aboutsummaryrefslogtreecommitdiff
path: root/header.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-10-14 16:26:31 +0200
committerCharles <sircharlesaze@gmail.com>2019-10-14 16:26:31 +0200
commit60733a2298c7a93fe681f78af9b69e1639a791b5 (patch)
treeb1097d7596a7e369ecd12059533da4173967411e /header.h
parent374a9c43da4c2ee0ac19798abc840cd57cb7cf15 (diff)
downloadft_printf-60733a2298c7a93fe681f78af9b69e1639a791b5.tar.gz
ft_printf-60733a2298c7a93fe681f78af9b69e1639a791b5.tar.bz2
ft_printf-60733a2298c7a93fe681f78af9b69e1639a791b5.zip
WIP: format parsing arguments extraction
Changed pformat struct, everything is broken
Diffstat (limited to 'header.h')
-rw-r--r--header.h39
1 files changed, 28 insertions, 11 deletions
diff --git a/header.h b/header.h
index 8c125bb..c770d35 100644
--- a/header.h
+++ b/header.h
@@ -31,16 +31,24 @@ typedef int t_bool;
typedef struct
{
- int ap_index;
- t_bool left_adjusted;
- t_bool zero_padding;
- int precision;
- t_bool precision_wildcard;
- int min_field_width;
- t_bool min_field_width_wildcard;
- t_conversion conversion;
- int len;
-} t_pformat;
+ int hardcoded;
+ struct
+ {
+ t_bool exist;
+ int ap_index;
+ } wildcard;
+} t_maybe_wildcard;
+
+typedef struct
+{
+ int ap_index;
+ t_bool left_adjusted;
+ t_bool zero_padding;
+ t_maybe_wildcard precision;
+ t_maybe_wildcard min_width;
+ t_conversion conversion;
+ int len;
+} t_pformat;
typedef struct s_list
{
@@ -82,7 +90,7 @@ void handle_precision(t_pformat *pformat, char *str);
** utils.c
*/
-int ft_atoi(const char *str);
+int ft_atoi(const char *str);
char *ft_strndup(const char *s1, int n);
char *ft_strrchr(const char *s, int c);
int strrchr_index(const char *s, char c);
@@ -90,6 +98,15 @@ int ft_strlen(char *str);
t_bool ft_isdigit(char c);
/*
+** extract.c
+*/
+
+char *extract_ap_index(t_pformat *pformat, char *fmt);
+char *extract_min_width(t_pformat *pformat, char *fmt);
+char *extract_standalone_flags(t_pformat *pformat, char *fmt);
+char *extract_precision(t_pformat *pformat, char *fmt);
+
+/*
** list.c
*/