-- see zlib.h -- */
(file, level, strategy)
| 495 | |
| 496 | /* -- see zlib.h -- */ |
| 497 | int ZEXPORT gzsetparams(file, level, strategy) |
| 498 | gzFile file; |
| 499 | int level; |
| 500 | int strategy; |
| 501 | { |
| 502 | gz_statep state; |
| 503 | z_streamp strm; |
| 504 | |
| 505 | /* get internal structure */ |
| 506 | if (file == NULL) |
| 507 | return Z_STREAM_ERROR; |
| 508 | state = (gz_statep)file; |
| 509 | strm = &(state->strm); |
| 510 | |
| 511 | /* check that we're writing and that there's no error */ |
| 512 | if (state->mode != GZ_WRITE || state->err != Z_OK) |
| 513 | return Z_STREAM_ERROR; |
| 514 | |
| 515 | /* if no change is requested, then do nothing */ |
| 516 | if (level == state->level && strategy == state->strategy) |
| 517 | return Z_OK; |
| 518 | |
| 519 | /* check for seek request */ |
| 520 | if (state->seek) { |
| 521 | state->seek = 0; |
| 522 | if (gz_zero(state, state->skip) == -1) |
| 523 | return -1; |
| 524 | } |
| 525 | |
| 526 | /* change compression parameters for subsequent input */ |
| 527 | if (state->size) { |
| 528 | /* flush previous input with previous parameters before changing */ |
| 529 | if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1) |
| 530 | return state->err; |
| 531 | deflateParams(strm, level, strategy); |
| 532 | } |
| 533 | state->level = level; |
| 534 | state->strategy = strategy; |
| 535 | return Z_OK; |
| 536 | } |
| 537 | |
| 538 | /* -- see zlib.h -- */ |
| 539 | int ZEXPORT gzclose_w(file) |
nothing calls this directly
no test coverage detected