New event_get_priority() function to return an event's priority

This commit is contained in:
Nick Mathewson 2012-05-08 17:46:46 -04:00
parent a4079aa88a
commit f90e25593c
2 changed files with 14 additions and 1 deletions

View File

@ -2072,6 +2072,13 @@ event_get_callback_arg(const struct event *ev)
return ev->ev_arg;
}
int
event_get_priority(const struct event *ev)
{
event_debug_assert_is_setup_(ev);
return ev->ev_pri;
}
int
event_add(struct event *ev, const struct timeval *tv)
{

View File

@ -1124,6 +1124,12 @@ event_callback_fn event_get_callback(const struct event *ev);
*/
void *event_get_callback_arg(const struct event *ev);
/**
Return the priority of an event.
@see event_priority_init(), event_get_priority()
*/
int event_get_priority(const struct event *ev);
/**
Extract _all_ of arguments given to construct a given event. The
event_base is copied into *base_out, the fd is copied into *fd_out, and so
@ -1226,7 +1232,7 @@ int event_base_get_npriorities(struct event_base *eb);
@param ev an event struct
@param priority the new priority to be assigned
@return 0 if successful, or -1 if an error occurred
@see event_priority_init()
@see event_priority_init(), event_get_priority()
*/
int event_priority_set(struct event *, int);