6 typedef struct _ObTimer ObTimer;
8 /*! Data type of Timer callback */
9 typedef void (*ObTimeoutHandler)(void *data);
13 /*! Microseconds between timer firings */
15 /*! Callback for timer expiry */
16 ObTimeoutHandler action;
17 /*! Data sent to callback */
19 /*! We overload the delete operator to just set this to true */
21 /*! The time the last fire should've been at */
23 /*! When this timer will next trigger */
27 /*! Initializes the timer subsection */
29 /*! Destroys the timer subsection */
30 void timer_shutdown();
32 /* Creates a new timer with a given delay */
33 ObTimer *timer_start(long delay, ObTimeoutHandler cb, void *data);
34 /* Stops and frees a timer */
35 void timer_stop(ObTimer *self);
37 /*! Dispatch all pending timers. Sets wait to the amount of time to wait for
38 the next timer, or NULL if there are no timers to wait for */
39 void timer_dispatch(GTimeVal **wait);