From 71a9a742f79df25275dc68359dac2f99a24d9af8 Mon Sep 17 00:00:00 2001 From: Amauri Lisboa <99747003+amauricoder@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:52:49 +0000 Subject: [PATCH] formatted readme --- README.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6b381d2..3c7d6ec 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,24 @@ ![Banner](gnl_banner.png "banner get next line") +"This project is about reading lines from file descriptors. It will be very, very useful in the future (believe me)." +## Table of Contents + +- [Introduction](#introduction) +- [Usage](#usage) +- [Files within the project](#files-within-the-project) +- [How does the algorithm work?](#how-does-the-algorithm-work) +- [Bonus](#bonus) +- [License and friendly advice](#license-and-friendly-advice) + ## Introduction This is a project that is part of the 42 common core curriculum. The purpose is to develop a program that reads a line from a file descriptor and returns it. In the bonus part, we essentially need to be able to do this with more than one file descriptor without losing the value of the last one. For more details, read the [subject](subject/subject.pdf). +>The code was written according to the 42 norm guidelines (norminette). ## Usage - To use the get_next_line in your project, follow these steps: 1. Clone the repository ```bash @@ -17,7 +27,7 @@ git clone git@github.com:amauricoder/42_get_next_line.git ``` 2. Compile the files ```bash -42_get_next_line % cc -Wall -Wextra -Werror sources/*.c -o get_next_line +cc -Wall -Wextra -Werror sources/*.c -o get_next_line ``` This will generate the get_next_line file in the root folder. @@ -29,10 +39,10 @@ This will generate the get_next_line file in the root folder. For Bonus: 1. Compile the files ```bash -42_get_next_line % cc -Wall -Wextra -Werror bonus/*.c -o get_next_line_bonus +cc -Wall -Wextra -Werror bonus/*.c -o get_next_line_bonus ``` This will generate the get_next_line_bonus file in the root folder. -2. 3. If you want to use as an external function, go to your header file and include the get_next_line.h to your header +2. If you want to use as an external function, go to your header file and include the get_next_line.h to your header ```C # include "get_next_line_bonus.h" ``` @@ -49,5 +59,14 @@ For the bonus part is basically the same, only changing the name of the files wi Below, I have a simple diagram that illustrates the workflow and explains the functioning of the algorithm. ![Workflow](workflow.jpg) -## Bonus part +## Bonus For the bonus part, the solution remains essentially the same. However, a crucial enhancement involves defining the static variable as an array. This ensures that the last value from a specific file descriptor (fd) is preserved when calling the function for another. This modification to the static variable within the code guarantees consistent behavior. + +## License and friendly advice +[View License](LICENSE) + +Get_Next_Line can read lines, but it can't write them. However, YOU CAN! +I recommend that you don't copy and paste code that you don't comprehend 100% and can't recreate from scratch. +Doing this goes against the purpose of the school and gives you a false sense of confidence that you know something that you actually don't. +If you've reached this project, you can do A LOT MORE! +Good luck!