Source code of Windows XP (NT5)
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.

62 lines
2.1 KiB

  1. /*
  2. ** lzcommon.h - Shared information for LZ modules.
  3. **
  4. ** Author: DavidDi
  5. */
  6. // Constants
  7. /////////////
  8. #define RING_BUF_LEN 4096 // size of ring buffer
  9. #define MAX_RING_BUF_LEN 4224 // size of ring buffer - from LZFile
  10. // struct declaration in lzexpand.h
  11. #define NIL RING_BUF_LEN // flag index used in binary search
  12. // trees
  13. #define BUF_CLEAR_BYTE ((BYTE) ' ') // rgbyteRingBuf[] initializer
  14. #define MAX_LITERAL_LEN 2 // encode string into position and
  15. // length if match length greater than
  16. // this value (== # of bytes required
  17. // to encode position and length)
  18. #define FIRST_MAX_MATCH_LEN 0x10 // ALG_FIRST used this length
  19. #define LZ_MAX_MATCH_LEN (0x10 + MAX_LITERAL_LEN)
  20. #define LZA_MAX_MATCH_LEN 64
  21. // upper limit for match length
  22. // (n.b., assume length field implies
  23. // length += 3)
  24. // Maximum number of bytes LZDecode() and LZADecode() will expand beyond
  25. // position requested.
  26. #define MAX_OVERRUN ((long)pLZI->cbMaxMatchLen)
  27. // Globals
  28. ///////////
  29. extern INT iCurMatch, // index of longest match (set by LZInsertNode())
  30. cbCurMatch; // length of longest match (set by LZInsertNode())
  31. extern DWORD uFlags; // LZ decoding description byte
  32. extern INT iCurRingBufPos; // ring buffer offset
  33. // Prototypes
  34. //////////////
  35. // lzcommon.c
  36. extern BOOL LZInitTree(PLZINFO pLZI);
  37. extern VOID LZFreeTree(PLZINFO pLZI);
  38. extern VOID LZInsertNode(INT nodeToInsert, BOOL bDoArithmeticInsert, PLZINFO pLZI);
  39. extern VOID LZDeleteNode(INT nodeToDelete, PLZINFO pLZI);
  40. // lzcomp.c
  41. extern INT LZEncode(INT doshSource, INT doshDest, PLZINFO pLZI);
  42. // lzexp.c
  43. extern INT LZDecode(INT doshSource, INT doshDest, LONG cblExpandedLength,
  44. BOOL bRestartDecoding, BOOL bFirstAlg, PLZINFO pLZI);
  45.