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