{"id":19061553,"url":"https://github.com/msune/libcdada","last_synced_at":"2026-03-15T16:32:15.053Z","repository":{"id":43006711,"uuid":"264779511","full_name":"msune/libcdada","owner":"msune","description":"Basic data structures in C: list, set, map/hashtable, queue... (libstdc++ wrapper)","archived":false,"fork":false,"pushed_at":"2024-07-29T21:57:24.000Z","size":2029,"stargazers_count":26,"open_issues_count":3,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T08:11:09.158Z","etag":null,"topics":["bitmap","c","cdada","data","data-container","data-structures","data-structures-and-algorithms","hashmap","hashtable","library","libstdc","libstdcxx","linked-list","list","map","queue","set","stack","string","struct"],"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/msune.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-17T23:56:54.000Z","updated_at":"2024-10-30T00:10:08.000Z","dependencies_parsed_at":"2022-09-13T18:50:35.733Z","dependency_job_id":"e86f0f59-ff0a-4aaf-97df-f14d6da17d81","html_url":"https://github.com/msune/libcdada","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msune%2Flibcdada","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msune%2Flibcdada/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msune%2Flibcdada/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msune%2Flibcdada/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msune","download_url":"https://codeload.github.com/msune/libcdada/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250585305,"owners_count":21454350,"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":["bitmap","c","cdada","data","data-container","data-structures","data-structures-and-algorithms","hashmap","hashtable","library","libstdc","libstdcxx","linked-list","list","map","queue","set","stack","string","struct"],"created_at":"2024-11-09T00:22:22.079Z","updated_at":"2026-03-15T16:32:15.047Z","avatar_url":"https://github.com/msune.png","language":"C","readme":"master [![Build status](https://github.com/msune/libcdada/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/msune/libcdada/actions/workflows/ci.yaml), devel [![Build status](https://github.com/msune/libcdada/actions/workflows/ci.yaml/badge.svg?branch=devel)](https://github.com/msune/libcdada/actions/workflows/ci.yaml)\n\n**libcdada** - basic data structures in C (`libstdc++` wrapper)\n---------------------------------------------------------------\n\nSmall library that offers basic data structures (`list`, `set`, `map`...) in a pure C API for user-space applications. Key features:\n\n* Easy to use, portable\n* No \"magic\" MACROs, and no need to modify your data structures (except, perhaps, for `__attribute__((packed))`)\n* Stable and well-tested backend engine (`libstdc++`) for most of the data structures\n* Reasonable performance - comparable to `libstdc++`\n\nExample\n-------\n```c\n#include \u003ccdada/list.h\u003e\n\nint x, val=0;\ncdada_list_t* my_list = cdada_list_create(int);\n\n//Add to list {10, 11, 5, 5}\nx=10;\ncdada_list_push_back(my_list, \u0026x);\nx=11;\ncdada_list_push_back(my_list, \u0026x);\nx=5;\ncdada_list_push_back(my_list, \u0026x);\ncdada_list_push_back(my_list, \u0026x);\n\n//Get element in position 1\ncdada_list_get(my_list, 1, \u0026val);\nassert(val == 11);\n\n//First/last\ncdada_list_first(my_list, \u0026val);\nassert(val == 10);\n\n//Add {10, 11, 5, 11}\nx=11;\ncdada_list_push_back(my_list, \u0026val);\n\n//Traverse list\ncdada_list_traverse(my_list, my_iterator_func, opaque);\n```\n\n```c\n#include \u003ccdada/str.h\u003e\n\ncdada_str_t* s = cdada_str_create(\"One string\");\nfprintf(stdout, \"%s\\n\", cdada_str(s));\n\n//Reset\ncdada_str_set(s, \"This is a test\");\nfprintf(stdout, \"%s\\n\", cdada_str(s));\n\ncdada_str_append(s, \" simple string\");\n\ncdada_str_lower(s);\ncdada_str_replace_all(s, \"test \", \"\");\n\n//Will print: \"this is a simple string\"\nfprintf(stdout, \"%s\\n\", cdada_str(s));\n```\n\nMore examples for `map` and `set` and custom containers in the [examples](examples/) folder.\n\nDocumentation\n-------------\n\nPublic API:\n\n  * [cdada.h](include/cdada.h): includes all headers listed below\n    * [cdada/bbitmap.h](include/cdada/bbitmap.h): big bitmap (\u003e 64bit)\n    * [cdada/list.h](include/cdada/list.h): an ordered list of objects (equivalent to `std::list`)\n    * [cdada/map.h](include/cdada/map.h): a hashmap {key -\u003e value}, with unique keys (equivalent to `std::map`)\n    * [cdada/queue.h](include/cdada/queue.h): queue (FIFO queue) implementation (equivalent to `std::queue`)\n    * [cdada/set.h](include/cdada/set.h): a set of objects (equivalent to `std::set`)\n    * [cdada/stack.h](include/cdada/stack.h): stack (LIFO queue) implementation (equivalent to `std::stack`)\n    * [cdada/str.h](include/cdada/str.h): a string (equivalent to `std::string`)\n    * [cdada/utils.h](include/cdada/utils.h): error codes and utility functions\n\n`libcdada` is not thread-safe.\n\nDefault containers support 1-256 bytes keys (values for lists), but they will\nperform better when aligned to {1,2,4,8,32,64,128,256} bytes - keys are padded to\na power of 2 bytes.\n\n#### Custom containers\n\nFor larger keys (any length), optimal memory usage and performance take a look at `libcdada`'s\n**[custom containers](doc/Custom.md)**.\n\n#### Benchmarking\n\nTake a look at **[benchmarking](doc/Benchmarks.md)** for an rough idea\nof the overhead of `libcdada` compared to `libstdc++`.\n\nInstallation\n------------\n\nRequirements:\n\n  * POSIX system\n  * C and C++ gcc compatible compilers (gcc, icc, clang...)\n  * Automake\n  * Autoconf\n  * Libtool\n  * libstdc++ (C++98)\n\n```\nsh autogen.sh\ncd build\n../configure\nsudo make install\n```\n\n#### Windows support\n\nThe library solely depends on `libstdc++`, so it should be very easy to port it\nto Windows. If you are interested, consider submitting a PR.\n\nContact\n-------\n\nMarc Sune \u003c marcdevel (at) gmail (dot) com\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsune%2Flibcdada","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsune%2Flibcdada","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsune%2Flibcdada/lists"}