1 #ifndef EL__MAIN_TIMER_H 2 #define EL__MAIN_TIMER_H 3 4 #include "util/time.h" 5 6 /* Only available internally. */ 7 struct timer; 8 9 /* Little hack, timer_id_T is in fact a pointer to the timer, so 10 * it has to be of a pointer type. 11 * The fact each timer is allocated ensure us that timer id will 12 * be unique. 13 * That way there is no need of id field in struct timer. --Zas */ 14 typedef struct timer * timer_id_T; 15 16 /* Should always be NULL or you'll have to modify install_timer() 17 * and kill_timer(). --Zas */ 18 #define TIMER_ID_UNDEF ((timer_id_T) NULL) 19 20 int get_timers_count(); 21 void check_timers(timeval_T *last_time); 22 void install_timer(timer_id_T *id, milliseconds_T delay, void (*)(void *), void *); 23 void kill_timer(timer_id_T *id); 24 int get_next_timer_time(timeval_T *t); 25 26 #endif 27