{"id":19364273,"url":"https://github.com/mity/c-reusables","last_synced_at":"2025-08-29T02:33:42.838Z","repository":{"id":152121387,"uuid":"101873996","full_name":"mity/c-reusables","owner":"mity","description":"Collection of highly reusable C utilities.","archived":false,"fork":false,"pushed_at":"2024-01-24T08:46:22.000Z","size":260,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T14:39:21.466Z","etag":null,"topics":["c","command-line-parser","hash","helpers","helpers-library","linked-list","mit-license","red-black-tree","utilities","utility-functions","utility-library","variant-data"],"latest_commit_sha":null,"homepage":null,"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/mity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-08-30T11:37:00.000Z","updated_at":"2025-01-27T01:07:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f6bc845-a93f-49b6-ac1d-03ecf24ac62e","html_url":"https://github.com/mity/c-reusables","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mity/c-reusables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mity%2Fc-reusables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mity%2Fc-reusables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mity%2Fc-reusables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mity%2Fc-reusables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mity","download_url":"https://codeload.github.com/mity/c-reusables/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mity%2Fc-reusables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272611999,"owners_count":24964385,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"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","command-line-parser","hash","helpers","helpers-library","linked-list","mit-license","red-black-tree","utilities","utility-functions","utility-library","variant-data"],"created_at":"2024-11-10T07:36:51.756Z","updated_at":"2025-08-29T02:33:42.795Z","avatar_url":"https://github.com/mity.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build (GitHub workflow)](https://img.shields.io/github/actions/workflow/status/mity/c-reusables/ci-build.yml?logo=github)](https://github.com/mity/c-reusables/actions/workflows/ci-build.yml)\n[![Code Coverage (codecov.io)](https://img.shields.io/codecov/c/github/mity/c-reusables/master.svg?logo=codecov\u0026label=code%20coverage)](https://codecov.io/github/mity/c-reusables)\n[![Coverity Scan Status](https://img.shields.io/coverity/scan/mity-c-reusables.svg?label=coverity%20scan)](https://scan.coverity.com/projects/mity-c-reusables)\n\n\n\n# C Reusables Readme\n\nHome: https://github.com/mity/c-reusables\n\n\n## Introduction\n\nThis repository is collection of assorted highly reusable C utilities.\nThe following rules apply:\n\n * **Licensing**: Only code under MIT or in Public Domain is accepted into the\n   repository.\n\n * **Distributing**: Just taking the sources of your interest is enough.\n   Copyright notes and licensing terms are placed within each source file.\n   Additional files like `LICENSE.md` are **not** required to be distributed.\n\n * **Self-contained**: Each module is single `*.c` source file with single\n   `*.h` header (or just the header in some cases) with no other dependencies\n   but system headers and standard C library. Each such module implements only\n   tightly related set of functions. Each header provides reasonable\n   documentation of the exposed functions and types.\n\n * **High portability**: All POSIX compatible systems and Windows are supported.\n   Most other systems probably too.\n\n\n## Table of Contents\n\n### Directory `data`\n\n * `data/buffer.[hc]`: Simple growing buffer. It offers also a stack-like\n   interface (push, pop operations) and array-like interface.\n\n * `data/htable.[hc]`: Simple growing intrusive hash table.\n\n * `data/list.h`: Intrusive double-linked and single-linked lists.\n\n * `data/rbtree.[hc]`: Intrusive red-black tree.\n\n * `data/value.[hc]`: Simple value structure, capable of holding various scalar\n   types of data (booleans, numeric types, strings) and collections (arrays,\n   dictionaries) of such data. It allows to build structured data in run-time;\n   for example it can be used as an in-memory storage for JSON-like data.\n\n### Directory `encode`\n\n * `encode/base64.[hc]`: Encoding and decoding Base64.\n\n * `encode/hex.[hc]`: Encoding and decoding of bytes into/from hexadecimal\n   notation (two hexadecimal digits per byte).\n\n### Directory `hash`\n\n * `hash/crc32.[hc]`: 32-bit cyclic redundancy check function.\n\n * `hash/fnv1a.[hc]`: 32-bit and 64-bit Fowler-Noll-Vo (variant 1a) hash\n   functions.\n\n### Directory `mem`\n\n * `mem/malloca.h`: `MALLOCA()` and `FREEA()` macros, which are a portable\n   variant of `_malloca()` and `_freea()` from Windows SDKs by Microsoft.\n   `MALLOCA()` allocates on stack if requested size below some threshold,\n   for larger allocations it uses `malloc()`.\n\n * `mem/memchunk.[hc]`: A simple chunk allocator, useful when program needs\n    to incrementally allocate many (small) blocks of memory which are eventually\n    all freed at the same time. In that situation this allocator is much cheaper\n    both in memory (much smaller overhead per-individual allocation) as well\n    as in CPU cycles (general purpose `malloc()` is quite expensive).\n\n### Directory `misc`\n\n * `misc/cmdline.[hc]`: Lightweight command line (`argc`, `argv`) parsing.\n\n * `misc/defs.h`: Defining set of basic and frequently used preprocessor macros\n   `MIN`, `MAX`, `CLAMP`, `ABS`, `SIZEOF_ARRAY`, `OFFSETOF`, `CONTAINEROF`\n   etc.\n\n### Directory `win32` (Windows only)\n\n * `win32/memstream.[hc]`: Trivial memory-backed read-only implementation of\n   `IStream` COM interface.\n\n\n## Reporting Bugs\n\nIf you encounter any bug, please be so kind and report it. Unheard bugs cannot\nget fixed. You can submit bug reports here:\n\n* http://github.com/mity/c-reusables/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmity%2Fc-reusables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmity%2Fc-reusables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmity%2Fc-reusables/lists"}