Objective Systems, Inc.  

ooTimer.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2009 by Objective Systems, Inc.
00003  *
00004  * This software is furnished under an open source license and may be
00005  * used and copied only in accordance with the terms of this license.
00006  * The text of the license may generally be found in the root
00007  * directory of this installation in the LICENSE.txt file.  It
00008  * can also be viewed online at the following URL:
00009  *
00010  *   http://www.obj-sys.com/open/license.html
00011  *
00012  * Any redistributions of this file including modified versions must
00013  * maintain this copyright notice.
00014  *
00015  *****************************************************************************/
00020 #ifndef _OOTIMER_H_
00021 #define _OOTIMER_H_
00022 
00023 #include "ooasn1.h"
00024 #include "ooSocket.h"   /* needed for timeval */
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    /* Callback functions */
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

This file was last modified on 28 May 2010.
Objective Open H.323 Stack, 0.9.1