{"id":19493381,"url":"https://github.com/negrel/cvector","last_synced_at":"2025-04-25T20:31:11.896Z","repository":{"id":109373955,"uuid":"441766095","full_name":"negrel/cvector","owner":"negrel","description":"Simple data structure library in C.","archived":true,"fork":false,"pushed_at":"2022-10-06T20:17:58.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T20:20:51.662Z","etag":null,"topics":["c","datastructure"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/negrel.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-25T22:06:38.000Z","updated_at":"2024-03-26T21:29:46.000Z","dependencies_parsed_at":"2023-03-07T08:00:57.006Z","dependency_job_id":null,"html_url":"https://github.com/negrel/cvector","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/negrel%2Fcvector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fcvector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fcvector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fcvector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/negrel","download_url":"https://codeload.github.com/negrel/cvector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250890329,"owners_count":21503478,"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","datastructure"],"created_at":"2024-11-10T21:25:37.343Z","updated_at":"2025-04-25T20:31:11.891Z","avatar_url":"https://github.com/negrel.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NDS\n\nSimple data structure library in C.\n\n## Build the library\n\nRun the following command to build the library in `build/libcvector.a`:\n\n```shell\n$ make build\n```\n\nIf you want to build it in a docker container:\n```shell\n$ make docker_build\n```\n\n## How it works\n\nCVector is composed of two parts, the **header** and the **body**. The headers contains privates information\nsuch as the length and capacity of the vector. The body contains inserted data.\n\nThe headers and body are laid out next two each other as follow:\n\n```\n0x00                                         0xFF\n┌───────────┬──────────────────────────────────┐\n│  Headers  │               Body               │\n└───────────┴──────────────────────────────────┘\n```\n\nTherefore, when the vector needs to grow, it allocate a new vector with a capacity twice as big and copy all elements from the old vector.  \nWhen a vector **grow** (e.g. `vector_push` and `vector_unshift`), it also free the old one.  \nThus, to **avoid** double free error or **segmentation fault** you must not\ncopy vector pointers and add a level of indirection instead.\n\n## Documentation\n\nFunctions are commented in [header file](./inc/vector.h).\n## :stars: Show your support\n\nPlease give a :star: if this project helped you!\n\n## :scroll: License\n\nMIT © [Alexandre Negrel](https://www.negrel.dev/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegrel%2Fcvector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnegrel%2Fcvector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegrel%2Fcvector/lists"}