MCPcopy Create free account
hub / github.com/F-Stack/f-stack / deflatePrime

Function deflatePrime

freebsd/contrib/zlib/deflate.c:545–568  ·  view source on GitHub ↗

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

(strm, bits, value)

Source from the content-addressed store, hash-verified

543
544/* ========================================================================= */
545int ZEXPORT deflatePrime (strm, bits, value)
546 z_streamp strm;
547 int bits;
548 int value;
549{
550 deflate_state *s;
551 int put;
552
553 if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
554 s = strm->state;
555 if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
556 return Z_BUF_ERROR;
557 do {
558 put = Buf_size - s->bi_valid;
559 if (put > bits)
560 put = bits;
561 s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
562 s->bi_valid += put;
563 _tr_flush_bits(s);
564 value >>= put;
565 bits -= put;
566 } while (bits);
567 return Z_OK;
568}
569
570/* ========================================================================= */
571int ZEXPORT deflateParams(strm, level, strategy)

Callers 1

zstd_zlibwrapper.cFile · 0.85

Calls 2

deflateStateCheckFunction · 0.85
_tr_flush_bitsFunction · 0.85

Tested by

no test coverage detected