42 Libft project
* Program name : libft.a
* Turn in files *.c, libft.h, Makefile
* Makefile Yes
* External functs. Detailed below
* Libft authorized Non-applicable
* Description Write your own library, containing an extract of important functions for your cursus.
- It is forbidden to use global variables.
- If you need subfunctions to write a complex function, you should define these subfunctions as static to avoid publishing them with your library. It would be a good habit to do this in your future projects as well.
- Submit all files in the root of your repository.
You must re-code the following functions. These function do not need any external functions(man):
• memset
• bzero
• memcpy
• memccpy
• memmove
• memchr
• memcmp
• strlen
• strlcpy
• strlcat
• strchr
• strrchr
• strnstr
• strncmp
• atoi
• isalpha
• isdigit
• isalnum
• isascii
• isprint
• toupper
• tolower
• calloc
• strdup
Each functions has its own explanation at the code page.
• ft_substr
• ft_strjoin
• ft_strtrim
• ft_split
• ft_itoa
• ft_strmapi
• ft_putchar_fd
• ft_putstr_fd
• ft_putendl_fd
• ft_putnbr_fd
You’ll use the following structure to represent the elements of your list.
This structure must be added to your libft.h file.
make bonus will add the bonus functions to the libft.a library.
typedef struct s_list
{
void *content;
struct s_list *next;
} t_list;
• content : The data contained in the element. The void * allows to store any kind of data.
• next : The next element’s address or NULL if it’s the last element.
The following functions will allow you to easily use your lists.
Each functions has its own explanation at the code page.
• ft_lstnew
• ft_lstadd_front
• ft_lstsize
• ft_lstlast
• ft_lstadd_back
• ft_lstdelone
• ft_lstclear
• ft_lstiter
• ft_lstmap