]> granicus.if.org Git - libevent/commitdiff
Rename current_base symbol to event_global_current_base_
authorNick Mathewson <nickm@torproject.org>
Tue, 4 May 2010 17:27:36 +0000 (13:27 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 4 May 2010 17:27:36 +0000 (13:27 -0400)
The "current_base" symbol was never actually declared in an exported
header; it's hideously deprecated, and it was the one remaining
exported symbol (fwict) that was prefixed with neither ev nor
bufferevent nor _ev nor _bufferevent.

codesearch.google.com turns up no actual attempts to use our
current_base from outside libevent.

event.c
include/event2/event.h
include/event2/event_compat.h
test/regress.c

diff --git a/event.c b/event.c
index 6336e4e691196aa29bf34a69bac0b1a1aa40ba90..f7b69f52f72d61593806ffea6f189f2a28e0840a 100644 (file)
--- a/event.c
+++ b/event.c
@@ -117,10 +117,12 @@ static const struct eventop *eventops[] = {
 };
 
 /* Global state; deprecated */
-struct event_base *current_base = NULL;
+struct event_base *event_global_current_base_ = NULL;
+#define current_base event_global_current_base_
+extern struct event_base *evsig_base;
 
 /* Global state */
-extern struct event_base *evsig_base;
+
 static int use_monotonic;
 
 /* Prototypes */
index 116010e1d54fd88713bb2fd53ec84ac0ca69a1e5..ba9ce3d8dff9761e953e33355ae8bb24217d4903 100644 (file)
@@ -85,11 +85,9 @@ void event_debug_unassign(struct event *);
 /**
   Initialize the event API.
 
-  Use event_base_new() to initialize a new event base, but does not set
-  the current_base global.   If using only event_base_new(), each event
-  added must have an event base set with event_base_set()
+  Use event_base_new() to initialize a new event base.
 
-  @see event_base_set(), event_base_free(), event_init(),
+  @see event_base_set(), event_base_free(),
     event_base_new_with_config()
  */
 struct event_base *event_base_new(void);
index 03bf2eba2a654aeb7ac03ec1f6f76d7e8b62139e..f59850a0143821105e64e7f9efc0262457c8b601 100644 (file)
@@ -53,8 +53,8 @@ extern "C" {
   Initialize the event API.
 
   The event API needs to be initialized with event_init() before it can be
-  used.  Sets the current_base global representing the default base for
-  events that have no base associated with them.
+  used.  Sets the global current base that gets used for events that have no
+  base associated with them.
 
   @deprecated This function is deprecated because it replaces the "current"
     event_base, and is totally unsafe for multithreaded use.  The replacement
index 513c3c879925cb2ca50712679cc18dff6c48681b..532542a6ff5cbfd41f33c8e25a6fcd866040b84c 100644 (file)
@@ -713,6 +713,7 @@ end:
 #ifndef WIN32
 static void signal_cb(evutil_socket_t fd, short event, void *arg);
 
+#define current_base event_global_current_base_
 extern struct event_base *current_base;
 
 static void