Ctools is a collection of generic data structures implemented in C.
Designed as an educational resource, Ctools offers idiomatic C implementations of common data structures. It uses void* to provide type-agnostic storage and sticks to the core C89/C99 standard, making it portable and easy to understand.
- Vec – A dynamic array
- Map – A simple hash map
- Linked List – A singly linked list implementation
All structures support manual memory management, putting you in full control of allocations and lifetimes.
- Type-agnostic (
void*-based) interfaces - No external dependencies
- Dynamically resizing containers
- Simple, portable C89/C99-compatible code
- Minimal API surface for learning and extension
Each data structure includes working demo files:
cmake .
./build/vecExample
./build/mapExample
./examples/listExamplegit clone https://github.com/anthonyb8/cvec.git libs/cvecgit submodule add https://github.com/anthonyb8/cvec.git libs/cvecadd_subdirectory(libs/cvec)
target_link_libraries(my_app PRIVATE cvec)
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.