diff --git a/libftx/gnl b/libftx/gnl deleted file mode 160000 index 38ce802..0000000 --- a/libftx/gnl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 38ce8029e589d6c70fe387ecfaa6a3219c63d3de diff --git a/libftx/gnl/Makefile b/libftx/gnl/Makefile new file mode 100644 index 0000000..429f249 --- /dev/null +++ b/libftx/gnl/Makefile @@ -0,0 +1,39 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: cchauvet +# include +# ifndef BUFFER_SIZE +# define BUFFER_SIZE 42 +# endif + +void *ft_calloc(size_t nmemb, size_t size); +void *ft_realloc(void *ptr, size_t size); +char *ft_strfjoin(char *dst, char *src); +char *ft_strndup(char *src, size_t n); +size_t ft_strlen(char *str); +ssize_t ft_strchr(char *str, char c); +char *get_next_line(int fd); +#endif diff --git a/libftx/gnl/get_next_line.o b/libftx/gnl/get_next_line.o new file mode 100644 index 0000000..91cbeed Binary files /dev/null and b/libftx/gnl/get_next_line.o differ diff --git a/libftx/gnl/get_next_line_utils.c b/libftx/gnl/get_next_line_utils.c new file mode 100644 index 0000000..9bd4a48 --- /dev/null +++ b/libftx/gnl/get_next_line_utils.c @@ -0,0 +1,106 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* get_next_line_utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = c && c >= '0') + || ('z' >= c && c >= 'a') + || ('Z' >= c && c >= 'A')) + return (1); + return (0); +} diff --git a/libftx/libft/ft_isalnum.o b/libftx/libft/ft_isalnum.o new file mode 100644 index 0000000..d3c509e Binary files /dev/null and b/libftx/libft/ft_isalnum.o differ diff --git a/libftx/libft/ft_isalpha.c b/libftx/libft/ft_isalpha.c new file mode 100644 index 0000000..9573931 --- /dev/null +++ b/libftx/libft/ft_isalpha.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isalpha.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = c && c >= 'a') || ('Z' >= c && c >= 'A')) + return (1); + return (0); +} diff --git a/libftx/libft/ft_isalpha.o b/libftx/libft/ft_isalpha.o new file mode 100644 index 0000000..1f29db1 Binary files /dev/null and b/libftx/libft/ft_isalpha.o differ diff --git a/libftx/libft/ft_isascii.c b/libftx/libft/ft_isascii.c new file mode 100644 index 0000000..5706106 --- /dev/null +++ b/libftx/libft/ft_isascii.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isascii.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 0 && 127 >= c) + return (1); + return (0); +} diff --git a/libftx/libft/ft_isascii.o b/libftx/libft/ft_isascii.o new file mode 100644 index 0000000..0e5035b Binary files /dev/null and b/libftx/libft/ft_isascii.o differ diff --git a/libftx/libft/ft_isdigit.c b/libftx/libft/ft_isdigit.c new file mode 100644 index 0000000..0db99f6 --- /dev/null +++ b/libftx/libft/ft_isdigit.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = c && c >= '0') + return (1); + return (0); +} diff --git a/libftx/libft/ft_isdigit.o b/libftx/libft/ft_isdigit.o new file mode 100644 index 0000000..234f0bb Binary files /dev/null and b/libftx/libft/ft_isdigit.o differ diff --git a/libftx/libft/ft_isprint.c b/libftx/libft/ft_isprint.c new file mode 100644 index 0000000..fd6d523 --- /dev/null +++ b/libftx/libft/ft_isprint.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isprint.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next = new; +} diff --git a/libftx/libft/ft_lstadd_front.c b/libftx/libft/ft_lstadd_front.c new file mode 100644 index 0000000..b17cc46 --- /dev/null +++ b/libftx/libft/ft_lstadd_front.c @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstadd_front.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next = *lst; + *lst = new; +} diff --git a/libftx/libft/ft_lstclear.c b/libftx/libft/ft_lstclear.c new file mode 100644 index 0000000..e29060a --- /dev/null +++ b/libftx/libft/ft_lstclear.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstclear.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next; + ft_lstdelone(*lst, del); + *lst = next; + } +} diff --git a/libftx/libft/ft_lstdelone.c b/libftx/libft/ft_lstdelone.c new file mode 100644 index 0000000..73ac454 --- /dev/null +++ b/libftx/libft/ft_lstdelone.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstdelone.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet content != NULL) + del(lst->content); + free(lst); + } +} diff --git a/libftx/libft/ft_lstiter.c b/libftx/libft/ft_lstiter.c new file mode 100644 index 0000000..1baa94d --- /dev/null +++ b/libftx/libft/ft_lstiter.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstiter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet content); + lst = lst->next; + } +} diff --git a/libftx/libft/ft_lstlast.c b/libftx/libft/ft_lstlast.c new file mode 100644 index 0000000..ba0d9d7 --- /dev/null +++ b/libftx/libft/ft_lstlast.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstlast.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next != NULL) + lst = lst->next; + return (lst); +} diff --git a/libftx/libft/ft_lstmap.c b/libftx/libft/ft_lstmap.c new file mode 100644 index 0000000..ed99c7c --- /dev/null +++ b/libftx/libft/ft_lstmap.c @@ -0,0 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstmap.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet content)); + if (root == NULL) + return (NULL); + last = root; + lst = lst->next; + while (lst != NULL) + { + last->next = ft_lstnew(f(lst->content)); + if (last->next == NULL) + { + ft_lstclear(&root, del); + return (NULL); + } + lst = lst->next; + last = last->next; + } + return (root); +} diff --git a/libftx/libft/ft_lstnew.c b/libftx/libft/ft_lstnew.c new file mode 100644 index 0000000..705733e --- /dev/null +++ b/libftx/libft/ft_lstnew.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstnew.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next = NULL; + new->content = content; + return (new); +} diff --git a/libftx/libft/ft_lstsize.c b/libftx/libft/ft_lstsize.c new file mode 100644 index 0000000..fa39de9 --- /dev/null +++ b/libftx/libft/ft_lstsize.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstsize.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next; + } + return (count); +} diff --git a/libftx/libft/ft_memchr.c b/libftx/libft/ft_memchr.c new file mode 100644 index 0000000..28f3775 --- /dev/null +++ b/libftx/libft/ft_memchr.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet 9) + { + ft_putnbr_fd(n / 10, fd); + ft_putnbr_fd(n % 10, fd); + } + else + ft_putchar_fd(n + 48, fd); +} diff --git a/libftx/libft/ft_putnbr_fd.o b/libftx/libft/ft_putnbr_fd.o new file mode 100644 index 0000000..0475e4d Binary files /dev/null and b/libftx/libft/ft_putnbr_fd.o differ diff --git a/libftx/libft/ft_putstr_fd.c b/libftx/libft/ft_putstr_fd.c new file mode 100644 index 0000000..d8c87d2 --- /dev/null +++ b/libftx/libft/ft_putstr_fd.c @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putstr_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = size) + return (ft_strlen(src) + (size)); + return (len_dest + ft_strlcpy(dest + len_dest, src, size - len_dest)); +} diff --git a/libftx/libft/ft_strlcat.o b/libftx/libft/ft_strlcat.o new file mode 100644 index 0000000..eba411e Binary files /dev/null and b/libftx/libft/ft_strlcat.o differ diff --git a/libftx/libft/ft_strlcpy.c b/libftx/libft/ft_strlcpy.c new file mode 100644 index 0000000..677264b --- /dev/null +++ b/libftx/libft/ft_strlcpy.c @@ -0,0 +1,28 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlcpy.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet + +size_t ft_strlen(const char *s) +{ + size_t length; + + length = 0; + while (s[length]) + length++; + return (length); +} diff --git a/libftx/libft/ft_strlen.o b/libftx/libft/ft_strlen.o new file mode 100644 index 0000000..c5e4312 Binary files /dev/null and b/libftx/libft/ft_strlen.o differ diff --git a/libftx/libft/ft_strmapi.c b/libftx/libft/ft_strmapi.c new file mode 100644 index 0000000..de9e4a1 --- /dev/null +++ b/libftx/libft/ft_strmapi.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strmapi.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet 0) + if (s[i] == (char) c) + return ((char *) s + i); + return (NULL); +} diff --git a/libftx/libft/ft_strrchr.o b/libftx/libft/ft_strrchr.o new file mode 100644 index 0000000..c86d46b Binary files /dev/null and b/libftx/libft/ft_strrchr.o differ diff --git a/libftx/libft/ft_strtrim.c b/libftx/libft/ft_strtrim.c new file mode 100644 index 0000000..229cb81 --- /dev/null +++ b/libftx/libft/ft_strtrim.c @@ -0,0 +1,44 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strtrim.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet len) + size = len; + ptr = malloc((size + 1) * sizeof(char)); + if (ptr == NULL) + return (NULL); + ptr[size] = '\0'; + while (size-- > 0) + ptr[size] = s[start + size]; + return (ptr); +} diff --git a/libftx/libft/ft_substr.o b/libftx/libft/ft_substr.o new file mode 100644 index 0000000..9566fe1 Binary files /dev/null and b/libftx/libft/ft_substr.o differ diff --git a/libftx/libft/ft_tolower.c b/libftx/libft/ft_tolower.c new file mode 100644 index 0000000..14d83da --- /dev/null +++ b/libftx/libft/ft_tolower.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_tolower.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 'A' && 'Z' >= c)); +} diff --git a/libftx/libft/ft_tolower.o b/libftx/libft/ft_tolower.o new file mode 100644 index 0000000..fd0f7ed Binary files /dev/null and b/libftx/libft/ft_tolower.o differ diff --git a/libftx/libft/ft_toupper.c b/libftx/libft/ft_toupper.c new file mode 100644 index 0000000..3775f6d --- /dev/null +++ b/libftx/libft/ft_toupper.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_toupper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 'a' && 'z' >= c)); +} diff --git a/libftx/libft/ft_toupper.o b/libftx/libft/ft_toupper.o new file mode 100644 index 0000000..9de53d2 Binary files /dev/null and b/libftx/libft/ft_toupper.o differ diff --git a/libftx/libft/libft.a b/libftx/libft/libft.a new file mode 100644 index 0000000..3dcba39 Binary files /dev/null and b/libftx/libft/libft.a differ diff --git a/libftx/libft/libft.h b/libftx/libft/libft.h new file mode 100644 index 0000000..83437ae --- /dev/null +++ b/libftx/libft/libft.h @@ -0,0 +1,70 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* libft.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet +# include + +int ft_atoi(const char *nptr); +void ft_bzero(void *s, size_t n); +void *ft_calloc(size_t nmemb, size_t size); +int ft_isalnum(int c); +int ft_isalpha(int c); +int ft_isascii(int c); +int ft_isdigit(int c); +int ft_isprint(int c); +void *ft_memchr(const void *s, int c, size_t n); +int ft_memcmp(const void *s1, const void *s2, size_t n); +void *ft_memcpy(void *dest, const void *src, size_t n); +void *ft_memmove(void *dest, const void *src, size_t n); +void *ft_memset(void *s, int c, size_t n); +char *ft_strchr(const char *s, int c); +char *ft_strdup(const char *s); +size_t ft_strlcat(char *dst, const char *src, size_t size); +size_t ft_strlcpy(char *dst, const char *src, size_t size); +size_t ft_strlen(const char *s); +int ft_strncmp(const char *s1, const char *s2, size_t n); +char *ft_strnstr(const char *big, const char *little, size_t len); +char *ft_strrchr(const char *s, int c); +int ft_tolower(int c); +int ft_toupper(int c); + +char *ft_substr(char const *s, unsigned int start, size_t len); +char *ft_strjoin(char const *s1, char const *s2); +char *ft_strtrim(char const *s1, char const *set); +char **ft_split(char const *s, char c); +char *ft_itoa(int n); +char *ft_strmapi(char const *s, char (*f)(unsigned int, char)); +void ft_striteri(char *s, void (*f)(unsigned int, char*)); +void ft_putchar_fd(char c, int fd); +void ft_putstr_fd(char *s, int fd); +void ft_putendl_fd(char *s, int fd); +void ft_putnbr_fd(int n, int fd); + +typedef struct s_list +{ + void *content; + struct s_list *next; +} t_list; + +t_list *ft_lstnew(void *content); +void ft_lstadd_front(t_list **lst, t_list *new); +int ft_lstsize(t_list *lst); +t_list *ft_lstlast(t_list *lst); +void ft_lstadd_back(t_list **lst, t_list *new); +void ft_lstdelone(t_list *lst, void (*del)(void *)); +void ft_lstclear(t_list **lst, void (*del)(void *)); +void ft_lstiter(t_list *lst, void (*f)(void *)); +t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *)); + +#endif diff --git a/libftx/printf b/libftx/printf deleted file mode 160000 index 898be16..0000000 --- a/libftx/printf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 898be1619f6f91d11e1ed7ea0b8fe4f70c42a70f diff --git a/libftx/printf/Makefile b/libftx/printf/Makefile new file mode 100644 index 0000000..e134948 --- /dev/null +++ b/libftx/printf/Makefile @@ -0,0 +1,36 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: cchauvet base_size - 1) + { + ft_dprintul_base(fd, n / base_size, base); + ft_putchar_fd(fd, base[n % base_size]); + } + else + ft_putchar_fd(fd, base[n]); + return (str_size - 1); +} diff --git a/libftx/printf/ft_dprintul_base.o b/libftx/printf/ft_dprintul_base.o new file mode 100644 index 0000000..e8c1874 Binary files /dev/null and b/libftx/printf/ft_dprintul_base.o differ diff --git a/libftx/printf/ft_dprintx.c b/libftx/printf/ft_dprintx.c new file mode 100644 index 0000000..6d6de6e --- /dev/null +++ b/libftx/printf/ft_dprintx.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_dprintx.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = '0') + return (1); + return (0); +} diff --git a/libftx/printf/ft_isdigit.o b/libftx/printf/ft_isdigit.o new file mode 100644 index 0000000..234f0bb Binary files /dev/null and b/libftx/printf/ft_isdigit.o differ diff --git a/libftx/printf/ft_printf.a b/libftx/printf/ft_printf.a new file mode 100644 index 0000000..968fe3a Binary files /dev/null and b/libftx/printf/ft_printf.a differ diff --git a/libftx/printf/ft_printf.c b/libftx/printf/ft_printf.c new file mode 100644 index 0000000..80cedbe --- /dev/null +++ b/libftx/printf/ft_printf.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_printf.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet +# include + +size_t ft_strlen(const char *s); +char *ft_strchr(const char *s, int c); +int ft_isdigit(int c); +int ft_skipflag(const char *str); +int ft_isarg(int c); + +int ft_dprintptr(int fd, void *ptr); +int ft_dprintl_base(int fd, long long n, char *base); +int ft_dprintul_base(int fd, unsigned long long n, char *base); +int ft_dprintul(int fd, unsigned long long n); +int ft_dprintx(int fd, unsigned int n); +int ft_dprint_upperx(int fd, unsigned int n); +int ft_dprintflag(int fd, const char *flag, va_list va); +int ft_dprintarg(int fd, int c, va_list va); + +int ft_printf(const char *format, ...); + +int ft_vdprintf(int fd, const char *format, va_list va); + +int ft_putchar_fd(int fd, char c); +int ft_putstr_fd(int fd, char *str); + +#endif diff --git a/libftx/printf/ft_printf.o b/libftx/printf/ft_printf.o new file mode 100644 index 0000000..3078514 Binary files /dev/null and b/libftx/printf/ft_printf.o differ diff --git a/libftx/printf/ft_putchar_fd.c b/libftx/printf/ft_putchar_fd.c new file mode 100644 index 0000000..d509e9c --- /dev/null +++ b/libftx/printf/ft_putchar_fd.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putchar_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet