MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / copy_block

Function copy_block

ZLib/trees.c:1205–1226  ·  view source on GitHub ↗

=========================================================================== * Copy a stored block, storing first the length and its * one's complement if requested. */

(s, buf, len, header)

Source from the content-addressed store, hash-verified

1203 * one's complement if requested.
1204 */
1205local void copy_block(s, buf, len, header)
1206 deflate_state *s;
1207 charf *buf; /* the input data */
1208 unsigned len; /* its length */
1209 int header; /* true if block header must be written */
1210{
1211 bi_windup(s); /* align on byte boundary */
1212
1213 if (header) {
1214 put_short(s, (ush)len);
1215 put_short(s, (ush)~len);
1216#ifdef DEBUG
1217 s->bits_sent += 2*16;
1218#endif
1219 }
1220#ifdef DEBUG
1221 s->bits_sent += (ulg)len<<3;
1222#endif
1223 while (len--) {
1224 put_byte(s, *buf++);
1225 }
1226}

Callers 1

_tr_stored_blockFunction · 0.85

Calls 1

bi_windupFunction · 0.85

Tested by

no test coverage detected