-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_type.c
33 lines (31 loc) · 1.33 KB
/
ft_type.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_type.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ccastill <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/08 18:11:44 by ccastill #+# #+# */
/* Updated: 2020/07/18 18:45:58 by ccastill ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_type(const char *s, t_list_printf *next)
{
if (s[next->len] == 'd' || s[next->len] == 'i')
return ('d');
else if (s[next->len] == 'c')
return ('c');
else if (s[next->len] == '%')
return ('%');
else if (s[next->len] == 's')
return ('s');
else if (s[next->len] == 'x' || s[next->len] == 'X')
return ('x');
else if (s[next->len] == 'p')
return ('p');
else if (s[next->len] == 'u')
return ('u');
else
return (0);
}