22#include "../utils/utils.h"
23#include "../../../libft/libft.h"
93 return (
print(seq, fd, total));
void init_subspec(t_subspec *subspec)
Sets initial values for a s_subspec that are not always set elsewhere.
void identify_sequence(va_list args, t_sequence *seq)
Initialize a s_sequence and determine which specifier it needs to handle, and runs the preprocessing ...
void parse_subspec(const char **format, t_subspec *subspec, va_list args)
Parse flags, width, precision, and length.
static int print(t_sequence seq, int *fd, int total)
Print appropriate padding characters on either side, as well as the sign / prefix,...
int handle_sequence(const char **format, va_list args, int *fd, int total)
Prepares and executes a sequence.
int wrap_err(int n, int *total)
Wrapper for handling functions that return a positive integer on success and -1 on failure....
size_t ft_strlen(const char *str)
Get length of str.
int repeat_str_n(const char *str, int n, int fd)
Write exactly n characters from str on descriptor fd. Repeats string if ft_strlen(str) is greater tha...
Holds information regarding the current format specifier sequence.
int(* process)(struct s_sequence, int *, int)
Function to use for processing this sequence's value.
char specifier
The specifier character for this sequence.
t_subspec subspec
Holds subspecifier options for a format specifier.
int total_len
Total number of characters after padding.
char * sign
String containing the prefix for the value. Set during preprocessing for a format handler.
int pad_len
Number of characters to pad.
Holds subspecifier options for a format specifier.
int min_width
Minimum number of characters to be printed.
char left_justify
1 or 0, whether padding should left justify.
char * pad_str
String used when padding values.