… | |
… | |
239 | #define EVMETHOD_SELECT 0x00000001 /* about anywhere */ |
239 | #define EVMETHOD_SELECT 0x00000001 /* about anywhere */ |
240 | #define EVMETHOD_POLL 0x00000002 /* !win */ |
240 | #define EVMETHOD_POLL 0x00000002 /* !win */ |
241 | #define EVMETHOD_EPOLL 0x00000004 /* linux */ |
241 | #define EVMETHOD_EPOLL 0x00000004 /* linux */ |
242 | #define EVMETHOD_KQUEUE 0x00000008 /* bsd */ |
242 | #define EVMETHOD_KQUEUE 0x00000008 /* bsd */ |
243 | #define EVMETHOD_DEVPOLL 0x00000010 /* solaris 8 */ /* NYI */ |
243 | #define EVMETHOD_DEVPOLL 0x00000010 /* solaris 8 */ /* NYI */ |
244 | #define EVMETHOD_PORT 0x00000020 /* solaris 10 */ /* NYI */ |
244 | #define EVMETHOD_PORT 0x00000020 /* solaris 10 */ |
245 | |
245 | |
246 | /* flag bits */ |
246 | /* flag bits */ |
247 | #define EVFLAG_NOENV 0x01000000 /* do NOT consult environment */ |
247 | #define EVFLAG_NOENV 0x01000000 /* do NOT consult environment */ |
248 | |
248 | |
249 | #if EV_PROTOTYPES |
249 | #if EV_PROTOTYPES |
… | |
… | |
267 | void ev_set_syserr_cb (void (*cb)(const char *msg)); |
267 | void ev_set_syserr_cb (void (*cb)(const char *msg)); |
268 | |
268 | |
269 | # if EV_MULTIPLICITY |
269 | # if EV_MULTIPLICITY |
270 | /* the default loop is the only one that handles signals and child watchers */ |
270 | /* the default loop is the only one that handles signals and child watchers */ |
271 | /* you can call this as often as you like */ |
271 | /* you can call this as often as you like */ |
272 | struct ev_loop *ev_default_loop (unsigned int flags); /* returns default loop */ |
272 | static struct ev_loop * |
|
|
273 | ev_default_loop (unsigned int flags) |
|
|
274 | { |
|
|
275 | extern struct ev_loop *ev_default_loop_ptr; |
|
|
276 | extern struct ev_loop *ev_default_loop_ (unsigned int flags); |
|
|
277 | |
|
|
278 | if (!ev_default_loop_ptr) |
|
|
279 | ev_default_loop_init (flags); |
|
|
280 | |
|
|
281 | return ev_default_loop_ptr; |
|
|
282 | } |
273 | |
283 | |
274 | /* create and destroy alternative loops that don't handle signals */ |
284 | /* create and destroy alternative loops that don't handle signals */ |
275 | struct ev_loop *ev_loop_new (unsigned int flags); |
285 | struct ev_loop *ev_loop_new (unsigned int flags); |
276 | void ev_loop_destroy (EV_P); |
286 | void ev_loop_destroy (EV_P); |
277 | void ev_loop_fork (EV_P); |
287 | void ev_loop_fork (EV_P); |
… | |
… | |
301 | unsigned int ev_method (EV_P); |
311 | unsigned int ev_method (EV_P); |
302 | #endif |
312 | #endif |
303 | |
313 | |
304 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
314 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
305 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
315 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
306 | #define EVUNLOOP_ONCE 1 /* unloop once */ |
316 | #define EVUNLOOP_ONE 1 /* unloop once */ |
307 | #define EVUNLOOP_ALL 2 /* unloop all loops */ |
317 | #define EVUNLOOP_ALL 2 /* unloop all loops */ |
308 | |
318 | |
309 | #if EV_PROTOTYPES |
319 | #if EV_PROTOTYPES |
310 | void ev_loop (EV_P_ int flags); |
320 | void ev_loop (EV_P_ int flags); |
311 | void ev_unloop (EV_P_ int how); /* set to 1 to break out of event loop, set to 2 to break out of all event loops */ |
321 | void ev_unloop (EV_P_ int how); /* set to 1 to break out of event loop, set to 2 to break out of all event loops */ |