diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-10-14 16:26:31 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-10-14 16:26:31 +0200 |
| commit | 60733a2298c7a93fe681f78af9b69e1639a791b5 (patch) | |
| tree | b1097d7596a7e369ecd12059533da4173967411e /header.h | |
| parent | 374a9c43da4c2ee0ac19798abc840cd57cb7cf15 (diff) | |
| download | ft_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.h | 39 |
1 files changed, 28 insertions, 11 deletions
@@ -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 */ |
