GSantoine / get_next_line

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 !

About

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


Languages

Language:C 100.0%