.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 2000-2004 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $SQL$Project Distributed Database System$VPC00C$
.tt 2 $$$
.tt 3 $$Definitions$2000-09-05$
********************************************
.nf

.nf


    ========== licence begin  GPL
    Copyright (c) 2000-2004 SAP AG

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end

.fo


.fo
Module  :
=========
.sp
Purpose :
.CM *-END-* purpose -------------------------------------
Define  :
 
.CM *-END-* define --------------------------------------
Use     :
 
.CM *-END-* use -----------------------------------------
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : 
.sp
.cp 3
Created : 1994-05-17
.sp
.cp 3
Version : 2000-09-05
.sp
.cp 3
.nf
Release :      Date : 2000-09-05
Specification:
 
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.sp
.CM -lll-
Code    :
/*PRETTY*/
#include "gpc001.h"
 
#define MXPC_SA 500
#define MXPC_KA 500
#define MXPC_PR 500
#define MXPC_ST 1000
#define MXPC_SD 20
#define MXPC_SD1 4000
#define MXPC_FN 50
#define MXPC_AT 50
#define MXPC_CU 200
#define MXPC_DI 100
#define MXPC_NA 1000
#define MXPC_OP 100
 
typedef enum tpc_chtypes_Enum {
        CPC_CH_NO,
        CPC_CH_SYNTAX,
        CPC_CH_ALL
} tpc_chtypes;
 
typedef enum tpc_se_types_Enum {
        CPC_SE_OFF = 0,
        CPC_SE_CONST,
        CPC_SE_TYPE,
        CPC_SE_VAR,
        CPC_SE_RECORD,
        CPC_SE_DECLARE,
        CPC_SE_STRUCTURE
} tpc_se_types;
 
typedef enum tpc_csymboltypes_Enum {
        CPC_CS_LEFTBRC = 25,
        CPC_CS_RIGHTBRC,
        CPC_CS_PREPCOM,
        CPC_CS_UNKNOWN    = CPR_S_UNKNOWN,
        CPC_CS_IDENTIFIER = CPR_S_IDENTIFIER,
        CPC_CS_PARAMETER  = CPR_S_PARAMETER_NAME,
        CPC_CS_GREATER    = CPR_S_GREATER,
        CPC_CS_UNSIGNED   = CPR_S_UNSIGNED_INTEGER,
        CPC_CS_CHAR       = CPR_S_STRING_LITERAL,
        CPC_CS_STRING     = CPR_S_CSTRING_LITERAL,
        CPC_CS_COMMA      = CPR_S_COMMA,
        CPC_CS_PERIOD     = CPR_S_POINT,
        CPC_CS_EQUAL      = CPR_S_EQUAL,
        CPC_CS_LEFTPAR    = CPR_S_LEFTPAR,
        CPC_CS_RIGHTPAR   = CPR_S_RIGHTPAR,
        CPC_CS_LEFTBRK    = CPR_S_LEFTINDPAR,
        CPC_CS_RIGHTBRK   = CPR_S_RIGHTINDPAR,
        CPC_CS_ASTERISK   = CPR_S_ASTERISK,
        CPC_CS_COLON      = CPR_S_COLON,
        CPC_CS_MACRO      = CPR_S_MACRO,
        CPC_CS_MINUS      = CPR_S_MINUS,
        CPC_CS_DIVIDE     = CPR_S_DIVIDE,
        CPC_CS_EOF        = CPR_S_EOF,
        CPC_CS_BUFEOF     = CPR_S_BUFEOF
} tpc_csymboltypes;
 
typedef enum tpc_immtypes_Enum {
        CPC_IMM_NO = 0,
        CPC_IMM_VARIABLE,
        CPC_IMM_STRING
} tpc_immtypes;
 
typedef enum tpc_asclausetypes_Enum {
        CPC_AS_VAR = 0,
        CPC_AS_TYPE,
        CPC_AS_STRUCT,
        CPC_AS_RECORD,
        CPC_AS_EMPTY = 99
} tpc_asclausetypes;
 
