… | |
… | |
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 | #ifdef EV_H |
|
|
35 | # include EV_H |
|
|
36 | #else |
34 | #include <ev.h> |
37 | # include <ev.h> |
|
|
38 | #endif |
35 | |
39 | |
36 | #ifdef __cplusplus |
40 | #ifdef __cplusplus |
37 | extern "C" { |
41 | extern "C" { |
38 | #endif |
42 | #endif |
|
|
43 | |
|
|
44 | struct event_base; |
39 | |
45 | |
40 | struct event |
46 | struct event |
41 | { |
47 | { |
42 | /* libev watchers we map onto */ |
48 | /* libev watchers we map onto */ |
43 | union { |
49 | union { |
… | |
… | |
102 | void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); |
108 | void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg); |
103 | int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
109 | int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
104 | |
110 | |
105 | int event_add (struct event *ev, struct timeval *tv); |
111 | int event_add (struct event *ev, struct timeval *tv); |
106 | int event_del (struct event *ev); |
112 | int event_del (struct event *ev); |
|
|
113 | void event_active (struct event *ev, int res, short ncalls); /* ncalls is being ignored */ |
107 | |
114 | |
108 | int event_pending (struct event *ev, short, struct timeval *tv); |
115 | int event_pending (struct event *ev, short, struct timeval *tv); |
109 | |
116 | |
110 | int event_priority_init (int npri); |
117 | int event_priority_init (int npri); |
111 | int event_priority_set (struct event *ev, int pri); |
118 | int event_priority_set (struct event *ev, int pri); |
112 | |
|
|
113 | struct event_base; |
|
|
114 | |
119 | |
115 | int event_base_set (struct event_base *base, struct event *ev); |
120 | int event_base_set (struct event_base *base, struct event *ev); |
116 | int event_base_loop (struct event_base *base, int); |
121 | int event_base_loop (struct event_base *base, int); |
117 | int event_base_loopexit (struct event_base *base, struct timeval *tv); |
122 | int event_base_loopexit (struct event_base *base, struct timeval *tv); |
118 | int event_base_dispatch (struct event_base *base); |
123 | int event_base_dispatch (struct event_base *base); |
119 | int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
124 | int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv); |
120 | int event_base_priority_init (struct event_base *base, int fd); |
125 | int event_base_priority_init (struct event_base *base, int fd); |
121 | |
126 | |
122 | #ifndef EV_STANDALONE |
127 | #ifndef EV_STANDALONE |
123 | # include "event_compat.h" |
128 | # include <event_compat.h> |
124 | #endif |
129 | #endif |
125 | |
130 | |
126 | #ifdef __cplusplus |
131 | #ifdef __cplusplus |
127 | } |
132 | } |
128 | #endif |
133 | #endif |