Add function initializing cctxParams from clevel

This commit is contained in:
Stella Lau
2017-08-25 13:36:47 -07:00
parent 9911153723
commit 0744592d38
3 changed files with 16 additions and 6 deletions
+6 -1
View File
@@ -282,7 +282,12 @@ size_t ZSTD_resetCCtxParams(ZSTD_CCtx_params* params)
return 0;
}
size_t ZSTD_initCCtxParams(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params)
size_t ZSTD_initCCtxParams(ZSTD_CCtx_params* cctxParams, int compressionLevel) {
ZSTD_parameters const params = ZSTD_getParams(compressionLevel, 0, 0);
return ZSTD_initCCtxParams_advanced(cctxParams, params);
}
size_t ZSTD_initCCtxParams_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params)
{
if (!cctxParams) { return ERROR(GENERIC); }
CHECK_F( ZSTD_checkCParams(params.cParams) );