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.

62 lines
2.0 KiB

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