15static void gnl_zerobuffer(
char *buff)
27static int gnl_read(
int fd,
char **fd_data)
40 gnl_zerobuffer(buffer);
53static char *gnl_get_line(
char **fd_data)
60 i = (size_t)(tmp - *fd_data) + 1;
70static char *gnl_line(
int read_return,
char **fd_data)
76 if (!fd_data || !*fd_data)
91 line = gnl_get_line(fd_data);
97 static char *fd_list[1024] = {0};
101 if (fd < 0 || read(fd, 0, 0) < 0 || BUFFER_SIZE <= 0 || fd > 1024)
105 fd_list[fd] = (
char *)malloc(
sizeof(
char) * (
BUFFER_SIZE + 1));
108 fd_list[fd][0] =
'\0';
112 read_return = gnl_read(fd, &fd_list[fd]);
118 line = gnl_line(read_return, &fd_list[fd]);
char * get_next_line(int fd)
Gets next line from a file.
char * ft_substr(char const *s, unsigned int start, size_t len)
Gets a piece of string out of a string.
char * ft_strjoin(char const *s1, char const *s2)
Joins two strings together.
char * ft_strchr(const char *s, int c)
Search a character.
size_t ft_strlen(const char *s)
Length of the string.