From 351aae58f2c73749a12e2b19cbb447614a2ee3ff Mon Sep 17 00:00:00 2001
From: Laurent Bercot
djbtime is a set of functions to convert
-tai_t and tain_t structures, and
+tai and tain structures, and
TAI time, from and to
other time formats and user-friendly representations.
-
-
-
-
-
-
- The following functions use the localtmn_t type to hold both
+ The following functions use the localtmn type to hold both
a broken-down time and a nanosecond count:
Data structures
-
@@ -52,7 +52,7 @@ field and an unsigned long nano field.
UTC
int utc_from_tai (uint64_t *u, tai_t const *t)
+ int utc_from_tai (uint64_t *u, tai const *t)
Converts the absolute TAI64 time in *t to an UTC time, stored in
*u as an unsigned 64-bit integer. *u is actually 2^62
plus the number of seconds since the Epoch.
@@ -62,7 +62,7 @@ returns 2 instead of 1.
int tai_from_utc (tai_t *t, uint64_t u)
+ int tai_from_utc (tai *t, uint64_t u)
Converts the UTC time in u, stored
as an unsigned 64-bit integer (2^62 plus the number of seconds since
the Epoch), to a TAI64 time in *t.
@@ -73,7 +73,7 @@ error occurs.
NTP
int ntp_from_tain (uint64_t *ntp, tain_t const *a)
+ int ntp_from_tain (uint64_t *ntp, tain const *a)
Converts the absolute TAI64N time in *a to a 64-bit NTP timestamp,
stored in *ntp. The higher 32 bits of *ntp represent a number
of seconds ; the lower 32 bits are the fractional part of the timestamp.
@@ -83,7 +83,7 @@ error occurs (for instance:
int tain_from_ntp (tain_t *a, uint64_t ntp)
+ int tain_from_ntp (tain *a, uint64_t ntp)
Converts the NTP timestamp in ntp to a TAI64N time in
*a.
The function returns 1 if it succeeds, or 0 (and sets errno) if an
@@ -101,7 +101,7 @@ timezone takes leap seconds into account or not.
int localtm_from_tai (struct tm *tm, tai_t const *t, int lo)
+ int localtm_from_tai (struct tm *tm, tai const *t, int lo)
Converts the TAI time in *t to broken-down GMT (if
lo is zero) or local (if lo is nonzero) time in
*tm.
@@ -141,7 +141,7 @@ error occurs.
int tai_from_localtm (tai_t *t, struct tm const *tm)
+ int tai_from_localtm (tai *t, struct tm const *tm)
Converts the broken-down local time in *tm to a TAI value
in *t.
The function returns 1 if it succeeds, or 0 (and sets errno) if an
@@ -157,11 +157,11 @@ error occurs.
typedef struct localtmn_s localtmn_t, *localtmn_t_ref ;
+
typedef struct localtmn_s localtmn, *localtmn_ref ;
struct localtmn_s
{
struct tm tm ;
@@ -174,10 +174,10 @@ struct localtmn_s
- int localtmn_from_tain (localtmn_t *tmn, tain_t const *a, int lo) ;
-int tain_from_localtmn (tain_t *a, localtmn_t const *tmn) ;
-int localtmn_from_sysclock (localtmn_t *tmn, tain_t const *a, int lo) ;
-int sysclock_from_localtmn (tain_t *a, localtmn_t const *tmn) ;
+ int localtmn_from_tain (localtmn *tmn, tain const *a, int lo) ;
+int tain_from_localtmn (tain *a, localtmn const *tmn) ;
+int localtmn_from_sysclock (localtmn *tmn, tain const *a, int lo) ;
+int sysclock_from_localtmn (tain *a, localtmn const *tmn) ;