my_rpg documentation
1.0.0
Loading...
Searching...
No Matches
myformats.h
1
/*
2
** EPITECH PROJECT, 2023
3
** my_printf
4
** File description:
5
** Header of all formats
6
*/
7
8
#include <stddef.h>
9
#include <stdarg.h>
10
11
#ifndef MYFORMATS_H_
12
#define MYFORMATS_H_
13
14
#define FORMATAGE "-+ #0"
15
#define WIDTH "0123456789"
16
#define PRECISION "."
17
#define NUMBERS "0123456789"
18
19
typedef
struct
formating
{
20
int
id_ft;
21
int
id_wd;
22
int
id_prc;
23
int
id_nb;
24
int
id_sp;
25
int
nb_format;
26
char
final_format[10];
27
char
next_chara;
28
va_list *liste;
29
int
index_user;
30
int
id_us;
31
char
flag;
32
int
fd;
33
}
formating_t
;
34
35
typedef
struct
flags
{
36
char
*str;
37
int
index_flag;
38
}
flags_t
;
39
40
typedef
struct
user
{
41
char
const
*str;
42
int
total_len;
43
int
i;
44
}
user_t
;
45
46
formating_t
*find_first(
user_t
*
user
,
int
*i,
47
formating_t
*
formating
);
48
formating_t
*find_width(
user_t
*
user
,
int
*i,
49
formating_t
*
formating
);
50
formating_t
*find_precision(
user_t
*
user
,
int
*i,
51
formating_t
*
formating
);
52
formating_t
*find_numbers(
user_t
*
user
,
int
*i,
53
formating_t
*
formating
);
54
formating_t
*find_specifier(
user_t
*
user
,
int
*i,
55
formating_t
*
formating
);
56
57
void
format_first(
struct
user
*,
struct
flags
*,
58
struct
formating
*,
int
*i);
59
void
format_width(
user_t
*
user
,
flags_t
*flgs,
60
formating_t
*
formating
,
int
*i);
61
void
format_precision(
user_t
*
user
,
flags_t
*flgs,
62
formating_t
*
formating
,
int
*i);
63
void
format_numbers(
user_t
*
user
,
flags_t
*flgs,
64
formating_t
*
formating
,
int
*i);
65
void
format_specifier(
user_t
*
user
,
flags_t
*flgs,
66
formating_t
*
formating
,
int
*i);
67
void
my_show_formating(
formating_t
*
formating
);
68
69
void
format_plus_double(
char
*str_finale,
formating_t
*
formating
,
double
nb);
70
void
format_moins_double(
char
*str_finale,
formating_t
*
formating
,
double
nb);
71
void
format_esp_double(
char
*str_finale,
formating_t
*
formating
,
double
nb);
72
void
format_hash_double(
char
*str_finale,
formating_t
*
formating
,
double
nb);
73
void
format_zero_double(
char
*str_finale,
formating_t
*
formating
,
double
nb);
74
void
format_it_double(
char
*str_finale,
75
formating_t
*
formating
,
double
partie_d);
76
void
precise_it_double(
char
*str_finale,
77
formating_t
*
formating
,
double
partie_d);
78
79
void
format_plus_int(
char
*str_finale,
80
formating_t
*
formating
,
size_t
nb);
81
void
format_moins_int(
char
*str_finale,
82
formating_t
*
formating
,
size_t
nb);
83
void
format_esp_int(
char
*str_finale,
84
formating_t
*
formating
,
size_t
nb);
85
void
format_hash_int(
char
*str_finale,
86
formating_t
*
formating
,
size_t
nb);
87
void
format_zero_int(
char
*str_finale,
88
formating_t
*
formating
,
size_t
nb);
89
void
format_it_int(
char
*str_finale,
90
formating_t
*
formating
,
size_t
nb);
91
void
precise_it_int(
char
*str_finale,
92
formating_t
*
formating
,
size_t
nb);
93
94
void
format_plus_char(
char
*str_finale,
formating_t
*
formating
,
char
c);
95
void
format_moins_char(
char
*str_finale,
formating_t
*
formating
,
char
c);
96
void
format_esp_char(
char
*str_finale,
formating_t
*
formating
,
char
c);
97
void
format_hash_char(
char
*str_finale,
formating_t
*
formating
,
char
c);
98
void
format_zero_char(
char
*str_finale,
formating_t
*
formating
,
char
c);
99
void
format_it_char(
char
*str_finale,
100
formating_t
*
formating
,
char
c);
101
102
void
format_plus_str(
char
*str_finale,
formating_t
*
formating
);
103
void
format_moins_str(
char
*str_finale,
formating_t
*
formating
);
104
void
format_esp_str(
char
*str_finale,
formating_t
*
formating
);
105
void
format_hash_str(
char
*str_finale,
formating_t
*
formating
);
106
void
format_zero_str(
char
*str_finale,
formating_t
*
formating
);
107
void
format_it_str(
char
*str_finale,
108
formating_t
*
formating
);
109
110
char
*specify_it_int(
formating_t
*
formating
,
size_t
temp);
111
char
*specify_it_base(
formating_t
*
formating
,
size_t
temp,
char
*);
112
113
#endif
/* MYFORMATS_H_ */
flags
Definition
myformats.h:35
formating
Definition
myformats.h:19
user
Definition
myformats.h:40
include
myformats.h
Generated by
1.11.0