inftrees.h 2.3 KB
Newer Older
M
Mark Adler 已提交
1 2 3 4 5 6 7 8 9 10 11
/* inftrees.h -- header to use inftrees.c
 * Copyright (C) 1995 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h 
 */

/* WARNING: this file should *not* be used by applications. It is
   part of the implementation of the compression library and is
   subject to change. Applications should only use zlib.h.
 */

/* Huffman code lookup table entry--this entry is four bytes for machines
M
Mark Adler 已提交
12
   that have 16-bit pointers (e.g. PC's in the small or medium model). */
M
Mark Adler 已提交
13

M
Mark Adler 已提交
14 15
typedef struct inflate_huft_s FAR inflate_huft;

M
Mark Adler 已提交
16 17 18
struct inflate_huft_s {
  union {
    struct {
M
Mark Adler 已提交
19
      Byte Exop;        /* number of extra bits or operation */
M
Mark Adler 已提交
20
      Byte Bits;        /* number of bits in this code or subcode */
M
Mark Adler 已提交
21
    } what;
M
Mark Adler 已提交
22
    Bytef *pad;         /* pad structure to a power of 2 (4 bytes for */
M
Mark Adler 已提交
23 24 25 26 27 28 29 30 31 32 33
  } word;               /*  16-bit, 8 bytes for 32-bit machines) */
  union {
    uInt Base;          /* literal, length base, or distance base */
    inflate_huft *Next; /* pointer to next level of table */
  } more;
};

#ifdef DEBUG
  extern uInt inflate_hufts;
#endif

M
Mark Adler 已提交
34 35 36 37
extern int inflate_trees_bits OF((
    uIntf *,                    /* 19 code lengths */
    uIntf *,                    /* bits tree desired/actual depth */
    inflate_huft * FAR *,       /* bits tree result */
M
Mark Adler 已提交
38
    z_stream *));               /* for zalloc, zfree functions */
M
Mark Adler 已提交
39

M
Mark Adler 已提交
40
extern int inflate_trees_dynamic OF((
M
Mark Adler 已提交
41 42
    uInt,                       /* number of literal/length codes */
    uInt,                       /* number of distance codes */
M
Mark Adler 已提交
43 44 45 46 47
    uIntf *,                    /* that many (total) code lengths */
    uIntf *,                    /* literal desired/actual bit depth */
    uIntf *,                    /* distance desired/actual bit depth */
    inflate_huft * FAR *,       /* literal/length tree result */
    inflate_huft * FAR *,       /* distance tree result */
M
Mark Adler 已提交
48
    z_stream *));               /* for zalloc, zfree functions */
M
Mark Adler 已提交
49

M
Mark Adler 已提交
50 51 52 53 54
extern int inflate_trees_fixed OF((
    uIntf *,                    /* literal desired/actual bit depth */
    uIntf *,                    /* distance desired/actual bit depth */
    inflate_huft * FAR *,       /* literal/length tree result */
    inflate_huft * FAR *));     /* distance tree result */
M
Mark Adler 已提交
55

M
Mark Adler 已提交
56
extern int inflate_trees_free OF((
M
Mark Adler 已提交
57 58
    inflate_huft *,             /* tables to free */
    z_stream *));               /* for zfree function */
M
Mark Adler 已提交
59