-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printf11.c
64 lines (53 loc) · 1.77 KB
/
ft_printf11.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf11.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: plisieck <plisieck@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/02/08 15:22:29 by plisieck #+# #+# */
/* Updated: 2015/02/08 16:35:55 by plisieck ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
char *treat_conv_s(va_list ap, t_specs opt, char *c, int *i)
{
char *str;
str = NULL;
str = ft_strdup(va_arg(ap, char *));
str = treat_options(str, opt, c[*i], 0);
return (str);
}
wchar_t *treat_conv_big_s(va_list ap, t_specs opt, char *c, int *i)
{
wchar_t *wstr;
wstr = NULL;
wstr = ft_wstrdup(va_arg(ap, wchar_t *));
wstr = wtrt_opt(wstr, opt, c[*i], 0);
return (wstr);
}
char *treat_conv_pourcent(t_specs opt, char *c, int *i)
{
char *str;
str = NULL;
str = ft_strdup("%");
str = treat_options(str, opt, c[*i], 0);
return (str);
}
char *treat_else(t_specs opt, char *c, int *i)
{
char *str;
str = (char *)malloc(sizeof(char) * 2);
str[0] = c[*i];
str[1] = '\0';
str = treat_options(str, opt, c[*i], 0);
return (str);
}
char *ft_option_c(va_list ap)
{
char *str;
str = (char*)malloc(sizeof(char) * 2);
str[0] = va_arg(ap, int);
str[1] = '\0';
return (str);
}