Wrap up version 1.3.3.
[minidlna.git] / event.h
blob6b30a21b74de060e5be3bdcc6c155a98af9998f2
1 #include "config.h"
3 #include <sys/types.h>
4 #ifdef HAVE_KQUEUE
5 #include <sys/event.h>
6 #endif
8 struct event;
10 typedef enum {
11 #ifdef HAVE_KQUEUE
12 EVENT_READ = EVFILT_READ,
13 EVENT_WRITE = EVFILT_WRITE,
14 EVENT_VNODE = EVFILT_VNODE,
15 #else
16 EVENT_READ,
17 EVENT_WRITE,
18 #endif
19 } event_t;
21 #define EV_FLAG_CLOSING 0x00000001
23 typedef void event_process_t(struct event *);
24 #ifdef HAVE_KQUEUE
25 typedef void event_vnode_process_t(struct event *, u_int);
26 #endif
28 struct event {
29 int fd;
30 int index;
31 event_t rdwr;
32 union {
33 event_process_t *process;
34 #ifdef HAVE_KQUEUE
35 event_vnode_process_t *process_vnode;
36 #endif
38 void *data;
41 typedef int event_module_add_t(struct event *);
42 typedef int event_module_del_t(struct event *, int flags);
43 typedef int event_module_init_t(void);
44 typedef void event_module_fini_t(void);
45 typedef int event_module_process_t(struct timeval *);
46 struct event_module {
47 event_module_add_t *add;
48 event_module_del_t *del;
49 event_module_process_t *process;
50 event_module_init_t *init;
51 event_module_fini_t *fini;
54 extern struct event_module event_module;