/* timer.h */ /* EMACS_MODES: c !fill */ /* This file contains the declarations for the timer management package. */ typedef unsigned nonce; /* a timeout nonce */ typedef struct timer { /* a timer */ struct q_elt tm_elt; /* next element in queue */ time_t tm_time; /* time the timer expires */ nonce tm_nonce; /* nonce for this timer */ int (*tm_subr) (); /* subroutine to call on timeout */ caddr_t tm_arg; /* arg to pass to subr */ } timer; typedef struct time_q { /* the queue of active timers */ timer *tmq_head; /* head of the timer queue */ timer *tmq_tail; /* tail of the timer queue */ int tmq_len; /* number of elements in queue */ } time_q; typedef struct timerid { /* a timer identifier */ timer *ti_ptr; /* pointer to the timer */ nonce ti_nonce; /* the timer's nonce */ } timerid; #define TRUE 1 #define FALSE 0