diff options
Diffstat (limited to 'lib/hash.h')
| -rw-r--r-- | lib/hash.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/hash.h b/lib/hash.h index 8c695d2381..60c412b8e0 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -39,15 +39,20 @@ DECLARE_MTYPE(HASH_BACKET) #define HASHWALK_CONTINUE 0 #define HASHWALK_ABORT -1 -struct hash_backet { +#if CONFDATE > 20200225 +CPP_NOTICE("hash.h: time to remove hash_backet #define") +#endif +#define hash_backet hash_bucket + +struct hash_bucket { /* - * if this backet is the head of the linked listed, len denotes the + * if this bucket is the head of the linked listed, len denotes the * number of elements in the list */ int len; /* Linked list. */ - struct hash_backet *next; + struct hash_bucket *next; /* Hash key. */ unsigned int key; @@ -64,8 +69,8 @@ struct hashstats { }; struct hash { - /* Hash backet. */ - struct hash_backet **index; + /* Hash bucket. */ + struct hash_bucket **index; /* Hash table size. Must be power of 2 */ unsigned int size; @@ -172,9 +177,9 @@ hash_create_size(unsigned int size, unsigned int (*hash_key)(void *), * hash table to operate on * * data - * data to insert or retrieve - A hash backet will not be created if + * data to insert or retrieve - A hash bucket will not be created if * the alloc_func returns a NULL pointer and nothing will be added to - * the hash. As such backet->data will always be non-NULL. + * the hash. As such bucket->data will always be non-NULL. * * alloc_func * function to call if the item is not found in the hash table. This @@ -243,7 +248,7 @@ extern void *hash_release(struct hash *hash, void *data); * during the walk will cause undefined behavior in that some new entries * will be walked and some will not. So do not do this. * - * The backet passed to func will have a non-NULL data pointer. + * The bucket passed to func will have a non-NULL data pointer. * * hash * hash table to operate on @@ -255,7 +260,7 @@ extern void *hash_release(struct hash *hash, void *data); * arbitrary argument passed as the second parameter in each call to 'func' */ extern void hash_iterate(struct hash *hash, - void (*func)(struct hash_backet *, void *), void *arg); + void (*func)(struct hash_bucket *, void *), void *arg); /* * Iterate over the elements in a hash table, stopping on condition. @@ -265,7 +270,7 @@ extern void hash_iterate(struct hash *hash, * during the walk will cause undefined behavior in that some new entries * will be walked and some will not. So do not do this. * - * The backet passed to func will have a non-NULL data pointer. + * The bucket passed to func will have a non-NULL data pointer. * * hash * hash table to operate on @@ -278,7 +283,7 @@ extern void hash_iterate(struct hash *hash, * arbitrary argument passed as the second parameter in each call to 'func' */ extern void hash_walk(struct hash *hash, - int (*func)(struct hash_backet *, void *), void *arg); + int (*func)(struct hash_bucket *, void *), void *arg); /* * Remove all elements from a hash table. |
