19#ifndef NETSURF_HASHMAP_H
20#define NETSURF_HASHMAP_H
37typedef void* (*hashmap_key_clone_t)(
void *);
57typedef void* (*hashmap_value_alloc_t)(
void *);
void(* hashmap_value_destroy_t)(void *)
Value destructor function type.
bool hashmap_remove(hashmap_t *hashmap, void *key)
Remove an entry from the hashmap.
hashmap_t * hashmap_create(hashmap_parameters_t *params)
Create a hashmap.
void(* hashmap_key_destroy_t)(void *)
Key destructor function type.
void *(* hashmap_key_clone_t)(void *)
Key cloning function type.
size_t hashmap_count(hashmap_t *hashmap)
Get the number of entries in this map.
uint32_t(* hashmap_key_hash_t)(void *)
Key hashing function type.
bool(* hashmap_key_eq_t)(void *, void *)
Key comparison function type.
void * hashmap_lookup(hashmap_t *hashmap, void *key)
Look up a key in a hashmap.
void * hashmap_insert(hashmap_t *hashmap, void *key)
Create an entry in a hashmap.
bool hashmap_iterate(hashmap_t *hashmap, hashmap_iteration_cb_t cb, void *ctx)
Iterate the hashmap.
void *(* hashmap_value_alloc_t)(void *)
Value allocation function type.
bool(* hashmap_iteration_cb_t)(void *, void *, void *)
Hashmap iteration callback function type.
void hashmap_destroy(hashmap_t *hashmap)
Destroy a hashmap.
hashmap_value_destroy_t value_destroy
A function which when called will destroy a value object.
hashmap_value_alloc_t value_alloc
A function which when called will allocate a value object.
hashmap_key_hash_t key_hash
A function which when given a key will return its hash.
hashmap_key_clone_t key_clone
A function which when called will clone a key and give ownership of the returned object to the hashma...
hashmap_key_destroy_t key_destroy
A function which when called will destroy a key object.
hashmap_key_eq_t key_eq
A function to compare two keys and return if they are equal.
The content of a hashmap.