--- libev/ev.h 2009/03/16 21:15:06 1.111 +++ libev/ev.h 2009/04/25 14:12:48 1.115 @@ -82,6 +82,10 @@ # define EV_ASYNC_ENABLE 1 #endif +#ifndef EV_WALK_ENABLE +# define EV_WALK_ENABLE 0 /* not yet */ +#endif + #ifndef EV_ATOMIC_T # include # define EV_ATOMIC_T sig_atomic_t volatile @@ -136,6 +140,7 @@ #define EV__IOFDSET 0x80 /* internal use only */ #define EV_IO EV_READ /* alias for type-detection */ #define EV_TIMEOUT 0x00000100 /* timer timed out */ +#define EV_TIMER EV_TIMEOUT /* alias for type-detection */ #define EV_PERIODIC 0x00000200 /* periodic timer timed out */ #define EV_SIGNAL 0x00000400 /* signal was received */ #define EV_CHILD 0x00000800 /* child/pid had status change */ @@ -146,6 +151,7 @@ #define EV_EMBED 0x00010000 /* embedded event loop needs sweep */ #define EV_FORK 0x00020000 /* event loop resumed in child */ #define EV_ASYNC 0x00040000 /* async intra-loop signal */ +#define EV_CUSTOM 0x01000000 /* for use by user code */ #define EV_ERROR 0x80000000 /* sent when an error occurs */ /* can be used to add custom fields to all watchers, while losing binary compatibility */ @@ -492,6 +498,13 @@ /* you can actually call it at any time, anywhere :) */ void ev_default_fork (void); +#if EV_WALK_ENABLE +/* walk (almost) all watchers in the loop of a given type, invoking the */ +/* callback on every such watcher. The callback might stop the watcher, */ +/* but do nothing else with the loop */ +void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); +#endif + unsigned int ev_backend (EV_P); /* backend in use by loop */ unsigned int ev_loop_count (EV_P); /* number of loop iterations */ #endif /* prototypes */ @@ -517,8 +530,16 @@ void ev_ref (EV_P); void ev_unref (EV_P); -/* convenience function, wait for a single event, without registering an event watcher */ -/* if timeout is < 0, do wait indefinitely */ +/* + * stop/start the timer handling. + */ +void ev_suspend (EV_P); +void ev_resume (EV_P); + +/* + * convenience function, wait for a single event, without registering an event watcher + * if timeout is < 0, do wait indefinitely + */ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg); #endif