-
Notifications
You must be signed in to change notification settings - Fork 0
/
type_exep.c
44 lines (40 loc) · 1.39 KB
/
type_exep.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
40
41
42
43
44
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* type_exep.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nahmed-m <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/01/25 11:41:14 by nahmed-m #+# #+# */
/* Updated: 2016/01/25 11:42:12 by nahmed-m ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
static void ft_putstr_left(t_var *e)
{
ft_putchar('%');
e->ret++;
ft_put_space(e->f_width - 1, e);
}
static void ft_putstr_right(t_var *e)
{
if (e->f_zero == 0)
ft_put_space(e->f_width - 1, e);
else
ft_put_zero(e->f_width - 1, e);
ft_putchar('%');
e->ret++;
}
void type_exep(t_var *e)
{
if (e->f_width == 0)
{
ft_putchar('%');
e->ret++;
return ;
}
else if (e->f_width != 0 && e->f_left == 1)
ft_putstr_left(e);
else if (e->f_width != 0 && e->f_left == 0)
ft_putstr_right(e);
}