========================================================================= * 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()). */
(strm)
| 530 | * (See also read_buf()). |
| 531 | */ |
| 532 | local void flush_pending(strm) |
| 533 | z_streamp strm; |
| 534 | { |
| 535 | unsigned len = strm->state->pending; |
| 536 | |
| 537 | if (len > strm->avail_out) len = strm->avail_out; |
| 538 | if (len == 0) return; |
| 539 | |
| 540 | zmemcpy(strm->next_out, strm->state->pending_out, len); |
| 541 | strm->next_out += len; |
| 542 | strm->state->pending_out += len; |
| 543 | strm->total_out += len; |
| 544 | strm->avail_out -= len; |
| 545 | strm->state->pending -= len; |
| 546 | if (strm->state->pending == 0) { |
| 547 | strm->state->pending_out = strm->state->pending_buf; |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | /* ========================================================================= */ |
| 552 | int ZEXPORT deflate (strm, flush) |