Move long-distance matching and high-level decompression from C shims into Rust. The decoder now owns context, dictionary, parameter, one-shot, and buffered streaming state while C retains allocation/configuration, legacy, and trace leaves. Move CLI parsing, safety policy, and dispatch into a separate Rust static archive. Keeping it separate prevents library builds from retaining FIO symbols, while C continues to own file opening, replacement, and I/O. Program targets now select matching compression/decompression archives. The remaining C boundary is intentional: high-level compression, optimal parsing, dictionary building, legacy callbacks, and CLI file I/O still need migration. Test Plan: - cargo test --all-targets (native and i686) - cargo test --all-targets in rust/cli (native and i686) - CLI crate compression-only and decompression-only feature tests - native and i686 fuzzer/zstreamtest runs, plus legacy and dictionary tests - ZSTD_C_PREDICT and ZSTD_HEAPMODE=0 fuzzer coverage - library, dynamic-link, and program-target build/round-trip matrix Refs: rust/README.md
27 lines
858 B
C
27 lines
858 B
C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under both the BSD-style license (found in the
|
|
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
* in the COPYING file in the root directory of this source tree).
|
|
* You may select, at your option, one of the above-listed licenses.
|
|
*/
|
|
|
|
/* The CLI parser and control flow live in rust/src/zstd_cli.rs. Keep this
|
|
* translation unit as the stable C entry point used by program launchers. */
|
|
#include "../lib/zstd.h"
|
|
|
|
int ZSTD_rust_cli_main(int argCount, const char* const argv[]);
|
|
const char* ZSTD_rust_cli_expected_version(void);
|
|
|
|
const char* ZSTD_rust_cli_expected_version(void)
|
|
{
|
|
return ZSTD_VERSION_STRING;
|
|
}
|
|
|
|
int main(int argCount, const char* argv[])
|
|
{
|
|
return ZSTD_rust_cli_main(argCount, argv);
|
|
}
|