MCPcopy Create free account
hub / github.com/F-Stack/f-stack / flush_pending

Function flush_pending

freebsd/contrib/zlib/deflate.c:733–753  ·  view source on GitHub ↗

========================================================================= * Flush as much pending output as possible. All deflate() output, except for * some deflate_stored() output, goes through this function so some * applications may wish to modify it to avoid allocating a large * strm->next_out buffer and copying into it. (See also read_buf()). */

(strm)

Source from the content-addressed store, hash-verified

731 * strm->next_out buffer and copying into it. (See also read_buf()).
732 */
733local void flush_pending(strm)
734 z_streamp strm;
735{
736 unsigned len;
737 deflate_state *s = strm->state;
738
739 _tr_flush_bits(s);
740 len = s->pending;
741 if (len > strm->avail_out) len = strm->avail_out;
742 if (len == 0) return;
743
744 zmemcpy(strm->next_out, s->pending_out, len);
745 strm->next_out += len;
746 s->pending_out += len;
747 strm->total_out += len;
748 strm->avail_out -= len;
749 s->pending -= len;
750 if (s->pending == 0) {
751 s->pending_out = s->pending_buf;
752 }
753}
754
755/* ===========================================================================
756 * Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1].

Callers 2

deflateFunction · 0.85
deflate_storedFunction · 0.85

Calls 2

_tr_flush_bitsFunction · 0.85
zmemcpyFunction · 0.85

Tested by

no test coverage detected