No description
- C 98.3%
- CMake 1.4%
- Shell 0.2%
Module pages describe the public contract: what to call, what you own, and what the return values mean. Historical bugs, rename notes, and implementer asides are gone. Examples use generic paths. |
||
|---|---|---|
| .forgejo/workflows | ||
| docs | ||
| include | ||
| src | ||
| tests | ||
| .gitignore | ||
| clanggen.sh | ||
| CMakeLists.txt | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
libflint
A C library of containers and helpers. Supports Linux, macOS, OpenBSD, and FreeBSD.
Documentation
Module documentation. The files under tests/ are also usable as examples.
Building
CMake is required. Use CMake directly, or the Makefile, which is a thin wrapper around it.
CMake
# If libflint is in ./lib/libflint
add_subdirectory(lib/libflint)
# when building a target...
target_link_libraries(${TARGET} PRIVATE flint)
The flint target exports include/, so you do not need a separate
target_include_directories for libflint headers. Compile definitions stay on
the flint target and are not added to the rest of your project.
Testing
cmake -B build && cmake --build build
ctest --test-dir build # run all tests
ctest --test-dir build --parallel # run in parallel
ctest --test-dir build --label-exclude slow # skip slow tests (macos)
# AddressSanitizer + UndefinedBehaviorSanitizer
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DFLINT_SANITIZE=ON
cmake --build build && ctest --test-dir build --output-on-failure -LE slow
Requirements
A C99 compiler and CMake. Linux needs libbsd (strtonum in the input module). macOS, OpenBSD, and FreeBSD need no extra libraries.
Libraries
Overflow-checked array allocation is provided as lf_reallocarray in lfcompat.h on every platform.