Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.28 KB

README.md

File metadata and controls

27 lines (20 loc) · 1.28 KB

Unix Rigor Algorithms&AI

get_next_line 💻

May it be a file, stdin or a network connection, get_next_line function will read content line by line.

Evaluation

evaluation badge

Mandatory part

Calling get_next_line in a loop will allow you to read the text available on the file descriptor one line at a time.

Function Description External functions
get_next_line Returns a line read from a file descriptor. read, malloc, free

To compile the program, modify the BUFFER_SIZE value xx.

gcc -Wall -Wextra -Werror -D BUFFER_SIZE=xx get_next_line.c get_next_line_utils.c

Bonus part

Use only one static variable and handle multiple file descriptors without losing the reading thread.