timers.h 618 B

12345678910111213141516171819202122
  1. /* Copyright (c) 2016, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. #ifndef TOR_TIMERS_H
  4. #define TOR_TIMERS_H
  5. #include "orconfig.h"
  6. #include "testsupport.h"
  7. typedef struct timeout tor_timer_t;
  8. typedef void (*timer_cb_fn_t)(tor_timer_t *, void *, const struct timeval *);
  9. tor_timer_t *timer_new(timer_cb_fn_t cb, void *arg);
  10. void timer_set_cb(tor_timer_t *t, timer_cb_fn_t cb, void *arg);
  11. void timer_schedule(tor_timer_t *t, const struct timeval *delay);
  12. void timer_disable(tor_timer_t *t);
  13. void timer_free(tor_timer_t *t);
  14. void timers_initialize(void);
  15. void timers_shutdown(void);
  16. #endif