From ee4b8e5e481850c936c5df10a0d3e70038234754 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 21 Nov 2019 02:53:41 +0100 Subject: WIP: adding ft_*printf --- ft_printf/convert_written.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ft_printf/convert_written.c (limited to 'ft_printf/convert_written.c') diff --git a/ft_printf/convert_written.c b/ft_printf/convert_written.c new file mode 100644 index 0000000..4beeaef --- /dev/null +++ b/ft_printf/convert_written.c @@ -0,0 +1,28 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* convert_written.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/30 23:38:28 by cacharle #+# #+# */ +/* Updated: 2019/11/05 23:59:24 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_vasprintf.h" + +char *convert_written(va_list ap, t_pformat *pformat) +{ + if (pformat->flags & FLAG_SHORT) + pformat->written = (long long int*)va_arg(ap, signed char*); + if (pformat->flags & FLAG_SHORT_SHORT) + pformat->written = (long long int*)va_arg(ap, short*); + if (pformat->flags & FLAG_LONG) + pformat->written = (long long int*)va_arg(ap, long int*); + if (pformat->flags & FLAG_LONG_LONG) + pformat->written = va_arg(ap, long long int*); + else + pformat->written = (long long int*)va_arg(ap, int*); + return (NULL); +} -- cgit