{"id":17145199,"url":"https://github.com/jeremyletang/kiwi","last_synced_at":"2026-02-14T21:02:20.298Z","repository":{"id":70390897,"uuid":"80278427","full_name":"jeremyletang/kiwi","owner":"jeremyletang","description":"Generate statically typed list for C","archived":false,"fork":false,"pushed_at":"2017-02-05T20:42:31.000Z","size":24,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T15:01:56.596Z","etag":null,"topics":["c","cmake","code-generator"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremyletang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2017-01-28T10:31:53.000Z","updated_at":"2020-08-19T22:06:59.000Z","dependencies_parsed_at":"2023-07-14T22:00:06.959Z","dependency_job_id":null,"html_url":"https://github.com/jeremyletang/kiwi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeremyletang/kiwi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fkiwi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fkiwi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fkiwi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fkiwi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyletang","download_url":"https://codeload.github.com/jeremyletang/kiwi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyletang%2Fkiwi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29455601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["c","cmake","code-generator"],"created_at":"2024-10-14T21:04:55.300Z","updated_at":"2026-02-14T21:02:20.284Z","avatar_url":"https://github.com/jeremyletang.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kiwi\nGenerate statically typed list for C\n\nKiwi is a simple tool to generate user defined statically typed list for C.\n\nKiwi is developed using only C11 standard feature and without any external dependencies so you can easily build it on any platform using a modern enough C compiler.\nAlso it is well integrated with CMake so you can add kiwi in a few line of code to your CMake build.\n\n# usage\nKiwi accepts those differents parameters:\n* `--out=OUT_DIR`: the output path for C, headers generated files (mandatory).\n* `-I=FILE_NAME`: filename to include in the generated file, used with user defined types (optional)\n* types: any other parameters represent you want to create a list for, those types accept two different syntax:\n * `int`: which just generate a list implementation for the type `int`\n * `\"str:char *\"`: which produce a list implementation for the type `char *`, using `str` as an alias in generated code naming.\n\nSimple usage example:\n```Shell\nkiwi --out=./kiwi_gen -I=toto.h int \"str:char *\" toto_t\n```\nExecuting this command will generate list definitions for `int, char *, toto_t`, in the output folder `./kiwi_gen`, using the header file `toto.h` to define the type `toto_t`.\n\n# features\nHere is a list of functions generate with each lists types:\n* make: create a new list\n* drop: delete a list\n* append: add a new element to the list\n* copy: copy an existing list\n* map: apply a function to all the element of a list, and build a new element with list\n* mapi: same than map but pass the index of the element in the list to the function\n* iter: apply a function to all the element of the list\n* iteri: same than iter but pass the index of the element in the list to the function\n* filter: return all the elements of the list that statisfy the predicate\n* any: return true if any of element of the list satisfy the predicate\n* all: return true if all the element of the list satisfy the predicate\n* rev: return the reversed list\n* find: return a pointer to a specific element in the list\n\nKiwi use the '_Generic' macro from C11 extensively, so it allows you to use the same API for any types, it means that you do not have to call verbose API like `int_list_map_float`, without losing typeness by using `void*` to a single function.\n\nExample:\n\n```C\n#include \u003ckiwi.h\u003e\n\nfloat int_to_float(const int *i) {/*...*/}\nint int_to_int(const int *i) {/*...*/}\nfloat float_float(const float *i) {/*...*/}\n\nint main() {\n    int_list *li = make(_int_list);\n    float_list *lf = make(_float_list);\n    // ... initialize your lists, do stuff with them\n    int_list *li2 = map(li, int_to_int);\n    float_list *lf2 = map(li, int_to_float);\n    float_list *lf3 = map(li, float_to_float);\n    // drop you lists\n    drop(li);\n    return 0;\n}\n```\n\n# build\nKiwi requires only a C11 compiler and CMake to build.\n```Shell\ngit clone https://github.com/jeremyletang/kiwi.git \u0026\u0026 cd kiwi\nmkdir build \u0026\u0026 cmake .. \u0026\u0026 make\n```\nKiwi should be available in the build/bin directory.\n\n# integrate kiwi in your project.\nYou can easily integrate kiwi to your C project, a CMake module is available at the root of the repository in the CMake folder.\nYou just need to include it in your project configuration, and this will allow you to call kiwi during the build of your own project and generate the lists you need.\nYou can find a basic CMakeLists.txt configuration to integrate kiwi in the example folder.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyletang%2Fkiwi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremyletang%2Fkiwi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyletang%2Fkiwi/lists"}