Massive change to the server core to remove horrid code in
[freeradius.git] / src / include / event.h
1 #ifndef LRAD_EVENT_H
2 #define LRAD_EVENT_H
3
4 /*
5  * event.h      Simple event queue
6  *
7  * Version:     $Id$
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22  *
23  * Copyright 2007 The FreeRADIUS server project
24  * Copyright 2007 Alan DeKok <aland@deployingradius.com>
25  */
26
27 #include <freeradius-devel/ident.h>
28 RCSIDH(event_h, "$Id$")
29
30 typedef struct lrad_event_list_t lrad_event_list_t;
31 typedef void (*lrad_event_callback_t)(void *);
32
33 lrad_event_list_t *lrad_event_list_create(void);
34 void lrad_event_list_free(lrad_event_list_t *el);
35
36 int lrad_event_list_num_elements(lrad_event_list_t *el);
37
38 int lrad_event_insert(lrad_event_list_t *el, lrad_event_callback_t callback,
39                       void *ctx, struct timeval *when);
40 int lrad_event_delete(lrad_event_list_t *el, void *ctx);
41
42 int lrad_event_callback(lrad_event_list_t *el, void *ctx,
43                         lrad_event_callback_t *pcallback);
44 int lrad_event_when(lrad_event_list_t *el, void *ctx, struct timeval *when);
45
46 int lrad_event_run(lrad_event_list_t *el, struct timeval *when);
47
48 int lrad_event_now(lrad_event_list_t *el, struct timeval *when);
49
50 #endif /* LRAD_HASH_H */