… | |
… | |
52 | void *ev_arg; |
52 | void *ev_arg; |
53 | int ev_fd; |
53 | int ev_fd; |
54 | int ev_pri; |
54 | int ev_pri; |
55 | int ev_res; |
55 | int ev_res; |
56 | short ev_events; |
56 | short ev_events; |
57 | |
|
|
58 | char initialised; /* flag to work around some idiosynchrasies in the API */ |
|
|
59 | }; |
57 | }; |
60 | |
58 | |
61 | #define EV_PERSIST 0x10 |
59 | #define EV_PERSIST 0x10 |
62 | |
60 | |
63 | #define EVENT_SIGNAL(ev) ((int) (ev)->ev_fd) |
61 | #define EVENT_SIGNAL(ev) ((int) (ev)->ev_fd) |
64 | #define EVENT_FD(ev) ((int) (ev)->ev_fd) |
62 | #define EVENT_FD(ev) ((int) (ev)->ev_fd) |
65 | |
63 | |
66 | #define event_initialized(ev) ((ev)->initialised) |
64 | #define event_initialized(ev) 1 |
67 | |
65 | |
68 | #define evtimer_add(ev,tv) event_add (ev, tv) |
66 | #define evtimer_add(ev,tv) event_add (ev, tv) |
69 | #define evtimer_set(ev,cb,data) event_set (ev, -1, 0, cb, data) |
67 | #define evtimer_set(ev,cb,data) event_set (ev, -1, 0, cb, data) |
70 | #define evtimer_del(ev) event_del (ev) |
68 | #define evtimer_del(ev) event_del (ev) |
71 | #define evtimer_pending(ev,tv) event_pending (ev, EV_TIMEOUT, tv) |
69 | #define evtimer_pending(ev,tv) event_pending (ev, EV_TIMEOUT, tv) |
… | |
… | |
104 | void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); |
102 | void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); |
105 | int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
103 | int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
106 | |
104 | |
107 | int event_add (struct event *ev, struct timeval *tv); |
105 | int event_add (struct event *ev, struct timeval *tv); |
108 | int event_del (struct event *ev); |
106 | int event_del (struct event *ev); |
|
|
107 | void event_active(struct event *ev, int res, short ncalls); /* ncalls is being ignored */ |
109 | |
108 | |
110 | int event_pending (struct event *ev, short, struct timeval *tv); |
109 | int event_pending (struct event *ev, short, struct timeval *tv); |
111 | |
110 | |
112 | int event_priority_init (int npri); |
111 | int event_priority_init (int npri); |
113 | int event_priority_set (struct event *ev, int pri); |
112 | int event_priority_set (struct event *ev, int pri); |