This repository is the well-known stb single-file public domain C/C++ library collection by Sean Barrett. It contains over 20 self-contained header-only libraries covering a wide range of functionality: image loading and writing (stb_image, stb_image_write), image resizing (stb_image_resize2), TrueType font parsing and rasterization with signed-distance fields (stb_truetype), Ogg Vorbis audio decoding (stb_vorbis), dynamic data structures (stb_ds), high-performance formatted output (stb_sprintf), rectangle packing (stb_rect_pack), text editing widget logic (stb_textedit), Perlin noise (stb_perlin), voxel rendering (stb_voxel_render), tilemap editing (stb_tilemap_editor), and many more. Each library is designed to be dropped into a project by including the header and defining an implementation macro in exactly one source file, requiring no external dependencies beyond standard C libraries. The repo also includes extensive test programs, fuzzing harnesses, and demo applications (e.g., a Minecraft-style voxel viewer, font oversampling demo). It is widely used in game development, tooling, and embedded systems due to its ease of integration and permissive licensing.
pugixml is a lightweight, high-performance C++ XML processing library that provides a DOM-like interface, a fast non-validating parser, and XPath 1.0 support. It is designed for embedding into other applications and is used widely in game development, desktop applications, and embedded systems. The library is distributed as a single source file (`pugixml.cpp`) and header (`pugixml.hpp`), with optional header-only mode and extensive compile-time configuration via `pugiconfig.hpp`. It supports automatic encoding detection (UTF-8, UTF-16, UTF-32, Latin1), BOM handling, and full Unicode conversion. The architecture is monolithic but well-organized: the core parser uses recursive descent with custom memory pooling (page-based allocator) for fast DOM construction. The DOM tree is exposed through lightweight handle classes (`xml_node`, `xml_attribute`, `xml_text`) with iterator support for children and attributes. XPath queries are compiled into an internal representation and evaluated against the tree with full axis, function, and predicate support. Output is handled via an abstract `xml_writer` interface, allowing custom sinks. The library has zero external dependencies beyond the C++ standard library. Key entry points include `xml_document::load_file`, `load_buffer`, `load_string`, and `save_file`. Data flows involve loading XML from files, memory buffers, or streams into an in-memory DOM, then performing traversal, modification, or XPath queries, and finally saving the modified document. The library is used in production for parsing configuration files, serializing data, and processing XML messages in network protocols. It has an extensive test suite covering parsing edge cases, XPath compliance (W3C and Xalan), memory stress tests, and fuzzing harnesses. The codebase demonstrates strong craftsmanship: template-based parser specializations avoid runtime branching, memory management hooks allow custom allocators, and the compact mode reduces footprint for constrained environments. The library is well-maintained with active CI (GitHub Actions, AppVeyor), fuzz testing, and support for many compilers and platforms. The only notable technical drift is the continued support for legacy compilers (MSVC6, Borland), which adds preprocessor complexity but does not affect modern usage.
This repository provides a single-header C/C++ library (utf8.h) for UTF-8 string manipulation. It implements a comprehensive set of functions mirroring the standard C string.h and strings.h APIs, but operating on UTF-8 encoded strings with codepoint-aware semantics. The library includes functions for length calculation (utf8len), comparison (utf8cmp, utf8casecmp), concatenation (utf8cat), searching (utf8chr, utf8str, utf8casestr), validation (utf8valid, utf8makevalid), case conversion (utf8lwr, utf8upr), and codepoint extraction (utf8codepoint, utf8rcodepoint). It supports C++14 constexpr for many functions and C++20 char8_t. The code is highly portable, tested across multiple compilers (gcc, clang, MSVC, tcc) and platforms (Linux, macOS, Windows), and includes extensive unit tests covering edge cases like invalid sequences, truncated strings, and case mapping for Latin, Greek, and Cyrillic scripts. The library is self-contained with no external dependencies beyond the standard C library.
utest.h is a single-header unit testing framework for C and C++ that provides automatic test registration via constructor attributes, sophisticated assertion macros with expression tracking, and cross-platform support. The framework supports basic tests, fixture-based tests, and indexed/parameterized tests. It outputs results in both human-readable console format and machine-readable XML format. The implementation demonstrates high craftsmanship through its platform abstraction layer, memory-safe test registration system, and clever use of compiler-specific features to eliminate boilerplate. The core functionality is entirely self-contained within utest.h with no external dependencies beyond standard libraries.
httpserver.h is a single-header C library for building high-performance, non-blocking, event-driven HTTP servers. It uses epoll on Linux and kqueue on BSD/macOS for I/O multiplexing, and includes a Ragel-generated HTTP parser that handles chunked transfer encoding, content-length bodies, streaming, and keep-alive connections. The library exposes a clean callback-based API: initialize a server with a port and request handler, then call listen to start the event loop. It also supports a poll mode for integration into existing event loops (e.g., game engines). The codebase is well-structured internally, split into separate compilation units that are concatenated into a single header at build time via M4. It includes comprehensive unit tests (using munit), functional tests (shell-driven), fuzz testing, and CI. Production-grade features include memory usage limits, request timeouts, connection management, and chunked response support. The architecture demonstrates strong C craftsmanship with clear separation of I/O, parsing, response formatting, and connection management.
JsonCpp is a C++ library for parsing, manipulating, and generating JSON data. It distinguishes itself by preserving comments during both parsing and serialization, making it suitable for configuration files and user-editable JSON where comments are important. The library is designed for stability and reliability, prioritizing security and compatibility over performance or new features, and maintains support for pre-C++11 toolchains. The architecture is that of a classic C++ library, providing header-only or separately compiled components. The core is the `Json::Value` class, which acts as a discriminated union for JSON types and includes iterator support for traversing objects and arrays. Configuration of parsing and writing behavior is handled via the builder pattern (`StreamWriterBuilder`, `CharReaderBuilder`) and feature toggles (`Json::Features`). The library minimizes external dependencies, relying only on the C++ standard library, and provides amalgamation scripts for easy integration. Key entry points include the main header `include/json/json.h` which aggregates the core components, and the library is built from source in `src/lib_json/`. Data flows involve parsing JSON input (from strings or streams) into a `Json::Value` DOM tree, manipulating the tree as needed, and serializing it back to JSON output. The library is actively maintained, with a focus on long-term stability and security, and exhibits low technical drift due to its intentional avoidance of unnecessary changes.
minimp3 is a minimal, high-performance, ISO-conformant MP3 decoder implemented as a single-header C library (minimp3.h). It provides a low-level frame decoding API and a higher-level streaming/seek API (minimp3_ex.h) with callback-based I/O abstraction. The decoder supports SSE and NEON SIMD acceleration, and compiles to a ~30kB binary with zero external dependencies. The repository includes a comprehensive test suite with over 50 test vectors covering standard and edge-case MPEG audio streams, a fuzzing harness, and a full-featured GUI player (using SDL2 and Nuklear) that demonstrates real-world usage. An additional tool (huffopt) generates optimized Huffman tables for Layer III. The library is designed for embedded systems, game engines, and any environment requiring a lightweight MP3 decoder.
par is a collection of single-file C libraries, stb-style, focused primarily on graphics, geometry, and utility functionality. The code is not an end-user application; each header is the unit of delivery. To use a library, a consumer defines the corresponding IMPLEMENTATION macro before including the header, which expands the implementation into one translation unit. This imposes a straightforward integration model for C and C++ projects. Core shipped capabilities include procedural mesh generation (par_shapes), triangulation of streamlines and curves (par_streamlines), blue-noise sampling via recursive Wang tiles (par_bluenoise), circle packing for hierarchical bubble diagrams (par_bubbles), camera controls, easings, file caching with optional LZ4 (par_filecache), string blocks, spatial pruning (par_sprune), and an experimental marching-squares image-to-mesh converter (par_msquares), which the README explicitly marks as unmaintained. The test suite is unusually thorough for a header library: it builds with CMake, runs under gcc and clang through Travis CI, checks C/C++ linkage, and uses vendored LodePNG, LZ4, SDS, and cgltf to validate outputs and exercise edge cases. Though not a data-research repository, several algorithms are grounded in published research (e.g., Kopf recursive Wang tiles, Wang circle packing) and are implemented with reusable, self-contained patterns. The main risks are drift in vendored third-party code, some POSIX assumptions that can hamper Windows portability, and the deprecated par_msquares component. Overall, the code demonstrates strong craftsmanship in the single-header genre.
vkbind is a Vulkan API loader and code generator that creates a single header file containing all Vulkan API definitions and functions for dynamically loading Vulkan functions. It parses the official Vulkan XML specifications (vk.xml and video.xml) to generate a comprehensive C header that eliminates the need for the official Vulkan SDK. The generated header includes type definitions, enumerants, function prototypes, and loader functions like vkInit(), vkInitInstanceAPI(), and vkBindAPI() for accessing Vulkan functionality across different platforms.
Peanut-GB is a high-speed, portable Game Boy (DMG) emulator library implemented as a single C99 header file (peanut_gb.h). It provides a complete emulation core including CPU, memory, LCD, cartridge (MBC1/2/3/5), RTC, serial link, and boot ROM support. The library is designed for easy integration into other projects via a callback-based architecture where the frontend provides ROM read, RAM read/write, error handling, and optional LCD line drawing and audio callbacks. The repository includes multiple example frontends demonstrating integration with SDL2 (full emulator with audio and controls), MiniFB (minimal X11 framebuffer), a debug CLI, a Nuklear-based GUI debugger with disassembler and VRAM viewer, and a benchmark tool. A test suite using the minctest.h framework runs Blargg's CPU instruction and timing tests as well as the dmg-acid2 LCD hash test. The library is MIT-licensed and has been used in several real-world projects (Pico-GB, CPBoy, PlayGB). While the core is well-crafted and portable, known inaccuracies exist (line-by-line LCD rendering, audio timing) and some features are incomplete (MBC6/7, camera). The build system is fragmented across Makefiles and CMake, and some examples have version drift in vendored dependencies.
This repository serves as a curated catalog of single-file C and C++ libraries that meet specific criteria: usability from C or C++, minimal dependencies (at most two files), and cross-platform compatibility. It does not contain executable code or runtime functionality; instead, it provides a static reference list organized by category (e.g., audio, graphics, math) in README.md, supplemented by GitHub contribution templates. The project functions as a developer resource for discovering lightweight libraries, with no data processing, APIs, or dynamic behavior. The architecture is entirely static: the sole meaningful content is README.md, which presents the library list in a formatted table. The .github directory contains standard issue and pull request templates, indicating an expectation of community contributions, but there is no source code, build system, or runtime dependencies. The repository relies entirely on GitHub's Markdown rendering for delivery, resulting in zero external dependencies beyond the hosting platform. Despite high community engagement (9,983 stars, 651 forks), the maintenance assessment indicates staleness due to the absence of recent commits (last commit timestamped 2026-08-18, implying no updates for over six months relative to a current analysis date). Technical drift is negligible as the static nature eliminates dependency risks or API obsolescence. While the list is well-organized and fulfills its purpose as a reference, it lacks reusable software components, as the content is purely informational rather than modular code.