91.523 Software Engineering I

 

CHGEN v11 Final Report

 

Prof. R. J. Lechner

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Joseph S. Karner

Keith B. Spinney

 

Dept. of Computer Science

UMASS Lowell

 

May 12, 1999


Table of Contents

 

 

1.    Project Goals and Summary__________________________________________________ 3

2.    GenMerge________________________________________________________________ 5

2.1.    CVS Retrieval Information________________________________________________ 5

2.2.    CVS Review Info________________________________________________________ 8

2.3.    CHGEN CVS Repository Guide___________________________________________ 61

2.4.    Test Cases____________________________________________________________ 63

2.4.1.         Schooldb8___________________________________________________________________ 63

2.4.2.         Schooldb12__________________________________________________________________ 64

2.4.3.         Enroll_______________________________________________________________________ 64

3.    CHGENv11______________________________________________________________ 69

3.1.    The Starting Point - chgenv10 Architecture__________________________________ 69

3.2.    chgenv11 Bootstrapped Data Flow_________________________________________ 69

3.3.    SV <schema>.msdat Issues______________________________________________ 70

3.4.    Code Modifications_____________________________________________________ 71

3.5.    Build Sequence________________________________________________________ 73

4.    Validation_______________________________________________________________ 83

5.    User's Manual___________________________________________________________ 119

5.1.    New Command Line Input Options_______________________________________ 119

5.2.    Limitations on -datinput Feature_________________________________________ 119

5.3.    Sample Input Files_____________________________________________________ 119

6.    Futures section__________________________________________________________ 120

6.1.    Re-Partitioning, or Data Over Method  (Keith)______________________________ 120

6.2.    Data over Method Migration - Row Class Followed by Table Class (Joe)_________ 123

7.    References______________________________________________________________ 125

 


 

1.    Project Goals and Summary

There are three goals for this project:

         Test, merge, and then check into cvs the source code and test cases for chgen versions 10 and the chgen log and replay project.  This brings the CVS repository up-to-date with the merging of chgen versions 10 and the chgen log and replay project. Three working test applications are available which are used as test cases (schooldb8, schooldb12, and enroll). This merge is  necessary to consolidate evolution of the Chgen  application.

         Develop and test version 11 of chgen.  This version has the capability to read metaschema data from a <schema>.dat file, in addition to the existing capability to read from a <schema>.sch file.  These enhancements are ANSI compliant, and the code compiles and runs on the DEC Alpha workstations.

         Re-partition chgen so that  its modularity is based on data instead of method.  This effort is also known as "putting data over method" instead of "putting method over data" as is presently done. 

 

The first two goals were met, and are documented in Sections 2 through 5.  As a result of these efforts, chgenv11 is functional, has been validated with six test cases, and is checked into cvs with a pedigree spanning back to the genlog work of 96s523 (see reference 3).  It can be checked out of  cvs and run in the following manner:

         From a directory in your file area enter the command :  cvs co –r genv11 chgen

         This will check the source files into the chgen/src directory, and the test case inputs into the chgen/test/<testname> directories.

         Move to the chgen/src subdirectory. Run the makefile, i.e. just type the command “make” from that directory.  This will place a file named chgen11 in the chgen/executables directory.

         The validation test cases can be run with runscript.j in the chgen/test/ directory, after editing it for the correct directory locations and manually defining the test case subdirectories shown in Figure 1.1.

 

Time did not permit the implementation of the third goal .  However, an overview of how this could be implemented is contained in Section 6.


Figure 1.1

Summary of Directory Structure in cvs for chgen Version 11

(return to Text)

(genv11-figure11.ppt)

 

 


2.    GenMerge

 

The GenMerge effort relied on the Concurrent Versions System (CVS) software version 1.6. The purpose of this section of the report is to give background on the CHGEN CVS repository. It was also written in the hope of providing a guide for using the CVS tool with the CHGEN repository.

 

 We were fortunate enough to have two excellent sources of documentation that we recommend for those doing any serious work with the CHGEN repository. The first is the man page which can be retrieved by entering the command ‘man cvs’ at your Unix account prompt. If you would like to save this in a file, issue the command ‘man cvs | col –bx > cvs.man’. This will redirect the cvs manpage to a file called cvs.man, stripped of all of its formatting.  We also recommend the guide Per Cederqvist, et. al“Version Management with CVS”, 1992,93 Signum Support AB. This can be found in Postscript format at $CASE/cvs/cvs_manual/VersMgtWithCVS.ps. Many other pointers and references can be found in the directory $CASE/cvs.

2.1.  CVS Retrieval Information

 

In order for you to work with CVS, it needs to be told the location of the file repository you are interested in. The method of conveying this information is the environmental variable CVSROOT. The following command will point CVS at the CHGEN repository.

 

setenv CVSROOT /usr/proj3/case/gen/base/Master

 

To test this, try to issue the command

 

cvs history -all

 

If you are successful, you will see a number of lines like

 

O 02/24 08:34 +0000 lechner  CVSROOT         =CVSROOT=           /usr/proj3/case/gen/*

O 03/03 21:03 +0000 lechner  chgen                 =chgen=                 ~/cvsGentest/*

.

.

.

etc….

 

 

Now you are prepared to checkout the CHGEN source code. You should have some idea of what version you are interested in. These are the versions that are in the repository:

 

ver_8

v8

pre-genmerge

genv9

genv10

genlog

genv10_branch

jsk-genlog                     - mainline anchor for the genlog-branch

genlog-branch                              - branch tag (this is the name of the branch)

gen10_rassman                            - on the genlog-branch

genv11                                           - on the genlog-branch

 

 

 

 

When you checkout, CVS attempts to place the files in a subdirectory below the directory the command was issued from. As an example, the command

 

cvs checkout chgen

 

instructs CVS to checkout the latest revision of the main branch (also known as the mainline), rooted in a subdirectory named chgen. To checkout a particular revision, say genv11, the command would be

 

cvs checkout –r genv11 chgen

 

 

The –r qualifier indicates that you are interested in checking out a collection of files that have been associated with one another with an “rtag”, or revision tag.  All the tags are listed in the diagram above, with the exception of the DfltVals version, which as of this writing was the latest revision on the mainline (which can be checked out following the first example above). To get the latest version of the genlog-branch, issue the checkout

 

cvs checkout –r genlog-branch chgen

 

If you are interested, however, in the state of the code when the genlog-branch was formed, check out the jsk-genlog revision.


 

Figure 2.1 CHGEN CVS Repository Timeline

(return to text)

v11-figure21.ppt

 

gen10_rassman

(log and replay)

 

   genv11

(lbootstrapping,

metaschema

generation)

 
 

 


 


2.2.  CVS Review Info

 

We took our direction for this portion of the project from a 3/15 mail from Dr. Lechner, to the authors, in which he  instructed

 

Merge ver_10, 10log and 10replay which are a direct sequence,

and should involve no merge conflicts to resolve.

The main problem is importing them as sequential revs to CVS.”

 

The starting point was revision ver_10. The strategy was to update this with genlog and ensure Chong Tian Wang’s 97f522 version (implementation of the pr_set_* utility macros) was included, and then with Rob Rassman’s 98f522 version (implementation of replay capability). We checked out the genlog version to private workspace, and evaluated the source files between it and Wang’s. The following methodology was used.

 

We evaluated the differences between Wang’s version and the genlog version. A differences of the files was made by getting a listing (ls –al) of each version and placing them side by side in a spreadsheet shown in Figure 2.2. This gave us an idea of the files that would need to be merged. We then made a file of the differences that we could look over to make the merge. Another spreadsheet of the differences from the genlog version to the latest mainline version was created, and is shown in Figure 2.3.  A file of differences between the Wang version and the latest mainline version is shown in Figure 2.4.  We also had placed a line in all of the source files that would allow for rcs identification tagging when the files were checked in or out of the repository. This required us to place a line in each of the sources:

 

static char rcsid [ ] = “$Id$”

 

A discussion of rcs tagging is included in the Per Cederqvist document referenced above as well as from $CASE/cvs/bdelog_rtag_use.hlp. The string described above is expanded to include actual rcs revisioning and other information when the file containing it is subsequently passed through the repository gates. This required that all source files be checked back into the repository. This was done on the mainline on 4/24/99.

 

A number of changes were necessary to get three test applications ( schooldb8, schooldb12, and enroll ) working. This included placing the following line in gen_defines.c:

 

fprintf ( file, “#define assert.h\n”);

 

This allows the embedded insert in pr_add utility program produced for the schooldb8 test application  to work properly. The results compared well for all of the test cases (only changes being in the label of the chgen version).  These test case files were updated on the mainline. We made the decision only to update the .sch, .c, and Makefile sources in the test directories as all other files (.h, pr_* utils, and the test case executable) can all be produced by running chgen. We maintain this is a cleaner approach, and will reduce confusion about the status of these other files in any run. It probably makes sense to remove the .h, pr_*.c files from the repository since chgen is quick and easy to build and run (easily less than five minutes on the alpha). Operating in this manner ensures versions that are based on the chgen version you are checking out. We also embedded rcsId’s in the fprintf’s of  the created utilities, so version checking can be done here.

 

It was at this point that we were instructed to branch off due to some conflicting mainline work with the genDfltVals team. We rtagged a version from the day prior to the conflicts in the following manner:

 

cvs rtag -D 1999-04-27 -f  jsk-genlog chgen

( This command created the mainline tag jsk-genlog pointing at the most recent revisions as of Tuesday, April 27. )

 

Then a branch was created based on this tag in the following manner:

 

cvs rtag  -b -r jsk-genlog genlog-branch chgen

( This command created a branch off the mainline called genlog-branch using the files tagged as jsk-genlog. )

 

This technique is explained nicely by Cynthia McLain in the file $CASE/cvs/bdelog_rtag_use.hlp.

 

The completion of the Wang updates was done by adding an update to the aareadme in the top level chgen directory and including his doc files in the proper directory.

 

The Rassman update took place in the same fashion as previously described. The differences spreadsheet is shown in Figure 2.5. The physical file differences are shown in Figure 2.6.  We took the liberty of editing the differences file to eliminate white space differences, (which can be avoided using the –w parameter to the diff command). Other repetitive acceptable differences, such as the revision history updates at the start of each file, rcs id changes, and additional inline comments describing existing code, wer also removed. These changes don’t impact the functional nature of the code, although they do enhance its readability, but they were omitted from the differences file, in order that it be approachable. Rassman’s updates to the enroll test application were also added, and the results between that work and the new version were identical except for  the chgen versioning information.

 

It was here we ran into a few problems with some RFLAG lines in schooldb that Wang had inserted. We could get a clean compile but ran into core dump problems in the executable on both the alpha and decstation. The offending lines were commented out and documented in-line. It appears that the four lines were re-declaring the RFLAG flag to be one (although it had already been initialized in a previous section). At this point we recalled the Wang original version and received the same results. Using his original object files, however, we were able to re-create the results. It was at this point that Dr. Lechner advised us to concentrate on Rassman’s test application, and we are happy to report that this application ran with identical results to Rassman’s original runs. This leaves the schooldb8 test application in a state that runs fine, however, there are some differences between its results and those reported by Wang. We will leave it to a subsequent effort to resolve these differences.

 

One other note about running various test applications with the Rassman (and subsequent) versions. A line in gen_pr_log.c is hard coded to look for the enroll.viewdefs file. This line must be changed, and chgen re-compiled, anytime a different test application is run. The line is shown below:

 

line 1610: ./gen_pr_log.c:  fprintf(prlog_fp, "  pr_init(\"enroll.viewdefs\",filelist);\n");

 

We attempted a last minute effort to remove this dependency, but started running into problems with view definitions for some unknown reason. We thought it best to leave a stable application (albeit with a dependency) rather than one which we could not address completely (or test). Fortunately, the other test applications run fine when the appropriate viewdefs file is substituted here in the source and recompiled.

 

The Rob Rassman version is rtagged on the genlog-branch as gen10_rassman

 

The final effort of genmerge was for the v11 changes. These are the metaschema and bootstrapping changes described in section 3 of this document. The spreadsheet summarizing the differences is shown in Figure 2.7. The file of physical file differences is shown in Figure 2.8. The specific files that needed merging were:

 

Makefile

chgen.c

chgen_externs.h

chgen_define.h

chgen_global_vars.c

chgen_release_date.c

gen_defines.c

gen_pr_add.c

gen_pr_init.c

gen_pr_load.c

gen_pr_utils.c

parse_schema.c

 

These were updated in the repository under the genlog_branch. We added two test cases (98sbde and JPBatch) and updated the house application to demonstrate the new metaschema and bootstrapping options. These went through the chgen run fine and compared to our results outside the repository.

 

The new version is rtagged as genv11 on the genlog-branch.

 


 

 

 

 

m-n-r-orig

 

 

genlog - of rtag by same name

 

Dec

10

20:09

../

512

 

512

Apr

21

7:48

../

 

Oct

10

1997

./

1536

 

2048

Apr

21

7:48

./

 

Oct

10

1997

aareadme

6461

 

914

Jun

22

1996

aareadme

 

May

10

1996

add_pc_cp_entries.c

3979

 

3979

May

18

1997

add_pc_cp_entries.c

 

May

10

1996

btree_c_file.h

12484

 

12484

May

19

1997

btree_c_file.h

 

May

10

1996

change_file_exten.c

2430

 

2430

May

18

1997

change_file_exten.c

 

May

10

1996

chgen.c

13797

 

13797

May

18

1997

chgen.c

 

Jul

3

1996

chgen_define.h

3496

 

3495

May

19

1997

chgen_define.h

 

May

10

1996

chgen_externs.h

14107

 

14107

May

18

1997

chgen_externs.h

 

May

10

1996

chgen_global_vars.c

8147

 

8147

May

18

1997

chgen_global_vars.c

 

Jun

6

1996

chgen_release_date.c

69

 

 

 

 

 

 

 

May

10

1996

chgen_release_date.c.bak

70

 

 

 

 

 

 

 

May

10

1996

close_files.c

1974

 

1974

May

18

1997

close_files.c

 

May

10

1996

gen_c_files.c

2382

 

2382

May

18

1997

gen_c_files.c

 

May

10

1996

gen_defines.c

57730

 

59299

May

18

1997

gen_defines.c

The genlog version includes bugfixes: last_child bug, encode prototype updated, v9 & v10 merged

May

10

1996

gen_load_data.c

9488

 

9488

Jun

22

1996

gen_load_data.c

 

May

10

1996

gen_lut.c

625

 

619

Jun

22

1996

gen_lut.c

The genlog version has #include<stdio.h> whereas the 96s523 version has #include "chgen_exterms.h"

May

10

1996

gen_macros.c

6656

 

6656

Jun

22

1996

gen_macros.c

 

May

10

1996

gen_path.c

5482

 

5482

Jun

22

1996

gen_path.c

 

May

10

1996

gen_pr_add.c

46695

 

48533

May

18

1997

gen_pr_add.c

All in genlog: included assert.h to link_child_1 macros; structure def of rr_data moved to chgen_externs.h; added comment for exit being replaced by a return (and the possible negative consequences); RJL added an assert if more than one child is linked.

May

10

1996

gen_pr_delete.c

25510

 

25509

May

18

1997

gen_pr_delete.c

 

May

10

1996

gen_pr_dump.c

12435

 

12433

May

17

1997

gen_pr_dump.c

 

May

10

1996

gen_pr_free.c

4862

 

4862

May

18

1997

gen_pr_free.c

 

May

10

1996

gen_pr_init.c

19459

 

19510

May

18

1997

gen_pr_init.c

The genlog version's rr_dump_row() initialization is slightly different.

May

10

1996

gen_pr_load.c

9685

 

9683

May

18

1997

gen_pr_load.c

 

May

10

1996

gen_pr_log.c

65835

 

65835

May

18

1997

gen_pr_log.c

 

May

10

1996

gen_pr_stats.c

6059

 

6059

Jun

22

1996

gen_pr_stats.c

 

May

10

1996

gen_pr_utils.c

39928

 

39928

May

18

1997

gen_pr_utils.c

 

May

10

1996

gen_rr_matrix.c

3478

 

3478

Jun

22

1996

gen_rr_matrix.c

 

May

10

1996

gen_structures.c

4396

 

7710

May

18

1997

gen_structures.c

 

May

23

1996

genv10src.wc

2022

 

 

 

 

 

 

 

May

10

1996

hcg_parse.c

3163

 

3163

May

18

1997

hcg_parse.c

 

May

10

1996

lut.c

23122

 

 

 

 

 

 

 

May

10

1996

lut.h

2286

 

 

 

 

 

 

 

May

10

1996

lut_c_file.h

13728

 

13728

May

19

1997

lut_c_file.h

 

May

10

1996

lut_h_file.h

2613

 

2652

May

19

1997

lut_h_file.h

 

May

10

1996

make_cptr.c

3068

 

3068

May

18

1997

make_cptr.c

 

May

10

1996

make_pptr.c

3149

 

3149

Jun

22

1996

make_pptr.c

 

May

10

1996

Makefile.alpha

1427

 

4044

May

18

1997

Makefile

 

Oct

10

1997

Makefile.ansi

1404

 

 

 

 

 

 

 

May

10

1996

Makefile.ansi.bak

1404

 

 

 

 

 

 

 

Oct

10

1997

Makefile.cstmp

1427

 

 

 

 

 

 

 

May

10

1996

Makefile.other

1385

 

 

 

 

 

 

 

May

10

1996

Makefile.other.genlog

1385

 

 

 

 

 

 

 

May

10

1996

Makefilebr.ansi

1434

 

 

 

 

 

 

 

May

10

1996

MakefileDN.ansi

1422

 

 

 

 

 

 

 

May

10

1996

Makefilemm.ansi

1435

 

 

 

 

 

 

 

May

10

1996

mystrcpy.c

2423

 

2423

May

18

1997

mystrcpy.c

 

May

10

1996

open_files.c

3508

 

3508

May

18

1997

open_files.c

 

May

10

1996

parse_schema.c

37039

 

37039

May

18

1997

parse_schema.c

 

May

10

1996

prototypes.h

4500

 

4500

May

18

1997

prototypes.h

 

May

10

1996

read_next.c

2287

 

2287

Jun

22

1996

read_next.c

 

May

10

1996

rr_insert.c

3222

 

3222

May

18

1997

rr_insert.c

 

May

10

1996

store_into_matrix.c

2824

 

2824

Jun

22

1996

store_into_matrix.c

 

May

10

1996

strncpy_null.c

2019

 

2019

Jun

22

1996

strncpy_null.c

 

May

10

1996

validate_schema.c

6446

 

6446

Jun

22

1996

validate_schema.c

 

May

10

1996

write_rr_table.c

4752

 

4752

Jun

22

1996

write_rr_table.c

 

 

 

 


genlog

 

 

 

 

 

cvs_latest

 

 

 

 

 

512

Apr

21

7:48

../

 

512

Apr

23

13:19

../

 

2048

Apr

21

7:48

./

 

2048

Apr

23

13:18

./

 

914

Jun

22

1996

aareadme

 

910

Dec

12

22:57

aareadme

 

3979

May

18

1997

add_pc_cp_entries.c

 

3979

May

18

1997

add_pc_cp_entries.c

 

706

Jun

22

1996

allpsfiles

 

706

Jun

22

1996

allpsfiles

 

 

 

 

 

 

 

512

Apr

23

13:18

bak/

 

12484

May

19

1997

btree_c_file.h

 

12484

May

19

1997

btree_c_file.h

 

95

Jun

22

1996

build

 

95

Jun

22

1996

build

 

360

Jun

22

1996

cfiles.wc.dif

 

360

Jun

22

1996

cfiles.wc.dif

 

2430

May

18

1997

change_file_exten.c

 

2430

May

18

1997

change_file_exten.c

 

13797

May

18

1997

chgen.c

 

13797

May

18

1997

chgen.c

 

3495

May

19

1997

chgen_define.h

 

3495

May

19

1997

chgen_define.h

 

14107

May

18

1997

chgen_externs.h

 

14107

May

18

1997

chgen_externs.h

 

8147

May

18

1997

chgen_global_vars.c

 

8147

May

18

1997

chgen_global_vars.c

 

1974

May

18

1997

close_files.c

 

1974

May

18

1997

close_files.c

 

512

Apr

21

7:48

CVS/

 

512

Apr

23

13:18

CVS/

 

2382

May

18

1997

gen_c_files.c

 

2382

May

18

1997

gen_c_files.c

 

59299

May

18

1997

gen_defines.c

 

59299

May

18

1997

gen_defines.c

 

9488

Jun

22

1996

gen_load_data.c

 

9488

Jun

22

1996

gen_load_data.c

 

619

Jun

22

1996

gen_lut.c

 

619

Jun

22

1996

gen_lut.c

 

6656

Jun

22

1996

gen_macros.c

 

6656

Jun

22

1996

gen_macros.c

 

5482

Jun

22

1996

gen_path.c

 

5482

Jun

22

1996

gen_path.c

 

746

Jun

22

1996

gen_pr_add.93to94.dif

 

746

Jun

22

1996

gen_pr_add.93to94.dif

 

48533

May

18

1997

gen_pr_add.c

 

48533

May

18

1997

gen_pr_add.c

 

42020

Jun

22

1996

gen_pr_add.c.18aug93

 

42020

Jun

22

1996

gen_pr_add.c.18aug93

 

25509

May

18

1997

gen_pr_delete.c

 

25552

Sep

11

1998

gen_pr_delete.c

The latest version in the repository had typecast (struct ca*) at a few places in the fprintf's.

12433

May

17

1997

gen_pr_dump.c

 

12433

May

17

1997

gen_pr_dump.c

 

4862

May

18

1997

gen_pr_free.c

 

4862

May

18

1997

gen_pr_free.c

 

19510

May

18

1997

gen_pr_init.c

 

19510

May

18

1997

gen_pr_init.c

 

9683

May

18

1997

gen_pr_load.c

 

9683

May

18

1997

gen_pr_load.c

 

65835

May

18

1997

gen_pr_log.c

 

65835

May

18

1997

gen_pr_log.c

 

6059

Jun

22

1996

gen_pr_stats.c

 

6059

Jun

22

1996

gen_pr_stats.c

 

39928

May

18

1997

gen_pr_utils.c

 

39928

May

18

1997

gen_pr_utils.c

 

3478

Jun

22

1996

gen_rr_matrix.c

 

3478

Jun

22

1996

gen_rr_matrix.c

 

7710

May

18

1997

gen_structures.c

 

7710

May

18

1997

gen_structures.c

 

5315

Jun

22

1996

genv8.cfl

 

5315

Jun

22

1996

genv8.cfl

 

10990

Jun

22

1996

genv8mainx.cfl

 

10990

Jun

22

1996

genv8mainx.cfl

 

11021

Jun

22

1996

genv8x.cfl

 

11021

Jun

22

1996

genv8x.cfl

 

3163

May

18

1997

hcg_parse.c

 

3163

May

18

1997

hcg_parse.c

 

1549

Jun

22

1996

hcg_structs.hlp

 

1549

Jun

22

1996

hcg_structs.hlp

 

529

Jun

22

1996

KEY_LENGTH.grep

 

529

Jun

22

1996

KEY_LENGTH.grep

 

1164

Jun

22

1996

KEY_LENGTH.grep1

 

1164

Jun

22

1996

KEY_LENGTH.grep1

 

13728

May

19

1997

lut_c_file.h

 

13728

May

19

1997

lut_c_file.h

 

2652

May

19

1997

lut_h_file.h

 

2652

May

19

1997

lut_h_file.h

 

3068

May

18

1997

make_cptr.c

 

3068

May

18

1997

make_cptr.c

 

3149

Jun

22

1996

make_pptr.c

 

3149

Jun

22

1996

make_pptr.c

 

4044

May

18

1997

Makefile

 

4044

May

18

1997

Makefile

 

2062

Jun

22

1996

Makefile.5dec94

 

2062

Jun

22

1996

Makefile.5dec94

 

2894

Jun

22

1996

Makefile.ver_8.alpha

 

2894

Jun

22

1996

Makefile.ver_8.alpha

 

13521

Jun

22

1996

meta_schema.hlp

 

13521

Jun

22

1996

meta_schema.hlp

 

16158

Jun

22

1996

meta_schema.hlp.ps

 

16158

Jun

22

1996

meta_schema.hlp.ps

 

2423

May

18

1997

mystrcpy.c

 

2423

May

18

1997

mystrcpy.c

 

3508

May

18

1997

open_files.c

 

3508

May

18

1997

open_files.c

 

37039

May

18

1997

parse_schema.c

 

37039

May

18

1997

parse_schema.c

 

4500

May

18

1997

prototypes.h

 

4500

May

18

1997

prototypes.h

 

108

Jun

22

1996

pslist

 

108

Jun

22

1996

pslist

 

2287

Jun

22

1996

read_next.c

 

2287

Jun

22

1996

read_next.c

 

3222

May

18

1997

rr_insert.c

 

3222

May

18

1997

rr_insert.c

 

1687

Jun

22

1996

src_and_SCCS.files

 

1687

Jun

22

1996

src_and_SCCS.files

 

2824

Jun

22

1996

store_into_matrix.c

 

2824

Jun

22

1996

store_into_matrix.c

 

2019

Jun

22

1996

strncpy_null.c

 

2019

Jun

22

1996

strncpy_null.c

 

6446

Jun

22

1996

validate_schema.c

 

6446

Jun

22

1996

validate_schema.c

 

1333

Jun

22

1996

ver_8.src.wc.14may94

 

1333

Jun

22

1996

ver_8.src.wc.14may94

 

1410

Jun

22

1996

ver_8.src.wc.6jun96

 

1410

Jun

22

1996

ver_8.src.wc.6jun96

 

1746

Jun

22

1996

ver_8.src.wch.6jun96

 

1746

Jun

22

1996

ver_8.src.wch.6jun96

 

4752

Jun

22

1996

write_rr_table.c

 

4752

Jun

22

1996

write_rr_table.c

 

 

 

 

 

 

 

cvs_latest

 

 

 

 

 


CVS differences after initial work - JSK - 99/4/24

 

This file is the output of a cvs diff on all files except for those in

the test directories (since those are generated by these). Mostly, I was

adding the rcs revision lines to the source code, but also to fix some

Makefile parameters that were missing in the test directories, and some

update to gen_defines.c.

 

 

 

 

Index: src/add_pc_cp_entries.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/add_pc_cp_entries.c,v

retrieving revision 1.2

diff -r1.2 add_pc_cp_entries.c

41a42

>              static char rcsid[] = "$Id";

Index: src/change_file_exten.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/change_file_exten.c,v

retrieving revision 1.2

diff -r1.2 change_file_exten.c

36a37

>              static char rcsid[] = "$Id";

Index: src/chgen.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/chgen.c,v

retrieving revision 1.3

diff -r1.3 chgen.c

98a99

>              static char rcsid[] = "$Id";

Index: src/chgen_externs.h

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/chgen_externs.h,v

retrieving revision 1.3

diff -r1.3 chgen_externs.h

4c4

< 

---

>

Index: src/close_files.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/close_files.c,v

retrieving revision 1.2

diff -r1.2 close_files.c

31a32

>              static char rcsid[] = "$Id";

Index: src/gen_c_files.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_c_files.c,v

retrieving revision 1.2

diff -r1.2 gen_c_files.c

37a38

>              static char rcsid[] = "$Id";

Index: src/gen_defines.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_defines.c,v

retrieving revision 1.6

diff -r1.6 gen_defines.c

25a26

> /*               Apr24 1999 Added #include <assert.h> - JSK                   */

54a56

>              static char rcsid[] = "$Id";

76a79

>     fprintf(schh_fp, "#include <assert.h>\n\n") ; /* 99s523 gen log merge */

Index: src/gen_load_data.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_load_data.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 gen_load_data.c

18c18

< /* revisions   :                                                              */

---

> /* revisions   : 99/4/24 99s523 gen merge - Added rcs lines - JK/KS           */

35a36

>              static char rcsid[] = "$Id";

46a48

>     static char rcsid[] = \"$Id\";\n\

Index: src/gen_lut.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_lut.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 gen_lut.c

11a12

>              static char rcsid[] = "$Id";

Index: src/gen_macros.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_macros.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 gen_macros.c

34a35

>              static char rcsid[] = "$Id";

Index: src/gen_path.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_path.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 gen_path.c

60a61

>              static char rcsid[] = "$Id";

Index: src/gen_pr_add.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_add.c,v

retrieving revision 1.3

diff -r1.3 gen_pr_add.c

51a52

>              static char rcsid[] = "$Id";

Index: src/gen_pr_delete.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_delete.c,v

retrieving revision 1.4

diff -r1.4 gen_pr_delete.c

22a23

> /*               99s523: Placed rcsId lines in                                */

41a43

>              static char rcsid[] = "$Id";

62a65,66

>

>              fprintf(prdel_fp," static char rcsid[] = \"$Id\";\n");

Index: src/gen_pr_dump.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_dump.c,v

retrieving revision 1.2

diff -r1.2 gen_pr_dump.c

19a20

> /*                99s523: added rcsid lines                                   */

37a39

>              static char rcsid[] = "$Id";

64a67,68

>

>              fprintf(prdump_fp,"static char rcsid[] = \"$Id\";\n");

Index: src/gen_pr_free.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_free.c,v

retrieving revision 1.2

diff -r1.2 gen_pr_free.c

18a19

> /*               99s523 - added rcsid lines - JK/KS                           */

33a35

>              static char rcsid[] = "$Id";

51a54,55

>

>              fprintf(prfree_fp,"static char rcsid[] = \"$Id\";\n");

Index: src/gen_pr_init.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_init.c,v

retrieving revision 1.3

diff -r1.3 gen_pr_init.c

47a48

>              static char rcsid[] = "$Id";

Index: src/gen_pr_load.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_load.c,v

retrieving revision 1.3

diff -r1.3 gen_pr_load.c

41a42

>              static char rcsid[] = "$Id";

Index: src/gen_pr_log.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_log.c,v

retrieving revision 1.1

diff -r1.1 gen_pr_log.c

17c17

< /* revisions   :                                                              */

---

> /* revisions   : 99s523 Added rcsid lines - JK/KS                             */

33a34

>              static char rcsid[] = "$Id";

452a454

>   fprintf(prlog_fp, "static char rcsid[] = \"$Id\";\n");

Index: src/gen_pr_stats.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_stats.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 gen_pr_stats.c

9a10

>              static char rcsid[] = "$Id";

28a30

>              fprintf(prstats_fp,"static char rcsid[] = \"$Id\";\n");

Index: src/gen_pr_utils.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_pr_utils.c,v

retrieving revision 1.2

diff -r1.2 gen_pr_utils.c

38a39

>              static char rcsid[] = "$Id";

Index: src/gen_rr_matrix.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_rr_matrix.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 gen_rr_matrix.c

32a33

>              static char rcsid[] = "$Id";

Index: src/gen_structures.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/gen_structures.c,v

retrieving revision 1.3

diff -r1.3 gen_structures.c

42a43

>              static char rcsid[] = "$Id";

Index: src/hcg_parse.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/hcg_parse.c,v

retrieving revision 1.2

diff -r1.2 hcg_parse.c

41a42

>              static char rcsid[] = "$Id";

Index: src/lut_h_file.h

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/lut_h_file.h,v

retrieving revision 1.2

diff -r1.2 lut_h_file.h

3a4

>

Index: src/make_cptr.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/make_cptr.c,v

retrieving revision 1.2

diff -r1.2 make_cptr.c

35a36

>              static char rcsid[] = "$Id";

Index: src/make_pptr.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/make_pptr.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 make_pptr.c

37a38

>              static char rcsid[] = "$Id";

Index: src/mystrcpy.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/mystrcpy.c,v

retrieving revision 1.2

diff -r1.2 mystrcpy.c

34a35

>              static char rcsid[] = "$Id";

Index: src/open_files.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/open_files.c,v

retrieving revision 1.2

diff -r1.2 open_files.c

37a38

>              static char rcsid[] = "$Id";

Index: src/parse_schema.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/parse_schema.c,v

retrieving revision 1.3

diff -r1.3 parse_schema.c

118a119

>              static char rcsid[] = "$Id";

Index: src/read_next.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/read_next.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 read_next.c

35a36

>              static char rcsid[] = "$Id";

Index: src/rr_insert.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/rr_insert.c,v

retrieving revision 1.2

diff -r1.2 rr_insert.c

37a38

>              static char rcsid[] = "$Id";

Index: src/store_into_matrix.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/store_into_matrix.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 store_into_matrix.c

34a35

>              static char rcsid[] = "$Id";

Index: src/strncpy_null.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/strncpy_null.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 strncpy_null.c

36a37

>              static char rcsid[] = "$Id";

Index: src/validate_schema.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/validate_schema.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 validate_schema.c

43a44

>              static char rcsid[] = "$Id";

Index: src/write_rr_table.c

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/src/write_rr_table.c,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 write_rr_table.c

34a35

>              static char rcsid[] = "$Id";

Index: test/housedb/makefile

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/test/housedb/makefile,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 makefile

7c7

<               pr_load.c pr_dump.c

---

>               pr_load.c pr_dump.c pr_log.c

10c10

<              pr_load.o pr_dump.o

---

>              pr_load.o pr_dump.o pr_log.o

21a22

>              rm pr_log.o

42a44,46

>

> pr_log.o : pr_log.c

>              $(CC) -c $(CFLAGS) pr_log.c

Index: test/schooldb12/Makefile

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/test/schooldb12/Makefile,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 Makefile

13c13

< OFILES = schooldb.o pr_delete.o pr_load.o pr_dump.o pr_stats.o pr_free.o

---

> OFILES = schooldb.o pr_delete.o pr_load.o pr_dump.o pr_stats.o pr_free.o pr_log.o

Index: test/schooldb8/Makefile

===================================================================

RCS file: /usr/proj3/case/gen/base/Master/chgen/test/schooldb8/Makefile,v

retrieving revision 1.1.1.1

diff -r1.1.1.1 Makefile

13c13

< OFILES = schooldb.o pr_delete.o pr_load.o pr_dump.o pr_stats.o pr_free.o

---

> OFILES = schooldb.o pr_delete.o pr_load.o pr_dump.o pr_stats.o pr_free.o pr_log.o

 

 


910

Dec

12

22:57

aareadme

 

 

 

 

 

 

add_pc_cp_entries.c

add_pc_cp_entries.c

4009

Apr

24

17:27

add_pc_cp_entries.c

x

3979

Mar

28

14:01

 

change_file_exten.c

change_file_exten.c

706

Jun

22

1996

allpsfiles

 

 

 

 

 

 

chgen.c

chgen.c

12484

May

19

1997

btree_c_file.h

 

12484

Mar

28

14:01

btree_c_file.h

chgen_define.h

chgen_define.h

95

Jun

22

1996

build

 

 

 

 

 

 

chgen_externs.h

chgen_externs.h

360

Jun

22

1996

cfiles.wc.dif

 

 

 

 

 

 

chgen_global_vars.c

chgen_global_vars.c

2460

Apr

24

17:27

change_file_exten.c

x

2430

Mar

28

14:01

change_file_exten.c

chgen_release_date.c

chgen_release_date.c

13827

Apr

24

17:27

chgen.c

x

13797

Mar

28

14:01

chgen.c

close_files.c

close_files.c

3513

May

1

9:25

chgen_define.h

x

3496

Mar

28

14:01

chgen_define.h

gen_c_files.c

gen_c_files.c

14107

May

18

1997

chgen_externs.h

x

14107

Mar

28

14:01

chgen_externs.h

gen_defines.c

gen_defines.c

8236

Apr

29

16:32

chgen_global_vars.c

x

8147

Mar

28

14:01

chgen_global_vars.c

gen_load_data.c

gen_load_data.c

98

May

1

9:29

chgen_release_date.c

x

69

Mar

28

14:01

chgen_release_date.c

gen_lut.c

gen_lut.c

2004

Apr

24

17:27

close_files.c

x

1974

Mar

28

14:01

close_files.c

gen_macros.c

gen_macros.c

512

May

1

12:22

CVS/

 

 

 

 

 

 

gen_path.c

gen_path.c

2412

Apr

24

17:27

gen_c_files.c

x

2382

Mar

28

14:01

gen_c_files.c

gen_pr_add.c

gen_pr_add.c

61064

Apr

30

9:13

gen_defines.c

xx

59063

Mar

28

14:01

gen_defines.c

gen_pr_delete.c

gen_pr_delete.c

9556

Apr

24

17:27

gen_load_data.c

xx

9488

Mar

28

14:01

gen_load_data.c

gen_pr_dump.c

gen_pr_dump.c

649

Apr

24

17:27

gen_lut.c

x

625

Mar

28

14:01

gen_lut.c

gen_pr_free.c

gen_pr_free.c

6686

Apr

24

17:27

gen_macros.c

x

6656

Mar

28

14:01

gen_macros.c

gen_pr_init.c

gen_pr_init.c

5512

Apr

24

17:27

gen_path.c

x

5482

Mar

28

14:01

gen_path.c

gen_pr_load.c

gen_pr_load.c

746

Jun

22

1996

gen_pr_add.93to94.dif

 

 

 

 

 

 

gen_pr_log.c

gen_pr_log.c

48563

Apr

24

17:27

gen_pr_add.c

xx

46695

Mar

28

14:01

gen_pr_add.c

gen_pr_stats.c

gen_pr_stats.c

42020

Jun

22

1996

gen_pr_add.c.18aug93

 

 

 

 

 

 

gen_pr_utils.c

gen_pr_utils.c

25720

Apr

24

17:27

gen_pr_delete.c

xx

25510

Mar

28

14:01

gen_pr_delete.c

gen_rr_matrix.c

gen_rr_matrix.c

12601

Apr

24

17:27

gen_pr_dump.c

xx

12435

Mar

28

14:01

gen_pr_dump.c

gen_structures.c

gen_structures.c

5030

Apr

24

17:27

gen_pr_free.c

xx

4862

Mar

28

14:01

gen_pr_free.c

hcg_parse.c

hcg_parse.c

19540

Apr

24

17:27

gen_pr_init.c

xx

19459

Mar

28

14:01

gen_pr_init.c

lut.c

lut.c

9713

Apr

24

17:28

gen_pr_load.c

x

9685

Mar

28

14:01

gen_pr_load.c

lut_h_file.h

lut_h_file.h

 

 

 

 

 

 

82707

Mar

28

14:01

gen_pr_log.bak

make_cptr.c

make_cptr.c

65922

Apr

24

17:28

gen_pr_log.c

xxx

83118

Mar

28

14:01

gen_pr_log.c

make_pptr.c

make_pptr.c

6146

Apr

24

17:28

gen_pr_stats.c

x

6059

Mar

28

14:01

gen_pr_stats.c

mystrcpy.c

mystrcpy.c

39958

Apr

24

17:28

gen_pr_utils.c

x

39928

Mar

28

14:01

gen_pr_utils.c

open_files.c

open_files.c

3508

Apr

24

17:28

gen_rr_matrix.c

x

3478

Mar

28

14:01

gen_rr_matrix.c

parse_schema.c

parse_schema.c

7925

Apr

30

9:13

gen_structures.c

xx

4470

Mar

28

14:01

gen_structures.c

read_next.c

read_next.c

5315

Jun

22

1996

genv8.cfl

 

 

 

 

 

 

rr_insert.c

rr_insert.c

10990

Jun

22

1996

genv8mainx.cfl

 

 

 

 

 

 

store_into_matrix.c

store_into_matrix.c

11021

Jun

22

1996

genv8x.cfl

 

 

 

 

 

 

strncpy_null.c

strncpy_null.c

3193

Apr

24

17:28

hcg_parse.c

x

3163

Mar

28

14:01

hcg_parse.c

validate_schema.c

validate_schema.c

1549

Jun

22

1996

hcg_structs.hlp

 

 

 

 

 

 

write_rr_table.c

write_rr_table.c

529

Jun

22

1996

KEY_LENGTH.grep

 

 

 

 

 

 

 

 

1164

Jun

22

1996

KEY_LENGTH.grep1

 

 

 

 

 

 

 

 

23152

Apr

30

9:38

lut.c

x

23122

Mar

28

14:01

lut.c

 

 

2286

Apr

30

9:38

lut.h

 

2286

Mar

28

14:01

lut.h

 

 

13728

May

19

1997

lut_c_file.h

 

13728

Mar

28

14:01

lut_c_file.h

 

 

2652

May

19

1997

lut_h_file.h

x

2613

Mar

28

14:01

lut_h_file.h

 

 

3098

Apr

24

17:28

make_cptr.c

x

3068

Mar

28

14:01

make_cptr.c

 

 

3179

Apr

24

17:28

make_pptr.c

x

3149

Mar

28

14:01

make_pptr.c

 

 

1404

Apr

30

10:35

Makefile

 

1404

Mar

28

14:01

Makefile

 

 

2062

Jun

22

1996

Makefile.5dec94

 

1385

Mar

28

14:01

Makefile.other.genlog

 

 

2894

Jun

22

1996

Makefile.ver_8.alpha

 

 

 

 

 

 

 

 

13521

Jun

22

1996

meta_schema.hlp

 

 

 

 

 

 

 

 

16158

Jun

22

1996

meta_schema.hlp.ps

 

 

 

 

 

 

 

 

2453

Apr

24

17:28

mystrcpy.c

x

2423

Mar

28

14:01

mystrcpy.c

 

 

3538

Apr

24

17:28

open_files.c

x

3508

Mar

28

14:01

open_files.c

 

 

37069

Apr

24

17:28

parse_schema.c

x

37039

Mar

28

14:01

parse_schema.c

 

 

4500

May

18

1997

prototypes.h

 

4500

Mar

28

14:01

prototypes.h

 

 

108

Jun

22

1996

pslist

 

 

 

 

 

 

 

 

2317

Apr

24

17:28

read_next.c

x

2287

Mar

28

14:01

read_next.c

 

 

3252

Apr

24

17:28

rr_insert.c

x

3222

Mar

28

14:01

rr_insert.c

 

 

1687

Jun

22

1996

src_and_SCCS.files

 

 

 

 

 

 

 

 

2854

Apr

24

17:28

store_into_matrix.c

x

2824

Mar

28

14:01

store_into_matrix.c

 

 

2049

Apr

24

17:28

strncpy_null.c

x

2019

Mar

28

14:01

strncpy_null.c

 

 

6476

Apr

24

17:28

validate_schema.c

x

6446

Mar

28

14:01

validate_schema.c

 

 

1333

Jun

22

1996

ver_8.src.wc.14may94

 

 

 

 

 

 

 

 

1410

Jun

22

1996

ver_8.src.wc.6jun96

 

 

 

 

 

 

 

 

1746

Jun

22

1996

ver_8.src.wch.6jun96

 

 

 

 

 

 

 

 

4782

Apr

24

17:28

write_rr_table.c

x

4752

Mar

28

14:01

write_rr_table.c

 

 

branch

 

 

 

 

 

rrassman

 

 

 

 

 

 


add_cp_entries

===============

 

change_file_exten.c

===============

37d36

<              static char rcsid[] = "$Id";

chgen.c

===============

99d98

<              static char rcsid[] = "$Id";

chgen_define.h

===============

34c34

< #define               CHGEN_VERSION "genlog-branch gen10-wang"

---

> #define               CHGEN_VERSION "v10log"

72a73

>

gen_externs.h

===============

chgen_global_vars.c

===============

125c125

< /* TEST COMMENT - Testing out CVS branching - this comment has no intrinsic value. JSK */

---

>

chgen_release_date.c

===============

1,2c1,2

< char * CHGEN_RELEASE_DATE() {return "Sat May  1 08:42:00 EDT 1999";}

< static char rcsid[] = "$Id";

---

> char * CHGEN_RELEASE_DATE() {return "Thu Jun 6 22:00:00 GMT 1996";}

>

close_files.c

===============

32d31

<              static char rcsid[] = "$Id";

gen_c_files.c

===============

38d37

<              static char rcsid[] = "$Id";

gen_defines.c

===============

59,60c51

<              static char rcsid[] = "$Id";

<     int i;

---

>     int    i;

82d72

<     fprintf(schh_fp, "#include <assert.h>\n\n") ; /* 99s523 gen log merge */

148,153d137

< /* I moved '#ifdef MAIN' below pr_add's definition  -  RJL 96/8/31 *

<  * pr_add generates 'implicit function decl and undefined' errors without it *

<  * (also done by Mark Aldred for gen/ver_10/chgen/src/gen_defines.c - RJL)

<  *

<  * 97/05/13 AS: V10 did not have main commented out. Commented by GENMERGE

< */

157,161c141,143

<        fprintf(schh_fp, "#define pr_add(view,tbl_abbr,tbl_ptr)  gen_pr_add(view, \"tbl_abbr\", tbl_ptr)\n" );

<     /* 93su523 PGEN merge (END) */

<

<     fprintf(schh_fp, "#ifdef MAIN\n") ; /* moved here by RJL 96/8/31 */

<     fprintf(schh_fp, "#define hcg_declare(tbl) *tbl = NULL , *tbl%scurr = NULL , *tbl%stemp = NULL , *tbl%send = NULL , *tbl%selt = NULL,\\\n",sep,sep,sep,sep) ;

---

>        fprintf(schh_fp,          "#define pr_add(view,tbl_abbr,tbl_ptr)  gen_pr_add(view, \"tbl_abbr\", tbl_ptr)\n" );

>     /* 93su523 PGEN merge (END)   */

>     fprintf(schh_fp, "#define hcg_declare(tbl) *tbl = NULL , *tbl%scurr = NULL , *tbl%stemp = NULL , *tbl%send = NULL , *tbl%selt = NULL,\\\n",sep,sep,sep,sep)        ;

gen_load_data.c

===============

18c18

< /* revisions   : 99/4/24 99s523 gen merge - Added rcs lines - JK/KS           */

---

> /* revisions   :                                                              */

36d35

<              static char rcsid[] = "$Id";

48d46

<     static char rcsid[] = \"$Id\";\n\

gen_lut.c

===============

1d0

< #include <stdio.h>

4,5c3

<

<

---

> #include "chgen_externs.h"

12d9

<              static char rcsid[] = "$Id";

gen_macros.c

===============

35d34

<              static char rcsid[] = "$Id";

gen_path.c

===============

61d60

<              static char rcsid[] = "$Id";

gen_pr_add.c

===============

40d37

< #include <assert.h>

52,56c46,49

<              static char rcsid[] = "$Id";

<         int foundnum, i;

<         char parent_pkey[NAMELENGTH];

<         char unpad;

< /* 93su523 PGEN merge (BEGIN) */

---

>              int foundnum, i;

>              char parent_pkey[NAMELENGTH];

>              char unpad;

> /* 93su523 PGEN              merge (BEGIN) */

124,128d116

< /* GENMERGE: AS: Noticed that genlog project replaced "exit(1)" statement

< //               with a "return" statement below. No explanation given

< //               for this change. This could be a bug, since origianl

< //               GEN v10 code uses "exit" for errors and "return" for warnings"

< */

144,148d131

< /* GENMERGE: AS: Noticed that genlog project replaced "exit(2)" statement

< //               with a "return" statement below. No explanation given

< //               for this change. This could be a bug, since origianl

< //               GEN v10 code uses "exit" for errors and "return" for warnings"

< */

350,351d332

<     fprintf(prload_fp,"/* The assert macro aborts if more than one child is linked in - RJL 94/12/6  */\n");

<     fprintf(prload_fp,"/* assert (loosely) allows NULL or self-pointer in the current parent         */\n");

354d334

<     fprintf(prload_fp, "assert(pa%scurr->c%s_fcp == NULL || pa%scurr->c%s_fcp == pa%scurr);\\\n",sep,sep,sep,sep,sep);

gen_pr_delete.c

===============

23d22

< /*               99s523: Placed rcsId lines in                                */

43d41

<              static char rcsid[] = "$Id";

66,67d63

<              fprintf(prdel_fp," static char rcsid[] = \"$Id\";\n");

<

gen_pr_dump.c

===============

20d19

< /*                99s523: added rcsid lines                                   */

39d37

<              static char rcsid[] = "$Id";

68,69d65

<              fprintf(prdump_fp,"static char rcsid[] = \"$Id\";\n");

<

gen_pr_free.c

===============

19d18

< /*               99s523 - added rcsid lines - JK/KS                           */

35d33

<              static char rcsid[] = "$Id";

54,55d51

<

<              fprintf(prfree_fp,"static char rcsid[] = \"$Id\";\n");

gen_pr_init.c

===============

48d47

<              static char rcsid[] = "$Id";

gen_pr_load.c

===============

42d41

<              static char rcsid[] = "$Id";

gen_pr_log.c

===============

17c17

< /* revisions   : 99s523 Added rcsid lines - JK/KS                             */

---

> /* revisions   :                                                              */

34d33

<              static char rcsid[] = "$Id";

454d452

<   fprintf(prlog_fp, "static char rcsid[] = \"$Id\";\n");

977a976,1282

> gen_log_do_set_int()

> {

>   int elseflag;

>

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "/* Function: log_do_set_int                                 */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* This function is used to set the value of an int field.  */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Created by : Rob Rassmann                                                      */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Creation Date : 12/12/98                                             */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Arguments: pkeychar    - char string of the primary key. */\n");

>   fprintf(prlog_fp, "/*            fieldname   - char string of the changing field. */\n");

>   fprintf(prlog_fp, "/*            newval      - int value to be set.            */\n");

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "void log_do_set_int(pkeychar,fieldname,newval)\n");

>   fprintf(prlog_fp, "const char pkeychar[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "const char fieldname[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "const int newval;\n");

>   fprintf(prlog_fp, "{\n");

>   fprintf(prlog_fp, "  char pkey[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "  int tbl_encoding, fld_encoding;\n");

>   fprintf(prlog_fp, "\n");

>   fprintf(prlog_fp, "  strcpy(pkey,pkeychar);\n");

>   fprintf(prlog_fp, "  find_tbl_idx(pkeychar);\n");

>   fprintf(prlog_fp, "  if(encode(pkey,&hcg_k) ==1)\n");

>   fprintf(prlog_fp, "  {\n");

>   fprintf(prlog_fp, "#ifdef DEBUG\n");

>   fprintf(prlog_fp, "  printf(\"Found DL with pkey %%s.\\n\",pkeychar);\n");

>   fprintf(prlog_fp, "#endif DEBUG\n");

>   fprintf(prlog_fp, "    tbl_encoding = encoding(hcg_table_seq_list[hcg_tbl_idx].ttabbrev);\n");

>   fprintf(prlog_fp, "    switch(tbl_encoding) {\n");

>   fprintf(prlog_fp, "\n");

>   /* for each table type, emit an appropriate delete action in the switch */

>

>   tt_curr = tt;

>   while ( tt_curr != NULL )

>     {

>       fprintf(prlog_fp, "  case %d: /* %s table */\n", encoding(tt_curr->TTabbr), tt_curr->TTabbr);

>

>       fprintf(prlog_fp, "    pr_find(%s, %sid, hcg_k);\n", tt_curr->TTabbr, tt_curr->TTabbr);

>       fprintf(prlog_fp, "    if (%scurr == NULL)\n",tt_curr->TTabbr);

>       fprintf(prlog_fp, "      printf(\"log_do_set_int %%s not found.\\n\", pkeychar);\n");

>       fprintf(prlog_fp, "    else{\n");

>

>       ta_curr = tt_curr->ta_ptr;

>       elseflag = 0;

>       while (ta_curr != NULL)

>       {

>              if(*ta_curr->FieldType=='i')

>              {

>                if(elseflag)

>                  fprintf(prlog_fp, "      else\n");

>                else

>                  elseflag = 1;

>                fprintf(prlog_fp, "      if(strcmp(fieldname,\"%s\")==0)\n",ta_curr->FieldName);

>                fprintf(prlog_fp, "        %scurr->%s = newval;\n",tt_curr->TTabbr,ta_curr->FieldName);

>              }

>              ta_curr = ta_curr->next_ptr;

>       }

>

>       fprintf(prlog_fp, "    }\n");

>       fprintf(prlog_fp, "    break;\n");

>       fprintf(prlog_fp, "\n");

>       tt_curr = tt_curr->next_ptr;

>     }

>   fprintf(prlog_fp, "    } /* end switch */\n");

>   fprintf(prlog_fp, "  } /* end if decode */\n");

>   fprintf(prlog_fp, "}\n");

>   fprintf(prlog_fp, "\n");

> }

>

> void

> gen_log_do_set_flt()

> {

>   int elseflag;

>

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "/* Function: log_do_set_flt                                 */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* This function is used to set the value of an float field.*/\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Created by : Rob Rassmann                                                      */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Creation Date : 12/12/98                                             */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Arguments: pkeychar    - char string of the primary key. */\n");

>   fprintf(prlog_fp, "/*            fieldname   - char string of the changing field. */\n");

>   fprintf(prlog_fp, "/*            newval      - flt value to be set.            */\n");

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "void log_do_set_flt(pkeychar,fieldname,newval)\n");

