Skip to content

binRick/hashmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hashmap

Generic hashmap implemented with the sdbm hash function.
Read more about it here: http://www.cse.yorku.ca/~oz/hash.html

Usage

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");

Installing

Just clone down the repository and run:

make && make install

Using it

To 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>

About

Generic hashmap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages