Welcome to libft! π This is the first mandatory project of the Common Core at 42 School, where we create our own C library of functions. This project is not only an introduction to C programming but also a great opportunity to understand how standard C library functions work.
In addition to the basic requirements, I've implemented all the bonus functions and also included Get Next Line (GNL) and ft_printf. π
libft/
βββ src/ # All files (.c)
β βββ GNL # Get Next Line
β βββ bonus # List functions
β βββ ft_printf # Printf
β βββ mandatory # Base functions
βββ .gitignore
βββ Makefile # Makefile to compile the project
βββ README.md # This file
βββ include/libft.h # Header file (.h)
- Character Functions:
isalnum,isalpha,isascii,isdigit,isprint,tolower,toupper - Memory Functions:
bzero,calloc,memchr,memcmp,memcpy,memmove,memset - Output Functions:
putchar_fd,putendl_fd,putnbr_fd,putstr_fd - String Functions:
atoi,itoa,split,strchr,strdup,striteri,strjoin,strlcat,strlcpy,strlen,strmapi,strncmp,strnstr,strrchr,strtrim,substr,
- Linked List Functions:
lstadd_back,lstadd_front,lstclear,lstdelone,lstiter,lstlast,lstmap,lstnew,lstsize
- GNL: A function that reads line by line from a file descriptor, ideal for handling files or network inputs.
- A function that replicates
printf
To compile the library, run the following command in the root of the project:
make
This will generate a libft.a file that you can link in your projects.
To use libft in your project, include the header file and link the library:
#include "libft.h"
And compile your project with:
gcc -Wall -Wextra -Werror -Iincludes -L. -lft your_program.c -o your_program