{"id":21056213,"url":"https://github.com/christophercrouzet/zero","last_synced_at":"2025-05-15T23:33:01.254Z","repository":{"id":82070404,"uuid":"118225889","full_name":"christophercrouzet/zero","owner":"christophercrouzet","description":"Collection of single-file libraries for C/C++.","archived":false,"fork":false,"pushed_at":"2022-12-09T20:50:15.000Z","size":125,"stargazers_count":47,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-06T23:55:55.323Z","etag":null,"topics":["c","header-only","library"],"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/christophercrouzet.png","metadata":{"files":{"readme":"README.md","changelog":"changelogs/allocator.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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-20T08:50:29.000Z","updated_at":"2025-02-09T05:34:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"58992baa-7bdb-461e-9df5-101f5c7436a5","html_url":"https://github.com/christophercrouzet/zero","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christophercrouzet%2Fzero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christophercrouzet%2Fzero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christophercrouzet%2Fzero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christophercrouzet%2Fzero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christophercrouzet","download_url":"https://codeload.github.com/christophercrouzet/zero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253908796,"owners_count":21982683,"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","header-only","library"],"created_at":"2024-11-19T16:49:26.000Z","updated_at":"2025-05-15T23:33:01.220Z","avatar_url":"https://github.com/christophercrouzet.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Zero\n====\n\nZero is a bunch of single-file libraries for C/C++.\n\nIt is written in C89 at the exception of a couple of features borrowed from C99,\nnamely fixed-width integer types and variadic macros.\n\n\n## Features\n\n* mostly C89-compliant\n* headers don't include anything by default \u003csup\u003e[1]\u003c/sup\u003e\n* implementations are included upon defining the `ZR_DEFINE_IMPLEMENTATION`\n  macro\n* each library is a standalone single file to ease integration into projects\n* simple\n\n1. The only exception being `\u003cstdarg.h\u003e` for headers defining functions with a\n`va_list` object as parameter.\n\n\n## Libraries\n\n\n| library | description | latest version | changelog |\n|---------|-------------|----------------|-----------|\n**[allocator.h](include/zero/allocator.h)** | Aligned and non-aligned wrappers of malloc/realloc/free | 0.2.0 | [changelog](changelogs/allocator.md)\n**[dynamicarray.h](include/zero/dynamicarray.h)** | Contiguous array that can grow and shrink | 0.1.0 | [changelog](changelogs/dynamicarray.md)\n**[logger.h](include/zero/logger.h)** | Simple logger with different log levels and colouring | 0.2.0 | [changelog](changelogs/logger.md)\n**[timer.h](include/zero/timer.h)** | High-resolution real time clock and CPU (user/system) clocks | 0.2.0 | [changelog](changelogs/timer.md)\n\n\n## FAQ\n\n### Why defining custom fixed-width integer types and even `size_t`?\n\nBecause most projects target common platforms (Windows, Linux, macOS), thus\nusing either the ILP32, LP64, or LLP64 data models, which all guarantee the\n`char` type to be 8 bits, `short` to be 16 bits, `int` to be 32 bits, and\n`long long` to be 64 bits. If such types can be accurately defined in a few\nlines for most of the projects, then why including a standard header that\nresolves to _thousands_ of lines of code with its dependencies? For the exotic\nplatforms, the macro `ZR_USE_STD_FIXED_TYPES` can be defined, or each type can\nbe overridden individually.\n\nThe same applies to redefining `size_t`—on almost all platforms the size of\n`size_t` equals the targeted architecture, that is either 32 or 64 bits. Here\nagain, if that's not enough then it's still possible to define\nthe macro `ZR_USE_STD_BASIC_TYPES`.\n\nNote that these custom types are only used for the public interface defined in\nthe headers, to avoid cluttering project headers including them. But the\nimplementation sections make free use of standard headers as needed\n(including standard fixed-width integer types and `size_t`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristophercrouzet%2Fzero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristophercrouzet%2Fzero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristophercrouzet%2Fzero/lists"}