├── libft_subject.pdf ├── ft_isascii.c ├── ft_isdigit.c ├── ft_isprint.c ├── ft_bzero.c ├── ft_putchar_fd.c ├── ft_isalnum.c ├── ft_isalpha.c ├── ft_tolower.c ├── ft_toupper.c ├── ft_strlen.c ├── ft_lstdelone_bonus.c ├── ft_putendl_fd.c ├── ft_lstlast_bonus.c ├── ft_lstsize_bonus.c ├── ft_striteri.c ├── ft_lstiter_bonus.c ├── ft_memset.c ├── ft_putstr_fd.c ├── ft_lstadd_front_bonus.c ├── ft_calloc.c ├── ft_lstnew_bonus.c ├── ft_lstadd_back_bonus.c ├── ft_strdup.c ├── ft_memchr.c ├── ft_lstclear_bonus.c ├── ft_memcpy.c ├── ft_strncmp.c ├── ft_strtrim.c ├── ft_memcmp.c ├── ft_strchr.c ├── ft_strmapi.c ├── ft_putnbr_fd.c ├── ft_strrchr.c ├── ft_strjoin.c ├── ft_strlcpy.c ├── ft_atoi.c ├── ft_lstmap_bonus.c ├── ft_memmove.c ├── ft_strnstr.c ├── ft_substr.c ├── ft_strlcat.c ├── ft_itoa.c ├── ft_split.c ├── Makefile ├── libft.h └── README.md /libft_subject.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PublioElio/School-42-libft/HEAD/libft_subject.pdf -------------------------------------------------------------------------------- /ft_isascii.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_isascii.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 0 && c <= 127); 18 | } 19 | -------------------------------------------------------------------------------- /ft_isdigit.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_isdigit.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 48 && c <= 57); 18 | } 19 | -------------------------------------------------------------------------------- /ft_isprint.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_isprint.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 32 && c <= 126); 18 | } 19 | -------------------------------------------------------------------------------- /ft_bzero.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_bzero.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 97 && c <= 122) || (c >= 65 && c <= 90)); 18 | } 19 | -------------------------------------------------------------------------------- /ft_tolower.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_tolower.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 65 && c <= 90) 18 | c += 32; 19 | return (c); 20 | } 21 | -------------------------------------------------------------------------------- /ft_toupper.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_toupper.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 97 && c <= 122) 18 | c -= 32; 19 | return (c); 20 | } 21 | -------------------------------------------------------------------------------- /ft_strlen.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_strlen.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be content); 20 | free(lst); 21 | } 22 | -------------------------------------------------------------------------------- /ft_putendl_fd.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_putendl_fd.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be next) 20 | lst = lst->next; 21 | return (lst); 22 | } 23 | -------------------------------------------------------------------------------- /ft_lstsize_bonus.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_lstsize.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be next; 23 | i++; 24 | } 25 | return (i); 26 | } 27 | -------------------------------------------------------------------------------- /ft_striteri.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_striteri.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be content); 22 | lst = lst->next; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ft_memset.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_memset.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be 0) 21 | *(ptr++) = (unsigned char)c; 22 | return (b); 23 | } 24 | -------------------------------------------------------------------------------- /ft_putstr_fd.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_putstr_fd.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be next = *lst; 25 | *lst = new; 26 | } 27 | -------------------------------------------------------------------------------- /ft_calloc.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_calloc.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be content = content; 23 | new->next = NULL; 24 | return (new); 25 | } 26 | -------------------------------------------------------------------------------- /ft_lstadd_back_bonus.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_lstadd_back.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be next = new; 28 | } 29 | -------------------------------------------------------------------------------- /ft_strdup.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_strdup.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be next; 24 | ft_lstdelone(*lst, del); 25 | *lst = aux; 26 | } 27 | *lst = 0; 28 | } 29 | -------------------------------------------------------------------------------- /ft_memcpy.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_memcpy.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 10) 27 | ft_putnbr_fd(num / 10, fd); 28 | ft_putchar_fd((char)(num % 10 + 48), fd); 29 | } 30 | -------------------------------------------------------------------------------- /ft_strrchr.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_strrchr.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be 0) 25 | { 26 | if (last[i] == find) 27 | return (last + i); 28 | i--; 29 | } 30 | if (last[i] == find) 31 | return (last); 32 | return (NULL); 33 | } 34 | -------------------------------------------------------------------------------- /ft_strjoin.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_strjoin.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 9 && *str <= 13) || *str == 32) 23 | str++; 24 | if (*str == 43 || *str == 45) 25 | { 26 | if (*str == 45) 27 | neg *= -1; 28 | str++; 29 | } 30 | while (*str >= 48 && *str <= 57) 31 | { 32 | num = num * 10 + (*str - '0'); 33 | str++; 34 | } 35 | return (num * neg); 36 | } 37 | -------------------------------------------------------------------------------- /ft_lstmap_bonus.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_lstmap.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be content)); 26 | if (!elem) 27 | { 28 | ft_lstclear(&new, del); 29 | return (NULL); 30 | } 31 | ft_lstadd_back(&new, elem); 32 | lst = lst->next; 33 | } 34 | return (new); 35 | } 36 | -------------------------------------------------------------------------------- /ft_memmove.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_memmove.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be src) 22 | { 23 | i = (int)len - 1; 24 | while (i >= 0) 25 | { 26 | *(char *)(dst + i) = *(char *)(src + i); 27 | i--; 28 | } 29 | } 30 | else 31 | { 32 | i = 0; 33 | while (i < (int)len) 34 | { 35 | *(char *)(dst + i) = *(char *)(src + i); 36 | i++; 37 | } 38 | } 39 | return (dst); 40 | } 41 | -------------------------------------------------------------------------------- /ft_strnstr.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_strnstr.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = ft_strlen(s)) 22 | { 23 | str = ft_calloc(1, sizeof(char)); 24 | if (!str) 25 | return (NULL); 26 | return (str); 27 | } 28 | if (ft_strlen(s) - start < len) 29 | len = ft_strlen(s) - start; 30 | str = ft_calloc(sizeof(char), len + 1); 31 | if (!str) 32 | return (NULL); 33 | while (s[start + i] && i < len) 34 | { 35 | str[i] = s[start + i]; 36 | i++; 37 | } 38 | return (str); 39 | } 40 | -------------------------------------------------------------------------------- /ft_strlcat.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_strlcat.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be 0) 27 | { 28 | while (src[i] && dst_length + i < dstsize - 1) 29 | { 30 | dst[j] = src[i]; 31 | j++; 32 | i++; 33 | } 34 | dst[j] = '\0'; 35 | } 36 | if (dst_length >= dstsize) 37 | dst_length = dstsize; 38 | return (dst_length + src_length); 39 | } 40 | -------------------------------------------------------------------------------- /ft_itoa.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_itoa.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be 0) 20 | size = 0; 21 | else 22 | size = 1; 23 | while (n) 24 | { 25 | n /= 10; 26 | size++; 27 | } 28 | return (size); 29 | } 30 | 31 | char *ft_itoa(int n) 32 | { 33 | char *str; 34 | long num; 35 | size_t size; 36 | 37 | num = n; 38 | size = get_size(n); 39 | if (n < 0) 40 | num *= -1; 41 | str = (char *)malloc(size + 1); 42 | if (!str) 43 | return (NULL); 44 | *(str + size--) = '\0'; 45 | while (num > 0) 46 | { 47 | *(str + size--) = num % 10 + '0'; 48 | num /= 10; 49 | } 50 | if (size == 0 && str[1] == '\0') 51 | *(str + size) = '0'; 52 | else if (size == 0 && str[1]) 53 | *(str + size) = '-'; 54 | return (str); 55 | } 56 | -------------------------------------------------------------------------------- /ft_split.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_split.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: adiaz-be = 0) 67 | { 68 | split[j++] = word_dup(s, index, i); 69 | index = -1; 70 | } 71 | i++; 72 | } 73 | split[j] = 0; 74 | return (split); 75 | } 76 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # **************************************************************************** # 2 | # # 3 | # ::: :::::::: # 4 | # Makefile :+: :+: :+: # 5 | # +:+ +:+ +:+ # 6 | # By: adiaz-be 16 | # include 17 | 18 | typedef struct s_list 19 | { 20 | void *content; 21 | struct s_list *next; 22 | } t_list; 23 | 24 | int ft_atoi(const char *str); 25 | void ft_bzero(void *s, size_t n); 26 | void *ft_calloc(size_t count, size_t size); 27 | int ft_isalnum(int c); 28 | int ft_isalpha(int c); 29 | int ft_isascii(int c); 30 | int ft_isdigit(int c); 31 | int ft_isprint(int c); 32 | char *ft_itoa(int n); 33 | void ft_lstadd_back(t_list **lst, t_list *new); 34 | void ft_lstadd_front(t_list **lst, t_list *new); 35 | void ft_lstclear(t_list **lst, void (*del)(void *)); 36 | void ft_lstdelone(t_list *lst, void (*del)(void *)); 37 | void ft_lstiter(t_list *lst, void (*f)(void *)); 38 | t_list *ft_lstlast(t_list *lst); 39 | t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *)); 40 | t_list *ft_lstnew(void *content); 41 | int ft_lstsize(t_list *lst); 42 | void *ft_memchr(const void *s, int c, size_t n); 43 | int ft_memcmp(const void *s1, const void *s2, size_t n); 44 | void *ft_memcpy(void *dst, const void *src, size_t n); 45 | void *ft_memmove(void *dst, const void *src, size_t len); 46 | void *ft_memset(void *b, int c, size_t len); 47 | void ft_putchar_fd(char c, int fd); 48 | void ft_putendl_fd(char *s, int fd); 49 | void ft_putnbr_fd(int n, int fd); 50 | void ft_putstr_fd(char *s, int fd); 51 | char **ft_split(char const *s, char c); 52 | char *ft_strchr(const char *s, int c); 53 | char *ft_strdup(const char *s1); 54 | void ft_striteri(char *s, void (*f)(unsigned int, char*)); 55 | char *ft_strjoin(char const *s1, char const *s2); 56 | size_t ft_strlcat(char *dst, const char *src, size_t dstsize); 57 | size_t ft_strlcpy(char *dst, const char *src, size_t dstsize); 58 | size_t ft_strlen(const char *s); 59 | char *ft_strmapi(char const *s, char (*f)(unsigned int, char)); 60 | int ft_strncmp(const char *s1, const char *s2, size_t n); 61 | char *ft_strnstr(const char *haystack, const char *needle, size_t len); 62 | char *ft_strrchr(const char *s, int c); 63 | char *ft_strtrim(char const *s1, char const *set); 64 | char *ft_substr(char const *s, unsigned int start, size_t len); 65 | int ft_tolower(int c); 66 | int ft_toupper(int c); 67 | #endif 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 4 | 5 |

