00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _OSIP_TIME_H_
00021 #define _OSIP_TIME_H_
00022
00023 #ifdef __cplusplus
00024 extern "C"
00025 {
00026 #endif
00027
00028
00029
00030 #if defined(_WIN32_WCE)
00031 struct _timeb {
00032 time_t time;
00033 unsigned short millitm;
00034 short timezone;
00035 short dstflag;
00036 };
00037
00038 #endif
00039
00040
00041 struct timeval;
00042
00043
00044 void add_gettimeofday (struct timeval *atv, int ms);
00045 void min_timercmp (struct timeval *tv1, struct timeval *tv2);
00046
00047
00048 #if defined(WIN32) || defined(_WIN32_WCE) || defined (__VXWORKS_OS__) || defined(__arc__)
00049
00050 #define osip_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
00051 # define osip_timercmp(a, b, CMP) \
00052 (((a)->tv_sec == (b)->tv_sec) ? \
00053 ((a)->tv_usec CMP (b)->tv_usec) : \
00054 ((a)->tv_sec CMP (b)->tv_sec))
00055 #define osip_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
00056
00057
00058 #if defined(__arc__)
00059 #define osip_gettimeofday gettimeofday
00060 #else
00061 int osip_gettimeofday (struct timeval *tp, void *tz);
00062 #endif
00063
00064 #else
00065
00066 #define osip_timerisset(tvp) timerisset(tvp)
00067 #define osip_timercmp(tvp, uvp, cmp) timercmp(tvp,uvp,cmp)
00068 #define osip_timerclear(tvp) timerclear(tvp)
00069
00070
00071 #define osip_gettimeofday gettimeofday
00072
00073 #endif
00074
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078
00079 #endif