diff options
Diffstat (limited to 'drivers/staging/batman-adv/hash.h')
-rw-r--r-- | drivers/staging/batman-adv/hash.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/staging/batman-adv/hash.h b/drivers/staging/batman-adv/hash.h index ea6d21e01251..2c8e1762389f 100644 --- a/drivers/staging/batman-adv/hash.h +++ b/drivers/staging/batman-adv/hash.h @@ -19,8 +19,9 @@ * */ -#ifndef _BATMAN_HASH_H -#define _BATMAN_HASH_H +#ifndef _NET_BATMAN_ADV_HASH_H_ +#define _NET_BATMAN_ADV_HASH_H_ + #define HASHIT(name) struct hash_it_t name = { \ .index = -1, .bucket = NULL, \ .prev_bucket = NULL, \ @@ -29,7 +30,7 @@ typedef int (*hashdata_compare_cb)(void *, void *); typedef int (*hashdata_choose_cb)(void *, int); -typedef void (*hashdata_free_cb)(void *); +typedef void (*hashdata_free_cb)(void *, void *); struct element_t { void *data; /* pointer to the data */ @@ -56,9 +57,6 @@ struct hashtable_t { * argument and the size the second */ }; -/* clears the hash */ -void hash_init(struct hashtable_t *hash); - /* allocates and clears the hash */ struct hashtable_t *hash_new(int size, hashdata_compare_cb compare, hashdata_choose_cb choose); @@ -72,7 +70,7 @@ void *hash_remove_bucket(struct hashtable_t *hash, struct hash_it_t *hash_it_t); /* remove the hash structure. if hashdata_free_cb != NULL, this function will be * called to remove the elements inside of the hash. if you don't remove the * elements, memory might be leaked. */ -void hash_delete(struct hashtable_t *hash, hashdata_free_cb free_cb); +void hash_delete(struct hashtable_t *hash, hashdata_free_cb free_cb, void *arg); /* free only the hashtable and the hash itself. */ void hash_destroy(struct hashtable_t *hash); @@ -99,6 +97,4 @@ struct hashtable_t *hash_resize(struct hashtable_t *hash, int size); struct hash_it_t *hash_iterate(struct hashtable_t *hash, struct hash_it_t *iter_in); -/* print the hash table for debugging */ -void hash_debug(struct hashtable_t *hash); -#endif +#endif /* _NET_BATMAN_ADV_HASH_H_ */ |