MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / deflate_huff

Function deflate_huff

extlibs/minizip/src/deflate.c:2312–2351  ·  view source on GitHub ↗

=========================================================================== * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. * (It will be regenerated if this run of deflate switches away from Huffman.) */

(s, flush)

Source from the content-addressed store, hash-verified

2310 * (It will be regenerated if this run of deflate switches away from Huffman.)
2311 */
2312local block_state deflate_huff(s, flush)
2313deflate_state* s;
2314
2315int flush;
2316{
2317 int bflush; /* set if current block must be flushed */
2318
2319 for (;;)
2320 {
2321 /* Make sure that we have a literal to write. */
2322 if (s->lookahead == 0)
2323 {
2324 fill_window(s);
2325 if (s->lookahead == 0)
2326 {
2327 if (flush == Z_NO_FLUSH)
2328 return need_more;
2329 break; /* flush the current block */
2330 }
2331 }
2332
2333 /* Output a literal byte */
2334 s->match_length = 0;
2335 Tracevv((stderr,"%c", s->window[s->strstart]));
2336 _tr_tally_lit (s, s->window[s->strstart], bflush);
2337 s->lookahead--;
2338 s->strstart++;
2339 if (bflush)
2340 FLUSH_BLOCK(s, 0);
2341 }
2342 s->insert = 0;
2343 if (flush == Z_FINISH)
2344 {
2345 FLUSH_BLOCK(s, 1);
2346 return finish_done;
2347 }
2348 if (s->last_lit)
2349 FLUSH_BLOCK(s, 0);
2350 return block_done;
2351}

Callers 1

deflateFunction · 0.85

Calls 1

fill_windowFunction · 0.85

Tested by

no test coverage detected