parallax 1.0
command-line based task/todo manager
|
Contains the structures and procedures for hashmap-related operations. More...
#include "task.h"
Go to the source code of this file.
Classes | |
struct | Entry |
Linked list node definition of an entry in a hash map. More... | |
struct | HashMap |
Hashmap structure. More... |
Typedefs | |
typedef struct Entry | Entry |
Linked list node definition of an entry in a hash map. | |
typedef struct HashMap | HashMap |
Hashmap structure. |
Functions | |
HashMap * | hashmap_create (size_t table_size) |
Creates a hashmap of a fixed size. | |
void | hashmap_set (HashMap *map, char *key, void *value) |
Adds an entry to a hashmap by a key string and value. | |
void * | hashmap_get (HashMap *map, char *key) |
Finds an entry in a non-empty hashmap by a key. | |
void | hashmap_elem_remove (HashMap *map, char *key) |
Removes an entry in a hashmap by its key. | |
void | hashmap_destroy (HashMap *map) |
Frees a hashmap to memory. |
Contains the structures and procedures for hashmap-related operations.
Definition in file hashmap.h.
typedef struct HashMap HashMap |
Hashmap structure.
Contains an array of Entry pointer nodes with a fixed size
HashMap * hashmap_create | ( | size_t | table_size | ) |
Creates a hashmap of a fixed size.
table_size | Size of the hash table |
Definition at line 32 of file hashmap.c.
void hashmap_destroy | ( | HashMap * | map | ) |
Frees a hashmap to memory.
map | Pointer to the hashmap |
void hashmap_elem_remove | ( | HashMap * | map, |
char * | key ) |
Removes an entry in a hashmap by its key.
map | Pointer to the hashmap |
key | Pointer to the key string |
Definition at line 102 of file hashmap.c.
void * hashmap_get | ( | HashMap * | map, |
char * | key ) |
Finds an entry in a non-empty hashmap by a key.
Utilizes the standard approach of hashing and appending to non-empty entries.
map | Pointer to the hashmap |
key | Pointer to the key string |
Definition at line 80 of file hashmap.c.
void hashmap_set | ( | HashMap * | map, |
char * | key, | ||
void * | value ) |
Adds an entry to a hashmap by a key string and value.
map | Pointer to the hashmap |
key | Pointer to the key string |
value | Pointer to the value |
Definition at line 42 of file hashmap.c.