Introduction to get_next_line
Get Next Line is an individual project at 1337 #42network that requires us to create a function similar to the getline from CPP and fgets from C. This function allows a file to be read line after line if called in a loop.
Prototype
char *get_next_line(int fd);
Description
The aim of this project is to make you code a function that returns a line ending with a newline, read from a file descriptor.
External functs
read, malloc, free.
See the subjects for further information
Functions table reference
The functions present in the utils are from the Libft with some code optimizations.
GNL Utils Functions |
||
|---|---|---|
| Name | Description | |
| ft_checker | checks if the static variable has content on it and calculate the length of the the line. | |
| ft_backup | delete the printed line. | |
| ft_putline | Returns a string from a buffer. | |
| get_next_line | Reads a line from a file descriptor. | |
Libft Functions |
||
| Name | Description | |
| ft_strlen | Computes the length of the string but not including the terminating null character. | |
| ft_strdup | Returns a pointer to a null-terminated byte string, which is a duplicate of the string. | |
| ft_substr | Converts the string to an integer (type int). | |
| ft_memmove | copies n bytes from memory area src to memory area dest, returns a pointer to dest. | |
| ft_strjoin | Returns a new string, which is the result of the concatenation of 's1' and 's2'. | |
On this page
Contributors
Created December 9, 2021
Updated March 22, 2022