diff --git a/ft_printf/Makefile b/ft_printf/Makefile deleted file mode 100644 index 2ca8de6..0000000 --- a/ft_printf/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# **************************************************************************** # -# # -# ::: :::::::: # -# Makefile :+: :+: :+: # -# +:+ +:+ +:+ # -# By: mdenys +#+ +:+ +#+ # -# +#+#+#+#+#+ +#+ # -# Created: 2020/10/28 11:52:03 by mdenys #+# #+# # -# Updated: 2020/12/16 05:38:16 by mdenys ### ########.fr # -# # -# **************************************************************************** # - -LIBFT = ./libft/libft.a - -N_TEMP = temp.a - -NAME = libftprintf.a - -SRCS = ft_printf.c parser/ft_parser.c parser/ft_parser_utils.c \ - putchar_maker/ft_put_c.c putchar_maker/put_d/ft_put_d.c putchar_maker/put_d/ft_put_d_utilc.c putchar_maker/ft_put_p.c putchar_maker/ft_put_s.c putchar_maker/ft_put_u.c putchar_maker/ft_put_x.c \ - putchar_maker/put_u/ft_put_u.c putchar_maker/put_u/ft_put_u_utilc.c\ - putchar_maker/put_x/ft_put_x.c putchar_maker/put_x/ft_put_x_utilc.c\ - putchar_maker/put_p/ft_put_p.c putchar_maker/put_p/ft_put_p_utilc.c\ - putchar_maker/putmaket_utils.c putchar_maker/put_d/ft_put_d_undersize.c - -SURPL_O = *.o - -CC = gcc - -FLAGS = -c -Wall -Wextra -Werror - -INCLUDES = -I./includes - -OBJS = $(SRCS:.c=.o) - -$(NAME): $(OBJS) - $(MAKE) bonus -C ./libft - cp libft/libft.a $(NAME) - $(CC) $(FLAGS) $(INCLUDES) $(SRCS) - ar -rcs $(NAME) $(OBJS) - -all : $(NAME) - -clean : - $(MAKE) clean -C ./libft - rm -rf $(SURPL_O) - rm -rf $(OBJS) - -fclean : clean - $(MAKE) fclean -C ./libft - rm -rf $(NAME) - -re : fclean all diff --git a/ft_printf/ft_printf.c b/ft_printf/ft_printf.c deleted file mode 100644 index 77a0f07..0000000 --- a/ft_printf/ft_printf.c +++ /dev/null @@ -1,46 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_printf.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/19 16:46:57 by mdenys #+# #+# */ -/* Updated: 2020/12/14 21:59:53 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "ft_printf.h" - -void ft_putchar_fd_count(t_printf *list, char c, int fd) -{ - write(fd, &c, 1); - list->count += 1; -} - -int ft_printf(const char *format, ...) -{ - int i; - char *ptr; - va_list name; - - i = 0; - va_start(name, format); - ptr = (char *)format; - while (*ptr) - { - if (*ptr == '%') - { - ptr++; - i += ft_parser(&ptr, &name); - } - else - { - ft_putchar_fd(*ptr, 1); - i++; - ptr++; - } - } - va_end(name); - return (i); -} diff --git a/ft_printf/ft_printf.h b/ft_printf/ft_printf.h deleted file mode 100644 index 4c8c935..0000000 --- a/ft_printf/ft_printf.h +++ /dev/null @@ -1,98 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_printf.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/19 16:50:07 by mdenys #+# #+# */ -/* Updated: 2020/12/16 06:00:04 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#ifndef FT_PRINTF_H -# define FT_PRINTF_H - -# include -# include "libft/libft.h" -# include - -typedef struct s_printf -{ - int wh; - int prec; - unsigned is_left:1; - unsigned is_zero:1; - unsigned is_prec:1; - unsigned rec_prec:1; - unsigned to_up:1; - unsigned v_min:1; - unsigned count; -} t_printf; - -void ft_putnbr_fd_count(t_printf *list, long int n, int fd); -void ft_putnbr_u_fd_count(t_printf *list, unsigned int n, int fd); -void ft_putchar_fd_count(t_printf *list, char c, int fd); -int ft_printf(const char *format, ...); -int ft_parser(char **str, va_list *name); -void while_c(t_printf *list, char c, int i); -void d_isprec(t_printf *list, int value); -int lennbr(long int n); -int is_flag(char **str, t_printf *params); -int is_star(char **str, va_list *arg, t_printf *params); -int is_digit(char **str, t_printf *params); -int is_type(char **str, int *cout, va_list *arg, t_printf *params); -int len_value(t_printf *list, long int value); -void d_isleft(t_printf *list, int value); -void d_isleft_2(t_printf *list, int value); -void ft_write_d(t_printf *list, int value); -void ft_write_d_2(t_printf *list, int value); -void for_min_diszero(t_printf *list, int value, int tmp, int *c); -void for_diszero(t_printf *list, int value, int tmp, int c); -void printf_value(t_printf *list, int value); -int len_u_value(t_printf *list, unsigned int value); -void u_isleft(t_printf *list, unsigned int value); -void u_iszero(t_printf *list, unsigned int value); -void u_isprec(t_printf *list, unsigned int value); -void ft_write_u(t_printf *list, unsigned int value); -int u_lennbr(unsigned int n); -void printf_u_value(t_printf *list, unsigned int value); -void for_uiszero(t_printf *list, unsigned int value, int tmp, \ -unsigned int c); -void for_min_uiszero(t_printf *list, unsigned int value, int tmp,\ -unsigned int *c); -void u_isleft_ext(t_printf *list, unsigned int value); -void x_isleft(t_printf *list, unsigned int value); -void x_iszero(t_printf *list, unsigned int value); -void x_isprec(t_printf *list, unsigned int value); -int len_x_value(t_printf *list, unsigned int value); -void ft_write_x(t_printf *list, unsigned int value); -void printf_x_value(t_printf *list, unsigned int value); -void print_hex(unsigned int value, t_printf *list); -int len_hex(unsigned int value); -void for_xiszero(t_printf *list, unsigned int value, int \ -tmp, unsigned int c); -void for_min_xiszero(t_printf *list, unsigned int value, int tmp,\ -unsigned int *c); -void print_hep(t_printf *list, long int value); -int len_hep(long int value); -void for_piszero(t_printf *list, long int value, long int tmp, \ -long int c); -void for_min_piszero(t_printf *list, long int value, long int tmp,\ -long int *c); -void printf_p_value(t_printf *list, long int value); -void p_isleft(t_printf *list, long int value); -void p_iszero(t_printf *list, long int value); -void p_isprec(t_printf *list, long int value); -int len_hep(long int value); -void ft_write_p(t_printf *list, long int value); -void printf_p_value_2(t_printf *list, long int value, int b); -int ft_put_percent(t_printf *list); -int ft_put_c(t_printf *list, va_list *name); -int ft_put_d(t_printf *list, va_list *name); -int ft_put_p(t_printf *list, va_list *name); -int ft_put_s(t_printf *list, va_list *name); -int ft_put_u(t_printf *list, va_list *name); -int ft_put_x(t_printf *list, va_list *name); - -#endif diff --git a/ft_printf/libft/Makefile b/ft_printf/libft/Makefile deleted file mode 100644 index 9182481..0000000 --- a/ft_printf/libft/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -# **************************************************************************** # -# # -# ::: :::::::: # -# Makefile :+: :+: :+: # -# +:+ +:+ +:+ # -# By: mdenys +#+ +:+ +#+ # -# +#+#+#+#+#+ +#+ # -# Created: 2020/10/28 11:52:03 by mdenys #+# #+# # -# Updated: 2020/12/04 22:45:21 by mdenys ### ########.fr # -# # -# **************************************************************************** # - -SRCS = ft_isalnum.c ft_isprint.c ft_memcmp.c ft_putchar_fd.c ft_split.c \ - ft_strlcat.c ft_strncmp.c ft_substr.c ft_atoi.c ft_isalpha.c \ - ft_itoa.c ft_memcpy.c ft_putendl_fd.c ft_strchr.c ft_strlcpy.c \ - ft_strnstr.c ft_tolower.c ft_bzero.c ft_isascii.c ft_memccpy.c \ - ft_memmove.c ft_putnbr_fd.c ft_strdup.c ft_strlen.c ft_strrchr.c \ - ft_toupper.c ft_calloc.c ft_isdigit.c ft_memchr.c ft_memset.c \ - ft_putstr_fd.c ft_strjoin.c ft_strmapi.c ft_strtrim.c ft_putchar.c -OBJS = $(SRCS:.c=.o) - -BONUS = ft_lstadd_back.c ft_lstadd_front.c ft_lstclear.c \ - ft_lstdelone.c ft_lstiter.c ft_lstlast.c \ - ft_lstmap.c ft_lstnew.c ft_lstsize.c -BONUS_OBJS = $(BONUS:.c=.o) - -CC = gcc -RM = rm -f -CFLAGS = -Wall -Wextra -Werror -I. - -NAME = libft.a - -all: $(NAME) - -$(NAME): $(OBJS) - ar rcs $(NAME) $(OBJS) - -clean: - $(RM) $(OBJS) $(BONUS_OBJS) - -fclean: clean - $(RM) $(NAME) - -re: fclean $(NAME) - -bonus: $(OBJS) $(BONUS_OBJS) - ar rcs $(NAME) $(OBJS) $(BONUS_OBJS) - -.PHONY: all clean fclean re bonus diff --git a/ft_printf/libft/ft_atoi.c b/ft_printf/libft/ft_atoi.c deleted file mode 100644 index 79f6a02..0000000 --- a/ft_printf/libft/ft_atoi.c +++ /dev/null @@ -1,51 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_atoi.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 13:36:13 by mdenys #+# #+# */ -/* Updated: 2020/11/05 17:22:30 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -static int ch(char ch) -{ - if (ch == '\t' || ch == '\n' || ch == ' ' || \ - ch == '\v' || ch == '\f' || ch == '\r') - return (1); - else - return (0); -} - -int ft_atoi(const char *str) -{ - int i; - unsigned long int result; - int operator; - - i = 0; - operator = 1; - result = 0; - while (ch(str[i])) - i++; - if (str[i] == '-' || str[i] == '+') - { - if (str[i] == '-') - operator *= -1; - i++; - } - while (str[i] >= '0' && str[i] <= '9') - { - if (result > 922337203685477580 && operator == -1) - return (0); - else if (result > 922337203685477580 && operator == 1) - return (-1); - result = result * 10 + str[i] - '0'; - i++; - } - return (result * operator); -} diff --git a/ft_printf/libft/ft_bzero.c b/ft_printf/libft/ft_bzero.c deleted file mode 100644 index 7e2c4eb..0000000 --- a/ft_printf/libft/ft_bzero.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_bzero.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 12:19:35 by mdenys #+# #+# */ -/* Updated: 2020/10/29 18:24:02 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_bzero(void *s, size_t num) -{ - char *tmp; - size_t i; - - i = 0; - if (num) - { - tmp = s; - while (i < num) - { - tmp[i] = '\0'; - i++; - } - } -} diff --git a/ft_printf/libft/ft_calloc.c b/ft_printf/libft/ft_calloc.c deleted file mode 100644 index 3422564..0000000 --- a/ft_printf/libft/ft_calloc.c +++ /dev/null @@ -1,31 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_calloc.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/01 19:59:31 by mdenys #+# #+# */ -/* Updated: 2020/11/01 20:41:24 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void *ft_calloc(size_t num, size_t size) -{ - void *addr; - unsigned int nbytes; - - nbytes = num * size; - addr = malloc(nbytes); - if (!size || !num || (size == 0 && num == 0)) - return ((void *)addr); - if (!addr) - return (NULL); - else - { - ft_memset(addr, '\0', nbytes); - } - return ((void *)addr); -} diff --git a/ft_printf/libft/ft_isalnum.c b/ft_printf/libft/ft_isalnum.c deleted file mode 100644 index 46ab34b..0000000 --- a/ft_printf/libft/ft_isalnum.c +++ /dev/null @@ -1,18 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_isalnum.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 16:43:05 by mdenys #+# #+# */ -/* Updated: 2020/10/29 19:50:43 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_isalnum(int c) -{ - return (ft_isalpha(c) || ft_isdigit(c)); -} diff --git a/ft_printf/libft/ft_isalpha.c b/ft_printf/libft/ft_isalpha.c deleted file mode 100644 index cb4c04f..0000000 --- a/ft_printf/libft/ft_isalpha.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_isalpha.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 14:03:52 by mdenys #+# #+# */ -/* Updated: 2020/10/30 11:46:57 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_isalpha(int c) -{ - if ((c > 64 && c < 91) || (c > 96 && c < 123)) - return (1); - return (0); -} diff --git a/ft_printf/libft/ft_isascii.c b/ft_printf/libft/ft_isascii.c deleted file mode 100644 index a715209..0000000 --- a/ft_printf/libft/ft_isascii.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_isascii.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 18:53:32 by mdenys #+# #+# */ -/* Updated: 2020/10/30 11:54:20 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_isascii(int c) -{ - if (c >= 0 && c <= 127) - return (1); - return (0); -} diff --git a/ft_printf/libft/ft_isdigit.c b/ft_printf/libft/ft_isdigit.c deleted file mode 100644 index 1a45ce4..0000000 --- a/ft_printf/libft/ft_isdigit.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_isdigit.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 14:29:08 by mdenys #+# #+# */ -/* Updated: 2020/10/30 11:52:05 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_isdigit(int ch) -{ - if (ch >= '0' && ch <= '9') - return (1); - return (0); -} diff --git a/ft_printf/libft/ft_isprint.c b/ft_printf/libft/ft_isprint.c deleted file mode 100644 index b9d4c4f..0000000 --- a/ft_printf/libft/ft_isprint.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_isprint.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 18:53:32 by mdenys #+# #+# */ -/* Updated: 2020/10/30 11:53:10 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_isprint(int c) -{ - if (c >= 32 && c <= 126) - return (1); - return (0); -} diff --git a/ft_printf/libft/ft_itoa.c b/ft_printf/libft/ft_itoa.c deleted file mode 100644 index a0b0119..0000000 --- a/ft_printf/libft/ft_itoa.c +++ /dev/null @@ -1,55 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_itoa.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/03 20:26:38 by mdenys #+# #+# */ -/* Updated: 2020/11/04 13:20:27 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -static int nbleng(unsigned int n) -{ - unsigned int i; - - i = 0; - while (n >= 10) - { - n /= 10; - i++; - } - return (i + 1); -} - -char *ft_itoa(int n) -{ - char *dst; - unsigned int leng; - unsigned int nbr; - unsigned int i; - - nbr = (n < 0 ? -n : n); - leng = nbleng(nbr); - i = 0; - if (!(dst = (char *)malloc(sizeof(char) * leng + 1 + (n < 0 ? 1 : 0)))) - return (NULL); - if (n < 0) - { - dst[i] = '-'; - leng++; - } - i = leng - 1; - while (nbr >= 10) - { - dst[i] = nbr % 10 + '0'; - nbr /= 10; - i--; - } - dst[i] = nbr % 10 + '0'; - dst[leng] = '\0'; - return (dst); -} diff --git a/ft_printf/libft/ft_lstadd_back.c b/ft_printf/libft/ft_lstadd_back.c deleted file mode 100644 index aa24128..0000000 --- a/ft_printf/libft/ft_lstadd_back.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstadd_back.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 18:15:55 by mdenys #+# #+# */ -/* Updated: 2020/11/04 18:36:49 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_lstadd_back(t_list **lst, t_list *new) -{ - t_list *temp; - - temp = *lst; - if (*lst) - { - while (temp->next != NULL) - temp = temp->next; - temp->next = new; - } - else if (*lst == NULL) - { - *lst = new; - } -} diff --git a/ft_printf/libft/ft_lstadd_front.c b/ft_printf/libft/ft_lstadd_front.c deleted file mode 100644 index 7a137be..0000000 --- a/ft_printf/libft/ft_lstadd_front.c +++ /dev/null @@ -1,22 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstadd_front.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 17:29:57 by mdenys #+# #+# */ -/* Updated: 2020/11/04 17:54:55 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_lstadd_front(t_list **lst, t_list *new) -{ - if (new) - { - new->next = *lst; - *lst = new; - } -} diff --git a/ft_printf/libft/ft_lstclear.c b/ft_printf/libft/ft_lstclear.c deleted file mode 100644 index ad0ee8e..0000000 --- a/ft_printf/libft/ft_lstclear.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstclear.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 20:53:46 by mdenys #+# #+# */ -/* Updated: 2020/11/04 21:34:51 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_lstclear(t_list **lst, void (*del)(void*)) -{ - t_list *new; - - if (*lst) - { - while (*lst) - { - del((*lst)->content); - new = *lst; - *lst = new->next; - free(new); - } - } - *lst = NULL; -} diff --git a/ft_printf/libft/ft_lstdelone.c b/ft_printf/libft/ft_lstdelone.c deleted file mode 100644 index 09e382c..0000000 --- a/ft_printf/libft/ft_lstdelone.c +++ /dev/null @@ -1,22 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstdelone.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 18:37:58 by mdenys #+# #+# */ -/* Updated: 2020/11/04 20:49:50 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_lstdelone(t_list *lst, void (*del)(void *)) -{ - if (lst) - { - del(lst->content); - free(lst); - } -} diff --git a/ft_printf/libft/ft_lstiter.c b/ft_printf/libft/ft_lstiter.c deleted file mode 100644 index 7be5633..0000000 --- a/ft_printf/libft/ft_lstiter.c +++ /dev/null @@ -1,24 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstiter.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 21:10:38 by mdenys #+# #+# */ -/* Updated: 2020/11/04 21:24:22 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_lstiter(t_list *lst, void (*f)(void *)) -{ - if (!lst || !f) - return ; - while (lst) - { - f(lst->content); - lst = lst->next; - } -} diff --git a/ft_printf/libft/ft_lstlast.c b/ft_printf/libft/ft_lstlast.c deleted file mode 100644 index c8ee653..0000000 --- a/ft_printf/libft/ft_lstlast.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstlast.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 18:07:26 by mdenys #+# #+# */ -/* Updated: 2020/11/04 18:14:43 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -t_list *ft_lstlast(t_list *lst) -{ - t_list *new; - - new = lst; - if (lst) - { - while (new->next != NULL) - new = new->next; - return (new); - } - return (NULL); -} diff --git a/ft_printf/libft/ft_lstmap.c b/ft_printf/libft/ft_lstmap.c deleted file mode 100644 index 63c8ef1..0000000 --- a/ft_printf/libft/ft_lstmap.c +++ /dev/null @@ -1,35 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstmap.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 21:25:01 by mdenys #+# #+# */ -/* Updated: 2020/11/05 16:46:12 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *)) -{ - t_list *nlst; - t_list *new; - - if (!lst) - return (NULL); - nlst = NULL; - while (lst) - { - new = ft_lstnew(f(lst->content)); - if (!new) - { - ft_lstclear(&nlst, del); - return (NULL); - } - ft_lstadd_back(&nlst, new); - lst = lst->next; - } - return (nlst); -} diff --git a/ft_printf/libft/ft_lstnew.c b/ft_printf/libft/ft_lstnew.c deleted file mode 100644 index 863e495..0000000 --- a/ft_printf/libft/ft_lstnew.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstnew.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 17:06:10 by mdenys #+# #+# */ -/* Updated: 2020/11/04 17:29:10 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -t_list *ft_lstnew(void *content) -{ - t_list *str; - - str = (t_list*)malloc(sizeof(t_list)); - if (str) - { - str->content = content; - str->next = NULL; - return (str); - } - return (NULL); -} diff --git a/ft_printf/libft/ft_lstsize.c b/ft_printf/libft/ft_lstsize.c deleted file mode 100644 index f3dd04e..0000000 --- a/ft_printf/libft/ft_lstsize.c +++ /dev/null @@ -1,28 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_lstsize.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 17:57:03 by mdenys #+# #+# */ -/* Updated: 2020/11/04 18:06:42 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_lstsize(t_list *lst) -{ - int i; - t_list *new; - - i = 0; - new = lst; - while (new) - { - new = new->next; - i++; - } - return (i); -} diff --git a/ft_printf/libft/ft_memccpy.c b/ft_printf/libft/ft_memccpy.c deleted file mode 100644 index 806e6fc..0000000 --- a/ft_printf/libft/ft_memccpy.c +++ /dev/null @@ -1,34 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_memccpy.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/30 15:35:27 by mdenys #+# #+# */ -/* Updated: 2020/11/04 17:38:29 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void *ft_memccpy(void *dst, const void *src, int ch, size_t n) -{ - unsigned char *d; - unsigned char *s; - unsigned int i; - - i = 0; - d = dst; - s = (unsigned char *)src; - if (!n) - return (0); - while (i < n) - { - d[i] = s[i]; - if (s[i] == (unsigned char)ch) - return (dst + i + 1); - i++; - } - return (0); -} diff --git a/ft_printf/libft/ft_memchr.c b/ft_printf/libft/ft_memchr.c deleted file mode 100644 index 6ba3f3a..0000000 --- a/ft_printf/libft/ft_memchr.c +++ /dev/null @@ -1,31 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_memchr.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/30 19:55:27 by mdenys #+# #+# */ -/* Updated: 2020/11/04 17:40:00 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void *ft_memchr(const void *arr, int c, size_t n) -{ - unsigned char *d; - unsigned int i; - - i = 0; - d = (unsigned char*)arr; - while (i < n) - { - if (d[i] == (unsigned char)c) - { - return (void*)(d + i); - } - i++; - } - return (NULL); -} diff --git a/ft_printf/libft/ft_memcmp.c b/ft_printf/libft/ft_memcmp.c deleted file mode 100644 index 56047fc..0000000 --- a/ft_printf/libft/ft_memcmp.c +++ /dev/null @@ -1,32 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_memcmp.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/31 12:46:41 by mdenys #+# #+# */ -/* Updated: 2020/11/04 17:41:43 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_memcmp(const void *buf1, const void *buf2, size_t n) -{ - unsigned int i; - unsigned char *d; - unsigned char *s; - - if (!n) - return (0); - i = 0; - d = (unsigned char*)buf1; - s = (unsigned char*)buf2; - while (d[i] == s[i] && n - 1 > i) - i++; - if (d[i] != s[i]) - return (d[i] - s[i]); - else - return (0); -} diff --git a/ft_printf/libft/ft_memcpy.c b/ft_printf/libft/ft_memcpy.c deleted file mode 100644 index 7e77e76..0000000 --- a/ft_printf/libft/ft_memcpy.c +++ /dev/null @@ -1,32 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_memcpy.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/30 14:43:54 by mdenys #+# #+# */ -/* Updated: 2020/10/31 13:33:48 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void *ft_memcpy(void *destination, const void *source, size_t n) -{ - unsigned char *d; - unsigned char *s; - int i; - - i = 0; - d = (unsigned char *)destination; - s = (unsigned char *)source; - if (!n || destination == source) - return (destination); - while (n--) - { - d[i] = s[i]; - i++; - } - return (destination); -} diff --git a/ft_printf/libft/ft_memmove.c b/ft_printf/libft/ft_memmove.c deleted file mode 100644 index 3d72e4f..0000000 --- a/ft_printf/libft/ft_memmove.c +++ /dev/null @@ -1,40 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_memmove.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/30 17:04:51 by mdenys #+# #+# */ -/* Updated: 2020/11/04 18:41:12 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void *ft_memmove(void *dst, const void *source, size_t n) -{ - unsigned char *d; - unsigned char *s; - unsigned int i; - - i = 0; - d = dst; - s = (unsigned char *)source; - if (!n) - return (dst); - else if (s < d) - { - while (++i <= n) - d[n - i] = s[n - i]; - } - else if (s) - { - while (i < n) - { - d[i] = s[i]; - i++; - } - } - return (dst); -} diff --git a/ft_printf/libft/ft_memset.c b/ft_printf/libft/ft_memset.c deleted file mode 100644 index eec8e84..0000000 --- a/ft_printf/libft/ft_memset.c +++ /dev/null @@ -1,31 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_memset.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 10:24:40 by mdenys #+# #+# */ -/* Updated: 2020/10/29 17:01:59 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void *ft_memset(void *dest, int val, size_t num) -{ - char *tmp; - size_t i; - - i = 0; - if (num) - { - tmp = dest; - while (i < num) - { - tmp[i] = val; - i++; - } - } - return (dest); -} diff --git a/ft_printf/libft/ft_putchar.c b/ft_printf/libft/ft_putchar.c deleted file mode 100644 index 7d338b7..0000000 --- a/ft_printf/libft/ft_putchar.c +++ /dev/null @@ -1,18 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_putchar.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/04 22:44:21 by mdenys #+# #+# */ -/* Updated: 2020/12/04 22:49:12 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_putchar(char c) -{ - write(1, &c, 1); -} diff --git a/ft_printf/libft/ft_putchar_fd.c b/ft_printf/libft/ft_putchar_fd.c deleted file mode 100644 index 8f3a068..0000000 --- a/ft_printf/libft/ft_putchar_fd.c +++ /dev/null @@ -1,19 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_putchar_fd.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 13:02:20 by mdenys #+# #+# */ -/* Updated: 2020/11/04 15:47:39 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_putchar_fd(char c, int fd) -{ - if (fd) - write(fd, &c, 1); -} diff --git a/ft_printf/libft/ft_putendl_fd.c b/ft_printf/libft/ft_putendl_fd.c deleted file mode 100644 index 5940d29..0000000 --- a/ft_printf/libft/ft_putendl_fd.c +++ /dev/null @@ -1,29 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_putendl_fd.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 14:53:54 by mdenys #+# #+# */ -/* Updated: 2020/11/04 14:57:01 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_putendl_fd(char *s, int fd) -{ - int i; - - i = 0; - if (s) - { - while (s[i]) - { - ft_putchar_fd(s[i], fd); - i++; - } - ft_putchar_fd('\n', fd); - } -} diff --git a/ft_printf/libft/ft_putnbr_fd.c b/ft_printf/libft/ft_putnbr_fd.c deleted file mode 100644 index 605733a..0000000 --- a/ft_printf/libft/ft_putnbr_fd.c +++ /dev/null @@ -1,45 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_putnbr_fd.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 15:04:13 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:49:18 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_putnbr_fd(long int n, int fd) -{ - long int nbr; - - if (n < 0) - { - ft_putchar_fd('-', fd); - nbr = (unsigned int)(n * -1); - } - else - nbr = (unsigned int)n; - if (nbr >= 10) - ft_putnbr_fd(nbr / 10, fd); - ft_putchar_fd((char)(nbr % 10 + '0'), fd); -} - -void ft_putnbr_u_fd(unsigned int n, int fd) -{ - unsigned int nbr; - - if (n < 0) - { - ft_putchar_fd('-', fd); - nbr = (unsigned int)(n * -1); - } - else - nbr = (unsigned int)n; - if (nbr >= 10) - ft_putnbr_fd(nbr / 10, fd); - ft_putchar_fd((char)(nbr % 10 + '0'), fd); -} diff --git a/ft_printf/libft/ft_putstr_fd.c b/ft_printf/libft/ft_putstr_fd.c deleted file mode 100644 index 6e026e7..0000000 --- a/ft_printf/libft/ft_putstr_fd.c +++ /dev/null @@ -1,28 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_putstr_fd.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 13:45:44 by mdenys #+# #+# */ -/* Updated: 2020/11/04 13:48:29 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -void ft_putstr_fd(char *s, int fd) -{ - int i; - - i = 0; - if (s) - { - while (s[i]) - { - ft_putchar_fd(s[i], fd); - i++; - } - } -} diff --git a/ft_printf/libft/ft_split.c b/ft_printf/libft/ft_split.c deleted file mode 100644 index 200ede3..0000000 --- a/ft_printf/libft/ft_split.c +++ /dev/null @@ -1,84 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_split.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/03 13:48:14 by mdenys #+# #+# */ -/* Updated: 2020/11/03 20:34:46 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" -#include - -static int ft_isspace(char c, char b) -{ - return (c == b); -} - -static int count_words(char *str, char c) -{ - int count; - - count = 0; - while (*str) - { - while (*str && ft_isspace(*str, c)) - str++; - if (*str && !ft_isspace(*str, c)) - { - count++; - while (*str && !ft_isspace(*str, c)) - str++; - } - } - return (count); -} - -static char *malloc_word(char *str, char c) -{ - char *word; - int i; - - i = 0; - while (str[i] && !ft_isspace(str[i], c)) - i++; - word = (char *)malloc(sizeof(char) * (i + 1)); - i = 0; - while (str[i] && !ft_isspace(str[i], c)) - { - word[i] = str[i]; - i++; - } - word[i] = '\0'; - return (word); -} - -char **ft_split(const char *str, char c) -{ - char **arr; - int i; - - i = 0; - arr = NULL; - if (str && (arr = malloc(sizeof(char *) * \ - (count_words((char*)str, c) + 1)))) - { - while (*str) - { - while (*str && ft_isspace(*str, c)) - str++; - if (*str && !ft_isspace(*str, c)) - { - arr[i] = malloc_word((char*)str, c); - i++; - while (*str && !ft_isspace(*str, c)) - str++; - } - } - arr[i] = NULL; - } - return (arr); -} diff --git a/ft_printf/libft/ft_strchr.c b/ft_printf/libft/ft_strchr.c deleted file mode 100644 index 801acfc..0000000 --- a/ft_printf/libft/ft_strchr.c +++ /dev/null @@ -1,37 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strchr.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/01 13:44:25 by mdenys #+# #+# */ -/* Updated: 2020/11/05 18:00:06 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_strchr(const char *str, int ch) -{ - unsigned char *d; - unsigned int i; - unsigned int len; - - len = ft_strlen((char *)str); - i = 0; - d = (unsigned char *)str; - if (str) - { - while (d[i] != (unsigned char)ch && i < len) - { - i++; - } - if (d[i] == (unsigned char)ch) - { - return (void *)(d + i); - } - return (0); - } - return (0); -} diff --git a/ft_printf/libft/ft_strdup.c b/ft_printf/libft/ft_strdup.c deleted file mode 100644 index 79396e9..0000000 --- a/ft_printf/libft/ft_strdup.c +++ /dev/null @@ -1,26 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strdup.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/01 20:43:44 by mdenys #+# #+# */ -/* Updated: 2020/11/01 21:11:41 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_strdup(const char *str) -{ - char *test; - int len; - - len = ft_strlen((char *)str) + 1; - test = malloc(len * sizeof(char)); - if (test == NULL) - return (NULL); - ft_strlcpy(test, str, (unsigned int)len); - return (test); -} diff --git a/ft_printf/libft/ft_strjoin.c b/ft_printf/libft/ft_strjoin.c deleted file mode 100644 index c6be36c..0000000 --- a/ft_printf/libft/ft_strjoin.c +++ /dev/null @@ -1,34 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strjoin.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/02 17:18:40 by mdenys #+# #+# */ -/* Updated: 2020/11/02 17:56:57 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_strjoin(char const *s1, char const *s2) -{ - int len1; - int len2; - char *new; - - if (s1 && s2) - { - len1 = ft_strlen((char*)s1); - len2 = ft_strlen((char*)s2); - new = malloc(sizeof(char *) * len1 + len2 + 1); - if (new) - { - ft_strlcpy(new, s1, len1 + 1); - ft_strlcat(new, s2, len1 + len2 + 1); - return (void *)(new); - } - } - return (0); -} diff --git a/ft_printf/libft/ft_strlcat.c b/ft_printf/libft/ft_strlcat.c deleted file mode 100644 index 4b7dcdc..0000000 --- a/ft_printf/libft/ft_strlcat.c +++ /dev/null @@ -1,39 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strlcat.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/31 17:10:24 by mdenys #+# #+# */ -/* Updated: 2020/11/05 16:58:02 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -size_t ft_strlcat(char *dst, const char *src, size_t size) -{ - unsigned int i; - unsigned int len; - - len = 0; - if (!dst && !src) - return (0); - len = ft_strlen(dst); - i = 0; - if (size < len) - return (ft_strlen((char *)src) + size); - if (size) - { - while (src[i] && len + 1 < size) - dst[len++] = src[i++]; - dst[len] = '\0'; - } - while (src[i]) - { - i++; - len++; - } - return (len); -} diff --git a/ft_printf/libft/ft_strlcpy.c b/ft_printf/libft/ft_strlcpy.c deleted file mode 100644 index 6e07543..0000000 --- a/ft_printf/libft/ft_strlcpy.c +++ /dev/null @@ -1,38 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strlcpy.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/28 19:26:31 by mdenys #+# #+# */ -/* Updated: 2020/11/05 16:57:58 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -size_t ft_strlcpy(char *dst, const char *src, size_t size) -{ - unsigned int i; - unsigned int count; - - count = 0; - if (!dst && !src) - return (0); - while (src[count] != '\0') - { - ++count; - } - i = 0; - if (size > 0) - { - while (src[i] != '\0' && i < (size - 1) && src[i]) - { - dst[i] = src[i]; - ++i; - } - dst[i] = '\0'; - } - return (count); -} diff --git a/ft_printf/libft/ft_strlen.c b/ft_printf/libft/ft_strlen.c deleted file mode 100644 index b9058f9..0000000 --- a/ft_printf/libft/ft_strlen.c +++ /dev/null @@ -1,28 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strlen.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/28 19:10:44 by mdenys #+# #+# */ -/* Updated: 2020/11/23 18:40:34 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_strlen(char *str) -{ - int i; - - i = 0; - if (*str) - { - while (str[i] != '\0') - { - i++; - } - } - return (i); -} diff --git a/ft_printf/libft/ft_strmapi.c b/ft_printf/libft/ft_strmapi.c deleted file mode 100644 index 46365f0..0000000 --- a/ft_printf/libft/ft_strmapi.c +++ /dev/null @@ -1,39 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strmapi.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/04 12:41:12 by mdenys #+# #+# */ -/* Updated: 2020/11/04 13:01:25 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_strmapi(char const *s, char (*f)(unsigned int, char)) -{ - int i; - int len; - char *str; - - i = 0; - str = NULL; - if (s) - { - len = ft_strlen((char*)s); - str = (char*)malloc(sizeof(char) * len + 1); - if (str) - { - while (s[i]) - { - str[i] = f(i, s[i]); - ++i; - } - str[i] = '\0'; - return (str); - } - } - return (0); -} diff --git a/ft_printf/libft/ft_strncmp.c b/ft_printf/libft/ft_strncmp.c deleted file mode 100644 index 6d93b98..0000000 --- a/ft_printf/libft/ft_strncmp.c +++ /dev/null @@ -1,35 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strncmp.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 12:22:15 by mdenys #+# #+# */ -/* Updated: 2020/11/05 17:52:29 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_strncmp(const char *s1, const char *s2, size_t a) -{ - unsigned int i; - unsigned char *d; - unsigned char *s; - - d = (unsigned char *)s1; - s = (unsigned char *)s2; - i = 0; - while (d[i] && s[i] && i < a) - { - if (d[i] != s[i]) - return (d[i] - s[i]); - i++; - } - if (i != a) - { - return (d[i] - s[i]); - } - return (0); -} diff --git a/ft_printf/libft/ft_strnstr.c b/ft_printf/libft/ft_strnstr.c deleted file mode 100644 index 65b5fc0..0000000 --- a/ft_printf/libft/ft_strnstr.c +++ /dev/null @@ -1,38 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strnstr.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/01 18:43:20 by mdenys #+# #+# */ -/* Updated: 2020/11/04 18:41:20 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_strnstr(const char *hst, const char *ndl, size_t size) -{ - unsigned int i; - unsigned int j; - - if (ndl[0] == '\0') - return ((char *)hst); - i = 0; - while (hst[i]) - { - j = 0; - if (hst[i] == ndl[j]) - { - while (hst[i + j] == ndl[j] && i + j < size) - { - j++; - if (!ndl[j]) - return ((void *)(hst + i)); - } - } - i++; - } - return (0); -} diff --git a/ft_printf/libft/ft_strrchr.c b/ft_printf/libft/ft_strrchr.c deleted file mode 100644 index 470aa00..0000000 --- a/ft_printf/libft/ft_strrchr.c +++ /dev/null @@ -1,36 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strrchr.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/01 16:14:36 by mdenys #+# #+# */ -/* Updated: 2020/11/05 17:56:32 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_strrchr(const char *str, int ch) -{ - unsigned char *d; - unsigned int i; - unsigned int len; - - len = ft_strlen((char *)str); - i = 0; - d = (unsigned char *)str; - if (str) - { - while (d[len] != (unsigned char)ch && 0 < len) - { - --len; - } - if (d[len] == (unsigned char)ch) - { - return (void *)(d + len); - } - } - return (0); -} diff --git a/ft_printf/libft/ft_strtrim.c b/ft_printf/libft/ft_strtrim.c deleted file mode 100644 index 639486f..0000000 --- a/ft_printf/libft/ft_strtrim.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_strtrim.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/02 17:58:31 by mdenys #+# #+# */ -/* Updated: 2020/11/03 11:18:41 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_strtrim(char const *s1, char const *set) -{ - char *new; - int len; - - len = 0; - if (!s1 || !set) - return (NULL); - while (*s1 && ft_strchr(set, *s1)) - s1++; - len = ft_strlen((char*)s1); - while (len && ft_strchr(set, s1[len])) - len--; - new = ft_substr((char *)(s1), 0, len + 1); - return (new); -} diff --git a/ft_printf/libft/ft_substr.c b/ft_printf/libft/ft_substr.c deleted file mode 100644 index 7539d6a..0000000 --- a/ft_printf/libft/ft_substr.c +++ /dev/null @@ -1,30 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_substr.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/02 12:21:46 by mdenys #+# #+# */ -/* Updated: 2020/11/02 16:58:52 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -char *ft_substr(char const *s, unsigned int start, size_t len) -{ - char *test; - - test = NULL; - if (s) - { - test = malloc(sizeof(*s) * len + 1); - if (test && start <= (unsigned int)ft_strlen((char *)s)) - { - ft_strlcpy(test, s + start, len + 1); - return (void *)(test); - } - } - return (void *)(test); -} diff --git a/ft_printf/libft/ft_tolower.c b/ft_printf/libft/ft_tolower.c deleted file mode 100644 index 0086955..0000000 --- a/ft_printf/libft/ft_tolower.c +++ /dev/null @@ -1,26 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_tolower.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/28 14:40:51 by mdenys #+# #+# */ -/* Updated: 2020/10/29 20:01:38 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_tolower(int a) -{ - if (a >= 65 && a <= 90) - { - return (a + 32); - } - else - { - return (a); - } - return (0); -} diff --git a/ft_printf/libft/ft_toupper.c b/ft_printf/libft/ft_toupper.c deleted file mode 100644 index 87e5bfd..0000000 --- a/ft_printf/libft/ft_toupper.c +++ /dev/null @@ -1,26 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_toupper.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/28 15:04:43 by mdenys #+# #+# */ -/* Updated: 2020/10/29 20:02:26 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" - -int ft_toupper(int a) -{ - if (a >= 97 && a <= 122) - { - return (a - 32); - } - else - { - return (a); - } - return (0); -} diff --git a/ft_printf/libft/libft.h b/ft_printf/libft/libft.h deleted file mode 100644 index a1f3644..0000000 --- a/ft_printf/libft/libft.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* libft.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/10/29 14:47:19 by mdenys #+# #+# */ -/* Updated: 2020/12/14 19:57:25 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#ifndef LIBFT_H -# define LIBFT_H - -# include -# include - -int ft_atoi(const char *str); -void *ft_memset(void *dest, int val, size_t num); -void ft_bzero(void *s, size_t num); -void *ft_memcpy(void *destination, const void *source, size_t n); -void *ft_memccpy(void *dst, const void *src, int ch, size_t n); -void *ft_memmove(void *dst, const void *source, size_t n); -void *ft_memchr(const void *arr, int c, size_t n); -int ft_memcmp(const void *buf1, const void *buf2, size_t n); -int ft_strlen(char *str); -int ft_strncmp(const char *s1, const char *s2, size_t a); -int ft_isalpha(int c); -int ft_isdigit(int ch); -int ft_isalnum(int c); -int ft_isascii(int c); -int ft_isprint(int c); -int ft_toupper(int a); -int ft_tolower(int a); -char *ft_strchr(const char *str, int ch); -char *ft_strrchr(const char *str, int ch); -size_t ft_strlcpy(char *dst, const char *src, size_t size); -size_t ft_strlcat(char *dst, const char *src, size_t size); -char *ft_strnstr(const char *hst, const char *ndl, size_t size); -void *ft_calloc(size_t num, size_t size); -char *ft_strdup(const char *str); -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_putchar(char c); -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(long int n, int fd); -void ft_putnbr_u_fd(unsigned 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_lstiter(t_list *lst, void (*f)(void *)); -void ft_lstclear(t_list **lst, void (*del)(void*)); -t_list *ft_lstmap(t_list *lst, void *(*f)(void *), \ - void (*del)(void *)); -#endif diff --git a/ft_printf/parser/ft_parser.c b/ft_printf/parser/ft_parser.c deleted file mode 100644 index 779e5db..0000000 --- a/ft_printf/parser/ft_parser.c +++ /dev/null @@ -1,116 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_parser.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/23 18:47:42 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:50:42 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -void szero(t_printf *params) -{ - params->is_left = 0; - params->is_prec = 0; - params->is_zero = 0; - params->prec = 0; - params->rec_prec = 0; - params->to_up = 0; - params->wh = 0; - params->v_min = 0; - params->count = 0; -} - -int ft_parser(char **str, va_list *arg) -{ - t_printf params; - int result; - - result = 0; - szero(¶ms); - if (**str == '%') - { - result += write(1, "%", 1); - (*str) += 1; - return (result); - } - while (**str) - { - if (is_flag(str, ¶ms)) - continue ; - else if (is_star(str, arg, ¶ms)) - continue ; - else if (is_digit(str, ¶ms)) - continue ; - else if (is_type(str, &result, arg, ¶ms)) - break ; - else - (*str) += 1 && result++; - } - return (result); -} - -int is_flag(char **str, t_printf *params) -{ - int result; - - result = 0; - if (**str == '-' && ++result) - { - if (params->rec_prec) - { - params->is_prec = 0; - params->rec_prec = 0; - } - params->is_left = 1; - } - else if (**str == '.' && ++result) - { - params->prec = 0; - params->is_prec = 1; - params->rec_prec = 1; - } - (*str) += result; - return (result); -} - -void is_star2(int *value, t_printf *params) -{ - if (params->rec_prec) - { - if (*value < 0) - params->is_prec = 0; - else - params->prec = *value; - params->rec_prec = 0; - } - else - { - if (*value < 0) - { - params->is_left = 1; - params->wh = *value * -1; - } - else - params->wh = *value; - } -} - -int is_star(char **str, va_list *arg, t_printf *params) -{ - int result; - int value; - - result = 0; - if (**str == '*' && ++result) - { - value = va_arg(*arg, int); - is_star2(&value, params); - } - (*str) += result; - return (result); -} diff --git a/ft_printf/parser/ft_parser_utils.c b/ft_printf/parser/ft_parser_utils.c deleted file mode 100644 index fd7be14..0000000 --- a/ft_printf/parser/ft_parser_utils.c +++ /dev/null @@ -1,141 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_parser_utils.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/11/25 13:33:20 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:48:22 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -void printf_value(t_printf *list, int value) -{ - int len; - long int cpval; - - cpval = value; - len = len_value(list, value); - if (list->v_min == 1) - { - ft_putchar_fd_count(list, '-', 1); - list->v_min = 0; - cpval *= -1; - } - if (list->rec_prec == 1 && list->prec == 0 && list->wh == 0) - ft_putnbr_fd_count(list, cpval, 1); - else if (list->prec < lennbr(value)) - ft_putnbr_fd_count(list, cpval, 1); - else - { - while_c(list, '0', len - lennbr(cpval)); - ft_putnbr_fd_count(list, cpval, 1); - } -} - -void printf_u_value(t_printf *list, unsigned int value) -{ - unsigned int len; - unsigned int cpval; - - cpval = value; - len = len_u_value(list, value); - if (list->v_min == 1) - { - ft_putchar_fd_count(list, '-', 1); - list->v_min = 0; - cpval *= -1; - } - if (list->rec_prec == 1 && list->prec == 0 && list->wh == 0) - ; - else if (list->prec < u_lennbr(value)) - ft_putnbr_u_fd_count(list, cpval, 1); - else - { - while_c(list, '0', len - u_lennbr(cpval)); - ft_putnbr_u_fd_count(list, cpval, 1); - } -} - -void printf_x_value(t_printf *list, unsigned int value) -{ - unsigned int len; - unsigned int cpval; - - cpval = value; - len = len_x_value(list, value); - if (list->is_prec == 1 && list->prec == 0 && list->wh == 1 && value == 0) - while_c(list, ' ', list->wh); - else if (list->prec == 0 && list->is_prec == 1 && \ - value == 0 && list->wh == 0) - ; - else if (list->rec_prec == 1 && list->prec == 0 && list->wh == 0) - ; - else if (list->prec < len_hex(value)) - print_hex(cpval, list); - else - { - while_c(list, '0', len - len_hex(cpval)); - print_hex(cpval, list); - } -} - -int is_digit(char **str, t_printf *params) -{ - int result; - int value; - - result = 0; - if (ft_isdigit(**str) && ++result) - { - while (**str == '0') - { - params->is_zero = 1; - (*str)++; - } - if (ft_isdigit(**str)) - { - value = ft_atoi(*str); - (*str) += lennbr(value); - if (params->rec_prec) - { - params->rec_prec = 0; - params->prec = value; - } - else - params->wh = value; - } - } - return (result); -} - -int is_type(char **str, int *cout, va_list *arg, t_printf *params) -{ - int result; - - result = 0; - if (**str == 'c' && ++result) - *cout = ft_put_c(params, arg); - else if (**str == 's' && ++result) - *cout = ft_put_s(params, arg); - else if (**str == 'p' && ++result) - *cout = ft_put_p(params, arg); - else if ((**str == 'd' || **str == 'i') && ++result) - *cout = ft_put_d(params, arg); - else if (**str == 'u' && ++result) - *cout = ft_put_u(params, arg); - else if (**str == '%' && ++result) - *cout = ft_put_percent(params); - else if (**str == 'x' && ++result) - *cout = ft_put_x(params, arg); - else if (**str == 'X' && ++result) - { - params->to_up = 1; - *cout = ft_put_x(params, arg); - } - (*str) += result; - return (result); -} diff --git a/ft_printf/putchar_maker/ft_put_c.c b/ft_printf/putchar_maker/ft_put_c.c deleted file mode 100644 index 9e3ed8f..0000000 --- a/ft_printf/putchar_maker/ft_put_c.c +++ /dev/null @@ -1,63 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_c.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/14 21:41:40 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -int ft_put_c(t_printf *list, va_list *name) -{ - char c; - int d; - - d = list->wh - 1; - c = va_arg(*name, int); - if (list->wh != 0 && list->is_left == 0) - { - while_c(list, ' ', d); - ft_putchar_fd_count(list, c, 1); - return (list->count); - } - else if (list->wh != 0 && list->is_left == 1) - { - ft_putchar_fd_count(list, c, 1); - while_c(list, ' ', d); - return (list->count); - } - else - { - ft_putchar_fd_count(list, c, 1); - return (list->count); - } -} - -int ft_put_percent(t_printf *list) -{ - int d; - - d = list->wh - 1; - if (list->wh != 0 && list->is_left == 0) - { - list->is_zero == 0 ? while_c(list, ' ', d) : while_c(list, '0', d); - ft_putchar_fd_count(list, '%', 1); - return (list->wh); - } - else if (list->wh != 0 && list->is_left == 1) - { - ft_putchar_fd_count(list, '%', 1); - while_c(list, ' ', d); - return (list->wh); - } - else - { - ft_putchar_fd_count(list, '%', 1); - return (1); - } -} diff --git a/ft_printf/putchar_maker/ft_put_p.c b/ft_printf/putchar_maker/ft_put_p.c deleted file mode 100644 index 9f12f1c..0000000 --- a/ft_printf/putchar_maker/ft_put_p.c +++ /dev/null @@ -1,71 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_p.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/14 21:55:46 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -void print_hep(t_printf *list, long int value) -{ - long int remainder; - int i; - int j; - char hepa[16]; - - i = 0; - j = 0; - while (value) - { - remainder = value % 16; - if (remainder < 10) - hepa[j++] = 48 + remainder; - else - hepa[j++] = 55 + remainder; - value = value / 16; - } - i = j - 1; - while (i >= 0) - { - ft_putchar_fd_count(list, ft_tolower(hepa[i]), 1); - i--; - } -} - -int len_hep(long int value) -{ - long int remainder; - int i; - int j; - long int cpval; - char hepa[16]; - - i = 0; - j = 0; - cpval = value; - while (cpval) - { - remainder = cpval % 16; - if (remainder < 10) - hepa[j++] = 48 + remainder; - else - hepa[j++] = 55 + remainder; - cpval = cpval / 16; - } - return (value == 0 ? 2 : j + 2); -} - -int ft_put_p(t_printf *list, va_list *name) -{ - long int value; - - value = va_arg(*name, long int); - ft_write_p(list, value); - return (list->count); -} diff --git a/ft_printf/putchar_maker/ft_put_s.c b/ft_printf/putchar_maker/ft_put_s.c deleted file mode 100644 index db09bde..0000000 --- a/ft_printf/putchar_maker/ft_put_s.c +++ /dev/null @@ -1,89 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_s.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:30:38 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -int ft_prints(t_printf *list, char *value) -{ - int i; - int len; - - len = ft_strlen(value); - i = 0; - if (list->is_prec == 1) - while (i < list->prec && i < len) - { - ft_putchar_fd_count(list, value[i], 1); - i++; - } - else - while (value[i]) - { - ft_putchar_fd_count(list, value[i], 1); - i++; - } - return (i); -} - -int count_tab(t_printf *list, char *value) -{ - int len; - int i; - - i = 0; - len = ft_strlen(value); - if (list->wh > 0 && list->prec == 0 && list->is_prec == 0) - i = list->wh - (list->prec > len ? list->prec : len); - else - i = list->wh - (list->prec > len ? len : list->prec); - return (i); -} - -char *get_line(va_list *name) -{ - char *line; - - if ((line = va_arg(*name, char *)) == NULL) - line = "(null)"; - return (line); -} - -int put_string(t_printf *list, va_list *name) -{ - int temp; - int count; - char *line; - - count = 0; - line = get_line(name); - temp = count_tab(list, line); - if (list->is_left == 1) - { - count = ft_prints(list, line) + temp; - while_c(list, ' ', temp); - } - else if ((list->wh > 0 && list->is_prec >= 0) || (list->wh > 0)) - { - list->is_zero == 0 ? while_c(list, ' ', temp) \ - : while_c(list, '0', temp); - count = ft_prints(list, line) + temp; - } - else - count = ft_prints(list, line); - return (count); -} - -int ft_put_s(t_printf *list, va_list *name) -{ - put_string(list, name); - return (list->count); -} diff --git a/ft_printf/putchar_maker/ft_put_u.c b/ft_printf/putchar_maker/ft_put_u.c deleted file mode 100644 index 8f24d57..0000000 --- a/ft_printf/putchar_maker/ft_put_u.c +++ /dev/null @@ -1,22 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_u.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 00:57:51 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -int ft_put_u(t_printf *list, va_list *name) -{ - unsigned int value; - - value = va_arg(*name, unsigned int); - ft_write_u(list, value); - return (list->count); -} diff --git a/ft_printf/putchar_maker/ft_put_x.c b/ft_printf/putchar_maker/ft_put_x.c deleted file mode 100644 index d508334..0000000 --- a/ft_printf/putchar_maker/ft_put_x.c +++ /dev/null @@ -1,73 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_x.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 02:03:54 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -void print_hex(unsigned int value, t_printf *list) -{ - long remainder; - int i; - int j; - char hexa[8]; - - i = 0; - j = 0; - value == 0 ? ft_putchar_fd_count(list, '0', 1) : 0; - while (value) - { - remainder = value % 16; - if (remainder < 10) - hexa[j++] = 48 + remainder; - else - hexa[j++] = 55 + remainder; - value = value / 16; - } - i = j - 1; - while (i >= 0) - { - list->count += ft_printf("%c", list->to_up == 1 ? hexa[i] : \ - ft_tolower(hexa[i])); - i--; - } -} - -int len_hex(unsigned int value) -{ - long remainder; - int i; - int j; - unsigned int cpval; - char hexa[8]; - - i = 0; - j = 0; - cpval = value; - while (cpval) - { - remainder = cpval % 16; - if (remainder < 10) - hexa[j++] = 48 + remainder; - else - hexa[j++] = 55 + remainder; - cpval = cpval / 16; - } - return (value == 0 ? 1 : j); -} - -int ft_put_x(t_printf *list, va_list *name) -{ - unsigned int value; - - value = va_arg(*name, unsigned int); - ft_write_x(list, value); - return (list->count); -} diff --git a/ft_printf/putchar_maker/put_d/ft_put_d.c b/ft_printf/putchar_maker/put_d/ft_put_d.c deleted file mode 100644 index 8569b8c..0000000 --- a/ft_printf/putchar_maker/put_d/ft_put_d.c +++ /dev/null @@ -1,89 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_d.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:21:31 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void d_iszero(t_printf *list, int value) -{ - int c; - int tmp; - - c = value; - tmp = list->wh - len_value(list, value); - if (list->v_min == 1) - for_min_diszero(list, value, tmp, &c); - else if (list->rec_prec == 1 && value == 0) - while_c(list, ' ', list->wh); - else if (value == 0 && list->wh != 0 && list->prec == 0) - while_c(list, '0', list->wh); - else - for_diszero(list, value, tmp, c); -} - -void d_isprec(t_printf *list, int value) -{ - int tmp; - - tmp = list->wh - len_value(list, value); - if (list->v_min == 1) - tmp--; - if (list->wh != 0 && list->prec == 0 && list->rec_prec == 1) - while_c(list, ' ', list->wh); - else - { - while_c(list, ' ', tmp); - printf_value(list, value); - } -} - -void ft_write_d(t_printf *list, int value) -{ - if ((list->wh > len_value(list, value))) - ft_write_d_2(list, value); - else if (list->is_left == 1 || (list->is_prec == 1 && list->wh > 0)) - d_isleft(list, value); - else if (list->wh == 0 && list->is_prec == 1 && list->rec_prec == 1) - d_iszero(list, value); - else if (list->is_prec == 1 && list->rec_prec == 1) - d_iszero(list, value); - else if (list->rec_prec == 1) - d_isprec(list, value); - else if (list->is_prec == 1 && list->prec == 0 && value == 0) - ; - else - printf_value(list, value); -} - -void ft_write_d_2(t_printf *list, int value) -{ - if (list->is_left == 1) - d_isleft(list, value); - else if (list->is_left == 0 && list->is_prec == 1 && value != 0) - d_isprec(list, value); - else if (list->is_prec == 1 && list->prec == 0) - d_isleft(list, value); - else if (list->is_zero == 1) - d_iszero(list, value); - else if (list->is_prec == 1) - d_isprec(list, value); - else - d_isprec(list, value); -} - -int ft_put_d(t_printf *list, va_list *name) -{ - int value; - - value = va_arg(*name, int); - ft_write_d(list, value); - return (list->count); -} diff --git a/ft_printf/putchar_maker/put_d/ft_put_d_undersize.c b/ft_printf/putchar_maker/put_d/ft_put_d_undersize.c deleted file mode 100644 index 61c8006..0000000 --- a/ft_printf/putchar_maker/put_d/ft_put_d_undersize.c +++ /dev/null @@ -1,62 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_d_undersize.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:22:28 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void d_isleft(t_printf *list, int value) -{ - int tmp; - - tmp = list->wh - len_value(list, value); - if (list->is_prec == 1 && list->prec == 0 && value == 0) - while_c(list, ' ', list->wh); - else if (list->wh > 0 && list->prec == 0 && list->rec_prec == 0 && \ - value == 0) - { - if (list->is_left == 1) - { - printf_value(list, value); - while_c(list, ' ', tmp); - } - else - { - while_c(list, ' ', tmp); - printf_value(list, value); - } - } - else if (list->prec == 0 && value == 0 && list->wh != 0) - while_c(list, ' ', list->wh); - else - d_isleft_2(list, value); -} - -void d_isleft_2(t_printf *list, int value) -{ - if (list->v_min == 1) - { - printf_value(list, value); - while_c(list, ' ', (list->wh - len_value(list, value) - 1)); - } - else - { - if (list->is_left == 1) - { - printf_value(list, value); - while_c(list, ' ', (list->wh - len_value(list, value))); - } - else - { - while_c(list, ' ', (list->wh - len_value(list, value))); - printf_value(list, value); - } - } -} diff --git a/ft_printf/putchar_maker/put_d/ft_put_d_utilc.c b/ft_printf/putchar_maker/put_d/ft_put_d_utilc.c deleted file mode 100644 index e80a146..0000000 --- a/ft_printf/putchar_maker/put_d/ft_put_d_utilc.c +++ /dev/null @@ -1,88 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_d_utilc.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/15 17:12:10 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void for_diszero(t_printf *list, int value, int tmp, int c) -{ - if (value == 0) - while_c(list, ' ', (list->wh - len_value(list, c))); - else if (list->is_prec == 1) - while_c(list, ' ', tmp); - else - while_c(list, '0', (list->wh - len_value(list, c))); - printf_value(list, c); -} - -void for_min_diszero(t_printf *list, int value, int tmp, int *c) -{ - if (list->is_prec == 0) - { - ft_putchar_fd_count(list, '-', 1); - list->v_min = 0; - *c *= -1; - while_c(list, '0', tmp - 1); - printf_value(list, *c); - } - else - { - while_c(list, ' ', tmp - 1); - printf_value(list, value); - } -} - -int lennbr(long int n) -{ - int digits; - - digits = 1; - if (n < 0) - n *= -1; - while (n >= 10) - { - n /= 10; - digits++; - } - return (digits); -} - -void while_c(t_printf *list, char c, int i) -{ - if (i > 0) - { - while (i--) - ft_putchar_fd_count(list, c, 1); - } -} - -int len_value(t_printf *list, long int value) -{ - int count; - - count = 0; - if (list->prec == 0 || list->prec <= lennbr(value)) - { - count = lennbr(value); - value < 0 ? list->v_min = 1 : 0; - } - else if (value < 0) - { - list->v_min = 1; - count = lennbr(value) + ((list->prec - lennbr(value) > 0) ?\ - list->prec - lennbr(value) : 0); - } - else if (list->prec > lennbr(value)) - { - count = list->prec; - } - return (count); -} diff --git a/ft_printf/putchar_maker/put_p/ft_put_p.c b/ft_printf/putchar_maker/put_p/ft_put_p.c deleted file mode 100644 index 9f1a9b5..0000000 --- a/ft_printf/putchar_maker/put_p/ft_put_p.c +++ /dev/null @@ -1,69 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_p.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:55:32 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void p_isleft(t_printf *list, long int value) -{ - printf_p_value(list, value); - if (value == 0) - while_c(list, ' ', list->wh - len_hep(value) - 1); - else - while_c(list, ' ', list->wh - len_hep(value)); -} - -void p_iszero(t_printf *list, long int value) -{ - long int c; - long int temp; - - c = value; - temp = list->wh - len_hep(value); - if (list->rec_prec == 1 && list->prec == 0) - list->count += ft_printf("0x"); - else if (value == 0) - while_c(list, ' ', temp); - else if (value == 0 && list->wh != 0 && list->prec == 0) - { - while_c(list, '0', temp); - } - else - for_piszero(list, value, temp, c); -} - -void p_isprec(t_printf *list, long int value) -{ - if (list->wh > 0 && list->prec == 0 && value == 0) - while_c(list, ' ', list->wh - 3); - else - while_c(list, ' ', list->wh - len_hep(value)); - printf_p_value(list, value); -} - -void ft_write_p(t_printf *list, long int value) -{ - if (list->is_left == 1) - p_isleft(list, value); - else if (list->is_zero == 1) - p_iszero(list, value); - else if (list->rec_prec == 1 || list->wh > 0) - p_isprec(list, value); - else - printf_p_value(list, value); -} - -void printf_p_value_2(t_printf *list, long int value, int b) -{ - list->count += ft_printf("0x"); - while_c(list, '0', b); - print_hep(list, value); -} diff --git a/ft_printf/putchar_maker/put_p/ft_put_p_utilc.c b/ft_printf/putchar_maker/put_p/ft_put_p_utilc.c deleted file mode 100644 index d5bab1e..0000000 --- a/ft_printf/putchar_maker/put_p/ft_put_p_utilc.c +++ /dev/null @@ -1,103 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_p_utilc.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:26:52 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -int p_counter(t_printf *list, long int value) -{ - int count; - - count = 0; - if (list->wh > len_hep(value)) - count = list->wh; - if (value < 0) - count += 1; - else - { - count += len_hep(value); - } - return (count); -} - -void for_piszero(t_printf *list, long int value, long int tmp, long int c) -{ - if (value == 0) - { - while_c(list, ' ', (list->wh - len_hep(c))); - list->count += ft_printf("0x"); - } - else if (list->is_prec == 1) - { - while_c(list, ' ', tmp); - list->count += ft_printf("0x"); - } - else - { - list->count += ft_printf("0x"); - while_c(list, '0', (list->wh - len_hep(c))); - } - printf_p_value(list, c); -} - -void for_min_piszero(t_printf *list, long int value, \ - long int tmp, long int *c) -{ - if (list->is_prec == 0) - { - ft_putchar('-'); - list->v_min = 0; - *c *= -1; - list->count += ft_printf("0x"); - while_c(list, '0', tmp - 1); - printf_p_value(list, *c); - } - else - { - while_c(list, ' ', tmp - 1); - list->count += ft_printf("0x"); - printf_p_value(list, value); - } -} - -int check_zero(t_printf *list, int value) -{ - if (list->is_left == 0 && list->is_prec == 0 && \ - list->is_zero == 0 && list->prec == 0 \ - && list->rec_prec == 0 && list->to_up == 0 \ - && list->wh == 0 && list->v_min == 0 && value == 0) - return (1); - return (0); -} - -void printf_p_value(t_printf *list, long int value) -{ - long int len; - - len = list->wh - len_hep(value); - if (list->rec_prec == 1 && list->prec == 0 && list->wh == 0) - { - list->count += ft_printf("0x"); - print_hep(list, value); - } - else if (check_zero(list, value)) - list->count += ft_printf("0x0"); - else if (list->wh != 0 && list->prec == 0 && list->is_zero == 0) - { - value == 0 ? (list->count += ft_printf("0x0")) : \ - (list->count += ft_printf("0x")); - print_hep(list, value); - } - else if (list->is_prec == 1 || list->rec_prec == 1) - printf_p_value_2(list, value, list->prec - len_hep(value) + 2); - else - printf_p_value_2(list, value, len); -} diff --git a/ft_printf/putchar_maker/put_u/ft_put_u.c b/ft_printf/putchar_maker/put_u/ft_put_u.c deleted file mode 100644 index b653118..0000000 --- a/ft_printf/putchar_maker/put_u/ft_put_u.c +++ /dev/null @@ -1,100 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_u.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:28:39 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void u_isleft(t_printf *list, unsigned int value) -{ - unsigned int tmp; - - tmp = list->wh - len_u_value(list, value); - if (list->wh > 0 && list->is_prec == 1 && list->prec == 0 && value == 0) - while_c(list, ' ', list->wh); - else if (list->wh > 0 && list->prec == 0 && list->rec_prec == 0 && \ - value == 0) - { - printf_u_value(list, value); - while_c(list, ' ', tmp); - } - else if (list->prec == 0 && value == 0 && list->wh != 0) - while_c(list, ' ', list->wh); - else - u_isleft_ext(list, value); -} - -void u_isleft_ext(t_printf *list, unsigned int value) -{ - if (list->v_min == 1) - { - printf_u_value(list, value); - while_c(list, ' ', (list->wh - len_u_value(list, value) - 1)); - } - else - { - printf_u_value(list, value); - while_c(list, ' ', (list->wh - len_u_value(list, value))); - } -} - -void u_iszero(t_printf *list, unsigned int value) -{ - unsigned int c; - unsigned int tmp; - - c = value; - tmp = list->wh - len_u_value(list, value); - if (list->wh > 0 && list->is_prec == 1 && list->prec == 0 && value == 0) - while_c(list, ' ', list->wh); - else if (list->rec_prec == 1 && value == 0) - while_c(list, ' ', list->wh); - else if (value == 0 && list->wh != 0 && list->prec == 0) - while_c(list, '0', list->wh); - else - for_uiszero(list, value, tmp, c); -} - -void u_isprec(t_printf *list, unsigned int value) -{ - unsigned int tmp; - - tmp = list->wh - len_u_value(list, value); - if (list->wh > 0 && list->is_prec == 1 && list->prec == 0 && value == 0) - while_c(list, ' ', list->wh); - else if (list->wh != 0 && list->prec == 0 && list->rec_prec == 1) - while_c(list, ' ', list->wh); - else - { - while_c(list, ' ', tmp); - printf_u_value(list, value); - } -} - -void ft_write_u(t_printf *list, unsigned int value) -{ - if ((list->wh > len_u_value(list, value))) - { - if (list->is_left == 1) - u_isleft(list, value); - else if (list->is_zero == 1) - u_iszero(list, value); - else if (list->is_prec == 1) - u_isprec(list, value); - else - u_isprec(list, value); - } - else if (list->rec_prec == 1) - u_isprec(list, value); - else if (list->is_prec == 1 && list->prec == 0 && value == 0) - while_c(list, ' ', list->wh); - else - printf_u_value(list, value); -} diff --git a/ft_printf/putchar_maker/put_u/ft_put_u_utilc.c b/ft_printf/putchar_maker/put_u/ft_put_u_utilc.c deleted file mode 100644 index c8fe13f..0000000 --- a/ft_printf/putchar_maker/put_u/ft_put_u_utilc.c +++ /dev/null @@ -1,80 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_u_utilc.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:29:15 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void for_uiszero(t_printf *list, unsigned int value, int tmp, unsigned int c) -{ - if (value == 0) - while_c(list, ' ', (list->wh - len_value(list, c))); - else if (list->is_prec == 1) - while_c(list, ' ', tmp); - else - while_c(list, '0', (list->wh - len_value(list, c))); - printf_u_value(list, c); -} - -void for_min_uiszero(t_printf *list, unsigned int value,\ - int tmp, unsigned int *c) -{ - if (list->is_prec == 0) - { - ft_putchar('-'); - list->v_min = 0; - *c *= -1; - while_c(list, '0', tmp - 1); - printf_u_value(list, *c); - } - else - { - while_c(list, ' ', tmp - 1); - printf_u_value(list, value); - } -} - -int len_u_value(t_printf *list, unsigned int value) -{ - unsigned int count; - - count = 0; - if (list->prec == 0 || list->prec <= u_lennbr(value)) - { - count = u_lennbr(value); - value < 0 ? list->v_min = 1 : 0; - } - else if (value < 0) - { - list->v_min = 1; - count = u_lennbr(value) + ((list->prec - u_lennbr(value) > 0) ?\ - list->prec - u_lennbr(value) : 0); - } - else if (list->prec > u_lennbr(value)) - { - count = list->prec; - } - return (count); -} - -int u_lennbr(unsigned int n) -{ - int digits; - - digits = 1; - if (n < 0) - n *= -1; - while (n >= 10) - { - n /= 10; - digits++; - } - return (digits); -} diff --git a/ft_printf/putchar_maker/put_x/ft_put_x.c b/ft_printf/putchar_maker/put_x/ft_put_x.c deleted file mode 100644 index 3a8d1ca..0000000 --- a/ft_printf/putchar_maker/put_x/ft_put_x.c +++ /dev/null @@ -1,109 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_x.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:15:12 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void x_isleft(t_printf *list, unsigned int value) -{ - unsigned int tmp; - - tmp = list->wh - len_x_value(list, value); - if (list->rec_prec == 0 && list->prec == 0 && \ - list->wh > 0 && list->is_left == 1 && list->is_prec == 1 && value == 0) - while_c(list, ' ', list->wh); - else if (list->wh > 0 && list->prec == 0 && list->rec_prec == 0 && \ - value == 0) - { - printf_x_value(list, value); - while_c(list, ' ', tmp); - } - else if (list->prec == 0 && value == 0 && list->wh != 0) - while_c(list, ' ', list->wh); - else - { - printf_x_value(list, value); - while_c(list, ' ', tmp); - } -} - -void x_iszero(t_printf *list, unsigned int value) -{ - unsigned int c; - unsigned int tmp; - - c = value; - tmp = list->wh - len_x_value(list, value); - if (list->rec_prec == 0 && list->prec == 0 && \ - list->wh > 0 && list->is_zero == 1 && list->is_prec == 1 && value == 0) - while_c(list, ' ', list->wh); - else if (list->rec_prec == 1 && value == 0) - while_c(list, ' ', list->wh); - else if (value == 0 && list->wh != 0 && list->prec == 0) - while_c(list, '0', list->wh); - else - for_xiszero(list, value, tmp, c); -} - -void x_isprec(t_printf *list, unsigned int value) -{ - unsigned int tmp; - - tmp = list->wh - len_x_value(list, value); - if (list->wh != 0 && list->prec == 0 && list->rec_prec == 1) - while_c(list, ' ', list->wh); - else if (list->wh > 0 && list->is_prec == 1 \ - && list->prec == 0 && value == 0) - while_c(list, ' ', list->wh); - else - { - while_c(list, ' ', tmp); - printf_x_value(list, value); - } -} - -int len_x_value(t_printf *list, unsigned int value) -{ - unsigned int count; - - count = 0; - if (list->prec == 0 || list->prec <= len_hex(value)) - { - count = len_hex(value); - value < 0 ? list->v_min = 1 : 0; - } - else if (list->prec > len_hex(value)) - { - count = list->prec; - } - return (count); -} - -void ft_write_x(t_printf *list, unsigned int value) -{ - if ((list->wh > len_x_value(list, value))) - { - if (list->is_left == 1) - x_isleft(list, value); - else if (list->is_zero == 1) - x_iszero(list, value); - else if (list->is_prec == 1) - x_isprec(list, value); - else - x_isprec(list, value); - } - else if (list->is_left == 1) - x_isleft(list, value); - else if (list->rec_prec == 1) - x_isprec(list, value); - else - printf_x_value(list, value); -} diff --git a/ft_printf/putchar_maker/put_x/ft_put_x_utilc.c b/ft_printf/putchar_maker/put_x/ft_put_x_utilc.c deleted file mode 100644 index 5b21307..0000000 --- a/ft_printf/putchar_maker/put_x/ft_put_x_utilc.c +++ /dev/null @@ -1,42 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_put_x_utilc.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:30:04 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../../ft_printf.h" - -void for_xiszero(t_printf *list, unsigned int value, int tmp, unsigned int c) -{ - if (value == 0) - while_c(list, ' ', (list->wh - len_x_value(list, c))); - else if (list->is_prec == 1) - while_c(list, ' ', tmp); - else - while_c(list, '0', (list->wh - len_x_value(list, c))); - printf_x_value(list, c); -} - -void for_min_xiszero(t_printf *list, unsigned int value, \ - int tmp, unsigned int *c) -{ - if (list->is_prec == 0) - { - ft_putchar('-'); - list->v_min = 0; - *c *= -1; - while_c(list, '0', tmp - 1); - printf_x_value(list, *c); - } - else - { - while_c(list, ' ', tmp - 1); - printf_x_value(list, value); - } -} diff --git a/ft_printf/putchar_maker/putmaket_utils.c b/ft_printf/putchar_maker/putmaket_utils.c deleted file mode 100644 index 2c10a4a..0000000 --- a/ft_printf/putchar_maker/putmaket_utils.c +++ /dev/null @@ -1,45 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* putmaket_utils.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: mdenys +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */ -/* Updated: 2020/12/16 05:39:25 by mdenys ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "../ft_printf.h" - -void ft_putnbr_fd_count(t_printf *list, long int n, int fd) -{ - long int nbr; - - if (n < 0) - { - ft_putchar_fd_count(list, '-', fd); - nbr = (unsigned int)(n * -1); - } - else - nbr = (unsigned int)n; - if (nbr >= 10) - ft_putnbr_fd_count(list, nbr / 10, fd); - ft_putchar_fd_count(list, (char)(nbr % 10 + '0'), fd); -} - -void ft_putnbr_u_fd_count(t_printf *list, unsigned int n, int fd) -{ - unsigned int nbr; - - if (n < 0) - { - ft_putchar_fd_count(list, '-', fd); - nbr = (unsigned int)(n * -1); - } - else - nbr = (unsigned int)n; - if (nbr >= 10) - ft_putnbr_u_fd_count(list, nbr / 10, fd); - ft_putchar_fd_count(list, (char)(nbr % 10 + '0'), fd); -} diff --git a/ft_printf_include_libft/Makefile b/ft_printf_include_libft/Makefile index 87bca00..8a4ae84 100644 --- a/ft_printf_include_libft/Makefile +++ b/ft_printf_include_libft/Makefile @@ -1,55 +1,60 @@ -# **************************************************************************** # -# # -# ::: :::::::: # -# Makefile :+: :+: :+: # -# +:+ +:+ +:+ # -# By: mdenys +#+ +:+ +#+ # -# +#+#+#+#+#+ +#+ # -# Created: 2020/10/28 11:52:03 by mdenys #+# #+# # -# Updated: 2021/01/10 21:19:54 by mdenys ### ########.fr # -# # -# **************************************************************************** # - LIBFT = ./libft/libft.a -N_TEMP = temp.a - NAME = libftprintf.a -dir = obj +srcs = +subsrcs = -SRCS = ft_printf.c parser/ft_parser.c parser/ft_parser_utils.c \ - putchar_maker/ft_put_c.c putchar_maker/put_d/ft_put_d.c \ - putchar_maker/put_d/ft_put_d_utilc.c putchar_maker/ft_put_p.c \ - putchar_maker/ft_put_s.c putchar_maker/ft_put_u.c putchar_maker/ft_put_x.c \ - putchar_maker/put_u/ft_put_u.c putchar_maker/put_u/ft_put_u_utilc.c\ - putchar_maker/put_x/ft_put_x.c putchar_maker/put_x/ft_put_x_utilc.c\ - putchar_maker/put_p/ft_put_p.c putchar_maker/put_p/ft_put_p_utilc.c\ - putchar_maker/putmaket_utils.c putchar_maker/put_d/ft_put_d_undersize.c +SRCS = ft_printf.c \ + ft_parser.c \ + ft_parser_utils.c \ + ft_put_c.c \ + ft_put_d.c \ + ft_put_d_utilc.c \ + ft_put_p.c \ + ft_put_s.c \ + ft_put_u.c \ + ft_put_x.c \ + ft_put_u.c \ + ft_put_u_utilc.c \ + ft_put_x.c\ + ft_put_x_utilc.c \ + ft_put_p.c\ + ft_put_p_utilc.c \ + putmaket_utils.c\ + ft_put_d_undersize.c \ + +OBJDIR= ./obj/ +# addprefix (OBJDIR, OBJS) SURPL_O = *.o CC = gcc -FLAGS = -c -Wall -Wextra -Werror +CFLAGS = -c -Wall -Wextra -Werror -I . OBJS = $(SRCS:.c=.o) -$(NAME): $(OBJS) - $(MAKE) bonus -C ./libft - cp libft/libft.a $(NAME) - $(CC) $(FLAGS) $(SRCS) - ar -rcs $(NAME) $(OBJS) +VPATH = -all : $(NAME) +$(NAME): $(OBJS) + mkdir -p $(OBJDIR) + $(CC) $(CFLAGS) $(SRCS) + +lib: + make bonus -C ./libft + cp libft/libft.a $(NAME) + +all : lib $(NAME) + ar -rcs $(NAME) $(OBJS) clean : $(MAKE) clean -C ./libft - rm -rf $(SURPL_O) - rm -rf $(OBJS) + rm -f $(SURPL_O) + rm -f $(OBJS) fclean : clean $(MAKE) fclean -C ./libft - rm -rf $(NAME) + rm -f $(NAME) re : fclean all diff --git a/ft_printf_include_libft/libft/Makefile b/ft_printf_include_libft/libft/Makefile index d972aa6..4fa9369 100644 --- a/ft_printf_include_libft/libft/Makefile +++ b/ft_printf_include_libft/libft/Makefile @@ -6,7 +6,7 @@ # By: mdenys +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/10/28 11:52:03 by mdenys #+# #+# # -# Updated: 2021/01/10 20:24:38 by mdenys ### ########.fr # +# Updated: 2021/01/10 22:56:29 by mdenys ### ########.fr # # # # **************************************************************************** # @@ -33,7 +33,7 @@ NAME = libft.a all: $(NAME) $(NAME): $(OBJS) libft.h - ar rcs $(NAME) $(OBJS) + ar rcs $@ $? clean: $(RM) $(OBJS) $(BONUS_OBJS) diff --git a/ft_printf_include_libft/libft/ft_atoi.o b/ft_printf_include_libft/libft/ft_atoi.o deleted file mode 100644 index 15e2709..0000000 Binary files a/ft_printf_include_libft/libft/ft_atoi.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_bzero.o b/ft_printf_include_libft/libft/ft_bzero.o deleted file mode 100644 index 7ee922d..0000000 Binary files a/ft_printf_include_libft/libft/ft_bzero.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_calloc.o b/ft_printf_include_libft/libft/ft_calloc.o deleted file mode 100644 index 92a2c36..0000000 Binary files a/ft_printf_include_libft/libft/ft_calloc.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_isalnum.o b/ft_printf_include_libft/libft/ft_isalnum.o deleted file mode 100644 index daec8e4..0000000 Binary files a/ft_printf_include_libft/libft/ft_isalnum.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_isalpha.o b/ft_printf_include_libft/libft/ft_isalpha.o deleted file mode 100644 index 0292d47..0000000 Binary files a/ft_printf_include_libft/libft/ft_isalpha.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_isascii.o b/ft_printf_include_libft/libft/ft_isascii.o deleted file mode 100644 index 291ef75..0000000 Binary files a/ft_printf_include_libft/libft/ft_isascii.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_isdigit.o b/ft_printf_include_libft/libft/ft_isdigit.o deleted file mode 100644 index d8d4d0f..0000000 Binary files a/ft_printf_include_libft/libft/ft_isdigit.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_isprint.o b/ft_printf_include_libft/libft/ft_isprint.o deleted file mode 100644 index a0e7354..0000000 Binary files a/ft_printf_include_libft/libft/ft_isprint.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_itoa.o b/ft_printf_include_libft/libft/ft_itoa.o deleted file mode 100644 index d82f392..0000000 Binary files a/ft_printf_include_libft/libft/ft_itoa.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstadd_back.o b/ft_printf_include_libft/libft/ft_lstadd_back.o deleted file mode 100644 index d32e6f1..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstadd_back.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstadd_front.o b/ft_printf_include_libft/libft/ft_lstadd_front.o deleted file mode 100644 index bd1d746..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstadd_front.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstclear.o b/ft_printf_include_libft/libft/ft_lstclear.o deleted file mode 100644 index a352b1e..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstclear.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstdelone.o b/ft_printf_include_libft/libft/ft_lstdelone.o deleted file mode 100644 index c25622f..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstdelone.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstiter.o b/ft_printf_include_libft/libft/ft_lstiter.o deleted file mode 100644 index 748ebb5..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstiter.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstlast.o b/ft_printf_include_libft/libft/ft_lstlast.o deleted file mode 100644 index 9ecbf78..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstlast.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstmap.o b/ft_printf_include_libft/libft/ft_lstmap.o deleted file mode 100644 index 3683853..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstmap.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstnew.o b/ft_printf_include_libft/libft/ft_lstnew.o deleted file mode 100644 index 85b89bc..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstnew.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_lstsize.o b/ft_printf_include_libft/libft/ft_lstsize.o deleted file mode 100644 index 317f19b..0000000 Binary files a/ft_printf_include_libft/libft/ft_lstsize.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_memccpy.o b/ft_printf_include_libft/libft/ft_memccpy.o deleted file mode 100644 index 9486a9c..0000000 Binary files a/ft_printf_include_libft/libft/ft_memccpy.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_memchr.o b/ft_printf_include_libft/libft/ft_memchr.o deleted file mode 100644 index fe06527..0000000 Binary files a/ft_printf_include_libft/libft/ft_memchr.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_memcmp.o b/ft_printf_include_libft/libft/ft_memcmp.o deleted file mode 100644 index e9522fc..0000000 Binary files a/ft_printf_include_libft/libft/ft_memcmp.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_memcpy.o b/ft_printf_include_libft/libft/ft_memcpy.o deleted file mode 100644 index dbf9d20..0000000 Binary files a/ft_printf_include_libft/libft/ft_memcpy.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_memmove.o b/ft_printf_include_libft/libft/ft_memmove.o deleted file mode 100644 index 68304f6..0000000 Binary files a/ft_printf_include_libft/libft/ft_memmove.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_memset.o b/ft_printf_include_libft/libft/ft_memset.o deleted file mode 100644 index ff31eaa..0000000 Binary files a/ft_printf_include_libft/libft/ft_memset.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_putchar.o b/ft_printf_include_libft/libft/ft_putchar.o deleted file mode 100644 index 2bc2daf..0000000 Binary files a/ft_printf_include_libft/libft/ft_putchar.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_putchar_fd.o b/ft_printf_include_libft/libft/ft_putchar_fd.o deleted file mode 100644 index b0b727e..0000000 Binary files a/ft_printf_include_libft/libft/ft_putchar_fd.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_putendl_fd.o b/ft_printf_include_libft/libft/ft_putendl_fd.o deleted file mode 100644 index 1b8c8e8..0000000 Binary files a/ft_printf_include_libft/libft/ft_putendl_fd.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_putnbr_fd.o b/ft_printf_include_libft/libft/ft_putnbr_fd.o deleted file mode 100644 index 286369a..0000000 Binary files a/ft_printf_include_libft/libft/ft_putnbr_fd.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_putstr_fd.o b/ft_printf_include_libft/libft/ft_putstr_fd.o deleted file mode 100644 index b8586eb..0000000 Binary files a/ft_printf_include_libft/libft/ft_putstr_fd.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_split.o b/ft_printf_include_libft/libft/ft_split.o deleted file mode 100644 index 685b9ab..0000000 Binary files a/ft_printf_include_libft/libft/ft_split.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strchr.o b/ft_printf_include_libft/libft/ft_strchr.o deleted file mode 100644 index d7e9665..0000000 Binary files a/ft_printf_include_libft/libft/ft_strchr.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strdup.o b/ft_printf_include_libft/libft/ft_strdup.o deleted file mode 100644 index bc9894e..0000000 Binary files a/ft_printf_include_libft/libft/ft_strdup.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strjoin.o b/ft_printf_include_libft/libft/ft_strjoin.o deleted file mode 100644 index ce1402e..0000000 Binary files a/ft_printf_include_libft/libft/ft_strjoin.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strlcat.o b/ft_printf_include_libft/libft/ft_strlcat.o deleted file mode 100644 index 4086144..0000000 Binary files a/ft_printf_include_libft/libft/ft_strlcat.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strlcpy.o b/ft_printf_include_libft/libft/ft_strlcpy.o deleted file mode 100644 index 44e2e24..0000000 Binary files a/ft_printf_include_libft/libft/ft_strlcpy.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strlen.o b/ft_printf_include_libft/libft/ft_strlen.o deleted file mode 100644 index b9520eb..0000000 Binary files a/ft_printf_include_libft/libft/ft_strlen.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strmapi.o b/ft_printf_include_libft/libft/ft_strmapi.o deleted file mode 100644 index 60b6a27..0000000 Binary files a/ft_printf_include_libft/libft/ft_strmapi.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strncmp.o b/ft_printf_include_libft/libft/ft_strncmp.o deleted file mode 100644 index f41a460..0000000 Binary files a/ft_printf_include_libft/libft/ft_strncmp.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strnstr.o b/ft_printf_include_libft/libft/ft_strnstr.o deleted file mode 100644 index d012b98..0000000 Binary files a/ft_printf_include_libft/libft/ft_strnstr.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strrchr.o b/ft_printf_include_libft/libft/ft_strrchr.o deleted file mode 100644 index d17649f..0000000 Binary files a/ft_printf_include_libft/libft/ft_strrchr.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_strtrim.o b/ft_printf_include_libft/libft/ft_strtrim.o deleted file mode 100644 index a919c9b..0000000 Binary files a/ft_printf_include_libft/libft/ft_strtrim.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_substr.o b/ft_printf_include_libft/libft/ft_substr.o deleted file mode 100644 index 3469980..0000000 Binary files a/ft_printf_include_libft/libft/ft_substr.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_tolower.o b/ft_printf_include_libft/libft/ft_tolower.o deleted file mode 100644 index b92af45..0000000 Binary files a/ft_printf_include_libft/libft/ft_tolower.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/ft_toupper.o b/ft_printf_include_libft/libft/ft_toupper.o deleted file mode 100644 index 4cd18a3..0000000 Binary files a/ft_printf_include_libft/libft/ft_toupper.o and /dev/null differ diff --git a/ft_printf_include_libft/libft/libft.a b/ft_printf_include_libft/libft/libft.a deleted file mode 100644 index 3961db3..0000000 Binary files a/ft_printf_include_libft/libft/libft.a and /dev/null differ diff --git a/ft_printf_include_libft/libftprintf.a b/ft_printf_include_libft/libftprintf.a deleted file mode 100644 index 3961db3..0000000 Binary files a/ft_printf_include_libft/libftprintf.a and /dev/null differ diff --git a/ft_printf_include_libft/parser/ft_parser.o b/ft_printf_include_libft/parser/ft_parser.o index 907569d..1251af2 100644 Binary files a/ft_printf_include_libft/parser/ft_parser.o and b/ft_printf_include_libft/parser/ft_parser.o differ diff --git a/ft_printf_include_libft/parser/ft_parser_utils.o b/ft_printf_include_libft/parser/ft_parser_utils.o index 0c32f7b..81a98e7 100644 Binary files a/ft_printf_include_libft/parser/ft_parser_utils.o and b/ft_printf_include_libft/parser/ft_parser_utils.o differ diff --git a/ft_printf_include_libft/putchar_maker/ft_put_c.o b/ft_printf_include_libft/putchar_maker/ft_put_c.o index 8f15531..6f3872b 100644 Binary files a/ft_printf_include_libft/putchar_maker/ft_put_c.o and b/ft_printf_include_libft/putchar_maker/ft_put_c.o differ diff --git a/ft_printf_include_libft/putchar_maker/ft_put_p.o b/ft_printf_include_libft/putchar_maker/ft_put_p.o index e0849bc..f4acd21 100644 Binary files a/ft_printf_include_libft/putchar_maker/ft_put_p.o and b/ft_printf_include_libft/putchar_maker/ft_put_p.o differ diff --git a/ft_printf_include_libft/putchar_maker/ft_put_s.o b/ft_printf_include_libft/putchar_maker/ft_put_s.o index 6051c4c..1a71ff5 100644 Binary files a/ft_printf_include_libft/putchar_maker/ft_put_s.o and b/ft_printf_include_libft/putchar_maker/ft_put_s.o differ diff --git a/ft_printf_include_libft/putchar_maker/ft_put_u.o b/ft_printf_include_libft/putchar_maker/ft_put_u.o index 9e1d362..a052a72 100644 Binary files a/ft_printf_include_libft/putchar_maker/ft_put_u.o and b/ft_printf_include_libft/putchar_maker/ft_put_u.o differ diff --git a/ft_printf_include_libft/putchar_maker/ft_put_x.o b/ft_printf_include_libft/putchar_maker/ft_put_x.o index d8bcd7f..794a1b6 100644 Binary files a/ft_printf_include_libft/putchar_maker/ft_put_x.o and b/ft_printf_include_libft/putchar_maker/ft_put_x.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_d/ft_put_d.o b/ft_printf_include_libft/putchar_maker/put_d/ft_put_d.o index 873650c..1c9fcee 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_d/ft_put_d.o and b/ft_printf_include_libft/putchar_maker/put_d/ft_put_d.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_undersize.o b/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_undersize.o index 73719f1..ee28e36 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_undersize.o and b/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_undersize.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_utilc.o b/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_utilc.o index b7eb0b8..4d55f1e 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_utilc.o and b/ft_printf_include_libft/putchar_maker/put_d/ft_put_d_utilc.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_p/ft_put_p.o b/ft_printf_include_libft/putchar_maker/put_p/ft_put_p.o index f3999a9..d4334c4 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_p/ft_put_p.o and b/ft_printf_include_libft/putchar_maker/put_p/ft_put_p.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_p/ft_put_p_utilc.o b/ft_printf_include_libft/putchar_maker/put_p/ft_put_p_utilc.o index 21bffab..e850df8 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_p/ft_put_p_utilc.o and b/ft_printf_include_libft/putchar_maker/put_p/ft_put_p_utilc.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_u/ft_put_u.o b/ft_printf_include_libft/putchar_maker/put_u/ft_put_u.o index 318547c..7c513e8 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_u/ft_put_u.o and b/ft_printf_include_libft/putchar_maker/put_u/ft_put_u.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_u/ft_put_u_utilc.o b/ft_printf_include_libft/putchar_maker/put_u/ft_put_u_utilc.o index d60582e..43b5924 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_u/ft_put_u_utilc.o and b/ft_printf_include_libft/putchar_maker/put_u/ft_put_u_utilc.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_x/ft_put_x.o b/ft_printf_include_libft/putchar_maker/put_x/ft_put_x.o index 9ca0407..2d6f5c2 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_x/ft_put_x.o and b/ft_printf_include_libft/putchar_maker/put_x/ft_put_x.o differ diff --git a/ft_printf_include_libft/putchar_maker/put_x/ft_put_x_utilc.o b/ft_printf_include_libft/putchar_maker/put_x/ft_put_x_utilc.o index 2988bbc..b7ccd14 100644 Binary files a/ft_printf_include_libft/putchar_maker/put_x/ft_put_x_utilc.o and b/ft_printf_include_libft/putchar_maker/put_x/ft_put_x_utilc.o differ diff --git a/ft_printf_include_libft/putchar_maker/putmaket_utils.o b/ft_printf_include_libft/putchar_maker/putmaket_utils.o index 6286d52..68c118e 100644 Binary files a/ft_printf_include_libft/putchar_maker/putmaket_utils.o and b/ft_printf_include_libft/putchar_maker/putmaket_utils.o differ