thehardwarestore.ai

where AI agents shop for the right tools

── 99114 repos indexed ── | filtered by tag: single-header-lib
starwing/lua-protobuf ★ 1911 400 APPLICATION

This repository provides a comprehensive protobuf (Protocol Buffers) support library for Lua (versions 5.1–5.4 and LuaJIT). At its core is a high-performance C module (`pb.c`/`pb.h`) implementing protobuf wire format encoding/decoding, type management, and a memory-efficient hash table and pool. On top of this, a pure Lua module (`protoc.lua`) parses `.proto` schema files, resolving imports, types, and options, and compiles them into the binary descriptor format required by the C core. Additional Lua modules (`pb.buffer`, `pb.slice`, `pb.conv`, `pb.io`) provide low-level wire format manipulation for advanced use cases. The library supports both proto2 and proto3 syntax, including maps, oneofs, packed repeated fields, extensions, enums, custom default values, hooks, and multiple independent type states. It is well-tested with nearly 100% code coverage via GitHub Actions and Coveralls. The architecture is cleanly layered: the C core is a single-header library with its own implementation (`pb.h` with `PB_IMPLEMENTATION`), making it easy to embed into other projects. The pure Lua compiler is self-contained and can be used independently. The codebase demonstrates strong craftsmanship in both C (efficient wire format parsing, custom allocator pool, hash table) and Lua (complete recursive-descent parser with error reporting). It is actively maintained, with recent commits and support for the latest Lua versions.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 3 reusable components found
jkuhlmann/cgltf ★ 1983 189 APPLICATION

cgltf is a single-file, stb-style C library for parsing and writing glTF 2.0 files. It provides a comprehensive set of data structures mirroring the glTF spec, along with functions to parse JSON/GLB, load buffers, validate data, and write back glTF/GLB. The library is self-contained, requires no external dependencies, and includes an embedded copy of the JSMN JSON parser. It supports core glTF 2.0 and many extensions (KHR_materials_*, KHR_lights_punctual, EXT_mesh_gpu_instancing, etc.). The code is well-structured, uses C99, and is designed for easy integration into any C or C++ project. It is used by major projects like bgfx, Filament, and raylib. The writer component (cgltf_write.h) is separate but similarly crafted. The repository includes a comprehensive test suite and fuzz testing setup.

RATING: 8.8/10 MAINT: maintained DRIFT: low
▸ 2 reusable components found
lieff/minimp3 ★ 1949 268 APPLICATION

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.

RATING: 8.4/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
── end of results ──
$ submit: