Result of cvs diff JPsim - RJL 97/12/5 CHief difference: gen v9.1 (cvs) vs. genv10 (omcg); Latter has pr_dump_row that affects every table case; it also was compiled traditional for neptune, not -ansi. Btree index is also new in latter only. Index: JPsim/JP/src/init_comp =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/JP/src/init_comp,v retrieving revision 1.1 diff -r1.1 init_comp 3c3 < RMTTOP=/usr/proj3/case/95s522/95solc/JPsim --- > RMTTOP=/usr/proj3/case/96f522/omcgonag/JPsim Index: JPsim/OP/src/Imakefile.templ =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/OP/src/Imakefile.templ,v retrieving revision 1.1 diff -r1.1 Imakefile.templ 15c15 < GENVER=GENV9 --- > GENVER=GENV10 21c21 < CFLAGS = -g -J -bswitch -D$(GENVER) --- > CFLAGS = -g -D$(GENVER) 30c30 < $(RMTTOPSRC)/Opaction.o --- > $(RMTOPSRC)/Opaction.o Index: JPsim/OP/src/init_comp =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/OP/src/init_comp,v retrieving revision 1.1 diff -r1.1 init_comp 3c3 < RMTTOP=/usr/proj3/case/95s522/95solc/JPsim --- > RMTTOP=/usr/proj3/case/96f522/omcgonag/JPsim 10c10 < nawk -f $RMTTOP/tools/makeawk FILE=$name2 Imakefile > tmpmake --- > awk -f ../../../../rwright/JPsim/tools/makeawk FILE=$name2 Imakefile > tmpmake Index: JPsim/TImer/src/init_comp =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/TImer/src/init_comp,v retrieving revision 1.1 diff -r1.1 init_comp 3c3 < RMTTOP=/usr/proj3/case/95s522/95solc/JPsim --- > RMTTOP=/usr/proj3/case/96f522/omcgonag/JPsim Index: JPsim/TImer/src/timer.c =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/TImer/src/timer.c,v retrieving revision 1.3 diff -r1.3 timer.c 64c64 < pr_gen_pkey("JuicePlantTransfer", TI, TIkey); --- > pr_gen_pkey("JuicePlant", TI, TIkey); 82c82 < pr_add("JuicePlantTransfer", databuffer); --- > pr_add("JuicePlant", databuffer); 93c93 < pr_add("JuicePlantTransfer", TI, TI_elt); --- > pr_add("JuicePlant", TI, TI_elt); Index: JPsim/olc/src/init_comp =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/olc/src/init_comp,v retrieving revision 1.1 diff -r1.1 init_comp 3c3 < RMTTOP=/usr/proj3/case/95s522/95solc/JPsim --- > RMTTOP=/usr/proj3/case/96f522/omcgonag/JPsim Index: JPsim/olc/src/state.c =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/olc/src/state.c,v retrieving revision 1.2 diff -r1.2 state.c 63a64 > #ifdef ORIGINAL_VERSION 64a66,68 > #else > ST_elt->ActFunc = (ActionRoutine *)StatesActionRoutine ; > #endif Index: JPsim/pr_util/Imakefile =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/pr_util/Imakefile,v retrieving revision 1.4 diff -r1.4 Imakefile 83a84,103 > > > > > > > > > > > > > > > > > > > > Index: JPsim/pr_util/pr_delete.c =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/pr_util/pr_delete.c,v retrieving revision 1.3 diff -r1.3 pr_delete.c 4c4 < /* Chgen Version : v9.0.1 */ --- > /* Chgen Version : v10 */ 19c19 < printf("del_row error: empty table");\ --- > printf("del_row error: empty table");\ 22c22 < printf("del_row error: NULL curr row ptr");\ --- > printf("del_row error: NULL curr row ptr");\ 24a25,30 > if( tbl/**/btidx == BTREESEARCH ) \ > { \ > sprintf(tempbtree,"tbl"); \ > tempbtree[HCG_ABBR_SIZE]='\0'; \ > pr_del_bt(tempbtree,tbl/**/curr->tbl/**/id); \ > } \ 529a536,555 > /******************************************************************************/ > /* Description: This routine is used to delete a row in btree. */ > /* Input: the special table name and its pkey value. */ > /* *temp1 is the table name. temp2 is the pkey value. */ > /* Output: none.( it will delete the specific row from btree. ) */ > /******************************************************************************/ > pr_del_bt(temp1,temp2) > char *temp1; > hcg_key temp2; > { > int tbl_encoding, finish=FALSE ; > hcg_key result; > pr_find_bt( temp1, &temp2); > > tbl_encoding = encoding( hcg_table_seq_list[hcg_tbl_idx].ttabbrev ); > switch( tbl_encoding ) > { > } > } > Index: JPsim/pr_util/pr_dump.c =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/pr_util/pr_dump.c,v retrieving revision 1.3 diff -r1.3 pr_dump.c 4c4 < /* Chgen Version : v9.0.1 */ --- > /* Chgen Version : v10 */ 8a9 > void dump_row(); 24c25 < --- > open_file=0; 37c38 < printf("Error: pr_dump() cannot open %s using file mode %s\n", file_name,modestr); --- > printf("Error: pr_dump_row() cannot open %s using file mode %s\n", file_name,modestr); 48,51c49,50 < hcg_update_version(&SMcurr->SMid,SM_idx,new_version); < decode(outkey[0], &SMcurr->SMid); < PrintCheck(fprintf(hcg_dump_fp, " %-8s %-4s %-80s\n" < , outkey[0], SMcurr->Abbrev, SMcurr->Name)); --- > > pr_dump_row(SM,viewname,file_name,new_version,modestr); 57a57,343 > > pr_dump_row(AC,viewname,file_name,new_version,modestr); > } > break; > > case 2 : /* encoding of ST */ > table_loop(viewname,ST) > { > > pr_dump_row(ST,viewname,file_name,new_version,modestr); > } > break; > > case 3 : /* encoding of AI */ > table_loop(viewname,AI) > { > > pr_dump_row(AI,viewname,file_name,new_version,modestr); > } > break; > > case 4 : /* encoding of TR */ > table_loop(viewname,TR) > { > > pr_dump_row(TR,viewname,file_name,new_version,modestr); > } > break; > > case 5 : /* encoding of ET */ > table_loop(viewname,ET) > { > > pr_dump_row(ET,viewname,file_name,new_version,modestr); > } > break; > > case 6 : /* encoding of EN */ > table_loop(viewname,EN) > { > > pr_dump_row(EN,viewname,file_name,new_version,modestr); > } > break; > > case 7 : /* encoding of EI */ > table_loop(viewname,EI) > { > > pr_dump_row(EI,viewname,file_name,new_version,modestr); > } > break; > > case 8 : /* encoding of CX */ > table_loop(viewname,CX) > { > > pr_dump_row(CX,viewname,file_name,new_version,modestr); > } > break; > > case 9 : /* encoding of TK */ > table_loop(viewname,TK) > { > > pr_dump_row(TK,viewname,file_name,new_version,modestr); > } > break; > > case 10 : /* encoding of PI */ > table_loop(viewname,PI) > { > > pr_dump_row(PI,viewname,file_name,new_version,modestr); > } > break; > > case 11 : /* encoding of PM */ > table_loop(viewname,PM) > { > > pr_dump_row(PM,viewname,file_name,new_version,modestr); > } > break; > > case 12 : /* encoding of PT */ > table_loop(viewname,PT) > { > > pr_dump_row(PT,viewname,file_name,new_version,modestr); > } > break; > > case 13 : /* encoding of VV */ > table_loop(viewname,VV) > { > > pr_dump_row(VV,viewname,file_name,new_version,modestr); > } > break; > > case 14 : /* encoding of PV */ > table_loop(viewname,PV) > { > > pr_dump_row(PV,viewname,file_name,new_version,modestr); > } > break; > > case 15 : /* encoding of IV */ > table_loop(viewname,IV) > { > > pr_dump_row(IV,viewname,file_name,new_version,modestr); > } > break; > > case 16 : /* encoding of OV */ > table_loop(viewname,OV) > { > > pr_dump_row(OV,viewname,file_name,new_version,modestr); > } > break; > > case 17 : /* encoding of PA */ > table_loop(viewname,PA) > { > > pr_dump_row(PA,viewname,file_name,new_version,modestr); > } > break; > > case 18 : /* encoding of NP */ > table_loop(viewname,NP) > { > > pr_dump_row(NP,viewname,file_name,new_version,modestr); > } > break; > > case 19 : /* encoding of BA */ > table_loop(viewname,BA) > { > > pr_dump_row(BA,viewname,file_name,new_version,modestr); > } > break; > > case 20 : /* encoding of TP */ > table_loop(viewname,TP) > { > > pr_dump_row(TP,viewname,file_name,new_version,modestr); > } > break; > > case 21 : /* encoding of HT */ > table_loop(viewname,HT) > { > > pr_dump_row(HT,viewname,file_name,new_version,modestr); > } > break; > > case 22 : /* encoding of CO */ > table_loop(viewname,CO) > { > > pr_dump_row(CO,viewname,file_name,new_version,modestr); > } > break; > > case 23 : /* encoding of JS */ > table_loop(viewname,JS) > { > > pr_dump_row(JS,viewname,file_name,new_version,modestr); > } > break; > > case 24 : /* encoding of RC */ > table_loop(viewname,RC) > { > > pr_dump_row(RC,viewname,file_name,new_version,modestr); > } > break; > > case 25 : /* encoding of JR */ > table_loop(viewname,JR) > { > > pr_dump_row(JR,viewname,file_name,new_version,modestr); > } > break; > > case 26 : /* encoding of RT */ > table_loop(viewname,RT) > { > > pr_dump_row(RT,viewname,file_name,new_version,modestr); > } > break; > > case 27 : /* encoding of CT */ > table_loop(viewname,CT) > { > > pr_dump_row(CT,viewname,file_name,new_version,modestr); > } > break; > > case 28 : /* encoding of NT */ > table_loop(viewname,NT) > { > > pr_dump_row(NT,viewname,file_name,new_version,modestr); > } > break; > > case 29 : /* encoding of TI */ > table_loop(viewname,TI) > { > > pr_dump_row(TI,viewname,file_name,new_version,modestr); > } > break; > > case 30 : /* encoding of OP */ > table_loop(viewname,OP) > { > > pr_dump_row(OP,viewname,file_name,new_version,modestr); > } > break; > > case 31 : /* encoding of JT */ > table_loop(viewname,JT) > { > > pr_dump_row(JT,viewname,file_name,new_version,modestr); > } > break; > > } > } > fclose(hcg_dump_fp); > open_file=1; > } > /******************************************************************************/ > /* This routine will write-out (dump) a single row that meet the specified */ > /* view to the specified file_name. The tbl indicates which table's row */ > /* will be dumped. The open_file flag of 1 indicates open a file for dumping */ > /* a single row. Otherwise doesn't open file because pr_dump had opened a */ > /* file. If the mode of the view is write, the caller is allowed to specify a */ > /* new_version flag of 1, which will cause a version number update. Finally, */ > /* the modestr parameter indicates if a new file should be generated ('w'), */ > /* or append to an existing file ('a'). */ > /******************************************************************************/ > void dump_row ( tbl,viewname, file_name,new_version, modestr ) > char tbl[]; > char viewname[]; > char file_name[]; > int new_version; > char modestr[]; > { > char outkey[5][HCG_KEY_SIZE+1]; > int idx; > idx=encoding(tbl); > if (open_file==1) > { > if ((hcg_dump_fp=fopen(file_name,modestr)) == NULL) > { > printf("Error: pr_dump_row() cannot open %s using file mode %s\n", file_name,modestr); > exit(1); > } > } > if (idx==0) > { > hcg_update_version(&SMcurr->SMid,SM_idx,new_version); > decode(outkey[0], &SMcurr->SMid); > PrintCheck(fprintf(hcg_dump_fp, " %-8s %-4s %-80s\n" > , outkey[0], SMcurr->Abbrev, SMcurr->Name)); > } > if (idx==1) > { 65,68c351 < break; < < case 2 : /* encoding of ST */ < table_loop(viewname,ST) --- > if (idx==2) 77,80c360 < break; < < case 3 : /* encoding of AI */ < table_loop(viewname,AI) --- > if (idx==3) 89,92c369 < break; < < case 4 : /* encoding of TR */ < table_loop(viewname,TR) --- > if (idx==4) 103,106c380 < break; < < case 5 : /* encoding of ET */ < table_loop(viewname,ET) --- > if (idx==5) 115,118c389 < break; < < case 6 : /* encoding of EN */ < table_loop(viewname,EN) --- > if (idx==6) 129,132c400 < break; < < case 7 : /* encoding of EI */ < table_loop(viewname,EI) --- > if (idx==7) 145,148c413 < break; < < case 8 : /* encoding of CX */ < table_loop(viewname,CX) --- > if (idx==8) 155,158c420 < break; < < case 9 : /* encoding of TK */ < table_loop(viewname,TK) --- > if (idx==9) 165,168c427 < break; < < case 10 : /* encoding of PI */ < table_loop(viewname,PI) --- > if (idx==10) 179,182c438 < break; < < case 11 : /* encoding of PM */ < table_loop(viewname,PM) --- > if (idx==11) 193,196c449 < break; < < case 12 : /* encoding of PT */ < table_loop(viewname,PT) --- > if (idx==12) 205,208c458 < break; < < case 13 : /* encoding of VV */ < table_loop(viewname,VV) --- > if (idx==13) 219,222c469 < break; < < case 14 : /* encoding of PV */ < table_loop(viewname,PV) --- > if (idx==14) 231,234c478 < break; < < case 15 : /* encoding of IV */ < table_loop(viewname,IV) --- > if (idx==15) 245,248c489 < break; < < case 16 : /* encoding of OV */ < table_loop(viewname,OV) --- > if (idx==16) 259,262c500 < break; < < case 17 : /* encoding of PA */ < table_loop(viewname,PA) --- > if (idx==17) 275,278c513 < break; < < case 18 : /* encoding of NP */ < table_loop(viewname,NP) --- > if (idx==18) 289,292c524 < break; < < case 19 : /* encoding of BA */ < table_loop(viewname,BA) --- > if (idx==19) 303,306c535 < break; < < case 20 : /* encoding of TP */ < table_loop(viewname,TP) --- > if (idx==20) 317,320c546 < break; < < case 21 : /* encoding of HT */ < table_loop(viewname,HT) --- > if (idx==21) 327,330c553 < break; < < case 22 : /* encoding of CO */ < table_loop(viewname,CO) --- > if (idx==22) 343,346c566 < break; < < case 23 : /* encoding of JS */ < table_loop(viewname,JS) --- > if (idx==23) 353,356c573 < break; < < case 24 : /* encoding of RC */ < table_loop(viewname,RC) --- > if (idx==24) 363,366c580 < break; < < case 25 : /* encoding of JR */ < table_loop(viewname,JR) --- > if (idx==25) 377,380c591 < break; < < case 26 : /* encoding of RT */ < table_loop(viewname,RT) --- > if (idx==26) 391,394c602 < break; < < case 27 : /* encoding of CT */ < table_loop(viewname,CT) --- > if (idx==27) 405,408c613 < break; < < case 28 : /* encoding of NT */ < table_loop(viewname,NT) --- > if (idx==28) 417,420c622 < break; < < case 29 : /* encoding of TI */ < table_loop(viewname,TI) --- > if (idx==29) 435,438c637 < break; < < case 30 : /* encoding of OP */ < table_loop(viewname,OP) --- > if (idx==30) 445,448c644 < break; < < case 31 : /* encoding of JT */ < table_loop(viewname,JT) --- > if (idx==31) 461,464c657 < break; < < } < } --- > if (open_file==1) Index: JPsim/pr_util/pr_free.c =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/pr_util/pr_free.c,v retrieving revision 1.3 diff -r1.3 pr_free.c 4c4 < /* Chgen Version : v9.0.1 */ --- > /* Chgen Version : v10 */ Index: JPsim/pr_util/pr_load.c =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/pr_util/pr_load.c,v retrieving revision 1.3 diff -r1.3 pr_load.c 4c4 < /* Chgen Version : v9.0.1 */ --- > /* Chgen Version : v10 */ 14c14,47 < /******************************************************************************/ --- > int SMbtidx; > int ACbtidx; > int STbtidx; > int AIbtidx; > int TRbtidx; > int ETbtidx; > int ENbtidx; > int EIbtidx; > int CXbtidx; > int TKbtidx; > int PIbtidx; > int PMbtidx; > int PTbtidx; > int VVbtidx; > int PVbtidx; > int IVbtidx; > int OVbtidx; > int PAbtidx; > int NPbtidx; > int BAbtidx; > int TPbtidx; > int HTbtidx; > int CObtidx; > int JSbtidx; > int RCbtidx; > int JRbtidx; > int RTbtidx; > int CTbtidx; > int NTbtidx; > int TIbtidx; > int OPbtidx; > int JTbtidx; > int open_file; > /************************************************************/ 19c52 < /******************************************************************************/ --- > /************************************************************/ 1586,1590c1619,1624 < if (hcg_initialized) < { < printf("Error: pr_init() called when database is already initialized.\n"); < exit(1); < } --- > open_file=1; > if (hcg_initialized) > { > printf("Error: pr_init() called when database is already initialized.\n"); > exit(1); > } 1593,1595c1627,1629 < clear_mem(hcg_ts_list,sizeof(hcg_ts_list)); < for (hcg_tbl_idx = 0; hcg_tbl_idx < HCG_NUM_TABLES; hcg_tbl_idx++) < hcg_table_seq_list[hcg_tbl_idx].rcount = hcg_table_seq_list[hcg_tbl_idx].maxver = 0; --- > clear_mem(hcg_ts_list,sizeof(hcg_ts_list)); > for (hcg_tbl_idx = 0; hcg_tbl_idx < HCG_NUM_TABLES; hcg_tbl_idx++) > hcg_table_seq_list[hcg_tbl_idx].rcount = hcg_table_seq_list[hcg_tbl_idx].maxver = 0; 1600,1608c1634,1642 < i = 0; < hcg_parse(filelist,scan_filename,&i); < while (scan_filename[0] != '\0') < { < if ((hcg_ascii_fp=fopen(scan_filename,"r")) == NULL) < { < printf("can not open %s to find TS data\n", scan_filename); < exit(2); < } --- > i = 0; > hcg_parse(filelist,scan_filename,&i); > while (scan_filename[0] != '\0') > { > if ((hcg_ascii_fp=fopen(scan_filename,"r")) == NULL) > { > printf("can not open %s to find TS data\n", scan_filename); > exit(2); > } 1618c1652 < printf("Warning: unknown table (%s) found in scanned datafile %s, ignored.\n",error_table,scan_filename); --- > printf("Warning: unknown table (%s) found in scanned datafile %s, ignored.\n",error_table,scan_filename); 1657,1658c1691,1692 < hcg_parse(filelist,scan_filename,&i); < } /* while scan_filename */ --- > hcg_parse(filelist,scan_filename,&i); > } /* while scan_filename */ 1661,1666c1695,1700 < hcg_view_list.num_views = 0; < if ((hcg_ascii_fp=fopen(viewdef_filename,"r")) == NULL) < { < printf("can not open %s to find view definitions\n", viewdef_filename); < exit(2); < } --- > hcg_view_list.num_views = 0; > if ((hcg_ascii_fp=fopen(viewdef_filename,"r")) == NULL) > { > printf("can not open %s to find view definitions\n", viewdef_filename); > exit(2); > } 1687c1721 < printf("Error: mode %s specified for view %s is invalid.\n",temp_mode,viewname); --- > printf("Error: mode %s specified for view %s is invalid.\n",temp_mode,viewname); 1707c1741 < printf("Warning: view %s specified in view_element statement is not defined, ignored.\n",viewname); --- > printf("Warning: view %s specified in view_element statement is not defined, ignored.\n",viewname); 1714c1748 < printf("Warning: unknown table (%s) specified for view %s in view_element statement, ignored.\n",table_abbrev,viewname); --- > printf("Warning: unknown table (%s) specified for view %s in view_element statement, ignored.\n",table_abbrev,viewname); 1722c1756 < printf("Warning: version-offset %d specified for view %s in view_element statement is out of range, ignored.\n",hcg_version,viewname); --- > printf("Warning: version-offset %d specified for view %s in view_element statement is out of range, ignored.\n",hcg_version,viewname); 1730c1764 < printf("Error: view %s invoked on table %s as write, MAXVERSION of %d is used\n",viewname, table_abbrev, MAXVERSIONS); --- > printf("Error: view %s invoked on table %s as write, MAXVERSION of %d is used\n",viewname, table_abbrev, MAXVERSIONS); 1736c1770 < printf("Warning: absolute version-number %d specified for view %s in view_element statement is higher than current max-version (%d), ignored.\n",hcg_version,viewname,hcg_table_seq_list[hcg_tbl_idx].maxver); --- > printf("Warning: absolute version-number %d specified for view %s in view_element statement is higher than current max-version (%d), ignored.\n",hcg_version,viewname,hcg_table_seq_list[hcg_tbl_idx].maxver); 1743c1777 < printf("Warning: version-offset %d specified for view %s in view_element statement would lead ",hcg_version,viewname); --- > printf("Warning: version-offset %d specified for view %s in view_element statement would lead ",hcg_version,viewname); 1762,1763c1796,1797 < close(hcg_ascii_fp); < hcg_initialized = 1; --- > close(hcg_ascii_fp); > btree_initialized(); 1764a1799 > hcg_initialized = 1; 1767a1803,1847 > /* Description: This routine is used to reset btree. .*/ > /* Input: none. */ > /* Output: none.( it will reset table 's btree. */ > /******************************************************************************/ > btree_initialized() > { > if (hcg_initialized) > { > } > > SMbtidx=SEQUENCESEARCH; > ACbtidx=SEQUENCESEARCH; > STbtidx=SEQUENCESEARCH; > AIbtidx=SEQUENCESEARCH; > TRbtidx=SEQUENCESEARCH; > ETbtidx=SEQUENCESEARCH; > ENbtidx=SEQUENCESEARCH; > EIbtidx=SEQUENCESEARCH; > CXbtidx=SEQUENCESEARCH; > TKbtidx=SEQUENCESEARCH; > PIbtidx=SEQUENCESEARCH; > PMbtidx=SEQUENCESEARCH; > PTbtidx=SEQUENCESEARCH; > VVbtidx=SEQUENCESEARCH; > PVbtidx=SEQUENCESEARCH; > IVbtidx=SEQUENCESEARCH; > OVbtidx=SEQUENCESEARCH; > PAbtidx=SEQUENCESEARCH; > NPbtidx=SEQUENCESEARCH; > BAbtidx=SEQUENCESEARCH; > TPbtidx=SEQUENCESEARCH; > HTbtidx=SEQUENCESEARCH; > CObtidx=SEQUENCESEARCH; > JSbtidx=SEQUENCESEARCH; > RCbtidx=SEQUENCESEARCH; > JRbtidx=SEQUENCESEARCH; > RTbtidx=SEQUENCESEARCH; > CTbtidx=SEQUENCESEARCH; > NTbtidx=SEQUENCESEARCH; > TIbtidx=SEQUENCESEARCH; > OPbtidx=SEQUENCESEARCH; > JTbtidx=SEQUENCESEARCH; > } > > /******************************************************************************/ 1786,1787c1866,1867 < tbl = tbl/**/elt; \ < tbl/**/end = tbl/**/elt; \ --- > tbl = tbl/**/elt; \ > tbl/**/end = tbl/**/elt; \ 1792,1794c1872,1874 < tbl/**/end->next_ptr = tbl/**/elt; \ < tbl/**/elt->prev_ptr = tbl/**/end; \ < tbl/**/end = tbl/**/elt; \ --- > tbl/**/end->next_ptr = tbl/**/elt; \ > tbl/**/elt->prev_ptr = tbl/**/end; \ > tbl/**/end = tbl/**/elt; \ 1798,1824c1878,1904 < tbl/**/temp = tbl; \ < tbl/**/curr = tbl; \ < while ((tbl/**/curr != NULL) && (key_compare(&tbl/**/curr->pkey,&tbl/**/elt->pkey) < 0)) \ < { \ < tbl/**/temp = tbl/**/curr; \ < tbl/**/curr = tbl/**/curr->next_ptr; \ < } \ < if ((tbl/**/curr != NULL) && (key_compare(&tbl/**/curr->pkey,&tbl/**/elt->pkey) == 0)) \ < { \ < dup_row_warning(tbl/**/elt->pkey); \ < free(tbl/**/elt); \ < break; \ < } \ < if (tbl/**/curr == tbl) \ < { \ < tbl/**/elt->next_ptr = tbl; \ < tbl->prev_ptr = tbl/**/elt; \ < tbl = tbl/**/elt; \ < } \ < else \ < { \ < tbl/**/elt->next_ptr = tbl/**/curr; \ < tbl/**/elt->prev_ptr = tbl/**/temp; \ < tbl/**/temp->next_ptr = tbl/**/elt; \ < if (tbl/**/curr != NULL) \ < tbl/**/curr->prev_ptr = tbl/**/elt; \ < } \ --- > tbl/**/temp = tbl; \ > tbl/**/curr = tbl; \ > while ((tbl/**/curr != NULL) && (key_compare(&tbl/**/curr->pkey,&tbl/**/elt->pkey) < 0)) \ > { \ > tbl/**/temp = tbl/**/curr; \ > tbl/**/curr = tbl/**/curr->next_ptr; \ > } \ > if ((tbl/**/curr != NULL) && (key_compare(&tbl/**/curr->pkey,&tbl/**/elt->pkey) == 0)) \ > { \ > dup_row_warning(tbl/**/elt->pkey); \ > free(tbl/**/elt); \ > break; \ > } \ > if (tbl/**/curr == tbl) \ > { \ > tbl/**/elt->next_ptr = tbl; \ > tbl->prev_ptr = tbl/**/elt; \ > tbl = tbl/**/elt; \ > } \ > else \ > { \ > tbl/**/elt->next_ptr = tbl/**/curr; \ > tbl/**/elt->prev_ptr = tbl/**/temp; \ > tbl/**/temp->next_ptr = tbl/**/elt; \ > if (tbl/**/curr != NULL) \ > tbl/**/curr->prev_ptr = tbl/**/elt; \ > } \ 1838,1844c1918,1924 < if (key_compare(&ca/**/curr2->cf,&pa/**/curr->pk) == 0) \ < { \ < ca/**/curr2->p/**/_pp = pa/**/curr; \ < pa/**/curr->c/**/_fcp = ca/**/curr2; \ < break; \ < } \ < ca/**/curr2 = ca/**/curr2->next_ptr; \ --- > if (key_compare(&ca/**/curr2->cf,&pa/**/curr->pk) == 0) \ > { \ > ca/**/curr2->p/**/_pp = pa/**/curr; \ > pa/**/curr->c/**/_fcp = ca/**/curr2; \ > break; \ > } \ > ca/**/curr2 = ca/**/curr2->next_ptr; \ 1857,1874c1937,1954 < if (key_compare(&ca/**/curr2->cf,&pa/**/curr->pk) == 0) \ < { \ < ca/**/curr2->p/**/_pp = pa/**/curr; \ < ca/**/temp2 = pa/**/curr->c/**/_bcp; \ < pa/**/curr->c/**/_bcp = ca/**/curr2; \ < (struct pa *) ca/**/curr2->p/**/_fpp = pa/**/curr; \ < if (pa/**/curr->c/**/_fcp == NULL) \ < { \ < pa/**/curr->c/**/_fcp = ca/**/curr2; \ < (struct pa *) ca/**/curr2->p/**/_bpp = pa/**/curr; \ < } \ < else \ < { \ < (struct ca *) ca/**/curr2->p/**/_bpp = ca/**/temp2; \ < (struct ca *) ca/**/temp2->p/**/_fpp = ca/**/curr2; \ < } \ < } \ < ca/**/curr2 = ca/**/curr2->next_ptr; \ --- > if (key_compare(&ca/**/curr2->cf,&pa/**/curr->pk) == 0) \ > { \ > ca/**/curr2->p/**/_pp = pa/**/curr; \ > ca/**/temp2 = pa/**/curr->c/**/_bcp; \ > pa/**/curr->c/**/_bcp = ca/**/curr2; \ > (struct pa *) ca/**/curr2->p/**/_fpp = pa/**/curr; \ > if (pa/**/curr->c/**/_fcp == NULL) \ > { \ > pa/**/curr->c/**/_fcp = ca/**/curr2; \ > (struct pa *) ca/**/curr2->p/**/_bpp = pa/**/curr; \ > } \ > else \ > { \ > (struct ca *) ca/**/curr2->p/**/_bpp = ca/**/temp2; \ > (struct ca *) ca/**/temp2->p/**/_fpp = ca/**/curr2; \ > } \ > } \ > ca/**/curr2 = ca/**/curr2->next_ptr; \ 1889,1898c1969,1978 < if (key_compare(&ca/**/curr2->cf,&pa/**/curr->pk) == 0) \ < { \ < ca/**/curr2->p/**/_pp = pa/**/curr; \ < (struct pa *) ca/**/curr2->p/**/_fpp = pa/**/curr; \ < if (pa/**/curr->c/**/_fcp == NULL) \ < { \ < pa/**/curr->c/**/_fcp = ca/**/curr2; \ < } \ < else \ < { \ --- > if (key_compare(&ca/**/curr2->cf,&pa/**/curr->pk) == 0) \ > { \ > ca/**/curr2->p/**/_pp = pa/**/curr; \ > (struct pa *) ca/**/curr2->p/**/_fpp = pa/**/curr; \ > if (pa/**/curr->c/**/_fcp == NULL) \ > { \ > pa/**/curr->c/**/_fcp = ca/**/curr2; \ > } \ > else \ > { \ 1900,1904c1980,1984 < (struct ca *) ca/**/temp2->p/**/_fpp = ca/**/curr2; \ < } \ < ca/**/temp2 = ca/**/curr2; \ < } \ < ca/**/curr2 = ca/**/curr2->next_ptr; \ --- > (struct ca *) ca/**/temp2->p/**/_fpp = ca/**/curr2; \ > } \ > ca/**/temp2 = ca/**/curr2; \ > } \ > ca/**/curr2 = ca/**/curr2->next_ptr; \ 1913,1918c1993,1998 < for (pa/**/curr2 = pa; (pa/**/curr2 != NULL) && (key_compare(&pa/**/curr2->pk,&ca/**/curr->cf) < 0); pa/**/curr2 = pa/**/curr2->next_ptr); \ < if ((pa/**/curr2 != NULL) && (key_compare(&ca/**/curr->cf,&pa/**/curr2->pk) == 0)) \ < { \ < ca/**/curr->p/**/_pp = pa/**/curr2; \ < pa/**/curr2->c/**/_fcp = ca/**/curr; \ < } --- > for (pa/**/curr2 = pa; (pa/**/curr2 != NULL) && (key_compare(&pa/**/curr2->pk,&ca/**/curr->cf) < 0); pa/**/curr2 = pa/**/curr2->next_ptr); \ > if ((pa/**/curr2 != NULL) && (key_compare(&ca/**/curr->cf,&pa/**/curr2->pk) == 0)) \ > { \ > ca/**/curr->p/**/_pp = pa/**/curr2; \ > pa/**/curr2->c/**/_fcp = ca/**/curr; \ > } 1934,1951c2014,2031 < for (pa/**/curr2 = pa; (pa/**/curr2 != NULL) && (key_compare(&pa/**/curr2->pk,&ca/**/curr->cf) < 0); pa/**/curr2 = pa/**/curr2->next_ptr); \ < if ((pa/**/curr2 != NULL) && (key_compare(&ca/**/curr->cf,&pa/**/curr2->pk) == 0)) \ < { \ < ca/**/curr->p/**/_pp = pa/**/curr2; \ < ca/**/temp = pa/**/curr2->c/**/_bcp; \ < pa/**/curr2->c/**/_bcp = ca/**/curr; \ < (struct pa *) ca/**/curr->p/**/_fpp = pa/**/curr2; \ < if (pa/**/curr2->c/**/_fcp == NULL) \ < { \ < pa/**/curr2->c/**/_fcp = ca/**/curr; \ < (struct pa *) ca/**/curr->p/**/_bpp = pa/**/curr2; \ < } \ < else \ < { \ < (struct ca *) ca/**/curr->p/**/_bpp = ca/**/temp; \ < (struct ca *) ca/**/temp->p/**/_fpp = ca/**/curr; \ < } \ < } --- > for (pa/**/curr2 = pa; (pa/**/curr2 != NULL) && (key_compare(&pa/**/curr2->pk,&ca/**/curr->cf) < 0); pa/**/curr2 = pa/**/curr2->next_ptr); \ > if ((pa/**/curr2 != NULL) && (key_compare(&ca/**/curr->cf,&pa/**/curr2->pk) == 0)) \ > { \ > ca/**/curr->p/**/_pp = pa/**/curr2; \ > ca/**/temp = pa/**/curr2->c/**/_bcp; \ > pa/**/curr2->c/**/_bcp = ca/**/curr; \ > (struct pa *) ca/**/curr->p/**/_fpp = pa/**/curr2; \ > if (pa/**/curr2->c/**/_fcp == NULL) \ > { \ > pa/**/curr2->c/**/_fcp = ca/**/curr; \ > (struct pa *) ca/**/curr->p/**/_bpp = pa/**/curr2; \ > } \ > else \ > { \ > (struct ca *) ca/**/curr->p/**/_bpp = ca/**/temp; \ > (struct ca *) ca/**/temp->p/**/_fpp = ca/**/curr; \ > } \ > } 1972,1980c2052,2060 < ca/**/curr->p/**/_pp = pa/**/curr2; \ < (struct pa *) ca/**/curr->p/**/_fpp = pa/**/curr2; \ < if (pa/**/curr2->c/**/_fcp == NULL) \ < pa/**/curr2->c/**/_fcp = ca/**/curr; \ < else \ < { \ < for (ca/**/temp2 = pa/**/curr2->c/**/_fcp; (struct pa *) ca/**/temp2->p/**/_fpp != pa/**/curr2; ca/**/temp2 = (struct ca *)ca/**/temp2->p/**/_fpp); \ < (struct ca *) ca/**/temp2->p/**/_fpp = ca/**/curr; \ < } \ --- > ca/**/curr->p/**/_pp = pa/**/curr2; \ > (struct pa *) ca/**/curr->p/**/_fpp = pa/**/curr2; \ > if (pa/**/curr2->c/**/_fcp == NULL) \ > pa/**/curr2->c/**/_fcp = ca/**/curr; \ > else \ > { \ > for (ca/**/temp2 = pa/**/curr2->c/**/_fcp; (struct pa *) ca/**/temp2->p/**/_fpp != pa/**/curr2; ca/**/temp2 = (struct ca *)ca/**/temp2->p/**/_fpp); \ > (struct ca *) ca/**/temp2->p/**/_fpp = ca/**/curr; \ > } \ 1984c2064 < /* This routine is used to link a single row to a virtual database table. */ --- > /* This routine is used to link a single row to a virtual database table. */ 1991c2071 < switch( tbl_encoding ) --- > switch( tbl_encoding ) 2224c2304 < /* This routine is used to create a table element and initialize it. */ --- > /* This routine is used to create a table element and initialize it. */ 2227c2307 < hcg_ptr pr_gen_create ( size ) --- > hcg_ptr pr_gen_create ( size ) 2231,2232c2311,2312 < bzero(ptr, size); /* or memset(ptr, 0, size); */ < /* This should also set all the keys to null_key() but doesn't right now -- MM */ --- > bzero(ptr, size); /* or memset(ptr, 0, size); */ > /* This should also set all the keys to null_key() but doesn't right now -- MM */ 2236,2237c2316,2317 < /* This macro is used to generate the next available primary key value for the*/ < /* specified table, using the specified view. */ --- > /* This macro is used to generate the next available primary key value for the*/ > /* specified table, using the specified view. */ 2240c2320 < #define pr_gen_key(key,tbl_abbrv,version_id,entry_id) \ --- > #define pr_gen_key(key,tbl_abbrv,version_id,entry_id) \ 2243c2323 < set_version(&(key), (version_id));\ --- > set_version(&(key), (version_id));\ 2246,2247c2326,2327 < #define pr_gen_pkey(viewname,tbl,pkey) \ < if (find_view_idx(viewname)) \ --- > #define pr_gen_pkey(viewname,tbl,pkey) \ > if (find_view_idx(viewname)) \ 2249,2250c2329,2330 < (char) hcg_view_list.view_list[hcg_view_idx].version_list[tbl/**/_idx], \ < hcg_ts_list[tbl/**/_idx].ts_list[hcg_view_list.view_list[hcg_view_idx].version_list[tbl/**/_idx]].maxrow+1) --- > (char) hcg_view_list.view_list[hcg_view_idx].version_list[tbl/**/_idx], \ > hcg_ts_list[tbl/**/_idx].ts_list[hcg_view_list.view_list[hcg_view_idx].version_list[tbl/**/_idx]].maxrow+1) 2253,2254c2333,2334 < #define pr_check_fkey(ctbl_abbr,ctbl_ptr,ckey,ptbl_abbr,pkey,ptbl_ptr) \ < if ( is_null_key(&((ctbl_ptr)->ckey)) || (ctbl_ptr)->ckey == 0 ) {\ --- > #define pr_check_fkey(ctbl_abbr,ctbl_ptr,ckey,ptbl_abbr,pkey,ptbl_ptr) \ > if ( is_null_key(&((ctbl_ptr)->ckey)) || (ctbl_ptr)->ckey == 0 ) {\ 2256,2258c2336,2338 < printf("Warning: foreign key %s is not set for table %s element 0x%8.8x\n", \ < "ckey", "ctbl_abbr", ctbl_ptr );\ < pr_gen_key( (ctbl_ptr)->ckey,"ptbl_abbr", 0, 0);\ --- > printf("Warning: foreign key %s is not set for table %s element 0x%8.8x\n", \ > "ckey", "ctbl_abbr", ctbl_ptr );\ > pr_gen_key( (ctbl_ptr)->ckey,"ptbl_abbr", 0, 0);\ 2260,2261c2340,2341 < else if ( (ptbl_ptr) && ( !is_null_key(&((ptbl_ptr)->pkey)) ) && ( (ptbl_ptr)->pkey != 0) ) {\ < (ctbl_ptr)->ckey = (ptbl_ptr)->pkey;\ --- > else if ( (ptbl_ptr) && ( !is_null_key(&((ptbl_ptr)->pkey)) ) && ( (ptbl_ptr)->pkey != 0) ) {\ > (ctbl_ptr)->ckey = (ptbl_ptr)->pkey;\ 2264c2344 < pr_gen_key( (ctbl_ptr)->ckey, "ptbl_abbr", 0, 0);\ --- > pr_gen_key( (ctbl_ptr)->ckey, "ptbl_abbr", 0, 0);\ 2269c2349 < /* This macro is used set the default value of non-key fields of type cX or tX*/ --- > /* This macro is used set the default value of non-key fields of type cX or tX*/ 2272,2273c2352,2353 < #define pr_check_str(tbl_abbr,tbl_ptr,fld,length) \ < if ( (tbl_ptr)->fld[0] == '\0' ) \ --- > #define pr_check_str(tbl_abbr,tbl_ptr,fld,length) \ > if ( (tbl_ptr)->fld[0] == '\0' ) \ 2276c2356 < printf("Warning: string field %s is not set for table %s element 0x%8.8x\n", \ --- > printf("Warning: string field %s is not set for table %s element 0x%8.8x\n", \ 2278c2358 < for((tbl_ptr)->fld[i] = '\0'; i>=0; (tbl_ptr)->fld[i--] = '?');\ --- > for((tbl_ptr)->fld[i] = '\0'; i>=0; (tbl_ptr)->fld[i--] = '?');\ 2282c2362 < /* This routine is used to add a single row to a virtual database table. */ --- > /* This routine is used to add a single row to a virtual database table. */ 2284,2285c2364,2365 < /* number is the right one for this table in this view. if all this passes, */ < /* the row is added to the database, and linked in to its parents, etc... */ --- > /* number is the right one for this table in this view. if all this passes, */ > /* the row is added to the database, and linked in to its parents, etc... */ 2287c2367 < void gen_pr_add (viewname, tbl_abbrv, tbl_ptr) --- > void gen_pr_add (viewname, tbl_abbrv, tbl_ptr) 2290c2370 < hcg_ptr tbl_ptr; --- > hcg_ptr tbl_ptr; 2296c2376 < /* skip leading spaces (if any) from tbl_abbrv */ --- > /* skip leading spaces (if any) from tbl_abbrv */ 2298c2378 < while( *tbl_abbrv == ' ') ++tbl_abbrv; --- > while( *tbl_abbrv == ' ') ++tbl_abbrv; 2318c2398 < hcg_version = hcg_view_list.view_list[hcg_view_idx].version_list[hcg_tbl_idx]; --- > hcg_version = hcg_view_list.view_list[hcg_view_idx].version_list[hcg_tbl_idx]; 2322,2323c2402,2403 < tbl_encoding = encoding( hcg_table_seq_list[hcg_tbl_idx].ttabbrev ); < switch( tbl_encoding ) --- > tbl_encoding = encoding( hcg_table_seq_list[hcg_tbl_idx].ttabbrev ); > switch( tbl_encoding ) 2673a2754,2757 > > /*OWEN*/ > typedef void (ActionRoutine)(hcg_key); > 2714c2798,2803 < pr_set_int(STelt,ActFunc,atoi(hcg_t)); --- > /*OWEN:CHANGED*/ > #ifdef ORIGINAL_VERSION > pr_set_int(STelt,ActFunc,atoi(hcg_t)); > #else > STelt->ActFunc = (ActionRoutine *)atoi(hcg_t) ; > #endif 3105,3109c3194,3198 < if (!hcg_initialized) < { < printf("Error: pr_load() called when database is not yet initialized.\n"); < exit(1); < } --- > if (!hcg_initialized) > { > printf("Error: pr_load() called when database is not yet initialized.\n"); > exit(1); > } 3113c3202 < printf("Error: view %s passed to pr_load is not defined.\n",viewname); --- > printf("Error: view %s passed to pr_load is not defined.\n",viewname); 3116,3122c3205,3236 < if ((hcg_ascii_fp=fopen(file_name,"r")) == NULL) < { < printf("can not open %s\n", file_name); < exit(2); < } < load_data (viewname); < close(hcg_ascii_fp); --- > if ((hcg_ascii_fp=fopen(file_name,"r")) == NULL) > { > printf("can not open %s\n", file_name); > exit(2); > } > load_data (viewname); > close(hcg_ascii_fp); > } > > /******************************************************************************/ > /* Description: This routine is used to find the pkey location by using btree.*/ > /* Input: the special table name and its pkey value. */ > /* *temp1 is the table name. *temp2 is the pkey value. */ > /* Output: none.( it will move table position to the specific row. */ > /******************************************************************************/ > void pr_find_bt(temp1,temp2) > char *temp1; > hcg_key *temp2; > { > int tbl_encoding, finish=FALSE ; > hcg_key result; > > if (!find_tbl_idx(temp1)) > { > printf("Error: unknown table (%s) passed to pr_find.\n",temp1); > exit(3); > } > > tbl_encoding = encoding( hcg_table_seq_list[hcg_tbl_idx].ttabbrev ); > switch( tbl_encoding ) > { > } Index: JPsim/pr_util/pr_stats.c =================================================================== RCS file: /usr/proj3/case/95s522/95solc/base/Master/JPsim/pr_util/pr_stats.c,v retrieving revision 1.3 diff -r1.3 pr_stats.c 4c4 < /* Chgen Version : v9.0.1 */ --- > /* Chgen Version : v10 */