This project involves coding a C library, libft, which will contain a variety of general-purpose functions that your programs can rely upon.
- Declaring global variables is forbidden.
- Helper functions must be defined as
static. - All files must be placed at the root of the repository.
- Only necessary files should be turned in.
- Every
.cfile must compile with-Wall -Wextra -Werrorflags. - The library must be created using the
arcommand, notlibtool. - The resulting
libft.amust be created at the root of the repository.
Re-implement the following standard library functions with the same behavior but prefixed with ft_:
ft_isalphaft_isdigitft_isalnumft_isasciift_isprintft_strlenft_memsetft_bzeroft_memcpyft_memmoveft_strlcpyft_strlcatft_toupperft_tolowerft_strchrft_strrchrft_strncmpft_memchrft_memcmpft_strnstrft_atoi
Additional functions using malloc():
ft_callocft_strdup
Implement the following functions:
ft_substrft_strjoinft_strtrimft_splitft_itoaft_strmapift_striterift_putchar_fdft_putstr_fdft_putendl_fdft_putnbr_fd
To be evaluated, the mandatory part must be perfect. If achieved, the following list manipulation functions can be implemented for bonus points:
typedef struct s_list
{
void *content;
struct s_list *next;
} t_list;ft_lstnew: Allocates and returns a new node.ft_lstadd_front: Adds the nodenewat the beginning of the list.ft_lstsize: Counts the number of nodes in the list.ft_lstlast: Returns the last node of the list.ft_lstadd_back: Adds the nodenewat the end of the list.ft_lstdelone: Frees the memory of a node’s content using thedelfunction given as a parameter and frees the node. The memory ofnextmust not be freed.ft_lstclear: Deletes and frees the given node and every successor of that node, using thedelfunction andfree(3). Finally, the pointer to the list must be set toNULL.ft_lstiter: Iterates the listlstand applies the functionfon the content of each node.ft_lstmap: Iterates the listlstand applies the functionfon the content of each node, creating a new list resulting from the successive applications off. Thedelfunction is used to delete the content of a node if needed.
Submit your assignment in your Git repository. Only the work inside your repository will be evaluated. Double-check file names to ensure they are correct. Place all files at the root of the repository.