1 /* Public domain. */
2 
3 #ifndef TAI_H
4 #define TAI_H
5 
6 #include "uint64.h"
7 
8 struct tai {
9   uint64 x;
10 } ;
11 
12 #define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64) (u)))
13 
14 extern void tai_now(struct tai *);
15 
16 #define tai_approx(t) ((double) ((t)->x))
17 
18 extern void tai_add(struct tai *,const struct tai *,const struct tai *);
19 extern void tai_sub(struct tai *,const struct tai *,const struct tai *);
20 #define tai_less(t,u) ((t)->x < (u)->x)
21 
22 #define TAI_PACK 8
23 extern void tai_pack(char *,const struct tai *);
24 extern void tai_unpack(const char *,struct tai *);
25 
26 extern void tai_uint(struct tai *,unsigned int);
27 
28 #endif
29