-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_next_line_bonus.h
40 lines (36 loc) · 1.42 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnidia <bnidia@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/01 12:30:04 by bnidia #+# #+# */
/* Updated: 2022/01/19 21:31:29 by bnidia ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_BONUS_H
# define GET_NEXT_LINE_BONUS_H
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 1024
# endif
# include <unistd.h>
# include <stdlib.h>
typedef struct s_file
{
int fd;
char rb_ar[BUFFER_SIZE];
char *str;
ssize_t rb_size;
size_t rb_pos;
size_t s_capacity;
size_t s_size;
struct file *next;
} t_file;
char *get_next_line(int fd);
t_file *init_file(int fd, t_file **file);
t_file *check_file(int fd, t_file **file);
void make_string(t_file *file);
void ft_realloc(t_file *file);
char *delete_file(t_file **file);
#endif