Function zstd_sys::ZSTD_registerSequenceProducer

source ·
pub unsafe extern "C" fn ZSTD_registerSequenceProducer(
    cctx: *mut ZSTD_CCtx,
    sequenceProducerState: *mut c_void,
    sequenceProducer: ZSTD_sequenceProducer_F,
)
Expand description

ZSTD_registerSequenceProducer() : Instruct zstd to use a block-level external sequence producer function.

The sequenceProducerState must be initialized by the caller, and the caller is responsible for managing its lifetime. This parameter is sticky across compressions. It will remain set until the user explicitly resets compression parameters.

Sequence producer registration is considered to be an “advanced parameter”, part of the “advanced API”. This means it will only have an effect on compression APIs which respect advanced parameters, such as compress2() and compressStream2(). Older compression APIs such as compressCCtx(), which predate the introduction of “advanced parameters”, will ignore any external sequence producer setting.

The sequence producer can be “cleared” by registering a NULL function pointer. This removes all limitations described above in the “LIMITATIONS” section of the API docs.

The user is strongly encouraged to read the full API documentation (above) before calling this function.