inftrees.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* inftrees.h -- header to use inftrees.c
  2. * Copyright (C) 1995-1996 Mark Adler
  3. * For conditions of distribution and use, see copyright notice in zlib.h
  4. */
  5. /* WARNING: this file should *not* be used by applications. It is
  6. part of the implementation of the compression library and is
  7. subject to change. Applications should only use zlib.h.
  8. */
  9. /* Huffman code lookup table entry--this entry is four bytes for machines
  10. that have 16-bit pointers (e.g. PC's in the small or medium model). */
  11. typedef struct inflate_huft_s FAR inflate_huft;
  12. struct inflate_huft_s {
  13. union {
  14. struct {
  15. Byte Exop; /* number of extra bits or operation */
  16. Byte Bits; /* number of bits in this code or subcode */
  17. } what;
  18. Bytef *pad; /* pad structure to a power of 2 (4 bytes for */
  19. } word; /* 16-bit, 8 bytes for 32-bit machines) */
  20. union {
  21. uInt Base; /* literal, length base, or distance base */
  22. inflate_huft *Next; /* pointer to next level of table */
  23. } more;
  24. };
  25. #ifdef DEBUG
  26. extern uInt inflate_hufts;
  27. #endif
  28. extern int inflate_trees_bits OF((
  29. uIntf *, /* 19 code lengths */
  30. uIntf *, /* bits tree desired/actual depth */
  31. inflate_huft * FAR *, /* bits tree result */
  32. z_streamp )); /* for zalloc, zfree functions */
  33. extern int inflate_trees_dynamic OF((
  34. uInt, /* number of literal/length codes */
  35. uInt, /* number of distance codes */
  36. uIntf *, /* that many (total) code lengths */
  37. uIntf *, /* literal desired/actual bit depth */
  38. uIntf *, /* distance desired/actual bit depth */
  39. inflate_huft * FAR *, /* literal/length tree result */
  40. inflate_huft * FAR *, /* distance tree result */
  41. z_streamp )); /* for zalloc, zfree functions */
  42. extern int inflate_trees_fixed OF((
  43. uIntf *, /* literal desired/actual bit depth */
  44. uIntf *, /* distance desired/actual bit depth */
  45. inflate_huft * FAR *, /* literal/length tree result */
  46. inflate_huft * FAR *)); /* distance tree result */
  47. extern int inflate_trees_free OF((
  48. inflate_huft *, /* tables to free */
  49. z_streamp )); /* for zfree function */