-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_next_line.h
48 lines (42 loc) · 1.52 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
43
44
45
46
47
48
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cdittric <cdittric@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/23 23:16:19 by cdittric #+# #+# */
/* Updated: 2017/11/30 15:20:31 by cdittric ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_H
# define GET_NEXT_LINE_H
# include <unistd.h>
# include <stdlib.h>
# define BUFF_SIZE 32
/*
** t_f: Chained file info list element
** d File descriptor
** s Line buffer size
** b Line buffer
** t Pointer to temporary buffer used when reallocating line buffer
** r Read buffer
** i Index of next character to read in read buffer
** j Number of characters in read buffer
** k Line buffer iterator
** n Next element in chained list
*/
typedef struct s_f
{
int d;
int s;
char *b;
char *t;
char r[BUFF_SIZE];
int i;
int j;
int k;
struct s_f *n;
} t_f;
int get_next_line(const int fd, char **line);
#endif