summaryrefslogtreecommitdiff
path: root/lib/hash.h
diff options
context:
space:
mode:
authorTim Bray <tim@kooky.org>2019-02-19 15:46:52 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 16:22:36 +0000
commite3b78da875d7ccb744763bb9f8ef6d08655e3975 (patch)
tree58e77a2f68461230e8283624c73cd9a7827e5aa1 /lib/hash.h
parent5a80b8c7c254b9955e357555ebd929ab9bc123ef (diff)
*: Rename backet to bucket
Presume typo from original author Signed-off-by: Tim Bray <tim@kooky.org>
Diffstat (limited to 'lib/hash.h')
-rw-r--r--lib/hash.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/hash.h b/lib/hash.h
index 8c695d2381..2bb0ada9f4 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -39,15 +39,15 @@ DECLARE_MTYPE(HASH_BACKET)
#define HASHWALK_CONTINUE 0
#define HASHWALK_ABORT -1
-struct hash_backet {
+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 +64,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 +172,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 +243,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 +255,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 +265,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 +278,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.