{"id":39395119,"url":"https://github.com/3541/liba3","last_synced_at":"2026-01-18T03:15:42.918Z","repository":{"id":38012260,"uuid":"314737444","full_name":"3541/liba3","owner":"3541","description":"Lightweight C utility library.","archived":false,"fork":false,"pushed_at":"2026-01-11T09:20:31.000Z","size":62038,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2026-01-11T10:58:56.627Z","etag":null,"topics":["c","utility-library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3541.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-21T05:05:34.000Z","updated_at":"2026-01-11T09:20:35.000Z","dependencies_parsed_at":"2023-11-25T00:21:39.434Z","dependency_job_id":"67049a13-6555-48da-9621-ce323a5be5a5","html_url":"https://github.com/3541/liba3","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/3541/liba3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3541%2Fliba3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3541%2Fliba3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3541%2Fliba3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3541%2Fliba3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3541","download_url":"https://codeload.github.com/3541/liba3/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3541%2Fliba3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","utility-library"],"created_at":"2026-01-18T03:15:42.701Z","updated_at":"2026-01-18T03:15:42.903Z","avatar_url":"https://github.com/3541.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# liba3\n\n[![Build and test](https://github.com/3541/liba3/actions/workflows/meson.yml/badge.svg)](https://github.com/3541/liba3/actions/workflows/build.yml)\n[![Build and test (aarch64)](https://circleci.com/gh/3541/liba3.svg?style=shield)](https://circleci.com/gh/3541/liba3)\n\nMy personal C/C++ library. All the little things I keep rewriting for every nontrivial project. This\nwas largely born out of frustration while working on [Short\nCircuit](https://github.com/3541/short-circuit).\n\n_Note: This library is absolutely neither stable nor mature, and not ready for any kind of external\nuse at this time. Show-stopping bugs probably exist, and the API may change drastically without any\nnotice._\n\n## Provides\n- Growable byte buffer.\n- Hash table (open addressing, Robin Hood).\n- Cache.\n- Intrusive singly and doubly-linked lists.\n- Priority queue (binary heap, WIP).\n- Logging (to arbitrary `FILE*` outputs).\n- Pool allocator.\n- Nicer strings.\n- Refcounting.\n\n## Features\n- Simple and lightweight — \u003c3 kLOC.\n- Type-generic data structures — (Ab)uses preprocessor macros to imitate C++ templates.\n- C++ friendly — All headers are compatible, and convenient C++ wrappers are provided where\n  appropriate (C++ is not required, however).\n\n## Building and Usage\nBuild dependencies (any of the following options):\n- Bazel 9.0.0 or later.\n- Nix (to provide Bazel; building with Nix is not supported).\n- Meson 1.3.0 or later and a C compiler supporting C11 or later.\n\n_Note: C11 support means genuine standard-compliant C11 support. For MSVC, this means VS2019 or\nnewer is required._\n\nTo build, simply run `bazel build --config=\u003cconf\u003e ...`, where `\u003cconf\u003e` is any of:\n* `clang` or `gcc`: use the given compiler from Nixpkgs.\n* `system-clang`, `system-gcc`, or `system-msvc`: use the given compiler from the host.\n\n### Building with Meson\nTo build, ensure all submodules are in place (`git submodule update --init --recursive`), and run\n`meson setup \u003cBUILDDIR\u003e` to set up the build system in `BUILDDIR`. Then, run `meson compile -C \u003cBUILDDIR\u003e` to build.\n\nTo run the test suite, simply run `meson test -C \u003cBUILDDIR\u003e`.\n\nMeson projects should easily be able to hook into the build system using `subproject`. The Meson\nbuild system provides dependencies `a3_dep`.\n\nProjects using other build systems can invoke Meson directly and depend on the library produced (or\nthey can simply build it themselves — take look at `meson.build` for inspiration).\n\n## Notes\nMost objects (buffer, hash table, linked list, etc...) provide the following functions to do with their lifecycle:\n\n- `void X_init(X*, [...])` initializes a new object.\n- `X* X_new([...])` allocates and initializes (by calling `X_init`) a new object.\n- `void X_destroy(X*)` deinitializes an object and frees its owned memory.\n- `void X_free(X*)` deinitializes (by calling `X_destroy`) and frees an object.\n\nThis vaguely mirrors the C++ object lifecycle, where `X_new` and `X_free` mimic `new` and `delete`, and `X_init` and `X_destroy` are the constructor and destructor.\n\nFor objects with value semantics (`A3String`), there is no `init` or `destroy`, and `new` returns a\nvalue, not a pointer. `free` still takes a pointer so that it can invalidate internal pointers.\n\n## Licensing\n\n`liba3` is licensed under the 3-clause BSD license, the terms of which are\ndescribed [here](https://github.com/3541/liba3/blob/trunk/LICENSE).\n\n`liba3` uses the following third-party projects:\n\n### HighwayHash\nThe project links with [HighwayHash](https://github.com/google/highwayhash),\nwhich is licensed under the [Apache\nlicense](https://github.com/google/highwayhash/blob/master/LICENSE).\n\n### Google Test\nThe test suite uses [Google Test](https://github.com/google/googletest),\nwhich is licensed under the [3-clause BSD\nlicense](https://github.com/google/googletest/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3541%2Fliba3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3541%2Fliba3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3541%2Fliba3/lists"}