{"id":19053306,"url":"https://github.com/jotavare/get_next_line","last_synced_at":"2025-04-24T02:47:58.382Z","repository":{"id":155284575,"uuid":"583763156","full_name":"jotavare/get_next_line","owner":"jotavare","description":"Create a function that enables reading content line by line from a file descriptor.","archived":false,"fork":false,"pushed_at":"2024-06-26T23:01:51.000Z","size":1360,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-27T02:42:14.120Z","etag":null,"topics":["buffer","c","gdb","get-next-line","gnl","makefile","norminette","static-variables","text","valgrind"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jotavare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-30T20:51:46.000Z","updated_at":"2024-06-26T23:05:12.000Z","dependencies_parsed_at":"2024-06-27T02:32:26.980Z","dependency_job_id":"494c54f6-617f-443d-a02a-377ff27ffb2b","html_url":"https://github.com/jotavare/get_next_line","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fget_next_line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fget_next_line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fget_next_line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotavare%2Fget_next_line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jotavare","download_url":"https://codeload.github.com/jotavare/get_next_line/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223768238,"owners_count":17199326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buffer","c","gdb","get-next-line","gnl","makefile","norminette","static-variables","text","valgrind"],"created_at":"2024-11-08T23:30:02.757Z","updated_at":"2024-11-08T23:30:03.175Z","avatar_url":"https://github.com/jotavare.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/jotavare/jotavare/blob/main/42/banners/piscine_and_common_core/github_piscine_and_common_core_banner_get_next_line.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/status-finished-success?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/evaluated-18%20%2F%2012%20%2F%202022-success?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/badge/score-125%20%2F%20100-success?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/github/languages/top/jotavare/get_next_line?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003cimg src=\"https://img.shields.io/github/last-commit/jotavare/get_next_line?color=%2312bab9\u0026style=flat-square\"/\u003e\n\t\u003ca href='https://www.linkedin.com/in/joaoptoliveira' target=\"_blank\"\u003e\u003cimg alt='Linkedin' src='https://img.shields.io/badge/LinkedIn-100000?style=flat-square\u0026logo=Linkedin\u0026logoColor=white\u0026labelColor=0A66C2\u0026color=0A66C2'/\u003e\u003c/a\u003e\n\t\u003ca href='https://profile.intra.42.fr/users/jotavare' target=\"_blank\"\u003e\u003cimg alt='42' src='https://img.shields.io/badge/Porto-100000?style=flat-square\u0026logo=42\u0026logoColor=white\u0026labelColor=000000\u0026color=000000'/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"#about\"\u003eAbout\u003c/a\u003e •\n\t\u003ca href=\"#how-to-use\"\u003eHow to use\u003c/a\u003e •\n\t\u003ca href=\"#mandatory\"\u003eMandatory\u003c/a\u003e •\n\t\u003ca href=\"#bonus\"\u003eBonus\u003c/a\u003e •\n\t\u003ca href=\"#norminette\"\u003eNorminette\u003c/a\u003e •\n\t\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n\t\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n## ABOUT\nThis project taught me how to read from a file descriptor and use static variables. This function retrieves a single line from a specified file descriptor. When called in a loop, get_next_line returns all the contents of the file, one line at a time until the end of the file is reached. Additionally, this function can be compiled with any buffer size specified.\n\n- [Subject](https://github.com/jotavare/get_next_line/blob/master/subject/en_subject_get_next_line.pdf) `PDF`\n- [References](https://github.com/jotavare/42-resources#01-get_next_line) `GitHub`\n\n## HOW TO USE\n#### 1º - Clone the repository\n```git\ngit clone git@github.com:jotavare/get_next_line.git\n```\n\n#### 2º - Enter the project folder\n```bash\ncd get_next_line/get_next_line\n```\n\n#### 3º - Compile the mandatory or bonus files\n\u003e The program should always be compiled with the flags below.\n```bash\n[Flags] -Wall -Wextra -Werror\n[Mandatory] cc [Flags] main.c get_next_line.c get_next_line_utils.c\n[Bonus] cc [Flags] main.c get_next_line_bonus.c get_next_line_utils_bonus.c\n```\n\n#### 4º - BUFFER_SIZE can be specified at compilation to override the default BUFFER_SIZE\n\u003e get_next_line should be able to compile with and without the -D BUFFER_SIZE=[SIZE] flag.\n```bash\n[Flags] -Wall -Wextra -Werror -D BUFFER_SIZE=[SIZE] \n[Mandatory] cc [Flags] main.c get_next_line.c get_next_line_utils.c\n[Bonus] cc [Flags] main.c get_next_line_bonus.c get_next_line_utils_bonus.c\n```\n\n#### 5º - Execution with one or multiple file descriptors/standard input\n```bash\n./a.out [text.txt]\n./a.out [text1.txt] [text2.txt]\n```\n\n## MANDATORY\n- [x] Read from one file descriptor, one line at a time.\n- [x] Needs to return the line that was read. If empty or error, return `NULL`.\n- [x] Should work as expected reading from a file or standard input.\n- [x] Returned line should include the terminating `\\n` character, except if it's the end of the file and the line does not end with `\\n`.\n- [x] The `get_next_line.h` header file should include at least the `get_next_line()` function.\n- [x] All adicional functions should be included in `get_next_line_utils.c` file, libft is not allowed.\n- [x] To define the buffer size for `read()`, add the option to the compiled file `-D BUFFER_SIZE=[SIZE]`.\n\n## BONUS\n- [x] Use only one static variable.\n- [x] Manage multiple file descriptors at the same time.\n- [x] Bonus files should include a suffix `_bonus.[c/h]`.\n\n## NORMINETTE\n\u003e At 42 School, it is expected that almost every project is written following the Norm, which is the coding standard of the school.\n\n```\n- No for, do...while, switch, case, goto, ternary operators, or variable-length arrays allowed;\n- Each function must be a maximum of 25 lines, not counting the function's curly brackets;\n- Each line must be at most 80 columns wide, with comments included;\n- A function can take 4 named parameters maximum;\n- No assigns and declarations in the same line (unless static);\n- You can't declare more than 5 variables per function;\n- ...\n```\n\n* [42 Norms](https://github.com/42School/norminette/blob/master/pdf/en.norm.pdf) - Information about 42 code norms. `PDF`\n* [Norminette](https://github.com/42School/norminette) - Tool to respect the code norm, made by 42. `GitHub`\n* [42 Header](https://github.com/42Paris/42header) - 42 header for Vim. `GitHub`\n\n## CONTRIBUTING\n\nIf you find any issues or have suggestions for improvements, feel free to fork the repository and open an issue or submit a pull request.\n\n## LICENSE\n\nThis project is available under the MIT License. For further details, please refer to the [LICENSE](https://github.com/jotavare/get_next_line/blob/master/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotavare%2Fget_next_line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjotavare%2Fget_next_line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotavare%2Fget_next_line/lists"}