path: root/taia.h
diff options
authorFelix von Leitner <>2003-09-05 21:09:14 +0000
committerFelix von Leitner <>2003-09-05 21:09:14 +0000
commit4c41a8819474d9db9de69c99f2c981e6a9891227 (patch)
treeb3a5c968b81173e081b5189fc932cd858c483476 /taia.h
parent4ab0bb3627ed7c491895761f89f23f66b4f6b147 (diff)
add long long buffer routines
add tai64 and tai6464 typedefs add error message buffer routines add io timeout routines
Diffstat (limited to 'taia.h')
1 files changed, 15 insertions, 15 deletions
diff --git a/taia.h b/taia.h
index fc0e98d..3c14a0b 100644
--- a/taia.h
+++ b/taia.h
@@ -9,37 +9,37 @@
* exclusive. The number is a multiple of 10^-18. The format of struct
* taia is designed to speed up common operations; applications should
* not look inside struct taia. */
-struct taia {
+typedef struct taia {
struct tai sec;
unsigned long nano; /* 0...999999999 */
unsigned long atto; /* 0...999999999 */
+} tai6464;
/* extract seconds */
-extern void taia_tai(const struct taia *source,struct tai *dest);
+void taia_tai(const tai6464 *source,tai64 *dest);
/* get current time */
-extern void taia_now(struct taia *);
+void taia_now(struct taia *);
/* return double-precision approximation; always nonnegative */
-extern double taia_approx(const struct taia *);
+double taia_approx(const tai6464 *);
/* return double-precision approximation of the fraction part;
* always nonnegative */
-extern double taia_frac(const struct taia *);
+double taia_frac(const tai6464 *);
/* add source1 to source2 modulo 2^64 and put the result in dest.
* The inputs and output may overlap */
-extern void taia_add(struct taia *dest,const struct taia *source1,const struct taia *source2);
+void taia_add(tai6464 *dest,const tai6464 *source1,const tai6464 *source2);
/* add secs seconds to source modulo 2^64 and put the result in dest. */
-extern void taia_addsec(struct taia *dest,const struct taia *source,int secs);
+void taia_addsec(tai6464 *dest,const tai6464 *source,long secs);
/* subtract source2 from source1 modulo 2^64 and put the result in dest.
* The inputs and output may overlap */
-extern void taia_sub(struct taia *,const struct taia *,const struct taia *);
+void taia_sub(tai6464 *,const tai6464 *,const tai6464 *);
/* divide source by 2, rouding down to a multiple of 10^-18, and put the
* result into dest. The input and output may overlap */
-extern void taia_half(struct taia *dest,const struct taia *source);
+void taia_half(tai6464 *dest,const tai6464 *source);
/* return 1 if a is less than b, 0 otherwise */
-extern int taia_less(const struct taia *a,const struct taia *b);
+int taia_less(const tai6464 *a,const tai6464 *b);
#define TAIA_PACK 16
/* char buf[TAIA_PACK] can be used to store a TAI64NA label in external
@@ -49,10 +49,10 @@ extern int taia_less(const struct taia *a,const struct taia *b);
/* convert a TAI64NA label from internal format in src to external
* TAI64NA format in buf. */
-extern void taia_pack(char *buf,const struct taia *src);
+void taia_pack(char *buf,const tai6464 *src);
/* convert a TAI64NA label from external TAI64NA format in buf to
* internal format in dest. */
-extern void taia_unpack(const char *buf,struct taia *dest);
+void taia_unpack(const char *buf,tai6464 *dest);
#define TAIA_FMTFRAC 19
/* print the 18-digit fraction part of t in decimal, without a decimal
@@ -60,9 +60,9 @@ extern void taia_unpack(const char *buf,struct taia *dest);
* terminating \0. It returns 18, the number of characters written. s
* may be zero; then taia_fmtfrac returns 18 without printing anything.
* */
-extern unsigned int taia_fmtfrac(char *s,const struct taia *t);
+unsigned int taia_fmtfrac(char *s,const tai6464 *t);
/* initialize t to secs seconds. */
-extern void taia_uint(struct taia *t,unsigned int secs);
+void taia_uint(tai6464 *t,unsigned int secs);