-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrimly.c
More file actions
58 lines (53 loc) · 1.42 KB
/
grimly.c
File metadata and controls
58 lines (53 loc) · 1.42 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
51
52
53
54
55
56
57
58
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* grimly.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: passef <passef@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/01/15 10:31:00 by passef #+# #+# */
/* Updated: 2018/01/20 20:15:18 by passef ### ########.fr */
/* */
/* ************************************************************************** */
#include "grimly.h"
/*
int find_path()
{
}
*/
int launcher(t_env *e)
{
if (!get_map_params(e))
return (0);
if (!get_map(e))
return (0);
printf("%s", e->map);
return (1);
}
int main(int argc, char **argv)
{
t_env e;
init_grimly(&e);
if (argc > 1)
{
argc--;
while (argc >= 1)
{
e.map_fd = open(argv[argc], O_RDONLY);
if (e.map_fd)
launcher(&e);
else
ft_puterror("erreur de lecture du fichier");
argc--;
}
}
else
{
e.map_fd = 0;
if (!launcher(&e))
return (0);
}
if (!e.status)
return (0);
return (0);
}