/* @(#)chgen_global_vars.c 2.1 93/05/18 */ /******************************************************************************/ /* function : chgen_global_vars.c */ /* */ /* subsystem : chgen */ /* */ /* input : n/a */ /* */ /* output : n/a */ /* */ /* returns : n/a */ /* */ /* author : Steve Smith / Craig Smith */ /* */ /* created : September, 1991 */ /* */ /* description : This file defines all global variables used by chgen. */ /* */ /******************************************************************************/ /*****************************************************************************/ /* CHGEN V9.0 94sgen - mcook, hsano, jhyun */ /* */ /* */ /* Basic enhancements include the ability to read in both a gendb and a */ /* schema file, by specifying a command line switch. */ /* */ /* Revision history: */ /* */ /* 5/16/94 - mcook - Added global variable "cli_nosource" which keeps */ /* track of whether or not to create pr_*.c and *.h */ /* files. (Command line option "-nosource". */ /* */ /* 5/09/94 - mcook - Added two global variables "cli_datafile" to keep */ /* track of the command line option specifying whether */ /* to output a metaschema.dat file or not; And a global */ /* variable datafile which keeps track of the datafile */ /* name. */ /* */ /* 5/01/94 - mcook - Added a global variable "cli_gendbschema" to keep */ /* track of the command line option specifying whether */ /* a chgen or gendb schema file is being read in. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* Updated 5/7/96 by Genlog to include prlog_fp */ /*****************************************************************************/ #include #include "chgen_define.h" #include "chgen_externs.h" /******************************************************************************/ /* The following are global variables used by chgen. */ /******************************************************************************/ /***** 93s523 ******/ lut_st hcg_table_abbrev_lut; /* holds abbreviation lut */ int hcg_abbr_size; /* holds size of table abbrevs */ struct rr_type *pc_table, /* parent-child table root */ *cp_table, /* child-parent table root */ *tmp; /* temp ptr into either list */ struct tt_type *tt, /* list of tables, root */ *tt_curr, /* ptr to current tt node */ *tt_tmp; /* temp table pointer */ struct ta_type *ta_curr, /* ptr to curr field for curr tbl*/ *ta_tmp; /* temp field pointer */ FILE *schtxt_fp, /* original schema file (r) */ *schh_fp, /* output schema .h file (w) */ *prload_fp, /* output pr_load.c file (w) */ *prdump_fp, /* output pr_dump.c file (w) */ *prfree_fp, /* output pr_free.c file (w) */ *prdel_fp, /* output pr_delete.c file (w) */ *prstats_fp, /* output pr_stats.c file (w) */ *prlog_fp; /* output pr_log.c file (w) */ /* Added by Genlog 5/7/96 */ FILE *XXschh_fp[MAXTABLES], *XXops_fp[MAXTABLES] ; /* added by ntansala 2k0428 */ char buffer[BUFSIZE], /* buff for current parse line */ temp_buffer[BUFSIZE], /* buff for current token */ tab_id[NAMELENGTH], /* table_name */ tab_abbr[ABBREV_NAME_LENGTH], /* table abbreviation */ prnt_abbrev[ABBREV_NAME_LENGTH], /* abbrev of parent tbl */ child_abbrev[ABBREV_NAME_LENGTH], /* abbrev of child tbl */ tab_name[NAMELENGTH], /* table name */ field_name[NAMELENGTH], /* field name */ alt_field_name[NAMELENGTH], /* alternate field name, from schema */ data_type[TYPELENGTH], /* data type field from schema */ comment[MAXCOMMENTLENGTH], /* tbl or field comment from schema */ parent[NAMELENGTH], /* primary key of parent in a relation */ child[NAMELENGTH], /* primary key of child in a relation */ sch_text_file_name[SCHEMA_HEADER_FILE_NAME_LENGTH], /* original schema file name */ sch_header_file_name[SCHEMA_HEADER_FILE_NAME_LENGTH], /* resulting schema .h file name */ sch_viewdef_file_name[SCHEMA_HEADER_FILE_NAME_LENGTH], /* schema .viewdefs input file */ datafile[SCHEMA_HEADER_FILE_NAME_LENGTH], /* output metaschema.dat file */ view_name[NAMELENGTH]; /* view name when reading from .dat file */ struct tindex_type TINDEX[TABLE_NO_LIMIT]; /* see structure definitions above */ struct pindex_type PINDEX[MAXTABLES][MAXTABLES]; struct pathtable_type PATHTABLE[MAXPATH]; int i, /* simple temporary variables */ j, k, l, num_tables, /* number of tables in schema */ TXindex, /* index values used when generating access macros */ PXindex, PTindex, tab_seq_no, /* integer table number (simple order from schema file) */ user_maxviews, /* max number of views supported in resulting code, uses default or users value */ cli_nobp, /* boolean representations of various command line qualifiers */ cli_quiet, cli_ansi, cli_noforward, cli_maxviews, cli_noorder, cli_gendbschema, cli_datafile, cli_nosource, cli_log, cli_datinput, cli_viewname; static char rcsId[] = "$Id";