]> git.meshlink.io Git - meshlink/blobdiff - src/event.c
Move timespec functions to utils.h.
[meshlink] / src / event.c
index f8ebe8b842047695c92cfccd98441673b8af452f..857aaec240c5d5eb216159649b8794c868b95e52 100644 (file)
 #endif
 #endif
 
-static void timespec_add(const struct timespec *a, const struct timespec *b, struct timespec *r) {
-       r->tv_sec = a->tv_sec + b->tv_sec;
-       r->tv_nsec = a->tv_nsec + b->tv_nsec;
-
-       if(r->tv_nsec > 1000000000) {
-               r->tv_sec++, r->tv_nsec -= 1000000000;
-       }
-}
-
-static void timespec_sub(const struct timespec *a, const struct timespec *b, struct timespec *r) {
-       r->tv_sec = a->tv_sec - b->tv_sec;
-       r->tv_nsec = a->tv_nsec - b->tv_nsec;
-
-       if(r->tv_nsec < 0) {
-               r->tv_sec--, r->tv_nsec += 1000000000;
-       }
-}
-
-static bool timespec_lt(const struct timespec *a, const struct timespec *b) {
-       if(a->tv_sec == b->tv_sec) {
-               return a->tv_nsec < b->tv_nsec;
-       } else {
-               return a->tv_sec < b->tv_sec;
-       }
-}
-
-static void timespec_clear(struct timespec *a) {
-       a->tv_sec = 0;
-}
-
 static int io_compare(const io_t *a, const io_t *b) {
        return a->fd - b->fd;
 }