-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_process_s.c
executable file
·39 lines (37 loc) · 1.37 KB
/
ft_process_s.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_process_s.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bscamand <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/11 14:55:43 by bscamand #+# #+# */
/* Updated: 2021/01/11 15:00:56 by bscamand ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
void ft_process_s(int len_s, t_parser *ptr)
{
if (MINUS)
{
if (DOT)
{
ft_putstr_fd_len(S, 1, ACCURACY, ptr);
ft_putchar_fd_tap(TAP, 1, ptr, WIDTH - ACCURACY);
return ;
}
ft_putstr_fd(S, 1, ptr);
ft_putchar_fd_tap(TAP, 1, ptr, WIDTH - len_s);
}
else
{
if (DOT)
{
ft_putchar_fd_tap(' ', 1, ptr, WIDTH - ACCURACY);
ft_putstr_fd_len(S, 1, ACCURACY, ptr);
return ;
}
ft_putchar_fd_tap(' ', 1, ptr, WIDTH - len_s);
ft_putstr_fd(S, 1, ptr);
}
}