diff options
Diffstat (limited to 'include/hashmap.h')
-rw-r--r-- | include/hashmap.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/hashmap.h b/include/hashmap.h index 0928081..f027d25 100644 --- a/include/hashmap.h +++ b/include/hashmap.h @@ -34,5 +34,9 @@ bool mgui_hashmap_get(mgui_hashmap *self, const char *key, size_t key_size, void /* Note: |hash| has to be the hash for |key|, which you can get by using calling |mgui_hashmap_hash| with |key| or as a result of |mgui_hashmap_insert| */ bool mgui_hashmap_get_by_hash(mgui_hashmap *self, const char *key, size_t key_size, uint64_t hash, void **value_out); uint64_t mgui_hashmap_hash(const char *key, size_t key_size); +/* Return false from |callback| to stop the iteration */ +void mgui_hashmap_for_each(mgui_hashmap *self, bool(*callback)(void *value, void *userdata), void *userdata); +/* Return true from |callback| to erase the item */ +void mgui_hashmap_for_each_erase(mgui_hashmap *self, bool(*callback)(void *value, void *userdata), void *userdata); #endif /* MGUI_HASHMAP_H */ |