WinCpic.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:36k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*****************************************************************************/
  2. /* wincpic.h                                                                 */
  3. /* Copyright Data Connection Ltd. 1992 - 2000                                */
  4. /* Copyright (c) Microsoft Corporation.  All rights reserved.                */
  5. /* CPI-Communications constants and function prototypes file                 */
  6. /*****************************************************************************/
  7. #ifndef CMCH_INCLUDED
  8. #define CMCH_INCLUDED
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /*****************************************************************************/
  13. /* Ensure the correct packing of structures                                  */
  14. /*****************************************************************************/
  15. #ifdef WIN32
  16.   #pragma pack(4)
  17. #endif
  18. /*****************************************************************************/
  19. /* Type Definitions                                                          */
  20. /*****************************************************************************/
  21. #ifdef DOS5
  22. #define CM_INT32 signed long int
  23. #define CM_ENTRY extern void pascal far _loadds
  24. #define CM_PTR   far *
  25. #endif
  26. #ifdef WINDOWS
  27. #define WINSNA
  28. #define CM_INT32 signed long int
  29. #define CM_ENTRY extern void pascal far _loadds
  30. #define CM_PTR   far *
  31. #endif
  32. #ifdef WIN32
  33. #define WINSNA
  34. #ifdef SET_UNALIGNED_ACCESS_FOR_THUNK
  35. #define CM_INT32 signed long int UNALIGNED
  36. #else
  37. #define CM_INT32 signed long int
  38. #endif
  39. #define CM_ENTRY extern void WINAPI
  40. #define CM_PTR   *
  41. #define CM_EVENT_HANDLE HANDLE
  42. #endif
  43. typedef CM_INT32 CM_CONVERSATION_STATE;
  44. typedef CM_INT32 CM_CONVERSATION_TYPE;
  45. typedef CM_INT32 CM_DATA_RECEIVED_TYPE;
  46. typedef CM_INT32 CM_DEALLOCATE_TYPE;
  47. typedef CM_INT32 CM_ERROR_DIRECTION;
  48. typedef CM_INT32 CM_FILL;
  49. typedef CM_INT32 CM_PREPARE_TO_RECEIVE_TYPE;
  50. typedef CM_INT32 CM_RECEIVE_TYPE;
  51. typedef CM_INT32 CM_REQUEST_TO_SEND_RECEIVED;
  52. typedef CM_INT32 CM_RETURN_CODE;
  53. typedef CM_INT32 CM_RETURN_CONTROL;
  54. typedef CM_INT32 CM_SEND_TYPE;
  55. typedef CM_INT32 CM_STATUS_RECEIVED;
  56. typedef CM_INT32 CM_SYNC_LEVEL;
  57. typedef CM_INT32 CM_END_TYPE;
  58. typedef CM_INT32 CM_PROCESSING_MODE;
  59. typedef CM_INT32 XC_CONVERSATION_SECURITY_TYPE;
  60. typedef CM_INT32 XC_TP_NAME_TYPE;
  61. /**STRUCT+********************************************************************/
  62. /* Side information struct used by xcmssi to define side information         */
  63. /*****************************************************************************/
  64. typedef struct side_info_entry
  65. {
  66.   unsigned char   sym_dest_name[8];            /* symbolic destination name  */
  67.   unsigned char   partner_LU_name[17];         /* fully Q'd PLU name         */
  68.   unsigned char   reserved[3];                 /* future expansion ??        */
  69.   XC_TP_NAME_TYPE TP_name_type;                /* set to XC_APPLICATION_TP   */
  70.                                                /*  or to XC_SNA_SERVICE_TP   */
  71.   unsigned char   TP_name[64];                 /* TP name                    */
  72.   unsigned char   mode_name[8];                /* mode name                  */
  73.   XC_CONVERSATION_SECURITY_TYPE
  74.                   conversation_security_type;  /* set to XC_SECURITY_NONE    */
  75.                                                /*  or to XC_SECURITY_SAME    */
  76.                                                /*  or to XC_SECURITY_PROGRAM */
  77.   unsigned char   security_user_ID[8];         /* user_ID                    */
  78.   unsigned char   security_password[8];        /* password                   */
  79. } SIDE_INFO;
  80. /**STRUCT-********************************************************************/
  81. /*****************************************************************************/
  82. /* Constant Definitions                                                      */
  83. /*****************************************************************************/
  84. /*****************************************************************************/
  85. /* Values for the conversation_state                                         */
  86. /*****************************************************************************/
  87. #define CM_INITIALIZE_STATE              (CM_CONVERSATION_STATE) 2
  88. #define CM_SEND_STATE                    (CM_CONVERSATION_STATE) 3
  89. #define CM_RECEIVE_STATE                 (CM_CONVERSATION_STATE) 4
  90. #define CM_SEND_PENDING_STATE            (CM_CONVERSATION_STATE) 5
  91. #define CM_CONFIRM_STATE                 (CM_CONVERSATION_STATE) 6
  92. #define CM_CONFIRM_SEND_STATE            (CM_CONVERSATION_STATE) 7
  93. #define CM_CONFIRM_DEALLOCATE_STATE      (CM_CONVERSATION_STATE) 8
  94. #define CM_DEFER_RECEIVE_STATE           (CM_CONVERSATION_STATE) 9
  95. #define CM_DEFER_DEALLOCATE_STATE        (CM_CONVERSATION_STATE) 10
  96. #define CM_SYNC_POINT_STATE              (CM_CONVERSATION_STATE) 11
  97. #define CM_SYNC_POINT_SEND_STATE         (CM_CONVERSATION_STATE) 12
  98. #define CM_SYNC_POINT_DEALLOCATE_STATE   (CM_CONVERSATION_STATE) 13
  99. #define CM_INITIALIZE_INCOMING_STATE     (CM_CONVERSATION_STATE) 14
  100. /*****************************************************************************/
  101. /* Values for the conversation_type                                          */
  102. /*****************************************************************************/
  103. #define CM_BASIC_CONVERSATION   (CM_CONVERSATION_TYPE) 0
  104. #define CM_MAPPED_CONVERSATION  (CM_CONVERSATION_TYPE) 1
  105. /*****************************************************************************/
  106. /* Values for data_received                                                  */
  107. /*****************************************************************************/
  108. #define CM_NO_DATA_RECEIVED          (CM_DATA_RECEIVED_TYPE) 0
  109. #define CM_DATA_RECEIVED             (CM_DATA_RECEIVED_TYPE) 1
  110. #define CM_COMPLETE_DATA_RECEIVED    (CM_DATA_RECEIVED_TYPE) 2
  111. #define CM_INCOMPLETE_DATA_RECEIVED  (CM_DATA_RECEIVED_TYPE) 3
  112. /*****************************************************************************/
  113. /* Values for the deallocate_type                                            */
  114. /*****************************************************************************/
  115. #define CM_DEALLOCATE_SYNC_LEVEL  (CM_DEALLOCATE_TYPE) 0
  116. #define CM_DEALLOCATE_FLUSH       (CM_DEALLOCATE_TYPE) 1
  117. #define CM_DEALLOCATE_CONFIRM     (CM_DEALLOCATE_TYPE) 2
  118. #define CM_DEALLOCATE_ABEND       (CM_DEALLOCATE_TYPE) 3
  119. /*****************************************************************************/
  120. /* Values for the error_direction                                            */
  121. /*****************************************************************************/
  122. #define CM_RECEIVE_ERROR  (CM_ERROR_DIRECTION) 0
  123. #define CM_SEND_ERROR     (CM_ERROR_DIRECTION) 1
  124. /*****************************************************************************/
  125. /* Values for fill type                                                      */
  126. /*****************************************************************************/
  127. #define CM_FILL_LL      (CM_FILL) 0
  128. #define CM_FILL_BUFFER  (CM_FILL) 1
  129. /*****************************************************************************/
  130. /* Values for specify_processing_mode                                        */
  131. /*****************************************************************************/
  132. #define CM_BLOCKING                    (CM_PROCESSING_MODE) 0
  133. #define CM_NON_BLOCKING                (CM_PROCESSING_MODE) 1
  134. /*****************************************************************************/
  135. /* Values for prepare_to_receive_type                                        */
  136. /*****************************************************************************/
  137. #define CM_PREP_TO_RECEIVE_SYNC_LEVEL  (CM_PREPARE_TO_RECEIVE_TYPE) 0
  138. #define CM_PREP_TO_RECEIVE_FLUSH       (CM_PREPARE_TO_RECEIVE_TYPE) 1
  139. #define CM_PREP_TO_RECEIVE_CONFIRM     (CM_PREPARE_TO_RECEIVE_TYPE) 2
  140. /*****************************************************************************/
  141. /* Values for the receive_type                                               */
  142. /*****************************************************************************/
  143. #define CM_RECEIVE_AND_WAIT   (CM_RECEIVE_TYPE) 0
  144. #define CM_RECEIVE_IMMEDIATE  (CM_RECEIVE_TYPE) 1
  145. /*****************************************************************************/
  146. /* Values for request_to_send_received                                       */
  147. /*****************************************************************************/
  148. #define CM_REQ_TO_SEND_NOT_RECEIVED  (CM_REQUEST_TO_SEND_RECEIVED) 0
  149. #define CM_REQ_TO_SEND_RECEIVED      (CM_REQUEST_TO_SEND_RECEIVED) 1
  150. /*****************************************************************************/
  151. /* Values for return_code (including CPI-RR value, which start at 100)       */
  152. /*****************************************************************************/
  153. #define CM_OK                            (CM_RETURN_CODE) 0
  154. #define CM_ALLOCATE_FAILURE_NO_RETRY     (CM_RETURN_CODE) 1
  155. #define CM_ALLOCATE_FAILURE_RETRY        (CM_RETURN_CODE) 2
  156. #define CM_CONVERSATION_TYPE_MISMATCH    (CM_RETURN_CODE) 3
  157. #define CM_PIP_NOT_SPECIFIED_CORRECTLY   (CM_RETURN_CODE) 5
  158. #define CM_SECURITY_NOT_VALID            (CM_RETURN_CODE) 6
  159. #define CM_SYNC_LVL_NOT_SUPPORTED_LU     (CM_RETURN_CODE) 7
  160. #define CM_SYNC_LVL_NOT_SUPPORTED_PGM    (CM_RETURN_CODE) 8
  161. #define CM_TPN_NOT_RECOGNIZED            (CM_RETURN_CODE) 9
  162. #define CM_SYNC_LEVEL_NOT_SUPPORTED_LU   (CM_RETURN_CODE) 7
  163. #define CM_SYNC_LEVEL_NOT_SUPPORTED_PGM  (CM_RETURN_CODE) 8
  164. #define CM_TPN_NOT_RECOGNISED            (CM_RETURN_CODE) 9
  165. #define CM_TP_NOT_AVAILABLE_NO_RETRY     (CM_RETURN_CODE) 10
  166. #define CM_TP_NOT_AVAILABLE_RETRY        (CM_RETURN_CODE) 11
  167. #define CM_DEALLOCATED_ABEND             (CM_RETURN_CODE) 17
  168. #define CM_DEALLOCATED_NORMAL            (CM_RETURN_CODE) 18
  169. #define CM_PARAMETER_ERROR               (CM_RETURN_CODE) 19
  170. #define CM_PRODUCT_SPECIFIC_ERROR        (CM_RETURN_CODE) 20
  171. #define CM_PROGRAM_ERROR_NO_TRUNC        (CM_RETURN_CODE) 21
  172. #define CM_PROGRAM_ERROR_PURGING         (CM_RETURN_CODE) 22
  173. #define CM_PROGRAM_ERROR_TRUNC           (CM_RETURN_CODE) 23
  174. #define CM_PROGRAM_PARAMETER_CHECK       (CM_RETURN_CODE) 24
  175. #define CM_PROGRAM_STATE_CHECK           (CM_RETURN_CODE) 25
  176. #define CM_RESOURCE_FAILURE_NO_RETRY     (CM_RETURN_CODE) 26
  177. #define CM_RESOURCE_FAILURE_RETRY        (CM_RETURN_CODE) 27
  178. #define CM_UNSUCCESSFUL                  (CM_RETURN_CODE) 28
  179. #define CM_DEALLOCATED_ABEND_SVC         (CM_RETURN_CODE) 30
  180. #define CM_DEALLOCATED_ABEND_TIMER       (CM_RETURN_CODE) 31
  181. #define CM_SVC_ERROR_NO_TRUNC            (CM_RETURN_CODE) 32
  182. #define CM_SVC_ERROR_PURGING             (CM_RETURN_CODE) 33
  183. #define CM_SVC_ERROR_TRUNC               (CM_RETURN_CODE) 34
  184. #define CM_OPERATION_INCOMPLETE          (CM_RETURN_CODE) 35
  185. #define CM_SYSTEM_EVENT                  (CM_RETURN_CODE) 36
  186. #define CM_OPERATION_NOT_ACCEPTED        (CM_RETURN_CODE) 37
  187. #define CM_TAKE_BACKOUT                  (CM_RETURN_CODE) 100
  188. #define CM_DEALLOCATED_ABEND_BO          (CM_RETURN_CODE) 130
  189. #define CM_DEALLOCATED_ABEND_SVC_BO      (CM_RETURN_CODE) 131
  190. #define CM_DEALLOCATED_ABEND_TIMER_BO    (CM_RETURN_CODE) 132
  191. #define CM_RESOURCE_FAIL_NO_RETRY_BO     (CM_RETURN_CODE) 133
  192. #define CM_RESOURCE_FAILURE_RETRY_BO     (CM_RETURN_CODE) 134
  193. #define CM_DEALLOCATED_NORMAL_BO         (CM_RETURN_CODE) 135
  194. /*****************************************************************************/
  195. /* Values for return_control                                                 */
  196. /*****************************************************************************/
  197. #define CM_WHEN_SESSION_ALLOCATED  (CM_RETURN_CONTROL) 0
  198. #define CM_IMMEDIATE               (CM_RETURN_CONTROL) 1
  199. /*****************************************************************************/
  200. /* Values for the send_type                                                  */
  201. /*****************************************************************************/
  202. #define CM_BUFFER_DATA               (CM_SEND_TYPE) 0
  203. #define CM_SEND_AND_FLUSH            (CM_SEND_TYPE) 1
  204. #define CM_SEND_AND_CONFIRM          (CM_SEND_TYPE) 2
  205. #define CM_SEND_AND_PREP_TO_RECEIVE  (CM_SEND_TYPE) 3
  206. #define CM_SEND_AND_DEALLOCATE       (CM_SEND_TYPE) 4
  207. /*****************************************************************************/
  208. /* Values for status_received                                                */
  209. /*****************************************************************************/
  210. #define CM_NO_STATUS_RECEIVED        (CM_STATUS_RECEIVED) 0
  211. #define CM_SEND_RECEIVED             (CM_STATUS_RECEIVED) 1
  212. #define CM_CONFIRM_RECEIVED          (CM_STATUS_RECEIVED) 2
  213. #define CM_CONFIRM_SEND_RECEIVED     (CM_STATUS_RECEIVED) 3
  214. #define CM_CONFIRM_DEALLOC_RECEIVED  (CM_STATUS_RECEIVED) 4
  215. #define CM_TAKE_COMMIT               (CM_STATUS_RECEIVED) 5
  216. #define CM_TAKE_COMMIT_SEND          (CM_STATUS_RECEIVED) 6
  217. #define CM_TAKE_COMMIT_DEALLOCATE    (CM_STATUS_RECEIVED) 7
  218. /*****************************************************************************/
  219. /* Values for the sync_level                                                 */
  220. /*****************************************************************************/
  221. #define CM_NONE     (CM_SYNC_LEVEL) 0
  222. #define CM_CONFIRM  (CM_SYNC_LEVEL) 1
  223. /*****************************************************************************/
  224. /* Values for maximum sizes of strings and buffers                           */
  225. /*****************************************************************************/
  226. #define CM_CID_SIZE   (8)         /* conversation ID           */
  227. #define CM_CTX_SIZE   (32)        /* context ID                */
  228. #define CM_LD_SIZE    (512)       /* log data                  */
  229. #define CM_MN_SIZE    (8)         /* mode name                 */
  230. #define CM_PLN_SIZE   (17)        /* partner LU name           */
  231. #define CM_PW_SIZE    (10)        /* password                  */
  232. #define CM_SDN_SIZE   (8)         /* symbolic destination name */
  233. #define CM_TPN_SIZE   (64)        /* TP name                   */
  234. #define CM_UID_SIZE   (10)        /* userid ID                 */
  235. /*****************************************************************************/
  236. /* Values for the conversation_security_type (NS/2 compatible)               */
  237. /*****************************************************************************/
  238. #define XC_SECURITY_NONE     (XC_CONVERSATION_SECURITY_TYPE) 0
  239. #define XC_SECURITY_SAME     (XC_CONVERSATION_SECURITY_TYPE) 1
  240. #define XC_SECURITY_PROGRAM  (XC_CONVERSATION_SECURITY_TYPE) 2
  241. /*****************************************************************************/
  242. /* Values for the TP_name_type (NS/2 compatible)                             */
  243. /*****************************************************************************/
  244. #define XC_APPLICATION_TP  (XC_TP_NAME_TYPE) 0
  245. #define XC_SNA_SERVICE_TP  (XC_TP_NAME_TYPE) 1
  246. /*****************************************************************************/
  247. /* Function prototypes for CPIC call routines                                */
  248. /*****************************************************************************/
  249. /* Accept_Conversation */
  250. CM_ENTRY cmaccp(unsigned char CM_PTR,               /* conversation_ID       */
  251.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  252. /* Allocate */
  253. CM_ENTRY cmallc(unsigned char CM_PTR,               /* conversation_ID       */
  254.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  255. /* Cancel_Conversation */
  256. CM_ENTRY cmcanc(unsigned char CM_PTR,               /* conversation_ID       */
  257.                 CM_INT32 CM_PTR);                   /* return_code           */
  258. /* Confirm */
  259. CM_ENTRY cmcfm(unsigned char CM_PTR,                /* conversation_ID       */
  260.                CM_REQUEST_TO_SEND_RECEIVED CM_PTR,  /* request_to_send_rec.. */
  261.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  262. /* Confirmed */
  263. CM_ENTRY cmcfmd(unsigned char CM_PTR,               /* conversation_ID       */
  264.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  265. /* Deallocate */
  266. CM_ENTRY cmdeal(unsigned char CM_PTR,               /* conversation_ID       */
  267.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  268. /* Extract_Conversation_State */
  269. CM_ENTRY cmecs(unsigned char CM_PTR,                /* conversation_ID       */
  270.                CM_CONVERSATION_STATE CM_PTR,        /* conversation_state    */
  271.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  272. /* Extract_Conversation_Type */
  273. CM_ENTRY cmect(unsigned char CM_PTR,                /* conversation_ID       */
  274.                CM_CONVERSATION_TYPE CM_PTR,         /* conversation type     */
  275.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  276. /* Extract_Mode_Name */
  277. CM_ENTRY cmemn(unsigned char CM_PTR,                /* conversation_ID       */
  278.                unsigned char CM_PTR,                /* mode_name             */
  279.                CM_INT32 CM_PTR,                     /* mode_name_length      */
  280.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  281. /* Extract_Partner_LU_Name */
  282. CM_ENTRY cmepln(unsigned char CM_PTR,               /* conversation_ID       */
  283.                 unsigned char CM_PTR,               /* partner_LU_name       */
  284.                 CM_INT32 CM_PTR,                    /* partner_LU_name_len.. */
  285.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  286. /* Extract_Sync_Level */
  287. CM_ENTRY cmesl(unsigned char CM_PTR,                /* conversation_ID       */
  288.                CM_SYNC_LEVEL CM_PTR,                /* sync_level            */
  289.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  290. /* Extract_TP_Name */
  291. CM_ENTRY cmetpn(unsigned char CM_PTR,               /* conversation_ID       */
  292.                 unsigned char CM_PTR,               /* TP_name               */
  293.                 CM_INT32 CM_PTR,                    /* TP_name_length        */
  294.                 CM_INT32 CM_PTR);                   /* return_code           */
  295. /* Flush */
  296. CM_ENTRY cmflus(unsigned char CM_PTR,               /* conversation_ID       */
  297.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  298. /* Initialize_Conversation */
  299. CM_ENTRY cminit(unsigned char CM_PTR,               /* conversation_ID       */
  300.                 unsigned char CM_PTR,               /* sym_dest_name         */
  301.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  302. /* Prepare_To_Receive */
  303. CM_ENTRY cmptr(unsigned char CM_PTR,                /* conversation_ID       */
  304.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  305. /* Receive */
  306. CM_ENTRY cmrcv(unsigned char CM_PTR,                /* conversation_ID       */
  307.                unsigned char CM_PTR,                /* buffer                */
  308.                CM_INT32 CM_PTR,                     /* requested_length      */
  309.                CM_DATA_RECEIVED_TYPE CM_PTR,        /* data_received         */
  310.                CM_INT32 CM_PTR,                     /* received_length       */
  311.                CM_STATUS_RECEIVED CM_PTR,           /* status_received       */
  312.                CM_REQUEST_TO_SEND_RECEIVED CM_PTR,  /* request_to_send_rec.. */
  313.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  314. /* Request_To_Send */
  315. CM_ENTRY cmrts(unsigned char CM_PTR,                /* conversation_ID       */
  316.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  317. /* Send */
  318. CM_ENTRY cmsend(unsigned char CM_PTR,               /* conversation_ID       */
  319.                 unsigned char CM_PTR,               /* buffer                */
  320.                 CM_INT32 CM_PTR,                    /* send_length           */
  321.                 CM_REQUEST_TO_SEND_RECEIVED CM_PTR, /* request_to_send_rec.. */
  322.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  323. /* Send_Error */
  324. CM_ENTRY cmserr(unsigned char CM_PTR,               /* conversation_ID       */
  325.                 CM_REQUEST_TO_SEND_RECEIVED CM_PTR, /* request_to_send_rec.. */
  326.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  327. /* Set_Conversation_Type */
  328. CM_ENTRY cmsct(unsigned char CM_PTR,                /* conversation_ID       */
  329.                CM_CONVERSATION_TYPE CM_PTR,         /* conversation_type     */
  330.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  331. /* Set_Deallocate_Type */
  332. CM_ENTRY cmsdt(unsigned char CM_PTR,                /* conversation_ID       */
  333.                CM_DEALLOCATE_TYPE CM_PTR,           /* deallocate_type       */
  334.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  335. /* Set_Error_Direction */
  336. CM_ENTRY cmsed(unsigned char CM_PTR,                /* conversation_ID       */
  337.                CM_ERROR_DIRECTION CM_PTR,           /* error_direction       */
  338.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  339. /* Set_Fill */
  340. CM_ENTRY cmsf(unsigned char CM_PTR,                 /* conversation_ID       */
  341.               CM_FILL CM_PTR,                       /* fill                  */
  342.               CM_RETURN_CODE CM_PTR);               /* return_code           */
  343. /* Set_Log_Data */
  344. CM_ENTRY cmsld(unsigned char CM_PTR,                /* conversation_ID       */
  345.                unsigned char CM_PTR,                /* log_data              */
  346.                CM_INT32 CM_PTR,                     /* log_data_length       */
  347.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  348. /* Specify_Local_TP_Name */
  349. CM_ENTRY cmsltp(unsigned char CM_PTR,               /* TP name               */
  350.                 CM_INT32 CM_PTR,                    /* TP_name_length        */
  351.                 CM_INT32 CM_PTR);                   /* return_code           */
  352. /* Set_Processing_Mode */
  353. CM_ENTRY cmspm(unsigned char CM_PTR,                /* conversation_ID       */
  354.                CM_INT32 CM_PTR,                     /* processing mode       */
  355.                CM_INT32 CM_PTR);                    /* return_code           */
  356. /* Set_Mode_Name */
  357. CM_ENTRY cmsmn(unsigned char CM_PTR,                /* conversation_ID       */
  358.                unsigned char CM_PTR,                /* mode_name             */
  359.                CM_INT32 CM_PTR,                     /* mode_name_length      */
  360.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  361. /* Set_Partner_LU_Name */
  362. CM_ENTRY cmspln(unsigned char CM_PTR,               /* conversation_ID       */
  363.                 unsigned char CM_PTR,               /* partner_LU_name       */
  364.                 CM_INT32 CM_PTR,                    /* partner_LU_name_len.. */
  365.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  366. /* Set_Prepare_To_Receive_Type */
  367. CM_ENTRY cmsptr(unsigned char CM_PTR,               /* conversation_ID       */
  368.                 CM_PREPARE_TO_RECEIVE_TYPE CM_PTR,  /* prepare_to_receive_.. */
  369.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  370. /* Set_Receive_Type */
  371. CM_ENTRY cmsrt(unsigned char CM_PTR,                /* conversation_ID       */
  372.                CM_RECEIVE_TYPE CM_PTR,              /* receive_type          */
  373.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  374. /* Set_Return_Control */
  375. CM_ENTRY cmsrc(unsigned char CM_PTR,                /* conversation_ID       */
  376.                CM_RETURN_CONTROL CM_PTR,            /* return_control        */
  377.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  378. /* Set_Send_Type */
  379. CM_ENTRY cmsst(unsigned char CM_PTR,                /* conversation_ID       */
  380.                CM_SEND_TYPE CM_PTR,                 /* send_type             */
  381.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  382. /* Set_Sync_Level */
  383. CM_ENTRY cmssl(unsigned char CM_PTR,                /* conversation_ID       */
  384.                CM_SYNC_LEVEL CM_PTR,                /* sync_level            */
  385.                CM_RETURN_CODE CM_PTR);              /* return_code           */
  386. /* Set_TP_name */
  387. CM_ENTRY cmstpn(unsigned char CM_PTR,               /* conversation_ID       */
  388.                 unsigned char CM_PTR,               /* TP_name               */
  389.                 CM_INT32 CM_PTR,                    /* TP_name_legth         */
  390.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  391. /* Test_Request_To_Send_Received */
  392. CM_ENTRY cmtrts(unsigned char CM_PTR,               /* conversation_ID       */
  393.                 CM_REQUEST_TO_SEND_RECEIVED CM_PTR, /* request_to_send_rec.. */
  394.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  395. /* Wait_For_Conversation */
  396. CM_ENTRY cmwait(unsigned char CM_PTR,               /* conversation_ID       */
  397.                 CM_INT32 CM_PTR,                    /* conversation ret code */
  398.                 CM_INT32 CM_PTR);                   /* return_code           */
  399. /* Convert incoming data (EBCDIC -> ASCII) */
  400. CM_ENTRY cmcnvi(unsigned char   CM_PTR,             /* buffer to convert     */
  401.                 CM_INT32        CM_PTR,             /* buffer length         */
  402.                 CM_RETURN_CODE  CM_PTR);            /* return_code           */
  403. /* Convert Outgoing data (ASCII -> EBCDIC) */
  404. CM_ENTRY cmcnvo(unsigned char   CM_PTR,             /* buffer to convert     */
  405.                 CM_INT32        CM_PTR,             /* buffer length         */
  406.                 CM_RETURN_CODE  CM_PTR);            /* return_code           */
  407. /*****************************************************************************/
  408. /* Function Prototypes for additional NS/2 compatible call routines          */
  409. /*****************************************************************************/
  410. /* Delete_CPIC_Side_Information */
  411. CM_ENTRY xcmdsi(unsigned char CM_PTR,               /* key_lock              */
  412.                 unsigned char CM_PTR,               /* sym_dest_name         */
  413.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  414. /* Extract_CPIC_Side_Information */
  415. CM_ENTRY xcmesi(CM_INT32 CM_PTR,                    /* entry_number          */
  416.                 unsigned char CM_PTR,               /* sym_dest_name         */
  417.                 SIDE_INFO CM_PTR,                   /* side_info_entry       */
  418.                 CM_INT32 CM_PTR,                    /* side_info_length      */
  419.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  420. /* Set_CPIC_Side_Information */
  421. CM_ENTRY xcmssi(unsigned char CM_PTR,               /* key_lock              */
  422.                 SIDE_INFO CM_PTR,                   /* side_info_entry       */
  423.                 CM_INT32 CM_PTR,                    /* side_info length      */
  424.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  425. /* Extract_Conversation_Security_Type */
  426. CM_ENTRY xcecst(unsigned char CM_PTR,               /* conversation_ID       */
  427.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  428.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  429. /* Extract_Conversation_User_ID */
  430. CM_ENTRY xcecsu(unsigned char CM_PTR,               /* conversation_ID       */
  431.                 unsigned char CM_PTR,               /* user_ID               */
  432.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  433.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  434. /* Set_Conversation_Security_Password */
  435. CM_ENTRY xcscsp(unsigned char CM_PTR,               /* conversation_ID       */
  436.                 unsigned char CM_PTR,               /* password              */
  437.                 CM_INT32 CM_PTR,                    /* password_length       */
  438.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  439. /* Set_Conversation_Security_Type */
  440. CM_ENTRY xcscst(unsigned char CM_PTR,               /* conversation_ID       */
  441.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  442.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  443. /* Set_Conversation_Security_User_ID */
  444. CM_ENTRY xcscsu(unsigned char CM_PTR,               /* conversation_ID       */
  445.                 unsigned char CM_PTR,               /* user_ID               */
  446.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  447.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  448. /*****************************************************************************/
  449. /* Also have new prototypes with cm not xc                                   */
  450. /*****************************************************************************/
  451. /* Extract_Conversation_Security_Type */
  452. CM_ENTRY cmecst(unsigned char CM_PTR,               /* conversation_ID       */
  453.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  454.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  455. /* Extract_Conversation_User_ID */
  456. CM_ENTRY cmecsu(unsigned char CM_PTR,               /* conversation_ID       */
  457.                 unsigned char CM_PTR,               /* user_ID               */
  458.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  459.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  460. /* Set_Conversation_Security_Password */
  461. CM_ENTRY cmscsp(unsigned char CM_PTR,               /* conversation_ID       */
  462.                 unsigned char CM_PTR,               /* password              */
  463.                 CM_INT32 CM_PTR,                    /* password_length       */
  464.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  465. /* Set_Conversation_Security_Type */
  466. CM_ENTRY cmscst(unsigned char CM_PTR,               /* conversation_ID       */
  467.                 XC_CONVERSATION_SECURITY_TYPE CM_PTR, /* conversation_sec... */
  468.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  469. /* Set_Conversation_Security_User_ID */
  470. CM_ENTRY cmscsu(unsigned char CM_PTR,               /* conversation_ID       */
  471.                 unsigned char CM_PTR,               /* user_ID               */
  472.                 CM_INT32 CM_PTR,                    /* user_ID_length        */
  473.                 CM_RETURN_CODE CM_PTR);             /* return_code           */
  474. #ifdef WINSNA
  475. /* Specify_Windows_Handle */
  476. CM_ENTRY xchwnd(HWND,                               /* Window HWND           */
  477.                 CM_INT32 CM_PTR);                   /* return_code           */
  478. #endif
  479. /*****************************************************************************/
  480. /* Function prototypes for undocumented NS/2 compatible call routines.  As   */
  481. /* these routines are undocumented the prototypes do not include any         */
  482. /* parameters.  These are needed to allow binary compatibility with NS/2     */
  483. /* CPI-C applications, with the proviso that only documented calls are       */
  484. /* actually used.                                                            */
  485. /*****************************************************************************/
  486. CM_ENTRY allocate_memory();
  487. CM_ENTRY free_cpic_memory();
  488. CM_ENTRY icmssi();
  489. #ifdef WINSNA
  490. /*---------------------------------------------------------------------------*/
  491. /* Windows CPI-C Extention Return Codes.                                     */
  492. /*---------------------------------------------------------------------------*/
  493. #define WCPICALREADY         0xF000  /* An async call is already outstanding */
  494. #define WCPICINVALID         0xF001  /* Async Task Id is invalid             */
  495. #define WCPICCANCEL          0xF002  /* Blocking call was cancelled          */
  496. #define WCPICSYSNOTREADY     0xF003  /* Underlying subsystem not started     */
  497. #define WCPICVERNOTSUPPORTED 0xF004  /* Application version not supported    */
  498. /*---------------------------------------------------------------------------*/
  499. /* Api structre definitions                                                  */
  500. /*---------------------------------------------------------------------------*/
  501. #define WCPICDESCRIPTION_LEN    127
  502. typedef struct tagWCPICDATA {
  503.         WORD    wVersion;
  504.         char    szDescription[WCPICDESCRIPTION_LEN+1];
  505. } WCPICDATA, * PWCPICDATA, FAR * LPWCPICDATA;
  506. /*****************************************************************************/
  507. /* ------------- Windows CPI-C function prototypes ------------------------- */
  508. /*****************************************************************************/
  509. extern BOOL WINAPI    WinCPICCleanup(void);
  510. extern BOOL WINAPI    WinCPICIsBlocking(void);
  511. extern int WINAPI     WinCPICStartup(WORD, LPWCPICDATA );
  512. extern FARPROC WINAPI WinCPICSetBlockingHook( FARPROC );
  513. extern BOOL WINAPI    WinCPICUnhookBlockingHook(void);
  514. #ifdef WIN32
  515. extern VOID WINAPI    WinCPICSetEvent(unsigned char   CM_PTR,
  516.                                       CM_EVENT_HANDLE CM_PTR,
  517.                                       CM_RETURN_CODE CM_PTR);
  518. extern VOID WINAPI    WinCPICExtractEvent(unsigned char   CM_PTR,
  519.                                           CM_EVENT_HANDLE CM_PTR,
  520.                                           CM_RETURN_CODE CM_PTR);
  521. #endif
  522. #define WIN_CPIC_ASYNC_COMPLETE_MESSAGE "WinAsyncCPI-C"
  523. #endif
  524. /*
  525.  * These macros allow you to write programs that are easier to read, since
  526.  * you can use the full name of the CPI-C call rather than its 6 character
  527.  * entry point.
  528.  *
  529.  * When porting code that uses these macros, you will have to ensure that
  530.  * the macros are defined on the target platform.
  531.  */
  532. #ifdef READABLE_MACROS
  533. #define Accept_Conversation(v1,v2)            cmaccp(v1,v2)
  534. #define Allocate(v1,v2)                       cmallc(v1,v2)
  535. #define Cancel_Conversation(v1,v2)            cmcanc(v1,v2)
  536. #define Confirm(v1,v2,v3)                     cmcfm(v1,v2,v3)
  537. #define Confirmed(v1,v2)                      cmcfmd(v1,v2)
  538. #define Convert_Incoming(v1,v2,v3)            cmcnvi(v1,v2,v3)
  539. #define Convert_Outgoing(v1,v2,v3)            cmcnvo(v1,v2,v3)
  540. #define Deallocate(v1,v2)                     cmdeal(v1,v2)
  541. #define Extract_Conversation_Security_User_ID(v1,v2,v3,v4)  cmecsu(v1,v2,v3,v4)
  542. #define Extract_Conversation_Security_Type(v1,v2,v3) cmecst(v1,v2,v3)
  543. #define Extract_Mode_Name(v1,v2,v3,v4)        cmemn(v1,v2,v3,v4)
  544. #define Extract_Partner_LU_Name(v1,v2,v3,v4)  cmepln(v1,v2,v3,v4)
  545. #define Extract_Sync_Level(v1,v2,v3)          cmesl(v1,v2,v3)
  546. #define Extract_TP_Name(v1,v2,v3,v4)          cmetpn(v1,v2,v3,v4)
  547. #define Flush(v1,v2)                          cmflus(v1,v2)
  548. #define Initialize_Conversation(v1,v2,v3)     cminit(v1,v2,v3)
  549. #define Prepare_To_Receive(v1,v2)             cmptr(v1,v2)
  550. #define Receive(v1,v2,v3,v4,v5,v6,v7,v8)      cmrcv(v1,v2,v3,v4,v5,v6,v7,v8)
  551. #define Request_To_Send(v1,v2)                cmrts(v1,v2)
  552. #define Send_Error(v1,v2,v3)                  cmserr(v1,v2,v3)
  553. #define Set_Conversation_Type(v1,v2,v3)       cmsct(v1,v2,v3)
  554. #define Set_Deallocate_Type(v1,v2,v3)         cmsdt(v1,v2,v3)
  555. #define Set_Error_Direction(v1,v2,v3)         cmsed(v1,v2,v3)
  556. #define Send_Data(v1,v2,v3,v4,v5)             cmsend(v1,v2,v3,v4,v5)
  557. #define Set_Fill(v1,v2,v3)                    cmsf(v1,v2,v3)
  558. #define Set_Log_Data(v1,v2,v3,v4)             cmsld(v1,v2,v3,v4)
  559. #define Set_Mode_Name(v1,v2,v3,v4)            cmsmn(v1,v2,v3,v4)
  560. #define Set_Partner_LU_Name(v1,v2,v3,v4)      cmspln(v1,v2,v3,v4)
  561. #define Set_Prepare_To_Receive_Type(v1,v2,v3) cmsptr(v1,v2,v3)
  562. #define Set_Processing_Mode(v1,v2,v3)         cmspm(v1,v2,v3)
  563. #define Set_Receive_Type(v1,v2,v3)            cmsrt(v1,v2,v3)
  564. #define Set_Return_Control(v1,v2,v3)          cmsrc(v1,v2,v3)
  565. #define Set_Send_Type(v1,v2,v3)               cmsst(v1,v2,v3)
  566. #define Set_Sync_Level(v1,v2,v3)              cmssl(v1,v2,v3)
  567. #define Set_TP_Name(v1,v2,v3,v4)              cmstpn(v1,v2,v3,v4)
  568. #define Specify_Local_TP_Name(v1,v2,v3)       cmsltp(v1,v2,v3)
  569. #define Set_Conversation_Security_Password(v1,v2,v3,v4) cmscsp(v1,v2,v3,v4)
  570. #define Set_Conversation_Security_Type(v1,v2,v3) cmscst(v1,v2,v3)
  571. #define Set_Conversation_Security_User_ID(v1,v2,v3,v4) cmscsu(v1,v2,v3,v4)
  572. #define Test_Request_To_Send_Received(v1,v2,v3) cmtrts(v1,v2,v3)
  573. #define Wait_For_Conversation(v1,v2,v3)       cmwait(v1,v2,v3)
  574. #define Specify_Windows_Handle(v1,v2)         xchwnd(v1,v2)
  575. #endif
  576. #ifdef __cplusplus
  577. }
  578. #endif
  579. /*****************************************************************************/
  580. /* Restore to default packing of structures                                  */
  581. /*****************************************************************************/
  582. #ifdef WIN32
  583.   #pragma pack()
  584. #endif
  585. #endif