I'm writing a general-purpose hash table library in C. Given a user-defined struct type named H whose
first member is named key
, I want the user to be able to use variables of type H* to represent
an array of type H, with an associated hash table that allows quick lookups of elements in the
array by the value of the key.
The key can be anything. Right now I'm supporting three types of keys:
- arbitary data with a fixed byte size
- a pointer to a null-terminated string
- a size_t followed by a pointer to arbitary data with that size