22#include "../utils/utils.h"
23#include "../../../libft/libft.h"
50 if (**format ==
'h' && (*format)++)
53 if (**format ==
'h' && (*format)++)
56 else if (**format ==
'l' && (*format)++)
59 if (**format ==
'l' && (*format)++)
62 else if (**format ==
'j' && (*format)++)
64 else if (**format ==
'z' && (*format)++)
66 else if (**format ==
't' && (*format)++)
84 return (va_arg(args,
int));
101 while (**format &&
ft_strchr(
"-+ #0_", **format))
105 else if (**format ==
'+')
107 else if (**format ==
' ')
109 else if (**format ==
'#')
112 subspec->
pad_str =
"0000000000";
113 else if (**format ==
'_')
114 subspec->
pad_str = va_arg(args,
char *);
int ft_atoi(const char *str)
Converts ASCII string str to integer representation.
int ft_isdigit(int c)
Is c a numeric character.
char * ft_strchr(const char *s, int c)
Finds first occurence of character c in string s.
static void parse_lenmod(const char **format, t_subspec *subspec)
Parse the length modifier for the sequence.
void init_subspec(t_subspec *subspec)
Sets initial values for a s_subspec that are not always set elsewhere.
void parse_subspec(const char **format, t_subspec *subspec, va_list args)
Parse flags, width, precision, and length.
static int subspec_parse_width_or_precision(const char **format, va_list args)
Parse inline or variable argument width or precision.
Holds subspecifier options for a format specifier.
int precision
Minimum number of digits to be printed, or maximum characters for strings.
int min_width
Minimum number of characters to be printed.
char force_decimal
1 or 0, whether or not to prefix octals or hexadecimals with their respective prefixes....
char * forced_sign
String to print before the value. Set before preprocessing for a format handler. Will be overriden,...
t_lenmod lenmod
Represents the length modifiers for a format specifier's variable argument.
char left_justify
1 or 0, whether padding should left justify.
char * pad_str
String used when padding values.