Skip to content

get_next_line function will read content line by line, whether it's a file, stdin or a network connection.

Notifications You must be signed in to change notification settings

denisgodoy/42-gnl

Repository files navigation

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.

About

get_next_line function will read content line by line, whether it's a file, stdin or a network connection.

Resources

Stars

Watchers

Forks

Languages