MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / gzsetparams

Function gzsetparams

zlib/gzio.c:239–259  ·  view source on GitHub ↗

=========================================================================== * Update the compression level and strategy */

(file, level, strategy)

Source from the content-addressed store, hash-verified

237 * Update the compression level and strategy
238 */
239int ZEXPORT gzsetparams (file, level, strategy)
240 gzFile file;
241 int level;
242 int strategy;
243{
244 gz_stream *s = (gz_stream*)file;
245
246 if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
247
248 /* Make room to allow flushing */
249 if (s->stream.avail_out == 0) {
250
251 s->stream.next_out = s->outbuf;
252 if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
253 s->z_err = Z_ERRNO;
254 }
255 s->stream.avail_out = Z_BUFSIZE;
256 }
257
258 return deflateParams (&(s->stream), level, strategy);
259}
260
261/* ===========================================================================
262 Read a byte from a gz_stream; update next_in and avail_in. Return EOF

Callers

nothing calls this directly

Calls 1

deflateParamsFunction · 0.85

Tested by

no test coverage detected