{"id":13810779,"url":"https://github.com/google/varstruct","last_synced_at":"2025-05-14T15:31:15.067Z","repository":{"id":65981597,"uuid":"84913296","full_name":"google/varstruct","owner":"google","description":null,"archived":true,"fork":false,"pushed_at":"2017-03-14T08:01:19.000Z","size":16,"stargazers_count":18,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T22:27:43.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-14T06:25:59.000Z","updated_at":"2024-10-25T12:35:19.000Z","dependencies_parsed_at":"2023-02-19T18:30:37.717Z","dependency_job_id":null,"html_url":"https://github.com/google/varstruct","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/google%2Fvarstruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fvarstruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fvarstruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fvarstruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/varstruct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171741,"owners_count":22026504,"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":[],"created_at":"2024-08-04T03:00:25.877Z","updated_at":"2025-05-14T15:31:10.052Z","avatar_url":"https://github.com/google.png","language":"C++","readme":"# Varstruct Overview\n\nVarstruct creates struct-like types with runtime-computed array sizes.\n\nVarstruct is a header-only library -- if you can't use the included Bazel-based\nbuild config, just add varstruct.h and varstruct_internal.h to your includes.\n\nC-style struct definitions may have internal array fields; however, these field\ndeclarations must specify the size of each array at compile time so that the\ncompiler may reserve enough space when computing the offset of each member and\nthe size of the struct.\n\nUnfortunately, many I/O protocols use headers with internal arrays whose size is\nspecified or computed based on other header fields. Therefore, code that parses\nthese headers often has to perform error-prone manual pointer manipulation.\n\nVarstruct is a C++11 library that creates types that may contains internal\narrays, and the sizes of these arrays may be passed in at runtime. Varstruct\nthen computes offsets to each member, and can also read and modify fields when\ngiven an input pointer.\n\n(Modification is performed via std::memcpy() to avoid memory alignment problems\nthat would otherwise occur accessing misaligned fields -- Varstruct doesn't add\nany padding of its own).\n\nYou can run the tests by running the following in the repo root directory (you\nwill need Google Bazel installed):\n\nbazel test :varstruct_test\n\nSee the comments in varstruct.h for more information.\n\nAuthor: Caleb Raitto\n\n# Disclaimer\n\nThis is not an official Google product.\n","funding_links":[],"categories":["Projects built with Bazel"],"sub_categories":["Google projects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fvarstruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fvarstruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fvarstruct/lists"}