Move dispatcher to ft_vprintf_percent.c

This commit is contained in:
gbaconni
2022-04-18 00:52:18 +02:00
parent 0269a1dc70
commit 0cd1d2ef1b
10 changed files with 141 additions and 39 deletions

View File

@@ -6,7 +6,7 @@
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:43:52 by gbaconni #+# #+# */
/* Updated: 2022/04/16 01:14:44 by gbaconni ### lausanne.ch */
/* Updated: 2022/04/17 22:45:28 by gbaconni ### lausanne.ch */
/* */
/* ************************************************************************** */
@@ -20,20 +20,9 @@ int ft_vprintf(char const *format, va_list ap)
while (*format != 0)
{
if (*format == '%')
{
if (*++format == '%')
ret += ft_vprintf_percent(format, ap);
else if (*format == 'c')
ret += ft_vprintf_char(format, ap);
else if (*format == 's')
ret += ft_vprintf_string(format, ap);
else if (*format == 'p')
ret += ft_vprintf_pointer(format, ap);
else if (*format == 'd' || *format == 'i' || *format == 'u')
ret += ft_vprintf_decimal(format, ap);
else if (*format == 'x' || *format == 'X')
ret += ft_vprintf_hexadecimal(format, ap);
}
ret += ft_vprintf_percent(++format, ap);
else if (*format == '\\')
ret += ft_vprintf_escape(++format, ap);
else
ret += ft_vprintf_other(format, ap);
format++;