MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / makefixed

Function makefixed

zlib/inflate.c:269–306  ·  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

267 a.out > inffixed.h
268 */
269void makefixed()
270{
271 unsigned low, size;
272 struct inflate_state state;
273
274 fixedtables(&state);
275 puts(" /* inffixed.h -- table for decoding fixed codes");
276 puts(" * Generated automatically by makefixed().");
277 puts(" */");
278 puts("");
279 puts(" /* WARNING: this file should *not* be used by applications.");
280 puts(" It is part of the implementation of this library and is");
281 puts(" subject to change. Applications should only use zlib.h.");
282 puts(" */");
283 puts("");
284 size = 1U << 9;
285 printf(" static const code lenfix[%u] = {", size);
286 low = 0;
287 for (;;) {
288 if ((low % 7) == 0) printf("\n ");
289 printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
290 state.lencode[low].val);
291 if (++low == size) break;
292 putchar(',');
293 }
294 puts("\n };");
295 size = 1U << 5;
296 printf("\n static const code distfix[%u] = {", size);
297 low = 0;
298 for (;;) {
299 if ((low % 6) == 0) printf("\n ");
300 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
301 state.distcode[low].val);
302 if (++low == size) break;
303 putchar(',');
304 }
305 puts("\n };");
306}
307#endif /* MAKEFIXED */
308
309/*

Callers

nothing calls this directly

Calls 1

fixedtablesFunction · 0.70

Tested by

no test coverage detected