|
|
#define | DECLARE_HASHTABLE(name, size) |
| | Declare a hashtable structure.
|
| |
| #define | hashtable_init(hashtable) __hashtable_init(&(hashtable)->table, ARRAY_SIZE((hashtable)->buckets)) |
| | Initialize an empty hashtable. More...
|
| |
| #define | hashtable_insert(hashtable, entry) __hashtable_insert(&(hashtable)->table, entry) |
| | Add an entry into an hashtable. More...
|
| |
| #define | hashtable_remove(hashtable, key) __hashtable_remove(&(hashtable)->table, key) |
| | Remove an entry from an hashtable. More...
|
| |
| #define | hashtable_find(hashtable, key) __hashtable_find(&(hashtable)->table, key) |
| | Find an entry inside an hastable. More...
|
| |
Hash table
This is our implementation for hash tables.
Key
This implementation only supports pointers for keys. The user should make sure that all keys are unique since this is not verified by this library.
◆ hashtable_find
| #define hashtable_find |
( |
|
hashtable, |
|
|
|
key |
|
) |
| __hashtable_find(&(hashtable)->table, key) |
- Parameters
-
| hashtable | The hashtable union declared using DECLARE_HASHTABLE(). |
| entry | Key used to find the entry. |
- Returns
- The entry, or NULL if it did not exist.
◆ hashtable_init
| #define hashtable_init |
( |
|
hashtable | ) |
__hashtable_init(&(hashtable)->table, ARRAY_SIZE((hashtable)->buckets)) |
◆ hashtable_insert
| #define hashtable_insert |
( |
|
hashtable, |
|
|
|
entry |
|
) |
| __hashtable_insert(&(hashtable)->table, entry) |
- Parameters
-
| hashtable | The hashtable union declared using DECLARE_HASHTABLE(). |
| entry | Pointer to the hashtable entry to add. |
◆ hashtable_remove
| #define hashtable_remove |
( |
|
hashtable, |
|
|
|
key |
|
) |
| __hashtable_remove(&(hashtable)->table, key) |
- Parameters
-
| hashtable | The hashtable union declared using DECLARE_HASHTABLE(). |
| entry | Key used to find the entry to remove. |
- Returns
- The removed entry, or NULL if it did not exist.