#[unsafe(export_name = "deflateCopy")]pub unsafe extern "C-unwind" fn deflateCopy(
dest: *mut z_stream,
source: *mut z_stream,
) -> i32Expand description
Sets the destination stream as a complete copy of the source stream.
This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter.
The streams that will be discarded should then be freed by calling deflateEnd.
Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory.
§Returns
Z_OKif successZ_MEM_ERRORif there was not enough memoryZ_STREAM_ERRORif the source stream state was inconsistent (such as zalloc being NULL)
The msg field is left unchanged in both source and destination.
§Safety
The caller must guarantee that
- Either
destisNULLdestsatisfies the requirements of&mut *(dest as *mut MaybeUninit<z_stream>)
- Either
sourceisNULLsourcesatisfies the requirements of&mut *strmand was initialized withdeflateInit_or similar