-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
54 lines (49 loc) · 1.5 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
46
47
48
49
50
51
52
53
54
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tdarchiv <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/23 18:11:09 by tdarchiv #+# #+# */
/* Updated: 2019/03/11 13:41:59 by tdarchiv ### ########.fr */
/* */
/* ************************************************************************** */
#include "app.h"
#include "libft/libft.h"
#include "fractal_list.h"
#include <stdlib.h>
void print_usage(void)
{
int i;
t_fractal *fractal_list;
ft_puts("Usage:");
ft_puts(" ./fractol");
i = 0;
fractal_list = get_fractal_list();
while (i < FRACTAL_COUNT)
{
ft_putstr(" ./fractol ");
ft_puts(fractal_list[i].name);
i++;
}
}
int main(int argc, char **argv)
{
t_app app;
int fractal_index;
if (argc != 2)
{
print_usage();
exit(0);
}
fractal_index = get_fractal_index_by_name(argv[1]);
if (fractal_index == -1)
{
print_usage();
exit(0);
}
app_init(&app, fractal_index);
app_run(&app);
return (0);
}