aboutsummaryrefslogtreecommitdiff
path: root/header.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-10-28 04:15:16 +0100
committerCharles <sircharlesaze@gmail.com>2019-10-28 04:15:16 +0100
commitf6ee1462e26d723cf5d53157eadaff2804d18c3a (patch)
tree366ba00a09afe4b7d21c55ee25fd98030b2cd5a5 /header.h
parentfeb71e200972bb78fe86130629ef040ef80811a7 (diff)
downloadft_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.h67
1 files changed, 30 insertions, 37 deletions
diff --git a/header.h b/header.h
index c482e94..20d6370 100644
--- a/header.h
+++ b/header.h
@@ -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