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
| 312 | a.out > inffixed.h |
| 313 | */ |
| 314 | void makefixed(void) |
| 315 | { |
| 316 | unsigned low, size; |
| 317 | struct inflate_state state; |
| 318 | |
| 319 | fixedtables(&state); |
| 320 | puts(" /* inffixed.h -- table for decoding fixed codes"); |
| 321 | puts(" * Generated automatically by makefixed()."); |
| 322 | puts(" */"); |
| 323 | puts(""); |
| 324 | puts(" /* WARNING: this file should *not* be used by applications."); |
| 325 | puts(" It is part of the implementation of this library and is"); |
| 326 | puts(" subject to change. Applications should only use zlib.h."); |
| 327 | puts(" */"); |
| 328 | puts(""); |
| 329 | size = 1U << 9; |
| 330 | printf(" static const code lenfix[%u] = {", size); |
| 331 | low = 0; |
| 332 | for (;;) { |
| 333 | if ((low % 7) == 0) printf("\n "); |
| 334 | printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op, |
| 335 | state.lencode[low].bits, state.lencode[low].val); |
| 336 | if (++low == size) break; |
| 337 | putchar(','); |
| 338 | } |
| 339 | puts("\n };"); |
| 340 | size = 1U << 5; |
| 341 | printf("\n static const code distfix[%u] = {", size); |
| 342 | low = 0; |
| 343 | for (;;) { |
| 344 | if ((low % 6) == 0) printf("\n "); |
| 345 | printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, |
| 346 | state.distcode[low].val); |
| 347 | if (++low == size) break; |
| 348 | putchar(','); |
| 349 | } |
| 350 | puts("\n };"); |
| 351 | } |
| 352 | #endif /* MAKEFIXED */ |
| 353 | |
| 354 | /* |
nothing calls this directly
no test coverage detected