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

Function makefixed

extlibs/minizip/src/inflate.c:356–393  ·  view source on GitHub ↗

Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also defines BUILDFIXED, so the tables are built on the fly. makefixed() writes those tables to stdout, which would be piped to inffixed.h. A small program can simply call makefixed to do this: void makefixed(void); int main(void) { makefixed(); return 0; } Then that can be linke

Source from the content-addressed store, hash-verified

354 a.out > inffixed.h
355 */
356void makefixed()
357{
358 unsigned low, size;
359 struct inflate_state state;
360
361 fixedtables(&state);
362 puts(" /* inffixed.h -- table for decoding fixed codes");
363 puts(" * Generated automatically by makefixed().");
364 puts(" */");
365 puts("");
366 puts(" /* WARNING: this file should *not* be used by applications.");
367 puts(" It is part of the implementation of this library and is");
368 puts(" subject to change. Applications should only use zlib.h.");
369 puts(" */");
370 puts("");
371 size = 1U << 9;
372 printf(" static const code lenfix[%u] = {", size);
373 low = 0;
374 for (;;) {
375 if ((low % 7) == 0) printf("\n ");
376 printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
377 state.lencode[low].bits, state.lencode[low].val);
378 if (++low == size) break;
379 putchar(',');
380 }
381 puts("\n };");
382 size = 1U << 5;
383 printf("\n static const code distfix[%u] = {", size);
384 low = 0;
385 for (;;) {
386 if ((low % 6) == 0) printf("\n ");
387 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
388 state.distcode[low].val);
389 if (++low == size) break;
390 putchar(',');
391 }
392 puts("\n };");
393}
394#endif /* MAKEFIXED */
395
396/*

Callers

nothing calls this directly

Calls 2

printfFunction · 0.85
fixedtablesFunction · 0.70

Tested by

no test coverage detected