Skip to content
Snippets Groups Projects
Forked from Knot projects / Knot Resolver
8721 commits behind the upstream repository.
README.rst 950 B

Generics library

This small collection of "generics" was born out of frustration that I couldn't find no such thing for C. It's either bloated, has poor interface, null-checking is absent or doesn't allow custom allocation scheme. BSD-licensed (or compatible) code is allowed here, as long as it comes with a test case in tests/test_generics.c.

  • array - a set of simple macros to make working with dynamic arrays easier.
  • map - a Crit-bit tree key-value map implementation (public domain) that comes with tests.
  • set - set abstraction implemented on top of map.
  • pack - length-prefixed list of objects (i.e. array-list).

array

map

set

pack