-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf_structures.c
80 lines (72 loc) · 1.78 KB
/
ft_printf_structures.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_structures.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmendes- <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/08/02 15:26:47 by tmendes- #+# #+# */
/* Updated: 2020/08/06 08:42:26 by tmendes- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
t_printf init_printf(void)
{
t_printf ptf;
ptf.rtrn = 0;
ptf.len = 0;
ptf.ptr = NULL;
ptf.begin = NULL;
ptf.end = NULL;
ptf.final = NULL;
ptf.txt = NULL;
ptf.pstn = NULL;
return (ptf);
}
t_printf end_printf(t_printf ptf)
{
free(ptf.ptr);
free(ptf.final);
free(ptf.txt);
free(ptf.pstn);
ptf.ptr = NULL;
ptf.begin = NULL;
ptf.end = NULL;
ptf.final = NULL;
ptf.txt = NULL;
ptf.pstn = NULL;
return (ptf);
}
t_fields init_fields(void)
{
t_fields fld;
int k;
k = -1;
while (++k < 5)
fld.flag[k] = 0;
fld.pnt_w = 0;
fld.width = 0;
fld.pnt_p = 0;
fld.prec = 6;
fld.prec_s = 0;
fld.len_h = 0;
fld.len_l = 0;
fld.ptr = NULL;
fld.str = NULL;
fld.flt = 0;
fld.llint = 0;
fld.ullint = 0;
fld.j = 0;
fld.k = 0;
fld.itg = 0;
return (fld);
}
t_scntfc init_scntfc(void)
{
t_scntfc sci;
sci.exp = NULL;
sci.ptr = NULL;
sci.chr = 0;
sci.itg = 0;
return (sci);
}