#ifndef KEKS_ENCTAI_H
#define KEKS_ENCTAI_H

#include <stdbool.h>
#include <time.h> // IWYU pragma: keep // struct timespec

// TEXINFO: KEKSTimespecToTAI64
// @deftypefun bool KEKSTimespecToTAI64 @
//     (unsigned char *buf, const struct timespec *ts)
// Convert @var{ts} structure to TAI64/TAI64N in the @var{buf}.
// If @var{ts} contains non zero nanoseconds count, then be sure that
// @var{buf} has enough capacity for 12-byte TAI64N value.
// False is returned if represented time is out of allowable bounds.
// @end deftypefun
bool
KEKSTimespecToTAI64(unsigned char *buf, const struct timespec *ts);

// TEXINFO: KEKSTimespecToTAI
// @deftypefun bool KEKSTimespecToTAI (struct timespec *ts)
// Convert UTC stored in @var{ts} structure to TAI.
// False is returned if represented time is out of allowable bounds.
// @end deftypefun
bool
KEKSTimespecToTAI(struct timespec *ts);

#endif // KEKS_ENCTAI_H
