… | |
… | |
229 | struct ev_check check; |
229 | struct ev_check check; |
230 | struct ev_signal signal; |
230 | struct ev_signal signal; |
231 | struct ev_child child; |
231 | struct ev_child child; |
232 | }; |
232 | }; |
233 | |
233 | |
234 | #define EVMETHOD_AUTO 0 /* consults environment */ |
234 | /* bits for ev_default_loop and ev_loop_new */ |
235 | #define EVMETHOD_SELECT 1 |
235 | /* the default */ |
236 | #define EVMETHOD_POLL 2 |
236 | #define EVFLAG_AUTO 0x00000000 /* not quite a mask */ |
237 | #define EVMETHOD_EPOLL 4 |
237 | |
238 | #define EVMETHOD_KQUEUE 8 |
238 | /* method bits to be ored together */ |
239 | #define EVMETHOD_DEVPOLL 16 /* NYI */ |
239 | #define EVMETHOD_SELECT 0x00000001 /* about anywhere */ |
240 | #define EVMETHOD_PORT 32 /* NYI */ |
240 | #define EVMETHOD_POLL 0x00000002 /* !win */ |
241 | #define EVMETHOD_WIN32 64 /* NYI */ |
241 | #define EVMETHOD_EPOLL 0x00000004 /* linux */ |
242 | #define EVMETHOD_ANY ~0 /* any method, do not consult env */ |
242 | #define EVMETHOD_KQUEUE 0x00000008 /* bsd */ |
|
|
243 | #define EVMETHOD_DEVPOLL 0x00000010 /* solaris 8 */ /* NYI */ |
|
|
244 | #define EVMETHOD_PORT 0x00000020 /* solaris 10 */ /* NYI */ |
|
|
245 | |
|
|
246 | /* flag bits */ |
|
|
247 | #define EVFLAG_NOENV 0x01000000 /* do NOT consult environment */ |
243 | |
248 | |
244 | #if EV_PROTOTYPES |
249 | #if EV_PROTOTYPES |
245 | int ev_version_major (void); |
250 | int ev_version_major (void); |
246 | int ev_version_minor (void); |
251 | int ev_version_minor (void); |
247 | |
252 | |
… | |
… | |
262 | void ev_set_syserr_cb (void (*cb)(const char *msg)); |
267 | void ev_set_syserr_cb (void (*cb)(const char *msg)); |
263 | |
268 | |
264 | # if EV_MULTIPLICITY |
269 | # if EV_MULTIPLICITY |
265 | /* 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 */ |
266 | /* you can call this as often as you like */ |
271 | /* you can call this as often as you like */ |
267 | struct ev_loop *ev_default_loop (int methods); /* returns default loop */ |
272 | struct ev_loop *ev_default_loop (unsigned int flags); /* returns default loop */ |
268 | |
273 | |
269 | /* create and destroy alternative loops that don't handle signals */ |
274 | /* create and destroy alternative loops that don't handle signals */ |
270 | struct ev_loop *ev_loop_new (int methods); |
275 | struct ev_loop *ev_loop_new (unsigned int flags); |
271 | void ev_loop_destroy (EV_P); |
276 | void ev_loop_destroy (EV_P); |
272 | void ev_loop_fork (EV_P); |
277 | void ev_loop_fork (EV_P); |
273 | |
278 | |
274 | ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ |
279 | ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ |
275 | |
280 | |
276 | # else |
281 | # else |
277 | |
282 | |
278 | int ev_default_loop (int methods); /* returns true when successful */ |
283 | int ev_default_loop (unsigned int flags); /* returns true when successful */ |
279 | |
284 | |
280 | static ev_tstamp |
285 | static ev_tstamp |
281 | ev_now (void) |
286 | ev_now (void) |
282 | { |
287 | { |
283 | extern ev_tstamp ev_rt_now; |
288 | extern ev_tstamp ev_rt_now; |
… | |
… | |
291 | /* if you create alternative loops you have to call ev_loop_fork on them */ |
296 | /* if you create alternative loops you have to call ev_loop_fork on them */ |
292 | /* you can call it in either the parent or the child */ |
297 | /* you can call it in either the parent or the child */ |
293 | /* you can actually call it at any time, anywhere :) */ |
298 | /* you can actually call it at any time, anywhere :) */ |
294 | void ev_default_fork (void); |
299 | void ev_default_fork (void); |
295 | |
300 | |
296 | int ev_method (EV_P); |
301 | unsigned int ev_method (EV_P); |
297 | #endif |
302 | #endif |
298 | |
303 | |
299 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
304 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
300 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
305 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
301 | #define EVUNLOOP_ONCE 1 /* unloop once */ |
306 | #define EVUNLOOP_ONCE 1 /* unloop once */ |