{"id":19599221,"url":"https://github.com/42yerevanprojects/get_next_line","last_synced_at":"2026-06-18T09:31:59.856Z","repository":{"id":132570166,"uuid":"349430886","full_name":"42YerevanProjects/get_next_line","owner":"42YerevanProjects","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.","archived":false,"fork":false,"pushed_at":"2022-05-31T09:03:40.000Z","size":1270,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T15:17:26.985Z","etag":null,"topics":["42born2code","42school","c"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42YerevanProjects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-03-19T13:23:10.000Z","updated_at":"2024-11-25T00:24:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc7d7d47-c517-4b1e-bf68-bf1da9fca546","html_url":"https://github.com/42YerevanProjects/get_next_line","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/42YerevanProjects/get_next_line","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42YerevanProjects%2Fget_next_line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42YerevanProjects%2Fget_next_line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42YerevanProjects%2Fget_next_line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42YerevanProjects%2Fget_next_line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42YerevanProjects","download_url":"https://codeload.github.com/42YerevanProjects/get_next_line/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42YerevanProjects%2Fget_next_line/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34485163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["42born2code","42school","c"],"created_at":"2024-11-11T09:09:25.139Z","updated_at":"2026-06-18T09:31:59.670Z","avatar_url":"https://github.com/42YerevanProjects.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 42 Get Next Line (GNL)\n\nThe aim of this project is to make you code a function that **returns a line\nending with a newline, read from a file descriptor.**\n\nThis project will not only allow you to add a very convenient function to your collection,\nbut it will also allow you to learn a highly interesting new concept in C programming: \n**\"static variables\"**\n\n\u003e ⚠️ **Warning**: Don't copy/paste code you don't understand: it's bad for you, and for the school.\n\n## About the project\n\n### Function Prototype\n```c\nint\tget_next_line(int fd, char **line);\n```\nYour program must compile with the flag -D **BUFFER_SIZE=xx**, which will be used\nas the buffer size for the read calls in your get_next_line.\n\nMake sure that your function behaves well when it reads from a file and when it\nreads from the standard input.\n\n### Points to understand in GNL\n\nAccording to our GNL subject *Calling your function get_next_line in a loop will then allow you to read the \ntext available on a file descriptor one line at a time until the EOF*\n\n**get_next_line** function will return an **integer** that will be taken to evaluate all the lines until the\nfile ends.\n\n### Return value\n | Value | Description         |\n |-----------|----------------------|\n |  1| A line has been read |\n |  0| EOF has been reached |\n |  -1| An error happened |\n\n## Resources\n\nVideos\n\n- [Open, Read, Write](https://youtu.be/dP3N8g7h8gY)\n- [Files in C](https://youtu.be/BQJBe4IbsvQ)\n- [File I/O](https://youtu.be/m7E9piHcfr4)\n- [Static Variables in C](https://youtu.be/OngGUoENgWo)\n\nLinks\n\n- [I/O system calls in C](https://www.geeksforgeeks.org/input-output-system-calls-c-create-open-close-read-write/)\n- [Static variables in C](https://www.geeksforgeeks.org/static-variables-in-c/)\n- [File descriptors in C](https://hacksland.net/c-programming-file-descriptors)\n\n## Additional info\nIf you are going to use this file in your 42 project please double check the norms and then validity of the \nsubject file. If you want to understand the project better read the [Get_next_line.pdf](Get_next_line.pdf). \nIf you find any bugs write an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42yerevanprojects%2Fget_next_line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42yerevanprojects%2Fget_next_line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42yerevanprojects%2Fget_next_line/lists"}