]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
publish new symbol ZSTD_compressSequencesAndLiterals()
authorYann Collet <cyan@fb.com>
Tue, 10 Dec 2024 02:17:34 +0000 (18:17 -0800)
committerYann Collet <cyan@fb.com>
Tue, 17 Dec 2024 04:44:03 +0000 (20:44 -0800)
lib/zstd.h
programs/zstdcli.c

index a78b6db45c63a29f290e3027011440a95244168b..cfacd58d0502460b4a32b48e990273215cff9b4e 100644 (file)
@@ -1656,6 +1656,21 @@ ZSTD_compressSequences( ZSTD_CCtx* cctx, void* dst, size_t dstSize,
                         const void* src, size_t srcSize);
 
 
+/*! ZSTD_compressSequencesAndLiterals() :
+ * This is a variant of ZSTD_compressSequences() which,
+ * instead of receiving (src,srcSize) as input parameter, receives (literals,litSize),
+ * aka all literals already extracted and grouped into a single continuous buffer.
+ * This can be useful if the process generating the sequences also happens to generate the buffer of literals,
+ * thus skipping an extraction + caching stage.
+ * To be valid, `litSize` must be equal to the sum of all @.litLength fields in @inSeqs.
+ * @return : final compressed size, or a ZSTD error code.
+ */
+ZSTDLIB_STATIC_API size_t
+ZSTD_compressSequencesAndLiterals( ZSTD_CCtx* cctx, void* dst, size_t dstSize,
+                        const ZSTD_Sequence* inSeqs, size_t inSeqsSize,
+                        const void* literals, size_t litSize);
+
+
 /*! ZSTD_writeSkippableFrame() :
  * Generates a zstd skippable frame containing data given by src, and writes it to dst buffer.
  *
index 024552d52b8b02c55ff8554d3429275e652bbe10..2a9a776249f7f68c35857d79cdf25282894f380f 100644 (file)
@@ -635,8 +635,6 @@ static unsigned parseCompressionParameters(const char* stringPtr, ZSTD_compressi
         return 0;
     }
 
-    DISPLAYLEVEL(4, "windowLog=%d, chainLog=%d, hashLog=%d, searchLog=%d \n", params->windowLog, params->chainLog, params->hashLog, params->searchLog);
-    DISPLAYLEVEL(4, "minMatch=%d, targetLength=%d, strategy=%d \n", params->minMatch, params->targetLength, params->strategy);
     if (stringPtr[0] != 0) return 0; /* check the end of string */
     return 1;
 }