]> granicus.if.org Git - libevent/commitdiff
New event_get_priority() function to return an event's priority
authorNick Mathewson <nickm@torproject.org>
Tue, 8 May 2012 21:46:46 +0000 (17:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 9 May 2012 16:06:00 +0000 (12:06 -0400)
event.c
include/event2/event.h

diff --git a/event.c b/event.c
index 28fa8d0efb8dad1ef2f8f8436243fd69a5e06639..3bc16babf1372e998016a6bbd886d2842f74f415 100644 (file)
--- a/event.c
+++ b/event.c
@@ -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)
 {
index f1331f62112a6ad855d1f2903c1661c03e937a94..1cfc3ce92126b0b89f128c8307b5d7b9746fa3b5 100644 (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);