Generic hashmap implemented with the sdbm hash function.
Read more about it here: http://www.cse.yorku.ca/~oz/hash.html
Here is an example:
#include <hashmap/map.h>
map_T* map = NEW_MAP();
// set
map_set(map, "xyz", strdup("123"));
// get
map_bucket_T* bucket = map_get(map, "xyz");
printf("%s\n", (char*)bucket->value) // "123"
// unset
map_unset(map, "xyz");Just clone down the repository and run:
make && make installTo use it in a project, simply install it first, then compile your program with the following flags:
-lm -lhashmap
Then just:
#include <hashmap/map.h>