typedef enum tpc_pre_errors_Enum {
        CPC_PRE_OK = 0,
        CPC_BUFFER_OVERFLOW,            /* -706 */
        CPC_CONNECT_NO_SYNTAX_CHECK,    /* -735 */
        CPC_CONST_DECLARE_WRONG,        /* -822 */
        CPC_CONST_TOO_LARGE,            /* -832 */
        CPC_DATATYP_NOT_COMPATIBLE,     /* -817 */
        CPC_DEL_ORACLE_STATEMENT,       /* -762 */
        CPC_DUPLICATE_FIELDDEF,         /* -825 */
        CPC_DUPLICATE_STATEMENTNAME,    /* -826 */
        CPC_DUPLICATE_SUBSTRUCTURE_NAME,/* -724 */
        CPC_DUPLICATE_TYPEDEF,          /* -827 */
        CPC_DUPLICATE_VARDEF,           /* -828 */
        CPC_END_OF_LINENO_INPUT,        /* -741 */
        CPC_EXTRA_BLOCK_CLOSURE,        /* -738 */
        CPC_FILE_CLOSE_ERROR,           /* -829 */
        CPC_FILE_OPEN_ERROR,            /* -830 */
        CPC_FILE_READ_ERROR,            /* -831 */
        CPC_FILE_WRITE_ERROR,           /* -832 */
        CPC_FORLOOP_NOT_ALLOWED,        /* -824 */
        CPC_INCLUDE_AREA_ON_WRONG_POSITION, /* -833 */
        CPC_INCLUDE_FILE_EXIST,         /* -758 */
        CPC_INCLUDE_FILE_PRODUCED,      /* -759 */
        CPC_INCLUDEFILE_ALLREADY_OPEN,  /* -834 */
        CPC_INCLUDEFILE_OPEN_ERROR,     /* -835 */
        CPC_INIT_KEYWORD_WRONG,         /* -899 */
        CPC_INVALID_CPREP_COMMAND,      /* -836 */
        CPC_INVALID_DATATYPE,           /* -837 */
        CPC_INVALID_DECLARATOR,         /* -838 */
        CPC_INVALID_LISTNAME_EXPANSION, /* -731 */
        CPC_INVALID_MACRO_STRING,       /* -839 */
        CPC_INVALID_MACRONUMBER,        /* -840 */
        CPC_INVALID_OPTION,             /* -841 */
        CPC_INVALID_PARAM_INDICATOR,    /* -842 */
        CPC_INVALID_PARAMETERNAME,      /* -843 */
        CPC_INVALID_RECORDNAME,         /* -844 */
        CPC_INVALID_RLISTNAME_RANGE,    /* -732 */
        CPC_INVALID_SECTION_BEGIN_OR_END,/* -886 */
        CPC_INVALID_SQL_COMMAND,        /* -845 */
        CPC_INVALID_STMT_IN_SECTION,    /* -846 */
        CPC_INVALID_TYPE_DEFINITION,    /* -847 */
        CPC_INVALID_UNSIGNEDINTEGER,    /* -848 */
        CPC_INVALID_VAR_DEFINITION,     /* -849 */
        CPC_LONG_COLUMN_EXIST_IN_TABLE, /* -771 */
        CPC_LOOP_ERROR_COUNT,           /* -740 */
        CPC_MACRO_IN_FETCH,             /* -770 */
        CPC_MISSING_ARRAY,              /* -855 */
        CPC_MISSING_CONNECT_USER,       /* -882 */
        CPC_MISSING_DBSNAME,            /* -857 */
        CPC_MISSING_ENDSIGN,            /* -850 */
        CPC_MISSING_INDICATORVARIABLE,  /* -884 */
        CPC_MISSING_MODULNAME,          /* -852 */
        CPC_NESTED_COMMENT_NOT_CLOSED,  /* -730 */
        CPC_NO_MACRO_INIT,              /* -721 */
        CPC_NO_OUTPUT_VARIABLE,         /* -753 */
        CPC_NO_POINTER_ALLOWED,         /* -734 */
        CPC_NO_SQL_STATEMENT_CHECK,     /* -853 */
        CPC_ONLY_QUESTION_MARKS_ALLOWED,/* -854 */
        CPC_P_LOOP_INIT_WRONG,          /* -856 */
        CPC_POINTER_VARIABLE,           /* -733 */
        CPC_PRE_CMD_NOT_AVAILABLE,      /* -101 */
        CPC_PRE_NOT_IMPLEMENTED,        /* -808 */
        CPC_PRE_REFLEX_START_REQUIRED,
        CPC_PRE_REQUEST_AREA_OVERFLOW,  /* -706 */
        CPC_PTR_COMP_NOT_ALLOWED,       /* -769 */
        CPC_SESSION_NOT_ALLOWED,        /* -806 */
        CPC_SOURCE_CODE_TRUNCATED,      /* -729 */
        CPC_STORAGE_CLASS_NOT_ALLOWED,  /* -858 */
        CPC_TOO_LONG_PARAMLIST,         /* -859 */
        CPC_TOO_LONG_READLINE,          /* -889 */
        CPC_TOO_LONG_WHENEVERSTRING,    /* -887 */
        CPC_TOO_MANY_CONST_DECLARED,    /* -860 */
        CPC_TOO_MANY_TYPE_DECLARED,     /* -870 */
        CPC_TOO_MANY_VAR_DECLARED,      /* -871 */
        CPC_TOO_SHORT_MAREND,           /* -890 */
        CPC_TOO_SHORT_PARAMLIST,        /* -872 */
        CPC_TRACE_PARAM_NO_STRUC_ALLOWED,/* -894 */
        CPC_UNKNOWN_CONSTNAME,           /* -873 */
        CPC_UNKNOWN_CURSORNAME,          /* -874 */
        CPC_UNKNOWN_MACRONUMBER,         /* -876 */
        CPC_UNKNOWN_PARAMETERNAME,       /* -877 */
        CPC_UNKNOWN_RECORDNAME,          /* -878 */
        CPC_UNKNOWN_SQL_COMMAND,         /* -879 */
        CPC_UNKNOWN_STATEMENTNAME,       /* -880 */
        CPC_UNKNOWN_TYPENAME,            /* -881 */
        CPC_USAGE_ADD_ERROR,             /*-9809 */
        CPC_USAGE_ON_OFF_ERROR,          /*-9805 */
        CPC_VARIABLE_MAY_OVERFLOW,       /* -892 */
        CPC_VARIABLE_NOT_ALLOWED_AS_ARRAY,/* -763 */
        CPC_VARIABLE_WILL_BE_TRUNCATED,   /* -885 */
        CPC_WHOLE_TABLE_DEL_UPD,          /* -895 */
        CPC_MACROS_NOT_ALLOWED            /* -780 */
} tpc_pre_errors;
 
