41 #define UEV_MAX_EVENTS 10 45 #define UEV_ERROR EPOLLERR 46 #define UEV_READ EPOLLIN 47 #define UEV_WRITE EPOLLOUT 48 #define UEV_PRI EPOLLPRI 49 #define UEV_HUP EPOLLHUP 50 #define UEV_RDHUP EPOLLRDHUP 51 #define UEV_EDGE EPOLLET 52 #define UEV_ONESHOT EPOLLONESHOT 56 #define UEV_NONBLOCK 2 59 #define uev_io_active(w) _uev_watcher_active(w) 61 #define uev_signal_active(w) _uev_watcher_active(w) 63 #define uev_timer_active(w) _uev_watcher_active(w) 65 #define uev_cron_active(w) _uev_watcher_active(w) 67 #define uev_event_active(w) _uev_watcher_active(w) int uev_signal_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int signo)
Create a signal watcher.
Definition: signal.c:52
int uev_init(uev_ctx_t *ctx)
Create an event loop context.
Definition: uev.c:191
int uev_exit(uev_ctx_t *ctx)
Terminate the event loop.
Definition: uev.c:240
int uev_init1(uev_ctx_t *ctx, int maxevents)
Create an event loop context.
Definition: uev.c:218
Event watcher.
Definition: uev.h:73
int uev_event_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg)
Create a generic event watcher.
Definition: event.c:46
int uev_io_stop(uev_t *w)
Stop an I/O watcher.
Definition: io.c:93
int uev_cron_start(uev_t *w)
Start a stopped at/cron job watcher.
Definition: cron.c:145
int uev_cron_stop(uev_t *w)
Stop and unregister an at/cron job watcher.
Definition: cron.c:156
int uev_io_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int fd, int events)
Create an I/O watcher.
Definition: io.c:44
int uev_run(uev_ctx_t *ctx, int flags)
Start the event loop.
Definition: uev.c:299
int uev_signal_stop(uev_t *w)
Stop a signal watcher.
Definition: signal.c:147
struct uev uev_t
Event watcher.
int fd
active descriptor
Definition: uev.h:79
int uev_signal_set(uev_t *w, int signo)
Reset a signal watcher.
Definition: signal.c:88
int uev_cron_set(uev_t *w, time_t when, time_t interval)
Reset an at/cron job watcher.
Definition: cron.c:100
int uev_timer_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int timeout, int period)
Create and start a timer watcher.
Definition: timer.c:77
int uev_cron_init(uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, time_t when, time_t interval)
Create and start an at/cron job watcher.
Definition: cron.c:66
int uev_io_start(uev_t *w)
Start an I/O watcher.
Definition: io.c:82
int signo
configured signal
Definition: uev.h:78
int uev_io_set(uev_t *w, int fd, int events)
Reset an I/O watcher.
Definition: io.c:65
int uev_timer_start(uev_t *w)
Start a stopped timer watcher.
Definition: timer.c:160
int uev_timer_stop(uev_t *w)
Stop and unregister a timer watcher.
Definition: timer.c:179
struct signalfd_siginfo siginfo
received signal
Definition: uev.h:83
uev_ctx_t * ctx
watcher context
Definition: uev.h:80
int uev_event_post(uev_t *w)
Post a generic event.
Definition: event.c:70
int uev_event_stop(uev_t *w)
Stop a generic event watcher.
Definition: event.c:92
int uev_timer_set(uev_t *w, int timeout, int period)
Reset a timer.
Definition: timer.c:116
struct uev_ctx uev_ctx_t
Event loop context, need one per process and thread.
Definition: uev.h:70
int uev_signal_start(uev_t *w)
Start a stopped signal watcher.
Definition: signal.c:128
void() uev_cb_t(uev_t *w, void *arg, int events)
Generic callback for watchers, events holds UEV_READ and/or UEV_WRITE with optional UEV_PRI (priority...
Definition: uev.h:97