========================================================================= */
| 743 | |
| 744 | /* ========================================================================= */ |
| 745 | int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { |
| 746 | deflate_state *s; |
| 747 | int put; |
| 748 | |
| 749 | if (deflateStateCheck(strm)) return Z_STREAM_ERROR; |
| 750 | s = strm->state; |
| 751 | #ifdef LIT_MEM |
| 752 | if (bits < 0 || bits > 16 || |
| 753 | (uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3)) |
| 754 | return Z_BUF_ERROR; |
| 755 | #else |
| 756 | if (bits < 0 || bits > 16 || |
| 757 | s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3)) |
| 758 | return Z_BUF_ERROR; |
| 759 | #endif |
| 760 | do { |
| 761 | put = Buf_size - s->bi_valid; |
| 762 | if (put > bits) |
| 763 | put = bits; |
| 764 | s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid); |
| 765 | s->bi_valid += put; |
| 766 | _tr_flush_bits(s); |
| 767 | value >>= put; |
| 768 | bits -= put; |
| 769 | } while (bits); |
| 770 | return Z_OK; |
| 771 | } |
| 772 | |
| 773 | /* ========================================================================= */ |
| 774 | int ZEXPORT deflateParams(z_streamp strm, int level, int strategy) { |
nothing calls this directly
no test coverage detected