… | |
… | |
80 | |
80 | |
81 | #ifndef EV_ASYNC_ENABLE |
81 | #ifndef EV_ASYNC_ENABLE |
82 | # define EV_ASYNC_ENABLE 1 |
82 | # define EV_ASYNC_ENABLE 1 |
83 | #endif |
83 | #endif |
84 | |
84 | |
|
|
85 | #ifndef EV_WALK_ENABLE |
|
|
86 | # define EV_WALK_ENABLE 0 /* not yet */ |
|
|
87 | #endif |
|
|
88 | |
85 | #ifndef EV_ATOMIC_T |
89 | #ifndef EV_ATOMIC_T |
86 | # include <signal.h> |
90 | # include <signal.h> |
87 | # define EV_ATOMIC_T sig_atomic_t volatile |
91 | # define EV_ATOMIC_T sig_atomic_t volatile |
88 | #endif |
92 | #endif |
89 | |
93 | |
… | |
… | |
455 | |
459 | |
456 | /* create and destroy alternative loops that don't handle signals */ |
460 | /* create and destroy alternative loops that don't handle signals */ |
457 | struct ev_loop *ev_loop_new (unsigned int flags); |
461 | struct ev_loop *ev_loop_new (unsigned int flags); |
458 | void ev_loop_destroy (EV_P); |
462 | void ev_loop_destroy (EV_P); |
459 | void ev_loop_fork (EV_P); |
463 | void ev_loop_fork (EV_P); |
460 | void ev_loop_verify (EV_P); |
|
|
461 | |
464 | |
462 | ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ |
465 | ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ |
463 | void ev_now_update (EV_P); |
466 | void ev_now_update (EV_P); |
464 | |
467 | |
465 | #else |
468 | #else |
… | |
… | |
492 | /* if you create alternative loops you have to call ev_loop_fork on them */ |
495 | /* if you create alternative loops you have to call ev_loop_fork on them */ |
493 | /* you can call it in either the parent or the child */ |
496 | /* you can call it in either the parent or the child */ |
494 | /* you can actually call it at any time, anywhere :) */ |
497 | /* you can actually call it at any time, anywhere :) */ |
495 | void ev_default_fork (void); |
498 | void ev_default_fork (void); |
496 | |
499 | |
497 | #if 0 |
500 | unsigned int ev_backend (EV_P); /* backend in use by loop */ |
|
|
501 | unsigned int ev_loop_count (EV_P); /* number of loop iterations */ |
|
|
502 | unsigned int ev_loop_depth (EV_P); /* #ev_loop enters - #ev_loop leaves */ |
|
|
503 | void ev_loop_verify (EV_P); /* abort if loop data corrupted */ |
|
|
504 | |
|
|
505 | #if EV_WALK_ENABLE |
498 | /* walk (almost) all watchers in the loop of a given type, invoking the */ |
506 | /* walk (almost) all watchers in the loop of a given type, invoking the */ |
499 | /* callback on every such watcher. The callback might stop the watcher, */ |
507 | /* callback on every such watcher. The callback might stop the watcher, */ |
500 | /* but do nothing else with the loop */ |
508 | /* but do nothing else with the loop */ |
501 | void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); |
509 | void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); |
502 | #endif |
510 | #endif |
503 | |
511 | |
504 | unsigned int ev_backend (EV_P); /* backend in use by loop */ |
|
|
505 | unsigned int ev_loop_count (EV_P); /* number of loop iterations */ |
|
|
506 | #endif /* prototypes */ |
512 | #endif /* prototypes */ |
507 | |
513 | |
508 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
514 | #define EVLOOP_NONBLOCK 1 /* do not block/wait */ |
509 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
515 | #define EVLOOP_ONESHOT 2 /* block *once* only */ |
510 | #define EVUNLOOP_CANCEL 0 /* undo unloop */ |
516 | #define EVUNLOOP_CANCEL 0 /* undo unloop */ |