gzsetparams

Name

gzsetparams -- dynamically set compression parameters

Synopsis

#include <zlib.h>

int gzsetparams (gzFile file, int level, int strategy);

Description

The gzsetparams() function shall set the compression level and compression strategy on the compressed file stream referenced by file. The compressed file stream shall have been opened in a write mode. The level and strategy are as defined in deflateInit2_. If there is any data pending writing, it shall be flushed before the parameters are updated.

Return Value

On success, the gzsetparams() function shall return Z_OK.

Errors

On error, gzsetparams() shall return one of the following error indications:

Z_STREAM_ERROR 

Invalid parameter, or file not open for writing.

Z_BUF_ERROR 

An internal inconsistency was detected while flushing the previous buffer.