refactor(compress): expose stream size and level leaves from Rust

Move the public stream-size and predefined compression-level leaves to their
caller-facing Rust symbols, removing the remaining C-only forwarding bodies.
Keep crate-local aliases where Rust implementation modules still use the old
internal names, while the public C ABI now lands directly in Rust.

Test Plan: Nightly Rust formatting and staged diff checks passed; capped native and upstream gates pending.
This commit is contained in:
2026-07-20 11:18:44 +02:00
parent c8603f2b3e
commit 58606b18aa
3 changed files with 14 additions and 26 deletions
-16
View File
@@ -1554,8 +1554,6 @@ typedef char ZSTD_rust_next_input_size_hint_mt_or_st_state_layout[
? 1 : -1];
size_t ZSTD_rust_nextInputSizeHintMTorST(
const ZSTD_rust_nextInputSizeHintMTorSTState* state);
size_t ZSTD_rust_CStreamInSize(void);
size_t ZSTD_rust_CStreamOutSize(void);
size_t ZSTD_rust_sizeofCDict(size_t objectSize, size_t workspaceSize);
size_t ZSTD_rust_sizeofLocalDict(int dictBufferPresent, size_t dictSize,
size_t cdictSize);
@@ -1925,9 +1923,6 @@ void ZSTD_rust_setBufferExpectations(
* sanitizer workspace policy, which it feeds to the leaves as explicit
* scalar inputs. The ZSTD_CParamMode_e and ZSTD_ParamSwitch_e enums are
* passed as int; the Rust side mirrors their values. */
int ZSTD_rust_params_maxCLevel(void);
int ZSTD_rust_params_minCLevel(void);
int ZSTD_rust_params_defaultCLevel(void);
ZSTD_bounds ZSTD_rust_params_getBounds(int param);
size_t ZSTD_rust_params_checkCParams(ZSTD_compressionParameters cParams);
void ZSTD_rust_params_assertEqualCParams(ZSTD_compressionParameters cParams1,
@@ -7547,13 +7542,6 @@ size_t ZSTD_freeCStream(ZSTD_CStream* zcs)
/*====== Initialization ======*/
size_t ZSTD_CStreamInSize(void) { return ZSTD_rust_CStreamInSize(); }
size_t ZSTD_CStreamOutSize(void)
{
return ZSTD_rust_CStreamOutSize();
}
static ZSTD_CParamMode_e ZSTD_getCParamMode(ZSTD_CDict const* cdict, ZSTD_CCtx_params const* params, U64 pledgedSrcSize)
{
int const cdict_present = cdict != NULL;
@@ -8653,10 +8641,6 @@ size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output)
/* The compression-level tables (formerly included from clevels.h) live in
* rust/src/zstd_compress_params.rs. */
int ZSTD_maxCLevel(void) { return ZSTD_rust_params_maxCLevel(); }
int ZSTD_minCLevel(void) { return ZSTD_rust_params_minCLevel(); }
int ZSTD_defaultCLevel(void) { return ZSTD_rust_params_defaultCLevel(); }
/**
* Reverses the adjustment applied to cparams when enabling dedicated dict
* search. This is used to recover the params set to be used in the working