Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

maketree.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include "zutil.h"
#include "inftrees.h"

Go to the source code of this file.

Defines

#define exop   word.what.Exop
#define bits   word.what.Bits

Functions

void maketree (uInt b, inflate_huft *t)
void main (void)


Define Documentation

#define bits   word.what.Bits
 

Definition at line 25 of file maketree.c.

#define exop   word.what.Exop
 

Definition at line 24 of file maketree.c.


Function Documentation

void main void   
 

Definition at line 52 of file maketree.c.

00053 {
00054   int r;
00055   uInt bl, bd;
00056   inflate_huft *tl, *td;
00057   z_stream z;
00058 
00059   z.zalloc = zcalloc;
00060   z.opaque = (voidpf)0;
00061   z.zfree = zcfree;
00062   r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z);
00063   if (r)
00064   {
00065     fprintf(stderr, "inflate_trees_fixed error %d\n", r);
00066     return;
00067   }
00068   puts("/* inffixed.h -- table for decoding fixed codes");
00069   puts(" * Generated automatically by the maketree.c program");
00070   puts(" */");
00071   puts("");
00072   puts("/* WARNING: this file should *not* be used by applications. It is");
00073   puts("   part of the implementation of the compression library and is");
00074   puts("   subject to change. Applications should only use zlib.h.");
00075   puts(" */");
00076   puts("");
00077   printf("local uInt fixed_bl = %d;\n", bl);
00078   printf("local uInt fixed_bd = %d;\n", bd);
00079   printf("local inflate_huft fixed_tl[] = {");
00080   maketree(bl, tl);
00081   puts("  };");
00082   printf("local inflate_huft fixed_td[] = {");
00083   maketree(bd, td);
00084   puts("  };");
00085 }

void maketree uInt    b,
inflate_huft   t
 

Definition at line 28 of file maketree.c.

Referenced by main().

00029 {
00030   int i, e;
00031 
00032   i = 0;
00033   while (1)
00034   {
00035     e = t[i].exop;
00036     if (e && (e & (16+64)) == 0)        /* table pointer */
00037     {
00038       fprintf(stderr, "maketree: cannot initialize sub-tables!\n");
00039       exit(1);
00040     }
00041     if (i % 4 == 0)
00042       printf("\n   ");
00043     printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base);
00044     if (++i == (1<<b))
00045       break;
00046     putchar(',');
00047   }
00048   puts("");
00049 }


Generated on Sat Oct 13 16:08:49 2001 for XMILL by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001