{"id":41932927,"url":"https://github.com/sequpt/ctl","last_synced_at":"2026-01-25T18:03:07.081Z","repository":{"id":162612659,"uuid":"591747464","full_name":"sequpt/ctl","owner":"sequpt","description":"A C11 library providing generic type-safe data structures compiling to actual structures and functions.","archived":false,"fork":false,"pushed_at":"2023-01-25T13:54:16.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-05-06T16:25:31.827Z","etag":null,"topics":["abstract-data-types","adt","c","c11","data-structures","generic","generic-programming","template"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sequpt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-21T18:32:42.000Z","updated_at":"2023-01-21T19:39:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"df9b8993-3aa5-4514-869f-2a91020cd8f2","html_url":"https://github.com/sequpt/ctl","commit_stats":null,"previous_names":[],"tags_count":7,"template":null,"template_full_name":null,"purl":"pkg:github/sequpt/ctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequpt%2Fctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequpt%2Fctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequpt%2Fctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequpt%2Fctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sequpt","download_url":"https://codeload.github.com/sequpt/ctl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sequpt%2Fctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28756432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["abstract-data-types","adt","c","c11","data-structures","generic","generic-programming","template"],"created_at":"2026-01-25T18:03:02.695Z","updated_at":"2026-01-25T18:03:07.067Z","avatar_url":"https://github.com/sequpt.png","language":"C","readme":"# ctl\n\n[![pipeline status](https://gitlab.com/sequpt/ctl/badges/master/pipeline.svg)](https://gitlab.com/sequpt/ctl/-/commits/master)\n[![license](https://img.shields.io/badge/license-0BSD-blue)](LICENSE)\n[![doxygen](https://img.shields.io/badge/doc-doxygen-blue)](https://sequpt.gitlab.io/ctl)\n\nA `C11` library of generic data structures providing type safety at compile\ntime.\n\n## Table of Contents\n\n- [Quick overview](#quick-overview)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Documentation](#documentation)\n- [Changelog](#changelog)\n- [Contributing](#contributing)\n- [License](#license)\n- [Interesting links](#interesting-links)\n- [Thanks](#thanks)\n\n## Quick overview\n\n```c\n#include \u003cstdio.h\u003e\n#include \"ctl_darray.h\"\n#include \"ctl_stack.h\"\n\n#define CTL_DARRAY_TYPES int, char\nCTL_DARRAY_DECLARE(CTL_DARRAY_TYPES);\nCTL_DARRAY_DEFINE(CTL_DARRAY_TYPES)\n\nint main(void)\n{\n    CTL_DARRAY(int) * foo = ctl_create(foo);\n    CTL_DARRAY(char) * bar = ctl_create(bar);\n    ctl_push(foo, 1);\n    ctl_push(foo, 2);\n    ctl_push(bar, 'a');\n    ctl_push(bar, 'b');\n    printf(\"Last element in foo = %d\\n\", ctl_back(foo));\n    printf(\"First element in bar = %c\\n\", ctl_front(bar));\n    printf(\"Removing last element from bar = %c\\n\", ctl_pop(bar));\n    printf(\"Removing last element from bar = %c\\n\", ctl_pop(bar));\n    printf(\"foo size = %zu\\n\", ctl_size(foo));\n    printf(\"bar size = %zu\\n\", ctl_size(bar));\n    ctl_destroy(foo);\n    ctl_destroy(bar);\n    return 0;\n}\n```\n\n**Output**:\n\n```text\nLast element in foo = 2\nFirst element in bar = a\nRemoving last element from bar = b\nRemoving last element from bar = a\nfoo size = 2\nbar size = 0\n```\n\n## Getting Started\n\n### Prerequisites\n\nA `C11` or above compliant compiler is needed due to the use of `_Generic`.\n\n### Installation\n\n[Download](https://gitlab.com/sequpt/ctl/-/archive/master/ctl-master.zip) or\nclone the repository:\n\n```text\ngit clone https://gitlab.com/sequpt/ctl.git\n```\n\nOptionally run the tests:\n\n```text\ncd ctl\nmake check\n```\n\nData structures are self-contained in their own header and are independent from\neach other. You can just drag-and-drop the one you need in your project and\n`#include` it.\n\n## Documentation\n\nDocumentation is available here: \u003chttps://sequpt.gitlab.io/ctl\u003e\n\n## Changelog\n\nSee the [CHANGELOG.md](CHANGELOG.md) file.\n\n## Contributing\n\nSee the [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\n## License\n\nThis project is licensed under the _very_ permissive [BSD Zero Clause License](LICENSE).\n\n\u003cdetails\u003e\n\u003csummary\u003e\nMore information on the 0BSD license:\n\u003c/summary\u003e\n\n- [The 0BSD's creator website](https://landley.net/toybox/license.html)\n- [BSD Zero Clause License | Software Package Data Exchange (SPDX)](https://spdx.org/licenses/0BSD.html)\n- [Zero-Clause BSD (0BSD) | Open Source Initiative](https://opensource.org/licenses/0BSD)\n- [BSD Zero Clause License | Choose a License](https://choosealicense.com/licenses/0bsd/)\n\n\u003c/details\u003e\n\n## Interesting links\n\n\u003cdetails\u003e\n\u003csummary\u003e\nHere are a few generic data structure libraries in C:\n\u003c/summary\u003e\n\n- [stb_ds.h](https://github.com/nothings/stb/blob/master/stb_ds.h): _This is a single-header-file library that provides easy-to-use\n   dynamic arrays and hash tables for C (also works in C++)._\n  - Part of the well known [stb library](https://github.com/nothings/stb) by Sean Barrett.\n- [Klib](https://github.com/attractivechaos/klib): _A standalone and lightweight C library_\n- [Collections-C](https://github.com/srdja/Collections-C): _A library of generic data structures for the C language._\n\n\u003c/details\u003e\n\n## Thanks\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003c/summary\u003e\n\n- [tnorth](https://gitlab.com/thno)\n\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsequpt%2Fctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsequpt%2Fctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsequpt%2Fctl/lists"}