-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_next_line_bonus.h
41 lines (35 loc) · 1.57 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dmoroz <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/07 18:12:49 by dmoroz #+# #+# */
/* Updated: 2024/03/09 17:48:50 by dmoroz ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_BONUS_H
# define GET_NEXT_LINE_BONUS_H
# include <stdlib.h>
# include <unistd.h>
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 32
# endif
typedef struct s_fd_buffer
{
int fd;
char buffer[BUFFER_SIZE];
ssize_t buffer_pos;
struct s_fd_buffer *next;
} t_fd_buffer;
char *get_next_line(int fd);
unsigned int ft_strlen(const char *s);
void *ft_memmove(void *dst, const void *src,
unsigned int len);
char *my_strnjoin(char *line, char *buffer,
unsigned int buff_n, unsigned int *line_size);
t_fd_buffer *get_fd_buffer(t_fd_buffer **fd_buffers, int fd);
void free_fd_buffer(t_fd_buffer **fd_buffers, int fd,
t_fd_buffer *prev);
#endif