X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/1b109e5d8b0948a2e7151b3820f1c4784cafeece..0c513fd963e79da73c7d77018523ac956a5066bd:/ev.h?ds=inline diff --git a/ev.h b/ev.h index d8f7ae1..66e9bd1 100644 --- a/ev.h +++ b/ev.h @@ -30,6 +30,10 @@ #ifndef EV_H #define EV_H +#ifdef __cplusplus +extern "C" { +#endif + typedef double ev_tstamp; /* eventmask, revents, events... */ @@ -163,19 +167,21 @@ struct ev_child int status; /* rw, holds the exit status, use the macros from sys/wait.h */ }; -#define EVMETHOD_NONE 0 +#define EVMETHOD_AUTO 0 /* consults environment */ #define EVMETHOD_SELECT 1 -#define EVMETHOD_EPOLL 2 +#define EVMETHOD_POLL 2 +#define EVMETHOD_EPOLL 4 +#define EVMETHOD_ANY ~0 /* any method, do not consult env */ #if EV_PROTOTYPES extern int ev_method; -int ev_init (int flags); /* returns ev_method */ +int ev_init (int methods); /* returns ev_method */ int ev_version_major (void); int ev_version_minor (void); /* these three calls are suitable for plugging into pthread_atfork */ -void ev_prefork (void); -void ev_postfork_parent (void); -void ev_postfork_child (void); +void ev_fork_prepare (void); +void ev_fork_parent (void); +void ev_fork_child (void); extern ev_tstamp ev_now; /* time w.r.t. timers and the eventloop, updated after each poll */ ev_tstamp ev_time (void); @@ -245,5 +251,9 @@ void ev_child_start (struct ev_child *w); void ev_child_stop (struct ev_child *w); #endif +#ifdef __cplusplus +} +#endif + #endif