diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-01 23:02:13 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-08-16 21:01:43 +0000 |
commit | d6d305feeb76735ee4b4e14c6bca737a5482bc19 (patch) | |
tree | 99005c635a452245006b3b5de44f1dd80da9f77f /toxcore/ping_array.h | |
parent | 54066f338f185f2fbd6694d9a4877f42cbfa21c8 (diff) |
Use per-instance `Mono_Time` for Messenger and onion.
Diffstat (limited to 'toxcore/ping_array.h')
-rw-r--r-- | toxcore/ping_array.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/toxcore/ping_array.h b/toxcore/ping_array.h index b927bbd4..cfa9bfcc 100644 --- a/toxcore/ping_array.h +++ b/toxcore/ping_array.h | |||
@@ -26,6 +26,11 @@ | |||
26 | 26 | ||
27 | #include "network.h" | 27 | #include "network.h" |
28 | 28 | ||
29 | #ifndef MONO_TIME_DEFINED | ||
30 | #define MONO_TIME_DEFINED | ||
31 | typedef struct Mono_Time Mono_Time; | ||
32 | #endif /* MONO_TIME_DEFINED */ | ||
33 | |||
29 | #ifndef PING_ARRAY_DEFINED | 34 | #ifndef PING_ARRAY_DEFINED |
30 | #define PING_ARRAY_DEFINED | 35 | #define PING_ARRAY_DEFINED |
31 | typedef struct Ping_Array Ping_Array; | 36 | typedef struct Ping_Array Ping_Array; |
@@ -52,7 +57,8 @@ void ping_array_kill(struct Ping_Array *_array); | |||
52 | * return ping_id on success. | 57 | * return ping_id on success. |
53 | * return 0 on failure. | 58 | * return 0 on failure. |
54 | */ | 59 | */ |
55 | uint64_t ping_array_add(struct Ping_Array *_array, const uint8_t *data, uint32_t length); | 60 | uint64_t ping_array_add(struct Ping_Array *_array, const struct Mono_Time *mono_time, const uint8_t *data, |
61 | uint32_t length); | ||
56 | 62 | ||
57 | /** | 63 | /** |
58 | * Check if ping_id is valid and not timed out. | 64 | * Check if ping_id is valid and not timed out. |
@@ -62,6 +68,7 @@ uint64_t ping_array_add(struct Ping_Array *_array, const uint8_t *data, uint32_t | |||
62 | * return length of data copied on success. | 68 | * return length of data copied on success. |
63 | * return -1 on failure. | 69 | * return -1 on failure. |
64 | */ | 70 | */ |
65 | int32_t ping_array_check(struct Ping_Array *_array, uint8_t *data, size_t length, uint64_t ping_id); | 71 | int32_t ping_array_check(struct Ping_Array *_array, const struct Mono_Time *mono_time, uint8_t *data, size_t length, |
72 | uint64_t ping_id); | ||
66 | 73 | ||
67 | #endif | 74 | #endif |