{"id":23888431,"url":"https://github.com/usmanmehmood55/queue","last_synced_at":"2026-06-17T22:31:54.342Z","repository":{"id":153232788,"uuid":"482331558","full_name":"usmanmehmood55/queue","owner":"usmanmehmood55","description":"A queue implementation in C","archived":false,"fork":false,"pushed_at":"2023-09-05T14:19:35.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T04:41:43.583Z","etag":null,"topics":["buffer","c","data-structures","queue"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usmanmehmood55.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-04-16T18:29:09.000Z","updated_at":"2023-09-05T13:46:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"19ff1eab-cecc-4e4a-9c10-db49573d816f","html_url":"https://github.com/usmanmehmood55/queue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/usmanmehmood55/queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usmanmehmood55%2Fqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usmanmehmood55%2Fqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usmanmehmood55%2Fqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usmanmehmood55%2Fqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usmanmehmood55","download_url":"https://codeload.github.com/usmanmehmood55/queue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usmanmehmood55%2Fqueue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34468766,"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-17T02:00:05.408Z","response_time":127,"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":["buffer","c","data-structures","queue"],"created_at":"2025-01-04T09:00:24.816Z","updated_at":"2026-06-17T22:31:54.323Z","avatar_url":"https://github.com/usmanmehmood55.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Queue\n\nAn implementation of a queue in C. Most of the code is based on the implementation \nfound in [this article](https://www.geeksforgeeks.org/queue-set-1introduction-and-array-implementation/).\n\n[![Build and Test](https://github.com/usmanmehmood55/queue/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/usmanmehmood55/queue/actions/workflows/build_and_test.yml)\n[![codecov](https://codecov.io/gh/usmanmehmood55/queue/graph/badge.svg?token=XK0MXKCR5N)](https://codecov.io/gh/usmanmehmood55/queue)\n\n## Usage\n\nThe queue is implemented as a structure with the front, rear, size, and an array.\n\n```c\ntypedef struct queue_t\n{\n    uint16_t   front;\n    uint16_t   rear;\n    uint16_t   size;\n    uint16_t   capacity;\n    uint16_t * elements;\n} queue_t;\n```\n\nThe user can enqueue items in it until the capacity is filled. After which old\nitems must be dequeued to enqueue new ones.\n\nA queue with capacity `5` can be initialized like this.\n```c\nqueue_t *q = NULL;\nint err = queue_create(\u0026q, 5U);\nif (err != 0)\n{\n    // error handling\n}\n```\n\nAfter use, the queue can be de-initialized like this.\n```c\nerr = queue_destroy(q)\nif (err != 0)\n{\n    // error handling\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusmanmehmood55%2Fqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusmanmehmood55%2Fqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusmanmehmood55%2Fqueue/lists"}