Function

compression_stream_init(_:_:_:)

Initializes a compression stream for either compression or decompression.

Declaration

func compression_stream_init(_ stream: UnsafeMutablePointer<compression_stream>, _ operation: compression_stream_operation, _ algorithm: compression_algorithm) -> compression_status

Parameters

stream

Pointer to an allocated compression_stream structure.

operation

A constant of type compression_stream_operation used to indicate the stream operation.

algorithm

Return Value

A value of type compression_status, interpreted as follows:

Discussion

After success of this function, set the dst_ptr, dst_size, src_ptr, and src_size fields of the stream structure to their respective values. You can then pass stream structure to the compression_stream_process(_:_:) function.

See Also

Multiple-Step Compression

Compressing and Decompressing Files with Stream Compression

Perform compression or the appropriate kind of decompression to a file based on its path extension.

struct compression_stream

A structure representing a compression stream.

func compression_stream_process(UnsafeMutablePointer<compression_stream>, Int32) -> compression_status

Performs compression or decompression using an initialized compression stream structure.

struct compression_status

A set of values used to represent the status of stream compression.

struct compression_stream_flags

A set of values used to represent stream compression flags.

struct compression_stream_operation

A set of values used to represent a stream compression operation.