========================================================================= * 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)
| 731 | * strm->next_out buffer and copying into it. (See also read_buf()). |
| 732 | */ |
| 733 | local 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]. |
no test coverage detected