Giter VIP home page Giter VIP logo

headerlibs's Introduction

Headerlibs

A collection of single file libaries for C

All libraries are entirely self contained and do not require any other files than the C standard library

All library files contain their own copy of the MIT license

You can copy single files from this repository and intergate into your own project without keeping the other files

All included libraries compiles without warnings using -Wall, -Wextra

Library Description
hashtable A dynamic hashtable supporting arbitrary key and value types. Common types have predefined hash functions and constructors
mempool A memory pool for reducing memory allocations for equally sized blocks
magpie A small and low overhead library for keeping track of allocations and detecting memory leaks. From my repo github.com/ten3roberts/magpie
libjson A json library for parsing and creating json files. From my repo github.com/ten3roberts/libjson

General documentation

Documentation for the specific libraries can be found within their header file

To integrate any library, drop the single header file into your project. Define $(LIBRARY_NAME)_IMPLEMENTATION in ONE C file. See specific documentation in the header for further information

Configuring is done at build time by adding defines before including the header, refer to the specific documention for available options

#define HASHTABLE_IMPLEMENTATION
#define HASHTABLE_DEFAULT_SIZE 16 // Optional configuration
#include "hashtable.h"
...

If you use several header only libraries in a project, you can create a C file that defines all implementations of the libraries

They will not produce conflicting symbols and can be used to integrate the standalone libraries to work together, most commonly with magpie leak detection

See the specific documentation for further details and usage

You may recognize this pattern from the amazing STB libraries by Sean Barret https://github.com/nothings/stb

headerlibs's People

Contributors

ten3roberts avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.