Tried to figure out how to restore values when using the ZSTD_CCtx setParameter function.
I understood only on the example of setting the compression level, like this for example:
cctx = ZSTD_createCCtx();
size_t ZSTD_CCtx_setParameter_ = ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, 22);
status_error = ZSTD_isError(ZSTD_CCtx_setParameter_);
if (status_error != 0)
{
std::cout<<ZSTD_getErrorName(ZSTD_CCtx_setParameter_)<<std::endl;
return 1;
}
In this case, everything is clear - the Enum "ZSTD_c_compressionLevel" parameter is passed to the function and the compression level is set to choose from from 0 to 22.
But here's an example:
ZSTD_c_enableLongDistanceMatching; //Enable long distance matching.
cctx = ZSTD_createCCtx();
size_t ZSTD_CCtx_setParameter_ = ZSTD_CCtx_setParameter(cctx, ZSTD_c_enableLongDistanceMatching, ???);
And how to Enable it then?? What value should I set then?? The description doesn't say anything about it.
Tell me please.
Use the source, Luke.
Right above the documentation for the
ZSTD_CCtx_setParameter
function is the following:And peering into the implementation of that function you can find the applicable lower and upper bounds:
In summary, the answer to your question is: