libevent
2.2.1
Event notification library
|
Go to the documentation of this file.
27 #ifndef EVENT2_EVENT_COMPAT_H_INCLUDED_
28 #define EVENT2_EVENT_COMPAT_H_INCLUDED_
44 #include <event2/visibility.h>
50 #include <event2/event-config.h>
51 #ifdef EVENT__HAVE_SYS_TYPES_H
52 #include <sys/types.h>
54 #ifdef EVENT__HAVE_SYS_TIME_H
148 void (*)(
evutil_socket_t,
short,
void *),
void *,
const struct timeval *);
186 #define evtimer_set(ev, cb, arg) event_set((ev), -1, 0, (cb), (arg))
187 #define evsignal_set(ev, x, cb, arg) \
188 event_set((ev), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
198 #define timeout_add(ev, tv) event_add((ev), (tv))
199 #define timeout_set(ev, cb, arg) event_set((ev), -1, 0, (cb), (arg))
200 #define timeout_del(ev) event_del(ev)
201 #define timeout_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv))
202 #define timeout_initialized(ev) event_initialized(ev)
212 #define signal_add(ev, tv) event_add((ev), (tv))
213 #define signal_set(ev, x, cb, arg) \
214 event_set((ev), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
215 #define signal_del(ev) event_del(ev)
216 #define signal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv))
217 #define signal_initialized(ev) event_initialized(ev)
222 #define EVENT_FD(ev) ((int)event_get_fd(ev))
223 #define EVENT_SIGNAL(ev) event_get_signal(ev)
EVENT2_EXPORT_SYMBOL int event_dispatch(void)
Loop to process events.
EVENT2_EXPORT_SYMBOL int event_loopbreak(void)
Abort the active event_loop() immediately.
Structure to hold information and state for a Libevent dispatch loop.
Definition: event.h:219
EVENT2_EXPORT_SYMBOL int event_priority_init(int)
Set the number of different event priorities.
Structure to represent a single event.
Definition: event.h:276
EVENT2_EXPORT_SYMBOL int event_loop(int)
Handle events.
EVENT2_EXPORT_SYMBOL int event_once(evutil_socket_t, short, void(*)(evutil_socket_t, short, void *), void *, const struct timeval *)
Schedule a one-time event to occur.
EVENT2_EXPORT_SYMBOL struct event_base * event_init(void)
Initialize the event API.
const EVENT2_EXPORT_SYMBOL char * event_get_method(void)
Get the kernel event notification mechanism used by Libevent.
EVENT2_EXPORT_SYMBOL int event_loopexit(const struct timeval *)
Exit the event loop after the specified time.
EVENT2_EXPORT_SYMBOL void event_set(struct event *, evutil_socket_t, short, void(*)(evutil_socket_t, short, void *), void *)
Prepare an event structure to be added.
Common convenience functions for cross-platform portability and related socket manipulations.
#define evutil_socket_t
A type wide enough to hold the output of "socket()" or "accept()".
Definition: util.h:325