#include <unistd.h>
#include "ft_printf_local.h"
#include "../ft_math/ft_math.h"
Go to the source code of this file.
◆ calc_pad_zero_len()
| static int calc_pad_zero_len |
( |
t_fmt * |
fmt, |
|
|
int * |
pad_len, |
|
|
int * |
zero_len |
|
) |
| |
|
static |
Definition at line 17 of file print_all.c.
19 int expected_print_len;
30 *pad_len =
ft_max(0, *pad_len - *zero_len);
37 return (expected_print_len);
◆ print_all()
| int print_all |
( |
int |
dstfd, |
|
|
t_list * |
list |
|
) |
| |
Definition at line 106 of file print_all.c.
123 written_count += tmp;
126 return (written_count);
static int print_str(int dstfd, t_fmt *fmt)
static int print_char(int dstfd, t_fmt *fmt)
static int print_buf(int dstfd, t_fmt *fmt)
◆ print_buf()
| static int print_buf |
( |
int |
dstfd, |
|
|
t_fmt * |
fmt |
|
) |
| |
|
static |
Definition at line 40 of file print_all.c.
47 while (!(fmt->
f_minus) && pad_len-- > 0)
50 while (zero_len-- > 0)
53 while (fmt->
f_minus && pad_len-- > 0)
static int calc_pad_zero_len(t_fmt *fmt, int *pad_len, int *zero_len)
char str_buf[STR_BUF_LEN]
◆ print_char()
| static int print_char |
( |
int |
dstfd, |
|
|
t_fmt * |
fmt |
|
) |
| |
|
static |
◆ print_str()
| static int print_str |
( |
int |
dstfd, |
|
|
t_fmt * |
fmt |
|
) |
| |
|
static |
Definition at line 80 of file print_all.c.
88 pad_len = fmt->
min_len - print_len;
91 while (!(fmt->
f_minus) && pad_len-- > 0)
93 write(dstfd, fmt->
data.
str, print_len);
94 while (fmt->
f_minus && pad_len-- > 0)
100 write(dstfd,
"0", 1);
101 write(dstfd, fmt->
data.
str, print_len);