Project de l'école 42 : Get_next_line
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.5 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <stdlib.h>
# include <unistd.h>
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