diff options
Diffstat (limited to 'ot_vector.h')
| -rw-r--r-- | ot_vector.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ot_vector.h b/ot_vector.h index 2618363..fbc75f4 100644 --- a/ot_vector.h +++ b/ot_vector.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | #ifndef OT_VECTOR_H__ | 6 | #ifndef OT_VECTOR_H__ |
| 7 | #define OT_VECTOR_H__ | 7 | #define OT_VECTOR_H__ |
| 8 | 8 | ||
| 9 | #include <stddef.h> | ||
| 10 | |||
| 9 | /* These defines control vectors behaviour */ | 11 | /* These defines control vectors behaviour */ |
| 10 | #define OT_VECTOR_MIN_MEMBERS 2 | 12 | #define OT_VECTOR_MIN_MEMBERS 2 |
| 11 | #define OT_VECTOR_GROW_RATIO 2 | 13 | #define OT_VECTOR_GROW_RATIO 2 |
| @@ -21,6 +23,9 @@ typedef struct { | |||
| 21 | size_t space; | 23 | size_t space; |
| 22 | } ot_vector; | 24 | } ot_vector; |
| 23 | 25 | ||
| 26 | /* trackerlogic.h needs ot_vector, break circular dependency here */ | ||
| 27 | #include "trackerlogic.h" | ||
| 28 | |||
| 24 | void *binary_search(const void *const key, const void *base, const size_t member_count, const size_t member_size, size_t compare_size, int *exactmatch); | 29 | void *binary_search(const void *const key, const void *base, const size_t member_count, const size_t member_size, size_t compare_size, int *exactmatch); |
| 25 | void *vector_find_or_insert(ot_vector *vector, void *key, size_t member_size, size_t compare_size, int *exactmatch); | 30 | void *vector_find_or_insert(ot_vector *vector, void *key, size_t member_size, size_t compare_size, int *exactmatch); |
| 26 | ot_peer *vector_find_or_insert_peer(ot_vector *vector, ot_peer const *peer, size_t peer_size, int *exactmatch); | 31 | ot_peer *vector_find_or_insert_peer(ot_vector *vector, ot_peer const *peer, size_t peer_size, int *exactmatch); |
