mirror of
https://github.com/facebook/zstd.git
synced 2025-08-08 17:22:10 +03:00
promote ZSTD_getDecompressedSize() to stable API
This commit is contained in:
@@ -85,9 +85,6 @@ static const ZSTD_DDict* createDict(const char* dictFileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* prototype declared here, as it currently is part of experimental section */
|
|
||||||
unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
|
|
||||||
|
|
||||||
static void decompress(const char* fname, const ZSTD_DDict* ddict)
|
static void decompress(const char* fname, const ZSTD_DDict* ddict)
|
||||||
{
|
{
|
||||||
size_t cSize;
|
size_t cSize;
|
||||||
|
@@ -74,9 +74,6 @@ static void* loadFile_X(const char* fileName, size_t* size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* prototype declared here, as it is currently part of experimental section */
|
|
||||||
unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
|
|
||||||
|
|
||||||
static void decompress(const char* fname)
|
static void decompress(const char* fname)
|
||||||
{
|
{
|
||||||
size_t cSize;
|
size_t cSize;
|
||||||
|
@@ -85,9 +85,14 @@ ZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity,
|
|||||||
const void* src, size_t srcSize,
|
const void* src, size_t srcSize,
|
||||||
int compressionLevel);
|
int compressionLevel);
|
||||||
|
|
||||||
|
/** ZSTD_getDecompressedSize() :
|
||||||
|
* @return : decompressed size if known, 0 otherwise.
|
||||||
|
note : to know precise reason why result is `0`, follow up with ZSTD_getFrameParams() */
|
||||||
|
unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
|
||||||
|
|
||||||
/*! ZSTD_decompress() :
|
/*! ZSTD_decompress() :
|
||||||
`compressedSize` : is the _exact_ size of the compressed blob, otherwise decompression will fail.
|
`compressedSize` : is the _exact_ size of compressed input, otherwise decompression will fail.
|
||||||
`dstCapacity` must be large enough, equal or larger than originalSize.
|
`dstCapacity` must be equal or larger than originalSize.
|
||||||
@return : the number of bytes decompressed into `dst` (<= `dstCapacity`),
|
@return : the number of bytes decompressed into `dst` (<= `dstCapacity`),
|
||||||
or an errorCode if it fails (which can be tested using ZSTD_isError()) */
|
or an errorCode if it fails (which can be tested using ZSTD_isError()) */
|
||||||
ZSTDLIB_API size_t ZSTD_decompress( void* dst, size_t dstCapacity,
|
ZSTDLIB_API size_t ZSTD_decompress( void* dst, size_t dstCapacity,
|
||||||
@@ -298,15 +303,6 @@ ZSTDLIB_API size_t ZSTD_compress_advanced (ZSTD_CCtx* ctx,
|
|||||||
|
|
||||||
/*--- Advanced Decompression functions ---*/
|
/*--- Advanced Decompression functions ---*/
|
||||||
|
|
||||||
/** ZSTD_getDecompressedSize() :
|
|
||||||
* compatible with legacy mode
|
|
||||||
* @return : decompressed size if known, 0 otherwise
|
|
||||||
note : 0 can mean any of the following :
|
|
||||||
- decompressed size is not provided within frame header
|
|
||||||
- frame header unknown / not supported
|
|
||||||
- frame header not completely provided (`srcSize` too small) */
|
|
||||||
unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
|
|
||||||
|
|
||||||
/*! ZSTD_createDCtx_advanced() :
|
/*! ZSTD_createDCtx_advanced() :
|
||||||
* Create a ZSTD decompression context using external alloc and free functions */
|
* Create a ZSTD decompression context using external alloc and free functions */
|
||||||
ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
|
ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
|
||||||
|
Reference in New Issue
Block a user