In this project, we needed to exactly reproduce the behavior of many of the standard C library (i. e. libc) functions, adapt some others and, for the bonus project, implement singly linked list functions. In total, forty-two functions were implemented, they are:
Name | Description |
---|---|
ft_isalpha |
Checks for an alphabetic character. |
ft_isdigit |
Checks for a digit from 0 through 9. |
ft_isalnum |
Checks for an alphanumeric character. |
ft_isascii |
Checks whether a given character is part of standard ASCII character set. |
ft_isascii |
Checks for any printable character. |
ft_toupper |
Converts character to uppercase. |
ft_tolower |
Converts character to lowercase. |
Name | Description |
---|---|
ft_memset |
Fills memory with a constant byte. |
ft_memcpy |
Copies memory area. |
ft_memmove |
Moves memory area. |
ft_memchr |
Scans memory for a character. |
ft_memcmp |
Compares memory areas. |
ft_bzero |
Zeroes a byte string. |
ft_strlen |
Calculates the length of a string. |
ft_strlcpy |
Copies string to a specific size. |
ft_strlcat |
Concatenates the string to a specific size. |
ft_strchr |
Locates a given character in string. |
ft_strrchr |
Locates a given character in string up to n characters. |
ft_strncmp |
Compares two strings. |
ft_strnstr |
Locates a substring in a string. |
ft_strdup |
Creates a dupplicate for the string passed as a parameter. |
Name | Description |
---|---|
ft_atoi |
Converts a string to an integer. |
ft_calloc |
Allocates memory and sets its bytes values to 0. |
Name | Description |
---|---|
ft_itoa |
Converts a number into string. |
ft_substr |
Returns a substring from a string. |
ft_strjoin |
Concatenates two strings. |
ft_strtrim |
Trims the beginning and the end of a string with specific set of characters. |
ft_split |
Splits a string using a character as a parameter. |
ft_strmapi |
Applies a function to each character of a string. |
ft_striteri |
Applies a function to each character of a string. |
ft_putchar_fd |
Outputs a character to a file descriptor. |
ft_putstr_fd |
Outputs a string to a file descriptor. |
ft_putendl_fd |
Outputs a string to a file descriptor, followed by a new line. |
ft_putnbr_fd |
Outputs a number to a file descriptor. |
Name | Description |
---|---|
ft_lstnew |
Creates a new list element. |
ft_lstaddfront |
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 frees a list. |
ft_lstiter |
Applies a function to each element of a list. |
ft_lstmap |
Applies a function to each element of a list. |
git clone git@github.com:ygor-sena/42cursus-libft.git
make bonus
#include "libft.h"
-lft -L path/to/libft.a -I path/to/libft.h
-
General references
- SCHILDT, Herbert. C Completo e Total. 2010.
- Tips for 42's students: https://github.com/agavrel/42_CheatSheet by Antonin GAVREL
- Libft functions flowchart diagram
- Acelera Libft by rodsmade
-
About linked lists:
-
Automated tests: