-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_next_line_bonus.h
49 lines (42 loc) · 1.74 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
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amouflet <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/28 22:19:30 by amouflet #+# #+# */
/* Updated: 2022/12/03 15:56:37 by amouflet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_BONUS_H
# define GET_NEXT_LINE_BONUS_H
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 60
# endif /*BUFFER_SIZE*/
# if (BUFFER_SIZE < 0)
# undef BUFFER_SIZE
# define BUFFER_SIZE 0
# endif /*BUFFER_SIZE*/
# include <stdlib.h>
# include <stdio.h>
# include <unistd.h>
# include <stddef.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <limits.h>
typedef struct s_stash
{
char *str;
struct s_stash *next;
}t_buf;
char *get_next_line(int fd);
char *get_line(int fd, char *stash, char **line, t_buf *lst);
int check_stash(char **stash, char **line, char *new_stash, int i);
int join_t_buf(t_buf **begin, char **stash, char **line);
int new_elem_back(t_buf **begin, char *buf);
int is_in_str(char *str, char c);
int free_lst(t_buf **lst);
size_t ft_strlcpy(char *dst, const char *src, size_t size);
#endif /*GET_NEXT_LINE_BONUS_H*/