-- see zlib.h -- */
(file, flush)
| 554 | |
| 555 | /* -- see zlib.h -- */ |
| 556 | int ZEXPORT gzflush(file, flush) |
| 557 | gzFile file; |
| 558 | int flush; |
| 559 | { |
| 560 | gz_statep state; |
| 561 | |
| 562 | /* get internal structure */ |
| 563 | if (file == NULL) |
| 564 | return Z_STREAM_ERROR; |
| 565 | state = (gz_statep)file; |
| 566 | |
| 567 | /* check that we're writing and that there's no error */ |
| 568 | if (state->mode != GZ_WRITE || state->err != Z_OK) |
| 569 | return Z_STREAM_ERROR; |
| 570 | |
| 571 | /* check flush parameter */ |
| 572 | if (flush < 0 || flush > Z_FINISH) |
| 573 | return Z_STREAM_ERROR; |
| 574 | |
| 575 | /* check for seek request */ |
| 576 | if (state->seek) { |
| 577 | state->seek = 0; |
| 578 | if (gz_zero(state, state->skip) == -1) |
| 579 | return state->err; |
| 580 | } |
| 581 | |
| 582 | /* compress remaining data with requested flush */ |
| 583 | (void)gz_comp(state, flush); |
| 584 | return state->err; |
| 585 | } |
| 586 | |
| 587 | /* -- see zlib.h -- */ |
| 588 | int ZEXPORT gzsetparams(file, level, strategy) |