-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathal_osctime.h
37 lines (31 loc) · 1.07 KB
/
al_osctime.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __AL_OSCTIME_H__
#define __AL_OSCTIME_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "al_region.h"
typedef struct _al_osctime_ntptime
{
uint32_t sec;
uint32_t frac_sec;
} al_osctime_ntptime;
typedef al_osctime_ntptime al_osctime;
#define AL_OSCTIME_SIZEOF_NTP 8
#define AL_OSCTIME_SIZEOF AL_OSCTIME_SIZEOF_NTP
#define AL_OSCTIME_NULL (al_osctime){0, 0}
#define AL_OSCTIME_IMMEDIATE (al_osctime){0, 1}
al_osctime al_osctime_add(al_region r, al_osctime t1, al_osctime t2);
al_osctime al_osctime_subtract(al_region r, al_osctime lhs, al_osctime rhs);
int al_osctime_compare(al_region r, al_osctime t1, al_osctime t2);
double al_osctime_toFloat(al_region r, al_osctime t);
al_osctime al_osctime_fromFloat(al_region r, double f);
char *al_osctime_toISO8601(al_region r, al_osctime t);
size_t _al_osctime_toISO8601(char *buf, size_t n, al_osctime t);
al_osctime al_osctime_fromISO8601(al_region r, char *s);
al_osctime al_osctime_ntoht(al_region r, char *buf);
void al_osctime_htont(al_region r, al_osctime t, char *buf);
#ifdef __cplusplus
}
#endif
#endif