Skip to content

personal implementation of the GNU C library getline() in C

Notifications You must be signed in to change notification settings

GSantoine/get_next_line

Repository files navigation

GNL - personal getline() implementation in C

2nd project in my 42 cursus

The goal of this project is to write a personal implementation of the GNU C library getline() in C.
The result is a get_next_line function in C that serves as a utility for reading line by line from a file descriptor without prior knowledge of its size. Through this project, we aim to explore the concept of static variables in C programming and gain insight into dynamic memory allocations, buffer manipulation, reallocation of memory, and the lifecycle of buffers.

Project Name get_next_line
Description My implementation of a function written in C that reads a line from a file descriptor function
Technologies C
Allowed utilities malloc(), free(), read()

Usage

  git clone https://github.com/GSantoine/get_next_line.git
  cd get_next_line

No makefile for this time :( You can simply compile .c files with the provided testing main.c file like so :

gcc -Wall -Wextra -Werror main.c get_next_line.c get_next_line_utils.c 

Basic test samples are provided in the tests/ directory. To use it :

./a.out tests/<test_file>

and voila !

Releases

No releases published

Packages

No packages published

Languages