aboutsummaryrefslogtreecommitdiff
path: root/header.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-10-31 01:45:37 +0100
committerCharles <sircharlesaze@gmail.com>2019-10-31 01:45:37 +0100
commit0f6cd15b0c7ce2d4d0154ae027985ed640cd543f (patch)
treeb30dc09db7e42b1e1e9924995b608ee153daddc5 /header.h
parentd63d6916249f5b40b81097854d8ca2c9d4d7d071 (diff)
downloadft_printf-0f6cd15b0c7ce2d4d0154ae027985ed640cd543f.tar.gz
ft_printf-0f6cd15b0c7ce2d4d0154ae027985ed640cd543f.tar.bz2
ft_printf-0f6cd15b0c7ce2d4d0154ae027985ed640cd543f.zip
Handle 'n' flag
Diffstat (limited to 'header.h')
-rw-r--r--header.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/header.h b/header.h
index 9667772..1a562cd 100644
--- a/header.h
+++ b/header.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/29 00:06:46 by cacharle #+# #+# */
-/* Updated: 2019/10/30 23:13:41 by cacharle ### ########.fr */
+/* Updated: 2019/10/31 00:04:28 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -25,17 +25,7 @@
# define IN_STR(str, c) (ft_strchr(str, c) != NULL)
# define IS_STANDALONE_FLAG(c) (IN_STR("0-+ #'", c))
-# define CONVERSIONS_STR "cspdiuxX%"
-
-# define CONVERSION_CHAR 'c'
-# define CONVERSION_STR 's'
-# define CONVERSION_PTR 'p'
-# define CONVERSION_DECIMAL 'd'
-# define CONVERSION_INT 'i'
-# define CONVERSION_UINT 'u'
-# define CONVERSION_HEX_LOWER 'x'
-# define CONVERSION_HEX_UPPER 'X'
-# define CONVERSION_PERCENT '%'
+# define CONVERSIONS_STR "ncspdiuxX%"
# define FLAG_LEFT_ADJUSTED (1 << 0)
# define FLAG_ZERO_PADDING (1 << 1)
@@ -67,6 +57,7 @@ typedef struct
char type;
int fmt_len;
int size;
+ int *written;
} t_pformat;
typedef struct s_flist
@@ -138,5 +129,6 @@ char *convert_int(va_list ap, t_pformat *pformat);
char *convert_uint(va_list ap, t_pformat *pformat);
char *convert_hex(va_list ap, t_pformat *pformat);
char *convert_percent(va_list ap, t_pformat *pformat);
+char *convert_written(va_list ap, t_pformat *pformat);
#endif