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