… | |
… | |
42 | struct ev_io io; |
42 | struct ev_io io; |
43 | struct ev_timer to; |
43 | struct ev_timer to; |
44 | struct ev_signal sig; |
44 | struct ev_signal sig; |
45 | |
45 | |
46 | struct event_base *ev_base; |
46 | struct event_base *ev_base; |
47 | int ev_fd; |
|
|
48 | short ev_events; |
|
|
49 | int ev_pri; |
|
|
50 | void (*ev_callback)(int, short, void *arg); |
47 | void (*ev_callback)(int, short, void *arg); |
51 | void *ev_arg; |
48 | void *ev_arg; |
|
|
49 | int ev_fd; |
|
|
50 | int ev_pri; |
52 | int ev_res; |
51 | int ev_res; |
|
|
52 | short ev_events; |
53 | }; |
53 | }; |
54 | |
54 | |
55 | #define EV_PERSIST 0x10 |
55 | #define EV_PERSIST 0x10 |
56 | |
56 | |
57 | #define EVENT_SIGNAL(ev) ((int) (ev)->ev_fd) |
57 | #define EVENT_SIGNAL(ev) ((int) (ev)->ev_fd) |
… | |
… | |
98 | void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); |
98 | void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); |
99 | int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
99 | int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
100 | |
100 | |
101 | int event_add (struct event *ev, struct timeval *tv); |
101 | int event_add (struct event *ev, struct timeval *tv); |
102 | int event_del (struct event *ev); |
102 | int event_del (struct event *ev); |
103 | void event_active (struct event *ev, int fd, short events); |
|
|
104 | |
103 | |
105 | int event_pending (struct event *ev, short, struct timeval *tv); |
104 | int event_pending (struct event *ev, short, struct timeval *tv); |
106 | |
105 | |
107 | int event_priority_init (int npri); |
106 | int event_priority_init (int npri); |
108 | int event_priority_set (struct event *ev, int pri); |
107 | int event_priority_set (struct event *ev, int pri); |