diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-22 13:49:46 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-22 13:49:46 +0100 |
| commit | 5f955749eb99e53304338453e351c9f8e5f5a2f7 (patch) | |
| tree | 88563277f9569ee078974a57f19a02c555b3757c /cheesemap.h | |
| parent | e4cd519363547444be338ff087a559bb0490c5f1 (diff) | |
finishing wrapper
Diffstat (limited to 'cheesemap.h')
| -rw-r--r-- | cheesemap.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cheesemap.h b/cheesemap.h index 423ec17..d1f72ef 100644 --- a/cheesemap.h +++ b/cheesemap.h @@ -140,6 +140,11 @@ void cm_new(struct cheesemap* map, uintptr_t key_size, uintptr_t value_size, uint8_t* mem_usr, cm_malloc_fn malloc, cm_free_fn free, uint8_t* map_usr, cm_hash_fn hash, cm_compare_fn compare); void cm_drop(struct cheesemap* map); +bool cm_insert(struct cheesemap* map, const uint8_t* key, + const uint8_t* value); +bool cm_lookup(struct cheesemap* map, const uint8_t* key, uint8_t** out_value); +bool cm_remove(struct cheesemap* map, const uint8_t* key, uint8_t* out_value); +bool cm_reserve(struct cheesemap* map, uintptr_t additional); //////////////////////////////// // cheesemap iterators @@ -159,6 +164,14 @@ void cm_raw_iter_init(struct cheesemap_raw_iter* iter, bool cheesemap_raw_iter_next(struct cheesemap_raw_iter* iter, uintptr_t entry_size, uintptr_t* out_index); +struct cheesemap_iter { + uintptr_t key_size, value_size; + struct cheesemap_raw_iter raw; +}; + +void cm_iter_init(struct cheesemap_iter* iter, const struct cheesemap* map); +bool cm_iter_next(struct cheesemap_iter* iter, const struct cheesemap* map, + uint8_t** out_key, uint8_t** out_value); #ifdef __cplusplus } |
