1*b9fc9a72Sderaadt /* $OpenBSD: worklist.h,v 1.8 2015/01/16 06:40:07 deraadt Exp $ */ 2d2852796Sjoris /* 3d2852796Sjoris * Copyright (c) 2006 Joris Vink <joris@openbsd.org> 4d2852796Sjoris * All rights reserved. 5d2852796Sjoris * 6d2852796Sjoris * Redistribution and use in source and binary forms, with or without 7d2852796Sjoris * modification, are permitted provided that the following conditions 8d2852796Sjoris * are met: 9d2852796Sjoris * 10d2852796Sjoris * 1. Redistributions of source code must retain the above copyright 11d2852796Sjoris * notice, this list of conditions and the following disclaimer. 12d2852796Sjoris * 2. The name of the author may not be used to endorse or promote products 13d2852796Sjoris * derived from this software without specific prior written permission. 14d2852796Sjoris * 15d2852796Sjoris * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 16d2852796Sjoris * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 17d2852796Sjoris * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 18d2852796Sjoris * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19d2852796Sjoris * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20d2852796Sjoris * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21d2852796Sjoris * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22d2852796Sjoris * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23d2852796Sjoris * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24d2852796Sjoris * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25d2852796Sjoris */ 26d2852796Sjoris 27d2852796Sjoris #ifndef WORKLIST_H 28d2852796Sjoris #define WORKLIST_H 29d2852796Sjoris 30*b9fc9a72Sderaadt #include <sys/types.h> 31*b9fc9a72Sderaadt #include <limits.h> 321f8531bdSotto 337a9e6d11Sray struct worklist { 34*b9fc9a72Sderaadt char wkl_path[PATH_MAX]; 357a9e6d11Sray volatile SLIST_ENTRY(worklist) wkl_list; 36d2852796Sjoris }; 37d2852796Sjoris 387a9e6d11Sray SLIST_HEAD(wklhead, worklist); 39d2852796Sjoris 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 *)); 43d2852796Sjoris 447a9e6d11Sray void worklist_unlink(struct worklist *); 45d2852796Sjoris 46d2852796Sjoris #endif 47