X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/e24bed5d59f88b90093005921b5338267ed65ea2..deff62d26ff4c1324816c04c0c6db1e4db435870:/ev.h?ds=sidebyside diff --git a/ev.h b/ev.h index b563c3f..08b5963 100644 --- a/ev.h +++ b/ev.h @@ -199,6 +199,20 @@ struct ev_child int rstatus; /* rw, holds the exit status, use the macros from sys/wait.h */ }; +union ev_any_watcher +{ + struct ev_watcher w; + struct ev_watcher_list wl; + struct ev_io io; + struct ev_timer timer; + struct ev_periodic periodic; + struct ev_signal signal; + struct ev_idle idle; + struct ev_child child; + struct ev_prepare prepare; + struct ev_check check; +}; + #define EVMETHOD_AUTO 0 /* consults environment */ #define EVMETHOD_SELECT 1 #define EVMETHOD_POLL 2 @@ -215,6 +229,20 @@ int ev_version_minor (void); ev_tstamp ev_time (void); +/* Sets the allocation function to use, works like realloc. + * It is used to allocate and free memory. + * If it returns zero when memory needs to be allocated, the library might abort + * or take some potentially destructive action. + * The default is your system realloc function. + */ +void ev_set_allocator (void *(*cb)(void *ptr, long size)); + +/* set the callback function to call on a + * retryable syscall error + * (such as failed select, poll, epoll_wait) + */ +void ev_set_syserr_cb (void (*cb)(void)); + # if EV_MULTIPLICITY /* the default loop is the only one that handles signals and child watchers */ /* you can call this as often as you like */