This project is about programming a function that allows you to read content line by line. This is done by returning a line read from a file descriptor.
The primary function in this project is get_next_line
, which reads from a file descriptor (fd
) and returns one line or NULL
.
Return Value:
char *
: The string containing a line read by the function.(null)
: Either an error occurred or reached EOF (End Of File).
This project includes several helper functions that the get_next_line
function utilizes:
strjoin
: Function to concatenate strings.strlen
: Function to find the length of a string.strchr
: Function to find the first occurrence of a character in a string.strdup
: Function to duplicate a string.substr
: Function to extract a substring from a string.
![Screenshot 2566-10-15 at 01 24 41](https://private-user-images.githubusercontent.com/48820052/275272686-abfecdae-c3b8-497c-b32f-ee0b7b3c5fa9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2NzkxODIsIm5iZiI6MTcyNDY3ODg4MiwicGF0aCI6Ii80ODgyMDA1Mi8yNzUyNzI2ODYtYWJmZWNkYWUtYzNiOC00OTdjLWIzMmYtZWUwYjdiM2M1ZmE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI2VDEzMjgwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM3MWU2YjUwMzY3OWMwMGQyMjk1NWMyNWJhNjI5ODY3NmNjNzI1YzNkZDQ3NWNmNGQ4ZWZlZDViNGNkMzQxNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hsE74-rtRzQWFOug6Q7xBtVld8fntmYziMEJyy1JgWY)