Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB

  1. //
  2. // deflate.h
  3. //
  4. // common to inflate and deflate
  5. #include "common.h"
  6. // ZIP constants
  7. #define NUM_LENGTH_BASE_CODES 29
  8. #define NUM_DIST_BASE_CODES 30
  9. #define NUM_PRETREE_ELEMENTS 19
  10. //
  11. // For std and optimal encoders, recording buffer encoding max bit lengths and
  12. // decoding table sizes
  13. //
  14. #define REC_LITERALS_DECODING_TABLE_BITS 12
  15. #define REC_DISTANCES_DECODING_TABLE_BITS 8
  16. #define REC_LITERALS_DECODING_TABLE_SIZE (1 << REC_LITERALS_DECODING_TABLE_BITS)
  17. #define REC_LITERALS_DECODING_TABLE_MASK (REC_LITERALS_DECODING_TABLE_SIZE-1)
  18. #define REC_DISTANCES_DECODING_TABLE_SIZE (1 << REC_DISTANCES_DECODING_TABLE_BITS)
  19. #define REC_DISTANCES_DECODING_TABLE_MASK (REC_DISTANCES_DECODING_TABLE_SIZE-1)
  20. //
  21. // The maximum code lengths to allow for recording (we don't want really large
  22. // 15 bit codes, just in case uncommon chars suddenly become common due to a change
  23. // in the data).
  24. //
  25. #define RECORDING_DIST_MAX_CODE_LEN 9
  26. #define RECORDING_LIT_MAX_CODE_LEN 13
  27. //
  28. // Max size of tree output (in bytes)
  29. //
  30. // We require that the output buffer have at least this much data available, so that we can
  31. // output the tree in one chunk
  32. //
  33. #define MAX_TREE_DATA_SIZE 512
  34. //
  35. // Return the position slot (0...29) of a match offset (0...32767)
  36. //
  37. #define POS_SLOT(pos) g_DistLookup[((pos) < 256) ? (pos) : (256 + ((pos) >> 7))]
  38. // context structure
  39. #include "defctxt.h"
  40. // encoders
  41. #include "stdenc.h"
  42. #include "optenc.h"
  43. #include "fastenc.h"
  44. // prototypes
  45. #include "defproto.h"
  46. // variables
  47. #include "defdata.h"
  48. #include "comndata.h"