Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

IvanoBilenchi/uhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uHash - a type-safe, generic C hash table.

⚠️ Important note ⚠️

uHash is now part of the uLib library. All further development has moved there.

Author

Ivano Bilenchi

Description

Implementation of a type-safe, generic hash table data structure written in C. It's a fork of klib's khash, aimed at extending its API and providing additional configuration options.

Features

  • Hash table primitives (uhash_get, uhash_put, uhash_delete, uhash_contains, ...)
  • Iteration macros (uhash_foreach, uhash_foreach_key, uhash_foreach_value)
  • Map-specific high-level API (uhmap_get, uhmap_set, uhmap_remove, ...)
  • Set-specific high-level API (uhset_insert, uhset_remove, uhset_is_superset, ...)

Usage

If you are using CMake as your build system, you can add uHash as a subproject, then link against the uhash target. Otherwise, in general you just need the uhash.h header.

Documentation

Documentation for the project is provided in form of docstrings in the Public API section of uhash.h. You can also generate HTML docs via CMake, though you will also need Doxygen. For usage examples, see test.c.

CMake targets

  • uhash: interface library target, which you can link against.
  • uhash-docs: generates documentation via Doxygen.
  • uhash-test: generates the test suite.
  • uhash-bench: generates benchmarks.

License

uHash is available under the MIT license. See the LICENSE file for more info.

Releases

No releases published

Packages

No packages published