MCPcopy Create free account
hub / github.com/MariaDB/server / deflatePrime

Function deflatePrime

zlib/deflate.c:745–771  ·  view source on GitHub ↗

========================================================================= */

Source from the content-addressed store, hash-verified

743
744/* ========================================================================= */
745int 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/* ========================================================================= */
774int ZEXPORT deflateParams(z_streamp strm, int level, int strategy) {

Callers

nothing calls this directly

Calls 2

deflateStateCheckFunction · 0.85
_tr_flush_bitsFunction · 0.85

Tested by

no test coverage detected