diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-10-28 04:15:16 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-10-28 04:15:16 +0100 |
| commit | f6ee1462e26d723cf5d53157eadaff2804d18c3a (patch) | |
| tree | 366ba00a09afe4b7d21c55ee25fd98030b2cd5a5 /header.h | |
| parent | feb71e200972bb78fe86130629ef040ef80811a7 (diff) | |
| download | ft_printf-f6ee1462e26d723cf5d53157eadaff2804d18c3a.tar.gz ft_printf-f6ee1462e26d723cf5d53157eadaff2804d18c3a.tar.bz2 ft_printf-f6ee1462e26d723cf5d53157eadaff2804d18c3a.zip | |
reformed pformat struct, rename t_flist
Diffstat (limited to 'header.h')
| -rw-r--r-- | header.h | 67 |
1 files changed, 30 insertions, 37 deletions
@@ -29,78 +29,71 @@ typedef int t_bool; typedef struct { - int value; - struct - { - t_bool exist; - int ap_index; - } wildcard; + int value; + t_bool 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_pformat_list + 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_flist { - struct s_pformat_list *next; - t_pformat *content; -} t_pformat_list; + struct s_flist *next; + t_pformat *content; +} t_flist; /* ** ft_printf.c */ -int ft_printf(const char *format, ...); +int ft_printf(const char *format, ...); /* ** parse.c */ -t_pformat_list *parse(const char *format); -char *isolate_conversion(const char *conversion_start); -t_pformat *parse_reduced(char *fmt); +t_flist *parse(const char *format); +char *isolate_conversion(const char *conversion_start); +t_pformat *parse_reduced(char *fmt); /* ** printer.c */ -void handle_padding(t_pformat *pformat, char *str); -char *convert_to_str(t_pformat *pformat, va_list ap); -void handle_precision(t_pformat *pformat, char *str); +void handle_padding(t_pformat *pformat, char *str); +char *convert_to_str(t_pformat *pformat, va_list ap); +void handle_precision(t_pformat *pformat, char *str); /* ** utils.c */ -int strrchr_index(const char *s, char c); +int strrchr_index(const char *s, 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); +char *extract_standalone_flags(t_pformat *pformat, char *fmt); +char *extract_min_width(t_pformat *pformat, char *fmt); +char *extract_precision(t_pformat *pformat, char *fmt); /* ** list.c */ -t_pformat_list *list_new(t_pformat *content); -void *list_destroy(t_pformat_list **lst); -void list_push_front(t_pformat_list **lst, t_pformat_list *new); -void list_push_back(t_pformat_list **lst, t_pformat_list *new); -void list_pop_front(t_pformat_list **lst); +t_flist *list_new(t_pformat *content); +void *list_destroy(t_flist **lst); +void list_push_front(t_flist **lst, t_flist *new); +void list_pop_front(t_flist **lst); +void list_reverse(t_flist **lst); #endif |
