--- libev/ev.h 2009/07/14 19:11:31 1.121 +++ libev/ev.h 2009/10/20 00:50:31 1.128 @@ -37,8 +37,8 @@ * either the BSD or the GPL. */ -#ifndef EV_H__ -#define EV_H__ +#ifndef EV_H_ +#define EV_H_ #ifdef __cplusplus extern "C" { @@ -163,7 +163,7 @@ #endif #define EV_VERSION_MAJOR 3 -#define EV_VERSION_MINOR 7 +#define EV_VERSION_MINOR 8 #ifndef EV_CB_DECLARE # define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents); @@ -365,7 +365,7 @@ EV_ATOMIC_T sent; /* private */ } ev_async; -# define ev_async_pending(w) ((w)->sent + 0) +# define ev_async_pending(w) (+(w)->sent) #endif /* the presence of this union forces similar struct layout */ @@ -404,6 +404,9 @@ /* flag bits */ #define EVFLAG_NOENV 0x01000000U /* do NOT consult environment */ #define EVFLAG_FORKCHECK 0x02000000U /* check for a fork in each iteration */ +/* debugging/feature disable */ +#define EVFLAG_NOINOTIFY 0x00100000U /* do not attempt to use inotify */ +#define EVFLAG_NOSIGFD 0x00200000U /* do not attempt to use signalfd */ /* method bits to be ored together */ #define EVBACKEND_SELECT 0x00000001U /* about anywhere */ #define EVBACKEND_POLL 0x00000002U /* !win */ @@ -411,6 +414,7 @@ #define EVBACKEND_KQUEUE 0x00000008U /* bsd */ #define EVBACKEND_DEVPOLL 0x00000010U /* solaris 8 */ /* NYI */ #define EVBACKEND_PORT 0x00000020U /* solaris 10 */ +#define EVBACKEND_ALL 0x0000003FU #if EV_PROTOTYPES int ev_version_major (void); @@ -553,6 +557,7 @@ void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)); void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P)); +unsigned int ev_pending_count (EV_P); /* number of pending events, if any */ void ev_invoke_pending (EV_P); /* invoke all pending watchers */ /* @@ -608,11 +613,11 @@ # define ev_priority(ev) ((ev), EV_MINPRI) # define ev_set_priority(ev,pri) ((ev), (pri)) #else -# define ev_priority(ev) ((((ev_watcher *)(void *)(ev))->priority) + 0) +# define ev_priority(ev) (+(((ev_watcher *)(void *)(ev))->priority)) # define ev_set_priority(ev,pri) ( (ev_watcher *)(void *)(ev))->priority = (pri) #endif -#define ev_periodic_at(ev) (((ev_watcher_time *)(ev))->at + 0.) +#define ev_periodic_at(ev) (+((ev_watcher_time *)(ev))->at) #ifndef ev_set_cb # define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_) @@ -637,6 +642,8 @@ void ev_timer_stop (EV_P_ ev_timer *w); /* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */ void ev_timer_again (EV_P_ ev_timer *w); +/* return remaining time */ +ev_tstamp ev_timer_remaining (EV_P_ ev_timer *w); #if EV_PERIODIC_ENABLE void ev_periodic_start (EV_P_ ev_periodic *w);