-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_next_line.h
43 lines (37 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: lmmielgo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/03 17:01:06 by luciama2 #+# #+# */
/* Updated: 2023/11/09 22:47:01 by lmmielgo ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_H
# define GET_NEXT_LINE_H
# include <unistd.h>
# include <stdio.h>
# include <stdlib.h>
# include <limits.h>
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 42
# endif
typedef struct stash
{
int stlen;
int nwline_i;
ssize_t readbytes;
char *stash;
} t_stash;
char *gnl_strjoin(char *s1, char *s2);
char *gnl_read_file(int fd, t_stash *s_stash);
void gnl_update_struct(int fd, t_stash *s_stash);
char *get_next_line(int fd);
int gnl_strlen(char *s);
int gnl_strchr(char *stash, char c);
char *gnl_save_first_line(t_stash *s_stash, int linelen);
char *gnl_delete_first_line(t_stash *s_stash, int linelen);
char *gnl_get_line(t_stash *s_stash);
#endif