/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* get_next_line.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/10/29 08:44:57 by narnaud #+# #+# */ /* Updated: 2021/11/19 17:48:45 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef GET_NEXT_LINE_H # define GET_NEXT_LINE_H # define SPLIT_SIZE 512 # include # include typedef struct s_buffer { char *content; size_t pos; size_t read_length; } t_buffer; typedef struct s_line_split { char *content; size_t i; size_t count; struct s_line_split *next; } t_split; int parse_buffer(t_buffer *buffer, t_split **line); char *get_next_line(int fd); void *ft_calloc(size_t count, size_t size); t_split *ft_new_split(char *content); t_split *ft_lstlast(t_split *lst); void ft_lstadd_back(t_split **alst, t_split *new); void ft_putstr_fd(char *s, int fd); #endif