diff --git a/ChangeLog b/ChangeLog index 172df22f..fdceb498 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ Changes in 2.0.2-alpha: o Try harder to compile with Visual C++. o Move event_set() and its allies to event2/event_compat.h where they belong. o Remove the event_gotsig code, which has long been deprecated and unused. + o Add an event_get_base() function to return the base assigned to an event. Changes in 2.0.1-alpha: diff --git a/event.c b/event.c index 70abe342..23aba066 100644 --- a/event.c +++ b/event.c @@ -1095,6 +1095,12 @@ event_get_fd(struct event *ev) return ev->ev_fd; } +struct event_base * +event_get_base(struct event *ev) +{ + return ev->ev_base; +} + int event_add(struct event *ev, const struct timeval *tv) { diff --git a/include/event2/event.h b/include/event2/event.h index dc802ef7..bb7a7704 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -503,6 +503,11 @@ int _event_initialized(struct event *, int check_fd); */ evutil_socket_t event_get_fd(struct event *ev); +/** + Get the event_base assigned to an event. +*/ +struct event_base *event_get_base(struct event *ev); + #ifndef EVENT_FD /* We haven't included event_struct.h, so define these as function calls * rather than as direct struct access. If we include event_struct.h later,