- Notifications
You must be signed in to change notification settings - Fork1
ksheedlo/kmdata
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
kmdata -- Data structures for C programmers, by C programmers.MISSION STATEMENTkmdata provides a simple, generic, and open set of abstractions for datastructures in the GNU C99 language. kmdata structures are highly efficient,performant, and portable without sacrificing generality. If you hate the STLand the general bloat of C++ but find yourself reinventing the wheel over andover again in C, kmdata has your back.Breaking that down further:Efficiency - kmdata chooses asymptotically optimal algorithms and structures.Performance - All algorithms and structures are tested and optimized for the x86/Linux platform.Portability - Written to compile and perform out of the box on IA32 and amd64 systems. I haven't attempted a port to another architecture yet, but I'm sure ARM is not out of the question.DOCUMENTATIONThere is some. Not too much. Users shouldn't call functions starting with an underscore. Other than that, most structures follow a similar pattern for usage.dict_t dict;dict_init(&dict);...dict_clear(&dict, DICTHT_FREE_KEYS | DICTHT_FREE_VALUES);The above code declares and initializes a dict, does some stuff with it, andclears it, freeing keys and values as it goes. Most clear functions have flagsfor specifying whether keys or values (or both) should be freed as the datastructure is being cleared out. Users should always call the init functionbefore starting to use a structure, and the clear function when finished.The exception is the tuple type, which is so simple it practically documentsitself.