Back to index

plt-scheme  4.2.1
Defines | Functions
maketree.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "zutil.h"
#include "inftrees.h"

Go to the source code of this file.


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


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.

  int r;
  uInt bl, bd;
  inflate_huft *tl, *td;
  z_stream z;

  z.zalloc = zcalloc;
  z.opaque = (voidpf)0;
  z.zfree = zcfree;
  r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z);
  if (r)
    fprintf(stderr, "inflate_trees_fixed error %d\n", r);
  puts("/* inffixed.h -- table for decoding fixed codes");
  puts(" * Generated automatically by the maketree.c program");
  puts(" */");
  puts("/* WARNING: this file should *not* be used by applications. It is");
  puts("   part of the implementation of the compression library and is");
  puts("   subject to change. Applications should only use zlib.h.");
  puts(" */");
  printf("local uInt fixed_bl = %d;\n", bl);
  printf("local uInt fixed_bd = %d;\n", bd);
  printf("local inflate_huft fixed_tl[] = {");
  maketree(bl, tl);
  puts("  };");
  printf("local inflate_huft fixed_td[] = {");
  maketree(bd, td);
  puts("  };");

Here is the call graph for this function:

void maketree ( uInt  b,
inflate_huft *  t 

Definition at line 28 of file maketree.c.

  int i, e;

  i = 0;
  while (1)
    e = t[i].exop;
    if (e && (e & (16+64)) == 0)        /* table pointer */
      fprintf(stderr, "maketree: cannot initialize sub-tables!\n");
    if (i % 4 == 0)
      printf("\n   ");
    printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base);
    if (++i == (1<<b))

Here is the caller graph for this function: