diff options
Diffstat (limited to 'toxcore/util.h')
-rw-r--r-- | toxcore/util.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/toxcore/util.h b/toxcore/util.h index 13ab4792..3ecefd9c 100644 --- a/toxcore/util.h +++ b/toxcore/util.h | |||
@@ -11,11 +11,19 @@ | |||
11 | #include <stdbool.h> | 11 | #include <stdbool.h> |
12 | #include <stdint.h> | 12 | #include <stdint.h> |
13 | 13 | ||
14 | uint64_t now(); | ||
15 | uint64_t random_64b(); | 14 | uint64_t random_64b(); |
16 | bool id_eq(uint8_t *dest, uint8_t *src); | ||
17 | void id_cpy(uint8_t *dest, uint8_t *src); | ||
18 | 15 | ||
16 | void unix_time_update(); | ||
17 | uint64_t unix_time(); | ||
18 | int is_timeout(uint64_t timestamp, uint64_t timeout); | ||
19 | |||
20 | |||
21 | /* id functions */ | ||
22 | bool id_equal(uint8_t *dest, uint8_t *src); | ||
23 | uint32_t id_copy(uint8_t *dest, uint8_t *src); /* return value is CLIENT_ID_SIZE */ | ||
24 | |||
25 | |||
26 | /* state load/save */ | ||
19 | typedef int (*load_state_callback_func)(void *outer, uint8_t *data, uint32_t len, uint16_t type); | 27 | typedef int (*load_state_callback_func)(void *outer, uint8_t *data, uint32_t len, uint16_t type); |
20 | int load_state(load_state_callback_func load_state_callback, void *outer, | 28 | int load_state(load_state_callback_func load_state_callback, void *outer, |
21 | uint8_t *data, uint32_t length, uint16_t cookie_inner); | 29 | uint8_t *data, uint32_t length, uint16_t cookie_inner); |