-- see zlib.h -- */
(file, level, strategy)
| 626 | |
| 627 | /* -- see zlib.h -- */ |
| 628 | int ZEXPORT gzsetparams(file, level, strategy) |
| 629 | gzFile file; |
| 630 | int level; |
| 631 | |
| 632 | int strategy; |
| 633 | { |
| 634 | gz_statep state; |
| 635 | z_streamp strm; |
| 636 | |
| 637 | /* get internal structure */ |
| 638 | if (file == NULL) |
| 639 | return Z_STREAM_ERROR; |
| 640 | state = (gz_statep)file; |
| 641 | strm = &(state->strm); |
| 642 | |
| 643 | /* check that we're writing and that there's no error */ |
| 644 | if (state->mode != GZ_WRITE || state->err != Z_OK) |
| 645 | return Z_STREAM_ERROR; |
| 646 | |
| 647 | /* if no change is requested, then do nothing */ |
| 648 | if (level == state->level && strategy == state->strategy) |
| 649 | return Z_OK; |
| 650 | |
| 651 | /* check for seek request */ |
| 652 | if (state->seek) |
| 653 | { |
| 654 | state->seek = 0; |
| 655 | if (gz_zero(state, state->skip) == -1) |
| 656 | return state->err; |
| 657 | } |
| 658 | |
| 659 | /* change compression parameters for subsequent input */ |
| 660 | if (state->size) |
| 661 | { |
| 662 | /* flush previous input with previous parameters before changing */ |
| 663 | if (strm->avail_in && gz_comp(state, Z_BLOCK) == -1) |
| 664 | return state->err; |
| 665 | deflateParams(strm, level, strategy); |
| 666 | } |
| 667 | state->level = level; |
| 668 | state->strategy = strategy; |
| 669 | return Z_OK; |
| 670 | } |
| 671 | |
| 672 | /* -- see zlib.h -- */ |
| 673 | int ZEXPORT gzclose_w(file) |
nothing calls this directly
no test coverage detected