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

Function deflateReset

zlib/deflate.c:357–390  ·  view source on GitHub ↗

========================================================================= */

(strm)

Source from the content-addressed store, hash-verified

355
356/* ========================================================================= */
357int ZEXPORT deflateReset (strm)
358 z_streamp strm;
359{
360 deflate_state *s;
361
362 if (strm == Z_NULL || strm->state == Z_NULL ||
363 strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
364 return Z_STREAM_ERROR;
365 }
366
367 strm->total_in = strm->total_out = 0;
368 strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
369 strm->data_type = Z_UNKNOWN;
370
371 s = (deflate_state *)strm->state;
372 s->pending = 0;
373 s->pending_out = s->pending_buf;
374
375 if (s->wrap < 0) {
376 s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
377 }
378 s->status = s->wrap ? INIT_STATE : BUSY_STATE;
379 strm->adler =
380#ifdef GZIP
381 s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
382#endif
383 adler32(0L, Z_NULL, 0);
384 s->last_flush = Z_NO_FLUSH;
385
386 _tr_init(s);
387 lm_init(s);
388
389 return Z_OK;
390}
391
392/* ========================================================================= */
393int ZEXPORT deflateSetHeader (strm, head)

Callers 1

deflateInit2_Function · 0.85

Calls 4

crc32Function · 0.85
adler32Function · 0.85
_tr_initFunction · 0.85
lm_initFunction · 0.85

Tested by

no test coverage detected