{"id":20055214,"url":"https://github.com/khammerschmidt/42cursus-get_next_line","last_synced_at":"2026-04-11T20:08:39.747Z","repository":{"id":227720831,"uuid":"417380862","full_name":"KHammerschmidt/42cursus-get_next_line","owner":"KHammerschmidt","description":"Reading one line from a file descriptor with a varying BUFFER_SIZE.","archived":false,"fork":false,"pushed_at":"2022-12-10T21:24:07.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T21:32:58.873Z","etag":null,"topics":["static-variables"],"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/KHammerschmidt.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}},"created_at":"2021-10-15T05:40:23.000Z","updated_at":"2022-10-28T09:49:21.000Z","dependencies_parsed_at":"2024-03-14T21:14:03.492Z","dependency_job_id":null,"html_url":"https://github.com/KHammerschmidt/42cursus-get_next_line","commit_stats":null,"previous_names":["khammerschmidt/42cursus-get_next_line"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-get_next_line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-get_next_line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-get_next_line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-get_next_line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KHammerschmidt","download_url":"https://codeload.github.com/KHammerschmidt/42cursus-get_next_line/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241483540,"owners_count":19970097,"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":["static-variables"],"created_at":"2024-11-13T12:46:53.485Z","updated_at":"2026-04-11T20:08:34.721Z","avatar_url":"https://github.com/KHammerschmidt.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg  width=\"90\" src=\"https://user-images.githubusercontent.com/19689770/129336866-169b0dc7-ea41-47d4-b50a-d466508031af.png\"\u003e\n  \n\t🧰 get_next_line\n \u003c/img\u003e\n\n\u003c/h1\u003e\n\u003c/br\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cb\u003eReading a line from a file descriptor\u003c/b\u003e\u003c/br\u003e\n\tStart date: 09/august/2021 \u003c/br\u003e\n\t\u003csub\u003e Project status: completed 105/100 points \u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg alt=\"Github repo size\" src=\"https://img.shields.io/github/repo-size/KHammerschmidt/42cursus-get_next_line?color=red\"/\u003e\n\t\u003cimg alt=\"Number of lines in code\" src=\"https://img.shields.io/tokei/lines/github/KHammerschmidt/42cursus-get_next_line?color=blueviolet\"/\u003e\n\t\u003cimg alt=\"Languages used in repo\" src=\"https://img.shields.io/github/languages/count/KHammerschmidt/42cursus-get_next_line?color=silver\"/\u003e\n\t\u003cimg alt=\"Top used progamming language\" src=\"https://img.shields.io/github/languages/top/KHammerschmidt/42cursus-get_next_line?color=gold\"/\u003e\t\n\u003c/p\u003e\n\n\n\n## 💡 About the project\n\u003e Write a project with maximum of 10 functions under the 42 norminette restrictions, that reads one line from a file descriptor with varying BUFFER_SIZE. Thereby, only one line should be returned and any remains after the newline should be saved for a repetitive function call.\n\u003c/br\u003e\n\n**Requirements** \u003c/br\u003e\n- Repeated calls (e.g., using a loop) to get_next_line() function should read the text file pointed to by the file descriptor, one line at a time.\u003c/br\u003e\n- The function should return the line that was read. If there is nothing else to read or if an error occurred, it should return NULL.\u003c/br\u003e\n- Function should work as expected both when reading a file and when reading from the standard input.\u003c/br\u003e\n- The returned line should include the terminating \\n character, except if the end of file was reached and does not end with a \\n character.\u003c/br\u003e\n- lseek() is forbidden.\u003c/br\u003e\n- Global variables are forbidden.\u003c/br\u003e\n\u003c/br\u003e\n\n**Key learning points**\n  - Learning about file descriptors and reading from a file\n  - Using static variables\n\u003c/br\u003e\n\n## 🛠️ **Usage**\n\nclone the repository:\n```bash\ngit clone https://github.com/KHammerschmidt/42cursus-get_next_line \u0026\u0026\ncd 42cursus-get_next_line \u0026\u0026\ngit clone https://github.com/KHammerschmidt/42cursus-Libft\n```\n\nto modify the buffer size used by read() adapt BUFFERSIZE value n in \u003c/br\u003e\n[`Makefile`](./Makefile) ``` CPPFLAGS\t:= -D BUFFER_SIZE=n ```\n\nto compile the project:\n```bash\nmake\n```\n\u003c/br\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhammerschmidt%2F42cursus-get_next_line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhammerschmidt%2F42cursus-get_next_line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhammerschmidt%2F42cursus-get_next_line/lists"}