Apple map is a C library written in half an hour, that implements a hashmap using FNV-1a hashing algorithm.
Create a hashmap in 1 line of code:
apple_map *map = apple_map_new();Add entries into it in 1 line of code:
apple_map_insert(
map,
"hello", // key
sizeof("hello") - 1,
1 // value
);Remove entries from it in 1 line of code:
apple_map_remove(map, "hello", sizeof("hello") - 1);Resolve values by keys in 1 function call:
uintptr_t value;
if (apple_map_get(map, "hello", sizeof("hello") - 1, &value)) {
printf("map[\"hello\"] = %d\n", value);
}And finally free the map:
apple_map_free(map);You can take a look at examples here.