MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / _tr_stored_block

Function _tr_stored_block

extern/zlib/src/trees.c:858–873  ·  view source on GitHub ↗

=========================================================================== * Send a stored block */

Source from the content-addressed store, hash-verified

856 * Send a stored block
857 */
858void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
859 ulg stored_len, int last) {
860 send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */
861 bi_windup(s); /* align on byte boundary */
862 put_short(s, (ush)stored_len);
863 put_short(s, (ush)~stored_len);
864 if (stored_len)
865 zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
866 s->pending += stored_len;
867#ifdef ZLIB_DEBUG
868 s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
869 s->compressed_len += (stored_len + 4) << 3;
870 s->bits_sent += 2*16;
871 s->bits_sent += stored_len << 3;
872#endif
873}
874
875/* ===========================================================================
876 * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)

Callers 3

trees.cFile · 0.85
deflateFunction · 0.85
deflate_storedFunction · 0.85

Calls 3

send_bitsFunction · 0.85
bi_windupFunction · 0.85
zmemcpyFunction · 0.85

Tested by

no test coverage detected