Awesome C
A curated list of C good stuff. This list contains only free software for code, and sellers who aren't evil for physical resources.
This is released under the GNU Free Documentation License - its text is provided in the LICENSE file.
Compilers
- Clang - A C compiler for LLVM. Supports C11. NCSA.
- CompCert - A fully-verified C compiler. Supports almost all of C89. GNU GPL2.1.
- GCC - Provides a C compiler as part of its compiler set. Supports C11 and OpenMP. GNU GPL3.
- PCC - A very old C compiler. Supports C99. Various licenses, all free.
- TCC - Tiny C Compiler; a small, fast C compiler. Supports C99 (except complex types). GNU GPL2.1.
Crypto
- GnuTLS - A secure communication library, implementing SSL, TLS and DTLS. GNU LGPL2.1.
- libgcrypt - A general-purpose cryptography library, with a range of available ciphers. GNU GPL2.1 and GNU LGPL2.1.
- LibreSSL - A BSD fork of OpenSSL. Various licenses, all semi-free.
- OpenSSL - Implementation of the SSL and TLS protocols, and also includes a cryptography library. Dual Licensed under the OpenSSL License and the SSLeay License
- libsodium - A modern and easy-to-use crypto library. Expat.
Database
This lists databases and data stores with C APIs.
- Hiredis - A minimalistic client library for Redis. 3-clause BSD.
- LMDB - An ultra-fast, ultra-compact key-value embedded data store. newOpenLDAP.
- MariaDB - A robust, scalable and reliable SQL server, designed to be a drop-in replacement for MySQL. 3-clause BSD.
- mongo-c-driver - A high-performance client library for MongoDB. Apache2.0.
- PostgreSQL - A powerful object-relational database system. PostgreSQL licence
- Redis - An advanced key-value store. 3-clause BSD.
- sophia - A modern, embeddable key-value database. FreeBSD.
- SQLite - A self-contained, serverless, zero-configuration, transactional SQL database engine with a C interface. Public domain.
- UnQLite - A self-contained, serverless, zero-configuration, transactional NoSQL engine with a C interface. FreeBSD.
Editors
These are specifically fancier, IDE-type editors. If you want a programmer's text editor, and yours doesn't support C, I'd be quite surprised.
- Anjuta DevStudio - The GNOME IDE. GNU GPL3.
- Code::Blocks - An extensible, configurable IDE supporting C. GNU GPL3.
- CodeLite - A cross-platform IDE. GNU GPL2.1.
- Eclipse - An IDE written in Java. EPL.
- Geany - A very small and fast IDE. GNU GPL2.1.
- KDevelop - The KDE IDE. GNU GPL2.1.
- NetBeans - Another IDE written in Java. GNU GPL2.1 or CDDL.
Environments
This is a list of technologies designed to bring Windows into the 21st century with respect to support for C.
- Cygwin - Designed to emulate a POSIX-compatible environment extensively under Windows. Various licenses, all free.
- MinGW - A minimalist environment for C development on Windows. Various licenses, all free.
Frameworks
This section has big libraries that provide data structures and other stuff you expect of a 'modern' standard library.
- APR - Apache Portable Runtime; another library of cross-platform utility functions. Apache2.0.
- C Algorithms - A collection of common algorithms and data structures for C. ISC.
- EFL - A large collection of useful data structures and functions. Various licenses, all free.
- GLib - A library of utility functions and structures, designed to be portable, efficient and powerful. GNU LGPL3.
- GIO - A modern and easy-to-use VFS API. GNU LGPL3.
- GObject - An object-oriented system and object model for C. GNU LGPL3.
- libnih - A lightweight library of C functions and structures. GNU GPL2.1.
- libU - A small library of basic utilities, including memory allocation, string manipulation and logging. 3-clause BSD.
- qlibc - A simple and powerful C library, designed as a replacement for GLib while focusing on being small and light. qLib license (similar to FreeBSD).
- stb - A range of single-file libraries for C. Public domain.
Game Programming
Engines
These are provided as examples of C game programming code.
- Corange - A game engine in pure C. FreeBSD.
- ioquake3 - The Quake3 engine, freed at last. GNU GPL2.1
- Quake - The Quake engine. GNU GPL2.1.
- Quake2 - The Quake2 engine. GNU GPL2.1.
Resources
These are libraries of all sorts that are useful for game programming.
- Allegro - A cross-platform, video game development and multimedia library. zlib.
- CSFML - A binding for SFML in C. zlib.
- FreeGLUT - An alternative to the OpenGL Utility Toolkit. Allows the creation and management of windows with OpenGL contexts. X11.
- GLFW - A multi-platform library for creating windows with OpenGL contexts. zlib.
- RetroArch - The reference frontend for libretro. GNU GPL3.
- SDL - A cross-platform library designed to provide low-level access to audio, keyboard, mouse, joystick and graphics hardware via OpenGL. zlib.
Generic Programming
- klib - Small and lightweight implementations of common algorithms and data structures. Expat.
- SGLIB - Simple Generic Library; an implementation of a range of generic programming structures and idioms in C. GNU GPL3.
Graphics
- Cogl - A GPU graphics and utilities API. GNU LGPL2.1.
- Clutter - A UI library based on OpenGL. GNU LGPL2.1.
- libjpeg - A library for reading and writing JPEG files. Free software license (check the source).
- libjpeg-turbo - A faster library for reading and writing JPEG files. Various licences.
- libxmi - A function library for rasterizing 2D vector graphics. GNU GPL3.
- mozjpeg - An improved JPEG encoder. 3-clause BSD.
- OpenGL - The industry standard for high-performance graphics, with a native C binding. Various licenses.
- SDL2 - Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. zlib
Graphical User Interface
These are specifically widget toolkits.
- Elementary - A widget toolkit. Part of the EFL. GNU LGPL2.1.
- GTK+ - A cross-platform widget toolkit. GNU LGPL2.1.
- IUP - Another cross-platform widget toolkit. Expat.
- Tk - A basic widget toolkit. Part of Tcl/Tk. Tcl/Tk License.
- XForms Toolkit - A widget toolkit designed for the XWindow system. GNU LGPL2.1.
JSON
- Jansson - A C library for encoding, decoding and manipulating JSON. Expat.
- jsmn - A minimalistic JSON parser. Expat.
- json-c - A library for working with JSON. Expat.
- WJElement - Advanced JSON manipulation library, with support for JSON Schema. GNU GPL3.
- YAJL - A fast C JSON streaming parser library. ISC
Learning, Reference and Tutorials
This is a list of resources for learning C programming in general, or something useful relating to C programming.
Online
Reference
- C: A Reference Manual 5E (online PDF)
- CERT C Coding Standard
- C FAQ - comp.lang.c Frequently Asked Questions
- Draft C11 standard
- Robert Pike's notes on programming in C
- The C Programming Language 2E (online PDF)
Beginner
- A tutorial on pointers
- Building C Projects
- C Primer Plus 5E (online PDF)
- C Programming Wikibook (online PDF)
- Introduction to 'fun' C
- POSIX Threads Programming tutorial (a little dated, but most of it is still valid and useful)
- The GNU C Programming Tutorial (online PDF)
- Templating in C
Intermediate
- 8 gdb tricks you should know
- 10 C99 tricks
- Diving into concurrency: trying out mutexes and atomics
- Introduction to OpenMP (video)
- OpenMP tutorial (for the OpenMP3 standard)
- memcpy vs memmove
- MPI tutorial
- Object-Oriented Programming with ANSI C (online PDF)
- The lost art of C structure packing
- What a C programmer should know about memory
- What every C programmer should know about undefined behaviour
Advanced
- A quick tutorial on implementing and debugging malloc, free, calloc, and realloc
- Bit twiddling hacks
- I do not know C
- Implementing smart pointers for the C programming language
- Inline functions in C
- Some dark corners of C
- Writing efficient C and C code optimization
Self-study courses
Physical
Reference
- C Pocket Reference - A concise reference book for C99.
Beginner
- C Programming: A Modern Approach - An excellent book to learn the basics from C from.
- Head First C - A 'head-first' style book for learning C.
Intermediate
- 21st Century C - A very good second programming book on C.
- Understanding and Using C Pointers - An in-depth resource on pointers in C.
- ZeroMQ - A book for using ZeroMQ with C.
Advanced
- Expert C Programming: Deep C Secrets - An interesting, in-depth and entertaining look at the innards of C.
Multimedia
- FFMPEG - A complete, cross-platform solution to record, convert and stream audio and video. GNU LGPL2.1, with some parts under GNU GPL2.1.
- GStreamer - A framework for audio and visual media. GNU LGPL2.1.
- lodepng - A simple PNG image decoder and encoder, requiring no other dependencies. 3-clause BSD.
Networking and Internet
- asnlc - A compiler of ASN.1 specifications into C source code. FreeBSD.
- czmq - A high-level binding for ZeroMQ. MPL2.0
- GNU adns - An advanced, easy-to-use, asynch-capable DNS client library and utilities. GNU GPL3.
- GNU SASL - An implementation of the Simple Authentication and Security Layer and a few common SASL mechanism. GNU GPL3.
- GnuTLS - A secure communication library, implementing SSL, TLS and DTLS. GNU LGPL2.1.
- gumbo-parser - An HTML5 parsing library in C99. Apache2.0.
- http-parser - An HTTP request/response parser. Expat.
- libcurl - A client-side URL transfer library, supporting a wide range of formats. curl license
- LibEtPan - A mail library providing an efficient network for IMAP, SMTP, POP and NNTP. 3-clause BSD.
- libev - Yet another event loop. FreeBSD.
- libevent - An event loop replacement for network servers. 3-clause BSD.
- libgss - Generic Security Service. GNU GPL3.
- libhttpd - A library to add basic web server capabilities to an application or embedded device. GNU GPL3.
- libidn - An implementation of the Stringprep, Punycode and IDNA specifications. GNU LGPL2.1.
- libmicrohttpd - A small C library that makes it easy to run an HTTP server as part of another application. GNU LGPL2.1.
- libsoup - A GNOME HTTP client/server library. Uses GObject. GNU LGPL2.1.
- LibreSSL - A BSD fork of OpenSSL. Various licenses, all semi-free.
- lwan - An experimental, scalable, high-performance HTTP server. GNU GPL2.1.
- mihl - A library for implementing an embedded HTTP server. FreeBSD.
- mongoose - Embedded web server for C. GNU GPL2.1.
- nanomsg - A C-based implementation of ZeroMQ. Expat.
- neon - An HTTP and WebDAV client library with a C interface. GNU LGPL3.
- onion - HTTP server library, designed to be easy to use. Apache2.0.
- OpenSSL - Implementation of the SSL and TLS protocols, and also includes a cryptography library. Dual Licensed under the OpenSSL License and the SSLeay License
- oSip - A SIP implementation in C without additional dependencies. GNU GPL3.
- socket99 - A wrapper library for the BSD sockets API.
- Tox - A communication platform, designed to be a Skype-killer. GNU GPL3.
- twitc - A mini C library for interacting with the Twitter OAuth API. GNU GPL3.
- ZeroMQ - High-performance message passing networking library. Implemented in C++, but has a C interface. GNU LGPL3.
Numerical
- apophenia - A library for statistical and scientific computing. GNU GPL2.1 with some exceptions.
- ATLAS - Automatically Tuned Linear Algebra Software. 3-clause BSD.
- BLAS - Basic Linear Algebra Subprograms; a set of routines that provide vector and matrix operations. BLAS license
- CRlibm - Correctly Rounded mathematical library; a modern implementation of a range of numeric routines. GN LGPL3.
- FFTW - The Fastest Fourier Transform in the West; a highly-optimized fast Fourier transform routine. GNU GPL2.1.
- FLINT - Fast Library for Number Theory; a library supporting arithmetic with numbers, polynomials, power series and matrices, among others. GNU GPL2.1.
- GLPK - GNU Linear Programming Kit; a package designed for solving large-scale linear programming, mixed integer programming and other related problems. GNU GPL3.
- GMP - GNU Multple Precision Arithmetic Library; a library for arbitrary-precision arithmetic. GNU GPL2.1 and GNU LGPL2.1.
- GNU MPC - A library for complex number arithmetic. GNU LGPL3.
- GNU MPFR - A library for arbitrary-precision floating-point arithmetic. GNU LGPL2.1.
- GNU MPRIA - A portable mathematics library for multi-precision rational interval arithmetic. GNU GPL3.
- GSL - The GNU Scientific Library; a sophisticated numerical library. GNU GPL3.
- KISS FFT - A very simple fast Fourier transform library. 3-clause BSD.
- LAPACKE - A C interface to LAPACK. 3-clause BSD.
- PARI/GP - A computer algebra system for number theory; includes a compiler to C. GNU GPL3.
- Yeppp! - Very fast, SIMD-optimized mathematical library. 3-clause BSD.
Parallel Programming
- cchan - A small library for channel constructs for inter-thread communication. Public domain.
- ck - Concurrency primitives, safe memory reclamation mechanisms and non-blocking data structures. FreeBSD.
- OpenMP - A set of C pragmas designed to allow for easy parallelization of code. Standard (licensing not applicable).
- pth - A portable implementation for non-preemptive priority-based scheduling for multiple threads of execution. GNU GPL3.
- pthreads - The POSIX thread library. Standard (no license applicable).
- TinyCThread - A portable, small implementation of the C11 threads API. zlib.
Regex
"Some people, when confronted with a problem, think 'I know, I'll use regular expressions'. Now they have two problems." - Jamie Zawinski.
- PCRE - An implementation of regexes identical to that of Perl 5. 3-clause BSD.
- SLRE - Super Light Regular Expression library; a very small implementation of a subset of Perl regex syntax. GNU GPL2.1.
- TRE - A POSIX-compliant, feature-full regex library. FreeBSD.
- T-Rex - Another tiny regex library. zlib.
Serialization
- c-capnproto - An implementation of the Cap'n Proto serialization protocol. Expat.
- libavro - A C implementation of the Avro data serialization system. Apache2.0.
- msgpackalt - A simple, light and fast binary serialization library. 3-clause BSD.
- protobuf-c - An implementation of Google Protocol Buffer in C. FreeBSD.
- xdr - External Data Representation; a standard for data serialization. Standard (no license applicable).
Source Code Collections
This contains collections of small source code. If you want something big and integrated, check the Frameworks section.
- CCAN - Modelled after Perl's CPAN, this is a big collection of C code that does stuff. The full list is here. Various licenses (all free software).
- clib - Something of a package manager for C. Comes with a bunch of libraries of its own. Expat.
- gnulib - A collection of common GNU code. GNU GPL3.
- ulib - Another collection of source code. Expat.
Standard Libraries
This contains standard C libraries.
- Bionic - Google's C standard library, developed for Android. 3-clause BSD
- dietlibc - A C standard library designed for the smallest possible binaries. GNU GPL2.1.
- glibc - The GNU C Library; an implementation of the C standard library. GNU LGPL3.
- musl - A standard C library, compatible with POSIX 2008 and C11. Designed for static linking. Expat.
String Manipulation
- bstrlib - The Better String Library. 3-clause BSD or GNU GPL2.1.
- ICU - International Components for Unicode; a library for Unicode support. ICU license.
- libunistring - A library for manipulating Unicode strings in C. GNU LGPL3.
- libgiconv - A text conversion library. GNU LGPL2.1.
- SDS - Simple Dynamic Strings; a library for handling C strings in a simpler way, but one that is compatible with normal C string functions. Available via clib. FreeBSD.
Testing
- CHEAT - A very simple unit testing framework. FreeBSD.
- Check - A unit testing framework for C. GNU LGPL2.1.
- cmocka - A unit testing framework with support for mock objects. Apache2.0.
- Criterion - A KISS, non-intrusive C test framework. Expat.
- CUnit - Another unit testing framework for C. GNU LGPL2.1.
- minunit - Minimal unit testing framework for C. Expat.
Text Editor Extensions
While practically any decent programmer's text editor supports C, there are some extensions that make it more pleasant. This is categorized by editor.
Emacs
- CEDET - Collection of Emacs Development Environment Tools; designed to provide IDE-like features to Emacs. Built-in. GNU GPL2.1.
- Flycheck - Modern syntax checking. For C, it can use either GCC or Clang as a back-end. GNU GPL3.
- Yasnippet - A template system, with C templates for common code snippets. GNU GPL3.
Vim
- Syntastic - Syntax checking and linting. Do What The Fuck You Want To license.
- YouCompleteMe - A code completion engine for Vim. GNU GPL3.
Tools
This is a list of useful programs to help you write and debug C code which are not editors, libraries or compilers.
- aimake - A build tool designed to avoid complex configurations. GNU GPL3.
- c - Compile and execute C "scripts" in one go on the command line. Also has shebang support. Expat.
- c99sh - Run C files using hash-bang. FreeBSD.
- cinclude2dot - Graphs include dependencies in a C project using Graphviz. GNU GPL3.
- GDB - The GNU Project debugger; a debugger for C. GNU GPL3.
- gprof - A performance analysis tool. Part of GNU binutils. GNU GPL3.
- libtool - A generic library support script. GNU GPL3.
- qo - A build system that works without a separate config file. Expat.
- rr - A debugger that records non-deterministic executions to allow for deterministic debugging. FreeBSD.
- Valgrind - A range of dynamic analysis tools, including a leak checker. GNU GPL2.1.
Utilities
This is a 'catch-all' category for anything that doesn't fit well anywhere else.
- bfd - A library for manipulating binary object files. Part of GNU binutils. GNU GPL2.1.
- ccv - C-based/Cached/Core Computer Vision library; modern computer vision. 3-clause BSD.
- CommonMark - A C implementation of the CommonMark spec. Variety of licenses, all free.
- docopt.c - A C implementation of a command-line option parser. Expat.
- dyncall - Another foreign function interface library. Expat.
- GNU FreeIPMI - An in-band and out-of-band IPMI implementation. GNU GPL3.
- GNU Libffcall - A collection of libraries for building foreign function interfaces. GNU GPL3.
- Hans Boehm GC - Garbage collection for C? Don't mind if I do! Various licenses, all free.
- huffandpuff - A minimal Huffman encoder and decoder. Public domain.
- libavl - A library containing a range of self-balancing binary trees. GNU GPL2.1.
- libbson - A BSON utility library. Apache2.0.
- libCello - A library introducing higher-level programming to C. 3-clause BSD.
- libffi - A portable foreign-function interface library. Expat.
- libgit2 - Pure C implementation of Git. GNU GPL2 with a linking exception.
- libPhenom - An eventing framework for building high-scalability and high-performance systems. Apache2.0.
- libucl - A universal configuration library parser. FreeBSD.
- libuv - Cross-platform asynchronous I/O. Expat.
- mpc - A parser combinator library. FreeBSD.
- ncurses - Coloured terminal UI library. GNU GPL3.
- nope.c - A C-language-based, ultra-light software platform for scalable server-side and networking applications (think node.js for C programmers). GNU GPL2.1.
- pbc - A protocol buffers library. Expat.
- rabbitmq-c - A client library for RabbitMQ. Expat.
- Ragel - A DSL for state machines that compiles to C. GNU GPL3.
- udpc - An implementation of the Universal Design Pattern. GNU GPL3.
- uthash - A hash table implementation, allowing existing structures to be stored in a hash table easily. 1-clause BSD
- Viola - A simplification of libCello. Expat.
- zlib - A massively-spiffy yet delicately-unobtrusive compression library. 3-clause BSD.
XML
"XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horrible crap to exist." - Linus Torvalds
- Expat - A stream-oriented XML parser. Expat.
- ezXML - An easy-to-use, fast and lightweight XML parser. Expat.
- libroxml - Another library for parsing XML. GNU LGPL2.1.
- libxml2 - A standards-compliant, portable XML parser. Expat.
- mini-xml - A small XML reading and writing library. No dependencies aside from C standard library. GNU LGPL2.1 with static linking exception.
- VTD-XML - A very fast XML processing framework. GNU GPL2.1.