… | |
… | |
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 | |
… | |
… | |
492 | /* if you create alternative loops you have to call ev_loop_fork on them */ |
496 | /* 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 */ |
497 | /* you can call it in either the parent or the child */ |
494 | /* you can actually call it at any time, anywhere :) */ |
498 | /* you can actually call it at any time, anywhere :) */ |
495 | void ev_default_fork (void); |
499 | void ev_default_fork (void); |
496 | |
500 | |
497 | #if 0 |
501 | #if EV_WALK_ENABLE |
498 | /* walk (almost) all watchers in the loop of a given type, invoking the */ |
502 | /* 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, */ |
503 | /* callback on every such watcher. The callback might stop the watcher, */ |
500 | /* but do nothing else with the loop */ |
504 | /* but do nothing else with the loop */ |
501 | void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); |
505 | void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); |
502 | #endif |
506 | #endif |
… | |
… | |
524 | * should not keep ev_loop from running, unref() after starting, and ref() before stopping. |
528 | * should not keep ev_loop from running, unref() after starting, and ref() before stopping. |
525 | */ |
529 | */ |
526 | void ev_ref (EV_P); |
530 | void ev_ref (EV_P); |
527 | void ev_unref (EV_P); |
531 | void ev_unref (EV_P); |
528 | |
532 | |
|
|
533 | /* |
|
|
534 | * stop/start the timer handling. |
|
|
535 | */ |
|
|
536 | void ev_suspend (EV_P); |
|
|
537 | void ev_resume (EV_P); |
|
|
538 | |
|
|
539 | /* |
529 | /* convenience function, wait for a single event, without registering an event watcher */ |
540 | * convenience function, wait for a single event, without registering an event watcher |
530 | /* if timeout is < 0, do wait indefinitely */ |
541 | * if timeout is < 0, do wait indefinitely |
|
|
542 | */ |
531 | void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg); |
543 | void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg); |
532 | #endif |
544 | #endif |
533 | |
545 | |
534 | /* these may evaluate ev multiple times, and the other arguments at most once */ |
546 | /* these may evaluate ev multiple times, and the other arguments at most once */ |
535 | /* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */ |
547 | /* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */ |