This project its our very first project as a student at 42. We will need to recode a few functions of the C standard library as well as some other utility functions that we will use during our whole cursus.
It was a great project so that from the beginning of the course we are aware of how the functions work.
-ft_isalpha - checks for an alphabetic character.
-ft_isdigit - checks for a digit (0 through 9).
-ft_isalnum - checks for an alphanumeric character.
-ft_isascii - checks whether c fits into the ASCII character set.
-ft_isprint - checks for any printable character.
-ft_toupper - convert char to uppercase.
-ft_tolower - convert char to lowercase.
-ft_memcpy - copy memory area.
-ft_memmove - copy memory area.
-ft_memset - fill memory with a constant byte.
-ft_memchr - scan memory for a character.
-ft_memcmp - compare memory areas.
-ft_strlen - calculate the length of a string.
-ft_bzero - zero a byte string.
-ft_strlcpy - copy string to an specific size.
-ft_strlcat - concatenate string to an specific size.
-ft_strchr - locate character in string.
-ft_strrchr - locate character in string.
-ft_strncmp - compare two strings.
-ft_strnstr - locate a substring in a string.
-ft_strdup - creates a dupplicate for the string passed as parameter.
-ft_atoi - convert a string to an integer.
-ft_calloc - allocates memory and sets its bytes' values to 0.
-ft_substr - returns a substring from a string.
-ft_strjoin - concatenates two strings.
-ft_strtrim - trims the beginning and end of string with specific set of chars.
-ft_split - splits a string using a char as parameter.
-ft_itoa - converts a number into a string.
-ft_strmapi - applies a function to each character of a string.
-ft_putchar_fd - output a char to a file descriptor.
-ft_putstr_fd - output a string to a file descriptor.
-ft_putendl_fd - output a string to a file descriptor, followed by a new line.
-ft_putnbr_fd - output a number to a file descriptor.
-ft_lstnew - creates a new list element.
-ft_lstadd_front - adds an element at the beginning of a list.
-ft_lstsize - counts the number of elements in a list.
-ft_lstlast - returns the last element of the list.
-ft_lstadd_back - adds an element at the end of a list.
-ft_lstclear - deletes and free list.
-ft_lstiter - applies a function to each element of a list.
-ft_lstmap - applies a function to each element of a list.
-ft_lstdelone - Takes a node and frees the memory of the node’s content using the function ’del’ given as a parameter and free the node. The memory of’next’ must not be freed.
-ft_lstmap - Iterates the list ’lst’ and applies the function ’f’ on the content of each node. Creates a new list resulting of the successive applications of the function ’f’. The ’del’ function is used to delete the content of a node if needed..
The library is written in C language and thus needs the cc compiler and some standard C libraries to run.
- Instructions -
- Compiling the library
To compile the library, run:
$ cd path/to/libft && make
- Using it in your code
To use the library functions in your code, simply include its header:
#include "libft.h"
-make without bonus functions.
-make bonus to compile with bonuses.