Statement of the project (in Spanish / English)
Libft is a project that consists on creating a library and replicating several funtions that belong to the Libc library.
In addition, there is a bonus part that consists on creating functions to manipulate lists.
Functions from libc:
- ft_isalpha - test for alphabetical characters
- ft_isdigit - test for numeric characters
- ft_isalnum - test for alphanumeric characters
- ft_isascii - test for ASCII characters
- ft_isprint - test for printable characters
- ft_strlen - compute the length of a string
- ft_memset - write a byte to a byte string
- ft_bzero - write zeroes to a byte string
- ft_memcpy - copy memory area
- ft_memmove - copy byte string
- ft_strlcpy - size-bounded string copying
- ft_strlcat - size-bounded string concatenation
- ft_toupper - lower case to upper case conversion
- ft_tolower - upper case to lower case conversion
- ft_strchr - locate a character in a string (first occurence)
- ft_strrchr - locate a character in a string (last occurence)
- ft_strncmp - compare strings (size-bounded)
- ft_memchr - locate a byte in a byte string
- ft_memcmp - compare a byte string
- ft_strnstr - locate a substring in a string (size-bounded)
- ft_atoi - converts a string to integer
Use malloc
to implement:
Additional functions:
- ft_substr - extracts a substring
- ft_strjoin - concatenates two strings
- ft_strtrim - trims a string
- ft_split - divides a string using a character as separator
- ft_itoa - convert an integer to string
- ft_strmapi - create new string from appying a function to a string
- ft_striteri - apply a function on each character of a string
- ft_putchar_fd - output a character to file descriptor
- ft_putstr_fd - output a string to file descriptor
- ft_putendl_fd - output a string followed by endline to file descriptor
- ft_putnbr_fd - output a number to file descriptor
Includes functions to manipulate lists.
typedef struct s_list
{
void *content;
struct s_list *next;
} t_list;
[!NOTE](content
is the data contained in the node (void * allows to store any kind of data)
next
is the address of the next node (NULL if it is the last one))
- ft_lstnew - create a new node
- ft_lstadd_front - add a node at the beginning
- ft_lstsize - count the number of nodes
- ft_lstlast - return the last node
- ft_lstadd_back - add a node at the end
- ft_lstdelone - free the content of the node
- ft_lstclear - delete the node and its successors
- ft_lstiter - iterate the list applying a function
- ft_lstmap - iterate the list applying a function to the content
The project is finished, and marked with 125.