heredoc support

This commit is contained in:
Camille Chauvet
2023-02-03 16:02:52 +01:00
parent 3654ff91bb
commit b8017175e8
27 changed files with 81 additions and 37 deletions

Binary file not shown.

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:20:05 by cchauvet ### ########.fr */
/* Updated: 2023/02/03 12:42:13 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -67,7 +67,7 @@ char *ft_itoa(int n);
char *ft_strmapi(char const *s, char (*f)(unsigned int, char));
void ft_striteri(char *s, void (*f)(unsigned int, char*));
void ft_putchar_fd(int fd, char c);
void ft_putstr_fd(int fd, char *s);
void ft_putstr_fd(char *s, int fd);
void ft_putendl_fd(int fd, char *s);
void ft_putnbr_fd(int fd, int n);

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')

Binary file not shown.

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);
}

Binary file not shown.

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++;
}

Binary file not shown.

Binary file not shown.

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;

Binary file not shown.