{"id":15396075,"url":"https://github.com/costava/c-list","last_synced_at":"2025-03-28T00:16:13.957Z","repository":{"id":91581382,"uuid":"472570291","full_name":"Costava/c-list","owner":"Costava","description":"Generic, type-safe dynamic array written in C","archived":false,"fork":false,"pushed_at":"2022-03-22T01:31:21.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T02:13:40.327Z","etag":null,"topics":["c","c99","dynamic-array"],"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":"2022-03-22T01:19:54.000Z","updated_at":"2022-03-22T01:32:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"06a3c6ef-fe21-4476-b499-44263cd52ea2","html_url":"https://github.com/Costava/c-list","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Costava%2Fc-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Costava","download_url":"https://codeload.github.com/Costava/c-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944107,"owners_count":20697960,"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":["c","c99","dynamic-array"],"created_at":"2024-10-01T15:30:48.714Z","updated_at":"2025-03-28T00:16:13.920Z","avatar_url":"https://github.com/Costava.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C List\n\n- Generic, type-safe [dynamic array](https://en.wikipedia.org/wiki/Dynamic_array) written in C.\n- Uses macros to generate a struct (where array state is managed) and functions to act on that struct for any given type.\n\nDependencies:\n- C99 standard library\n\n## Usage\n\n```C\n#include \u003cstdint.h\u003e\n#include \"List.h\"\n\n// Generate code for the type `int32_t`\n// \"i32\" is suffixed to \"List\" in the function names\nLIST_GENERATE_FOR_TYPE(int32_t, i32);\n\nint main(void) {\n    Listi32 depths;\n    Listi32_Init(\u0026depths, 32, LIST_GROW_MODE_MULTIPLY, 2);\n    Listi32_PushBack(\u0026depths, 1000);\n    Listi32_PushBack(\u0026depths, 3000);\n    Listi32_PushBack(\u0026depths, 4000);\n    Listi32_InsertAtShift(\u0026depths, 2000, 1);\n    const int32_t latest = Listi32_PopBack(\u0026depths); // 4000\n\n    Listi32_Deinit(\u0026depths);\n    return 0;\n}\n```\n\n`LIST_GENERATE_FOR_TYPE` is a convenience macro that calls both\n`LIST_GENERATE_HEADER_CODE` and `LIST_GENERATE_IMPLEMENTATION_CODE`.  \nAlternatively, these two macros can be called separately\nas seen in `test/car.h` and `test/car.c` respectively.  \nAll three macros take the same two arguments: `type` and `suffix`.\n\nSee `LIST_GENERATE_HEADER_CODE` in `List.h`\nfor a list of functions and their descriptions.\n\n## License\n\nBSD 2-Clause License. See file `LICENSE.txt`.\n\n## Contributing\n\nNot currently accepting contributions.  \nFeel free to open an issue or open an issue just to ask a question.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostava%2Fc-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcostava%2Fc-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcostava%2Fc-list/lists"}