Git Product home page Git Product logo

libjapan's Introduction

LibJapan

Ubuntu CI Windows CI CodeQL scanning

A collection of frequently used features that the C language lacks: lists, hashes, trees, maths functions (vectors, matrices), between an etcetera of other utilities. My contribution to the constellation of existing general-purpose libraries.

The project born as an exercise to learn the language, since then I've been updating/refactoring it according to my needs and experience. There are some flaws to fix, designs to polish, bugs to add, and probably the library is too game-development oriented, I'm working on those aspects... any help is welcome.

Overview

Header -
buffer.h Tiny fix over realloc().
dictionary.h Linear hash map, grows dynamically between a threshold. By default uses FNV1 as hash function.
endianness.h Runtime functions to convert between little and big endianness.
image.h Support for the unknown SGI format, up to 4 channels of 8 or 16 bits, optionally with RLE compression.
list.h Double linked list. Friendly with the "fat pointer" technique.
matrix.h 4x4 matrix operations. Based on linmath.h.
sound.h Support for WAV and AU formats, with integer-samples of 8, 16, 32 bits or float-samples of 32, 64 bits. Handles U-Law and A-Law compression.
status.h A method to pass error values between functions.
string.h UTF8 and ASCII validation. Distinguishes between UTF8 units and bytes, can be used to count them.
tree.h Just a generic tree.
utilities.h Min, Max, DegToRad, and other one-liners.
vector.h 2, 3, and 4 dimensions vectors.

Work-in-progress modules:

Header -
token.h A tokenizer, as C makes string manipulation particularly hard.
configuration.h Configuration variables (cvar) a la Quake.

Compilation

Compiles lovely with Clang, GCC and MSVC ❤️.

To clone and compile the repository with:

git clone https://github.com/baAlex/libjapan.git libjapan
cd libjapan

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug

And for a release build the same procedure as above except for:

cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release

By default if CMake finds cmocka installed, a test suite is build.

Similar projects

Modern, simpler approaches:

  • stb.h, «This is a single header file with a bunch of useful utilities for getting stuff done in C/C++».
  • Tbox, «The project focuses on making C development easier and provides many modules (...), so that any developer can quickly pick it up and enjoy the productivity boost when developing in C language».
  • ZPL, «C99 cross-platform header-only library that offers powerful toolkit to accelerate your development progress».

License

Under MIT License.

Optional notes

  • File 'matrix.c' is licensed under the WTFPL license. Copyright (c) 2013 by Wolfgang 'datenwolf' Draxinger. Based on linmath.h.
  • File 'laws.c' is released under public domain. Based on code written by Steve Underwood ([email protected]): g711.h - In line A-law and u-law conversion routines.

As those two files licenses/terms can be problematic(a)(b), if desired it's safe to assume that they are re-licensed under the MIT License as specified in the file LICENSE. Is not a requirement to expose this paragraph nor the original authors, here is done as a gratitude gesture.


libjapan's People

Contributors

baalex avatar

Watchers

 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.