-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_and_exit.c
40 lines (36 loc) · 1.5 KB
/
error_and_exit.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error_and_exit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yagnaou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/09 15:49:11 by yagnaou #+# #+# */
/* Updated: 2022/03/09 17:19:10 by yagnaou ### ########.fr */
/* */
/* ************************************************************************** */
#include "fractol.h"
int available_fractals(char **av)
{
if (!ft_strcmp(av[1], "julia") || !ft_strcmp(av[1], "first_julia")
|| !ft_strcmp(av[1], "second_julia")
|| !ft_strcmp(av[1], "mandelbrot")
|| !ft_strcmp(av[1], "burning_ship"))
return (0);
return (1);
}
void error_phrase(void)
{
write(1, "Usage: ./fractol <NAME>\n", 24);
write(1, "Available Fractals:\n", 21);
write(1, "---> mandelbrot\n", 17);
write(1, "---> julia:\n", 13);
write(1, "\t * julia\n\t * first_julia\n\t * second_julia\n", 44);
write(1, "---> burning_ship\n", 19);
exit(EXIT_FAILURE);
}
int exit_when_close(void)
{
exit(EXIT_FAILURE);
return (0);
}