Windows NT 4.0 source code leak
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.

48 lines
1.6 KiB

4 years ago
  1. /*****************************************************************************
  2. * *
  3. * ZECKDAT.H *
  4. * *
  5. * Copyright (C) Microsoft Corporation 1990. *
  6. * All Rights reserved. *
  7. * *
  8. ******************************************************************************
  9. * *
  10. * Module Intent *
  11. * *
  12. * Internal data decls for Zeck compression routines for bitmaps & topic
  13. * 2K blocks.
  14. * *
  15. *****************************************************************************/
  16. /* ----- THIS STUFF USED INTERNALLY BY THE COMPRESSION ROUTINES ----- */
  17. #ifndef HC_H
  18. #include "hc.h"
  19. #endif
  20. // this bitfield structure encodes an offset and a length of the
  21. // repeated pattern. Since we deal with huge buffers, we must access
  22. // this as two bytes to insert it into the buffer (structures cannot
  23. // cross huge segment boundaries).
  24. typedef union bytesoverlay {
  25. struct {
  26. WORD uiBackwardsOffset:12;
  27. WORD cbPatternLen:4;
  28. };
  29. BYTE bytes[2];
  30. } ZECKPACKBLOCK, *QZECKPACKBLOCK;
  31. // The length encoding is offset by a min value since you would never
  32. // encode a pattern of 1 or 2 bytes. And no, you can't change MAX_PATTERN_LEN
  33. // The decompression code (i.e., WinHelp) depends on these values.
  34. #define MIN_PATTERN_LEN 3
  35. #define MAX_PATTERN_LEN 18
  36. #define PATTERNLEN_FROM_ENCODE(len) ((len) + MIN_PATTERN_LEN)
  37. #define ENCODE_FROM_PATTERNLEN(len) ((len) - MIN_PATTERN_LEN)
  38. // do similar offset for backwards offset:
  39. #define BACKWARDS_FROM_ENCODE(offset) ((offset) + 1)
  40. #define ENCODE_FROM_BACKWARDS(offset) ((offset) -1)