diff options
| author | Mosder <xmosder12@gmail.com> | 2026-07-10 12:55:39 +0200 |
|---|---|---|
| committer | Mosder <xmosder12@gmail.com> | 2026-07-10 12:55:39 +0200 |
| commit | 26d8457a5da5d70226fdbba5ed92fda8cac735f6 (patch) | |
| tree | 0545c0e39a7e33a23c34fe26c55db801d7e7e451 /analyzer/utils/hashmap.h | |
| parent | 54fdf207352a0ee44a8264972118f6cc9d30cad1 (diff) | |
feat: added functions for iterating over a hashmap
Diffstat (limited to 'analyzer/utils/hashmap.h')
| -rw-r--r-- | analyzer/utils/hashmap.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/analyzer/utils/hashmap.h b/analyzer/utils/hashmap.h index 96e8b58..22c71c6 100644 --- a/analyzer/utils/hashmap.h +++ b/analyzer/utils/hashmap.h @@ -72,6 +72,21 @@ extern void *hashmap_get(HashMap *map, void *key); // - key - pointer to the key of the entry to delete extern void hashmap_delete(HashMap *map, void *key); +// get first node in the hashmap, use with hashmap_next to iterate over hashmap +// params: +// - map - hash map to get the first node from +// returns: +// pointer to the first node in the hashmap or NULL if there's no entries in it +extern HashMapNode *hashmap_first(HashMap *map); + +// get next node in the hashmap, use with hashmap_first to iterate over hashmap +// params: +// - map - hash map to get the next node from +// - node - the node preceeding the one we search for +// returns: +// pointer to the next node in the hashmap or NULL if there's no next +extern HashMapNode *hashmap_next(HashMap *map, HashMapNode *node); + // free the hash map // - map - hash map to free extern void hashmap_free(HashMap *map); |
