I made a complete pass on the tai* conversion subsystem.
It should now be, unfortunately, less efficient, because
there are a lot of nested function calls for very little
real code - but it is a lot cleaner and more logical.
I figured that since most machines have a leap second
table lookup in the fast path anyway, one or two more function
calls wouldn't hurt that much.
You can now:
* convert between time_t and tai_t without checking or
changing the format:
- for absolute times: time_from_tai, tai_from_time
- for relative times: time_from_tai_relative, tai_relative_from_tai
* convert between struct timeval and tain_t:
- for absolute times: timeval_from_tain, tain_from_timeval
- for relative times: timeval_from_tain_relative, tain_relative_from_timeval
* same thing with struct timespec
And the new things:
* convert between a real system clock time_t stamp and a
real TAI64 tai_tstamp: time_sysclock_from_tai, tai_from_time_sysclock
* convert between a real system clock struct timeval stamp and a
real TAI64N tain_t stamp: timeval_sysclock_from_tain, tain_from_timeval_sysclock
* same thing with struct timespec
* There are function names looking a lot like those ones, but
without the _from_. They are unrelated, although doing similar things;
the name proximity is unfortunate and confusing. Always check for the
_from_ if you need a conversion function.
* Conversions between tai_t and struct time(val|spec) removed, they
didn't fit the nice new logical model.
* Documentation updated.
Available in the latest skalibs git snapshot. Please tell me if it
works for you.
--
Laurent
Received on Fri Jan 09 2015 - 01:30:26 UTC