X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ftimer.h;h=549490c574be3fb221a3ab41726699d96735024f;hb=85112c4d0831067251de1295fbb6974db94af2ba;hp=e50ffa8cf02f8db5a32b3d2ab5a4b642d1ca391b;hpb=20ba24b7415609cbd57927c44f079bab3c911839;p=chaz%2Fopenbox diff --git a/openbox/timer.h b/openbox/timer.h index e50ffa8c..549490c5 100644 --- a/openbox/timer.h +++ b/openbox/timer.h @@ -3,14 +3,17 @@ #include +typedef struct _ObTimer ObTimer; + /*! Data type of Timer callback */ -typedef void (*TimeoutHandler)(void *data); +typedef void (*ObTimeoutHandler)(void *data); -typedef struct Timer { +struct _ObTimer +{ /*! Microseconds between timer firings */ long delay; /*! Callback for timer expiry */ - TimeoutHandler action; + ObTimeoutHandler action; /*! Data sent to callback */ void *data; /*! We overload the delete operator to just set this to true */ @@ -19,7 +22,7 @@ typedef struct Timer { GTimeVal last; /*! When this timer will next trigger */ GTimeVal timeout; -} Timer; +}; /*! Initializes the timer subsection */ void timer_startup(); @@ -27,9 +30,9 @@ void timer_startup(); void timer_shutdown(); /* Creates a new timer with a given delay */ -Timer *timer_start(long delay, TimeoutHandler cb, void *data); +ObTimer *timer_start(long delay, ObTimeoutHandler cb, void *data); /* Stops and frees a timer */ -void timer_stop(Timer *self); +void timer_stop(ObTimer *self); /*! Dispatch all pending timers. Sets wait to the amount of time to wait for the next timer, or NULL if there are no timers to wait for */