-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
48 lines (43 loc) · 1.43 KB
/
main.c
File metadata and controls
48 lines (43 loc) · 1.43 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aobshatk <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/10 11:21:28 by aobshatk #+# #+# */
/* Updated: 2025/04/09 09:20:52 by aobshatk ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
static void free_arr(t_step_coord *coord)
{
int i;
i = 0;
while (i < coord->height)
{
free(coord->colors[i]);
free(coord->z_matrix[i]);
i++;
}
free(coord->colors);
free(coord->z_matrix);
}
int main(int argc, char **argv)
{
t_coord *coords;
t_step_coord s_coords;
if (argc < 2 || argc > 2)
{
ft_printf("Wrong number of arguments\n");
return (1);
}
coords = init_list(argv[1]);
if (!coords)
return (1);
s_coords = create_coords(coords);
start_window(s_coords);
free_arr(&s_coords);
clear_list(&coords);
return (0);
}