1.4 KiB
1.4 KiB
Personal library for C
Installation
This library can easily be installed using CMake and FetchContent. Add this to your CMakeLists.txt file:
include(FetchContent)
FetchContent_Declare(
htd
GIT_REPOSITORY https://github.com/hugomardbrink/htd.git
GIT_TAG main
)
FetchContent_MakeAvailable(htd)
add_executable(myapp main.c)
target_link_libraries(myapp PRIVATE htd::htd)
Features
Primitives
Use shorter more concise names for common C types.
i8: 8-bit signed integeru8: 8-bit unsigned integeri16: 16-bit signed integeru16: 16-bit unsigned integeri32: 32-bit signed integeru32: 32-bit unsigned integeri64: 64-bit signed integeru64: 64-bit unsigned integerf32: 32-bit floating pointf64: 64-bit floating pointusize: Unsigned integer of the same size as a pointerisize: Signed integer of the same size as a pointer
Data structures
Dynamic array: A dynamic array that can grow and shrink in size.Hash map: A hash map that uses murmur3, open addressing (double hashing) and tombstone deletion.Priority queue: A priority queue that uses a binary heap, custom comparator.
Building
mkdir build
cd build
cmake ..
make
Testing
cd build
ctest
Local install
cd build
make install
Local uninstall
cd build
make uninstall