libcproject
C static library easier to use than libc (C standard library).
|
#include <errno.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "linked_list.h"
#include "types.h"
Go to the source code of this file.
Data Structures | |
struct | hash_map |
Hash map data structure. More... | |
struct | hash_map_item |
Hash map item data structure. More... | |
Macros | |
#define | HASH_MAP_INITIAL_CAPACITY 10 |
Functions | |
uint64_t | hash (string_t key, size_t capacity) |
Hash function (using SipHash 1-3 algorithm). More... | |
struct hash_map * | hash_map_initialization () |
Hash map initialization. More... | |
void | hash_map_add (struct hash_map *hash_map, string_t key, void *data) |
Add an item to the hash map. More... | |
void | hash_map_remove (struct hash_map *hash_map, string_t key) |
Remove an item from the hash map. More... | |
void * | hash_map_get (struct hash_map *hash_map, string_t key) |
Get an item from the hash map. More... | |
bool | hash_map_contains_key (struct hash_map *hash_map, string_t key) |
Check if the hash map contains a key. More... | |
string_t * | hash_map_get_keys (struct hash_map *hash_map) |
Get the hash map keys. More... | |
void | hash_map_free (struct hash_map *hash_map) |
Frees the hash map. More... | |
struct hash_map |
Data Fields | ||
---|---|---|
struct linked_list ** | items | |
size_t | length | |
size_t | capacity |
struct hash_map_item |
Data Fields | ||
---|---|---|
void * | data | |
string_t | key |
#define HASH_MAP_INITIAL_CAPACITY 10 |
Definition at line 14 of file hash_map.h.
uint64_t hash | ( | string_t | key, |
size_t | capacity | ||
) |
Hash function (using SipHash 1-3 algorithm).
key | |
capacity |
struct hash_map* hash_map_initialization | ( | ) |
Hash map initialization.