00001 00056 #ifndef __TIMERCDP_H 00057 #define __TIMERCDP_H 00058 00059 #include "worker.h" 00060 00062 typedef void (*callback_f)(time_t now,void *ptr); 00063 00065 typedef struct _timer_cb_t{ 00066 time_t expires; 00067 int one_time; 00068 int interval; 00069 callback_f cb; 00070 void **ptr; 00072 struct _timer_cb_t *next; 00073 struct _timer_cb_t *prev; 00074 } timer_cb_t; 00075 00077 typedef struct { 00078 timer_cb_t *head; 00079 timer_cb_t *tail; 00080 } timer_cb_list_t; 00081 00082 int add_timer(int expires_in,int one_time,callback_f cb,void *ptr); 00083 00084 void timer_cdp_init(); 00085 00086 void timer_cdp_destroy(); 00087 00088 00089 void timer_process(int returns); 00090 00091 00092 00093 #endif 00094
1.5.2