-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibftprintf_bonus.h
98 lines (83 loc) · 2.86 KB
/
libftprintf_bonus.h
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libftprintf_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmendes- <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/06/26 13:31:08 by tmendes- #+# #+# */
/* Updated: 2020/08/07 08:16:52 by tmendes- ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef LIBFTPRINTF_BONUS_H
# define LIBFTPRINTF_BONUS_H
# include <stdlib.h>
# include <unistd.h>
# include <stdarg.h>
# include <wchar.h>
# include "libft/libft.h"
typedef struct s_fields
{
int flag[5];
int pnt_w;
int width;
int pnt_p;
int prec;
int prec_s;
int len_h;
int len_l;
int rtrn;
void *ptr;
char *str;
long double flt;
t_llint llint;
t_ullint ullint;
int itg;
int j;
int k;
} t_fields;
typedef struct s_printf
{
char *ptr;
char *begin;
char *end;
char *final;
char *txt;
long int *pstn;
int rtrn;
int len;
} t_printf;
typedef struct s_scntfc
{
char *exp;
char *ptr;
char chr;
int itg;
} t_scntfc;
int ft_printf(const char *format, ...);
char *signal_space(char *str, t_fields fld);
t_printf format_txt(t_printf ptf, va_list ap);
char *pad_str(char *str, t_fields fld, int len, char chr);
t_fields set_fields(char *begin, char *end, t_fields fields);
t_printf c____type(t_printf ptf, t_fields fld, va_list ap);
t_printf s____type(t_printf ptf, t_fields fld, va_list ap);
t_printf p____type(t_printf ptf, t_fields fld, va_list ap);
t_printf p100_type(t_printf ptf, t_fields fld);
t_printf format_nbr(t_printf ptf, t_fields fld);
t_fields fld_process(t_printf ptf, t_fields fld);
t_printf d____type(t_printf ptf, t_fields fld, va_list ap);
t_printf u____type(t_printf ptf, t_fields fld, va_list ap);
t_printf x____type(t_printf ptf, t_fields fld, va_list ap);
t_printf g____type(t_printf ptf, t_fields fld, va_list ap);
t_printf e____type(t_printf ptf, t_fields fld, va_list ap);
char *unpad(char *nbr, char chr);
t_printf n____type(t_printf ptf, t_fields fld, va_list ap);
t_printf f____type(t_printf ptf, t_fields fld, va_list ap);
t_printf o____type(t_printf ptf, t_fields fld, va_list ap);
int nbr_exp(long double nbr, int prec);
char *scntfc_not(char *nbr, int prec);
t_printf init_printf(void);
t_printf end_printf(t_printf ptf);
t_fields init_fields(void);
t_scntfc init_scntfc(void);
#endif