{"id":15396066,"url":"https://github.com/costava/c-queue","last_synced_at":"2026-07-01T00:32:45.402Z","repository":{"id":91581390,"uuid":"367551858","full_name":"Costava/c-queue","owner":"Costava","description":"Generic, type-safe queue using a circular buffer","archived":false,"fork":false,"pushed_at":"2021-05-15T05:58:53.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T23:44:47.731Z","etag":null,"topics":["c","c99","queue"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Costava.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-05-15T05:56:17.000Z","updated_at":"2022-03-26T05:12:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a1c49d0-a6f6-4e46-ac8c-bce85f7dbb3b","html_url":"https://github.com/Costava/c-queue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Costava/c-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Costava","download_url":"https://codeload.github.com/Costava/c-queue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-queue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34988712,"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-30T02:00:05.919Z","response_time":92,"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":["c","c99","queue"],"created_at":"2024-10-01T15:30:46.971Z","updated_at":"2026-07-01T00:32:45.369Z","avatar_url":"https://github.com/Costava.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C Queue\n\n- Generic, type-safe queue using a circular buffer\n- Uses macros to generate a struct (where queue state is managed) and functions to act on that struct for any given type\n- The internal buffer is automatically resized (2x) when necessary to fit additional items\n\nDependencies:\n\n- C99 standard library\n\n## Usage\n\n```C\n#include \"q.h\"\n\n// Generate the code for the type `unsigned int`\n// \"uint\" is suffixed to \"q\" in the function names\nQ_GENERATE_FOR_TYPE(unsigned int, uint)\n\nint main(void) {\n    quint nums;\n    unsigned int val;\n\n    // Initialize with capacity of 64\n    quint_init(\u0026nums, 64);\n    quint_enqueue(\u0026nums, 111u);\n    quint_enqueue(\u0026nums, 222u);\n    quint_enqueue(\u0026nums, 333u);\n    quint_try_dequeue(\u0026nums, \u0026val); // Returned true and val is 111u\n    quint_try_dequeue(\u0026nums, \u0026val); // Returned true and val is 222u\n    quint_try_dequeue(\u0026nums, \u0026val); // Returned true and val is 333u\n    quint_try_dequeue(\u0026nums, \u0026val); // Returned false and val remains 333u\n    quint_enqueue(\u0026nums, 444u);\n    quint_clear(\u0026nums);\n    quint_try_dequeue(\u0026nums, \u0026val); // Returned false and val remains 333u\n\n    quint_deinit(\u0026nums);\n    return 0;\n}\n```\n\n`Q_GENERATE_FOR_TYPE` is a convenience macro that calls both\n`Q_GENERATE_HEADER_CODE` and `Q_GENERATE_IMPLEMENTATION_CODE`.  \nAlternatively, these two macros can be called separately\nas seen in `test/car.h` and `test/car.c` respectively.\n\n## License\nBSD 2-Clause License. See file `LICENSE.txt`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostava%2Fc-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcostava%2Fc-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostava%2Fc-queue/lists"}