-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.c
More file actions
50 lines (44 loc) · 1.54 KB
/
errors.c
File metadata and controls
50 lines (44 loc) · 1.54 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* errors.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aybiouss <aybiouss@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/30 12:47:39 by aybiouss #+# #+# */
/* Updated: 2023/01/07 13:10:53 by aybiouss ### ########.fr */
/* */
/* ************************************************************************** */
#include "so_long.h"
void error_width_height(t_program *game)
{
write(2, "Error\n", 7);
write(2, "The map must be rectangular", 28);
free_map(game);
exit(EXIT_FAILURE);
}
void error_map(void)
{
write(2, "Error\n", 7);
write(2, "Correct the map", 16);
exit(EXIT_FAILURE);
}
void error_name(void)
{
write(2, "Error\n", 7);
write(2, "Wrong file name", 31);
exit(EXIT_FAILURE);
}
void error_file(void)
{
write(2, "Error\n", 7);
write(2, "No such file or directory", 26);
exit(EXIT_FAILURE);
}
void error_image(t_program *game)
{
write(2, "Error\n", 7);
write(2, "Error image", 12);
free_map(game);
exit(EXIT_FAILURE);
}