Nice article! I think eventually you need to move to macros to support multiple key/value types in C. Just leaving some macro implementations for reference:
- https://github.com/attractivechaos/klib/blob/master/khash.h
There are numerous, tested macro libraries to prevent reinventing common data-structure/algorithm bugs.
Here's one: https://github.com/troydhanson/uthash
I use uthash:
https://github.com/troydhanson/uthash
You can compare performance with it and other C hash table implementations.