libevent
2.2.1
Event notification library
|
Go to the documentation of this file.
24 #ifndef EVENT2_WATCH_H_INCLUDED_
25 #define EVENT2_WATCH_H_INCLUDED_
43 #include <event2/visibility.h>
47 struct evwatch_prepare_cb_info;
48 struct evwatch_check_cb_info;
59 typedef void (*
evwatch_prepare_cb)(
struct evwatch *,
const struct evwatch_prepare_cb_info *,
void *);
69 typedef void (*
evwatch_check_cb)(
struct evwatch *,
const struct evwatch_check_cb_info *,
void *);
EVENT2_EXPORT_SYMBOL struct event_base * evwatch_base(struct evwatch *watcher)
Get the event_base that a given evwatch is registered with.
void(* evwatch_prepare_cb)(struct evwatch *, const struct evwatch_prepare_cb_info *, void *)
Prepare callback, invoked by event_base_loop immediately before polling for I/O.
Definition: watch.h:59
void(* evwatch_check_cb)(struct evwatch *, const struct evwatch_check_cb_info *, void *)
Check callback, invoked by event_base_loop immediately after polling for I/O and before processing an...
Definition: watch.h:69
Structure to hold information and state for a Libevent dispatch loop.
Definition: event.h:219
EVENT2_EXPORT_SYMBOL int evwatch_prepare_get_timeout(const struct evwatch_prepare_cb_info *info, struct timeval *timeout)
Get the timeout (the expected polling duration) passed to the underlying implementation's dispatch.
EVENT2_EXPORT_SYMBOL struct evwatch * evwatch_check_new(struct event_base *base, evwatch_check_cb callback, void *arg)
Register a new "check" watcher, to be called in the event loop after polling for events and before ha...
EVENT2_EXPORT_SYMBOL struct evwatch * evwatch_prepare_new(struct event_base *base, evwatch_prepare_cb callback, void *arg)
Register a new "prepare" watcher, to be called in the event loop prior to polling for events.
EVENT2_EXPORT_SYMBOL void evwatch_free(struct evwatch *watcher)
Deregister and deallocate a watcher.