This commit is contained in:
Etienne Rey-bethbeder
2023-02-14 13:55:02 +01:00
36 changed files with 737 additions and 186 deletions

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/23 18:08:31 by cchauvet #+# #+# */
/* Updated: 2023/01/05 17:37:12 by cchauvet ### ########.fr */
/* Updated: 2023/02/03 12:52:38 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -27,7 +27,7 @@ int ft_dprintarg(int fd, int arg, va_list args)
if (arg == 'S')
return (ft_dprintstrtab(fd, va_arg(args, char **)));
if (arg == 's')
return (ft_putstr_fd(fd, va_arg(args, char *)));
return (ft_putstr_fd_p(fd, va_arg(args, char *)));
if (arg == '%')
return (ft_putchar_fd(fd, '%'));
if (arg == 'p')

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/06 17:41:04 by cchauvet #+# #+# */
/* Updated: 2022/10/12 15:22:40 by cchauvet ### ########.fr */
/* Updated: 2023/02/03 12:53:45 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,10 +18,10 @@ int ft_dprintptr(int fd, void *ptr)
int i;
if (ptr == NULL)
return (ft_putstr_fd(fd, "(nil)"));
return (ft_putstr_fd_p(fd, "(nil)"));
address = (unsigned long) ptr;
i = 2;
ft_putstr_fd(fd, "0x");
ft_putstr_fd_p(fd, "0x");
i += ft_dprintul_base(fd, address, "0123456789abcdef");
return (i);
}

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/05 17:26:55 by cchauvet #+# #+# */
/* Updated: 2023/01/05 18:52:56 by cchauvet ### ########.fr */
/* Updated: 2023/02/03 12:54:44 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,7 +21,7 @@ int ft_dprintstrtab(int fd, char **tab)
index = 0;
while (tab[index] != NULL)
{
i += ft_putstr_fd(fd, tab[index]) + 1;
i += ft_putstr_fd_p(fd, tab[index]) + 1;
ft_putchar_fd(fd, '\n');
index++;
}

View File

@ -12,7 +12,7 @@
#include "ft_printf.h"
int ft_printf(const char *format, ...)
int ft_eprintf(const char *format, ...)
{
va_list va;
int i;

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/26 14:47:54 by cchauvet #+# #+# */
/* Updated: 2023/02/01 16:19:38 by cchauvet ### ########.fr */
/* Updated: 2023/02/03 12:51:07 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -37,6 +37,6 @@ int ft_eprintf(const char *format, ...);
int ft_vdprintf(int fd, const char *format, va_list va);
int ft_putchar_fd(int fd, char c);
int ft_putstr_fd(int fd, char *str);
int ft_putstr_fd_p(int fd, char *str);
#endif

View File

@ -6,13 +6,13 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/29 22:25:08 by cchauvet #+# #+# */
/* Updated: 2022/10/12 16:51:51 by cchauvet ### ########.fr */
/* Updated: 2023/02/03 12:49:18 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putstr_fd(int fd, char *str)
int ft_putstr_fd_p(int fd, char *str)
{
int i;