diff -r 83284b289430 -r 3a89b31f0724 src/map.c --- a/src/map.c Wed Oct 15 22:45:21 2025 +0200 +++ b/src/map.c Thu Oct 16 19:57:47 2025 +0200 @@ -84,6 +84,29 @@ // +void cxMapClear(CxMap *map) { + map->cl->clear(map); +} + +size_t cxMapSize(const CxMap *map) { + return map->collection.size; +} + +CxMapIterator cxMapIteratorValues(const CxMap *map) { + if (map == NULL) map = cxEmptyMap; + return map->cl->iterator(map, CX_MAP_ITERATOR_VALUES); +} + +CxMapIterator cxMapIteratorKeys(const CxMap *map) { + if (map == NULL) map = cxEmptyMap; + return map->cl->iterator(map, CX_MAP_ITERATOR_KEYS); +} + +CxMapIterator cxMapIterator(const CxMap *map) { + if (map == NULL) map = cxEmptyMap; + return map->cl->iterator(map, CX_MAP_ITERATOR_PAIRS); +} + CxMapIterator cxMapMutIteratorValues(CxMap *map) { if (map == NULL) map = cxEmptyMap; CxMapIterator it = map->cl->iterator(map, CX_MAP_ITERATOR_VALUES); @@ -105,6 +128,22 @@ return it; } +int cx_map_put(CxMap *map, CxHashKey key, void *value) { + return map->cl->put(map, key, value) == NULL; +} + +void *cx_map_emplace(CxMap *map, CxHashKey key) { + return map->cl->put(map, key, NULL); +} + +void *cx_map_get(const CxMap *map, CxHashKey key) { + return map->cl->get(map, key); +} + +int cx_map_remove(CxMap *map, CxHashKey key, void *targetbuf) { + return map->cl->remove(map, key, targetbuf); +} + void cxMapFree(CxMap *map) { if (map == NULL) return; map->cl->deallocate(map);