typedef enum tpc_dclspecstypes_Enum {
        CPC_CCONST = 8
} tpc_dclspecstypes;
 
typedef enum tpc_vftypes_Enum {
        CPC_PCLISTFILE = 1,
        CPC_INPUTFILE,
        CPC_WORK1FILE,
        CPC_WORK2FILE,
        CPC_WORK3FILE,
        CPC_LNOINPUT,
        CPC_LNOOUTPUT,
        CPC_INCLUDEFILE
} tpc_vftypes;
 
typedef tsp00_Int2 tpc_cob_section;
 
typedef struct
{
        tsp00_Sname ename;
        tsp00_Int2 enaml;
} tpc_endsentry;
 
typedef struct
{
        tsp00_Int4 ecnt;
        tpc_endsentry eend [5];
}
 tpc_endstype;
 
typedef struct
{
        tsp00_Int4        vffileno;
        tsp00_VFilename   vffilen;
        tsp05_RteFileMode     vffilemode;
        BOOLEAN         vfbinary;
        BOOLEAN         vffeof;
        tsp00_Int2        vfReclen;
        tsp00_Int2        vfcnt;
        tsp00_VfFormat   vfform;
        tsp00_Int2        vfbufcount;
        tsp00_Int2        vffiller;
        void*           vfblock;
        tsp00_Int4        vfRecLen;       /* Hae ???????? */
}
 tpc_vffileentry;
 
#define MXPC_VFFILES          8
typedef tpc_vffileentry tpc_vfentries [MXPC_VFFILES];
 
typedef struct
{
        tsp00_Int2        vfacc;
        tsp00_Int4        vfpoolprt;
        tpc_vfentries   vffn;
}
 tpc_vffiletype;
 
#define MXPR_PRELINE     512
 
typedef char tpc_prelinetype [MXPR_PRELINE];
typedef struct
{
        tsp00_Int2        llen;
        tsp00_Int2        lbegpos;
        tsp00_Int2        lendpos;
        tsp00_Int2        laccpos;
        tpc_prelinetype lline;
}
 tpc_tprelinerec;
 
typedef struct
{
        tsp00_Int2        ancomtyp;
        tsp00_Int2        ansection;
        BOOLEAN         anbegin;
        BOOLEAN         ansuccstatem;
        tsp00_Int2        ancheck;
        BOOLEAN         anusage [sqlgamax];
}
 tpc_analysetype;
 
typedef struct
{
        tsp00_Int2        whlen;
        tsp00_Int2        whact;
        char            whstr [50];
        tsp00_Int2        whfiller;
}
 tpc_wheneverentry;
 
typedef tpc_wheneverentry tpc_whenevertype [6];
 
#define MXPC_CONST_SEC       100
 
typedef struct
{
        tsp00_Lname       cname;
        tsp00_Int2        cwert;
}
 tpc_const_entry;
 
typedef tpc_const_entry tpc_csectionp [100];
 
