Initial import (again)
[srvx.git] / src / timeq.h
1 /* timeq.h - time-based event queue
2  * Copyright 2000-2002 srvx Development Team
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.  Important limitations are
8  * listed in the COPYING file that accompanies this software.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, email srvx-maintainers@srvx.net.
17  */
18
19 #ifndef TIMEQ_H
20 #define TIMEQ_H
21
22 typedef void (*timeq_func)(void *data);
23
24 #define TIMEQ_IGNORE_WHEN    0x01
25 #define TIMEQ_IGNORE_FUNC    0x02
26 #define TIMEQ_IGNORE_DATA    0x04
27
28 void timeq_init(void);
29 void timeq_add(time_t when, timeq_func func, void *data);
30 void timeq_del(time_t when, timeq_func func, void *data, int mask);
31 time_t timeq_next(void);
32 unsigned int timeq_size(void);
33 void timeq_run(void);
34
35 #endif /* ndef TIMEQ_H */