Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_printf | ||
4 | ** File description: | ||
5 | ** The functions for apply format to a char | ||
6 | */ | ||
7 | /** | ||
8 | * @file format_it_char.c | ||
9 | * @brief The file containing the format_it_char function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "myprintf.h" | ||
14 | |||
15 | 10923 | void format_it_char(char *str_finale, | |
16 | formating_t *formating, char c) | ||
17 | { | ||
18 | 10923 | void (*format[])(char *, formating_t *, char c) = | |
19 | {&format_moins_char, &format_plus_char, | ||
20 | &format_esp_char, &format_hash_char, &format_zero_char}; | ||
21 | |||
22 |
4/4✓ Branch 0 taken 10916 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 10915 times.
|
10923 | if (formating->id_ft == -1 && formating->id_wd != -1) { |
23 | 1 | format[2](str_finale, formating, c); | |
24 | } | ||
25 |
2/2✓ Branch 0 taken 54615 times.
✓ Branch 1 taken 10923 times.
|
65538 | for (int i = 0; i < 5; i++) { |
26 |
2/2✓ Branch 0 taken 7 times.
✓ Branch 1 taken 54608 times.
|
54615 | if (formating->id_ft == i) { |
27 | 7 | format[i](str_finale, formating, c); | |
28 | } | ||
29 | } | ||
30 | 10923 | return; | |
31 | } | ||
32 |