>   fprintf(prlog_fp, "const char pkeychar[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "const char fieldname[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "const float newval;\n");

>   fprintf(prlog_fp, "{\n");

>   fprintf(prlog_fp, "  char pkey[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "  int tbl_encoding, fld_encoding;\n");

>   fprintf(prlog_fp, "\n");

>   fprintf(prlog_fp, "  strcpy(pkey,pkeychar);\n");

>   fprintf(prlog_fp, "  find_tbl_idx(pkeychar);\n");

>   fprintf(prlog_fp, "  if(encode(pkey,&hcg_k) ==1)\n");

>   fprintf(prlog_fp, "  {\n");

>   fprintf(prlog_fp, "#ifdef DEBUG\n");

>   fprintf(prlog_fp, "  printf(\"Found DL with pkey %%s.\\n\",pkeychar);\n");

>   fprintf(prlog_fp, "#endif DEBUG\n");

>   fprintf(prlog_fp, "    tbl_encoding = encoding(hcg_table_seq_list[hcg_tbl_idx].ttabbrev);\n");

>   fprintf(prlog_fp, "    switch(tbl_encoding) {\n");

>   fprintf(prlog_fp, "\n");

>   /* for each table type, emit an appropriate delete action in the switch */

>

>   tt_curr = tt;

>   while ( tt_curr != NULL )

>     {

>       fprintf(prlog_fp, "  case %d: /* %s table */\n", encoding(tt_curr->TTabbr), tt_curr->TTabbr);

>

>       fprintf(prlog_fp, "    pr_find(%s, %sid, hcg_k);\n", tt_curr->TTabbr, tt_curr->TTabbr);

>       fprintf(prlog_fp, "    if (%scurr == NULL)\n",tt_curr->TTabbr);

>       fprintf(prlog_fp, "      printf(\"log_do_set_flt %%s not found.\\n\", pkeychar);\n");

>       fprintf(prlog_fp, "    else{\n");

>

>       ta_curr = tt_curr->ta_ptr;

>       elseflag = 0;

>       while (ta_curr != NULL)

>       {

>              if(*ta_curr->FieldType=='f')

>              {

>                if(elseflag)

>                  fprintf(prlog_fp, "      else\n");

>                else

>                  elseflag = 1;

>                fprintf(prlog_fp, "      if(strcmp(fieldname,\"%s\")==0)\n",ta_curr->FieldName);

>                fprintf(prlog_fp, "        %scurr->%s = newval;\n",tt_curr->TTabbr,ta_curr->FieldName);

>              }

>              ta_curr = ta_curr->next_ptr;

>       }

>

>       fprintf(prlog_fp, "    }\n");

>       fprintf(prlog_fp, "    break;\n");

>       fprintf(prlog_fp, "\n");

>       tt_curr = tt_curr->next_ptr;

>     }

>   fprintf(prlog_fp, "    } /* end switch */\n");

>   fprintf(prlog_fp, "  } /* end if decode */\n");

>   fprintf(prlog_fp, "}\n");

>   fprintf(prlog_fp, "\n");

> }

>

> void

> gen_log_do_set_key()

> {

>   int elseflag;

>

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "/* Function: log_do_set_key                                 */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* This function is used to set the value of an key field.  */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Created by : Rob Rassmann                                                      */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Creation Date : 12/12/98                                             */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Arguments: pkeychar    - char string of the primary key. */\n");

>   fprintf(prlog_fp, "/*            fieldname   - char string of the changing field. */\n");

>   fprintf(prlog_fp, "/*            newval      - char string key value to be set.*/\n");

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "void log_do_set_key(pkeychar,fieldname,newval)\n");

