ZSTD_DCtx_refDDict method

int ZSTD_DCtx_refDDict(
  1. Pointer<ZSTD_DCtx> dctx,
  2. Pointer<ZSTD_DDict> ddict
)

! ZSTD_DCtx_refDDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used to decompress next frames. The dictionary remains active for decompression of future frames using same DCtx.

If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function will store the DDict references in a table, and the DDict used for decompression will be determined at decompression time, as per the dict ID in the frame. The memory for the table is allocated on the first call to refDDict, and can be freed with ZSTD_freeDCtx().

If called with ZSTD_d_refMultipleDDicts disabled (the default), only one dictionary will be managed, and referencing a dictionary effectively "discards" any previous one.

@result : 0, or an error code (which can be tested with ZSTD_isError()). Special: referencing a NULL DDict means "return to no-dictionary mode". Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.

Implementation

int ZSTD_DCtx_refDDict(
    ffi.Pointer<ZSTD_DCtx> dctx,
    ffi.Pointer<ZSTD_DDict> ddict,
    ) {
  return _ZSTD_DCtx_refDDict(
    dctx,
    ddict,
  );
}