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.

241 lines
8.7 KiB

  1. /***************************************************************************
  2. Name : NSFMACRO.H
  3. Comment : INTERNAL-ONLY Definitions of BC and NSF related structs
  4. Copyright (c) 1993 Microsoft Corp.
  5. Revision Log
  6. Date Name Description
  7. -------- ----- ---------------------------------------------------------
  8. ***************************************************************************/
  9. #ifdef PORTABLE
  10. /***********************************************************************
  11. * *
  12. * NOTICE: This file has to be ANSI compilable, under GCC on UNIX *
  13. * and other ANSI compiles. Be sure to use no MS C specific features *
  14. * In particular, don't use // for comments!!!! *
  15. * *
  16. ***********************************************************************/
  17. #define NSFvMsgProtocol(p) (((((LPBYTE)(p))[1]) & 0x38) >> 3)
  18. #define fBinaryData(p) (((((LPBYTE)(p))[1]) & 0x40) >> 6)
  19. #define fInwardRouting(p) (((((LPBYTE)(p))[1]) & 0x80) >> 7)
  20. #define vSecurity(p) (((((LPBYTE)(p))[2]) & 0x07) >> 0)
  21. #define vMsgCompress(p) (((((LPBYTE)(p))[2]) & 0x18) >> 3)
  22. #define fDontCache(p) (((((LPBYTE)(p))[2]) & 0x20) >> 5)
  23. #define OperatingSys(p) (((((LPBYTE)(p))[3]) & 0x07) >> 0)
  24. #define vShortFlags(p) (((((LPBYTE)(p))[3]) & 0x18) >> 3)
  25. #define NSFvInteractive(p) (((((LPBYTE)(p))[3]) & 0xE0) >> 5)
  26. #define DataSpeed(p) (((((LPBYTE)(p))[4]) & 0x1F) >> 0)
  27. #define DataLink(p) (((((LPBYTE)(p))[4]) & 0xE0) >> 5)
  28. #define SetBCSTD0(p, l, n, m, b, i) \
  29. (((LPBYTE)(p))[0]) = ((((l) & 0x3F) << 0) | (((n) & 0x03) << 6)); \
  30. (((LPBYTE)(p))[1]) = ((((n) & 0x1C) >> 2) | (((m) & 0x07) << 3) | \
  31. (((b) & 0x01) << 6) | (((i) & 0x01) << 7));
  32. #define SetBCSTD2(p, s, c, d) \
  33. (((LPBYTE)(p))[2]) = ((((s) & 0x07) << 0) | (((c) & 0x03) << 3) | (((d) & 0x01) << 5));
  34. #define SetBCSTD3(p, o, f, i) \
  35. (((LPBYTE)(p))[3]) = ((((o) & 0x07) << 0) | (((f) & 0x03) << 3) | (((i) & 0x07) << 5));
  36. #define SetBCSTD4(p, s, l) \
  37. (((LPBYTE)(p))[4]) = ((((s) & 0x1F) << 0) | (((l) & 0x07) << 5));
  38. #define TextEncoding(p) (((((LPBYTE)(p))[1]) & 0xF8) >> 3)
  39. #define fAnyWidth(p) (((((LPBYTE)(p))[1]) & 0x08) >> 3)
  40. #define vRamboVer(p) (((((LPBYTE)(p))[1]) & 0xF0) >> 4)
  41. #define vCoverAttach(p) (((((LPBYTE)(p))[2]) & 0x07) >> 0)
  42. #define vAddrAttach(p) (((((LPBYTE)(p))[2]) & 0x18) >> 3)
  43. #define vMetaFile(p) (((((LPBYTE)(p))[2]) & 0x60) >> 5)
  44. #define HiResolution(p) (((((LPBYTE)(p))[3]) & 0x0F) >> 0)
  45. #define HiEncoding(p) (((((LPBYTE)(p))[3]) & 0xF0) >> 4)
  46. #define CutSheetSizes(p) (((LPBYTE)(p))[4])
  47. #define fOddCutSheet(p) (((((LPBYTE)(p))[5]) & 0x01) >> 0)
  48. #define SetBCIMAGE0(p, l, n, a, r) \
  49. (((LPBYTE)(p))[0]) = ((((l) & 0x3F) << 0) | (((n) & 0x03) << 6)); \
  50. (((LPBYTE)(p))[1]) = ((((n) & 0x1C) >> 2) | (((a) & 0x01) << 3) | \
  51. (((r) & 0x0F) << 4));
  52. #define SetBCIMAGE2(p, c, a, m) \
  53. (((LPBYTE)(p))[2]) = ((((c) & 0x07) << 0) | (((a) & 0x03) << 3) | (((m) & 0x03) << 5));
  54. #define SetBCIMAGE3(p, r, e) \
  55. (((LPBYTE)(p))[3]) = ((((r) & 0x0F) << 0) | (((e) & 0x0F) << 4));
  56. #define SetBCIMAGE4(p, c) (((LPBYTE)(p))[4]) = (c);
  57. #define SetBCIMAGE5(p, c) (((LPBYTE)(p))[5]) = (((c) & 0x01) << 0);
  58. #define fLowSpeedPoll(p) (((((LPBYTE)(p))[1]) & 0x08) >> 3)
  59. #define fHighSpeedPoll(p) (((((LPBYTE)(p))[1]) & 0x10) >> 4)
  60. #define fPollByNameAvail(p) (((((LPBYTE)(p))[1]) & 0x20) >> 5)
  61. #define fPollByRecipAvail(p) (((((LPBYTE)(p))[1]) & 0x40) >> 6)
  62. #define fFilePolling(p) (((((LPBYTE)(p))[1]) & 0x80) >> 7)
  63. #define fExtCapsAvail(p) (((((LPBYTE)(p))[2]) & 0x01) >> 0)
  64. #define fNoShortTurn(p) (((((LPBYTE)(p))[2]) & 0x02) >> 1)
  65. #define vMsgRelay(p) (((((LPBYTE)(p))[2]) & 0x1C) >> 2)
  66. #define ExtCapsCRC(p) (((WORD)(((LPBYTE)(p))[3])) | (((WORD)(((LPBYTE)(p))[4])) << 8))
  67. #define SetExtCapsCRC(p, w) ((((LPBYTE)(p))[3] = (((WORD)(w)) & 0xFF)), (((LPBYTE)(p))[4] = ((((WORD)(w)) >> 8) & 0xFF)))
  68. #define SetBCPOLLCAPS0(p, l, n, lp, hp, pn, pr, pf) \
  69. (((LPBYTE)(p))[0]) = ((((l) & 0x3F) << 0) | (((n) & 0x03) << 6)); \
  70. (((LPBYTE)(p))[1]) = ((((n) & 0x1C) >> 2) | (((lp) & 0x01) << 3) | \
  71. (((hp) & 0x01) << 4) | (((pn) & 0x01) << 5) | \
  72. (((pr) & 0x01) << 6) | (((pf) & 0x01) << 7));
  73. #define SetBCPOLLCAPS2(p, e, n, m) \
  74. (((LPBYTE)(p))[2]) = ((((e) & 0x01) << 0) | (((n) & 0x01) << 1) | (((m) & 0x07) << 2));
  75. #define NSSvMsgProtocol(p) (((((LPBYTE)(p))[1]) & 0x38) >> 3)
  76. #define NSSvInteractive(p) (((((LPBYTE)(p))[2]) & 0x07) >> 0)
  77. #define SetBCNSS0(p, l, n, m, i) \
  78. (((LPBYTE)(p))[0]) = ((((l) & 0x3F) << 0) | (((n) & 0x03) << 6)); \
  79. (((LPBYTE)(p))[1]) = ((((n) & 0x1C) >> 2) | (((m) & 0x07) << 3)); \
  80. (((LPBYTE)(p))[2]) = ((((i) & 0x07) << 0));
  81. #define fReturnControl(p) (((((LPBYTE)(p))[1]) & 0x08) >> 3)
  82. #define PollType(p) (((((LPBYTE)(p))[1]) & 0xF0) >> 4)
  83. #define NamePass(p) (((LPBYTE)(p)) + 2)
  84. #define SetBCPOLLREQ0(p, l, n, f, t) \
  85. (((LPBYTE)(p))[0]) = ((((l) & 0x3F) << 0) | (((n) & 0x03) << 6)); \
  86. (((LPBYTE)(p))[1]) = ((((n) & 0x1C) >> 2) | (((f) & 0x01) << 3) | \
  87. (((t) & 0x0F) << 4));
  88. #else /** PORTABLE **/
  89. #define NSFvMsgProtocol(p) ((p)->vMsgProtocol)
  90. #define fBinaryData(p) ((p)->fBinaryData)
  91. #define fInwardRouting(p) ((p)->fInwardRouting)
  92. #define vSecurity(p) ((p)->vSecurity)
  93. #define vMsgCompress(p) ((p)->vMsgCompress)
  94. #define fDontCache(p) ((p)->fDontCache)
  95. #define OperatingSys(p) ((p)->OperatingSys)
  96. #define vShortFlags(p) ((p)->vShortFlags)
  97. #define NSFvInteractive(p) ((p)->vInteractive)
  98. #define DataSpeed(p) ((p)->DataSpeed)
  99. #define DataLink(p) ((p)->DataLink)
  100. #define SetBCSTD0(p, l, n, m, b, i) \
  101. (((p)->GroupLength) = (l)); \
  102. (((p)->GroupNum) = (n)); \
  103. (((p)->vMsgProtocol) = (m)); \
  104. (((p)->fBinaryData) = (b)); \
  105. (((p)->fInwardRouting) = (i));
  106. #define SetBCSTD2(p, s, c, d) \
  107. (((p)->vSecurity) = (s)); \
  108. (((p)->vMsgCompress) = (c)); \
  109. (((p)->fDontCache) = (d));
  110. #define SetBCSTD3(p, o, f, i) \
  111. (((p)->OperatingSys) = (o)); \
  112. (((p)->vShortFlags) = (f)); \
  113. (((p)->vInteractive) = (i));
  114. #define SetBCSTD4(p, s, l) \
  115. (((p)->DataSpeed) = (s)); \
  116. (((p)->DataLink) = (l));
  117. #define TextEncoding(p) (((LPBCTEXTID)(p))->TextEncoding)
  118. #define fAnyWidth(p) ((p)->fAnyWidth)
  119. #define vRamboVer(p) ((p)->vRamboVer)
  120. #define vCoverAttach(p) ((p)->vCoverAttach)
  121. #define vAddrAttach(p) ((p)->vAddrAttach)
  122. #define vMetaFile(p) ((p)->vMetaFile)
  123. #define HiResolution(p) ((p)->HiResolution)
  124. #define HiEncoding(p) ((p)->HiEncoding)
  125. #define CutSheetSizes(p) ((p)->CutSheetSizes)
  126. #define fOddCutSheet(p) ((p)->fOddCutSheet)
  127. #define SetBCIMAGE0(p, l, n, a, r) \
  128. (((p)->GroupLength) = (l)); \
  129. (((p)->GroupNum) = (n)); \
  130. (((p)->fAnyWidth) = (a)); \
  131. (((p)->vRamboVer) = (r));
  132. #define SetBCIMAGE2(p, c, a, m) \
  133. (((p)->vCoverAttach) = (c)); \
  134. (((p)->vAddrAttach) = (a)); \
  135. (((p)->vMetaFile) = (m));
  136. #define SetBCIMAGE3(p, r, e) \
  137. (((p)->HiResolution) = (r)); \
  138. (((p)->HiEncoding) = (e)); \
  139. #define SetBCIMAGE4(p, c) (((p)->CutSheetSizes) = (c));
  140. #define SetBCIMAGE5(p, c) (((p)->fOddCutSheet) = (c));
  141. #define fLowSpeedPoll(p) ((p)->fLowSpeedPoll)
  142. #define fHighSpeedPoll(p) ((p)->fHighSpeedPoll)
  143. #define fPollByNameAvail(p) ((p)->fPollByNameAvail)
  144. #define fPollByRecipAvail(p) ((p)->fPollByRecipAvail)
  145. #define fFilePolling(p) ((p)->fFilePolling)
  146. #define fExtCapsAvail(p) ((p)->fExtCapsAvail)
  147. #define fNoShortTurn(p) ((p)->fNoShortTurn)
  148. #define vMsgRelay(p) ((p)->vMsgRelay)
  149. #define ExtCapsCRC(p) ((p)->ExtCapsCRC)
  150. #define SetExtCapsCRC(p, w) (((p)->ExtCapsCRC) = (w))
  151. #define SetBCPOLLCAPS0(p, l, n, lp, hp, pn, pr, pf) \
  152. (((p)->GroupLength) = (l)); \
  153. (((p)->GroupNum) = (n)); \
  154. (((p)->fLowSpeedPoll) = (lp)); \
  155. (((p)->fHighSpeedPoll) = (hp)); \
  156. (((p)->fPollByNameAvail) = (pn)); \
  157. (((p)->fPollByRecipAvail)= (pr)); \
  158. (((p)->fFilePolling) = (pf));
  159. #define SetBCPOLLCAPS2(p, e, n, m) \
  160. (((p)->fExtCapsAvail) = (e)); \
  161. (((p)->fNoShortTurn) = (n)); \
  162. (((p)->vMsgRelay) = (m));
  163. #define NSSvMsgProtocol(p) ((p)->vMsgProtocol)
  164. #define NSSvInteractive(p) ((p)->vInteractive)
  165. #define SetBCNSS0(p, l, n, m, i) \
  166. (((p)->GroupLength) = (l)); \
  167. (((p)->GroupNum) = (n)); \
  168. (((p)->vMsgProtocol) = (m)); \
  169. (((p)->vInteractive) = (i)); \
  170. #define fReturnControl(p) (((LPBCPOLLREQ)(p))->fReturnControl)
  171. #define PollType(p) (((LPBCPOLLREQ)(p))->PollType)
  172. #define NamePass(p) (((LPBCPOLLREQ)(p))->b)
  173. #define SetBCPOLLREQ0(p, l, n, f, t) \
  174. ((((LPBCPOLLREQ)(p))->GroupLength) = (l)); \
  175. ((((LPBCPOLLREQ)(p))->GroupNum) = (n)); \
  176. ((((LPBCPOLLREQ)(p))->fReturnControl) = (f)); \
  177. ((((LPBCPOLLREQ)(p))->PollType) = (t)); \
  178. #endif /** PORTABLE **/