home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 September / CHIP_CD_1997_09_PL.iso / software / testsoft / adabas / setup / data.z / sqlca.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-24  |  33.3 KB  |  1,112 lines

  1. #define sql_oracle 0
  2. /* begin of cpc.h */
  3. #ifndef _CPC_H_1
  4. #define _CPC_H_1 0
  5.  
  6. #define       sqlint2max               32767
  7. #define       sqlint4min             - 2147483647
  8. #define       sqlint4max               2147483647
  9. #define       sqldbnamelengthmax       18
  10. #define       sqlhostnamelengthmax     64
  11. #define       sqlserverdblengthmax     18
  12. #define       sqlservernodelengthmax   64
  13. #define       sqlsnamelengthmax        12
  14. #define       sqlnamelengthmax         18
  15. #define       sqllnamelengthmax        32
  16. #define       sqllinelengthmax         52
  17. #define       sqlmacrolinelengthmax    30
  18. #define       sqlgamax                  8
  19. #define       sqlmamax                128
  20. #define       sqlarglinelengthmax      132
  21. #define       sqlmaxformkeys           20
  22. #define       sqlmaxlabelkeys          96
  23. #define       sqlmfetchmax             18
  24. #define       sqlmfentrymax            56
  25. #define       sqlnmax                 300
  26. #define       sqldialogmax              4
  27. #define       sqlvrpmx               8240
  28. #define       sqlldmx                 250
  29.  
  30. /* dialog buffer */
  31.  
  32. #define       sqldccmax             32760
  33. #define       sqldvcmax             32760
  34. #define       sqlddgmax              5500
  35. #define       sqldigmax             24000
  36. #define       sqldvimax              5000
  37. #define       sqldpdmax               600
  38.  
  39. /* SQLCODE macro for ANSI compatibility */
  40.  
  41. #define SQLCODE sqlca.sqlcode
  42.  
  43. /* SQLSTAE macro for ANSI compatibility */
  44.  
  45. #define SQLSTATE sqlca.sqlstate
  46.  
  47. /* Symbole fuer sqlvar - Eintraege */
  48.  
  49. /* colio: */
  50. #define sqlinppar 0
  51. #define sqloutpar 1
  52. #define sqlinoutpar 2
  53.  
  54. /* colmode: */
  55. #define sqlval    0
  56. #define sqlundef  1
  57.  
  58. /* coltype: */
  59. #define sqlfixed     0
  60. #define sqlfloat     1
  61. #define sqlchar      2
  62. #define sqlbyte      3
  63. #define sqldate      4
  64. #define sqltime      5
  65. #define sqlstring    6
  66. #define sqlexpr      7
  67. #define sqltimestamp 8
  68. #define sqldbascii   9
  69. #define sqldbebcdic 10
  70. #define sqloldlongchar 11
  71. #define sqloldlongbyte 12
  72. #define sqlsmallint 15
  73. #define sqlinteger  16
  74. #define sqlvarchar  17
  75. #define sqlescapechar 18
  76. #define sqllong     19
  77. #define sqllongbyte 20
  78. #define sqlboolean  23
  79.  
  80.  
  81. /* hostvartype: */
  82. #define sqlvint2     0
  83. #define sqlvint4     1
  84. #define sqlvuns2    16
  85. #define sqlvuns4    17
  86. #define sqlvreal4    2
  87. #define sqlvreal8    3
  88. #define sqlvchar     7
  89. #define sqlvstring2   15
  90. #define sqlvstring1   20
  91. #define sqlvint8      33
  92. #define sqlvstring4   35
  93.  
  94. /* Macro Definitions for the VARCHAR Pseudotype: */
  95.  
  96. #define VARCHS(n) struct {unsigned short len; unsigned char arr [n];}
  97. #define VARCHD(t,n) struct t {unsigned short len; unsigned char arr [n];}
  98. #define VARCHR(t) struct t
  99.  
  100. /* Macro Definitions for the DECIMAL Pseudotype: */
  101.  
  102. #define DECIMS(n) struct {char arr [n];}
  103.  
  104. /* SAA sqlda Description: */
  105.  
  106. #if defined(sql_db2)
  107. #ifndef SQLDASIZE
  108. #define SQLDASIZE(n) (sizeof(struct sqlda) + (n-1)*sizeof(struct sqlvar))
  109. #endif
  110. #endif
  111.  
  112.  
  113. typedef short          sqlint2;
  114. typedef unsigned short sqluns2;
  115.  
  116.  
  117.   typedef long           sqlint4;
  118.   typedef unsigned long  sqluns4;
  119.  
  120. typedef float      sqlr4;
  121. typedef double     sqlr8;
  122. typedef char       sqlparsid   [12] ,
  123.                    sqlsname      [sqlsnamelengthmax] ,
  124.                    sqlnname      [sqlnamelengthmax] ,
  125.                    sqllname      [sqllnamelengthmax] ,
  126.                    sqllinetype   [sqllinelengthmax] ,
  127.                    sqlmacroline  [sqlmacrolinelengthmax] ,
  128.                    sqldbname     [sqldbnamelengthmax] ,
  129.                    sqldbnode     [sqlhostnamelengthmax] ,
  130.                    sqlserverdb   [sqlserverdblengthmax] ,
  131.                    sqlservernode [sqlservernodelengthmax] ,
  132.                    sqlhostname   [sqlhostnamelengthmax] ,
  133.                    sqlargline    [sqlarglinelengthmax] ,
  134.                    sqlformkeys   [sqlmaxformkeys] ,
  135.                    sqllabelkeys  [sqlmaxlabelkeys] ,
  136.                    sqluser [18],
  137.                    sqlpassword [18] ,
  138.                    sqlc8 [8],
  139.            sqlc80 [80],
  140.                    sqlstatement_buffer [8240];
  141. typedef sqlint4    sqlcrypt [6];
  142. typedef DECIMS(1) DECIMAL1;
  143. typedef DECIMS(2) DECIMAL2;
  144. typedef DECIMS(2) DECIMAL3;
  145. typedef DECIMS(3) DECIMAL4;
  146. typedef DECIMS(3) DECIMAL5;
  147. typedef DECIMS(4) DECIMAL6;
  148. typedef DECIMS(4) DECIMAL7;
  149. typedef DECIMS(5) DECIMAL8;
  150. typedef DECIMS(5) DECIMAL9;
  151. typedef DECIMS(6) DECIMAL10;
  152. typedef DECIMS(6) DECIMAL11;
  153. typedef DECIMS(7) DECIMAL12;
  154. typedef DECIMS(7) DECIMAL13;
  155. typedef DECIMS(8) DECIMAL14;
  156. typedef DECIMS(8) DECIMAL15;
  157.  
  158. struct SQLCOL
  159. {
  160.         sqlint2 coltype;
  161.         sqlint2 colmode;
  162.         sqlint2 colio;
  163.     sqlint2 fill;
  164.         sqlint4 collen;
  165.         sqlint2 colfrac;
  166.         sqlint2 colpos;           /* column buffer position (relative) */
  167.         sqlint2 coliolen;         /* column byte length */
  168.         char colisnum;          /* (numeric column) ? 1 : 0 */
  169.         char colislong;         /* (long column) ? 1 : 0 */
  170.         sqlint2 colvartype;       /* host variable type */
  171.         sqlint2 colindtype;       /* indicator variable type */
  172. #if defined(__cplusplus) || defined(__STDC__)
  173.         int (*coltobuf) (const struct SQLCOL *col, char *buf, const void *va,
  174.                 sqlint4 cl, sqlint4 vs, sqlint2 vl, sqlint2 vf);
  175.         int (*colfrombuf) (const struct SQLCOL *col, const char *buf,
  176.                 void *va, sqlint4 cl, sqlint4 vs, sqlint2 vl, sqlint2 vf);
  177.                          /* input and output conversion functions */
  178.         int (*coltoindi) (sqlint4 ival, void *indi,sqlint2 indl,sqlint2 indf);
  179.         int (*colfromindi) (sqlint4 *ival, const void *indi, sqlint2 indl,
  180.                 sqlint2 indf); /* indicator conversion functions */
  181. #else
  182.         int (*coltobuf) ();
  183.         int (*colfrombuf) (); /* input and output conversion functions */
  184.         int (*coltoindi) ();
  185.         int (*colfromindi) (); /* indicator conversion functions */
  186. #endif
  187. };
  188.  
  189. struct SQLROW
  190. {
  191.         sqlint2 ireclen;  /* irecord length = Max (icolpos) + its (coliolen) */
  192.         sqlint2 oreclen;  /* orecord length = Max (ocolpos) + its (coliolen) */
  193. };
  194.  
  195. struct SQLRESTBUFLONG
  196. {
  197.         sqlint2 rbcolno;
  198.         sqlint2 rbrestlen;
  199.         sqlint4 rbhostlensum;
  200.         sqlint4 rblongcolmax;
  201.         char varpart [sqlvrpmx];
  202. };
  203.  
  204. struct SQLMSG
  205. {
  206.         sqlint4 reserved;
  207.         char protid;
  208.         char msgclass;
  209.         char rteflags;
  210.         char residual;
  211.         sqlint4 sendref;
  212.         sqlint4 recvref;
  213.         char fill [4];
  214.         char msgcode [2];
  215.         sqlint2 msgtype;
  216.         char sendid [8];
  217.         sqlint2 part1l;
  218.         sqlint2 part2l;
  219.         sqlint2 retcode;
  220.         sqlint2 errcode;
  221.         char varpart [sqlvrpmx];
  222. };
  223.  
  224. struct SQLPCLD
  225. {
  226. #if defined(__cplusplus) || defined(__STDC__)
  227.         void *ldhostaddr;
  228.         void *ldindkaddr;
  229. #else
  230.         char *ldhostaddr;
  231.         char *ldindkaddr;
  232. #endif
  233.         struct SQLCOL *ldcoladdr;
  234.         sqlint4 ldhostlen;
  235.         sqlint2 ldhosttype;
  236.         sqlint2 ldindktype;
  237.         sqlint2 ldindklen;
  238.         sqlint2 ldindkfrac;
  239.         sqlint2 ldrowno;
  240.         sqlint2 ldcolno;
  241.         char ldsfiotype;
  242.         char ldsfdtype;
  243.         sqlint2 ldsfbufpos;
  244.         sqlint4 ldhostlensum;
  245. };
  246.  
  247. struct OLDSQLSPLD
  248. {
  249.     char     lddsc [8];
  250.         char     ldtabid [8];
  251.         char     lddbno [2];
  252.         char     ldrpl;
  253.         char     ldchange;
  254.         sqlint4  ldintpos;
  255.         char     ldextr;
  256.         char     ldshortsc;
  257.         unsigned char ldvalind;
  258.         char    ldvalmode;
  259.         sqlint2 ldvalpos;
  260.         sqlint2 ldvallen;
  261. };
  262. struct NEWSQLSPLD
  263. {
  264.     char    lddsc [8];
  265.         char    ldsvno [2];
  266.         char    ldchange;
  267.         char    ldrpl;
  268.         sqlint4 ldcurrpag;
  269.         sqlint2 ldcurrpos;
  270.     char    ldcolno;
  271.     char    ldshowkind;
  272.         sqlint4 ldintpos;
  273.         char    ldinfoset;
  274.         char    ldfill1;
  275.         unsigned char ldvalind;
  276.         char    ldvalmode;
  277.         sqlint2 ldvalpos;
  278.         sqlint2 ldvallen;
  279.         sqlint4 ldfullen;
  280.         char    ldfill2 [4];
  281.         sqlint4 ldlastipos;
  282.         sqlint4 ldrootcheck;
  283. };
  284.  
  285. struct SQLSPLD
  286. {
  287.         sqlint2 ldkind;
  288.         sqlint2 ldlength;
  289.     union
  290.     {
  291.         struct OLDSQLSPLD o;
  292.         struct NEWSQLSPLD n;
  293.     } ld;
  294. };
  295.  
  296. struct SQLLD
  297. {
  298.         sqlint2 ldmaxi;
  299.         sqlint2 ldmaxo;
  300.         sqlint2 ldindpc;
  301.         sqlint2 ldindsp;
  302.         sqlint2 ldcolkind;
  303.         sqlint2 ldcount;
  304.         char ldputvalsend;
  305.         char allsend;
  306.         sqlint2 ldretmaxi;   /** bf 20.12.94 */
  307.         sqlint2 ldretmaxo;
  308.         sqlint2 ldretindpc;
  309.         sqlint2 ldretindsp;
  310.     struct SQLRESTBUFLONG  *ldrestbufp;  /** bf **/
  311.     struct SQLPCLD ldpc [sqlldmx];
  312.         struct SQLSPLD ldsp [sqlldmx];
  313. };
  314.  
  315. typedef struct
  316. {
  317.         char  ratermid [8];
  318.         sqlint4  raprocessid;
  319.         char  racomponent  [4];
  320.         sqlint2 rasqlinit,
  321.               raactsession,
  322.               rakamode,
  323.               ramesstype;
  324.         sqlint4  raprofsec;
  325.         struct SQLMSG sqlmsg;
  326. }
  327. sqlratype; /**/
  328.  
  329. typedef struct
  330. {
  331.  sqlhostname  tatracefn;
  332.  sqlint4         tatraceno;
  333.  sqlint4         tatracepprt;
  334.  sqlint2        tatracety;
  335.  sqlint2        tamaxsecoutp;
  336.  sqlhostname  tamaxsecfn;
  337.  sqlint4         tamaxsecno;
  338.  sqlint4         tamaxsecpptr;
  339.  sqlc8        tastartdate;
  340.  sqlc8        taenddate;
  341.  sqlc8        tastarttime;
  342.  sqlc8        taendtime;
  343.  sqlint2        tacnttrstm ;
  344.  sqlint2        tastr80l;
  345.  sqlc80       tastr80;
  346. }
  347. sqltatype;  /**/
  348.  
  349. typedef struct     {
  350.  sqlhostname   oamodtracefn;
  351.  sqlint2         oamodtrace;
  352.  sqlint2         oamodtracety;
  353.  sqlint2         oamodsettrty;
  354.  sqlint2         oamaxtrstm;
  355.  sqlint2         oaprofile;
  356.  sqlint2         oanotrtimeoutp;
  357.  sqlint2         oanosdf;
  358.  sqlint2         oauseropset;
  359.  sqlint4          oatraceptr;
  360.  sqlint2         oamaxsec;
  361. }
  362. sqloatype;  /**/
  363.  
  364. typedef struct     {
  365.                       sqlint4       ga_reference;
  366.                       sqlint2       ga_status;
  367.                       sqlint2       ga_lockset;
  368.                       sqluser       ga_userid;
  369.                       sqlint2       ga_profinit;
  370.                       sqlcrypt      ga_password;
  371.                       sqlint2       ga_timeout;
  372.                       sqlint2       ga_vaindex;
  373.                       sqldbname     ga_serverdb;
  374.                       sqlint2       ga_messcode;
  375.                       sqlhostname   ga_servernode;
  376.                       sqlnname      ga_userkey;
  377.                       sqlint2       ga_nodeindex;
  378.                       char          ga_sqlmode [8]; /**/
  379.                       sqlint4       ga_cachelimit; /**/
  380.                    }
  381.                    sqlgaentry;
  382.  
  383. typedef struct     {
  384.   sqluser         gaopuserid;
  385.   sqlint2         gaoplockset;
  386.   sqlcrypt        gaoppassword;
  387.   sqlint2         gamodlockset;
  388.   sqlint2         gaoptimeout;
  389.   sqlhostname     gaopservernode;
  390.   sqldbname       gaopserverdb;
  391.   sqlint2         gasqlconntyp;
  392.   sqlint4         gaopcachelimit;
  393.   sqlint2         gaxuserset;
  394.   sqlint2         gafiller1;
  395.   sqlgaentry    *gaentry [sqlgamax];
  396.      }
  397.      sqlgatype;   /**/
  398. typedef struct     {
  399.                       sqlint2       malen;
  400.                       sqlmacroline  maval;
  401.                    }
  402.                    mavalue;
  403. typedef mavalue    sqlmaentries [sqlmamax] ;
  404. typedef struct     {
  405.                       sqlint4       maversion;
  406.                       sqlmaentries  maentry;
  407.                    }
  408.                    sqlmatype;
  409. typedef struct     {
  410.                   sqlint2          mfInit,
  411.                            mfSelectno,
  412.                        mfBufinit,
  413.                                        mfBuflen,
  414.                                        mfRecpos,
  415.                                        mfReclen,
  416.                                        mfPrevfaspec,
  417.                                        mfLastfaspec;
  418.                       sqlparsid        mfSelparsid;
  419.                       sqlint2          mfRownotfound,
  420.                                        mfRecposbeg;
  421.                       sqlint4          mfMaxselrec,
  422.                                        mfLastrecno,
  423.                                        mfBufbegno,
  424.                                        mfBufendno;
  425.                       struct SQLMSG   *mfBufpointer;
  426.                       sqlint2          mfsqlint4colpos,
  427.                                        mfFiller;
  428.            }
  429.                    sqlmfentry;
  430. /*typedef char       sqlmfentry [sqlmfentrymax] ;*/
  431. typedef struct     {
  432.                       sqlint2       mfselcnt,
  433.                                     mfetch;
  434.                       sqlmfentry    mfentry [sqlmfetchmax] ;
  435.                    }
  436.                    sqlmftype;
  437.  
  438. typedef struct     {
  439.                       sqlint2       xainit,
  440.                                     xacmdinit,
  441.                                     xakano;
  442.                       sqlnname      xaprogn;
  443.                       sqlint2       xaprogc;
  444.                       sqlnname      xamodn;
  445.                       sqlint2       xamodc,
  446.                                     xalang,
  447.                                     xabs,
  448.                                     xatrace,
  449.                                     xaprno;
  450.                       sqlsname      xalcheck;
  451.                       sqlnname      xaprname;
  452. #if defined(__cplusplus) || defined(__STDC__)
  453.                       void         *xasqldap;
  454. #else
  455.                       char         *xasqldap;
  456. #endif
  457.                       sqlint2       xacfetspec;
  458.                       sqlint4       xacfetposc;
  459.               sqlint4        fill;
  460.                    }
  461.                    sqlcxatype;    /**/
  462.  
  463. /* dialog buffer */
  464.  
  465. typedef char sqlcodecache    [sqldccmax];
  466. typedef char sqlvaluecache   [sqldvcmax];
  467. typedef char sqldialogglobal [sqlddgmax];
  468. typedef char sqliglobal      [sqldigmax];
  469. typedef char sqldiaprevars   [sqldvimax];
  470. typedef char sqlprecompdca   [sqldpdmax];
  471. typedef struct
  472. {
  473.         sqlint2         sqlcursor,
  474.                         sqlrelkey,
  475.                         fill,
  476.                         sqlerrno;
  477.         char            errmsg [64];
  478.         sqlnname        action,
  479.                         function1,
  480.                         function2,
  481.                         function3,
  482.                         function4,
  483.                         funct;
  484. } sqldiaresult;
  485. typedef struct     {
  486.                       sqlint2 ldcc,
  487.                               ldvc,
  488.                               lddg,
  489.                               ldig,
  490.                               ldvi,
  491.                               ldpd;
  492. #if defined(__cplusplus) || defined(__STDC__)
  493.                       void
  494. #else
  495.                       char
  496. #endif
  497.                  *pdcc,
  498.                              *pdvc,
  499.                              *pddg,
  500.                              *pdig,
  501.                              *pdvi,
  502.                              *pdpd;
  503.                       sqldiaresult diaresult;
  504.                    }
  505.                    sqldiaenv;
  506.  
  507. #if defined(sql_oracle) && ! defined(__cplusplus)
  508. typedef struct sqlca {
  509. #else
  510. typedef struct     {
  511. #endif
  512.                       sqlint4       sqlenv;
  513.                       char          sqlcaid [8] ;
  514. #ifdef sql_oracle
  515.                       sqlint4       sqlabc,
  516. #else
  517.                       sqlint4       sqlcabc,
  518. #endif
  519.                                     sqlcode;
  520. #ifdef sql_oracle
  521.                       struct {
  522.                         sqluns2 sqlerrml;
  523.                         char           sqlerrmc [70];
  524.                         } sqlerrm;
  525. #else
  526.                       sqlint2       sqlerrml;
  527.                       char          sqlerrmc [70] ;
  528. #endif
  529.                       char          sqlerrp [8] ;
  530.                       sqlint4       sqlerrd [6] ;
  531. #ifdef sql_oracle
  532.                       char          sqlwarn [16];
  533. #else
  534.                       char          sqlwarn0,
  535.                                     sqlwarn1,
  536.                                     sqlwarn2,
  537.                                     sqlwarn3,
  538.                                     sqlwarn4,
  539.                                     sqlwarn5,
  540.                                     sqlwarn6,
  541.                                     sqlwarn7,
  542.                                     sqlwarn8,
  543.                                     sqlwarn9,
  544.                                     sqlwarna,
  545.                                     sqlwarnb,
  546.                                     sqlwarnc,
  547.                                     sqlwarnd,
  548.                                     sqlwarne,
  549.                                     sqlwarnf;
  550. #endif
  551.                       char          sqlext [12] ;
  552.                       sqlnname      sqlresn;
  553.                       sqlint2       sqlcursor,
  554.                                     sqlpfkey,
  555.                                     sqlrowno,
  556.                                     sqlcolno,
  557.                     sqlmfetch;
  558.               sqlint4       sqltermref;
  559.               sqlint2       sqldiapre,
  560.                                     sqldbmode,
  561.                                     sqldatetime;
  562.               char        sqlstate [6];
  563.                       sqlargline    sqlargl;
  564.                       sqlgatype     *sqlgap;
  565.                       sqlratype     *sqlrap;
  566.                       sqloatype     *sqloap;
  567.                       sqlmatype     *sqlmap;
  568.                       sqlmftype     *sqlmfp;
  569.                       struct SQLLD  *sqlldp;
  570.                       sqltatype     *sqltap;
  571.                       sqldiaenv     *sqlplp;
  572.                       sqlcxatype    sqlcxa;
  573.                    }
  574.                    sqlcatype;
  575.  
  576. #if defined (sql_sqldb) || defined (sql_default) || defined (sql_ansi)
  577. typedef struct     {
  578.                       sqlnname      colname;
  579.                       sqlint2       colio,
  580.                                     colmode,
  581.                                     coltype;
  582.                       sqlint4       collength;
  583.                       sqlint2       colfrac,
  584.                         colfiller,
  585.                                     hostvartype,
  586.                                     hostcolsize;
  587.                       sqlint4       hostindicator;
  588. #if defined(__cplusplus) || defined(__STDC__)
  589.                       void         *hostvaraddr;
  590. #else
  591.                       char         *hostvaraddr;
  592. #endif
  593.                       sqlint4      *hostindaddr;
  594.                       struct SQLCOL col;
  595.               }
  596.                    sqlvartype;
  597. typedef struct     {
  598.                       char          sqldaid [8] ;
  599.                       sqlint4       sqlmax;
  600.                       sqlint2       sqln,
  601.                                     sqld;
  602.                       sqlint4       sqlloop,
  603.                                     sqloffset;
  604.                       sqlint2       sqlkano,
  605.                                     sqlprno,
  606.                                     sqlkamode,
  607.                                     sqlfill;
  608.                       struct SQLROW sqlrow;
  609.                       sqlvartype    sqlvar [sqlnmax] ;
  610.                    }
  611.                    sqldatype;
  612.  
  613. #endif
  614.  
  615. #if defined (sql_db2)
  616. /**/
  617. /*  SAA - sqlda Description */
  618. /**/
  619. struct sqlda       {
  620.                    unsigned char sqldaid [8];
  621.                    sqlint4       sqldabc;
  622.                    sqlint2       sqln;
  623.                    sqlint2       sqld;
  624.                    sqlint4       sqlloop,
  625.                                  sqloffset;
  626.                    sqlint2       sqlkano,
  627.                                  sqlprno,
  628.                                  sqlkamode,
  629.                                  sqlfill;
  630.                    struct SQLROW sqlrow;
  631.                    struct sqlvar {
  632.                                  sqlint2        sqltype;
  633.                                  sqlint2        sqllen;
  634.                                  unsigned char *sqldata;
  635.                                  sqlint2         *sqlind;
  636.                                  struct SQLNAME {
  637.                                                 sqlint2         length;
  638.                                                 unsigned char data [30];
  639.                                                 } sqlname;
  640.                                  struct SQLCOL col;
  641.                          } sqlvar [1];
  642.                    };
  643. /**/
  644. #endif
  645.  
  646. #ifdef sql_oracle
  647. struct SQLDA {
  648.           unsigned char sqldaid [8];
  649.           sqlint4 sqldabc;
  650.           sqlint4 sqlfill;
  651.           sqlint4 sqlloop;
  652.           sqlint4 sqloffset;
  653.           sqlint2 sqlkano,
  654.                   sqlprno;
  655.           sqlint2 sqlkamode,
  656.                   sqlfill2;
  657.           struct SQLROW sqlrow;
  658.           struct SQLCOL sqlcol [sqlnmax];
  659.           long    N;   /* Descriptor size in number of entries         */
  660.           char  **V;   /* Ptr to Arr of addresses of main variables    */
  661.           long   *L;   /* Ptr to Arr of lengths of buffers             */
  662.           short  *T;   /* Ptr to Arr of types of buffers               */
  663.           short **I;   /* Ptr to Arr of addresses of indicator vars    */
  664.           long    F;   /* Number of variables found by DESCRIBE        */
  665.           char  **S;   /* Ptr to Arr of variable name pointers         */
  666.           short  *M;   /* Ptr to Arr of max lengths of var. names      */
  667.           short  *C;   /* Ptr to Arr of current lengths of var. names  */
  668.           char  **X;   /* Ptr to Arr of ind. var. name pointers        */
  669.           short  *Y;   /* Ptr to Arr of max lengths of ind. var. names */
  670.           short  *Z;   /* Ptr to Arr of cur lengths of ind. var. names */
  671.           /* only cobol */
  672.           char  **FM;  /* Ptr to Arr of hostvar decimal pointers       */
  673.           short  *FML; /* Ptr to Arr of lengths of hostvar decimal     */
  674.           short  *FCLP;   /* nil  */
  675.           short  *FCRC;   /* nil  */
  676.           };
  677.  
  678. #ifndef __cplusplus
  679. typedef struct SQLDA SQLDA;
  680. #endif
  681. #endif
  682.  
  683. enum SQLVAINDI  {SQLVASC = 0, SQLVACM, SQLVAST, SQLVAPT};
  684.  
  685. typedef struct
  686. {
  687.     sqlint2 va1indi;
  688.     sqlint2 va1indva2;
  689.     sqlint2 va1indva3;
  690.     sqlint2 va1fill;
  691. #if defined(__cplusplus) || defined(__STDC__)
  692.     void *va1addr;
  693.         void *va1fill1;
  694. #else
  695.     char *va1addr;
  696.         char *va1fill1;
  697. #endif
  698. }
  699. sqlvascalar;
  700.  
  701. typedef struct
  702. {
  703.     sqlint2 va1indi;
  704.     sqlint2 va1indva2;
  705.     sqlint2 va1indva3;
  706.     sqlint2 va1fill;
  707.     sqlint4 va1offs;
  708.     sqlint4 va1fill2;
  709. }
  710. sqlvacomponent;
  711.  
  712. typedef struct
  713. {
  714.     sqlint2 va1indi;
  715.     sqlint2 va1cmpcnt;
  716.     sqlint4 va1size;
  717. #if defined(__cplusplus) || defined(__STDC__)
  718.     void *va1addr;
  719. #else
  720.     char *va1addr;
  721. #endif
  722.     sqlint4 va1ix;
  723. }
  724. sqlvastruct;
  725.  
  726. typedef struct
  727. {
  728.     sqlint2 va1indi;
  729.     sqlint2 va1fill3;
  730.     sqlint4 va1ix;
  731. #if defined(__cplusplus) || defined(__STDC__)
  732.     void *va1addr;
  733.         void *va1fill5;
  734. #else
  735.     char *va1addr;
  736.         char *va1fill5;
  737. #endif
  738. }
  739. sqlvaptr;
  740.  
  741. typedef union
  742. {
  743.     sqlvascalar sc;
  744.     sqlvacomponent cm;
  745.     sqlvastruct st;
  746.     sqlvaptr pt;
  747. }
  748. sqlva1en;
  749.  
  750. typedef struct     {
  751.                    sqlint2 va2typ;
  752.                    sqlint2 va2digit;
  753.                    sqlint4 va2size;
  754.                    sqlint2 va2frac;
  755.                    sqlint2 va2const;
  756.                    }
  757.                    sqlva2en;
  758. typedef struct     {
  759.                    sqllname va3name;
  760.                    sqlint2 va3naml;
  761.                    sqlint2 va3fill;
  762.                    }
  763.                    sqlva3en;
  764. typedef sqlva1en *sqlv1pointer;
  765. typedef sqlva2en *sqlv2pointer;
  766. typedef sqlva3en *sqlv3pointer;
  767.  
  768. enum SQLPARINDI {SQLPARLO = 0, SQLPARST,
  769.         SQLPAREL, SQLPARPL, SQLPARFU};
  770.  
  771. typedef struct     {
  772.                       sqlint2       pakind;
  773.                       sqlint2       pava1index;
  774.               sqlint4       paloopcnt;
  775.               sqlint4       paloopmin;
  776. }
  777.     sqlparlooptyp;
  778. typedef struct     {
  779.                       sqlint2       pakind;
  780.                       sqlint2       pavarst;
  781.                       sqlint2       paindst;
  782.                       sqlint2       paelcnt;
  783.                       sqlint4       pafill4;
  784. }
  785.     sqlparstructyp;
  786. typedef struct     {
  787.                       sqlint2       pakind;
  788.                       sqlint2       pavarno;
  789.                       sqlint2       paindno;
  790.                       sqlint2       pafill2;
  791.                       struct SQLCOL * pasqlcolp;
  792. }
  793.     sqlparelemtyp;
  794. typedef struct     {
  795.                       sqlint2       pakind;
  796.                       sqlint2       paarea;
  797.                       sqlint2       papreline;
  798.                       sqlint2       paindex;
  799.                       sqlint4       pafill5;
  800. }
  801.     sqlparsqlpltyp;
  802. typedef struct     {
  803.                       sqlint2       pakind;
  804.                       sqlint2       pacolid;
  805.                       sqlint2       pacoltyp;
  806.                       sqlint2       pava1ind;
  807.                       sqlint4       pafill6;
  808. }
  809.     sqlparfuncpltyp;
  810. typedef union     {
  811.     sqlparlooptyp    lo;
  812.     sqlparstructyp   st;
  813.     sqlparelemtyp    el;
  814.     sqlparsqlpltyp   pl;
  815.     sqlparfuncpltyp  fu;
  816. }
  817. sqlparentry;
  818. typedef sqlparentry *sqlparpointer;
  819.  
  820.  
  821. typedef struct     {
  822.                       sqlint2       katyp,
  823.                                     kastate,
  824.                                     kapacount,
  825.                                     kapaindex,
  826.                                     kastcount,
  827.                                     kastindex,
  828.                                     kamacro,
  829.                                     kaprindex,
  830.                                     kadiindex,
  831.                                     kaparserrc;
  832.                       sqlint4       kaversion;
  833.                       sqlparsid     kaparsid;
  834.                       sqlint2       kaparamcnt,
  835.                                     kalineno,
  836.                                     kafaindex,
  837.                                     kaatindex,
  838.                                     kacuindex,
  839.                                     kamode;
  840.                       struct SQLROW kasqlrow;
  841.                    }
  842.                    sqlkaentry;
  843. typedef sqlkaentry *sqlkapointer;
  844. typedef struct     {
  845.                       char*         orsfpointer;
  846.                       sqlint2       oropennew,
  847.                                     orkaopenind;
  848.                    }
  849.                    sqlorentry;
  850. typedef sqlorentry *sqlorpointer;
  851. typedef struct     {
  852.                       sqlint2       prvaindex,
  853.                                     prstate;
  854.                       sqlnname      prname;
  855.                       sqlint2       prkaindex,
  856.                                     prarea,
  857.                                     prdescribe;
  858.                       sqlnname      prcuname;
  859.                       sqlint2       prcuindex,
  860.                                     prstcount,
  861.                                     prstindex;
  862.                    }
  863.                    sqlprentry;
  864. typedef sqlprentry *sqlprpointer;
  865. typedef struct     {
  866.                       sqlint4       stllen;
  867.                       sqllinetype   stline;
  868.                    }
  869.                    sqlstentry;
  870. typedef sqlstentry *sqlstpointer;
  871. typedef struct
  872. {
  873.         sqlint2 faselectno;
  874.         sqlint2 famfindex;
  875.         sqlint4 fapos;
  876.         sqlint2 faspec;
  877.         sqlint2 fafetch;
  878.         sqlint2 fareclen;
  879.         sqlint2 fill;
  880. } sqlfaentry;
  881. typedef sqlfaentry *sqlfapointer;
  882. typedef struct
  883. {
  884.         sqlint2 fnkanomin;
  885.         sqlint2 fnkanomax;
  886.         sqlnname fnfilen;
  887.         sqlint2 fnincllno;
  888. } sqlfnentry;
  889. typedef sqlfnentry *sqlfnpointer;
  890. typedef struct
  891. {
  892.     sqlint2 sd1count;
  893.     sqlint2 sd1index;
  894.     sqlint2 sdcntcols;
  895.     sqlint2 sdfiller;
  896.     char sdgetheader [36];
  897.     sqlint2 sdgetfiller;
  898.     sqlint2 sdgetkeycount;
  899.     sqlint2 sdgetcntcols;
  900.     sqlint2 sdgetcntconvertcols;
  901. }
  902. sqlsdentry;
  903. typedef sqlsdentry *sqlsdpointer;
  904. typedef char sqlsd1entry [4];
  905. typedef sqlsd1entry *sqls1pointer;
  906. typedef struct     {
  907.                       sqluser       diuserid;
  908.                       sqlint2       difiller;
  909.                       sqlnname      diapplname;
  910.                       sqlnname      dimodname;
  911.                       sqlint2       dimacrono;
  912.                       sqlint2       dinacount,
  913.                                     dinaindex,
  914.                                     diopindex;
  915.                    }
  916.                    sqldientry;
  917. typedef sqldientry *sqldipointer;
  918. typedef struct     {
  919.                       sqlnname      naname;
  920.                       sqlint2       nalnam,
  921.                                     nalow,
  922.                                     nahigh,
  923.                                     namode,
  924.                                     nakind,
  925.                                     naattr,
  926.                                     napaind;
  927.                    }
  928.                    sqlnaentry;
  929. typedef sqlnaentry *sqlnapointer;
  930. typedef struct
  931. {
  932.         sqlint2         printcase,
  933.                         newpage,
  934.                         cpage,
  935.                         linespace,
  936.                         firstfeed,
  937.                         prnflag;
  938.         sqlnname        prname;
  939.         sqlint2         filler;
  940. } sqlopprint;
  941. typedef struct     {
  942.                       sqlint2       opbackground,
  943.                                     oprestore,
  944.                                     opinit;
  945.                       char          opprompt [2] ;
  946.                       sqlint2       opclear,
  947.                                     opwindowline,
  948.                                     opwindowcol,
  949.                                     opviewline,
  950.                                     opviewcol,
  951.                                     opviewlen,
  952.                                     opviewwidth,
  953.                                     opmark,
  954.                                     opaction,
  955.                                     opinp;
  956.                       sqlopprint    opprint;
  957.                       char          opframehead [80];
  958.                       sqlint2       opframe,
  959.                                     opaccept;
  960.                       sqlformkeys   opacceptkey;
  961.                       sqllabelkeys  opacceptlab;
  962.                       sqlint2       opinput [20];
  963.                    }
  964.                    sqlopentry;
  965. typedef sqlopentry *sqloppointer;
  966. typedef struct     {
  967.                       sqlnname      atdbname;
  968.                       sqlint2       atdbindex;
  969.                       sqldbnode     atdbstring;
  970.                       sqlint2       atgaindex,
  971.                                     atfiller;
  972.                    }
  973.                    sqlatentry;
  974. typedef sqlatentry *sqlatpointer;
  975. typedef struct     {
  976.                       sqlnname      cuname;
  977.                       sqlint2       cuatindex;
  978.                       sqlint4       cuerrd3;
  979.                       sqlint2       custate,
  980.                                     cukind;
  981.                    }
  982.                    sqlcuentry;
  983. typedef sqlcuentry *sqlcupointer;
  984. typedef struct     {
  985.                       sqlint2       xainit,
  986.                                     xacmdinit,
  987.                                     xakano;
  988.                       sqlnname      xaprogn;
  989.                       sqlint2       xaprogc;
  990.                       sqlnname      xamodn;
  991.                       sqlint2       xamodc,
  992.                                     xalang,
  993.                                     xabs,
  994.                                     xatrace,
  995.                                     xaprno;
  996.                       sqlsname      xalcheck;
  997.                       sqlnname      xaprname;
  998.                       sqlint2       xastopcnt,
  999.                                     xallen;
  1000.                       sqllinetype   xaline;
  1001.                       sqlint4       xatime;
  1002.                       sqlint2       xadescpos,
  1003.                                     xadesclen;
  1004.                       sqlparpointer  sqlpap;
  1005.                       sqlint4       sapfiller;
  1006.                       sqlkapointer  sqlkap;
  1007.                       sqlprpointer  sqlprp;
  1008.                       sqlstpointer  sqlstp;
  1009.                       sqlfapointer  sqlfap;
  1010.                       sqldipointer  sqldip;
  1011.                       sqlnapointer  sqlnap;
  1012.                       sqloppointer  sqlopp;
  1013.                       sqlatpointer  sqlatp;
  1014.                       sqlv1pointer  sqlv1p;
  1015.                       sqlv2pointer  sqlv2p;
  1016.                       sqlv3pointer  sqlv3p;
  1017.                       sqlsdpointer  sqlsdp;
  1018.                       sqls1pointer  sqls1p;
  1019.                       sqlint2       xaloopinp,
  1020.                                     xaloopout;
  1021.                       sqlcupointer  sqlcup;
  1022.                       sqlorpointer  sqlorp;
  1023.                       sqlint2       xaatcount,
  1024.                                     xacucount;
  1025.                       sqlfnpointer  sqlfnp;
  1026. #if defined(__cplusplus) || defined(__STDC__)
  1027.               void *sqlsnp;
  1028. #else
  1029.               char *sqlsnp;
  1030. #endif
  1031.                       char          xafill [4];
  1032.                    }
  1033.                    sqlxatype;
  1034. #endif
  1035. /* end of first part of cpc.h */
  1036. /* begin of third part of cpc.h */
  1037. #ifndef _CPC_H_3
  1038. #define _CPC_H_3 0
  1039.  
  1040.  /* ----------------------------------------------- */
  1041.  /*     SQLCA                                       */
  1042.  /* ----------------------------------------------- */
  1043.  
  1044. #ifndef sqlextern
  1045. extern sqlcatype sqlca;
  1046.  
  1047. #if defined(sql_db2)
  1048. /* SAA sqlda description */
  1049. extern short sqlsize; /* number of sqlvars (sqln) */
  1050. extern struct SQLDA *sqlptr;
  1051. #endif
  1052.  
  1053. #endif
  1054.  
  1055. static sqlxatype sqlxa;
  1056. #if sqlva1mx > 0
  1057. static sqlva1en sqlva1 [sqlva1mx];
  1058. #endif
  1059. #if sqlva2mx > 0
  1060. static sqlva2en sqlva2 [sqlva2mx];
  1061. #endif
  1062. #if sqlva3mx > 0
  1063. static sqlva3en sqlva3 [sqlva3mx];
  1064. #endif
  1065. #if sqlpamax > 0
  1066. static sqlparentry sqlpa [sqlpamax];
  1067. #endif
  1068. #if sqlkamax > 0
  1069. static sqlkaentry sqlka [sqlkamax];
  1070. static sqlorentry sqlor [sqlkamax];
  1071. #endif
  1072. #if sqlprmax > 0
  1073. static sqlprentry sqlpr [sqlprmax];
  1074. #endif
  1075. #if sqlstmax > 0
  1076. static sqlstentry sqlst [sqlstmax];
  1077. #endif
  1078. #if sqlsdmx > 0
  1079. static sqlsdentry sqlsd [sqlsdmx];
  1080. #endif
  1081. #if sqlsd1mx > 0
  1082. static sqlsd1entry sqlsd1 [sqlsd1mx];
  1083. #endif
  1084. #if sqlfamx > 0
  1085. static sqlfaentry sqlfa [sqlfamx];
  1086. #endif
  1087. #if sqlfnmx > 0
  1088. static sqlfnentry sqlfn [sqlfnmx];
  1089. #endif
  1090. #if sqldimax > 0
  1091. static sqldientry sqldi [sqldimax];
  1092. #endif
  1093. #if sqlnamax > 0
  1094. static sqlnaentry sqlna [sqlnamax];
  1095. #endif
  1096. #if sqlopmax > 0
  1097. static sqlopentry sqlop [sqlopmax];
  1098. #endif
  1099. #if (sqldamax > 0) && (defined(sql_sqldb) || defined(sql_default)) || defined(sql_ansi)
  1100. static sqldatype sqlda;
  1101. #endif
  1102. #if sqlatmx > 0
  1103. static sqlatentry sqlat [sqlatmx];
  1104. #endif
  1105. #if sqlcumx > 0
  1106. static sqlcuentry sqlcu [sqlcumx];
  1107. #endif
  1108. static sqlint2 sqlstci = 0;
  1109.  
  1110. #endif
  1111. /* end of cpc.h */
  1112.