tezc/sc
FreeCommon libraries and data structures for C.
FreeFree tier
About tezc/sc
A collection of portable, stand-alone C libraries and data structures written in C99. Each library is contained in a single header/source pair for easy drag-and-drop integration. Designed for high performance and minimal memory usage, with broad OS/architecture support. Includes utilities for arrays, buffers, hashmaps, logging, threading, networking, and more.
Key Features
Portable across Linux, macOS, FreeBSD, Windows and multiple architectures (x64, aarch64, armv6, armv7, ppc64le, s390x, riscv64)
High performance with minimal memory usage
Stand-alone C99 libraries with single header/source per module
100% branch coverage with sanitizers and CI on multiple platforms
Easy drag-and-drop source code distribution
Covers data structures (array, heap, map, queue, linked list, disjoint set) and system utilities (socket, thread, timer, logger, crc32, ini parser, uri parser)
Pros & Cons
Pros
- High performance and low memory footprint
- Portable across many operating systems and architectures
- Easy to integrate: just copy the needed source files
- Comprehensive testing with 100% branch coverage and sanitizers
- Well-documented with per-module descriptions
Cons
- Limited to individual C libraries, not a full framework
- Requires manual integration into existing projects
- API design may not suit all preferences
- No build system included (user must copy files manually)
Best For
Building high-performance server-side applicationsImplementing custom protocols and serialization formatsDeveloping cross-platform C programsEmbedded systems requiring lightweight librariesEducational purposes for learning data structures in C
FAQ
Is it any better than library X?
The author often uses these libraries for high performance server-side applications and cares about readable and easy to debug code. The libraries reflect their taste in trade-offs between performance, API design, and readability. You may or may not like it.
Why don't you change API here at X, so it will be easier to use?
The author welcomes pull requests but asks that you do not introduce undefined behavior. They try to avoid undefined behavior in their API design.
What is the most efficient way to use these libraries?
Add the source files to your project and ideally use compiler optimizations like -O3 -flto + PGO. It may not make a difference for your use case though.