typedef struct
{
        tsp00_Int2        ccnt;
        tsp00_Int2        cbot;
        tpc_const_entry   *csec;
}
 tpc_const_sec;
 
typedef struct
{
        tsp00_Int2        lnoinp;
        tsp00_Int2        lnoout;
        tsp00_Int2        lnoind;
        tsp00_Int2        lnolast;
        tsp00_Int2        lnosrc;
        tsp00_Int2        lnoexp;
        tsp00_C12         lnochr;
}
 tpc_lnorecord;
 
typedef struct
{
        tsp00_Lname       vaname;
        tsp00_Int2        vanaml;
        tsp00_Int2        vacnt;
        tsp00_Int2        vastrix;
        tsp00_Int2        vatypix;
        tsp00_Int2        vasqlix;
        tsp00_Int2        vaglobl;
        tsp00_Int2        vablockid;
        tsp00_Int2        vafiller;
}
 tpc_varent;
 
typedef struct
{
        tsp00_Int2        tyRef;
        tsp00_Int2        tyPtr;
        tsp00_Int2        tyFiller;
        tsp00_Int2        tyIndi;
        tsp00_Int2        tyCmCnt;
        tsp00_Int2        tyCmpIx;
        tsp00_Int2        tyVacnt;
        tsp00_Int2        tyFiller2;
}
 tpc_vstruct;
 
typedef struct
{
        tsp00_Int2        tyRef;
        tsp00_Int2        tyPtr;
        tsp00_Int2        tyFiller;
        tsp00_Int2        tyIndi;
        tsp00_Int4        tyDim;
        tsp00_Int2        tyFix;
        tsp00_Int2        tyTypIx;
}
 tpc_varray;
 
typedef struct
{
        tsp00_Int2        tyRef;
        tsp00_Int2        tyPtr;
        tsp00_Int2        tyDigit;
        tsp00_Int2        tyIndi;
        tsp00_Int4        tySize;
        tsp00_Int2        tyFrac;
        tsp00_Int2        tyFiller2;
}
 tpc_vscalar;
 
typedef union
{
        tpc_vscalar      sc;
        tpc_vstruct      st;
        tpc_varray       ar;
}
 tpc_typent;
 
#define MXPC_VARENT      1000
#define MXPC_TYPENT      1000
 
typedef tpc_varent tpc_vartable [MXPC_VARENT];
typedef tpc_typent tpc_typtable [MXPC_TYPENT];
typedef tpc_varent *tpc_vartablep;
typedef tpc_typent *tpc_typtablep;
 
typedef tsp00_Int2 tpc_cmpent;
typedef tpc_cmpent tpc_cmpindex [MXPC_VARENT];
typedef tpc_cmpent *tpc_cmpindexp;
 
typedef struct
{
        tsp00_Int2        varCnt;
        tsp00_Int2        varSav;
        tsp00_Int2        varBot;
        tsp00_Int2        typCnt;
        tsp00_Int2        cmpCnt;
        tsp00_Int2        pcFiller;
        tpc_varent*     vartablep;
        tpc_typent*     typtablep;
        tpc_cmpent*     cmpindexp;
}
 tpc_symtab;
 
#define MXPC_NDARRAY    4
#define MXPC_SQLVA1 10000
#define MXPC_SQLVA2   500
#define MXPC_SQLVA3  1000
#define MXPC_SQLND    100
#define MXPC_NDENT    100
 
typedef struct
{
        tsp00_Int2   ndVarmainIx;
        tsp00_Int2   ndVararrIx;
        tsp00_Int2   ndVarentIx;
        tsp00_Int2   ndTypentIx;
        tsp00_Int2   ndMainTyindi;
        tsp00_Int2   ndCompExpan;
        tsp00_Int2   ndArrayCnt;
        tsp00_Int2   ndArrayIx [MXPC_NDARRAY];
        tsp00_Int4   ndSqlva1St;
        tsp00_Int4   ndSqlva1Ix;
        tsp00_Int4   ndSqlva1Cnt;
        tsp00_Int2   ndBlockId;
        tsp00_Int2   ndKano;
        tsp00_Int2   ndLoopPar;
        tsp00_Int2   ndExpanlen;
        tsp00_Int2   ndCompIx;
        tsp00_Int2   ndNamelen;
        char       *ndNamePtr;
}
 tpc_nd_entry;
typedef tpc_nd_entry tpc_arrndtype [MXPC_NDENT];
typedef tpc_nd_entry *tpc_nd_entryp;
 
typedef struct
{
        tsp00_Int2        va1cnt;
        tsp00_Int2        va2cnt;
        tsp00_Int2        va3cnt;
        tsp00_Int2        ndmax;
        tsp00_Int2        ndcnt;
        tsp00_Int2        ndfiller;
        tpc_nd_entry*   ndtabp;
}
 tpc_pc_sqlva;
 
