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