#include <cutk/array.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | StrHmap_itemtype |
struct | StrHmap |
Defines | |
#define | StrHmapSize(x) (arysize(&(x)->items)) |
Typedefs | |
typedef StrHmap_itemtype | StrHmap_itemtype |
typedef StrHmap | StrHmap |
Functions | |
StrHmap * | StrHmapAlloc (size_t size) |
void | StrHmapClear (StrHmap *hashmap) |
int | StrHmapCompact (StrHmap *hashmap) |
StrHmap * | StrHmapDup (const StrHmap *hashmap) |
int | StrHmapErase (StrHmap *hashmap, const char *key) |
void | StrHmapFree (StrHmap *hashmap) |
void * | StrHmapFind (StrHmap *hashmap, const char *key) |
int | StrHmapInsert (StrHmap *hashmap, const char *key, const void *item) |
int | StrHmapReplace (StrHmap *hashmap, const char *key, const void *item) |
int | StrHmapReserve (StrHmap *hashmap, size_t size) |
|
|
|
|
|
|
|
Allocate a new empty hash map.
|
|
Erases all elements in a hash map.
|
|
Rebuilds a hash map. Erased items are removed from the hash map to free up memory.
|
|
Duplicates a hash map.
|
|
Erases an element from the hash map. Note that this will not free memory held by the hash map. Use StrHmaprehash to free up memory after items have been deleted.
|
|
Finds an element in the hash map.
|
|
Releases all memory held by a hash map.
|
|
Inserts a new element into the hash map. This will return an error if the key already exists.
|
|
Inserts or replaces an element in the hash map. This will overwrite existing items in the hash map.
|
|
Reallocates a hash map. If the size is smaller than the actual number of elements in the hash map then the effect will be to reduce memory usage if possible. The size can be larger than the actual number of elements in the hash map which will allow lots of insertions to go faster since the table won't need to be resized as often.
|