]> jfr.im git - irc/rqf/shadowircd.git/blob - libcharybdis/event.h
[svn] - update config files
[irc/rqf/shadowircd.git] / libcharybdis / event.h
1 /*
2 * ircd-ratbox: A slightly useful ircd.
3 * event.h: The ircd event header.
4 *
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2004 ircd-ratbox development team
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 *
24 * $Id: event.h 380 2005-12-07 15:08:37Z nenolod $
25 */
26
27 #ifndef INCLUDED_event_h
28 #define INCLUDED_event_h
29
30 /*
31 * How many event entries we need to allocate at a time in the block
32 * allocator. 16 should be plenty at a time.
33 */
34 #define MAX_EVENTS 50
35
36
37 typedef void EVH(void *);
38
39 /* The list of event processes */
40 struct ev_entry
41 {
42 EVH *func;
43 void *arg;
44 const char *name;
45 time_t frequency;
46 time_t when;
47 int active;
48 };
49
50 extern void eventAdd(const char *name, EVH * func, void *arg, time_t when);
51 extern void eventAddOnce(const char *name, EVH * func, void *arg, time_t when);
52 extern void eventAddIsh(const char *name, EVH * func, void *arg, time_t delta_ish);
53 extern void eventRun(void);
54 extern time_t eventNextTime(void);
55 extern void eventInit(void);
56 extern void eventDelete(EVH * func, void *);
57 extern int eventFind(EVH * func, void *);
58 extern void set_back_events(time_t);
59
60 void eventUpdate(const char *name, time_t freq);
61
62 extern void show_events(struct Client *source_p);
63
64 #endif /* INCLUDED_event_h */