typedef struct
{
        tsp00_C132        dclattr;
        tsp00_Int2        dclattrl;
        tsp00_Int2        dclfnlen;
}
 tpc_dclclause;
 
typedef struct
{
        tsp00_Int2        tabclause;
        tsp00_Int2        asclause;
        tsp00_Int2        indclause;
        tsp00_KnlIdentifier dcluser;
        tsp00_KnlIdentifier dcltab;
        tsp00_KnlIdentifier dclmodul;
        tsp00_Int2        dcltabl;
        tpc_dclclause   clause [2];
}
 tpc_dclgen;
 
typedef struct
{
        tsp00_Name        progid;
        tsp00_Name        partptst;
        tsp00_Int4        cicscount;
        BOOLEAN         iscics;
        BOOLEAN         pass1;
}
 tpc_pc_cics;
 
typedef struct
{
        tsp00_Int2        uscom;
        tsp00_KnlIdentifier usdobjn1;
        tsp00_Int2        usfiller;
        tsp00_KnlIdentifier usdobjn2;
}
 tpc_pc_usage;
 
typedef char tpc_partbuffer [MXPR_PARTBUF];
typedef char *tpc_partbufptr;
 
typedef struct
{
       tsp00_Int4    part1len;
       tsp00_Int4    part2len;
       tsp00_Int4    partmaxlen;
       tsp00_Int4    partsizlen;
       char   *    partbufp;    /* pointer auf partmaxlen buffer */
}
   tpc_cmd_part;
 
typedef struct
{
        tsp00_Int2        pcError;
        tsp00_Int2        pcErrcnt;
        tsp00_Int2        pcWrncnt;
        tsp00_Int2        pcXuserSet;
        tsp00_Int2        pcEndsymLen;
        tsp00_Sname       pcEndsym;
        tsp00_C2          pcEndcmd;
        tpc_endstype    pcEndSe;
        tsp00_Int4        pcLinePerPage;
        tsp00_Int4        pcCharPerLine;
        tsp00_KnlIdentifier        pcFilen;
        tsp00_Name        pcFilet;
        tsp00_Name        pcFilem;
        tsp4_argline    pcArgs;
        tsp00_Int2        pcExecSql;
        tsp00_Int2        pcStmax;
        tsp00_Int2        pcStstm;
        tsp00_Int4        pcPaLoop;
        tsp00_Int2        pcKaAtind;
        tsp00_Int2        pcKaCuind;
        tsp00_Int2        pcAt;
        tsp00_Int2        pcCu;
        tsp00_Int2        pcAtGacnt;
        tsp00_Int2        pcPa;
        tsp00_Int2        pcSa;
        tsp00_Int2        pcKa;
        tsp00_Int2        pcPr;
        tsp00_Int2        pcSt;
        tsp00_Int2        pcFa;
        tsp00_Int2        pcFn;
        tsp00_Int2        pcDi;
        tsp00_Int2        pcNa;
        tsp00_Int2        pcOp;
        tsp00_Int2        pcDa;
        tsp00_Int2        pcBndDsc;
        tsp00_Int2        pcSelDsc;
        struct tsp4_args_options   pcOpts;
        tpc_vffiletype     pcVf;
        tsp00_Int2        pcCodeInd;
        tsp00_Int2        pcInpInd;
        tpc_tprelinerec      pcInpLine;
        tpc_tprelinerec      pcOutLine;
        BOOLEAN              pcInpEof;
        BOOLEAN              pcSqlCom;
        BOOLEAN              pcComment;
        tpr_scannertype      pcScan;
        tpc_analysetype      pcAn;
        tsp00_Int2             pcCobSect;
        tpc_whenevertype     pcWhe;
        tsp00_Int2        pcWheSet;
        tsp00_Int2        pcWheNo;
        tpc_const_sec   pcCse;
        tsp00_Int2        pcCmcnt;
        tpc_lnorecord   pcLno;
        sqlcatype       sqlca;
        sqlxatype       sqlxa;
        tpc_symtab      pcSymtab;
        tpc_pc_sqlva    pcSqlva;
        tpc_dclgen      pcDclgen;
        tpc_pc_cics     pcCics;
        tpc_pc_usage    pcUsage;
        tpc_cmd_part    pccmdpart;
}
 tpc_globals;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :        534
*-PRETTY-*  lines of code :        534        PRETTYX 3.10 
*-PRETTY-*  lines in file :        607         1997-12-10 
.PA 
