A project done at Codam Amsterdam.
-
Repeated calls (e.g., using a loop) to get_next_line should let you read the text file pointed to by the file descriptor, one line at a time.
-
The function returns the line that was read. If there is nothing else to read or if an error occurred, it returns NULL.
-
The returned line includes the terminating \n character, except if the end of file was reached and does not end with a \n character.
The option "-D BUFFER_SIZE=n" is added to the compilation command to add the BUFFER_SIZE maco with a variable n size.