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