00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00020 #ifndef _OOTIMER_H_
00021 #define _OOTIMER_H_
00022
00023 #include "ooasn1.h"
00024 #include "ooSocket.h"
00025
00026 struct _OOTimer;
00027
00028 typedef int (*OOTimerCbFunc)(void *data);
00029
00030 typedef struct _OOTimer {
00031 struct timeval expireTime, timeout;
00032 void* cbData;
00033 OOBOOL reRegister;
00034
00035
00036 OOTimerCbFunc timeoutCB;
00037 } OOTimer;
00038
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042
00049 EXTERN void ooTimerComputeExpireTime (OOTimer* pTimer);
00050
00062 EXTERN OOTimer* ooTimerCreate
00063 (OOCTXT* pctxt, DList *pList, OOTimerCbFunc cb, OOUINT32 deltaSecs, void *data,
00064 OOBOOL reRegister);
00065
00072 EXTERN void ooTimerDelete (OOCTXT* pctxt, DList* pList, OOTimer* pTimer);
00073
00080 EXTERN OOBOOL ooTimerExpired (OOTimer* pTimer);
00081
00086 EXTERN void ooTimerFireExpired (OOCTXT* pctxt, DList* pList);
00087
00096 EXTERN int ooTimerInsertEntry (OOCTXT* pctxt, DList* pList, OOTimer* pTimer);
00097
00105 EXTERN struct timeval* ooTimerNextTimeout (DList* pList, struct timeval* ptimeout);
00106
00114 EXTERN void ooTimerReset (OOCTXT* pctxt, DList* pList, OOTimer* pTimer);
00115
00116
00124 int ooCompareTimeouts(struct timeval *to1, struct timeval *to2);
00125 #ifdef __cplusplus
00126 }
00127 #endif
00128 #endif