]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Rename applyCCtxParams()
authorStella Lau <laus@fb.com>
Wed, 30 Aug 2017 01:03:06 +0000 (18:03 -0700)
committerStella Lau <laus@fb.com>
Wed, 30 Aug 2017 01:03:06 +0000 (18:03 -0700)
lib/compress/zstd_compress.c
lib/zstd.h
tests/roundTripCrash.c
tests/zstreamtest.c

index 4251bbb01d0d16d74df8900a92e82096e2576d38..436e73cee1dc3b4a3504fbf4439474a9f400d745 100644 (file)
@@ -465,7 +465,8 @@ size_t ZSTD_CCtxParam_setParameter(
  *
  * Pledged srcSize is treated as unknown.
  */
-size_t ZSTD_CCtx_applyCCtxParams(ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params)
+size_t ZSTD_CCtx_setParametersUsingCCtxParams(
+        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params)
 {
     if (cctx->streamStage != zcss_init) return ERROR(stage_wrong);
     if (cctx->cdict) return ERROR(stage_wrong);
index 8ac5648845d783c9b9cb9ba8fdd1c49152a1f840..e062f6d2b2b448fb61d063918e5935592eba3518 100644 (file)
@@ -1109,7 +1109,7 @@ size_t ZSTD_compress_generic_simpleArgs (
  *  - ZSTD_CCtxParam_setParameter() : Push parameters one by one into an
  *  existing ZSTD_CCtx_params structure. This is similar to
  *  ZSTD_CCtx_setParameter().
- *  - ZSTD_CCtx_applyCCtxParams() : Apply parameters to an existing CCtx. These
+ *  - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to an existing CCtx. These
  *  parameters will be applied to all subsequent compression jobs.
  *  - ZSTD_compress_generic() : Do compression using the CCtx.
  *  - ZSTD_freeCCtxParams() : Free the memory.
@@ -1141,19 +1141,20 @@ ZSTDLIB_API size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);
 /*! ZSTD_CCtxParam_setParameter() :
  *  Similar to ZSTD_CCtx_setParameter.
  *  Set one compression parameter, selected by enum ZSTD_cParameter.
- *  Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_applyCCtxParams().
+ *  Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_setParametersUsingCCtxParams().
  *  Note : when `value` is an enum, cast it to unsigned for proper type checking.
  *  @result : 0, or an error code (which can be tested with ZSTD_isError()).
  */
 ZSTDLIB_API size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value);
 
-/*! ZSTD_CCtx_applyCCtxParams() :
+/*! ZSTD_CCtx_setParametersUsingCCtxParams() :
  * Apply a set of ZSTD_CCtx_params to the compression context.
  * This must be done before the dictionary is loaded.
  * The pledgedSrcSize is treated as unknown.
  * Multithreading parameters are applied only if nbThreads > 1.
  */
-ZSTDLIB_API size_t ZSTD_CCtx_applyCCtxParams(ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);
+ZSTDLIB_API size_t ZSTD_CCtx_setParametersUsingCCtxParams(
+        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);
 
 /**
     Block functions
index cb0221c5804d12f1e4712dbe01788af7f568b9e7..41e5d4472713549801e6ce3a0b19b2a7399502ca 100644 (file)
@@ -98,7 +98,7 @@ static size_t cctxParamRoundTripTest(void* resultBuff, size_t resultBuffCapacity
 
 
     /* Apply parameters */
-    CHECK_Z( ZSTD_CCtx_applyCCtxParams(cctx, cctxParams) );
+    CHECK_Z( ZSTD_CCtx_setParametersUsingCCtxParams(cctx, cctxParams) );
 
     CHECK_Z (ZSTD_compress_generic(cctx, &outBuffer, &inBuffer, ZSTD_e_end) );
 
index 5d6ef416843cd8a9bb8b94fd40b62b7a9c0c7a6c..f8683ac78c807dace585050e7e748a20c1121437 100644 (file)
@@ -1381,7 +1381,7 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double
 
                 /* Apply parameters */
                 if (useOpaqueAPI) {
-                    CHECK_Z (ZSTD_CCtx_applyCCtxParams(zc, cctxParams) );
+                    CHECK_Z (ZSTD_CCtx_setParametersUsingCCtxParams(zc, cctxParams) );
                 }
 
                 if (FUZ_rand(&lseed) & 1) {
@@ -1393,8 +1393,8 @@ static int fuzzerTests_newAPI(U32 seed, U32 nbTests, unsigned startTest, double
                     if (dict && dictSize) {
                         /* test that compression parameters are rejected (correctly) after loading a non-NULL dictionary */
                         if (useOpaqueAPI) {
-                            size_t const setError = ZSTD_CCtx_applyCCtxParams(zc, cctxParams);
-                            CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_applyCCtxParams should have failed");
+                            size_t const setError = ZSTD_CCtx_setParametersUsingCCtxParams(zc, cctxParams);
+                            CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_setParametersUsingCCtxParams should have failed");
                         } else {
                             size_t const setError = ZSTD_CCtx_setParameter(zc, ZSTD_p_windowLog, cParams.windowLog-1);
                             CHECK(!ZSTD_isError(setError), "ZSTD_CCtx_setParameter should have failed");