-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
43 lines (38 loc) · 1.3 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lpaulo-m <lpaulo-m@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/25 10:34:20 by lpaulo-m #+# #+# */
/* Updated: 2022/08/17 11:42:32 by lpaulo-m ### ########.fr */
/* */
/* ************************************************************************** */
#include <push_swap.h>
static void initialize(int argc, char **argv)
{
initialize_control(argc, argv);
handle_arguments();
log_state();
normalize_a();
}
static void sort(void)
{
if (is_sorted())
return ;
if (get_total_size() <= 5)
return (five_sort());
insertion_sort_v2();
}
static void cleanup(void)
{
free_memory();
}
int main(int argc, char **argv)
{
initialize(argc, argv);
sort();
cleanup();
return (EXIT_SUCCESS);
}