{"id":25834628,"url":"https://github.com/nihilantropy/get_next_line","last_synced_at":"2026-06-13T14:33:22.836Z","repository":{"id":254829036,"uuid":"847638023","full_name":"Nihilantropy/get_next_line","owner":"Nihilantropy","description":"get_next_line 42 school project","archived":false,"fork":false,"pushed_at":"2024-08-26T10:22:43.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T01:00:05.623Z","etag":null,"topics":["42projects","42school","c","coding","getnextline","project"],"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/Nihilantropy.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":"2024-08-26T08:54:00.000Z","updated_at":"2025-02-26T11:28:23.000Z","dependencies_parsed_at":"2024-08-26T12:34:01.371Z","dependency_job_id":"02c46f50-a9ff-4a35-8054-04b50ccebd8a","html_url":"https://github.com/Nihilantropy/get_next_line","commit_stats":null,"previous_names":["nihilantropy/get_next_line"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nihilantropy/get_next_line","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2Fget_next_line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2Fget_next_line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2Fget_next_line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2Fget_next_line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nihilantropy","download_url":"https://codeload.github.com/Nihilantropy/get_next_line/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nihilantropy%2Fget_next_line/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34288664,"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-13T02:00:06.617Z","response_time":62,"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":["42projects","42school","c","coding","getnextline","project"],"created_at":"2025-03-01T00:58:48.940Z","updated_at":"2026-06-13T14:33:22.813Z","avatar_url":"https://github.com/Nihilantropy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Installation\n\nYou can git clone the repository using https protocol\n\n```\ngit clone https://github.com/Nihilantropy/get_next_line.git\n```\n\naccess the directory\n\n```bash\ncd get_next_line\n```\n\nTake a look at the code :eyes:! To test it you can call this command:\n\n```\ncc -Wall -Wextra -Werror -D BUFFER_SIZE=42 main.c get_next_line.c get_next_line_utils.c -o test_gnl\n```\nand run the program with\n\n```\n./test_gnl\n```\n\nTry to modify the `sample.txt.` file to see the result. You can play with the BUFFER_SIZE in each compilation to see if it works :smile:\n\n**IMPORTANT!**: `main.c` and `sample.txt` are just for testing. They must not go into the project repository!\n\nYou can even use a tester program like this one:\n\n```\nhttps://github.com/Tripouille/gnlTester\n```\n\nBiggest shotout to `Oceano` :ocean: (https://github.com/suspectedoceano) (https://www.youtube.com/watch?v=8E9siq7apUU). This project is based on his wise teaching :love_letter:!\n\nNow let's get down to the meat :cut_of_meat:!\n\n# Get Next Line 📜\n\nWelcome to the **Get Next Line** project! 🎉 This project will add a handy function to your coding toolbox, allowing you to read lines from a file descriptor one at a time. Perfect for when you need to handle files or standard input in a neat and manageable way!\n\n## 📚 Project Overview\n\nThe goal of this project is to develop a function that reads a single line from a file descriptor. You'll become familiar with static variables and gain a deeper understanding of file handling in C. \n\n## 🛠️ Getting Started\n\n- **Function Name**: `get_next_line`\n- **Prototype**: `char *get_next_line(int fd);`\n- **File Names**: `get_next_line.c`, `get_next_line_utils.c`, `get_next_line.h`\n- **Parameters**: `fd` - The file descriptor to read from\n- **Return Value**:\n  - **Read Line**: Returns the line read from the file descriptor.\n  - **NULL**: If there is nothing else to read or if an error occurred.\n\n### Key Points\n\n- **Buffer Size**: Define the buffer size using `-D BUFFER_SIZE=n` during compilation. Test with various sizes to ensure robustness.\n- **Handling Files**: Ensure your function reads files and standard input correctly.\n- **Line Termination**: Include the terminating `\\n` character in the returned line unless it's the end of file.\n- **No Global Variables**: Use static variables to maintain state across multiple calls.\n- **Avoid lseek()**: Directly use `read()` without seeking.\n\n## 🔍 Mandatory Part\n\n1. **Function**: Implement `get_next_line()` to read a line from a file descriptor.\n2. **Files**: Submit `get_next_line.c`, `get_next_line_utils.c`, and `get_next_line.h`.\n3. **Compilation**: Compile with `cc -Wall -Wextra -Werror -D BUFFER_SIZE=42 \u003cfiles\u003e.c`.\n\n## 🎨 Bonus Part\n\nIf you're up for a challenge, here’s what you can do:\n\n- **Single Static Variable**: Refactor `get_next_line()` to use only one static variable.\n- **Multiple File Descriptors**: Enable `get_next_line()` to handle multiple file descriptors simultaneously.\n\n**Bonus Files**:\n- `get_next_line_bonus.c`\n- `get_next_line_bonus.h`\n- `get_next_line_utils_bonus.c`\n\n## 📝 Submission and Peer Evaluation\n\n- **Repository**: Submit your work to your Git repository.\n- **Testing**: Prepare diverse test cases to ensure functionality across different scenarios.\n- **Defense**: Be ready to explain your code and test results during your defense.\n\nFeel free to test your implementation thoroughly and ensure it meets all requirements. Once you’re done, integrate `get_next_line()` into your libft if you wish!\n\nHappy coding and good luck! 🚀\n\n## Leave a strar :star:!\n\nIf you'd like to see an in-depth analisy of this code, leave a star to let us know! :love_letter:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihilantropy%2Fget_next_line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnihilantropy%2Fget_next_line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihilantropy%2Fget_next_line/lists"}