--- libev/ev.h 2019/12/22 15:05:31 1.199 +++ libev/ev.h 2019/12/24 13:52:58 1.200 @@ -392,14 +392,12 @@ } ev_stat; #endif -#if EV_IDLE_ENABLE /* invoked when the nothing else needs to be done, keeps the process from blocking */ /* revent EV_IDLE */ typedef struct ev_idle { EV_WATCHER (ev_idle) } ev_idle; -#endif /* invoked for each run of the mainloop, just before the blocking call */ /* you can still change events in any way you like */ @@ -416,23 +414,19 @@ EV_WATCHER (ev_check) } ev_check; -#if EV_FORK_ENABLE /* the callback gets invoked before check in the child process when a fork was detected */ /* revent EV_FORK */ typedef struct ev_fork { EV_WATCHER (ev_fork) } ev_fork; -#endif -#if EV_CLEANUP_ENABLE /* is invoked just before the loop gets destroyed */ /* revent EV_CLEANUP */ typedef struct ev_cleanup { EV_WATCHER (ev_cleanup) } ev_cleanup; -#endif #if EV_EMBED_ENABLE /* used to embed an event loop inside another */ @@ -442,16 +436,18 @@ EV_WATCHER (ev_embed) struct ev_loop *other; /* ro */ +#undef EV_IO_ENABLE +#define EV_IO_ENABLE 1 ev_io io; /* private */ +#undef EV_PREPARE_ENABLE +#define EV_PREPARE_ENABLE 1 ev_prepare prepare; /* private */ ev_check check; /* unused */ ev_timer timer; /* unused */ ev_periodic periodic; /* unused */ ev_idle idle; /* unused */ ev_fork fork; /* private */ -#if EV_CLEANUP_ENABLE ev_cleanup cleanup; /* unused */ -#endif } ev_embed; #endif @@ -660,6 +656,8 @@ */ EV_API_DECL void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_NOEXCEPT; +EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */ + # if EV_FEATURE_API EV_API_DECL unsigned int ev_iteration (EV_P) EV_NOEXCEPT; /* number of loop iterations */ EV_API_DECL unsigned int ev_depth (EV_P) EV_NOEXCEPT; /* #ev_loop enters - #ev_loop leaves */ @@ -677,7 +675,6 @@ EV_API_DECL void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_NOEXCEPT, void (*acquire)(EV_P) EV_NOEXCEPT) EV_NOEXCEPT; EV_API_DECL unsigned int ev_pending_count (EV_P) EV_NOEXCEPT; /* number of pending events, if any */ -EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */ /* * stop/start the timer handling.