{"id":25683439,"url":"https://github.com/ejarvinen/42get_next_line","last_synced_at":"2026-06-11T22:31:14.086Z","repository":{"id":264462278,"uuid":"883857207","full_name":"ejarvinen/42Get_next_line","owner":"ejarvinen","description":"A custom implementation of the C Standard Library function getline","archived":false,"fork":false,"pushed_at":"2025-02-01T18:21:15.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T19:25:36.270Z","etag":null,"topics":["filedescriptor","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/ejarvinen.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-11-05T17:37:10.000Z","updated_at":"2025-02-01T18:21:19.000Z","dependencies_parsed_at":"2025-02-01T19:34:30.876Z","dependency_job_id":null,"html_url":"https://github.com/ejarvinen/42Get_next_line","commit_stats":null,"previous_names":["ejarvinen/42get_next_line"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejarvinen%2F42Get_next_line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejarvinen%2F42Get_next_line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejarvinen%2F42Get_next_line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejarvinen%2F42Get_next_line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejarvinen","download_url":"https://codeload.github.com/ejarvinen/42Get_next_line/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240519211,"owners_count":19814560,"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":["filedescriptor","static-variables"],"created_at":"2025-02-24T16:51:48.609Z","updated_at":"2026-06-11T22:31:14.072Z","avatar_url":"https://github.com/ejarvinen.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 42Get_next_line\n## Introduction\n**Get_next_line** is a C function that reads a line from a file descriptor. This project aims to introduce **static variables** while adhering to best coding practices and memory management in C. The function reads a file line-by-line, making it easier to process text files.\n\n## Features\n- Reads a line from a given file descriptor.\n- Handles memory allocation and deallocation properly.\n- Works with different buffer sizes defined at compilation.\n\n## Bonus Features\n- Uses only one static variable.\n\n## Installation\n1. Clone the repository:\n```\ngit clone https://github.com/ejarvinen/42Get_next_line.git\n```\n2. Navigate to the project directory:\n```\ncd 42Get_next_line\n```\n3. Compile the project:\n```\nmake\n```\n*Running `make` ompiles project, reads `textfile.txt` line-by-line to `stdout` for demo purposes.*\n\n## Usage\nTo use `get_next_line()` in your project:\n```\n#include \"get_next_line.h\"\n\nint fd = open(\"file.txt\", O_RDONLY);\nchar *line;\nwhile ((line = get_next_line(fd))) {\n    printf(\"%s\", line);\n    free(line);\n}\nclose(fd);\n```\n### Compiling and Running\nTo compile with a buffer size of 42:\n```\ncc -Wall -Wextra -Werror -D BUFFER_SIZE=42 get_next_line.c get_next_line_utils.c -o gnl\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejarvinen%2F42get_next_line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejarvinen%2F42get_next_line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejarvinen%2F42get_next_line/lists"}