Emhashmap
This library is an implementation of a hash map in C that maps integers to void pointers
Install / Use
/learn @openxc/EmhashmapREADME
Generic C Hash Map for Embedded Systems
This library is an implementation of a hash map in C that maps integers to void pointers. The map is initialized with a fixed size and load factor, and memory is allocated on the heap all at once. There are no dependencies besides the BSD queue.h, which is included in most systems by default.
Compiling
$ make
Test Suite
Dependencies
- check
This library has a test suite built with the check C library. Run the tests
like so:
$ make test
Examples
#include "emhashmap.h"
#define MAX_CAPACITY 64
HashMap map = emhashmap_create(64);
int key = 42;
char* value = "foo";
emhashmap_put(&map, key, (void*)value);
bool contains = emhashmap_contains(list, key);
// contains == true
int size = emhashmap_size(&map);
// size == 1
emhashmap_remove(&map, key);
emhashmap_is_empty(&map);
// == true
emhashmap_destroy(&map);
License
This library is licensed under the BSD license and is Copyright 2014, Ford Motor Company
Contributors
- Chris Peplin, cpeplin@ford.com
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
