C header-only

Open-source C projects categorized as header-only

Top 19 C header-only Projects

  • librg

    🚀 Making multi-player gamedev simpler since 2017

  • zpl

    📐 Pushing the boundaries of simplicity

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • earcut.hpp

    Fast, header-only polygon triangulation

  • metalang99

    Full-blown preprocessor metaprogramming

    Project mention: How to convert an enum to string in C++ | news.ycombinator.com | 2023-09-30

    There are also other approaches. Macro variants making use of `__VA_ARGS__` would be probably the best trade-off. If you want a slightly more ergonomic syntax, something like Metalang99 [1] will help (and the author even wrote a post about this exact subject [2]). Codegen is another option which may work better than other options depending on the situation and exact implementation strategy. And there is always the Reflection TS [3], which may or may not be incorporated to C++26...

    [1] https://github.com/Hirrolot/metalang99

    [2] https://hirrolot.github.io/posts/pretty-printable-enumeratio...

    [3] https://en.cppreference.com/w/cpp/experimental/reflect

  • minicoro

    Single header stackful cross-platform coroutine library in pure C.

    Project mention: How Much Memory Do You Need to Run 1M Concurrent Tasks? | news.ycombinator.com | 2023-05-21

    It would be interesting to bench something extremely lightweight (like https://github.com/edubart/minicoro) against these runtimes.

    By my back-of-the-napkin math, 1,000,000 coroutines would cost about 64mb + 2mb/core for stacks.. which works out to about 4x less memory than the 'winner' of this comparison, and ~30x less than go.

  • Tina

    Tina is a teeny tiny, header only, coroutine and job library.

    Project mention: Bunki, a C Coroutine Library | news.ycombinator.com | 2023-03-13
  • tiny-dream

    Tiny Dream - An embedded, Header Only, Stable Diffusion C++ implementation

    Project mention: Tiny Dream – An Embedded, Header Only, Stable Diffusion C++ Implementation | news.ycombinator.com | 2023-09-26
  • Onboard AI

    Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.

  • ctl

    My variant of the C Template Library (by rurban)

    Project mention: A header-only C implementation of C++ <algorithm> | news.ycombinator.com | 2023-07-03

    Well, I do like mine better, which is closer to the STL, and for all containers. https://github.com/rurban/ctl/

  • libcester

    A robust header-only unit testing framework for C and C++ programming language. Support function mocking, memory leak detection, crash report.

  • sgc

    Generic Algorithms and Data Structures in C

  • pega-texto

    Single-file Parsing Expression Grammars (PEG) runtime engine for C

  • Mathc

    A simple and clean, glsl like, math (linear algebra) header only library for C.

  • exile.h

    Painless Linux sandboxing API

  • roguelike.h

    Header only roguelike rendering library.

  • PoxHash

    A block hashing algorithm with implementations in C, Rust, Go, Nim, Python and JS

    Project mention: How do crypto functions deal with the issue of character size? (e.g. Unicode) | /r/cryptography | 2023-06-18

    Hey guys. If you remember me from several months ago, with this object de art, I am here with a less cringy question than that of 'I made a hash function!!!111'. I apologize if this question is basic btw. My question is, how do crypto functions, of any kind, deal with character size? For example in C, wchar_t is either 2 or 4 bytes. So, if the implementation goes through the stream like stream++ it will be stepping word-wise not byte-wise. And then if another machine, using a different implementation, reads the stream byte-wise and not word-wise, then it won't get the same message right?

  • c-flags

    Library for parsing command line arguments easily. Like golang flag module.

  • cp437.h

    Header only codepage 437 unicode lookup table.

    Project mention: Possible security issues allowing multibyte chars? | /r/C_Programming | 2023-02-23

    Dwarf Fortress Tilesets are CP437, and libtcod has a CP437 mode, and we even easily map them to Unicode with cp437.h.

  • radian

    Header-only library of macros to assist with reading and writing big/little endian values. (by raddari)

  • c-allocators

    A collection of public domain single-file custom allocators for C/C++

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-09-30.

C header-only related posts


What are some of the best open-source header-only projects in C? This list will help you:

Project Stars
1 librg 1,156
2 zpl 921
3 earcut.hpp 765
4 metalang99 702
5 minicoro 532
6 Tina 233
7 tiny-dream 209
8 ctl 147
9 libcester 57
10 sgc 32
11 pega-texto 17
12 Mathc 15
13 exile.h 14
14 roguelike.h 10
15 PoxHash 7
16 c-flags 7
17 cp437.h 3
18 radian 1
19 c-allocators 0
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives