21#ifndef JUNO_TIME_API_H
22#define JUNO_TIME_API_H
120#define JUNO_TIME_NEW_API(Now, SleepTo, Sleep) \
124 JunoTime_SubtractTime, \
127 JunoTime_TimestampToNanos, \
128 JunoTime_TimestampToMicros, \
129 JunoTime_TimestampToMillis, \
130 JunoTime_NanosToTimestamp, \
131 JunoTime_MicrosToTimestamp, \
132 JunoTime_MillisToTimestamp, \
133 JunoTime_TimestampToDouble, \
134 JunoTime_DoubleToTimestamp, \
#define JUNO_MODULE_EMPTY
Definition module.h:126
#define JUNO_MODULE_RESULT(NAME_T, OK_T)
Defines a result type combining a status and a success payload.
Definition module.h:223
#define JUNO_MODULE_ROOT(API_T,...)
Definition module.h:182
int32_t JUNO_STATUS_T
Definition status.h:23
JUNO_TIME_SECONDS_T iSeconds
Seconds component of time.
Definition time_api.h:65
JUNO_TIME_SUBSECONDS_T iSubSeconds
Definition time_api.h:68
JUNO_TIMESTAMP_RESULT_T(* NanosToTimestamp)(JUNO_TIME_T *ptTime, JUNO_TIME_NANOS_T iNanos)
Convert nanoseconds to a timestamp.
Definition time_api.h:97
JUNO_STATUS_T(* SleepTo)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTimeToWakeup)
Sleep this thread until a specific time.
Definition time_api.h:87
JUNO_TIMESTAMP_RESULT_T(* DoubleToTimestamp)(JUNO_TIME_T *ptTime, double dTimestamp)
Convert a double to a timestamp.
Definition time_api.h:105
JUNO_TIMESTAMP_RESULT_T(* Now)(JUNO_TIME_T *ptTime)
Get the current time as specified by the implementation.
Definition time_api.h:81
JUNO_TIMESTAMP_RESULT_T(* MillisToTimestamp)(JUNO_TIME_T *ptTime, JUNO_TIME_MILLIS_T iMillis)
Convert milliseconds to a timestamp.
Definition time_api.h:101
JUNO_STATUS_T(* SubtractTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToSubtract)
Perform subtraction with time.
Definition time_api.h:85
JUNO_TIME_NANOS_RESULT_T(* TimestampToNanos)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTime)
Convert a timestamp to nanoseconds.
Definition time_api.h:91
JUNO_TIMESTAMP_RESULT_T(* MicrosToTimestamp)(JUNO_TIME_T *ptTime, JUNO_TIME_MICROS_T iMicros)
Convert microseconds to a timestamp.
Definition time_api.h:99
JUNO_RESULT_F64_T(* TimestampToDouble)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTimestamp)
Convert a timestamp to a double.
Definition time_api.h:103
JUNO_STATUS_T(* AddTime)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToAdd)
Perform addition with time.
Definition time_api.h:83
JUNO_STATUS_T(* Sleep)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tDuration)
Sleep this thread for a duration.
Definition time_api.h:89
JUNO_TIME_MILLIS_RESULT_T(* TimestampToMillis)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTime)
Convert a timestamp to milliseconds.
Definition time_api.h:95
JUNO_TIME_MICROS_RESULT_T(* TimestampToMicros)(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTime)
Convert a timestamp to microsconds.
Definition time_api.h:93
uint64_t JUNO_TIME_NANOS_T
Definition time_api.h:41
static bool JunoTime_TimestampEquals(JUNO_TIMESTAMP_T tLeft, JUNO_TIMESTAMP_T tRight)
Definition time_api.h:147
JUNO_TIME_MICROS_RESULT_T JunoTime_TimestampToMicros(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTime)
Definition juno_time.c:82
uint64_t JUNO_TIME_MICROS_T
Definition time_api.h:40
JUNO_TIMESTAMP_RESULT_T JunoTime_MicrosToTimestamp(JUNO_TIME_T *ptTime, JUNO_TIME_MICROS_T iMicros)
Definition juno_time.c:146
JUNO_TIMESTAMP_RESULT_T JunoTime_MillisToTimestamp(JUNO_TIME_T *ptTime, JUNO_TIME_MILLIS_T iMillis)
Definition juno_time.c:162
JUNO_TIME_NANOS_RESULT_T JunoTime_TimestampToNanos(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTime)
Definition juno_time.c:58
static bool JunoTime_TimestampGreaterThan(JUNO_TIMESTAMP_T tLeft, JUNO_TIMESTAMP_T tRight)
Definition time_api.h:137
JUNO_STATUS_T JunoTime_AddTime(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToAdd)
Definition juno_time.c:8
uint64_t JUNO_TIME_MILLIS_T
Definition time_api.h:39
static bool JunoTime_TimestampLessThan(JUNO_TIMESTAMP_T tLeft, JUNO_TIMESTAMP_T tRight)
Definition time_api.h:142
uint64_t JUNO_TIME_SECONDS_T
Definition time_api.h:38
JUNO_STATUS_T JunoTime_SubtractTime(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T *ptRetTime, JUNO_TIMESTAMP_T tTimeToSubtract)
Definition juno_time.c:30
uint64_t JUNO_TIME_SUBSECONDS_T
Definition time_api.h:42
union JUNO_TIME_TAG JUNO_TIME_T
Definition time_api.h:34
JUNO_TIMESTAMP_RESULT_T JunoTime_DoubleToTimestamp(JUNO_TIME_T *ptTime, double dTimestamp)
Definition juno_time.c:193
JUNO_TIMESTAMP_RESULT_T JunoTime_NanosToTimestamp(JUNO_TIME_T *ptTime, JUNO_TIME_NANOS_T iNanos)
Definition juno_time.c:130
JUNO_RESULT_F64_T JunoTime_TimestampToDouble(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTimestamp)
Definition juno_time.c:179
JUNO_TIME_MILLIS_RESULT_T JunoTime_TimestampToMillis(JUNO_TIME_T *ptTime, JUNO_TIMESTAMP_T tTime)
Definition juno_time.c:106
struct JUNO_TIME_ROOT_TAG JUNO_TIME_ROOT_T
Definition time_api.h:35