sl@0: /* maketree.c -- make inffixed.h table for decoding fixed codes sl@0: * Copyright (C) 1998 Mark Adler sl@0: * For conditions of distribution and use, see copyright notice in zlib.h sl@0: */ sl@0: sl@0: /* WARNING: this file should *not* be used by applications. It is sl@0: part of the implementation of the compression library and is sl@0: subject to change. Applications should only use zlib.h. sl@0: */ sl@0: sl@0: /* This program is included in the distribution for completeness. sl@0: You do not need to compile or run this program since inffixed.h sl@0: is already included in the distribution. To use this program sl@0: you need to compile zlib with BUILDFIXED defined and then compile sl@0: and link this program with the zlib library. Then the output of sl@0: this program can be piped to inffixed.h. */ sl@0: sl@0: #include sl@0: #include sl@0: #include "zutil.h" sl@0: #include "inftrees.h" sl@0: sl@0: /* simplify the use of the inflate_huft type with some defines */ sl@0: #define exop word.what.Exop sl@0: #define bits word.what.Bits sl@0: sl@0: /* generate initialization table for an inflate_huft structure array */ sl@0: void maketree(uInt b, inflate_huft *t) sl@0: { sl@0: int i, e; sl@0: sl@0: i = 0; sl@0: while (1) sl@0: { sl@0: e = t[i].exop; sl@0: if (e && (e & (16+64)) == 0) /* table pointer */ sl@0: { sl@0: fprintf(stderr, "maketree: cannot initialize sub-tables!\n"); sl@0: exit(1); sl@0: } sl@0: if (i % 4 == 0) sl@0: printf("\n "); sl@0: printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base); sl@0: if (++i == (1<