Rabbit Tree
Radix bit tries for implementing associative arrays and sets in C.
Remarks

Coding Style

I am relatively new to C, which I am sure is the first thing that you want to hear from the author. If you see something in the code that could have been done much more elegantly or efficiently, it is probably because I did not know how. My goal is to improve the code along with my understanding of C, so please share any insights on how I can do so.

Macro Abuse

I use macros extensively to provide the greatest versatility. It may be possible to replace some of them with inline functions but for many that would be too restrictive. I have attempted to limit their use to what I consider necessary, but some will nevertheless find even this too much.

I use what works. If you have a better suggestion, I will gladly hear it.

Incidentally, the first draft implementation used macros for everything. I soon realized just how difficult that was to maintain and rewrote everything from scratch.

Stability

I will try to keep the interface stable but I guarantee nothing. The code is still fresh and largely untested in real-world contexts. If I suddenly realize that I did something the wrong way (see previous section) then I will change it. Initially I do not expect many if anyone else to use this, so interface changes will not be a problem. If others do begin to use the code then I will try to stabilize the interface while taking into account feedback.

Utility

Some may ask why I even bothered writing this. Dictionaries have been implemented every which way possible and surely far more competent people have come up with better solutions than this.

I started to write this one day when I needed a dictionary type for some small C script that I was writing. After a quick search for implementations I found that most pulled in a load of dependencies or were not readily packaged.

I admit that I did not look very long or hard though, but I had already begun thinking about ways that I could implement a dictionary myself. The concept of radix bit tries occurred to me quite quickly, even if I did not know their technical name at the time. A binary tree that forks based on bit values strikes me as very natural.

Once I had that idea in my head, I just started to code. Most of the code that I write begins with a bit of curiosity and some free time (well, usually procrastination, but it's almost the same thing, at least until the deadline).

In addition to ending up with something that I consider useful, it has also served as a pet project with which I have familiarized myself with C to a point of feeling comfortable. I obviously haven't delved too deep, but deep enough to have come across several different things. Finally, coming from high-level languages, I actually find it fun to fiddle bits (<insert joke here>) and implement things that those languages provide out of the box.

Whether or not this proves to be comparably efficient to more widely-used alternatives, I expect it to suffice for my own applications. It frees me from dealing with others' dependencies and it lets me easily tweak it when needed.

In short, it suites me and I provide it in case it suites someone else. It is up to you to determine if it is useful for you.

Source Code Management

I manage the source code internally with Git, but I rewrite history so often that I could work for Minitrue. At some point I will stop this and upload the repository.

Contact
echo xyne.archlinux.org | sed 's/\./@/'