From abc17b0f8997ab07ae66130edd5dc8c43e72c886 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 8 Jul 2018 08:43:42 +0000 Subject: Factor out time keeping code into its own module: mono_time.c. It turns out, `unix_time` is also monotonic, and is used as such, so I've renamed the new functions to `mono_time_*`. 2018-07-08: ``` 00:01 <@irungentoo> the idea used to be that the unix_time() function could go backward in time but I think I might have started using it like if it could not after I changed it so that it would never go back in time ``` --- toxcore/util.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'toxcore/util.h') diff --git a/toxcore/util.h b/toxcore/util.h index de493ebe..4c5023cf 100644 --- a/toxcore/util.h +++ b/toxcore/util.h @@ -39,21 +39,6 @@ extern "C" { #define MIN(a,b) (((a)<(b))?(a):(b)) #define PAIR(TYPE1__, TYPE2__) struct { TYPE1__ first; TYPE2__ second; } -typedef struct Unix_Time Unix_Time; - -Unix_Time *unix_time_new(void); -void unix_time_free(Unix_Time *unixtime); - -// TODO(#405): Use per-tox unixtime, remove unix_time_update, and rename -// unix_time_update_r to unix_time_update. -void unix_time_update_r(Unix_Time *unixtime); -uint64_t unix_time_get(const Unix_Time *unixtime); -int unix_time_is_timeout(const Unix_Time *unixtime, uint64_t timestamp, uint64_t timeout); - -void unix_time_update(void); -uint64_t unix_time(void); -int is_timeout(uint64_t timestamp, uint64_t timeout); - /* id functions */ bool id_equal(const uint8_t *dest, const uint8_t *src); uint32_t id_copy(uint8_t *dest, const uint8_t *src); /* return value is CLIENT_ID_SIZE */ -- cgit v1.2.3