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.

104 lines
4.3 KiB

  1. /*****************************************************************************
  2. * *
  3. * ZECK.H *
  4. * *
  5. * Copyright (C) Microsoft Corporation 1990. *
  6. * All Rights reserved. *
  7. * *
  8. ******************************************************************************
  9. * *
  10. * Module Intent *
  11. * *
  12. * Zeck compression routines for bitmaps & topic 2K blocks.
  13. * *
  14. *****************************************************************************/
  15. // This structure is passed to the compression routine to specify ranges
  16. // in which to suppress compression:
  17. #ifndef __ZECK_H__
  18. #define __ZECK_H__
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #include "misc.h"
  23. typedef struct struct_suppresszeck SUPPRESSZECK, FAR *QSUPPRESSZECK;
  24. struct struct_suppresszeck {
  25. RB rbSuppress; // beginning of range for suppression.
  26. WORD cbSuppress; // number of bytes to suppress compression.
  27. RB rbNewpos; // pointer into dest buffer where suppressed range
  28. // ended up after compression (an OUT param value).
  29. WORD iBitdex; // offset from rbNewpos of zeck code bits, used when
  30. // back patching.
  31. QSUPPRESSZECK next; // next suppression range in this list.
  32. };
  33. #define BITDEX_NONE ((WORD)-1) // indicates no compression took place, and
  34. // backpatch should not adjust for the
  35. // code bits.
  36. /* LcbCompressZeck -
  37. *
  38. * This is the only entry point into zeck compression. Compresses 'cbSrc'
  39. * bytes at 'rbSrc' into the buffer at 'rbDest', suppressing compression
  40. * for bytes specified by the qSuppress linked list.
  41. *
  42. * rbSrc - IN far pointer to source buffer.
  43. * rbDest- IN far pointer to dest buffer.
  44. * cbSrc - IN count of bytes to be compressed.
  45. * cbDest- IN limit count of bytes to put in rbDest - used to create
  46. * the 2K topic blocks.
  47. * qulSrcUsed- OUT count of src bytes compressed into rbDest (needed when
  48. * a cbDest limit is used).
  49. * qSuppress IN OUT linked list of compression suppression specifiers,
  50. * the out value is where the suppression ranges ended
  51. * up in the rbDest buffer.
  52. *
  53. * RETURNS: length of compressed data put in rbDest, 0 for error.
  54. */
  55. #define COMPRESS_CBNONE 0 // passed as cbDest when no limit is to apply.
  56. #define COMPRESS_SUPPRESSNIL NULL // passed as qSuppress when no
  57. // suppression is desired
  58. ULONG FAR PASCAL LcbCompressZeck( QB rbSrc, QB rbDest, ULONG cbSrc,
  59. ULONG cbDest, QUL qulSrcUsed, QSUPPRESSZECK qSuppress, LPVOID
  60. lperrb);
  61. BOOL FAR PASCAL FAllocateZeckGlobals( void );
  62. void FAR PASCAL FreeZeckGlobals( void );
  63. ULONG PASCAL FAR LcbSimpleCompressZeck(RB rbSrc, RB rbDest,
  64. ULONG cbSrc, LPVOID lperrb);
  65. VOID FAR PASCAL VMemBackpatchZeck( QSUPPRESSZECK qsuppresszeck,
  66. ULONG ulOffset, ULONG ulValue );
  67. // erinfox: comment out so we don't need def. for HF
  68. //BOOL FAR PASCAL FDiskBackpatchZeck( HF hf, ULONG fcl, ULONG ulOffset,
  69. // WORD iBitdex, ULONG ulValue, BOOL fSaveLoc, LPVOID lperrb );
  70. ULONG FAR PASCAL LcbUncompressZeck( RB rbSrc, RB rbDest, ULONG cbSrc,
  71. ULONG cbDest);
  72. /***********************************************************************
  73. MATTSMI 4/17/92 -- CALLBACK DEFNS PUT HERE SO THAT THE WMVC COMPILER CAN
  74. GET STATUS INFORMATION DURING COMPRESSION
  75. ************************************************************************/
  76. typedef BOOL (FAR PASCAL * lpfnPumpMessageQueue)(VOID);
  77. typedef VOID (FAR PASCAL * lpfnPrintStatusMessage)(LPSTR);
  78. typedef VOID (FAR PASCAL * lpfnMessageGetPutFunc)(VOID);
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif // __ZECK_H__