mirror of
https://github.com/tezc/sc.git
synced 2025-01-14 06:43:04 +08:00
Overview
Portable, stand-alone C libraries and data structures. (C99)
Most of them are optimized for performance. e.g array, hashmap, queue, timer.
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 array, copy sc_array.h and sc_array.c to your project.
I use on Linux mostly but libraries are portable, CI runs on
OS : Linux, MacOS, FreeBSD and Windows Compilers : GCC, Clang, MSVC Arch : x64, aarch64, armv6(32 bit), armv7(32 bit), ppc64le, s390x(big endian) Sanitizers : valgrind and clang/gcc sanitizers(address, undefined, thread)
List
Library | Description |
---|---|
array | Generic array/vector |
buffer | Buffer for encoding/decoding variables, best fit for protocol/serialization implementations |
condition | Condition wrapper for Posix and Windows |
crc32 | Crc32c, uses crc32c CPU instruction if available |
heap | Min heap which can be used as max heap/priority queue as well |
ini | Ini parser |
linked list | Intrusive linked list |
logger | Logger |
map | A high performance open addressing hashmap |
memory map | Mmap wrapper for Posix and Windows |
mutex | Mutex wrapper for Posix and Windows |
option | Cmdline argument parser. Very basic one |
perf | Benchmark utility to get performance counters info via perf_event_open() |
queue | Generic queue which can be used as dequeue/stack/list as well |
sc | Utility functions |
signal | Signal safe snprintf & Signal handler (handling CTRL+C, printing backtrace on crash etc) |
socket | Pipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows |
string | Length prefixed, null terminated C strings. |
thread | Thread wrapper for Posix and Windows. |
time | Time and sleep functions for Posix and Windows |
timer | Hashed timing wheel implementation with fast poll / cancel ops |
uri | A basic uri parser |
Description
Common libraries and data structures for C.
algorithmalgorithmsccollectionsdata-structuresgenerichashmaphashtableheaplibrarylinked-listloggerpriority-queuequeuesocketstackthreadtimervector
Readme
BSD-3-Clause
1.2 MiB
Languages
C
84.8%
CMake
15.2%