]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add legacy mode in documentation
authorshakeelrao <shakeelrao79@gmail.com>
Tue, 19 Mar 2019 03:33:15 +0000 (20:33 -0700)
committershakeelrao <shakeelrao79@gmail.com>
Tue, 19 Mar 2019 03:33:15 +0000 (20:33 -0700)
16 files changed:
lib/decompress/zstd_decompress.c
lib/legacy/zstd_v01.c
lib/legacy/zstd_v01.h
lib/legacy/zstd_v02.c
lib/legacy/zstd_v02.h
lib/legacy/zstd_v03.c
lib/legacy/zstd_v03.h
lib/legacy/zstd_v04.c
lib/legacy/zstd_v04.h
lib/legacy/zstd_v05.c
lib/legacy/zstd_v05.h
lib/legacy/zstd_v06.c
lib/legacy/zstd_v06.h
lib/legacy/zstd_v07.c
lib/legacy/zstd_v07.h
lib/zstd.h

index 7870bae5082fb401643984bd5dc6f149d896c0de..142923fe4bc83e35575b7f4ea7fe552fe87ff409 100644 (file)
@@ -518,7 +518,7 @@ size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)
 
 
 /** ZSTD_decompressBound() :
- *  currently incompatible with legacy mode
+ *  compatible with legacy mode
  *  `src` must point to the start of a ZSTD frame or a skippeable frame
  *  `srcSize` must be at least as large as the frame contained
  *  @return : the maximum decompressed size of the compressed source
index 0f77533fcf26a7b2dd92c5ffd448aa8f6f11c592..bb0f4b5932108d663e64152535cfea2ab7d74ff3 100644 (file)
@@ -2001,6 +2001,8 @@ size_t ZSTDv01_decompress(void* dst, size_t maxDstSize, const void* src, size_t
     return ZSTDv01_decompressDCtx(&ctx, dst, maxDstSize, src, srcSize);
 }
 
+/* ZSTD_errorFrameSizeInfoLegacy() :
+   assumes `cSize` and `dBound` are _not_ NULL */
 static void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
 {
     *cSize = ret;
index bcc3545fddb116d4c670aecfed39636b3f8e4e15..8329429a3227df4861efaec556ac8b24b430cf97 100644 (file)
@@ -42,6 +42,8 @@ size_t ZSTDv01_decompress( void* dst, size_t maxOriginalSize,
                                 or an errorCode if it fails (which can be tested using ZSTDv01_isError())
      dBound (output paramter) : an upper-bound for the decompressed size of the data in the frame
                                 or ZSTD_CONTENTSIZE_ERROR if an error occurs
+
+     note : assumes `cSize` and `dBound` are _not_ NULL.
  */
 void ZSTDv01_findFrameSizeInfoLegacy(const void *src, size_t srcSize,
                                      size_t* cSize, unsigned long long* dBound);
index 1d7c206496b1fa53f0ac81079e42bc76a8ce6547..594835943f448a2cdb770ff6f11211156f7764d1 100644 (file)
@@ -3314,7 +3314,9 @@ static size_t ZSTD_decompress(void* dst, size_t maxDstSize, const void* src, siz
     return ZSTD_decompressDCtx(&ctx, dst, maxDstSize, src, srcSize);
 }
 
-MEM_STATIC void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
+/* ZSTD_errorFrameSizeInfoLegacy() :
+   assumes `cSize` and `dBound` are _not_ NULL */
+static void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
 {
     *cSize = ret;
     *dBound = ZSTD_CONTENTSIZE_ERROR;
index 5e6911f8a70bf4509092d9a00caf35e551c0346d..556d509e33dee817e900aceb98342ecef5cae7a8 100644 (file)
@@ -42,6 +42,8 @@ size_t ZSTDv02_decompress( void* dst, size_t maxOriginalSize,
                                 or an errorCode if it fails (which can be tested using ZSTDv01_isError())
      dBound (output paramter) : an upper-bound for the decompressed size of the data in the frame
                                 or ZSTD_CONTENTSIZE_ERROR if an error occurs
+
+    note : assumes `cSize` and `dBound` are _not_ NULL.
  */
 void ZSTDv02_findFrameSizeInfoLegacy(const void *src, size_t srcSize,
                                      size_t* cSize, unsigned long long* dBound);
index 2aac45d187f62787b5dc1aede940731c568ff393..b6c60d296c86b8fe05a1089b2ac3c4144dc02f41 100644 (file)
@@ -2955,6 +2955,8 @@ static size_t ZSTD_decompress(void* dst, size_t maxDstSize, const void* src, siz
     return ZSTD_decompressDCtx(&ctx, dst, maxDstSize, src, srcSize);
 }
 
+/* ZSTD_errorFrameSizeInfoLegacy() :
+   assumes `cSize` and `dBound` are _not_ NULL */
 MEM_STATIC void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
 {
     *cSize = ret;
index 6bde907f00c0b0b6eb8eb7d979451ba457d69950..c2d9f191fc6f48df44d1312ccf911109a53b1731 100644 (file)
@@ -42,6 +42,9 @@ size_t ZSTDv03_decompress( void* dst, size_t maxOriginalSize,
                                 or an errorCode if it fails (which can be tested using ZSTDv01_isError())
      dBound (output paramter) : an upper-bound for the decompressed size of the data in the frame
                                 or ZSTD_CONTENTSIZE_ERROR if an error occurs
+
+    note : assumes `cSize` and `dBound` are _not_ NULL.
+
  */
  void ZSTDv03_findFrameSizeInfoLegacy(const void *src, size_t srcSize,
                                       size_t* cSize, unsigned long long* dBound);
index 22de6b94da6e334e92363e74b447e776fb10bfa1..65dc64dbbabd7eb4f0249816bfd9b0f5f480ee64 100644 (file)
@@ -3121,7 +3121,9 @@ static size_t ZSTD_decompress_usingDict(ZSTD_DCtx* ctx,
     return op-ostart;
 }
 
-MEM_STATIC void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
+/* ZSTD_errorFrameSizeInfoLegacy() :
+   assumes `cSize` and `dBound` are _not_ NULL */
+static void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
 {
     *cSize = ret;
     *dBound = ZSTD_CONTENTSIZE_ERROR;
index 11b3c00b3a264b3672093461388a87249ea16c41..84a3e7d70127ecb5afb30bec5509d9efa7252577 100644 (file)
@@ -42,6 +42,8 @@ size_t ZSTDv04_decompress( void* dst, size_t maxOriginalSize,
                                 or an errorCode if it fails (which can be tested using ZSTDv01_isError())
      dBound (output paramter) : an upper-bound for the decompressed size of the data in the frame
                                 or ZSTD_CONTENTSIZE_ERROR if an error occurs
+
+    note : assumes `cSize` and `dBound` are _not_ NULL.
  */
  void ZSTDv04_findFrameSizeInfoLegacy(const void *src, size_t srcSize,
                                       size_t* cSize, unsigned long long* dBound);
index 469466b14c8f0db95743dd1cf2ffa94d23137247..1c39f2f2682fac2ea11d675e465f8c1d0e398549 100644 (file)
@@ -3510,7 +3510,9 @@ size_t ZSTDv05_decompress(void* dst, size_t maxDstSize, const void* src, size_t
 #endif
 }
 
-MEM_STATIC void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
+/* ZSTD_errorFrameSizeInfoLegacy() :
+   assumes `cSize` and `dBound` are _not_ NULL */
+static void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
 {
     *cSize = ret;
     *dBound = ZSTD_CONTENTSIZE_ERROR;
index 2d95084b6e947d2b1c1617a03e442ada300997f4..3b866083a3d128b4e77234fa87ffe8803f9be76a 100644 (file)
@@ -40,6 +40,9 @@ size_t ZSTDv05_decompress( void* dst, size_t dstCapacity,
                                 or an errorCode if it fails (which can be tested using ZSTDv01_isError())
      dBound (output paramter) : an upper-bound for the decompressed size of the data in the frame
                                 or ZSTD_CONTENTSIZE_ERROR if an error occurs
+
+    note : assumes `cSize` and `dBound` are _not_ NULL.
+
  */
 void ZSTDv05_findFrameSizeInfoLegacy(const void *src, size_t srcSize,
                                      size_t* cSize, unsigned long long* dBound);
index 2daea0e9148a8e236efecf318de20aace036a19e..65975ac2933af39e6777b839476c43ee54be7440 100644 (file)
@@ -3656,7 +3656,9 @@ size_t ZSTDv06_decompress(void* dst, size_t dstCapacity, const void* src, size_t
 #endif
 }
 
-MEM_STATIC void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
+/* ZSTD_errorFrameSizeInfoLegacy() :
+   assumes `cSize` and `dBound` are _not_ NULL */
+static void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
 {
     *cSize = ret;
     *dBound = ZSTD_CONTENTSIZE_ERROR;
index 71d3b6af118cdae95d07f3ba7db38d7c348bd7d5..971429c9b9667d5922b701921a87d47888fab94d 100644 (file)
@@ -49,6 +49,9 @@ ZSTDv06_findFrameSizeInfoLegacy() : get the source length and decompressed bound
                                or an errorCode if it fails (which can be tested using ZSTDv01_isError())
     dBound (output paramter) : an upper-bound for the decompressed size of the data in the frame
                                or ZSTD_CONTENTSIZE_ERROR if an error occurs
+
+    note : assumes `cSize` and `dBound` are _not_ NULL.
+
 */
 void ZSTDv06_findFrameSizeInfoLegacy(const void *src, size_t srcSize,
                                      size_t* cSize, unsigned long long* dBound);
index 89fe7d5aae5d3dab44352d71b3b0026ef4d70778..443524b3ac214f573b2905e87b62e9ce67a426ca 100644 (file)
@@ -3897,7 +3897,9 @@ size_t ZSTDv07_decompress(void* dst, size_t dstCapacity, const void* src, size_t
 #endif
 }
 
-MEM_STATIC void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
+/* ZSTD_errorFrameSizeInfoLegacy() :
+   assumes `cSize` and `dBound` are _not_ NULL */
+static void ZSTD_errorFrameSizeInfoLegacy(size_t* cSize, unsigned long long* dBound, size_t ret)
 {
     *cSize = ret;
     *dBound = ZSTD_CONTENTSIZE_ERROR;
index 912ff7c5e119bec752695315b959b3f4a2562e69..c8144bd61bbc8245addb19ce2e741af308362e30 100644 (file)
@@ -56,6 +56,9 @@ ZSTDv07_findFrameSizeInfoLegacy() : get the source length and decompressed bound
                                or an errorCode if it fails (which can be tested using ZSTDv01_isError())
     dBound (output paramter) : an upper-bound for the decompressed size of the data in the frame
                                or ZSTD_CONTENTSIZE_ERROR if an error occurs
+
+    note : assumes `cSize` and `dBound` are _not_ NULL.
+
 */
 void ZSTDv07_findFrameSizeInfoLegacy(const void *src, size_t srcSize,
                                      size_t* cSize, unsigned long long* dBound);
index 4373d6dfd3658cae03df0497af29f7ec85bde7dc..f6332589d6b3ef58327e22483d2a802352d0269f 100644 (file)
@@ -1115,7 +1115,7 @@ ZSTDLIB_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t
  *  @return : - upper-bound for the decompressed size of all data in all successive frames
  *            - if an error occured: ZSTD_CONTENTSIZE_ERROR
  *
- *  note 1  : an error can occur if `src` contains a legacy frame or an invalid/incorrectly formatted frame.
+ *  note 1  : an error can occur if `src` contains an invalid or incorrectly formatted frame.
  *  note 2  : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`.
  *            in this case, `ZSTD_findDecompressedSize` and `ZSTD_decompressBound` return the same value.
  *  note 3  : when the decompressed size field isn't available, the upper-bound for that frame is calculated by: