-- see zlib.h -- */
(file, flush)
| 463 | |
| 464 | /* -- see zlib.h -- */ |
| 465 | int ZEXPORT gzflush(file, flush) |
| 466 | gzFile file; |
| 467 | int flush; |
| 468 | { |
| 469 | gz_statep state; |
| 470 | |
| 471 | /* get internal structure */ |
| 472 | if (file == NULL) |
| 473 | return -1; |
| 474 | state = (gz_statep)file; |
| 475 | |
| 476 | /* check that we're writing and that there's no error */ |
| 477 | if (state->mode != GZ_WRITE || state->err != Z_OK) |
| 478 | return Z_STREAM_ERROR; |
| 479 | |
| 480 | /* check flush parameter */ |
| 481 | if (flush < 0 || flush > Z_FINISH) |
| 482 | return Z_STREAM_ERROR; |
| 483 | |
| 484 | /* check for seek request */ |
| 485 | if (state->seek) { |
| 486 | state->seek = 0; |
| 487 | if (gz_zero(state, state->skip) == -1) |
| 488 | return -1; |
| 489 | } |
| 490 | |
| 491 | /* compress remaining data with requested flush */ |
| 492 | gz_comp(state, flush); |
| 493 | return state->err; |
| 494 | } |
| 495 | |
| 496 | /* -- see zlib.h -- */ |
| 497 | int ZEXPORT gzsetparams(file, level, strategy) |