X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Futil%2Ftimer.h;h=df06fc3453ce7e3b879d2e16debd795bf71786c2;hb=367bf8f76227dea6e7e10e974967ae1d60cfe38e;hp=23aea08d53b32406de5d6320f84bd70d90a495c1;hpb=35e206acc0a7b9dca7611fe4a7e17c7acc381ad0;p=chaz%2Ftint2 diff --git a/src/util/timer.h b/src/util/timer.h index 23aea08..df06fc3 100644 --- a/src/util/timer.h +++ b/src/util/timer.h @@ -22,13 +22,15 @@ #include extern GSList* timeout_list; -extern struct timespec next_timeout; +extern struct timeval next_timeout; struct timeout { int interval_msec; struct timespec timeout_expires; - void (*_callback)(); + void (*_callback)(void*); + void* arg; + void* multi_timeout; }; @@ -36,9 +38,9 @@ struct timeout { /** installs a timeout with the first timeout of 'value_msec' and then a periodic timeout with * 'interval_msec'. '_callback' is the callback function when the timer reaches the timeout. * returns a pointer to the timeout, which is needed for stopping it again **/ -const struct timeout* add_timeout(int value_msec, int interval_msec, void (*_callback)()); +const struct timeout* add_timeout(int value_msec, int interval_msec, void (*_callback)(void*), void* arg); -void change_timeout(const struct timeout* t, int value_msec, int interval_msec, void (*_callback)()); +void change_timeout(const struct timeout* t, int value_msec, int interval_msec, void (*_callback)(void*), void* arg); /** stops the timeout 't' **/ void stop_timeout(const struct timeout* t);