Hash Table example.
Hash Table example.
#include <banjo/main.h>
int main(int argc, char* argv[]) {
(void)argc;
(void)argv;
int key1 = 123;
int value1 = 456;
int key2 = 789;
int value2 = 101112;
bj_info(
"{%d} = %d", key1, *retrieved_value1);
bj_info(
"{%d} = %d", key2, *retrieved_value2);
return 0;
}
struct bj_htable_t bj_htable
Typedef for the bj_htable_t struct.
Definition htable.h:28
void * bj_htable_set(bj_htable *table, void *p_key, void *p_value)
Inserts a value into the hash table.
#define bj_htable_new_t(K, V)
Creates a new bj_htable with types inferred for keys and values.
Definition htable.h:49
void * bj_htable_get(const bj_htable *table, const void *p_key, void *p_default)
Returns the value associated with p_key, if it exists.
void bj_htable_del(bj_htable *p_table)
Deletes a bj_htable object and releases associated memory.
#define bj_info(...)
Log a message using the BJ_LOG_INFO level.
Definition log.h:103
Header file for Hash Table container type.
Logging utility functions.