-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
39 lines (36 loc) · 1.28 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rjobert <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/12 17:58:54 by rjobert #+# #+# */
/* Updated: 2023/07/12 18:01:00 by rjobert ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int main(int argc, char *argv[])
{
t_list *a;
t_list *b;
int len;
int *clean_input;
b = NULL;
a = NULL;
clean_input = NULL;
len = parse_input(argc, argv, &clean_input);
if (len == 0)
return (0);
if (len < 0)
{
write(2, "Error\n", 6);
return (-1);
}
create_stack(len, clean_input, &a);
push_swap(&a, &b);
free_stack(&a);
free_stack(&b);
free(clean_input);
return (0);
}