mirror of
https://github.com/facebook/zstd.git
synced 2025-08-07 06:23:00 +03:00
--no-content-size cli
This commit is contained in:
@@ -323,6 +323,7 @@ struct FIO_prefs_s {
|
|||||||
|
|
||||||
int excludeCompressedFiles;
|
int excludeCompressedFiles;
|
||||||
int patchFromMode;
|
int patchFromMode;
|
||||||
|
int noContentSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -494,6 +495,11 @@ void FIO_setPatchFromMode(FIO_prefs_t* const prefs, int value)
|
|||||||
prefs->patchFromMode = value != 0;
|
prefs->patchFromMode = value != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FIO_setNoContentSize(FIO_prefs_t* const prefs, int value)
|
||||||
|
{
|
||||||
|
prefs->noContentSize = value != 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Functions
|
* Functions
|
||||||
***************************************/
|
***************************************/
|
||||||
@@ -1336,7 +1342,7 @@ FIO_compressFilename_internal(FIO_prefs_t* const prefs,
|
|||||||
clock_t const cpuStart = clock();
|
clock_t const cpuStart = clock();
|
||||||
U64 readsize = 0;
|
U64 readsize = 0;
|
||||||
U64 compressedfilesize = 0;
|
U64 compressedfilesize = 0;
|
||||||
U64 const fileSize = UTIL_getFileSize(srcFileName);
|
U64 const fileSize = !prefs->noContentSize ? UTIL_getFileSize(srcFileName) : UTIL_FILESIZE_UNKNOWN;
|
||||||
DISPLAYLEVEL(5, "%s: %u bytes \n", srcFileName, (unsigned)fileSize);
|
DISPLAYLEVEL(5, "%s: %u bytes \n", srcFileName, (unsigned)fileSize);
|
||||||
|
|
||||||
/* compression format selection */
|
/* compression format selection */
|
||||||
|
@@ -95,6 +95,7 @@ void FIO_setNoProgress(unsigned noProgress);
|
|||||||
void FIO_setNotificationLevel(int level);
|
void FIO_setNotificationLevel(int level);
|
||||||
void FIO_setExcludeCompressedFile(FIO_prefs_t* const prefs, int excludeCompressedFiles);
|
void FIO_setExcludeCompressedFile(FIO_prefs_t* const prefs, int excludeCompressedFiles);
|
||||||
void FIO_setPatchFromMode(FIO_prefs_t* const prefs, int value);
|
void FIO_setPatchFromMode(FIO_prefs_t* const prefs, int value);
|
||||||
|
void FIO_setNoContentSize(FIO_prefs_t* const prefs, int value);
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Single File functions
|
* Single File functions
|
||||||
|
@@ -634,7 +634,8 @@ int main(int const argCount, const char* argv[])
|
|||||||
setRealTimePrio = 0,
|
setRealTimePrio = 0,
|
||||||
singleThread = 0,
|
singleThread = 0,
|
||||||
showDefaultCParams = 0,
|
showDefaultCParams = 0,
|
||||||
ultra=0;
|
ultra=0,
|
||||||
|
noContentSize=0;
|
||||||
double compressibility = 0.5;
|
double compressibility = 0.5;
|
||||||
unsigned bench_nbSeconds = 3; /* would be better if this value was synchronized from bench */
|
unsigned bench_nbSeconds = 3; /* would be better if this value was synchronized from bench */
|
||||||
size_t blockSize = 0;
|
size_t blockSize = 0;
|
||||||
@@ -748,6 +749,7 @@ int main(int const argCount, const char* argv[])
|
|||||||
if (!strcmp(argument, "--priority=rt")) { setRealTimePrio = 1; continue; }
|
if (!strcmp(argument, "--priority=rt")) { setRealTimePrio = 1; continue; }
|
||||||
if (!strcmp(argument, "--output-dir-flat")) {nextArgumentIsOutDirName=1; lastCommand=1; continue; }
|
if (!strcmp(argument, "--output-dir-flat")) {nextArgumentIsOutDirName=1; lastCommand=1; continue; }
|
||||||
if (!strcmp(argument, "--show-default-cparams")) { showDefaultCParams = 1; continue; }
|
if (!strcmp(argument, "--show-default-cparams")) { showDefaultCParams = 1; continue; }
|
||||||
|
if (!strcmp(argument, "--no-content-size")) { noContentSize = 1; continue; }
|
||||||
if (!strcmp(argument, "--adapt")) { adapt = 1; continue; }
|
if (!strcmp(argument, "--adapt")) { adapt = 1; continue; }
|
||||||
if (longCommandWArg(&argument, "--adapt=")) { adapt = 1; if (!parseAdaptParameters(argument, &adaptMin, &adaptMax)) { badusage(programName); CLEAN_RETURN(1); } continue; }
|
if (longCommandWArg(&argument, "--adapt=")) { adapt = 1; if (!parseAdaptParameters(argument, &adaptMin, &adaptMax)) { badusage(programName); CLEAN_RETURN(1); } continue; }
|
||||||
if (!strcmp(argument, "--single-thread")) { nbWorkers = 0; singleThread = 1; continue; }
|
if (!strcmp(argument, "--single-thread")) { nbWorkers = 0; singleThread = 1; continue; }
|
||||||
@@ -1256,6 +1258,7 @@ int main(int const argCount, const char* argv[])
|
|||||||
FIO_setMemLimit(prefs, memLimit);
|
FIO_setMemLimit(prefs, memLimit);
|
||||||
if (operation==zom_compress) {
|
if (operation==zom_compress) {
|
||||||
#ifndef ZSTD_NOCOMPRESS
|
#ifndef ZSTD_NOCOMPRESS
|
||||||
|
FIO_setNoContentSize(prefs, noContentSize);
|
||||||
FIO_setNbWorkers(prefs, nbWorkers);
|
FIO_setNbWorkers(prefs, nbWorkers);
|
||||||
FIO_setBlockSize(prefs, (int)blockSize);
|
FIO_setBlockSize(prefs, (int)blockSize);
|
||||||
if (g_overlapLog!=OVERLAP_LOG_DEFAULT) FIO_setOverlapLog(prefs, (int)g_overlapLog);
|
if (g_overlapLog!=OVERLAP_LOG_DEFAULT) FIO_setOverlapLog(prefs, (int)g_overlapLog);
|
||||||
|
Reference in New Issue
Block a user