Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noonat/hashtable

C hash table based on Lua's table implementation
https://github.com/noonat/hashtable

Last synced: 1 day ago
JSON representation

C hash table based on Lua's table implementation

Awesome Lists containing this project

README

        

A simple C hash table based on Lua's table implementation. This version does
*not* include any of Lua's special-case numeric array handling.

Example:

table_t table;
table_init(&table, H_STRING, NULL, NULL);
table_set(&table, (hvalue_t)"foo", 1);
table_set(&table, (hvalue_t)"bar", 2);
table_get(&table, (hvalue_t)"foo"); // 1
table_get(&table, (hvalue_t)"bar"); // 2
table_get(&table, (hvalue_t)"baz"); // 0
table_destroy(&table);