]> granicus.if.org Git - libevent/commitdiff
event_get_version() and event_get_method() from
authorNiels Provos <provos@gmail.com>
Fri, 25 Feb 2005 05:28:57 +0000 (05:28 +0000)
committerNiels Provos <provos@gmail.com>
Fri, 25 Feb 2005 05:28:57 +0000 (05:28 +0000)
Nick Mathewson <nickm@freehaven.net>

svn:r133

event.c
event.h

diff --git a/event.c b/event.c
index 2df71c886025bb80ee489846eea1a6809074c2b5..0c94ea0252eac3b6673b69a55e9e97ad3f483ac3 100644 (file)
--- a/event.c
+++ b/event.c
@@ -798,3 +798,22 @@ event_queue_insert(struct event_base *base, struct event *ev, int queue)
                errx(1, "%s: unknown queue %x", __func__, queue);
        }
 }
+
+/* Functions for debugging */
+
+const char *
+event_get_version(void)
+{
+       return (VERSION);
+}
+
+/* 
+ * No thread-safe interface needed - the information should be the same
+ * for all threads.
+ */
+
+const char *
+event_get_method(void)
+{
+       return (current_base->evsel->name);
+}
diff --git a/event.h b/event.h
index eb6b6663ea838eec057bcb4c5b080dae85f00c44..5f39d24709ee2b64b9952c2fd635c39885cd01c8 100644 (file)
--- a/event.h
+++ b/event.h
@@ -172,6 +172,10 @@ int event_pending(struct event *, short, struct timeval *);
 #define event_initialized(ev)          ((ev)->ev_flags & EVLIST_INIT)
 #endif
 
+/* Some simple debugging functions */
+const char *event_get_version(void);
+const char *event_get_method(void);
+
 /* These functions deal with event priorities */
 
 int    event_priority_init(int);