home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / winlua.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  39KB  |  656 lines

  1. /******************************************************************************/
  2. /* lua_c.h   - include file for SNAP-IX LUA API.                              */
  3. /* (C) Copyright Data Connection Ltd. 1990                                    */
  4. /******************************************************************************/
  5.  
  6. /*****************************************************************************/
  7. /* Change History                                                            */
  8. /*                                                                           */
  9. /*LUA*   15/05/91  LP  This file new for LUA support                         */
  10. /*L030*  12/09/91  LP  Check for terminated apps in Windows environment      */
  11. /*512S*  25/11/91  LP  Extend max # sessions allowed from 16 to 512 for OS/2 */
  12. /*L055*  13/01/92  LP  Move error codes to rui.c to keep lua_c.h like EE file*/
  13. /*W32*   30/03/92  AD  Win32 port                                            */
  14. /*9999   11/08/93  PP  Fix LUA_INVALID_ADAPTED and add LUA_RESPONSE_ALREADY_ */
  15. /*                     SENT                                                  */
  16. /*9998   15/09/93  PP  Pull substructures out                                */
  17. /*l110   16/12/93  PP  Add RUI_INIT status messages                          */
  18. /*****************************************************************************/
  19.  
  20. #ifndef LUA_CH_INCLUDED
  21. #define LUA_CH_INCLUDED
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. /*************************************************************************W32*/
  28. /* define type conversion macros                                         *W32*/
  29. /*************************************************************************W32*/
  30. #define LUA_LO_UC(w)    ((unsigned char)(((unsigned short)(w)) & 0xFF)) /*W32*/
  31. #define LUA_HI_UC(w)    ((unsigned char)(((unsigned short)(w) >> 8)  \
  32.                             & 0xff))                                    /*W32*/
  33. #define LUA_MAKUS(l, h) (((unsigned short)(l)) |                     \
  34.                           ((unsigned short)(h)) << 8)                   /*W32*/
  35. #define LUA_MAKUL(l, h) ((unsigned long)(((unsigned short)(l))|      \
  36.                           ((unsigned long)((unsigned short)(h))) << 16))/*W32*/
  37. #define LUA_LO_US(l)   ((unsigned short)(((unsigned long)(l)) & 0xFFFF))/*W32*/
  38. #define LUA_HI_US(l)    ((unsigned short)(((unsigned long)(l) >> 16) \
  39.                            & 0xffff))                                   /*W32*/
  40.                                                                         /*W32*/
  41. /*************************************************************************W32*/
  42. /* IF non-Intel THEN                                                     *W32*/
  43. /*   set flipping to nop for now                                         *W32*/
  44. /*   reverse order of bit fields                                         *W32*/
  45. /*************************************************************************W32*/
  46. #ifdef NON_INTEL_BYTE_ORDER                                             /*W32*/
  47. #define LUA_FLIPI(X)  (X)                                               /*W32*/
  48. #define LUA_FLIPL(X)  (X)                                               /*W32*/
  49. #define LUA_FLIPRQD                                                     /*W32*/
  50.                                                                         /*W32*/
  51. /*************************************************************************W32*/
  52. /* ELSE (Intel environment)                                              *W32*/
  53. /*   define flipping macros                                              *W32*/
  54. /*************************************************************************W32*/
  55. #else                                                                   /*W32*/
  56. #define LUA_FLIPI(X) LUA_MAKUS(LUA_HI_UC(X),LUA_LO_UC(X))               /*W32*/
  57. #define LUA_FLIPL(X) LUA_MAKUL(LUA_FLIPI(LUA_HI_US(X)),           \
  58.                                  LUA_FLIPI(LUA_LO_US(X)))               /*W32*/
  59. #endif                                                                  /*W32*/
  60.  
  61.  
  62. /*L055************************************************************************/
  63. /*L055* Error codes moved to rui.c - 10 #defines deleted                     */
  64. /*L055************************************************************************/
  65.  
  66. /*W32*************************************************************************/
  67. /*W32* Make all constant definitions hardware independent                    */
  68. /*W32*************************************************************************/
  69.  
  70. /*****************************************************************************/
  71. /* LUA VERB TYPES                                                            */
  72. /*****************************************************************************/
  73. #define LUA_VERB_RUI                      LUA_FLIPI(0x5200)
  74. #define LUA_VERB_SLI                      LUA_FLIPI(0x5200)
  75.  
  76. /*****************************************************************************/
  77. /* LUA OPCODES ( RUI and SLI )                                               */
  78. /*****************************************************************************/
  79. #define LUA_OPCODE_RUI_INIT               LUA_FLIPI(0x0180)
  80. #define LUA_OPCODE_RUI_TERM               LUA_FLIPI(0x0280)
  81. #define LUA_OPCODE_RUI_READ               LUA_FLIPI(0x0380)
  82. #define LUA_OPCODE_RUI_WRITE              LUA_FLIPI(0x0480)
  83. #define LUA_OPCODE_RUI_PURGE              LUA_FLIPI(0x0580)
  84. #define LUA_OPCODE_RUI_BID                LUA_FLIPI(0x0680)
  85.  
  86. #define LUA_OPCODE_SLI_OPEN               LUA_FLIPI(0x0100)
  87. #define LUA_OPCODE_SLI_CLOSE              LUA_FLIPI(0x0200)
  88. #define LUA_OPCODE_SLI_RECEIVE            LUA_FLIPI(0x0300)
  89. #define LUA_OPCODE_SLI_SEND               LUA_FLIPI(0x0400)
  90. #define LUA_OPCODE_SLI_PURGE              LUA_FLIPI(0x0500)
  91. #define LUA_OPCODE_SLI_BID                LUA_FLIPI(0x0600)
  92. #define LUA_OPCODE_SLI_BIND_ROUTINE       LUA_FLIPI(0x1100)
  93. #define LUA_OPCODE_SLI_STSN_ROUTINE       LUA_FLIPI(0x1200)
  94. #define LUA_OPCODE_SLI_CRV_ROUTINE        LUA_FLIPI(0x1300)
  95.  
  96. /*****************************************************************************/
  97. /* LUA PRIMARY RETURN CODES                                                  */
  98. /*****************************************************************************/
  99. #define LUA_OK                            0x0000
  100. #define LUA_PARAMETER_CHECK               LUA_FLIPI(0x0001)
  101. #define LUA_STATE_CHECK                   LUA_FLIPI(0x0002)
  102. #define LUA_SESSION_FAILURE               LUA_FLIPI(0x000F)
  103. #define LUA_UNSUCCESSFUL                  LUA_FLIPI(0x0014)
  104. #define LUA_NEGATIVE_RSP                  LUA_FLIPI(0x0018)
  105. #define LUA_CANCELLED                     LUA_FLIPI(0x0021)
  106. #define LUA_IN_PROGRESS                   LUA_FLIPI(0x0030)
  107. #define LUA_STATUS                        LUA_FLIPI(0x0040)
  108. #define LUA_COMM_SUBSYSTEM_ABENDED        LUA_FLIPI(0xF003)
  109. #define LUA_COMM_SUBSYSTEM_NOT_LOADED     LUA_FLIPI(0xF004)
  110. #define LUA_INVALID_VERB_SEGMENT          LUA_FLIPI(0xF008)
  111. #define LUA_UNEXPECTED_DOS_ERROR          LUA_FLIPI(0xF011)
  112. #define LUA_STACK_TOO_SMALL               LUA_FLIPI(0xF015)
  113. #define LUA_INVALID_VERB                  0xFFFF
  114.  
  115. /*****************************************************************************/
  116. /* LUA SECONDARY RETURN CODES                                                */
  117. /*****************************************************************************/
  118. #define LUA_SEC_RC_OK                     LUA_FLIPL(0x00000000)
  119. #define LUA_INVALID_LUNAME                LUA_FLIPL(0x00000001)
  120. #define LUA_BAD_SESSION_ID                LUA_FLIPL(0x00000002)
  121. #define LUA_DATA_TRUNCATED                LUA_FLIPL(0x00000003)
  122. #define LUA_BAD_DATA_PTR                  LUA_FLIPL(0x00000004)
  123. #define LUA_DATA_SEG_LENGTH_ERROR         LUA_FLIPL(0x00000005)
  124. #define LUA_RESERVED_FIELD_NOT_ZERO       LUA_FLIPL(0x00000006)
  125. #define LUA_INVALID_POST_HANDLE           LUA_FLIPL(0x00000007)
  126. #define LUA_PURGED                        LUA_FLIPL(0x0000000C)
  127. #define LUA_BID_VERB_SEG_ERROR            LUA_FLIPL(0x0000000F)
  128. #define LUA_NO_PREVIOUS_BID_ENABLED       LUA_FLIPL(0x00000010)
  129. #define LUA_NO_DATA                       LUA_FLIPL(0x00000011)
  130. #define LUA_BID_ALREADY_ENABLED           LUA_FLIPL(0x00000012)
  131. #define LUA_VERB_RECORD_SPANS_SEGMENTS    LUA_FLIPL(0x00000013)
  132. #define LUA_INVALID_FLOW                  LUA_FLIPL(0x00000014)
  133. #define LUA_NOT_ACTIVE                    LUA_FLIPL(0x00000015)
  134. #define LUA_VERB_LENGTH_INVALID           LUA_FLIPL(0x00000016)
  135. #define LUA_REQUIRED_FIELD_MISSING        LUA_FLIPL(0x00000019)
  136. #define LUA_READY                         LUA_FLIPL(0x00000030)
  137. #define LUA_NOT_READY                     LUA_FLIPL(0x00000031)
  138. #define LUA_INIT_COMPLETE                 LUA_FLIPL(0x00000032)
  139. #define LUA_SESSION_END_REQUESTED         LUA_FLIPL(0x00000033)
  140. #define LUA_NO_SLI_SESSION                LUA_FLIPL(0x00000034)
  141. #define LUA_SESSION_ALREADY_OPEN          LUA_FLIPL(0x00000035)
  142. #define LUA_INVALID_OPEN_INIT_TYPE        LUA_FLIPL(0x00000036)
  143. #define LUA_INVALID_OPEN_DATA             LUA_FLIPL(0x00000037)
  144. #define LUA_UNEXPECTED_SNA_SEQUENCE       LUA_FLIPL(0x00000038)
  145. #define LUA_NEG_RSP_FROM_BIND_ROUTINE     LUA_FLIPL(0x00000039)
  146. #define LUA_NEG_RSP_FROM_CRV_ROUTINE      LUA_FLIPL(0x0000003A)
  147. #define LUA_NEG_RSP_FROM_STSN_ROUTINE     LUA_FLIPL(0x0000003B)
  148. #define LUA_CRV_ROUTINE_REQUIRED          LUA_FLIPL(0x0000003C)
  149. #define LUA_STSN_ROUTINE_REQUIRED         LUA_FLIPL(0x0000003D)
  150. #define LUA_INVALID_OPEN_ROUTINE_TYPE     LUA_FLIPL(0x0000003E)
  151. #define LUA_MAX_NUMBER_OF_SENDS           LUA_FLIPL(0x0000003F)
  152. #define LUA_SEND_ON_FLOW_PENDING          LUA_FLIPL(0x00000040)
  153. #define LUA_INVALID_MESSAGE_TYPE          LUA_FLIPL(0x00000041)
  154. #define LUA_RECEIVE_ON_FLOW_PENDING       LUA_FLIPL(0x00000042)
  155. #define LUA_DATA_LENGTH_ERROR             LUA_FLIPL(0x00000043)
  156. #define LUA_CLOSE_PENDING                 LUA_FLIPL(0x00000044)
  157. #define LUA_NEGATIVE_RSP_CHASE            LUA_FLIPL(0x00000046)
  158. #define LUA_NEGATIVE_RSP_SHUTC            LUA_FLIPL(0x00000047)
  159. #define LUA_NEGATIVE_RSP_RSHUTD           LUA_FLIPL(0x00000048)
  160. #define LUA_NO_RECEIVE_TO_PURGE           LUA_FLIPL(0x0000004A)
  161. #define LUA_CANCEL_COMMAND_RECEIVED       LUA_FLIPL(0x0000004D)
  162. #define LUA_RUI_WRITE_FAILURE             LUA_FLIPL(0x0000004E)
  163. #define LUA_SLI_BID_PENDING               LUA_FLIPL(0x00000051)
  164. #define LUA_SLI_PURGE_PENDING             LUA_FLIPL(0x00000052)
  165. #define LUA_PROCEDURE_ERROR               LUA_FLIPL(0x00000053)
  166. #define LUA_INVALID_SLI_ENCR_OPTION       LUA_FLIPL(0x00000054)
  167. #define LUA_RECEIVED_UNBIND               LUA_FLIPL(0x00000055)
  168. #define LUA_DATA_INCOMPLETE               LUA_FLIPL(0x00000060)
  169. #define LUA_SLI_LOGIC_ERROR               LUA_FLIPL(0x0000007F)
  170. #define LUA_TERMINATED                    LUA_FLIPL(0x00000080)
  171. #define LUA_NO_RUI_SESSION                LUA_FLIPL(0x00000081)
  172. #define LUA_DUPLICATE_RUI_INIT            LUA_FLIPL(0x00000082)
  173. #define LUA_INVALID_PROCESS               LUA_FLIPL(0x00000083)
  174. #define LUA_API_MODE_CHANGE               LUA_FLIPL(0x00000085)
  175. #define LUA_COMMAND_COUNT_ERROR           LUA_FLIPL(0x00000087)
  176. #define LUA_NO_READ_TO_PURGE              LUA_FLIPL(0x00000088)
  177. #define LUA_MULTIPLE_WRITE_FLOWS          LUA_FLIPL(0x00000089)
  178. #define LUA_DUPLICATE_READ_FLOW           LUA_FLIPL(0x0000008A)
  179. #define LUA_DUPLICATE_WRITE_FLOW          LUA_FLIPL(0x0000008B)
  180. #define LUA_LINK_NOT_STARTED              LUA_FLIPL(0x0000008C)
  181. #define LUA_INVALID_ADAPTER               LUA_FLIPL(0x0000008D)
  182. #define LUA_ENCR_DECR_LOAD_ERROR          LUA_FLIPL(0x0000008E)
  183. #define LUA_ENCR_DECR_PROC_ERROR          LUA_FLIPL(0x0000008F)
  184. #define LUA_NEG_NOTIFY_RSP                LUA_FLIPL(0x000000BE)
  185. #define LUA_RUI_LOGIC_ERROR               LUA_FLIPL(0x000000BF)
  186. #define LUA_LU_INOPERATIVE                LUA_FLIPL(0x000000FF)
  187.  
  188. /*****************************************************************************/
  189. /* THE FOLLOWING SECONDARY RETURN CODES ARE SNA SENSE CODES                  */
  190. /*****************************************************************************/
  191. #define LUA_NON_UNIQ_ID                   LUA_FLIPL(0xC0001001)
  192. #define LUA_NON_UNIQ_NAU_AD               LUA_FLIPL(0xC0001002)
  193. #define LUA_INV_NAU_ADDR                  LUA_FLIPL(0xC0002001)
  194. #define LUA_INV_ADPT_NUM                  LUA_FLIPL(0xC0002002)
  195.  
  196. #define LUA_RESOURCE_NOT_AVAILABLE        LUA_FLIPL(0x08010000)
  197. #define LUA_SESSION_LIMIT_EXCEEDED        LUA_FLIPL(0x08050000)
  198. #define LUA_SLU_SESSION_LIMIT_EXCEEDED    LUA_FLIPL(0x0805000A)
  199. #define LUA_MODE_INCONSISTENCY            LUA_FLIPL(0x08090000)
  200. #define LUA_BRACKET_RACE_ERROR            LUA_FLIPL(0x080B0000)
  201. #define LUA_INSUFFICIENT_RESOURCES        LUA_FLIPL(0x08120000)
  202. #define LUA_BB_REJECT_NO_RTR              LUA_FLIPL(0x08130000)
  203. #define LUA_BB_REJECT_RTR                 LUA_FLIPL(0x08140000)
  204. #define LUA_RECEIVER_IN_TRANSMIT_MODE     LUA_FLIPL(0x081B0000)
  205. #define LUA_REQUEST_NOT_EXECUTABLE        LUA_FLIPL(0x081C0000)
  206. #define LUA_INVALID_SESSION_PARAMETERS    LUA_FLIPL(0x08210000)
  207. #define LUA_UNIT_OF_WORK_ABORTED          LUA_FLIPL(0x08240000)
  208. #define LUA_FM_FUNCTION_NOT_SUPPORTED     LUA_FLIPL(0x08260000)
  209. #define LUA_LU_COMPONENT_DISCONNECTED     LUA_FLIPL(0x08310000)
  210. #define LUA_INVALID_PARAMETER_FLAGS       LUA_FLIPL(0x08330000)
  211. #define LUA_INVALID_PARAMETER             LUA_FLIPL(0x08350000)
  212. #define LUA_NEGOTIABLE_BIND_ERROR         LUA_FLIPL(0x08350001)
  213. #define LUA_BIND_FM_PROFILE_ERROR         LUA_FLIPL(0x08350002)
  214. #define LUA_BIND_TS_PROFILE_ERROR         LUA_FLIPL(0x08350003)
  215. #define LUA_BIND_LU_TYPE_ERROR            LUA_FLIPL(0x0835000E)
  216. #define LUA_CRYPTOGRAPHY_INOPERATIVE      LUA_FLIPL(0x08480000)
  217. #define LUA_REQ_RESOURCES_NOT_AVAIL       LUA_FLIPL(0x084B0000)
  218. #define LUA_SSCP_LU_SESSION_NOT_ACTIVE    LUA_FLIPL(0x08570000)
  219. #define LUA_SYNC_EVENT_RESPONSE           LUA_FLIPL(0x08670000)
  220. #define LUA_REC_CORR_TABLE_FULL           LUA_FLIPL(0x08780001)
  221. #define LUA_SEND_CORR_TABLE_FULL          LUA_FLIPL(0x08780002)
  222. #define LUA_SESSION_SERVICE_PATH_ERROR    LUA_FLIPL(0x087D0000)
  223.  
  224. #define LUA_RU_DATA_ERROR                 LUA_FLIPL(0x10010000)
  225. #define LUA_RU_LENGTH_ERROR               LUA_FLIPL(0x10020000)
  226. #define LUA_FUNCTION_NOT_SUPPORTED        LUA_FLIPL(0x10030000)
  227. #define LUA_HDX_BRACKET_STATE_ERROR       LUA_FLIPL(0x10050121)
  228. #define LUA_RESPONSE_ALREADY_SENT         LUA_FLIPL(0x10050122)
  229. #define LUA_EXR_SENSE_INCORRECT           LUA_FLIPL(0x10050123)
  230. #define LUA_RESPONSE_OUT_OF_ORDER         LUA_FLIPL(0x10050124)
  231. #define LUA_CHASE_RESPONSE_REQUIRED       LUA_FLIPL(0x10050125)
  232. #define LUA_CATEGORY_NOT_SUPPORTED        LUA_FLIPL(0x10070000)
  233.  
  234. #define LUA_INCORRECT_SEQUENCE_NUMBER     LUA_FLIPL(0x20010000)
  235. #define LUA_CHAINING_ERROR                LUA_FLIPL(0x20020000)
  236. #define LUA_BRACKET                       LUA_FLIPL(0x20030000)
  237. #define LUA_DIRECTION                     LUA_FLIPL(0x20040000)
  238. #define LUA_DATA_TRAFFIC_RESET            LUA_FLIPL(0x20050000)
  239. #define LUA_DATA_TRAFFIC_QUIESCED         LUA_FLIPL(0x20060000)
  240. #define LUA_DATA_TRAFFIC_NOT_RESET        LUA_FLIPL(0x20070000)
  241. #define LUA_NO_BEGIN_BRACKET              LUA_FLIPL(0x20080000)
  242. #define LUA_SC_PROTOCOL_VIOLATION         LUA_FLIPL(0x20090000)
  243. #define LUA_IMMEDIATE_REQ_MODE_ERROR      LUA_FLIPL(0x200A0000)
  244. #define LUA_QUEUED_RESPONSE_ERROR         LUA_FLIPL(0x200B0000)
  245. #define LUA_ERP_SYNC_EVENT_ERROR          LUA_FLIPL(0x200C0000)
  246. #define LUA_RSP_BEFORE_SENDING_REQ        LUA_FLIPL(0x200D0000)
  247. #define LUA_RSP_CORRELATION_ERROR         LUA_FLIPL(0x200E0000)
  248. #define LUA_RSP_PROTOCOL_ERROR            LUA_FLIPL(0x200F0000)
  249.  
  250. #define LUA_INVALID_SC_OR_NC_RH           LUA_FLIPL(0x40010000)
  251. #define LUA_BB_NOT_ALLOWED                LUA_FLIPL(0x40030000)
  252. #define LUA_EB_NOT_ALLOWED                LUA_FLIPL(0x40040000)
  253. #define LUA_EXCEPTION_RSP_NOT_ALLOWED     LUA_FLIPL(0x40060000)
  254. #define LUA_DEFINITE_RSP_NOT_ALLOWED      LUA_FLIPL(0x40070000)
  255. #define LUA_PACING_NOT_SUPPORTED          LUA_FLIPL(0x40080000)
  256. #define LUA_CD_NOT_ALLOWED                LUA_FLIPL(0x40090000)
  257. #define LUA_NO_RESPONSE_NOT_ALLOWED       LUA_FLIPL(0x400A0000)
  258. #define LUA_CHAINING_NOT_SUPPORTED        LUA_FLIPL(0x400B0000)
  259. #define LUA_BRACKETS_NOT_SUPPORTED        LUA_FLIPL(0x400C0000)
  260. #define LUA_CD_NOT_SUPPORTED              LUA_FLIPL(0x400D0000)
  261. #define LUA_INCORRECT_USE_OF_FI           LUA_FLIPL(0x400F0000)
  262. #define LUA_ALTERNATE_CODE_NOT_SUPPORT    LUA_FLIPL(0x40100000)
  263. #define LUA_INCORRECT_RU_CATEGORY         LUA_FLIPL(0x40110000)
  264. #define LUA_INCORRECT_REQUEST_CODE        LUA_FLIPL(0x40120000)
  265. #define LUA_INCORRECT_SPEC_OF_SDI_RTI     LUA_FLIPL(0x40130000)
  266. #define LUA_INCORRECT_DR1I_DR2I_ERI       LUA_FLIPL(0x40140000)
  267. #define LUA_INCORRECT_USE_OF_QRI          LUA_FLIPL(0x40150000)
  268. #define LUA_INCORRECT_USE_OF_EDI          LUA_FLIPL(0x40160000)
  269. #define LUA_INCORRECT_USE_OF_PDI          LUA_FLIPL(0x40170000)
  270.  
  271. #define LUA_NAU_INOPERATIVE               LUA_FLIPL(0x80030000)
  272. #define LUA_NO_SESSION                    LUA_FLIPL(0x80050000)
  273.  
  274. /*****************************************************************************/
  275. /* LUA_RH.RUC masks                                                          */
  276. /*****************************************************************************/
  277. #define  LUA_RH_FMD                       0
  278. #define  LUA_RH_NC                        1
  279. #define  LUA_RH_DFC                       2
  280. #define  LUA_RH_SC                        3
  281.  
  282. /*****************************************************************************/
  283. /* LUA MESSAGE TYPES                                                         */
  284. /*****************************************************************************/
  285. #define LUA_MESSAGE_TYPE_LU_DATA          0x01
  286. #define LUA_MESSAGE_TYPE_SSCP_DATA        0x11
  287. #define LUA_MESSAGE_TYPE_RSP              0x02
  288. #define LUA_MESSAGE_TYPE_BID              0xC8
  289. #define LUA_MESSAGE_TYPE_BIND             0x31
  290. #define LUA_MESSAGE_TYPE_BIS              0x70
  291. #define LUA_MESSAGE_TYPE_CANCEL           0x83
  292. #define LUA_MESSAGE_TYPE_CHASE            0x84
  293. #define LUA_MESSAGE_TYPE_CLEAR            0xA1
  294. #define LUA_MESSAGE_TYPE_CRV              0xD0
  295. #define LUA_MESSAGE_TYPE_LUSTAT_LU        0x04
  296. #define LUA_MESSAGE_TYPE_LUSTAT_SSCP      0x14
  297. #define LUA_MESSAGE_TYPE_QC               0x81
  298. #define LUA_MESSAGE_TYPE_QEC              0x80
  299. #define LUA_MESSAGE_TYPE_RELQ             0x82
  300. #define LUA_MESSAGE_TYPE_RQR              0xA3
  301. #define LUA_MESSAGE_TYPE_RTR              0x05
  302. #define LUA_MESSAGE_TYPE_SBI              0x71
  303. #define LUA_MESSAGE_TYPE_SHUTD            0xC0
  304. #define LUA_MESSAGE_TYPE_SIGNAL           0xC9
  305. #define LUA_MESSAGE_TYPE_SDT              0xA0
  306. #define LUA_MESSAGE_TYPE_STSN             0xA2
  307. #define LUA_MESSAGE_TYPE_UNBIND           0x32
  308.  
  309. /*****************************************************************************/
  310. /* LUA INIT TYPES (Used for SLI only)                                        */
  311. /*****************************************************************************/
  312. #define LUA_INIT_TYPE_SEC_IS              0x01
  313. #define LUA_INIT_TYPE_SEC_LOG             0x02
  314. #define LUA_INIT_TYPE_PRIM                0x03
  315. #define LUA_INIT_TYPE_PRIM_SSCP           0x04
  316.  
  317. /*****************************************************************************/
  318. /* LUA SLI_OPEN EXTENSION ROUTINE TYPES                                      */
  319. /*****************************************************************************/
  320. #define LUA_ROUTINE_TYPE_BIND             0x01
  321. #define LUA_ROUTINE_TYPE_CRV              0x02
  322. #define LUA_ROUTINE_TYPE_STSN             0x03
  323. #define LUA_ROUTINE_TYPE_END              0x00
  324.  
  325. /*****************************************************************************/
  326. /* LUA VERB RECORD STRUCTURES                                                */
  327. /*****************************************************************************/
  328.  
  329.  
  330. /*************************************************************************W32*/
  331. /* If Win32 environment then ensure that packing is correct              *W32*/
  332. /*************************************************************************W32*/
  333. #ifdef WIN32                                                            /*W32*/
  334. #pragma pack(4)                                                         /*W32*/
  335. #endif                                                                  /*W32*/
  336.  
  337.  
  338. /*****************************************************************************/
  339. /* Transmission header structure                                             */
  340. /*****************************************************************************/
  341. struct LUA_TH
  342.       {
  343. #ifdef LUA_FLIPRQD                                                      /*W32*/
  344.       unsigned char    flags_fid  : 4;        /* Format Identification Type 2*/
  345.       unsigned char    flags_mpf  : 2;        /* Segmenting Mapping Field    */
  346.       unsigned char    flags_odai : 1;        /* OAF-DAF Assignor Indicator  */
  347.       unsigned char    flags_efi  : 1;        /* Expedited Flow Indicator    */
  348. #else                                                                   /*W32*/
  349.       unsigned char    flags_efi  : 1;        /* Expedited Flow Indicator    */
  350.       unsigned char    flags_odai : 1;        /* OAF-DAF Assignor Indicator  */
  351.       unsigned char    flags_mpf  : 2;        /* Segmenting Mapping Field    */
  352.       unsigned char    flags_fid  : 4;        /* Format Identification Type 2*/
  353. #endif                                                                  /*W32*/
  354.       unsigned char               : 8;        /* Reserved Field              */
  355.       unsigned char    daf;                   /* Destination Address Field   */
  356.       unsigned char    oaf;                   /* Originating Address Field   */
  357.       unsigned char    snf[2];                /* Sequence Number Field       */
  358.       };
  359.  
  360. /*****************************************************************************/
  361. /* Request/Response unit header strcuture                                    */
  362. /*****************************************************************************/
  363. struct LUA_RH
  364.       {
  365. #ifdef LUA_FLIPRQD                                                      /*W32*/
  366.       unsigned char    rri  : 1;              /* Request-Response Indicator  */
  367.       unsigned char    ruc  : 2;              /* RU Category                 */
  368.       unsigned char         : 1;              /* Reserved Field              */
  369.       unsigned char    fi   : 1;              /* Format Indicator            */
  370.       unsigned char    sdi  : 1;              /* Sense Data Included Ind     */
  371.       unsigned char    bci  : 1;              /* Begin Chain Indicator       */
  372.       unsigned char    eci  : 1;              /* End Chain Indicator         */
  373. #else                                                                   /*W32*/
  374.       unsigned char    eci  : 1;              /* End Chain Indicator         */
  375.       unsigned char    bci  : 1;              /* Begin Chain Indicator       */
  376.       unsigned char    sdi  : 1;              /* Sense Data Included Ind     */
  377.       unsigned char    fi   : 1;              /* Format Indicator            */
  378.       unsigned char         : 1;              /* Reserved Field              */
  379.       unsigned char    ruc  : 2;              /* RU Category                 */
  380.       unsigned char    rri  : 1;              /* Request-Response Indicator  */
  381. #endif                                                                  /*W32*/
  382.  
  383. #ifdef LUA_FLIPRQD                                                      /*W32*/
  384.       unsigned char    dr1i : 1;              /* DR 1 Indicator              */
  385.       unsigned char         : 1;              /* Reserved Field              */
  386.       unsigned char    dr2i : 1;              /* DR 2 Indicator              */
  387.       unsigned char    ri   : 1;              /* Response Indicator          */
  388.       unsigned char         : 2;              /* Reserved Field              */
  389.       unsigned char    qri  : 1;              /* Queued Response Indicator   */
  390.       unsigned char    pi   : 1;              /* Pacing Indicator            */
  391. #else                                                                   /*W32*/
  392.       unsigned char    pi   : 1;              /* Pacing Indicator            */
  393.       unsigned char    qri  : 1;              /* Queued Response Indicator   */
  394.       unsigned char         : 2;              /* Reserved Field              */
  395.       unsigned char    ri   : 1;              /* Response Indicator          */
  396.       unsigned char    dr2i : 1;              /* DR 2 Indicator              */
  397.       unsigned char         : 1;              /* Reserved Field              */
  398.       unsigned char    dr1i : 1;              /* DR 1 Indicator              */
  399. #endif                                                                  /*W32*/
  400.  
  401. #ifdef LUA_FLIPRQD                                                      /*W32*/
  402.       unsigned char    bbi  : 1;              /* Begin Bracket Indicator     */
  403.       unsigned char    ebi  : 1;              /* End Bracket Indicator       */
  404.       unsigned char    cdi  : 1;              /* Change Direction Indicator  */
  405.       unsigned char         : 1;              /* Reserved Field              */
  406.       unsigned char    csi  : 1;              /* Code Selection Indicator    */
  407.       unsigned char    edi  : 1;              /* Enciphered Data Indicator   */
  408.       unsigned char    pdi  : 1;              /* Padded Data Indicator       */
  409.       unsigned char         : 1;              /* Reserved Field              */
  410. #else                                                                   /*W32*/
  411.       unsigned char         : 1;              /* Reserved Field              */
  412.       unsigned char    pdi  : 1;              /* Padded Data Indicator       */
  413.       unsigned char    edi  : 1;              /* Enciphered Data Indicator   */
  414.       unsigned char    csi  : 1;              /* Code Selection Indicator    */
  415.       unsigned char         : 1;              /* Reserved Field              */
  416.       unsigned char    cdi  : 1;              /* Change Direction Indicator  */
  417.       unsigned char    ebi  : 1;              /* End Bracket Indicator       */
  418.       unsigned char    bbi  : 1;              /* Begin Bracket Indicator     */
  419. #endif                                                                  /*W32*/
  420.       };
  421.  
  422. /*****************************************************************************/
  423. /* Structure for LUA_FLAG1                                                   */
  424. /*****************************************************************************/
  425. struct LUA_FLAG1                              /* LUA_FLAG1                   */
  426.       {
  427. #ifdef LUA_FLIPRQD                                                      /*W32*/
  428.       unsigned char  bid_enable  : 1;         /* Bid Enabled Indicator       */
  429.       unsigned char  reserv1     : 1;         /* reserved                    */
  430.       unsigned char  close_abend : 1;         /* Close Immediate Flag        */
  431.       unsigned char  nowait      : 1;         /* Don't Wait for Data Flag    */
  432.       unsigned char  sscp_exp    : 1;         /* SSCP expedited flow         */
  433.       unsigned char  sscp_norm   : 1;         /* SSCP normal flow            */
  434.       unsigned char  lu_exp      : 1;         /* LU expedited flow           */
  435.       unsigned char  lu_norm     : 1;         /* lu normal flow              */
  436. #else                                                                   /*W32*/
  437.       unsigned char  lu_norm     : 1;         /* lu normal flow              */
  438.       unsigned char  lu_exp      : 1;         /* LU expedited flow           */
  439.       unsigned char  sscp_norm   : 1;         /* SSCP normal flow            */
  440.       unsigned char  sscp_exp    : 1;         /* SSCP expedited flow         */
  441.       unsigned char  nowait      : 1;         /* Don't Wait for Data Flag    */
  442.       unsigned char  close_abend : 1;         /* Close Immediate Flag        */
  443.       unsigned char  reserv1     : 1;         /* reserved                    */
  444.       unsigned char  bid_enable  : 1;         /* Bid Enabled Indicator       */
  445. #endif                                                                  /*W32*/
  446.       };
  447. /*****************************************************************************/
  448. /* Structure for LUA_FLAG2                                                   */
  449. /*****************************************************************************/
  450. struct LUA_FLAG2                              /* LUA_FLAG2                   */
  451.       {
  452. #ifdef LUA_FLIPRQD                                                      /*W32*/
  453.       unsigned char  bid_enable  : 1;         /* Bid Enabled Indicator       */
  454.       unsigned char  async       : 1;         /* flags asynchronous verb
  455.                                                  completion                  */
  456.       unsigned char              : 2;         /* reserved                    */
  457.       unsigned char  sscp_exp    : 1;         /* SSCP expedited flow         */
  458.       unsigned char  sscp_norm   : 1;         /* SSCP normal flow            */
  459.       unsigned char  lu_exp      : 1;         /* LU expedited flow           */
  460.       unsigned char  lu_norm     : 1;         /* lu normal flow              */
  461. #else                                                                   /*W32*/
  462.       unsigned char  lu_norm     : 1;         /* lu normal flow              */
  463.       unsigned char  lu_exp      : 1;         /* LU expedited flow           */
  464.       unsigned char  sscp_norm   : 1;         /* SSCP normal flow            */
  465.       unsigned char  sscp_exp    : 1;         /* SSCP expedited flow         */
  466.       unsigned char              : 2;         /* reserved                    */
  467.       unsigned char  async       : 1;         /* flags asynchronous verb
  468.                                                  completion                  */
  469.       unsigned char  bid_enable  : 1;         /* Bid Enabled Indicator       */
  470. #endif                                                                  /*W32*/
  471.       };
  472.  
  473. /*****************************************************************************/
  474. /* Structure for common verb header                                          */
  475. /*****************************************************************************/
  476.    struct LUA_COMMON
  477.      {
  478.     unsigned short lua_verb;                   /* Verb Code                  */
  479.     unsigned short lua_verb_length;            /* Length of Verb Record      */
  480.     unsigned short lua_prim_rc;                /* Primary Return Code        */
  481.     unsigned long  lua_sec_rc;                 /* Secondary Return Code      */
  482.     unsigned short lua_opcode;                 /* Verb Operation Code        */
  483.     unsigned long  lua_correlator;             /* User Correlation Field     */
  484.     unsigned char  lua_luname[8];              /* Local LU Name              */
  485.     unsigned short lua_extension_list_offset;  /* Offset of DLL Extention Lis*/
  486.     unsigned short lua_cobol_offset;           /* Offset of Cobol Extension  */
  487.     unsigned long  lua_sid;                    /* Session ID                 */
  488.     unsigned short lua_max_length;             /* Receive Buffer Length      */
  489.     unsigned short lua_data_length;            /* Data Length                */
  490.     char far       *lua_data_ptr;              /* Data Buffer Pointer        */
  491.     unsigned long  lua_post_handle;            /* Posting handle             */
  492.  
  493.     struct LUA_TH  lua_th;                     /* LUA TH Fields              */
  494.  
  495.     struct LUA_RH  lua_rh;                     /* LUA RH Fields              */
  496.  
  497.     struct LUA_FLAG1 lua_flag1;                /* LUA_FLAG1                  */
  498.  
  499.     unsigned char lua_message_type;            /* sna message command type   */
  500.  
  501.     struct LUA_FLAG2 lua_flag2;                /* LUA_FLAG2                  */
  502.  
  503.     unsigned char lua_resv56[7];               /* Reserved Field             */
  504.     unsigned char lua_encr_decr_option;        /* Cryptography Option        */
  505.      } ;
  506.  
  507.  
  508. /******************* COMMAND SPECIFIC VERB DEFINITIONS ***************/
  509.  
  510. /*****************************************************************************/
  511. /* Structure for extension routines                                          */
  512. /*****************************************************************************/
  513. struct LUA_EXT_ENTRY
  514.        {
  515.         unsigned char lua_routine_type;       /* Extension Routine Type      */
  516.         unsigned char lua_module_name[9];     /* Extension Module Name       */
  517.         unsigned char lua_procedure_name[33]; /* Extension Procedure Name    */
  518.        } ;
  519.  
  520. /*****************************************************************************/
  521. /* LUA SPECIFIC FIELDS FOR THE SLI_OPEN VERB                                 */
  522. /*****************************************************************************/
  523.    struct SLI_OPEN
  524.      {
  525.      unsigned char  lua_init_type;            /* Type of Session Initiation  */
  526.      unsigned char  lua_resv65;               /* Reserved Field              */
  527.      unsigned short lua_wait;                 /* Secondary Retry Wait Time   */
  528.  
  529.      struct LUA_EXT_ENTRY  lua_open_extension[3];
  530.  
  531.      unsigned char lua_ending_delim;          /* Extension List Delimiter    */
  532.      } ;
  533.  
  534. /*****************************************************************************/
  535. /*  LUA SPECIFIC FIELDS FOR THE SLI_OPEN, SLI_SEND RUI_BID AND SLI_BID VERBS */
  536. /*****************************************************************************/
  537.    union LUA_SPECIFIC
  538.      {
  539.      struct   SLI_OPEN       open;
  540.      unsigned char           lua_sequence_number[2];     /* sequence number */
  541.      unsigned char           lua_peek_data[12];          /* Data Pending    */
  542.      } ;
  543.  
  544. /*****************************************************************************/
  545. /* GENERIC LUA VERB RECORD TYPEDEF DECLARATION                               */
  546. /*****************************************************************************/
  547.    typedef struct
  548.     {
  549.     struct LUA_COMMON       common;    /* common verb header command         */
  550.     union  LUA_SPECIFIC     specific;  /* command specific portion of record */
  551.     }  LUA_VERB_RECORD;
  552.  
  553.  
  554.  
  555. #if (defined WINDOWS) || (defined WIN32)
  556. /*****************************************************************************/
  557. /*WLUA* Return codes from WinLUAStartup                                      */
  558. /*****************************************************************************/
  559. #define WLUASYSNOTREADY                 1
  560. #define WLUAVERNOTSUPPORTED             2
  561. #define WLUAINVALID                     3
  562. #define WLUAFAILURE                     4
  563. #define WLUAINITREJECT                  5
  564.  
  565. #define WLUADESCRIPTION_LEN             40
  566.  
  567. typedef struct
  568. {
  569.   WORD wVersion;
  570.   char szDescription[WLUADESCRIPTION_LEN + 1];
  571. } LUADATA;
  572.  
  573. /*****************************************************************************/
  574. /*WLUA* Return codes from WinLUA                                             */
  575. /*****************************************************************************/
  576. #define WLUAINVALIDHANDLE               10
  577. #define WLUASTARTUPNOTCALLED            11
  578. /*l110************************************************************************/
  579. /*l110* New codes for RUI_INIT status messages                               */
  580. /*l110************************************************************************/
  581. #define WLUALINKINACTIVE                12
  582. #define WLUALINKACTIVATING              13
  583. #define WLUAPUINACTIVE                  14
  584. #define WLUAPUACTIVE                    15
  585. #define WLUAPUREACTIVATED               16
  586. #define WLUALUINACTIVE                  17
  587. #define WLUALUACTIVE                    18
  588. #define WLUALUREACTIVATED               19
  589. #define WLUASIDINVALID                  20
  590. #define WLUASIDZERO                     21
  591. #define WLUAALREADYACTIVE               22
  592. #define WLUANTFYINVALID                 23
  593. #define WLUAGLOBALHANDLER               24
  594. #define WLUAGETLU                       25
  595. #define WLUAUNKNOWN                     255
  596.  
  597.  
  598. #define WLUA_NTFY_EVENT                  1
  599. #define WLUA_NTFY_MSG_CORRELATOR         2
  600. #define WLUA_NTFY_MSG_SID                3
  601. /*l110************************************************************************/
  602. /*l110* End changes                                                          */
  603. /*l110************************************************************************/
  604.  
  605.  
  606. #endif
  607.  
  608. /*WLUA************************************************************************/
  609. /*WLUA* Function prototypes                                                  */
  610. /*WLUA************************************************************************/
  611. #ifdef WIN32
  612.   #define LOADDS
  613. #else
  614.   #define LOADDS _loadds
  615. #endif
  616. #if (defined WINDOWS) || (defined WIN32)
  617.  
  618. int  WINAPI LOADDS WinRUI        (HWND, LUA_VERB_RECORD FAR *);
  619. int  WINAPI LOADDS WinSLI        (HWND, LUA_VERB_RECORD FAR *);
  620. BOOL WINAPI LOADDS WinRUICleanup (void);
  621. BOOL WINAPI LOADDS WinSLICleanup (void);
  622. int  WINAPI LOADDS WinRUIStartup (WORD, LUADATA FAR *);
  623. int  WINAPI LOADDS WinSLIStartup (WORD, LUADATA FAR *);
  624. void WINAPI LOADDS RUI           (LUA_VERB_RECORD FAR *);
  625. void WINAPI LOADDS RUI_CALL      (LUA_VERB_RECORD FAR *);
  626. void WINAPI LOADDS SLI           (LUA_VERB_RECORD FAR *);
  627.  
  628. int WINAPI LOADDS WinRUIGetLastInitStatus (DWORD  dwSid,               /*l110*/
  629.                                     HANDLE hStatusHandle,              /*l110*/
  630.                                     DWORD  dwNotifyType,               /*l110*/
  631.                                     BOOL   bClearPrevious);            /*l110*/
  632. int WINAPI GetLuaReturnCode      (struct LUA_COMMON FAR *, UINT, unsigned char FAR *);
  633.  
  634. #else
  635. void pascal far _loadds RUI      (LUA_VERB_RECORD FAR *);
  636. #endif
  637.  
  638.  
  639. /*************************************************************************W32*/
  640. /* If Win32 environment then restore original packing format             *W32*/
  641. /*************************************************************************W32*/
  642. #ifdef WIN32                                                            /*W32*/
  643. #pragma pack()                                                          /*W32*/
  644. #endif                                                                  /*W32*/
  645.  
  646. /*****************************************************************************/
  647. /* RUI ENTRY POINT DECLARATION                                               */
  648. /*PORT* Remove prototype defintions since EE header file does not have any   */
  649. /*****************************************************************************/
  650.  
  651. #ifdef __cplusplus
  652. }
  653. #endif
  654.  
  655. #endif
  656.