diff options
Diffstat (limited to 'ot_vector.h')
-rw-r--r-- | ot_vector.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/ot_vector.h b/ot_vector.h index 37e2592..8d41452 100644 --- a/ot_vector.h +++ b/ot_vector.h | |||
@@ -16,22 +16,21 @@ | |||
16 | #define OT_PEER_BUCKET_MAXCOUNT 256 | 16 | #define OT_PEER_BUCKET_MAXCOUNT 256 |
17 | 17 | ||
18 | typedef struct { | 18 | typedef struct { |
19 | void *data; | 19 | void *data; |
20 | size_t size; | 20 | size_t size; |
21 | size_t space; | 21 | size_t space; |
22 | } ot_vector; | 22 | } ot_vector; |
23 | 23 | ||
24 | void *binary_search( const void * const key, const void * base, const size_t member_count, const size_t member_size, | 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); |
25 | 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); |
26 | 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); |
27 | ot_peer *vector_find_or_insert_peer( ot_vector *vector, ot_peer const *peer, size_t peer_size, int *exactmatch ); | ||
28 | 27 | ||
29 | int vector_remove_peer( ot_vector *vector, ot_peer const *peer, size_t peer_size); | 28 | int vector_remove_peer(ot_vector *vector, ot_peer const *peer, size_t peer_size); |
30 | void vector_remove_torrent( ot_vector *vector, ot_torrent *match ); | 29 | void vector_remove_torrent(ot_vector *vector, ot_torrent *match); |
31 | 30 | ||
32 | /* For ot_clean.c */ | 31 | /* For ot_clean.c */ |
33 | void vector_redistribute_buckets( ot_peerlist * peer_list, size_t peer_size ); | 32 | void vector_redistribute_buckets(ot_peerlist *peer_list, size_t peer_size); |
34 | void vector_fixup_peers( ot_vector * vector, size_t peer_size ); | 33 | void vector_fixup_peers(ot_vector *vector, size_t peer_size); |
35 | void vector_clean_list( ot_vector * vector, int num_buckets); | 34 | void vector_clean_list(ot_vector *vector, int num_buckets); |
36 | 35 | ||
37 | #endif | 36 | #endif |