diff --git a/hashtable.h b/hashtable.h index b354521..ad4ce58 100644 --- a/hashtable.h +++ b/hashtable.h @@ -22,8 +22,6 @@ typedef struct entry * hashtable_iterator_t; // data deallocator typedef void(*hashtable_dealloc)(void*); -// data copy and allocator -typedef void(*hashtable_alloc)(void*); extern int key_compare(entry_key_t one, entry_key_t two); extern entry_hash_t key_hash(entry_key_t key); @@ -38,10 +36,11 @@ struct hashtable { struct entry * data; size_t len, count; - hashtable_alloc alloc_data; hashtable_dealloc dealloc_data; }; +extern void hashtable_init(struct hashtable * table); + extern hashtable_iterator_t hashtable_end(struct hashtable * table); /** diff --git a/test_hashtable.c b/test_hashtable.c index bc4c351..35d8b5c 100644 --- a/test_hashtable.c +++ b/test_hashtable.c @@ -42,6 +42,13 @@ void testadd() { pass(); } +volatile int number_copied = 0; + +void* test_copy(void * data) { + number_copied++; + return data; +} + void testget() { init("get");