Home

Awesome

Overview

License: BSD codecov

Portable, stand-alone C libraries and data structures. (C99)

Each folder is stand-alone with a single header/source pair in it. There is no
build for libraries, just copy files you want.

e.g., If you want the logger, copy sc_log.h and sc_log.c to your project.

Features

Test

There is 100% branch-coverage on Linux and CI runs on

<pre> OS : Linux, MacOS, FreeBSD and Windows Compilers : GCC, Clang, MSVC Arch : x64, aarch64, armv6(32 bit), armv7(32 bit), ppc64le, s390x(big endian), riscv64 Sanitizers : valgrind and clang/gcc sanitizers(address, undefined, thread) </pre>

List

LibraryDescription
arrayGeneric array/vector
bufferBuffer for encoding/decoding variables, best fit for protocol/serialization implementations
conditionCondition wrapper for Posix and Windows
crc32Crc32c, uses crc32c CPU instruction if available
heapMin heap which can be used as max heap/priority queue as well
iniIni parser
linked listIntrusive linked list
loggerLogger
mapA high performance open addressing hashmap
memory mapMmap wrapper for Posix and Windows
mutexMutex wrapper for Posix and Windows
optionCmdline argument parser. Very basic one
perfBenchmark utility to get performance counters info via perf_event_open()
queueGeneric queue which can be used as dequeue/stack/list as well
scUtility functions
signalSignal safe snprintf & Signal handler (handling CTRL+C, printing backtrace on crash etc)
socketPipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows
stringLength prefixed, null terminated C strings.
threadThread wrapper for Posix and Windows.
timeTime and sleep functions for Posix and Windows
timerHashed timing wheel implementation with fast poll / cancel ops
uriA basic uri parser

Q&A