1*b9fc9a72Sderaadt /* $OpenBSD: worklist.h,v 1.4 2015/01/16 06:40:11 deraadt Exp $ */ 22dc36bedSjoris /* 32dc36bedSjoris * Copyright (c) 2006 Joris Vink <joris@openbsd.org> 42dc36bedSjoris * All rights reserved. 52dc36bedSjoris * 62dc36bedSjoris * Redistribution and use in source and binary forms, with or without 72dc36bedSjoris * modification, are permitted provided that the following conditions 82dc36bedSjoris * are met: 92dc36bedSjoris * 102dc36bedSjoris * 1. Redistributions of source code must retain the above copyright 112dc36bedSjoris * notice, this list of conditions and the following disclaimer. 122dc36bedSjoris * 2. The name of the author may not be used to endorse or promote products 132dc36bedSjoris * derived from this software without specific prior written permission. 142dc36bedSjoris * 152dc36bedSjoris * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 162dc36bedSjoris * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 172dc36bedSjoris * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 182dc36bedSjoris * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 192dc36bedSjoris * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 202dc36bedSjoris * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 212dc36bedSjoris * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 222dc36bedSjoris * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 232dc36bedSjoris * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 242dc36bedSjoris * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 252dc36bedSjoris */ 262dc36bedSjoris 272dc36bedSjoris #ifndef WORKLIST_H 282dc36bedSjoris #define WORKLIST_H 292dc36bedSjoris 30*b9fc9a72Sderaadt #include <sys/types.h> 31*b9fc9a72Sderaadt #include <limits.h> 324781e2faSxsa 337a9e6d11Sray struct worklist { 34*b9fc9a72Sderaadt char wkl_path[PATH_MAX]; 357a9e6d11Sray volatile SLIST_ENTRY(worklist) wkl_list; 362dc36bedSjoris }; 372dc36bedSjoris 387a9e6d11Sray SLIST_HEAD(wklhead, worklist); 392dc36bedSjoris 407a9e6d11Sray void worklist_add(const char *, struct wklhead *); 417a9e6d11Sray void worklist_run(struct wklhead *, void (*cb)(struct worklist *)); 427a9e6d11Sray void worklist_clean(struct wklhead *, void (*cb)(struct worklist *)); 432dc36bedSjoris 447a9e6d11Sray void worklist_unlink(struct worklist *); 452dc36bedSjoris 467a9e6d11Sray extern struct wklhead temp_files; 472dc36bedSjoris 482dc36bedSjoris #endif 49