1 |
/* |
2 |
* Copyright © 2005 atheme.org. |
3 |
* Rights to this code are as documented in doc/LICENSE. |
4 |
* |
5 |
* Event stuff. |
6 |
* |
7 |
* $Id: event.h 7271 2006-11-25 00:08:57Z jilles $ |
8 |
*/ |
9 |
|
10 |
#ifndef EVENT_H |
11 |
#define EVENT_H |
12 |
|
13 |
typedef void EVH (void *); |
14 |
|
15 |
/* event list struct */ |
16 |
struct ev_entry |
17 |
{ |
18 |
EVH *func; |
19 |
void *arg; |
20 |
const char *name; |
21 |
time_t frequency; |
22 |
time_t when; |
23 |
bool active; |
24 |
}; |
25 |
|
26 |
E struct ev_entry event_table[MAX_EVENTS]; |
27 |
E const char *last_event_ran; |
28 |
|
29 |
E unsigned int event_add (const char *name, EVH * func, void *arg, time_t when); |
30 |
E unsigned int event_add_once (const char *name, EVH * func, void *arg, time_t when); |
31 |
E void event_run (void); |
32 |
E time_t event_next_time (void); |
33 |
E void event_delete (EVH * func, void *arg); |
34 |
E unsigned int event_find (EVH * func, void *arg); |
35 |
|
36 |
#endif |