… | |
… | |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | */ |
30 | */ |
31 | #ifndef _EVENT_H_ |
31 | #ifndef _EVENT_H_ |
32 | #define _EVENT_H_ |
32 | #define _EVENT_H_ |
33 | |
33 | |
|
|
34 | #include "ev.h" |
|
|
35 | |
34 | #ifdef __cplusplus |
36 | #ifdef __cplusplus |
35 | extern "C" { |
37 | extern "C" { |
36 | #endif |
38 | #endif |
37 | |
39 | |
38 | #include "ev.h" |
40 | struct event |
|
|
41 | { |
|
|
42 | /* libev watchers we map onto */ |
|
|
43 | union { |
|
|
44 | struct ev_io io; |
|
|
45 | struct ev_signal sig; |
|
|
46 | } iosig; |
|
|
47 | struct ev_timer to; |
39 | |
48 | |
40 | struct event |
49 | /* compatibility slots */ |
41 | { |
|
|
42 | struct ev_io io; |
|
|
43 | struct ev_timer to; |
|
|
44 | struct ev_signal sig; |
|
|
45 | |
|
|
46 | struct event_base *ev_base; |
50 | struct event_base *ev_base; |
47 | void (*ev_callback)(int, short, void *arg); |
51 | void (*ev_callback)(int, short, void *arg); |
48 | void *ev_arg; |
52 | void *ev_arg; |
49 | int ev_fd; |
53 | int ev_fd; |
50 | int ev_pri; |
54 | int ev_pri; |
… | |
… | |
113 | int event_base_loopexit (struct event_base *base, struct timeval *tv); |
117 | int event_base_loopexit (struct event_base *base, struct timeval *tv); |
114 | int event_base_dispatch (struct event_base *base); |
118 | int event_base_dispatch (struct event_base *base); |
115 | int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
119 | int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
116 | int event_base_priority_init (struct event_base *base, int fd); |
120 | int event_base_priority_init (struct event_base *base, int fd); |
117 | |
121 | |
|
|
122 | #ifndef EV_STANDALONE |
|
|
123 | # include "event_compat.h" |
118 | #endif |
124 | #endif |
|
|
125 | |
|
|
126 | #ifdef __cplusplus |
|
|
127 | } |
|
|
128 | #endif |
|
|
129 | |
|
|
130 | #endif |
|
|
131 | |