Each and every piece of libwayne was written because I needed it, but only things that I took careful time to do well went into libwayne . Any algorithm that needs to compare objects needs a comparison function like the one used by the ANSI standard qsort routine. The array grows as necessary using realloc , so you don't need to know the maximum size a priori , although you need to give it an initial guess. Here's what its header file looks like. Of course, they use my heap routines.
Events are function pointers that get called when the appropriate event is activated.
I found it very useful for prototyping even complicated event-driven simulations. All these routines are very fast, since almost every operation is just a few bit manipualitons. I wrote these for my Ramsey Graph searching. The last two search for cliques and independent sets on an arbitrary graph using the brute-force exponential time algorithm. The latter is good for sorting large objects.