30 #ifndef INCLUDED_TimeValueC_h_GUID_A02C6917_124D_4CB3_E63E_07F2DA7144E9 31 #define INCLUDED_TimeValueC_h_GUID_A02C6917_124D_4CB3_E63E_07F2DA7144E9 37 #include <osvr/Util/Export.h> 38 #include <osvr/Util/PlatformConfig.h> 88 #ifdef OSVR_HAVE_STRUCT_TIMEVAL 103 OSVR_UTIL_EXPORT
void 104 osvrTimeValueToStructTimeval(
OSVR_OUT struct timeval *dest,
117 OSVR_UTIL_EXPORT
void 158 OSVR_UTIL_EXPORT
void 200 return ((tvA->seconds > tvB->seconds) ||
201 ((tvA->seconds == tvB->seconds) &&
202 (tvA->microseconds > tvB->microseconds)))
214 #ifdef _LIBCPP_VERSION 231 assert(osvrTimeValueIsNormalized(tvA) &&
232 "First timevalue argument to comparison was not normalized!");
233 assert(osvrTimeValueIsNormalized(tvB) &&
234 "Second timevalue argument to comparison was not normalized!");
253 osvrTimeValueIsNormalized(tvA) &&
254 "First timevalue argument to equality comparison was not normalized!");
256 osvrTimeValueIsNormalized(tvB) &&
257 "Second timevalue argument to equality comparison was not normalized!");
263 assert(osvrTimeValueIsNormalized(tvA) &&
"First timevalue argument to " 264 "inequality comparison was not " 266 assert(osvrTimeValueIsNormalized(tvB) &&
"Second timevalue argument to " 267 "inequality comparison was not " OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT int osvrTimeValueCmp(OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB) OSVR_FUNC_NONNULL((1
Compares two time values (assumed to be normalized), returning the same values as strcmp...
uint8_t OSVR_CBool
A pre-C99-safe bool type.
Definition: BoolC.h:50
#define OSVR_FALSE
Canonical "false" value for OSVR_CBool.
Definition: BoolC.h:54
#define OSVR_IN_PTR
Indicates a required pointer (non-null) function parameter that serves only as input.
Definition: AnnotationMacrosC.h:108
Header providing a C-safe "bool" type, because we can't depend on Visual Studio providing proper C99 ...
Header wrapping the C99 standard stdint header.
OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT int OSVR_EXTERN_C_END OSVR_INLINE double osvrTimeValueDurationSeconds(OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB)
Compute the difference between the two time values, returning the duration as a double-precision floa...
Definition: TimeValueC.h:185
int32_t OSVR_TimeValue_Microseconds
The signed integer type storing the microseconds in a struct OSVR_TimeValue.
Definition: TimeValueC.h:69
#define OSVR_FUNC_NONNULL(X)
Indicates the parameter(s) that must be non-null.
Definition: AnnotationMacrosC.h:202
#define OSVR_TRUE
Canonical "true" value for OSVR_CBool.
Definition: BoolC.h:52
#define OSVR_OUT
Indicates a required function parameter that serves only as output.
Definition: AnnotationMacrosC.h:143
OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void osvrTimeValueDifference(OSVR_INOUT_PTR OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB) OSVR_FUNC_NONNULL((1
Computes the difference between two time values, replacing the first with the result.
OSVR_UTIL_EXPORT void osvrTimeValueNormalize(OSVR_INOUT_PTR OSVR_TimeValue *tv) OSVR_FUNC_NONNULL((1))
"Normalizes" a time value so that the absolute number of microseconds is less than 1...
Definition: TimeValueC.cpp:46
int64_t OSVR_TimeValue_Seconds
The signed integer type storing the seconds in a struct OSVR_TimeValue.
Definition: TimeValueC.h:66
#define OSVR_INOUT_PTR
Indicates a required pointer (non-null) function parameter that is both read and written to...
Definition: AnnotationMacrosC.h:178
Header providing basic C macros for defining API headers.
OSVR_INLINE OSVR_CBool osvrTimeValueGreater(OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB)
True if A is later than B.
Definition: TimeValueC.h:195
OSVR_TimeValue_Microseconds microseconds
Microseconds portion of the time value.
Definition: TimeValueC.h:85
Header containing macros for source-level annotation.
OSVR_UTIL_EXPORT void osvrTimeValueSum(OSVR_INOUT_PTR OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB) OSVR_FUNC_NONNULL((1
Sums two time values, replacing the first with the result.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
struct OSVR_TimeValue OSVR_TimeValue
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
OSVR_TimeValue_Seconds seconds
Seconds portion of the time value.
Definition: TimeValueC.h:83