-- see zlib.h -- */
(file, flush)
| 592 | |
| 593 | /* -- see zlib.h -- */ |
| 594 | int ZEXPORT gzflush(file, flush) |
| 595 | gzFile file; |
| 596 | |
| 597 | int flush; |
| 598 | { |
| 599 | gz_statep state; |
| 600 | |
| 601 | /* get internal structure */ |
| 602 | if (file == NULL) |
| 603 | return Z_STREAM_ERROR; |
| 604 | state = (gz_statep)file; |
| 605 | |
| 606 | /* check that we're writing and that there's no error */ |
| 607 | if (state->mode != GZ_WRITE || state->err != Z_OK) |
| 608 | return Z_STREAM_ERROR; |
| 609 | |
| 610 | /* check flush parameter */ |
| 611 | if (flush < 0 || flush > Z_FINISH) |
| 612 | return Z_STREAM_ERROR; |
| 613 | |
| 614 | /* check for seek request */ |
| 615 | if (state->seek) |
| 616 | { |
| 617 | state->seek = 0; |
| 618 | if (gz_zero(state, state->skip) == -1) |
| 619 | return state->err; |
| 620 | } |
| 621 | |
| 622 | /* compress remaining data with requested flush */ |
| 623 | (void)gz_comp(state, flush); |
| 624 | return state->err; |
| 625 | } |
| 626 | |
| 627 | /* -- see zlib.h -- */ |
| 628 | int ZEXPORT gzsetparams(file, level, strategy) |