Function that returns a line read from a file descriptor.
- “Line” is a succession of characters that end with ’\n’ (ascii code 0x0a) or with End Of File (EOF).
- The first parameter is the file descriptor that will be used to read.
- The second parameter is the address of a pointer to a character that is used to save the line read from the file descriptor.
- The return value can be 1, 0 or -1 depending on whether a line has been read, when the reading has been completed, or if an error has happened respectively.
- Function get_next_line returns its result without ’\n’.
Download and use get_next_line.c and get_next_line.h in your program.