From 722dfd3b4b152c41b7ef189368ea71e7de730282 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sat, 7 Nov 2026 06:22:58 +0900 Subject: [PATCH 1/2] libarchive-m 3.8.7: libarchive as C++23 modules (mcpplibs.mwrap.libarchive) Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --- .gitattributes | 2 + .github/workflows/ci.yml | 88 +++++ .github/workflows/release.yml | 49 +++ .github/workflows/templates.yml | 28 ++ .gitignore | 6 + .xlings.json | 5 + NOTICE | 13 + README.zh.md | 82 +++++ docs/usage.md | 56 +++ include/mwrap/libarchive/macros.hpp | 14 + mcpp.toml | 43 +++ src/libarchive.cppm | 493 +++++++++++++++++++++++++ src/macros.cppm | 538 +++++++++++++++++++++++++++ templates/bundle/mcpp.toml.in | 10 + templates/bundle/src/main.cpp.in | 57 +++ templates/bundle/template.toml | 4 + tests/api_test.cpp | 119 ++++++ tests/header_mix_test.cpp | 17 + tests/linked.cpp | 468 +++++++++++++++++++++++ tests/macros.cpp | 553 ++++++++++++++++++++++++++++ tools/api.py | 134 +++++++ tools/check_mwrap_release.py | 50 +++ tools/generate.py | 223 +++++++++++ tools/run_conformance.py | 117 ++++++ tools/surface.toml | 20 + tools/test_template.py | 83 +++++ upstream/documents.json | 17 + upstream/libarchive/COPYING | 65 ++++ upstream/libarchive/README.md | 250 +++++++++++++ 29 files changed, 3604 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/templates.yml create mode 100644 .gitignore create mode 100644 .xlings.json create mode 100644 NOTICE create mode 100644 README.zh.md create mode 100644 docs/usage.md create mode 100644 include/mwrap/libarchive/macros.hpp create mode 100644 mcpp.toml create mode 100644 src/libarchive.cppm create mode 100644 src/macros.cppm create mode 100644 templates/bundle/mcpp.toml.in create mode 100644 templates/bundle/src/main.cpp.in create mode 100644 templates/bundle/template.toml create mode 100644 tests/api_test.cpp create mode 100644 tests/header_mix_test.cpp create mode 100644 tests/linked.cpp create mode 100644 tests/macros.cpp create mode 100644 tools/api.py create mode 100644 tools/check_mwrap_release.py create mode 100644 tools/generate.py create mode 100644 tools/run_conformance.py create mode 100644 tools/surface.toml create mode 100644 tools/test_template.py create mode 100644 upstream/documents.json create mode 100644 upstream/libarchive/COPYING create mode 100644 upstream/libarchive/README.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8a6c241 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Preserve upstream document bytes and original whitespace on every platform. +upstream/** -text -whitespace diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8880a57 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,88 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + mcpp: + name: mcpp (${{ matrix.os }}, ${{ matrix.toolchain }}${{ matrix.target && format(', {0}', matrix.target) || '' }}) + strategy: + fail-fast: false + matrix: + include: + - { os: ubuntu-24.04, toolchain: 'gcc@16.1.0' } + - { os: ubuntu-24.04, toolchain: 'gcc@16.1.0', target: x86_64-linux-musl } + - { os: ubuntu-24.04, 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: 60 + defaults: + run: + shell: bash + env: + XLINGS_NON_INTERACTIVE: 1 + TARGET: ${{ matrix.target && format('--target {0}', matrix.target) || '' }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Mwrap identity and bilingual README contract + run: python3 tools/check_mwrap_release.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: Select the toolchain + run: | + name="${{ matrix.toolchain }}" + mcpp toolchain install "${name%@*}" "${name#*@}" + mcpp toolchain default "$name" + + - name: Build the modules + run: mcpp build $TARGET + + - name: Tests (formats and filters written and read back, entries, errors, the constants, every function linked, header mixing) + run: mcpp test $TARGET + + - name: Export audit (the headers as clang reads them on this host) + if: startsWith(matrix.toolchain, 'llvm') + run: python3 tools/generate.py --check + + - name: Upstream's test suite over the same library + if: ${{ !matrix.target }} + run: python3 tools/run_conformance.py --toolchain "${{ matrix.toolchain }}" 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..4bcfe74 --- /dev/null +++ b/.github/workflows/templates.yml @@ -0,0 +1,28 @@ +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.5.1" +jobs: + templates: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + 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 + run: python3 tools/test_template.py --toolchain gcc@16.1.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7c7b405 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +target/ +.mcpp/ +mcpp.lock +compile_commands.json +__pycache__/ +.xlings/ diff --git a/.xlings.json b/.xlings.json new file mode 100644 index 0000000..0ee91fd --- /dev/null +++ b/.xlings.json @@ -0,0 +1,5 @@ +{ + "workspace": { + "xim:mcpp": "2026.11.5.1" + } +} diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..4b2d333 --- /dev/null +++ b/NOTICE @@ -0,0 +1,13 @@ +libarchive-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. libarchive is distributed under the BSD +2-Clause license, with the exceptions its COPYING lists: + + Copyright (c) 2003-2018 Tim Kientzle and the libarchive contributors + +Its original README and license summary are retained in upstream/libarchive/. +The library itself is provided by compat.libarchive from the same release. +Provenance and checksums are recorded in upstream/documents.json. diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 0000000..61366c5 --- /dev/null +++ b/README.zh.md @@ -0,0 +1,82 @@ +# libarchive + +> libarchive——多格式归档与压缩库,以 C++23 模块提供。 + +[English](README.md) · **简体中文** · [上游](https://github.com/libarchive/libarchive) · [发布](https://github.com/mcpplibs/libarchive-m/releases) · [mcpp](https://github.com/mcpp-community/mcpp) · [索引](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/libarchive-m/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mcpplibs/libarchive-m/actions/workflows/ci.yml) + +上游 API 不变:`archive_read_new`、`archive_write_open_memory`、`archive_read_next_header`、`archive_entry_pathname`、 +`struct archive` 与 `struct archive_entry` 都是 `` 与 `` 中的上游实体,位于上游声明它们的全局 +命名空间。库本身是带 zlib、bzip2、liblzma、lz4 与 zstd 的 `compat.libarchive` 3.8.7;常量宏映射为 C++ 常量。每次 CI 都在 +同一份库上运行上游自己的测试套件(702 个测试)。 + +## 模块 + +- `import mcpplibs.mwrap.libarchive;`:`` 与 `` 的全部函数与类型,并重新导出宏模块 +- `import mcpplibs.mwrap.libarchive.macros;`:`ARCHIVE_OK`、`ARCHIVE_EOF`、`ARCHIVE_FATAL`、`ARCHIVE_FORMAT_*`、`ARCHIVE_FILTER_*`、`ARCHIVE_EXTRACT_*`、`AE_IFREG`、`ARCHIVE_ENTRY_ACL_*`、`ARCHIVE_VERSION_NUMBER` 等,位于 `mcpplibs::mwrap::libarchive::macros` + +> 更多模块 API -> [用法与 API](docs/usage.md) + +## 快速开始 + +```sh +mcpp new bundle --template mcpplibs.mwrap.libarchive@3.8.7 +cd bundle +mcpp run +``` + +默认模板在内存中写出含三个文件的 tar.gz 并列出其内容;`mcpp run -- ` 列出 libarchive 能读取的任何归档。 + +```toml +[dependencies] +"mcpplibs.mwrap.libarchive" = "3.8.7" +``` + +```cpp +import std; +import mcpplibs.mwrap.libarchive; + +namespace la = mcpplibs::mwrap::libarchive::macros; + +int main(int argc, char** argv) { + archive* a = archive_read_new(); + archive_read_support_filter_all(a); + archive_read_support_format_all(a); + archive_entry* e; + if (archive_read_open_filename(a, argv[1], 10240) == la::ARCHIVE_OK) + while (archive_read_next_header(a, &e) == la::ARCHIVE_OK) + std::println("{}", archive_entry_pathname(e)); + archive_read_free(a); +} +``` + +## 范围与宏 + +模块导出两个头文件的全部函数:共 453 个,在 Windows 上另有只在 Windows 上声明的两个(`archive_read_open_filenames_w`、 +`archive_entry_copy_bhfi`)。声明是静态库形式(`LIBARCHIVE_STATIC`),模块在包含头文件之前定义它。 + +命名模块不能导出宏。常量映射为 `mcpplibs::mwrap::libarchive::macros` 中同名的 `inline constexpr`。头文件没有面向使用者的 +带参数宏,因此本版本的 `` 为空。宏在限定名中也会展开。同时包含 `` 的翻译单元经 +头文件的宏读取常量([docs/usage.md](docs/usage.md))。 + +## 构建与测试 + +Linux、macOS、Windows 的 CI 用 GCC 与 LLVM 构建模块并运行测试:pax 加 gzip、ustar 加 xz、cpio 加 zstd、gnutar 加 bzip2、 +ZIP 与 7-Zip 写入内存后读回并识别格式与过滤器,经克隆保留的条目元数据,无效输入被拒绝,版本同其宏相等,每个常量同其宏 +相等,每个导出函数都能链接,头文件混用。CI 还运行: + +- 导出审计([tools/generate.py](tools/generate.py) `--check`):按 clang 读到的头文件重新生成模块、宏映射、宏头文件与 + 生成的测试并逐字节比较;在 macOS 与 Windows 上检查头文件在该平台声明的每个名字都已导出; +- 在同一份库上运行上游的测试套件([tools/run_conformance.py](tools/run_conformance.py));其中一个测试因 + compat.libarchive 的配置而失败,已连同原因列出。 + +另一个作业把默认模板当作已安装的包生成项目并运行。 + +## 许可 + +包装部分为 [Apache-2.0](LICENSE),作者 mcpp-community([NOTICE](NOTICE))。libarchive 仍遵循 BSD 2-Clause 许可及其摘要 +列出的例外([upstream/libarchive/COPYING](upstream/libarchive/COPYING)、[README](upstream/libarchive/README.md))。 diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 0000000..a274518 --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,56 @@ +# Usage and API + +`mcpplibs.mwrap.libarchive` 3.8.7 exports libarchive's public API, upstream's +names unchanged. This page lists what each module holds and the places where a +module and a header differ. [tools/generate.py](../tools/generate.py) writes the +lists from the headers, and CI checks them on every target. + +## Modules + +| Module | Holds | +|---|---| +| `mcpplibs.mwrap.libarchive` | ``: `struct archive`; reading (`archive_read_new`, `archive_read_support_filter_*`, `archive_read_support_format_*`, `archive_read_open_*`, `archive_read_next_header`, `archive_read_data*`, `archive_read_extract*`, `archive_read_set_*option*`, passphrases); writing (`archive_write_new`, `archive_write_set_format_*`, `archive_write_add_filter_*`, `archive_write_open_*`, `archive_write_header`, `archive_write_data*`); disk access (`archive_write_disk_*`, `archive_read_disk_*`); matching (`archive_match_*`); errors and status (`archive_errno`, `archive_error_string`, `archive_format_name`, `archive_filter_*`); `archive_version_*`; the callback types and `la_int64_t`, `la_ssize_t`. ``: `struct archive_entry` and every `archive_entry_*` accessor, ACLs, extended attributes, sparse maps, `archive_entry_linkresolver`. Re-exports the macros module | +| `mcpplibs.mwrap.libarchive.macros` | in `mcpplibs::mwrap::libarchive::macros`: the status codes (`ARCHIVE_EOF`, `ARCHIVE_OK`, `ARCHIVE_RETRY`, `ARCHIVE_WARN`, `ARCHIVE_FAILED`, `ARCHIVE_FATAL`); `ARCHIVE_FILTER_*`, `ARCHIVE_COMPRESSION_*` and `ARCHIVE_FORMAT_*`; `ARCHIVE_EXTRACT_*`, `ARCHIVE_READDISK_*`, `ARCHIVE_MATCH_*`; `AE_IF*` file types and `AE_SYMLINK_TYPE_*`; `ARCHIVE_ENTRY_ACL_*`; `ARCHIVE_VERSION_NUMBER`, `ARCHIVE_VERSION_ONLY_STRING`, `ARCHIVE_VERSION_STRING` | + +`archive_read_open_filenames_w` and `archive_entry_copy_bhfi` are declared on +Windows only and are exported there. The functions that upstream marks +deprecated for 4.0 are declared in 3.8.7 and are exported. + +## Configuration + +`compat.libarchive` builds a static library (`LIBARCHIVE_STATIC`) with zlib, +bzip2, liblzma, lz4 and zstd, its bundled BLAKE2, and every format. External +filter programs (`lrzip`, `lzop`, `grzip`, `lzip` through a program) are run +when the system has them. The character set of every locale is UTF-8. The +module defines `LIBARCHIVE_STATIC` before the headers; on Windows the +declarations would otherwise import from a DLL. A unit that includes +`` itself defines it too (tests/header_mix_test.cpp does). + +## Macros + +- **Constants.** Each object-like macro whose expansion is a constant + expression is an `inline constexpr` of the same name and value; + tests/macros.cpp compares every one with its macro. `AE_IF*` keep upstream's + type (`__LA_MODE_T`: `mode_t`, or `unsigned short` on Windows). +- **Declaration syntax.** The `__LA_*` macros (linkage, deprecation, the + portable `time_t`, `mode_t` and `dev_t` spellings) are reserved names and are + not offered. The headers define no macro with arguments for a user; + `` is empty in this release. + +## A header beside the module + +`#include ` and `import mcpplibs.mwrap.libarchive;` may appear in +one unit: they declare the same entities. A macro expands even inside a +qualified name, so `mcpplibs::mwrap::libarchive::macros::ARCHIVE_OK` written +after the header is `...::macros::0`. In such a unit use the header's macros, +or read their values under other names and `#undef` the macros before naming +the constants (tests/macros.cpp does this). + +## Conformance + +tools/run_conformance.py builds libarchive's own `libarchive/test` (312 +sources, 702 tests) with upstream's `test_main.c` over `compat.libarchive` and +runs it against the release's reference files. One test fails by +configuration and is expected: `test_archive_string_conversion_fail_c` +expects a conversion to the C locale's ASCII to fail, and `compat.libarchive` +answers UTF-8 for every locale. diff --git a/include/mwrap/libarchive/macros.hpp b/include/mwrap/libarchive/macros.hpp new file mode 100644 index 0000000..6950307 --- /dev/null +++ b/include/mwrap/libarchive/macros.hpp @@ -0,0 +1,14 @@ +// --- the macros of the headers that are neither a constant +// nor a type: they take arguments, or call a function. A named module cannot export a +// macro: include this header before `import mcpplibs.mwrap.libarchive;`. Each definition is +// upstream's (libarchive 3.8.7, BSD 2-Clause license), made only where the upstream header has +// not defined it, with the constants it names read from mcpplibs::mwrap::libarchive::macros +// and NULL written nullptr. +// The upstream header included after this one redefines these macros. +// Written by tools/generate.py. +#ifndef MWRAP_LIBARCHIVE_MACROS_HPP +#define MWRAP_LIBARCHIVE_MACROS_HPP + +// The headers of this release define no such macro. + +#endif // MWRAP_LIBARCHIVE_MACROS_HPP diff --git a/mcpp.toml b/mcpp.toml new file mode 100644 index 0000000..75f7f2c --- /dev/null +++ b/mcpp.toml @@ -0,0 +1,43 @@ +# Module wrapper; upstream API preserved. Policy: mcpp-index/docs/mwrap.md. +[package] +namespace = "mcpplibs.mwrap" +name = "libarchive" +version = "3.8.7" +description = "libarchive 3.8.7 C++ modules for mcpp (import mcpplibs.mwrap.libarchive;): reading and writing tar, cpio, zip, 7-Zip, ISO 9660 and other archives with their compression filters, archive entries and disk access over compat.libarchive, with the constants of archive.h as C++ constants" +license = "Apache-2.0" +authors = ["mcpp-community"] +repo = "https://github.com/mcpplibs/libarchive-m" +platforms = ["linux", "macos", "windows"] + +[targets.libarchive] +kind = "lib" + +[build] +sources = ["src/*.cppm"] +# : the macros of archive.h that are not constants. +include_dirs = ["include"] + +[dependencies] +compat.libarchive = "3.8.7" + +[test] +discover = ["tests/*.cpp"] + +[package.metadata.mwrap] +upstream-version = "3.8.7" + +[[runtime.deploy]] +from = "LICENSE" +to = "licenses/libarchive" + +[[runtime.deploy]] +from = "NOTICE" +to = "licenses/libarchive" + +[[runtime.deploy]] +from = "upstream/libarchive/README.md" +to = "licenses/libarchive/upstream/libarchive" + +[[runtime.deploy]] +from = "upstream/libarchive/COPYING" +to = "licenses/libarchive/upstream/libarchive" diff --git a/src/libarchive.cppm b/src/libarchive.cppm new file mode 100644 index 0000000..1cb15d3 --- /dev/null +++ b/src/libarchive.cppm @@ -0,0 +1,493 @@ +// mcpplibs.mwrap.libarchive --- libarchive 3.8.7 as a C++ module. Every exported name is +// the upstream entity of the headers below, unchanged, in the global namespace where +// upstream declares it; the root also re-exports the macro mapping. The implementation +// is compat.libarchive 3.8.7. Written by tools/generate.py from the headers. +module; +#ifndef LIBARCHIVE_STATIC +#define LIBARCHIVE_STATIC +#endif +#include +#include + +export module mcpplibs.mwrap.libarchive; + +export import mcpplibs.mwrap.libarchive.macros; + +export { +using ::archive; +using ::archive_acl; +using ::archive_bzlib_version; +using ::archive_clear_error; +using ::archive_close_callback; +using ::archive_cng_version; +using ::archive_commoncrypto_version; +using ::archive_compression; +using ::archive_compression_name; +using ::archive_copy_error; +using ::archive_entry; +using ::archive_entry_acl; +using ::archive_entry_acl_add_entry; +using ::archive_entry_acl_add_entry_w; +using ::archive_entry_acl_clear; +using ::archive_entry_acl_count; +using ::archive_entry_acl_from_text; +using ::archive_entry_acl_from_text_w; +using ::archive_entry_acl_next; +using ::archive_entry_acl_reset; +using ::archive_entry_acl_text; +using ::archive_entry_acl_text_w; +using ::archive_entry_acl_to_text; +using ::archive_entry_acl_to_text_w; +using ::archive_entry_acl_types; +using ::archive_entry_atime; +using ::archive_entry_atime_is_set; +using ::archive_entry_atime_nsec; +using ::archive_entry_birthtime; +using ::archive_entry_birthtime_is_set; +using ::archive_entry_birthtime_nsec; +using ::archive_entry_clear; +using ::archive_entry_clone; +using ::archive_entry_copy_fflags_text; +using ::archive_entry_copy_fflags_text_len; +using ::archive_entry_copy_fflags_text_w; +using ::archive_entry_copy_gname; +using ::archive_entry_copy_gname_w; +using ::archive_entry_copy_hardlink; +using ::archive_entry_copy_hardlink_w; +using ::archive_entry_copy_link; +using ::archive_entry_copy_link_w; +using ::archive_entry_copy_mac_metadata; +using ::archive_entry_copy_pathname; +using ::archive_entry_copy_pathname_w; +using ::archive_entry_copy_sourcepath; +using ::archive_entry_copy_sourcepath_w; +using ::archive_entry_copy_stat; +using ::archive_entry_copy_symlink; +using ::archive_entry_copy_symlink_w; +using ::archive_entry_copy_uname; +using ::archive_entry_copy_uname_w; +using ::archive_entry_ctime; +using ::archive_entry_ctime_is_set; +using ::archive_entry_ctime_nsec; +using ::archive_entry_dev; +using ::archive_entry_dev_is_set; +using ::archive_entry_devmajor; +using ::archive_entry_devminor; +using ::archive_entry_digest; +using ::archive_entry_fflags; +using ::archive_entry_fflags_text; +using ::archive_entry_filetype; +using ::archive_entry_filetype_is_set; +using ::archive_entry_free; +using ::archive_entry_gid; +using ::archive_entry_gid_is_set; +using ::archive_entry_gname; +using ::archive_entry_gname_utf8; +using ::archive_entry_gname_w; +using ::archive_entry_hardlink; +using ::archive_entry_hardlink_is_set; +using ::archive_entry_hardlink_utf8; +using ::archive_entry_hardlink_w; +using ::archive_entry_ino; +using ::archive_entry_ino64; +using ::archive_entry_ino_is_set; +using ::archive_entry_is_data_encrypted; +using ::archive_entry_is_encrypted; +using ::archive_entry_is_metadata_encrypted; +using ::archive_entry_linkify; +using ::archive_entry_linkresolver; +using ::archive_entry_linkresolver_free; +using ::archive_entry_linkresolver_new; +using ::archive_entry_linkresolver_set_strategy; +using ::archive_entry_mac_metadata; +using ::archive_entry_mode; +using ::archive_entry_mtime; +using ::archive_entry_mtime_is_set; +using ::archive_entry_mtime_nsec; +using ::archive_entry_new; +using ::archive_entry_new2; +using ::archive_entry_nlink; +using ::archive_entry_partial_links; +using ::archive_entry_pathname; +using ::archive_entry_pathname_utf8; +using ::archive_entry_pathname_w; +using ::archive_entry_perm; +using ::archive_entry_perm_is_set; +using ::archive_entry_rdev; +using ::archive_entry_rdev_is_set; +using ::archive_entry_rdevmajor; +using ::archive_entry_rdevminor; +using ::archive_entry_set_atime; +using ::archive_entry_set_birthtime; +using ::archive_entry_set_ctime; +using ::archive_entry_set_dev; +using ::archive_entry_set_devmajor; +using ::archive_entry_set_devminor; +using ::archive_entry_set_digest; +using ::archive_entry_set_fflags; +using ::archive_entry_set_filetype; +using ::archive_entry_set_gid; +using ::archive_entry_set_gname; +using ::archive_entry_set_gname_utf8; +using ::archive_entry_set_hardlink; +using ::archive_entry_set_hardlink_utf8; +using ::archive_entry_set_ino; +using ::archive_entry_set_ino64; +using ::archive_entry_set_is_data_encrypted; +using ::archive_entry_set_is_metadata_encrypted; +using ::archive_entry_set_link; +using ::archive_entry_set_link_to_hardlink; +using ::archive_entry_set_link_to_symlink; +using ::archive_entry_set_link_utf8; +using ::archive_entry_set_mode; +using ::archive_entry_set_mtime; +using ::archive_entry_set_nlink; +using ::archive_entry_set_pathname; +using ::archive_entry_set_pathname_utf8; +using ::archive_entry_set_perm; +using ::archive_entry_set_rdev; +using ::archive_entry_set_rdevmajor; +using ::archive_entry_set_rdevminor; +using ::archive_entry_set_size; +using ::archive_entry_set_symlink; +using ::archive_entry_set_symlink_type; +using ::archive_entry_set_symlink_utf8; +using ::archive_entry_set_uid; +using ::archive_entry_set_uname; +using ::archive_entry_set_uname_utf8; +using ::archive_entry_size; +using ::archive_entry_size_is_set; +using ::archive_entry_sourcepath; +using ::archive_entry_sourcepath_w; +using ::archive_entry_sparse_add_entry; +using ::archive_entry_sparse_clear; +using ::archive_entry_sparse_count; +using ::archive_entry_sparse_next; +using ::archive_entry_sparse_reset; +using ::archive_entry_stat; +using ::archive_entry_strmode; +using ::archive_entry_symlink; +using ::archive_entry_symlink_type; +using ::archive_entry_symlink_utf8; +using ::archive_entry_symlink_w; +using ::archive_entry_uid; +using ::archive_entry_uid_is_set; +using ::archive_entry_uname; +using ::archive_entry_uname_utf8; +using ::archive_entry_uname_w; +using ::archive_entry_unset_atime; +using ::archive_entry_unset_birthtime; +using ::archive_entry_unset_ctime; +using ::archive_entry_unset_mtime; +using ::archive_entry_unset_size; +using ::archive_entry_update_gname_utf8; +using ::archive_entry_update_hardlink_utf8; +using ::archive_entry_update_link_utf8; +using ::archive_entry_update_pathname_utf8; +using ::archive_entry_update_symlink_utf8; +using ::archive_entry_update_uname_utf8; +using ::archive_entry_xattr_add_entry; +using ::archive_entry_xattr_clear; +using ::archive_entry_xattr_count; +using ::archive_entry_xattr_next; +using ::archive_entry_xattr_reset; +using ::archive_errno; +using ::archive_error_string; +using ::archive_file_count; +using ::archive_filter_bytes; +using ::archive_filter_code; +using ::archive_filter_count; +using ::archive_filter_name; +using ::archive_format; +using ::archive_format_name; +using ::archive_free; +using ::archive_free_callback; +using ::archive_libacl_version; +using ::archive_libattr_version; +using ::archive_libbsdxml_version; +using ::archive_libexpat_version; +using ::archive_libiconv_version; +using ::archive_liblz4_version; +using ::archive_liblzma_version; +using ::archive_liblzo2_version; +using ::archive_libmd_version; +using ::archive_libpcre2_version; +using ::archive_libpcre_version; +using ::archive_librichacl_version; +using ::archive_libxml2_version; +using ::archive_libzstd_version; +using ::archive_match_exclude_entry; +using ::archive_match_exclude_pattern; +using ::archive_match_exclude_pattern_from_file; +using ::archive_match_exclude_pattern_from_file_w; +using ::archive_match_exclude_pattern_w; +using ::archive_match_excluded; +using ::archive_match_free; +using ::archive_match_include_date; +using ::archive_match_include_date_w; +using ::archive_match_include_file_time; +using ::archive_match_include_file_time_w; +using ::archive_match_include_gid; +using ::archive_match_include_gname; +using ::archive_match_include_gname_w; +using ::archive_match_include_pattern; +using ::archive_match_include_pattern_from_file; +using ::archive_match_include_pattern_from_file_w; +using ::archive_match_include_pattern_w; +using ::archive_match_include_time; +using ::archive_match_include_uid; +using ::archive_match_include_uname; +using ::archive_match_include_uname_w; +using ::archive_match_new; +using ::archive_match_owner_excluded; +using ::archive_match_path_excluded; +using ::archive_match_path_unmatched_inclusions; +using ::archive_match_path_unmatched_inclusions_next; +using ::archive_match_path_unmatched_inclusions_next_w; +using ::archive_match_set_inclusion_recursion; +using ::archive_match_time_excluded; +using ::archive_mbedtls_version; +using ::archive_nettle_version; +using ::archive_open_callback; +using ::archive_openssl_version; +using ::archive_parse_date; +using ::archive_passphrase_callback; +using ::archive_position_compressed; +using ::archive_position_uncompressed; +using ::archive_read_add_callback_data; +using ::archive_read_add_passphrase; +using ::archive_read_append_callback_data; +using ::archive_read_append_filter; +using ::archive_read_append_filter_program; +using ::archive_read_append_filter_program_signature; +using ::archive_read_callback; +using ::archive_read_close; +using ::archive_read_data; +using ::archive_read_data_block; +using ::archive_read_data_into_fd; +using ::archive_read_data_skip; +using ::archive_read_disk_can_descend; +using ::archive_read_disk_current_filesystem; +using ::archive_read_disk_current_filesystem_is_remote; +using ::archive_read_disk_current_filesystem_is_synthetic; +using ::archive_read_disk_descend; +using ::archive_read_disk_entry_from_file; +using ::archive_read_disk_gname; +using ::archive_read_disk_new; +using ::archive_read_disk_open; +using ::archive_read_disk_open_w; +using ::archive_read_disk_set_atime_restored; +using ::archive_read_disk_set_behavior; +using ::archive_read_disk_set_gname_lookup; +using ::archive_read_disk_set_matching; +using ::archive_read_disk_set_metadata_filter_callback; +using ::archive_read_disk_set_standard_lookup; +using ::archive_read_disk_set_symlink_hybrid; +using ::archive_read_disk_set_symlink_logical; +using ::archive_read_disk_set_symlink_physical; +using ::archive_read_disk_set_uname_lookup; +using ::archive_read_disk_uname; +using ::archive_read_extract; +using ::archive_read_extract2; +using ::archive_read_extract_set_progress_callback; +using ::archive_read_extract_set_skip_file; +using ::archive_read_finish; +using ::archive_read_format_capabilities; +using ::archive_read_free; +using ::archive_read_has_encrypted_entries; +using ::archive_read_header_position; +using ::archive_read_new; +using ::archive_read_next_header; +using ::archive_read_next_header2; +using ::archive_read_open; +using ::archive_read_open1; +using ::archive_read_open2; +using ::archive_read_open_FILE; +using ::archive_read_open_fd; +using ::archive_read_open_file; +using ::archive_read_open_filename; +using ::archive_read_open_filename_w; +using ::archive_read_open_filenames; +using ::archive_read_open_memory; +using ::archive_read_open_memory2; +using ::archive_read_prepend_callback_data; +using ::archive_read_set_callback_data; +using ::archive_read_set_callback_data2; +using ::archive_read_set_close_callback; +using ::archive_read_set_filter_option; +using ::archive_read_set_format; +using ::archive_read_set_format_option; +using ::archive_read_set_open_callback; +using ::archive_read_set_option; +using ::archive_read_set_options; +using ::archive_read_set_passphrase_callback; +using ::archive_read_set_read_callback; +using ::archive_read_set_seek_callback; +using ::archive_read_set_skip_callback; +using ::archive_read_set_switch_callback; +using ::archive_read_support_compression_all; +using ::archive_read_support_compression_bzip2; +using ::archive_read_support_compression_compress; +using ::archive_read_support_compression_gzip; +using ::archive_read_support_compression_lzip; +using ::archive_read_support_compression_lzma; +using ::archive_read_support_compression_none; +using ::archive_read_support_compression_program; +using ::archive_read_support_compression_program_signature; +using ::archive_read_support_compression_rpm; +using ::archive_read_support_compression_uu; +using ::archive_read_support_compression_xz; +using ::archive_read_support_filter_all; +using ::archive_read_support_filter_by_code; +using ::archive_read_support_filter_bzip2; +using ::archive_read_support_filter_compress; +using ::archive_read_support_filter_grzip; +using ::archive_read_support_filter_gzip; +using ::archive_read_support_filter_lrzip; +using ::archive_read_support_filter_lz4; +using ::archive_read_support_filter_lzip; +using ::archive_read_support_filter_lzma; +using ::archive_read_support_filter_lzop; +using ::archive_read_support_filter_none; +using ::archive_read_support_filter_program; +using ::archive_read_support_filter_program_signature; +using ::archive_read_support_filter_rpm; +using ::archive_read_support_filter_uu; +using ::archive_read_support_filter_xz; +using ::archive_read_support_filter_zstd; +using ::archive_read_support_format_7zip; +using ::archive_read_support_format_all; +using ::archive_read_support_format_ar; +using ::archive_read_support_format_by_code; +using ::archive_read_support_format_cab; +using ::archive_read_support_format_cpio; +using ::archive_read_support_format_empty; +using ::archive_read_support_format_gnutar; +using ::archive_read_support_format_iso9660; +using ::archive_read_support_format_lha; +using ::archive_read_support_format_mtree; +using ::archive_read_support_format_rar; +using ::archive_read_support_format_rar5; +using ::archive_read_support_format_raw; +using ::archive_read_support_format_tar; +using ::archive_read_support_format_warc; +using ::archive_read_support_format_xar; +using ::archive_read_support_format_zip; +using ::archive_read_support_format_zip_seekable; +using ::archive_read_support_format_zip_streamable; +using ::archive_seek_callback; +using ::archive_seek_data; +using ::archive_set_error; +using ::archive_skip_callback; +using ::archive_switch_callback; +using ::archive_utility_string_sort; +using ::archive_version_details; +using ::archive_version_number; +using ::archive_version_string; +using ::archive_wincrypt_version; +using ::archive_write_add_filter; +using ::archive_write_add_filter_b64encode; +using ::archive_write_add_filter_by_name; +using ::archive_write_add_filter_bzip2; +using ::archive_write_add_filter_compress; +using ::archive_write_add_filter_grzip; +using ::archive_write_add_filter_gzip; +using ::archive_write_add_filter_lrzip; +using ::archive_write_add_filter_lz4; +using ::archive_write_add_filter_lzip; +using ::archive_write_add_filter_lzma; +using ::archive_write_add_filter_lzop; +using ::archive_write_add_filter_none; +using ::archive_write_add_filter_program; +using ::archive_write_add_filter_uuencode; +using ::archive_write_add_filter_xz; +using ::archive_write_add_filter_zstd; +using ::archive_write_callback; +using ::archive_write_close; +using ::archive_write_data; +using ::archive_write_data_block; +using ::archive_write_disk_gid; +using ::archive_write_disk_new; +using ::archive_write_disk_set_group_lookup; +using ::archive_write_disk_set_options; +using ::archive_write_disk_set_skip_file; +using ::archive_write_disk_set_standard_lookup; +using ::archive_write_disk_set_user_lookup; +using ::archive_write_disk_uid; +using ::archive_write_fail; +using ::archive_write_finish; +using ::archive_write_finish_entry; +using ::archive_write_free; +using ::archive_write_get_bytes_in_last_block; +using ::archive_write_get_bytes_per_block; +using ::archive_write_header; +using ::archive_write_new; +using ::archive_write_open; +using ::archive_write_open2; +using ::archive_write_open_FILE; +using ::archive_write_open_fd; +using ::archive_write_open_file; +using ::archive_write_open_filename; +using ::archive_write_open_filename_w; +using ::archive_write_open_memory; +using ::archive_write_set_bytes_in_last_block; +using ::archive_write_set_bytes_per_block; +using ::archive_write_set_compression_bzip2; +using ::archive_write_set_compression_compress; +using ::archive_write_set_compression_gzip; +using ::archive_write_set_compression_lzip; +using ::archive_write_set_compression_lzma; +using ::archive_write_set_compression_none; +using ::archive_write_set_compression_program; +using ::archive_write_set_compression_xz; +using ::archive_write_set_filter_option; +using ::archive_write_set_format; +using ::archive_write_set_format_7zip; +using ::archive_write_set_format_ar_bsd; +using ::archive_write_set_format_ar_svr4; +using ::archive_write_set_format_by_name; +using ::archive_write_set_format_cpio; +using ::archive_write_set_format_cpio_bin; +using ::archive_write_set_format_cpio_newc; +using ::archive_write_set_format_cpio_odc; +using ::archive_write_set_format_cpio_pwb; +using ::archive_write_set_format_filter_by_ext; +using ::archive_write_set_format_filter_by_ext_def; +using ::archive_write_set_format_gnutar; +using ::archive_write_set_format_iso9660; +using ::archive_write_set_format_mtree; +using ::archive_write_set_format_mtree_classic; +using ::archive_write_set_format_option; +using ::archive_write_set_format_pax; +using ::archive_write_set_format_pax_restricted; +using ::archive_write_set_format_raw; +using ::archive_write_set_format_shar; +using ::archive_write_set_format_shar_dump; +using ::archive_write_set_format_ustar; +using ::archive_write_set_format_v7tar; +using ::archive_write_set_format_warc; +using ::archive_write_set_format_xar; +using ::archive_write_set_format_zip; +using ::archive_write_set_option; +using ::archive_write_set_options; +using ::archive_write_set_passphrase; +using ::archive_write_set_passphrase_callback; +using ::archive_write_set_skip_file; +using ::archive_write_zip_set_compression_bzip2; +using ::archive_write_zip_set_compression_deflate; +using ::archive_write_zip_set_compression_lzma; +using ::archive_write_zip_set_compression_store; +using ::archive_write_zip_set_compression_xz; +using ::archive_write_zip_set_compression_zstd; +using ::archive_zlib_version; +using ::la_int64_t; +using ::la_ssize_t; +using ::la_uint64_t; +} + +#if defined(_WIN32) && !defined(__CYGWIN__) +export { +using ::archive_entry_copy_bhfi; +using ::archive_read_open_filenames_w; +} +#endif diff --git a/src/macros.cppm b/src/macros.cppm new file mode 100644 index 0000000..f8dde73 --- /dev/null +++ b/src/macros.cppm @@ -0,0 +1,538 @@ +// mcpplibs.mwrap.libarchive.macros --- the macros of the headers that are a constant or a +// type, under their original names in mcpplibs::mwrap::libarchive::macros, each equal to +// the macro where the module is built (a named module cannot export a macro). The +// other macros are in . Written by tools/generate.py. +module; +#ifndef LIBARCHIVE_STATIC +#define LIBARCHIVE_STATIC +#endif +#include +#include + +// The values, taken under other names while the macros are defined. +namespace mwrap_libarchive_capture { +inline constexpr auto value_AE_IFBLK = (AE_IFBLK); +inline constexpr auto value_AE_IFCHR = (AE_IFCHR); +inline constexpr auto value_AE_IFDIR = (AE_IFDIR); +inline constexpr auto value_AE_IFIFO = (AE_IFIFO); +inline constexpr auto value_AE_IFLNK = (AE_IFLNK); +inline constexpr auto value_AE_IFMT = (AE_IFMT); +inline constexpr auto value_AE_IFREG = (AE_IFREG); +inline constexpr auto value_AE_IFSOCK = (AE_IFSOCK); +inline constexpr auto value_AE_SYMLINK_TYPE_DIRECTORY = (AE_SYMLINK_TYPE_DIRECTORY); +inline constexpr auto value_AE_SYMLINK_TYPE_FILE = (AE_SYMLINK_TYPE_FILE); +inline constexpr auto value_AE_SYMLINK_TYPE_UNDEFINED = (AE_SYMLINK_TYPE_UNDEFINED); +inline constexpr auto value_ARCHIVE_COMPRESSION_BZIP2 = (ARCHIVE_COMPRESSION_BZIP2); +inline constexpr auto value_ARCHIVE_COMPRESSION_COMPRESS = (ARCHIVE_COMPRESSION_COMPRESS); +inline constexpr auto value_ARCHIVE_COMPRESSION_GZIP = (ARCHIVE_COMPRESSION_GZIP); +inline constexpr auto value_ARCHIVE_COMPRESSION_LRZIP = (ARCHIVE_COMPRESSION_LRZIP); +inline constexpr auto value_ARCHIVE_COMPRESSION_LZIP = (ARCHIVE_COMPRESSION_LZIP); +inline constexpr auto value_ARCHIVE_COMPRESSION_LZMA = (ARCHIVE_COMPRESSION_LZMA); +inline constexpr auto value_ARCHIVE_COMPRESSION_NONE = (ARCHIVE_COMPRESSION_NONE); +inline constexpr auto value_ARCHIVE_COMPRESSION_PROGRAM = (ARCHIVE_COMPRESSION_PROGRAM); +inline constexpr auto value_ARCHIVE_COMPRESSION_RPM = (ARCHIVE_COMPRESSION_RPM); +inline constexpr auto value_ARCHIVE_COMPRESSION_UU = (ARCHIVE_COMPRESSION_UU); +inline constexpr auto value_ARCHIVE_COMPRESSION_XZ = (ARCHIVE_COMPRESSION_XZ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ADD_FILE = (ARCHIVE_ENTRY_ACL_ADD_FILE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY = (ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_APPEND_DATA = (ARCHIVE_ENTRY_ACL_APPEND_DATA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_DELETE = (ARCHIVE_ENTRY_ACL_DELETE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_DELETE_CHILD = (ARCHIVE_ENTRY_ACL_DELETE_CHILD); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT = (ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS = (ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT = (ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_INHERITED = (ARCHIVE_ENTRY_ACL_ENTRY_INHERITED); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY = (ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT = (ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS = (ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_EVERYONE = (ARCHIVE_ENTRY_ACL_EVERYONE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_EXECUTE = (ARCHIVE_ENTRY_ACL_EXECUTE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_GROUP = (ARCHIVE_ENTRY_ACL_GROUP); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_GROUP_OBJ = (ARCHIVE_ENTRY_ACL_GROUP_OBJ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 = (ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_LIST_DIRECTORY = (ARCHIVE_ENTRY_ACL_LIST_DIRECTORY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_MASK = (ARCHIVE_ENTRY_ACL_MASK); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_OTHER = (ARCHIVE_ENTRY_ACL_OTHER); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_PERMS_NFS4 = (ARCHIVE_ENTRY_ACL_PERMS_NFS4); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_PERMS_POSIX1E = (ARCHIVE_ENTRY_ACL_PERMS_POSIX1E); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ = (ARCHIVE_ENTRY_ACL_READ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_ACL = (ARCHIVE_ENTRY_ACL_READ_ACL); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES = (ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_DATA = (ARCHIVE_ENTRY_ACL_READ_DATA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS = (ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_COMPACT = (ARCHIVE_ENTRY_ACL_STYLE_COMPACT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID = (ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT = (ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA = (ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_SOLARIS = (ARCHIVE_ENTRY_ACL_STYLE_SOLARIS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_SYNCHRONIZE = (ARCHIVE_ENTRY_ACL_SYNCHRONIZE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_ACCESS = (ARCHIVE_ENTRY_ACL_TYPE_ACCESS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_ALARM = (ARCHIVE_ENTRY_ACL_TYPE_ALARM); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_ALLOW = (ARCHIVE_ENTRY_ACL_TYPE_ALLOW); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_AUDIT = (ARCHIVE_ENTRY_ACL_TYPE_AUDIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_DEFAULT = (ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_DENY = (ARCHIVE_ENTRY_ACL_TYPE_DENY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_NFS4 = (ARCHIVE_ENTRY_ACL_TYPE_NFS4); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_POSIX1E = (ARCHIVE_ENTRY_ACL_TYPE_POSIX1E); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_USER = (ARCHIVE_ENTRY_ACL_USER); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_USER_OBJ = (ARCHIVE_ENTRY_ACL_USER_OBJ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE = (ARCHIVE_ENTRY_ACL_WRITE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_ACL = (ARCHIVE_ENTRY_ACL_WRITE_ACL); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES = (ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_DATA = (ARCHIVE_ENTRY_ACL_WRITE_DATA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS = (ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_OWNER = (ARCHIVE_ENTRY_ACL_WRITE_OWNER); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_MD5 = (ARCHIVE_ENTRY_DIGEST_MD5); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_RMD160 = (ARCHIVE_ENTRY_DIGEST_RMD160); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA1 = (ARCHIVE_ENTRY_DIGEST_SHA1); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA256 = (ARCHIVE_ENTRY_DIGEST_SHA256); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA384 = (ARCHIVE_ENTRY_DIGEST_SHA384); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA512 = (ARCHIVE_ENTRY_DIGEST_SHA512); +inline constexpr auto value_ARCHIVE_EOF = (ARCHIVE_EOF); +inline constexpr auto value_ARCHIVE_EXTRACT_ACL = (ARCHIVE_EXTRACT_ACL); +inline constexpr auto value_ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS = (ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS); +inline constexpr auto value_ARCHIVE_EXTRACT_FFLAGS = (ARCHIVE_EXTRACT_FFLAGS); +inline constexpr auto value_ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED = (ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED); +inline constexpr auto value_ARCHIVE_EXTRACT_MAC_METADATA = (ARCHIVE_EXTRACT_MAC_METADATA); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_AUTODIR = (ARCHIVE_EXTRACT_NO_AUTODIR); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_HFS_COMPRESSION = (ARCHIVE_EXTRACT_NO_HFS_COMPRESSION); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_OVERWRITE = (ARCHIVE_EXTRACT_NO_OVERWRITE); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER = (ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER); +inline constexpr auto value_ARCHIVE_EXTRACT_OWNER = (ARCHIVE_EXTRACT_OWNER); +inline constexpr auto value_ARCHIVE_EXTRACT_PERM = (ARCHIVE_EXTRACT_PERM); +inline constexpr auto value_ARCHIVE_EXTRACT_SAFE_WRITES = (ARCHIVE_EXTRACT_SAFE_WRITES); +inline constexpr auto value_ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS = (ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS); +inline constexpr auto value_ARCHIVE_EXTRACT_SECURE_NODOTDOT = (ARCHIVE_EXTRACT_SECURE_NODOTDOT); +inline constexpr auto value_ARCHIVE_EXTRACT_SECURE_SYMLINKS = (ARCHIVE_EXTRACT_SECURE_SYMLINKS); +inline constexpr auto value_ARCHIVE_EXTRACT_SPARSE = (ARCHIVE_EXTRACT_SPARSE); +inline constexpr auto value_ARCHIVE_EXTRACT_TIME = (ARCHIVE_EXTRACT_TIME); +inline constexpr auto value_ARCHIVE_EXTRACT_UNLINK = (ARCHIVE_EXTRACT_UNLINK); +inline constexpr auto value_ARCHIVE_EXTRACT_XATTR = (ARCHIVE_EXTRACT_XATTR); +inline constexpr auto value_ARCHIVE_FAILED = (ARCHIVE_FAILED); +inline constexpr auto value_ARCHIVE_FATAL = (ARCHIVE_FATAL); +inline constexpr auto value_ARCHIVE_FILTER_BZIP2 = (ARCHIVE_FILTER_BZIP2); +inline constexpr auto value_ARCHIVE_FILTER_COMPRESS = (ARCHIVE_FILTER_COMPRESS); +inline constexpr auto value_ARCHIVE_FILTER_GRZIP = (ARCHIVE_FILTER_GRZIP); +inline constexpr auto value_ARCHIVE_FILTER_GZIP = (ARCHIVE_FILTER_GZIP); +inline constexpr auto value_ARCHIVE_FILTER_LRZIP = (ARCHIVE_FILTER_LRZIP); +inline constexpr auto value_ARCHIVE_FILTER_LZ4 = (ARCHIVE_FILTER_LZ4); +inline constexpr auto value_ARCHIVE_FILTER_LZIP = (ARCHIVE_FILTER_LZIP); +inline constexpr auto value_ARCHIVE_FILTER_LZMA = (ARCHIVE_FILTER_LZMA); +inline constexpr auto value_ARCHIVE_FILTER_LZOP = (ARCHIVE_FILTER_LZOP); +inline constexpr auto value_ARCHIVE_FILTER_NONE = (ARCHIVE_FILTER_NONE); +inline constexpr auto value_ARCHIVE_FILTER_PROGRAM = (ARCHIVE_FILTER_PROGRAM); +inline constexpr auto value_ARCHIVE_FILTER_RPM = (ARCHIVE_FILTER_RPM); +inline constexpr auto value_ARCHIVE_FILTER_UU = (ARCHIVE_FILTER_UU); +inline constexpr auto value_ARCHIVE_FILTER_XZ = (ARCHIVE_FILTER_XZ); +inline constexpr auto value_ARCHIVE_FILTER_ZSTD = (ARCHIVE_FILTER_ZSTD); +inline constexpr auto value_ARCHIVE_FORMAT_7ZIP = (ARCHIVE_FORMAT_7ZIP); +inline constexpr auto value_ARCHIVE_FORMAT_AR = (ARCHIVE_FORMAT_AR); +inline constexpr auto value_ARCHIVE_FORMAT_AR_BSD = (ARCHIVE_FORMAT_AR_BSD); +inline constexpr auto value_ARCHIVE_FORMAT_AR_GNU = (ARCHIVE_FORMAT_AR_GNU); +inline constexpr auto value_ARCHIVE_FORMAT_BASE_MASK = (ARCHIVE_FORMAT_BASE_MASK); +inline constexpr auto value_ARCHIVE_FORMAT_CAB = (ARCHIVE_FORMAT_CAB); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO = (ARCHIVE_FORMAT_CPIO); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_AFIO_LARGE = (ARCHIVE_FORMAT_CPIO_AFIO_LARGE); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_BIN_BE = (ARCHIVE_FORMAT_CPIO_BIN_BE); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_BIN_LE = (ARCHIVE_FORMAT_CPIO_BIN_LE); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_POSIX = (ARCHIVE_FORMAT_CPIO_POSIX); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_PWB = (ARCHIVE_FORMAT_CPIO_PWB); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_SVR4_CRC = (ARCHIVE_FORMAT_CPIO_SVR4_CRC); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_SVR4_NOCRC = (ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); +inline constexpr auto value_ARCHIVE_FORMAT_EMPTY = (ARCHIVE_FORMAT_EMPTY); +inline constexpr auto value_ARCHIVE_FORMAT_ISO9660 = (ARCHIVE_FORMAT_ISO9660); +inline constexpr auto value_ARCHIVE_FORMAT_ISO9660_ROCKRIDGE = (ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); +inline constexpr auto value_ARCHIVE_FORMAT_LHA = (ARCHIVE_FORMAT_LHA); +inline constexpr auto value_ARCHIVE_FORMAT_MTREE = (ARCHIVE_FORMAT_MTREE); +inline constexpr auto value_ARCHIVE_FORMAT_RAR = (ARCHIVE_FORMAT_RAR); +inline constexpr auto value_ARCHIVE_FORMAT_RAR_V5 = (ARCHIVE_FORMAT_RAR_V5); +inline constexpr auto value_ARCHIVE_FORMAT_RAW = (ARCHIVE_FORMAT_RAW); +inline constexpr auto value_ARCHIVE_FORMAT_SHAR = (ARCHIVE_FORMAT_SHAR); +inline constexpr auto value_ARCHIVE_FORMAT_SHAR_BASE = (ARCHIVE_FORMAT_SHAR_BASE); +inline constexpr auto value_ARCHIVE_FORMAT_SHAR_DUMP = (ARCHIVE_FORMAT_SHAR_DUMP); +inline constexpr auto value_ARCHIVE_FORMAT_TAR = (ARCHIVE_FORMAT_TAR); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_GNUTAR = (ARCHIVE_FORMAT_TAR_GNUTAR); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE = (ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_PAX_RESTRICTED = (ARCHIVE_FORMAT_TAR_PAX_RESTRICTED); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_USTAR = (ARCHIVE_FORMAT_TAR_USTAR); +inline constexpr auto value_ARCHIVE_FORMAT_WARC = (ARCHIVE_FORMAT_WARC); +inline constexpr auto value_ARCHIVE_FORMAT_XAR = (ARCHIVE_FORMAT_XAR); +inline constexpr auto value_ARCHIVE_FORMAT_ZIP = (ARCHIVE_FORMAT_ZIP); +inline constexpr auto value_ARCHIVE_MATCH_CTIME = (ARCHIVE_MATCH_CTIME); +inline constexpr auto value_ARCHIVE_MATCH_EQUAL = (ARCHIVE_MATCH_EQUAL); +inline constexpr auto value_ARCHIVE_MATCH_MTIME = (ARCHIVE_MATCH_MTIME); +inline constexpr auto value_ARCHIVE_MATCH_NEWER = (ARCHIVE_MATCH_NEWER); +inline constexpr auto value_ARCHIVE_MATCH_OLDER = (ARCHIVE_MATCH_OLDER); +inline constexpr auto value_ARCHIVE_OK = (ARCHIVE_OK); +inline constexpr auto value_ARCHIVE_READDISK_HONOR_NODUMP = (ARCHIVE_READDISK_HONOR_NODUMP); +inline constexpr auto value_ARCHIVE_READDISK_MAC_COPYFILE = (ARCHIVE_READDISK_MAC_COPYFILE); +inline constexpr auto value_ARCHIVE_READDISK_NO_ACL = (ARCHIVE_READDISK_NO_ACL); +inline constexpr auto value_ARCHIVE_READDISK_NO_FFLAGS = (ARCHIVE_READDISK_NO_FFLAGS); +inline constexpr auto value_ARCHIVE_READDISK_NO_SPARSE = (ARCHIVE_READDISK_NO_SPARSE); +inline constexpr auto value_ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS = (ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS); +inline constexpr auto value_ARCHIVE_READDISK_NO_XATTR = (ARCHIVE_READDISK_NO_XATTR); +inline constexpr auto value_ARCHIVE_READDISK_RESTORE_ATIME = (ARCHIVE_READDISK_RESTORE_ATIME); +inline constexpr auto value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA = (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA); +inline constexpr auto value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA = (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA); +inline constexpr auto value_ARCHIVE_READ_FORMAT_CAPS_NONE = (ARCHIVE_READ_FORMAT_CAPS_NONE); +inline constexpr auto value_ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW = (ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW); +inline constexpr auto value_ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED = (ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED); +inline constexpr auto value_ARCHIVE_RETRY = (ARCHIVE_RETRY); +inline constexpr auto value_ARCHIVE_VERSION_NUMBER = (ARCHIVE_VERSION_NUMBER); +inline constexpr auto value_ARCHIVE_VERSION_ONLY_STRING = (ARCHIVE_VERSION_ONLY_STRING); +inline constexpr auto value_ARCHIVE_VERSION_STRING = (ARCHIVE_VERSION_STRING); +inline constexpr auto value_ARCHIVE_WARN = (ARCHIVE_WARN); +inline constexpr auto value_OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID = (OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID); +inline constexpr auto value_OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT = (OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT); +} +#undef AE_IFBLK +#undef AE_IFCHR +#undef AE_IFDIR +#undef AE_IFIFO +#undef AE_IFLNK +#undef AE_IFMT +#undef AE_IFREG +#undef AE_IFSOCK +#undef AE_SYMLINK_TYPE_DIRECTORY +#undef AE_SYMLINK_TYPE_FILE +#undef AE_SYMLINK_TYPE_UNDEFINED +#undef ARCHIVE_COMPRESSION_BZIP2 +#undef ARCHIVE_COMPRESSION_COMPRESS +#undef ARCHIVE_COMPRESSION_GZIP +#undef ARCHIVE_COMPRESSION_LRZIP +#undef ARCHIVE_COMPRESSION_LZIP +#undef ARCHIVE_COMPRESSION_LZMA +#undef ARCHIVE_COMPRESSION_NONE +#undef ARCHIVE_COMPRESSION_PROGRAM +#undef ARCHIVE_COMPRESSION_RPM +#undef ARCHIVE_COMPRESSION_UU +#undef ARCHIVE_COMPRESSION_XZ +#undef ARCHIVE_ENTRY_ACL_ADD_FILE +#undef ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY +#undef ARCHIVE_ENTRY_ACL_APPEND_DATA +#undef ARCHIVE_ENTRY_ACL_DELETE +#undef ARCHIVE_ENTRY_ACL_DELETE_CHILD +#undef ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT +#undef ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS +#undef ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT +#undef ARCHIVE_ENTRY_ACL_ENTRY_INHERITED +#undef ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY +#undef ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT +#undef ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS +#undef ARCHIVE_ENTRY_ACL_EVERYONE +#undef ARCHIVE_ENTRY_ACL_EXECUTE +#undef ARCHIVE_ENTRY_ACL_GROUP +#undef ARCHIVE_ENTRY_ACL_GROUP_OBJ +#undef ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 +#undef ARCHIVE_ENTRY_ACL_LIST_DIRECTORY +#undef ARCHIVE_ENTRY_ACL_MASK +#undef ARCHIVE_ENTRY_ACL_OTHER +#undef ARCHIVE_ENTRY_ACL_PERMS_NFS4 +#undef ARCHIVE_ENTRY_ACL_PERMS_POSIX1E +#undef ARCHIVE_ENTRY_ACL_READ +#undef ARCHIVE_ENTRY_ACL_READ_ACL +#undef ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES +#undef ARCHIVE_ENTRY_ACL_READ_DATA +#undef ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS +#undef ARCHIVE_ENTRY_ACL_STYLE_COMPACT +#undef ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID +#undef ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT +#undef ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA +#undef ARCHIVE_ENTRY_ACL_STYLE_SOLARIS +#undef ARCHIVE_ENTRY_ACL_SYNCHRONIZE +#undef ARCHIVE_ENTRY_ACL_TYPE_ACCESS +#undef ARCHIVE_ENTRY_ACL_TYPE_ALARM +#undef ARCHIVE_ENTRY_ACL_TYPE_ALLOW +#undef ARCHIVE_ENTRY_ACL_TYPE_AUDIT +#undef ARCHIVE_ENTRY_ACL_TYPE_DEFAULT +#undef ARCHIVE_ENTRY_ACL_TYPE_DENY +#undef ARCHIVE_ENTRY_ACL_TYPE_NFS4 +#undef ARCHIVE_ENTRY_ACL_TYPE_POSIX1E +#undef ARCHIVE_ENTRY_ACL_USER +#undef ARCHIVE_ENTRY_ACL_USER_OBJ +#undef ARCHIVE_ENTRY_ACL_WRITE +#undef ARCHIVE_ENTRY_ACL_WRITE_ACL +#undef ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES +#undef ARCHIVE_ENTRY_ACL_WRITE_DATA +#undef ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS +#undef ARCHIVE_ENTRY_ACL_WRITE_OWNER +#undef ARCHIVE_ENTRY_DIGEST_MD5 +#undef ARCHIVE_ENTRY_DIGEST_RMD160 +#undef ARCHIVE_ENTRY_DIGEST_SHA1 +#undef ARCHIVE_ENTRY_DIGEST_SHA256 +#undef ARCHIVE_ENTRY_DIGEST_SHA384 +#undef ARCHIVE_ENTRY_DIGEST_SHA512 +#undef ARCHIVE_EOF +#undef ARCHIVE_EXTRACT_ACL +#undef ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS +#undef ARCHIVE_EXTRACT_FFLAGS +#undef ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED +#undef ARCHIVE_EXTRACT_MAC_METADATA +#undef ARCHIVE_EXTRACT_NO_AUTODIR +#undef ARCHIVE_EXTRACT_NO_HFS_COMPRESSION +#undef ARCHIVE_EXTRACT_NO_OVERWRITE +#undef ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER +#undef ARCHIVE_EXTRACT_OWNER +#undef ARCHIVE_EXTRACT_PERM +#undef ARCHIVE_EXTRACT_SAFE_WRITES +#undef ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS +#undef ARCHIVE_EXTRACT_SECURE_NODOTDOT +#undef ARCHIVE_EXTRACT_SECURE_SYMLINKS +#undef ARCHIVE_EXTRACT_SPARSE +#undef ARCHIVE_EXTRACT_TIME +#undef ARCHIVE_EXTRACT_UNLINK +#undef ARCHIVE_EXTRACT_XATTR +#undef ARCHIVE_FAILED +#undef ARCHIVE_FATAL +#undef ARCHIVE_FILTER_BZIP2 +#undef ARCHIVE_FILTER_COMPRESS +#undef ARCHIVE_FILTER_GRZIP +#undef ARCHIVE_FILTER_GZIP +#undef ARCHIVE_FILTER_LRZIP +#undef ARCHIVE_FILTER_LZ4 +#undef ARCHIVE_FILTER_LZIP +#undef ARCHIVE_FILTER_LZMA +#undef ARCHIVE_FILTER_LZOP +#undef ARCHIVE_FILTER_NONE +#undef ARCHIVE_FILTER_PROGRAM +#undef ARCHIVE_FILTER_RPM +#undef ARCHIVE_FILTER_UU +#undef ARCHIVE_FILTER_XZ +#undef ARCHIVE_FILTER_ZSTD +#undef ARCHIVE_FORMAT_7ZIP +#undef ARCHIVE_FORMAT_AR +#undef ARCHIVE_FORMAT_AR_BSD +#undef ARCHIVE_FORMAT_AR_GNU +#undef ARCHIVE_FORMAT_BASE_MASK +#undef ARCHIVE_FORMAT_CAB +#undef ARCHIVE_FORMAT_CPIO +#undef ARCHIVE_FORMAT_CPIO_AFIO_LARGE +#undef ARCHIVE_FORMAT_CPIO_BIN_BE +#undef ARCHIVE_FORMAT_CPIO_BIN_LE +#undef ARCHIVE_FORMAT_CPIO_POSIX +#undef ARCHIVE_FORMAT_CPIO_PWB +#undef ARCHIVE_FORMAT_CPIO_SVR4_CRC +#undef ARCHIVE_FORMAT_CPIO_SVR4_NOCRC +#undef ARCHIVE_FORMAT_EMPTY +#undef ARCHIVE_FORMAT_ISO9660 +#undef ARCHIVE_FORMAT_ISO9660_ROCKRIDGE +#undef ARCHIVE_FORMAT_LHA +#undef ARCHIVE_FORMAT_MTREE +#undef ARCHIVE_FORMAT_RAR +#undef ARCHIVE_FORMAT_RAR_V5 +#undef ARCHIVE_FORMAT_RAW +#undef ARCHIVE_FORMAT_SHAR +#undef ARCHIVE_FORMAT_SHAR_BASE +#undef ARCHIVE_FORMAT_SHAR_DUMP +#undef ARCHIVE_FORMAT_TAR +#undef ARCHIVE_FORMAT_TAR_GNUTAR +#undef ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE +#undef ARCHIVE_FORMAT_TAR_PAX_RESTRICTED +#undef ARCHIVE_FORMAT_TAR_USTAR +#undef ARCHIVE_FORMAT_WARC +#undef ARCHIVE_FORMAT_XAR +#undef ARCHIVE_FORMAT_ZIP +#undef ARCHIVE_MATCH_CTIME +#undef ARCHIVE_MATCH_EQUAL +#undef ARCHIVE_MATCH_MTIME +#undef ARCHIVE_MATCH_NEWER +#undef ARCHIVE_MATCH_OLDER +#undef ARCHIVE_OK +#undef ARCHIVE_READDISK_HONOR_NODUMP +#undef ARCHIVE_READDISK_MAC_COPYFILE +#undef ARCHIVE_READDISK_NO_ACL +#undef ARCHIVE_READDISK_NO_FFLAGS +#undef ARCHIVE_READDISK_NO_SPARSE +#undef ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS +#undef ARCHIVE_READDISK_NO_XATTR +#undef ARCHIVE_READDISK_RESTORE_ATIME +#undef ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA +#undef ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA +#undef ARCHIVE_READ_FORMAT_CAPS_NONE +#undef ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW +#undef ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED +#undef ARCHIVE_RETRY +#undef ARCHIVE_VERSION_NUMBER +#undef ARCHIVE_VERSION_ONLY_STRING +#undef ARCHIVE_VERSION_STRING +#undef ARCHIVE_WARN +#undef OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID +#undef OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT + +export module mcpplibs.mwrap.libarchive.macros; + +export namespace mcpplibs::mwrap::libarchive::macros { +inline constexpr auto AE_IFBLK = mwrap_libarchive_capture::value_AE_IFBLK; +inline constexpr auto AE_IFCHR = mwrap_libarchive_capture::value_AE_IFCHR; +inline constexpr auto AE_IFDIR = mwrap_libarchive_capture::value_AE_IFDIR; +inline constexpr auto AE_IFIFO = mwrap_libarchive_capture::value_AE_IFIFO; +inline constexpr auto AE_IFLNK = mwrap_libarchive_capture::value_AE_IFLNK; +inline constexpr auto AE_IFMT = mwrap_libarchive_capture::value_AE_IFMT; +inline constexpr auto AE_IFREG = mwrap_libarchive_capture::value_AE_IFREG; +inline constexpr auto AE_IFSOCK = mwrap_libarchive_capture::value_AE_IFSOCK; +inline constexpr auto AE_SYMLINK_TYPE_DIRECTORY = mwrap_libarchive_capture::value_AE_SYMLINK_TYPE_DIRECTORY; +inline constexpr auto AE_SYMLINK_TYPE_FILE = mwrap_libarchive_capture::value_AE_SYMLINK_TYPE_FILE; +inline constexpr auto AE_SYMLINK_TYPE_UNDEFINED = mwrap_libarchive_capture::value_AE_SYMLINK_TYPE_UNDEFINED; +inline constexpr auto ARCHIVE_COMPRESSION_BZIP2 = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_BZIP2; +inline constexpr auto ARCHIVE_COMPRESSION_COMPRESS = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_COMPRESS; +inline constexpr auto ARCHIVE_COMPRESSION_GZIP = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_GZIP; +inline constexpr auto ARCHIVE_COMPRESSION_LRZIP = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_LRZIP; +inline constexpr auto ARCHIVE_COMPRESSION_LZIP = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_LZIP; +inline constexpr auto ARCHIVE_COMPRESSION_LZMA = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_LZMA; +inline constexpr auto ARCHIVE_COMPRESSION_NONE = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_NONE; +inline constexpr auto ARCHIVE_COMPRESSION_PROGRAM = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_PROGRAM; +inline constexpr auto ARCHIVE_COMPRESSION_RPM = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_RPM; +inline constexpr auto ARCHIVE_COMPRESSION_UU = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_UU; +inline constexpr auto ARCHIVE_COMPRESSION_XZ = mwrap_libarchive_capture::value_ARCHIVE_COMPRESSION_XZ; +inline constexpr auto ARCHIVE_ENTRY_ACL_ADD_FILE = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ADD_FILE; +inline constexpr auto ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY; +inline constexpr auto ARCHIVE_ENTRY_ACL_APPEND_DATA = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_APPEND_DATA; +inline constexpr auto ARCHIVE_ENTRY_ACL_DELETE = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_DELETE; +inline constexpr auto ARCHIVE_ENTRY_ACL_DELETE_CHILD = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_DELETE_CHILD; +inline constexpr auto ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT; +inline constexpr auto ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS; +inline constexpr auto ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT; +inline constexpr auto ARCHIVE_ENTRY_ACL_ENTRY_INHERITED = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ENTRY_INHERITED; +inline constexpr auto ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY; +inline constexpr auto ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT; +inline constexpr auto ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS; +inline constexpr auto ARCHIVE_ENTRY_ACL_EVERYONE = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_EVERYONE; +inline constexpr auto ARCHIVE_ENTRY_ACL_EXECUTE = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_EXECUTE; +inline constexpr auto ARCHIVE_ENTRY_ACL_GROUP = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_GROUP; +inline constexpr auto ARCHIVE_ENTRY_ACL_GROUP_OBJ = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_GROUP_OBJ; +inline constexpr auto ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4; +inline constexpr auto ARCHIVE_ENTRY_ACL_LIST_DIRECTORY = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_LIST_DIRECTORY; +inline constexpr auto ARCHIVE_ENTRY_ACL_MASK = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_MASK; +inline constexpr auto ARCHIVE_ENTRY_ACL_OTHER = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_OTHER; +inline constexpr auto ARCHIVE_ENTRY_ACL_PERMS_NFS4 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_PERMS_NFS4; +inline constexpr auto ARCHIVE_ENTRY_ACL_PERMS_POSIX1E = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_PERMS_POSIX1E; +inline constexpr auto ARCHIVE_ENTRY_ACL_READ = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_READ; +inline constexpr auto ARCHIVE_ENTRY_ACL_READ_ACL = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_READ_ACL; +inline constexpr auto ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES; +inline constexpr auto ARCHIVE_ENTRY_ACL_READ_DATA = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_READ_DATA; +inline constexpr auto ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS; +inline constexpr auto ARCHIVE_ENTRY_ACL_STYLE_COMPACT = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_STYLE_COMPACT; +inline constexpr auto ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID; +inline constexpr auto ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; +inline constexpr auto ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA; +inline constexpr auto ARCHIVE_ENTRY_ACL_STYLE_SOLARIS = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_STYLE_SOLARIS; +inline constexpr auto ARCHIVE_ENTRY_ACL_SYNCHRONIZE = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_SYNCHRONIZE; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_ACCESS = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_ACCESS; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_ALARM = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_ALARM; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_ALLOW = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_ALLOW; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_AUDIT = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_AUDIT; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_DEFAULT = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_DENY = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_DENY; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_NFS4 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_NFS4; +inline constexpr auto ARCHIVE_ENTRY_ACL_TYPE_POSIX1E = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_TYPE_POSIX1E; +inline constexpr auto ARCHIVE_ENTRY_ACL_USER = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_USER; +inline constexpr auto ARCHIVE_ENTRY_ACL_USER_OBJ = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_USER_OBJ; +inline constexpr auto ARCHIVE_ENTRY_ACL_WRITE = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_WRITE; +inline constexpr auto ARCHIVE_ENTRY_ACL_WRITE_ACL = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_WRITE_ACL; +inline constexpr auto ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES; +inline constexpr auto ARCHIVE_ENTRY_ACL_WRITE_DATA = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_WRITE_DATA; +inline constexpr auto ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS; +inline constexpr auto ARCHIVE_ENTRY_ACL_WRITE_OWNER = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_ACL_WRITE_OWNER; +inline constexpr auto ARCHIVE_ENTRY_DIGEST_MD5 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_DIGEST_MD5; +inline constexpr auto ARCHIVE_ENTRY_DIGEST_RMD160 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_DIGEST_RMD160; +inline constexpr auto ARCHIVE_ENTRY_DIGEST_SHA1 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_DIGEST_SHA1; +inline constexpr auto ARCHIVE_ENTRY_DIGEST_SHA256 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_DIGEST_SHA256; +inline constexpr auto ARCHIVE_ENTRY_DIGEST_SHA384 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_DIGEST_SHA384; +inline constexpr auto ARCHIVE_ENTRY_DIGEST_SHA512 = mwrap_libarchive_capture::value_ARCHIVE_ENTRY_DIGEST_SHA512; +inline constexpr auto ARCHIVE_EOF = mwrap_libarchive_capture::value_ARCHIVE_EOF; +inline constexpr auto ARCHIVE_EXTRACT_ACL = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_ACL; +inline constexpr auto ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS; +inline constexpr auto ARCHIVE_EXTRACT_FFLAGS = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_FFLAGS; +inline constexpr auto ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED; +inline constexpr auto ARCHIVE_EXTRACT_MAC_METADATA = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_MAC_METADATA; +inline constexpr auto ARCHIVE_EXTRACT_NO_AUTODIR = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_NO_AUTODIR; +inline constexpr auto ARCHIVE_EXTRACT_NO_HFS_COMPRESSION = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_NO_HFS_COMPRESSION; +inline constexpr auto ARCHIVE_EXTRACT_NO_OVERWRITE = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_NO_OVERWRITE; +inline constexpr auto ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; +inline constexpr auto ARCHIVE_EXTRACT_OWNER = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_OWNER; +inline constexpr auto ARCHIVE_EXTRACT_PERM = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_PERM; +inline constexpr auto ARCHIVE_EXTRACT_SAFE_WRITES = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_SAFE_WRITES; +inline constexpr auto ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; +inline constexpr auto ARCHIVE_EXTRACT_SECURE_NODOTDOT = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_SECURE_NODOTDOT; +inline constexpr auto ARCHIVE_EXTRACT_SECURE_SYMLINKS = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_SECURE_SYMLINKS; +inline constexpr auto ARCHIVE_EXTRACT_SPARSE = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_SPARSE; +inline constexpr auto ARCHIVE_EXTRACT_TIME = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_TIME; +inline constexpr auto ARCHIVE_EXTRACT_UNLINK = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_UNLINK; +inline constexpr auto ARCHIVE_EXTRACT_XATTR = mwrap_libarchive_capture::value_ARCHIVE_EXTRACT_XATTR; +inline constexpr auto ARCHIVE_FAILED = mwrap_libarchive_capture::value_ARCHIVE_FAILED; +inline constexpr auto ARCHIVE_FATAL = mwrap_libarchive_capture::value_ARCHIVE_FATAL; +inline constexpr auto ARCHIVE_FILTER_BZIP2 = mwrap_libarchive_capture::value_ARCHIVE_FILTER_BZIP2; +inline constexpr auto ARCHIVE_FILTER_COMPRESS = mwrap_libarchive_capture::value_ARCHIVE_FILTER_COMPRESS; +inline constexpr auto ARCHIVE_FILTER_GRZIP = mwrap_libarchive_capture::value_ARCHIVE_FILTER_GRZIP; +inline constexpr auto ARCHIVE_FILTER_GZIP = mwrap_libarchive_capture::value_ARCHIVE_FILTER_GZIP; +inline constexpr auto ARCHIVE_FILTER_LRZIP = mwrap_libarchive_capture::value_ARCHIVE_FILTER_LRZIP; +inline constexpr auto ARCHIVE_FILTER_LZ4 = mwrap_libarchive_capture::value_ARCHIVE_FILTER_LZ4; +inline constexpr auto ARCHIVE_FILTER_LZIP = mwrap_libarchive_capture::value_ARCHIVE_FILTER_LZIP; +inline constexpr auto ARCHIVE_FILTER_LZMA = mwrap_libarchive_capture::value_ARCHIVE_FILTER_LZMA; +inline constexpr auto ARCHIVE_FILTER_LZOP = mwrap_libarchive_capture::value_ARCHIVE_FILTER_LZOP; +inline constexpr auto ARCHIVE_FILTER_NONE = mwrap_libarchive_capture::value_ARCHIVE_FILTER_NONE; +inline constexpr auto ARCHIVE_FILTER_PROGRAM = mwrap_libarchive_capture::value_ARCHIVE_FILTER_PROGRAM; +inline constexpr auto ARCHIVE_FILTER_RPM = mwrap_libarchive_capture::value_ARCHIVE_FILTER_RPM; +inline constexpr auto ARCHIVE_FILTER_UU = mwrap_libarchive_capture::value_ARCHIVE_FILTER_UU; +inline constexpr auto ARCHIVE_FILTER_XZ = mwrap_libarchive_capture::value_ARCHIVE_FILTER_XZ; +inline constexpr auto ARCHIVE_FILTER_ZSTD = mwrap_libarchive_capture::value_ARCHIVE_FILTER_ZSTD; +inline constexpr auto ARCHIVE_FORMAT_7ZIP = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_7ZIP; +inline constexpr auto ARCHIVE_FORMAT_AR = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_AR; +inline constexpr auto ARCHIVE_FORMAT_AR_BSD = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_AR_BSD; +inline constexpr auto ARCHIVE_FORMAT_AR_GNU = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_AR_GNU; +inline constexpr auto ARCHIVE_FORMAT_BASE_MASK = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_BASE_MASK; +inline constexpr auto ARCHIVE_FORMAT_CAB = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CAB; +inline constexpr auto ARCHIVE_FORMAT_CPIO = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO; +inline constexpr auto ARCHIVE_FORMAT_CPIO_AFIO_LARGE = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO_AFIO_LARGE; +inline constexpr auto ARCHIVE_FORMAT_CPIO_BIN_BE = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO_BIN_BE; +inline constexpr auto ARCHIVE_FORMAT_CPIO_BIN_LE = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO_BIN_LE; +inline constexpr auto ARCHIVE_FORMAT_CPIO_POSIX = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO_POSIX; +inline constexpr auto ARCHIVE_FORMAT_CPIO_PWB = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO_PWB; +inline constexpr auto ARCHIVE_FORMAT_CPIO_SVR4_CRC = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO_SVR4_CRC; +inline constexpr auto ARCHIVE_FORMAT_CPIO_SVR4_NOCRC = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_CPIO_SVR4_NOCRC; +inline constexpr auto ARCHIVE_FORMAT_EMPTY = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_EMPTY; +inline constexpr auto ARCHIVE_FORMAT_ISO9660 = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_ISO9660; +inline constexpr auto ARCHIVE_FORMAT_ISO9660_ROCKRIDGE = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_ISO9660_ROCKRIDGE; +inline constexpr auto ARCHIVE_FORMAT_LHA = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_LHA; +inline constexpr auto ARCHIVE_FORMAT_MTREE = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_MTREE; +inline constexpr auto ARCHIVE_FORMAT_RAR = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_RAR; +inline constexpr auto ARCHIVE_FORMAT_RAR_V5 = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_RAR_V5; +inline constexpr auto ARCHIVE_FORMAT_RAW = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_RAW; +inline constexpr auto ARCHIVE_FORMAT_SHAR = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_SHAR; +inline constexpr auto ARCHIVE_FORMAT_SHAR_BASE = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_SHAR_BASE; +inline constexpr auto ARCHIVE_FORMAT_SHAR_DUMP = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_SHAR_DUMP; +inline constexpr auto ARCHIVE_FORMAT_TAR = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_TAR; +inline constexpr auto ARCHIVE_FORMAT_TAR_GNUTAR = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_TAR_GNUTAR; +inline constexpr auto ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE; +inline constexpr auto ARCHIVE_FORMAT_TAR_PAX_RESTRICTED = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_TAR_PAX_RESTRICTED; +inline constexpr auto ARCHIVE_FORMAT_TAR_USTAR = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_TAR_USTAR; +inline constexpr auto ARCHIVE_FORMAT_WARC = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_WARC; +inline constexpr auto ARCHIVE_FORMAT_XAR = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_XAR; +inline constexpr auto ARCHIVE_FORMAT_ZIP = mwrap_libarchive_capture::value_ARCHIVE_FORMAT_ZIP; +inline constexpr auto ARCHIVE_MATCH_CTIME = mwrap_libarchive_capture::value_ARCHIVE_MATCH_CTIME; +inline constexpr auto ARCHIVE_MATCH_EQUAL = mwrap_libarchive_capture::value_ARCHIVE_MATCH_EQUAL; +inline constexpr auto ARCHIVE_MATCH_MTIME = mwrap_libarchive_capture::value_ARCHIVE_MATCH_MTIME; +inline constexpr auto ARCHIVE_MATCH_NEWER = mwrap_libarchive_capture::value_ARCHIVE_MATCH_NEWER; +inline constexpr auto ARCHIVE_MATCH_OLDER = mwrap_libarchive_capture::value_ARCHIVE_MATCH_OLDER; +inline constexpr auto ARCHIVE_OK = mwrap_libarchive_capture::value_ARCHIVE_OK; +inline constexpr auto ARCHIVE_READDISK_HONOR_NODUMP = mwrap_libarchive_capture::value_ARCHIVE_READDISK_HONOR_NODUMP; +inline constexpr auto ARCHIVE_READDISK_MAC_COPYFILE = mwrap_libarchive_capture::value_ARCHIVE_READDISK_MAC_COPYFILE; +inline constexpr auto ARCHIVE_READDISK_NO_ACL = mwrap_libarchive_capture::value_ARCHIVE_READDISK_NO_ACL; +inline constexpr auto ARCHIVE_READDISK_NO_FFLAGS = mwrap_libarchive_capture::value_ARCHIVE_READDISK_NO_FFLAGS; +inline constexpr auto ARCHIVE_READDISK_NO_SPARSE = mwrap_libarchive_capture::value_ARCHIVE_READDISK_NO_SPARSE; +inline constexpr auto ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS = mwrap_libarchive_capture::value_ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS; +inline constexpr auto ARCHIVE_READDISK_NO_XATTR = mwrap_libarchive_capture::value_ARCHIVE_READDISK_NO_XATTR; +inline constexpr auto ARCHIVE_READDISK_RESTORE_ATIME = mwrap_libarchive_capture::value_ARCHIVE_READDISK_RESTORE_ATIME; +inline constexpr auto ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA = mwrap_libarchive_capture::value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA; +inline constexpr auto ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA = mwrap_libarchive_capture::value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA; +inline constexpr auto ARCHIVE_READ_FORMAT_CAPS_NONE = mwrap_libarchive_capture::value_ARCHIVE_READ_FORMAT_CAPS_NONE; +inline constexpr auto ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW = mwrap_libarchive_capture::value_ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW; +inline constexpr auto ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED = mwrap_libarchive_capture::value_ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED; +inline constexpr auto ARCHIVE_RETRY = mwrap_libarchive_capture::value_ARCHIVE_RETRY; +inline constexpr auto ARCHIVE_VERSION_NUMBER = mwrap_libarchive_capture::value_ARCHIVE_VERSION_NUMBER; +inline constexpr auto ARCHIVE_VERSION_ONLY_STRING = mwrap_libarchive_capture::value_ARCHIVE_VERSION_ONLY_STRING; +inline constexpr auto ARCHIVE_VERSION_STRING = mwrap_libarchive_capture::value_ARCHIVE_VERSION_STRING; +inline constexpr auto ARCHIVE_WARN = mwrap_libarchive_capture::value_ARCHIVE_WARN; +inline constexpr auto OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID = mwrap_libarchive_capture::value_OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID; +inline constexpr auto OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT = mwrap_libarchive_capture::value_OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT; +} diff --git a/templates/bundle/mcpp.toml.in b/templates/bundle/mcpp.toml.in new file mode 100644 index 0000000..a637560 --- /dev/null +++ b/templates/bundle/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/bundle/src/main.cpp.in b/templates/bundle/src/main.cpp.in new file mode 100644 index 0000000..a269665 --- /dev/null +++ b/templates/bundle/src/main.cpp.in @@ -0,0 +1,57 @@ +// {{project.name}}: libarchive through import mcpplibs.mwrap.libarchive. The +// functions and types are libarchive's own names; the constants (ARCHIVE_OK, +// AE_IFREG …) are in mcpplibs::mwrap::libarchive::macros. +import std; +import mcpplibs.mwrap.libarchive; + +namespace la = mcpplibs::mwrap::libarchive::macros; + +// A tar.gz of three small files, in memory. +static std::string bundle() +{ + std::string out(64 * 1024, '\0'); + std::size_t used = 0; + archive* a = archive_write_new(); + archive_write_set_format_pax_restricted(a); + archive_write_add_filter_gzip(a); + archive_write_open_memory(a, out.data(), out.size(), &used); + for (std::string_view name : {"README.md", "src/main.cpp", "notes/today.txt"}) { + const std::string data = std::format("{} was written by libarchive {}\n", name, la::ARCHIVE_VERSION_ONLY_STRING); + archive_entry* e = archive_entry_new(); + archive_entry_set_pathname(e, std::string(name).c_str()); + archive_entry_set_filetype(e, la::AE_IFREG); + archive_entry_set_perm(e, 0644); + archive_entry_set_size(e, static_cast(data.size())); + archive_write_header(a, e); + archive_write_data(a, data.data(), data.size()); + archive_entry_free(e); + } + archive_write_free(a); // closes the archive and flushes the filter + out.resize(used); + return out; +} + +int main(int argc, char** argv) +{ + archive* a = archive_read_new(); + archive_read_support_filter_all(a); + archive_read_support_format_all(a); + const std::string memory = argc > 1 ? std::string() : bundle(); + const int opened = argc > 1 ? archive_read_open_filename(a, argv[1], 10240) + : archive_read_open_memory(a, memory.data(), memory.size()); + if (opened != la::ARCHIVE_OK) { + std::println("cannot open: {}", archive_error_string(a)); + archive_read_free(a); + return 1; + } + archive_entry* e; + int entries = 0; + while (archive_read_next_header(a, &e) == la::ARCHIVE_OK) { + std::println("{:>8} {}", archive_entry_size(e), archive_entry_pathname(e)); + archive_read_data_skip(a); + ++entries; + } + std::println("{} entries, {} / {}", entries, archive_format_name(a), archive_filter_name(a, 0)); + archive_read_free(a); + return entries > 0 ? 0 : 1; +} diff --git a/templates/bundle/template.toml b/templates/bundle/template.toml new file mode 100644 index 0000000..583c548 --- /dev/null +++ b/templates/bundle/template.toml @@ -0,0 +1,4 @@ +[template] +description = "Archives with import mcpplibs.mwrap.libarchive: a tar.gz written in memory and listed, or the listing of any archive libarchive reads" +default = true +post_message = "Run `mcpp run`, or `mcpp run -- ` to list an archive of your own." diff --git a/tests/api_test.cpp b/tests/api_test.cpp new file mode 100644 index 0000000..1a41a82 --- /dev/null +++ b/tests/api_test.cpp @@ -0,0 +1,119 @@ +// The module's functions over compat.libarchive: archives written to memory in +// several formats and filters and read back entry by entry, the entry +// metadata, the automatic format detection, the refusal of garbage, and the +// version against its macros. +import std; +import mcpplibs.mwrap.libarchive; + +namespace m = mcpplibs::mwrap::libarchive::macros; + +struct File { + std::string path, data; +}; + +// One archive in memory: `format` and `filter` are libarchive's names ("pax", "gzip" …). +static std::string write(const char* format, const char* filter, const std::vector& files) +{ + std::string out(1 << 20, '\0'); + std::size_t used = 0; + archive* a = archive_write_new(); + archive_write_set_format_by_name(a, format); + if (filter) archive_write_add_filter_by_name(a, filter); + if (archive_write_open_memory(a, out.data(), out.size(), &used) != m::ARCHIVE_OK) return {}; + for (const File& f : files) { + archive_entry* e = archive_entry_new(); + archive_entry_set_pathname(e, f.path.c_str()); + archive_entry_set_size(e, static_cast(f.data.size())); + archive_entry_set_filetype(e, m::AE_IFREG); + archive_entry_set_perm(e, 0644); + archive_entry_set_mtime(e, 1700000000, 0); + archive_write_header(a, e); + archive_write_data(a, f.data.data(), f.data.size()); + archive_entry_free(e); + } + archive_write_close(a); + archive_write_free(a); + out.resize(used); + return out; +} + +// Every entry of an archive in memory, with its format and filter as detected. +static std::vector read(const std::string& bytes, std::string& format, std::string& filter) +{ + std::vector files; + archive* a = archive_read_new(); + archive_read_support_filter_all(a); + archive_read_support_format_all(a); + if (archive_read_open_memory(a, bytes.data(), bytes.size()) == m::ARCHIVE_OK) { + archive_entry* e; + while (archive_read_next_header(a, &e) == m::ARCHIVE_OK) { + File f{archive_entry_pathname(e), std::string(static_cast(archive_entry_size(e)), '\0')}; + archive_read_data(a, f.data.data(), f.data.size()); + files.push_back(std::move(f)); + } + format = archive_format_name(a); + filter = archive_filter_count(a) > 1 ? archive_filter_name(a, 0) : "none"; + } + archive_read_free(a); + return files; +} + +int main() +{ + int failures = 0; + auto check = [&](bool ok, std::string_view what) { + std::println("{} {}", ok ? "ok " : "FAIL", what); + failures += ok ? 0 : 1; + }; + + std::string big; + for (int i = 0; i < 2000; ++i) big += std::format("line {}\n", i); + const std::vector files{{"hello.txt", "hello, archive\n"}, {"dir/big.txt", big}, {"empty", ""}}; + + // Format and filter combinations, each detected on reading. A pax archive + // that needs no extended header reads as ustar, and "cpio" writes odc. + struct Case { const char* format; const char* filter; std::string_view detected; }; + for (const Case c : {Case{"pax", "gzip", "POSIX"}, Case{"ustar", "xz", "POSIX ustar format"}, + Case{"cpio", "zstd", "POSIX octet-oriented cpio"}, Case{"zip", nullptr, "ZIP"}, + Case{"7zip", nullptr, "7-Zip"}, Case{"gnutar", "bzip2", "GNU tar format"}}) { + const std::string bytes = write(c.format, c.filter, files); + std::string format, filter; + const auto back = read(bytes, format, filter); + const bool same = back.size() == files.size() + && std::ranges::equal(back, files, [](const File& a, const File& b) { return a.path == b.path && a.data == b.data; }); + check(!bytes.empty() && same && format.starts_with(c.detected) && (c.filter ? filter == c.filter : true), + std::format("{} + {}: {} bytes, read back as {} / {}", c.format, c.filter ? c.filter : "none", bytes.size(), + format, filter)); + } + + // Entry metadata. + archive_entry* e = archive_entry_new(); + archive_entry_set_pathname(e, "a/b.txt"); + archive_entry_set_mode(e, m::AE_IFREG | 0640); + archive_entry_set_uid(e, 1000); + archive_entry_set_uname(e, "builder"); + archive_entry* copy = archive_entry_clone(e); + check(std::string_view(archive_entry_pathname(copy)) == "a/b.txt" && archive_entry_filetype(copy) == m::AE_IFREG + && (archive_entry_perm(copy) & 0777) == 0640 && archive_entry_uid(copy) == 1000 + && std::string_view(archive_entry_uname(copy)) == "builder", "an entry's metadata survives a clone"); + archive_entry_free(copy); + archive_entry_free(e); + + // Garbage is refused with a message. + archive* a = archive_read_new(); + archive_read_support_format_all(a); + archive_read_support_filter_all(a); + const char garbage[] = "this is not an archive at all, not even close"; + archive_entry* entry; + const bool refused = archive_read_open_memory(a, garbage, sizeof garbage) != m::ARCHIVE_OK + || archive_read_next_header(a, &entry) == m::ARCHIVE_FATAL; + check(refused && archive_error_string(a) != nullptr, std::format("garbage is refused: {}", + archive_error_string(a) ? archive_error_string(a) : "(no message)")); + archive_read_free(a); + + check(archive_version_number() == m::ARCHIVE_VERSION_NUMBER + && std::string_view(archive_version_string()) == m::ARCHIVE_VERSION_STRING, "the library is the headers' version"); + std::println("{}", archive_version_details()); + std::println("{} failures", failures); + return failures != 0; +} diff --git a/tests/header_mix_test.cpp b/tests/header_mix_test.cpp new file mode 100644 index 0000000..28c045e --- /dev/null +++ b/tests/header_mix_test.cpp @@ -0,0 +1,17 @@ +// The headers and the module in one translation unit: the same entities, so an +// archive object created through one spelling is freed through the other. +#define LIBARCHIVE_STATIC +#include +#include +import std; +import mcpplibs.mwrap.libarchive; + +int main() +{ + struct archive* a = ::archive_write_new(); // the header's declaration + const bool format = archive_write_set_format_pax(a) == ARCHIVE_OK; // the module's + const bool freed = archive_write_free(a) == ARCHIVE_OK; + const bool same = &::archive_entry_new == &archive_entry_new; + std::println("{}", format && freed && same ? "header and module agree" : "FAIL"); + return format && freed && same ? 0 : 1; +} diff --git a/tests/linked.cpp b/tests/linked.cpp new file mode 100644 index 0000000..6467e5a --- /dev/null +++ b/tests/linked.cpp @@ -0,0 +1,468 @@ +// Every function that mcpplibs.mwrap.libarchive exports, by address: the program links only +// where compat.libarchive defines each one. Written by tools/generate.py. +import std; +import mcpplibs.mwrap.libarchive; + +int main() +{ + // volatile: an optimiser may not drop a reference, so each one reaches the link. + const void* volatile functions[] = { + reinterpret_cast(&archive_bzlib_version), + reinterpret_cast(&archive_clear_error), + reinterpret_cast(&archive_cng_version), + reinterpret_cast(&archive_commoncrypto_version), + reinterpret_cast(&archive_compression), + reinterpret_cast(&archive_compression_name), + reinterpret_cast(&archive_copy_error), + reinterpret_cast(&archive_entry_acl), + reinterpret_cast(&archive_entry_acl_add_entry), + reinterpret_cast(&archive_entry_acl_add_entry_w), + reinterpret_cast(&archive_entry_acl_clear), + reinterpret_cast(&archive_entry_acl_count), + reinterpret_cast(&archive_entry_acl_from_text), + reinterpret_cast(&archive_entry_acl_from_text_w), + reinterpret_cast(&archive_entry_acl_next), + reinterpret_cast(&archive_entry_acl_reset), + reinterpret_cast(&archive_entry_acl_text), + reinterpret_cast(&archive_entry_acl_text_w), + reinterpret_cast(&archive_entry_acl_to_text), + reinterpret_cast(&archive_entry_acl_to_text_w), + reinterpret_cast(&archive_entry_acl_types), + reinterpret_cast(&archive_entry_atime), + reinterpret_cast(&archive_entry_atime_is_set), + reinterpret_cast(&archive_entry_atime_nsec), + reinterpret_cast(&archive_entry_birthtime), + reinterpret_cast(&archive_entry_birthtime_is_set), + reinterpret_cast(&archive_entry_birthtime_nsec), + reinterpret_cast(&archive_entry_clear), + reinterpret_cast(&archive_entry_clone), + reinterpret_cast(&archive_entry_copy_fflags_text), + reinterpret_cast(&archive_entry_copy_fflags_text_len), + reinterpret_cast(&archive_entry_copy_fflags_text_w), + reinterpret_cast(&archive_entry_copy_gname), + reinterpret_cast(&archive_entry_copy_gname_w), + reinterpret_cast(&archive_entry_copy_hardlink), + reinterpret_cast(&archive_entry_copy_hardlink_w), + reinterpret_cast(&archive_entry_copy_link), + reinterpret_cast(&archive_entry_copy_link_w), + reinterpret_cast(&archive_entry_copy_mac_metadata), + reinterpret_cast(&archive_entry_copy_pathname), + reinterpret_cast(&archive_entry_copy_pathname_w), + reinterpret_cast(&archive_entry_copy_sourcepath), + reinterpret_cast(&archive_entry_copy_sourcepath_w), + reinterpret_cast(&archive_entry_copy_stat), + reinterpret_cast(&archive_entry_copy_symlink), + reinterpret_cast(&archive_entry_copy_symlink_w), + reinterpret_cast(&archive_entry_copy_uname), + reinterpret_cast(&archive_entry_copy_uname_w), + reinterpret_cast(&archive_entry_ctime), + reinterpret_cast(&archive_entry_ctime_is_set), + reinterpret_cast(&archive_entry_ctime_nsec), + reinterpret_cast(&archive_entry_dev), + reinterpret_cast(&archive_entry_dev_is_set), + reinterpret_cast(&archive_entry_devmajor), + reinterpret_cast(&archive_entry_devminor), + reinterpret_cast(&archive_entry_digest), + reinterpret_cast(&archive_entry_fflags), + reinterpret_cast(&archive_entry_fflags_text), + reinterpret_cast(&archive_entry_filetype), + reinterpret_cast(&archive_entry_filetype_is_set), + reinterpret_cast(&archive_entry_free), + reinterpret_cast(&archive_entry_gid), + reinterpret_cast(&archive_entry_gid_is_set), + reinterpret_cast(&archive_entry_gname), + reinterpret_cast(&archive_entry_gname_utf8), + reinterpret_cast(&archive_entry_gname_w), + reinterpret_cast(&archive_entry_hardlink), + reinterpret_cast(&archive_entry_hardlink_is_set), + reinterpret_cast(&archive_entry_hardlink_utf8), + reinterpret_cast(&archive_entry_hardlink_w), + reinterpret_cast(&archive_entry_ino), + reinterpret_cast(&archive_entry_ino64), + reinterpret_cast(&archive_entry_ino_is_set), + reinterpret_cast(&archive_entry_is_data_encrypted), + reinterpret_cast(&archive_entry_is_encrypted), + reinterpret_cast(&archive_entry_is_metadata_encrypted), + reinterpret_cast(&archive_entry_linkify), + reinterpret_cast(&archive_entry_linkresolver_free), + reinterpret_cast(&archive_entry_linkresolver_new), + reinterpret_cast(&archive_entry_linkresolver_set_strategy), + reinterpret_cast(&archive_entry_mac_metadata), + reinterpret_cast(&archive_entry_mode), + reinterpret_cast(&archive_entry_mtime), + reinterpret_cast(&archive_entry_mtime_is_set), + reinterpret_cast(&archive_entry_mtime_nsec), + reinterpret_cast(&archive_entry_new), + reinterpret_cast(&archive_entry_new2), + reinterpret_cast(&archive_entry_nlink), + reinterpret_cast(&archive_entry_partial_links), + reinterpret_cast(&archive_entry_pathname), + reinterpret_cast(&archive_entry_pathname_utf8), + reinterpret_cast(&archive_entry_pathname_w), + reinterpret_cast(&archive_entry_perm), + reinterpret_cast(&archive_entry_perm_is_set), + reinterpret_cast(&archive_entry_rdev), + reinterpret_cast(&archive_entry_rdev_is_set), + reinterpret_cast(&archive_entry_rdevmajor), + reinterpret_cast(&archive_entry_rdevminor), + reinterpret_cast(&archive_entry_set_atime), + reinterpret_cast(&archive_entry_set_birthtime), + reinterpret_cast(&archive_entry_set_ctime), + reinterpret_cast(&archive_entry_set_dev), + reinterpret_cast(&archive_entry_set_devmajor), + reinterpret_cast(&archive_entry_set_devminor), + reinterpret_cast(&archive_entry_set_digest), + reinterpret_cast(&archive_entry_set_fflags), + reinterpret_cast(&archive_entry_set_filetype), + reinterpret_cast(&archive_entry_set_gid), + reinterpret_cast(&archive_entry_set_gname), + reinterpret_cast(&archive_entry_set_gname_utf8), + reinterpret_cast(&archive_entry_set_hardlink), + reinterpret_cast(&archive_entry_set_hardlink_utf8), + reinterpret_cast(&archive_entry_set_ino), + reinterpret_cast(&archive_entry_set_ino64), + reinterpret_cast(&archive_entry_set_is_data_encrypted), + reinterpret_cast(&archive_entry_set_is_metadata_encrypted), + reinterpret_cast(&archive_entry_set_link), + reinterpret_cast(&archive_entry_set_link_to_hardlink), + reinterpret_cast(&archive_entry_set_link_to_symlink), + reinterpret_cast(&archive_entry_set_link_utf8), + reinterpret_cast(&archive_entry_set_mode), + reinterpret_cast(&archive_entry_set_mtime), + reinterpret_cast(&archive_entry_set_nlink), + reinterpret_cast(&archive_entry_set_pathname), + reinterpret_cast(&archive_entry_set_pathname_utf8), + reinterpret_cast(&archive_entry_set_perm), + reinterpret_cast(&archive_entry_set_rdev), + reinterpret_cast(&archive_entry_set_rdevmajor), + reinterpret_cast(&archive_entry_set_rdevminor), + reinterpret_cast(&archive_entry_set_size), + reinterpret_cast(&archive_entry_set_symlink), + reinterpret_cast(&archive_entry_set_symlink_type), + reinterpret_cast(&archive_entry_set_symlink_utf8), + reinterpret_cast(&archive_entry_set_uid), + reinterpret_cast(&archive_entry_set_uname), + reinterpret_cast(&archive_entry_set_uname_utf8), + reinterpret_cast(&archive_entry_size), + reinterpret_cast(&archive_entry_size_is_set), + reinterpret_cast(&archive_entry_sourcepath), + reinterpret_cast(&archive_entry_sourcepath_w), + reinterpret_cast(&archive_entry_sparse_add_entry), + reinterpret_cast(&archive_entry_sparse_clear), + reinterpret_cast(&archive_entry_sparse_count), + reinterpret_cast(&archive_entry_sparse_next), + reinterpret_cast(&archive_entry_sparse_reset), + reinterpret_cast(&archive_entry_stat), + reinterpret_cast(&archive_entry_strmode), + reinterpret_cast(&archive_entry_symlink), + reinterpret_cast(&archive_entry_symlink_type), + reinterpret_cast(&archive_entry_symlink_utf8), + reinterpret_cast(&archive_entry_symlink_w), + reinterpret_cast(&archive_entry_uid), + reinterpret_cast(&archive_entry_uid_is_set), + reinterpret_cast(&archive_entry_uname), + reinterpret_cast(&archive_entry_uname_utf8), + reinterpret_cast(&archive_entry_uname_w), + reinterpret_cast(&archive_entry_unset_atime), + reinterpret_cast(&archive_entry_unset_birthtime), + reinterpret_cast(&archive_entry_unset_ctime), + reinterpret_cast(&archive_entry_unset_mtime), + reinterpret_cast(&archive_entry_unset_size), + reinterpret_cast(&archive_entry_update_gname_utf8), + reinterpret_cast(&archive_entry_update_hardlink_utf8), + reinterpret_cast(&archive_entry_update_link_utf8), + reinterpret_cast(&archive_entry_update_pathname_utf8), + reinterpret_cast(&archive_entry_update_symlink_utf8), + reinterpret_cast(&archive_entry_update_uname_utf8), + reinterpret_cast(&archive_entry_xattr_add_entry), + reinterpret_cast(&archive_entry_xattr_clear), + reinterpret_cast(&archive_entry_xattr_count), + reinterpret_cast(&archive_entry_xattr_next), + reinterpret_cast(&archive_entry_xattr_reset), + reinterpret_cast(&archive_errno), + reinterpret_cast(&archive_error_string), + reinterpret_cast(&archive_file_count), + reinterpret_cast(&archive_filter_bytes), + reinterpret_cast(&archive_filter_code), + reinterpret_cast(&archive_filter_count), + reinterpret_cast(&archive_filter_name), + reinterpret_cast(&archive_format), + reinterpret_cast(&archive_format_name), + reinterpret_cast(&archive_free), + reinterpret_cast(&archive_libacl_version), + reinterpret_cast(&archive_libattr_version), + reinterpret_cast(&archive_libbsdxml_version), + reinterpret_cast(&archive_libexpat_version), + reinterpret_cast(&archive_libiconv_version), + reinterpret_cast(&archive_liblz4_version), + reinterpret_cast(&archive_liblzma_version), + reinterpret_cast(&archive_liblzo2_version), + reinterpret_cast(&archive_libmd_version), + reinterpret_cast(&archive_libpcre2_version), + reinterpret_cast(&archive_libpcre_version), + reinterpret_cast(&archive_librichacl_version), + reinterpret_cast(&archive_libxml2_version), + reinterpret_cast(&archive_libzstd_version), + reinterpret_cast(&archive_match_exclude_entry), + reinterpret_cast(&archive_match_exclude_pattern), + reinterpret_cast(&archive_match_exclude_pattern_from_file), + reinterpret_cast(&archive_match_exclude_pattern_from_file_w), + reinterpret_cast(&archive_match_exclude_pattern_w), + reinterpret_cast(&archive_match_excluded), + reinterpret_cast(&archive_match_free), + reinterpret_cast(&archive_match_include_date), + reinterpret_cast(&archive_match_include_date_w), + reinterpret_cast(&archive_match_include_file_time), + reinterpret_cast(&archive_match_include_file_time_w), + reinterpret_cast(&archive_match_include_gid), + reinterpret_cast(&archive_match_include_gname), + reinterpret_cast(&archive_match_include_gname_w), + reinterpret_cast(&archive_match_include_pattern), + reinterpret_cast(&archive_match_include_pattern_from_file), + reinterpret_cast(&archive_match_include_pattern_from_file_w), + reinterpret_cast(&archive_match_include_pattern_w), + reinterpret_cast(&archive_match_include_time), + reinterpret_cast(&archive_match_include_uid), + reinterpret_cast(&archive_match_include_uname), + reinterpret_cast(&archive_match_include_uname_w), + reinterpret_cast(&archive_match_new), + reinterpret_cast(&archive_match_owner_excluded), + reinterpret_cast(&archive_match_path_excluded), + reinterpret_cast(&archive_match_path_unmatched_inclusions), + reinterpret_cast(&archive_match_path_unmatched_inclusions_next), + reinterpret_cast(&archive_match_path_unmatched_inclusions_next_w), + reinterpret_cast(&archive_match_set_inclusion_recursion), + reinterpret_cast(&archive_match_time_excluded), + reinterpret_cast(&archive_mbedtls_version), + reinterpret_cast(&archive_nettle_version), + reinterpret_cast(&archive_openssl_version), + reinterpret_cast(&archive_parse_date), + reinterpret_cast(&archive_position_compressed), + reinterpret_cast(&archive_position_uncompressed), + reinterpret_cast(&archive_read_add_callback_data), + reinterpret_cast(&archive_read_add_passphrase), + reinterpret_cast(&archive_read_append_callback_data), + reinterpret_cast(&archive_read_append_filter), + reinterpret_cast(&archive_read_append_filter_program), + reinterpret_cast(&archive_read_append_filter_program_signature), + reinterpret_cast(&archive_read_close), + reinterpret_cast(&archive_read_data), + reinterpret_cast(&archive_read_data_block), + reinterpret_cast(&archive_read_data_into_fd), + reinterpret_cast(&archive_read_data_skip), + reinterpret_cast(&archive_read_disk_can_descend), + reinterpret_cast(&archive_read_disk_current_filesystem), + reinterpret_cast(&archive_read_disk_current_filesystem_is_remote), + reinterpret_cast(&archive_read_disk_current_filesystem_is_synthetic), + reinterpret_cast(&archive_read_disk_descend), + reinterpret_cast(&archive_read_disk_entry_from_file), + reinterpret_cast(&archive_read_disk_gname), + reinterpret_cast(&archive_read_disk_new), + reinterpret_cast(&archive_read_disk_open), + reinterpret_cast(&archive_read_disk_open_w), + reinterpret_cast(&archive_read_disk_set_atime_restored), + reinterpret_cast(&archive_read_disk_set_behavior), + reinterpret_cast(&archive_read_disk_set_gname_lookup), + reinterpret_cast(&archive_read_disk_set_matching), + reinterpret_cast(&archive_read_disk_set_metadata_filter_callback), + reinterpret_cast(&archive_read_disk_set_standard_lookup), + reinterpret_cast(&archive_read_disk_set_symlink_hybrid), + reinterpret_cast(&archive_read_disk_set_symlink_logical), + reinterpret_cast(&archive_read_disk_set_symlink_physical), + reinterpret_cast(&archive_read_disk_set_uname_lookup), + reinterpret_cast(&archive_read_disk_uname), + reinterpret_cast(&archive_read_extract), + reinterpret_cast(&archive_read_extract2), + reinterpret_cast(&archive_read_extract_set_progress_callback), + reinterpret_cast(&archive_read_extract_set_skip_file), + reinterpret_cast(&archive_read_finish), + reinterpret_cast(&archive_read_format_capabilities), + reinterpret_cast(&archive_read_free), + reinterpret_cast(&archive_read_has_encrypted_entries), + reinterpret_cast(&archive_read_header_position), + reinterpret_cast(&archive_read_new), + reinterpret_cast(&archive_read_next_header), + reinterpret_cast(&archive_read_next_header2), + reinterpret_cast(&archive_read_open), + reinterpret_cast(&archive_read_open1), + reinterpret_cast(&archive_read_open2), + reinterpret_cast(&archive_read_open_FILE), + reinterpret_cast(&archive_read_open_fd), + reinterpret_cast(&archive_read_open_file), + reinterpret_cast(&archive_read_open_filename), + reinterpret_cast(&archive_read_open_filename_w), + reinterpret_cast(&archive_read_open_filenames), + reinterpret_cast(&archive_read_open_memory), + reinterpret_cast(&archive_read_open_memory2), + reinterpret_cast(&archive_read_prepend_callback_data), + reinterpret_cast(&archive_read_set_callback_data), + reinterpret_cast(&archive_read_set_callback_data2), + reinterpret_cast(&archive_read_set_close_callback), + reinterpret_cast(&archive_read_set_filter_option), + reinterpret_cast(&archive_read_set_format), + reinterpret_cast(&archive_read_set_format_option), + reinterpret_cast(&archive_read_set_open_callback), + reinterpret_cast(&archive_read_set_option), + reinterpret_cast(&archive_read_set_options), + reinterpret_cast(&archive_read_set_passphrase_callback), + reinterpret_cast(&archive_read_set_read_callback), + reinterpret_cast(&archive_read_set_seek_callback), + reinterpret_cast(&archive_read_set_skip_callback), + reinterpret_cast(&archive_read_set_switch_callback), + reinterpret_cast(&archive_read_support_compression_all), + reinterpret_cast(&archive_read_support_compression_bzip2), + reinterpret_cast(&archive_read_support_compression_compress), + reinterpret_cast(&archive_read_support_compression_gzip), + reinterpret_cast(&archive_read_support_compression_lzip), + reinterpret_cast(&archive_read_support_compression_lzma), + reinterpret_cast(&archive_read_support_compression_none), + reinterpret_cast(&archive_read_support_compression_program), + reinterpret_cast(&archive_read_support_compression_program_signature), + reinterpret_cast(&archive_read_support_compression_rpm), + reinterpret_cast(&archive_read_support_compression_uu), + reinterpret_cast(&archive_read_support_compression_xz), + reinterpret_cast(&archive_read_support_filter_all), + reinterpret_cast(&archive_read_support_filter_by_code), + reinterpret_cast(&archive_read_support_filter_bzip2), + reinterpret_cast(&archive_read_support_filter_compress), + reinterpret_cast(&archive_read_support_filter_grzip), + reinterpret_cast(&archive_read_support_filter_gzip), + reinterpret_cast(&archive_read_support_filter_lrzip), + reinterpret_cast(&archive_read_support_filter_lz4), + reinterpret_cast(&archive_read_support_filter_lzip), + reinterpret_cast(&archive_read_support_filter_lzma), + reinterpret_cast(&archive_read_support_filter_lzop), + reinterpret_cast(&archive_read_support_filter_none), + reinterpret_cast(&archive_read_support_filter_program), + reinterpret_cast(&archive_read_support_filter_program_signature), + reinterpret_cast(&archive_read_support_filter_rpm), + reinterpret_cast(&archive_read_support_filter_uu), + reinterpret_cast(&archive_read_support_filter_xz), + reinterpret_cast(&archive_read_support_filter_zstd), + reinterpret_cast(&archive_read_support_format_7zip), + reinterpret_cast(&archive_read_support_format_all), + reinterpret_cast(&archive_read_support_format_ar), + reinterpret_cast(&archive_read_support_format_by_code), + reinterpret_cast(&archive_read_support_format_cab), + reinterpret_cast(&archive_read_support_format_cpio), + reinterpret_cast(&archive_read_support_format_empty), + reinterpret_cast(&archive_read_support_format_gnutar), + reinterpret_cast(&archive_read_support_format_iso9660), + reinterpret_cast(&archive_read_support_format_lha), + reinterpret_cast(&archive_read_support_format_mtree), + reinterpret_cast(&archive_read_support_format_rar), + reinterpret_cast(&archive_read_support_format_rar5), + reinterpret_cast(&archive_read_support_format_raw), + reinterpret_cast(&archive_read_support_format_tar), + reinterpret_cast(&archive_read_support_format_warc), + reinterpret_cast(&archive_read_support_format_xar), + reinterpret_cast(&archive_read_support_format_zip), + reinterpret_cast(&archive_read_support_format_zip_seekable), + reinterpret_cast(&archive_read_support_format_zip_streamable), + reinterpret_cast(&archive_seek_data), + reinterpret_cast(&archive_set_error), + reinterpret_cast(&archive_utility_string_sort), + reinterpret_cast(&archive_version_details), + reinterpret_cast(&archive_version_number), + reinterpret_cast(&archive_version_string), + reinterpret_cast(&archive_wincrypt_version), + reinterpret_cast(&archive_write_add_filter), + reinterpret_cast(&archive_write_add_filter_b64encode), + reinterpret_cast(&archive_write_add_filter_by_name), + reinterpret_cast(&archive_write_add_filter_bzip2), + reinterpret_cast(&archive_write_add_filter_compress), + reinterpret_cast(&archive_write_add_filter_grzip), + reinterpret_cast(&archive_write_add_filter_gzip), + reinterpret_cast(&archive_write_add_filter_lrzip), + reinterpret_cast(&archive_write_add_filter_lz4), + reinterpret_cast(&archive_write_add_filter_lzip), + reinterpret_cast(&archive_write_add_filter_lzma), + reinterpret_cast(&archive_write_add_filter_lzop), + reinterpret_cast(&archive_write_add_filter_none), + reinterpret_cast(&archive_write_add_filter_program), + reinterpret_cast(&archive_write_add_filter_uuencode), + reinterpret_cast(&archive_write_add_filter_xz), + reinterpret_cast(&archive_write_add_filter_zstd), + reinterpret_cast(&archive_write_close), + reinterpret_cast(&archive_write_data), + reinterpret_cast(&archive_write_data_block), + reinterpret_cast(&archive_write_disk_gid), + reinterpret_cast(&archive_write_disk_new), + reinterpret_cast(&archive_write_disk_set_group_lookup), + reinterpret_cast(&archive_write_disk_set_options), + reinterpret_cast(&archive_write_disk_set_skip_file), + reinterpret_cast(&archive_write_disk_set_standard_lookup), + reinterpret_cast(&archive_write_disk_set_user_lookup), + reinterpret_cast(&archive_write_disk_uid), + reinterpret_cast(&archive_write_fail), + reinterpret_cast(&archive_write_finish), + reinterpret_cast(&archive_write_finish_entry), + reinterpret_cast(&archive_write_free), + reinterpret_cast(&archive_write_get_bytes_in_last_block), + reinterpret_cast(&archive_write_get_bytes_per_block), + reinterpret_cast(&archive_write_header), + reinterpret_cast(&archive_write_new), + reinterpret_cast(&archive_write_open), + reinterpret_cast(&archive_write_open2), + reinterpret_cast(&archive_write_open_FILE), + reinterpret_cast(&archive_write_open_fd), + reinterpret_cast(&archive_write_open_file), + reinterpret_cast(&archive_write_open_filename), + reinterpret_cast(&archive_write_open_filename_w), + reinterpret_cast(&archive_write_open_memory), + reinterpret_cast(&archive_write_set_bytes_in_last_block), + reinterpret_cast(&archive_write_set_bytes_per_block), + reinterpret_cast(&archive_write_set_compression_bzip2), + reinterpret_cast(&archive_write_set_compression_compress), + reinterpret_cast(&archive_write_set_compression_gzip), + reinterpret_cast(&archive_write_set_compression_lzip), + reinterpret_cast(&archive_write_set_compression_lzma), + reinterpret_cast(&archive_write_set_compression_none), + reinterpret_cast(&archive_write_set_compression_program), + reinterpret_cast(&archive_write_set_compression_xz), + reinterpret_cast(&archive_write_set_filter_option), + reinterpret_cast(&archive_write_set_format), + reinterpret_cast(&archive_write_set_format_7zip), + reinterpret_cast(&archive_write_set_format_ar_bsd), + reinterpret_cast(&archive_write_set_format_ar_svr4), + reinterpret_cast(&archive_write_set_format_by_name), + reinterpret_cast(&archive_write_set_format_cpio), + reinterpret_cast(&archive_write_set_format_cpio_bin), + reinterpret_cast(&archive_write_set_format_cpio_newc), + reinterpret_cast(&archive_write_set_format_cpio_odc), + reinterpret_cast(&archive_write_set_format_cpio_pwb), + reinterpret_cast(&archive_write_set_format_filter_by_ext), + reinterpret_cast(&archive_write_set_format_filter_by_ext_def), + reinterpret_cast(&archive_write_set_format_gnutar), + reinterpret_cast(&archive_write_set_format_iso9660), + reinterpret_cast(&archive_write_set_format_mtree), + reinterpret_cast(&archive_write_set_format_mtree_classic), + reinterpret_cast(&archive_write_set_format_option), + reinterpret_cast(&archive_write_set_format_pax), + reinterpret_cast(&archive_write_set_format_pax_restricted), + reinterpret_cast(&archive_write_set_format_raw), + reinterpret_cast(&archive_write_set_format_shar), + reinterpret_cast(&archive_write_set_format_shar_dump), + reinterpret_cast(&archive_write_set_format_ustar), + reinterpret_cast(&archive_write_set_format_v7tar), + reinterpret_cast(&archive_write_set_format_warc), + reinterpret_cast(&archive_write_set_format_xar), + reinterpret_cast(&archive_write_set_format_zip), + reinterpret_cast(&archive_write_set_option), + reinterpret_cast(&archive_write_set_options), + reinterpret_cast(&archive_write_set_passphrase), + reinterpret_cast(&archive_write_set_passphrase_callback), + reinterpret_cast(&archive_write_set_skip_file), + reinterpret_cast(&archive_write_zip_set_compression_bzip2), + reinterpret_cast(&archive_write_zip_set_compression_deflate), + reinterpret_cast(&archive_write_zip_set_compression_lzma), + reinterpret_cast(&archive_write_zip_set_compression_store), + reinterpret_cast(&archive_write_zip_set_compression_xz), + reinterpret_cast(&archive_write_zip_set_compression_zstd), + reinterpret_cast(&archive_zlib_version), + }; + int missing = 0; + for (const void* f : functions) missing += f == nullptr; + std::println("453 functions linked, {} null", missing); + return missing != 0; +} diff --git a/tests/macros.cpp b/tests/macros.cpp new file mode 100644 index 0000000..f4fb8f7 --- /dev/null +++ b/tests/macros.cpp @@ -0,0 +1,553 @@ +// Each constant and type of mcpplibs.mwrap.libarchive.macros equals its macro. A macro +// expands even in a qualified name, so the values of the headers are taken under other +// names and the macros undefined before the mapped names are used. Written by +// tools/generate.py. +#ifndef LIBARCHIVE_STATIC +#define LIBARCHIVE_STATIC +#endif +#include +#include + +namespace header { +inline constexpr auto value_AE_IFBLK = (AE_IFBLK); +inline constexpr auto value_AE_IFCHR = (AE_IFCHR); +inline constexpr auto value_AE_IFDIR = (AE_IFDIR); +inline constexpr auto value_AE_IFIFO = (AE_IFIFO); +inline constexpr auto value_AE_IFLNK = (AE_IFLNK); +inline constexpr auto value_AE_IFMT = (AE_IFMT); +inline constexpr auto value_AE_IFREG = (AE_IFREG); +inline constexpr auto value_AE_IFSOCK = (AE_IFSOCK); +inline constexpr auto value_AE_SYMLINK_TYPE_DIRECTORY = (AE_SYMLINK_TYPE_DIRECTORY); +inline constexpr auto value_AE_SYMLINK_TYPE_FILE = (AE_SYMLINK_TYPE_FILE); +inline constexpr auto value_AE_SYMLINK_TYPE_UNDEFINED = (AE_SYMLINK_TYPE_UNDEFINED); +inline constexpr auto value_ARCHIVE_COMPRESSION_BZIP2 = (ARCHIVE_COMPRESSION_BZIP2); +inline constexpr auto value_ARCHIVE_COMPRESSION_COMPRESS = (ARCHIVE_COMPRESSION_COMPRESS); +inline constexpr auto value_ARCHIVE_COMPRESSION_GZIP = (ARCHIVE_COMPRESSION_GZIP); +inline constexpr auto value_ARCHIVE_COMPRESSION_LRZIP = (ARCHIVE_COMPRESSION_LRZIP); +inline constexpr auto value_ARCHIVE_COMPRESSION_LZIP = (ARCHIVE_COMPRESSION_LZIP); +inline constexpr auto value_ARCHIVE_COMPRESSION_LZMA = (ARCHIVE_COMPRESSION_LZMA); +inline constexpr auto value_ARCHIVE_COMPRESSION_NONE = (ARCHIVE_COMPRESSION_NONE); +inline constexpr auto value_ARCHIVE_COMPRESSION_PROGRAM = (ARCHIVE_COMPRESSION_PROGRAM); +inline constexpr auto value_ARCHIVE_COMPRESSION_RPM = (ARCHIVE_COMPRESSION_RPM); +inline constexpr auto value_ARCHIVE_COMPRESSION_UU = (ARCHIVE_COMPRESSION_UU); +inline constexpr auto value_ARCHIVE_COMPRESSION_XZ = (ARCHIVE_COMPRESSION_XZ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ADD_FILE = (ARCHIVE_ENTRY_ACL_ADD_FILE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY = (ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_APPEND_DATA = (ARCHIVE_ENTRY_ACL_APPEND_DATA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_DELETE = (ARCHIVE_ENTRY_ACL_DELETE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_DELETE_CHILD = (ARCHIVE_ENTRY_ACL_DELETE_CHILD); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT = (ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS = (ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT = (ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_INHERITED = (ARCHIVE_ENTRY_ACL_ENTRY_INHERITED); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY = (ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT = (ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS = (ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_EVERYONE = (ARCHIVE_ENTRY_ACL_EVERYONE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_EXECUTE = (ARCHIVE_ENTRY_ACL_EXECUTE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_GROUP = (ARCHIVE_ENTRY_ACL_GROUP); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_GROUP_OBJ = (ARCHIVE_ENTRY_ACL_GROUP_OBJ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 = (ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_LIST_DIRECTORY = (ARCHIVE_ENTRY_ACL_LIST_DIRECTORY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_MASK = (ARCHIVE_ENTRY_ACL_MASK); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_OTHER = (ARCHIVE_ENTRY_ACL_OTHER); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_PERMS_NFS4 = (ARCHIVE_ENTRY_ACL_PERMS_NFS4); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_PERMS_POSIX1E = (ARCHIVE_ENTRY_ACL_PERMS_POSIX1E); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ = (ARCHIVE_ENTRY_ACL_READ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_ACL = (ARCHIVE_ENTRY_ACL_READ_ACL); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES = (ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_DATA = (ARCHIVE_ENTRY_ACL_READ_DATA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS = (ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_COMPACT = (ARCHIVE_ENTRY_ACL_STYLE_COMPACT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID = (ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT = (ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA = (ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_STYLE_SOLARIS = (ARCHIVE_ENTRY_ACL_STYLE_SOLARIS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_SYNCHRONIZE = (ARCHIVE_ENTRY_ACL_SYNCHRONIZE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_ACCESS = (ARCHIVE_ENTRY_ACL_TYPE_ACCESS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_ALARM = (ARCHIVE_ENTRY_ACL_TYPE_ALARM); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_ALLOW = (ARCHIVE_ENTRY_ACL_TYPE_ALLOW); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_AUDIT = (ARCHIVE_ENTRY_ACL_TYPE_AUDIT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_DEFAULT = (ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_DENY = (ARCHIVE_ENTRY_ACL_TYPE_DENY); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_NFS4 = (ARCHIVE_ENTRY_ACL_TYPE_NFS4); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_TYPE_POSIX1E = (ARCHIVE_ENTRY_ACL_TYPE_POSIX1E); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_USER = (ARCHIVE_ENTRY_ACL_USER); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_USER_OBJ = (ARCHIVE_ENTRY_ACL_USER_OBJ); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE = (ARCHIVE_ENTRY_ACL_WRITE); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_ACL = (ARCHIVE_ENTRY_ACL_WRITE_ACL); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES = (ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_DATA = (ARCHIVE_ENTRY_ACL_WRITE_DATA); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS = (ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS); +inline constexpr auto value_ARCHIVE_ENTRY_ACL_WRITE_OWNER = (ARCHIVE_ENTRY_ACL_WRITE_OWNER); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_MD5 = (ARCHIVE_ENTRY_DIGEST_MD5); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_RMD160 = (ARCHIVE_ENTRY_DIGEST_RMD160); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA1 = (ARCHIVE_ENTRY_DIGEST_SHA1); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA256 = (ARCHIVE_ENTRY_DIGEST_SHA256); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA384 = (ARCHIVE_ENTRY_DIGEST_SHA384); +inline constexpr auto value_ARCHIVE_ENTRY_DIGEST_SHA512 = (ARCHIVE_ENTRY_DIGEST_SHA512); +inline constexpr auto value_ARCHIVE_EOF = (ARCHIVE_EOF); +inline constexpr auto value_ARCHIVE_EXTRACT_ACL = (ARCHIVE_EXTRACT_ACL); +inline constexpr auto value_ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS = (ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS); +inline constexpr auto value_ARCHIVE_EXTRACT_FFLAGS = (ARCHIVE_EXTRACT_FFLAGS); +inline constexpr auto value_ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED = (ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED); +inline constexpr auto value_ARCHIVE_EXTRACT_MAC_METADATA = (ARCHIVE_EXTRACT_MAC_METADATA); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_AUTODIR = (ARCHIVE_EXTRACT_NO_AUTODIR); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_HFS_COMPRESSION = (ARCHIVE_EXTRACT_NO_HFS_COMPRESSION); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_OVERWRITE = (ARCHIVE_EXTRACT_NO_OVERWRITE); +inline constexpr auto value_ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER = (ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER); +inline constexpr auto value_ARCHIVE_EXTRACT_OWNER = (ARCHIVE_EXTRACT_OWNER); +inline constexpr auto value_ARCHIVE_EXTRACT_PERM = (ARCHIVE_EXTRACT_PERM); +inline constexpr auto value_ARCHIVE_EXTRACT_SAFE_WRITES = (ARCHIVE_EXTRACT_SAFE_WRITES); +inline constexpr auto value_ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS = (ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS); +inline constexpr auto value_ARCHIVE_EXTRACT_SECURE_NODOTDOT = (ARCHIVE_EXTRACT_SECURE_NODOTDOT); +inline constexpr auto value_ARCHIVE_EXTRACT_SECURE_SYMLINKS = (ARCHIVE_EXTRACT_SECURE_SYMLINKS); +inline constexpr auto value_ARCHIVE_EXTRACT_SPARSE = (ARCHIVE_EXTRACT_SPARSE); +inline constexpr auto value_ARCHIVE_EXTRACT_TIME = (ARCHIVE_EXTRACT_TIME); +inline constexpr auto value_ARCHIVE_EXTRACT_UNLINK = (ARCHIVE_EXTRACT_UNLINK); +inline constexpr auto value_ARCHIVE_EXTRACT_XATTR = (ARCHIVE_EXTRACT_XATTR); +inline constexpr auto value_ARCHIVE_FAILED = (ARCHIVE_FAILED); +inline constexpr auto value_ARCHIVE_FATAL = (ARCHIVE_FATAL); +inline constexpr auto value_ARCHIVE_FILTER_BZIP2 = (ARCHIVE_FILTER_BZIP2); +inline constexpr auto value_ARCHIVE_FILTER_COMPRESS = (ARCHIVE_FILTER_COMPRESS); +inline constexpr auto value_ARCHIVE_FILTER_GRZIP = (ARCHIVE_FILTER_GRZIP); +inline constexpr auto value_ARCHIVE_FILTER_GZIP = (ARCHIVE_FILTER_GZIP); +inline constexpr auto value_ARCHIVE_FILTER_LRZIP = (ARCHIVE_FILTER_LRZIP); +inline constexpr auto value_ARCHIVE_FILTER_LZ4 = (ARCHIVE_FILTER_LZ4); +inline constexpr auto value_ARCHIVE_FILTER_LZIP = (ARCHIVE_FILTER_LZIP); +inline constexpr auto value_ARCHIVE_FILTER_LZMA = (ARCHIVE_FILTER_LZMA); +inline constexpr auto value_ARCHIVE_FILTER_LZOP = (ARCHIVE_FILTER_LZOP); +inline constexpr auto value_ARCHIVE_FILTER_NONE = (ARCHIVE_FILTER_NONE); +inline constexpr auto value_ARCHIVE_FILTER_PROGRAM = (ARCHIVE_FILTER_PROGRAM); +inline constexpr auto value_ARCHIVE_FILTER_RPM = (ARCHIVE_FILTER_RPM); +inline constexpr auto value_ARCHIVE_FILTER_UU = (ARCHIVE_FILTER_UU); +inline constexpr auto value_ARCHIVE_FILTER_XZ = (ARCHIVE_FILTER_XZ); +inline constexpr auto value_ARCHIVE_FILTER_ZSTD = (ARCHIVE_FILTER_ZSTD); +inline constexpr auto value_ARCHIVE_FORMAT_7ZIP = (ARCHIVE_FORMAT_7ZIP); +inline constexpr auto value_ARCHIVE_FORMAT_AR = (ARCHIVE_FORMAT_AR); +inline constexpr auto value_ARCHIVE_FORMAT_AR_BSD = (ARCHIVE_FORMAT_AR_BSD); +inline constexpr auto value_ARCHIVE_FORMAT_AR_GNU = (ARCHIVE_FORMAT_AR_GNU); +inline constexpr auto value_ARCHIVE_FORMAT_BASE_MASK = (ARCHIVE_FORMAT_BASE_MASK); +inline constexpr auto value_ARCHIVE_FORMAT_CAB = (ARCHIVE_FORMAT_CAB); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO = (ARCHIVE_FORMAT_CPIO); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_AFIO_LARGE = (ARCHIVE_FORMAT_CPIO_AFIO_LARGE); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_BIN_BE = (ARCHIVE_FORMAT_CPIO_BIN_BE); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_BIN_LE = (ARCHIVE_FORMAT_CPIO_BIN_LE); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_POSIX = (ARCHIVE_FORMAT_CPIO_POSIX); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_PWB = (ARCHIVE_FORMAT_CPIO_PWB); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_SVR4_CRC = (ARCHIVE_FORMAT_CPIO_SVR4_CRC); +inline constexpr auto value_ARCHIVE_FORMAT_CPIO_SVR4_NOCRC = (ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); +inline constexpr auto value_ARCHIVE_FORMAT_EMPTY = (ARCHIVE_FORMAT_EMPTY); +inline constexpr auto value_ARCHIVE_FORMAT_ISO9660 = (ARCHIVE_FORMAT_ISO9660); +inline constexpr auto value_ARCHIVE_FORMAT_ISO9660_ROCKRIDGE = (ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); +inline constexpr auto value_ARCHIVE_FORMAT_LHA = (ARCHIVE_FORMAT_LHA); +inline constexpr auto value_ARCHIVE_FORMAT_MTREE = (ARCHIVE_FORMAT_MTREE); +inline constexpr auto value_ARCHIVE_FORMAT_RAR = (ARCHIVE_FORMAT_RAR); +inline constexpr auto value_ARCHIVE_FORMAT_RAR_V5 = (ARCHIVE_FORMAT_RAR_V5); +inline constexpr auto value_ARCHIVE_FORMAT_RAW = (ARCHIVE_FORMAT_RAW); +inline constexpr auto value_ARCHIVE_FORMAT_SHAR = (ARCHIVE_FORMAT_SHAR); +inline constexpr auto value_ARCHIVE_FORMAT_SHAR_BASE = (ARCHIVE_FORMAT_SHAR_BASE); +inline constexpr auto value_ARCHIVE_FORMAT_SHAR_DUMP = (ARCHIVE_FORMAT_SHAR_DUMP); +inline constexpr auto value_ARCHIVE_FORMAT_TAR = (ARCHIVE_FORMAT_TAR); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_GNUTAR = (ARCHIVE_FORMAT_TAR_GNUTAR); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE = (ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_PAX_RESTRICTED = (ARCHIVE_FORMAT_TAR_PAX_RESTRICTED); +inline constexpr auto value_ARCHIVE_FORMAT_TAR_USTAR = (ARCHIVE_FORMAT_TAR_USTAR); +inline constexpr auto value_ARCHIVE_FORMAT_WARC = (ARCHIVE_FORMAT_WARC); +inline constexpr auto value_ARCHIVE_FORMAT_XAR = (ARCHIVE_FORMAT_XAR); +inline constexpr auto value_ARCHIVE_FORMAT_ZIP = (ARCHIVE_FORMAT_ZIP); +inline constexpr auto value_ARCHIVE_MATCH_CTIME = (ARCHIVE_MATCH_CTIME); +inline constexpr auto value_ARCHIVE_MATCH_EQUAL = (ARCHIVE_MATCH_EQUAL); +inline constexpr auto value_ARCHIVE_MATCH_MTIME = (ARCHIVE_MATCH_MTIME); +inline constexpr auto value_ARCHIVE_MATCH_NEWER = (ARCHIVE_MATCH_NEWER); +inline constexpr auto value_ARCHIVE_MATCH_OLDER = (ARCHIVE_MATCH_OLDER); +inline constexpr auto value_ARCHIVE_OK = (ARCHIVE_OK); +inline constexpr auto value_ARCHIVE_READDISK_HONOR_NODUMP = (ARCHIVE_READDISK_HONOR_NODUMP); +inline constexpr auto value_ARCHIVE_READDISK_MAC_COPYFILE = (ARCHIVE_READDISK_MAC_COPYFILE); +inline constexpr auto value_ARCHIVE_READDISK_NO_ACL = (ARCHIVE_READDISK_NO_ACL); +inline constexpr auto value_ARCHIVE_READDISK_NO_FFLAGS = (ARCHIVE_READDISK_NO_FFLAGS); +inline constexpr auto value_ARCHIVE_READDISK_NO_SPARSE = (ARCHIVE_READDISK_NO_SPARSE); +inline constexpr auto value_ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS = (ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS); +inline constexpr auto value_ARCHIVE_READDISK_NO_XATTR = (ARCHIVE_READDISK_NO_XATTR); +inline constexpr auto value_ARCHIVE_READDISK_RESTORE_ATIME = (ARCHIVE_READDISK_RESTORE_ATIME); +inline constexpr auto value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA = (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA); +inline constexpr auto value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA = (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA); +inline constexpr auto value_ARCHIVE_READ_FORMAT_CAPS_NONE = (ARCHIVE_READ_FORMAT_CAPS_NONE); +inline constexpr auto value_ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW = (ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW); +inline constexpr auto value_ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED = (ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED); +inline constexpr auto value_ARCHIVE_RETRY = (ARCHIVE_RETRY); +inline constexpr auto value_ARCHIVE_VERSION_NUMBER = (ARCHIVE_VERSION_NUMBER); +inline constexpr auto value_ARCHIVE_VERSION_ONLY_STRING = (ARCHIVE_VERSION_ONLY_STRING); +inline constexpr auto value_ARCHIVE_VERSION_STRING = (ARCHIVE_VERSION_STRING); +inline constexpr auto value_ARCHIVE_WARN = (ARCHIVE_WARN); +inline constexpr auto value_OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID = (OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID); +inline constexpr auto value_OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT = (OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT); +} +#undef AE_IFBLK +#undef AE_IFCHR +#undef AE_IFDIR +#undef AE_IFIFO +#undef AE_IFLNK +#undef AE_IFMT +#undef AE_IFREG +#undef AE_IFSOCK +#undef AE_SYMLINK_TYPE_DIRECTORY +#undef AE_SYMLINK_TYPE_FILE +#undef AE_SYMLINK_TYPE_UNDEFINED +#undef ARCHIVE_COMPRESSION_BZIP2 +#undef ARCHIVE_COMPRESSION_COMPRESS +#undef ARCHIVE_COMPRESSION_GZIP +#undef ARCHIVE_COMPRESSION_LRZIP +#undef ARCHIVE_COMPRESSION_LZIP +#undef ARCHIVE_COMPRESSION_LZMA +#undef ARCHIVE_COMPRESSION_NONE +#undef ARCHIVE_COMPRESSION_PROGRAM +#undef ARCHIVE_COMPRESSION_RPM +#undef ARCHIVE_COMPRESSION_UU +#undef ARCHIVE_COMPRESSION_XZ +#undef ARCHIVE_ENTRY_ACL_ADD_FILE +#undef ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY +#undef ARCHIVE_ENTRY_ACL_APPEND_DATA +#undef ARCHIVE_ENTRY_ACL_DELETE +#undef ARCHIVE_ENTRY_ACL_DELETE_CHILD +#undef ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT +#undef ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS +#undef ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT +#undef ARCHIVE_ENTRY_ACL_ENTRY_INHERITED +#undef ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY +#undef ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT +#undef ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS +#undef ARCHIVE_ENTRY_ACL_EVERYONE +#undef ARCHIVE_ENTRY_ACL_EXECUTE +#undef ARCHIVE_ENTRY_ACL_GROUP +#undef ARCHIVE_ENTRY_ACL_GROUP_OBJ +#undef ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4 +#undef ARCHIVE_ENTRY_ACL_LIST_DIRECTORY +#undef ARCHIVE_ENTRY_ACL_MASK +#undef ARCHIVE_ENTRY_ACL_OTHER +#undef ARCHIVE_ENTRY_ACL_PERMS_NFS4 +#undef ARCHIVE_ENTRY_ACL_PERMS_POSIX1E +#undef ARCHIVE_ENTRY_ACL_READ +#undef ARCHIVE_ENTRY_ACL_READ_ACL +#undef ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES +#undef ARCHIVE_ENTRY_ACL_READ_DATA +#undef ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS +#undef ARCHIVE_ENTRY_ACL_STYLE_COMPACT +#undef ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID +#undef ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT +#undef ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA +#undef ARCHIVE_ENTRY_ACL_STYLE_SOLARIS +#undef ARCHIVE_ENTRY_ACL_SYNCHRONIZE +#undef ARCHIVE_ENTRY_ACL_TYPE_ACCESS +#undef ARCHIVE_ENTRY_ACL_TYPE_ALARM +#undef ARCHIVE_ENTRY_ACL_TYPE_ALLOW +#undef ARCHIVE_ENTRY_ACL_TYPE_AUDIT +#undef ARCHIVE_ENTRY_ACL_TYPE_DEFAULT +#undef ARCHIVE_ENTRY_ACL_TYPE_DENY +#undef ARCHIVE_ENTRY_ACL_TYPE_NFS4 +#undef ARCHIVE_ENTRY_ACL_TYPE_POSIX1E +#undef ARCHIVE_ENTRY_ACL_USER +#undef ARCHIVE_ENTRY_ACL_USER_OBJ +#undef ARCHIVE_ENTRY_ACL_WRITE +#undef ARCHIVE_ENTRY_ACL_WRITE_ACL +#undef ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES +#undef ARCHIVE_ENTRY_ACL_WRITE_DATA +#undef ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS +#undef ARCHIVE_ENTRY_ACL_WRITE_OWNER +#undef ARCHIVE_ENTRY_DIGEST_MD5 +#undef ARCHIVE_ENTRY_DIGEST_RMD160 +#undef ARCHIVE_ENTRY_DIGEST_SHA1 +#undef ARCHIVE_ENTRY_DIGEST_SHA256 +#undef ARCHIVE_ENTRY_DIGEST_SHA384 +#undef ARCHIVE_ENTRY_DIGEST_SHA512 +#undef ARCHIVE_EOF +#undef ARCHIVE_EXTRACT_ACL +#undef ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS +#undef ARCHIVE_EXTRACT_FFLAGS +#undef ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED +#undef ARCHIVE_EXTRACT_MAC_METADATA +#undef ARCHIVE_EXTRACT_NO_AUTODIR +#undef ARCHIVE_EXTRACT_NO_HFS_COMPRESSION +#undef ARCHIVE_EXTRACT_NO_OVERWRITE +#undef ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER +#undef ARCHIVE_EXTRACT_OWNER +#undef ARCHIVE_EXTRACT_PERM +#undef ARCHIVE_EXTRACT_SAFE_WRITES +#undef ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS +#undef ARCHIVE_EXTRACT_SECURE_NODOTDOT +#undef ARCHIVE_EXTRACT_SECURE_SYMLINKS +#undef ARCHIVE_EXTRACT_SPARSE +#undef ARCHIVE_EXTRACT_TIME +#undef ARCHIVE_EXTRACT_UNLINK +#undef ARCHIVE_EXTRACT_XATTR +#undef ARCHIVE_FAILED +#undef ARCHIVE_FATAL +#undef ARCHIVE_FILTER_BZIP2 +#undef ARCHIVE_FILTER_COMPRESS +#undef ARCHIVE_FILTER_GRZIP +#undef ARCHIVE_FILTER_GZIP +#undef ARCHIVE_FILTER_LRZIP +#undef ARCHIVE_FILTER_LZ4 +#undef ARCHIVE_FILTER_LZIP +#undef ARCHIVE_FILTER_LZMA +#undef ARCHIVE_FILTER_LZOP +#undef ARCHIVE_FILTER_NONE +#undef ARCHIVE_FILTER_PROGRAM +#undef ARCHIVE_FILTER_RPM +#undef ARCHIVE_FILTER_UU +#undef ARCHIVE_FILTER_XZ +#undef ARCHIVE_FILTER_ZSTD +#undef ARCHIVE_FORMAT_7ZIP +#undef ARCHIVE_FORMAT_AR +#undef ARCHIVE_FORMAT_AR_BSD +#undef ARCHIVE_FORMAT_AR_GNU +#undef ARCHIVE_FORMAT_BASE_MASK +#undef ARCHIVE_FORMAT_CAB +#undef ARCHIVE_FORMAT_CPIO +#undef ARCHIVE_FORMAT_CPIO_AFIO_LARGE +#undef ARCHIVE_FORMAT_CPIO_BIN_BE +#undef ARCHIVE_FORMAT_CPIO_BIN_LE +#undef ARCHIVE_FORMAT_CPIO_POSIX +#undef ARCHIVE_FORMAT_CPIO_PWB +#undef ARCHIVE_FORMAT_CPIO_SVR4_CRC +#undef ARCHIVE_FORMAT_CPIO_SVR4_NOCRC +#undef ARCHIVE_FORMAT_EMPTY +#undef ARCHIVE_FORMAT_ISO9660 +#undef ARCHIVE_FORMAT_ISO9660_ROCKRIDGE +#undef ARCHIVE_FORMAT_LHA +#undef ARCHIVE_FORMAT_MTREE +#undef ARCHIVE_FORMAT_RAR +#undef ARCHIVE_FORMAT_RAR_V5 +#undef ARCHIVE_FORMAT_RAW +#undef ARCHIVE_FORMAT_SHAR +#undef ARCHIVE_FORMAT_SHAR_BASE +#undef ARCHIVE_FORMAT_SHAR_DUMP +#undef ARCHIVE_FORMAT_TAR +#undef ARCHIVE_FORMAT_TAR_GNUTAR +#undef ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE +#undef ARCHIVE_FORMAT_TAR_PAX_RESTRICTED +#undef ARCHIVE_FORMAT_TAR_USTAR +#undef ARCHIVE_FORMAT_WARC +#undef ARCHIVE_FORMAT_XAR +#undef ARCHIVE_FORMAT_ZIP +#undef ARCHIVE_MATCH_CTIME +#undef ARCHIVE_MATCH_EQUAL +#undef ARCHIVE_MATCH_MTIME +#undef ARCHIVE_MATCH_NEWER +#undef ARCHIVE_MATCH_OLDER +#undef ARCHIVE_OK +#undef ARCHIVE_READDISK_HONOR_NODUMP +#undef ARCHIVE_READDISK_MAC_COPYFILE +#undef ARCHIVE_READDISK_NO_ACL +#undef ARCHIVE_READDISK_NO_FFLAGS +#undef ARCHIVE_READDISK_NO_SPARSE +#undef ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS +#undef ARCHIVE_READDISK_NO_XATTR +#undef ARCHIVE_READDISK_RESTORE_ATIME +#undef ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA +#undef ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA +#undef ARCHIVE_READ_FORMAT_CAPS_NONE +#undef ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW +#undef ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED +#undef ARCHIVE_RETRY +#undef ARCHIVE_VERSION_NUMBER +#undef ARCHIVE_VERSION_ONLY_STRING +#undef ARCHIVE_VERSION_STRING +#undef ARCHIVE_WARN +#undef OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID +#undef OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT + +import std; +import mcpplibs.mwrap.libarchive.macros; + +namespace m = mcpplibs::mwrap::libarchive::macros; + + +template +bool same(A a, B b) +{ + if constexpr (std::is_convertible_v && std::is_convertible_v) + return std::string_view(a) == std::string_view(b); + else + return a == b; +} + +int main() +{ + int differ = 0; + if (!same(m::AE_IFBLK, header::value_AE_IFBLK)) { std::println("FAIL AE_IFBLK"); ++differ; } + if (!same(m::AE_IFCHR, header::value_AE_IFCHR)) { std::println("FAIL AE_IFCHR"); ++differ; } + if (!same(m::AE_IFDIR, header::value_AE_IFDIR)) { std::println("FAIL AE_IFDIR"); ++differ; } + if (!same(m::AE_IFIFO, header::value_AE_IFIFO)) { std::println("FAIL AE_IFIFO"); ++differ; } + if (!same(m::AE_IFLNK, header::value_AE_IFLNK)) { std::println("FAIL AE_IFLNK"); ++differ; } + if (!same(m::AE_IFMT, header::value_AE_IFMT)) { std::println("FAIL AE_IFMT"); ++differ; } + if (!same(m::AE_IFREG, header::value_AE_IFREG)) { std::println("FAIL AE_IFREG"); ++differ; } + if (!same(m::AE_IFSOCK, header::value_AE_IFSOCK)) { std::println("FAIL AE_IFSOCK"); ++differ; } + if (!same(m::AE_SYMLINK_TYPE_DIRECTORY, header::value_AE_SYMLINK_TYPE_DIRECTORY)) { std::println("FAIL AE_SYMLINK_TYPE_DIRECTORY"); ++differ; } + if (!same(m::AE_SYMLINK_TYPE_FILE, header::value_AE_SYMLINK_TYPE_FILE)) { std::println("FAIL AE_SYMLINK_TYPE_FILE"); ++differ; } + if (!same(m::AE_SYMLINK_TYPE_UNDEFINED, header::value_AE_SYMLINK_TYPE_UNDEFINED)) { std::println("FAIL AE_SYMLINK_TYPE_UNDEFINED"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_BZIP2, header::value_ARCHIVE_COMPRESSION_BZIP2)) { std::println("FAIL ARCHIVE_COMPRESSION_BZIP2"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_COMPRESS, header::value_ARCHIVE_COMPRESSION_COMPRESS)) { std::println("FAIL ARCHIVE_COMPRESSION_COMPRESS"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_GZIP, header::value_ARCHIVE_COMPRESSION_GZIP)) { std::println("FAIL ARCHIVE_COMPRESSION_GZIP"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_LRZIP, header::value_ARCHIVE_COMPRESSION_LRZIP)) { std::println("FAIL ARCHIVE_COMPRESSION_LRZIP"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_LZIP, header::value_ARCHIVE_COMPRESSION_LZIP)) { std::println("FAIL ARCHIVE_COMPRESSION_LZIP"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_LZMA, header::value_ARCHIVE_COMPRESSION_LZMA)) { std::println("FAIL ARCHIVE_COMPRESSION_LZMA"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_NONE, header::value_ARCHIVE_COMPRESSION_NONE)) { std::println("FAIL ARCHIVE_COMPRESSION_NONE"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_PROGRAM, header::value_ARCHIVE_COMPRESSION_PROGRAM)) { std::println("FAIL ARCHIVE_COMPRESSION_PROGRAM"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_RPM, header::value_ARCHIVE_COMPRESSION_RPM)) { std::println("FAIL ARCHIVE_COMPRESSION_RPM"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_UU, header::value_ARCHIVE_COMPRESSION_UU)) { std::println("FAIL ARCHIVE_COMPRESSION_UU"); ++differ; } + if (!same(m::ARCHIVE_COMPRESSION_XZ, header::value_ARCHIVE_COMPRESSION_XZ)) { std::println("FAIL ARCHIVE_COMPRESSION_XZ"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ADD_FILE, header::value_ARCHIVE_ENTRY_ACL_ADD_FILE)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ADD_FILE"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, header::value_ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_APPEND_DATA, header::value_ARCHIVE_ENTRY_ACL_APPEND_DATA)) { std::println("FAIL ARCHIVE_ENTRY_ACL_APPEND_DATA"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_DELETE, header::value_ARCHIVE_ENTRY_ACL_DELETE)) { std::println("FAIL ARCHIVE_ENTRY_ACL_DELETE"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_DELETE_CHILD, header::value_ARCHIVE_ENTRY_ACL_DELETE_CHILD)) { std::println("FAIL ARCHIVE_ENTRY_ACL_DELETE_CHILD"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, header::value_ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, header::value_ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, header::value_ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, header::value_ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ENTRY_INHERITED"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, header::value_ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, header::value_ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, header::value_ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS)) { std::println("FAIL ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_EVERYONE, header::value_ARCHIVE_ENTRY_ACL_EVERYONE)) { std::println("FAIL ARCHIVE_ENTRY_ACL_EVERYONE"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_EXECUTE, header::value_ARCHIVE_ENTRY_ACL_EXECUTE)) { std::println("FAIL ARCHIVE_ENTRY_ACL_EXECUTE"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_GROUP, header::value_ARCHIVE_ENTRY_ACL_GROUP)) { std::println("FAIL ARCHIVE_ENTRY_ACL_GROUP"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_GROUP_OBJ, header::value_ARCHIVE_ENTRY_ACL_GROUP_OBJ)) { std::println("FAIL ARCHIVE_ENTRY_ACL_GROUP_OBJ"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4, header::value_ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) { std::println("FAIL ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, header::value_ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) { std::println("FAIL ARCHIVE_ENTRY_ACL_LIST_DIRECTORY"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_MASK, header::value_ARCHIVE_ENTRY_ACL_MASK)) { std::println("FAIL ARCHIVE_ENTRY_ACL_MASK"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_OTHER, header::value_ARCHIVE_ENTRY_ACL_OTHER)) { std::println("FAIL ARCHIVE_ENTRY_ACL_OTHER"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_PERMS_NFS4, header::value_ARCHIVE_ENTRY_ACL_PERMS_NFS4)) { std::println("FAIL ARCHIVE_ENTRY_ACL_PERMS_NFS4"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_PERMS_POSIX1E, header::value_ARCHIVE_ENTRY_ACL_PERMS_POSIX1E)) { std::println("FAIL ARCHIVE_ENTRY_ACL_PERMS_POSIX1E"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_READ, header::value_ARCHIVE_ENTRY_ACL_READ)) { std::println("FAIL ARCHIVE_ENTRY_ACL_READ"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_READ_ACL, header::value_ARCHIVE_ENTRY_ACL_READ_ACL)) { std::println("FAIL ARCHIVE_ENTRY_ACL_READ_ACL"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, header::value_ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES)) { std::println("FAIL ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_READ_DATA, header::value_ARCHIVE_ENTRY_ACL_READ_DATA)) { std::println("FAIL ARCHIVE_ENTRY_ACL_READ_DATA"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, header::value_ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS)) { std::println("FAIL ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_STYLE_COMPACT, header::value_ARCHIVE_ENTRY_ACL_STYLE_COMPACT)) { std::println("FAIL ARCHIVE_ENTRY_ACL_STYLE_COMPACT"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, header::value_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { std::println("FAIL ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT, header::value_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT)) { std::println("FAIL ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA, header::value_ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA)) { std::println("FAIL ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_STYLE_SOLARIS, header::value_ARCHIVE_ENTRY_ACL_STYLE_SOLARIS)) { std::println("FAIL ARCHIVE_ENTRY_ACL_STYLE_SOLARIS"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_SYNCHRONIZE, header::value_ARCHIVE_ENTRY_ACL_SYNCHRONIZE)) { std::println("FAIL ARCHIVE_ENTRY_ACL_SYNCHRONIZE"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_ACCESS, header::value_ARCHIVE_ENTRY_ACL_TYPE_ACCESS)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_ACCESS"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_ALARM, header::value_ARCHIVE_ENTRY_ACL_TYPE_ALARM)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_ALARM"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_ALLOW, header::value_ARCHIVE_ENTRY_ACL_TYPE_ALLOW)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_ALLOW"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_AUDIT, header::value_ARCHIVE_ENTRY_ACL_TYPE_AUDIT)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_AUDIT"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, header::value_ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_DEFAULT"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_DENY, header::value_ARCHIVE_ENTRY_ACL_TYPE_DENY)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_DENY"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_NFS4, header::value_ARCHIVE_ENTRY_ACL_TYPE_NFS4)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_NFS4"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, header::value_ARCHIVE_ENTRY_ACL_TYPE_POSIX1E)) { std::println("FAIL ARCHIVE_ENTRY_ACL_TYPE_POSIX1E"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_USER, header::value_ARCHIVE_ENTRY_ACL_USER)) { std::println("FAIL ARCHIVE_ENTRY_ACL_USER"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_USER_OBJ, header::value_ARCHIVE_ENTRY_ACL_USER_OBJ)) { std::println("FAIL ARCHIVE_ENTRY_ACL_USER_OBJ"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_WRITE, header::value_ARCHIVE_ENTRY_ACL_WRITE)) { std::println("FAIL ARCHIVE_ENTRY_ACL_WRITE"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_WRITE_ACL, header::value_ARCHIVE_ENTRY_ACL_WRITE_ACL)) { std::println("FAIL ARCHIVE_ENTRY_ACL_WRITE_ACL"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, header::value_ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES)) { std::println("FAIL ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_WRITE_DATA, header::value_ARCHIVE_ENTRY_ACL_WRITE_DATA)) { std::println("FAIL ARCHIVE_ENTRY_ACL_WRITE_DATA"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, header::value_ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS)) { std::println("FAIL ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_ACL_WRITE_OWNER, header::value_ARCHIVE_ENTRY_ACL_WRITE_OWNER)) { std::println("FAIL ARCHIVE_ENTRY_ACL_WRITE_OWNER"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_DIGEST_MD5, header::value_ARCHIVE_ENTRY_DIGEST_MD5)) { std::println("FAIL ARCHIVE_ENTRY_DIGEST_MD5"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_DIGEST_RMD160, header::value_ARCHIVE_ENTRY_DIGEST_RMD160)) { std::println("FAIL ARCHIVE_ENTRY_DIGEST_RMD160"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_DIGEST_SHA1, header::value_ARCHIVE_ENTRY_DIGEST_SHA1)) { std::println("FAIL ARCHIVE_ENTRY_DIGEST_SHA1"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_DIGEST_SHA256, header::value_ARCHIVE_ENTRY_DIGEST_SHA256)) { std::println("FAIL ARCHIVE_ENTRY_DIGEST_SHA256"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_DIGEST_SHA384, header::value_ARCHIVE_ENTRY_DIGEST_SHA384)) { std::println("FAIL ARCHIVE_ENTRY_DIGEST_SHA384"); ++differ; } + if (!same(m::ARCHIVE_ENTRY_DIGEST_SHA512, header::value_ARCHIVE_ENTRY_DIGEST_SHA512)) { std::println("FAIL ARCHIVE_ENTRY_DIGEST_SHA512"); ++differ; } + if (!same(m::ARCHIVE_EOF, header::value_ARCHIVE_EOF)) { std::println("FAIL ARCHIVE_EOF"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_ACL, header::value_ARCHIVE_EXTRACT_ACL)) { std::println("FAIL ARCHIVE_EXTRACT_ACL"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS, header::value_ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS)) { std::println("FAIL ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_FFLAGS, header::value_ARCHIVE_EXTRACT_FFLAGS)) { std::println("FAIL ARCHIVE_EXTRACT_FFLAGS"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED, header::value_ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED)) { std::println("FAIL ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_MAC_METADATA, header::value_ARCHIVE_EXTRACT_MAC_METADATA)) { std::println("FAIL ARCHIVE_EXTRACT_MAC_METADATA"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_NO_AUTODIR, header::value_ARCHIVE_EXTRACT_NO_AUTODIR)) { std::println("FAIL ARCHIVE_EXTRACT_NO_AUTODIR"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_NO_HFS_COMPRESSION, header::value_ARCHIVE_EXTRACT_NO_HFS_COMPRESSION)) { std::println("FAIL ARCHIVE_EXTRACT_NO_HFS_COMPRESSION"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_NO_OVERWRITE, header::value_ARCHIVE_EXTRACT_NO_OVERWRITE)) { std::println("FAIL ARCHIVE_EXTRACT_NO_OVERWRITE"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER, header::value_ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER)) { std::println("FAIL ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_OWNER, header::value_ARCHIVE_EXTRACT_OWNER)) { std::println("FAIL ARCHIVE_EXTRACT_OWNER"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_PERM, header::value_ARCHIVE_EXTRACT_PERM)) { std::println("FAIL ARCHIVE_EXTRACT_PERM"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_SAFE_WRITES, header::value_ARCHIVE_EXTRACT_SAFE_WRITES)) { std::println("FAIL ARCHIVE_EXTRACT_SAFE_WRITES"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS, header::value_ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS)) { std::println("FAIL ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_SECURE_NODOTDOT, header::value_ARCHIVE_EXTRACT_SECURE_NODOTDOT)) { std::println("FAIL ARCHIVE_EXTRACT_SECURE_NODOTDOT"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_SECURE_SYMLINKS, header::value_ARCHIVE_EXTRACT_SECURE_SYMLINKS)) { std::println("FAIL ARCHIVE_EXTRACT_SECURE_SYMLINKS"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_SPARSE, header::value_ARCHIVE_EXTRACT_SPARSE)) { std::println("FAIL ARCHIVE_EXTRACT_SPARSE"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_TIME, header::value_ARCHIVE_EXTRACT_TIME)) { std::println("FAIL ARCHIVE_EXTRACT_TIME"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_UNLINK, header::value_ARCHIVE_EXTRACT_UNLINK)) { std::println("FAIL ARCHIVE_EXTRACT_UNLINK"); ++differ; } + if (!same(m::ARCHIVE_EXTRACT_XATTR, header::value_ARCHIVE_EXTRACT_XATTR)) { std::println("FAIL ARCHIVE_EXTRACT_XATTR"); ++differ; } + if (!same(m::ARCHIVE_FAILED, header::value_ARCHIVE_FAILED)) { std::println("FAIL ARCHIVE_FAILED"); ++differ; } + if (!same(m::ARCHIVE_FATAL, header::value_ARCHIVE_FATAL)) { std::println("FAIL ARCHIVE_FATAL"); ++differ; } + if (!same(m::ARCHIVE_FILTER_BZIP2, header::value_ARCHIVE_FILTER_BZIP2)) { std::println("FAIL ARCHIVE_FILTER_BZIP2"); ++differ; } + if (!same(m::ARCHIVE_FILTER_COMPRESS, header::value_ARCHIVE_FILTER_COMPRESS)) { std::println("FAIL ARCHIVE_FILTER_COMPRESS"); ++differ; } + if (!same(m::ARCHIVE_FILTER_GRZIP, header::value_ARCHIVE_FILTER_GRZIP)) { std::println("FAIL ARCHIVE_FILTER_GRZIP"); ++differ; } + if (!same(m::ARCHIVE_FILTER_GZIP, header::value_ARCHIVE_FILTER_GZIP)) { std::println("FAIL ARCHIVE_FILTER_GZIP"); ++differ; } + if (!same(m::ARCHIVE_FILTER_LRZIP, header::value_ARCHIVE_FILTER_LRZIP)) { std::println("FAIL ARCHIVE_FILTER_LRZIP"); ++differ; } + if (!same(m::ARCHIVE_FILTER_LZ4, header::value_ARCHIVE_FILTER_LZ4)) { std::println("FAIL ARCHIVE_FILTER_LZ4"); ++differ; } + if (!same(m::ARCHIVE_FILTER_LZIP, header::value_ARCHIVE_FILTER_LZIP)) { std::println("FAIL ARCHIVE_FILTER_LZIP"); ++differ; } + if (!same(m::ARCHIVE_FILTER_LZMA, header::value_ARCHIVE_FILTER_LZMA)) { std::println("FAIL ARCHIVE_FILTER_LZMA"); ++differ; } + if (!same(m::ARCHIVE_FILTER_LZOP, header::value_ARCHIVE_FILTER_LZOP)) { std::println("FAIL ARCHIVE_FILTER_LZOP"); ++differ; } + if (!same(m::ARCHIVE_FILTER_NONE, header::value_ARCHIVE_FILTER_NONE)) { std::println("FAIL ARCHIVE_FILTER_NONE"); ++differ; } + if (!same(m::ARCHIVE_FILTER_PROGRAM, header::value_ARCHIVE_FILTER_PROGRAM)) { std::println("FAIL ARCHIVE_FILTER_PROGRAM"); ++differ; } + if (!same(m::ARCHIVE_FILTER_RPM, header::value_ARCHIVE_FILTER_RPM)) { std::println("FAIL ARCHIVE_FILTER_RPM"); ++differ; } + if (!same(m::ARCHIVE_FILTER_UU, header::value_ARCHIVE_FILTER_UU)) { std::println("FAIL ARCHIVE_FILTER_UU"); ++differ; } + if (!same(m::ARCHIVE_FILTER_XZ, header::value_ARCHIVE_FILTER_XZ)) { std::println("FAIL ARCHIVE_FILTER_XZ"); ++differ; } + if (!same(m::ARCHIVE_FILTER_ZSTD, header::value_ARCHIVE_FILTER_ZSTD)) { std::println("FAIL ARCHIVE_FILTER_ZSTD"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_7ZIP, header::value_ARCHIVE_FORMAT_7ZIP)) { std::println("FAIL ARCHIVE_FORMAT_7ZIP"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_AR, header::value_ARCHIVE_FORMAT_AR)) { std::println("FAIL ARCHIVE_FORMAT_AR"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_AR_BSD, header::value_ARCHIVE_FORMAT_AR_BSD)) { std::println("FAIL ARCHIVE_FORMAT_AR_BSD"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_AR_GNU, header::value_ARCHIVE_FORMAT_AR_GNU)) { std::println("FAIL ARCHIVE_FORMAT_AR_GNU"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_BASE_MASK, header::value_ARCHIVE_FORMAT_BASE_MASK)) { std::println("FAIL ARCHIVE_FORMAT_BASE_MASK"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CAB, header::value_ARCHIVE_FORMAT_CAB)) { std::println("FAIL ARCHIVE_FORMAT_CAB"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO, header::value_ARCHIVE_FORMAT_CPIO)) { std::println("FAIL ARCHIVE_FORMAT_CPIO"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO_AFIO_LARGE, header::value_ARCHIVE_FORMAT_CPIO_AFIO_LARGE)) { std::println("FAIL ARCHIVE_FORMAT_CPIO_AFIO_LARGE"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO_BIN_BE, header::value_ARCHIVE_FORMAT_CPIO_BIN_BE)) { std::println("FAIL ARCHIVE_FORMAT_CPIO_BIN_BE"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO_BIN_LE, header::value_ARCHIVE_FORMAT_CPIO_BIN_LE)) { std::println("FAIL ARCHIVE_FORMAT_CPIO_BIN_LE"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO_POSIX, header::value_ARCHIVE_FORMAT_CPIO_POSIX)) { std::println("FAIL ARCHIVE_FORMAT_CPIO_POSIX"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO_PWB, header::value_ARCHIVE_FORMAT_CPIO_PWB)) { std::println("FAIL ARCHIVE_FORMAT_CPIO_PWB"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO_SVR4_CRC, header::value_ARCHIVE_FORMAT_CPIO_SVR4_CRC)) { std::println("FAIL ARCHIVE_FORMAT_CPIO_SVR4_CRC"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_CPIO_SVR4_NOCRC, header::value_ARCHIVE_FORMAT_CPIO_SVR4_NOCRC)) { std::println("FAIL ARCHIVE_FORMAT_CPIO_SVR4_NOCRC"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_EMPTY, header::value_ARCHIVE_FORMAT_EMPTY)) { std::println("FAIL ARCHIVE_FORMAT_EMPTY"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_ISO9660, header::value_ARCHIVE_FORMAT_ISO9660)) { std::println("FAIL ARCHIVE_FORMAT_ISO9660"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_ISO9660_ROCKRIDGE, header::value_ARCHIVE_FORMAT_ISO9660_ROCKRIDGE)) { std::println("FAIL ARCHIVE_FORMAT_ISO9660_ROCKRIDGE"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_LHA, header::value_ARCHIVE_FORMAT_LHA)) { std::println("FAIL ARCHIVE_FORMAT_LHA"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_MTREE, header::value_ARCHIVE_FORMAT_MTREE)) { std::println("FAIL ARCHIVE_FORMAT_MTREE"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_RAR, header::value_ARCHIVE_FORMAT_RAR)) { std::println("FAIL ARCHIVE_FORMAT_RAR"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_RAR_V5, header::value_ARCHIVE_FORMAT_RAR_V5)) { std::println("FAIL ARCHIVE_FORMAT_RAR_V5"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_RAW, header::value_ARCHIVE_FORMAT_RAW)) { std::println("FAIL ARCHIVE_FORMAT_RAW"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_SHAR, header::value_ARCHIVE_FORMAT_SHAR)) { std::println("FAIL ARCHIVE_FORMAT_SHAR"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_SHAR_BASE, header::value_ARCHIVE_FORMAT_SHAR_BASE)) { std::println("FAIL ARCHIVE_FORMAT_SHAR_BASE"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_SHAR_DUMP, header::value_ARCHIVE_FORMAT_SHAR_DUMP)) { std::println("FAIL ARCHIVE_FORMAT_SHAR_DUMP"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_TAR, header::value_ARCHIVE_FORMAT_TAR)) { std::println("FAIL ARCHIVE_FORMAT_TAR"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_TAR_GNUTAR, header::value_ARCHIVE_FORMAT_TAR_GNUTAR)) { std::println("FAIL ARCHIVE_FORMAT_TAR_GNUTAR"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE, header::value_ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE)) { std::println("FAIL ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_TAR_PAX_RESTRICTED, header::value_ARCHIVE_FORMAT_TAR_PAX_RESTRICTED)) { std::println("FAIL ARCHIVE_FORMAT_TAR_PAX_RESTRICTED"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_TAR_USTAR, header::value_ARCHIVE_FORMAT_TAR_USTAR)) { std::println("FAIL ARCHIVE_FORMAT_TAR_USTAR"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_WARC, header::value_ARCHIVE_FORMAT_WARC)) { std::println("FAIL ARCHIVE_FORMAT_WARC"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_XAR, header::value_ARCHIVE_FORMAT_XAR)) { std::println("FAIL ARCHIVE_FORMAT_XAR"); ++differ; } + if (!same(m::ARCHIVE_FORMAT_ZIP, header::value_ARCHIVE_FORMAT_ZIP)) { std::println("FAIL ARCHIVE_FORMAT_ZIP"); ++differ; } + if (!same(m::ARCHIVE_MATCH_CTIME, header::value_ARCHIVE_MATCH_CTIME)) { std::println("FAIL ARCHIVE_MATCH_CTIME"); ++differ; } + if (!same(m::ARCHIVE_MATCH_EQUAL, header::value_ARCHIVE_MATCH_EQUAL)) { std::println("FAIL ARCHIVE_MATCH_EQUAL"); ++differ; } + if (!same(m::ARCHIVE_MATCH_MTIME, header::value_ARCHIVE_MATCH_MTIME)) { std::println("FAIL ARCHIVE_MATCH_MTIME"); ++differ; } + if (!same(m::ARCHIVE_MATCH_NEWER, header::value_ARCHIVE_MATCH_NEWER)) { std::println("FAIL ARCHIVE_MATCH_NEWER"); ++differ; } + if (!same(m::ARCHIVE_MATCH_OLDER, header::value_ARCHIVE_MATCH_OLDER)) { std::println("FAIL ARCHIVE_MATCH_OLDER"); ++differ; } + if (!same(m::ARCHIVE_OK, header::value_ARCHIVE_OK)) { std::println("FAIL ARCHIVE_OK"); ++differ; } + if (!same(m::ARCHIVE_READDISK_HONOR_NODUMP, header::value_ARCHIVE_READDISK_HONOR_NODUMP)) { std::println("FAIL ARCHIVE_READDISK_HONOR_NODUMP"); ++differ; } + if (!same(m::ARCHIVE_READDISK_MAC_COPYFILE, header::value_ARCHIVE_READDISK_MAC_COPYFILE)) { std::println("FAIL ARCHIVE_READDISK_MAC_COPYFILE"); ++differ; } + if (!same(m::ARCHIVE_READDISK_NO_ACL, header::value_ARCHIVE_READDISK_NO_ACL)) { std::println("FAIL ARCHIVE_READDISK_NO_ACL"); ++differ; } + if (!same(m::ARCHIVE_READDISK_NO_FFLAGS, header::value_ARCHIVE_READDISK_NO_FFLAGS)) { std::println("FAIL ARCHIVE_READDISK_NO_FFLAGS"); ++differ; } + if (!same(m::ARCHIVE_READDISK_NO_SPARSE, header::value_ARCHIVE_READDISK_NO_SPARSE)) { std::println("FAIL ARCHIVE_READDISK_NO_SPARSE"); ++differ; } + if (!same(m::ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS, header::value_ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS)) { std::println("FAIL ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS"); ++differ; } + if (!same(m::ARCHIVE_READDISK_NO_XATTR, header::value_ARCHIVE_READDISK_NO_XATTR)) { std::println("FAIL ARCHIVE_READDISK_NO_XATTR"); ++differ; } + if (!same(m::ARCHIVE_READDISK_RESTORE_ATIME, header::value_ARCHIVE_READDISK_RESTORE_ATIME)) { std::println("FAIL ARCHIVE_READDISK_RESTORE_ATIME"); ++differ; } + if (!same(m::ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA, header::value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA)) { std::println("FAIL ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA"); ++differ; } + if (!same(m::ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA, header::value_ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA)) { std::println("FAIL ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA"); ++differ; } + if (!same(m::ARCHIVE_READ_FORMAT_CAPS_NONE, header::value_ARCHIVE_READ_FORMAT_CAPS_NONE)) { std::println("FAIL ARCHIVE_READ_FORMAT_CAPS_NONE"); ++differ; } + if (!same(m::ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW, header::value_ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)) { std::println("FAIL ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW"); ++differ; } + if (!same(m::ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED, header::value_ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED)) { std::println("FAIL ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED"); ++differ; } + if (!same(m::ARCHIVE_RETRY, header::value_ARCHIVE_RETRY)) { std::println("FAIL ARCHIVE_RETRY"); ++differ; } + if (!same(m::ARCHIVE_VERSION_NUMBER, header::value_ARCHIVE_VERSION_NUMBER)) { std::println("FAIL ARCHIVE_VERSION_NUMBER"); ++differ; } + if (!same(m::ARCHIVE_VERSION_ONLY_STRING, header::value_ARCHIVE_VERSION_ONLY_STRING)) { std::println("FAIL ARCHIVE_VERSION_ONLY_STRING"); ++differ; } + if (!same(m::ARCHIVE_VERSION_STRING, header::value_ARCHIVE_VERSION_STRING)) { std::println("FAIL ARCHIVE_VERSION_STRING"); ++differ; } + if (!same(m::ARCHIVE_WARN, header::value_ARCHIVE_WARN)) { std::println("FAIL ARCHIVE_WARN"); ++differ; } + if (!same(m::OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, header::value_OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) { std::println("FAIL OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID"); ++differ; } + if (!same(m::OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT, header::value_OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT)) { std::println("FAIL OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT"); ++differ; } + std::println("173 constants and 0 types compared, {} differ", differ); + return differ != 0; +} diff --git a/tools/api.py b/tools/api.py new file mode 100644 index 0000000..1ee5ff8 --- /dev/null +++ b/tools/api.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python3 +"""The public API of a set of C headers, as the compiler reads them. + +`extract` returns the functions, variables, types and enumerators that the +owned headers declare, and the macros that they define, as the compiler's AST and +preprocessor see them in a C++23 translation unit including the headers. +`constant_macros` and `type_macros` select the object-like macros whose +expansion is a constant expression or a type. tools/generate.py writes the +module from these sets and audits it against them. +""" +import json +from pathlib import Path +import re +import subprocess + + +def _run(cmd, stdin): + return subprocess.run(cmd, input=stdin, capture_output=True, text=True, check=True).stdout + + +def _owned(path, owned): + path = path.replace('\\', '/') + return any(path == name or path.endswith('/' + name) for name in owned) + + +def extract(compiler, flags, headers, owned=None): + """`flags`: the compiler's include, define and target flags for the module; + `owned`: the header files whose declarations are the API (default: `headers`).""" + owned = list(owned or headers) + source = ''.join(f'#include <{h}>\n' for h in headers) + flags = ['-x', 'c++', '-std=c++23', *flags] + ast = json.loads(_run([compiler, *flags, '-fsyntax-only', '-Xclang', '-ast-dump=json', '-'], source)) + api = {'functions': set(), 'internal': set(), 'variables': set(), 'types': set(), 'enumerators': set()} + current = [''] + + def mine(node): + # The AST names a file only where it changes from the previous node. + loc = node.get('loc', {}) + for where in (loc, loc.get('spellingLoc', {}), loc.get('expansionLoc', {})): + if 'file' in where: + current[0] = where['file'] + return _owned(current[0], owned) + + def walk(nodes): + for node in nodes: + kind = node.get('kind') + if kind == 'LinkageSpecDecl': + mine(node) + walk(node.get('inner', [])) + continue + if not mine(node) or node.get('isImplicit'): + continue + name = node.get('name') + if kind == 'EnumDecl': + api['enumerators'] |= {e['name'] for e in node.get('inner', []) if e.get('kind') == 'EnumConstantDecl'} + if not name: + continue + if kind == 'FunctionDecl': + api['internal' if node.get('storageClass') == 'static' else 'functions'].add(name) + elif kind == 'VarDecl' and node.get('storageClass') == 'extern': + api['variables'].add(name) + elif kind in ('TypedefDecl', 'TypeAliasDecl', 'RecordDecl', 'CXXRecordDecl', 'EnumDecl'): + api['types'].add(name) + walk(ast.get('inner', [])) + api['functions'] -= api['internal'] + + macros = {} + current = '' + for line in _run([compiler, *flags, '-E', '-dD', '-'], source).splitlines(): + marker = re.match(r'#\s*(?:line\s+)?\d+\s+"([^"]*)"', line) + if marker: + current = marker.group(1) + continue + define = re.match(r'#define\s+([A-Za-z_][A-Za-z_0-9]*)(\([^)]*\))?\s*(.*)$', line) + if define and _owned(current, owned): + macros[define.group(1)] = {'params': define.group(2), 'body': define.group(3).strip(), 'file': current} + undefine = re.match(r'#undef\s+([A-Za-z_][A-Za-z_0-9]*)', line) + if undefine: + macros.pop(undefine.group(1), None) + return api, macros + + +def guards(macros): + """The include guards among `macros`. An empty macro that the first + conditional directive of its file tests (`#ifndef G` or `#if !defined(G)`), + or a macro named like a guard (`..._H`, `..._H_`, `..._INCLUDED`) + that its file defines right after `#ifndef G`.""" + found = set() + for name, macro in macros.items(): + if macro['params'] is not None: + continue + try: + text = Path(macro['file']).read_text(encoding='utf-8', errors='replace') + except OSError: + continue + text = re.sub(r'/\*.*?\*/', ' ', text, flags=re.S) + first = re.search(r'^\s*#\s*if.*$', text, flags=re.M) + tested_first = first and re.fullmatch( + r'\s*#\s*(?:ifndef\s+' + name + r'|if\s+!\s*defined\s*\(?\s*' + name + r'\s*\)?)\s*', first.group(0)) + named = re.search(r'_H(?:_\w+)?$|_INCLUDED$', name) and re.search( + r'^\s*#\s*ifndef\s+' + name + r'\s*\n\s*#\s*define\s+' + name + r'\b', text, flags=re.M) + if (tested_first and not macro['body']) or named: + found.add(name) + return found + + +def _accepted(compiler, flags, headers, names, form): + """The names for which `form` (with {i} and {n}) compiles after the headers: + one translation unit, dropping the lines with an error until none remain.""" + head = ''.join(f'#include <{h}>\n' for h in headers) + pending = sorted(names) + while pending: + probe = head + '#line 1 "mwrap-probe"\n' + ''.join(form.format(i=i, n=n) + '\n' for i, n in enumerate(pending)) + result = subprocess.run([compiler, '-x', 'c++', '-std=c++23', *flags, '-fsyntax-only', '-ferror-limit=0', '-'], + input=probe, capture_output=True, text=True) + if result.returncode == 0: + return set(pending) + bad = {int(m.group(1)) - 1 for m in re.finditer(r'mwrap-probe:(\d+):\d+: error', result.stderr)} + if not bad: + raise RuntimeError(result.stderr[-2000:]) + pending = [n for i, n in enumerate(pending) if i not in bad] + return set() + + +def constant_macros(compiler, flags, headers, macros): + """The object-like macros among `macros` whose expansion is a constant expression.""" + names = [n for n, m in macros.items() if m['params'] is None and m['body']] + return _accepted(compiler, flags, headers, names, 'inline constexpr auto mwrap_probe_{i} = ({n});') + + +def type_macros(compiler, flags, headers, macros): + """The object-like macros among `macros` whose expansion is a type.""" + names = [n for n, m in macros.items() if m['params'] is None and m['body']] + return _accepted(compiler, flags, headers, names, 'using mwrap_probe_{i} = {n};') 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/generate.py b/tools/generate.py new file mode 100644 index 0000000..bc63b7a --- /dev/null +++ b/tools/generate.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python3 +"""Write, or with --check audit, the parts of the wrapper that follow from the headers. + +tools/surface.toml names the headers and classifies what the compiler cannot: +the configuration that consumers share with the compat package (`defines`, +defined before the headers), the macros that are how the headers are written +(`syntax`), the names that only some targets declare (`conditional`), and the +functions that the compat package does not build (`unbuilt`, not exported). +Everything else follows from the headers as the compiler reads them +(tools/api.py), with the include, define and target flags of the last +`mcpp build` (target/**/compile_commands.json): + + src/.cppm every function, variable, type and enumerator, + `export using ::name` + src/macros.cppm every object-like macro that is a constant + expression or a type, under its own name in + mcpplibs::mwrap::::macros + include/mwrap//macros.hpp every other macro, upstream's definition + tests/macros.cpp each mapped constant and type against its macro + tests/linked.cpp the address of each exported function, so that + the link proves the compat package defines it + +The include guards and reserved identifiers (`__x`, `_X`) are recognised and +omitted. --check renders the same files in memory: on the host named by +`generated-on` they must be byte-identical; on every host, each name the +headers declare there must be exported, mapped, kept or classified, and each +unconditional export must be declared there. +The compiler is the clang of the build; run it after `mcpp build` with LLVM. +""" +import argparse +import json +from pathlib import Path +import re +import sys +import tomllib + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import api # noqa: E402 + +ROOT = Path(__file__).resolve().parents[1] +KEEP_JOINED = ('-I', '-isystem', '-idirafter', '-iquote', '-D', '-U', '--sysroot=', '-isysroot', '--target=', + '-target', '-include', '-imsvc', '-fms-compatibility-version=', '-fms-runtime-lib=', '-fms-extensions') +KEEP_ALONE = ('-nostdinc++', '-nostdlibinc', '-nostdinc', '--no-default-config') +TAKES_VALUE = ('-I', '-isystem', '-idirafter', '-iquote', '-D', '-U', '-isysroot', '-target', '-include', '-imsvc') + + +def build_flags(name): + """The clang of the newest LLVM build and its preprocessing and target flags for src/.cppm.""" + databases = sorted((ROOT / 'target').glob('**/compile_commands.json'), key=lambda p: p.stat().st_mtime) + for database in reversed(databases): + for entry in json.loads(database.read_text(encoding='utf-8')): + words = entry.get('arguments') or entry['command'].split() + if Path(entry['file']).as_posix().endswith(f'src/{name}.cppm') and 'clang' in Path(words[0]).name: + flags, rest = [], iter(words[1:]) + for word in rest: + if word in TAKES_VALUE: + flags += [word, next(rest)] + elif word in KEEP_ALONE or word.startswith(KEEP_JOINED): + flags.append(word) + return words[0], flags + sys.exit(f'no LLVM build of src/{name}.cppm; run `mcpp build --toolchain llvm@23.1.3` first') + + +def qualify(body, mapped, scope): + return re.sub(r'(?' for h in cfg['headers']]) + declared = surface['functions'] | surface['variables'] | surface['types'] | surface['enumerators'] + exported = sorted(declared - set(conditional) - set(cfg.get('unbuilt', []))) + cap = f'mwrap_{name}_capture' + + module = [f"// mcpplibs.mwrap.{name} --- {cfg['title']} as a C++ module. Every exported name is", + "// the upstream entity of the headers below, unchanged, in the global namespace where", + f"// upstream declares it; the root also re-exports the macro mapping. The implementation", + f"// is compat.{cfg['compat']} {cfg['version']}. Written by tools/generate.py from the headers.", + 'module;', includes, '', f'export module mcpplibs.mwrap.{name};', '', + f'export import mcpplibs.mwrap.{name}.macros;', '', 'export {'] + module += [f'using ::{n};' for n in exported] + module.append('}') + for condition in sorted(set(conditional.values())): + module += ['', f'#if {condition}', 'export {'] + module += [f'using ::{n};' for n in sorted(conditional) if conditional[n] == condition] + module += ['}', '#endif'] + + mapped = sorted(constants | types) + macros = [f"// mcpplibs.mwrap.{name}.macros --- the macros of the headers that are a constant or a", + "// type, under their original names in " + scope + "::macros, each equal to", + "// the macro where the module is built (a named module cannot export a macro). The", + f"// other macros are in . Written by tools/generate.py.", + 'module;', includes, '', '// The values, taken under other names while the macros are defined.', + f'namespace {cap} {{'] + macros += [f'inline constexpr auto value_{n} = ({n});' if n in constants else f'using type_{n} = {n};' + for n in mapped] + macros += ['}'] + [f'#undef {n}' for n in mapped] + macros += ['', f'export module mcpplibs.mwrap.{name}.macros;', '', f'export namespace {scope}::macros {{'] + macros += [f'inline constexpr auto {n} = {cap}::value_{n};' if n in constants else f'using {n} = {cap}::type_{n};' + for n in mapped] + macros.append('}') + + guard = f'MWRAP_{name.upper()}_MACROS_HPP' + header = [f'// --- the macros of the headers that are neither a constant', + '// nor a type: they take arguments, or call a function. A named module cannot export a', + f'// macro: include this header before `import mcpplibs.mwrap.{name};`. Each definition is', + f"// upstream's ({cfg['title']}, {cfg['license']}), made only where the upstream header has", + f'// not defined it, with the constants it names read from {scope}::macros', + '// and NULL written nullptr.', + '// The upstream header included after this one redefines these macros.', + '// Written by tools/generate.py.', + f'#ifndef {guard}', f'#define {guard}'] + for n in sorted(kept): + # A module-only unit has no NULL macro; in C++ nullptr is its meaning. + body = re.sub(r'\bNULL\b', 'nullptr', qualify(kept[n]['body'], set(mapped), f'{scope}::macros')) + header += ['', f'#ifndef {n}', f"#define {n}{kept[n]['params'] or ''} {body}".rstrip(), '#endif'] + if not kept: + header += ['', '// The headers of this release define no such macro.'] + header += ['', f'#endif // {guard}'] + + test = [f'// Each constant and type of mcpplibs.mwrap.{name}.macros equals its macro. A macro', + '// expands even in a qualified name, so the values of the headers are taken under other', + '// names and the macros undefined before the mapped names are used. Written by', + '// tools/generate.py.', includes, '', 'namespace header {'] + test += [f'inline constexpr auto value_{n} = ({n});' if n in constants else f'using type_{n} = {n};' for n in mapped] + test += ['}'] + [f'#undef {n}' for n in mapped] + test += ['', 'import std;', f'import mcpplibs.mwrap.{name}.macros;', '', + f'namespace m = {scope}::macros;', ''] + test += [f'static_assert(std::is_same_v, "{n}");' for n in sorted(types)] + test += ['', 'template ', 'bool same(A a, B b)', '{', + ' if constexpr (std::is_convertible_v && std::is_convertible_v)', + ' return std::string_view(a) == std::string_view(b);', + ' else', + ' return a == b;', + '}', '', 'int main()', '{', ' int differ = 0;'] + test += [f' if (!same(m::{n}, header::value_{n})) {{ std::println("FAIL {n}"); ++differ; }}' for n in sorted(constants)] + test += [f' std::println("{len(constants)} constants and {len(types)} types compared, {{}} differ", differ);', + ' return differ != 0;', '}'] + functions = sorted(surface['functions'] - set(conditional) - set(cfg.get('unbuilt', []))) + linked = [f'// Every function that mcpplibs.mwrap.{name} exports, by address: the program links only', + f'// where compat.{cfg["compat"]} defines each one. Written by tools/generate.py.', + 'import std;', f'import mcpplibs.mwrap.{name};', '', 'int main()', '{', + ' // volatile: an optimiser may not drop a reference, so each one reaches the link.', + ' const void* volatile functions[] = {'] + linked += [f' reinterpret_cast(&{n}),' for n in functions] + linked += [' };', ' int missing = 0;', ' for (const void* f : functions) missing += f == nullptr;', + f' std::println("{len(functions)} functions linked, {{}} null", missing);', + ' return missing != 0;', '}'] + join = lambda lines: '\n'.join(lines) + '\n' + return {f'src/{name}.cppm': join(module), 'src/macros.cppm': join(macros), + f'include/mwrap/{name}/macros.hpp': join(header), 'tests/macros.cpp': join(test), + 'tests/linked.cpp': join(linked)} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('--check', action='store_true', help='audit instead of writing') + args = parser.parse_args() + cfg = tomllib.loads((ROOT / 'tools/surface.toml').read_text(encoding='utf-8')) + compiler, flags = build_flags(cfg['name']) + surface, macros, guards, constants, types, kept = classify(cfg, compiler, flags) + files = render(cfg, surface, constants, types, kept) + problems = [] + host = {'linux': 'linux', 'darwin': 'macos', 'win32': 'windows'}.get(sys.platform, sys.platform) + if not args.check: + for path, text in files.items(): + target = ROOT / path + target.parent.mkdir(parents=True, exist_ok=True) + if not target.exists() or target.read_text(encoding='utf-8') != text: + target.write_text(text, encoding='utf-8', newline='\n') + elif host == cfg['generated-on']: + problems += [f'differs from the headers: {p}' for p, t in files.items() + if not (ROOT / p).exists() or (ROOT / p).read_text(encoding='utf-8') != t] + else: + # Another host: its declarations against the files written on `generated-on`. + module = (ROOT / f"src/{cfg['name']}.cppm").read_text(encoding='utf-8') + written = set(re.findall(r'using ::(\w+);', module)) + unconditional = set(re.findall(r'using ::(\w+);', module.split('\n#if ')[0])) + declared = surface['functions'] | surface['variables'] | surface['types'] | surface['enumerators'] + mapping = (ROOT / 'src/macros.cppm').read_text(encoding='utf-8') + mapped = set(re.findall(r'^#undef (\w+)$', mapping, flags=re.M)) + kept_written = set(re.findall(r'^#ifndef (\w+)$', (ROOT / f"include/mwrap/{cfg['name']}/macros.hpp") + .read_text(encoding='utf-8'), flags=re.M)) + problems += [f'declared here, not exported: {n}' for n in sorted(declared - written - set(cfg.get('unbuilt', [])))] + problems += [f'exported, not declared here: {n}' for n in sorted(unconditional - declared)] + problems += [f'macro here, neither mapped, kept nor classified: {n}' for n in sorted( + set(macros) - guards - set(cfg.get('syntax', [])) - mapped - kept_written) + if not re.match(r'_[_A-Z]', n)] + problems += [f'mapped, not a constant or type here: {n}' for n in sorted(mapped - constants - types)] + problems += [f'internal linkage, cannot be exported: {n}' for n in sorted(surface['internal']) + if n not in cfg.get('adapted', [])] + for problem in problems: + print(problem) + print(f"{host}: {len(surface['functions'])} functions, {len(surface['variables'])} variables, " + f"{len(surface['types'])} types, {len(surface['enumerators'])} enumerators; {len(constants)} constant and " + f"{len(types)} type macros mapped, {len(kept)} kept, {len(guards)} guards, " + f"{len(set(cfg.get('syntax', [])) & set(macros))} syntax; {len(problems)} problems") + return 1 if problems else 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/run_conformance.py b/tools/run_conformance.py new file mode 100644 index 0000000..8650e66 --- /dev/null +++ b/tools/run_conformance.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python3 +"""Run libarchive's own test suite (libarchive/test of the release) against +compat.libarchive 3.8.7, the library this wrapper exports. + +The release tarball is downloaded once into target/upstream and checked +against upstream/documents.json. libarchive/test and test_utils are copied +unchanged into target/conformance; a project there builds the 312 test +sources with upstream's test_main.c over compat.libarchive, as C, with the +configuration compat.libarchive compiles with (config.h names it) and the +test list upstream's build generates (list.h, every DEFINE_TEST). The program +runs every test against the reference files of libarchive/test. + +EXPECTED lists the tests that fail because of how compat.libarchive is +configured, with the reason; any other failure, or an expected failure that +passes, fails the run. +""" +import argparse +import hashlib +import json +from pathlib import Path +import re +import shutil +import subprocess +import sys +import tarfile +import tempfile +import urllib.request + +MANIFEST = '''[package] +name = "libarchive-conformance" +version = "3.8.7" +description = "libarchive 3.8.7's test suite over compat.libarchive (tools/run_conformance.py)" + +[targets.libarchive_test] +kind = "bin" +main = "test_utils/test_main.c" + +[build] +c_standard = "c11" +sources = ["test/*.c", "test_utils/test_utils.c"] +include_dirs = ["test", "test_utils"] +cflags = ["-DHAVE_CONFIG_H", "-D_GNU_SOURCE", "-DLIBARCHIVE_STATIC", "-DLIST_H"] + +[dependencies] +compat.libarchive = "3.8.7" +''' + +# compat.libarchive answers every locale's character set with UTF-8 (its +# localcharset.h), so a conversion that upstream expects to fail under the C +# locale's ASCII succeeds. +EXPECTED = { + 'test_archive_string_conversion_fail_c': 'every locale is UTF-8 in compat.libarchive', +} + + +def fetch(root: Path) -> Path: + pins = json.loads((root / 'upstream/documents.json').read_text(encoding='utf-8')) + cache = root / 'target/upstream' + cache.mkdir(parents=True, exist_ok=True) + archive = cache / 'libarchive-release.tar.gz' + if not archive.exists() or hashlib.sha256(archive.read_bytes()).hexdigest() != pins['upstream_sha256']: + print('+ fetch', pins['upstream'], flush=True) + with urllib.request.urlopen(pins['upstream'], timeout=120) as response: + archive.write_bytes(response.read()) + digest = hashlib.sha256(archive.read_bytes()).hexdigest() + if digest != pins['upstream_sha256']: + sys.exit(f'upstream archive checksum {digest} != {pins["upstream_sha256"]}') + with tarfile.open(archive) as tar: + top = tar.getmembers()[0].name.split('/')[0] + if not (cache / top).exists(): + tar.extractall(cache, filter='data') + return cache / top + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--mcpp', default='mcpp') + parser.add_argument('--toolchain') + args = parser.parse_args() + root = Path(__file__).resolve().parents[1] + upstream = fetch(root) + work = root / 'target/conformance' + shutil.rmtree(work, ignore_errors=True) + shutil.copytree(upstream / 'libarchive/test', work / 'test') + shutil.copytree(upstream / 'test_utils', work / 'test_utils') + tests = sorted({m.group(0) for p in (work / 'test').glob('*.c') + for m in re.finditer(r'^DEFINE_TEST\(\w+\)', p.read_text(encoding='utf-8', errors='replace'), re.M)}) + (work / 'test/list.h').write_text('\n'.join(tests) + '\n', encoding='utf-8') + (work / 'test/config.h').write_text('#include "mcpp_libarchive_config.h"\n', encoding='utf-8') + (work / 'mcpp.toml').write_text(MANIFEST, encoding='utf-8') + build = [args.mcpp, 'build', '--release'] + if args.toolchain: + build += ['--toolchain', args.toolchain] + print('+', ' '.join(build), flush=True) + subprocess.run(build, cwd=work, check=True) + program = next(p for p in (work / 'target').rglob('libarchive_test*') if p.is_file() and p.suffix in ('', '.exe')) + scratch = Path(tempfile.mkdtemp(prefix='libarchive-test-')) + command = [program, '-r', work / 'test', '-q'] + print('+', ' '.join(map(str, command)), flush=True) + run = subprocess.run(command, cwd=scratch, capture_output=True, text=True, errors='replace') + print(run.stdout[-4000:], run.stderr[-2000:], sep='\n', flush=True) + failed = set(re.findall(r'^\s*\d+: (\w+) \(', run.stdout, flags=re.M)) + unexpected = sorted(failed - set(EXPECTED)) + fixed = sorted(set(EXPECTED) - failed) + for name in unexpected: + print('unexpected failure:', name) + for name in fixed: + print('expected to fail, passed (remove it from EXPECTED):', name) + print(f'libarchive 3.8.7: {len(tests)} tests, {len(failed)} failed, {len(failed & set(EXPECTED))} of them expected', + flush=True) + if not unexpected and not fixed: + shutil.rmtree(scratch, ignore_errors=True) + return 1 if unexpected or fixed or (run.returncode != 0 and not failed) else 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/surface.toml b/tools/surface.toml new file mode 100644 index 0000000..33985c3 --- /dev/null +++ b/tools/surface.toml @@ -0,0 +1,20 @@ +# What tools/generate.py cannot read from the headers; everything else it can. +name = "libarchive" +title = "libarchive 3.8.7" +compat = "libarchive" +version = "3.8.7" +license = "BSD 2-Clause license" +generated-on = "linux" +headers = ["archive.h", "archive_entry.h"] +owned = ["archive.h", "archive_entry.h"] + +# compat.libarchive compiles a static library (-DLIBARCHIVE_STATIC). The +# declarations must say so too: on Windows the headers otherwise declare every +# function __declspec(dllimport), and the program would look for a DLL. +defines = ["LIBARCHIVE_STATIC"] +syntax = [] + +# Declared on Windows only (archive.h, archive_entry.h: `_WIN32 && !__CYGWIN__`). +[conditional] +archive_read_open_filenames_w = "defined(_WIN32) && !defined(__CYGWIN__)" +archive_entry_copy_bhfi = "defined(_WIN32) && !defined(__CYGWIN__)" diff --git a/tools/test_template.py b/tools/test_template.py new file mode 100644 index 0000000..81ea805 --- /dev/null +++ b/tools/test_template.py @@ -0,0 +1,83 @@ +#!/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"][identity] + 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() + matches = [i for i, line in enumerate(lines) if line.startswith(json.dumps(identity) + " =")] + assert len(matches) == 1, "Expected exactly one qualified dependency from self.name" + lines[matches[0]] = json.dumps(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/documents.json b/upstream/documents.json new file mode 100644 index 0000000..8513f33 --- /dev/null +++ b/upstream/documents.json @@ -0,0 +1,17 @@ +{ + "upstream": "https://libarchive.org/downloads/libarchive-3.8.7.tar.gz", + "upstream_sha256": "4b787cca6697a95c7725e45293c973c208cbdc71ae2279f30ef09f52472b9166", + "pruning": "Nothing of libarchive is vendored: the library is compat.libarchive 3.8.7's, from the same tarball. Its README and license summary are retained here. The conformance run builds the release's libarchive/test suite against compat.libarchive, from the tarball downloaded at test time.", + "documents": [ + { + "path": "upstream/libarchive/README.md", + "source": "https://github.com/libarchive/libarchive/blob/v3.8.7/README.md", + "sha256": "158527b45cc55cce474530d54e8c7e1a6fd3f57c6cf0967777421c07ea34398d" + }, + { + "path": "upstream/libarchive/COPYING", + "source": "https://github.com/libarchive/libarchive/blob/v3.8.7/COPYING", + "sha256": "30e556b3959e3985d66efefec5eaac51d4995053caa1d3cffe6eb916f146f229" + } + ] +} diff --git a/upstream/libarchive/COPYING b/upstream/libarchive/COPYING new file mode 100644 index 0000000..9d0bcf8 --- /dev/null +++ b/upstream/libarchive/COPYING @@ -0,0 +1,65 @@ +The libarchive distribution as a whole is Copyright by Tim Kientzle +and is subject to the copyright notice reproduced at the bottom of +this file. + +Each individual file in this distribution should have a clear +copyright/licensing statement at the beginning of the file. If any do +not, please let me know and I will rectify it. The following is +intended to summarize the copyright status of the individual files; +the actual statements in the files are controlling. + +* Except as listed below, all C sources (including .c and .h files) + and documentation files are subject to the copyright notice reproduced + at the bottom of this file. + +* The following source files are also subject in whole or in part to + a 3-clause UC Regents copyright; please read the individual source + files for details: + libarchive/archive_read_support_filter_compress.c + libarchive/archive_write_add_filter_compress.c + libarchive/mtree.5 + +* The following source files are in the public domain: + libarchive/archive_parse_date.c + +* The following source files are triple-licensed with the ability to choose + from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: + libarchive/archive_blake2.h + libarchive/archive_blake2_impl.h + libarchive/archive_blake2s_ref.c + libarchive/archive_blake2sp_ref.c + +* The build files---including Makefiles, configure scripts, + and auxiliary scripts used as part of the compile process---have + widely varying licensing terms. Please check individual files before + distributing them to see if those restrictions apply to you. + +I intend for all new source code to use the license below and hope over +time to replace code with other licenses with new implementations that +do use the license below. The varying licensing of the build scripts +seems to be an unavoidable mess. + + +Copyright (c) 2003-2018 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer + in this position and unchanged. +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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 AUTHOR(S) 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. diff --git a/upstream/libarchive/README.md b/upstream/libarchive/README.md new file mode 100644 index 0000000..3009e1b --- /dev/null +++ b/upstream/libarchive/README.md @@ -0,0 +1,250 @@ +# Welcome to libarchive! + +The libarchive project develops a portable, efficient C library that +can read and write streaming archives in a variety of formats. It +also includes implementations of the common `tar`, `cpio`, and `zcat` +command-line tools that use the libarchive library. + +## Questions? Issues? + +* https://www.libarchive.org is the home for ongoing + libarchive development, including documentation, + and links to the libarchive mailing lists. +* To report an issue, use the issue tracker at + https://github.com/libarchive/libarchive/issues +* To submit an enhancement to libarchive, please + submit a pull request via GitHub: https://github.com/libarchive/libarchive/pulls + +## Contents of the Distribution + +This distribution bundle includes the following major components: + +* **libarchive**: a library for reading and writing streaming archives +* **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive +* **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality +* **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such +* **unzip**: the 'bsdunzip' program is a simple replacement tool for Info-ZIP's unzip +* **examples**: Some small example programs that you may find useful. +* **examples/minitar**: a compact sample demonstrating use of libarchive. +* **contrib**: Various items sent to me by third parties; please contact the authors with any questions. + +The top-level directory contains the following information files: + +* **NEWS** - highlights of recent changes +* **COPYING** - what you can do with this +* **INSTALL** - installation instructions +* **README** - this file +* **CMakeLists.txt** - input for "cmake" build tool, see INSTALL +* **configure** - configuration script, see INSTALL for details. If your copy of the source lacks a `configure` script, you can try to construct it by running the script in `build/autogen.sh` (or use `cmake`). + +The following files in the top-level directory are related to the 'configure' script and are only needed by maintainers: + +* `configure.ac` - used (by autoconf) to build the configure script and related files +* `Makefile.am` - used (by automake) to generate Makefile.in +* `aclocal.m4` - auto-generated file (created by aclocal) used to build the configure script +* `Makefile.in` - auto-generated template (created by automake) used by the configure script to create Makefile +* `config.h.in` - auto-generated template (created by autoheader) used by the configure script to create config.h + +## Documentation + +In addition to the informational articles and documentation +in the online [libarchive Wiki](https://github.com/libarchive/libarchive/wiki), +the distribution also includes a number of manual pages: + + * bsdtar.1 explains the use of the bsdtar program + * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program + * libarchive.3 gives an overview of the library as a whole + * archive_read.3, archive_write.3, archive_write_disk.3, and + archive_read_disk.3 provide detailed calling sequences for the read + and write APIs + * archive_entry.3 details the "struct archive_entry" utility class + * archive_internals.3 provides some insight into libarchive's + internal structure and operation. + * libarchive-formats.5 documents the file formats supported by the library + * cpio.5, mtree.5, and tar.5 provide detailed information about these + popular archive formats, including hard-to-find details about + modern cpio and tar variants. + +The manual pages above are provided in the 'doc' directory in +a number of different formats. + +You should also read the copious comments in `archive.h` and the +source code for the sample programs for more details. Please let us +know about any errors or omissions you find. + +## Supported Formats + +Currently, the library automatically detects and reads the following formats: + + * Old V7 tar archives + * POSIX ustar + * GNU tar format (including GNU long filenames, long link names, and sparse files) + * Solaris 9 extended tar format (including ACLs) + * POSIX pax interchange format + * POSIX octet-oriented cpio + * SVR4 ASCII cpio + * Binary cpio (big-endian or little-endian) + * PWB binary cpio + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) + * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * 7-Zip archives (including archives that use zstandard compression) + * Microsoft CAB format + * LHA and LZH archives + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * WARC archives + * XAR archives + +The library also detects and handles any of the following before evaluating the archive: + + * uuencoded files + * files with RPM wrapper + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + * zstandard compression + +The library can create archives in any of the following formats: + + * POSIX ustar + * POSIX pax interchange format + * "restricted" pax format, which will create ustar archives except for + entries that require pax extensions (for long filenames, ACLs, etc). + * Old GNU tar format + * Old V7 tar format + * POSIX octet-oriented cpio + * SVR4 "newc" cpio + * Binary cpio (little-endian) + * PWB binary cpio + * shar archives + * ZIP archives (with uncompressed or "deflate" compressed entries) + * ZIPX archives (with bzip2, zstd, lzma or xz compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * ISO9660 format + * 7-Zip archives (including archives that use zstandard compression) + * WARC archives + * XAR archives + +When creating archives, the result can be filtered with any of the following: + + * uuencode + * base64 + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + * zstandard compression + +## Notes about the Library Design + +The following notes address many of the most common +questions we are asked about libarchive: + +* This is a heavily stream-oriented system. That means that + it is optimized to read or write the archive in a single + pass from beginning to end. For example, this allows + libarchive to process archives too large to store on disk + by processing them on-the-fly as they are read from or + written to a network or tape drive. This also makes + libarchive useful for tools that need to produce + archives on-the-fly (such as webservers that provide + archived contents of a users account). + +* In-place modification and random access to the contents + of an archive are not directly supported. For some formats, + this is not an issue: For example, tar.gz archives are not + designed for random access. In some other cases, libarchive + can re-open an archive and scan it from the beginning quickly + enough to provide the needed abilities even without true + random access. Of course, some applications do require true + random access; those applications should consider alternatives + to libarchive. + +* The library is designed to be extended with new compression and + archive formats. The only requirement is that the format be + readable or writable as a stream and that each archive entry be + independent. There are articles on the libarchive Wiki explaining + how to extend libarchive. + +* On read, compression and format are always detected automatically. + +* The same API is used for all formats; it should be very + easy for software using libarchive to transparently handle + any of libarchive's archiving formats. + +* Libarchive's automatic support for decompression can be used + without archiving by explicitly selecting the "raw" and "empty" + formats. + +* I've attempted to minimize static link pollution. If you don't + explicitly invoke a particular feature (such as support for a + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. + +* The library is generally _thread-safe_ depending on the platform: + it does not define any global variables of its own. However, some + platforms do not provide fully thread-safe versions of key C library + functions. On those platforms, libarchive will use the non-thread-safe + functions. Patches to improve this are of great interest to us. + +* The function `archive_write_disk_header()` is _not_ thread safe on + POSIX machines and could lead to security issue resulting in world + writeable directories. Thus it must be mutexed by the calling code. + This is due to calling `umask(oldumask = umask(0))`, which sets the + umask for the whole process to 0 for a short time frame. + In case other thread calls the same function in parallel, it might + get interrupted by it and cause the executable to use umask=0 for the + remaining execution. + This will then lead to implicitly created directories to have 777 + permissions without sticky bit. + +* In particular, libarchive's modules to read or write a directory + tree do use `chdir()` to optimize the directory traversals. This + can cause problems for programs that expect to do disk access from + multiple threads. Of course, those modules are completely + optional and you can use the rest of libarchive without them. + +* The library is _not_ thread-aware, however. It does no locking + or thread management of any kind. If you create a libarchive + object and need to access it from multiple threads, you will + need to provide your own locking. + +* On read, the library accepts whatever blocks you hand it. + Your read callback is free to pass the library a byte at a time + or mmap the entire archive and give it to the library at once. + On write, the library always produces correctly-blocked output. + +* The object-style approach allows you to have multiple archive streams + open at once. bsdtar uses this in its "@archive" extension. + +* The archive itself is read/written using callback functions. + You can read an archive directly from an in-memory buffer or + write it to a socket, if you wish. There are some utility + functions to provide easy-to-use "open file," etc, capabilities. + +* The read/write APIs are designed to allow individual entries + to be read or written to any data source: You can create + a block of data in memory and add it to a tar archive without + first writing a temporary file. You can also read an entry from + an archive and write the data directly to a socket. If you want + to read/write entries to disk, there are convenience functions to + make this especially easy. + +* Note: The "pax interchange format" is a POSIX standard extended tar + format that should be used when the older _ustar_ format is not + appropriate. It has many advantages over other tar formats + (including the legacy GNU tar format) and is widely supported by + current tar implementations. From dcff2a66e8431cc3888e1e03339bb356d14dd714 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sat, 7 Nov 2026 06:30:42 +0900 Subject: [PATCH 2/2] ci: upstream's test suite on Linux, where compat.libarchive's configuration is the suite's Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --- .github/workflows/ci.yml | 6 +++++- README.md | 6 ++++-- README.zh.md | 5 +++-- docs/usage.md | 5 ++++- tools/api.py | 14 ++++++++------ 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8880a57..4071a8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,6 +83,10 @@ jobs: if: startsWith(matrix.toolchain, 'llvm') run: python3 tools/generate.py --check + # Linux only: the suite's sources expect the configuration that upstream's own + # build generates for each host, and compat.libarchive configures macOS and + # Windows from the Android host headers with substitutions, which the test + # sources do not accept (dirent.h on Windows, the macOS ACL calls). - name: Upstream's test suite over the same library - if: ${{ !matrix.target }} + if: ${{ !matrix.target && runner.os == 'Linux' }} run: python3 tools/run_conformance.py --toolchain "${{ matrix.toolchain }}" diff --git a/README.md b/README.md index 51315c9..f72ff7f 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,11 @@ linked, and header mixing. CI also runs: module, the macro mapping, the macro header and the generated tests are regenerated from the headers as clang reads them and compared, and on macOS and Windows every name the headers declare there is exported; -- upstream's test suite over the same library +- on Linux, upstream's test suite over the same library ([tools/run_conformance.py](tools/run_conformance.py)); one test fails by - compat.libarchive's configuration and is listed with its reason. + compat.libarchive's configuration and is listed with its reason. The suite's + sources need the configuration upstream's build generates per host, which + compat.libarchive does not produce for macOS and Windows. A separate job scaffolds the default template as an installed package and runs it. diff --git a/README.zh.md b/README.zh.md index 61366c5..7e9d81a 100644 --- a/README.zh.md +++ b/README.zh.md @@ -71,8 +71,9 @@ ZIP 与 7-Zip 写入内存后读回并识别格式与过滤器,经克隆保留 - 导出审计([tools/generate.py](tools/generate.py) `--check`):按 clang 读到的头文件重新生成模块、宏映射、宏头文件与 生成的测试并逐字节比较;在 macOS 与 Windows 上检查头文件在该平台声明的每个名字都已导出; -- 在同一份库上运行上游的测试套件([tools/run_conformance.py](tools/run_conformance.py));其中一个测试因 - compat.libarchive 的配置而失败,已连同原因列出。 +- 在 Linux 上于同一份库运行上游的测试套件([tools/run_conformance.py](tools/run_conformance.py));其中一个测试因 + compat.libarchive 的配置而失败,已连同原因列出。测试源码需要上游构建为各宿主生成的配置,compat.libarchive 不为 macOS + 与 Windows 生成这种配置。 另一个作业把默认模板当作已安装的包生成项目并运行。 diff --git a/docs/usage.md b/docs/usage.md index a274518..d5c84cf 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -50,7 +50,10 @@ the constants (tests/macros.cpp does this). tools/run_conformance.py builds libarchive's own `libarchive/test` (312 sources, 702 tests) with upstream's `test_main.c` over `compat.libarchive` and -runs it against the release's reference files. One test fails by +runs it against the release's reference files, on Linux: the test sources +expect the configuration upstream's build generates for each host, and +compat.libarchive configures macOS and Windows from the Android host headers +with substitutions, which the sources do not accept. One test fails by configuration and is expected: `test_archive_string_conversion_fail_c` expects a conversion to the C locale's ASCII to fail, and `compat.libarchive` answers UTF-8 for every locale. diff --git a/tools/api.py b/tools/api.py index 1ee5ff8..a9f88a8 100644 --- a/tools/api.py +++ b/tools/api.py @@ -104,9 +104,10 @@ def guards(macros): return found -def _accepted(compiler, flags, headers, names, form): - """The names for which `form` (with {i} and {n}) compiles after the headers: - one translation unit, dropping the lines with an error until none remain.""" +def accepted(compiler, flags, headers, names, form): + """The names for which `form` (with {i} and {n}; one or more lines) compiles + after the headers: one translation unit, dropping the forms with an error + until none remain.""" head = ''.join(f'#include <{h}>\n' for h in headers) pending = sorted(names) while pending: @@ -115,7 +116,8 @@ def _accepted(compiler, flags, headers, names, form): input=probe, capture_output=True, text=True) if result.returncode == 0: return set(pending) - bad = {int(m.group(1)) - 1 for m in re.finditer(r'mwrap-probe:(\d+):\d+: error', result.stderr)} + lines = form.count('\n') + 1 + bad = {(int(m.group(1)) - 1) // lines for m in re.finditer(r'mwrap-probe:(\d+):\d+: error', result.stderr)} if not bad: raise RuntimeError(result.stderr[-2000:]) pending = [n for i, n in enumerate(pending) if i not in bad] @@ -125,10 +127,10 @@ def _accepted(compiler, flags, headers, names, form): def constant_macros(compiler, flags, headers, macros): """The object-like macros among `macros` whose expansion is a constant expression.""" names = [n for n, m in macros.items() if m['params'] is None and m['body']] - return _accepted(compiler, flags, headers, names, 'inline constexpr auto mwrap_probe_{i} = ({n});') + return accepted(compiler, flags, headers, names, 'inline constexpr auto mwrap_probe_{i} = ({n});') def type_macros(compiler, flags, headers, macros): """The object-like macros among `macros` whose expansion is a type.""" names = [n for n, m in macros.items() if m['params'] is None and m['body']] - return _accepted(compiler, flags, headers, names, 'using mwrap_probe_{i} = {n};') + return accepted(compiler, flags, headers, names, 'using mwrap_probe_{i} = {n};')