========================================================================= * Flush as much pending output as possible. All deflate() 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()). */
| 645 | * (See also read_buf()). |
| 646 | */ |
| 647 | local void flush_pending(z_streamp strm) |
| 648 | { |
| 649 | unsigned len; |
| 650 | deflate_state *s = strm->state; |
| 651 | |
| 652 | _tr_flush_bits(s); |
| 653 | len = s->pending; |
| 654 | if (len > strm->avail_out) len = strm->avail_out; |
| 655 | if (len == 0) return; |
| 656 | |
| 657 | zmemcpy(strm->next_out, s->pending_out, len); |
| 658 | strm->next_out += len; |
| 659 | s->pending_out += len; |
| 660 | strm->total_out += len; |
| 661 | strm->avail_out -= len; |
| 662 | s->pending -= len; |
| 663 | if (s->pending == 0) { |
| 664 | s->pending_out = s->pending_buf; |
| 665 | } |
| 666 | } |
| 667 | |
| 668 | /* ========================================================================= */ |
| 669 | int ZEXPORT deflate (z_streamp strm, int flush) |
no test coverage detected