-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_next_line.h
42 lines (34 loc) · 1.42 KB
/
get_next_line.h
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pguthaus <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/17 19:49:54 by pguthaus #+# #+# */
/* Updated: 2019/11/21 16:39:49 by pguthaus ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_H
# define GET_NEXT_LINE_H
# include <stdlib.h>
# include <limits.h>
# include <unistd.h>
# include <fcntl.h>
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 64
# endif
typedef struct s_buff
{
char buff[BUFFER_SIZE];
size_t len;
char eol;
char eof;
struct s_buff *next;
} t_buff;
int get_next_line(int fd, char **line);
int flush_to_eol(t_buff **buff, char **line);
t_buff *clear_buff_next(t_buff *buff);
void trim_buff(t_buff *buff, unsigned int nl);
int flush_el(t_buff **buff, char **line);
#endif