๐ง๐ Utility library for C ๐๐ป
The "llib" library is a collection of standalone modules created for the purpose of reducing the need to rewrite similar code and providing alternative implementations of the standard library. This project was developed for fun and as a learning experience and also as a little challenge.
The library is composed by a series of sub-modules for better code structure and most of them are standalone, so you can just use the module you need.
Every module header is fully commented and can be used as a reference.
Inspired by https://github.com/barrust/c-utils and https://github.com/goToMain/c-utils/.
To use the "llib" library, you have two alternatives:
- simply clone the repository and include the necessary header files in your project;
- use single modules by downloading their .h file in the include/llib directory and .c file in the src/llib directory.
- compile llib as a static library and include the .a file in your project.
Make sure to link the library (or the modules) during compilation and update your include path.
- memory - memory-related stuff (safe allocation, copy, swap)
- utils - utility functions (wait, safe fopen)
- string - string struct and related functions (create, delete, copy, compare, concat, input, etc.)
- io - io utilities (i.e. buffer cleaning)
- algorithms - various algorithms (searching, sorting, shuffling)
You can find examples in the examples directory and compile them using make examples
.
Contains memory related stuff, like safe allocation, swap and copy functions.
Contains utility functions, like wait, safe fopen
Contains string struct and related functions, like create, delete, copy, compare, concat, input, etc. Also contains utility functions for normal char arrays. Note: this module isn't standalone. You will also need memory and io to use it.
Contains io utility functions, like input with buffer cleaning.
Contains implementations of several useful algorithms for arrays, including:
- linear and binary search for arrays;
- sorting (currently merge sort, planning on implementing other algorithms);
- shuffling
Note: this module isn't standalone. You will also need memory to use it.