{"id":16967884,"url":"https://github.com/skyf0l/list-library","last_synced_at":"2025-03-21T18:18:32.368Z","repository":{"id":53038842,"uuid":"231433990","full_name":"skyf0l/List-library","owner":"skyf0l","description":"Lightweight list library in C","archived":false,"fork":false,"pushed_at":"2021-04-08T21:12:33.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T13:11:50.861Z","etag":null,"topics":["arraylist","c","clib","clibrary","list"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyf0l.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-02T18:04:48.000Z","updated_at":"2024-10-09T13:06:36.000Z","dependencies_parsed_at":"2022-08-24T02:11:00.953Z","dependency_job_id":null,"html_url":"https://github.com/skyf0l/List-library","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/skyf0l%2FList-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyf0l%2FList-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyf0l%2FList-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyf0l%2FList-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyf0l","download_url":"https://codeload.github.com/skyf0l/List-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244844531,"owners_count":20519790,"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":["arraylist","c","clib","clibrary","list"],"created_at":"2024-10-14T00:10:03.275Z","updated_at":"2025-03-21T18:18:32.330Z","avatar_url":"https://github.com/skyf0l.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# List-library\nList library in C\n\n## Build\n\nTo build and install:\n\n```\nmkdir build\ncd build\nmeson ..\nmeson install\n```\n\nTo test:\n\n```\nmkdir build\ncd build\nmeson -Dtests=true ..\nmeson test\n\n```\n\nOr, you may just use `Makefile` to do it all by hand.\n\n## Method Summary\n\n### List :\n\nReturn a new list object, or `NULL` if it failed\n\n```\nlist_t *list_create(void (*destructor)(void *));\n\n(destructor : Destruct object function (as `free` for `malloc`) and `NULL` for nothing)\n```\n\nDestroy list and all objects with the list destructor\n\n```\nvoid *list_destroy(list_t *list);\n```\n\nReturns a full copy of this list, or `NULL` if it failed\n```\nlist_t *list_clone(list_t *list);\n```\n\nReturns an array containing all of the elements in this list (from first to last element).\n```\nvoid **list_to_array(list_t *list);\n```\n\n### Add :\n\nAppends the specified element to the end of this list\n\n```\nint list_add(list_t *list, void *data);\n```\n\nInserts the specified element at the specified position in this list\n\n```\nint list_add_at(list_t *list, void *data, int index);\n```\n\n### Remove :\n\nRemoves the element at the specified position in this list and destroy it\n```\nint list_remove(list_t *list, int index);\n```\n\nRemoves the first occurrence of the specified element from this list\n```\nint list_remove_data(list_t *list, void *data);\n```\n\nRemoves all occurrence of the specified element from this list\n```\nint list_remove_all_data(list_t *list, void *data);\n```\n\nRemoves from this list all of the elements whose index is between index_from, inclusive, and index_to, exclusive\n```\nint list_remove_range(list_t *list, int index_from, int index_to);\n```\n\nRemoves from this list all of the elements whose index is not between index_from, inclusive, and index_to, exclusive\n```\nint list_sub_list(list_t *list, int index_from, int index_to);\n```\n\nRemoves all of the elements from this list\n```\nint list_clear(list_t *list);\n```\n\n### Replace :\n\nReplaces the element at the specified position in this list with the specified element without destroy\n```\nint list_set(list_t *list, void *data, int index);\n```\n\nReplaces the element at the specified position in this list with the specified element and destroy it with the list destructor\n```\nint list_replace(list_t *list, void *data, int index);\n```\n### Order :\n\nReverse order of list\n```\nint list_reverse(list_t *list);\n```\n\n### Get :\n\nReturns the element at the specified position in this list\n```\nvoid *list_get(list_t *list, int index);\n```\n\nReturns the number of elements in this list\n```\nint list_get_size(list_t *list);\n```\n\nReturns 1 if this list contains no elements and 0 else\n```\nint list_is_empty(list_t *list\n```\n\nReturns 1 if this list contains the specified element and 0 else\n```\nint list_contain(list_t *list, void *data);\n```\n\nReturns the number of elements occurrence in this list\n```\nint list_count(list_t *list, void *data);\n```\n\nReturns the index of the first occurrence of the specified element in list or -1 if this list does not contain the element\n```\nint list_index_of(list_t *list, void *data);\n```\n\nReturns the index of the last occurrence of the specified element in list or -1 if this list does not contain the element\n```\nint list_last_index_of(list_t *list, void *data);\n```\n\n### Destructor :\n\nGet destructor\n\n```\nvoid *list_get_destructor(list_t *list);\n```\n\nSet destructor\n\n```\nint list_set_destructor(list_t *list, void (*destructor)(void *));\n```\n\n## System Functions Used:\nmalloc and free\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyf0l%2Flist-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyf0l%2Flist-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyf0l%2Flist-library/lists"}