![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
Defines a generic, non-resizing hashmap data type. More...
#include <stddef.h>#include <assert.h>#include <stdbool.h>Go to the source code of this file.
Data Structures | |
| struct | hashmap_entry_t |
| A hashmap entry. More... | |
| struct | hashmap_t |
| A hashmap. More... | |
Macros | |
| #define | HASH_OF(key) |
| #define | HASHMAP(token) |
| #define | K void* |
| #define | V void* |
Typedefs | |
| typedef struct hashmap_entry_t | hashmap_entry_t |
| A hashmap entry. | |
| typedef struct hashmap_t | hashmap_t |
| A hashmap. | |
Functions | |
| void | hashmap_free (hashmap_t *hashmap) |
| Free all memory used by the given hashmap. | |
| void * | hashmap_get (hashmap_t *hashmap, void *key) |
| Get the value associated with the given key. | |
| static hashmap_entry_t * | hashmap_get_actual_address (hashmap_t *hashmap, void *key) |
| Return the actual address of the hashmap entry corresponding to key, or the address of the closest empty entry if no such entry exists. | |
| static hashmap_entry_t * | hashmap_get_ideal_address (hashmap_t *hashmap, void *key) |
| hashmap_t * | hashmap_new (size_t capacity, void *nothing) |
| Construct a new hashmap object. | |
| void | hashmap_put (hashmap_t *hashmap, void *key, void *value) |
| Associate a value with the given key. | |
Defines a generic, non-resizing hashmap data type.
Hashmaps are defined by redefining K, V, HASH_OF, and HASHMAP, and including this file. A default hashmap type is defined here. See pointer_hashmap.h for an example of a hashmap declaration.
| #define HASH_OF | ( | key | ) |
| #define K void* |
| #define V void* |
|
static |