diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..51477ea --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,174 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +env: + # The tests' dev-dependency mcpplibs.mwrap.abseil 20250512.1 is in mcpp-index#845 and not yet in + # the published index: until it is, the run resolves against that PR's candidate commit, the + # complete unchanged index layout installed as the built-in index of the run's home. Drop this + # pin and the steps that read it once the index publishes it. + MCPP_INDEX_CANDIDATE: "269cd2dd952b729ce1732bc82e6caa0fa15bea53" + +jobs: + mcpp: + name: mcpp (${{ matrix.os }}, ${{ matrix.toolchain }}) + strategy: + fail-fast: false + matrix: + include: + - { os: ubuntu-24.04, toolchain: 'gcc@16.1.0' } + - { os: ubuntu-24.04, toolchain: 'llvm@23.1.3' } + - { os: ubuntu-24.04-arm, toolchain: 'gcc@16.1.0' } + - { os: ubuntu-24.04-arm, toolchain: 'llvm@23.1.3' } + - { os: macos-15, toolchain: 'llvm@23.1.3' } + - { os: windows-2025, toolchain: 'llvm@23.1.3' } + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + defaults: + run: + shell: bash + env: + XLINGS_NON_INTERACTIVE: 1 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Mwrap identity, bilingual README contract, the codegen example is the template + run: | + python3 tools/check_mwrap_release.py + python3 tools/check_examples.py + + - name: Install Xlings (Linux/macOS) + if: runner.os != 'Windows' + run: | + curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/refs/heads/main/tools/other/quick_install.sh | bash + echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" + + - name: Install Xlings (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + irm https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.ps1 | iex + "$env:USERPROFILE\.xlings\subos\current\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Install project tools (.xlings.json) + run: | + for attempt in 1 2 3; do + xlings update > /dev/null 2>&1 || true + if xlings install; then break; fi + [ "$attempt" = 3 ] && exit 1 + sleep 30 + done + mcpp --version + + - name: Candidate index (mcpp-index#845) + run: | + mcpp index update + # No early exit in awk: mcpp would take SIGPIPE, and pipefail report it. + home=$(mcpp self env | awk -F'= *' '/^MCPP_HOME/ && !h {h = $2} END {print h}') + test -n "$home" + git init -q "$RUNNER_TEMP/index" + git -C "$RUNNER_TEMP/index" fetch -q --depth 1 https://github.com/mcpplibs/mcpp-index "$MCPP_INDEX_CANDIDATE" + git -C "$RUNNER_TEMP/index" checkout -q FETCH_HEAD + python3 "$RUNNER_TEMP/index/tests/prepare_builtin_index.py" --home "$home" + + - name: Select the toolchain + run: | + name="${{ matrix.toolchain }}" + mcpp toolchain install "${name%@*}" "${name#*@}" + mcpp toolchain default "$name" + + - name: Build the modules + run: mcpp build + + - name: Tests (wire bytes, text and JSON, the well-known types, .proto parsing, streams, every macro, header mixing) + run: mcpp test + + - name: Tests, release profile + run: mcpp test --profile release + + - name: The gzip feature (GzipOutputStream / GzipInputStream over compat.zlib) + working-directory: examples/gzip + run: mcpp run + + # protoc is built for this machine from the same release, protogen generates the code during the build. + # Not on Windows: compat.protobuf 35.1 does not build protoc there (its host-tool sub-build fails). + - name: Code generation (templates/codegen instantiated) + if: runner.os != 'Windows' + working-directory: examples/codegen + run: mcpp run + + # Evidence, not a gate: whether compat.protobuf's protoc host-tool sub-build still fails on Windows. + - name: Probe protoc on Windows (known to fail with compat.protobuf 35.1) + if: runner.os == 'Windows' + continue-on-error: true + working-directory: examples/codegen + run: mcpp run + + - name: Export audit (the generated sources are fresh; on the LLVM row the record is derived again by clang) + run: | + if [ "${{ matrix.os }}" = "ubuntu-24.04" ] && [ "${{ matrix.toolchain }}" = "llvm@23.1.3" ]; then + export MWRAP_REQUIRE_CLANG=1 + export MWRAP_CLANG="$(ls -d "$HOME"/.mcpp/registry/data/xpkgs/xim-x-llvm/23.1.3/bin/clang++ "$HOME"/.xlings/data/xpkgs/xim-x-llvm/23.1.3/bin/clang++ 2>/dev/null | head -1)" + fi + python3 tools/check_exports.py + + # The Web: wasm32-emscripten (emsdk from xlings, through mcpp), the tests under node. + web: + name: mcpp (web, wasm32-emscripten) + runs-on: ubuntu-24.04 + timeout-minutes: 90 + defaults: + run: + shell: bash + env: + XLINGS_NON_INTERACTIVE: 1 + steps: + - uses: actions/checkout@v4 + + - name: Install Xlings + run: | + curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/refs/heads/main/tools/other/quick_install.sh | bash + echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" + + - name: Install project tools (.xlings.json) + run: | + for attempt in 1 2 3; do + xlings update > /dev/null 2>&1 || true + if xlings install; then break; fi + [ "$attempt" = 3 ] && exit 1 + sleep 30 + done + mcpp --version + + - name: Candidate index (mcpp-index#845) + run: | + mcpp index update + # No early exit in awk: mcpp would take SIGPIPE, and pipefail report it. + home=$(mcpp self env | awk -F'= *' '/^MCPP_HOME/ && !h {h = $2} END {print h}') + test -n "$home" + git init -q "$RUNNER_TEMP/index" + git -C "$RUNNER_TEMP/index" fetch -q --depth 1 https://github.com/mcpplibs/mcpp-index "$MCPP_INDEX_CANDIDATE" + git -C "$RUNNER_TEMP/index" checkout -q FETCH_HEAD + python3 "$RUNNER_TEMP/index/tests/prepare_builtin_index.py" --home "$home" + + - name: Tests under node + run: mcpp test --target wasm32-emscripten + + - name: Tests under node, release profile + run: mcpp test --target wasm32-emscripten --profile release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f0c6447 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release +on: + push: + tags: ["mwrap-*"] +permissions: + contents: read +jobs: + publish: + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write + actions: read + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Check tag, upstream version and bilingual entry pages + run: python3 tools/check_mwrap_release.py --tag "$GITHUB_REF_NAME" + - name: Require successful source CI at this exact commit + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + set -euo pipefail + result=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow ci.yml --commit "$GITHUB_SHA" --limit 1 --json status,conclusion --jq '.[0] | .status == "completed" and .conclusion == "success"') + test "$result" = true || { echo 'No successful source CI at the tag commit'; exit 1; } + - name: Build immutable source asset and publish + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + set -euo pipefail + version="${GITHUB_REF_NAME#mwrap-}" + repo="${GITHUB_REPOSITORY#*/}" + asset="${repo}-${version}.tar.gz" + git archive --format=tar.gz --prefix="${repo}-${version}/" "$GITHUB_SHA" > "$RUNNER_TEMP/$asset" + (cd "$RUNNER_TEMP" && sha256sum "$asset" > "$asset.sha256") + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then + echo 'Release already exists; refusing to change immutable assets'; exit 1 + fi + extra=() + if [[ "$version" == *-rc* ]]; then extra+=(--prerelease); fi + gh release create "$GITHUB_REF_NAME" "$RUNNER_TEMP/$asset" "$RUNNER_TEMP/$asset.sha256" \ + --repo "$GITHUB_REPOSITORY" --verify-tag --title "$repo $version" \ + --notes "Module wrapper for upstream $version. New mwrap package identities become installable after mcpp-index publication; see the bilingual README for the tested support scope." "${extra[@]}" diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml new file mode 100644 index 0000000..884cf21 --- /dev/null +++ b/.github/workflows/templates.yml @@ -0,0 +1,30 @@ +name: Actual project templates +on: + push: + branches: [main] + pull_request: + workflow_dispatch: +permissions: + contents: read +concurrency: + group: templates-${{ github.ref }} + cancel-in-progress: true +env: + MCPP_VERSION: "2026.11.18.1" +jobs: + templates: + runs-on: ubuntu-24.04 + timeout-minutes: 90 + steps: + - uses: actions/checkout@v4 + - name: Install the pinned mcpp + shell: bash + run: | + archive="mcpp-${MCPP_VERSION}-linux-x86_64.tar.gz" + curl -L -fsS -o "$archive" "https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/$archive" + tar -xzf "$archive" + echo "$PWD/mcpp-${MCPP_VERSION}-linux-x86_64/bin" >> "$GITHUB_PATH" + - name: Actual scaffold, strict build and run of the default template (message) + run: python3 tools/test_template.py --toolchain gcc@16.1.0 + - name: Actual scaffold, strict build and run of the codegen template (protoc during the build) + run: python3 tools/test_template.py --toolchain gcc@16.1.0 --template codegen diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d4e0d59 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +target/ +compile_commands.json +mcpp.lock +.mcpp/ +.xlings/ +doctor.log +__pycache__/ diff --git a/.xlings.json b/.xlings.json new file mode 100644 index 0000000..8aeb5c2 --- /dev/null +++ b/.xlings.json @@ -0,0 +1,5 @@ +{ + "workspace": { + "xim:mcpp": "2026.11.18.1" + } +} diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..763f7e6 --- /dev/null +++ b/NOTICE @@ -0,0 +1,20 @@ +protobuf-m: C++ module wrapper +Copyright (c) 2026 mcpp-community contributors + +The wrapper contributions are licensed under the Apache License, Version 2.0. +Upstream code, copied interfaces and dependencies retain their original +licenses and copyright notices: + + Protocol Buffers, under the BSD 3-Clause License: + Copyright 2008 Google Inc. (Google LLC). All rights reserved. + utf8_range (third_party/utf8_range of the protobuf release), under the MIT + License: + Copyright (c) 2019 Yibo Cai. Copyright 2022 Google LLC. + Abseil (compat.abseil, which protobuf links), under the Apache License 2.0: + Copyright The Abseil Authors. + +Their original README and licenses are retained in upstream/protobuf/, +upstream/utf8_range/ and upstream/abseil-cpp/. The library itself is built by +compat.protobuf 35.1 over compat.abseil 20250512.1 from the same releases. +rules/ (protogen) is derived from grpc-m's grpcgen (Apache-2.0, mcpp-community). +Provenance and checksums are recorded in upstream/documents.json. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a231bd5 --- /dev/null +++ b/README.md @@ -0,0 +1,96 @@ +# protobuf-m + +> Protocol Buffers 35.1 (the C++ runtime), through C++23 modules. + +**English** · [简体中文](README.zh.md) · [Upstream](https://github.com/protocolbuffers/protobuf) · [Releases](https://github.com/mcpplibs/protobuf-m/releases) · [mcpp](https://github.com/mcpp-community/mcpp) · [Index](https://github.com/mcpplibs/mcpp-index) + +[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23) +[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) +[![mcpp-community](https://img.shields.io/badge/mcpp--community-mwrap-blue)](https://github.com/mcpp-community) +[![CI](https://github.com/mcpplibs/protobuf-m/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mcpplibs/protobuf-m/actions/workflows/ci.yml) + +The upstream C++ API is unchanged: `google::protobuf::Message`, `DescriptorPool`, +`util::MessageDifferencer`, `Timestamp` are the upstream entities. The library is +`compat.protobuf` 35.1 over `compat.abseil` 20250512.1, built from the releases, and the +`codegen` feature adds protoc, built for the build machine from the same release, with +`protogen`, a build rule that generates the code of every `.proto` during the build. + +## Modules + +- `import mcpplibs.mwrap.protobuf;`: messages, descriptors, reflection, arenas, repeated fields, maps, text format, the well-known types; re-exports the modules below +- `import mcpplibs.mwrap.protobuf.io;`: coded and zero-copy streams, the tokenizer +- `import mcpplibs.mwrap.protobuf.util;`: JSON (`json::`), `MessageDifferencer`, `TimeUtil`, `FieldMaskUtil`, delimited messages +- `import mcpplibs.mwrap.protobuf.compiler;`: parsing `.proto` files at run time (`Importer`, `Parser`) +- `import mcpplibs.mwrap.protobuf.io.gzip;`: `GzipInputStream`, `GzipOutputStream` (feature `gzip`) + +> More Modules API -> [Usage](docs/usage.md) · [every exported name](docs/api.md) + +## Getting started + +```sh +mcpp new people --template mcpplibs.mwrap.protobuf@35.1 +cd people +mcpp run +``` + +The default template describes a message type at run time and uses it through reflection: +wire bytes, text and JSON, then Timestamp arithmetic, Struct and Any — no protoc. With +`--template mcpplibs.mwrap.protobuf@35.1:codegen`, `proto/addressbook.proto` is compiled by +protoc during the build and the generated classes are used with the module. + +```toml +[dependencies] +mcpplibs.mwrap.protobuf = { version = "35.1", features = ["codegen"] } +``` + +```cpp +// build.mcpp +import mcpp; +import protogen; +int main() { return protogen::generate_all() ? 0 : 1; } +``` + +```cpp +// src/main.cpp: includes first (the prelude, then generated headers), imports after +#include +#include "addressbook.pb.h" +import std; +import mcpplibs.mwrap.protobuf; +``` + +## Features + +| Feature | Purpose | +|---|---| +| `codegen` | protoc for the build machine, from the same release, and the `protogen` rule (not on Windows: protoc is not built there) | +| `gzip` | `GzipInputStream` / `GzipOutputStream` over compat.zlib, `import mcpplibs.mwrap.protobuf.io.gzip;` | +| `upb` | protobuf's C runtime from the same release, as gRPC links it (one protobuf in a program with both) | + +## Abseil and headers + +protobuf's API takes and returns Abseil types (`absl::Status`, `absl::string_view`, which +is `std::string_view`); this package exports no `absl` name. To name them, import +`mcpplibs.mwrap.abseil` or include the Abseil header. With GCC every `#include` of a +translation unit comes before its first `import`; one that includes generated headers +includes `` first. The version macros are constants in +`mcpplibs::mwrap::protobuf::macros`; `GOOGLE_PROTOBUF_VERIFY_VERSION` and the other +macros come from ``. + +## Build and testing + +CI on Linux (x86_64, aarch64; GCC 16 and LLVM 23), macOS and Windows builds the modules +and runs the tests in the dev and release profiles: wire bytes, text and JSON round trips, +the well-known types, MessageDifferencer and FieldMaskUtil, coded and delimited streams, +a `.proto` parsed at run time, every macro mapping, header mixing; the gzip feature; and +code generation through protogen (not on Windows). The Web row runs the tests as +wasm32 under node. The export audit derives the record again from the headers on the +Linux LLVM row. A separate job scaffolds both templates as an installed package and runs +them. + +## License + +[Apache-2.0](LICENSE) for the wrapper, by mcpp-community ([NOTICE](NOTICE)). Protocol +Buffers remains under the BSD 3-Clause License ([upstream/protobuf/LICENSE](upstream/protobuf/LICENSE), +[README](upstream/protobuf/README.md)), utf8_range under MIT +([upstream/utf8_range/LICENSE](upstream/utf8_range/LICENSE)), and Abseil, which it links, +under Apache-2.0 ([upstream/abseil-cpp/LICENSE](upstream/abseil-cpp/LICENSE)). diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 0000000..4bd75e9 --- /dev/null +++ b/README.zh.md @@ -0,0 +1,91 @@ +# protobuf-m + +> 以 C++23 模块使用 Protocol Buffers 35.1(C++ 运行时)。 + +[English](README.md) · **简体中文** · [Upstream](https://github.com/protocolbuffers/protobuf) · [Releases](https://github.com/mcpplibs/protobuf-m/releases) · [mcpp](https://github.com/mcpp-community/mcpp) · [Index](https://github.com/mcpplibs/mcpp-index) + +[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23) +[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) +[![mcpp-community](https://img.shields.io/badge/mcpp--community-mwrap-blue)](https://github.com/mcpp-community) +[![CI](https://github.com/mcpplibs/protobuf-m/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mcpplibs/protobuf-m/actions/workflows/ci.yml) + +上游 C++ API 不变:`google::protobuf::Message`、`DescriptorPool`、`util::MessageDifferencer`、 +`Timestamp` 就是上游实体。库由 `compat.protobuf` 35.1 提供,基于 `compat.abseil` 20250512.1, +均从发布包构建;`codegen` feature 增加 protoc(为构建机从同一发布构建)和构建规则 +`protogen`,在构建时为每个 `.proto` 生成代码。 + +## Modules + +- `import mcpplibs.mwrap.protobuf;`:消息、描述符、反射、arena、repeated 字段、map、文本格式、well-known types;并重导出下列模块 +- `import mcpplibs.mwrap.protobuf.io;`:coded / zero-copy 流、tokenizer +- `import mcpplibs.mwrap.protobuf.util;`:JSON(`json::`)、`MessageDifferencer`、`TimeUtil`、`FieldMaskUtil`、带长度前缀的消息 +- `import mcpplibs.mwrap.protobuf.compiler;`:运行时解析 `.proto`(`Importer`、`Parser`) +- `import mcpplibs.mwrap.protobuf.io.gzip;`:`GzipInputStream`、`GzipOutputStream`(feature `gzip`) + +> More Modules API -> [用法](docs/usage.md) · [全部导出名](docs/api.md) + +## 快速开始 + +```sh +mcpp new people --template mcpplibs.mwrap.protobuf@35.1 +cd people +mcpp run +``` + +默认模板在运行时描述一个消息类型并通过反射使用:线上字节、文本与 JSON,再演示 +Timestamp 运算、Struct 与 Any —— 不需要 protoc。用 +`--template mcpplibs.mwrap.protobuf@35.1:codegen` 时,`proto/addressbook.proto` 在构建中由 +protoc 编译,生成的类与模块一起使用。 + +```toml +[dependencies] +mcpplibs.mwrap.protobuf = { version = "35.1", features = ["codegen"] } +``` + +```cpp +// build.mcpp +import mcpp; +import protogen; +int main() { return protogen::generate_all() ? 0 : 1; } +``` + +```cpp +// src/main.cpp:先 include(prelude,再生成的头文件),后 import +#include +#include "addressbook.pb.h" +import std; +import mcpplibs.mwrap.protobuf; +``` + +## Features + +| Feature | 用途 | +|---|---| +| `codegen` | 为构建机构建的同版本 protoc,以及 `protogen` 规则(Windows 不可用:那里不构建 protoc) | +| `gzip` | 基于 compat.zlib 的 `GzipInputStream` / `GzipOutputStream`,`import mcpplibs.mwrap.protobuf.io.gzip;` | +| `upb` | 同一发布中的 protobuf C 运行时,供 gRPC 链接(两者同用时只有一份 protobuf) | + +## Abseil 与头文件 + +protobuf 的 API 使用 Abseil 类型(`absl::Status`、`absl::string_view`,即 +`std::string_view`);本包不导出任何 `absl` 名字。需要书写这些名字时,import +`mcpplibs.mwrap.abseil` 或 include Abseil 头文件。GCC 要求翻译单元的所有 `#include` 位于 +第一个 `import` 之前;包含生成头文件的翻译单元先 include ``。 +版本宏是 `mcpplibs::mwrap::protobuf::macros` 中的常量;`GOOGLE_PROTOBUF_VERIFY_VERSION` +等其余宏由 `` 提供。 + +## 构建与测试 + +CI 在 Linux(x86_64、aarch64;GCC 16 与 LLVM 23)、macOS、Windows 上构建模块,并在 dev 与 +release 两种 profile 下运行测试:线上字节、文本与 JSON 往返、well-known types、 +MessageDifferencer 与 FieldMaskUtil、coded 与带长度前缀的流、运行时解析 `.proto`、每个宏映射、 +头文件混用;gzip feature;以及经 protogen 的代码生成(Windows 除外)。Web 行在 node 下以 +wasm32 运行测试。导出审计在 Linux LLVM 行上从头文件重新推导记录。另一个作业把两个模板作为 +已安装包生成并运行。 + +## 许可 + +封装层为 [Apache-2.0](LICENSE),归属 mcpp-community([NOTICE](NOTICE))。Protocol Buffers 保持 +BSD 3-Clause([upstream/protobuf/LICENSE](upstream/protobuf/LICENSE)、[README](upstream/protobuf/README.md)), +utf8_range 为 MIT([upstream/utf8_range/LICENSE](upstream/utf8_range/LICENSE)),其链接的 Abseil 为 +Apache-2.0([upstream/abseil-cpp/LICENSE](upstream/abseil-cpp/LICENSE))。 diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..69bcb0d --- /dev/null +++ b/docs/api.md @@ -0,0 +1,243 @@ +# Modules and API + +[Usage](usage.md) · [README](../README.md) · written by `tools/surface.py` from `tools/surface.json` (audited by `tools/check_exports.py`). + +Every exported name is the upstream entity, in the namespace upstream declares it in. No `absl` name is exported: +protobuf's API uses Abseil types (`absl::Status`, `absl::string_view`, `absl::Cord`); to name them, import +`mcpplibs.mwrap.abseil` or include the Abseil header. + +| Module | Names | Of | +|---|---:|---| +| `mcpplibs.mwrap.protobuf` | 710 | messages, descriptors, reflection, arenas, repeated fields, maps, text format and the well-known types | +| `mcpplibs.mwrap.protobuf.io` | 33 | coded and zero-copy streams, the tokenizer and the printer | +| `mcpplibs.mwrap.protobuf.util` | 51 | JSON, MessageDifferencer, TimeUtil, FieldMaskUtil, delimited messages and type resolvers | +| `mcpplibs.mwrap.protobuf.compiler` | 7 | parsing .proto files at run time: Importer, DiskSourceTree, Parser | +| `mcpplibs.mwrap.protobuf.io.gzip` | 2 | GzipInputStream and GzipOutputStream (the package's `gzip` feature) | +| `mcpplibs.mwrap.protobuf.macros` | 7 | the version macros and the tag computation | + +## mcpplibs.mwrap.protobuf + +- `google::protobuf` types (227): `AccessListener`, `Any`, `AnyGlobalsTypeInternal`, `Api`, `ApiGlobalsTypeInternal`, `Arena`, `ArenaOptions`, `AssignDescriptorsHelper`, `BigEndian`, `BoolValue`, `BoolValueGlobalsTypeInternal`, `BytesValue`, `BytesValueGlobalsTypeInternal`, `Closure`, `ConstMapIterator`, `DebugStringOptions`, `Descriptor`, `DescriptorBuilder`, `DescriptorDatabase`, `DescriptorPool`, `DescriptorPoolDatabase`, `DescriptorPoolDatabaseOptions`, `DescriptorProto`, `DescriptorProtoGlobalsTypeInternal`, `DescriptorProto_ExtensionRange`, `DescriptorProto_ExtensionRangeGlobalsTypeInternal`, `DescriptorProto_ReservedRange`, `DescriptorProto_ReservedRangeGlobalsTypeInternal`, `DoubleValue`, `DoubleValueGlobalsTypeInternal`, `Duration`, `DurationGlobalsTypeInternal`, `DynamicMapSorter`, `DynamicMessage`, `DynamicMessageFactory`, `Edition`, `Empty`, `EmptyGlobalsTypeInternal`, `EncodedDescriptorDatabase`, `Enum`, `EnumDescriptor`, `EnumDescriptorProto`, `EnumDescriptorProtoGlobalsTypeInternal`, `EnumDescriptorProto_EnumReservedRange`, `EnumDescriptorProto_EnumReservedRangeGlobalsTypeInternal`, `EnumGlobalsTypeInternal`, `EnumOptions`, `EnumOptionsGlobalsTypeInternal`, `EnumValue`, `EnumValueDescriptor`, `EnumValueDescriptorProto`, `EnumValueDescriptorProtoGlobalsTypeInternal`, `EnumValueGlobalsTypeInternal`, `EnumValueOptions`, `EnumValueOptionsGlobalsTypeInternal`, `ExtDeclEnforcementLevel`, `ExtensionRangeOptions`, `ExtensionRangeOptionsGlobalsTypeInternal`, `ExtensionRangeOptions_Declaration`, `ExtensionRangeOptions_DeclarationGlobalsTypeInternal`, `ExtensionRangeOptions_VerificationState`, `FastReflectionMessageMutator`, `FastReflectionStringSetter`, `FeatureResolver`, `FeatureSet`, `FeatureSetDefaults`, `FeatureSetDefaultsGlobalsTypeInternal`, `FeatureSetDefaults_FeatureSetEditionDefault`, `FeatureSetDefaults_FeatureSetEditionDefaultGlobalsTypeInternal`, `FeatureSetGlobalsTypeInternal`, `FeatureSet_EnforceNamingStyle`, `FeatureSet_EnumType`, `FeatureSet_FieldPresence`, `FeatureSet_JsonFormat`, `FeatureSet_MessageEncoding`, `FeatureSet_RepeatedFieldEncoding`, `FeatureSet_Utf8Validation`, `FeatureSet_VisibilityFeature`, `FeatureSet_VisibilityFeatureGlobalsTypeInternal`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility`, `Field`, `FieldDescriptor`, `FieldDescriptorProto`, `FieldDescriptorProtoGlobalsTypeInternal`, `FieldDescriptorProto_Label`, `FieldDescriptorProto_Type`, `FieldGlobalsTypeInternal`, `FieldMask`, `FieldMaskGlobalsTypeInternal`, `FieldOptions`, `FieldOptionsGlobalsTypeInternal`, `FieldOptions_CType`, `FieldOptions_EditionDefault`, `FieldOptions_EditionDefaultGlobalsTypeInternal`, `FieldOptions_FeatureSupport`, `FieldOptions_FeatureSupportGlobalsTypeInternal`, `FieldOptions_JSType`, `FieldOptions_OptionRetention`, `FieldOptions_OptionTargetType`, `Field_Cardinality`, `Field_Kind`, `FileDescriptor`, `FileDescriptorLegacy`, `FileDescriptorProto`, `FileDescriptorProtoGlobalsTypeInternal`, `FileDescriptorSet`, `FileDescriptorSetGlobalsTypeInternal`, `FileDescriptorTables`, `FileOptions`, `FileOptionsGlobalsTypeInternal`, `FileOptions_OptimizeMode`, `FloatValue`, `FloatValueGlobalsTypeInternal`, `GeneratedCodeInfo`, `GeneratedCodeInfoGlobalsTypeInternal`, `GeneratedCodeInfo_Annotation`, `GeneratedCodeInfo_AnnotationGlobalsTypeInternal`, `GeneratedCodeInfo_Annotation_Semantic`, `GeneratedMessageReflectionTestHelper`, `Int32Value`, `Int32ValueGlobalsTypeInternal`, `Int64Value`, `Int64ValueGlobalsTypeInternal`, `ListValue`, `ListValueGlobalsTypeInternal`, `MakeDependent`, `Map`, `MapIterator`, `MapIteratorBase`, `MapKey`, `MapPair`, `MapReflectionTester`, `MapValueConstRef`, `MapValueRef`, `MergedDescriptorDatabase`, `Message`, `MessageFactory`, `MessageLayoutInspector`, `MessageLite`, `MessageOptions`, `MessageOptionsGlobalsTypeInternal`, `Metadata`, `Method`, `MethodDescriptor`, `MethodDescriptorProto`, `MethodDescriptorProtoGlobalsTypeInternal`, `MethodGlobalsTypeInternal`, `MethodOptions`, `MethodOptionsGlobalsTypeInternal`, `MethodOptions_IdempotencyLevel`, `Mixin`, `MixinGlobalsTypeInternal`, `MutableRepeatedFieldRef`, `NoOpAccessListener`, `NullValue`, `OneofDescriptor`, `OneofDescriptorProto`, `OneofDescriptorProtoGlobalsTypeInternal`, `OneofOptions`, `OneofOptionsGlobalsTypeInternal`, `Option`, `OptionGlobalsTypeInternal`, `Reflection`, `RepeatedField`, `RepeatedFieldProxy`, `RepeatedFieldRef`, `RepeatedPtrField`, `ResultCallback`, `ResultCallback1`, `ResultCallback2`, `RpcChannel`, `RpcController`, `Service`, `ServiceDescriptor`, `ServiceDescriptorProto`, `ServiceDescriptorProtoGlobalsTypeInternal`, `ServiceOptions`, `ServiceOptionsGlobalsTypeInternal`, `SimpleDescriptorDatabase`, `SourceCodeInfo`, `SourceCodeInfoGlobalsTypeInternal`, `SourceCodeInfo_Location`, `SourceCodeInfo_LocationGlobalsTypeInternal`, `SourceContext`, `SourceContextGlobalsTypeInternal`, `SourceLocation`, `StringValue`, `StringValueGlobalsTypeInternal`, `Struct`, `StructGlobalsTypeInternal`, `Struct_FieldsEntry_DoNotUse`, `Struct_FieldsEntry_DoNotUseGlobalsTypeInternal`, `Symbol`, `SymbolChecker`, `SymbolCheckerError`, `SymbolCheckerErrorType`, `SymbolVisibility`, `Syntax`, `TextFormat`, `Timestamp`, `TimestampGlobalsTypeInternal`, `Type`, `TypeGlobalsTypeInternal`, `TypeId`, `UInt32Value`, `UInt32ValueGlobalsTypeInternal`, `UInt64Value`, `UInt64ValueGlobalsTypeInternal`, `UninterpretedOption`, `UninterpretedOptionGlobalsTypeInternal`, `UninterpretedOption_NamePart`, `UninterpretedOption_NamePartGlobalsTypeInternal`, `UnknownField`, `UnknownFieldSet`, `Value`, `ValueGlobalsTypeInternal`, `WeakRepeatedPtrField`, `int16`, `int32`, `int64`, `int8`, `is_proto_enum`, `uint`, `uint16`, `uint32`, `uint64`, `uint8` +- `google::protobuf` enumerators of unscoped enumerations (133): `EDITION_1_TEST_ONLY`, `EDITION_2023`, `EDITION_2024`, `EDITION_2026`, `EDITION_2_TEST_ONLY`, `EDITION_99997_TEST_ONLY`, `EDITION_99998_TEST_ONLY`, `EDITION_99999_TEST_ONLY`, `EDITION_LEGACY`, `EDITION_MAX`, `EDITION_PROTO2`, `EDITION_PROTO3`, `EDITION_UNKNOWN`, `EDITION_UNSTABLE`, `ExtensionRangeOptions_VerificationState_DECLARATION`, `ExtensionRangeOptions_VerificationState_UNVERIFIED`, `FeatureSet_EnforceNamingStyle_ENFORCE_NAMING_STYLE_UNKNOWN`, `FeatureSet_EnforceNamingStyle_STYLE2024`, `FeatureSet_EnforceNamingStyle_STYLE2026`, `FeatureSet_EnforceNamingStyle_STYLE_LEGACY`, `FeatureSet_EnumType_CLOSED`, `FeatureSet_EnumType_ENUM_TYPE_UNKNOWN`, `FeatureSet_EnumType_OPEN`, `FeatureSet_FieldPresence_EXPLICIT`, `FeatureSet_FieldPresence_FIELD_PRESENCE_UNKNOWN`, `FeatureSet_FieldPresence_IMPLICIT`, `FeatureSet_FieldPresence_LEGACY_REQUIRED`, `FeatureSet_JsonFormat_ALLOW`, `FeatureSet_JsonFormat_JSON_FORMAT_UNKNOWN`, `FeatureSet_JsonFormat_LEGACY_BEST_EFFORT`, `FeatureSet_MessageEncoding_DELIMITED`, `FeatureSet_MessageEncoding_LENGTH_PREFIXED`, `FeatureSet_MessageEncoding_MESSAGE_ENCODING_UNKNOWN`, `FeatureSet_RepeatedFieldEncoding_EXPANDED`, `FeatureSet_RepeatedFieldEncoding_PACKED`, `FeatureSet_RepeatedFieldEncoding_REPEATED_FIELD_ENCODING_UNKNOWN`, `FeatureSet_Utf8Validation_NONE`, `FeatureSet_Utf8Validation_UTF8_VALIDATION_UNKNOWN`, `FeatureSet_Utf8Validation_VERIFY`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_EXPORT_ALL`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_EXPORT_TOP_LEVEL`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_LOCAL_ALL`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_STRICT`, `FieldDescriptorProto_Label_LABEL_OPTIONAL`, `FieldDescriptorProto_Label_LABEL_REPEATED`, `FieldDescriptorProto_Label_LABEL_REQUIRED`, `FieldDescriptorProto_Type_TYPE_BOOL`, `FieldDescriptorProto_Type_TYPE_BYTES`, `FieldDescriptorProto_Type_TYPE_DOUBLE`, `FieldDescriptorProto_Type_TYPE_ENUM`, `FieldDescriptorProto_Type_TYPE_FIXED32`, `FieldDescriptorProto_Type_TYPE_FIXED64`, `FieldDescriptorProto_Type_TYPE_FLOAT`, `FieldDescriptorProto_Type_TYPE_GROUP`, `FieldDescriptorProto_Type_TYPE_INT32`, `FieldDescriptorProto_Type_TYPE_INT64`, `FieldDescriptorProto_Type_TYPE_MESSAGE`, `FieldDescriptorProto_Type_TYPE_SFIXED32`, `FieldDescriptorProto_Type_TYPE_SFIXED64`, `FieldDescriptorProto_Type_TYPE_SINT32`, `FieldDescriptorProto_Type_TYPE_SINT64`, `FieldDescriptorProto_Type_TYPE_STRING`, `FieldDescriptorProto_Type_TYPE_UINT32`, `FieldDescriptorProto_Type_TYPE_UINT64`, `FieldOptions_CType_CORD`, `FieldOptions_CType_STRING`, `FieldOptions_CType_STRING_PIECE`, `FieldOptions_JSType_JS_NORMAL`, `FieldOptions_JSType_JS_NUMBER`, `FieldOptions_JSType_JS_STRING`, `FieldOptions_OptionRetention_RETENTION_RUNTIME`, `FieldOptions_OptionRetention_RETENTION_SOURCE`, `FieldOptions_OptionRetention_RETENTION_UNKNOWN`, `FieldOptions_OptionTargetType_TARGET_TYPE_ENUM`, `FieldOptions_OptionTargetType_TARGET_TYPE_ENUM_ENTRY`, `FieldOptions_OptionTargetType_TARGET_TYPE_EXTENSION_RANGE`, `FieldOptions_OptionTargetType_TARGET_TYPE_FIELD`, `FieldOptions_OptionTargetType_TARGET_TYPE_FILE`, `FieldOptions_OptionTargetType_TARGET_TYPE_MESSAGE`, `FieldOptions_OptionTargetType_TARGET_TYPE_METHOD`, `FieldOptions_OptionTargetType_TARGET_TYPE_ONEOF`, `FieldOptions_OptionTargetType_TARGET_TYPE_SERVICE`, `FieldOptions_OptionTargetType_TARGET_TYPE_UNKNOWN`, `Field_Cardinality_CARDINALITY_OPTIONAL`, `Field_Cardinality_CARDINALITY_REPEATED`, `Field_Cardinality_CARDINALITY_REQUIRED`, `Field_Cardinality_CARDINALITY_UNKNOWN`, `Field_Cardinality_Field_Cardinality_INT_MAX_SENTINEL_DO_NOT_USE_`, `Field_Cardinality_Field_Cardinality_INT_MIN_SENTINEL_DO_NOT_USE_`, `Field_Kind_Field_Kind_INT_MAX_SENTINEL_DO_NOT_USE_`, `Field_Kind_Field_Kind_INT_MIN_SENTINEL_DO_NOT_USE_`, `Field_Kind_TYPE_BOOL`, `Field_Kind_TYPE_BYTES`, `Field_Kind_TYPE_DOUBLE`, `Field_Kind_TYPE_ENUM`, `Field_Kind_TYPE_FIXED32`, `Field_Kind_TYPE_FIXED64`, `Field_Kind_TYPE_FLOAT`, `Field_Kind_TYPE_GROUP`, `Field_Kind_TYPE_INT32`, `Field_Kind_TYPE_INT64`, `Field_Kind_TYPE_MESSAGE`, `Field_Kind_TYPE_SFIXED32`, `Field_Kind_TYPE_SFIXED64`, `Field_Kind_TYPE_SINT32`, `Field_Kind_TYPE_SINT64`, `Field_Kind_TYPE_STRING`, `Field_Kind_TYPE_UINT32`, `Field_Kind_TYPE_UINT64`, `Field_Kind_TYPE_UNKNOWN`, `FileOptions_OptimizeMode_CODE_SIZE`, `FileOptions_OptimizeMode_LITE_RUNTIME`, `FileOptions_OptimizeMode_SPEED`, `GeneratedCodeInfo_Annotation_Semantic_ALIAS`, `GeneratedCodeInfo_Annotation_Semantic_NONE`, `GeneratedCodeInfo_Annotation_Semantic_SET`, `MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN`, `MethodOptions_IdempotencyLevel_IDEMPOTENT`, `MethodOptions_IdempotencyLevel_NO_SIDE_EFFECTS`, `NESTED_ENUM_STRICT_VIOLATION`, `NESTED_MESSAGE_STRICT_VIOLATION`, `NULL_VALUE`, `NullValue_INT_MAX_SENTINEL_DO_NOT_USE_`, `NullValue_INT_MIN_SENTINEL_DO_NOT_USE_`, `SYNTAX_EDITIONS`, `SYNTAX_PROTO2`, `SYNTAX_PROTO3`, `Syntax_INT_MAX_SENTINEL_DO_NOT_USE_`, `Syntax_INT_MIN_SENTINEL_DO_NOT_USE_`, `VISIBILITY_EXPORT`, `VISIBILITY_LOCAL`, `VISIBILITY_UNSET` +- `google::protobuf` objects (217): `Any_class_data_`, `Any_globals_`, `Api_class_data_`, `Api_globals_`, `BoolValue_class_data_`, `BoolValue_globals_`, `BytesValue_class_data_`, `BytesValue_globals_`, `DescriptorProto_ExtensionRange_class_data_`, `DescriptorProto_ExtensionRange_globals_`, `DescriptorProto_ReservedRange_class_data_`, `DescriptorProto_ReservedRange_globals_`, `DescriptorProto_class_data_`, `DescriptorProto_globals_`, `DoubleValue_class_data_`, `DoubleValue_globals_`, `Duration_class_data_`, `Duration_globals_`, `Edition_MAX`, `Edition_MIN`, `Edition_internal_data_`, `Empty_class_data_`, `Empty_globals_`, `EnumDescriptorProto_EnumReservedRange_class_data_`, `EnumDescriptorProto_EnumReservedRange_globals_`, `EnumDescriptorProto_class_data_`, `EnumDescriptorProto_globals_`, `EnumOptions_class_data_`, `EnumOptions_globals_`, `EnumValueDescriptorProto_class_data_`, `EnumValueDescriptorProto_globals_`, `EnumValueOptions_class_data_`, `EnumValueOptions_globals_`, `EnumValue_class_data_`, `EnumValue_globals_`, `Enum_class_data_`, `Enum_globals_`, `ExtensionRangeOptions_Declaration_class_data_`, `ExtensionRangeOptions_Declaration_globals_`, `ExtensionRangeOptions_VerificationState_VerificationState_ARRAYSIZE`, `ExtensionRangeOptions_VerificationState_VerificationState_MAX`, `ExtensionRangeOptions_VerificationState_VerificationState_MIN`, `ExtensionRangeOptions_VerificationState_internal_data_`, `ExtensionRangeOptions_class_data_`, `ExtensionRangeOptions_globals_`, `FeatureSetDefaults_FeatureSetEditionDefault_class_data_`, `FeatureSetDefaults_FeatureSetEditionDefault_globals_`, `FeatureSetDefaults_class_data_`, `FeatureSetDefaults_globals_`, `FeatureSet_EnforceNamingStyle_EnforceNamingStyle_ARRAYSIZE`, `FeatureSet_EnforceNamingStyle_EnforceNamingStyle_MAX`, `FeatureSet_EnforceNamingStyle_EnforceNamingStyle_MIN`, `FeatureSet_EnforceNamingStyle_internal_data_`, `FeatureSet_EnumType_EnumType_ARRAYSIZE`, `FeatureSet_EnumType_EnumType_MAX`, `FeatureSet_EnumType_EnumType_MIN`, `FeatureSet_EnumType_internal_data_`, `FeatureSet_FieldPresence_FieldPresence_ARRAYSIZE`, `FeatureSet_FieldPresence_FieldPresence_MAX`, `FeatureSet_FieldPresence_FieldPresence_MIN`, `FeatureSet_FieldPresence_internal_data_`, `FeatureSet_JsonFormat_JsonFormat_ARRAYSIZE`, `FeatureSet_JsonFormat_JsonFormat_MAX`, `FeatureSet_JsonFormat_JsonFormat_MIN`, `FeatureSet_JsonFormat_internal_data_`, `FeatureSet_MessageEncoding_MessageEncoding_ARRAYSIZE`, `FeatureSet_MessageEncoding_MessageEncoding_MAX`, `FeatureSet_MessageEncoding_MessageEncoding_MIN`, `FeatureSet_MessageEncoding_internal_data_`, `FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_ARRAYSIZE`, `FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MAX`, `FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MIN`, `FeatureSet_RepeatedFieldEncoding_internal_data_`, `FeatureSet_Utf8Validation_Utf8Validation_ARRAYSIZE`, `FeatureSet_Utf8Validation_Utf8Validation_MAX`, `FeatureSet_Utf8Validation_Utf8Validation_MIN`, `FeatureSet_Utf8Validation_internal_data_`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_ARRAYSIZE`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_MAX`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_MIN`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_internal_data_`, `FeatureSet_VisibilityFeature_class_data_`, `FeatureSet_VisibilityFeature_globals_`, `FeatureSet_class_data_`, `FeatureSet_globals_`, `FieldDescriptorProto_Label_Label_ARRAYSIZE`, `FieldDescriptorProto_Label_Label_MAX`, `FieldDescriptorProto_Label_Label_MIN`, `FieldDescriptorProto_Label_internal_data_`, `FieldDescriptorProto_Type_Type_ARRAYSIZE`, `FieldDescriptorProto_Type_Type_MAX`, `FieldDescriptorProto_Type_Type_MIN`, `FieldDescriptorProto_Type_internal_data_`, `FieldDescriptorProto_class_data_`, `FieldDescriptorProto_globals_`, `FieldMask_class_data_`, `FieldMask_globals_`, `FieldOptions_CType_CType_ARRAYSIZE`, `FieldOptions_CType_CType_MAX`, `FieldOptions_CType_CType_MIN`, `FieldOptions_CType_internal_data_`, `FieldOptions_EditionDefault_class_data_`, `FieldOptions_EditionDefault_globals_`, `FieldOptions_FeatureSupport_class_data_`, `FieldOptions_FeatureSupport_globals_`, `FieldOptions_JSType_JSType_ARRAYSIZE`, `FieldOptions_JSType_JSType_MAX`, `FieldOptions_JSType_JSType_MIN`, `FieldOptions_JSType_internal_data_`, `FieldOptions_OptionRetention_OptionRetention_ARRAYSIZE`, `FieldOptions_OptionRetention_OptionRetention_MAX`, `FieldOptions_OptionRetention_OptionRetention_MIN`, `FieldOptions_OptionRetention_internal_data_`, `FieldOptions_OptionTargetType_OptionTargetType_ARRAYSIZE`, `FieldOptions_OptionTargetType_OptionTargetType_MAX`, `FieldOptions_OptionTargetType_OptionTargetType_MIN`, `FieldOptions_OptionTargetType_internal_data_`, `FieldOptions_class_data_`, `FieldOptions_globals_`, `Field_Cardinality_Cardinality_ARRAYSIZE`, `Field_Cardinality_Cardinality_MAX`, `Field_Cardinality_Cardinality_MIN`, `Field_Cardinality_internal_data_`, `Field_Kind_Kind_ARRAYSIZE`, `Field_Kind_Kind_MAX`, `Field_Kind_Kind_MIN`, `Field_Kind_internal_data_`, `Field_class_data_`, `Field_globals_`, `FileDescriptorProto_class_data_`, `FileDescriptorProto_globals_`, `FileDescriptorSet_class_data_`, `FileDescriptorSet_globals_`, `FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE`, `FileOptions_OptimizeMode_OptimizeMode_MAX`, `FileOptions_OptimizeMode_OptimizeMode_MIN`, `FileOptions_OptimizeMode_internal_data_`, `FileOptions_class_data_`, `FileOptions_globals_`, `FloatValue_class_data_`, `FloatValue_globals_`, `GeneratedCodeInfo_Annotation_Semantic_Semantic_ARRAYSIZE`, `GeneratedCodeInfo_Annotation_Semantic_Semantic_MAX`, `GeneratedCodeInfo_Annotation_Semantic_Semantic_MIN`, `GeneratedCodeInfo_Annotation_Semantic_internal_data_`, `GeneratedCodeInfo_Annotation_class_data_`, `GeneratedCodeInfo_Annotation_globals_`, `GeneratedCodeInfo_class_data_`, `GeneratedCodeInfo_globals_`, `Int32Value_class_data_`, `Int32Value_globals_`, `Int64Value_class_data_`, `Int64Value_globals_`, `ListValue_class_data_`, `ListValue_globals_`, `MessageOptions_class_data_`, `MessageOptions_globals_`, `MethodDescriptorProto_class_data_`, `MethodDescriptorProto_globals_`, `MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE`, `MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX`, `MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN`, `MethodOptions_IdempotencyLevel_internal_data_`, `MethodOptions_class_data_`, `MethodOptions_globals_`, `Method_class_data_`, `Method_globals_`, `Mixin_class_data_`, `Mixin_globals_`, `NullValue_ARRAYSIZE`, `NullValue_MAX`, `NullValue_MIN`, `NullValue_internal_data_`, `OneofDescriptorProto_class_data_`, `OneofDescriptorProto_globals_`, `OneofOptions_class_data_`, `OneofOptions_globals_`, `Option_class_data_`, `Option_globals_`, `ServiceDescriptorProto_class_data_`, `ServiceDescriptorProto_globals_`, `ServiceOptions_class_data_`, `ServiceOptions_globals_`, `SourceCodeInfo_Location_class_data_`, `SourceCodeInfo_Location_globals_`, `SourceCodeInfo_class_data_`, `SourceCodeInfo_globals_`, `SourceContext_class_data_`, `SourceContext_globals_`, `StringValue_class_data_`, `StringValue_globals_`, `Struct_FieldsEntry_DoNotUse_class_data_`, `Struct_FieldsEntry_DoNotUse_globals_`, `Struct_class_data_`, `Struct_globals_`, `SymbolVisibility_ARRAYSIZE`, `SymbolVisibility_MAX`, `SymbolVisibility_MIN`, `SymbolVisibility_internal_data_`, `Syntax_ARRAYSIZE`, `Syntax_MAX`, `Syntax_MIN`, `Syntax_internal_data_`, `Timestamp_class_data_`, `Timestamp_globals_`, `Type_class_data_`, `Type_globals_`, `UInt32Value_class_data_`, `UInt32Value_globals_`, `UInt64Value_class_data_`, `UInt64Value_globals_`, `UninterpretedOption_NamePart_class_data_`, `UninterpretedOption_NamePart_globals_`, `UninterpretedOption_class_data_`, `UninterpretedOption_globals_`, `Value_class_data_`, `Value_globals_` +- `google::protobuf` functions and operators (130): `AbslStringify`, `AllocatedRepeatedPtrFieldBackInserter`, `DoNothing`, `DownCastMessage`, `DownCastToGenerated`, `DynamicCastMessage`, `DynamicCastToGenerated`, `Edition_IsValid`, `Edition_Name`, `Edition_Parse`, `Edition_descriptor`, `EnumerateEnumValues`, `ExtensionRangeOptions_VerificationState_IsValid`, `ExtensionRangeOptions_VerificationState_Name`, `ExtensionRangeOptions_VerificationState_Parse`, `ExtensionRangeOptions_VerificationState_descriptor`, `FeatureSet_EnforceNamingStyle_IsValid`, `FeatureSet_EnforceNamingStyle_Name`, `FeatureSet_EnforceNamingStyle_Parse`, `FeatureSet_EnforceNamingStyle_descriptor`, `FeatureSet_EnumType_IsValid`, `FeatureSet_EnumType_Name`, `FeatureSet_EnumType_Parse`, `FeatureSet_EnumType_descriptor`, `FeatureSet_FieldPresence_IsValid`, `FeatureSet_FieldPresence_Name`, `FeatureSet_FieldPresence_Parse`, `FeatureSet_FieldPresence_descriptor`, `FeatureSet_JsonFormat_IsValid`, `FeatureSet_JsonFormat_Name`, `FeatureSet_JsonFormat_Parse`, `FeatureSet_JsonFormat_descriptor`, `FeatureSet_MessageEncoding_IsValid`, `FeatureSet_MessageEncoding_Name`, `FeatureSet_MessageEncoding_Parse`, `FeatureSet_MessageEncoding_descriptor`, `FeatureSet_RepeatedFieldEncoding_IsValid`, `FeatureSet_RepeatedFieldEncoding_Name`, `FeatureSet_RepeatedFieldEncoding_Parse`, `FeatureSet_RepeatedFieldEncoding_descriptor`, `FeatureSet_Utf8Validation_IsValid`, `FeatureSet_Utf8Validation_Name`, `FeatureSet_Utf8Validation_Parse`, `FeatureSet_Utf8Validation_descriptor`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_IsValid`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_Name`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_Parse`, `FeatureSet_VisibilityFeature_DefaultSymbolVisibility_descriptor`, `FieldDescriptorProto_Label_IsValid`, `FieldDescriptorProto_Label_Name`, `FieldDescriptorProto_Label_Parse`, `FieldDescriptorProto_Label_descriptor`, `FieldDescriptorProto_Type_IsValid`, `FieldDescriptorProto_Type_Name`, `FieldDescriptorProto_Type_Parse`, `FieldDescriptorProto_Type_descriptor`, `FieldOptions_CType_IsValid`, `FieldOptions_CType_Name`, `FieldOptions_CType_Parse`, `FieldOptions_CType_descriptor`, `FieldOptions_JSType_IsValid`, `FieldOptions_JSType_Name`, `FieldOptions_JSType_Parse`, `FieldOptions_JSType_descriptor`, `FieldOptions_OptionRetention_IsValid`, `FieldOptions_OptionRetention_Name`, `FieldOptions_OptionRetention_Parse`, `FieldOptions_OptionRetention_descriptor`, `FieldOptions_OptionTargetType_IsValid`, `FieldOptions_OptionTargetType_Name`, `FieldOptions_OptionTargetType_Parse`, `FieldOptions_OptionTargetType_descriptor`, `Field_Cardinality_IsValid`, `Field_Cardinality_Name`, `Field_Cardinality_Parse`, `Field_Cardinality_descriptor`, `Field_Kind_IsValid`, `Field_Kind_Name`, `Field_Kind_Parse`, `Field_Kind_descriptor`, `FileOptions_OptimizeMode_IsValid`, `FileOptions_OptimizeMode_Name`, `FileOptions_OptimizeMode_Parse`, `FileOptions_OptimizeMode_descriptor`, `GOOGLE_UNALIGNED_LOAD16`, `GOOGLE_UNALIGNED_LOAD32`, `GOOGLE_UNALIGNED_LOAD64`, `GOOGLE_UNALIGNED_STORE16`, `GOOGLE_UNALIGNED_STORE32`, `GOOGLE_UNALIGNED_STORE64`, `GeneratedCodeInfo_Annotation_Semantic_IsValid`, `GeneratedCodeInfo_Annotation_Semantic_Name`, `GeneratedCodeInfo_Annotation_Semantic_Parse`, `GeneratedCodeInfo_Annotation_Semantic_descriptor`, `GetEnumDescriptor`, `GetExtensionReflection`, `LinkExtensionReflection`, `LinkMessageReflection`, `MethodOptions_IdempotencyLevel_IsValid`, `MethodOptions_IdempotencyLevel_Name`, `MethodOptions_IdempotencyLevel_Parse`, `MethodOptions_IdempotencyLevel_descriptor`, `NewCallback`, `NewPermanentCallback`, `NullValue_IsValid`, `NullValue_Name`, `NullValue_Parse`, `NullValue_descriptor`, `ProtobufInternalGetEnumDescriptor`, `RepeatedFieldBackInserter`, `RepeatedPtrFieldBackInserter`, `ShortFormat`, `ShutdownProtobufLibrary`, `SymbolVisibility_IsValid`, `SymbolVisibility_Name`, `SymbolVisibility_Parse`, `SymbolVisibility_descriptor`, `Syntax_IsValid`, `Syntax_Name`, `Syntax_Parse`, `Syntax_descriptor`, `UnsafeArenaAllocatedRepeatedPtrFieldBackInserter`, `Utf8Format`, `c_sort`, `c_stable_sort`, `erase`, `erase_if`, `ghtonl`, `sort`, `stable_sort` +- `google::protobuf` names protobuf re-declares from another namespace (2): `AbslParseFlag`, `AbslUnparseFlag` +- `google::protobuf::internal` operators of public types declared in an implementation namespace, for argument-dependent lookup (1): `operator|` + +## mcpplibs.mwrap.protobuf.io + +- `google::protobuf` types (1): `ZeroCopyCodedInputStream` +- `google::protobuf::io` types (26): `AnnotationCollector`, `AnnotationProtoCollector`, `ArrayInputStream`, `ArrayOutputStream`, `CodedInputStream`, `CodedOutputStream`, `ColumnNumber`, `ConcatenatingInputStream`, `CopyingInputStream`, `CopyingInputStreamAdaptor`, `CopyingOutputStream`, `CopyingOutputStreamAdaptor`, `CordInputStream`, `CordOutputStream`, `EpsCopyOutputStream`, `ErrorCollector`, `FileInputStream`, `FileOutputStream`, `IstreamInputStream`, `LimitingInputStream`, `OstreamOutputStream`, `Printer`, `StringOutputStream`, `Tokenizer`, `ZeroCopyInputStream`, `ZeroCopyOutputStream` +- `google::protobuf::io` functions and operators (6): `NoLocaleStrtod`, `SafeDoubleToFloat`, `SimpleDtoa`, `SimpleFtoa`, `as_string_data`, `mutable_string_data` + +## mcpplibs.mwrap.protobuf.util + +- `google::protobuf` functions and operators (17): `operator!=`, `operator%`, `operator%=`, `operator*`, `operator*=`, `operator+`, `operator+=`, `operator-`, `operator-=`, `operator/`, `operator/=`, `operator<`, `operator<<`, `operator<=`, `operator==`, `operator>`, `operator>=` +- `google::protobuf::json` types (2): `ParseOptions`, `PrintOptions` +- `google::protobuf::json` functions and operators (8): `BinaryToJsonStream`, `BinaryToJsonString`, `JsonStreamToMessage`, `JsonStringToMessage`, `JsonToBinaryStream`, `JsonToBinaryString`, `MessageToJsonStream`, `MessageToJsonString` +- `google::protobuf::util` types (10): `DefaultFieldComparator`, `FieldComparator`, `FieldContext`, `FieldMaskUtil`, `JsonParseOptions`, `JsonPrintOptions`, `MessageDifferencer`, `SimpleFieldComparator`, `TimeUtil`, `TypeResolver` +- `google::protobuf::util` functions and operators (8): `ConvertDescriptorToType`, `NewTypeResolverForDescriptorPool`, `ParseDelimitedFromCodedStream`, `ParseDelimitedFromZeroCopyStream`, `SerializeDelimitedToCodedStream`, `SerializeDelimitedToFileDescriptor`, `SerializeDelimitedToOstream`, `SerializeDelimitedToZeroCopyStream` +- `google::protobuf::util` names protobuf re-declares from another namespace (6): `BinaryToJsonStream`, `BinaryToJsonString`, `JsonStringToMessage`, `JsonToBinaryStream`, `JsonToBinaryString`, `MessageToJsonString` + +## mcpplibs.mwrap.protobuf.compiler + +- `google::protobuf::compiler` types (7): `DiskSourceTree`, `Importer`, `MultiFileErrorCollector`, `Parser`, `SourceLocationTable`, `SourceTree`, `SourceTreeDescriptorDatabase` + +## mcpplibs.mwrap.protobuf.io.gzip + +- `google::protobuf::io` types (2): `GzipInputStream`, `GzipOutputStream` + +## Not exported + +- Headers: + - `google/protobuf/arena_test_util.h`: test support + - `google/protobuf/map_test_util.h`: test support (needs test protos) + - `google/protobuf/reflection_tester.h`: test support (needs test protos) + - `google/protobuf/test_util.h`: test support + - `google/protobuf/test_util2.h`: test support + - `google/protobuf/test_util_lite.h`: test support + - `google/protobuf/test_textproto.h`: test support (needs GoogleMock) + - `google/protobuf/wire_format_unittest.h`: test support + - `google/protobuf/descriptor_test_utils.h`: test support + - `google/protobuf/internal_visibility_for_testing.h`: test support + - `google/protobuf/unredacted_debug_format_for_test.h`: test support + - `google/protobuf/io/test_zero_copy_stream.h`: test support + - `google/protobuf/io/io_win32.h`: Windows-only portability layer of the compiler (namespace io::win32) + - `google/protobuf/util/internal_timeval.h`: implementation detail +- Implementation namespaces: `google::protobuf::compiler::generator_internal`, `google::protobuf::internal`, `google::protobuf::internal::big_endian`, `google::protobuf::internal::cleanup`, `google::protobuf::internal::cpp`, `google::protobuf::internal::detail`, `google::protobuf::internal::field_layout`, `google::protobuf::internal::generated_enum`, `google::protobuf::internal::little_endian`, `google::protobuf::internal::string_util`, `google::protobuf::io::zc_sink_internal` +- Namespace `pb`: the C++ feature-set extension of editions (pb::CppFeatures, from cpp_features.proto; extension_set.h forward-declares it), used by protoc and generated code: not exported, so a module-only translation unit keeps the common `namespace pb = google::protobuf;`; declares it +- Names: + - `google::protobuf::kint32max`: internal linkage: declared again with its value in mcpplibs::mwrap::protobuf + - `google::protobuf::kint32min`: internal linkage: declared again with its value in mcpplibs::mwrap::protobuf + - `google::protobuf::kint64max`: internal linkage: declared again with its value in mcpplibs::mwrap::protobuf + - `google::protobuf::kint64min`: internal linkage: declared again with its value in mcpplibs::mwrap::protobuf + - `google::protobuf::kuint32max`: internal linkage: declared again with its value in mcpplibs::mwrap::protobuf + - `google::protobuf::kuint64max`: internal linkage: declared again with its value in mcpplibs::mwrap::protobuf + - `google::protobuf::TestUtil::ReflectionTester`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::compiler::CodeGenerator`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::compiler::CommandLineInterface`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::compiler::cpp::CalculateFieldDescriptorRepeatedType`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::compiler::cpp::CppGenerator`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::compiler::cpp::Formatter`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::compiler::cpp::MessageTableTester`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::compiler::java::MemoizeProjection`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::descriptor_unittest::DescriptorPoolMemoizationTest`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::descriptor_unittest::DescriptorTest`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::descriptor_unittest::FeaturesTest`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::descriptor_unittest::ValidationErrorTest`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::expr::CelMapReflectionFriend`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::expr::SudoMapReflectionFriend`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::python::MapReflectionFriend`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::python::MessageReflectionFriend`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::python::cmessage::PythonFieldValuePrinter`: only declared (a friend of a protobuf class): defined by another project or by protoc + - `google::protobuf::rust::PtrAndLen`: only declared (a friend of a protobuf class): defined by another project or by protoc + +## Macros + +- Constants in `mcpplibs::mwrap::protobuf::macros`: `GOOGLE_PROTOBUF_VERSION`, `GOOGLE_PROTOBUF_VERSION_SUFFIX`, `PROTOBUF_OSS_VERSION`, `PROTOBUF_OSS_VERSION_SUFFIX`, `PROTOBUF_VERSION`, `PROTOBUF_VERSION_SUFFIX` +- Functions: `GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG` +- Through `` only: + - `GOOGLE_PROTOBUF_ANY_H__`: header guard + - `GOOGLE_PROTOBUF_ARCH_64_BIT`: describes the target (GOOGLE_PROTOBUF_ARCH_*): a switch for #if, different on each platform + - `GOOGLE_PROTOBUF_ARCH_X64`: describes the target (GOOGLE_PROTOBUF_ARCH_*): a switch for #if, different on each platform + - `GOOGLE_PROTOBUF_ARENASTRING_H__`: header guard + - `GOOGLE_PROTOBUF_ARENAZ_SAMPLER_H__`: header guard + - `GOOGLE_PROTOBUF_ARENA_ALIGN_H__`: header guard + - `GOOGLE_PROTOBUF_ARENA_ALLOCATION_POLICY_H__`: header guard + - `GOOGLE_PROTOBUF_ARENA_CLEANUP_H__`: header guard + - `GOOGLE_PROTOBUF_ARENA_H__`: header guard + - `GOOGLE_PROTOBUF_ASSERT_RETURN`: function-like: generates code or attributes, or returns from its caller + - `GOOGLE_PROTOBUF_COMMON_H__`: header guard + - `GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__`: header guard + - `GOOGLE_PROTOBUF_COMPILER_PARSER_H__`: header guard + - `GOOGLE_PROTOBUF_CPP_EDITION_DEFAULTS_H__`: header guard + - `GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__`: header guard + - `GOOGLE_PROTOBUF_DESCRIPTOR_H__`: header guard + - `GOOGLE_PROTOBUF_DESCRIPTOR_LEGACY_H__`: header guard + - `GOOGLE_PROTOBUF_DESCRIPTOR_LITE_H__`: header guard + - `GOOGLE_PROTOBUF_DESCRIPTOR_VISITOR_H__`: header guard + - `GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__`: header guard + - `GOOGLE_PROTOBUF_ENDIAN_H__`: header guard + - `GOOGLE_PROTOBUF_EXPLICITLY_CONSTRUCTED_H__`: header guard + - `GOOGLE_PROTOBUF_EXTENSION_SET_H__`: header guard + - `GOOGLE_PROTOBUF_EXTENSION_SET_INL_H__`: header guard + - `GOOGLE_PROTOBUF_FEATURE_RESOLVER_H__`: header guard + - `GOOGLE_PROTOBUF_FIELD_ACCESS_LISTENER_H__`: header guard + - `GOOGLE_PROTOBUF_FIELD_WITH_ARENA_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_DECL_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_GEN_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_IMPL_H__`: header guard + - `GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__`: header guard + - `GOOGLE_PROTOBUF_HAS_BITS_H__`: header guard + - `GOOGLE_PROTOBUF_HAS_CEL_MAP_REFLECTION_FRIEND`: empty: an annotation or a switch for #ifdef + - `GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__`: header guard + - `GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__`: header guard + - `GOOGLE_PROTOBUF_INTERNAL_FEATURE_HELPER_H__`: header guard + - `GOOGLE_PROTOBUF_INTERNAL_METADATA_LOCATOR_H__`: header guard + - `GOOGLE_PROTOBUF_INTERNAL_VISIBILITY_H__`: header guard + - `GOOGLE_PROTOBUF_IO_CODED_STREAM_H__`: header guard + - `GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__`: header guard + - `GOOGLE_PROTOBUF_IO_PRINTER_H__`: header guard + - `GOOGLE_PROTOBUF_IO_STRTOD_H__`: header guard + - `GOOGLE_PROTOBUF_IO_TOKENIZER_H__`: header guard + - `GOOGLE_PROTOBUF_IO_ZERO_COPY_SINK_H__`: header guard + - `GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__`: header guard + - `GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__`: header guard + - `GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__`: header guard + - `GOOGLE_PROTOBUF_JSON_JSON_H__`: header guard + - `GOOGLE_PROTOBUF_MAP_ENTRY_H__`: header guard + - `GOOGLE_PROTOBUF_MAP_FIELD_H__`: header guard + - `GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__`: header guard + - `GOOGLE_PROTOBUF_MAP_H__`: header guard + - `GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__`: header guard + - `GOOGLE_PROTOBUF_MESSAGE_H__`: header guard + - `GOOGLE_PROTOBUF_MESSAGE_LITE_H__`: header guard + - `GOOGLE_PROTOBUF_METADATA_H__`: header guard + - `GOOGLE_PROTOBUF_METADATA_LITE_H__`: header guard + - `GOOGLE_PROTOBUF_MICRO_STRING_H__`: header guard + - `GOOGLE_PROTOBUF_PARSER_ASSERT`: function-like: generates code or attributes, or returns from its caller + - `GOOGLE_PROTOBUF_PARSE_CONTEXT_H__`: header guard + - `GOOGLE_PROTOBUF_PLATFORM_MACROS_H_`: header guard + - `GOOGLE_PROTOBUF_PORT_H__`: header guard + - `GOOGLE_PROTOBUF_RAW_PTR_H__`: header guard + - `GOOGLE_PROTOBUF_REFLECTION_H__`: header guard + - `GOOGLE_PROTOBUF_REFLECTION_INTERNAL_H__`: header guard + - `GOOGLE_PROTOBUF_REFLECTION_MODE_H__`: header guard + - `GOOGLE_PROTOBUF_REFLECTION_OPS_H__`: header guard + - `GOOGLE_PROTOBUF_REFLECTION_VISIT_FIELDS_H__`: header guard + - `GOOGLE_PROTOBUF_REFLECTION_VISIT_FIELD_INFO_H__`: header guard + - `GOOGLE_PROTOBUF_REPEATED_FIELD_H__`: header guard + - `GOOGLE_PROTOBUF_REPEATED_FIELD_PROXY_H__`: header guard + - `GOOGLE_PROTOBUF_REPEATED_FIELD_PROXY_ITERATOR_H__`: header guard + - `GOOGLE_PROTOBUF_REPEATED_FIELD_PROXY_TRAITS_H__`: header guard + - `GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__`: header guard + - `GOOGLE_PROTOBUF_RUNTIME_DEPRECATED`: function-like: generates code or attributes, or returns from its caller + - `GOOGLE_PROTOBUF_RUNTIME_VERSION_H__`: header guard + - `GOOGLE_PROTOBUF_SERIAL_ARENA_H__`: header guard + - `GOOGLE_PROTOBUF_SERVICE_H__`: header guard + - `GOOGLE_PROTOBUF_STRING_BLOCK_H__`: header guard + - `GOOGLE_PROTOBUF_STRING_MEMBER_ROBBER_H__`: header guard + - `GOOGLE_PROTOBUF_STUBS_CALLBACK_H_`: header guard + - `GOOGLE_PROTOBUF_STUBS_PORT_H_`: header guard + - `GOOGLE_PROTOBUF_SYMBOL_CHECKER_H__`: header guard + - `GOOGLE_PROTOBUF_TEXT_FORMAT_H__`: header guard + - `GOOGLE_PROTOBUF_THREAD_SAFE_ARENA_H__`: header guard + - `GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__`: header guard + - `GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__`: header guard + - `GOOGLE_PROTOBUF_VARINT_SHUFFLE_H__`: header guard + - `GOOGLE_PROTOBUF_VERIFY_VERSION`: a statement of generated code (calls the library's internals) + - `GOOGLE_PROTOBUF_WIRE_FORMAT_H__`: header guard + - `GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__`: header guard + - `LIBPROTOBUF_EXPORT`: empty: an annotation or a switch for #ifdef + - `LIBPROTOC_EXPORT`: empty: an annotation or a switch for #ifdef + - `PROTOBUF_DEFINE_NAME_ACCESSOR`: function-like: generates code or attributes, or returns from its caller + - `PROTOBUF_DEFINE_OPTIONS_ACCESSOR`: function-like: generates code or attributes, or returns from its caller + - `PROTOBUF_FUTURE_ADD_EARLY_NODISCARD`: annotation or an internal parameter list of generated code + - `PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED`: annotation or an internal parameter list of generated code + - `PROTOBUF_FUTURE_ADD_NODISCARD`: empty: an annotation or a switch for #ifdef + - `PROTOBUF_INTERNAL_CPP_EDITION_DEFAULTS`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_DIRECT_LAZY_FIELD_IN_EXTENSION_SET`: empty: an annotation or a switch for #ifdef + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fany_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fcpp_5ffeatures_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fdescriptor_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fduration_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fempty_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ffield_5fmask_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fsource_5fcontext_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fstruct_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftimestamp_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftype_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fwrappers_2eproto`: annotation or an internal parameter list of generated code + - `PROTOBUF_RUNTIME_DEPRECATED`: function-like: generates code or attributes, or returns from its caller + - `PROTOBUF_TC_PARAM_NO_DATA_DECL`: annotation or an internal parameter list of generated code + - `PROTOBUF_TC_PARAM_NO_DATA_PASS`: annotation or an internal parameter list of generated code + - `PROTOBUF_TC_PARAM_PASS`: annotation or an internal parameter list of generated code + - `PROTOBUF_TC_PARSE_FUNCTION_LIST`: annotation or an internal parameter list of generated code + - `PROTOBUF_TC_PARSE_FUNCTION_LIST_END_GROUP`: function-like: generates code or attributes, or returns from its caller + - `PROTOBUF_TC_PARSE_FUNCTION_LIST_PACKED`: function-like: generates code or attributes, or returns from its caller + - `PROTOBUF_TC_PARSE_FUNCTION_LIST_REPEATED`: function-like: generates code or attributes, or returns from its caller + - `PROTOBUF_TC_PARSE_FUNCTION_LIST_SINGLE`: function-like: generates code or attributes, or returns from its caller + - `google_2fprotobuf_2fany_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fapi_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fduration_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fempty_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2ffield_5fmask_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fsource_5fcontext_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fstruct_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2ftimestamp_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2ftype_2eproto_2epb_2eh`: header guard + - `google_2fprotobuf_2fwrappers_2eproto_2epb_2eh`: header guard diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 0000000..0acd59c --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,89 @@ +# Using mcpplibs.mwrap.protobuf + +[README](../README.md) · [every exported name](api.md) + +`import mcpplibs.mwrap.protobuf;` declares protobuf 35.1's C++ API as its headers do: the +names are the upstream entities, in the namespaces upstream declares them in +(`google::protobuf`, `::io`, `::util`, `::json`, `::compiler`). The library is +`compat.protobuf` 35.1 (libprotobuf and utf8_range) over `compat.abseil` 20250512.1. + +## Modules + +| Module | Holds | +|---|---| +| `mcpplibs.mwrap.protobuf` | `Message`, `MessageLite`, `Reflection`, `Descriptor` and the other descriptors, `DescriptorPool`, `DynamicMessageFactory`, `Arena`, `RepeatedField`, `RepeatedPtrField`, `Map`, `TextFormat`, `UnknownFieldSet`, the well-known types (`Any`, `Timestamp`, `Duration`, `Struct`, `Value`, `FieldMask`, `Empty`, the wrappers, `Api`, `Type` …) and `descriptor.proto`'s messages; re-exports the four below | +| `mcpplibs.mwrap.protobuf.io` | `CodedInputStream`, `CodedOutputStream`, the zero-copy streams, `Tokenizer`, `ErrorCollector`, `Printer` | +| `mcpplibs.mwrap.protobuf.util` | `json::MessageToJsonString` / `JsonStringToMessage` (also as `util::`), `MessageDifferencer`, `TimeUtil` with the Timestamp/Duration operators, `FieldMaskUtil`, `SerializeDelimitedTo*` / `ParseDelimitedFrom*`, `TypeResolver` | +| `mcpplibs.mwrap.protobuf.compiler` | `Importer`, `DiskSourceTree`, `SourceTree`, `Parser`, `MultiFileErrorCollector` | +| `mcpplibs.mwrap.protobuf.macros` | the version macros as constants, `GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG` as a constexpr function | +| `mcpplibs.mwrap.protobuf.io.gzip` | `GzipInputStream`, `GzipOutputStream`: only with the `gzip` feature (compat.protobuf defines them only then); import it by name | + +Names in implementation namespaces (`internal`) are not exported, except their operators, +which apply to public types and are found by argument-dependent lookup. The constants +`kint32max` … `kuint64max` (`static` in the headers) are declared again in +`mcpplibs::mwrap::protobuf`. + +## Generated code: the codegen feature and protogen + +```toml +[dependencies] +mcpplibs.mwrap.protobuf = { version = "35.1", features = ["codegen"] } +``` + +`codegen` builds protoc for the build machine from the protobuf release the program links +(so the generator and the runtime cannot differ) and hands the project the `protogen` +rule. `build.mcpp`: + +```cpp +import mcpp; +import protogen; +int main() { return protogen::generate_all() ? 0 : 1; } +``` + +Every `.proto` under `proto/` becomes one build-graph edge; `proto/a/b.proto` generates +`a/b.pb.{h,cc}`, the `.pb.cc` enter the build and the header directory becomes an include +directory. Options (the same names as grpc-m's `grpcgen`, whose generic layer this is): + +| Option | Effect | +|---|---| +| `.proto_dir` | the directory scanned (default `proto`) | +| `.extra_dirs` | further trees to generate from, each also an `-I` root | +| `.imports` | `-I` roots searched only (their code comes from elsewhere) | +| `.lite` | `--cpp_out=lite:`: `MessageLite` classes, no descriptors or reflection | +| `.descriptor_set` | also `.pb.desc`, the FileDescriptorSet with imports | +| `.protoc_args` | any other protoc flag | +| `.plugins` | protoc plugins: `protogen::plugin{name, binary, params, suffixes}` | + +`generate({"name"})` names files; `plan_all()` returns the edges for inspection or editing +before `submit()`. A gRPC project uses grpc-m's `grpcgen` instead, which adds the gRPC +plugin. On Windows compat.protobuf 35.1 does not build protoc, so `codegen` fails there with +a message; generate on Linux or macOS. + +A translation unit that includes generated headers and imports the module includes +`` first — every header the modules include — then the +generated headers, then imports. With GCC every `#include` must come before the first +`import`, and a translation unit that includes fewer headers than the modules did can read +a declaration of the module as conflicting with its own. Clang accepts both orders. +Generated code declares a top-level namespace `pb` (`pb::CppFeatures`); the module does not +export it, so a module-only translation unit may use `namespace pb = google::protobuf;`. + +## Abseil + +protobuf's API uses Abseil types: `absl::Status` and `absl::StatusOr` (JSON, TextFormat +errors), `absl::string_view` (= `std::string_view`), `absl::Cord`. No `absl` name is +exported here; a value of these types is used through its members without naming it +(`if (!json::MessageToJsonString(m, &s).ok())`). To name a type, import +`mcpplibs.mwrap.abseil` (the same entities, linked once) or include its header. + +## Macros + +`mcpplibs::mwrap::protobuf::macros` holds `GOOGLE_PROTOBUF_VERSION`, +`PROTOBUF_VERSION` (7035001) and their `_SUFFIX` strings, and +`GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(number, wire_type)`. The others — +`GOOGLE_PROTOBUF_VERIFY_VERSION` (a statement), the `GOOGLE_PROTOBUF_ARCH_*` switches, +annotations — come from ``, included before the imports. + +## Platforms + +Linux (x86_64, aarch64), macOS, Windows (x86_64) and the Web (wasm32-emscripten): the +runtime everywhere; `codegen` where protoc builds (not Windows). diff --git a/examples/codegen/build.mcpp b/examples/codegen/build.mcpp new file mode 100644 index 0000000..5f5b1ab --- /dev/null +++ b/examples/codegen/build.mcpp @@ -0,0 +1,9 @@ +// Code generation: every .proto under proto/ becomes one build-graph edge that +// runs protoc (C++ messages, .pb.h / .pb.cc). Add a .proto to +// proto/ and build; nothing here changes. +import mcpp; +import protogen; + +int main() { + return protogen::generate_all() ? 0 : 1; +} diff --git a/examples/codegen/mcpp.toml b/examples/codegen/mcpp.toml new file mode 100644 index 0000000..b81345c --- /dev/null +++ b/examples/codegen/mcpp.toml @@ -0,0 +1,14 @@ +# templates/codegen instantiated, with the package by path: CI builds and runs +# it, which is how the codegen path (protoc, protogen, generated code with the +# module) is tested on every native row that builds protoc. build.mcpp, +# proto/ and src/main.cpp must equal the template's (CI checks it). +[package] +name = "codegen-example" +version = "0.1.0" + +[targets.codegen-example] +kind = "bin" +main = "src/main.cpp" + +[dependencies] +mcpplibs.mwrap.protobuf = { path = "../..", features = ["codegen"] } diff --git a/examples/codegen/proto/addressbook.proto b/examples/codegen/proto/addressbook.proto new file mode 100644 index 0000000..430935c --- /dev/null +++ b/examples/codegen/proto/addressbook.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package tutorial; + +import "google/protobuf/timestamp.proto"; + +message Person { + string name = 1; + int32 id = 2; + string email = 3; + + enum PhoneType { + PHONE_TYPE_UNSPECIFIED = 0; + PHONE_TYPE_MOBILE = 1; + PHONE_TYPE_HOME = 2; + PHONE_TYPE_WORK = 3; + } + + message PhoneNumber { + string number = 1; + PhoneType type = 2; + } + + repeated PhoneNumber phones = 4; + google.protobuf.Timestamp last_updated = 5; +} + +message AddressBook { + repeated Person people = 1; +} diff --git a/examples/codegen/src/main.cpp b/examples/codegen/src/main.cpp new file mode 100644 index 0000000..4a131ee --- /dev/null +++ b/examples/codegen/src/main.cpp @@ -0,0 +1,36 @@ +// Generated code with the module: addressbook.pb.h is produced from +// proto/addressbook.proto by protoc during the build. A translation unit that +// includes generated headers includes the prelude first (every header the +// modules include), then the generated ones, then imports (GCC needs every +// #include before the first import). +#include +#include "addressbook.pb.h" + +import std; +import mcpplibs.mwrap.protobuf; + +namespace gpb = google::protobuf; // (generated code declares its own `pb`) + +int main() { + tutorial::AddressBook book; + tutorial::Person* ada = book.add_people(); + ada->set_name("Ada Lovelace"); + ada->set_id(1815); + ada->set_email("ada@example.org"); + tutorial::Person::PhoneNumber* phone = ada->add_phones(); + phone->set_number("+44 20 0000 0000"); + phone->set_type(tutorial::Person::PHONE_TYPE_HOME); + gpb::util::TimeUtil::FromString("1843-07-01T00:00:00Z", ada->mutable_last_updated()); + + const std::string wire = book.SerializeAsString(); + std::string json; + (void)gpb::json::MessageToJsonString(book, &json); + std::println("{} bytes on the wire\n{}", wire.size(), json); + + tutorial::AddressBook back; + const bool ok = back.ParseFromString(wire) && gpb::util::MessageDifferencer::Equals(book, back) && + back.people(0).phones(0).type() == tutorial::Person::PHONE_TYPE_HOME && + tutorial::Person::descriptor()->full_name() == "tutorial.Person"; + std::println("{}", ok ? "read back: equal" : "read back: DIFFERENT"); + return ok ? 0 : 1; +} diff --git a/examples/gzip/mcpp.toml b/examples/gzip/mcpp.toml new file mode 100644 index 0000000..9257653 --- /dev/null +++ b/examples/gzip/mcpp.toml @@ -0,0 +1,12 @@ +# The `gzip` feature: GzipOutputStream / GzipInputStream (compat.protobuf over +# compat.zlib) through import mcpplibs.mwrap.protobuf.io.gzip. CI runs it. +[package] +name = "gzip-example" +version = "0.1.0" + +[targets.gzip-example] +kind = "bin" +main = "src/main.cpp" + +[dependencies] +mcpplibs.mwrap.protobuf = { path = "../..", features = ["gzip"] } diff --git a/examples/gzip/src/main.cpp b/examples/gzip/src/main.cpp new file mode 100644 index 0000000..a7ca68c --- /dev/null +++ b/examples/gzip/src/main.cpp @@ -0,0 +1,29 @@ +// A message through a gzip stream and back, with the package's `gzip` feature. +import std; +import mcpplibs.mwrap.protobuf; +import mcpplibs.mwrap.protobuf.io.gzip; + +namespace pb = google::protobuf; + +int main() { + pb::Struct object; + for (int i = 0; i < 200; ++i) (*object.mutable_fields())[std::format("key{}", i)].set_string_value(std::string(32, 'x')); + const std::string plain = object.SerializeAsString(); + + std::string compressed; + { + pb::io::StringOutputStream sink(&compressed); + pb::io::GzipOutputStream::Options options; + options.format = pb::io::GzipOutputStream::GZIP; + pb::io::GzipOutputStream gzip(&sink, options); + if (!object.SerializeToZeroCopyStream(&gzip) || !gzip.Close()) return 1; + } + pb::io::ArrayInputStream source(compressed.data(), static_cast(compressed.size())); + pb::io::GzipInputStream gunzip(&source, pb::io::GzipInputStream::GZIP); + pb::Struct back; + const bool ok = back.ParseFromZeroCopyStream(&gunzip) && pb::util::MessageDifferencer::Equals(object, back) && + static_cast(compressed[0]) == 0x1f && static_cast(compressed[1]) == 0x8b && + compressed.size() < plain.size(); + std::println("{} bytes, gzip {} bytes, read back {}", plain.size(), compressed.size(), ok ? "equal" : "DIFFERENT"); + return ok ? 0 : 1; +} diff --git a/include/mwrap/protobuf/macros.hpp b/include/mwrap/protobuf/macros.hpp new file mode 100644 index 0000000..f7a3ab5 --- /dev/null +++ b/include/mwrap/protobuf/macros.hpp @@ -0,0 +1,6 @@ +// — protobuf's macros (GOOGLE_PROTOBUF_VERIFY_VERSION, the GOOGLE_PROTOBUF_ARCH_* +// switches …), which a module cannot export: every public header the modules include, in their order. Include +// it BEFORE `import mcpplibs.mwrap.protobuf;` (GCC requires the includes of a translation unit to come before its +// imports). Written by tools/surface.py. +#pragma once +#include diff --git a/include/mwrap/protobuf/prelude.hpp b/include/mwrap/protobuf/prelude.hpp new file mode 100644 index 0000000..1c9f13f --- /dev/null +++ b/include/mwrap/protobuf/prelude.hpp @@ -0,0 +1,110 @@ +// — every header the modules of mcpplibs.mwrap.protobuf include in their global module +// fragments (without gzip_stream.h, which only the `gzip` feature's module includes), in their order. +// +// A translation unit that includes a generated `.pb.h` and imports the module includes this header first: +// with GCC every #include must come before the first import, and a translation unit that includes fewer +// of these headers than the modules did can read a module's declaration as conflicting with its own +// (descriptor.h). Written by tools/surface.py. +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/mcpp.toml b/mcpp.toml new file mode 100644 index 0000000..f0cea93 --- /dev/null +++ b/mcpp.toml @@ -0,0 +1,83 @@ +# Module wrapper; upstream API preserved. Policy: mcpp-index/docs/mwrap.md. +[package] +namespace = "mcpplibs.mwrap" +name = "protobuf" +version = "35.1" +description = "Protocol Buffers 35.1 C++ modules for mcpp (import mcpplibs.mwrap.protobuf;): messages, descriptors, reflection, the well-known types, JSON and text formats, streams, run-time .proto parsing; protoc code generation through the codegen feature" +license = "Apache-2.0" +authors = ["mcpp-community"] +repo = "https://github.com/mcpplibs/protobuf-m" +platforms = ["linux", "macos", "windows", "emscripten"] + +[targets.protobuf] +kind = "lib" + +[build] +# The modules only: the library is compat.protobuf (over compat.abseil), built +# from the same release. src/protobuf.cppm, io, util, compiler, macros and +# gzip/io_gzip.cppm are written by tools/surface.py. +sources = ["src/*.cppm"] +# and . +include_dirs = ["include"] + +[dependencies] +compat.protobuf = "35.1" + +[dev-dependencies] +compat.gtest = "1.15.2" +# tests/abseil_identity_test.cpp: protobuf's absl::Status is mcpplibs.mwrap.abseil's. +mcpplibs.mwrap.abseil = "20250512.1" + +# GzipInputStream / GzipOutputStream: compat.protobuf compiles them only with +# its gzip feature (over compat.zlib), so their module exists only here. +[features.gzip] +sources = ["src/gzip/io_gzip.cppm"] + +[feature-deps.gzip] +compat.protobuf = { version = "35.1", features = ["gzip"] } + +# upb, protobuf's C runtime, from the same tarball: what gRPC links. Forwarded +# so that a program with both resolves one protobuf with the union of features. +[feature-deps.upb] +compat.protobuf = { version = "35.1", features = ["upb"] } + +# Code generation: protoc, built by mcpp for the build machine from the same +# release the program links (it needs upb), handed to the consumer with the +# rule package below. Not on Windows: compat.protobuf 35.1 does not build +# protoc there. +[feature-deps.codegen] +compat.protobuf = { version = "35.1", features = ["upb"], tools = ["protoc"], reexport = true } + +# The rule, as an importable host module (`import protogen;` in build.mcpp). +[build-dependencies] +mcpplibs.protogen = { path = "rules", host-module = true, reexport = true } + +[package.metadata.mwrap] +upstream-version = "35.1" + +[[runtime.deploy]] +from = "LICENSE" +to = "licenses/protobuf" + +[[runtime.deploy]] +from = "NOTICE" +to = "licenses/protobuf" + +[[runtime.deploy]] +from = "upstream/protobuf/README.md" +to = "licenses/protobuf/upstream/protobuf" + +[[runtime.deploy]] +from = "upstream/protobuf/LICENSE" +to = "licenses/protobuf/upstream/protobuf" + +[[runtime.deploy]] +from = "upstream/utf8_range/LICENSE" +to = "licenses/protobuf/upstream/utf8_range" + +[[runtime.deploy]] +from = "upstream/abseil-cpp/LICENSE" +to = "licenses/protobuf/upstream/abseil-cpp" + +[target.'cfg(windows)'.build] +cxxflags = ["-DNOMINMAX", "-DWIN32_LEAN_AND_MEAN"] diff --git a/rules/mcpp.toml b/rules/mcpp.toml new file mode 100644 index 0000000..020faa1 --- /dev/null +++ b/rules/mcpp.toml @@ -0,0 +1,34 @@ +# protogen — protoc as an importable mcpp build rule: the generic, protobuf-owned +# layer of code generation. One build-graph edge per .proto, C++ messages by +# default, any protoc plugin as a parameter. +# +# # mcpp.toml — or simply mcpplibs.mwrap.protobuf = { version = "35.1", features = ["codegen"] } +# [build-dependencies] +# mcpplibs.protogen = { version = "35.1", host-module = true } +# +# // build.mcpp +# import mcpp; +# import protogen; +# int main() { return protogen::generate_all() ? 0 : 1; } +# +# Its version is protobuf's: the rule, the protoc it drives and the runtime the +# generated code links are one release. The API is the generic layer of +# grpc-m's grpcgen (same names and options); a gRPC project uses grpcgen, which +# adds the gRPC plugin. +# +# The package name and the module name are equal (`protogen`): mcpp registers a +# host module under the dependency's package name on older engines and under +# the declared name from 2026.8.29.1; only equality works on both. +[package] +namespace = "mcpplibs" +name = "protogen" +version = "35.1" +standard = "c++23" +description = "protoc as an importable mcpp build rule (host-module): one edge per .proto, C++ messages, any protoc plugin" +license = "Apache-2.0" +authors = ["mcpp-community"] +repo = "https://github.com/mcpplibs/protobuf-m" +platforms = ["linux", "macos", "windows"] + +[targets.protogen] +kind = "lib" diff --git a/rules/src/protogen.cppm b/rules/src/protogen.cppm new file mode 100644 index 0000000..0d618ae --- /dev/null +++ b/rules/src/protogen.cppm @@ -0,0 +1,438 @@ +// protogen — protoc as an importable build rule: the generic layer of protobuf +// code generation, owned by protobuf. +// +// import mcpp; +// import protogen; +// int main() { return protogen::generate_all() ? 0 : 1; } +// +// Every .proto under proto/ becomes one build-graph edge that runs protoc with +// --cpp_out (C++ messages, `.pb.{h,cc}`), and with any protoc plugin +// given in `options::plugins`; the .pb.cc enter the build, the directory of the +// .pb.h becomes an include directory of the package. protoc is built by mcpp +// for the build machine from the same protobuf release the program links. +// +// The layers, each the next one's defaults (the API of grpc-m's grpcgen, whose +// generic half this is): +// +// L0 generate_all() the whole directory +// L1 generate_all({.imports=…, .lite=…, .descriptor_set=…, .protoc_args=…}) +// L2 generate_all({.plugins={my_plugin}}) +// L3 auto e = plan_all(); /* edit */ submit(e); +// +// `generate_all(opt)` IS `submit(plan_all(opt))`. What this rule does not do is +// print command lines: build.ninja has every action's argv +// (`ninja -t commands `); the rule owns which knobs produced it, in +// each edge's description. +export module protogen; + +import std; +import mcpp; + +namespace protogen::detail { + +// protoc does not embed the well-known types: `import +// "google/protobuf/timestamp.proto"` — and Duration, Any, Empty, Struct, which +// real services use constantly — is read from disk. They ship inside the +// protobuf package the consumer already depends on, so the path is derivable +// and nobody has to install anything. +// +// Found by looking for the directory that actually holds descriptor.proto, +// rather than by assuming the tarball's wrap-directory name: that name is a +// packaging artifact and not part of any contract. +std::string well_known_types_dir() { + namespace fs = std::filesystem; + const std::string base = mcpp::dep_dir("compat.protobuf"); + if (base.empty()) return {}; + std::error_code ec; + for (const auto& e : fs::directory_iterator(base, ec)) { + const fs::path src = e.path() / "src"; + if (fs::exists(src / "google" / "protobuf" / "descriptor.proto", ec)) + return src.generic_string(); + } + return {}; +} + +} // namespace protogen::detail + +export namespace protogen { + +// ── L2: a protoc plugin ──────────────────────────────────────────────────── +// +// One plugin is four things, and the fourth is not optional: mcpp has to know +// which files the edge PRODUCES to put the .cc in the compile set and keep the +// .h out of it. A plugin that cannot say what it emits cannot be a build-graph +// node at all. +struct plugin { + // The protoc name: drives `--_out=` and `--plugin=protoc-gen-=`. + std::string name; + // Absolute path to the generator executable. Empty = unresolved; the rule + // reports it by name rather than letting protoc fail with its own wording. + std::string binary; + // Plugin parameters, joined with ',' and prefixed onto the output dir — + // protoc's `--x_out=a=1,b=2:` grammar. + std::vector params; + // Suffixes appended to the .proto's stem, e.g. ".grpc.pb.cc". + std::vector suffixes; +}; + +struct options { + // Where the .proto files live, relative to the consumer's manifest. + std::string_view proto_dir = "proto"; + // Additional trees to GENERATE from, each also becoming an `-I` root. + // Names keep their path relative to their own root, so + // ../shared-proto/common/types.proto emits common/types.pb.{h,cc}. + // + // Distinct from `imports` on purpose: protoc emits + // `#include "common/types.pb.h"` into any file that imports that .proto, + // so a shared tree reached only through `-I` yields a header nobody + // produced. Use this when the shared .proto's code is yours to build. + std::vector extra_dirs; + // Extra `-I` roots, SEARCH ONLY: no code is generated for what they + // contain (the generated code comes from a package you already link). + std::vector imports; + // Generate for the lite runtime (`--cpp_out=lite:`): MessageLite, no + // descriptors or reflection. + bool lite = false; + // Also write each .proto's FileDescriptorSet, with its imports, beside the + // generated code as `.pb.desc` (protoc --descriptor_set_out + // --include_imports): what a DescriptorPool / DynamicMessage needs at run + // time without the generated classes. + bool descriptor_set = false; + // Escape hatch for protoc flags this rule does not model, e.g. + // "--experimental_allow_proto3_optional". + std::vector protoc_args; + // L2: protoc plugins run with the C++ generator, each a build-graph output + // set of its own. Empty: messages only, and no plugin dependency. + std::vector plugins; +}; + +// ── L3: a planned edge, before it is submitted ───────────────────────────── +// +// Owns its strings, unlike `mcpp::action` whose id/description are raw +// pointers — a planned edge outlives the expression that built it. +struct edge { + std::string id; + std::string description; + std::vector command; + std::vector inputs; + std::vector outputs; + + edge& arg(std::string a) { command.push_back(std::move(a)); return *this; } + edge& input(std::string p) { inputs.push_back(std::move(p)); return *this; } + edge& output(std::string p) { outputs.push_back(std::move(p)); return *this; } +}; + +namespace detail { + +std::vector resolve_plugins(const options& opt) { return opt.plugins; } + +// "protoc:echo (+grpc generate_mock_code=true, -I proto -I ../shared/proto)" +// +// The description is what every build prints, so it is where "which knobs +// produced this" belongs. The command itself is in build.ninja; see the module +// header for why the rule does not duplicate it. +std::string describe(const std::string& name, + const std::vector& plugins, + const std::vector& userIncs, + const std::string& root) { + std::string s = "protoc:" + name + " ("; + if (plugins.empty()) { + s += "messages"; + } else { + bool first = true; + for (const auto& p : plugins) { + if (!first) s += " "; + first = false; + s += "+" + p.name; + for (const auto& q : p.params) { + s += " " + q; + } + } + } + // Only the roots the AUTHOR chose. The well-known-types directory is + // always present and is not a knob, and absolute store paths would bury + // the part worth reading. Rendered relative to the manifest so the string + // matches what was written in build.mcpp. + for (const auto& i : userIncs) { + // Prefer the relative form — it is usually what the author wrote — but + // only while it stays readable. `lexically_relative` SUCCEEDS for a + // path far from the manifest and returns a chain of `..` longer than + // the absolute path it replaced; guarding only on "could not compute" + // misses that case entirely. + auto rel = std::filesystem::path(i).lexically_relative(root); + auto r = rel.generic_string(); + auto shown = (r.empty() || r.starts_with("../..")) ? i : r; + s += (i == userIncs.front() ? ", -I" : " -I") + shown; + } + s += ")"; + return s; +} + +} // namespace detail + +// Build the edges for the named .proto files WITHOUT submitting them. +// +// Names are given WITHOUT the extension, relative to `opt.proto_dir` — +// "helloworld" means /helloworld.proto. +// +// Returns an empty vector after printing a diagnostic. +// ── L3, bottom: a .proto addressed by (root, name) ───────────────────────── +// +// `plan()` and `plan_all()` both funnel here. It is public because it is the +// only form that can express a .proto living somewhere neither `proto_dir` nor +// `extra_dirs` covers — without it, such a project would be back to writing +// its own build.mcpp, which is the cliff this whole design exists to remove. +// +// `name` is relative to `root` and decides the OUTPUT path, so two roots may +// contribute the same relative name only if the author meant it — exactly the +// property protoc's own -I list has. +struct entry { std::string root, name; }; + +// Plan edges for .proto files given as explicit (root, name) pairs. +std::vector plan_entries(std::vector protos, options opt = {}) { + const std::string root = mcpp::manifest_dir(); + const std::string out = mcpp::out_dir(); + if (root.empty() || out.empty()) { + std::println(std::cerr, + "protogen: no mcpp build context — this runs from build.mcpp"); + return {}; + } + if (protos.empty()) { + std::println(std::cerr, "protogen: no .proto files to plan"); + return {}; + } + + // By the qualified name: a project that uses this rule usually depends on + // mcpplibs.mwrap.protobuf too, whose short name is also `protobuf`. + const char* protoc = mcpp::dep_bin("compat.protobuf", "protoc"); + if (!protoc || !*protoc) { + std::println(std::cerr, + "protogen: no protoc. Declare it on the protobuf package:\n" + " mcpplibs.mwrap.protobuf = {{ version = \"35.1\", features = [\"codegen\"] }}\n" + " (or compat.protobuf = {{ version = \"35.1\", features = [\"upb\"], tools = [\"protoc\"] }})\n" + " On Windows compat.protobuf 35.1 does not build protoc; generate on Linux or macOS."); + return {}; + } + + auto plugins = detail::resolve_plugins(opt); + for (const auto& p : plugins) { + if (!p.binary.empty()) continue; + std::println(std::cerr, + "protogen: plugin '{}' has no executable: declare the package that " + "builds it with `tools = [...]` and pass its mcpp::dep_bin path", p.name); + return {}; + } + + const std::string wkt = detail::well_known_types_dir(); + if (wkt.empty()) { + std::println(std::cerr, + "protogen: cannot locate the well-known .proto files inside the " + "protobuf package"); + return {}; + } + + auto abs_under_root = [&](const std::string& v) { + std::filesystem::path p{v}; + return p.is_absolute() ? p.generic_string() + : (std::filesystem::path(root) / p) + .lexically_normal().generic_string(); + }; + const std::string protoDir = abs_under_root(std::string(opt.proto_dir)); + + // Include roots, in the order protoc sees them: the generation roots (own + // tree first), then search-only roots, then the well-known types. + std::vector incs{ protoDir }; + for (const auto& d : opt.extra_dirs) incs.push_back(abs_under_root(d)); + for (const auto& i : opt.imports) incs.push_back(abs_under_root(i)); + incs.push_back(wkt); + + // Every .proto is an input of every action. A .proto that imports a sibling + // has a real dependency this rule does not parse, and regenerating a little + // too eagerly is far better than silently stale stubs. + std::vector inputs; + inputs.reserve(protos.size()); + for (const auto& e : protos) + inputs.push_back(std::format("{}/{}.proto", e.root, e.name)); + + std::vector edges; + edges.reserve(protos.size()); + + for (const auto& ent : protos) { + const std::string& name = ent.name; + const std::string src = std::format("{}/{}.proto", ent.root, name); + const std::string base = std::format("{}/{}", out, name); + + edge e; + e.id = std::format("protoc:{}", name); + // Only the author-chosen roots: incs also carries the well-known-types + // directory, which is constant and not worth printing every build. + e.description = detail::describe( + name, plugins, + std::vector(incs.begin(), incs.end() - 1), root); + + e.arg(protoc); + for (const auto& i : incs) e.arg("-I" + i); + e.arg(std::string("--cpp_out=") + (opt.lite ? "lite:" : "") + out); + if (opt.descriptor_set) { + e.arg("--include_imports"); + e.arg("--descriptor_set_out=" + base + ".pb.desc"); + } + + for (const auto& p : plugins) { + std::string spec; + for (const auto& q : p.params) { + if (!spec.empty()) spec += ","; + spec += q; + } + // protoc's grammar: `--x_out=:`; the colon is only + // present when there are params. + e.arg("--" + p.name + "_out=" + (spec.empty() ? out : spec + ":" + out)); + e.arg("--plugin=protoc-gen-" + p.name + "=" + p.binary); + } + for (const auto& a : opt.protoc_args) e.arg(a); + e.arg(src); + + for (const auto& in : inputs) e.input(in); + + // protoc mirrors the .proto's relative path under --cpp_out and does + // NOT create the intermediate directories. A flat proto/ never notices; + // proto/sub/x.proto fails with "No such file or directory" from inside + // protoc, which reads as a codegen bug rather than a missing mkdir. + { + std::error_code mkec; + std::filesystem::create_directories( + std::filesystem::path(base).parent_path(), mkec); + } + // The headers are declared as outputs because they must be PRODUCED by + // this edge; mcpp knows a header is not a translation unit and keeps + // them out of the compile set. + e.output(base + ".pb.cc").output(base + ".pb.h"); + if (opt.descriptor_set) e.output(base + ".pb.desc"); + for (const auto& p : plugins) + for (const auto& s : p.suffixes) e.output(base + s); + + edges.push_back(std::move(e)); + } + return edges; +} + +// Every .proto under `opt.proto_dir`, without naming any of them — planned but +// not submitted. +// +// Safe only because the engine can express "my output depends on which files +// are here" (`rerun_if_changed_glob`, mcpp 2026.8.6.2+). Before that, a build +// program that globbed did not re-run when a .proto was added — no declared +// file's hash had changed — so the new file was silently never generated, +// which is worse than making the author list names. That is why this +// repository shipped the explicit list first. +// +// Names keep their subdirectory, so proto/sub/x.proto generates sub/x.pb.cc. +// Build the edges for the named .proto files WITHOUT submitting them. +// +// Names are given WITHOUT the extension, relative to `opt.proto_dir` — +// "helloworld" means /helloworld.proto. Files under `extra_dirs` +// are not addressable this way; use plan_all() for those. +// +// Returns an empty vector after printing a diagnostic. +std::vector plan(std::vector protos, options opt = {}) { + const std::string root = mcpp::manifest_dir(); + if (root.empty()) { + std::println(std::cerr, + "protogen: no mcpp build context — this runs from build.mcpp"); + return {}; + } + std::filesystem::path pd{std::string(opt.proto_dir)}; + const std::string base = pd.is_absolute() + ? pd.generic_string() + : (std::filesystem::path(root) / pd).lexically_normal().generic_string(); + std::vector entries; + entries.reserve(protos.size()); + for (auto& n : protos) entries.push_back({ base, std::move(n) }); + return plan_entries(std::move(entries), std::move(opt)); +} + +std::vector plan_all(options opt = {}) { + namespace fs = std::filesystem; + const std::string root = mcpp::manifest_dir(); + if (root.empty()) { + std::println(std::cerr, + "protogen: no mcpp build context — this runs from build.mcpp"); + return {}; + } + // Every generation root: the project's own tree, then `extra_dirs`. + std::vector roots{ std::string(opt.proto_dir) }; + for (const auto& d : opt.extra_dirs) roots.push_back(d); + + std::vector entries; + for (const auto& r : roots) { + // One glob per root — a .proto appearing in ANY of them must re-run + // this program, and only the path SET is fingerprinted (contents are + // covered by the edges' own inputs). + const std::string pattern = r + "/**/*.proto"; + mcpp::rerun_if_changed_glob(pattern.c_str()); + + fs::path rp{r}; + const fs::path dir = rp.is_absolute() ? rp + : (fs::path(root) / rp).lexically_normal(); + std::error_code ec; + if (!fs::exists(dir, ec)) { + std::println(std::cerr, + "protogen::plan_all(): no '{}' directory under {}", r, root); + return {}; + } + std::vector names; + for (auto const& e : fs::recursive_directory_iterator(dir, ec)) { + if (ec) break; + if (!e.is_regular_file(ec)) continue; + if (e.path().extension() != ".proto") continue; + auto rel = e.path().lexically_relative(dir); + rel.replace_extension(); + names.push_back(rel.generic_string()); + } + // Sorted so the declared edge set is stable run to run — an unstable + // order would churn build.ninja for no reason. + std::ranges::sort(names); + for (auto& n : names) + entries.push_back({ dir.generic_string(), std::move(n) }); + } + if (entries.empty()) { + std::println(std::cerr, + "protogen::plan_all(): no .proto files under {}", opt.proto_dir); + return {}; + } + return plan_entries(std::move(entries), std::move(opt)); +} + +// Hand the planned edges to mcpp, and declare where the generated headers live. +// +// That include dir is PRIVATE to the consuming package by design — one a +// package's own consumers must see belongs in its manifest, not in a build +// program. +bool submit(const std::vector& edges) { + if (edges.empty()) return false; + for (const auto& e : edges) { + mcpp::action a; + a.id = e.id.c_str(); + a.role = "source"; + a.description = e.description.c_str(); + for (const auto& c : e.command) a.arg(c.c_str()); + for (const auto& i : e.inputs) a.input(i.c_str()); + for (const auto& o : e.outputs) a.output(o.c_str()); + a.submit(); + } + mcpp::include_dir(mcpp::out_dir()); + return true; +} + +// Declare one codegen edge per named .proto. `plan` + `submit`, with nothing +// in between — the two-call form exists so a consumer can put something there. +bool generate(std::vector protos, options opt = {}) { + return submit(plan(std::move(protos), std::move(opt))); +} + +// Every .proto under `opt.proto_dir`. The form the greeter template uses. +bool generate_all(options opt = {}) { + return submit(plan_all(std::move(opt))); +} + +} // namespace protogen diff --git a/src/compiler.cppm b/src/compiler.cppm new file mode 100644 index 0000000..ab21238 --- /dev/null +++ b/src/compiler.cppm @@ -0,0 +1,22 @@ +// Written by tools/surface.py from tools/surface.json; tools/check_exports.py audits it. Do not edit by hand. + +// mcpplibs.mwrap.protobuf.compiler — parsing .proto files at run time: Importer, DiskSourceTree, Parser (protobuf 35.1), unchanged: +// each name is a using-declaration of the upstream entity in the namespace upstream declares it in. +module; +#include "detail/prelude.hpp" +#include +#include +#include "detail/epilogue.hpp" + +export module mcpplibs.mwrap.protobuf.compiler; + +export namespace google::protobuf::compiler { +// types (7) +using ::google::protobuf::compiler::DiskSourceTree; +using ::google::protobuf::compiler::Importer; +using ::google::protobuf::compiler::MultiFileErrorCollector; +using ::google::protobuf::compiler::Parser; +using ::google::protobuf::compiler::SourceLocationTable; +using ::google::protobuf::compiler::SourceTree; +using ::google::protobuf::compiler::SourceTreeDescriptorDatabase; +} // namespace google::protobuf::compiler diff --git a/src/detail/epilogue.hpp b/src/detail/epilogue.hpp new file mode 100644 index 0000000..f21675e --- /dev/null +++ b/src/detail/epilogue.hpp @@ -0,0 +1,18 @@ +// Included by every module unit of protobuf-m in the global module fragment, +// after the protobuf headers. +#pragma once +#include +#include + +// On little-endian aarch64 (not MSVC) parse_context.h's VarintParse calls +// VarintParseSlowArm, a `static` (internal linkage) overload set. Inline code of +// the headers (ReadVarint64, ReadVarint32 …) instantiates VarintParse, and +// Clang performs those pending instantiations at the end of the translation +// unit — in the module purview, where an entity of internal linkage from the +// global module fragment is not visible: "no matching function for call to +// 'VarintParseSlowArm'". Explicit instantiation definitions here instantiate +// them in the fragment, where the overloads are found. +#if defined(__aarch64__) && defined(ABSL_IS_LITTLE_ENDIAN) && !defined(_MSC_VER) +template const char* google::protobuf::internal::VarintParse(const char*, std::uint32_t*); +template const char* google::protobuf::internal::VarintParse(const char*, std::uint64_t*); +#endif diff --git a/src/detail/prelude.hpp b/src/detail/prelude.hpp new file mode 100644 index 0000000..543e3b4 --- /dev/null +++ b/src/detail/prelude.hpp @@ -0,0 +1,15 @@ +// Included first by every module unit of protobuf-m, in the global module +// fragment, before any protobuf header. +#pragma once + +// On Windows protobuf's headers can reach , whose min/max +// function-like macros break std::numeric_limits::max() in the headers that +// follow; compat.protobuf builds with the same two macros. +#if defined(_WIN32) +# ifndef NOMINMAX +# define NOMINMAX +# endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +#endif diff --git a/src/gzip/io_gzip.cppm b/src/gzip/io_gzip.cppm new file mode 100644 index 0000000..689175c --- /dev/null +++ b/src/gzip/io_gzip.cppm @@ -0,0 +1,16 @@ +// Written by tools/surface.py from tools/surface.json; tools/check_exports.py audits it. Do not edit by hand. + +// mcpplibs.mwrap.protobuf.io.gzip — GzipInputStream and GzipOutputStream (the package's `gzip` feature) (protobuf 35.1), unchanged: +// each name is a using-declaration of the upstream entity in the namespace upstream declares it in. +module; +#include "../detail/prelude.hpp" +#include +#include "../detail/epilogue.hpp" + +export module mcpplibs.mwrap.protobuf.io.gzip; + +export namespace google::protobuf::io { +// types (2) +using ::google::protobuf::io::GzipInputStream; +using ::google::protobuf::io::GzipOutputStream; +} // namespace google::protobuf::io diff --git a/src/io.cppm b/src/io.cppm new file mode 100644 index 0000000..401d489 --- /dev/null +++ b/src/io.cppm @@ -0,0 +1,59 @@ +// Written by tools/surface.py from tools/surface.json; tools/check_exports.py audits it. Do not edit by hand. + +// mcpplibs.mwrap.protobuf.io — coded and zero-copy streams, the tokenizer and the printer (protobuf 35.1), unchanged: +// each name is a using-declaration of the upstream entity in the namespace upstream declares it in. +module; +#include "detail/prelude.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include "detail/epilogue.hpp" + +export module mcpplibs.mwrap.protobuf.io; + +export namespace google::protobuf { +// types (1) +using ::google::protobuf::ZeroCopyCodedInputStream; +} // namespace google::protobuf + +export namespace google::protobuf::io { +// types (26) +using ::google::protobuf::io::AnnotationCollector; +using ::google::protobuf::io::AnnotationProtoCollector; +using ::google::protobuf::io::ArrayInputStream; +using ::google::protobuf::io::ArrayOutputStream; +using ::google::protobuf::io::CodedInputStream; +using ::google::protobuf::io::CodedOutputStream; +using ::google::protobuf::io::ColumnNumber; +using ::google::protobuf::io::ConcatenatingInputStream; +using ::google::protobuf::io::CopyingInputStream; +using ::google::protobuf::io::CopyingInputStreamAdaptor; +using ::google::protobuf::io::CopyingOutputStream; +using ::google::protobuf::io::CopyingOutputStreamAdaptor; +using ::google::protobuf::io::CordInputStream; +using ::google::protobuf::io::CordOutputStream; +using ::google::protobuf::io::EpsCopyOutputStream; +using ::google::protobuf::io::ErrorCollector; +using ::google::protobuf::io::FileInputStream; +using ::google::protobuf::io::FileOutputStream; +using ::google::protobuf::io::IstreamInputStream; +using ::google::protobuf::io::LimitingInputStream; +using ::google::protobuf::io::OstreamOutputStream; +using ::google::protobuf::io::Printer; +using ::google::protobuf::io::StringOutputStream; +using ::google::protobuf::io::Tokenizer; +using ::google::protobuf::io::ZeroCopyInputStream; +using ::google::protobuf::io::ZeroCopyOutputStream; +// functions and operators (6) +using ::google::protobuf::io::NoLocaleStrtod; +using ::google::protobuf::io::SafeDoubleToFloat; +using ::google::protobuf::io::SimpleDtoa; +using ::google::protobuf::io::SimpleFtoa; +using ::google::protobuf::io::as_string_data; +using ::google::protobuf::io::mutable_string_data; +} // namespace google::protobuf::io diff --git a/src/macros.cppm b/src/macros.cppm new file mode 100644 index 0000000..826970e --- /dev/null +++ b/src/macros.cppm @@ -0,0 +1,127 @@ +// Written by tools/surface.py from tools/surface.json; tools/check_exports.py audits it. Do not edit by hand. + +// mcpplibs.mwrap.protobuf.macros — the version macros of protobuf's headers as constants of the same names in +// mcpplibs::mwrap::protobuf::macros, and GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG as a constexpr function. A module +// does not export macros: the others (GOOGLE_PROTOBUF_VERIFY_VERSION, the platform switches …) come from +// #include , before the import. +module; +#include "detail/prelude.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "detail/epilogue.hpp" + +namespace mwrap_protobuf_macros { +inline constexpr auto value_GOOGLE_PROTOBUF_VERSION = GOOGLE_PROTOBUF_VERSION; +inline constexpr auto value_GOOGLE_PROTOBUF_VERSION_SUFFIX = GOOGLE_PROTOBUF_VERSION_SUFFIX; +inline constexpr auto value_PROTOBUF_OSS_VERSION = PROTOBUF_OSS_VERSION; +inline constexpr auto value_PROTOBUF_OSS_VERSION_SUFFIX = PROTOBUF_OSS_VERSION_SUFFIX; +inline constexpr auto value_PROTOBUF_VERSION = PROTOBUF_VERSION; +inline constexpr auto value_PROTOBUF_VERSION_SUFFIX = PROTOBUF_VERSION_SUFFIX; +} // namespace mwrap_protobuf_macros + +#undef GOOGLE_PROTOBUF_VERSION +#undef GOOGLE_PROTOBUF_VERSION_SUFFIX +#undef PROTOBUF_OSS_VERSION +#undef PROTOBUF_OSS_VERSION_SUFFIX +#undef PROTOBUF_VERSION +#undef PROTOBUF_VERSION_SUFFIX +#undef GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG + +export module mcpplibs.mwrap.protobuf.macros; + +export namespace mcpplibs::mwrap::protobuf::macros { + +inline constexpr auto GOOGLE_PROTOBUF_VERSION = mwrap_protobuf_macros::value_GOOGLE_PROTOBUF_VERSION; +inline constexpr auto GOOGLE_PROTOBUF_VERSION_SUFFIX = mwrap_protobuf_macros::value_GOOGLE_PROTOBUF_VERSION_SUFFIX; +inline constexpr auto PROTOBUF_OSS_VERSION = mwrap_protobuf_macros::value_PROTOBUF_OSS_VERSION; +inline constexpr auto PROTOBUF_OSS_VERSION_SUFFIX = mwrap_protobuf_macros::value_PROTOBUF_OSS_VERSION_SUFFIX; +inline constexpr auto PROTOBUF_VERSION = mwrap_protobuf_macros::value_PROTOBUF_VERSION; +inline constexpr auto PROTOBUF_VERSION_SUFFIX = mwrap_protobuf_macros::value_PROTOBUF_VERSION_SUFFIX; + +// wire_format_lite.h: the tag of a field, (number << 3) | wire type. +constexpr std::uint32_t GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(int field_number, ::google::protobuf::internal::WireFormatLite::WireType type) { + return static_cast((static_cast(field_number) << ::google::protobuf::internal::WireFormatLite::kTagTypeBits) | type); +} + +} // namespace mcpplibs::mwrap::protobuf::macros diff --git a/src/protobuf.cppm b/src/protobuf.cppm new file mode 100644 index 0000000..d672e63 --- /dev/null +++ b/src/protobuf.cppm @@ -0,0 +1,830 @@ +// Written by tools/surface.py from tools/surface.json; tools/check_exports.py audits it. Do not edit by hand. + +// mcpplibs.mwrap.protobuf — messages, descriptors, reflection, arenas, repeated fields, maps, text format and the well-known types (protobuf 35.1), unchanged: +// each name is a using-declaration of the upstream entity in the namespace upstream declares it in. +// The root also re-exports the other modules (gzip only through its own import, with the feature). +module; +#include "detail/prelude.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "detail/epilogue.hpp" + +export module mcpplibs.mwrap.protobuf; + +export import mcpplibs.mwrap.protobuf.io; +export import mcpplibs.mwrap.protobuf.util; +export import mcpplibs.mwrap.protobuf.compiler; +export import mcpplibs.mwrap.protobuf.macros; + +// constants of internal linkage in the headers (stubs/common.h), declared again under their names with their values +export namespace mcpplibs::mwrap::protobuf { +inline constexpr auto kint32max = ::google::protobuf::kint32max; +inline constexpr auto kint32min = ::google::protobuf::kint32min; +inline constexpr auto kint64max = ::google::protobuf::kint64max; +inline constexpr auto kint64min = ::google::protobuf::kint64min; +inline constexpr auto kuint32max = ::google::protobuf::kuint32max; +inline constexpr auto kuint64max = ::google::protobuf::kuint64max; +} // namespace mcpplibs::mwrap::protobuf + +export namespace google::protobuf { +// types (227) +using ::google::protobuf::AccessListener; +using ::google::protobuf::Any; +using ::google::protobuf::AnyGlobalsTypeInternal; +using ::google::protobuf::Api; +using ::google::protobuf::ApiGlobalsTypeInternal; +using ::google::protobuf::Arena; +using ::google::protobuf::ArenaOptions; +using ::google::protobuf::AssignDescriptorsHelper; +using ::google::protobuf::BigEndian; +using ::google::protobuf::BoolValue; +using ::google::protobuf::BoolValueGlobalsTypeInternal; +using ::google::protobuf::BytesValue; +using ::google::protobuf::BytesValueGlobalsTypeInternal; +using ::google::protobuf::Closure; +using ::google::protobuf::ConstMapIterator; +using ::google::protobuf::DebugStringOptions; +using ::google::protobuf::Descriptor; +using ::google::protobuf::DescriptorBuilder; +using ::google::protobuf::DescriptorDatabase; +using ::google::protobuf::DescriptorPool; +using ::google::protobuf::DescriptorPoolDatabase; +using ::google::protobuf::DescriptorPoolDatabaseOptions; +using ::google::protobuf::DescriptorProto; +using ::google::protobuf::DescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::DescriptorProto_ExtensionRange; +using ::google::protobuf::DescriptorProto_ExtensionRangeGlobalsTypeInternal; +using ::google::protobuf::DescriptorProto_ReservedRange; +using ::google::protobuf::DescriptorProto_ReservedRangeGlobalsTypeInternal; +using ::google::protobuf::DoubleValue; +using ::google::protobuf::DoubleValueGlobalsTypeInternal; +using ::google::protobuf::Duration; +using ::google::protobuf::DurationGlobalsTypeInternal; +using ::google::protobuf::DynamicMapSorter; +using ::google::protobuf::DynamicMessage; +using ::google::protobuf::DynamicMessageFactory; +using ::google::protobuf::Edition; +using ::google::protobuf::Empty; +using ::google::protobuf::EmptyGlobalsTypeInternal; +using ::google::protobuf::EncodedDescriptorDatabase; +using ::google::protobuf::Enum; +using ::google::protobuf::EnumDescriptor; +using ::google::protobuf::EnumDescriptorProto; +using ::google::protobuf::EnumDescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::EnumDescriptorProto_EnumReservedRange; +using ::google::protobuf::EnumDescriptorProto_EnumReservedRangeGlobalsTypeInternal; +using ::google::protobuf::EnumGlobalsTypeInternal; +using ::google::protobuf::EnumOptions; +using ::google::protobuf::EnumOptionsGlobalsTypeInternal; +using ::google::protobuf::EnumValue; +using ::google::protobuf::EnumValueDescriptor; +using ::google::protobuf::EnumValueDescriptorProto; +using ::google::protobuf::EnumValueDescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::EnumValueGlobalsTypeInternal; +using ::google::protobuf::EnumValueOptions; +using ::google::protobuf::EnumValueOptionsGlobalsTypeInternal; +using ::google::protobuf::ExtDeclEnforcementLevel; +using ::google::protobuf::ExtensionRangeOptions; +using ::google::protobuf::ExtensionRangeOptionsGlobalsTypeInternal; +using ::google::protobuf::ExtensionRangeOptions_Declaration; +using ::google::protobuf::ExtensionRangeOptions_DeclarationGlobalsTypeInternal; +using ::google::protobuf::ExtensionRangeOptions_VerificationState; +using ::google::protobuf::FastReflectionMessageMutator; +using ::google::protobuf::FastReflectionStringSetter; +using ::google::protobuf::FeatureResolver; +using ::google::protobuf::FeatureSet; +using ::google::protobuf::FeatureSetDefaults; +using ::google::protobuf::FeatureSetDefaultsGlobalsTypeInternal; +using ::google::protobuf::FeatureSetDefaults_FeatureSetEditionDefault; +using ::google::protobuf::FeatureSetDefaults_FeatureSetEditionDefaultGlobalsTypeInternal; +using ::google::protobuf::FeatureSetGlobalsTypeInternal; +using ::google::protobuf::FeatureSet_EnforceNamingStyle; +using ::google::protobuf::FeatureSet_EnumType; +using ::google::protobuf::FeatureSet_FieldPresence; +using ::google::protobuf::FeatureSet_JsonFormat; +using ::google::protobuf::FeatureSet_MessageEncoding; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding; +using ::google::protobuf::FeatureSet_Utf8Validation; +using ::google::protobuf::FeatureSet_VisibilityFeature; +using ::google::protobuf::FeatureSet_VisibilityFeatureGlobalsTypeInternal; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility; +using ::google::protobuf::Field; +using ::google::protobuf::FieldDescriptor; +using ::google::protobuf::FieldDescriptorProto; +using ::google::protobuf::FieldDescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::FieldDescriptorProto_Label; +using ::google::protobuf::FieldDescriptorProto_Type; +using ::google::protobuf::FieldGlobalsTypeInternal; +using ::google::protobuf::FieldMask; +using ::google::protobuf::FieldMaskGlobalsTypeInternal; +using ::google::protobuf::FieldOptions; +using ::google::protobuf::FieldOptionsGlobalsTypeInternal; +using ::google::protobuf::FieldOptions_CType; +using ::google::protobuf::FieldOptions_EditionDefault; +using ::google::protobuf::FieldOptions_EditionDefaultGlobalsTypeInternal; +using ::google::protobuf::FieldOptions_FeatureSupport; +using ::google::protobuf::FieldOptions_FeatureSupportGlobalsTypeInternal; +using ::google::protobuf::FieldOptions_JSType; +using ::google::protobuf::FieldOptions_OptionRetention; +using ::google::protobuf::FieldOptions_OptionTargetType; +using ::google::protobuf::Field_Cardinality; +using ::google::protobuf::Field_Kind; +using ::google::protobuf::FileDescriptor; +using ::google::protobuf::FileDescriptorLegacy; +using ::google::protobuf::FileDescriptorProto; +using ::google::protobuf::FileDescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::FileDescriptorSet; +using ::google::protobuf::FileDescriptorSetGlobalsTypeInternal; +using ::google::protobuf::FileDescriptorTables; +using ::google::protobuf::FileOptions; +using ::google::protobuf::FileOptionsGlobalsTypeInternal; +using ::google::protobuf::FileOptions_OptimizeMode; +using ::google::protobuf::FloatValue; +using ::google::protobuf::FloatValueGlobalsTypeInternal; +using ::google::protobuf::GeneratedCodeInfo; +using ::google::protobuf::GeneratedCodeInfoGlobalsTypeInternal; +using ::google::protobuf::GeneratedCodeInfo_Annotation; +using ::google::protobuf::GeneratedCodeInfo_AnnotationGlobalsTypeInternal; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic; +using ::google::protobuf::GeneratedMessageReflectionTestHelper; +using ::google::protobuf::Int32Value; +using ::google::protobuf::Int32ValueGlobalsTypeInternal; +using ::google::protobuf::Int64Value; +using ::google::protobuf::Int64ValueGlobalsTypeInternal; +using ::google::protobuf::ListValue; +using ::google::protobuf::ListValueGlobalsTypeInternal; +using ::google::protobuf::MakeDependent; +using ::google::protobuf::Map; +using ::google::protobuf::MapIterator; +using ::google::protobuf::MapIteratorBase; +using ::google::protobuf::MapKey; +using ::google::protobuf::MapPair; +using ::google::protobuf::MapReflectionTester; +using ::google::protobuf::MapValueConstRef; +using ::google::protobuf::MapValueRef; +using ::google::protobuf::MergedDescriptorDatabase; +using ::google::protobuf::Message; +using ::google::protobuf::MessageFactory; +using ::google::protobuf::MessageLayoutInspector; +using ::google::protobuf::MessageLite; +using ::google::protobuf::MessageOptions; +using ::google::protobuf::MessageOptionsGlobalsTypeInternal; +using ::google::protobuf::Metadata; +using ::google::protobuf::Method; +using ::google::protobuf::MethodDescriptor; +using ::google::protobuf::MethodDescriptorProto; +using ::google::protobuf::MethodDescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::MethodGlobalsTypeInternal; +using ::google::protobuf::MethodOptions; +using ::google::protobuf::MethodOptionsGlobalsTypeInternal; +using ::google::protobuf::MethodOptions_IdempotencyLevel; +using ::google::protobuf::Mixin; +using ::google::protobuf::MixinGlobalsTypeInternal; +using ::google::protobuf::MutableRepeatedFieldRef; +using ::google::protobuf::NoOpAccessListener; +using ::google::protobuf::NullValue; +using ::google::protobuf::OneofDescriptor; +using ::google::protobuf::OneofDescriptorProto; +using ::google::protobuf::OneofDescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::OneofOptions; +using ::google::protobuf::OneofOptionsGlobalsTypeInternal; +using ::google::protobuf::Option; +using ::google::protobuf::OptionGlobalsTypeInternal; +using ::google::protobuf::Reflection; +using ::google::protobuf::RepeatedField; +using ::google::protobuf::RepeatedFieldProxy; +using ::google::protobuf::RepeatedFieldRef; +using ::google::protobuf::RepeatedPtrField; +using ::google::protobuf::ResultCallback; +using ::google::protobuf::ResultCallback1; +using ::google::protobuf::ResultCallback2; +using ::google::protobuf::RpcChannel; +using ::google::protobuf::RpcController; +using ::google::protobuf::Service; +using ::google::protobuf::ServiceDescriptor; +using ::google::protobuf::ServiceDescriptorProto; +using ::google::protobuf::ServiceDescriptorProtoGlobalsTypeInternal; +using ::google::protobuf::ServiceOptions; +using ::google::protobuf::ServiceOptionsGlobalsTypeInternal; +using ::google::protobuf::SimpleDescriptorDatabase; +using ::google::protobuf::SourceCodeInfo; +using ::google::protobuf::SourceCodeInfoGlobalsTypeInternal; +using ::google::protobuf::SourceCodeInfo_Location; +using ::google::protobuf::SourceCodeInfo_LocationGlobalsTypeInternal; +using ::google::protobuf::SourceContext; +using ::google::protobuf::SourceContextGlobalsTypeInternal; +using ::google::protobuf::SourceLocation; +using ::google::protobuf::StringValue; +using ::google::protobuf::StringValueGlobalsTypeInternal; +using ::google::protobuf::Struct; +using ::google::protobuf::StructGlobalsTypeInternal; +using ::google::protobuf::Struct_FieldsEntry_DoNotUse; +using ::google::protobuf::Struct_FieldsEntry_DoNotUseGlobalsTypeInternal; +using ::google::protobuf::Symbol; +using ::google::protobuf::SymbolChecker; +using ::google::protobuf::SymbolCheckerError; +using ::google::protobuf::SymbolCheckerErrorType; +using ::google::protobuf::SymbolVisibility; +using ::google::protobuf::Syntax; +using ::google::protobuf::TextFormat; +using ::google::protobuf::Timestamp; +using ::google::protobuf::TimestampGlobalsTypeInternal; +using ::google::protobuf::Type; +using ::google::protobuf::TypeGlobalsTypeInternal; +using ::google::protobuf::TypeId; +using ::google::protobuf::UInt32Value; +using ::google::protobuf::UInt32ValueGlobalsTypeInternal; +using ::google::protobuf::UInt64Value; +using ::google::protobuf::UInt64ValueGlobalsTypeInternal; +using ::google::protobuf::UninterpretedOption; +using ::google::protobuf::UninterpretedOptionGlobalsTypeInternal; +using ::google::protobuf::UninterpretedOption_NamePart; +using ::google::protobuf::UninterpretedOption_NamePartGlobalsTypeInternal; +using ::google::protobuf::UnknownField; +using ::google::protobuf::UnknownFieldSet; +using ::google::protobuf::Value; +using ::google::protobuf::ValueGlobalsTypeInternal; +using ::google::protobuf::WeakRepeatedPtrField; +using ::google::protobuf::int16; +using ::google::protobuf::int32; +using ::google::protobuf::int64; +using ::google::protobuf::int8; +using ::google::protobuf::is_proto_enum; +using ::google::protobuf::uint; +using ::google::protobuf::uint16; +using ::google::protobuf::uint32; +using ::google::protobuf::uint64; +using ::google::protobuf::uint8; +// enumerators of unscoped enumerations (133) +using ::google::protobuf::EDITION_1_TEST_ONLY; +using ::google::protobuf::EDITION_2023; +using ::google::protobuf::EDITION_2024; +using ::google::protobuf::EDITION_2026; +using ::google::protobuf::EDITION_2_TEST_ONLY; +using ::google::protobuf::EDITION_99997_TEST_ONLY; +using ::google::protobuf::EDITION_99998_TEST_ONLY; +using ::google::protobuf::EDITION_99999_TEST_ONLY; +using ::google::protobuf::EDITION_LEGACY; +using ::google::protobuf::EDITION_MAX; +using ::google::protobuf::EDITION_PROTO2; +using ::google::protobuf::EDITION_PROTO3; +using ::google::protobuf::EDITION_UNKNOWN; +using ::google::protobuf::EDITION_UNSTABLE; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_DECLARATION; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_UNVERIFIED; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_ENFORCE_NAMING_STYLE_UNKNOWN; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_STYLE2024; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_STYLE2026; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_STYLE_LEGACY; +using ::google::protobuf::FeatureSet_EnumType_CLOSED; +using ::google::protobuf::FeatureSet_EnumType_ENUM_TYPE_UNKNOWN; +using ::google::protobuf::FeatureSet_EnumType_OPEN; +using ::google::protobuf::FeatureSet_FieldPresence_EXPLICIT; +using ::google::protobuf::FeatureSet_FieldPresence_FIELD_PRESENCE_UNKNOWN; +using ::google::protobuf::FeatureSet_FieldPresence_IMPLICIT; +using ::google::protobuf::FeatureSet_FieldPresence_LEGACY_REQUIRED; +using ::google::protobuf::FeatureSet_JsonFormat_ALLOW; +using ::google::protobuf::FeatureSet_JsonFormat_JSON_FORMAT_UNKNOWN; +using ::google::protobuf::FeatureSet_JsonFormat_LEGACY_BEST_EFFORT; +using ::google::protobuf::FeatureSet_MessageEncoding_DELIMITED; +using ::google::protobuf::FeatureSet_MessageEncoding_LENGTH_PREFIXED; +using ::google::protobuf::FeatureSet_MessageEncoding_MESSAGE_ENCODING_UNKNOWN; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_EXPANDED; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_PACKED; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_REPEATED_FIELD_ENCODING_UNKNOWN; +using ::google::protobuf::FeatureSet_Utf8Validation_NONE; +using ::google::protobuf::FeatureSet_Utf8Validation_UTF8_VALIDATION_UNKNOWN; +using ::google::protobuf::FeatureSet_Utf8Validation_VERIFY; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_EXPORT_ALL; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_EXPORT_TOP_LEVEL; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_LOCAL_ALL; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_STRICT; +using ::google::protobuf::FieldDescriptorProto_Label_LABEL_OPTIONAL; +using ::google::protobuf::FieldDescriptorProto_Label_LABEL_REPEATED; +using ::google::protobuf::FieldDescriptorProto_Label_LABEL_REQUIRED; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_BOOL; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_BYTES; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_DOUBLE; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_ENUM; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_FIXED32; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_FIXED64; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_FLOAT; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_GROUP; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_INT32; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_INT64; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_MESSAGE; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_SFIXED32; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_SFIXED64; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_SINT32; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_SINT64; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_STRING; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_UINT32; +using ::google::protobuf::FieldDescriptorProto_Type_TYPE_UINT64; +using ::google::protobuf::FieldOptions_CType_CORD; +using ::google::protobuf::FieldOptions_CType_STRING; +using ::google::protobuf::FieldOptions_CType_STRING_PIECE; +using ::google::protobuf::FieldOptions_JSType_JS_NORMAL; +using ::google::protobuf::FieldOptions_JSType_JS_NUMBER; +using ::google::protobuf::FieldOptions_JSType_JS_STRING; +using ::google::protobuf::FieldOptions_OptionRetention_RETENTION_RUNTIME; +using ::google::protobuf::FieldOptions_OptionRetention_RETENTION_SOURCE; +using ::google::protobuf::FieldOptions_OptionRetention_RETENTION_UNKNOWN; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_ENUM; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_ENUM_ENTRY; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_EXTENSION_RANGE; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_FIELD; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_FILE; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_MESSAGE; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_METHOD; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_ONEOF; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_SERVICE; +using ::google::protobuf::FieldOptions_OptionTargetType_TARGET_TYPE_UNKNOWN; +using ::google::protobuf::Field_Cardinality_CARDINALITY_OPTIONAL; +using ::google::protobuf::Field_Cardinality_CARDINALITY_REPEATED; +using ::google::protobuf::Field_Cardinality_CARDINALITY_REQUIRED; +using ::google::protobuf::Field_Cardinality_CARDINALITY_UNKNOWN; +using ::google::protobuf::Field_Cardinality_Field_Cardinality_INT_MAX_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::Field_Cardinality_Field_Cardinality_INT_MIN_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::Field_Kind_Field_Kind_INT_MAX_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::Field_Kind_Field_Kind_INT_MIN_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::Field_Kind_TYPE_BOOL; +using ::google::protobuf::Field_Kind_TYPE_BYTES; +using ::google::protobuf::Field_Kind_TYPE_DOUBLE; +using ::google::protobuf::Field_Kind_TYPE_ENUM; +using ::google::protobuf::Field_Kind_TYPE_FIXED32; +using ::google::protobuf::Field_Kind_TYPE_FIXED64; +using ::google::protobuf::Field_Kind_TYPE_FLOAT; +using ::google::protobuf::Field_Kind_TYPE_GROUP; +using ::google::protobuf::Field_Kind_TYPE_INT32; +using ::google::protobuf::Field_Kind_TYPE_INT64; +using ::google::protobuf::Field_Kind_TYPE_MESSAGE; +using ::google::protobuf::Field_Kind_TYPE_SFIXED32; +using ::google::protobuf::Field_Kind_TYPE_SFIXED64; +using ::google::protobuf::Field_Kind_TYPE_SINT32; +using ::google::protobuf::Field_Kind_TYPE_SINT64; +using ::google::protobuf::Field_Kind_TYPE_STRING; +using ::google::protobuf::Field_Kind_TYPE_UINT32; +using ::google::protobuf::Field_Kind_TYPE_UINT64; +using ::google::protobuf::Field_Kind_TYPE_UNKNOWN; +using ::google::protobuf::FileOptions_OptimizeMode_CODE_SIZE; +using ::google::protobuf::FileOptions_OptimizeMode_LITE_RUNTIME; +using ::google::protobuf::FileOptions_OptimizeMode_SPEED; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_ALIAS; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_NONE; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_SET; +using ::google::protobuf::MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN; +using ::google::protobuf::MethodOptions_IdempotencyLevel_IDEMPOTENT; +using ::google::protobuf::MethodOptions_IdempotencyLevel_NO_SIDE_EFFECTS; +using ::google::protobuf::NESTED_ENUM_STRICT_VIOLATION; +using ::google::protobuf::NESTED_MESSAGE_STRICT_VIOLATION; +using ::google::protobuf::NULL_VALUE; +using ::google::protobuf::NullValue_INT_MAX_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::NullValue_INT_MIN_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::SYNTAX_EDITIONS; +using ::google::protobuf::SYNTAX_PROTO2; +using ::google::protobuf::SYNTAX_PROTO3; +using ::google::protobuf::Syntax_INT_MAX_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::Syntax_INT_MIN_SENTINEL_DO_NOT_USE_; +using ::google::protobuf::VISIBILITY_EXPORT; +using ::google::protobuf::VISIBILITY_LOCAL; +using ::google::protobuf::VISIBILITY_UNSET; +// objects (217) +using ::google::protobuf::Any_class_data_; +using ::google::protobuf::Any_globals_; +using ::google::protobuf::Api_class_data_; +using ::google::protobuf::Api_globals_; +using ::google::protobuf::BoolValue_class_data_; +using ::google::protobuf::BoolValue_globals_; +using ::google::protobuf::BytesValue_class_data_; +using ::google::protobuf::BytesValue_globals_; +using ::google::protobuf::DescriptorProto_ExtensionRange_class_data_; +using ::google::protobuf::DescriptorProto_ExtensionRange_globals_; +using ::google::protobuf::DescriptorProto_ReservedRange_class_data_; +using ::google::protobuf::DescriptorProto_ReservedRange_globals_; +using ::google::protobuf::DescriptorProto_class_data_; +using ::google::protobuf::DescriptorProto_globals_; +using ::google::protobuf::DoubleValue_class_data_; +using ::google::protobuf::DoubleValue_globals_; +using ::google::protobuf::Duration_class_data_; +using ::google::protobuf::Duration_globals_; +using ::google::protobuf::Edition_MAX; +using ::google::protobuf::Edition_MIN; +using ::google::protobuf::Edition_internal_data_; +using ::google::protobuf::Empty_class_data_; +using ::google::protobuf::Empty_globals_; +using ::google::protobuf::EnumDescriptorProto_EnumReservedRange_class_data_; +using ::google::protobuf::EnumDescriptorProto_EnumReservedRange_globals_; +using ::google::protobuf::EnumDescriptorProto_class_data_; +using ::google::protobuf::EnumDescriptorProto_globals_; +using ::google::protobuf::EnumOptions_class_data_; +using ::google::protobuf::EnumOptions_globals_; +using ::google::protobuf::EnumValueDescriptorProto_class_data_; +using ::google::protobuf::EnumValueDescriptorProto_globals_; +using ::google::protobuf::EnumValueOptions_class_data_; +using ::google::protobuf::EnumValueOptions_globals_; +using ::google::protobuf::EnumValue_class_data_; +using ::google::protobuf::EnumValue_globals_; +using ::google::protobuf::Enum_class_data_; +using ::google::protobuf::Enum_globals_; +using ::google::protobuf::ExtensionRangeOptions_Declaration_class_data_; +using ::google::protobuf::ExtensionRangeOptions_Declaration_globals_; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_VerificationState_ARRAYSIZE; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_VerificationState_MAX; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_VerificationState_MIN; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_internal_data_; +using ::google::protobuf::ExtensionRangeOptions_class_data_; +using ::google::protobuf::ExtensionRangeOptions_globals_; +using ::google::protobuf::FeatureSetDefaults_FeatureSetEditionDefault_class_data_; +using ::google::protobuf::FeatureSetDefaults_FeatureSetEditionDefault_globals_; +using ::google::protobuf::FeatureSetDefaults_class_data_; +using ::google::protobuf::FeatureSetDefaults_globals_; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_EnforceNamingStyle_ARRAYSIZE; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_EnforceNamingStyle_MAX; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_EnforceNamingStyle_MIN; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_internal_data_; +using ::google::protobuf::FeatureSet_EnumType_EnumType_ARRAYSIZE; +using ::google::protobuf::FeatureSet_EnumType_EnumType_MAX; +using ::google::protobuf::FeatureSet_EnumType_EnumType_MIN; +using ::google::protobuf::FeatureSet_EnumType_internal_data_; +using ::google::protobuf::FeatureSet_FieldPresence_FieldPresence_ARRAYSIZE; +using ::google::protobuf::FeatureSet_FieldPresence_FieldPresence_MAX; +using ::google::protobuf::FeatureSet_FieldPresence_FieldPresence_MIN; +using ::google::protobuf::FeatureSet_FieldPresence_internal_data_; +using ::google::protobuf::FeatureSet_JsonFormat_JsonFormat_ARRAYSIZE; +using ::google::protobuf::FeatureSet_JsonFormat_JsonFormat_MAX; +using ::google::protobuf::FeatureSet_JsonFormat_JsonFormat_MIN; +using ::google::protobuf::FeatureSet_JsonFormat_internal_data_; +using ::google::protobuf::FeatureSet_MessageEncoding_MessageEncoding_ARRAYSIZE; +using ::google::protobuf::FeatureSet_MessageEncoding_MessageEncoding_MAX; +using ::google::protobuf::FeatureSet_MessageEncoding_MessageEncoding_MIN; +using ::google::protobuf::FeatureSet_MessageEncoding_internal_data_; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_ARRAYSIZE; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MAX; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MIN; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_internal_data_; +using ::google::protobuf::FeatureSet_Utf8Validation_Utf8Validation_ARRAYSIZE; +using ::google::protobuf::FeatureSet_Utf8Validation_Utf8Validation_MAX; +using ::google::protobuf::FeatureSet_Utf8Validation_Utf8Validation_MIN; +using ::google::protobuf::FeatureSet_Utf8Validation_internal_data_; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_ARRAYSIZE; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_MAX; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_MIN; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_internal_data_; +using ::google::protobuf::FeatureSet_VisibilityFeature_class_data_; +using ::google::protobuf::FeatureSet_VisibilityFeature_globals_; +using ::google::protobuf::FeatureSet_class_data_; +using ::google::protobuf::FeatureSet_globals_; +using ::google::protobuf::FieldDescriptorProto_Label_Label_ARRAYSIZE; +using ::google::protobuf::FieldDescriptorProto_Label_Label_MAX; +using ::google::protobuf::FieldDescriptorProto_Label_Label_MIN; +using ::google::protobuf::FieldDescriptorProto_Label_internal_data_; +using ::google::protobuf::FieldDescriptorProto_Type_Type_ARRAYSIZE; +using ::google::protobuf::FieldDescriptorProto_Type_Type_MAX; +using ::google::protobuf::FieldDescriptorProto_Type_Type_MIN; +using ::google::protobuf::FieldDescriptorProto_Type_internal_data_; +using ::google::protobuf::FieldDescriptorProto_class_data_; +using ::google::protobuf::FieldDescriptorProto_globals_; +using ::google::protobuf::FieldMask_class_data_; +using ::google::protobuf::FieldMask_globals_; +using ::google::protobuf::FieldOptions_CType_CType_ARRAYSIZE; +using ::google::protobuf::FieldOptions_CType_CType_MAX; +using ::google::protobuf::FieldOptions_CType_CType_MIN; +using ::google::protobuf::FieldOptions_CType_internal_data_; +using ::google::protobuf::FieldOptions_EditionDefault_class_data_; +using ::google::protobuf::FieldOptions_EditionDefault_globals_; +using ::google::protobuf::FieldOptions_FeatureSupport_class_data_; +using ::google::protobuf::FieldOptions_FeatureSupport_globals_; +using ::google::protobuf::FieldOptions_JSType_JSType_ARRAYSIZE; +using ::google::protobuf::FieldOptions_JSType_JSType_MAX; +using ::google::protobuf::FieldOptions_JSType_JSType_MIN; +using ::google::protobuf::FieldOptions_JSType_internal_data_; +using ::google::protobuf::FieldOptions_OptionRetention_OptionRetention_ARRAYSIZE; +using ::google::protobuf::FieldOptions_OptionRetention_OptionRetention_MAX; +using ::google::protobuf::FieldOptions_OptionRetention_OptionRetention_MIN; +using ::google::protobuf::FieldOptions_OptionRetention_internal_data_; +using ::google::protobuf::FieldOptions_OptionTargetType_OptionTargetType_ARRAYSIZE; +using ::google::protobuf::FieldOptions_OptionTargetType_OptionTargetType_MAX; +using ::google::protobuf::FieldOptions_OptionTargetType_OptionTargetType_MIN; +using ::google::protobuf::FieldOptions_OptionTargetType_internal_data_; +using ::google::protobuf::FieldOptions_class_data_; +using ::google::protobuf::FieldOptions_globals_; +using ::google::protobuf::Field_Cardinality_Cardinality_ARRAYSIZE; +using ::google::protobuf::Field_Cardinality_Cardinality_MAX; +using ::google::protobuf::Field_Cardinality_Cardinality_MIN; +using ::google::protobuf::Field_Cardinality_internal_data_; +using ::google::protobuf::Field_Kind_Kind_ARRAYSIZE; +using ::google::protobuf::Field_Kind_Kind_MAX; +using ::google::protobuf::Field_Kind_Kind_MIN; +using ::google::protobuf::Field_Kind_internal_data_; +using ::google::protobuf::Field_class_data_; +using ::google::protobuf::Field_globals_; +using ::google::protobuf::FileDescriptorProto_class_data_; +using ::google::protobuf::FileDescriptorProto_globals_; +using ::google::protobuf::FileDescriptorSet_class_data_; +using ::google::protobuf::FileDescriptorSet_globals_; +using ::google::protobuf::FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE; +using ::google::protobuf::FileOptions_OptimizeMode_OptimizeMode_MAX; +using ::google::protobuf::FileOptions_OptimizeMode_OptimizeMode_MIN; +using ::google::protobuf::FileOptions_OptimizeMode_internal_data_; +using ::google::protobuf::FileOptions_class_data_; +using ::google::protobuf::FileOptions_globals_; +using ::google::protobuf::FloatValue_class_data_; +using ::google::protobuf::FloatValue_globals_; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_Semantic_ARRAYSIZE; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_Semantic_MAX; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_Semantic_MIN; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_internal_data_; +using ::google::protobuf::GeneratedCodeInfo_Annotation_class_data_; +using ::google::protobuf::GeneratedCodeInfo_Annotation_globals_; +using ::google::protobuf::GeneratedCodeInfo_class_data_; +using ::google::protobuf::GeneratedCodeInfo_globals_; +using ::google::protobuf::Int32Value_class_data_; +using ::google::protobuf::Int32Value_globals_; +using ::google::protobuf::Int64Value_class_data_; +using ::google::protobuf::Int64Value_globals_; +using ::google::protobuf::ListValue_class_data_; +using ::google::protobuf::ListValue_globals_; +using ::google::protobuf::MessageOptions_class_data_; +using ::google::protobuf::MessageOptions_globals_; +using ::google::protobuf::MethodDescriptorProto_class_data_; +using ::google::protobuf::MethodDescriptorProto_globals_; +using ::google::protobuf::MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE; +using ::google::protobuf::MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX; +using ::google::protobuf::MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN; +using ::google::protobuf::MethodOptions_IdempotencyLevel_internal_data_; +using ::google::protobuf::MethodOptions_class_data_; +using ::google::protobuf::MethodOptions_globals_; +using ::google::protobuf::Method_class_data_; +using ::google::protobuf::Method_globals_; +using ::google::protobuf::Mixin_class_data_; +using ::google::protobuf::Mixin_globals_; +using ::google::protobuf::NullValue_ARRAYSIZE; +using ::google::protobuf::NullValue_MAX; +using ::google::protobuf::NullValue_MIN; +using ::google::protobuf::NullValue_internal_data_; +using ::google::protobuf::OneofDescriptorProto_class_data_; +using ::google::protobuf::OneofDescriptorProto_globals_; +using ::google::protobuf::OneofOptions_class_data_; +using ::google::protobuf::OneofOptions_globals_; +using ::google::protobuf::Option_class_data_; +using ::google::protobuf::Option_globals_; +using ::google::protobuf::ServiceDescriptorProto_class_data_; +using ::google::protobuf::ServiceDescriptorProto_globals_; +using ::google::protobuf::ServiceOptions_class_data_; +using ::google::protobuf::ServiceOptions_globals_; +using ::google::protobuf::SourceCodeInfo_Location_class_data_; +using ::google::protobuf::SourceCodeInfo_Location_globals_; +using ::google::protobuf::SourceCodeInfo_class_data_; +using ::google::protobuf::SourceCodeInfo_globals_; +using ::google::protobuf::SourceContext_class_data_; +using ::google::protobuf::SourceContext_globals_; +using ::google::protobuf::StringValue_class_data_; +using ::google::protobuf::StringValue_globals_; +using ::google::protobuf::Struct_FieldsEntry_DoNotUse_class_data_; +using ::google::protobuf::Struct_FieldsEntry_DoNotUse_globals_; +using ::google::protobuf::Struct_class_data_; +using ::google::protobuf::Struct_globals_; +using ::google::protobuf::SymbolVisibility_ARRAYSIZE; +using ::google::protobuf::SymbolVisibility_MAX; +using ::google::protobuf::SymbolVisibility_MIN; +using ::google::protobuf::SymbolVisibility_internal_data_; +using ::google::protobuf::Syntax_ARRAYSIZE; +using ::google::protobuf::Syntax_MAX; +using ::google::protobuf::Syntax_MIN; +using ::google::protobuf::Syntax_internal_data_; +using ::google::protobuf::Timestamp_class_data_; +using ::google::protobuf::Timestamp_globals_; +using ::google::protobuf::Type_class_data_; +using ::google::protobuf::Type_globals_; +using ::google::protobuf::UInt32Value_class_data_; +using ::google::protobuf::UInt32Value_globals_; +using ::google::protobuf::UInt64Value_class_data_; +using ::google::protobuf::UInt64Value_globals_; +using ::google::protobuf::UninterpretedOption_NamePart_class_data_; +using ::google::protobuf::UninterpretedOption_NamePart_globals_; +using ::google::protobuf::UninterpretedOption_class_data_; +using ::google::protobuf::UninterpretedOption_globals_; +using ::google::protobuf::Value_class_data_; +using ::google::protobuf::Value_globals_; +// functions and operators (130) +using ::google::protobuf::AbslStringify; +using ::google::protobuf::AllocatedRepeatedPtrFieldBackInserter; +using ::google::protobuf::DoNothing; +using ::google::protobuf::DownCastMessage; +using ::google::protobuf::DownCastToGenerated; +using ::google::protobuf::DynamicCastMessage; +using ::google::protobuf::DynamicCastToGenerated; +using ::google::protobuf::Edition_IsValid; +using ::google::protobuf::Edition_Name; +using ::google::protobuf::Edition_Parse; +using ::google::protobuf::Edition_descriptor; +using ::google::protobuf::EnumerateEnumValues; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_IsValid; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_Name; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_Parse; +using ::google::protobuf::ExtensionRangeOptions_VerificationState_descriptor; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_IsValid; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_Name; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_Parse; +using ::google::protobuf::FeatureSet_EnforceNamingStyle_descriptor; +using ::google::protobuf::FeatureSet_EnumType_IsValid; +using ::google::protobuf::FeatureSet_EnumType_Name; +using ::google::protobuf::FeatureSet_EnumType_Parse; +using ::google::protobuf::FeatureSet_EnumType_descriptor; +using ::google::protobuf::FeatureSet_FieldPresence_IsValid; +using ::google::protobuf::FeatureSet_FieldPresence_Name; +using ::google::protobuf::FeatureSet_FieldPresence_Parse; +using ::google::protobuf::FeatureSet_FieldPresence_descriptor; +using ::google::protobuf::FeatureSet_JsonFormat_IsValid; +using ::google::protobuf::FeatureSet_JsonFormat_Name; +using ::google::protobuf::FeatureSet_JsonFormat_Parse; +using ::google::protobuf::FeatureSet_JsonFormat_descriptor; +using ::google::protobuf::FeatureSet_MessageEncoding_IsValid; +using ::google::protobuf::FeatureSet_MessageEncoding_Name; +using ::google::protobuf::FeatureSet_MessageEncoding_Parse; +using ::google::protobuf::FeatureSet_MessageEncoding_descriptor; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_IsValid; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_Name; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_Parse; +using ::google::protobuf::FeatureSet_RepeatedFieldEncoding_descriptor; +using ::google::protobuf::FeatureSet_Utf8Validation_IsValid; +using ::google::protobuf::FeatureSet_Utf8Validation_Name; +using ::google::protobuf::FeatureSet_Utf8Validation_Parse; +using ::google::protobuf::FeatureSet_Utf8Validation_descriptor; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_IsValid; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_Name; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_Parse; +using ::google::protobuf::FeatureSet_VisibilityFeature_DefaultSymbolVisibility_descriptor; +using ::google::protobuf::FieldDescriptorProto_Label_IsValid; +using ::google::protobuf::FieldDescriptorProto_Label_Name; +using ::google::protobuf::FieldDescriptorProto_Label_Parse; +using ::google::protobuf::FieldDescriptorProto_Label_descriptor; +using ::google::protobuf::FieldDescriptorProto_Type_IsValid; +using ::google::protobuf::FieldDescriptorProto_Type_Name; +using ::google::protobuf::FieldDescriptorProto_Type_Parse; +using ::google::protobuf::FieldDescriptorProto_Type_descriptor; +using ::google::protobuf::FieldOptions_CType_IsValid; +using ::google::protobuf::FieldOptions_CType_Name; +using ::google::protobuf::FieldOptions_CType_Parse; +using ::google::protobuf::FieldOptions_CType_descriptor; +using ::google::protobuf::FieldOptions_JSType_IsValid; +using ::google::protobuf::FieldOptions_JSType_Name; +using ::google::protobuf::FieldOptions_JSType_Parse; +using ::google::protobuf::FieldOptions_JSType_descriptor; +using ::google::protobuf::FieldOptions_OptionRetention_IsValid; +using ::google::protobuf::FieldOptions_OptionRetention_Name; +using ::google::protobuf::FieldOptions_OptionRetention_Parse; +using ::google::protobuf::FieldOptions_OptionRetention_descriptor; +using ::google::protobuf::FieldOptions_OptionTargetType_IsValid; +using ::google::protobuf::FieldOptions_OptionTargetType_Name; +using ::google::protobuf::FieldOptions_OptionTargetType_Parse; +using ::google::protobuf::FieldOptions_OptionTargetType_descriptor; +using ::google::protobuf::Field_Cardinality_IsValid; +using ::google::protobuf::Field_Cardinality_Name; +using ::google::protobuf::Field_Cardinality_Parse; +using ::google::protobuf::Field_Cardinality_descriptor; +using ::google::protobuf::Field_Kind_IsValid; +using ::google::protobuf::Field_Kind_Name; +using ::google::protobuf::Field_Kind_Parse; +using ::google::protobuf::Field_Kind_descriptor; +using ::google::protobuf::FileOptions_OptimizeMode_IsValid; +using ::google::protobuf::FileOptions_OptimizeMode_Name; +using ::google::protobuf::FileOptions_OptimizeMode_Parse; +using ::google::protobuf::FileOptions_OptimizeMode_descriptor; +using ::google::protobuf::GOOGLE_UNALIGNED_LOAD16; +using ::google::protobuf::GOOGLE_UNALIGNED_LOAD32; +using ::google::protobuf::GOOGLE_UNALIGNED_LOAD64; +using ::google::protobuf::GOOGLE_UNALIGNED_STORE16; +using ::google::protobuf::GOOGLE_UNALIGNED_STORE32; +using ::google::protobuf::GOOGLE_UNALIGNED_STORE64; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_IsValid; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_Name; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_Parse; +using ::google::protobuf::GeneratedCodeInfo_Annotation_Semantic_descriptor; +using ::google::protobuf::GetEnumDescriptor; +using ::google::protobuf::GetExtensionReflection; +using ::google::protobuf::LinkExtensionReflection; +using ::google::protobuf::LinkMessageReflection; +using ::google::protobuf::MethodOptions_IdempotencyLevel_IsValid; +using ::google::protobuf::MethodOptions_IdempotencyLevel_Name; +using ::google::protobuf::MethodOptions_IdempotencyLevel_Parse; +using ::google::protobuf::MethodOptions_IdempotencyLevel_descriptor; +using ::google::protobuf::NewCallback; +using ::google::protobuf::NewPermanentCallback; +using ::google::protobuf::NullValue_IsValid; +using ::google::protobuf::NullValue_Name; +using ::google::protobuf::NullValue_Parse; +using ::google::protobuf::NullValue_descriptor; +using ::google::protobuf::ProtobufInternalGetEnumDescriptor; +using ::google::protobuf::RepeatedFieldBackInserter; +using ::google::protobuf::RepeatedPtrFieldBackInserter; +using ::google::protobuf::ShortFormat; +using ::google::protobuf::ShutdownProtobufLibrary; +using ::google::protobuf::SymbolVisibility_IsValid; +using ::google::protobuf::SymbolVisibility_Name; +using ::google::protobuf::SymbolVisibility_Parse; +using ::google::protobuf::SymbolVisibility_descriptor; +using ::google::protobuf::Syntax_IsValid; +using ::google::protobuf::Syntax_Name; +using ::google::protobuf::Syntax_Parse; +using ::google::protobuf::Syntax_descriptor; +using ::google::protobuf::UnsafeArenaAllocatedRepeatedPtrFieldBackInserter; +using ::google::protobuf::Utf8Format; +using ::google::protobuf::c_sort; +using ::google::protobuf::c_stable_sort; +using ::google::protobuf::erase; +using ::google::protobuf::erase_if; +using ::google::protobuf::ghtonl; +using ::google::protobuf::sort; +using ::google::protobuf::stable_sort; +// names protobuf re-declares from another namespace (2) +using ::google::protobuf::AbslParseFlag; +using ::google::protobuf::AbslUnparseFlag; +} // namespace google::protobuf + +export namespace google::protobuf::internal { +// operators of public types declared in an implementation namespace, for argument-dependent lookup (1) +using ::google::protobuf::internal::operator|; +} // namespace google::protobuf::internal diff --git a/src/util.cppm b/src/util.cppm new file mode 100644 index 0000000..f5eaca2 --- /dev/null +++ b/src/util.cppm @@ -0,0 +1,84 @@ +// Written by tools/surface.py from tools/surface.json; tools/check_exports.py audits it. Do not edit by hand. + +// mcpplibs.mwrap.protobuf.util — JSON, MessageDifferencer, TimeUtil, FieldMaskUtil, delimited messages and type resolvers (protobuf 35.1), unchanged: +// each name is a using-declaration of the upstream entity in the namespace upstream declares it in. +module; +#include "detail/prelude.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "detail/epilogue.hpp" + +export module mcpplibs.mwrap.protobuf.util; + +export namespace google::protobuf { +// functions and operators (17) +using ::google::protobuf::operator!=; +using ::google::protobuf::operator%; +using ::google::protobuf::operator%=; +using ::google::protobuf::operator*; +using ::google::protobuf::operator*=; +using ::google::protobuf::operator+; +using ::google::protobuf::operator+=; +using ::google::protobuf::operator-; +using ::google::protobuf::operator-=; +using ::google::protobuf::operator/; +using ::google::protobuf::operator/=; +using ::google::protobuf::operator<; +using ::google::protobuf::operator<<; +using ::google::protobuf::operator<=; +using ::google::protobuf::operator==; +using ::google::protobuf::operator>; +using ::google::protobuf::operator>=; +} // namespace google::protobuf + +export namespace google::protobuf::json { +// types (2) +using ::google::protobuf::json::ParseOptions; +using ::google::protobuf::json::PrintOptions; +// functions and operators (8) +using ::google::protobuf::json::BinaryToJsonStream; +using ::google::protobuf::json::BinaryToJsonString; +using ::google::protobuf::json::JsonStreamToMessage; +using ::google::protobuf::json::JsonStringToMessage; +using ::google::protobuf::json::JsonToBinaryStream; +using ::google::protobuf::json::JsonToBinaryString; +using ::google::protobuf::json::MessageToJsonStream; +using ::google::protobuf::json::MessageToJsonString; +} // namespace google::protobuf::json + +export namespace google::protobuf::util { +// types (10) +using ::google::protobuf::util::DefaultFieldComparator; +using ::google::protobuf::util::FieldComparator; +using ::google::protobuf::util::FieldContext; +using ::google::protobuf::util::FieldMaskUtil; +using ::google::protobuf::util::JsonParseOptions; +using ::google::protobuf::util::JsonPrintOptions; +using ::google::protobuf::util::MessageDifferencer; +using ::google::protobuf::util::SimpleFieldComparator; +using ::google::protobuf::util::TimeUtil; +using ::google::protobuf::util::TypeResolver; +// functions and operators (8) +using ::google::protobuf::util::ConvertDescriptorToType; +using ::google::protobuf::util::NewTypeResolverForDescriptorPool; +using ::google::protobuf::util::ParseDelimitedFromCodedStream; +using ::google::protobuf::util::ParseDelimitedFromZeroCopyStream; +using ::google::protobuf::util::SerializeDelimitedToCodedStream; +using ::google::protobuf::util::SerializeDelimitedToFileDescriptor; +using ::google::protobuf::util::SerializeDelimitedToOstream; +using ::google::protobuf::util::SerializeDelimitedToZeroCopyStream; +// names protobuf re-declares from another namespace (6) +using ::google::protobuf::util::BinaryToJsonStream; +using ::google::protobuf::util::BinaryToJsonString; +using ::google::protobuf::util::JsonStringToMessage; +using ::google::protobuf::util::JsonToBinaryStream; +using ::google::protobuf::util::JsonToBinaryString; +using ::google::protobuf::util::MessageToJsonString; +} // namespace google::protobuf::util diff --git a/templates/codegen/build.mcpp.in b/templates/codegen/build.mcpp.in new file mode 100644 index 0000000..5f5b1ab --- /dev/null +++ b/templates/codegen/build.mcpp.in @@ -0,0 +1,9 @@ +// Code generation: every .proto under proto/ becomes one build-graph edge that +// runs protoc (C++ messages, .pb.h / .pb.cc). Add a .proto to +// proto/ and build; nothing here changes. +import mcpp; +import protogen; + +int main() { + return protogen::generate_all() ? 0 : 1; +} diff --git a/templates/codegen/mcpp.toml.in b/templates/codegen/mcpp.toml.in new file mode 100644 index 0000000..7c999de --- /dev/null +++ b/templates/codegen/mcpp.toml.in @@ -0,0 +1,12 @@ +[package] +name = "{{project.name}}" +version = "0.1.0" + +[targets.{{project.name}}] +kind = "bin" +main = "src/main.cpp" + +# `codegen` hands this project protoc, built for this machine from the same +# protobuf release it links, and the `protogen` rule build.mcpp imports. +[dependencies] +{{self.name}} = { version = "{{self.version}}", features = ["codegen"] } diff --git a/templates/codegen/proto/addressbook.proto b/templates/codegen/proto/addressbook.proto new file mode 100644 index 0000000..430935c --- /dev/null +++ b/templates/codegen/proto/addressbook.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package tutorial; + +import "google/protobuf/timestamp.proto"; + +message Person { + string name = 1; + int32 id = 2; + string email = 3; + + enum PhoneType { + PHONE_TYPE_UNSPECIFIED = 0; + PHONE_TYPE_MOBILE = 1; + PHONE_TYPE_HOME = 2; + PHONE_TYPE_WORK = 3; + } + + message PhoneNumber { + string number = 1; + PhoneType type = 2; + } + + repeated PhoneNumber phones = 4; + google.protobuf.Timestamp last_updated = 5; +} + +message AddressBook { + repeated Person people = 1; +} diff --git a/templates/codegen/src/main.cpp.in b/templates/codegen/src/main.cpp.in new file mode 100644 index 0000000..4a131ee --- /dev/null +++ b/templates/codegen/src/main.cpp.in @@ -0,0 +1,36 @@ +// Generated code with the module: addressbook.pb.h is produced from +// proto/addressbook.proto by protoc during the build. A translation unit that +// includes generated headers includes the prelude first (every header the +// modules include), then the generated ones, then imports (GCC needs every +// #include before the first import). +#include +#include "addressbook.pb.h" + +import std; +import mcpplibs.mwrap.protobuf; + +namespace gpb = google::protobuf; // (generated code declares its own `pb`) + +int main() { + tutorial::AddressBook book; + tutorial::Person* ada = book.add_people(); + ada->set_name("Ada Lovelace"); + ada->set_id(1815); + ada->set_email("ada@example.org"); + tutorial::Person::PhoneNumber* phone = ada->add_phones(); + phone->set_number("+44 20 0000 0000"); + phone->set_type(tutorial::Person::PHONE_TYPE_HOME); + gpb::util::TimeUtil::FromString("1843-07-01T00:00:00Z", ada->mutable_last_updated()); + + const std::string wire = book.SerializeAsString(); + std::string json; + (void)gpb::json::MessageToJsonString(book, &json); + std::println("{} bytes on the wire\n{}", wire.size(), json); + + tutorial::AddressBook back; + const bool ok = back.ParseFromString(wire) && gpb::util::MessageDifferencer::Equals(book, back) && + back.people(0).phones(0).type() == tutorial::Person::PHONE_TYPE_HOME && + tutorial::Person::descriptor()->full_name() == "tutorial.Person"; + std::println("{}", ok ? "read back: equal" : "read back: DIFFERENT"); + return ok ? 0 : 1; +} diff --git a/templates/codegen/template.toml b/templates/codegen/template.toml new file mode 100644 index 0000000..fd8d0f2 --- /dev/null +++ b/templates/codegen/template.toml @@ -0,0 +1,3 @@ +[template] +description = "Generated code: proto/*.proto compiled by protoc during the build (protogen), used with import mcpplibs.mwrap.protobuf" +post_message = "Run `mcpp run`. The .pb.h/.pb.cc are not checked in: mcpp builds protoc from the protobuf release you link and generates them during the build. Add a .proto to proto/ and build. (Not on Windows: protoc is not built there.)" diff --git a/templates/message/mcpp.toml.in b/templates/message/mcpp.toml.in new file mode 100644 index 0000000..43c2cea --- /dev/null +++ b/templates/message/mcpp.toml.in @@ -0,0 +1,10 @@ +[package] +name = "{{project.name}}" +version = "0.1.0" + +[targets.{{project.name}}] +kind = "bin" +main = "src/main.cpp" + +[dependencies] +{{self.name}} = "{{self.version}}" diff --git a/templates/message/src/main.cpp.in b/templates/message/src/main.cpp.in new file mode 100644 index 0000000..e88cee0 --- /dev/null +++ b/templates/message/src/main.cpp.in @@ -0,0 +1,73 @@ +// A message type described at run time and used through reflection — no protoc, +// no generated code: protobuf's descriptors are messages themselves. Its wire +// bytes, text and JSON forms are printed and read back; then the well-known +// types: Timestamp and Duration arithmetic, Struct as JSON, Any. +import std; +import mcpplibs.mwrap.protobuf; + +namespace pb = google::protobuf; + +int main() { + // demo.Person { string name = 1; int32 id = 2; repeated string email = 3; } + pb::FileDescriptorProto file; + file.set_name("person.proto"); + file.set_package("demo"); + file.set_syntax("proto3"); + pb::DescriptorProto* person = file.add_message_type(); + person->set_name("Person"); + auto field = [&](const char* name, int number, pb::FieldDescriptorProto::Type type, bool repeated) { + pb::FieldDescriptorProto* f = person->add_field(); + f->set_name(name); + f->set_json_name(name); + f->set_number(number); + f->set_type(type); + f->set_label(repeated ? pb::FieldDescriptorProto::LABEL_REPEATED : pb::FieldDescriptorProto::LABEL_OPTIONAL); + }; + field("name", 1, pb::FieldDescriptorProto::TYPE_STRING, false); + field("id", 2, pb::FieldDescriptorProto::TYPE_INT32, false); + field("email", 3, pb::FieldDescriptorProto::TYPE_STRING, true); + + pb::DescriptorPool pool; + const pb::Descriptor* type = pool.BuildFile(file)->FindMessageTypeByName("Person"); + pb::DynamicMessageFactory factory(&pool); + std::unique_ptr ada(factory.GetPrototype(type)->New()); + const pb::Reflection* reflection = ada->GetReflection(); + reflection->SetString(ada.get(), type->FindFieldByName("name"), "Ada"); + reflection->SetInt32(ada.get(), type->FindFieldByName("id"), 7); + reflection->AddString(ada.get(), type->FindFieldByName("email"), "ada@example.org"); + + std::string wire, text, json; + ada->SerializeToString(&wire); + pb::TextFormat::PrintToString(*ada, &text); + (void)pb::json::MessageToJsonString(*ada, &json); + std::print("{} — {} bytes on the wire:", type->full_name(), wire.size()); + for (unsigned char c : wire) std::print(" {:02x}", c); + std::println("\ntext: {}json: {}", text, json); + + std::unique_ptr back(ada->New()); + const bool json_ok = pb::json::JsonStringToMessage(json, back.get()).ok(); + const bool same = json_ok && pb::util::MessageDifferencer::Equals(*ada, *back); + std::println("read back from JSON: {}", same ? "equal" : "DIFFERENT"); + + pb::Timestamp start; + pb::util::TimeUtil::FromString("2026-11-19T08:30:00Z", &start); + const pb::Duration ninety = pb::util::TimeUtil::SecondsToDuration(90); + std::println("{} + {} = {}", pb::util::TimeUtil::ToString(start), pb::util::TimeUtil::ToString(ninety), + pb::util::TimeUtil::ToString(start + ninety)); + + pb::Struct object; + (*object.mutable_fields())["service"].set_string_value("demo"); + (*object.mutable_fields())["replicas"].set_number_value(3); + std::string object_json; + (void)pb::json::MessageToJsonString(object, &object_json); + std::println("Struct as JSON: {}", object_json); + + pb::Any any; + any.PackFrom(start); + pb::Timestamp unpacked; + const bool any_ok = any.Is() && any.UnpackTo(&unpacked) && unpacked.seconds() == start.seconds(); + std::println("Any holding {}: {}", any.type_url(), any_ok ? "unpacked" : "FAILED"); + + const bool ok = wire.size() == 24 && same && any_ok && pb::util::TimeUtil::ToString(start + ninety) == "2026-11-19T08:31:30Z"; + return ok ? 0 : 1; +} diff --git a/templates/message/template.toml b/templates/message/template.toml new file mode 100644 index 0000000..cdd417d --- /dev/null +++ b/templates/message/template.toml @@ -0,0 +1,4 @@ +[template] +description = "A message type made at run time: DynamicMessage, wire bytes, text, JSON and the well-known types with import mcpplibs.mwrap.protobuf" +default = true +post_message = "Run `mcpp run`. No protoc involved; for generated code use the `codegen` template." diff --git a/tests/abseil_identity_test.cpp b/tests/abseil_identity_test.cpp new file mode 100644 index 0000000..345315d --- /dev/null +++ b/tests/abseil_identity_test.cpp @@ -0,0 +1,37 @@ +// protobuf's API returns and takes Abseil types; this package exports no `absl` +// name, mcpplibs.mwrap.abseil does. With both imported, the status a protobuf +// function returns is that module's absl::Status — one type, one Abseil linked. +// +// GCC 16 workarounds, each seen in CI or locally: +// - the Abseil groups the test names are imported, not the root: the root +// brings mcpplibs.mwrap.abseil.log, whose import alone stops GCC with an +// internal compiler error emitting debug information (dwarf2out.cc, +// gen_enumeration_type_die); +// - the result type is checked on a local variable: a decltype of the call at +// namespace scope makes GCC report "conflicting type for imported +// declaration" for descriptor.h's members while merging the modules; +// - failures are reported with ADD_FAILURE rather than GoogleTest's assertion +// templates, for the same debug-information fault (seen on aarch64). +#include + +import std; +import mcpplibs.mwrap.protobuf; +import mcpplibs.mwrap.abseil.status; +import mcpplibs.mwrap.abseil.strings; + +namespace pb = google::protobuf; + +static_assert(std::is_same_v); + +TEST(Abseil, ProtobufStatusIsAbseilStatus) { + pb::Struct object; + auto bad = pb::json::JsonStringToMessage("{not json", &object); + static_assert(std::is_same_v); + const absl::Status good = pb::json::JsonStringToMessage(R"({"a":1})", &object); + std::string report; + if (bad.ok()) report += "malformed JSON accepted; "; + if (bad.code() != absl::StatusCode::kInvalidArgument || !absl::IsInvalidArgument(bad)) report += "not InvalidArgument; "; + if (!good.ok()) report += "valid JSON refused: " + std::string(good.message()) + "; "; + if (absl::StrCat("fields: ", object.fields_size()) != "fields: 1") report += "StrCat; "; + if (!report.empty()) ADD_FAILURE() << report; +} diff --git a/tests/api_test.cpp b/tests/api_test.cpp new file mode 100644 index 0000000..7a58ca5 --- /dev/null +++ b/tests/api_test.cpp @@ -0,0 +1,194 @@ +// The API through the module alone: no protobuf header in this translation +// unit. A message type built at run time (FileDescriptorProto -> DescriptorPool +// -> DynamicMessage) with its wire bytes pinned; text and JSON round trips; +// the well-known types; MessageDifferencer, FieldMaskUtil, delimited streams, +// coded streams and an arena. +#include + +import std; +import mcpplibs.mwrap.protobuf; + +namespace pb = google::protobuf; + +namespace { +std::string hex(std::string_view bytes) { + std::string out; + for (unsigned char c : bytes) out += std::format("{:02x}", c); + return out; +} + +// demo.Person { string name = 1; int32 id = 2; repeated string email = 3; } +const pb::FileDescriptor* person_file(pb::DescriptorPool& pool) { + pb::FileDescriptorProto file; + file.set_name("person.proto"); + file.set_package("demo"); + file.set_syntax("proto3"); + pb::DescriptorProto* message = file.add_message_type(); + message->set_name("Person"); + auto field = [&](const char* name, int number, pb::FieldDescriptorProto::Type type, pb::FieldDescriptorProto::Label label) { + pb::FieldDescriptorProto* f = message->add_field(); + f->set_name(name); + f->set_json_name(name); + f->set_number(number); + f->set_type(type); + f->set_label(label); + }; + field("name", 1, pb::FieldDescriptorProto::TYPE_STRING, pb::FieldDescriptorProto::LABEL_OPTIONAL); + field("id", 2, pb::FieldDescriptorProto::TYPE_INT32, pb::FieldDescriptorProto::LABEL_OPTIONAL); + field("email", 3, pb::FieldDescriptorProto::TYPE_STRING, pb::FieldDescriptorProto::LABEL_REPEATED); + return pool.BuildFile(file); +} + +struct Person { + pb::DescriptorPool pool; + const pb::Descriptor* type = nullptr; + pb::DynamicMessageFactory factory{&pool}; + Person() { type = person_file(pool)->FindMessageTypeByName("Person"); } + std::unique_ptr make(std::string_view name, int id, std::initializer_list emails) { + std::unique_ptr m(factory.GetPrototype(type)->New()); + const pb::Reflection* r = m->GetReflection(); + r->SetString(m.get(), type->FindFieldByName("name"), std::string(name)); + r->SetInt32(m.get(), type->FindFieldByName("id"), id); + for (auto e : emails) r->AddString(m.get(), type->FindFieldByName("email"), std::string(e)); + return m; + } +}; +} // namespace + +TEST(Api, Version) { + EXPECT_EQ(mcpplibs::mwrap::protobuf::macros::GOOGLE_PROTOBUF_VERSION, 7035001); + EXPECT_EQ(mcpplibs::mwrap::protobuf::macros::PROTOBUF_VERSION, 7035001); +} + +TEST(Api, DynamicMessageWireBytes) { + Person person; + ASSERT_NE(person.type, nullptr); + EXPECT_EQ(person.type->full_name(), "demo.Person"); + auto ada = person.make("Ada", 7, {"ada@example.org"}); + std::string wire; + ASSERT_TRUE(ada->SerializeToString(&wire)); + // Field 1 (len 3) "Ada", field 2 varint 7, field 3 (len 15) "ada@example.org". + EXPECT_EQ(hex(wire), "0a034164611007" "1a0f616461406578616d706c652e6f7267"); + std::unique_ptr back(ada->New()); + ASSERT_TRUE(back->ParseFromString(wire)); + EXPECT_TRUE(pb::util::MessageDifferencer::Equals(*ada, *back)); + EXPECT_EQ(back->ByteSizeLong(), wire.size()); +} + +TEST(Api, TextFormat) { + Person person; + auto ada = person.make("Ada", 7, {"a@x", "b@x"}); + std::string text; + ASSERT_TRUE(pb::TextFormat::PrintToString(*ada, &text)); + EXPECT_EQ(text, "name: \"Ada\"\nid: 7\nemail: \"a@x\"\nemail: \"b@x\"\n"); + std::unique_ptr back(ada->New()); + ASSERT_TRUE(pb::TextFormat::ParseFromString("name: \"Ada\" id: 7 email: \"a@x\" email: \"b@x\"", back.get())); + EXPECT_TRUE(pb::util::MessageDifferencer::Equals(*ada, *back)); + EXPECT_FALSE(pb::TextFormat::ParseFromString("name: 12 id: \"x\"", back.get())); +} + +TEST(Api, Json) { + Person person; + auto ada = person.make("Ada", 7, {"ada@example.org"}); + std::string json; + ASSERT_TRUE(pb::json::MessageToJsonString(*ada, &json).ok()); + EXPECT_EQ(json, R"({"name":"Ada","id":7,"email":["ada@example.org"]})"); + std::unique_ptr back(ada->New()); + ASSERT_TRUE(pb::util::JsonStringToMessage(json, back.get()).ok()); + EXPECT_TRUE(pb::util::MessageDifferencer::Equals(*ada, *back)); + const auto bad = pb::util::JsonStringToMessage(R"({"id":"seven"})", back.get()); + EXPECT_FALSE(bad.ok()); + EXPECT_FALSE(bad.message().empty()); +} + +TEST(Api, WellKnownTypes) { + pb::Timestamp when; + ASSERT_TRUE(pb::util::TimeUtil::FromString("2026-11-19T08:30:00Z", &when)); + EXPECT_EQ(when.seconds(), 1795077000); + const pb::Duration ninety = pb::util::TimeUtil::SecondsToDuration(90); + EXPECT_EQ(pb::util::TimeUtil::ToString(when + ninety), "2026-11-19T08:31:30Z"); + EXPECT_EQ(pb::util::TimeUtil::ToString(ninety * 2), "180s"); + EXPECT_TRUE(when < when + ninety); + + pb::Struct object; + (*object.mutable_fields())["pi"].set_number_value(3.25); + (*object.mutable_fields())["ok"].set_bool_value(true); + (*object.mutable_fields())["tags"].mutable_list_value()->add_values()->set_string_value("x"); + std::string json; + ASSERT_TRUE(pb::json::MessageToJsonString(object, &json).ok()); + pb::Struct back; + ASSERT_TRUE(pb::json::JsonStringToMessage(json, &back).ok()); + EXPECT_TRUE(pb::util::MessageDifferencer::Equals(object, back)); + EXPECT_EQ(back.fields().at("pi").number_value(), 3.25); + + pb::Any any; + ASSERT_TRUE(any.PackFrom(when)); + EXPECT_EQ(any.type_url(), "type.googleapis.com/google.protobuf.Timestamp"); + EXPECT_TRUE(any.Is()); + EXPECT_FALSE(any.Is()); + pb::Timestamp unpacked; + ASSERT_TRUE(any.UnpackTo(&unpacked)); + EXPECT_EQ(unpacked.seconds(), when.seconds()); + + pb::Int64Value wrapped; + wrapped.set_value(-5); + EXPECT_EQ(wrapped.SerializeAsString(), std::string("\x08\xfb\xff\xff\xff\xff\xff\xff\xff\xff\x01", 11)); +} + +TEST(Api, FieldMaskAndDifferencer) { + pb::FieldMask mask; + pb::util::FieldMaskUtil::FromString("seconds,nanos", &mask); + EXPECT_EQ(mask.paths_size(), 2); + EXPECT_TRUE(pb::util::FieldMaskUtil::IsValidFieldMask(mask)); + pb::Timestamp a, b; + a.set_seconds(1); + b.set_seconds(2); + pb::util::MessageDifferencer differ; + std::string report; + differ.ReportDifferencesToString(&report); + EXPECT_FALSE(differ.Compare(a, b)); + EXPECT_NE(report.find("seconds"), std::string::npos) << report; +} + +TEST(Api, CodedAndDelimitedStreams) { + std::string bytes; + { + pb::io::StringOutputStream raw(&bytes); + pb::io::CodedOutputStream coded(&raw); + coded.WriteVarint32(300); + coded.WriteLittleEndian32(0x01020304u); + } + EXPECT_EQ(hex(bytes), "ac0204030201"); + pb::io::ArrayInputStream in(bytes.data(), static_cast(bytes.size())); + pb::io::CodedInputStream reader(&in); + std::uint32_t varint = 0, fixed = 0; + ASSERT_TRUE(reader.ReadVarint32(&varint)); + ASSERT_TRUE(reader.ReadLittleEndian32(&fixed)); + EXPECT_EQ(varint, 300u); + EXPECT_EQ(fixed, 0x01020304u); + + std::string stream; + { + pb::io::StringOutputStream out(&stream); + for (int seconds : {1, 2, 3}) { + pb::Timestamp t; + t.set_seconds(seconds); + ASSERT_TRUE(pb::util::SerializeDelimitedToZeroCopyStream(t, &out)); + } + } + pb::io::ArrayInputStream source(stream.data(), static_cast(stream.size())); + for (int seconds : {1, 2, 3}) { + pb::Timestamp t; + bool clean_eof = false; + ASSERT_TRUE(pb::util::ParseDelimitedFromZeroCopyStream(&t, &source, &clean_eof)); + EXPECT_EQ(t.seconds(), seconds); + } +} + +TEST(Api, Arena) { + pb::Arena arena; + auto* when = pb::Arena::Create(&arena); + when->set_seconds(42); + EXPECT_EQ(when->GetArena(), &arena); + EXPECT_GT(arena.SpaceUsed(), 0u); +} diff --git a/tests/compiler_test.cpp b/tests/compiler_test.cpp new file mode 100644 index 0000000..e75208a --- /dev/null +++ b/tests/compiler_test.cpp @@ -0,0 +1,62 @@ +// Parsing a .proto at run time, through the module alone: the tokenizer over an +// in-memory stream, the parser into a FileDescriptorProto, a DescriptorPool, +// and a message of the parsed type; a syntax error reported with its position. +#include + +import std; +import mcpplibs.mwrap.protobuf; + +namespace pb = google::protobuf; + +namespace { +struct Errors : pb::io::ErrorCollector { + std::vector seen; + void RecordError(int line, pb::io::ColumnNumber column, std::string_view message) override { + seen.push_back(std::format("{}:{}: {}", line + 1, column + 1, message)); + } +}; + +bool parse(std::string_view text, pb::FileDescriptorProto* file, Errors* errors) { + pb::io::ArrayInputStream input(text.data(), static_cast(text.size())); + pb::io::Tokenizer tokenizer(&input, errors); + pb::compiler::Parser parser; + parser.RecordErrorsTo(errors); + return parser.Parse(&tokenizer, file); +} +} // namespace + +TEST(Compiler, ParseBuildAndUse) { + constexpr std::string_view text = R"( + syntax = "proto3"; + package geo; + message Point { int32 x = 1; int32 y = 2; } + message Path { repeated Point points = 1; string label = 2; } + )"; + pb::FileDescriptorProto file; + Errors errors; + ASSERT_TRUE(parse(text, &file, &errors)); + EXPECT_TRUE(errors.seen.empty()); + file.set_name("geo.proto"); + pb::DescriptorPool pool; + const pb::FileDescriptor* built = pool.BuildFile(file); + ASSERT_NE(built, nullptr); + const pb::Descriptor* path = built->FindMessageTypeByName("Path"); + ASSERT_NE(path, nullptr); + EXPECT_EQ(path->field_count(), 2); + EXPECT_EQ(path->FindFieldByName("points")->message_type()->full_name(), "geo.Point"); + + pb::DynamicMessageFactory factory(&pool); + std::unique_ptr message(factory.GetPrototype(path)->New()); + ASSERT_TRUE(pb::TextFormat::ParseFromString("label: \"route\" points { x: 1 y: 2 } points { x: -3 }", message.get())); + std::string json; + ASSERT_TRUE(pb::json::MessageToJsonString(*message, &json).ok()); + EXPECT_EQ(json, R"({"points":[{"x":1,"y":2},{"x":-3}],"label":"route"})"); +} + +TEST(Compiler, SyntaxErrorIsReported) { + pb::FileDescriptorProto file; + Errors errors; + EXPECT_FALSE(parse("syntax = \"proto3\";\nmessage Broken { int32 = 1; }\n", &file, &errors)); + ASSERT_FALSE(errors.seen.empty()); + EXPECT_TRUE(errors.seen.front().starts_with("2:")) << errors.seen.front(); +} diff --git a/tests/header_mix_test.cpp b/tests/header_mix_test.cpp new file mode 100644 index 0000000..1adc097 --- /dev/null +++ b/tests/header_mix_test.cpp @@ -0,0 +1,22 @@ +// The headers and the import in one translation unit, the way a program with +// generated code is written: the prelude (every header the modules include) +// first, then the import. The module's names are the very same entities as the +// headers': an object made through one is used through the other. +#include +#include +#include +#include + +import mcpplibs.mwrap.protobuf; + +TEST(HeaderMix, TheSameEntities) { + ::google::protobuf::Timestamp through_header; + through_header.set_seconds(10); + google::protobuf::Any any; + ASSERT_TRUE(any.PackFrom(through_header)); + google::protobuf::Timestamp back; + ASSERT_TRUE(any.UnpackTo(&back)); + EXPECT_EQ(::google::protobuf::util::TimeUtil::ToString(back), "1970-01-01T00:00:10Z"); + static_assert(std::is_base_of_v<::google::protobuf::Message, google::protobuf::Timestamp>); + GOOGLE_PROTOBUF_VERIFY_VERSION; // a statement macro, from the headers +} diff --git a/tests/macros_test.cpp b/tests/macros_test.cpp new file mode 100644 index 0000000..2591449 --- /dev/null +++ b/tests/macros_test.cpp @@ -0,0 +1,57 @@ +// Written by tools/surface.py: every constant of mcpplibs.mwrap.protobuf.macros against the macro of the same +// name, and GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG against its mapping. The headers come first; each macro is +// taken, then set aside: while it is defined it would replace the qualified name too. +#include +#include +#include +#include + +namespace header { +inline constexpr auto google_protobuf_version = GOOGLE_PROTOBUF_VERSION; +inline constexpr auto google_protobuf_version_suffix = GOOGLE_PROTOBUF_VERSION_SUFFIX; +inline constexpr auto protobuf_oss_version = PROTOBUF_OSS_VERSION; +inline constexpr auto protobuf_oss_version_suffix = PROTOBUF_OSS_VERSION_SUFFIX; +inline constexpr auto protobuf_version = PROTOBUF_VERSION; +inline constexpr auto protobuf_version_suffix = PROTOBUF_VERSION_SUFFIX; +constexpr std::uint32_t make_tag(int number, ::google::protobuf::internal::WireFormatLite::WireType type) { + return GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(number, type); +} +} // namespace header + +#undef GOOGLE_PROTOBUF_VERSION +#undef GOOGLE_PROTOBUF_VERSION_SUFFIX +#undef PROTOBUF_OSS_VERSION +#undef PROTOBUF_OSS_VERSION_SUFFIX +#undef PROTOBUF_VERSION +#undef PROTOBUF_VERSION_SUFFIX +#undef GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG + +#include + +import mcpplibs.mwrap.protobuf; + +namespace macros = mcpplibs::mwrap::protobuf::macros; +using google::protobuf::internal::WireFormatLite; + +template +constexpr bool same(A a, B b) { + if constexpr (!std::is_same_v) return false; + else if constexpr (std::is_same_v) return std::string_view(a) == std::string_view(b); + else return a == b; +} + +static_assert(same(macros::GOOGLE_PROTOBUF_VERSION, header::google_protobuf_version), "GOOGLE_PROTOBUF_VERSION"); +static_assert(same(macros::GOOGLE_PROTOBUF_VERSION_SUFFIX, header::google_protobuf_version_suffix), "GOOGLE_PROTOBUF_VERSION_SUFFIX"); +static_assert(same(macros::PROTOBUF_OSS_VERSION, header::protobuf_oss_version), "PROTOBUF_OSS_VERSION"); +static_assert(same(macros::PROTOBUF_OSS_VERSION_SUFFIX, header::protobuf_oss_version_suffix), "PROTOBUF_OSS_VERSION_SUFFIX"); +static_assert(same(macros::PROTOBUF_VERSION, header::protobuf_version), "PROTOBUF_VERSION"); +static_assert(same(macros::PROTOBUF_VERSION_SUFFIX, header::protobuf_version_suffix), "PROTOBUF_VERSION_SUFFIX"); +static_assert(macros::GOOGLE_PROTOBUF_VERSION == 7035001); + +TEST(Macros, MakeTagAsTheMacro) { + for (int number : {1, 2, 15, 16, 2047, 536870911}) + for (auto type : {WireFormatLite::WIRETYPE_VARINT, WireFormatLite::WIRETYPE_FIXED64, WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + WireFormatLite::WIRETYPE_START_GROUP, WireFormatLite::WIRETYPE_END_GROUP, WireFormatLite::WIRETYPE_FIXED32}) + EXPECT_EQ(macros::GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(number, type), header::make_tag(number, type)); + static_assert(macros::GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(1, WireFormatLite::WIRETYPE_LENGTH_DELIMITED) == 10); +} diff --git a/tools/check_examples.py b/tools/check_examples.py new file mode 100644 index 0000000..bbad3f7 --- /dev/null +++ b/tools/check_examples.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +"""examples/codegen is templates/codegen instantiated: CI builds and runs it, which is +what tests the template's code generation. Its build.mcpp, proto/ and src/main.cpp +must therefore be the template's, byte for byte (the template's main.cpp.in and +build.mcpp.in carry no substitutions).""" +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +pairs = [('templates/codegen/build.mcpp.in', 'examples/codegen/build.mcpp'), + ('templates/codegen/src/main.cpp.in', 'examples/codegen/src/main.cpp'), + ('templates/codegen/proto/addressbook.proto', 'examples/codegen/proto/addressbook.proto')] +for template, example in pairs: + a, b = (ROOT / template).read_bytes(), (ROOT / example).read_bytes() + assert b'{{' not in a, template + assert a == b, f'{example} differs from {template}' +print('examples/codegen is templates/codegen instantiated') diff --git a/tools/check_exports.py b/tools/check_exports.py new file mode 100644 index 0000000..d557a7b --- /dev/null +++ b/tools/check_exports.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +"""Audit the module surface against protobuf's public headers. + +The generated sources (src/*.cppm, src/gzip/io_gzip.cppm, the two side headers, +tests/macros_test.cpp, docs/api.md) must be exactly what tools/surface.py +writes from tools/surface.json, and no `absl` name may be exported. With a +clang++ (--clang, or MWRAP_CLANG) the record itself is derived again from the +release headers and must be the same: no public name left out, none exported +that is not there. MWRAP_REQUIRE_CLANG=1 makes the second half mandatory (CI's +Linux LLVM row). +""" +import argparse +import os +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import surface # noqa: E402 + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--clang', default=os.environ.get('MWRAP_CLANG')) + args = parser.parse_args() + record = surface.record() + for path, text in surface.outputs(record).items(): + assert path.read_text(encoding='utf-8') == text, f'{path.relative_to(surface.ROOT)} is not what tools/surface.py --write gives' + for module, scopes in record['modules'].items(): + assert all(scope.startswith('google::protobuf') for scope in scopes), (module, list(scopes)) + if args.clang: + derived = surface.derive(args.clang) + if derived != record: + for key in sorted(set(derived) | set(record)): + if derived.get(key) != record.get(key): + print('differs:', key, file=sys.stderr) + sys.exit('the record is not what clang derives from the headers: run tools/surface.py --clang --write') + else: + assert os.environ.get('MWRAP_REQUIRE_CLANG') != '1', 'MWRAP_REQUIRE_CLANG=1 and no clang++ given' + counts = {m: sum(len(v) for kinds in scopes.values() for v in kinds.values()) for m, scopes in record['modules'].items()} + print(f'exported: {counts}; {len(record["adapted"])} constants adapted; {len(record["not exported"]["names"])} names not exported; ' + f'macros: {len(record["macros"]["constants"])} constants, {len(record["macros"]["functions"])} function, ' + f'{len(record["macros"]["textual"])} textual; ' + + ('the record is what clang derives from the headers' if args.clang else 'the record not derived again (no clang++ given)')) + + +if __name__ == '__main__': + main() diff --git a/tools/check_mwrap_release.py b/tools/check_mwrap_release.py new file mode 100644 index 0000000..9bedddb --- /dev/null +++ b/tools/check_mwrap_release.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +"""Check the immutable mwrap release coordinate and bilingual entry pages.""" +import argparse +import hashlib +import json +from pathlib import Path +import re +import tomllib + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--tag', help='release tag; omitted during PR checks') + args = parser.parse_args() + root = Path(__file__).resolve().parents[1] + package = tomllib.loads((root / 'mcpp.toml').read_text(encoding="utf-8"))['package'] + assert package['namespace'] == 'mcpplibs.mwrap', package + assert re.fullmatch(r'[A-Za-z_][A-Za-z_0-9]*', package['name']), package['name'] + upstream = package['metadata']['mwrap']['upstream-version'] + version = package['version'] + assert version == upstream or re.fullmatch(re.escape(upstream) + r'\.[1-9][0-9]*', version), (version, upstream) + if args.tag: + assert args.tag == 'mwrap-' + version, (args.tag, version) + assert package['license'] == 'Apache-2.0', package['license'] + assert package['authors'] == ['mcpp-community'], package.get('authors') + license_text = (root / 'LICENSE').read_text(encoding='utf-8') + assert 'Apache License' in license_text and 'Version 2.0' in license_text + assert 'mcpp-community' in (root / 'NOTICE').read_text(encoding='utf-8') + documents = json.loads((root / 'upstream/documents.json').read_text(encoding='utf-8'))['documents'] + assert any(Path(d['path']).name.startswith('README') for d in documents) + assert any(Path(d['path']).name.startswith(('LICENSE', 'COPYING')) for d in documents) + deployed = {entry['from'] for entry in tomllib.loads((root / 'mcpp.toml').read_text(encoding='utf-8')).get('runtime', {}).get('deploy', [])} + assert {'LICENSE', 'NOTICE'} <= deployed + for document in documents: + path = Path(document['path']) + assert not path.is_absolute() and '..' not in path.parts and path.parts[0] == 'upstream' + assert hashlib.sha256((root / path).read_bytes()).hexdigest() == document['sha256'], path + assert document['source'] and path.as_posix() in deployed, path + identity = package['namespace'] + '.' + package['name'] + for name, other in [('README.md', 'README.zh.md'), ('README.zh.md', 'README.md')]: + text = (root / name).read_text(encoding="utf-8") + assert len(text.splitlines()) <= 150, name + assert '](' + other + ')' in '\n'.join(text.splitlines()[:12]), name + assert identity in text and version in text, name + assert text.count('```') % 2 == 0, name + print(identity + '@' + version) + + +if __name__ == '__main__': + main() diff --git a/tools/surface.json b/tools/surface.json new file mode 100644 index 0000000..0767eec --- /dev/null +++ b/tools/surface.json @@ -0,0 +1,1212 @@ +{ + "release": "https://github.com/protocolbuffers/protobuf/releases/download/v35.1/protobuf-35.1.tar.gz", + "headers": { + "protobuf": [ + "google/protobuf/any.h", + "google/protobuf/any.pb.h", + "google/protobuf/api.pb.h", + "google/protobuf/arena.h", + "google/protobuf/arena_align.h", + "google/protobuf/arena_allocation_policy.h", + "google/protobuf/arena_cleanup.h", + "google/protobuf/arenastring.h", + "google/protobuf/arenaz_sampler.h", + "google/protobuf/cpp_edition_defaults.h", + "google/protobuf/cpp_features.pb.h", + "google/protobuf/descriptor.h", + "google/protobuf/descriptor.pb.h", + "google/protobuf/descriptor_database.h", + "google/protobuf/descriptor_legacy.h", + "google/protobuf/descriptor_lite.h", + "google/protobuf/descriptor_visitor.h", + "google/protobuf/duration.pb.h", + "google/protobuf/dynamic_message.h", + "google/protobuf/empty.pb.h", + "google/protobuf/endian.h", + "google/protobuf/explicitly_constructed.h", + "google/protobuf/extension_set.h", + "google/protobuf/extension_set_inl.h", + "google/protobuf/feature_resolver.h", + "google/protobuf/field_access_listener.h", + "google/protobuf/field_mask.pb.h", + "google/protobuf/field_with_arena.h", + "google/protobuf/generated_enum_reflection.h", + "google/protobuf/generated_enum_util.h", + "google/protobuf/generated_message_bases.h", + "google/protobuf/generated_message_reflection.h", + "google/protobuf/generated_message_tctable_decl.h", + "google/protobuf/generated_message_tctable_gen.h", + "google/protobuf/generated_message_tctable_impl.h", + "google/protobuf/generated_message_util.h", + "google/protobuf/has_bits.h", + "google/protobuf/implicit_weak_message.h", + "google/protobuf/inlined_string_field.h", + "google/protobuf/internal_feature_helper.h", + "google/protobuf/internal_metadata_locator.h", + "google/protobuf/internal_visibility.h", + "google/protobuf/map.h", + "google/protobuf/map_entry.h", + "google/protobuf/map_field.h", + "google/protobuf/map_field_lite.h", + "google/protobuf/map_type_handler.h", + "google/protobuf/message.h", + "google/protobuf/message_lite.h", + "google/protobuf/metadata.h", + "google/protobuf/metadata_lite.h", + "google/protobuf/micro_string.h", + "google/protobuf/parse_context.h", + "google/protobuf/port.h", + "google/protobuf/raw_ptr.h", + "google/protobuf/reflection.h", + "google/protobuf/reflection_internal.h", + "google/protobuf/reflection_mode.h", + "google/protobuf/reflection_ops.h", + "google/protobuf/reflection_visit_field_info.h", + "google/protobuf/reflection_visit_fields.h", + "google/protobuf/repeated_field.h", + "google/protobuf/repeated_field_proxy.h", + "google/protobuf/repeated_field_proxy_iterator.h", + "google/protobuf/repeated_field_proxy_traits.h", + "google/protobuf/repeated_ptr_field.h", + "google/protobuf/runtime_version.h", + "google/protobuf/serial_arena.h", + "google/protobuf/service.h", + "google/protobuf/source_context.pb.h", + "google/protobuf/string_block.h", + "google/protobuf/string_member_robber.h", + "google/protobuf/struct.pb.h", + "google/protobuf/symbol_checker.h", + "google/protobuf/text_format.h", + "google/protobuf/thread_safe_arena.h", + "google/protobuf/timestamp.pb.h", + "google/protobuf/type.pb.h", + "google/protobuf/unknown_field_set.h", + "google/protobuf/varint_shuffle.h", + "google/protobuf/wire_format.h", + "google/protobuf/wire_format_lite.h", + "google/protobuf/wrappers.pb.h" + ], + "io": [ + "google/protobuf/io/coded_stream.h", + "google/protobuf/io/printer.h", + "google/protobuf/io/strtod.h", + "google/protobuf/io/tokenizer.h", + "google/protobuf/io/zero_copy_sink.h", + "google/protobuf/io/zero_copy_stream.h", + "google/protobuf/io/zero_copy_stream_impl.h", + "google/protobuf/io/zero_copy_stream_impl_lite.h" + ], + "util": [ + "google/protobuf/util/delimited_message_util.h", + "google/protobuf/util/field_comparator.h", + "google/protobuf/util/field_mask_util.h", + "google/protobuf/util/json_util.h", + "google/protobuf/util/message_differencer.h", + "google/protobuf/util/time_util.h", + "google/protobuf/util/type_resolver.h", + "google/protobuf/util/type_resolver_util.h", + "google/protobuf/json/json.h" + ], + "compiler": [ + "google/protobuf/compiler/importer.h", + "google/protobuf/compiler/parser.h" + ], + "gzip": [ + "google/protobuf/io/gzip_stream.h" + ] + }, + "modules": { + "protobuf": { + "google::protobuf": { + "enumerators": [ + "EDITION_1_TEST_ONLY", + "EDITION_2023", + "EDITION_2024", + "EDITION_2026", + "EDITION_2_TEST_ONLY", + "EDITION_99997_TEST_ONLY", + "EDITION_99998_TEST_ONLY", + "EDITION_99999_TEST_ONLY", + "EDITION_LEGACY", + "EDITION_MAX", + "EDITION_PROTO2", + "EDITION_PROTO3", + "EDITION_UNKNOWN", + "EDITION_UNSTABLE", + "ExtensionRangeOptions_VerificationState_DECLARATION", + "ExtensionRangeOptions_VerificationState_UNVERIFIED", + "FeatureSet_EnforceNamingStyle_ENFORCE_NAMING_STYLE_UNKNOWN", + "FeatureSet_EnforceNamingStyle_STYLE2024", + "FeatureSet_EnforceNamingStyle_STYLE2026", + "FeatureSet_EnforceNamingStyle_STYLE_LEGACY", + "FeatureSet_EnumType_CLOSED", + "FeatureSet_EnumType_ENUM_TYPE_UNKNOWN", + "FeatureSet_EnumType_OPEN", + "FeatureSet_FieldPresence_EXPLICIT", + "FeatureSet_FieldPresence_FIELD_PRESENCE_UNKNOWN", + "FeatureSet_FieldPresence_IMPLICIT", + "FeatureSet_FieldPresence_LEGACY_REQUIRED", + "FeatureSet_JsonFormat_ALLOW", + "FeatureSet_JsonFormat_JSON_FORMAT_UNKNOWN", + "FeatureSet_JsonFormat_LEGACY_BEST_EFFORT", + "FeatureSet_MessageEncoding_DELIMITED", + "FeatureSet_MessageEncoding_LENGTH_PREFIXED", + "FeatureSet_MessageEncoding_MESSAGE_ENCODING_UNKNOWN", + "FeatureSet_RepeatedFieldEncoding_EXPANDED", + "FeatureSet_RepeatedFieldEncoding_PACKED", + "FeatureSet_RepeatedFieldEncoding_REPEATED_FIELD_ENCODING_UNKNOWN", + "FeatureSet_Utf8Validation_NONE", + "FeatureSet_Utf8Validation_UTF8_VALIDATION_UNKNOWN", + "FeatureSet_Utf8Validation_VERIFY", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_EXPORT_ALL", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_EXPORT_TOP_LEVEL", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_LOCAL_ALL", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_STRICT", + "FieldDescriptorProto_Label_LABEL_OPTIONAL", + "FieldDescriptorProto_Label_LABEL_REPEATED", + "FieldDescriptorProto_Label_LABEL_REQUIRED", + "FieldDescriptorProto_Type_TYPE_BOOL", + "FieldDescriptorProto_Type_TYPE_BYTES", + "FieldDescriptorProto_Type_TYPE_DOUBLE", + "FieldDescriptorProto_Type_TYPE_ENUM", + "FieldDescriptorProto_Type_TYPE_FIXED32", + "FieldDescriptorProto_Type_TYPE_FIXED64", + "FieldDescriptorProto_Type_TYPE_FLOAT", + "FieldDescriptorProto_Type_TYPE_GROUP", + "FieldDescriptorProto_Type_TYPE_INT32", + "FieldDescriptorProto_Type_TYPE_INT64", + "FieldDescriptorProto_Type_TYPE_MESSAGE", + "FieldDescriptorProto_Type_TYPE_SFIXED32", + "FieldDescriptorProto_Type_TYPE_SFIXED64", + "FieldDescriptorProto_Type_TYPE_SINT32", + "FieldDescriptorProto_Type_TYPE_SINT64", + "FieldDescriptorProto_Type_TYPE_STRING", + "FieldDescriptorProto_Type_TYPE_UINT32", + "FieldDescriptorProto_Type_TYPE_UINT64", + "FieldOptions_CType_CORD", + "FieldOptions_CType_STRING", + "FieldOptions_CType_STRING_PIECE", + "FieldOptions_JSType_JS_NORMAL", + "FieldOptions_JSType_JS_NUMBER", + "FieldOptions_JSType_JS_STRING", + "FieldOptions_OptionRetention_RETENTION_RUNTIME", + "FieldOptions_OptionRetention_RETENTION_SOURCE", + "FieldOptions_OptionRetention_RETENTION_UNKNOWN", + "FieldOptions_OptionTargetType_TARGET_TYPE_ENUM", + "FieldOptions_OptionTargetType_TARGET_TYPE_ENUM_ENTRY", + "FieldOptions_OptionTargetType_TARGET_TYPE_EXTENSION_RANGE", + "FieldOptions_OptionTargetType_TARGET_TYPE_FIELD", + "FieldOptions_OptionTargetType_TARGET_TYPE_FILE", + "FieldOptions_OptionTargetType_TARGET_TYPE_MESSAGE", + "FieldOptions_OptionTargetType_TARGET_TYPE_METHOD", + "FieldOptions_OptionTargetType_TARGET_TYPE_ONEOF", + "FieldOptions_OptionTargetType_TARGET_TYPE_SERVICE", + "FieldOptions_OptionTargetType_TARGET_TYPE_UNKNOWN", + "Field_Cardinality_CARDINALITY_OPTIONAL", + "Field_Cardinality_CARDINALITY_REPEATED", + "Field_Cardinality_CARDINALITY_REQUIRED", + "Field_Cardinality_CARDINALITY_UNKNOWN", + "Field_Cardinality_Field_Cardinality_INT_MAX_SENTINEL_DO_NOT_USE_", + "Field_Cardinality_Field_Cardinality_INT_MIN_SENTINEL_DO_NOT_USE_", + "Field_Kind_Field_Kind_INT_MAX_SENTINEL_DO_NOT_USE_", + "Field_Kind_Field_Kind_INT_MIN_SENTINEL_DO_NOT_USE_", + "Field_Kind_TYPE_BOOL", + "Field_Kind_TYPE_BYTES", + "Field_Kind_TYPE_DOUBLE", + "Field_Kind_TYPE_ENUM", + "Field_Kind_TYPE_FIXED32", + "Field_Kind_TYPE_FIXED64", + "Field_Kind_TYPE_FLOAT", + "Field_Kind_TYPE_GROUP", + "Field_Kind_TYPE_INT32", + "Field_Kind_TYPE_INT64", + "Field_Kind_TYPE_MESSAGE", + "Field_Kind_TYPE_SFIXED32", + "Field_Kind_TYPE_SFIXED64", + "Field_Kind_TYPE_SINT32", + "Field_Kind_TYPE_SINT64", + "Field_Kind_TYPE_STRING", + "Field_Kind_TYPE_UINT32", + "Field_Kind_TYPE_UINT64", + "Field_Kind_TYPE_UNKNOWN", + "FileOptions_OptimizeMode_CODE_SIZE", + "FileOptions_OptimizeMode_LITE_RUNTIME", + "FileOptions_OptimizeMode_SPEED", + "GeneratedCodeInfo_Annotation_Semantic_ALIAS", + "GeneratedCodeInfo_Annotation_Semantic_NONE", + "GeneratedCodeInfo_Annotation_Semantic_SET", + "MethodOptions_IdempotencyLevel_IDEMPOTENCY_UNKNOWN", + "MethodOptions_IdempotencyLevel_IDEMPOTENT", + "MethodOptions_IdempotencyLevel_NO_SIDE_EFFECTS", + "NESTED_ENUM_STRICT_VIOLATION", + "NESTED_MESSAGE_STRICT_VIOLATION", + "NULL_VALUE", + "NullValue_INT_MAX_SENTINEL_DO_NOT_USE_", + "NullValue_INT_MIN_SENTINEL_DO_NOT_USE_", + "SYNTAX_EDITIONS", + "SYNTAX_PROTO2", + "SYNTAX_PROTO3", + "Syntax_INT_MAX_SENTINEL_DO_NOT_USE_", + "Syntax_INT_MIN_SENTINEL_DO_NOT_USE_", + "VISIBILITY_EXPORT", + "VISIBILITY_LOCAL", + "VISIBILITY_UNSET" + ], + "functions": [ + "AbslStringify", + "AllocatedRepeatedPtrFieldBackInserter", + "DoNothing", + "DownCastMessage", + "DownCastToGenerated", + "DynamicCastMessage", + "DynamicCastToGenerated", + "Edition_IsValid", + "Edition_Name", + "Edition_Parse", + "Edition_descriptor", + "EnumerateEnumValues", + "ExtensionRangeOptions_VerificationState_IsValid", + "ExtensionRangeOptions_VerificationState_Name", + "ExtensionRangeOptions_VerificationState_Parse", + "ExtensionRangeOptions_VerificationState_descriptor", + "FeatureSet_EnforceNamingStyle_IsValid", + "FeatureSet_EnforceNamingStyle_Name", + "FeatureSet_EnforceNamingStyle_Parse", + "FeatureSet_EnforceNamingStyle_descriptor", + "FeatureSet_EnumType_IsValid", + "FeatureSet_EnumType_Name", + "FeatureSet_EnumType_Parse", + "FeatureSet_EnumType_descriptor", + "FeatureSet_FieldPresence_IsValid", + "FeatureSet_FieldPresence_Name", + "FeatureSet_FieldPresence_Parse", + "FeatureSet_FieldPresence_descriptor", + "FeatureSet_JsonFormat_IsValid", + "FeatureSet_JsonFormat_Name", + "FeatureSet_JsonFormat_Parse", + "FeatureSet_JsonFormat_descriptor", + "FeatureSet_MessageEncoding_IsValid", + "FeatureSet_MessageEncoding_Name", + "FeatureSet_MessageEncoding_Parse", + "FeatureSet_MessageEncoding_descriptor", + "FeatureSet_RepeatedFieldEncoding_IsValid", + "FeatureSet_RepeatedFieldEncoding_Name", + "FeatureSet_RepeatedFieldEncoding_Parse", + "FeatureSet_RepeatedFieldEncoding_descriptor", + "FeatureSet_Utf8Validation_IsValid", + "FeatureSet_Utf8Validation_Name", + "FeatureSet_Utf8Validation_Parse", + "FeatureSet_Utf8Validation_descriptor", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_IsValid", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_Name", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_Parse", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_descriptor", + "FieldDescriptorProto_Label_IsValid", + "FieldDescriptorProto_Label_Name", + "FieldDescriptorProto_Label_Parse", + "FieldDescriptorProto_Label_descriptor", + "FieldDescriptorProto_Type_IsValid", + "FieldDescriptorProto_Type_Name", + "FieldDescriptorProto_Type_Parse", + "FieldDescriptorProto_Type_descriptor", + "FieldOptions_CType_IsValid", + "FieldOptions_CType_Name", + "FieldOptions_CType_Parse", + "FieldOptions_CType_descriptor", + "FieldOptions_JSType_IsValid", + "FieldOptions_JSType_Name", + "FieldOptions_JSType_Parse", + "FieldOptions_JSType_descriptor", + "FieldOptions_OptionRetention_IsValid", + "FieldOptions_OptionRetention_Name", + "FieldOptions_OptionRetention_Parse", + "FieldOptions_OptionRetention_descriptor", + "FieldOptions_OptionTargetType_IsValid", + "FieldOptions_OptionTargetType_Name", + "FieldOptions_OptionTargetType_Parse", + "FieldOptions_OptionTargetType_descriptor", + "Field_Cardinality_IsValid", + "Field_Cardinality_Name", + "Field_Cardinality_Parse", + "Field_Cardinality_descriptor", + "Field_Kind_IsValid", + "Field_Kind_Name", + "Field_Kind_Parse", + "Field_Kind_descriptor", + "FileOptions_OptimizeMode_IsValid", + "FileOptions_OptimizeMode_Name", + "FileOptions_OptimizeMode_Parse", + "FileOptions_OptimizeMode_descriptor", + "GOOGLE_UNALIGNED_LOAD16", + "GOOGLE_UNALIGNED_LOAD32", + "GOOGLE_UNALIGNED_LOAD64", + "GOOGLE_UNALIGNED_STORE16", + "GOOGLE_UNALIGNED_STORE32", + "GOOGLE_UNALIGNED_STORE64", + "GeneratedCodeInfo_Annotation_Semantic_IsValid", + "GeneratedCodeInfo_Annotation_Semantic_Name", + "GeneratedCodeInfo_Annotation_Semantic_Parse", + "GeneratedCodeInfo_Annotation_Semantic_descriptor", + "GetEnumDescriptor", + "GetExtensionReflection", + "LinkExtensionReflection", + "LinkMessageReflection", + "MethodOptions_IdempotencyLevel_IsValid", + "MethodOptions_IdempotencyLevel_Name", + "MethodOptions_IdempotencyLevel_Parse", + "MethodOptions_IdempotencyLevel_descriptor", + "NewCallback", + "NewPermanentCallback", + "NullValue_IsValid", + "NullValue_Name", + "NullValue_Parse", + "NullValue_descriptor", + "ProtobufInternalGetEnumDescriptor", + "RepeatedFieldBackInserter", + "RepeatedPtrFieldBackInserter", + "ShortFormat", + "ShutdownProtobufLibrary", + "SymbolVisibility_IsValid", + "SymbolVisibility_Name", + "SymbolVisibility_Parse", + "SymbolVisibility_descriptor", + "Syntax_IsValid", + "Syntax_Name", + "Syntax_Parse", + "Syntax_descriptor", + "UnsafeArenaAllocatedRepeatedPtrFieldBackInserter", + "Utf8Format", + "c_sort", + "c_stable_sort", + "erase", + "erase_if", + "ghtonl", + "sort", + "stable_sort" + ], + "objects": [ + "Any_class_data_", + "Any_globals_", + "Api_class_data_", + "Api_globals_", + "BoolValue_class_data_", + "BoolValue_globals_", + "BytesValue_class_data_", + "BytesValue_globals_", + "DescriptorProto_ExtensionRange_class_data_", + "DescriptorProto_ExtensionRange_globals_", + "DescriptorProto_ReservedRange_class_data_", + "DescriptorProto_ReservedRange_globals_", + "DescriptorProto_class_data_", + "DescriptorProto_globals_", + "DoubleValue_class_data_", + "DoubleValue_globals_", + "Duration_class_data_", + "Duration_globals_", + "Edition_MAX", + "Edition_MIN", + "Edition_internal_data_", + "Empty_class_data_", + "Empty_globals_", + "EnumDescriptorProto_EnumReservedRange_class_data_", + "EnumDescriptorProto_EnumReservedRange_globals_", + "EnumDescriptorProto_class_data_", + "EnumDescriptorProto_globals_", + "EnumOptions_class_data_", + "EnumOptions_globals_", + "EnumValueDescriptorProto_class_data_", + "EnumValueDescriptorProto_globals_", + "EnumValueOptions_class_data_", + "EnumValueOptions_globals_", + "EnumValue_class_data_", + "EnumValue_globals_", + "Enum_class_data_", + "Enum_globals_", + "ExtensionRangeOptions_Declaration_class_data_", + "ExtensionRangeOptions_Declaration_globals_", + "ExtensionRangeOptions_VerificationState_VerificationState_ARRAYSIZE", + "ExtensionRangeOptions_VerificationState_VerificationState_MAX", + "ExtensionRangeOptions_VerificationState_VerificationState_MIN", + "ExtensionRangeOptions_VerificationState_internal_data_", + "ExtensionRangeOptions_class_data_", + "ExtensionRangeOptions_globals_", + "FeatureSetDefaults_FeatureSetEditionDefault_class_data_", + "FeatureSetDefaults_FeatureSetEditionDefault_globals_", + "FeatureSetDefaults_class_data_", + "FeatureSetDefaults_globals_", + "FeatureSet_EnforceNamingStyle_EnforceNamingStyle_ARRAYSIZE", + "FeatureSet_EnforceNamingStyle_EnforceNamingStyle_MAX", + "FeatureSet_EnforceNamingStyle_EnforceNamingStyle_MIN", + "FeatureSet_EnforceNamingStyle_internal_data_", + "FeatureSet_EnumType_EnumType_ARRAYSIZE", + "FeatureSet_EnumType_EnumType_MAX", + "FeatureSet_EnumType_EnumType_MIN", + "FeatureSet_EnumType_internal_data_", + "FeatureSet_FieldPresence_FieldPresence_ARRAYSIZE", + "FeatureSet_FieldPresence_FieldPresence_MAX", + "FeatureSet_FieldPresence_FieldPresence_MIN", + "FeatureSet_FieldPresence_internal_data_", + "FeatureSet_JsonFormat_JsonFormat_ARRAYSIZE", + "FeatureSet_JsonFormat_JsonFormat_MAX", + "FeatureSet_JsonFormat_JsonFormat_MIN", + "FeatureSet_JsonFormat_internal_data_", + "FeatureSet_MessageEncoding_MessageEncoding_ARRAYSIZE", + "FeatureSet_MessageEncoding_MessageEncoding_MAX", + "FeatureSet_MessageEncoding_MessageEncoding_MIN", + "FeatureSet_MessageEncoding_internal_data_", + "FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_ARRAYSIZE", + "FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MAX", + "FeatureSet_RepeatedFieldEncoding_RepeatedFieldEncoding_MIN", + "FeatureSet_RepeatedFieldEncoding_internal_data_", + "FeatureSet_Utf8Validation_Utf8Validation_ARRAYSIZE", + "FeatureSet_Utf8Validation_Utf8Validation_MAX", + "FeatureSet_Utf8Validation_Utf8Validation_MIN", + "FeatureSet_Utf8Validation_internal_data_", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_ARRAYSIZE", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_MAX", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_DefaultSymbolVisibility_MIN", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility_internal_data_", + "FeatureSet_VisibilityFeature_class_data_", + "FeatureSet_VisibilityFeature_globals_", + "FeatureSet_class_data_", + "FeatureSet_globals_", + "FieldDescriptorProto_Label_Label_ARRAYSIZE", + "FieldDescriptorProto_Label_Label_MAX", + "FieldDescriptorProto_Label_Label_MIN", + "FieldDescriptorProto_Label_internal_data_", + "FieldDescriptorProto_Type_Type_ARRAYSIZE", + "FieldDescriptorProto_Type_Type_MAX", + "FieldDescriptorProto_Type_Type_MIN", + "FieldDescriptorProto_Type_internal_data_", + "FieldDescriptorProto_class_data_", + "FieldDescriptorProto_globals_", + "FieldMask_class_data_", + "FieldMask_globals_", + "FieldOptions_CType_CType_ARRAYSIZE", + "FieldOptions_CType_CType_MAX", + "FieldOptions_CType_CType_MIN", + "FieldOptions_CType_internal_data_", + "FieldOptions_EditionDefault_class_data_", + "FieldOptions_EditionDefault_globals_", + "FieldOptions_FeatureSupport_class_data_", + "FieldOptions_FeatureSupport_globals_", + "FieldOptions_JSType_JSType_ARRAYSIZE", + "FieldOptions_JSType_JSType_MAX", + "FieldOptions_JSType_JSType_MIN", + "FieldOptions_JSType_internal_data_", + "FieldOptions_OptionRetention_OptionRetention_ARRAYSIZE", + "FieldOptions_OptionRetention_OptionRetention_MAX", + "FieldOptions_OptionRetention_OptionRetention_MIN", + "FieldOptions_OptionRetention_internal_data_", + "FieldOptions_OptionTargetType_OptionTargetType_ARRAYSIZE", + "FieldOptions_OptionTargetType_OptionTargetType_MAX", + "FieldOptions_OptionTargetType_OptionTargetType_MIN", + "FieldOptions_OptionTargetType_internal_data_", + "FieldOptions_class_data_", + "FieldOptions_globals_", + "Field_Cardinality_Cardinality_ARRAYSIZE", + "Field_Cardinality_Cardinality_MAX", + "Field_Cardinality_Cardinality_MIN", + "Field_Cardinality_internal_data_", + "Field_Kind_Kind_ARRAYSIZE", + "Field_Kind_Kind_MAX", + "Field_Kind_Kind_MIN", + "Field_Kind_internal_data_", + "Field_class_data_", + "Field_globals_", + "FileDescriptorProto_class_data_", + "FileDescriptorProto_globals_", + "FileDescriptorSet_class_data_", + "FileDescriptorSet_globals_", + "FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE", + "FileOptions_OptimizeMode_OptimizeMode_MAX", + "FileOptions_OptimizeMode_OptimizeMode_MIN", + "FileOptions_OptimizeMode_internal_data_", + "FileOptions_class_data_", + "FileOptions_globals_", + "FloatValue_class_data_", + "FloatValue_globals_", + "GeneratedCodeInfo_Annotation_Semantic_Semantic_ARRAYSIZE", + "GeneratedCodeInfo_Annotation_Semantic_Semantic_MAX", + "GeneratedCodeInfo_Annotation_Semantic_Semantic_MIN", + "GeneratedCodeInfo_Annotation_Semantic_internal_data_", + "GeneratedCodeInfo_Annotation_class_data_", + "GeneratedCodeInfo_Annotation_globals_", + "GeneratedCodeInfo_class_data_", + "GeneratedCodeInfo_globals_", + "Int32Value_class_data_", + "Int32Value_globals_", + "Int64Value_class_data_", + "Int64Value_globals_", + "ListValue_class_data_", + "ListValue_globals_", + "MessageOptions_class_data_", + "MessageOptions_globals_", + "MethodDescriptorProto_class_data_", + "MethodDescriptorProto_globals_", + "MethodOptions_IdempotencyLevel_IdempotencyLevel_ARRAYSIZE", + "MethodOptions_IdempotencyLevel_IdempotencyLevel_MAX", + "MethodOptions_IdempotencyLevel_IdempotencyLevel_MIN", + "MethodOptions_IdempotencyLevel_internal_data_", + "MethodOptions_class_data_", + "MethodOptions_globals_", + "Method_class_data_", + "Method_globals_", + "Mixin_class_data_", + "Mixin_globals_", + "NullValue_ARRAYSIZE", + "NullValue_MAX", + "NullValue_MIN", + "NullValue_internal_data_", + "OneofDescriptorProto_class_data_", + "OneofDescriptorProto_globals_", + "OneofOptions_class_data_", + "OneofOptions_globals_", + "Option_class_data_", + "Option_globals_", + "ServiceDescriptorProto_class_data_", + "ServiceDescriptorProto_globals_", + "ServiceOptions_class_data_", + "ServiceOptions_globals_", + "SourceCodeInfo_Location_class_data_", + "SourceCodeInfo_Location_globals_", + "SourceCodeInfo_class_data_", + "SourceCodeInfo_globals_", + "SourceContext_class_data_", + "SourceContext_globals_", + "StringValue_class_data_", + "StringValue_globals_", + "Struct_FieldsEntry_DoNotUse_class_data_", + "Struct_FieldsEntry_DoNotUse_globals_", + "Struct_class_data_", + "Struct_globals_", + "SymbolVisibility_ARRAYSIZE", + "SymbolVisibility_MAX", + "SymbolVisibility_MIN", + "SymbolVisibility_internal_data_", + "Syntax_ARRAYSIZE", + "Syntax_MAX", + "Syntax_MIN", + "Syntax_internal_data_", + "Timestamp_class_data_", + "Timestamp_globals_", + "Type_class_data_", + "Type_globals_", + "UInt32Value_class_data_", + "UInt32Value_globals_", + "UInt64Value_class_data_", + "UInt64Value_globals_", + "UninterpretedOption_NamePart_class_data_", + "UninterpretedOption_NamePart_globals_", + "UninterpretedOption_class_data_", + "UninterpretedOption_globals_", + "Value_class_data_", + "Value_globals_" + ], + "reexported": [ + "AbslParseFlag", + "AbslUnparseFlag" + ], + "types": [ + "AccessListener", + "Any", + "AnyGlobalsTypeInternal", + "Api", + "ApiGlobalsTypeInternal", + "Arena", + "ArenaOptions", + "AssignDescriptorsHelper", + "BigEndian", + "BoolValue", + "BoolValueGlobalsTypeInternal", + "BytesValue", + "BytesValueGlobalsTypeInternal", + "Closure", + "ConstMapIterator", + "DebugStringOptions", + "Descriptor", + "DescriptorBuilder", + "DescriptorDatabase", + "DescriptorPool", + "DescriptorPoolDatabase", + "DescriptorPoolDatabaseOptions", + "DescriptorProto", + "DescriptorProtoGlobalsTypeInternal", + "DescriptorProto_ExtensionRange", + "DescriptorProto_ExtensionRangeGlobalsTypeInternal", + "DescriptorProto_ReservedRange", + "DescriptorProto_ReservedRangeGlobalsTypeInternal", + "DoubleValue", + "DoubleValueGlobalsTypeInternal", + "Duration", + "DurationGlobalsTypeInternal", + "DynamicMapSorter", + "DynamicMessage", + "DynamicMessageFactory", + "Edition", + "Empty", + "EmptyGlobalsTypeInternal", + "EncodedDescriptorDatabase", + "Enum", + "EnumDescriptor", + "EnumDescriptorProto", + "EnumDescriptorProtoGlobalsTypeInternal", + "EnumDescriptorProto_EnumReservedRange", + "EnumDescriptorProto_EnumReservedRangeGlobalsTypeInternal", + "EnumGlobalsTypeInternal", + "EnumOptions", + "EnumOptionsGlobalsTypeInternal", + "EnumValue", + "EnumValueDescriptor", + "EnumValueDescriptorProto", + "EnumValueDescriptorProtoGlobalsTypeInternal", + "EnumValueGlobalsTypeInternal", + "EnumValueOptions", + "EnumValueOptionsGlobalsTypeInternal", + "ExtDeclEnforcementLevel", + "ExtensionRangeOptions", + "ExtensionRangeOptionsGlobalsTypeInternal", + "ExtensionRangeOptions_Declaration", + "ExtensionRangeOptions_DeclarationGlobalsTypeInternal", + "ExtensionRangeOptions_VerificationState", + "FastReflectionMessageMutator", + "FastReflectionStringSetter", + "FeatureResolver", + "FeatureSet", + "FeatureSetDefaults", + "FeatureSetDefaultsGlobalsTypeInternal", + "FeatureSetDefaults_FeatureSetEditionDefault", + "FeatureSetDefaults_FeatureSetEditionDefaultGlobalsTypeInternal", + "FeatureSetGlobalsTypeInternal", + "FeatureSet_EnforceNamingStyle", + "FeatureSet_EnumType", + "FeatureSet_FieldPresence", + "FeatureSet_JsonFormat", + "FeatureSet_MessageEncoding", + "FeatureSet_RepeatedFieldEncoding", + "FeatureSet_Utf8Validation", + "FeatureSet_VisibilityFeature", + "FeatureSet_VisibilityFeatureGlobalsTypeInternal", + "FeatureSet_VisibilityFeature_DefaultSymbolVisibility", + "Field", + "FieldDescriptor", + "FieldDescriptorProto", + "FieldDescriptorProtoGlobalsTypeInternal", + "FieldDescriptorProto_Label", + "FieldDescriptorProto_Type", + "FieldGlobalsTypeInternal", + "FieldMask", + "FieldMaskGlobalsTypeInternal", + "FieldOptions", + "FieldOptionsGlobalsTypeInternal", + "FieldOptions_CType", + "FieldOptions_EditionDefault", + "FieldOptions_EditionDefaultGlobalsTypeInternal", + "FieldOptions_FeatureSupport", + "FieldOptions_FeatureSupportGlobalsTypeInternal", + "FieldOptions_JSType", + "FieldOptions_OptionRetention", + "FieldOptions_OptionTargetType", + "Field_Cardinality", + "Field_Kind", + "FileDescriptor", + "FileDescriptorLegacy", + "FileDescriptorProto", + "FileDescriptorProtoGlobalsTypeInternal", + "FileDescriptorSet", + "FileDescriptorSetGlobalsTypeInternal", + "FileDescriptorTables", + "FileOptions", + "FileOptionsGlobalsTypeInternal", + "FileOptions_OptimizeMode", + "FloatValue", + "FloatValueGlobalsTypeInternal", + "GeneratedCodeInfo", + "GeneratedCodeInfoGlobalsTypeInternal", + "GeneratedCodeInfo_Annotation", + "GeneratedCodeInfo_AnnotationGlobalsTypeInternal", + "GeneratedCodeInfo_Annotation_Semantic", + "GeneratedMessageReflectionTestHelper", + "Int32Value", + "Int32ValueGlobalsTypeInternal", + "Int64Value", + "Int64ValueGlobalsTypeInternal", + "ListValue", + "ListValueGlobalsTypeInternal", + "MakeDependent", + "Map", + "MapIterator", + "MapIteratorBase", + "MapKey", + "MapPair", + "MapReflectionTester", + "MapValueConstRef", + "MapValueRef", + "MergedDescriptorDatabase", + "Message", + "MessageFactory", + "MessageLayoutInspector", + "MessageLite", + "MessageOptions", + "MessageOptionsGlobalsTypeInternal", + "Metadata", + "Method", + "MethodDescriptor", + "MethodDescriptorProto", + "MethodDescriptorProtoGlobalsTypeInternal", + "MethodGlobalsTypeInternal", + "MethodOptions", + "MethodOptionsGlobalsTypeInternal", + "MethodOptions_IdempotencyLevel", + "Mixin", + "MixinGlobalsTypeInternal", + "MutableRepeatedFieldRef", + "NoOpAccessListener", + "NullValue", + "OneofDescriptor", + "OneofDescriptorProto", + "OneofDescriptorProtoGlobalsTypeInternal", + "OneofOptions", + "OneofOptionsGlobalsTypeInternal", + "Option", + "OptionGlobalsTypeInternal", + "Reflection", + "RepeatedField", + "RepeatedFieldProxy", + "RepeatedFieldRef", + "RepeatedPtrField", + "ResultCallback", + "ResultCallback1", + "ResultCallback2", + "RpcChannel", + "RpcController", + "Service", + "ServiceDescriptor", + "ServiceDescriptorProto", + "ServiceDescriptorProtoGlobalsTypeInternal", + "ServiceOptions", + "ServiceOptionsGlobalsTypeInternal", + "SimpleDescriptorDatabase", + "SourceCodeInfo", + "SourceCodeInfoGlobalsTypeInternal", + "SourceCodeInfo_Location", + "SourceCodeInfo_LocationGlobalsTypeInternal", + "SourceContext", + "SourceContextGlobalsTypeInternal", + "SourceLocation", + "StringValue", + "StringValueGlobalsTypeInternal", + "Struct", + "StructGlobalsTypeInternal", + "Struct_FieldsEntry_DoNotUse", + "Struct_FieldsEntry_DoNotUseGlobalsTypeInternal", + "Symbol", + "SymbolChecker", + "SymbolCheckerError", + "SymbolCheckerErrorType", + "SymbolVisibility", + "Syntax", + "TextFormat", + "Timestamp", + "TimestampGlobalsTypeInternal", + "Type", + "TypeGlobalsTypeInternal", + "TypeId", + "UInt32Value", + "UInt32ValueGlobalsTypeInternal", + "UInt64Value", + "UInt64ValueGlobalsTypeInternal", + "UninterpretedOption", + "UninterpretedOptionGlobalsTypeInternal", + "UninterpretedOption_NamePart", + "UninterpretedOption_NamePartGlobalsTypeInternal", + "UnknownField", + "UnknownFieldSet", + "Value", + "ValueGlobalsTypeInternal", + "WeakRepeatedPtrField", + "int16", + "int32", + "int64", + "int8", + "is_proto_enum", + "uint", + "uint16", + "uint32", + "uint64", + "uint8" + ] + }, + "google::protobuf::internal": { + "adl": [ + "operator|" + ] + } + }, + "io": { + "google::protobuf": { + "types": [ + "ZeroCopyCodedInputStream" + ] + }, + "google::protobuf::io": { + "functions": [ + "NoLocaleStrtod", + "SafeDoubleToFloat", + "SimpleDtoa", + "SimpleFtoa", + "as_string_data", + "mutable_string_data" + ], + "types": [ + "AnnotationCollector", + "AnnotationProtoCollector", + "ArrayInputStream", + "ArrayOutputStream", + "CodedInputStream", + "CodedOutputStream", + "ColumnNumber", + "ConcatenatingInputStream", + "CopyingInputStream", + "CopyingInputStreamAdaptor", + "CopyingOutputStream", + "CopyingOutputStreamAdaptor", + "CordInputStream", + "CordOutputStream", + "EpsCopyOutputStream", + "ErrorCollector", + "FileInputStream", + "FileOutputStream", + "IstreamInputStream", + "LimitingInputStream", + "OstreamOutputStream", + "Printer", + "StringOutputStream", + "Tokenizer", + "ZeroCopyInputStream", + "ZeroCopyOutputStream" + ] + } + }, + "util": { + "google::protobuf": { + "functions": [ + "operator!=", + "operator%", + "operator%=", + "operator*", + "operator*=", + "operator+", + "operator+=", + "operator-", + "operator-=", + "operator/", + "operator/=", + "operator<", + "operator<<", + "operator<=", + "operator==", + "operator>", + "operator>=" + ] + }, + "google::protobuf::json": { + "functions": [ + "BinaryToJsonStream", + "BinaryToJsonString", + "JsonStreamToMessage", + "JsonStringToMessage", + "JsonToBinaryStream", + "JsonToBinaryString", + "MessageToJsonStream", + "MessageToJsonString" + ], + "types": [ + "ParseOptions", + "PrintOptions" + ] + }, + "google::protobuf::util": { + "functions": [ + "ConvertDescriptorToType", + "NewTypeResolverForDescriptorPool", + "ParseDelimitedFromCodedStream", + "ParseDelimitedFromZeroCopyStream", + "SerializeDelimitedToCodedStream", + "SerializeDelimitedToFileDescriptor", + "SerializeDelimitedToOstream", + "SerializeDelimitedToZeroCopyStream" + ], + "reexported": [ + "BinaryToJsonStream", + "BinaryToJsonString", + "JsonStringToMessage", + "JsonToBinaryStream", + "JsonToBinaryString", + "MessageToJsonString" + ], + "types": [ + "DefaultFieldComparator", + "FieldComparator", + "FieldContext", + "FieldMaskUtil", + "JsonParseOptions", + "JsonPrintOptions", + "MessageDifferencer", + "SimpleFieldComparator", + "TimeUtil", + "TypeResolver" + ] + } + }, + "compiler": { + "google::protobuf::compiler": { + "types": [ + "DiskSourceTree", + "Importer", + "MultiFileErrorCollector", + "Parser", + "SourceLocationTable", + "SourceTree", + "SourceTreeDescriptorDatabase" + ] + } + }, + "gzip": { + "google::protobuf::io": { + "types": [ + "GzipInputStream", + "GzipOutputStream" + ] + } + } + }, + "not exported": { + "headers": { + "google/protobuf/arena_test_util.h": "test support", + "google/protobuf/map_test_util.h": "test support (needs test protos)", + "google/protobuf/reflection_tester.h": "test support (needs test protos)", + "google/protobuf/test_util.h": "test support", + "google/protobuf/test_util2.h": "test support", + "google/protobuf/test_util_lite.h": "test support", + "google/protobuf/test_textproto.h": "test support (needs GoogleMock)", + "google/protobuf/wire_format_unittest.h": "test support", + "google/protobuf/descriptor_test_utils.h": "test support", + "google/protobuf/internal_visibility_for_testing.h": "test support", + "google/protobuf/unredacted_debug_format_for_test.h": "test support", + "google/protobuf/io/test_zero_copy_stream.h": "test support", + "google/protobuf/io/io_win32.h": "Windows-only portability layer of the compiler (namespace io::win32)", + "google/protobuf/util/internal_timeval.h": "implementation detail" + }, + "implementation namespaces": [ + "google::protobuf::compiler::generator_internal", + "google::protobuf::internal", + "google::protobuf::internal::big_endian", + "google::protobuf::internal::cleanup", + "google::protobuf::internal::cpp", + "google::protobuf::internal::detail", + "google::protobuf::internal::field_layout", + "google::protobuf::internal::generated_enum", + "google::protobuf::internal::little_endian", + "google::protobuf::internal::string_util", + "google::protobuf::io::zc_sink_internal" + ], + "other namespaces": { + "pb": "the C++ feature-set extension of editions (pb::CppFeatures, from cpp_features.proto; extension_set.h forward-declares it), used by protoc and generated code: not exported, so a module-only translation unit keeps the common `namespace pb = google::protobuf;`; declares it" + }, + "names": { + "google::protobuf::kint32max": "internal linkage: declared again with its value in mcpplibs::mwrap::protobuf", + "google::protobuf::kint32min": "internal linkage: declared again with its value in mcpplibs::mwrap::protobuf", + "google::protobuf::kint64max": "internal linkage: declared again with its value in mcpplibs::mwrap::protobuf", + "google::protobuf::kint64min": "internal linkage: declared again with its value in mcpplibs::mwrap::protobuf", + "google::protobuf::kuint32max": "internal linkage: declared again with its value in mcpplibs::mwrap::protobuf", + "google::protobuf::kuint64max": "internal linkage: declared again with its value in mcpplibs::mwrap::protobuf", + "google::protobuf::TestUtil::ReflectionTester": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::compiler::CodeGenerator": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::compiler::CommandLineInterface": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::compiler::cpp::CalculateFieldDescriptorRepeatedType": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::compiler::cpp::CppGenerator": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::compiler::cpp::Formatter": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::compiler::cpp::MessageTableTester": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::compiler::java::MemoizeProjection": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::descriptor_unittest::DescriptorPoolMemoizationTest": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::descriptor_unittest::DescriptorTest": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::descriptor_unittest::FeaturesTest": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::descriptor_unittest::ValidationErrorTest": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::expr::CelMapReflectionFriend": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::expr::SudoMapReflectionFriend": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::python::MapReflectionFriend": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::python::MessageReflectionFriend": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::python::cmessage::PythonFieldValuePrinter": "only declared (a friend of a protobuf class): defined by another project or by protoc", + "google::protobuf::rust::PtrAndLen": "only declared (a friend of a protobuf class): defined by another project or by protoc" + } + }, + "adapted": [ + "kint32max", + "kint32min", + "kint64max", + "kint64min", + "kuint32max", + "kuint64max" + ], + "macros": { + "constants": [ + "GOOGLE_PROTOBUF_VERSION", + "GOOGLE_PROTOBUF_VERSION_SUFFIX", + "PROTOBUF_OSS_VERSION", + "PROTOBUF_OSS_VERSION_SUFFIX", + "PROTOBUF_VERSION", + "PROTOBUF_VERSION_SUFFIX" + ], + "functions": [ + "GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG" + ], + "textual": { + "GOOGLE_PROTOBUF_ANY_H__": "header guard", + "GOOGLE_PROTOBUF_ARCH_64_BIT": "describes the target (GOOGLE_PROTOBUF_ARCH_*): a switch for #if, different on each platform", + "GOOGLE_PROTOBUF_ARCH_X64": "describes the target (GOOGLE_PROTOBUF_ARCH_*): a switch for #if, different on each platform", + "GOOGLE_PROTOBUF_ARENASTRING_H__": "header guard", + "GOOGLE_PROTOBUF_ARENAZ_SAMPLER_H__": "header guard", + "GOOGLE_PROTOBUF_ARENA_ALIGN_H__": "header guard", + "GOOGLE_PROTOBUF_ARENA_ALLOCATION_POLICY_H__": "header guard", + "GOOGLE_PROTOBUF_ARENA_CLEANUP_H__": "header guard", + "GOOGLE_PROTOBUF_ARENA_H__": "header guard", + "GOOGLE_PROTOBUF_ASSERT_RETURN": "function-like: generates code or attributes, or returns from its caller", + "GOOGLE_PROTOBUF_COMMON_H__": "header guard", + "GOOGLE_PROTOBUF_COMPILER_IMPORTER_H__": "header guard", + "GOOGLE_PROTOBUF_COMPILER_PARSER_H__": "header guard", + "GOOGLE_PROTOBUF_CPP_EDITION_DEFAULTS_H__": "header guard", + "GOOGLE_PROTOBUF_DESCRIPTOR_DATABASE_H__": "header guard", + "GOOGLE_PROTOBUF_DESCRIPTOR_H__": "header guard", + "GOOGLE_PROTOBUF_DESCRIPTOR_LEGACY_H__": "header guard", + "GOOGLE_PROTOBUF_DESCRIPTOR_LITE_H__": "header guard", + "GOOGLE_PROTOBUF_DESCRIPTOR_VISITOR_H__": "header guard", + "GOOGLE_PROTOBUF_DYNAMIC_MESSAGE_H__": "header guard", + "GOOGLE_PROTOBUF_ENDIAN_H__": "header guard", + "GOOGLE_PROTOBUF_EXPLICITLY_CONSTRUCTED_H__": "header guard", + "GOOGLE_PROTOBUF_EXTENSION_SET_H__": "header guard", + "GOOGLE_PROTOBUF_EXTENSION_SET_INL_H__": "header guard", + "GOOGLE_PROTOBUF_FEATURE_RESOLVER_H__": "header guard", + "GOOGLE_PROTOBUF_FIELD_ACCESS_LISTENER_H__": "header guard", + "GOOGLE_PROTOBUF_FIELD_WITH_ARENA_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_BASES_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_DECL_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_GEN_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_TCTABLE_IMPL_H__": "header guard", + "GOOGLE_PROTOBUF_GENERATED_MESSAGE_UTIL_H__": "header guard", + "GOOGLE_PROTOBUF_HAS_BITS_H__": "header guard", + "GOOGLE_PROTOBUF_HAS_CEL_MAP_REFLECTION_FRIEND": "empty: an annotation or a switch for #ifdef", + "GOOGLE_PROTOBUF_IMPLICIT_WEAK_MESSAGE_H__": "header guard", + "GOOGLE_PROTOBUF_INLINED_STRING_FIELD_H__": "header guard", + "GOOGLE_PROTOBUF_INTERNAL_FEATURE_HELPER_H__": "header guard", + "GOOGLE_PROTOBUF_INTERNAL_METADATA_LOCATOR_H__": "header guard", + "GOOGLE_PROTOBUF_INTERNAL_VISIBILITY_H__": "header guard", + "GOOGLE_PROTOBUF_IO_CODED_STREAM_H__": "header guard", + "GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__": "header guard", + "GOOGLE_PROTOBUF_IO_PRINTER_H__": "header guard", + "GOOGLE_PROTOBUF_IO_STRTOD_H__": "header guard", + "GOOGLE_PROTOBUF_IO_TOKENIZER_H__": "header guard", + "GOOGLE_PROTOBUF_IO_ZERO_COPY_SINK_H__": "header guard", + "GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__": "header guard", + "GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_H__": "header guard", + "GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_IMPL_LITE_H__": "header guard", + "GOOGLE_PROTOBUF_JSON_JSON_H__": "header guard", + "GOOGLE_PROTOBUF_MAP_ENTRY_H__": "header guard", + "GOOGLE_PROTOBUF_MAP_FIELD_H__": "header guard", + "GOOGLE_PROTOBUF_MAP_FIELD_LITE_H__": "header guard", + "GOOGLE_PROTOBUF_MAP_H__": "header guard", + "GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__": "header guard", + "GOOGLE_PROTOBUF_MESSAGE_H__": "header guard", + "GOOGLE_PROTOBUF_MESSAGE_LITE_H__": "header guard", + "GOOGLE_PROTOBUF_METADATA_H__": "header guard", + "GOOGLE_PROTOBUF_METADATA_LITE_H__": "header guard", + "GOOGLE_PROTOBUF_MICRO_STRING_H__": "header guard", + "GOOGLE_PROTOBUF_PARSER_ASSERT": "function-like: generates code or attributes, or returns from its caller", + "GOOGLE_PROTOBUF_PARSE_CONTEXT_H__": "header guard", + "GOOGLE_PROTOBUF_PLATFORM_MACROS_H_": "header guard", + "GOOGLE_PROTOBUF_PORT_H__": "header guard", + "GOOGLE_PROTOBUF_RAW_PTR_H__": "header guard", + "GOOGLE_PROTOBUF_REFLECTION_H__": "header guard", + "GOOGLE_PROTOBUF_REFLECTION_INTERNAL_H__": "header guard", + "GOOGLE_PROTOBUF_REFLECTION_MODE_H__": "header guard", + "GOOGLE_PROTOBUF_REFLECTION_OPS_H__": "header guard", + "GOOGLE_PROTOBUF_REFLECTION_VISIT_FIELDS_H__": "header guard", + "GOOGLE_PROTOBUF_REFLECTION_VISIT_FIELD_INFO_H__": "header guard", + "GOOGLE_PROTOBUF_REPEATED_FIELD_H__": "header guard", + "GOOGLE_PROTOBUF_REPEATED_FIELD_PROXY_H__": "header guard", + "GOOGLE_PROTOBUF_REPEATED_FIELD_PROXY_ITERATOR_H__": "header guard", + "GOOGLE_PROTOBUF_REPEATED_FIELD_PROXY_TRAITS_H__": "header guard", + "GOOGLE_PROTOBUF_REPEATED_PTR_FIELD_H__": "header guard", + "GOOGLE_PROTOBUF_RUNTIME_DEPRECATED": "function-like: generates code or attributes, or returns from its caller", + "GOOGLE_PROTOBUF_RUNTIME_VERSION_H__": "header guard", + "GOOGLE_PROTOBUF_SERIAL_ARENA_H__": "header guard", + "GOOGLE_PROTOBUF_SERVICE_H__": "header guard", + "GOOGLE_PROTOBUF_STRING_BLOCK_H__": "header guard", + "GOOGLE_PROTOBUF_STRING_MEMBER_ROBBER_H__": "header guard", + "GOOGLE_PROTOBUF_STUBS_CALLBACK_H_": "header guard", + "GOOGLE_PROTOBUF_STUBS_PORT_H_": "header guard", + "GOOGLE_PROTOBUF_SYMBOL_CHECKER_H__": "header guard", + "GOOGLE_PROTOBUF_TEXT_FORMAT_H__": "header guard", + "GOOGLE_PROTOBUF_THREAD_SAFE_ARENA_H__": "header guard", + "GOOGLE_PROTOBUF_UNKNOWN_FIELD_SET_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_DELIMITED_MESSAGE_UTIL_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_FIELD_COMPARATOR_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_FIELD_MASK_UTIL_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_JSON_UTIL_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_MESSAGE_DIFFERENCER_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__": "header guard", + "GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__": "header guard", + "GOOGLE_PROTOBUF_VARINT_SHUFFLE_H__": "header guard", + "GOOGLE_PROTOBUF_VERIFY_VERSION": "a statement of generated code (calls the library's internals)", + "GOOGLE_PROTOBUF_WIRE_FORMAT_H__": "header guard", + "GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__": "header guard", + "LIBPROTOBUF_EXPORT": "empty: an annotation or a switch for #ifdef", + "LIBPROTOC_EXPORT": "empty: an annotation or a switch for #ifdef", + "PROTOBUF_DEFINE_NAME_ACCESSOR": "function-like: generates code or attributes, or returns from its caller", + "PROTOBUF_DEFINE_OPTIONS_ACCESSOR": "function-like: generates code or attributes, or returns from its caller", + "PROTOBUF_FUTURE_ADD_EARLY_NODISCARD": "annotation or an internal parameter list of generated code", + "PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED": "annotation or an internal parameter list of generated code", + "PROTOBUF_FUTURE_ADD_NODISCARD": "empty: an annotation or a switch for #ifdef", + "PROTOBUF_INTERNAL_CPP_EDITION_DEFAULTS": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_DIRECT_LAZY_FIELD_IN_EXTENSION_SET": "empty: an annotation or a switch for #ifdef", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fany_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fapi_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fcpp_5ffeatures_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fdescriptor_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fduration_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fempty_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ffield_5fmask_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fsource_5fcontext_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fstruct_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftimestamp_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftype_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fwrappers_2eproto": "annotation or an internal parameter list of generated code", + "PROTOBUF_RUNTIME_DEPRECATED": "function-like: generates code or attributes, or returns from its caller", + "PROTOBUF_TC_PARAM_NO_DATA_DECL": "annotation or an internal parameter list of generated code", + "PROTOBUF_TC_PARAM_NO_DATA_PASS": "annotation or an internal parameter list of generated code", + "PROTOBUF_TC_PARAM_PASS": "annotation or an internal parameter list of generated code", + "PROTOBUF_TC_PARSE_FUNCTION_LIST": "annotation or an internal parameter list of generated code", + "PROTOBUF_TC_PARSE_FUNCTION_LIST_END_GROUP": "function-like: generates code or attributes, or returns from its caller", + "PROTOBUF_TC_PARSE_FUNCTION_LIST_PACKED": "function-like: generates code or attributes, or returns from its caller", + "PROTOBUF_TC_PARSE_FUNCTION_LIST_REPEATED": "function-like: generates code or attributes, or returns from its caller", + "PROTOBUF_TC_PARSE_FUNCTION_LIST_SINGLE": "function-like: generates code or attributes, or returns from its caller", + "google_2fprotobuf_2fany_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fapi_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fduration_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fempty_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2ffield_5fmask_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fsource_5fcontext_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fstruct_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2ftimestamp_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2ftype_2eproto_2epb_2eh": "header guard", + "google_2fprotobuf_2fwrappers_2eproto_2epb_2eh": "header guard" + } + } +} diff --git a/tools/surface.py b/tools/surface.py new file mode 100644 index 0000000..7ec0521 --- /dev/null +++ b/tools/surface.py @@ -0,0 +1,561 @@ +#!/usr/bin/env python3 +"""The module's export lists, derived from protobuf's public headers. + +The headers are those of the release compat.protobuf builds (upstream's own +tarball, pinned with its checksum in upstream/documents.json and fetched into +target/upstream), read with the Abseil release compat.abseil builds (the same +file pins it) and utf8_range from the protobuf tarball. + +Modules, by the directory of the header that declares a name: + + protobuf : messages, descriptors, reflection, arenas, + repeated fields, maps, text format, the well-known types (the root, + mcpplibs.mwrap.protobuf, which also re-exports the others) + io : coded streams, zero-copy streams, + tokenizer, printer + util , : JSON, + MessageDifferencer, TimeUtil, FieldMaskUtil, delimited messages, + type resolvers + compiler : parsing .proto + files at run time (the part of the compiler in the runtime library) + gzip : GzipInputStream and + GzipOutputStream, only with the package's `gzip` feature (the + library defines them only then) + +With --clang the headers are read by the compiler and every name +declared in `namespace google::protobuf` and its public nested namespaces is +recorded in tools/surface.json under the module of the header that declares +it, provided that module's headers make it visible (else under the first +module whose headers do). A function name is exported by every module that +declares an overload of it. Namespaces whose name contains `internal` are +implementation detail and not exported, except their operators, which apply +to public types and are found by argument-dependent lookup. Names of internal +linkage cannot be exported; the record lists them. No `absl` name is +exported: Abseil's names belong to mcpplibs.mwrap.abseil. + +The macros: the version macros are constants of the same names in +mcpplibs::mwrap::protobuf::macros (compiled as constant expressions), as is +GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG, a constexpr function; every other macro +of the headers stays a macro, in , listed with its +reason. + +--write writes the module sources, , +, tests/macros_test.cpp and docs/api.md. +""" +import argparse +import hashlib +import json +from pathlib import Path +import re +import subprocess +import sys +import tarfile +import tempfile +import urllib.request + +ROOT = Path(__file__).resolve().parent.parent +RECORD = ROOT / 'tools/surface.json' +SRC = ROOT / 'src' +VERSION = '35.1' + +MODULES = ('protobuf', 'io', 'util', 'compiler', 'gzip') +MODULE_NAMES = {'protobuf': 'mcpplibs.mwrap.protobuf', 'io': 'mcpplibs.mwrap.protobuf.io', 'util': 'mcpplibs.mwrap.protobuf.util', + 'compiler': 'mcpplibs.mwrap.protobuf.compiler', 'gzip': 'mcpplibs.mwrap.protobuf.io.gzip'} +MODULE_FILES = {'protobuf': 'src/protobuf.cppm', 'io': 'src/io.cppm', 'util': 'src/util.cppm', 'compiler': 'src/compiler.cppm', + 'gzip': 'src/gzip/io_gzip.cppm'} +# Test and mocking support in the public directories: they need GoogleTest/GoogleMock or protobuf's test protos. +EXCLUDED = { + 'google/protobuf/arena_test_util.h': 'test support', 'google/protobuf/map_test_util.h': 'test support (needs test protos)', + 'google/protobuf/reflection_tester.h': 'test support (needs test protos)', 'google/protobuf/test_util.h': 'test support', + 'google/protobuf/test_util2.h': 'test support', 'google/protobuf/test_util_lite.h': 'test support', + 'google/protobuf/test_textproto.h': 'test support (needs GoogleMock)', 'google/protobuf/wire_format_unittest.h': 'test support', + 'google/protobuf/descriptor_test_utils.h': 'test support', 'google/protobuf/internal_visibility_for_testing.h': 'test support', + 'google/protobuf/unredacted_debug_format_for_test.h': 'test support', 'google/protobuf/io/test_zero_copy_stream.h': 'test support', + 'google/protobuf/io/io_win32.h': 'Windows-only portability layer of the compiler (namespace io::win32)', + 'google/protobuf/util/internal_timeval.h': 'implementation detail', +} +# The namespaces whose names are exported; any other namespace a header mentions only forward-declares friends. +SCOPES = {'google::protobuf', 'google::protobuf::io', 'google::protobuf::util', 'google::protobuf::json', 'google::protobuf::compiler'} +# Constants of internal linkage (stubs/common.h: `static const` limits), declared again with their values. +ADAPTED = {f'google::protobuf::{n}' for n in ('kint32max', 'kint32min', 'kint64max', 'kint64min', 'kuint32max', 'kuint64max')} +COMPILER_HEADERS = ('google/protobuf/compiler/importer.h', 'google/protobuf/compiler/parser.h') +GZIP_HEADERS = ('google/protobuf/io/gzip_stream.h',) + +KINDS = { + 'CXXRecordDecl': 'types', 'ClassTemplateDecl': 'types', 'EnumDecl': 'types', 'TypeAliasDecl': 'types', 'TypedefDecl': 'types', + 'TypeAliasTemplateDecl': 'types', 'FunctionDecl': 'functions', 'FunctionTemplateDecl': 'functions', 'VarDecl': 'objects', + 'VarTemplateDecl': 'objects', 'UsingDecl': 'reexported', +} +ADL = re.compile(r'operator\W') +MEMBERS = {'CXXMethodDecl', 'CXXConstructorDecl', 'CXXDestructorDecl', 'CXXConversionDecl'} +PASSED = {'UsingDirectiveDecl', 'UsingShadowDecl', 'ClassTemplateSpecializationDecl', 'ClassTemplatePartialSpecializationDecl', + 'CXXDeductionGuideDecl', 'StaticAssertDecl', 'EmptyDecl', 'FriendDecl', 'LinkageSpecDecl', 'FullComment', + 'VarTemplateSpecializationDecl', 'VarTemplatePartialSpecializationDecl', 'ExplicitInstantiationDecl', 'NamespaceAliasDecl', + 'UsingEnumDecl', 'ConceptDecl', *MEMBERS} + + +def fetch(): + """protobuf's and Abseil's release trees under target/upstream, checked against upstream/documents.json.""" + pins = json.loads((ROOT / 'upstream/documents.json').read_text(encoding='utf-8')) + cache = ROOT / 'target/upstream' + cache.mkdir(parents=True, exist_ok=True) + tops = [] + for key, name in (('upstream', 'protobuf.tar.gz'), ('abseil', 'abseil-cpp.tar.gz')): + url, digest = pins[key], pins[key + '_sha256'] + archive = cache / name + if not archive.exists() or hashlib.sha256(archive.read_bytes()).hexdigest() != digest: + print('+ fetch', url, flush=True) + with urllib.request.urlopen(url, timeout=300) as response: + archive.write_bytes(response.read()) + got = hashlib.sha256(archive.read_bytes()).hexdigest() + if got != digest: + sys.exit(f'{name}: checksum {got} != {digest}') + with tarfile.open(archive) as tar: + top = tar.next().name.split('/')[0] + if not (cache / top).exists(): + tar.extractall(cache, filter='data') + tops.append(cache / top) + return tops[0], tops[1] + + +def include_dirs(protobuf, abseil): + return [protobuf / 'src', abseil, protobuf / 'third_party/utf8_range'] + + +def headers(protobuf, module=None): + src = protobuf / 'src' + rel = lambda p: p.relative_to(src).as_posix() + found = { + 'protobuf': sorted(rel(p) for p in (src / 'google/protobuf').glob('*.h')), + 'io': sorted(rel(p) for p in (src / 'google/protobuf/io').glob('*.h') if rel(p) not in GZIP_HEADERS), + 'util': sorted(rel(p) for p in (src / 'google/protobuf/util').glob('*.h')) + ['google/protobuf/json/json.h'], + 'compiler': list(COMPILER_HEADERS), + 'gzip': list(GZIP_HEADERS), + } + found = {m: [h for h in hs if h not in EXCLUDED and not h.endswith('/package_info.h')] for m, hs in found.items()} + return found[module] if module else found + + +def module_of(path): + path = path.replace('\\', '/') + match = re.search(r'google/protobuf/(.*)$', path) + if not match: + return None + rel = 'google/protobuf/' + match.group(1) + if rel in GZIP_HEADERS: + return 'gzip' + for module, prefix in (('compiler', 'google/protobuf/compiler/'), ('io', 'google/protobuf/io/'), ('util', 'google/protobuf/util/'), + ('util', 'google/protobuf/json/')): + if rel.startswith(prefix): + return module + return 'protobuf' + + +def dump(clang, protobuf, abseil, include): + with tempfile.TemporaryDirectory(prefix='protobuf-surface-') as directory: + source = Path(directory) / 'all.cpp' + source.write_text(''.join(f'#include <{h}>\n' for h in include), encoding='utf-8') + command = [clang, '-std=c++23', '-fsyntax-only', '-w', *[f'-I{d}' for d in include_dirs(protobuf, abseil)], + '-Xclang', '-skip-function-bodies', '-Xclang', '-ast-dump=json', '-Xclang', '-ast-dump-filter=google', str(source)] + text = '\n' + subprocess.run(command, check=True, stdout=subprocess.PIPE, text=True).stdout + decoder, at, out = json.JSONDecoder(), 0, [] + while True: + at = text.find('\n{', at - 1 if at else 0) + if at < 0: + break + tree, at = decoder.raw_decode(text, at + 1) + out.append(tree) + return out + + +def annotate(node, state): + """Give every node the file of its location: clang writes a location's file only when it changes.""" + def touch(loc): + if 'spellingLoc' in loc: + touch(loc['spellingLoc']) + touch(loc.get('expansionLoc', {})) + elif 'file' in loc: + state['file'] = loc['file'] + if isinstance(node, dict): + for key, value in list(node.items()): + if key == 'loc': + touch(value) + node['_file'] = state['file'] + elif key == 'range': + touch(value.get('begin', {})) + touch(value.get('end', {})) + elif key not in ('includedFrom',): + annotate(value, state) + elif isinstance(node, list): + for item in node: + annotate(item, state) + + +def internal_linkage(node): + return node.get('storageClass') == 'static' or (node.get('kind') == 'VarDecl' and not node.get('inline') and node.get('constexpr')) + + +def declarations(clang, protobuf, abseil, include): + found, skipped, unknown = {}, set(), set() + + def walk(node, scope, hidden=False): + for child in node.get('inner', []): + kind, name = child.get('kind'), child.get('name') + if kind == 'NamespaceDecl': + if child.get('isInline'): + walk(child, scope, hidden) + elif not name: + skipped.add(f'{scope}::(anonymous)') + elif hidden or 'internal' in name: + skipped.add(f'{scope}::{name}') + walk(child, f'{scope}::{name}', True) + else: + walk(child, f'{scope}::{name}') + continue + if child.get('isImplicit') or not name or kind in PASSED or name.startswith('<'): + continue + if hidden and not (kind in ('FunctionDecl', 'FunctionTemplateDecl') and ADL.match(name)): + continue + if 'parentDeclContextId' in child or (kind == 'FunctionTemplateDecl' and any(i.get('kind') in MEMBERS for i in child.get('inner', []))): + continue + if kind not in KINDS: + unknown.add(f'{kind} {scope}::{name}') + continue + if kind == 'UsingDecl': + name = name.split('::')[-1] + entry = found.setdefault((scope, name), {'kind': 'adl' if hidden else KINDS[kind], 'modules': set(), 'internal': False, + 'definition': set()}) + entry.setdefault('decls', set()).add(kind) + module = module_of(child.get('_file') or '') + if module: + entry['modules'].add(module) + if child.get('completeDefinition') or any(i.get('completeDefinition') for i in child.get('inner', []) if isinstance(i, dict)): + entry['definition'].add(module) + if kind in ('VarDecl', 'FunctionDecl') and internal_linkage(child): + entry['internal'] = True + if kind == 'EnumDecl' and not child.get('scopedEnumTag'): + for item in child.get('inner', []): + if item.get('kind') == 'EnumConstantDecl': + e = found.setdefault((scope, item['name']), {'kind': 'enumerators', 'modules': set(), 'internal': False, 'definition': set()}) + if module: + e['modules'].add(module) + + state = {'file': None} + for tree in dump(clang, protobuf, abseil, include): + annotate(tree, state) + if tree.get('kind') == 'NamespaceDecl' and tree.get('name') == 'google': + for child in tree.get('inner', []): + if child.get('kind') == 'NamespaceDecl' and child.get('name') == 'protobuf': + walk(child, 'google::protobuf') + assert not unknown, sorted(unknown) + return found, skipped + + +# ── macros ─────────────────────────────────────────────────────────────────── + +MACRO = re.compile(r'#define\s+([A-Za-z_]\w*)(\(([^)]*)\))?\s*(.*)$') +# Mapped by hand: a computation, as a constexpr function of the same name (tests/macros_test.cpp compares them). +FUNCTIONS = {'GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG'} + + +def macro_definitions(clang, protobuf, abseil, include): + source = ''.join(f'#include <{h}>\n' for h in include) + command = [clang, '-std=c++23', '-E', '-dD', '-w', *[f'-I{d}' for d in include_dirs(protobuf, abseil)], '-x', 'c++', '-'] + text = subprocess.run(command, check=True, input=source, stdout=subprocess.PIPE, text=True).stdout + current, out = '', {} + for line in text.splitlines(): + if line.startswith('# ') and '"' in line: + current = line.split('"')[1].replace('\\\\', '/').replace('\\', '/') + continue + if '/google/protobuf/' not in current: + continue + if line.startswith('#undef '): + out.pop(line.split()[1], None) + continue + match = MACRO.match(line) + if match: + out[match.group(1)] = {'header': current.split('/src/', 1)[-1], 'params': match.group(2) is not None, 'body': match.group(4).strip()} + return out + + +def constant_expressions(clang, protobuf, abseil, include, names): + names = list(names) + while names: + preamble = ''.join(f'#include <{h}>\n' for h in include) + offset = preamble.count('\n') + lines = [f'inline constexpr auto mwrap_probe_{i} = {n};' for i, n in enumerate(names)] + with tempfile.TemporaryDirectory(prefix='protobuf-probe-') as directory: + source = Path(directory) / 'probe.cpp' + source.write_text(preamble + '\n'.join(lines) + '\n', encoding='utf-8') + result = subprocess.run([clang, '-std=c++23', '-fsyntax-only', '-ferror-limit=0', '-w', + *[f'-I{d}' for d in include_dirs(protobuf, abseil)], str(source)], stderr=subprocess.PIPE, text=True) + bad = {int(m.group(1)) - offset for m in re.finditer(r'probe\.cpp:(\d+):\d+: error', result.stderr)} + bad = {names[i - 1] for i in bad if 1 <= i <= len(names)} + if not bad: + return names + names = [n for n in names if n not in bad] + return names + + +def classify_macros(clang, protobuf, abseil, include): + defined = macro_definitions(clang, protobuf, abseil, include) + textual, candidates = {}, [] + for name, entry in sorted(defined.items()): + if name in FUNCTIONS: + continue + body = entry['body'] + if name.endswith(('_H__', '_H_')) or re.fullmatch(r'google_2fprotobuf_\w+_2eh', name): + textual[name] = 'header guard' + elif entry['header'].endswith('stubs/platform_macros.h'): + textual[name] = 'describes the target (GOOGLE_PROTOBUF_ARCH_*): a switch for #if, different on each platform' + elif not body: + textual[name] = 'empty: an annotation or a switch for #ifdef' + elif entry['params']: + textual[name] = 'function-like: generates code or attributes, or returns from its caller' + elif 'INTERNAL' in name or name.startswith('PROTOBUF_TC_') or body.startswith(('[[', 'ABSL_', 'PROTOBUF_EXPORT')): + textual[name] = 'annotation or an internal parameter list of generated code' + elif re.search(r'::google::protobuf::internal::', body): + textual[name] = 'a statement of generated code (calls the library\'s internals)' + else: + candidates.append(name) + constants = constant_expressions(clang, protobuf, abseil, include, candidates) + for name in candidates: + if name not in constants: + textual[name] = 'not a constant expression' + return {'constants': constants, 'functions': sorted(FUNCTIONS), 'textual': textual} + + +# ── the record ─────────────────────────────────────────────────────────────── + +def derive(clang): + protobuf, abseil = fetch() + sets = headers(protobuf) + every = sum(sets.values(), []) + found, skipped = declarations(clang, protobuf, abseil, every) + visible = {m: set(declarations(clang, protobuf, abseil, sets[m])[0]) for m in MODULES} + record = {m: {} for m in MODULES} + internal = {} + adapted = [] + for (scope, name), entry in sorted(found.items()): + key = (scope, name) + public_scope = scope in SCOPES or scope.split('::')[-1].find('internal') >= 0 + forward_only = entry.get('decls', set()) <= {'CXXRecordDecl', 'ClassTemplateDecl'} and not entry['definition'] + if not public_scope or (scope != 'google::protobuf' and entry['kind'] == 'types' and forward_only): + internal[f'{scope}::{name}'] = 'only declared (a friend of a protobuf class): defined by another project or by protoc' + continue + if entry['internal']: + if entry['kind'] == 'objects' and f'{scope}::{name}' in ADAPTED: + adapted.append(name) + internal[f'{scope}::{name}'] = 'internal linkage: declared again with its value in mcpplibs::mwrap::protobuf' + else: + internal[f'{scope}::{name}'] = 'internal linkage (static, or constexpr not inline): every includer has its own' + continue + if entry['kind'] in ('functions', 'adl'): + owners = [m for m in MODULES if m in entry['modules'] and key in visible[m]] + else: + preferred = entry['definition'] or entry['modules'] + owners = [m for m in MODULES if m in preferred and key in visible[m]][:1] + if not owners: + owners = [m for m in MODULES if key in visible[m]][:1] + if not owners: + internal[f'{scope}::{name}'] = 'declared by no public header (only reached through an implementation header)' + continue + for module in owners: + record[module].setdefault(scope, {}).setdefault(entry['kind'], []).append(name) + macros = classify_macros(clang, protobuf, abseil, every) + pins = json.loads((ROOT / 'upstream/documents.json').read_text(encoding='utf-8')) + return { + 'release': pins['upstream'], + 'headers': sets, + 'modules': {m: {s: {k: sorted(v) for k, v in sorted(kinds.items())} for s, kinds in sorted(record[m].items())} for m in MODULES}, + 'not exported': { + 'headers': EXCLUDED, + 'implementation namespaces': sorted(skipped), + 'other namespaces': {'pb': 'the C++ feature-set extension of editions (pb::CppFeatures, from cpp_features.proto; extension_set.h ' + 'forward-declares it), used by protoc and generated code: not exported, so a module-only translation ' + 'unit keeps the common `namespace pb = google::protobuf;`; declares it'}, + 'names': internal, + }, + 'adapted': adapted, + 'macros': macros, + } + + +def record(): + return json.loads(RECORD.read_text(encoding='utf-8')) + + +# ── the sources ────────────────────────────────────────────────────────────── + +HEADER = '// Written by tools/surface.py from tools/surface.json; tools/check_exports.py audits it. Do not edit by hand.\n' +TITLES = (('types', 'types'), ('enumerators', 'enumerators of unscoped enumerations'), ('objects', 'objects'), + ('functions', 'functions and operators'), ('reexported', 'names protobuf re-declares from another namespace'), + ('adl', 'operators of public types declared in an implementation namespace, for argument-dependent lookup')) +SUMMARY = { + 'protobuf': 'messages, descriptors, reflection, arenas, repeated fields, maps, text format and the well-known types', + 'io': 'coded and zero-copy streams, the tokenizer and the printer', + 'util': 'JSON, MessageDifferencer, TimeUtil, FieldMaskUtil, delimited messages and type resolvers', + 'compiler': 'parsing .proto files at run time: Importer, DiskSourceTree, Parser', + 'gzip': 'GzipInputStream and GzipOutputStream (the package\'s `gzip` feature)', +} + + +def module_text(module, surface): + name = MODULE_NAMES[module] + lines = [HEADER, f'// {name} — {SUMMARY[module]} (protobuf {VERSION}), unchanged:', + '// each name is a using-declaration of the upstream entity in the namespace upstream declares it in.'] + if module == 'protobuf': + lines.append('// The root also re-exports the other modules (gzip only through its own import, with the feature).') + detail = 'detail/' if module != 'gzip' else '../detail/' + lines += ['module;', f'#include "{detail}prelude.hpp"', *[f'#include <{h}>' for h in surface['headers'][module]], + f'#include "{detail}epilogue.hpp"', '', f'export module {name};', ''] + if module == 'protobuf': + lines += ['export import mcpplibs.mwrap.protobuf.io;', 'export import mcpplibs.mwrap.protobuf.util;', + 'export import mcpplibs.mwrap.protobuf.compiler;', 'export import mcpplibs.mwrap.protobuf.macros;', ''] + if module == 'protobuf' and surface['adapted']: + lines += ['// constants of internal linkage in the headers (stubs/common.h), declared again under their names with their values', + 'export namespace mcpplibs::mwrap::protobuf {'] + lines += [f'inline constexpr auto {n} = ::google::protobuf::{n};' for n in surface['adapted']] + lines += ['} // namespace mcpplibs::mwrap::protobuf', ''] + for scope, kinds in surface['modules'][module].items(): + lines.append(f'export namespace {scope} {{') + for kind, title in TITLES: + names = kinds.get(kind, []) + if names: + lines.append(f'// {title} ({len(names)})') + lines += [f'using ::{scope}::{n};' for n in names] + lines += [f'}} // namespace {scope}', ''] + return '\n'.join(lines) + + +def macros_text(surface): + m = surface['macros'] + lines = [HEADER, '// mcpplibs.mwrap.protobuf.macros — the version macros of protobuf\'s headers as constants of the same names in', + '// mcpplibs::mwrap::protobuf::macros, and GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG as a constexpr function. A module', + '// does not export macros: the others (GOOGLE_PROTOBUF_VERIFY_VERSION, the platform switches …) come from', + '// #include , before the import.', 'module;', '#include "detail/prelude.hpp"', + *[f'#include <{h}>' for h in surface['headers']['protobuf']], '#include "detail/epilogue.hpp"', '', 'namespace mwrap_protobuf_macros {'] + lines += [f'inline constexpr auto value_{n} = {n};' for n in m['constants']] + lines.append('} // namespace mwrap_protobuf_macros\n') + lines += [f'#undef {n}' for n in m['constants'] + m['functions']] + lines += ['', 'export module mcpplibs.mwrap.protobuf.macros;', '', 'export namespace mcpplibs::mwrap::protobuf::macros {', ''] + lines += [f'inline constexpr auto {n} = mwrap_protobuf_macros::value_{n};' for n in m['constants']] + lines += ['', + '// wire_format_lite.h: the tag of a field, (number << 3) | wire type.', + 'constexpr std::uint32_t GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(int field_number, ::google::protobuf::internal::WireFormatLite::WireType type) {', + ' return static_cast((static_cast(field_number) << ::google::protobuf::internal::WireFormatLite::kTagTypeBits) | type);', + '}', '', '} // namespace mcpplibs::mwrap::protobuf::macros', ''] + return '\n'.join(lines) + + +def macros_hpp_text(surface): + lines = ['// — protobuf\'s macros (GOOGLE_PROTOBUF_VERIFY_VERSION, the GOOGLE_PROTOBUF_ARCH_*', + '// switches …), which a module cannot export: every public header the modules include, in their order. Include', + '// it BEFORE `import mcpplibs.mwrap.protobuf;` (GCC requires the includes of a translation unit to come before its', + '// imports). Written by tools/surface.py.', '#pragma once', '#include ', ''] + return '\n'.join(lines) + + +def prelude_hpp_text(surface): + lines = ['// — every header the modules of mcpplibs.mwrap.protobuf include in their global module', + '// fragments (without gzip_stream.h, which only the `gzip` feature\'s module includes), in their order.', + '//', '// A translation unit that includes a generated `.pb.h` and imports the module includes this header first:', + '// with GCC every #include must come before the first import, and a translation unit that includes fewer', + '// of these headers than the modules did can read a module\'s declaration as conflicting with its own', + '// (descriptor.h). Written by tools/surface.py.', '#pragma once'] + seen = [] + for module in ('protobuf', 'io', 'util', 'compiler'): + seen += [h for h in surface['headers'][module] if h not in seen] + lines += [f'#include <{h}>' for h in seen] + return '\n'.join(lines) + '\n' + + +def macros_test_text(surface): + m = surface['macros'] + lines = ['// Written by tools/surface.py: every constant of mcpplibs.mwrap.protobuf.macros against the macro of the same', + '// name, and GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG against its mapping. The headers come first; each macro is', + '// taken, then set aside: while it is defined it would replace the qualified name too.', + '#include ', '#include ', '#include ', '#include ', '', + 'namespace header {'] + lines += [f'inline constexpr auto {n.lower()} = {n};' for n in m['constants']] + lines += ['constexpr std::uint32_t make_tag(int number, ::google::protobuf::internal::WireFormatLite::WireType type) {', + ' return GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(number, type);', '}', '} // namespace header', ''] + lines += [f'#undef {n}' for n in m['constants'] + m['functions']] + lines += ['', '#include ', '', 'import mcpplibs.mwrap.protobuf;', '', + 'namespace macros = mcpplibs::mwrap::protobuf::macros;', 'using google::protobuf::internal::WireFormatLite;', '', + 'template ', 'constexpr bool same(A a, B b) {', + ' if constexpr (!std::is_same_v) return false;', + ' else if constexpr (std::is_same_v) return std::string_view(a) == std::string_view(b);', + ' else return a == b;', '}', ''] + lines += [f'static_assert(same(macros::{n}, header::{n.lower()}), "{n}");' for n in m['constants']] + lines += ['static_assert(macros::GOOGLE_PROTOBUF_VERSION == 7035001);', '', + 'TEST(Macros, MakeTagAsTheMacro) {', + ' for (int number : {1, 2, 15, 16, 2047, 536870911})', + ' for (auto type : {WireFormatLite::WIRETYPE_VARINT, WireFormatLite::WIRETYPE_FIXED64, WireFormatLite::WIRETYPE_LENGTH_DELIMITED,', + ' WireFormatLite::WIRETYPE_START_GROUP, WireFormatLite::WIRETYPE_END_GROUP, WireFormatLite::WIRETYPE_FIXED32})', + ' EXPECT_EQ(macros::GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(number, type), header::make_tag(number, type));', + ' static_assert(macros::GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(1, WireFormatLite::WIRETYPE_LENGTH_DELIMITED) == 10);', '}', ''] + return '\n'.join(lines) + + +def api_text(surface): + m, n = surface['macros'], surface['not exported'] + count = lambda module: sum(len(v) for kinds in surface['modules'][module].values() for v in kinds.values()) + lines = ['# Modules and API', '', '[Usage](usage.md) · [README](../README.md) · written by `tools/surface.py` from `tools/surface.json`' + ' (audited by `tools/check_exports.py`).', '', + 'Every exported name is the upstream entity, in the namespace upstream declares it in. No `absl` name is exported:', + 'protobuf\'s API uses Abseil types (`absl::Status`, `absl::string_view`, `absl::Cord`); to name them, import', + '`mcpplibs.mwrap.abseil` or include the Abseil header.', '', '| Module | Names | Of |', '|---|---:|---|'] + lines += [f'| `{MODULE_NAMES[mod]}` | {count(mod)} | {SUMMARY[mod]} |' for mod in MODULES] + lines += [f'| `mcpplibs.mwrap.protobuf.macros` | {len(m["constants"]) + len(m["functions"])} | the version macros and the tag computation |', ''] + for mod in MODULES: + lines += [f'## {MODULE_NAMES[mod]}', ''] + for scope, kinds in surface['modules'][mod].items(): + for kind, title in TITLES: + names = kinds.get(kind, []) + if names: + lines.append(f'- `{scope}` {title} ({len(names)}): ' + ', '.join(f'`{x}`' for x in names)) + lines.append('') + lines += ['## Not exported', '', '- Headers:'] + lines += [f' - `{h}`: {r}' for h, r in n['headers'].items()] + lines += ['- Implementation namespaces: ' + ', '.join(f'`{x}`' for x in n['implementation namespaces'])] + lines += [f'- Namespace `{k}`: {v}' for k, v in n['other namespaces'].items()] + lines += ['- Names:'] + [f' - `{k}`: {v}' for k, v in n['names'].items()] + lines += ['', '## Macros', '', '- Constants in `mcpplibs::mwrap::protobuf::macros`: ' + ', '.join(f'`{x}`' for x in m['constants']), + '- Functions: ' + ', '.join(f'`{x}`' for x in m['functions']), + '- Through `` only:'] + lines += [f' - `{k}`: {v}' for k, v in m['textual'].items()] + return '\n'.join(lines) + '\n' + + +def outputs(surface=None): + surface = surface or record() + out = {ROOT / MODULE_FILES[m]: module_text(m, surface) for m in MODULES} + out[SRC / 'macros.cppm'] = macros_text(surface) + out[ROOT / 'include/mwrap/protobuf/macros.hpp'] = macros_hpp_text(surface) + out[ROOT / 'include/mwrap/protobuf/prelude.hpp'] = prelude_hpp_text(surface) + out[ROOT / 'tests/macros_test.cpp'] = macros_test_text(surface) + out[ROOT / 'docs/api.md'] = api_text(surface) + return out + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--clang', help='derive tools/surface.json with this clang++') + parser.add_argument('--write', action='store_true', help='write the module sources and the headers') + args = parser.parse_args() + if args.clang: + RECORD.write_text(json.dumps(derive(args.clang), indent=1) + '\n', encoding='utf-8') + if args.write: + for path, text in outputs().items(): + path.parent.mkdir(parents=True, exist_ok=True) + if not path.exists() or path.read_text(encoding='utf-8') != text: + path.write_text(text, encoding='utf-8') + surface = record() + for module, scopes in surface['modules'].items(): + print(module + ': ' + '; '.join(f'{scope} ' + ', '.join(f'{len(v)} {k}' for k, v in kinds.items()) for scope, kinds in scopes.items())) + print('macros: ' + ', '.join(f'{len(v)} {k}' for k, v in surface['macros'].items())) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/test_template.py b/tools/test_template.py new file mode 100644 index 0000000..2dc33b1 --- /dev/null +++ b/tools/test_template.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +"""Render an installed candidate's default mcpp template, then build and run it.""" +import argparse +import json +import os +from pathlib import Path +import shutil +import subprocess +import tempfile +import tomllib + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--mcpp", default="mcpp") + parser.add_argument("--namespace", help="index namespace for legacy manifests without package.namespace") + parser.add_argument("--toolchain", default="llvm@23.1.3") + parser.add_argument("--template", help="named template; omit for the package default") + parser.add_argument("--run-arg", action="append", default=[]) + parser.add_argument("--index", type=Path, help="candidate SDK/wrapper index for unpublished feature dependencies") + args = parser.parse_args() + root = Path(__file__).resolve().parents[1] + metadata = tomllib.loads((root / "mcpp.toml").read_text())["package"] + namespace = metadata.get("namespace", args.namespace) + assert namespace, "Supply the published index namespace for this legacy manifest" + name, version = metadata["name"], metadata["version"] + identity = namespace + "." + name + with tempfile.TemporaryDirectory(prefix=name + "-template-") as directory: + temporary = Path(directory) + home = temporary / "home" + package = home / "registry/data/xpkgs" / (namespace + "-x-" + name) / version / (name + "-" + version) + shutil.copytree(root, package, ignore=shutil.ignore_patterns( + ".git", "target", ".mcpp", ".xlings", ".candidate-index", "__pycache__", "mcpp.lock", "compile_commands.json", "mcpp-2026.*")) + index = home / "indices/mcpplibs/pkgs/mwrap" + index.mkdir(parents=True) + entry = '{url="https://example.invalid/candidate.tar.gz",sha256="fixture"}' + descriptor = ('package={spec="1",namespace=' + json.dumps(namespace) + ',name=' + json.dumps(name) + + ',description="Installed template fixture",type="package",mcpp="mcpp.toml",xpm={') + descriptor += ",".join(platform + "={[" + json.dumps(version) + "]=" + entry + "}" + for platform in ("linux", "macosx", "windows")) + "}}\n" + (index / (identity + ".lua")).write_text(descriptor) + env = dict(os.environ, MCPP_HOME=str(home)) + selector = identity + "@" + version + for command in ([args.mcpp, "new", "--list-templates", selector], + [args.mcpp, "new", "quickstart", "--template", selector + (":" + args.template if args.template else "")]): + print("+", " ".join(command), flush=True) + subprocess.run(command, cwd=temporary, env=env, check=True) + project = temporary / "quickstart" + manifest = project / "mcpp.toml" + text = manifest.read_text() + dependency = tomllib.loads(text)["dependencies"] + for part in identity.split("."): + dependency = dependency[part] + options = {"version": dependency} if isinstance(dependency, str) else dependency + assert options["version"] == version, options + replacement = '{ path = ' + json.dumps(package.as_posix()) + if options.get("features"): + replacement += ', features = ' + json.dumps(options["features"]) + replacement += ' }' + lines = text.splitlines() + # The selector as one dotted key, unquoted (mcpp 2026.11.8.1 and later read a quoted one as deprecated). + matches = [i for i, line in enumerate(lines) if line.startswith(identity + " =")] + assert len(matches) == 1, "Expected exactly one qualified dependency from self.name" + lines[matches[0]] = identity + " = " + replacement + manifest.write_text("\n".join(lines) + "\n") + if args.index: + candidate_index = args.index.resolve() + subprocess.run([os.sys.executable, str(candidate_index / "tests/prepare_mwrap_indices.py")], + cwd=candidate_index, check=True) + with manifest.open("a") as out: + out.write("\n[indices]\n") + for namespace in ("compat", "mcpplibs.mwrap"): + view = candidate_index / "tests/mwrap/.indices" / namespace + out.write(json.dumps(namespace) + ' = { path = ' + json.dumps(view.as_posix()) + ' }\n') + command = [args.mcpp, "build", "--toolchain", args.toolchain, "--strict"] + print("+", " ".join(command), flush=True) + subprocess.run(command, cwd=project, check=True) + command = [args.mcpp, "run", "--toolchain", args.toolchain] + if args.run_arg: + command += ["--", *args.run_arg] + print("+", " ".join(command), flush=True) + subprocess.run(command, cwd=project, check=True) + + +if __name__ == "__main__": + main() diff --git a/upstream/abseil-cpp/LICENSE b/upstream/abseil-cpp/LICENSE new file mode 100644 index 0000000..ccd61dc --- /dev/null +++ b/upstream/abseil-cpp/LICENSE @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/upstream/documents.json b/upstream/documents.json new file mode 100644 index 0000000..13d25b1 --- /dev/null +++ b/upstream/documents.json @@ -0,0 +1,29 @@ +{ + "upstream": "https://github.com/protocolbuffers/protobuf/releases/download/v35.1/protobuf-35.1.tar.gz", + "upstream_sha256": "f0b6838e7522a8da96126d487068c959bc624926368f3024ac8fd03abd0a1ac4", + "abseil": "https://github.com/abseil/abseil-cpp/releases/download/20250512.1/abseil-cpp-20250512.1.tar.gz", + "abseil_sha256": "9b7a064305e9fd94d124ffa6cc358592eb42b5da588fb4e07d09254aa40086db", + "pruning": "Nothing of protobuf is vendored: the library is compat.protobuf 35.1 (libprotobuf, with utf8_range from the same tarball), over compat.abseil 20250512.1, both built from these release tarballs. Their README and licenses are retained here; Abseil's because a program that links protobuf links it too. The module surface is read from the release headers (tools/surface.py).", + "documents": [ + { + "path": "upstream/protobuf/README.md", + "source": "https://github.com/protocolbuffers/protobuf/blob/v35.1/README.md", + "sha256": "766a75d175e1005821ed5996724eb4c051ea6e735fc95c135271fa4068a70a98" + }, + { + "path": "upstream/protobuf/LICENSE", + "source": "https://github.com/protocolbuffers/protobuf/blob/v35.1/LICENSE", + "sha256": "6e5e117324afd944dcf67f36cf329843bc1a92229a8cd9bb573d7a83130fea7d" + }, + { + "path": "upstream/utf8_range/LICENSE", + "source": "https://github.com/protocolbuffers/protobuf/blob/v35.1/third_party/utf8_range/LICENSE", + "sha256": "02de69b64fc36d9e938f418e52723e42f0b2b226d58a9cb3c8dcbdf7059f5074" + }, + { + "path": "upstream/abseil-cpp/LICENSE", + "source": "https://github.com/abseil/abseil-cpp/blob/20250512.1/LICENSE", + "sha256": "c79a7fea0e3cac04cd43f20e7b648e5a0ff8fa5344e644b0ee09ca1162b62747" + } + ] +} diff --git a/upstream/protobuf/LICENSE b/upstream/protobuf/LICENSE new file mode 100644 index 0000000..19b305b --- /dev/null +++ b/upstream/protobuf/LICENSE @@ -0,0 +1,32 @@ +Copyright 2008 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. diff --git a/upstream/protobuf/README.md b/upstream/protobuf/README.md new file mode 100644 index 0000000..40e88ba --- /dev/null +++ b/upstream/protobuf/README.md @@ -0,0 +1,155 @@ +Protocol Buffers - Google's data interchange format +=================================================== + +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/protocolbuffers/protobuf/badge)](https://securityscorecards.dev/viewer/?uri=github.com/protocolbuffers/protobuf) + +Copyright 2008 Google LLC + +Overview +-------- + +Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, +platform-neutral, extensible mechanism for serializing structured data. You +can learn more about it in [protobuf's documentation](https://protobuf.dev). + +This README file contains protobuf installation instructions. To install +protobuf, you need to install the protocol compiler (used to compile .proto +files) and the protobuf runtime for your chosen programming language. + +Working With Protobuf Source Code +--------------------------------- + +Most users will find working from +[supported releases](https://github.com/protocolbuffers/protobuf/releases) to be +the easiest path. + +If you choose to work from the head revision of the main branch your build will +occasionally be broken by source-incompatible changes and insufficiently-tested +(and therefore broken) behavior. + +If you are using C++ or otherwise need to build protobuf from source as a part +of your project, you should pin to a release commit on a release branch. + +This is because even release branches can experience some instability in between +release commits. + +### Bazel with Bzlmod + +Protobuf supports +[Bzlmod](https://bazel.build/external/module) with Bazel 8 +. +Users should specify a dependency on protobuf in their MODULE.bazel file as +follows. + +``` +bazel_dep(name = "protobuf", version = ) +``` + +Users can optionally override the repo name, such as for compatibility with +WORKSPACE. + +``` +bazel_dep(name = "protobuf", version = , repo_name = "com_google_protobuf") +``` + +### Bazel with WORKSPACE + +Users can also add the following to their legacy +[WORKSPACE](https://bazel.build/external/overview#workspace-system) file. + +Note that with the release of 30.x there are a few more load statements to +properly set up rules_java and rules_python. + +``` +http_archive( + name = "com_google_protobuf", + strip_prefix = "protobuf-VERSION", + sha256 = ..., + url = ..., +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + +load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies") + +rules_java_dependencies() + +load("@rules_java//java:repositories.bzl", "rules_java_toolchains") + +rules_java_toolchains() + +load("@rules_python//python:repositories.bzl", "py_repositories") + +py_repositories() +``` + +Protobuf Compiler Installation +------------------------------ + +The protobuf compiler is written in C++. If you are using C++, please follow +the [C++ Installation Instructions](src/README.md) to install protoc along +with the C++ runtime. + +For non-C++ users, the simplest way to install the protocol compiler is to +download a pre-built binary from our [GitHub release page](https://github.com/protocolbuffers/protobuf/releases). + +In the downloads section of each release, you can find pre-built binaries in +zip packages: `protoc-$VERSION-$PLATFORM.zip`. It contains the protoc binary +as well as a set of standard `.proto` files distributed along with protobuf. + +If you are looking for an old version that is not available in the release +page, check out the [Maven repository](https://repo1.maven.org/maven2/com/google/protobuf/protoc/). + +These pre-built binaries are only provided for released versions. If you want +to use the github main version at HEAD, or you need to modify protobuf code, +or you are using C++, it's recommended to build your own protoc binary from +source. + +If you would like to build protoc binary from source, see the [C++ Installation Instructions](src/README.md). + +Protobuf Runtime Installation +----------------------------- + +Protobuf supports several different programming languages. For each programming +language, you can find instructions in the corresponding source directory about +how to install protobuf runtime for that specific language: + +| Language | Source | +|--------------------------------------|-------------------------------------------------------------| +| C++ (include C++ runtime and protoc) | [src](src) | +| Java | [java](java) | +| Python | [python](python) | +| Objective-C | [objectivec](objectivec) | +| C# | [csharp](csharp) | +| Ruby | [ruby](ruby) | +| Go | [protocolbuffers/protobuf-go](https://github.com/protocolbuffers/protobuf-go)| +| PHP | [php](php) | +| Dart | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) | +| JavaScript | [protocolbuffers/protobuf-javascript](https://github.com/protocolbuffers/protobuf-javascript)| + +Quick Start +----------- + +The best way to learn how to use protobuf is to follow the [tutorials in our +developer guide](https://protobuf.dev/getting-started). + +If you want to learn from code examples, take a look at the examples in the +[examples](examples) directory. + +Documentation +------------- + +The complete documentation is available at the [Protocol Buffers doc site](https://protobuf.dev). + +Support Policy +-------------- + +Read about our [version support policy](https://protobuf.dev/version-support/) +to stay current on support timeframes for the language libraries. + +Developer Community +------------------- + +To be alerted to upcoming changes in Protocol Buffers and connect with protobuf developers and users, +[join the Google Group](https://groups.google.com/g/protobuf). diff --git a/upstream/utf8_range/LICENSE b/upstream/utf8_range/LICENSE new file mode 100644 index 0000000..e59f14f --- /dev/null +++ b/upstream/utf8_range/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2019 Yibo Cai +Copyright 2022 Google LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.