Skip to content

mvslovers/hashmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hashmap

A simple generic hashmap, and double linked list, implementation in C.

This fork is a port that is providing a JCC compatible version of hashmaps.

Usage

All hash map API functions are prefixed as hashMap*.

#include "hashmap.h"

// The larger the better
size_t size = 50;

HashMap *map = hashMapNew(size);

// Insertion/Setting
hashMapSet(map, "libname", "hashmap");
hashMapSet(map, "author", "mech");
hashMapset(map, "author", "mecha"); // Overrides
hashMapSet(map, "foo", "bar");

// Removal
hashMapDelete(map, "foo");

// Retrieval
hashMapGet(map, "libname"); // "hashmap"
hashMapGet(map, "author"); // "mecha"

// Existence check
hashMapHas(map, "libname"); true
hashMapHas(map, "foo"); // false

Releases

No releases published

Packages

No packages published