|
libft
|
Implementation of the get_next_line function. More...
#include "libft.h"
Include dependency graph for get_next_line.c:Functions | |
| static char * | extract_line (char *remainder) |
| Extracts the next line from the remainder buffer. | |
| char * | get_next_line (int fd) |
| Reads a line from a file descriptor. | |
| static ssize_t | read_and_store (int fd, char **remainder) |
| Reads from a file descriptor and appends to the remainder buffer. | |
| static char * | update_remainder (char *remainder) |
| Updates the remainder buffer after a line has been extracted. | |
Implementation of the get_next_line function.
This file implements get_next_line, a utility that reads from a file descriptor and returns the next line of input (including \n if present). It uses a static buffer indexed by file descriptor to support reading from multiple files simultaneously.
BUFFER_SIZE and MAX_FD are defined in ft_file.h.