|
libpulsar
A modular compiler for the pulsar programming language
|
Hash map data structure. More...
Go to the source code of this file.
Data Structures | |
| struct | ps_hash_map |
| A hash map. More... | |
| struct | ps_hash_map::ps_hash_map_entry |
Typedefs | |
| typedef void(* | free_fn_t) (void *ptr) |
| Function that destroys an object and its owned resources. | |
Functions | |
| struct ps_hash_map * | ps_hash_map_new (is_equal_t is_equal, hasher_t hasher, free_fn_t free_fn) |
| Creates a new hash map with the given comparison and memory functions. | |
| struct ps_hash_map * | _ps_hash_map_new (is_equal_t is_equal, hasher_t hasher, free_fn_t free_fn, u64 capacity) |
| void | ps_hash_map_free (struct ps_hash_map *map) |
| Destroys all data owned by the hash map. | |
| void | ps_hash_map_insert (struct ps_hash_map **map_ptr, void *key, void *value) |
| Inserts a new key-value pair into the hash map. | |
| void * | ps_hash_map_get (struct ps_hash_map *map, void *key) |
| Gets the value associated with the given key. | |
| void | ps_hash_map_remove (struct ps_hash_map *map, void *key) |
| Removes the key-value pair associated with the given key. | |
| bool | ps_hash_map_contains (struct ps_hash_map *map, void *key) |
| Checks if the hash map contains the given key-value pair. | |
| u64 | ps_hash_map_count (const struct ps_hash_map *map) |
| Gets the number of key-value pairs in the hash map. | |
Hash map data structure.
Definition in file hashmap.h.
| typedef void(* free_fn_t) (void *ptr) |
| struct ps_hash_map * _ps_hash_map_new | ( | is_equal_t | is_equal, |
| hasher_t | hasher, | ||
| free_fn_t | free_fn, | ||
| u64 | capacity | ||
| ) |
| bool ps_hash_map_contains | ( | struct ps_hash_map * | map, |
| void * | key | ||
| ) |
| u64 ps_hash_map_count | ( | const struct ps_hash_map * | map | ) |
| void ps_hash_map_free | ( | struct ps_hash_map * | map | ) |
| void * ps_hash_map_get | ( | struct ps_hash_map * | map, |
| void * | key | ||
| ) |
| void ps_hash_map_insert | ( | struct ps_hash_map ** | map_ptr, |
| void * | key, | ||
| void * | value | ||
| ) |
|
inline |
Creates a new hash map with the given comparison and memory functions.
| is_equal | The comparison function (for the keys). |
| hasher | The hash function (for the keys). |
| free_fn | The free function (for the objects). |
Creates a new hash map with the given comparison and memory functions.
| void ps_hash_map_remove | ( | struct ps_hash_map * | map, |
| void * | key | ||
| ) |