9 #ifndef TOR_COMPAT_LIBEVENT_H
10 #define TOR_COMPAT_LIBEVENT_H
21 #define tor_event_new event_new
22 #define tor_evtimer_new evtimer_new
23 #define tor_evsignal_new evsignal_new
24 #define tor_evdns_add_server_port(sock, tcp, cb, data) \
25 evdns_add_server_port_with_base(tor_libevent_get_base(), \
26 (sock),(tcp),(cb),(data));
32 void tor_event_free_(
struct event *ev);
33 #define tor_event_free(ev) \
34 FREE_AND_NULL(struct event, tor_event_free_, (ev))
45 #define periodic_timer_free(t) \
46 FREE_AND_NULL(periodic_timer_t, periodic_timer_free_, (t))
59 #define mainloop_event_free(event) \
60 FREE_AND_NULL(mainloop_event_t, mainloop_event_free_, (event))
76 void tor_check_libevent_header_compatibility(
void);
81 int tor_init_libevent_rng(
void);
84 void tor_libevent_postfork(
void);
92 #ifdef COMPAT_LIBEVENT_PRIVATE
100 #define V(major, minor, patch) \
101 (((major) << 24) | ((minor) << 16) | ((patch) << 8))
STATIC void libevent_logging_callback(int severity, const char *msg)
void tor_libevent_initialize(tor_libevent_cfg_t *cfg)
void suppress_libevent_log_msg(const char *msg)
bool tor_libevent_is_initialized(void)
struct event_base * tor_libevent_get_base(void)
void periodic_timer_free_(periodic_timer_t *)
const char * tor_libevent_get_version_str(void)
int mainloop_event_schedule(mainloop_event_t *event, const struct timeval *delay)
void periodic_timer_launch(periodic_timer_t *, const struct timeval *tv)
mainloop_event_t * mainloop_event_postloop_new(void(*cb)(mainloop_event_t *, void *), void *userdata)
void mainloop_event_cancel(mainloop_event_t *event)
const char * tor_libevent_get_method(void)
periodic_timer_t * periodic_timer_new(struct event_base *base, const struct timeval *tv, void(*cb)(periodic_timer_t *timer, void *data), void *data)
void tor_libevent_exit_loop_after_callback(struct event_base *base)
mainloop_event_t * mainloop_event_new(void(*cb)(mainloop_event_t *, void *), void *userdata)
void mainloop_event_free_(mainloop_event_t *event)
int tor_libevent_run_event_loop(struct event_base *base, int once)
const char * tor_libevent_get_header_version_str(void)
void tor_libevent_exit_loop_after_delay(struct event_base *base, const struct timeval *delay)
void tor_libevent_free_all(void)
void configure_libevent_logging(void)
void periodic_timer_disable(periodic_timer_t *)
void mainloop_event_activate(mainloop_event_t *event)
Headers for util_malloc.c.
void(* cb)(struct periodic_timer_t *, void *)
Macros to implement mocking and selective exposure for the test code.
#define MOCK_DECL(rv, funcname, arglist)