Reading a line on a fd is way too tedious
This project is about programming a function that returns a line read from a file descriptor. May it be a file, stdin, or even later a network connection, you will always need a way to read content line by line. It is time to start working on this function, which will be essential for your future projects. This project will not only allow you to add a very convenient function to your collection, but it will also make you learn a highly interesting new concept in C programming: static variables.
The function is written in C language and thus needs the gcc
compiler and some standard C libraries to run.
1. Using it in your code
To use the function in your code, simply include its header:
#include "get_next_line.h"
and, when compiling your code, add the source files and the required flag:
get_next_line.c get_next_line_utils.c -D BUFFER_SIZE=<size>
Bonus for handling mulitple file descriptors at the same time was implemented using a linked list to replicate a map in order to save memory by not having to preallocate FD_MAX amount of integers.