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

Function _tr_stored_block

freebsd/contrib/zlib/trees.c:863–881  ·  view source on GitHub ↗

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

(s, buf, stored_len, last)

Source from the content-addressed store, hash-verified

861 * Send a stored block
862 */
863void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
864 deflate_state *s;
865 charf *buf; /* input block */
866 ulg stored_len; /* length of input block */
867 int last; /* one if this is the last block for a file */
868{
869 send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
870 bi_windup(s); /* align on byte boundary */
871 put_short(s, (ush)stored_len);
872 put_short(s, (ush)~stored_len);
873 zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
874 s->pending += stored_len;
875#ifdef ZLIB_DEBUG
876 s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
877 s->compressed_len += (stored_len + 4) << 3;
878 s->bits_sent += 2*16;
879 s->bits_sent += stored_len<<3;
880#endif
881}
882
883/* ===========================================================================
884 * 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