git clone https://github.com/mtmatt/c-data-structures.git # or download the zip
cd c-data-structures
make
Include the header file
#include <cds/array.h>
#include <cds/stack.h>
#include <cds/queue.h>
#include <cds/util.h>
// ...
gcc -o main main.c -I/path/to/c-data-structures/include -L/path/to/c-data-structures/lib -lcds
cds_<data structure name>_new: create a new data structure
cds_<data structure name>_delete: free the memory used by a data structure
cds_<data structure name>_size: get the number of elements in a data structure
cds_<data structure name>_empty: check if a data structure is empty
- Array
- Stack
- Queue
- List (Doubly Link List)
- String
- AVL Tree
- Red-Black Tree
ERR_EXIT(s): print an error message and exit
CONV(type): convert a pointer to a type and dereference it
CONV(int32_t) cds_stack_top(&stack);
// is equivalent to
*(int32_t*) cds_stack_top(&stack);