home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CPI-C.ZIP / CPICDEFS.H < prev    next >
Text File  |  1992-06-21  |  7KB  |  210 lines

  1. /*
  2.  *  PROGRAM:   JQCPIC -- John Q's Portable CPI-C Abuser
  3.  *
  4.  *  MODULE:    CPICDEFS.H -- CPI-C constants, typedefs, and enums
  5.  *
  6.  *  COPYRIGHTS:
  7.  *             This module contains code made available by IBM
  8.  *             Corporation on an AS IS basis.  Any one receiving the
  9.  *             module is considered to be licensed under IBM copyrights
  10.  *             to use the IBM-provided source code in any way he or she
  11.  *             deems fit, including copying it, compiling it, modifying
  12.  *             it, and redistributing it, with or without
  13.  *             modifications.  No license under any IBM patents or
  14.  *             patent applications is to be implied from this copyright
  15.  *             license.
  16.  *
  17.  *             A user of the module should understand that IBM cannot
  18.  *             provide technical support for the module and will not be
  19.  *             responsible for any consequences of use of the program.
  20.  *
  21.  *             Any notices, including this one, are not to be removed
  22.  *             from the module without the prior written consent of
  23.  *             IBM.
  24.  *
  25.  *  AUTHOR:    Dr. John Q. Walker II
  26.  *             IBM VNET: JOHNQ at RALVM6          IBM tie line: 444-4414
  27.  *             Internet: johnq@vnet.ibm.com        phone: (919) 254-4414
  28.  *
  29.  *  RELATED FILES:
  30.  *             See file JQCPIC.DOC for detailed information.
  31.  *
  32.  *  CHANGE HISTORY:
  33.  *  Date       Description
  34.  *  05/12/92   Added prologue.
  35.  */
  36.  
  37. #define  MAX_LU_ALIAS       (8+1)
  38. #define  MAX_PLU_ALIAS      (8+1)
  39. #define  MAX_TP_NAME        (64+1)
  40. #define  MAX_SYM_DEST_NAME  (8+1)
  41. #define  MAX_FQPLU_NAME     (17+1)
  42. #define  MAX_DESTINATION    (17+1)
  43. #define  MAX_MODE_NAME      (8+1)
  44. #define  MAX_USERID         (8+1)
  45. #define  MAX_PASSWD         (8+1)
  46.  
  47. /* These two conversation states fill in the first two places in the array */
  48. #define CM_NULL_STATE                    (CM_CONVERSATION_STATE) 0
  49. #define CM_INIT_STATE                    (CM_CONVERSATION_STATE) 0
  50. #define CM_ACCP_STATE                    (CM_CONVERSATION_STATE) 1
  51.  
  52.  
  53. typedef enum {
  54.     CMACCP  =  0,
  55.     CMALLC  =  1,
  56.     CMCFM   =  2,
  57.     CMCFMD  =  3,
  58.     CMDEALa =  4,
  59.     CMDEALc =  5,
  60.     CMDEALf =  6,
  61.     CMDEALs =  7,
  62.     CMECS   =  8,
  63.     CMECT   =  9,
  64.     CMEMN   = 10,
  65.     CMEPLN  = 11,
  66.     CMESL   = 12,
  67.     CMFLUS  = 13,
  68.     CMINIT  = 14,
  69.     CMPTRc  = 15,
  70.     CMPTRf  = 16,
  71.     CMPTRs  = 17,
  72.     CMRCVi  = 18,
  73.     CMRCVw  = 19,
  74.     CMRTS   = 20,
  75.     CMSCT   = 21,
  76.     CMSDT   = 22,
  77.     CMSED   = 23,
  78.     CMSEND  = 24,
  79.     CMSERR  = 25,
  80.     CMSF    = 26,
  81.     CMSLD   = 27,
  82.     CMSMN   = 28,
  83.     CMSPLN  = 29,
  84.     CMSPTR  = 30,
  85.     CMSRC   = 31,
  86.     CMSRT   = 32,
  87.     CMSSL   = 33,
  88.     CMSST   = 34,
  89.     CMSTPN  = 35,
  90.     CMTRTS  = 36
  91. } CPIC_CALL_INDEX;
  92.  
  93. typedef enum {
  94.     MSG_CMACCP =  0,
  95.     MSG_CMALLC =  1,
  96.     MSG_CMCFM  =  2,
  97.     MSG_CMCFMD =  3,
  98.     MSG_CMDEAL =  4,
  99.     MSG_CMECS  =  5,
  100.     MSG_CMECT  =  6,
  101.     MSG_CMEMN  =  7,
  102.     MSG_CMEPLN =  8,
  103.     MSG_CMESL  =  9,
  104.     MSG_CMFLUS = 10,
  105.     MSG_CMINIT = 11,
  106.     MSG_CMPTR  = 12,
  107.     MSG_CMRCV  = 13,
  108.     MSG_CMRTS  = 14,
  109.     MSG_CMSCT  = 15,
  110.     MSG_CMSDT  = 16,
  111.     MSG_CMSED  = 17,
  112.     MSG_CMSEND = 18,
  113.     MSG_CMSERR = 19,
  114.     MSG_CMSF   = 20,
  115.     MSG_CMSLD  = 21,
  116.     MSG_CMSMN  = 22,
  117.     MSG_CMSPLN = 23,
  118.     MSG_CMSPTR = 24,
  119.     MSG_CMSRC  = 25,
  120.     MSG_CMSRT  = 26,
  121.     MSG_CMSSL  = 27,
  122.     MSG_CMSST  = 28,
  123.     MSG_CMSTPN = 29,
  124.     MSG_CMTRTS = 30,
  125.     MSG_XCSCSU = 31,
  126.     MSG_XCSCST = 32,
  127.     MSG_XCSCSP = 33
  128. } CPIC_VERB_INDEX;
  129.  
  130. typedef struct cpicerr_message {
  131.     CM_INT32 index;
  132.     char     *message;
  133. } CPICERR_MESSAGE;
  134.  
  135. typedef enum cpicerr_message_type {
  136.     CPIC_SYNC_LEVELS  = 1,
  137.     CPIC_CONV_TYPES   = 2,
  138.     CPIC_STATES_CONV  = 3,
  139.     CPIC_RC_CLASSES   = 4,
  140.     CPIC_RETURN_CODES = 5,
  141.     CPIC_VERBS_SHORT  = 6,
  142.     CPIC_VERBS_LONG   = 7
  143. } CPICERR_MESSAGE_TYPE;
  144.  
  145. typedef enum {
  146.     ALL_ERRORS      ,
  147.     CONTINUE        ,
  148.     RETRY_VERB      ,
  149.     ERROR_RECEIVED  ,
  150.     RETRY_CONV      ,
  151.     RETRY_CONV_BO   ,
  152.     BACKOUT_RECEIVED,
  153.     UNRECOVERABLE   ,
  154.     UNRECOVERABLE_BO,
  155.     NO_ERRORS
  156. } CPIC_RC_HANDLING;
  157.  
  158. typedef struct cpicerr_message_list {
  159.     CPICERR_MESSAGE_TYPE type;
  160.     CPICERR_MESSAGE *    list;
  161. } CPICERR_MESSAGE_LIST;
  162.  
  163. typedef struct cpic_conv_attrib {
  164.     /*=========================================================================
  165.      * Everything about one conversation.
  166.      *=======================================================================*/
  167.     CM_INT32                     call_index;
  168.     unsigned char CM_PTR         buffer;
  169.     unsigned char CM_PTR         conversation_ID;
  170.     CM_CONVERSATION_STATE        conversation_state;
  171.     CM_CONVERSATION_TYPE         conversation_type;
  172.     CM_DATA_RECEIVED_TYPE        data_received;
  173.     CM_DEALLOCATE_TYPE           deallocate_type;
  174.     CM_ERROR_DIRECTION           error_direction;
  175.     CM_FILL                      fill;
  176.     unsigned char CM_PTR         log_data;
  177.     CM_INT32                     log_data_length;
  178.     unsigned char CM_PTR         mode_name;
  179.     CM_INT32                     mode_name_length;
  180.     unsigned char CM_PTR         partner_LU_name;
  181.     CM_INT32                     partner_LU_name_length;
  182.     CM_PREPARE_TO_RECEIVE_TYPE   prepare_to_receive_type;
  183.     CM_RECEIVE_TYPE              receive_type;
  184.     CM_INT32                     received_length;
  185.     CM_INT32                     requested_length;
  186.     CM_REQUEST_TO_SEND_RECEIVED  request_to_send_received;
  187.     CM_RETURN_CODE               return_code;
  188.     CM_RETURN_CONTROL            return_control;
  189.     CM_INT32                     send_length;
  190.     CM_SEND_TYPE                 send_type;
  191.     CM_STATUS_RECEIVED           status_received;
  192.     unsigned char CM_PTR         sym_dest_name;
  193.     CM_SYNC_LEVEL                sync_level;
  194.     unsigned char CM_PTR         TP_name;
  195.     CM_INT32                     TP_name_length;
  196. } CPIC_CONV_ATTRIB;
  197.  
  198.  
  199. extern CPICERR_MESSAGE cpicerr_verbs_short[];
  200. extern CPICERR_MESSAGE cpicerr_verbs_long[];
  201. extern CPICERR_MESSAGE cpicerr_return_codes[];
  202. extern CPICERR_MESSAGE cpicerr_rc_classes[];
  203. extern CPICERR_MESSAGE cpicerr_states_conv[];
  204. extern CPICERR_MESSAGE cpicerr_conv_types[];
  205. extern CPICERR_MESSAGE cpicerr_sync_levels[];
  206.  
  207. extern CPIC_VERB_INDEX call_state_map[];
  208.  
  209. char *cpicerr_get_message(CPICERR_MESSAGE_TYPE, CM_INT32);
  210.