Lines Matching refs:strm

59 #define DEFLATE_RESET_HOOK(strm) do {} while (0)  argument
60 #define DEFLATE_HOOK(strm, flush, bstate) 0 argument
61 #define DEFLATE_NEED_CHECKSUM(strm) 1 argument
78 static int read_buf (z_streamp strm, Byte *buf, unsigned size);
189 z_streamp strm, in zlib_deflateInit2() argument
207 if (strm == NULL) return Z_STREAM_ERROR; in zlib_deflateInit2()
209 strm->msg = NULL; in zlib_deflateInit2()
213 mem = (deflate_workspace *) strm->workspace; in zlib_deflateInit2()
248 strm->state = (struct internal_state *)s; in zlib_deflateInit2()
249 s->strm = strm; in zlib_deflateInit2()
278 return zlib_deflateReset(strm); in zlib_deflateInit2()
283 z_streamp strm in zlib_deflateReset() argument
288 if (strm == NULL || strm->state == NULL) in zlib_deflateReset()
291 strm->total_in = strm->total_out = 0; in zlib_deflateReset()
292 strm->msg = NULL; in zlib_deflateReset()
293 strm->data_type = Z_UNKNOWN; in zlib_deflateReset()
295 s = (deflate_state *)strm->state; in zlib_deflateReset()
303 strm->adler = 1; in zlib_deflateReset()
309 DEFLATE_RESET_HOOK(strm); in zlib_deflateReset()
330 z_streamp strm, in zlib_deflate() argument
337 if (strm == NULL || strm->state == NULL || in zlib_deflate()
341 s = (deflate_state *) strm->state; in zlib_deflate()
343 if ((strm->next_in == NULL && strm->avail_in != 0) || in zlib_deflate()
347 if (strm->avail_out == 0) return Z_BUF_ERROR; in zlib_deflate()
349 s->strm = strm; /* just in case */ in zlib_deflate()
369 putShortMSB(s, (uInt)(strm->adler >> 16)); in zlib_deflate()
370 putShortMSB(s, (uInt)(strm->adler & 0xffff)); in zlib_deflate()
372 strm->adler = 1L; in zlib_deflate()
377 flush_pending(strm); in zlib_deflate()
378 if (strm->avail_out == 0) { in zlib_deflate()
393 } else if (strm->avail_in == 0 && flush <= old_flush && in zlib_deflate()
399 if (s->status == FINISH_STATE && strm->avail_in != 0) { in zlib_deflate()
405 if (strm->avail_in != 0 || s->lookahead != 0 || in zlib_deflate()
409 bstate = DEFLATE_HOOK(strm, flush, &bstate) ? bstate : in zlib_deflate()
416 if (strm->avail_out == 0) { in zlib_deflate()
444 flush_pending(strm); in zlib_deflate()
445 if (strm->avail_out == 0) { in zlib_deflate()
451 Assert(strm->avail_out > 0, "bug2"); in zlib_deflate()
457 putShortMSB(s, (uInt)(strm->adler >> 16)); in zlib_deflate()
458 putShortMSB(s, (uInt)(strm->adler & 0xffff)); in zlib_deflate()
459 flush_pending(strm); in zlib_deflate()
469 z_streamp strm in zlib_deflateEnd() argument
475 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR; in zlib_deflateEnd()
476 s = (deflate_state *) strm->state; in zlib_deflateEnd()
484 strm->state = NULL; in zlib_deflateEnd()
497 z_streamp strm, in read_buf() argument
502 unsigned len = strm->avail_in; in read_buf()
507 strm->avail_in -= len; in read_buf()
509 if (!DEFLATE_NEED_CHECKSUM(strm)) {} in read_buf()
510 else if (!((deflate_state *)(strm->state))->noheader) { in read_buf()
511 strm->adler = zlib_adler32(strm->adler, strm->next_in, len); in read_buf()
513 memcpy(buf, strm->next_in, len); in read_buf()
514 strm->next_in += len; in read_buf()
515 strm->total_in += len; in read_buf()
794 if (s->strm->avail_in == 0) return; in fill_window()
809 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); in fill_window()
824 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); in fill_window()
838 flush_pending(s->strm); \
845 if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
1107 if (s->strm->avail_out == 0) return need_more; in deflate_slow()