diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-04-13 11:11:35 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-09 14:04:06 -0400 |
commit | dcf948da0652ca13f5b44f0e15e062f1ff3f8993 (patch) | |
tree | e41e14ab06fb6209189a6965e28adbb034697ba1 /src/common/timers.h | |
parent | c77cf8825a33d902c5827f0b4f0a71cec97a3a85 (diff) | |
download | tor-dcf948da0652ca13f5b44f0e15e062f1ff3f8993.tar.gz tor-dcf948da0652ca13f5b44f0e15e062f1ff3f8993.zip |
Add wrappers to tie the new timeouts into libevent.
Diffstat (limited to 'src/common/timers.h')
-rw-r--r-- | src/common/timers.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common/timers.h b/src/common/timers.h new file mode 100644 index 0000000000..594cf38a64 --- /dev/null +++ b/src/common/timers.h @@ -0,0 +1,22 @@ +/* Copyright (c) 2016, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +#ifndef TOR_TIMERS_H +#define TOR_TIMERS_H + +#include "orconfig.h" +#include "testsupport.h" + +typedef struct timeout tor_timer_t; +typedef void (*timer_cb_fn_t)(tor_timer_t *, void *, const struct timeval *); +tor_timer_t *timer_new(timer_cb_fn_t cb, void *arg); +void timer_set_cb(tor_timer_t *t, timer_cb_fn_t cb, void *arg); +void timer_schedule(tor_timer_t *t, const struct timeval *delay); +void timer_disable(tor_timer_t *t); +void timer_free(tor_timer_t *t); + +void timers_initialize(void); +void timers_shutdown(void); + +#endif + |