-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
45 lines (39 loc) · 1.02 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 :+: :+: :+: */
/* +:+ +:+ +:+ */
/* */
/* ************************************************************************** */
#include "fillit.h"
/*
** Frees the piecelist
*/
void free_piecelist(t_piece *list)
{
t_piece *tmp;
while (list)
{
tmp = list;
list = list->next;
free(tmp);
}
}
int main(int argc, char **argv)
{
t_piece *piecelist;
if (argc != 2)
{
ft_putstr("usage: ./fillit source_file\n");
return (1);
}
piecelist = parser(argv[1]);
if (piecelist == NULL)
{
ft_putstr("error\n");
return (1);
}
solve(piecelist);
free_piecelist(piecelist);
return (0);
}