Libft_Extended
is an enhanced version of the original libft library. It combines multiple essential modules into a single, reusable static library — libft.a
.
Included modules:
- ✅ Libft – core standard library reimplementations
- ✅ ft_printf – custom implementation of
printf
- ✅ get_next_line – function to read a line from a file descriptor
Each module has been integrated from its original standalone repository:
Although each module was initially built as a faithful reimplementation of the standard C library functions (according to the 42 school specifications), they have since been modernized and extended with additional functionality:
libft
includes extra validation utilities and list helpersft_printf
supportsft_printf
— a custom version ofprintf
for output to STDOUT and also supportsft_dprintf
— a custom version ofdprintf
for output to specific file descriptorsget_next_line
remains lightweight, but now integrates better with other components
This makes Libft_Extended a robust base for building real-world C applications and projects.
git clone https://github.com/tigran-sargsyan-w/Libft_Extended.git libft
Use the provided Makefile to compile all modules into libft.a
:
make
This will generate libft.a
in the root of the repository.
Assuming your main.c
is located in the root of your project:
cc main.c -I./libft -L./libft -lft
-I./libft
— adds the path to the header files (libft.h
,ft_printf.h
,get_next_line.h
)-L./libft
— adds the path to the compiled static library-lft
— links againstlibft.a
(as the compiler interprets-lft
aslibft.a
)
libft.a
includes all compiled code fromlibft
,ft_printf
, andget_next_line
.- Make sure to include the appropriate headers in your source files:
#include "libft.h"
#include "ft_printf.h"
#include "get_next_line.h"
- Depending on your project structure, you may need to adapt
-I
and-L
paths.
For a simple test setup, place your main.c
alongside the libft
folder and compile using:
cc main.c libft/libft.a -Ilibft
Enjoy using Libft_Extended as a robust foundation for your future C projects!