{"id":26924239,"url":"https://github.com/msabr/get_next_line_1337","last_synced_at":"2025-04-02T01:53:36.981Z","repository":{"id":278365493,"uuid":"935382795","full_name":"msabr/GET_NEXT_LINE_1337","owner":"msabr","description":"A function that reads a file line by line, allowing efficient handling of input from files, stdin, or network streams.","archived":false,"fork":false,"pushed_at":"2025-03-12T02:25:33.000Z","size":1526,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T03:27:23.297Z","etag":null,"topics":["1337cursus","1337school","42cursus","42projects","42school","c","file-reading","get-","get-next-line-42","get-next-line-bonus","get-next-line42","getnextline","getnextline-42","getnextline42","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/msabr.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":"2025-02-19T11:02:34.000Z","updated_at":"2025-03-12T03:16:18.000Z","dependencies_parsed_at":"2025-02-19T12:22:33.072Z","dependency_job_id":"2c4bd0df-c799-4e91-acdb-c2fb6f1a1540","html_url":"https://github.com/msabr/GET_NEXT_LINE_1337","commit_stats":null,"previous_names":["msabr/get_next_line_1337"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msabr%2FGET_NEXT_LINE_1337","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msabr%2FGET_NEXT_LINE_1337/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msabr%2FGET_NEXT_LINE_1337/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msabr%2FGET_NEXT_LINE_1337/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msabr","download_url":"https://codeload.github.com/msabr/GET_NEXT_LINE_1337/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741135,"owners_count":20826064,"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":["1337cursus","1337school","42cursus","42projects","42school","c","file-reading","get-","get-next-line-42","get-next-line-bonus","get-next-line42","getnextline","getnextline-42","getnextline42","static-variables"],"created_at":"2025-04-02T01:53:36.424Z","updated_at":"2025-04-02T01:53:36.965Z","avatar_url":"https://github.com/msabr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **get_next_line - 42 Network**  \n\n## **Overview**  \nGet Next Line delivers a function, `get_next_line()`, that retrieves a line from a file descriptor. It’s divided into two parts:\n- **Mandatory Part**: A single function to read lines sequentially from a file descriptor or standard input.\n- **Bonus Part**: Enhanced version supporting multiple file descriptors simultaneously with a single static variable.\n\n### Key Features\n\n- Returns a line ending with `\\n` (unless EOF is reached without it).\n- Handles both file input and standard input efficiently.\n- Uses static variables for state persistence across calls.\n- Bonus: manages multiple file descriptors without mixing their reading threads.\n\n### Restrictions\n\n- Written in C, adhering to the 42 Norm.\n- No unexpected crashes (e.g., segmentation faults).\n- No memory leaks from heap allocations.\n- Compiled with `-Wall -Wextra -Werror` and `-D BUFFER_SIZE=n` (e.g., 42).\n- No use of `libft`, `lseek()`, or global variables.\n\n## Getting Started\n\n### Prerequisites\n\n- C compiler (e.g., `clang` or `gcc`).\n- `make` utility.\n\n### How to Build and Run\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/msabr/GET_NEXT_LINE_1337\n   cd GET_NEXT_LINE_1337\n\n2. Build the mandatory part:\n\n   ```bash\n   cc -Wall -Wextra -Werror -D BUFFER_SIZE=42 get_next_line.c get_next_line_utils.c\n\n3. Build the bonus part (optional, separately):\n\n   ```bash\n   cc -Wall -Wextra -Werror -D BUFFER_SIZE=42 get_next_line_bonus.c get_next_line_utils_bonus.c\n\n4. Run with a file or standard input:\n\n   ```bash\n   ./a.out \u003cfile\u003e\n\n## Project Structure\n\n- `get_next_line.h`: function prototype for mandatory part.\n- `get_next_line.c`: main function source.\n- `get_next_line_utils.c`: helper functions.\n- `get_next_line_bonus.h`: bonus function prototype.\n- `get_next_line_bonus.c`: bonus main source.\n- `get_next_line_utils_bonus.c`: bonus helper functions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsabr%2Fget_next_line_1337","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsabr%2Fget_next_line_1337","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsabr%2Fget_next_line_1337/lists"}