aboutsummaryrefslogtreecommitdiff
path: root/src/io/ft_printf/internals/convert_written.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/ft_printf/internals/convert_written.c')
-rw-r--r--src/io/ft_printf/internals/convert_written.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/io/ft_printf/internals/convert_written.c b/src/io/ft_printf/internals/convert_written.c
new file mode 100644
index 0000000..4beeaef
--- /dev/null
+++ b/src/io/ft_printf/internals/convert_written.c
@@ -0,0 +1,28 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* convert_written.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* 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);
+}