-- see zlib.h -- */
| 526 | |
| 527 | /* -- see zlib.h -- */ |
| 528 | int ZEXPORT gzflush(gzFile file, int flush) { |
| 529 | gz_statep state; |
| 530 | |
| 531 | /* get internal structure */ |
| 532 | if (file == NULL) |
| 533 | return Z_STREAM_ERROR; |
| 534 | state = (gz_statep)file; |
| 535 | |
| 536 | /* check that we're writing and that there's no error */ |
| 537 | if (state->mode != GZ_WRITE || state->err != Z_OK) |
| 538 | return Z_STREAM_ERROR; |
| 539 | |
| 540 | /* check flush parameter */ |
| 541 | if (flush < 0 || flush > Z_FINISH) |
| 542 | return Z_STREAM_ERROR; |
| 543 | |
| 544 | /* check for seek request */ |
| 545 | if (state->seek) { |
| 546 | state->seek = 0; |
| 547 | if (gz_zero(state, state->skip) == -1) |
| 548 | return state->err; |
| 549 | } |
| 550 | |
| 551 | /* compress remaining data with requested flush */ |
| 552 | (void)gz_comp(state, flush); |
| 553 | return state->err; |
| 554 | } |
| 555 | |
| 556 | /* -- see zlib.h -- */ |
| 557 | int ZEXPORT gzsetparams(gzFile file, int level, int strategy) { |