Libft is a custom implementation of the C standard library functions as part of the 42 School curriculum. The library includes various functions for string manipulation, memory management, and linked list operations, among others.
ft_atoi: Converts a string to an integerft_bzero: Sets a block of memory to zeroft_calloc: Allocates memory and sets it to zeroft_isalnum: Checks if a character is alphanumericft_isalpha: Checks if a character is alphabeticft_isascii: Checks if a character is an ASCII characterft_isdigit: Checks if a character is a digitft_isprint: Checks if a character is printableft_itoa: Converts an integer to a stringft_memchr: Searches for a character in a block of memoryft_memcmp: Compares two blocks of memoryft_memcpy: Copies a block of memoryft_memmove: Moves a block of memoryft_memset: Sets a block of memory to a specified valueft_putchar_fd: Writes a character to a file descriptorft_putendl_fd: Writes a string followed by a newline to a file descriptorft_putnbr_fd: Writes an integer to a file descriptorft_putstr_fd: Writes a string to a file descriptorft_split: Splits a string into an array of strings based on a delimiterft_strchr: Finds the first occurrence of a character in a stringft_strdup: Duplicates a stringft_striteri: Applies a function to each character of a stringft_strjoin: Joins two strings into a new stringft_strlcat: Concatenates two strings with size limitationft_strlcpy: Copies a string with size limitationft_strlen: Returns the length of a stringft_strmapi: Creates a new string by applying a function to each character of a stringft_strncmp: Compares two strings up to a specified number of charactersft_strnstr: Finds the first occurrence of a substring in a stringft_strrchr: Finds the last occurrence of a character in a stringft_strtrim: Trims characters from the beginning and end of a stringft_substr: Creates a substring from a stringft_tolower: Converts a character to lowercaseft_toupper: Converts a character to uppercase
ft_lstadd_back: Adds a new element to the end of a listft_lstadd_front: Adds a new element to the beginning of a listft_lstclear: Clears a listft_lstdelone: Deletes a single element from a listft_lstiter: Iterates over a list and applies a function to each elementft_lstlast: Returns the last element of a listft_lstmap: Applies a function to each element of a list and creates a new listft_lstnew: Creates a new list elementft_lstsize: Returns the size of a list
To compile the library, run the following command:
makeThis will generate the libft.a static library file.
To compile the bonus functions, run:
make bonusInclude the libft.h header file in your project and link against the libft.a library:
#include "libft.h"
// Your code hereCompile your project with the libft.a library:
cc -o my_program my_program.c -L. -lft