>   fprintf(prlog_fp, "const char pkeychar[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "const char fieldname[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "const char newval[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "{\n");

>   fprintf(prlog_fp, "  char pkey[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "  int tbl_encoding, fld_encoding;\n");

>   fprintf(prlog_fp, "  hcg_key new_key;\n");

>   fprintf(prlog_fp, "\n");

>   fprintf(prlog_fp, "  strcpy(pkey,pkeychar);\n");

>   fprintf(prlog_fp, "  find_tbl_idx(pkeychar);\n");

>   fprintf(prlog_fp, "  if(encode(pkey,&hcg_k) ==1)\n");

>   fprintf(prlog_fp, "  {\n");

>   fprintf(prlog_fp, "#ifdef DEBUG\n");

>   fprintf(prlog_fp, "  printf(\"Found DL with pkey %%s.\\n\",pkeychar);\n");

>   fprintf(prlog_fp, "#endif DEBUG\n");

>   fprintf(prlog_fp, "    if(encode(fieldname,&new_key) ==1)\n");

>   fprintf(prlog_fp, "    {\n");

>   fprintf(prlog_fp, "#ifdef DEBUG\n");

>   fprintf(prlog_fp, "  printf(\"Found DL with key %%s.\\n\",fieldname);\n");

>   fprintf(prlog_fp, "#endif DEBUG\n");

>   fprintf(prlog_fp, "      tbl_encoding = encoding(hcg_table_seq_list[hcg_tbl_idx].ttabbrev);\n");

>   fprintf(prlog_fp, "      switch(tbl_encoding) {\n");

>   fprintf(prlog_fp, "\n");

>   /* for each table type, emit an appropriate delete action in the switch */

>

>   tt_curr = tt;

>   while ( tt_curr != NULL )

>     {

>       fprintf(prlog_fp, "      case %d: /* %s table */\n", encoding(tt_curr->TTabbr), tt_curr->TTabbr);

>

>       fprintf(prlog_fp, "        pr_find(%s, %sid, hcg_k);\n", tt_curr->TTabbr, tt_curr->TTabbr);

>       fprintf(prlog_fp, "        if (%scurr == NULL)\n",tt_curr->TTabbr);

>       fprintf(prlog_fp, "          printf(\"log_do_set_key %%s not found.\\n\", pkeychar);\n");

>       fprintf(prlog_fp, "        else{\n");

>

>       ta_curr = tt_curr->ta_ptr;

>       elseflag = 0;

>       while (ta_curr != NULL)

>       {

>              if(ta_curr->IsKey==1)

>              {

>                if(elseflag)

>                  fprintf(prlog_fp, "          else\n");

>                else

>                  elseflag = 1;

>                fprintf(prlog_fp, "          if(strcmp(fieldname,\"%s\")==0)\n",ta_curr->FieldName);

>                fprintf(prlog_fp, "            %scurr->%s = new_key;\n",tt_curr->TTabbr,ta_curr->FieldName);

>              }

>              ta_curr = ta_curr->next_ptr;

>       }

>

>       fprintf(prlog_fp, "        }\n");

>       fprintf(prlog_fp, "        break;\n");

>       fprintf(prlog_fp, "\n");

>       tt_curr = tt_curr->next_ptr;

>     }

>   fprintf(prlog_fp, "      } /* end switch */\n");

>   fprintf(prlog_fp, "    } /* end if decode of fieldname */\n");

>   fprintf(prlog_fp, "  } /* end if decode of pkey */\n");

>   fprintf(prlog_fp, "}\n");

>   fprintf(prlog_fp, "\n");

> }

>

> void

> gen_log_do_set_str()

> {

>   int elseflag;

>

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "/* Function: log_do_set_str                                 */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* This function is used to set the value of an string field.*/\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Created by : Rob Rassmann                                                      */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Creation Date : 12/12/98                                             */\n");

>   fprintf(prlog_fp, "/*                                                          */\n");

>   fprintf(prlog_fp, "/* Arguments: pkeychar    - char string of the primary key. */\n");

>   fprintf(prlog_fp, "/*            fieldname   - char string of the changing field. */\n");

>   fprintf(prlog_fp, "/*            newval      - char string value to be set.    */\n");

>   fprintf(prlog_fp, "/************************************************************/\n");

>   fprintf(prlog_fp, "void log_do_set_str(pkeychar,fieldname,newval)\n");

>   fprintf(prlog_fp, "const char pkeychar[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "const char fieldname[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "const char newval[BUFSIZE+1];\n");

>   fprintf(prlog_fp, "{\n");

>   fprintf(prlog_fp, "  char pkey[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "  int tbl_encoding, fld_encoding;\n");

>   fprintf(prlog_fp, "\n");

>   fprintf(prlog_fp, "  strcpy(pkey,pkeychar);\n");

>   fprintf(prlog_fp, "  find_tbl_idx(pkeychar);\n");

>   fprintf(prlog_fp, "  if(encode(pkey,&hcg_k) ==1)\n");

>   fprintf(prlog_fp, "  {\n");

>   fprintf(prlog_fp, "#ifdef DEBUG\n");

>   fprintf(prlog_fp, "  printf(\"Found DL with pkey %%s.\\n\",pkeychar);\n");

>   fprintf(prlog_fp, "#endif DEBUG\n");

>   fprintf(prlog_fp, "    tbl_encoding = encoding(hcg_table_seq_list[hcg_tbl_idx].ttabbrev);\n");

>   fprintf(prlog_fp, "    switch(tbl_encoding) {\n");

>   fprintf(prlog_fp, "\n");

>   /* for each table type, emit an appropriate delete action in the switch */

>

>   tt_curr = tt;

>   while ( tt_curr != NULL )

>     {

>       fprintf(prlog_fp, "  case %d: /* %s table */\n", encoding(tt_curr->TTabbr), tt_curr->TTabbr);

>

>       fprintf(prlog_fp, "    pr_find(%s, %sid, hcg_k);\n", tt_curr->TTabbr, tt_curr->TTabbr);

>       fprintf(prlog_fp, "    if (%scurr == NULL)\n",tt_curr->TTabbr);

>       fprintf(prlog_fp, "      printf(\"log_do_set_str %%s not found.\\n\", pkeychar);\n");

>       fprintf(prlog_fp, "    else{\n");

>

>       ta_curr = tt_curr->ta_ptr;

>       elseflag = 0;

>       while (ta_curr != NULL)

>       {

>              if(*ta_curr->FieldType=='c' && ta_curr->IsKey==0)

>              {

>                if(elseflag)

>                  fprintf(prlog_fp, "      else\n");

>                else

>                  elseflag = 1;

>                fprintf(prlog_fp, "      if(strcmp(fieldname,\"%s\")==0)\n",ta_curr->FieldName);

>                fprintf(prlog_fp, "        strcpy(%scurr->%s,newval);\n",tt_curr->TTabbr,ta_curr->FieldName);

>              }

>              ta_curr = ta_curr->next_ptr;

>       }

>

>       fprintf(prlog_fp, "    }\n");

>       fprintf(prlog_fp, "    break;\n");

>       fprintf(prlog_fp, "\n");

>       tt_curr = tt_curr->next_ptr;

>     }

>   fprintf(prlog_fp, "    } /* end switch */\n");

>   fprintf(prlog_fp, "  } /* end if decode */\n");

>   fprintf(prlog_fp, "}\n");

>   fprintf(prlog_fp, "\n");

> }

>

> void

1117a1423,1478

>

>   /*** New Code inserted 12/12/98 ***/

>   fprintf(prlog_fp, "    if (strcmp(token,\"PR_SET_INT\") == 0) {\n");

>   fprintf(prlog_fp, "      char temp_tbl[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "      char temp_field[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "      char temp_newval[BUFSIZE+1];\n");

>   fprintf(prlog_fp, "      int temp_newint;\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_tbl,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_field,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_newval,&idx);\n");

>   fprintf(prlog_fp, "      temp_newint = atoi(temp_newval);\n");

>   fprintf(prlog_fp, "      log_do_set_int(temp_tbl,temp_field,temp_newint);\n");

>   fprintf(prlog_fp, "      hcg_read_next();\n");

>   fprintf(prlog_fp, "      continue;\n");

>   fprintf(prlog_fp, "    }\n");

>   fprintf(prlog_fp, "\n");

>   fprintf(prlog_fp, "    if (strcmp(token,\"PR_SET_FLT\") == 0) {\n");

>   fprintf(prlog_fp, "      char temp_tbl[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "      char temp_field[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "      char temp_newval[BUFSIZE+1];\n");

>   fprintf(prlog_fp, "      float temp_newflt;\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_tbl,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_field,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_newval,&idx);\n");

>   fprintf(prlog_fp, "      temp_newflt = atof(temp_newval);\n");

>   fprintf(prlog_fp, "      log_do_set_flt(temp_tbl,temp_field,temp_newflt);\n");

>   fprintf(prlog_fp, "      hcg_read_next();\n");

>   fprintf(prlog_fp, "      continue;\n");

>   fprintf(prlog_fp, "    }\n");

>   fprintf(prlog_fp, "\n");

>   fprintf(prlog_fp, "    if (strcmp(token,\"PR_SET_KEY\") == 0) {\n");

>   fprintf(prlog_fp, "      char temp_tbl[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "      char temp_field[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "      char temp_newkey[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_tbl,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_field,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_newkey,&idx);\n");

>   fprintf(prlog_fp, "      log_do_set_key(temp_tbl,temp_field,temp_newkey);\n");

>   fprintf(prlog_fp, "      hcg_read_next();\n");

>   fprintf(prlog_fp, "      continue;\n");

>   fprintf(prlog_fp, "    }\n");

>   fprintf(prlog_fp, "\n");

>   fprintf(prlog_fp, "    if (strcmp(token,\"PR_SET_STR\") == 0) {\n");

>   fprintf(prlog_fp, "      char temp_tbl[HCG_KEY_SIZE+1];\n");

>   fprintf(prlog_fp, "      char temp_field[NAMELENGTH+1];\n");

>   fprintf(prlog_fp, "      char temp_newstr[BUFSIZE+1];\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_tbl,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_field,&idx);\n");

>   fprintf(prlog_fp, "      hcg_parse(hcg_buffer,temp_newstr,&idx);\n");

>   fprintf(prlog_fp, "      log_do_set_str(temp_tbl,temp_field,temp_newstr);\n");

>   fprintf(prlog_fp, "      hcg_read_next();\n");

>   fprintf(prlog_fp, "      continue;\n");

>   fprintf(prlog_fp, "    }\n");

>   fprintf(prlog_fp, "\n");

>   /*** End of New Code inserted 12/12/98 ***/

>

1241c1602

<   fprintf(prlog_fp, "  pr_init(\"students.viewdefs\",filelist);\n");

---

>   fprintf(prlog_fp, "  pr_init(\"enroll.viewdefs\",filelist);\n");

1277a1639

>              fprintf(prlog_fp,"#include <stdlib.h>\n") ;

1298a1661,1668

>

>              /*** New Code inserted 12/12/98 ***/

>              gen_log_do_set_int();

>              gen_log_do_set_flt();

>              gen_log_do_set_key();

>              gen_log_do_set_str();

>              /*** End of New Code inserted 12/12/98 ***/

>

gen_pr_stats.c

===============

10d9

<              static char rcsid[] = "$Id";

30d28

<              fprintf(prstats_fp,"static char rcsid[] = \"$Id\";\n");

gen_pr_utils.c

===============

39d38

<              static char rcsid[] = "$Id";

gen_rr_matrix.c

===============

33d32

<              static char rcsid[] = "$Id";

gen_structures.c

===============

44,45c43

<              static char rcsid[] = "$Id";

<     int dimension, index ;

---

>     int    dimension, index ;

127,165d124

< /*** 95s523,chwang,5,11,95. Add btree structures and other relative btree arguments.  ***/

< /*** ---lines begin--- ***/

<     fprintf(schh_fp,"\n\n/******************************************************************************/\n");

<     fprintf(schh_fp,"/* The following define the btree structures and relative variables for each  */\n");

<     fprintf(schh_fp,"/* table which defines btree search in schema file.                           */\n");

<     fprintf(schh_fp,"/******************************************************************************/\n\n");

<     fprintf(schh_fp,"\n#define BTREESEARCH 1 \n");

<     fprintf(schh_fp,"#define SEQUENCESEARCH 0 \n");

<     fprintf(schh_fp,"#define LEFT 2 \n");

<     fprintf(schh_fp,"#define RIGHT 3 \n\n");

<

<     tt_curr = tt;

<     while (tt_curr != NULL)

<      {

<        fprintf(schh_fp,"int %sbtidx; \n",tt_curr->TTabbr);

<        if (tt_curr->comment[0] != '\0')

<        if (tt_curr->comment[2] == '1')

<        {

<                 fprintf(schh_fp,"/******************************************************************************/\n");

<                 fprintf(schh_fp,"/* Table %s btree structure : %sbtree                                         */\n",tt_curr->TTabbr,tt_curr->TTabbr);

<                 fprintf(schh_fp,"/******************************************************************************/\n");

<                 fprintf(schh_fp,"struct %sbtree \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"{   \n");

<                 fprintf(schh_fp,"hcg_key key;   /* primary key */  \n");

<                 fprintf(schh_fp,"struct %s *ptr; \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"struct %sbtree *parent;  \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"struct %sbtree *left;   \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"struct %sbtree *right;  \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"}; \n");

<                 fprintf(schh_fp,"hcg_extern struct %sbtree *%sbtroot,*%sbtelt,*%sbttemp,*%sbtcurr;  \n\n"

<                                 ,tt_curr->TTabbr,tt_curr->TTabbr,tt_curr->TTabbr,tt_curr->TTabbr

<                                 ,tt_curr->TTabbr,tt_curr->TTabbr);

<        }

<        tt_curr=tt_curr->next_ptr;

<      } /* end while tt_cur */

<     fprintf(schh_fp,"hcg_extern char tempbtree[BUFSIZE]; \n");

<     fprintf(schh_fp,"hcg_extern hcg_key btfinish,btresult;\n");

<     fprintf(schh_fp,"void pr_find_bt(); \n\n");

< /*** ---lines end--- ***/

hcg_parse.c

===============

42d41

<              static char rcsid[] = "$Id";

lut.c

===============

43d42

<              static char rcsid[] = "$Id";

lut_h_file.h

===============

make_cptr.c

===============

36d35

<              static char rcsid[] = "$Id";

make_pptr.c

===============

38d37

<              static char rcsid[] = "$Id";

mystrcpy.c

===============

35d34

<              static char rcsid[] = "$Id";

open_files.c

===============

38d37

<              static char rcsid[] = "$Id";

parse_schema.c

===============

119d118

<              static char rcsid[] = "$Id";

read_next.c

===============

36d35

<              static char rcsid[] = "$Id";

rr_insert.c

===============

38d37

<              static char rcsid[] = "$Id";

store_into_matrix.c

===============

35d34

<              static char rcsid[] = "$Id";

strncpy_null.c

===============

37d36

<              static char rcsid[] = "$Id";

validate_schema.c

===============

44d43

<              static char rcsid[] = "$Id";

write_rr_table.c

===============

35d34

<              static char rcsid[] = "$Id";

 

 


Existing CVS Branch (Rassman v10)

 

Version 11 (99s523 Changes)

4074

 

add_pc_cp_entries.c

x

3970

 

add_pc_cp_entries.c

12586

 

btree_c_file.h

x

12430

 

btree_c_file.h

2525

 

change_file_exten.c

x

2410

 

change_file_exten.c

13880

 

chgen.c

XXX

12728

 

chgen.c

3700

 

chgen_define.h

XXX

3515

 

chgen_define.h

14311

 

chgen_externs.h

XXX

13473

 

chgen_externs.h

8174

 

chgen_global_vars.c

XXX

8069

 

chgen_global_vars.c

168

 

chgen_release_date.c

x

70

 

chgen_release_date.c

2063

 

close_files.c

x

1952

 

close_files.c

2471

 

gen_c_files.c

x

2048

 

gen_c_files.c

61124

 

gen_defines.c

xx

53094

 

gen_defines.c

9617

 

gen_load_data.c

x

9488

 

gen_load_data.c

730

 

gen_lut.c

x

619

 

gen_lut.c

6744

 

gen_macros.c

x

6656

 

gen_macros.c

5568

 

gen_path.c

x

5482

 

gen_path.c

48621

 

gen_pr_add.c

XXX

41324

 

gen_pr_add.c

25781

 

gen_pr_delete.c

xx

24655

 

gen_pr_delete.c

12660

 

gen_pr_dump.c

XXX

12434

 

gen_pr_dump.c

5148

 

gen_pr_free.c

x

4675

 

gen_pr_free.c

19721

 

gen_pr_init.c

XXX

17143

 

gen_pr_init.c

9894

 

gen_pr_load.c

XXX

9176

 

gen_pr_load.c

83696

 

gen_pr_log.c

 

 

 

 

6266

 

gen_pr_stats.c

x

6059

 

gen_pr_stats.c

40141

 

gen_pr_utils.c

x

39447

 

gen_pr_utils.c

3569

 

gen_rr_matrix.c

x

3478

 

gen_rr_matrix.c

7987

 

gen_structures.c

xx

6586

 

gen_structures.c

3250

 

hcg_parse.c

x

3136

 

hcg_parse.c

23203

 

lut.c

x

23146

 

lut.c

2373

 

lut.h

x

2263

 

lut.h

13828

 

lut_c_file.h

xx

13679

 

lut_c_file.h

2752

 

lut_h_file.h

x

2563

 

lut_h_file.h

3155

 

make_cptr.c

x

3092

 

make_cptr.c

3236

 

make_pptr.c

x

3149

 

make_pptr.c

 

 

 

A

41860

 

metaschema.h

2509

 

mystrcpy.c

x

2396

 

mystrcpy.c

3596

 

open_files.c

x

3094

 

open_files.c

37129

 

parse_schema.c

XXX

44741

 

parse_schema.c

 

 

 

A

9906

 

pr_delete.c

 

 

 

A

5829

 

pr_dump.c

 

 

 

A

1552

 

pr_free.c

 

 

 

A

76125

 

pr_load.c

 

 

 

A

3860

 

pr_stats.c

4600

 

prototypes.h

 

 

 

 

2374

 

read_next.c

x

2287

 

read_next.c

3309

 

rr_insert.c

x

3112

 

rr_insert.c

2919

 

store_into_matrix.c

x

2824

 

store_into_matrix.c

2109

 

strncpy_null.c

xx

2019

 

strncpy_null.c

6539

 

validate_schema.c

x

6446

 

validate_schema.c

4844

 

write_rr_table.c

x

4752

 

write_rr_table.c

 

 

 


 

*************************************************************

add_pc_cp_entries.c differences:

42d41

<              static char rcsid[] = "$Id: add_pc_cp_entries.c,v 1.3.4.1 1999/05/04 16:58:40 jkarner Exp $";

 

 

*************************************************************

change_file_exten.c differences:

37d36

<              static char rcsid[] = "$Id: change_file_exten.c,v 1.3.4.1 1999/05/04 16:59:34 jkarner Exp $";

 

 

*************************************************************

chgen.c differences vs chgen.c:

83,104d82

< /*****************************************************************************/

< /*    CHGEN V11.0            99s523 - kspinney, jkarner                      */

< /*                                                                           */

< /*                                                                           */

< /* Basic enhancements include the ability to read in a metaschema file in    */

< /* .dat (or .msdat) format.                                                                                                     */

< /*                                                                           */

< /* Revision history:                                                         */

< /*                                                                           */

< /*    4/11/99 - kspinney - initial modifications. These consisted of         */

< /*                         generating pr*.c and metaschema.h files from      */

< /*                         chgenv10 using the schema file metaschema.sch -   */

< /*                         which contains the metadata for the SV/TT/TA/TS/VV*/

< /*                         scructs- and including these files in chgenv11.   */

< /*                         Modifications were made to read input in .dat     */

< /*                         format if the option -datinput is specified       */

< /*                         Also, a <schema>.viewdefs file must accompany     */

< /*                         the <schema>.dat input file, and the -viewname    */

< /*                         <ViewName> command line option must be specified  */

< /*****************************************************************************/

<

< #define MAIN

121d98

<              static char rcsid[] = "$Id: chgen.c,v 1.4.4.2 1999/05/07 01:25:00 jkarner Exp $";

148c125

<      printf("%CHGEN-F-INVARGS, Usage: chgen 'schema-filename'[.sch] [-keysize=n] [-nobp] [-ansi] [-quiet] [-validate] [-noforward] [-maxviews=n] [-noorder] [-gendbschema] [-metafile] [-nosource] [-datinput] [-viewname <viewname>]\n");

---

>      printf("CHGEN-F-INVARGS, Usage: chgen 'schema-filename'[.sch] [-keysize=n] [-nobp] [-ansi] [-quiet] [-validate] [-noforward] [-maxviews=n] [-noorder] [-gendbschema] [-metafile] [-nosource] [-log]\n");

162,163d138

<     cli_datinput    = FALSE;

<     cli_viewname    = FALSE;

277,292d251

<         if (strcmp(argv[j],"-datinput") == 0) {

<             cli_datinput = TRUE;

<             strcpy((char *)strstr(sch_text_file_name,".sch"),".dat");    /* change the .sch extension to .dat */

<             strcpy(sch_viewdef_file_name, sch_text_file_name);    /* the viewdef & sch file have same base */

<             strcpy((char *)strstr(sch_viewdef_file_name,".dat"),".viewdefs");    /* change the .dat extension to .viewdefs */

<         }

<       else

<         if (strcmp(argv[j],"-viewname") == 0) {

<           cli_viewname = TRUE;

<           if (++j >= argc) {

<                                  printf ("CHGEN-F-NOVIEWNAME, command-line qualifier -viewname is not followed by a view name\n");

<                                  exit(EXIT_FAILURE);

<           }

<           strcpy(view_name,argv[j]);

<         }

<       else

312,313c271

<       /*printf("\nCHGEN %s, released %s, Copyright 1991, University of Mass - Lowell\n\n",CHGEN_VERSION,CHGEN_RELEASE_DATE());*/

<       printf("\nCHGEN %s, released Thu May 06 11:00:00 GMT 1999, Copyright 1999, University of Mass - Lowell\n\n", CHGEN_VERSION);

---

>       printf("\nCHGEN %s, released %s, Copyright 1991, University of Mass - Lowell\n\n",CHGEN_VERSION,CHGEN_RELEASE_DATE());

331,335c289

<                              printf ("CHGEN-I-NONDEFAULTQUAL, Using non-default command-line qualifier -metafile\n");

<       if (cli_datinput)

<                              printf ("CHGEN-I-NONDEFAULTQUAL, Using non-default command-line qualifier -datinput\n");

<       if (cli_viewname)

<                              printf ("CHGEN-I-NONDEFAULTQUAL, Using non-default command-line qualifier -viewname with view_name = %s\n",view_name);

---

>              printf ("CHGEN-I-NONDEFAULTQUAL, Using non-default command-line qualifier -datafile\n");

340,355d293

<     if (cli_datinput && cli_gendbschema) {

<              printf ("CHGEN-F-INCOMPATINPUT, command-line qualifiers -datinput and -gendbschema are incompatible\n");

<              exit(EXIT_FAILURE);

<     }

<

<     if (cli_datinput && (hcg_abbr_size == 4)) {

<              printf ("CHGEN-F-INCOMPATINPUT, command-line qualifier -datinput is incompatible with a keysize of 12\n");

<              exit(EXIT_FAILURE);

<     }

<

<     if (cli_datinput && !cli_viewname) {

<              printf ("CHGEN-F-NOCLIVIEWNAME, command line qualifier -viewname <viewname> must be entered if -datinput qualifier is used\n");

<              exit(EXIT_FAILURE);

<     }

<

<

381c319

<     if (cli_datafile && !cli_datinput)                /* if cli_datinput, then the .msdat file was pr_dumped */

---

>     if (cli_datafile)

 

 

*************************************************************

chgen_global_vars.c differences:

98,100c98

<                          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 */

---

>                                datafile[SCHEMA_HEADER_FILE_NAME_LENGTH]; /* Filename for output metaschema.dat file */

125,128c123,125

<                          cli_log,

<                          cli_datinput,

<                          cli_viewname;

< static char rcsId[] = "$Id";

---

>                          cli_log;

>

>

 

 

*************************************************************

chgen_release_date.c differences:

1,2c1,2

< char * CHGEN_RELEASE_DATE() {return "Thurs May  6 22:00:00 EDT 1999";}

< static char rcsid[] = "$Id: chgen_release_date.c,v 1.1.1.1.2.3 1999/05/07 01:25:19 jkarner Exp $";

---

> char * CHGEN_RELEASE_DATE() {return "Thu Jun 6 22:00:00 GMT 1996";}

>

 

 

*************************************************************

close_files.c differences:

32d31

<              static char rcsid[] = "$Id: close_files.c,v 1.3.4.1 1999/05/04 16:59:39 jkarner Exp $";

 

 

*************************************************************

gen_c_files.c differences:

38d37

<              static char rcsid[] = "$Id: gen_c_files.c,v 1.3.4.1 1999/05/04 16:59:40 jkarner Exp $";

 

 

*************************************************************

gen_defines.c differences:

23,30d22

< /*                         Mar 4 1997: Fixed var_last_child bug: - RJL                  */

< /*                          Mar21 1997: Changed encode prototype as in genv10 - RJL      */

< /*               May14 1997 Merged v9 and v10 - AS                            */

< /*               Apr24 1999 Added #include <assert.h> - JSK                   */

< /*               Apr26 1999 Hand merged ctwang updates of pr_set_key, pr_set_ */

< /*                          flt, pr_set_int, and pr_set_str, - clearly        */

< /*                          delineated by wang's BEGIN and END markers.       */

< /*                                                                            */

59d50

<              static char rcsid[] = "$Id: gen_defines.c,v 1.7.4.3 1999/05/07 01:25:07 jkarner Exp $";

82d72

<     fprintf(schh_fp, "#include <assert.h>\n\n") ; /* 99s523 gen log merge */

94c84

<     fprintf(schh_fp, "#define CHGEN_RELEASE_DATE \"%s\"\n",CHGEN_RELEASE_DATE);

---

>     fprintf(schh_fp, "#define CHGEN_RELEASE_DATE \"%s\"\n",CHGEN_RELEASE_DATE());

146c136

< /*    fprintf(schh_fp, "#ifdef MAIN\n") ; */

---

>     fprintf(schh_fp, "#ifdef MAIN\n") ;

148,155c138

< /* I moved '#ifdef MAIN' below pr_add's definition  -  RJL 96/8/31 *

<  * pr_add generates 'implicit function decl and undefined' errors without it *

<  * (also done by Mark Aldred for gen/ver_10/chgen/src/gen_defines.c - RJL)

<  *

<  * 97/05/13 AS: V10 did not have main commented out. Commented by GENMERGE

< */

<     /* 93su523 PGEN merge (BEGIN) (deleted 99s523 chgenbootstrap) */

<     /*if (cli_ansi)

---

>     if (cli_ansi)

159d141

<     */

161,162d142

<

<     fprintf(schh_fp, "#ifdef MAIN\n") ; /* moved here by RJL 96/8/31 */

169c149

<     /*fprintf(schh_fp, "#define pr_add(view,tbl_abbr,tbl_ptr)  gen_pr_add(view, #tbl_abbr,  tbl_ptr)\n");*/

---

>     fprintf(schh_fp, "#define pr_add(view,tbl_abbr,tbl_ptr)  gen_pr_add(view, #tbl_abbr,  tbl_ptr)\n");

213,217d192

<

<

<

<

<

365d339

<

702c676,677

< } ",sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep

---

> }

> ",sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep,sep

892c867

<     fprintf(schh_fp,"#define var_last_child(tbl,parent,child,ckey) ((struct tbl *) child->ckey%s_fpp == parent)\n\n\n",sep); /* Replaced != by ==  RJL97/3/4 */

---

>     fprintf(schh_fp,"#define var_last_child(tbl,parent,child,ckey) ((struct tbl *) child->ckey%s_fpp != parent)\n\n\n",sep);

907d881

<    /*  extern int encode(hcg_key *, char *); */\n\

909d882

<     extern pr_find_bt(char *, hcg_key *);

910a884

>     extern pr_find_bt(char *, hcg_key *);

923c897

<     extern void pr_add(char *, char *, hcg_ptr);\n\

---

>     extern void     gen_pr_add(char *, char    *, hcg_ptr);\n\

 

 

*************************************************************

gen_load_data.c differences:

18c18

< /* revisions   : 99/4/24 99s523 gen merge - Added rcs lines - JK/KS           */

---

> /* revisions   :                                                              */

36d35

<              static char rcsid[] = "$Id: gen_load_data.c,v 1.2.4.1 1999/05/04 16:59:44 jkarner Exp $";

48d46

<     static char rcsid[] = \"$Id\";\n\

 

 

*************************************************************

gen_lut.c differences:

1d0

< #include <stdio.h>

4d2

<

12d9

<              static char rcsid[] = "$Id: gen_lut.c,v 1.2.4.1 1999/05/04 16:59:46 jkarner Exp $";

 

 

*************************************************************

gen_macros.c differences:

35d34

<              static char rcsid[] = "$Id: gen_macros.c,v 1.2.4.1 1999/05/04 16:59:47 jkarner Exp $";

 

 

*************************************************************

gen_path.c differences:

61d60

<              static char rcsid[] = "$Id: gen_path.c,v 1.2.4.1 1999/05/04 16:59:49 jkarner Exp $";

 

 

*************************************************************

gen_pr_add.c differences:

21,22d20

< /*             : included #include <assert.h> and added assert macro          */

< /*             : to link_child_1 macro -RJL 94/12/6                           */

40d37

< #include <assert.h>

43,45d39

< /*

< // GENMERGE: structure definition of rr_data moved tp chgen_externs.h by GENLOG

< */

52d45

<              static char rcsid[] = "$Id: gen_pr_add.c,v 1.4.4.2 1999/05/07 01:25:08 jkarner Exp $";

77c70

< void pr_add (viewname, tbl_abbrv, tbl_ptr)\n\

---

> void gen_pr_add              (viewname, tbl_abbrv, tbl_ptr)\n\

124,128d116

< /* GENMERGE: AS: Noticed that genlog project replaced "exit(1)" statement

< //               with a "return" statement below. No explanation given

< //               for this change. This could be a bug, since origianl

< //               GEN v10 code uses "exit" for errors and "return" for warnings"

< */

144,148d131

< /* GENMERGE: AS: Noticed that genlog project replaced "exit(2)" statement

< //               with a "return" statement below. No explanation given

< //               for this change. This could be a bug, since origianl

< //               GEN v10 code uses "exit" for errors and "return" for warnings"

< */

350,351d332

<     fprintf(prload_fp,"/* The assert macro aborts if more than one child is linked in - RJL 94/12/6  */\n");

<     fprintf(prload_fp,"/* assert (loosely) allows NULL or self-pointer in the current parent         */\n");

354d334

<     fprintf(prload_fp, "assert(pa%scurr->c%s_fcp == NULL || pa%scurr->c%s_fcp == pa%scurr);\\\n",sep,sep,sep,sep,sep);

947d926

<

 

 

*************************************************************

gen_pr_delete.c differences:

23d22

< /*               99s523: Placed rcsId lines in                                */

43d41

<              static char rcsid[] = "$Id: gen_pr_delete.c,v 1.5.4.1 1999/05/04 16:59:52 jkarner Exp $";

66,67d63

<              fprintf(prdel_fp," static char rcsid[] = \"$Id\";\n");

<

352c348

<     fprintf(prdel_fp, "ca%stemp = (struct ca *) pa%scurr->c%s_fcp; \\\n",sep,sep,sep);

---

>     fprintf(prdel_fp, "ca%stemp = pa%scurr->c%s_fcp; \\\n",sep,sep,sep);

364c360

<     fprintf(prdel_fp, "ca%stemp = (struct ca *) pa%scurr->c%s_fcp; \\\n",sep,sep,sep);

---

>     fprintf(prdel_fp, "ca%stemp = pa%scurr->c%s_fcp; \\\n",sep,sep,sep);

380c376

<     fprintf(prdel_fp, "ca%stemp = (struct ca *) pa%scurr->c%s_fcp; \\\n",sep,sep,sep);

---

>     fprintf(prdel_fp, "ca%stemp = pa%scurr->c%s_fcp; \\\n",sep,sep,sep);

 

 

*************************************************************

gen_pr_dump.c differences:

20d19

< /*                99s523: added rcsid lines                                   */

39d37

<              static char rcsid[] = "$Id: gen_pr_dump.c,v 1.3.4.1 1999/05/04 16:59:53 jkarner Exp $";

50c48

<         fprintf(prdump_fp,"#include \"%s\"\n\n",sch_header_file_name) ;

---

>         fprintf(prdump_fp,"#include \"%s\"\n",sch_header_file_name) ;

68,69d65

<              fprintf(prdump_fp,"static char rcsid[] = \"$Id\";\n");

<

90c86

<         fprintf(prdump_fp,"char outkey[%d][HCG_KEY_SIZE+1];\n\n", max);

---

>         fprintf(prdump_fp,"char outkey[%d][HCG_KEY_SIZE+1];\n", max);

108c104

<         fprintf(prdump_fp,"\t\tprintf(\"Error: pr_dump() cannot open %%s using file mode %%s\\n\", file_name,modestr);\n");

---

>         fprintf(prdump_fp,"\t\tprintf(\"Error: pr_dump_row() cannot open %%s using file mode %%s\\n\", file_name,modestr);\n");

229c225,226

<                         fprintf(prdump_fp," %%-%ds", atoi(ta_curr->FieldType+1) );  /* 93su523 PGEN merge */

---

>                         fprintf(prdump_fp," %%-%ds", atoi(ta_curr->FieldType+1) )\

> ;  /* 93su523 PGEN merge */

 

 

*************************************************************

gen_pr_free.c differences:

19d18

< /*               99s523 - added rcsid lines - JK/KS                           */

35d33

<              static char rcsid[] = "$Id: gen_pr_free.c,v 1.3.4.1 1999/05/04 16:59:55 jkarner Exp $";

54,55d51

<

<              fprintf(prfree_fp,"static char rcsid[] = \"$Id: gen_pr_free.c,v 1.3.4.1 1999/05/04 16:59:55 jkarner Exp $\";\n");

 

 

*************************************************************

gen_pr_init.c differences:

46,47d45

< void gen_btree_initialized();                           /* forward declaration  - genMerge 99s523   */

<

50d47

<              static char rcsid[] = "$Id: gen_pr_init.c,v 1.4.4.2 1999/05/07 01:25:13 jkarner Exp $";

65d61

<         fprintf(prload_fp,"static char rcsid[] = \"$Id: gen_pr_init.c,v 1.4.4.2 1999/05/07 01:25:13 jkarner Exp $\";\n");

90,94c86

< /*** 95s523, chwang, 5,14,95 . For pr_dump_row() 's initialization.***/

< /*** ---line begin--- ***/

<         fprintf(prload_fp,"     open_file=1; \n");

< /*** ---line end--- ***/

<

---

>         fprintf(prload_fp,"     open_file=1; \n"); /* 95s523, chwang, 5,14,95 . For pr_dump_row() 's initialization. */

134c126

<              fprintf(prload_fp,"        }\n");

---

>              fprintf(prload_fp,"        }\n\n");

147c139

<              fprintf(prload_fp,"     {\n");

---

>              fprintf(prload_fp,"     {\n\n");

324,325c316

<              fprintf(prload_fp,"               hcg_initialized = 1;\n\n");

<              fprintf(prload_fp,"}\n\n");

---

>              fprintf(prload_fp,"     hcg_initialized = 1;\n");

326a318

>              fprintf(prload_fp,"}\n\n");

331d322

<

 

 

*************************************************************

gen_pr_load.c differences:

40,42d39

<              void gen_pr_find_bt();                       /* forward declaration - genMerge 99s523  */

<              void gen_pr_clear_bt();                      /* forward declaration - genMerge 99s523  */

<

45d41

<              static char rcsid[] = "$Id: gen_pr_load.c,v 1.4.4.2 1999/05/07 01:25:14 jkarner Exp $";

56,57c52

<              fprintf(prload_fp, "{\n");

<         fprintf(prload_fp,"static char rcsid[] = \"$Id: gen_pr_load.c,v 1.4.4.2 1999/05/07 01:25:14 jkarner Exp $\";\n");

---

>              fprintf(prload_fp, "{\n\n");

 

 

*************************************************************

gen_pr_stats.c differences:

10d9

<              static char rcsid[] = "$Id: gen_pr_stats.c,v 1.2.4.1 1999/05/04 17:00:01 jkarner Exp $";

30d28

<              fprintf(prstats_fp,"static char rcsid[] = \"$Id: gen_pr_stats.c,v 1.2.4.1 1999/05/04 17:00:01 jkarner Exp $\";\n");

 

 

*************************************************************

gen_pr_utils.c differences:

39d38

<              static char rcsid[] = "$Id: gen_pr_utils.c,v 1.3.4.2 1999/05/07 01:25:16 jkarner Exp $";

52d50

<         fprintf(prload_fp, "#include <strings.h>\n") ;

71d68

<         fprintf(prload_fp,"static char rcsid[] = \"$Id: gen_pr_utils.c,v 1.3.4.2 1999/05/07 01:25:16 jkarner Exp $\";\n");

 

 

*************************************************************

gen_rr_matrix.c differences:

33d32

<              static char rcsid[] = "$Id: gen_rr_matrix.c,v 1.2.4.1 1999/05/04 17:00:04 jkarner Exp $";

 

 

*************************************************************

gen_structures.c differences:

20d19

< /*               99s523: added rcsId lines, merged in 97 wang updates. JK-KS  */

44d42

<              static char rcsid[] = "$Id: gen_structures.c,v 1.4.4.2 1999/05/04 17:00:06 jkarner Exp $";

107c105

<        fprintf(schh_fp,"int    RFLAG; /* for pr_utility macro log */\n"); /* From ctwang log changes */

---

>        fprintf(schh_fp,"int    RFLAG; /* for pr_utility macro log */\n");

127,165d124

< /*** 95s523,chwang,5,11,95. Add btree structures and other relative btree arguments.  ***/

< /*** ---lines begin--- ***/

<     fprintf(schh_fp,"\n\n/******************************************************************************/\n");

<     fprintf(schh_fp,"/* The following define the btree structures and relative variables for each  */\n");

<     fprintf(schh_fp,"/* table which defines btree search in schema file.                           */\n");

<     fprintf(schh_fp,"/******************************************************************************/\n\n");

<     fprintf(schh_fp,"\n#define BTREESEARCH 1 \n");

<     fprintf(schh_fp,"#define SEQUENCESEARCH 0 \n");

<     fprintf(schh_fp,"#define LEFT 2 \n");

<     fprintf(schh_fp,"#define RIGHT 3 \n\n");

<

<     tt_curr = tt;

<     while (tt_curr != NULL)

<      {

<        fprintf(schh_fp,"int %sbtidx; \n",tt_curr->TTabbr);

<        if (tt_curr->comment[0] != '\0')

<        if (tt_curr->comment[2] == '1')

<        {

<                 fprintf(schh_fp,"/******************************************************************************/\n");

<                 fprintf(schh_fp,"/* Table %s btree structure : %sbtree                                         */\n",tt_curr->TTabbr,tt_curr->TTabbr);

<                 fprintf(schh_fp,"/******************************************************************************/\n");

<                 fprintf(schh_fp,"struct %sbtree \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"{   \n");

<                 fprintf(schh_fp,"hcg_key key;   /* primary key */  \n");

<                 fprintf(schh_fp,"struct %s *ptr; \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"struct %sbtree *parent;  \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"struct %sbtree *left;   \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"struct %sbtree *right;  \n",tt_curr->TTabbr);

<                 fprintf(schh_fp,"}; \n");

<                 fprintf(schh_fp,"hcg_extern struct %sbtree *%sbtroot,*%sbtelt,*%sbttemp,*%sbtcurr;  \n\n"

<                                 ,tt_curr->TTabbr,tt_curr->TTabbr,tt_curr->TTabbr,tt_curr->TTabbr

<                                 ,tt_curr->TTabbr,tt_curr->TTabbr);

<        }

<        tt_curr=tt_curr->next_ptr;

<      } /* end while tt_cur */

<     fprintf(schh_fp,"hcg_extern char tempbtree[BUFSIZE]; \n");

<     fprintf(schh_fp,"hcg_extern hcg_key btfinish,btresult;\n");

<     fprintf(schh_fp,"void pr_find_bt(); \n\n");

< /*** ---lines end--- ***/

 

 

*************************************************************

hcg_parse.c differences:

42d41

<              static char rcsid[] = "$Id: hcg_parse.c,v 1.3.4.1 1999/05/04 17:00:07 jkarner Exp $";

 

 

*************************************************************

lut.c differences:

43d42

<              static char rcsid[] = "$Id: lut.c,v 1.2.2.1 1999/05/04 17:00:09 jkarner Exp $";

 

 

*************************************************************

make_cptr.c differences:

36d35

<              static char rcsid[] = "$Id: make_cptr.c,v 1.3.4.1 1999/05/04 17:00:10 jkarner Exp $";

 

 

*************************************************************

make_pptr.c differences:

38d37

<              static char rcsid[] = "$Id: make_pptr.c,v 1.2.4.1 1999/05/04 17:00:12 jkarner Exp $";

 

 

*************************************************************

mystrcpy.c differences:

35d34

<              static char rcsid[] = "$Id: mystrcpy.c,v 1.3.4.1 1999/05/04 17:00:14 jkarner Exp $";

 

 

*************************************************************

open_files.c differences:

38d37

<              static char rcsid[] = "$Id: open_files.c,v 1.3.4.1 1999/05/04 17:00:16 jkarner Exp $";

 

 

*************************************************************

parse_schema.c differences:

58,60d57

< /*    5/06/99 - kspinney Added TT_to_tt(), mystrcpy2(), dump_tt_ta_data(),   */

< /*              jkarner and dump_tt_ta_data() to support the parsing of an   */

< /*                      input schema in .dat (.msdat) format                 */

120,127d116

< void parse_schema_chgen();             /* forward declaration - genMerge 99s523  */

< void parse_schema_gendb();             /* forward declaration - genMerge 99s523  */

< void find_parent (char* tbuffer);      /* forward declaration - genMerge 99s523  */

< void TT_to_tt();                       /* forward declaration - genMerge 99s523  */

< void parse_schema_dat();               /* forward declaration - genMerge 99s523  */

< void dump_tt_ta_data();                /* forward declaration - genMerge 99s523  */

< void mystrcpy2(char *s,char *t,int n); /* forward declaration - genMerge 99s523  */

<

130,133c119

<              static char rcsid[] = "$Id: parse_schema.c,v 1.4.4.2 1999/05/07 01:25:18 jkarner Exp $";

<   if (cli_gendbschema)

<     parse_schema_gendb();

<   else if (!cli_datinput)

---

>   if (!cli_gendbschema)

136c122

<     parse_schema_dat();

---

>     parse_schema_gendb();

1073,1074d1058

<       else if (tatemp->IsKey && !tatemp->HasBp)

<         fprintf (fp, "-1");

1088,1264d1071

< }

<

<

< void parse_schema_dat()

< {

<     pr_init(sch_viewdef_file_name,sch_text_file_name);

<     pr_load(view_name, sch_text_file_name);

<     if (cli_datafile)

<       pr_dump(view_name, datafile, 0, "w");

<     TT_to_tt();

< }

<

< void TT_to_tt()

< {

<     int parse_state;

<     char is_key[10];

<     int i;

<     char parent[NAMELENGTH];

<     char child[NAMELENGTH];

<

<     tt          = NULL;

<     tt_curr     = NULL;

<     tab_seq_no  = 0 ;

<     num_tables  = 0;

<     strcpy(tab_name,"<none>");

<     strcpy(tab_abbr,"<none>");

<     strcpy(field_name,"<none>");

<     strcpy(is_key,"0");

<     comment[0] = '\0';

<

<     lut_init(&hcg_table_abbrev_lut,ABBR_TBL_TYPE);

<                                                                                                                                                             

<     for ( TTcurr = TT; TTcurr; TTcurr = TTcurr->next_ptr)

<     {

<         /******************************************/

<         /* Starting a new table, so add a node to */

<         /* the tt list.                           */

<         /******************************************/

<         tt_tmp = (struct tt_type*) malloc (sizeof (struct tt_type));

<         mystrcpy2(tt_tmp->TTabbr,TTcurr->ttabb,HCG_ABBR_SIZE);

<         mystrcpy2(tt_tmp->TableName,TTcurr->ttname,NAMELENGTH);

<         mystrcpy(tt_tmp->comment,TTcurr->descr,MAXCOMMENTLENGTH,1);

<         tt_tmp->next_ptr = NULL;

<         tt_tmp->ta_ptr   = NULL;

<

<         num_tables++;

<

<         if (tt == NULL)

<          {

<           tt = tt_tmp;

<           tt_curr = tt_tmp;

<          }

<         else

<          {

<           tt_curr->next_ptr = tt_tmp;

<           tt_curr = tt_curr->next_ptr;

<          }

<

<

<         for (TAcurr = TTcurr->TAid_fcp; TAcurr; TAcurr = TAcurr->next_ptr)

<         {

<             if (TAcurr->TTid_pp != TTcurr)        /* this handles all but the last TT         */

<                 continue;                                            /* (the for loop terminates at the last TT) */

<

<             if (tt_curr->ta_ptr == NULL)

<             {

<                 /* first field, must be key and first 2 abbrev==tab_abbrev */

<                 /* get the hash_value for the table abbreviation    */

<                 /* and put corresponding tab_seq_no into field_list    */

<

<                 TXindex = encoding(tt_curr->TTabbr);

<

<                 /* fill up TINDEX */

<                 TINDEX[TXindex].TXindex = TXindex ;

<                 TINDEX[TXindex].TTindex = tab_seq_no;

<                 mystrcpy2(TINDEX[TXindex].TTabbr, TTcurr->ttabb,HCG_ABBR_SIZE);

<             }

<             else if (TAcurr->iskey[0] != '0')

<             {

<                 /* must be a foreign key */

<                              mystrcpy2 (parent, TAcurr->fname, NAMELENGTH);

<                              mystrcpy2 (child , TTcurr->TAid_fcp->fname, NAMELENGTH);

<                 add_pc_cp_entries( parent, child, TAcurr->iskey);

<             }

<

<             /***********************************************/

<             /* Add this field name to the ta list.         */

<             /***********************************************/

<             ta_tmp = (struct ta_type*) malloc (sizeof (struct ta_type));

<             mystrcpy2(ta_tmp->FieldName,TAcurr->fname,NAMELENGTH);

<             mystrcpy2(ta_tmp->AltFieldName, TAcurr->dfltVal,NAMELENGTH);

<             mystrcpy2(ta_tmp->FieldType, TAcurr->ftype,NAMELENGTH);

<             mystrcpy(ta_tmp->comment,TAcurr->comment,MAXCOMMENTLENGTH,1);

<

<             ta_tmp->IsKey      = (TAcurr->iskey[0] != '0');

<             ta_tmp->HasBp      = (TAcurr->iskey[0] == '1') || (TAcurr->iskey[0] == 's');

<             ta_tmp->Singleton  = (TAcurr->iskey[0] == 's');

<

<             ta_tmp->next_ptr = NULL;

<

<             if (tt_curr->ta_ptr == NULL)

<             {

<               tt_curr->ta_ptr = ta_tmp;

<               ta_curr = ta_tmp;

<             }

<             else

<             {

<               ta_curr->next_ptr = ta_tmp;

<               ta_curr = ta_curr->next_ptr;

<             }

<

<         }    /* for TA */

<

<          tab_seq_no++;

<

<     }    /* for TT */

<

< }    /* end func */

<

< /* void dump_tt_ta_data()

<  *

<  * This function dumps out the tt/ta struct contents

<  *

<  * Preconditions: a global pointer to a valid tt_type structure (or a NULL pointer)

<  *                tt->next ptr is NULL for the last table type

<  *                ta->next_ptr is NULL for the last attribute of each table type

<  *

<  * PostConditions: contents of tt/ta structs are printed to stdout

<  */

<

<

< void dump_tt_ta_data()

< {

<     for ( tt_tmp = tt; tt_tmp; tt_tmp = tt_tmp->next_ptr)

<     {

<         printf ("tt_tmp->TTabbr   : %s\n",  tt_tmp->TTabbr);

<         printf ("tt_tmp->TableName: %s\n",  tt_tmp->TableName);

<         printf ("tt_tmp->comment  : %s\n",  tt_tmp->comment);

<         printf ("tt_tmp->next_ptr : %ld\n", tt_tmp->next_ptr);

<         printf ("tt_tmp->ta_ptr   : %ld\n", tt_tmp->ta_ptr);

<

<         for (ta_tmp = tt_tmp->ta_ptr; ta_tmp; ta_tmp = ta_tmp->next_ptr)

<         {

<             printf ("\n************** ta_tmp->FieldName       = %s\n",ta_tmp->FieldName);

<             printf (  "               ta_tmp                  = %ld\n", ta_tmp);

<             printf (  "               ta_tmp->AltFieldName    = %s\n",ta_tmp->AltFieldName);

<             printf (  "               ta_tmp->FieldType       = %s\n",ta_tmp->FieldType);

<             printf (  "               ta_tmp->comment         = %s\n",ta_tmp->comment  );

<             printf (  "               ta_tmp->IsKey           = %d\n",ta_tmp->IsKey);

<             printf (  "               ta_tmp->HasBp           = %d\n",ta_tmp->HasBp);

<             printf (  "               ta_tmp->Singleton       = %d\n",ta_tmp->Singleton);

<             printf (  "               ta_tmp->next_ptr        = %ld\n",ta_tmp->next_ptr);

<

<

<         }    /* for TA */

<

<     }    /* for TT */

<

< }    /* end func */

<

<

< void mystrcpy2(s,t,n)

< char *s, *t;

< int n;

< {

<              int i;

<              strncpy(s,t,n);

<              for (i = 0; i < n; i++)

<              {

<                              /* search for space or tab and replace with an EOL */

<                              if ( (s[i] == ' ') || (s[i] == 9) )

<                              {

<                                              s[i] = '\0';

<                                              return;

<                              }

<              }

<              s[n] = '\0';

 

 

*************************************************************

read_next.c differences:

36d35

<              static char rcsid[] = "$Id: read_next.c,v 1.2.4.1 1999/05/04 17:00:19 jkarner Exp $";

 

 

*************************************************************

rr_insert.c differences:

38d37

<              static char rcsid[] = "$Id: rr_insert.c,v 1.3.4.1 1999/05/04 17:00:20 jkarner Exp $";

 

 

*************************************************************

store_into_matrix.c differences:

35d34

<              static char rcsid[] = "$Id: store_into_matrix.c,v 1.2.4.1 1999/05/04 17:00:22 jkarner Exp $";

 

 

*************************************************************

strncpy_null.c differences:

37d36

<              static char rcsid[] = "$Id: strncpy_null.c,v 1.2.4.1 1999/05/04 17:00:23 jkarner Exp $";

 

 

*************************************************************

validate_schema.c differences:

44d43

<              static char rcsid[] = "$Id: validate_schema.c,v 1.2.4.1 1999/05/04 17:00:25 jkarner Exp $";

 

 

*************************************************************

write_rr_table.c differences:

35d34

<              static char rcsid[] = "$Id: write_rr_table.c,v 1.2.4.1 1999/05/04 17:00:26 jkarner Exp $";

 

 

*************************************************************

btree_c_file.h differences:

4,6d3

< /* rcs revision information */

< /* $Id: btree_c_file.h,v 1.2.4.1 1999/05/04 17:00:28 jkarner Exp $ */

<

 

 

*************************************************************

chgen_define.h differences:

5,7d4

< /* rcs revision information */

< /* $Id: chgen_define.h,v 1.4.4.3 1999/05/07 01:25:04 jkarner Exp $ */

<

23,24c20

< /* revisions   : 99s523 - Added rcs revision line - JK-KS                     */

< /*               5/93,  93s523                                                                                          */

---

> /* revisions   :  5/93,         93s523                                                                                          */

37,40d32

<

< /**** genMerge 99s523 5/3/99 ****/

< #include "metaschema.h"

<

42c34

< /*#define            CHGEN_VERSION "genMerge chgenv11-karner/spinney"*/

---

> #define               CHGEN_VERSION "v10log"

44c36

< /* extern char * CHGEN_RELEASE_DATE();  - removed genMerge 99s523 */

---

> extern char * CHGEN_RELEASE_DATE();

58c50

< /*#define            MAXVIEWNAMELEN       NAMELENGTH  removed 99s523 genMerge *//* max size          of a view-name string                                */

---

> #define               MAXVIEWNAMELEN       NAMELENGTH  /* max size              of a view-name string                          */

80a73

>

 

 

*************************************************************

chgen_externs.h differences:

5,7d4

< /* rcs revision information */

< /* $Id: chgen_externs.h,v 1.3.4.2 1999/05/07 01:25:02 jkarner Exp $ */

<

23,24c20

< /* revisions   :  99s523 added rcs revision line                              */

< /*               93s523: added: include key.h, lut.h header files,           */

---

> /* revisions   :  93s523: added: include key.h, lut.h header files,           */

36c32

< #include <strings.h>

---

> #include "lut.h"

39,43d34

< /*#include "lut.h" - removed genMerge 99s523 */

<

< /**** 99s523 5/3/99 genMerge ****/

< #include "metaschema.h"

<

226,228c217

<                                datafile[SCHEMA_HEADER_FILE_NAME_LENGTH], /* Filename for output metaschema.dat file */

<                                sch_viewdef_file_name[SCHEMA_HEADER_FILE_NAME_LENGTH], /* viewdef file name -genMerge 99s523 */

<                                view_name[NAMELENGTH];            /* view name when reading from .dat file -genMerge 99s523 */

---

>                                datafile[SCHEMA_HEADER_FILE_NAME_LENGTH]; /* Filename for output metaschema.dat file */

255,257c244

<                                                     cli_log,       /* Added by Genlog 5/6/96 */

<                                cli_datinput,  /* Added by genMerge 99s523 */

<                                cli_viewname;  /* Added by genMerge 99s523 */

---

>                                                     cli_log;       /* Added by Genlog 5/6/96 */

 

 

*************************************************************

lut.h differences:

4,5d3

< /* rcs revision information */

< /* $Id: lut.h,v 1.2.2.1 1999/05/04 17:00:33 jkarner Exp $ */

 

 

*************************************************************

lut_c_file.h differences:

5,7d4

< /* rcs revision information */

< /* $Id: lut_c_file.h,v 1.2.4.1 1999/05/04 17:00:34 jkarner Exp $ */

<

 

 

*************************************************************

lut_h_file.h differences:

4,6d3

< /* rcs revision information */

< /* $Id: lut_h_file.h,v 1.2.4.1 1999/05/04 17:00:38 jkarner Exp $ */

<


 

2.3.  CHGEN CVS Repository Guide

 

The Genmerge portion of our task exposed us to several situations that we thought warranted their own section of the project report.

 

Rtags versus Branch Tags

Rtags are labels that associate a number of files together. This makes setting up a new version or update straightforward.  It also makes retrieving past versions of code very easy. There are two very different types of rtags, and their difference is very important (particularly the way we use them). One is called a “sticky” tag, and the other is called a revision or “branch” tag.

 

The source of this difference and why it is important is that any file checked in to the repository must be “up-to-date”. You can check to see if a file is “up-to-date” by performing a “cvs status <directory/filename>. This is the method CVS uses to ensure correct revisioning.  Files which have a sticky tag associated with them cannot be checked directly back into the repository. This is important to know if you are going to make changes to a file and then hope to check it back in. Branch tags, however, identify revisions of files that have been branched off the mainline, much like our genlog-branch as it appears in Figure 2.1. It is possible to checkin on a branch tag, since the tag points to the “head” node, or latest revision, of the branch.

 

If a file does not have a sticky tag associated with it, it must still go through a merge process during commit to satisfy CVS, but it does have the potential to go back into the repository, whereas a file with a sticky tag on it does not. Our suggestion is that if you have made a lot of changes to a version of a file that you checked out with a sticky tag and you hope to merge that file back into the repository, copy it to another directory not under CVS control. Then release the version that was checked out with the sticky tag via:

 

cvs release –d directory (i.e. chgen)

 

Next, check out the latest revision of the file (from the mainline or the branch). If you were to do it from a branch it would look like:

 

cvs co –r branch-tag (i.e. genlog-branch) chgen/file

 

Then hand merge the changes from the file you copied to the directory not under CVS control and then commit the file. For a commit to a branch, this would look like:

 

cvs ci –r branch-tag (i.e. genlog-branch) –m “Checkin comments” chgen/file

 

There is a method for checking out an rtagged version of individual files without the sticky tag attached. This is done via the cvs update command:

 

cvs update –p –r tag file > file

 

The –p option sends the contents to standard output (which is hard to set a tag on). The > redirects the standard output to the filename you specify. Per Cederqvist discusses it on pg. 35 of the Version Management guide cited in Section 2.

 

Merging Issues (Hand merge vs. automatic)

CVS offers a facility to resolve merge differences between the head version in the repository and your working copy of  file(s). When you attempt to checkin a file to CVS with a command like:

 

cvs commit –m “Comments” <path/file>

 

CVS will cancel the checkin if the file is not up-to-date. If you would like to have CVS point out the merge conflicts, use the cvs update <file>. If there are merge conflicts, CVS will launch a differences type tool which will indicate the difference and ask you which version is correct. We found this tool to be a little harsh in the readibility of the subsequently written update file. We would suggest that users address merge issues by hand before checkins. This means directly editing in the changes you want to make to an up-to-date revision copy before the checkin. An exception to this rule is if there is a great deal of familiarity with the changes, and you know precisely what you are doing, you should be fine with this tool and it is a lot faster.

 

 

Updating rtags

Another situation which we found ourselves in was having to update an rtag on a file after we already rtagged a group of files. An example of this would be forgetting to update the aareadme file (which happened a few times!). You don’t want a revision to have an aareadme that doesn’t reflect the changes to that version, so you have to update it. Remember, once you rtag a file, you cannot edit it directly and check it back in, so this is only really effective when you remember your omission before subsequent checkins.  To accomplish this, check out the head version (remember head versions can be on a branch or the mainline).

 

Mainline example:

 

cvs checkout <path/file>

 

Now, do your editing. When you are done:

 

cvs commit <path/file>

 

cvs rtag –F rtag <path/file>

 

Branch example:

 

cvs checkout –r <branch-tag> <path/file>

 

Now, do your editing. When you are done:

 

cvs commit –r <branch-tag> <path/file>

 

cvs rtag –F –r <branch-tag> rtag <path/file>

 

 

Other CVS Commands You Will Use All the Time

 

cvs status <path/file>  - (file must previously have been checked out) Returns information on the version of the file you have checked out, lets you know if you have modified it, informs you of any sticky tags or branch tags associated with the file.

 

cvs status –v <path/file> - (file must previously have been checked out) Returns all tags which are associated with the file. This is a good command to look at a history of revisions.

 

cvs release –d <path> - (file must previously have been checked out) Note that this can only be done with a directory. This is a cleanup mechanism and is suggested rather than rm because it keeps the cvs history straight with regards to what you have checked out.

 

cvs history –aT – gives you a complete history of the rtags in the repository. This works particularly well with grep to get the exact version tag you want to check out: i.e. cvs history –aT | grep v11 (gives you status of all v11 tags).

 

cvs add <path/file> - This adds entries for new files into the repository. It is necessary to actually check in the file before it gets into the repository (and the checkin can be done to a mainline or a branch). 

 

Another excellent qualifier that cvs has is –n qualifier which goes between cvs and the command you are issuing. This instructs cvs to simulate the command without actually saving any of the results, so it’s a good way of seeing how cvs will interpret your instructions when you are unsure.

2.4.  Test Cases

 

This section is to review the status of the test cases that were used to help verify the genv11 update. Section 4 discusses the verification of the cases used to test v11 specific functionality. This section discusses the status of the three applications that were working after the Rassman version update, how to run them, and how the results compared to the Rassman version.

 

 In order to run gen_v11, first check it out of the chgen repository in the following manner:

 

·              From a directory in your file area enter the command :  cvs co –r genv11 chgen

 

·              Move to the chgen/src subdirectory. Run the makefile, i.e. just type the command “make” from that directory.

 

This will place a file named chgen11 in the chgen/executables directory. You are now ready to proceed to the test cases.

2.4.1.     Schooldb8

2.4.1.1.    Overview

                The Schooldb8 test case is a version of the schooldb case. We refer the reader to the 96s523 writeup which can be found at $CASE/gen/ver_10log/doc/GenlogFinalRep.[ps,txt], Reference 3. This was updated by the 97f522 work by Wang. This write up is in the chgen repository under docs/project_report_97f522.txt, Reference 6.

 

                To run this test case,

a.        change directory to the chgen/test/schooldb8 directory from where chgen is rooted.

b.       At this point, run make clean.

c.        Type ../../executables/chgen11 –ansi –log schooldb      (This builds the .h and pr-*.c routines).

d.       Type make      (This makes the schooldb executable)

e.        Type schooldb (This runs the schooldb executable)

 

2.4.1.2.    Test Case Results

                The differences in the source files from the genlog version to the wang version are Shown in Figure 2.9.  When we originally attempted to run this, we received an unresolved for token assert. This was due to the fact that an assert statement was added to the build of pr_load.c, but the header file was not included. Once this was resolved, the sources compiled and linked fine. When we tried to run, however, there were some issues. These were described in Section 2.2, but are revisited here due to their applicability.

 

We had a clean compile but ran into core dump problems in the executable on both the alpha and decstation. The offending lines were commented out and documented in-line. It appears that the four lines were re-declaring the RFLAG flag to be one (although it had already been initialized in a previous section). At this point we recalled the Wang original version and received the same results. Using his original object files, however, we were able to re-create the results. It was at this point that Dr. Lechner advised us to concentrate on Rassman’s test application, which was enroll (see 2.4.3). Therefore, the schooldb8 application runs, but there are some differences from the genlog version because of the Wang changes. These differences are reviewed in v11-sdb8-test-diffs.txt. There are no differences from the Wang results and the v11 results.

 

2.4.2.     Schooldb12

2.4.2.1.    Overview

 

The Schooldb12 test case is a version of the schooldb case. We refer the reader to the 96s523 writeup which can be found at $CASE/gen/ver_10log/doc/GenlogFinalRep.[ps,txt], Reference 3.

 

                To run this test case,

f.         change directory to the chgen/test/schooldb12 directory from where chgen is rooted.

g.       At this point, run make clean.

h.       Type ../../executables/chgen11 –ansi –log –keysize=12 schooldb      (This builds the .h and pr-*.c routines).

i.         Type make      (This makes the schooldb executable)

j.         Type schooldb (This runs the schooldb executable)

 

2.4.2.2.    Test Case Results

                The test case results were identical to the rtag genlog results.

2.4.3.     Enroll

2.4.3.1.    Overview

The enroll test case was first developed by Wang as part of the 97f522 chgen effort, Reference 6. It is documented in the report located in the chgen repository at doc/project_report_97f522.txt. This test case was extended by Rassman to include the replay capability. He describes the changes to the enroll application in his report in the repository at doc/genlog_replay_report.[doc,txt].

 

                To run this test case,

k.        change directory to the chgen/test/enroll directory from where chgen is rooted.

l.         At this point, run make clean.

m.      Type ../../executables/chgen11 –ansi –log enroll      (This builds the .h and pr-*.c routines).

n.       Type make      (This makes the enroll executable)

o.       Type enroll (This runs the enroll executable)

 

 

2.4.3.2.    Test Case Results

                The test case results are identical to those in the Rob Rassman report.


1a2 - JSK - See if this is used anywhere in the test deck, if not, leave it out.

> #define DEBUG  

7a9,20  - JSK - These will have to be added to the repository version.

> void dummywait(num)

> int num;

> {

>   int t,i;

>

>   t =10000000* num;

>

>   i =0;

>   while (i<t) {

>     i =i+1;

>   }

> }

 

41a55,87 - JSK - These will have to be added to the repository version.

>   /*********************************************/

>   /* Test addition - B. Rideout                */

>   /*********************************************/

>

>     /***************************************************/

>     /* pr_utility log initialization, ctwang, 12/20/97 */

>     /* their pr-conditions are the same:               */

>     /* (1) table attribute RFLAG is set to 1.          */

>     /* (2) global veriable PARSE is set to 0.          */

>     /* (3) hcg_log != 0 which means                    */

>     /*     pr_startlog() has been correctly called.    */

>     /* their post-condition are the same:              */

>     /* the pr_set_utility calls are recoreded          */

>     /*     in the logged file.                         */

>     /***************************************************/

>

>     /* manually set all record's RFLAG to 1  for testing pr_utility macro */

>     table_loop(view_name, AA)

>         AAcurr->RFLAG = 1;

>     table_loop(view_name, BB)

>         BBcurr->RFLAG = 1;

>     table_loop(view_name, CC)

>         CCcurr->RFLAG = 1;

>     table_loop(view_name, DD)

>         DDcurr->RFLAG = 1;

>     table_loop(view_name, EE)

>         EEcurr->RFLAG = 1;

>     /* set PARSE          */

>     PARSE = 0;

>  

>   pr_startlog("Billtest", view_name);

>  

> dummywait(2);

 

97a144 - JSK - Add this.

>   CC_elt->RFLAG = 1;

 

 

100c147 - JSK - Add the dummywait to the repository version.

<

---

> dummywait(1);

 

104c151,153 - JSK - Note from 2 changes down, that the BB_elt IS defined in the

repository version, I'll assume it doesn't need changing, BUT THIS ASSUMPTION may

need to be revisited....

<   find_int_loop(view_name, DD, room, 25)           /* find room 25 pkey */

---

>   BB_elt->RFLAG = 1;

>   find_int_loop(view_name, DD, room, 25)           /* find room 25 pkey

> */

 

 

120c172 - JSK - Add the dummywait to the repository

<

---

> dummywait(1);

 

 

126a179 - JSK - See the note two changes back.

>   BB_elt->RFLAG = 1;

 

- JSK - Add the following calls from ctwang's to the repository version.

146a203

> dummywait(1);

164a222

> dummywait(1);

170a229

> dummywait(1);

182a243

> dummywait(1);

186a248

> dummywait(1);

193a256

>   AA_elt->RFLAG = 1;

202a266

> dummywait(1);

212a277

>   EE_elt->RFLAG = 1;

226a292

> dummywait(1);

233a300

>   EE_elt->RFLAG = 1;

245a313

> dummywait(1);

292a361,366

> dummywait(1);

>

>   pr_stoplog(view_name,1);

>

>   pr_replay(view_name, "Billtest.txt", 1, 1);

> 

304a379

>



 

3.    CHGENv11

chgenv11 includes all of the chgenv10 features incorporated in Rassman’s chgenv10  version Reference 5, and also includes bootstrapping capability.  (Note that at some points in the development effort, this project was referred to as genBootstrap).   This capability refers to the ability for chgen to generate pr*.c and <schema>.h files that another (new) version of chgen can use.  The new version is then endowed with the ability to read metadata from a <schema>.dat file, instead of a <schema>.sch file.  This is explained in more detail in the following subsections.

 

3.1.  The Starting Point - chgenv10 Architecture

 

In order to understand how chgenv11 works, it is necessary to understand its predecessor, chgenv10.  chgenv10 reads a <schema>.sch file and generates <schema>.h and pr*.c files.  These files can then be used by an application developer along with his own <schema>.c source code (and any other source code and header files) to generate an application which manipulates a database which is described by the metadata in <schema>.sch.  This resulting application typically reads an <input>.dat file and generates an <output>.dat file.  The logic flow for this design is shown in Figure 3.1

 

The present chgen design uses tt_type and ta_type structs internal to its code to keep track of the metadata which was read from the user input file <schema>.sch.  The chgen-generated code pr_load.c and <schema>.h provide support to allow the application code to read in data from a permanent database file.  This data is stored in application-specific data structures.  These structures are created by chgenv10 using the application-specific information in <schema>.sch .  The metadata for these data structures are stored internally in the application-specific code as hcg structs.  Also, since the source code was generated specifically to handle a specific schema, the metadata is implicit in the source code itself.  Note the inconsistency between chgenv10 and the source code that it produces – chgen uses tt/ta structs for its metadata, while the generated code uses hcg structs.

3.2.  chgenv11 Bootstrapped Data Flow

 

The question then becomes – how can we reconcile this inconsistency?  The answer is that we can use chgen to process a metaschema.sch input file.  This input file is shown in Figure 3.2.  The resulting code (pr_load() and associated functions) can then read in SV, TT and TA data from a .dat file (as well as TS and VV data; however these two will not be used for the present project), and store it into its SV, TT and TA structures which are defined in the generated code metaschema.h.  Note that these data structures were generated for storing data, not metadata!

 

Once this data is read into the SV, TT, and TA structures, this information must be converted to tt_type and ta_type structure format so that other functions of chgenv11 can understand it as metadata (not just as data).  Remember, the TT and TA information are data (or application data), whereas the tt_type and ta_type structs are metadata.

 

The metadata contained in the hcg structs which was generated during the pr_loading of the SV, TT, and TA data can be ignored for this phase, since the SV, TT, and TA structs contain all of the information that chgenv11 requires, except for pointer information  associated with the tt_type and ta_type structs.  This is easily generated during the conversion process using existing chgen source code.

 

The tt_type and ta_type structs as presently defined in chgenv10 are listed in Figure 3.3.  Note that chgenv10 does not make use of any sv  information.  However it prints out an SV row in Output_Metaschema() if the command line option –metafile is selected.  This SV row consists of mostly hardcoded information, with exception of the version (CHGEN or GENDB) (which is selected based on whether or not the command line option –gendbschema is selected during chgen execution), and the name of the input schema file .

 

The TT and TA structs as defined in the metaschema.h file are presented in Figure 3.4.  The correlation between the two data representations is provided in Figure 3.5.  In both of the schemas, the TT and tt_type structs are implemented as linked lists, as are the TA and ta_type structs.  Association between TT and TA (and tt_type and ta_type) is via a single pointer from the TT (tt_type) struct to the head of the TA (ta_type) linked list.  The TT/TA structs have additional pointers to speed navigation.  However these are not needed in the conversion to the tt_type/ta_type structs.  Rather, the function TT_to_tt() uses methods already implemented in parse_schema_chgen() to add additional navigational entries in separate data structures using the encode() function, the TINDEX[ ] array, and the add_pc_cp_entries() function.

 

Note that the only other tt/ta data that cannot be directly obtained from the TT/TA structs are the HasBp and Singleton parameters.  HasBp and Singleton are easily derived data from the IsKey parameter.  These are indicated by the dotted lines in Figure 3.5.

 

The final logic flow for this design is shown in Figure 3.6.  This figure shows a specific <schema>.sch file (metaschema.sch) being read into chgenv10, and the resulting code (pr*.c and metaschema.h files) used to generate the next version of chgen (chgenv11).  This new version can read a .dat file (which is the same as a .msdat file).  However in order to accomplish this some minor modification of the existing chgen source files and the generated code was performed, as well as generation of TT_to_tt() and related functions.  Note that TT_to_tt() actually performs the conversion of the TA structs to their chgen counterparts, as well as the TT structs, as the name of the function indicates.  The functions are explained in the Section 3.4.

 

Note that after these modifications were performed, chgenv11 can generate pr*.c and metaschema.h files which can be used without modification to produce new versions of chgen.  One caveat here is that the TT_to_tt() conversion function relies on the specific TT and TA field names as described in metaschema.h.  Any changes to these fields will require corresponding modifications to TT_to_tt().

 

The function call sequence for chgenv11 is shown in Figure 3.7.  The new function calls and modifications for version 11 are indicated in bold.

 

3.3.  SV <schema>.msdat Issues

 

Note that the SV line in the <schema>.dat file which is produced by the call to Output_Metaschema() (if the -datinput command line option is not specified) is basically a hardcoded printf with only the name of the input schema file(<schema>.sch) and the format used (CHGEN or GENDB) determined at run time.  Furthermore, the fields in this SV line do not agree in format with the pr_dumped version of the <schema>.msdat file (produced if the -datinput command line option is specified).  Refer to Figure 3.2 for the chgenv11 SV schema, and to Figure 3.8 for a sample <schema>.msdat file produced by Outut_Metaschema() when running without the -datinput option.

 

Therefore not all fields are populated in the resulting <schema>.msdat files.  There are several solutions to this problem:

1.        Modify Output_Metaschema() to use the new SV format, and to make certain assumptions for values for the fields.  Assumptions must be made because there is no way of communicating this information via a <schema>.sch file, because all information is converted to TT and TA data rows, not SV rows, in the output <schema>.msdat file. For example:

          svname could be the name of the input <schema>.sch file, as is presently done.

         sformat  would be determined as before (GENDB if -gendbformat is entered on the command line, otherwise CHGEN)

         sversion could default to 0.0

         lastMod  could default to the run time

         svpath   could default to the full path name of the <schema>.sch input file

         descr    could default to /* chgen */

However, this would make the execution of chgenv11 without the -datinput option inconsistent with previous versions, and these default values may be misleading or incorrect.

 

2.        Modify parse_schema_chgen() to handle SV information differently that other table types.  This would allow for the user to manually enter the specific SV attribute values in the <schema>.sch file.  However this would not be backward compatible with chgenv10.

 

3.        Require the user to hand-modify the output <schema>.msdat file to add the relevant SV fields prior to using the file as a <schema>.dat input to another chgenv11 run.  This option requires the same level of user effort as option 2, provides backward compatibility to chgenv10, and requires no development effort.  Therefore, this is the option that was chosen.

 

The DAT-test test case in Section 4 provides validation that option 3 works correctly for all fields.  The other 5 test cases in that section demonstrate that it works correctly even with partially populated fields when reading a <schema>.dat file which was produced from a  <schema>.sch file.

3.4.  Code Modifications

The following list provides the number of manually modified or added lines of source code required for chgenv11:

 

source file

# of lines modified or added

chgen.c

65

chgen_global_vars.c

6

gen_defines.c

6

gen_pr_add.c

1

gen_pr_init.c

1

gen_pr_load.c

2

parse_schema.c

192

chgen_defines.h

4

chgen_externs.h

9

metaschema.sch

47

total

333

 

The number of lines of chgen generated source code is:

source file

# of lines modified or added

pr_delete.c

252

pr_dump.c

169

pr_free.c

39

pr_load.c

2454

pr_stats.c

90

metaschema.h

998

total

4002

 

 

 

Figure 2.8 provides a detailed lists of all of the changes to the source files.  They are summarized in Figure 2.7.  The changes can be broken up into three categories:

·         changes which were necessary to support a build of all the files into one executable

·         bugfixes

·         chgenv11 feature enhancements

 

 

 These differences can be summarized as follows:

 

changes which were necessary to support a build of all the files into one executable:

·         Makefile -

removed the following files due to duplication in the pr*.c and metaschema.h files:

-         mystrcpy.c

-         hcg_parse.c

-         strncpy_null.c

Renamed the executable chgen11

·         chgen_externs.h:

-          #included metaschema.h

-         commented out #include “lut.h” since metaschema.h contains all of lut.h (and more).

·         chgen_global_vars.h: #included metaschema.h

·         chgen_defines.h: the function prototype for CHGEN_RELEASE_DATE () was removed.

·         gen_pr_init.c: forward prototype declarations were added

·         gen_pr_load.c: forward prototype declarations were added

·         gen_defines.c:

-         the release date was changed from a function call CHGEN_RELEASE_DATE () to reference to a #defined CHGEN_RELEASE_DATE in metaschema.h.  Therefore the file chgen_release_date.c is not used in chgenv11.  This was necessary because one cannot have a function and a macro with the same name.

·         gen_pr_add.c: the printf for gen_pr_add() was changed to pr_add().

·         parse_schema.c: forward prototype declarations were added

·         pr_load.c: gen_pr_add() was renamed to pr_add() to eliminate a name conflict with the function in gen_pr_add.c. 

·         metaschema.h:

-         The following macro was commented out:

#define pr_add(view,tbl_abbr,tbl_ptr)  gen_pr_add(view, "tbl_abbr", tbl_ptr)

-         changed function prototype for gen_pr_add() to pr_add.

 

bugfixes

·         Output_Metaschema(): Output_Metaschema() could not handle –1 value for the attribute field isKey.  A value of –1 means that the attribute is a key, but has no back-pointer.  This was printed out to <schema>.msdat as a 0.  Output_Metaschema() was modified to correct this implementation deficiency.

·         chgen.c: the informational warning which is printed out when the command line option –metafile is selected called the option –datafile.  It was changed to –metafile.

·         gen_defines.c: fixed an errant new line in a big fprintf statement.

 

chgenv11 feature enhancements

·         parse_schema.c:  Added the new functions:

-         TT_to_tt() – this function converts the pr_loaded SV, TT, and TA data to appropriate sv_type, tt_type, and ta_type data formats, and adds the back and forward pointer information in a similar fashion to parse_schema_chgen().

-         parse_schema_dat() – this function calls pr_init(), pr_load(), and TT_to_tt().  It also calls pr_dump() if the –metafile option is selected.

-         dump_tt_ta_data() – this function prints out the contents of the tt_type and ta_type structs.  It was used for debugging, but is not called by chgenv11.  It was left there due to its potential future usefulness.

-         mystrcpy2() – this function performs a string copy and removes all trailing blanks.  This function was necessary because mystrcpy() was not properly performing this function where two character strings are stored adjacently in memory and the second one contains a C-delimited comment.  In these cases the comment was being contatenated onto the first string.

·         parse_schema.c – modified parse_schema() to call parse_schema_dat() if cli_datinput was specified.

·         chgen.c – added code to implement the –datinput and –viewname <viewname> command line options and to implement the function calls shown in Figure 3.7 in bold.

·         chgen_global_vars.c

-         added sch_viewdef_file_name[ ] and view_name[ ] variable declarations.  The provide storage for the viewdefs file name and the name of the view to be used in the pr_loading of the data

-         added cli_datinput and cli_viewname  variables.

·         chgen_externs.h

-         added sch_viewdef_file_name[ ] and view_name[ ] variable declarations.  The provide storage for the viewdefs file name and the name of the view to be used in the pr_loading of the data

-         added cli_datinput and cli_viewname  variables.

 

3.5.  Build Sequence

The process that was used to generate the final version of chgen11 is listed below:

1.        Develop metaschema.sch

2.        Run chgenv10 -ansi metaschema

3.        copy chgenv10 source and header files into the chgenv11 source directory

4.        copy the pr*.c and metaschema.h files generated in step 2 into the chgenv11 source directory.

5.        perform the modifications discussed in Section 3.4.

6.        make the executable chgen11 via the command 'make'.  The Makefile used for this sequence is shown in Figure 3.9.

7.        perform preliminary testing as documented in Section 4.

8.        re-run step 2 with chgenv11, then repeat step 4, 6, and 7.  Note that step 5 (the manual modifications) were left out in this step.  This process demonstrated that chgenv11 is self-bootstrappable with no manual modifications.

 

Section 4 documents the final validation testing performed with the executable generated in step 6 above (i.e. the 'final' version of chgenv11).

 


 

 

 

 

 

 



Figure 3.2

metaschema.sch

(return to Section 3.2)

(return to Section 3.3)

 

SchemaVersion SV /* sv_type - schema version, data, path, applications? */

{

      SVid     SV000000    c8   1    /* primary key field      */

      PVid     PJ000000    c8   0    /* Project Ref - non-key field for now */

      svname   NA          t30  0    /* schema name [and version?]          */

      sformat  TBD         c6   0    /* schema format: CHGEN or GENDB[?] */

      sversion 0.0         t12  0    /* schema tag or version (rev# i.j...? */

      lastMod  000000      i4   0    /* date of last mod: yymmdd   */

      svpath   NA          t80  0    /* full path prefix or $DEFINED-SYMBOL */

      descr    NA          t80  0      /* e.g., list of schema applications? */

}

TableType TT    /* tt_type - table description and child-set of attributes*/

{

      TTid     TT000000    c8   1    /* primary key field    */

      SVid     SV000000    c8   1    /* SVid is  foreign key */

      ttabb    NA          c5   0    /* 2 or 4 UCLetters */

      ttname   NA          t30  0    /* table name           */

      descr    NA          t80  0    /* descriptive comment (table purpose) */

}

TableAttribute TA /* ta_type - scalar or ref attribute of parent table */

{

      TAid     TA000000    c8   1    /* primary key field    */

      TTid     TT000000    c8   1    /* TTid is foreign key  */

      fname    NA          c30  0    /* field name (column header)         */

      dfltVal  NA          t30  0    /* default value (was altName)     */

      ftype    I4          c10  0    /* field type (I4/F4/c##,t###/k8/k12) */

      iskey    0           c4   0    /* 0:nonkey; 1/-1:pfkey; s:superClassRef */

      comment  //          t132 0    /* descriptive comment (units/range?) */

}

 

ViewVersion VV     /* vv_type - subset of tables in this view */

{

      VVid     VV000000    c8   1    /* primary key field    */

      SVid     SV000000    c8   1    /* SV foreign key field */

      vname    schema      t30  0    /* view name (schema = all tables) */

      mode     r           c2   0    /* mode (r/w/u)           */

      num_tables 0         i2   0    /* number of tables in View  */

}

TableStatistics TS    /* ts_type - statistics about this Table in View */

{

      TSid     TS000000    c8   1    /* primary key field    */

      VVid     VV000000    c8   1    /* fkey to ViewVersion for this TSrow */

      TTid     TT000000    c8   1    /* fkey to TTrow for this TSrow     */

      verno    0           i2   0    /* version number of TT in VV        */

      maxrow   0           i2   0    /* max row# in this table and VV    */

      vvrowcnt 0           i2   0    /* row-count of this TT in parent VV only*/

}

 

 


 

Figure 3.3

tt_type and ta_type Structs as Defined in chgen_extern.h

(return to Section 3.2)

 

 

struct tt_type  /* object to hold table name */

{

        char TTabbr[ABBREV_NAME_LENGTH];

        char TableName[NAMELENGTH];

        char comment[MAXCOMMENTLENGTH];

        struct tt_type  *next_ptr;

        struct ta_type  *ta_ptr;

}

 

struct ta_type  /* object to hold a field (attribute) name for a table */

{

        char FieldName[NAMELENGTH];

        char AltFieldName[NAMELENGTH];

        char FieldType[NAMELENGTH];

        char comment[MAXCOMMENTLENGTH];

        int  IsKey;

        int  HasBp;

        int  Singleton;

        struct ta_type  *next_ptr;

};

 

 


Figure 3.4

TT/TA Structs as Defined in metaschema.h

(return to text)

 

/******************************************************************************/

/* Table: SV                                                                  */

/******************************************************************************/

hcg_extern

struct SV                  /* sv_type - schema version, data, path, applications? */

{

hcg_key SVid; /* primary key field      */

char PVid[9]; /* Project Ref - non-key field for now */

char svname[31];     /* schema name [and version?]          */

char sformat[7];     /* schema format: CHGEN or GENDB[?] */

char sversion[13];   /* schema tag or version (rev# i.j...? */

int lastMod;  /* date of last mod: yymmdd   */

char svpath[81];     /* full path prefix or $DEFINED-SYMBOL */

char descr[81];      /* e.g., list of schema applications? */

struct VV *VVid_fcp;

struct VV *VVid_bcp;

struct TT *TTid_fcp;

struct TT *TTid_bcp;

struct SV *prev_ptr;

struct SV *next_ptr;

int    RFLAG; /* for pr_utility macro log */

} hcg_declare(SV);

/******************************************************************************/

/* Table: TT                                                                  */

/******************************************************************************/

hcg_extern

struct TT                  /* tt_type - table description and child-set of attributes*/

{

hcg_key TTid; /* primary key field    */

hcg_key SVid; /* SVid is  foreign key */

char ttabb[6];       /* 2 or 4 UCLetters */

char ttname[31];     /* table name           */

char descr[81];      /* descriptive comment (table purpose) */

struct SV *SVid_pp;

struct dummy_type *SVid_fpp;

struct dummy_type *SVid_bpp;

struct TS *TSid_fcp;

struct TS *TSid_bcp;

struct TA *TAid_fcp;

struct TA *TAid_bcp;

struct TT *prev_ptr;

struct TT *next_ptr;

int    RFLAG; /* for pr_utility macro log */

} hcg_declare(TT);

/******************************************************************************/

/* Table: TA                                                                  */

/******************************************************************************/

hcg_extern

struct TA                  /* ta_type - scalar or ref attribute of parent table */

{

hcg_key TAid; /* primary key field    */

hcg_key TTid; /* TTid is foreign key  */

char fname[31];      /* field name (column header)         */

char dfltVal[31];    /* default value (was altName)     */

char ftype[11];      /* field type (I4/F4/c##,t###/k8/k12) */

char iskey[5];       /* 0:nonkey; 1/-1:pfkey; s:superClassRef */

char comment[133];   /* descriptive comment (units/range?) */

struct TT *TTid_pp;

struct dummy_type *TTid_fpp;

struct dummy_type *TTid_bpp;

struct TA *prev_ptr;

struct TA *next_ptr;

int    RFLAG; /* for pr_utility macro log */

} hcg_declare(TA);


Figure 3.5

Correlation of TT/TA ER Diagram to

to tt_type / ta_type ER Diagram