From d2d5c969e820e0350d1d70c2977e2b6b1f48e5a5 Mon Sep 17 00:00:00 2001 From: nicolas-arnaud Date: Sat, 8 Apr 2023 23:37:38 +0200 Subject: [PATCH] changed fprintf to use FILE --- compile_commands.json | 1019 +++++++++++++++++++++++++++++++++++++++-- includes/ft_printf.h | 3 +- srcs/ft_printf.c | 4 +- 3 files changed, 989 insertions(+), 37 deletions(-) diff --git a/compile_commands.json b/compile_commands.json index b15e0ea..c82c8d7 100644 --- a/compile_commands.json +++ b/compile_commands.json @@ -2,20 +2,962 @@ { "arguments": [ "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "is/ft_isalpha.o", + "is/ft_isalpha.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/is/ft_isalpha.c", + "output": "/home/nicolas/Development/ft_printf/libft/is/ft_isalpha.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "is/ft_isdigit.o", + "is/ft_isdigit.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/is/ft_isdigit.c", + "output": "/home/nicolas/Development/ft_printf/libft/is/ft_isdigit.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "is/ft_isascii.o", + "is/ft_isascii.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/is/ft_isascii.c", + "output": "/home/nicolas/Development/ft_printf/libft/is/ft_isascii.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "is/ft_isprint.o", + "is/ft_isprint.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/is/ft_isprint.c", + "output": "/home/nicolas/Development/ft_printf/libft/is/ft_isprint.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "is/ft_isalnum.o", + "is/ft_isalnum.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/is/ft_isalnum.c", + "output": "/home/nicolas/Development/ft_printf/libft/is/ft_isalnum.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "is/ft_isspace.o", + "is/ft_isspace.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/is/ft_isspace.c", + "output": "/home/nicolas/Development/ft_printf/libft/is/ft_isspace.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "is/ft_isnumber.o", + "is/ft_isnumber.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/is/ft_isnumber.c", + "output": "/home/nicolas/Development/ft_printf/libft/is/ft_isnumber.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_len.o", + "str/ft_len.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_len.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_len.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_lcpy.o", + "str/ft_lcpy.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_lcpy.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_lcpy.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_lcat.o", + "str/ft_lcat.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_lcat.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_lcat.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_chr.o", + "str/ft_chr.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_chr.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_chr.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_rchr.o", + "str/ft_rchr.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_rchr.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_rchr.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_ncmp.o", + "str/ft_ncmp.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_ncmp.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_ncmp.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_nstr.o", + "str/ft_nstr.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_nstr.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_nstr.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_dup.o", + "str/ft_dup.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_dup.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_dup.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_sub.o", + "str/ft_sub.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_sub.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_sub.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_join.o", + "str/ft_join.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_join.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_join.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_trim.o", + "str/ft_trim.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_trim.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_trim.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_split.o", + "str/ft_split.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_split.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_split.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_rev.o", + "str/ft_rev.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_rev.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_rev.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_mapi.o", + "str/ft_mapi.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_mapi.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_mapi.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_iteri.o", + "str/ft_iteri.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_iteri.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_iteri.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_join_with.o", + "str/ft_join_with.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_join_with.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_join_with.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_new.o", + "str/ft_new.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_new.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_new.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "str/ft_append.o", + "str/ft_append.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/str/ft_append.c", + "output": "/home/nicolas/Development/ft_printf/libft/str/ft_append.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "conv/ft_toupper.o", + "conv/ft_toupper.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/conv/ft_toupper.c", + "output": "/home/nicolas/Development/ft_printf/libft/conv/ft_toupper.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "conv/ft_tolower.o", + "conv/ft_tolower.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/conv/ft_tolower.c", + "output": "/home/nicolas/Development/ft_printf/libft/conv/ft_tolower.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "conv/ft_atoi.o", + "conv/ft_atoi.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/conv/ft_atoi.c", + "output": "/home/nicolas/Development/ft_printf/libft/conv/ft_atoi.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "conv/ft_itoa.o", + "conv/ft_itoa.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/conv/ft_itoa.c", + "output": "/home/nicolas/Development/ft_printf/libft/conv/ft_itoa.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "conv/ft_itox.o", + "conv/ft_itox.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/conv/ft_itox.c", + "output": "/home/nicolas/Development/ft_printf/libft/conv/ft_itox.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "conv/ft_utoa.o", + "conv/ft_utoa.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/conv/ft_utoa.c", + "output": "/home/nicolas/Development/ft_printf/libft/conv/ft_utoa.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_bzero.o", + "mem/ft_bzero.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_bzero.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_bzero.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_memset.o", + "mem/ft_memset.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_memset.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_memset.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_memchr.o", + "mem/ft_memchr.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_memchr.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_memchr.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_memcpy.o", + "mem/ft_memcpy.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_memcpy.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_memcpy.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_memcmp.o", + "mem/ft_memcmp.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_memcmp.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_memcmp.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_memmove.o", + "mem/ft_memmove.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_memmove.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_memmove.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_calloc.o", + "mem/ft_calloc.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_calloc.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_calloc.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "mem/ft_free_split.o", + "mem/ft_free_split.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/mem/ft_free_split.c", + "output": "/home/nicolas/Development/ft_printf/libft/mem/ft_free_split.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", "-Werror", + "-c", + "-o", + "put/ft_putchar_fd.o", + "put/ft_putchar_fd.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/put/ft_putchar_fd.c", + "output": "/home/nicolas/Development/ft_printf/libft/put/ft_putchar_fd.o" + }, + { + "arguments": [ + "/usr/bin/gcc", "-Wall", "-Wextra", + "-Werror", "-c", - "-g", - "-I", - "includes", "-o", - "srcs/ft_printf.p.o", - "srcs/ft_printf.c" + "put/ft_putnbr_fd.o", + "put/ft_putnbr_fd.c" ], - "directory": "/home/nicolas/Development/ft_printf", - "file": "/home/nicolas/Development/ft_printf/srcs/ft_printf.c", - "output": "/home/nicolas/Development/ft_printf/srcs/ft_printf.p.o" + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/put/ft_putnbr_fd.c", + "output": "/home/nicolas/Development/ft_printf/libft/put/ft_putnbr_fd.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "put/ft_putendl_fd.o", + "put/ft_putendl_fd.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/put/ft_putendl_fd.c", + "output": "/home/nicolas/Development/ft_printf/libft/put/ft_putendl_fd.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "put/ft_putstr_fd.o", + "put/ft_putstr_fd.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/put/ft_putstr_fd.c", + "output": "/home/nicolas/Development/ft_printf/libft/put/ft_putstr_fd.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "put/ft_putnstr_fd.o", + "put/ft_putnstr_fd.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/put/ft_putnstr_fd.c", + "output": "/home/nicolas/Development/ft_printf/libft/put/ft_putnstr_fd.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "nbr/ft_nbrlen.o", + "nbr/ft_nbrlen.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/nbr/ft_nbrlen.c", + "output": "/home/nicolas/Development/ft_printf/libft/nbr/ft_nbrlen.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "nbr/ft_croissant.o", + "nbr/ft_croissant.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/nbr/ft_croissant.c", + "output": "/home/nicolas/Development/ft_printf/libft/nbr/ft_croissant.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "nbr/ft_decroissant.o", + "nbr/ft_decroissant.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/nbr/ft_decroissant.c", + "output": "/home/nicolas/Development/ft_printf/libft/nbr/ft_decroissant.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "nbr/ft_max.o", + "nbr/ft_max.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/nbr/ft_max.c", + "output": "/home/nicolas/Development/ft_printf/libft/nbr/ft_max.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "nbr/ft_min.o", + "nbr/ft_min.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/nbr/ft_min.c", + "output": "/home/nicolas/Development/ft_printf/libft/nbr/ft_min.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_size.o", + "slist/ft_size.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_size.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_size.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_new.o", + "slist/ft_new.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_new.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_new.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_last.o", + "slist/ft_last.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_last.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_last.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_add_back.o", + "slist/ft_add_back.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_add_back.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_add_back.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_add_front.o", + "slist/ft_add_front.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_add_front.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_add_front.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_delone.o", + "slist/ft_delone.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_delone.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_delone.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_clear.o", + "slist/ft_clear.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_clear.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_clear.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_iter.o", + "slist/ft_iter.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_iter.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_iter.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "slist/ft_map.o", + "slist/ft_map.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/slist/ft_map.c", + "output": "/home/nicolas/Development/ft_printf/libft/slist/ft_map.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "i_slist/ft_free.o", + "i_slist/ft_free.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/i_slist/ft_free.c", + "output": "/home/nicolas/Development/ft_printf/libft/i_slist/ft_free.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "i_slist/ft_first.o", + "i_slist/ft_first.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/i_slist/ft_first.c", + "output": "/home/nicolas/Development/ft_printf/libft/i_slist/ft_first.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "i_slist/ft_is_in.o", + "i_slist/ft_is_in.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/i_slist/ft_is_in.c", + "output": "/home/nicolas/Development/ft_printf/libft/i_slist/ft_is_in.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "dlist/ft_add.o", + "dlist/ft_add.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/dlist/ft_add.c", + "output": "/home/nicolas/Development/ft_printf/libft/dlist/ft_add.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "dlist/ft_n.o", + "dlist/ft_n.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/dlist/ft_n.c", + "output": "/home/nicolas/Development/ft_printf/libft/dlist/ft_n.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-Werror", + "-c", + "-o", + "dlist/ft_to_arr.o", + "dlist/ft_to_arr.c" + ], + "directory": "/home/nicolas/Development/ft_printf/libft", + "file": "/home/nicolas/Development/ft_printf/libft/dlist/ft_to_arr.c", + "output": "/home/nicolas/Development/ft_printf/libft/dlist/ft_to_arr.o" }, { "arguments": [ @@ -25,15 +967,14 @@ "-Wextra", "-c", "-g", - "-I", - "includes", + "-I./includes", "-o", - "srcs/ft_print_chars.p.o", + "srcs/ft_print_chars.o", "srcs/ft_print_chars.c" ], "directory": "/home/nicolas/Development/ft_printf", "file": "/home/nicolas/Development/ft_printf/srcs/ft_print_chars.c", - "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_chars.p.o" + "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_chars.o" }, { "arguments": [ @@ -43,15 +984,14 @@ "-Wextra", "-c", "-g", - "-I", - "includes", + "-I./includes", "-o", - "srcs/ft_print_hexs.p.o", + "srcs/ft_print_hexs.o", "srcs/ft_print_hexs.c" ], "directory": "/home/nicolas/Development/ft_printf", "file": "/home/nicolas/Development/ft_printf/srcs/ft_print_hexs.c", - "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_hexs.p.o" + "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_hexs.o" }, { "arguments": [ @@ -61,15 +1001,14 @@ "-Wextra", "-c", "-g", - "-I", - "includes", + "-I./includes", "-o", - "srcs/ft_print_nbrs.p.o", + "srcs/ft_print_nbrs.o", "srcs/ft_print_nbrs.c" ], "directory": "/home/nicolas/Development/ft_printf", "file": "/home/nicolas/Development/ft_printf/srcs/ft_print_nbrs.c", - "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_nbrs.p.o" + "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_nbrs.o" }, { "arguments": [ @@ -79,15 +1018,14 @@ "-Wextra", "-c", "-g", - "-I", - "includes", + "-I./includes", "-o", - "srcs/ft_print_opts.p.o", + "srcs/ft_print_opts.o", "srcs/ft_print_opts.c" ], "directory": "/home/nicolas/Development/ft_printf", "file": "/home/nicolas/Development/ft_printf/srcs/ft_print_opts.c", - "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_opts.p.o" + "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_opts.o" }, { "arguments": [ @@ -97,15 +1035,14 @@ "-Wextra", "-c", "-g", - "-I", - "includes", + "-I./includes", "-o", - "srcs/ft_print_ptrs.p.o", + "srcs/ft_print_ptrs.o", "srcs/ft_print_ptrs.c" ], "directory": "/home/nicolas/Development/ft_printf", "file": "/home/nicolas/Development/ft_printf/srcs/ft_print_ptrs.c", - "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_ptrs.p.o" + "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_ptrs.o" }, { "arguments": [ @@ -115,16 +1052,30 @@ "-Wextra", "-c", "-g", - "-D", - "FPRINTF", - "-I", - "includes", + "-I./includes", "-o", - "srcs/ft_printf.f.o", + "srcs/ft_printf.o", "srcs/ft_printf.c" ], "directory": "/home/nicolas/Development/ft_printf", "file": "/home/nicolas/Development/ft_printf/srcs/ft_printf.c", - "output": "/home/nicolas/Development/ft_printf/srcs/ft_printf.f.o" + "output": "/home/nicolas/Development/ft_printf/srcs/ft_printf.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Werror", + "-Wall", + "-Wextra", + "-c", + "-g", + "-I./includes", + "-o", + "srcs/ft_print_strings.o", + "srcs/ft_print_strings.c" + ], + "directory": "/home/nicolas/Development/ft_printf", + "file": "/home/nicolas/Development/ft_printf/srcs/ft_print_strings.c", + "output": "/home/nicolas/Development/ft_printf/srcs/ft_print_strings.o" } ] diff --git a/includes/ft_printf.h b/includes/ft_printf.h index 8e0a743..7e1dada 100644 --- a/includes/ft_printf.h +++ b/includes/ft_printf.h @@ -16,6 +16,7 @@ # include "libft.h" # include +# include typedef struct s_opts { int len; @@ -54,5 +55,5 @@ void va_print_perc(va_list va, const char *str, t_opts *opts); void ft_format(const char *str, va_list args); int ft_printf(const char *str, ...); -int ft_fprintf(int fd, const char *format, ...); +int ft_fprintf(FILE *file, const char *format, ...); int ft_sprintf(char *ret, const char *format, ...); diff --git a/srcs/ft_printf.c b/srcs/ft_printf.c index 09df435..253d9fe 100644 --- a/srcs/ft_printf.c +++ b/srcs/ft_printf.c @@ -117,7 +117,7 @@ int ft_printf(const char *format, ...) return (ret); } -int ft_fprintf(int fd, const char *format, ...) +int ft_fprintf(FILE *file, const char *format, ...) { int ret; t_dlist *strings; @@ -130,7 +130,7 @@ int ft_fprintf(int fd, const char *format, ...) while (strings) { ret += strings->size; - ft_putnstr_fd(strings->size, strings->content, fd); + fwrite(strings->content, sizeof(char), strings->size, file); strings = strings->next; } clean_list();