refactor(cli): remove pure fileio forwarders
Call the Rust pass-through and frame-analysis leaves directly from their C callbacks. The C translation unit still owns private resource projections, filename suffix configuration, diagnostics, and format-specific operations; this commit only removes two exact return-forwarding layers. Test Plan: - clang -fsyntax-only on programs/fileio.c - git diff --check - Full capped native/upstream suite pending after this commit
This commit is contained in:
+5
-16
@@ -3716,13 +3716,6 @@ static void FIO_freeDResources(dRess_t ress)
|
|||||||
FIO_rust_freeDResources(&state);
|
FIO_rust_freeDResources(&state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIO_passThrough() : just copy input into output, for compatibility with gzip -df mode
|
|
||||||
* @return : 0 (no error) */
|
|
||||||
static int FIO_passThrough(dRess_t *ress)
|
|
||||||
{
|
|
||||||
return FIO_rust_passThrough(ress->readCtx, ress->writeCtx);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
FIO_RUST_ZSTD_ERROR_HELP_WINDOW_SIZE = 0,
|
FIO_RUST_ZSTD_ERROR_HELP_WINDOW_SIZE = 0,
|
||||||
FIO_RUST_ZSTD_ERROR_HELP_WINDOW_GUIDANCE = 1,
|
FIO_RUST_ZSTD_ERROR_HELP_WINDOW_GUIDANCE = 1,
|
||||||
@@ -4248,11 +4241,14 @@ static int FIO_rust_decompressZstdFrameCallback(void* opaque,
|
|||||||
return *frameSize == FIO_ERROR_FRAME_DECODING;
|
return *frameSize == FIO_ERROR_FRAME_DECODING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIO_passThrough() : just copy input into output, for compatibility with gzip -df mode
|
||||||
|
* @return : 0 (no error) */
|
||||||
static int FIO_rust_decompressPassThroughCallback(void* opaque)
|
static int FIO_rust_decompressPassThroughCallback(void* opaque)
|
||||||
{
|
{
|
||||||
FIO_rust_decompression_projection_t* const projection =
|
FIO_rust_decompression_projection_t* const projection =
|
||||||
(FIO_rust_decompression_projection_t*)opaque;
|
(FIO_rust_decompression_projection_t*)opaque;
|
||||||
return FIO_passThrough(projection->ress);
|
return FIO_rust_passThrough(projection->ress->readCtx,
|
||||||
|
projection->ress->writeCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FIO_rust_decompressStatusCallback(void* opaque,
|
static void FIO_rust_decompressStatusCallback(void* opaque,
|
||||||
@@ -4875,13 +4871,6 @@ FIO_rust_analyzeFrames_display(int diagnostic,
|
|||||||
DISPLAYLEVEL(1, " \n");
|
DISPLAYLEVEL(1, " \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static InfoError
|
|
||||||
FIO_analyzeFrames(fileInfo_t* info, FILE* const srcFile)
|
|
||||||
{
|
|
||||||
return (InfoError)FIO_rust_analyzeFrames(info, srcFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static InfoError
|
static InfoError
|
||||||
getFileInfo_fileConfirmed(fileInfo_t* info, const char* inFileName)
|
getFileInfo_fileConfirmed(fileInfo_t* info, const char* inFileName)
|
||||||
{
|
{
|
||||||
@@ -4891,7 +4880,7 @@ getFileInfo_fileConfirmed(fileInfo_t* info, const char* inFileName)
|
|||||||
ERROR_IF(srcFile == NULL, info_file_error, "Error: could not open source file %s", inFileName);
|
ERROR_IF(srcFile == NULL, info_file_error, "Error: could not open source file %s", inFileName);
|
||||||
|
|
||||||
info->compressedSize = UTIL_getFileSizeStat(&srcFileStat);
|
info->compressedSize = UTIL_getFileSizeStat(&srcFileStat);
|
||||||
status = FIO_analyzeFrames(info, srcFile);
|
status = (InfoError)FIO_rust_analyzeFrames(info, srcFile);
|
||||||
|
|
||||||
fclose(srcFile);
|
fclose(srcFile);
|
||||||
info->nbFiles = 1;
|
info->nbFiles = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user