diff options
author | 2019-08-12 17:59:10 +0300 | |
---|---|---|
committer | 2019-08-12 17:59:10 +0300 | |
commit | 3fcd58c715993b3c2a42e21d41fece5d7d09243c (patch) | |
tree | 14793609fc8f94b2f9d8014dd8d554414cc6b53b /include/rin | |
parent | 7c4f627ebb0e2d2f1922c4ec18032a3619ea5f1d (diff) | |
download | librin-3fcd58c715993b3c2a42e21d41fece5d7d09243c.tar.gz librin-3fcd58c715993b3c2a42e21d41fece5d7d09243c.tar.bz2 librin-3fcd58c715993b3c2a42e21d41fece5d7d09243c.zip |
time: add timeval versions.
We now got functions to operate on both struct timespec and
struct timeval.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'include/rin')
-rw-r--r-- | include/rin/time.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/rin/time.h b/include/rin/time.h index 523103f..9c8200f 100644 --- a/include/rin/time.h +++ b/include/rin/time.h @@ -21,17 +21,27 @@ #ifndef LIBRIN_TIME_INCLUDED #define LIBRIN_TIME_INCLUDED -#include <time.h> +#include <sys/time.h> struct timespec rin_time_add(const struct timespec * const a, const struct timespec * const b); struct timespec rin_time_sub(const struct timespec * const a, const struct timespec * const b); struct timespec rin_time_normalize(const struct timespec * const t); +struct timeval rin_timeval_add(const struct timeval * const a, const struct timeval * const b); +struct timeval rin_timeval_sub(const struct timeval * const a, const struct timeval * const b); +struct timeval rin_timeval_normalize(const struct timeval * const t); long int rin_time_cmp(const struct timespec * const a, const struct timespec * const b); +long int rin_timeval_cmp(const struct timeval * const a, const struct timeval * const b); unsigned int rin_time_cmp_less(const struct timespec * const a, const struct timespec * const b); unsigned int rin_time_cmp_more(const struct timespec * const a, const struct timespec * const b); unsigned int rin_time_cmp_lessequal(const struct timespec * const a, const struct timespec * const b); unsigned int rin_time_cmp_moreequal(const struct timespec * const a, const struct timespec * const b); unsigned int rin_time_cmp_equal(const struct timespec * const a, const struct timespec * const b); unsigned int rin_time_cmp_nonequal(const struct timespec * const a, const struct timespec * const b); +unsigned int rin_timeval_cmp_less(const struct timeval * const a, const struct timeval * const b); +unsigned int rin_timeval_cmp_more(const struct timeval * const a, const struct timeval * const b); +unsigned int rin_timeval_cmp_lessequal(const struct timeval * const a, const struct timeval * const b); +unsigned int rin_timeval_cmp_moreequal(const struct timeval * const a, const struct timeval * const b); +unsigned int rin_timeval_cmp_equal(const struct timeval * const a, const struct timeval * const b); +unsigned int rin_timeval_cmp_nonequal(const struct timeval * const a, const struct timeval * const b); #endif /* LIBRIN_TIME_INCLUDED */ |