MOS Source Code
Loading...
Searching...
No Matches
hashmap.h File Reference
#include <mos/lib/sync/spinlock.h>
#include <mos/moslib_global.h>
#include <mos/types.h>
+ Include dependency graph for hashmap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hashmap_t
 

Typedefs

typedef hash_t(* hashmap_hash_t) (const uintn key)
 
typedef int(* hashmap_key_compare_t) (const uintn key1, const uintn key2)
 A hashmap hash function prototype.
 
typedef bool(* hashmap_foreach_func_t) (const uintn key, void *value, void *data)
 A hashmap key comparison function prototype.
 
typedef struct hashmap_entry hashmap_entry_t
 A hashmap foreach callback function prototype.
 

Functions

MOSAPI void hashmap_init (hashmap_t *map, size_t capacity, hashmap_hash_t hash_func, hashmap_key_compare_t compare_func)
 
MOSAPI void hashmap_deinit (hashmap_t *map)
 Deinitialize a hashmap.
 
MOSAPI voidhashmap_put (hashmap_t *map, uintn key, void *value)
 
MOSAPI voidhashmap_get (hashmap_t *map, uintn key)
 
MOSAPI voidhashmap_remove (hashmap_t *map, uintn key)
 
MOSAPI void hashmap_foreach (hashmap_t *map, hashmap_foreach_func_t func, void *data)