C header-only

Open-source C projects categorized as header-only

Top 20 C header-only Projects

  • librg

    🚀 Making multi-player gamedev simpler since 2017

  • zpl

    📐 Pushing the boundaries of simplicity

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • 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.

  • 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
  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • 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

  • rexo

    Neat single-file cross-platform unit testing framework for C/C++.

  • Project mention: Show HN: RK Test, a Google Test style library written in C99 | news.ycombinator.com | 2023-12-11

    I really like Google Test, but am planning on doing some embedded development in C, where I sometimes find it awkward to test C code using a C++ library.

    Therefore, I wrote a small unit test library closely mimicking Google Test. It consists of two source files, "rktest.c" and "rktest.h", and is about 1k lines of code and written in C99.

    It uses a trick for self registering tests by placing pointers to the unit test functions into a known place in program memory, that I first learned about from https://github.com/christophercrouzet/rexo/ and https://github.com/Snaipe/Criterion/.

  • 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.

  • c-flags

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

  • 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?

  • cp437.h

    Header only codepage 437 unicode lookup table.

  • c-allocators

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

  • radian

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

  • SaaSHub

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

    SaaSHub logo
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).

C header-only related posts

Index

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

Project Stars
1 librg 1,218
2 zpl 960
3 earcut.hpp 811
4 metalang99 765
5 minicoro 577
6 Tina 250
7 tiny-dream 237
8 ctl 158
9 libcester 58
10 sgc 32
11 rexo 27
12 pega-texto 17
13 Mathc 15
14 exile.h 14
15 roguelike.h 10
16 c-flags 8
17 PoxHash 7
18 cp437.h 3
19 c-allocators 2
20 radian 1

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com