-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_next_line_bonus.h
48 lines (40 loc) · 1.47 KB
/
get_next_line_bonus.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_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rde-mour <rde-mour@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/18 19:17:23 by rde-mour #+# #+# */
/* Updated: 2024/03/16 10:30:30 by rde-mour ### ########.org.br */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_BONUS_H
# define GET_NEXT_LINE_BONUS_H
# include <stdlib.h>
# include <unistd.h>
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 2048
# endif
typedef struct s_data
{
int fd;
ssize_t status;
char *buffer;
struct s_string *buffered;
} t_data;
typedef struct s_string
{
int character;
struct s_string *next;
} t_buffered;
enum e_end
{
NEW_LINE,
END_LINE
};
char *get_next_line(int fd);
char *gnl_lstclear(t_buffered **list);
void gnl_lstadd_back(t_buffered **list, int character);
int gnl_lstfind_character(t_buffered *list, int character, int eof);
#endif