Giter VIP home page Giter VIP logo

bread.h's Introduction

Bready Header-Only Libraries

Hi, I'm toast. These are my header-only libraries. They're all licensed under CC0: feel free to do literally anything you want with them.

They are optimized for conceptual simplicity. Most other libraries will be faster. However, if you want to write your own for speed, these can also be a good starting point

For now, they all target C99. Though I may eventually target C11 or C23 for some of them, when this happens the below list will mention the target C version.

They will not have any dependencies except libc. Some of them may depend on POSIX rather than pure ISO C, in which case the below list will note this.

Library List

  • base64.h (0.2): implementation of "base64" and "base64url" compliant to RFC 4648
  • ini.h (0.1): lax streaming parser for the INI format
  • stdiox.h (0.1): extensions to ISO C stdio.h

How do I use them?

  1. Copy the appropriate .h file into your project.
  2. #include the header.
  3. In exactly one .c file, #include the header after defining the appropriate macro. This is usually something like BREAD_uppercased-header-name_IMPLEMENTATION. You can find the exact macro at the very start of the header.

For example, with base64. In your .h:

#include "base64.h" // you may rename it

Then in exactly one .c:

#define BREAD_BASE64_IMPLEMENTATION
#include "base64.h"

You can combine the implementations of all of the libraries in a single file, they do not conflict with one another.

Contributing

This repository follows the following contribution model:

  • You can submit bugfixes for existing headers. When doing so, you should allow pushes from maintainers, your code will be changed.
  • You can request additional features to existing headers. Depending on the complexity involved, those features may be implemented.
  • You can request new headers. Do not expect those to be added any time soon.
  • Benchmarks and Tests (in /bench and /test) are fair game. As long as they run on my machine, they will generally be merged. Make sure you add usage instructions at the top of the file.

Unless your code simplifies (conceptually, not computationally, though computational simplification patches will be accepted if they do not negatively affect conceptual simplicity) the existing code, they will not be accepted. However, if they do, they often will be.

Additionally, make sure to avoid defines whenever possible.

bread.h's People

Contributors

cosmictoast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bread.h's Issues

utf-*

how implementing utf-8 16, 32 etc
this is important

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.