-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
executable file
·45 lines (41 loc) · 1.51 KB
/
main.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ybitton <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/07 16:26:48 by ybitton #+# #+# */
/* Updated: 2017/01/16 16:41:07 by ybitton ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include "fillit.h"
/*
** On commence le traitemant du fichier et on le resoue on appelle
** les fonctions qui vont le traiter
** elle va traiter le fichier et afficher le resulatat sur la sortie
** standar
*/
int main(int argc, char **argv)
{
t_list *list_end;
t_map *maping;
if (argc != 2)
{
ft_putstr("usage: fillit input_file\n");
exit(1);
}
if ((list_end = read_files(open(argv[1], O_RDONLY), 0, 0)) == NULL)
{
ft_putstr("error\n");
exit(1);
}
maping = resolution(list_end);
print_map_list(maping);
free_map_list(maping);
free_tetris_list(list_end);
return (0);
}