ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/event.h
Revision: 1.4
Committed: Sun Sep 16 18:54:42 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +9 -4 lines
Log Message:
#defines to enum

File Contents

# User Rev Content
1 pippijn 1.4 /**
2     * event.h: Event stuff.
3     *
4     * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
5     * Rights to this code are as documented in COPYING.
6     *
7     *
8     * Portions of this file were derived from sources bearing the following license:
9 pippijn 1.3 * Copyright © 2005 atheme.org.
10 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
11 pippijn 1.1 *
12 pippijn 1.4 * $Id: event.h,v 1.3 2007-08-28 17:08:06 pippijn Exp $
13 pippijn 1.1 */
14    
15     #ifndef EVENT_H
16     #define EVENT_H
17    
18     typedef void EVH (void *);
19    
20     /* event list struct */
21 pippijn 1.3 struct ev_entry : zero_initialised
22 pippijn 1.1 {
23     EVH *func;
24     void *arg;
25 pippijn 1.3 char const *name;
26 pippijn 1.1 time_t frequency;
27     time_t when;
28     bool active;
29     };
30    
31     E struct ev_entry event_table[MAX_EVENTS];
32 pippijn 1.3 E char const *last_event_ran;
33 pippijn 1.1
34 pippijn 1.3 E unsigned int event_add (char const * const name, EVH * func, void *arg, time_t when);
35     E unsigned int event_add_once (char const * const name, EVH * func, void *arg, time_t when);
36 pippijn 1.1 E void event_run (void);
37     E time_t event_next_time (void);
38     E void event_delete (EVH * func, void *arg);
39     E unsigned int event_find (EVH * func, void *arg);
40    
41     #endif