getParameter fills an int*
rather than an unsigned* for consistency since type of setParameter() changed to int.
This commit is contained in:
+9
-16
@@ -351,7 +351,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inB
|
|||||||
<BR></pre>
|
<BR></pre>
|
||||||
|
|
||||||
<a name="Chapter12"></a><h2>Candidate API for promotion to stable status</h2><pre>
|
<a name="Chapter12"></a><h2>Candidate API for promotion to stable status</h2><pre>
|
||||||
The following symbols and constants are in "staging area" :
|
The following symbols and constants belong to the "staging area" :
|
||||||
they are considered to join "stable API" status by v1.4.0.
|
they are considered to join "stable API" status by v1.4.0.
|
||||||
The below proposal is written so that it can become stable "as is".
|
The below proposal is written so that it can become stable "as is".
|
||||||
It's still possible to suggest modifications.
|
It's still possible to suggest modifications.
|
||||||
@@ -771,9 +771,10 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
|||||||
|
|
||||||
<a name="Chapter14"></a><h2>experimental API (static linking only)</h2><pre>
|
<a name="Chapter14"></a><h2>experimental API (static linking only)</h2><pre>
|
||||||
The following symbols and constants
|
The following symbols and constants
|
||||||
are not planned to join "stable API" status anytime soon.
|
are not planned to join "stable API" status in the near future.
|
||||||
|
They can still change in future versions.
|
||||||
Some of them are planned to remain in the static_only section indefinitely.
|
Some of them are planned to remain in the static_only section indefinitely.
|
||||||
Some of them might even be removed in the future (especially when redundant with existing stable functions)
|
Some of them might be removed in the future (especially when redundant with existing stable functions)
|
||||||
|
|
||||||
<BR></pre>
|
<BR></pre>
|
||||||
|
|
||||||
@@ -788,9 +789,9 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
|||||||
} ZSTD_compressionParameters;
|
} ZSTD_compressionParameters;
|
||||||
</b></pre><BR>
|
</b></pre><BR>
|
||||||
<pre><b>typedef struct {
|
<pre><b>typedef struct {
|
||||||
unsigned contentSizeFlag; </b>/**< 1: content size will be in frame header (when known) */<b>
|
int contentSizeFlag; </b>/**< 1: content size will be in frame header (when known) */<b>
|
||||||
unsigned checksumFlag; </b>/**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection */<b>
|
int checksumFlag; </b>/**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection */<b>
|
||||||
unsigned noDictIDFlag; </b>/**< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression) */<b>
|
int noDictIDFlag; </b>/**< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression) */<b>
|
||||||
} ZSTD_frameParameters;
|
} ZSTD_frameParameters;
|
||||||
</b></pre><BR>
|
</b></pre><BR>
|
||||||
<pre><b>typedef struct {
|
<pre><b>typedef struct {
|
||||||
@@ -859,14 +860,6 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
|||||||
</b></pre><BR>
|
</b></pre><BR>
|
||||||
<a name="Chapter15"></a><h2>Frame size functions</h2><pre></pre>
|
<a name="Chapter15"></a><h2>Frame size functions</h2><pre></pre>
|
||||||
|
|
||||||
<pre><b>size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
|
|
||||||
</b><p> `src` should point to the start of a ZSTD encoded frame or skippable frame
|
|
||||||
`srcSize` must be >= first frame size
|
|
||||||
@return : the compressed size of the first frame starting at `src`,
|
|
||||||
suitable to pass to `ZSTD_decompress` or similar,
|
|
||||||
or an error code if input is invalid
|
|
||||||
</p></pre><BR>
|
|
||||||
|
|
||||||
<pre><b>unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
|
<pre><b>unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
|
||||||
</b><p> `src` should point the start of a series of ZSTD encoded and/or skippable frames
|
</b><p> `src` should point the start of a series of ZSTD encoded and/or skippable frames
|
||||||
`srcSize` must be the _exact_ size of this series
|
`srcSize` must be the _exact_ size of this series
|
||||||
@@ -1035,7 +1028,7 @@ static ZSTD_customMem const ZSTD_defaultCMem = { NULL, NULL, NULL }; </b>/**< t
|
|||||||
how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)
|
how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?)
|
||||||
</p></pre><BR>
|
</p></pre><BR>
|
||||||
|
|
||||||
<pre><b>size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned* value);
|
<pre><b>size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);
|
||||||
</b><p> Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
</b><p> Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
||||||
@result : 0, or an error code (which can be tested with ZSTD_isError()).
|
@result : 0, or an error code (which can be tested with ZSTD_isError()).
|
||||||
|
|
||||||
@@ -1086,7 +1079,7 @@ size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);
|
|||||||
|
|
||||||
</p></pre><BR>
|
</p></pre><BR>
|
||||||
|
|
||||||
<pre><b>size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned* value);
|
<pre><b>size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value);
|
||||||
</b><p> Similar to ZSTD_CCtx_getParameter.
|
</b><p> Similar to ZSTD_CCtx_getParameter.
|
||||||
Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
||||||
@result : 0, or an error code (which can be tested with ZSTD_isError()).
|
@result : 0, or an error code (which can be tested with ZSTD_isError()).
|
||||||
|
|||||||
@@ -620,13 +620,13 @@ size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* CCtxParams,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned* value)
|
size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value)
|
||||||
{
|
{
|
||||||
return ZSTD_CCtxParam_getParameter(&cctx->requestedParams, param, value);
|
return ZSTD_CCtxParam_getParameter(&cctx->requestedParams, param, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ZSTD_CCtxParam_getParameter(
|
size_t ZSTD_CCtxParam_getParameter(
|
||||||
ZSTD_CCtx_params* CCtxParams, ZSTD_cParameter param, unsigned* value)
|
ZSTD_CCtx_params* CCtxParams, ZSTD_cParameter param, int* value)
|
||||||
{
|
{
|
||||||
switch(param)
|
switch(param)
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-5
@@ -957,9 +957,9 @@ typedef struct {
|
|||||||
} ZSTD_compressionParameters;
|
} ZSTD_compressionParameters;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned contentSizeFlag; /**< 1: content size will be in frame header (when known) */
|
int contentSizeFlag; /**< 1: content size will be in frame header (when known) */
|
||||||
unsigned checksumFlag; /**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection */
|
int checksumFlag; /**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection */
|
||||||
unsigned noDictIDFlag; /**< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression) */
|
int noDictIDFlag; /**< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression) */
|
||||||
} ZSTD_frameParameters;
|
} ZSTD_frameParameters;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -1242,7 +1242,7 @@ ZSTDLIB_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* pre
|
|||||||
* Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
* Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
||||||
* @result : 0, or an error code (which can be tested with ZSTD_isError()).
|
* @result : 0, or an error code (which can be tested with ZSTD_isError()).
|
||||||
*/
|
*/
|
||||||
ZSTDLIB_API size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, unsigned* value);
|
ZSTDLIB_API size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);
|
||||||
|
|
||||||
|
|
||||||
/*! ZSTD_CCtx_params :
|
/*! ZSTD_CCtx_params :
|
||||||
@@ -1295,7 +1295,7 @@ ZSTDLIB_API size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cP
|
|||||||
* Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
* Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.
|
||||||
* @result : 0, or an error code (which can be tested with ZSTD_isError()).
|
* @result : 0, or an error code (which can be tested with ZSTD_isError()).
|
||||||
*/
|
*/
|
||||||
ZSTDLIB_API size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned* value);
|
ZSTDLIB_API size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value);
|
||||||
|
|
||||||
/*! ZSTD_CCtx_setParametersUsingCCtxParams() :
|
/*! ZSTD_CCtx_setParametersUsingCCtxParams() :
|
||||||
* Apply a set of ZSTD_CCtx_params to the compression context.
|
* Apply a set of ZSTD_CCtx_params to the compression context.
|
||||||
|
|||||||
+1
-1
@@ -504,7 +504,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
|||||||
{ ZSTD_CCtx* const cctx = ZSTD_createCCtx();
|
{ ZSTD_CCtx* const cctx = ZSTD_createCCtx();
|
||||||
ZSTD_outBuffer out = {NULL, 0, 0};
|
ZSTD_outBuffer out = {NULL, 0, 0};
|
||||||
ZSTD_inBuffer in = {NULL, 0, 0};
|
ZSTD_inBuffer in = {NULL, 0, 0};
|
||||||
unsigned value;
|
int value;
|
||||||
|
|
||||||
CHECK_Z(ZSTD_CCtx_getParameter(cctx, ZSTD_p_compressionLevel, &value));
|
CHECK_Z(ZSTD_CCtx_getParameter(cctx, ZSTD_p_compressionLevel, &value));
|
||||||
CHECK_EQ(value, 3);
|
CHECK_EQ(value, 3);
|
||||||
|
|||||||
+8
-8
@@ -223,13 +223,13 @@ static size_t SEQ_generateRoundTrip(ZSTD_CCtx* cctx, ZSTD_DCtx* dctx,
|
|||||||
|
|
||||||
static size_t getCCtxParams(ZSTD_CCtx* zc, ZSTD_parameters* savedParams)
|
static size_t getCCtxParams(ZSTD_CCtx* zc, ZSTD_parameters* savedParams)
|
||||||
{
|
{
|
||||||
unsigned value;
|
int value;
|
||||||
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_windowLog, &savedParams->cParams.windowLog));
|
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_windowLog, (int*)&savedParams->cParams.windowLog));
|
||||||
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_hashLog, &savedParams->cParams.hashLog));
|
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_hashLog, (int*)&savedParams->cParams.hashLog));
|
||||||
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_chainLog, &savedParams->cParams.chainLog));
|
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_chainLog, (int*)&savedParams->cParams.chainLog));
|
||||||
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_searchLog, &savedParams->cParams.searchLog));
|
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_searchLog, (int*)&savedParams->cParams.searchLog));
|
||||||
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_minMatch, &savedParams->cParams.minMatch));
|
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_minMatch, (int*)&savedParams->cParams.minMatch));
|
||||||
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_targetLength, &savedParams->cParams.targetLength));
|
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_targetLength, (int*)&savedParams->cParams.targetLength));
|
||||||
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_compressionStrategy, &value));
|
CHECK_RET_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_compressionStrategy, &value));
|
||||||
savedParams->cParams.strategy = value;
|
savedParams->cParams.strategy = value;
|
||||||
|
|
||||||
@@ -962,7 +962,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
|||||||
DISPLAYLEVEL(3, "OK \n");
|
DISPLAYLEVEL(3, "OK \n");
|
||||||
|
|
||||||
DISPLAYLEVEL(3, "test%3i : ZSTD_initCStream_srcSize sets requestedParams : ", testNb++);
|
DISPLAYLEVEL(3, "test%3i : ZSTD_initCStream_srcSize sets requestedParams : ", testNb++);
|
||||||
{ unsigned level;
|
{ int level;
|
||||||
CHECK_Z(ZSTD_initCStream_srcSize(zc, 11, ZSTD_CONTENTSIZE_UNKNOWN));
|
CHECK_Z(ZSTD_initCStream_srcSize(zc, 11, ZSTD_CONTENTSIZE_UNKNOWN));
|
||||||
CHECK_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_compressionLevel, &level));
|
CHECK_Z(ZSTD_CCtx_getParameter(zc, ZSTD_p_compressionLevel, &level));
|
||||||
CHECK(level != 11, "Compression level does not match");
|
CHECK(level != 11, "Compression level does not match");
|
||||||
|
|||||||
Reference in New Issue
Block a user