From 3b15402fd4055cb5bd66cd9ac1106ceecff9f760 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 11 Feb 1999 22:18:36 +0000 Subject: Grrr, forgot to commit the event routines themselves :| --- lib/event.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/event.h (limited to 'lib/event.h') diff --git a/lib/event.h b/lib/event.h new file mode 100644 index 00000000..0b1ea842 --- /dev/null +++ b/lib/event.h @@ -0,0 +1,33 @@ +/* + * BIRD Library -- Event Processing + * + * (c) 1999 Martin Mares + * + * Can be freely distributed and used under the terms of the GNU GPL. + */ + +#ifndef _BIRD_EVENT_H_ +#define _BIRD_EVENT_H_ + +#include "lib/resource.h" + +typedef struct event { + resource r; + void (*hook)(void *); + void *data; + node n; /* Internal link */ +} event; + +typedef list event_list; + +extern event_list global_event_list; + +event *ev_new(pool *); +void ev_run(event *); +#define ev_init_list(el) init_list(el) +void ev_enqueue(event_list *, event *); +void ev_schedule(event *); +void ev_postpone(event *); +void ev_run_list(event_list *); + +#endif -- cgit v1.2.3