CSTL is a C library of container, algorithms, and iterators, each providing many fundamental computer science algorithms and abstract data types. CSTL’s components are heavily parameterized: almost every component library can be tailored to a specific end application.
The goal of the library is to mimic the C++ Standard Template Library as closely as possible, while remaining a C89 library. The library is also written to minimize RAM usage as much as possible. Most of the familiar STL containers are found in CSTL and exibit identical behavior, with a few notable exceptions:
- None of the containers invoke C++ constructors/destructors. That is, if compiled for C++, constructors and destructors are not invoked when elements are added/removed.
- Heap free containers, algorithms, and iterators are provided and can be used. This allows CSTL to compile on small microcontrollers with restricted RAM availability.
CSTL will compile on any C89 compiler, with one notable exception:
- A C99 stdint.h header must be defined for CSTL to compile.
Environments lacking a stdint.h header can be easily amended: CSTL is designed to readily accept custom stdint header files.
CSTL was successfully compiled and used on the following processor families:
- X86
- X64
- Microchip PIC18
- Microchip PIC24
- Microchip PIC32
- Atmel AVR
- And many more.
CSTL is released under the Apache V2.0 license, and therefore, free to use. You may download the library here.