In this repo you will find all the files regarding the implementations of the get_next_line functions, both its mandatory and bonus versions.
Calling the function
get_next_line
in a loop will then allow the user to read the text available on the file descriptor one line at a time until the end of it. It has to behave well both on external files and standard input. The function should return the line that has just been read. If there is nothing else to read or if an error has occurred it should return NULL. The mandatory part must deal with at least one file descriptor at a time, and can have more than one static variable.
The bonus part must behave like the mandatory part but adding up functionality to handle multiple file descriptors opened at once. The bonus function must also deal with only one static variable.
header file
get_next_line
- the main function and its additionalsget_next_line_utils
- additional functions fromlibft
header file
get_next_line_bonus
- the main function and its additionalsget_next_line_utils_bonus
- additional functions fromlibft
When compiling get_next_line
or its bonus version, be sure to include the following flags
$> gcc -Wall -Wextra -Werror -D BUFFER_SIZE=xxx <files>.c.
Where the xxx
can be substituted by the number of bytes read at a time into the buffer for the read
function.