aboutsummaryrefslogtreecommitdiff
path: root/src/or/periodic.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-10-03 10:44:45 -0400
committerNick Mathewson <nickm@torproject.org>2018-04-05 12:35:11 -0400
commit871ff0006d052967534fb6ce31465b55021888f0 (patch)
treef3a489068b883fd059dee3e86f20d2a3c45682e0 /src/or/periodic.h
parentf9e32a20843cca221f5d61688000a87fb2babaf8 (diff)
downloadtor-871ff0006d052967534fb6ce31465b55021888f0.tar.gz
tor-871ff0006d052967534fb6ce31465b55021888f0.zip
Add an API for a scheduled/manually activated event in the mainloop
Using this API lets us remove event2/event.h usage from half a dozen modules, to better isolate libevent. Implements part of ticket 23750.
Diffstat (limited to 'src/or/periodic.h')
-rw-r--r--src/or/periodic.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/periodic.h b/src/or/periodic.h
index 8baf3994eb..285400b8bb 100644
--- a/src/or/periodic.h
+++ b/src/or/periodic.h
@@ -14,13 +14,14 @@
typedef int (*periodic_event_helper_t)(time_t now,
const or_options_t *options);
-struct event;
+struct mainloop_event_t;
/** A single item for the periodic-events-function table. */
typedef struct periodic_event_item_t {
periodic_event_helper_t fn; /**< The function to run the event */
time_t last_action_time; /**< The last time the function did something */
- struct event *ev; /**< Libevent callback we're using to implement this */
+ struct mainloop_event_t *ev; /**< Libevent callback we're using to implement
+ * this */
const char *name; /**< Name of the function -- for debug */
} periodic_event_item_t;