This is my get_next_line.
void *ft_memcpy(void *dst, const void *src, size_t len);
memcpy() function copies n bytes from memory area src to memory area dst.
Returns the amount of characters copied.
int ft_strcpy(char *dst, char *src);
ft_strcpy() copies the string src into the string dst.
Returns the amount of characters copied.
char *ft_strchr(char *s, char c);
ft_strchr() search the first occurrence of the character c in the string s.
Returns the first occurrence of the character c in the string s or 0 if there's no ocurrence.
char *ft_get_aux(int fd);
ft_get_aux() tryes to gets from a list the struct corresponding to the entered fd.
Returns the struct that corresponds to the entered fd or returns NULL on falure.
static int ft_buffprocesor(int fd, char *str);
ft_buffprocesor() attempts to read up to BUFFER_SIZE characters from a file descriptor fd into str and, if there is any '\n', saves the extra string into an aux array. If the aux array has a value while calling the function it will do the same but taking the buffer from the aux array instead the file.
Returns the amount of characters on the string not including the ones on the aux variable.
static char *ft_createstr(int len);
ft_createstr() tries to create a string of the size len.
Returns an empty string of size en or, on failure, returns 0.
char *ft_assembler(int fd);
ft_assembler() function attempts read the necesary characters from the file descriptor fd and returns them as a new string, saving the characters after the '\n' on a list with a struct for each file descriptor.
It doesent check if the BUFFER_SIZE is > to 0 and fd >= 0;
Returns the next line of the chosen file descriptor as a new string.
char *get_next_line(int fd);
get_next_line() function attempts read the necesary characters from the file descriptor fd and returns them as a new string, saving the characters after the '\n' on a list with a struct for each file descriptor.
Returns the next line of the chosen file descriptor as a new string.