Skip to content

Haimasker/get_next_line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

get_next_line

This project was made in accordance with the project of School 21 (Ecole 42).

GitHub code size in bytes Number of lines of code Code language count GitHub top language


Preamble

The purpose of this project is to code a function that returns a line read from a file descriptor.

You can see the subject here: get_next_line.

Main requirements, rules and code style: Norm.


Description

Mandatory part

  • Each call to get_next_line() should return next line from the text file pointed to
    by the file descriptor.

  • Function should return NULL in case of an error or if there is nothing else to read.

  • Reading from the text file should work due to reading characters piece by piece into
    buffer with BUFFER_SIZE size.

Bonus part

  • In addition to the previous requirements get_next_line() must manage multiple file
    descriptors at the same time. At most one static variable is allowed.

Installation and usage

  • Copy this project in your project directory.

  • To use get_next_line() in your code just include library header:

#include "get_next_line.h"

or

#include "get_next_line_bonus.h"
  • After that just use get_next_line() function where it is necessary.

Testing

  • You can check code norm due to norminette.

  • This is the tester for the get_next_line project: