home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / wincsv.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  24KB  |  414 lines

  1. /* Copyright Data Connection Ltd. 1989                                       */
  2. /* acssvcc.h                                                                 */
  3. /* Copyright (c) 1989 Microsoft Corporation. All rights reserved.            */
  4. /*****************************************************************************/
  5. /*       Function prototypes for the Common Service Verbs                    */
  6. /*****************************************************************************/
  7. /*  3054  13/11/91  SW  Add pascal entry point function prototype            */
  8. /*  W32   15/04/92  CD  Add WIN32 support                                    */
  9. /*  WCSV  06/11/92  SW  Add prototype for WinCSV entry points                */
  10. /*  0998  11/06/93  SP  Add Async Transfer_MS_Data + wait for Host's Rsp     */
  11. /*  WCSV2 15/09/93  PP  Add WinCSV return codes                              */
  12. /*  RCFX2 26/07/94  SF  Ensure Secondary return code is a ULONG              */
  13. /*****************************************************************************/
  14.  
  15. #ifndef ACSSVCCH_INCLUDED
  16. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  17. #define ACSSVCCH_INCLUDED
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. #if (defined(WIN32) || defined(WINDOWS))
  24.  #define CSVENTRY WINAPI
  25. #else
  26.  #define CSVENTRY far pascal
  27. #endif
  28.  
  29.  
  30.  
  31. #if (defined(WIN32) || defined(WINDOWS))
  32. #define    WCSVDESCRIPTION_LEN    127                                      /*0998*/
  33.  
  34. typedef struct tagWCSVDATA                                             /*0998*/
  35. {                                                                      /*0998*/
  36.   WORD    wVersion;                                                    /*0998*/
  37.   char    szDescription[WCSVDESCRIPTION_LEN+1];                        /*0998*/
  38. } WCSVDATA, * PWCSVDATA, FAR * LPWCSVDATA;                             /*0998*/
  39.  
  40. extern void   CSVENTRY WinCSV(long);                                   /*0998*/
  41. extern HANDLE CSVENTRY WinAsyncCSV(HWND, long);                        /*0998*/
  42. extern int    CSVENTRY WinCSVCleanup(void);                            /*0998*/
  43. extern int    CSVENTRY WinCSVStartup(WORD wVersion, LPWCSVDATA lpData);/*0998*/
  44. extern int    CSVENTRY GetCsvReturnCode (struct  svc_hdr FAR *, UINT, unsigned char FAR *);
  45. /*WCSV2***********************************************************************/
  46. /* WinCSV return codes                                                       */
  47. /*****************************************************************************/
  48. #define WCSVINVALID         CSV_FLIPI(0x01F0) /* invalid parameter           */
  49. #define WCSVSYSNOTREADY     CSV_FLIPI(0x03F0) /* subsystem not started       */
  50. #define WCSVVERNOTSUPPORTED CSV_FLIPI(0x04F0) /* requested ver not supported */
  51.  
  52. #endif
  53.  
  54. extern void CSVENTRY ACSSVC(long);
  55. extern void CSVENTRY ACSSVC_C(long);
  56. extern void CSVENTRY ACSSVC_P(long);                                   /*3054*/
  57.  
  58. /*****************************************************************************/
  59. /* Ensure the correct packing of structures                                  */
  60. /*****************************************************************************/
  61. #ifdef WIN32
  62.   #pragma pack(4)
  63. #endif
  64.  
  65. /*****************************************************************************/
  66. /*                       VCB structures                                      */
  67. /*****************************************************************************/
  68.  
  69. struct svc_hdr
  70.   {
  71.   unsigned short opcode;           /* Verb identifying operation code.       */
  72.   unsigned char opext;             /* Reserved                               */
  73.   unsigned char reserv2;           /* Reserved.                              */
  74.   unsigned short primary_rc;       /* Primary return code from verb.         */
  75.   unsigned long secondary_rc;      /* Secondary (qualifying) return code.    */
  76.   };
  77.  
  78. struct convert
  79.   {
  80.   unsigned short opcode;           /* Verb identifying operation code.       */
  81.   unsigned char opext;             /* Reserved.                              */
  82.   unsigned char reserv2;           /* Reserved.                              */
  83.   unsigned short primary_rc;       /* Primary return code from verb.         */
  84.   unsigned long secondary_rc;      /* Secondary (qualifying) return code.    */
  85.   unsigned char direction;         /* Direction of conversion - ASCII to     */
  86.                                    /* EBCDIC or vice-versa.                  */
  87.   unsigned char char_set;          /* Character to use for the conversion    */
  88.                                    /* A, AE, or user-defined G.              */
  89.   unsigned short len;              /* Length of string to be converted.      */
  90. #ifdef WIN32
  91.   unsigned char     *source;       /* Pointer to string to be converted.     */
  92.   unsigned char     *target;       /* Address to put converted string at.    */
  93. #else
  94.   unsigned char far *source;       /* Pointer to string to be converted.     */
  95.   unsigned char far *target;       /* Address to put converted string at.    */
  96. #endif
  97.   };
  98.  
  99. struct define_trace
  100.   {
  101.   unsigned short opcode;           /* Verb identifying operation code.       */
  102.   unsigned char opext;             /* Reserved.                              */
  103.   unsigned char reserv2;           /* Reserved.                              */
  104.   unsigned short primary_rc;       /* Primary return code from verb.         */
  105.   unsigned long secondary_rc;      /* Secondary (qualifying) return code.    */
  106.   unsigned char reserv3[8];        /* Reserved.                              */
  107.   unsigned char dt_set;            /* Trace state to be set (on/off).        */
  108.   /***************************************************************************/
  109.   /* In the following fields, used for specifying which sorts of tracing is  */
  110.   /* required, only the most significant bit is currently used. Bits 1 to 7  */
  111.   /* are reserved. Bit 0 can be set to 'ignore' or to 'change'.              */
  112.   /***************************************************************************/
  113.   unsigned char appc;              /* Tracing for APPC.                      */
  114.   unsigned char reserv4;           /* Reserved.                              */
  115.   unsigned char srpi;              /* Tracing for SRPI.                      */
  116.   unsigned char sdlc;              /* Reserved.                              */
  117.   unsigned char tkn_rng_dlc;       /* Reserved.                              */
  118.   unsigned char pcnet_dlc;         /* Reserved.                              */
  119.   unsigned char dft;               /* Reserved.                              */
  120.   unsigned char acdi;              /* Reserved.                              */
  121.   unsigned char reserv5;           /* Reserved.                              */
  122.   unsigned char comm_serv;         /* Tracing for Comm_Serv_API.             */
  123.   unsigned char ehllapi;           /* Reserved.                              */
  124.   unsigned char x25_api;           /* Reserved.                              */
  125.   unsigned char x25_dlc;           /* Reserved.                              */
  126.   unsigned char twinax;            /* Reserved.                              */
  127.   unsigned char reserv6;           /* Reserved.                              */
  128.   unsigned char lua_api;           /* Reserved.                              */
  129.   unsigned char etherand;          /* Reserved.                              */
  130.   unsigned char subsym;            /* Reserved.                              */
  131.   unsigned char reserv7[8];        /* Reserved.                              */
  132.   unsigned char reset_trc;         /* Reserved.                              */
  133.   unsigned short trunc;            /* Truncation size for trace records.     */
  134.   unsigned short strg_size;        /* Reserved.                              */
  135.   unsigned char reserv8[1];        /* Reserved.                              */
  136.   unsigned char phys_link[8];      /* Reserved.                              */
  137.   unsigned char reserv9[56];       /* Reserved.                              */
  138.   };
  139.  
  140.  
  141.  
  142. struct get_cp_convert_table
  143.   {
  144.   unsigned short opcode;           /* Verb identifying operation code.       */
  145.   unsigned char opext;             /* Reserved.                              */
  146.   unsigned char reserv2;           /* Reserved.                              */
  147.   unsigned short primary_rc;       /* Primary return code from verb.         */
  148.   unsigned long secondary_rc;      /* Secondary (qualifying) return code.    */
  149.   unsigned short source_cp;        /* Source code page for conversion table. */
  150.   unsigned short target_cp;        /* Target code page for conversion table. */
  151. #ifdef WIN32
  152.   unsigned char     *conv_tbl_addr;/* Address to put conversion table at.    */
  153. #else
  154.   unsigned char far *conv_tbl_addr;/* Address to put conversion table at.    */
  155. #endif
  156.   unsigned char char_not_fnd;      /* Character not found option: either     */
  157.                                    /* substitute character or round trip.    */
  158.   unsigned char substitute_char;   /* Substitute character to use.           */
  159.   };
  160.  
  161.  
  162.  
  163. struct log_message
  164.   {
  165.   unsigned short opcode;           /* Verb identifying operation code.       */
  166.   unsigned char opext;             /* Reserved.                              */
  167.   unsigned char reserv2;           /* Reserved.                              */
  168.   unsigned short primary_rc;       /* Primary return code from verb.         */
  169.   unsigned long secondary_rc;      /* Secondary (qualifying) return code.    */
  170.   unsigned short msg_num;          /* Number of message to log.              */
  171.   unsigned char origntr_id[8];     /* ID of the originator of the message.   */
  172.   unsigned char msg_file_name[3];  /* Message file to search for the required*/
  173.                                    /* message number.                        */
  174.   unsigned char msg_act;           /* Message action - whether to inform     */
  175.                                    /* operator.                              */
  176.   unsigned short msg_ins_len;      /* Length of data for insertion in msg.   */
  177. #ifdef WIN32
  178.   unsigned char     *msg_ins_ptr;  /* Address of data for insertion in msg.  */
  179. #else
  180.   unsigned char far *msg_ins_ptr;  /* Address of data for insertion in msg.  */
  181. #endif
  182.   };
  183.  
  184. struct transfer_ms_data
  185.   {
  186.   unsigned short opcode;           /* Verb identifying operation code.       */
  187.   unsigned char data_type;         /* Data type supplied to the verb - can   */
  188.                                    /* be: user-defined; alert subvectors;    */
  189.                                    /* pdstats subvectors; NMVT.              */
  190.   unsigned char reserv2;           /* Reserved.                              */
  191.   unsigned short primary_rc;       /* Primary return code from verb.         */
  192.   unsigned long secondary_rc;      /* Secondary (qualifying) return code.    */
  193.   unsigned char options;           /* Verb options. Bits 3 - 7 are reserved. */
  194.                                    /* Bit 0: Time stamp subvector option.    */
  195.                                    /* Bit 1: Product set id subvector option.*/
  196.                                    /* Bit 2: Option to send NMVT to SSCP.    */
  197.                                    /* Bit 3: Option for local logging.       */
  198.   unsigned char reserv3;           /* Reserved.                              */
  199.   unsigned char origntr_id[8];     /* ID of originator of NMVT.              */
  200.   unsigned short dlen;             /* Length of data supplied to verb.       */
  201. #ifdef WIN32
  202.   unsigned char     *dptr;         /* Address at which supplied data resides.*/
  203. #else
  204.   unsigned char far *dptr;         /* Address at which supplied data resides.*/
  205. #endif
  206.   };
  207.  
  208.  
  209. struct set_user_log_queue
  210.   {
  211.   unsigned short opcode;           /* Verb operation code                    */
  212.   unsigned char opext;             /* Reserved.                              */
  213.   unsigned char reserv2;           /* Reserved.                              */
  214.   unsigned short primary_rc;       /* Primary RETURN_CODE                    */
  215.   unsigned long secondary_rc;      /* Secondary RETURN_CODE                  */
  216.   unsigned char reserv3[8];        /* Reserved.                              */
  217.   unsigned char queue_name[64];    /* Reserved.                              */
  218.   unsigned char forward;           /* Reserved.                              */
  219.   unsigned char suppress;          /* Reserved.                              */
  220.   unsigned char selection;         /* Reserved.                              */
  221.   unsigned short numbers[10];      /* Reserved.                              */
  222.   };
  223.  
  224.  
  225. struct copy_trace_to_file
  226.   {
  227.   unsigned short opcode;           /* Verb identifying operation code.       */
  228.   unsigned char opext;             /* Reserved.                              */
  229.   unsigned char reserv2;           /* Reserved.                              */
  230.   unsigned short primary_rc;       /* Primary return code from verb.         */
  231.   unsigned long secondary_rc;      /* Secondary (qualifying) return code.    */
  232.   unsigned char reserv3[8];        /* Reserved.                              */
  233.   unsigned char file_name[64];     /* Trace file name.                       */
  234.   unsigned char file_option;       /* File options. New or overwrite.        */
  235.   unsigned char reserv4[12];       /* Address at which supplied data resides.*/
  236.   };
  237.  
  238.  
  239. /*****************************************************************************/
  240. /* Return the packing to what the user set                                   */
  241. /*****************************************************************************/
  242. #ifdef WIN32
  243.   #pragma pack()
  244. #endif
  245.  
  246. /*****************************************************************************/
  247. /* ------------------------- macro definitions ----------------------------- */
  248. /*****************************************************************************/
  249.  
  250. /*************************************************************************W32*/
  251. /* define type conversion macros                                         *W32*/
  252. /*************************************************************************W32*/
  253. #ifndef CSVFLIPSET
  254. #define CSVFLIPSET
  255. #define CSV_LO_UC(w)    ((unsigned char)(((unsigned short)(w)) & 0xFF)) /*W32*/
  256. #define CSV_HI_UC(w)    ((unsigned char)(((unsigned short)(w) >> 8)  \
  257.                             & 0xff))                                    /*W32*/
  258. #define CSV_MAKUS(l, h) (((unsigned short)(l)) |                     \
  259.                           ((unsigned short)(h)) << 8)                   /*W32*/
  260. #define CSV_MAKUL(l, h) ((unsigned long)(((unsigned short)(l))|      \
  261.                           ((unsigned long)((unsigned short)(h))) << 16))/*W32*/
  262. #define CSV_LO_US(l)  ((unsigned short)(((unsigned long)(l)) & 0xFFFF)) /*W32*/
  263. #define CSV_HI_US(l)    ((unsigned short)(((unsigned long)(l) >> 16) \
  264.                            & 0xffff))                                   /*W32*/
  265.                                                                         /*W32*/
  266. /*************************************************************************W32*/
  267. /* IF non-Intel THEN                                                     *W32*/
  268. /*   set flipping to nop for now                                         *W32*/
  269. /*************************************************************************W32*/
  270. #ifdef NON_INTEL_BYTE_ORDER                                             /*W32*/
  271. #define CSV_FLIPI(X)  (X)                                               /*W32*/
  272. #define CSV_FLIPL(X)  (X)                                               /*W32*/
  273.                                                                         /*W32*/
  274. /*************************************************************************W32*/
  275. /* ELSE (Intel environment)                                              *W32*/
  276. /*   define flipping macros                                              *W32*/
  277. /*************************************************************************W32*/
  278. #else                                                                   /*W32*/
  279. #define CSV_FLIPI(X) CSV_MAKUS(CSV_HI_UC(X),CSV_LO_UC(X))               /*W32*/
  280. #define CSV_FLIPL(X) CSV_MAKUL(CSV_FLIPI(CSV_HI_US(X)),               \
  281.                                  CSV_FLIPI(CSV_LO_US(X)))               /*W32*/
  282. #endif                                                                  /*W32*/
  283. #endif
  284.  
  285. /*****************************************************************************/
  286. /*        Verb op codes.                                                     */
  287. /*****************************************************************************/
  288.  
  289.   #define SV_CONVERT                       CSV_FLIPI(0x1A00)
  290.   #define SV_DEFINE_TRACE                  CSV_FLIPI(0x1D00)
  291.   #define SV_GET_CP_CONVERT_TABLE          CSV_FLIPI(0x1900)
  292.   #define SV_LOG_MESSAGE                   CSV_FLIPI(0x1F00)
  293.   #define SV_TRANSFER_MS_DATA              CSV_FLIPI(0x1C00)
  294.  
  295.   #define SV_SET_USER_LOG_QUEUE            CSV_FLIPI(0x4B00)
  296.   #define SV_COPY_TRACE_TO_FILE            CSV_FLIPI(0x4C00)
  297.   #define SV_DEFINE_DUMP                   CSV_FLIPI(0x4D00)
  298.  
  299.  
  300. /*****************************************************************************/
  301. /*        Parameters for the Common Service Verbs.                           */
  302. /*****************************************************************************/
  303.  
  304.   #define SV_ADD                                     0
  305.   #define SV_CHANGE                                  1
  306.   #define SV_IGNORE                                  0
  307.   #define SV_NO_ADD                                  1
  308.   #define SV_NO_SEND                                 1
  309.   #define SV_SEND                                    0
  310.  
  311.   #define SV_A                                       0x01
  312.   #define SV_AE                                      0x00
  313.   #define SV_ALL                                     0x01
  314.   #define SV_ALERT_SUBVECTORS                        0x02
  315.   #define SV_ASCII_TO_EBCDIC                         0x00
  316.   #define SV_EBCDIC_TO_ASCII                         0x01
  317.   #define SV_FORWARD                                 0x02
  318.   #define SV_INTRV                                   0x00
  319.   #define SV_G                                       0x02
  320.   #define SV_LOG                                     0x00
  321.   #define SV_LOGS                                    0x00
  322.   #define SV_NMVT                                    0x01
  323.   #define SV_NO                                      0x00
  324.   #define SV_NO_INTRV                                0x01
  325.   #define SV_NO_LOG                                  0x01
  326.   #define SV_NONE                                    0x00
  327.   #define SV_OFF                                     0x00
  328.   #define SV_ON                                      0x01
  329.   #define SV_PDSTATS_SUBVECTORS                      0x03
  330.   #define SV_ROUND_TRIP                              0x01
  331.   #define SV_SOME                                    0x00
  332.   #define SV_SUBSTITUTE                              0x00
  333.   #define SV_SYSTEM_MESSAGES                         0x01
  334.   #define SV_USER_DEFINED                            0x00
  335.   #define SV_USER_MESSAGES                           0x02
  336.   #define SV_YES                                     0x01
  337.  
  338.  /****************************************************************************/
  339.  /*       Bit masks for enabling and disabling functions                     */
  340.  /****************************************************************************/
  341.   #define SV_BIT0                                    0x80        /* x....... */
  342.   #define SV_BIT1                                    0x40        /* .x...... */
  343.   #define SV_BIT2                                    0x20        /* ..x..... */
  344.   #define SV_BIT3                                    0x10        /* ...x.... */
  345.   #define SV_BIT4                                    0x08        /* ....x... */
  346.   #define SV_BIT5                                    0x04        /* .....x.. */
  347.   #define SV_BIT6                                    0x02        /* ......x. */
  348.   #define SV_BIT7                                    0x01        /* .......x */
  349.  
  350. /*****************************************************************************/
  351. /*        Return Codes from the Common Service Verbs.                        */
  352. /*****************************************************************************/
  353.  
  354.   #define SV_COMM_SUBSYSTEM_NOT_LOADED     CSV_FLIPI(0xF012)
  355.   #define SV_CONFIG_FILE_ERROR             CSV_FLIPI(0x0032)
  356.   #define SV_INVALID_VERB                  CSV_FLIPI(0xFFFF)
  357.   #define SV_INVALID_VERB_SEGMENT          CSV_FLIPI(0xF008)
  358.   #define SV_OK                            CSV_FLIPI(0x0000)
  359.   #define SV_PARAMETER_CHECK               CSV_FLIPI(0x0001)
  360.   #define SV_STATE_CHECK                   CSV_FLIPI(0x0002)
  361.   #define SV_UNEXPECTED_DOS_ERROR          CSV_FLIPI(0xF011)
  362.   #define SV_CANCELLED                     CSV_FLIPI(0x0021)           /*0998*/
  363.   #define SV_SERVER_RESOURCE_NOT_FOUND     CSV_FLIPI(0xF024)           /*0998*/
  364.   #define SV_SERVER_RESOURCES_LOST         CSV_FLIPI(0xF026)           /*0998*/
  365.   #define SV_THREAD_BLOCKING               CSV_FLIPI(0xF006)           /*0998*/
  366.  
  367.   #define SV_CONVERSION_ERROR              CSV_FLIPL(0x00000406)
  368.   #define SV_DATA_EXCEEDS_RU_SIZE          CSV_FLIPL(0x00000302)
  369.   #define SV_INVALID_CHARACTER_SET         CSV_FLIPL(0x00000402)
  370.   #define SV_INVALID_CHAR_NOT_FOUND        CSV_FLIPL(0x00000630)
  371.   #define SV_INVALID_DATA_SEGMENT          CSV_FLIPL(0x00000006)
  372.   #define SV_INVALID_DATA_TYPE             CSV_FLIPL(0x00000303)
  373.   #define SV_INVALID_DIRECTION             CSV_FLIPL(0x00000401)
  374.   #define SV_INVALID_FIRST_CHARACTER       CSV_FLIPL(0x00000404)
  375.   #define SV_INVALID_FORWARD               CSV_FLIPL(0x00000700)
  376.   #define SV_INVALID_MESSAGE_ACTION        CSV_FLIPL(0x00000621)
  377.   #define SV_INVALID_NMVT_ERROR            CSV_FLIPL(0x00000304)
  378.   #define SV_INVALID_QUEUE                 CSV_FLIPL(0x00000704)
  379.   #define SV_INVALID_RESET_TRACE           CSV_FLIPL(0x0000062F)
  380.   #define SV_INVALID_SELECTION             CSV_FLIPL(0x00000702)
  381.   #define SV_INVALID_SET                   CSV_FLIPL(0x00000624)
  382.   #define SV_INVALID_SOURCE_CODE_PAGE      CSV_FLIPL(0x00000631)
  383.   #define SV_INVALID_STORAGE_SIZE          CSV_FLIPL(0x00000627)
  384.   #define SV_INVALID_SUPPRESS              CSV_FLIPL(0x00000701)
  385.   #define SV_INVALID_TARGET_CODE_PAGE      CSV_FLIPL(0x00000632)
  386.   #define SV_PD_MENUS_IN_PROGRESS          CSV_FLIPL(0x0000062E)
  387.   #define SV_QUEUE_ALREADY_IN_EFFECT       CSV_FLIPL(0x00000705)
  388.   #define SV_SSCP_PU_SESSION_NOT_ACTIVE    CSV_FLIPL(0x00000301)
  389.   #define SV_TABLE_ERROR                   CSV_FLIPL(0x00000405)
  390.   #define SV_TOO_HIGH_A_NUMBER             CSV_FLIPL(0x00000703)
  391.   #define SV_SERVER_CONN_FAILURE           CSV_FLIPL(0x030000AB) /*0998**RCFX*/
  392.  
  393. /*****************************************************************************/
  394. /* The following constants are needed for EE12 enhancements but could not    */
  395. /* be found in the EE header file.                                           */
  396. /*****************************************************************************/
  397.   #define SV_NEW                                     0x00
  398.   #define SV_OVERWRITE                               0x01
  399.  
  400.   #define SV_OUTPUT_DEVICE_FULL            CSV_FLIPI(0x0031)
  401.   #define SV_FILE_ALREADY_EXISTS           CSV_FLIPI(0x0030)
  402.  
  403.   #define SV_TRACE_NOT_STOPPED             CSV_FLIPL(0x0000062A)
  404.   #define SV_INVALID_FILE_OPTION           CSV_FLIPL(0x0000062B)
  405.   #define SV_TRACE_BUFFER_EMPTY            CSV_FLIPL(0x0000062C)
  406.  
  407.  
  408. #ifdef __cplusplus
  409. }
  410. #endif
  411.  
  412. #pragma option pop /*P_O_Pop*/
  413. #endif
  414.