-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
39 lines (36 loc) · 1.39 KB
/
main.c
File metadata and controls
39 lines (36 loc) · 1.39 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lsauvage <lsauvage@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/03 17:03:47 by lsauvage #+# #+# */
/* Updated: 2018/05/03 17:32:28 by lsauvage ### ########.fr */
/* */
/* ************************************************************************** */
#include "./get_next_line.h"
int main(int ac, char **av)
{
int fd;
int ret;
char *line;
line = NULL;
fd = open(av[ac - 1], O_RDONLY);
while ((ret = get_next_line(fd, &line)) > 0)
{
ft_putstr(line);
ft_putstr("\033[32;1m|---> \033[0m");
ft_putstr("\033[35;1m");
ft_putnbr(ret);
ft_putstr("\033[0m");
ft_putstr("\n");
}
ft_putstr("\n\n");
ft_putstr("\033[31;1mFINAL RET = [\033[0m");
ft_putstr("\033[35;1m");
ft_putnbr(ret);
ft_putstr("\033[0m");
ft_putstr("\033[31;1m]\n\n\033[0m");
return (0);
}