pub unsafe extern "C-unwind" fn inflateSetDictionary(
strm: *mut z_stream,
dictionary: *const u8,
dictLength: c_uint,
) -> c_intExpand description
Initializes the decompression dictionary from the given uncompressed byte sequence.
This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT.
The dictionary chosen by the compressor can be determined from the Adler-32 value returned by that call of inflate.
The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary).
For raw inflate, this function can be called at any time to set the dictionary.
If the provided dictionary is smaller than the window and there is already data in the window, then the provided dictionary will amend what’s there.
The application must insure that the same dictionary that was used for compression is provided.
inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate.
§Returns
Z_OKif successZ_STREAM_ERRORif the source stream state was inconsistent ordictionaryisNULLZ_DATA_ERRORif the given dictionary doesn’t match the expected one (i.e. it has an incorrect Adler-32 value).
§Safety
The caller must guarantee that
- Either
strmisNULLstrmsatisfies the requirements of&mut *strmand was initialized withinflateInit_or similar
- Either
dictionaryisNULLdictionaryanddictLengthsatisfy the requirements ofcore::slice::from_raw_parts_mut::<u8>