bounds.lowerBound = (int)ZSTD_bm_buffered;
bounds.upperBound = (int)ZSTD_bm_stable;
return bounds;
+
+ case ZSTD_c_blockDelimiters:
+ bounds.lowerBound = (int)ZSTD_sf_noBlockDelimiters;
+ bounds.upperBound = (int)ZSTD_sf_explicitBlockDelimiters;
+ return bounds;
default:
bounds.error = ERROR(parameter_unsupported);
case ZSTD_c_srcSizeHint:
case ZSTD_c_stableInBuffer:
case ZSTD_c_stableOutBuffer:
+ case ZSTD_c_blockDelimiters:
default:
return 0;
}
case ZSTD_c_srcSizeHint:
case ZSTD_c_stableInBuffer:
case ZSTD_c_stableOutBuffer:
+ case ZSTD_c_blockDelimiters:
break;
default: RETURN_ERROR(parameter_unsupported, "unknown parameter");
BOUNDCHECK(ZSTD_c_stableOutBuffer, value);
CCtxParams->outBufferMode = (ZSTD_bufferMode_e)value;
return CCtxParams->outBufferMode;
+
+ case ZSTD_c_blockDelimiters:
+ BOUNDCHECK(ZSTD_c_blockDelimiters, value);
+ CCtxParams->blockDelimiters = (ZSTD_sequenceFormat_e)value;
+ return CCtxParams->blockDelimiters;
default: RETURN_ERROR(parameter_unsupported, "unknown parameter");
}
case ZSTD_c_stableOutBuffer :
*value = (int)CCtxParams->outBufferMode;
break;
+ case ZSTD_c_blockDelimiters :
+ *value = (int)CCtxParams->blockDelimiters;
+ break;
default: RETURN_ERROR(parameter_unsupported, "unknown parameter");
}
return 0;
zc->ldmState.loadedDictEnd = 0;
}
- zc->blockDelimiters = ZSTD_sf_noBlockDelimiters;
- zc->calculateRepcodes = ZSTD_sf_calculateRepcodes;
-
/* Due to alignment, when reusing a workspace, we can actually consume
* up to 3 extra bytes for alignment. See the comments in zstd_cwksp.h
*/
ZSTD_bufferMode_e inBufferMode;
ZSTD_bufferMode_e outBufferMode;
+ /* Sequence compression API */
+ ZSTD_sequenceFormat_e blockDelimiters;
+
/* Internal use, for createCCtxParams() and freeCCtxParams() only */
ZSTD_customMem customMem;
}; /* typedef'd to ZSTD_CCtx_params within "zstd.h" */
const ZSTD_CDict* cdict;
ZSTD_prefixDict prefixDict; /* single-usage dictionary */
- /* Sequence compression API */
- ZSTD_sequenceFormat_blockBoundaries_e blockDelimiters;
- ZSTD_sequenceFormat_repcodes_e calculateRepcodes;
-
/* Multi-threading */
#ifdef ZSTD_MULTITHREAD
ZSTDMT_CCtx* mtctx;
* ZSTD_c_enableDedicatedDictSearch
* ZSTD_c_stableInBuffer
* ZSTD_c_stableOutBuffer
+ * ZSTD_c_blockDelimiters
* Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
* note : never ever use experimentalParam? names directly;
* also, the enums values themselves are unstable and can still change.
ZSTD_c_experimentalParam7=1004,
ZSTD_c_experimentalParam8=1005,
ZSTD_c_experimentalParam9=1006,
- ZSTD_c_experimentalParam10=1007
+ ZSTD_c_experimentalParam10=1007,
+ ZSTD_c_experimentalParam11=1008
} ZSTD_cParameter;
typedef struct {
ZSTDLIB_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
typedef enum {
- ZSTD_sf_noBlockDelimiters, /* Representation of ZSTD_Sequence has no block delimiters, sequences only */
- ZSTD_sf_explicitBlockDelimiters /* Representation of ZSTD_Sequence contains explicit block delimiters */
-} ZSTD_sequenceFormat_blockBoundaries_e;
-
-typedef enum {
- ZSTD_sf_calculateRepcodes,
- ZSTD_sf_noCalculateRepcodes
-} ZSTD_sequenceFormat_repcodes_e;
+ ZSTD_sf_noBlockDelimiters = 0, /* Representation of ZSTD_Sequence has no block delimiters, sequences only */
+ ZSTD_sf_explicitBlockDelimiters = 1 /* Representation of ZSTD_Sequence contains explicit block delimiters */
+} ZSTD_sequenceFormat_e;
/*! ZSTD_generateSequences() :
* Generate sequences using ZSTD_compress2, given a source buffer.
*
* zc can be used to insert custom compression params.
* This function invokes ZSTD_compress2
+ *
+ * The output of this function can be fed into ZSTD_compressSequences() with ZSTD_c_explicitBlockDelimiters
+ * set to ZSTD_sf_explicitBlockDelimiters
* @return : number of sequences generated
*/
*
* As such, the final generated result has no explicit representation of block boundaries,
* and the final last literals segment is not represented in the sequences.
+ *
+ * The output of this function can be fed into ZSTD_compressSequences() with ZSTD_c_blockDelimiters
+ * set to ZSTD_sf_noBlockDelimiters
* @return : number of sequences left after merging
*/
ZSTDLIB_API size_t ZSTD_mergeBlockDelimiters(ZSTD_Sequence* sequences, size_t seqsSize);
*/
#define ZSTD_c_stableOutBuffer ZSTD_c_experimentalParam10
+/* ZSTD_c_blockDelimiters
+ * Default is 0 == ZSTD_sf_noBlockDelimiters.
+ *
+ * For use with sequence compression API: ZSTD_compressSequences().
+ * Designates whether or not the given array of ZSTD_Sequence contains block delimiters
+ * which are defined as sequences with offset == 0 and matchLength == 0.
+ */
+#define ZSTD_c_blockDelimiters ZSTD_c_experimentalParam11
+
/*! ZSTD_CCtx_getParameter() :
* Get the requested compression parameter value, selected by enum ZSTD_cParameter,
* and store it into int* value.