-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
66 lines (61 loc) · 1.8 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
55
56
57
58
59
60
61
62
63
64
65
66
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zszeredi <zszeredi@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/22 16:06:07 by zszeredi #+# #+# */
<<<<<<< HEAD
/* Updated: 2020/02/25 14:32:48 by zszeredi ### ########.fr */
=======
/* Updated: 2020/02/22 18:45:19 by aben-azz ### ########.fr */
>>>>>>> 013b98f415153171ca627e0bde26d963b20acdb3
/* */
/* ************************************************************************** */
#include "fillit.h"
int ft_error(int n)
{
if (n == 1)
write(1, "usage", 5);
else
ft_putstr("error\n");
return (1);
}
int main(int argc, char **argv)
{
int fd;
<<<<<<< HEAD
t_tetra *s;
t_table *s2;
s = NULL;
=======
t_tetra *tetros;
int *connect;
t_table *s;
s = NULL;
connect = ft_memalloc(26 * sizeof(int));
>>>>>>> 013b98f415153171ca627e0bde26d963b20acdb3
if (*argv && argc == 2)
{
fd = open(argv[1], O_RDONLY);
if (fd <= 0)
return (ft_error(1));
<<<<<<< HEAD
if ((s = read_file(fd)) == NULL)
return (ft_error(2));
else
{
s2 = ft_allocate(s, 0);
=======
if ((tetros = read_file(fd, connect)) == NULL)
return (ft_error(2));
else
{
ft_allocate(tetros, 0);
>>>>>>> 013b98f415153171ca627e0bde26d963b20acdb3
return (0);
}
}
return (0);
}