ThomasRobertson/42-get_next_line
Reading a line from a fd is way too tedious.
get_next_line
Reading a line from a fd is way too tedious.
Summary • How It Work • How To Use • License
Summary
This function read from a file descriptor and return a line when reaching an EOF or '\n'.
This project is part of 42 Paris' curriculum. You can check the full subject in the subject pdf included in this repo.
How It Work
The function read a specified number of bytes from the file descriptor, using the GNL_BUFFER variable. If a EOF or a '\n' (new line) has been found, the function store the rest of the buffer and return a line.
The bonus can manage multiple file descriptor open at the same time, but if the function is stopped while the end has not been reached, leaks can occur. This is why the mandatory version is instead use in my Libft.
How To Use
Clone this GitHub repos
git clone https://github.com/ThomasRobertson/42-get_next_lineThe function does not include any main function, and need to be either compile with a file containing the main function, or use within a library.
License
MIT