Banjo API 0.0.1
Multi-purpose C99 API
Loading...
Searching...
No Matches
htable.h File Reference

Header file for Hash Table container type.

#include <banjo/api.h>
#include <banjo/array.h>
#include <banjo/memory.h>
Include dependency graph for htable.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define bj_htable_new_t(K, V)
 Creates a new bj_htable with types inferred for keys and values.
 

Typedefs

typedef uint32_t(* bj_hash_fn) (const void *p_data, size_t size)
 Function type for hashing keys.
 
typedef struct bj_htable_t bj_htable
 Typedef for the bj_htable_t struct.
 

Functions

bj_htablebj_htable_new (size_t bytes_key, size_t bytes_value)
 Creates a new bj_htable with the specified sizes for keys and values.
 
void bj_htable_del (bj_htable *p_table)
 Deletes a bj_htable object and releases associated memory.
 
void * bj_htable_set (bj_htable *table, void *p_key, void *p_value)
 Inserts a value into the hash table.
 
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.
 
size_t bj_htable_len (const bj_htable *table)
 Returns the number of elements in the table.