libft

6 | 7 | > School 42 Málaga cursus project 8 | 9 | This repository contains all archives for the project __libft__ in the __School 42 Málaga core cursus__. It's a custom-made library of useful functions in __C language__. The repository includes the `Makefile` and the `libft.h` library. 10 | 11 |

12 | About 13 | · 14 | Index 15 | · 16 | Requirements 17 | · 18 | Instructions 19 | · 20 | Testing 21 |

22 | 23 | ## About 24 | 25 | This project is a __C library__ of useful functions that are allowed to be used in future __School 42 cursus__ projects. With access to this library, the coding proccess in incoming projects will be more effective. The aim of rewrite this functions is to get a better understanding of them, and get a whide range of utilities for the next projects. [You can find more information in the subject](https://github.com/PublioElio/School-42-libft/blob/main/libft_subject.pdf). As it's specified in the subjet, all the archives are in the same folder. 26 | 27 | The code in this repository follows [the rules of the Norminette](https://github.com/PublioElio/School42-Piscina-agosto-2022/blob/main/norme.es.pdf). 28 | 29 | ## Index 30 | ### Functions from `` library 31 | * [`ft_isascii`](https://github.com/PublioElio/School-42-libft/blob/main/ft_isascii.c) - Test a character to see if it's a 7-bit ASCII character. 32 | * [`ft_isalpha`](https://github.com/PublioElio/School-42-libft/blob/main/ft_isalpha.c) - Test a character to see if it's alphabetic. 33 | * [`ft_isdigit`](https://github.com/PublioElio/School-42-libft/blob/main/ft_isdigit.c) - Test a character to see if it's a decimal digit. 34 | * [`ft_isalnum`](https://github.com/PublioElio/School-42-libft/blob/main/ft_isalnum.c) - Test a character to see if it's alphanumeric. 35 | * [`ft_isprint`](https://github.com/PublioElio/School-42-libft/blob/main/ft_isprint.c) - Test a character to see if it's any printable character, including a space. 36 | * [`ft_tolower`](https://github.com/PublioElio/School-42-libft/blob/main/ft_tolower.c) - Convert a character to lowercase. 37 | * [`ft_toupper`](https://github.com/PublioElio/School-42-libft/blob/main/ft_toupper.c) - Convert a character to uppercase. 38 | 39 | ### Functions from `` library 40 | * [`ft_atoi`](https://github.com/PublioElio/School-42-libft/blob/main/ft_atoi.c) - Convert ASCII string to integer. 41 | * [`ft_calloc`](https://github.com/PublioElio/School-42-libft/blob/main/ft_calloc.c) - Allocate space for an array and initializes it to 0. This function and `malloc` return a void pointer, that had no associated data type with it. A void pointer can hold address of any type and can be typecasted to any type. 42 | 43 | ### Functions from `` library 44 | * [`ft_bzero`](https://github.com/PublioElio/School-42-libft/blob/main/ft_bzero.c) - Set the first part of an object to null bytes (filling it with zeroes). 45 | * [`ft_memset`](https://github.com/PublioElio/School-42-libft/blob/main/ft_memset.c) - Set memory to a given value. 46 | * [`ft_memchr`](https://github.com/PublioElio/School-42-libft/blob/main/ft_memchr.c) - Find the first occurrence of a character in a buffer (locate byte in byte string). 47 | * [`ft_memcmp`](https://github.com/PublioElio/School-42-libft/blob/main/ft_memcmp.c) - Compare the bytes in two buffers. 48 | * [`ft_memmove`](https://github.com/PublioElio/School-42-libft/blob/main/ft_memmove.c) - Copy bytes from one buffer to another, handling overlapping memory correctly. 49 | * [`ft_memcpy`](https://github.com/PublioElio/School-42-libft/blob/main/ft_memcpy.c) - Copy bytes from one buffer to another. 50 | 51 | ### Functions from `` library 52 | * [`ft_strlen`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strlen.c) - Get the length of a string. 53 | * [`ft_strchr`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strchr.c) - Find the first occurrence of a character in a string. 54 | * [`ft_strrchr`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strrchr.c) - Find the last occurrence of a character in a string. 55 | * [`ft_strnstr`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strnstr.c) - Locate a substring in a string. 56 | * [`ft_strncmp`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strncmp.c) - Compare two strings, up to a given length. 57 | * [`ft_strdup`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strdup.c) - Create a duplicate of a string, using `malloc`. 58 | * [`ft_strlcpy`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strlcpy.c) - Size-bounded string copy. 59 | * [`ft_strlcat`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strlcat.c) - Size-bounded string concatenation. 60 | 61 | ### Non-standard functions 62 | * [`ft_itoa`](https://github.com/PublioElio/School-42-libft/blob/main/ft_itoa.c) - Convert integer to ASCII string. 63 | * [`ft_substr`](https://github.com/PublioElio/School-42-libft/blob/main/ft_substr.c) - Get a substring from string. 64 | * [`ft_strtrim`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strtrim.c) - Trim beginning and end of string with the specified substring. 65 | * [`ft_strjoin`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strjoin.c) - Concatenate two strings into a new string, using `calloc`. 66 | * [`ft_split`](https://github.com/PublioElio/School-42-libft/blob/main/ft_split.c) - Split string, with specified character as delimiter, into an array of strings. 67 | * [`ft_strmapi`](https://github.com/PublioElio/School-42-libft/blob/main/ft_strmapi.c) - Create new string from a string modified with a specified function. 68 | * [`ft_striteri`](https://github.com/PublioElio/School-42-libft/blob/main/ft_striteri.c) - Modify a string with a given function. 69 | * [`ft_putchar_fd`](https://github.com/PublioElio/School-42-libft/blob/main/ft_putchar_fd.c) - Output a character to given file. 70 | * [`ft_putstr_fd`](https://github.com/PublioElio/School-42-libft/blob/main/ft_putstr_fd.c) - Output string to given file. 71 | * [`ft_putendl_fd`](https://github.com/PublioElio/School-42-libft/blob/main/ft_putendl_fd.c) - Output string to given file with newline. 72 | * [`ft_putnbr_fd`](https://github.com/PublioElio/School-42-libft/blob/main/ft_putnbr_fd.c) - Output integer to given file. 73 | 74 | ### Linked list functions *(bonus)* 75 | * [`ft_lstnew`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstnew_bonus.c) - Create new list. 76 | * [`ft_lstsize`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstsize_bonus.c) - Count elements of a list. 77 | * [`ft_lstlast`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstlast_bonus.c) - Find last element of list. 78 | * [`ft_lstadd_back`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstadd_back_bonus.c) - Add new element at end of list. 79 | * [`ft_lstadd_front`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstadd_front_bonus.c) - Add new element at beginning of list. 80 | * [`ft_lstdelone`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstdelone_bonus.c) - Delete element from list. 81 | * [`ft_lstclear`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstclear_bonus.c) - Delete sequence of elements of list from a starting point. 82 | * [`ft_lstiter`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstiter_bonus.c) - Apply function to content of all list's elements. 83 | * [`ft_lstmap`](https://github.com/PublioElio/School-42-libft/blob/main/ft_lstmap_bonus.c) - Apply function to content of all list's elements into new list. 84 | 85 | ## Requirements 86 | The library is written in __C language__ and needs the `gcc` compiler, with `` and `` standard libraries to run. 87 | 88 | ## Instructions 89 | 90 | ### 1. Compiling the library 91 | 92 | To compile the library, go to its path and run: 93 | 94 | For __basic__ functions: 95 | ``` 96 | $ make 97 | ``` 98 | 99 | For __bonus__ functions: 100 | ``` 101 | $ make bonus 102 | ``` 103 | 104 | ### 2. Cleaning all binary (.o) and executable files (.a) 105 | 106 | To delete all files generated with make, go to the path and run: 107 | ``` 108 | $ make fclean 109 | ``` 110 | 111 | ### 3. Using it in your code 112 | 113 | To use the library functions in your code, simply include this header: 114 | ``` 115 | #include "libft.h" 116 | ``` 117 | 118 | ## Testing 119 | This library have been tested with [Francinette](https://github.com/xicodomingues/francinette). 120 | 121 | 122 | --------------------------------------------------------------------------------