Corewar documentation
1.0.0
Loading...
Searching...
No Matches
myprintf.h
Go to the documentation of this file.
1
/*
2
** EPITECH PROJECT, 2023
3
** my_printf
4
** File description:
5
** The header of all formats and flags
6
*/
13
#include "
../my.h
"
14
15
#ifndef MYPRINTF_H_
16
#define MYPRINTF_H_
17
18
#define FORMATAGE "-+ #0"
19
#define WIDTH "0123456789"
20
#define PRECISION "."
21
#define NUMBERS "0123456789"
22
23
typedef
struct
formating_s
{
24
int
fd;
25
int
id_ft;
26
int
id_wd;
27
int
id_prc;
28
int
id_nb;
29
int
id_sp;
30
int
nb_format;
31
char
final_format[10];
32
char
next_chara;
33
va_list *liste;
34
int
index_user;
35
int
id_us;
36
char
flag;
37
}
formating_t
;
38
39
typedef
struct
flags_s
{
40
char
*str;
41
int
index_flag;
42
}
flags_t
;
43
44
typedef
struct
user_s
{
45
char
const
*str;
46
int
total_len;
47
int
i;
48
}
user_t
;
49
50
/* Round functions */
51
void
round_a(
char
*float_nb,
int
precision,
char
last_char,
int
i);
52
void
round_biga(
char
*float_nb,
int
precision,
char
last_char,
int
i);
53
54
/* Find functions */
55
formating_t
*find_first(
user_t
*user,
int
*i,
56
formating_t
*formating);
57
formating_t
*find_width(
user_t
*user,
int
*i,
58
formating_t
*formating);
59
formating_t
*find_precision(
user_t
*user,
int
*i,
60
formating_t
*formating);
61
formating_t
*find_numbers(
user_t
*user,
int
*i,
62
formating_t
*formating);
63
formating_t
*find_specifier(
user_t
*user,
int
*i,
64
formating_t
*formating);
65
66
/* Format functions */
67
void
format_first(
user_t
*user,
flags_t
*flags,
68
formating_t
*formating,
int
*copy);
69
void
format_width(
user_t
*user,
flags_t
*flags,
70
formating_t
*formating,
int
*copy);
71
void
format_precision(
user_t
*user,
flags_t
*flags,
72
formating_t
*formating,
int
*copy);
73
void
format_numbers(
user_t
*user,
flags_t
*flags,
74
formating_t
*formating,
int
*copy);
75
void
format_specifier(
user_t
*user,
flags_t
*flags,
76
formating_t
*formating,
int
*copy);
77
void
my_show_formating(
formating_t
*formating);
78
79
void
format_plus_double(
char
*str_finale,
formating_t
*formating,
double
nb);
80
void
format_moins_double(
char
*str_finale,
formating_t
*formating,
double
nb);
81
void
format_esp_double(
char
*str_finale,
formating_t
*formating,
double
nb);
82
void
format_hash_double(
char
*str_finale,
formating_t
*formating,
double
nb);
83
void
format_zero_double(
char
*str_finale,
formating_t
*formating,
double
nb);
84
void
format_it_double(
char
*str_finale,
85
formating_t
*formating,
double
partie_d);
86
void
precise_it_double(
char
*str_finale,
87
formating_t
*formating,
double
partie_d);
88
89
void
format_plus_int(
char
*str_finale,
90
formating_t
*formating,
size_t
nb);
91
void
format_moins_int(
char
*str_finale,
92
formating_t
*formating,
size_t
nb);
93
void
format_esp_int(
char
*str_finale,
94
formating_t
*formating,
size_t
nb);
95
void
format_hash_int(
char
*str_finale,
96
formating_t
*formating,
size_t
nb);
97
void
format_zero_int(
char
*str_finale,
98
formating_t
*formating,
size_t
nb);
99
void
format_it_int(
char
*str_finale,
100
formating_t
*formating,
size_t
nb);
101
void
precise_it_int(
char
*str_finale,
102
formating_t
*formating,
size_t
nb);
103
104
void
format_plus_char(
char
*str_finale,
formating_t
*formating,
char
c);
105
void
format_moins_char(
char
*str_finale,
formating_t
*formating,
char
c);
106
void
format_esp_char(
char
*str_finale,
formating_t
*formating,
char
c);
107
void
format_hash_char(
char
*str_finale,
formating_t
*formating,
char
c);
108
void
format_zero_char(
char
*str_finale,
formating_t
*formating,
char
c);
109
void
format_it_char(
char
*str_finale,
110
formating_t
*formating,
char
c);
111
112
void
format_plus_str(
char
*str_finale,
formating_t
*formating);
113
void
format_moins_str(
char
*str_finale,
formating_t
*formating);
114
void
format_esp_str(
char
*str_finale,
formating_t
*formating);
115
void
format_hash_str(
char
*str_finale,
formating_t
*formating);
116
void
format_zero_str(
char
*str_finale,
formating_t
*formating);
117
void
format_it_str(
char
*str_finale,
118
formating_t
*formating);
119
120
/* Specify functions */
121
char
*specify_it_int(
formating_t
*formating,
size_t
temp);
122
char
*specify_it_base(
formating_t
*formating,
size_t
temp,
char
*);
123
124
/* Flag functions */
125
int
flag_c(va_list list,
formating_t
*);
126
int
flag_s(va_list list,
formating_t
*);
127
int
flag_d(va_list list,
formating_t
*);
128
int
flag_i(va_list list,
formating_t
*);
129
int
flag_p(va_list list,
formating_t
*);
130
int
flag_o(va_list list,
formating_t
*);
131
int
flag_u(va_list list,
formating_t
*);
132
int
flag_x(va_list list,
formating_t
*);
133
int
flag_bigx(va_list list,
formating_t
*);
134
int
flag_e(va_list list,
formating_t
*);
135
int
flag_bige(va_list list,
formating_t
*);
136
int
flag_f(va_list list,
formating_t
*);
137
int
flag_bigf(va_list list,
formating_t
*);
138
int
flag_g(va_list list,
formating_t
*);
139
int
flag_bigg(va_list list,
formating_t
*);
140
int
flag_a(va_list list,
formating_t
*);
141
int
flag_biga(va_list list,
formating_t
*);
142
int
flag_n(va_list list,
formating_t
*,
int
len);
143
int
flag_m(va_list list,
formating_t
*);
144
int
flag_b(va_list list,
formating_t
*);
145
int
flag_bigs(va_list list,
formating_t
*);
146
int
flag_bigd(va_list list,
formating_t
*);
147
int
flag_percent(va_list list,
formating_t
*);
148
149
extern
int (*FLAGS[])(va_list,
formating_t
*);
150
151
#endif
/* MYPRINTF_H_ */
my.h
The header file of the libmy.
flags_s
Definition
myprintf.h:39
formating_s
Definition
myprintf.h:23
user_s
Definition
myprintf.h:44
lib
my
my_printf
myprintf.h
Generated by
1.11.0