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 f7b30693..f69f294b 100644 --- a/toxcore/util.h +++ b/toxcore/util.h | |||
@@ -28,11 +28,19 @@ | |||
28 | #include <stdbool.h> | 28 | #include <stdbool.h> |
29 | #include <stdint.h> | 29 | #include <stdint.h> |
30 | 30 | ||
31 | uint64_t now(); | ||
32 | uint64_t random_64b(); | 31 | uint64_t random_64b(); |
33 | bool id_eq(uint8_t *dest, uint8_t *src); | ||
34 | void id_cpy(uint8_t *dest, uint8_t *src); | ||
35 | 32 | ||
33 | void unix_time_update(); | ||
34 | uint64_t unix_time(); | ||
35 | int is_timeout(uint64_t timestamp, uint64_t timeout); | ||
36 | |||
37 | |||
38 | /* id functions */ | ||
39 | bool id_equal(uint8_t *dest, uint8_t *src); | ||
40 | uint32_t id_copy(uint8_t *dest, uint8_t *src); /* return value is CLIENT_ID_SIZE */ | ||
41 | |||
42 | |||
43 | /* state load/save */ | ||
36 | typedef int (*load_state_callback_func)(void *outer, uint8_t *data, uint32_t len, uint16_t type); | 44 | typedef int (*load_state_callback_func)(void *outer, uint8_t *data, uint32_t len, uint16_t type); |
37 | int load_state(load_state_callback_func load_state_callback, void *outer, | 45 | int load_state(load_state_callback_func load_state_callback, void *outer, |
38 | uint8_t *data, uint32_t length, uint16_t cookie_inner); | 46 | uint8_t *data, uint32_t length, uint16_t cookie_inner); |