]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add new enum for different sequence formats for ingestion/extraction
authorsenhuang42 <senhuang96@fb.com>
Mon, 2 Nov 2020 15:15:53 +0000 (10:15 -0500)
committersenhuang42 <senhuang96@fb.com>
Mon, 2 Nov 2020 15:15:53 +0000 (10:15 -0500)
lib/zstd.h

index c1fb55cf5e201a0d0afd6193b6bf6e9de769a655..608ebd2f9d9bde9428bba50fa112bae08487f703 100644 (file)
@@ -1297,14 +1297,27 @@ ZSTDLIB_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcS
  *           or an error code (if srcSize is too small) */
 ZSTDLIB_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
 
+typedef enum {
+  ZSTD_sf_blockDelimiters = 0,
+  ZSTD_sf_noBlockDelimiters = 1,
+} ZSTD_sequenceFormat_e;
+
 /*! ZSTD_getSequences() :
  * Extract sequences from the sequence store.
- * Each block will end with a dummy sequence with offset == 0, matchLength == 0, and litLength == length of last literals.
+ * If invoked with ZSTD_sf_blockDelimiters, block will end with a dummy sequence
+ * with offset == 0, matchLength == 0, and litLength == length of last literals.
+ * 
+ * If invoked with ZSTD_sf_noBlockDelimiters, sequences will still be generated
+ * on a per-block basis, but any last literals of a block will be merged into the
+ * last literals of the first sequence in the next block with the exception of the
+ * final segment of last literals. As such, the final generated result has no
+ * explicit representation of block boundaries.
  * 
  * zc can be used to insert custom compression params.
  * This function invokes ZSTD_compress2
  * @return : number of sequences extracted
  */
+
 ZSTDLIB_API size_t ZSTD_getSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs,
     size_t outSeqsSize, const void* src, size_t srcSize);