Why this library

C is a low level language and lacks all the data structures that we commonly use. Many high level languages already come with these collections so that we don't have to implement everything ourselves. A lot of third party libraries that implement these missing data structures for the C language usually make use of a void pointers and a lot of macros. This is why the C Macro Collections Library was created. All you need to do is to write down one macro and which data type you wish to work with. The library currently provides many data structures, such as:

  • Linear Collections : List, LinkedList, Deque, Stack, Queue, SortedList
  • Sets : HashSet, TreeSet, MultiSet
  • Maps : HashMap, TreeMap, MultiMap, BidiMap
  • Heaps : Heap, IntervalHeap

All with the following features:

  • Type-safe - No void * pointers are used. A collection of type int will only accept integers;
  • Customization - Custom struct name and function namespace;
  • Bidirectional Iterators - Full support for iterators;
  • Nesting - Collections can be nested (List of Lists, HashSet of Stacks, etc);
  • One macro to rule them all - Only one macro to generate everything and that's it.

and many other powerful features (see Features).