-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_next_line.h
43 lines (36 loc) · 1.54 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgaume <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/29 03:47:35 by lgaume #+# #+# */
/* Updated: 2023/11/01 11:16:30 by lgaume ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_H
# define GET_NEXT_LINE_H
# include <stdlib.h>
# include <sys/types.h>
# include <sys/uio.h>
# include <unistd.h>
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 5
# endif
typedef struct s_list
{
char *content;
struct s_list *next;
} t_list;
char *get_next_line(int fd);
int found_newline(t_list *stash);
t_list *ft_lst_get_last(t_list *stash);
void read_and_stash(int fd, t_list **stash);
void add_to_stash(t_list **stash, char *buf, int readed);
void extract_line(t_list *stash, char **line);
void generate_line(char **line, t_list *stash);
void clean_stash(t_list **stash);
int ft_strlen(const char *str);
void free_stash(t_list *stash);
#endif