{"id":25641947,"url":"https://github.com/juripan/jplist","last_synced_at":"2025-06-29T05:37:46.979Z","repository":{"id":278962483,"uuid":"937293297","full_name":"juripan/JPList","owner":"juripan","description":"A dynamic array list implementation in C, usable for custom types","archived":false,"fork":false,"pushed_at":"2025-02-22T19:52:26.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T20:29:20.197Z","etag":null,"topics":["abstraction","arraylist","c","c-programming","c-programming-language","dynamic-array","list","low-level-programming","typed-array"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juripan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-22T19:40:57.000Z","updated_at":"2025-02-22T19:52:30.000Z","dependencies_parsed_at":"2025-02-22T20:39:24.821Z","dependency_job_id":null,"html_url":"https://github.com/juripan/JPList","commit_stats":null,"previous_names":["juripan/jplist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/juripan/JPList","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juripan%2FJPList","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juripan%2FJPList/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juripan%2FJPList/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juripan%2FJPList/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juripan","download_url":"https://codeload.github.com/juripan/JPList/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juripan%2FJPList/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262543971,"owners_count":23326632,"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":["abstraction","arraylist","c","c-programming","c-programming-language","dynamic-array","list","low-level-programming","typed-array"],"created_at":"2025-02-23T05:16:35.339Z","updated_at":"2025-06-29T05:37:46.973Z","avatar_url":"https://github.com/juripan.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JPLIST\n\nA dynamic array list implementation in C. Works for any type (even your custom structs)\n\n## Quick start:\n1. Include the jplist header file\n```C\n#include \"jplist.h\"\n```\n2. Make a print format macro for the types that you will use inside of the JPList struct (used for printing out the list)\n```C\n#define format_Person(i) \"(name: \\\"%s\\\", age: %d)\", iget(list, Person, i).name, iget(list, Person, i).age\n```\n3. Make a comparison function that gets called when comparing items in the JPList struct (it should act like strcmp from \"string.h\")\n```C\nint int_cmp(int x, int y){return x - y;}\n```\n4. Call the \"ADD_BASE_FUNC\" macro to initialize all of the functions that can be used for the JPList (pass in the type, print format macro you made earlier, and the comparison function)\n```C\nADD_BASE_FUNC(int, format_int, int_cmp)\n```\n**IMPORTANT: you cannot use pointers as a type in the list UNLESS you typedef it** \\\nFor example:\n```C\ntypedef int* int_ptr;\nADD_BASE_FUNC(int_ptr, format_int_ptr, int_ptr_cmp)\n```\nNOTE: you can also add specific features only by using the \"ADD\" macros defined in the jplist header file\n\n## Indexing:\nSince the JPList struct stores the items in a void* so indexing the items directly is a mess,\nthats why I added a \"IGET\" macro \\\nExample usage: \\\n```C\nint val = IGET(ints_list, int, 5);\nIGET(ints_list, int, 4) = 21;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuripan%2Fjplist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuripan%2Fjplist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuripan%2Fjplist/lists"}