My own C library for 42 School projects
- free
- malloc
- read
- write
- ft_bit - Perform basic operations on bit arrays
- ft_btree - Implementation of binary trees
- ft_const - Contains some useful constants
- ft_ctype - Character tests and conversions
- ft_dlist - Implementation of doubly linked lists
- ft_generic - Provide generic functions for common standard data types
- ft_list - Implementation of singly linked lists
- ft_memory - Functions concerning memory manipulation
- ft_rbtree - Implementation of red black trees
- ft_stdio - Basic I/O interface
- ft_string - Fonctions concerning string manipulation
- ft_type - Contains data types definition including generic functions pointers
- A faster printf implementation (only conversions c, d, n, o, p, s, u, and x are supported)
- ft_get_next_line can read a file descriptor line by line, either on standard input or on a file
- Implementation of generic data structures that do not exist in the libc
This project can be compiled on both Linux and Mac by the following command in a terminal:
make
It generates a static C library named libft.a.
In order to install the libft on your system, you can use the command:
sudo make install
It can be removed with:
sudo make uninstall
⚠️ Note that it requires access privileges
All header files are located in the inc directory.
The main header file is called libft.h, which can be included in your source files like this:
#include "libft.h" // include all libft functions
But you can also use sub-header files if you do not want to include the entire library. For example:
#include "libft/ft_string.h" // include only libft string functions like ft_strlen
Code samples can be compiled with:
make test
Then, all compiled binaries are stored in the bin directory. You are free to test the programs and access the source code.
Assuming that you are using gcc as your compiler and main.c is located at the root of the directory:
gcc -I./inc main.c -L. -lft
...or if the library has been installed on your system:
gcc main.c -lft
This project is licensed under the LGPLv3 License - see the LICENSE file for details