summaryrefslogtreecommitdiff
path: root/ot_vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'ot_vector.h')
-rw-r--r--ot_vector.h23
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
18typedef struct { 18typedef 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
24void *binary_search( const void * const key, const void * base, const size_t member_count, const size_t member_size, 24void *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 ); 25void *vector_find_or_insert(ot_vector *vector, void *key, size_t member_size, size_t compare_size, int *exactmatch);
26void *vector_find_or_insert( ot_vector *vector, void *key, size_t member_size, size_t compare_size, int *exactmatch ); 26ot_peer *vector_find_or_insert_peer(ot_vector *vector, ot_peer const *peer, size_t peer_size, int *exactmatch);
27ot_peer *vector_find_or_insert_peer( ot_vector *vector, ot_peer const *peer, size_t peer_size, int *exactmatch );
28 27
29int vector_remove_peer( ot_vector *vector, ot_peer const *peer, size_t peer_size); 28int vector_remove_peer(ot_vector *vector, ot_peer const *peer, size_t peer_size);
30void vector_remove_torrent( ot_vector *vector, ot_torrent *match ); 29void vector_remove_torrent(ot_vector *vector, ot_torrent *match);
31 30
32/* For ot_clean.c */ 31/* For ot_clean.c */
33void vector_redistribute_buckets( ot_peerlist * peer_list, size_t peer_size ); 32void vector_redistribute_buckets(ot_peerlist *peer_list, size_t peer_size);
34void vector_fixup_peers( ot_vector * vector, size_t peer_size ); 33void vector_fixup_peers(ot_vector *vector, size_t peer_size);
35void vector_clean_list( ot_vector * vector, int num_buckets); 34void vector_clean_list(ot_vector *vector, int num_buckets);
36 35
37#endif 36#endif