revert breaks some stupid old compilers
[oscam.git] / oscam-time.h
blob6feb62fe39e16ad54212ed00a1feeb04651c61ba
1 #ifndef OSCAM_TIME_H_
2 #define OSCAM_TIME_H_
4 enum clock_type {
5 CLOCK_TYPE_UNKNOWN,
6 CLOCK_TYPE_REALTIME,
7 CLOCK_TYPE_MONOTONIC,
8 };
10 int64_t comp_timeb(struct timeb *tpa, struct timeb *tpb);
11 int64_t comp_timebus(struct timeb *tpa, struct timeb *tpb);
12 time_t cs_timegm(struct tm *tm);
13 struct tm *cs_gmtime_r(const time_t *timep, struct tm *r);
14 char *cs_ctime_r(const time_t *timep, char *buf);
15 void cs_ftime(struct timeb *tp);
16 void cs_ftimeus(struct timeb *tp);
17 void cs_sleepms(uint32_t msec);
18 void cs_sleepus(uint32_t usec);
20 void add_ms_to_timespec(struct timespec *timeout, int32_t msec);
21 void add_ms_to_timeb(struct timeb *tb, int32_t ms);
22 int64_t add_ms_to_timeb_diff(struct timeb *tb, int32_t ms);
24 time_t cs_walltime(struct timeb *tp);
25 time_t cs_time(void);
27 static inline bool cs_valid_time(struct timeb *tp) { return tp->time != 0; }
29 void cs_gettime(struct timespec *ts);
31 enum clock_type cs_getclocktype(void);
34 void __cs_pthread_cond_init(const char *n, pthread_cond_t *cond);
35 void cs_pthread_cond_init(const char *n, pthread_mutex_t *mutex, pthread_cond_t *cond);
37 void __cs_pthread_cond_init_nolog(const char *n, pthread_cond_t *cond);
38 void cs_pthread_cond_init_nolog(const char *n, pthread_mutex_t *mutex, pthread_cond_t *cond);
40 void sleepms_on_cond(const char *n, pthread_mutex_t *mutex, pthread_cond_t *cond, uint32_t msec);
42 #endif