added prototypes for advanced parameters for decompression API

required to decode custom formats
This commit is contained in:
Yann Collet
2017-09-24 15:57:29 -07:00
parent e60f48c549
commit 7c3dea42ce
4 changed files with 251 additions and 69 deletions
+9
View File
@@ -256,6 +256,9 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned v
switch(param)
{
case ZSTD_p_format :
return ZSTD_CCtxParam_setParameter(&cctx->requestedParams, param, value);
case ZSTD_p_compressionLevel:
if (value == 0) return 0; /* special value : 0 means "don't change anything" */
if (cctx->cdict) return ERROR(stage_wrong);
@@ -326,6 +329,12 @@ size_t ZSTD_CCtxParam_setParameter(
{
switch(param)
{
case ZSTD_p_format :
if (value > (unsigned)ZSTD_f_zstd1_block)
return ERROR(parameter_unsupported);
params->format = (ZSTD_format_e)value;
return 0;
case ZSTD_p_compressionLevel :
if ((int)value > ZSTD_maxCLevel()) value = ZSTD_maxCLevel();
if (value == 0) return 0;