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.

99 lines
2.7 KiB

  1. /*==============================================================================
  2. This include file defines C++ objects for each type of instance.
  3. ==============================================================================*/
  4. #include <ifaxos.h>
  5. #include <faxcodec.h>
  6. #ifdef DEBUG
  7. extern DBGPARAM dpCurSettings;
  8. #endif
  9. //==============================================================================
  10. typedef struct T4STATE // keep in sync with t4core.asm!
  11. {
  12. LPBYTE lpbIn; // read-only input buffer
  13. LPBYTE lpbOut; // output buffer
  14. WORD wOffset; // segment offset of change vector buffer (for consumers)
  15. WORD cbIn; // input data size
  16. WORD cbOut; // output buffer size
  17. WORD cbLine; // width of line in bytes
  18. WORD wColumn; // current position in bits
  19. WORD wColor; // current color
  20. WORD wWord; // current word
  21. WORD wBit; // bit modulus
  22. WORD cbSlack;
  23. LPBYTE lpbRef; // read-only reference change vector
  24. LPBYTE lpbBegRef; // for client
  25. WORD wRet; // return status
  26. WORD wToggle;
  27. WORD iKFactor; // K counter
  28. WORD wMode; // for MR
  29. short a0; // for MMR
  30. DWORD nType; // type of data being produced/consumed
  31. }
  32. FAR* LPT4STATE;
  33. // Values for wRet
  34. #define RET_INPUT_EMPTY1 1
  35. #define RET_INPUT_EMPTY2 2
  36. #define RET_OUTPUT_FULL 3
  37. #define RET_END_OF_LINE 4
  38. #define RET_SPURIOUS_EOL 5
  39. #define RET_BEG_OF_PAGE 6
  40. #define RET_END_OF_PAGE 10
  41. #define RET_DECODE_ERR 253
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. // ASM methods
  46. void ChangeToRaw (LPT4STATE);
  47. void RawToChange (LPT4STATE);
  48. void ChangeToMH (LPT4STATE);
  49. void MHToChange (LPT4STATE);
  50. void ChangeToMR (LPT4STATE);
  51. void MRToChange (LPT4STATE);
  52. void ChangeToMMR (LPT4STATE);
  53. void MMRToChange (LPT4STATE);
  54. #ifdef __cplusplus
  55. } // extern "C"
  56. #endif
  57. //==============================================================================
  58. #ifdef __cplusplus
  59. typedef class FAR CODEC : FC_PARAM
  60. {
  61. LPBYTE lpbLine;
  62. UINT xExt;
  63. UINT cSpurious;
  64. LPBYTE lpbChange;
  65. LPBYTE lpbRef;
  66. BOOL f2D;
  67. T4STATE t4C, t4P;
  68. void (*Consumer)(LPT4STATE);
  69. void (*Producer)(LPT4STATE);
  70. WORD wBad;
  71. public:
  72. FC_COUNT fcCount;
  73. void Init (LPFC_PARAM, BOOL f2DInit);
  74. FC_STATUS Convert (LPBUFFER, LPBUFFER);
  75. private:
  76. void SwapChange (void);
  77. void ResetBad (void);
  78. void EndLine (void);
  79. void StartPage (void);
  80. void EndPage (LPBUFFER lpbufOut);
  81. FC_STATUS ConvertToT4 (LPBUFFER lpbufIn, LPBUFFER lpbufOut);
  82. FC_STATUS ConvertToRaw (LPBUFFER lpbufIn, LPBUFFER lpbufOut);
  83. }
  84. FAR *LPCODEC;
  85. #endif // C++