17. MERGING AND REDUCING LIBRARIES

If you start to develop your own library of macros and functions, you have to resolve several problems:

  1. If you update the zzmaster file and you receive a new version of OrgC later, the zzmaster will collide with the one you have already developed.
  2. If both you and your colleague developed new macros, how do you merge the two libraries?
  3. If you only need several organizations, it does not make much sense to drag along hundreds of macros. You may want to reduce the library to only those macros which you will actually use.

The best strategy for developing your own library is not to modify the zzmaster file, but to create your own file under a different name, say, myMaster. The myMaster file has the same format as the zzmaster file but contains only the organizations you developed yourself. All the files that contain your new macros and parametric functions will be stored together with OrgC files in the orgC/macro directory.

Merging Libraries:

When you are ready to merge the original OrgC library with your new library, rename the original zzmaster to something else, say qqmaster. Then run the program that merges the two libraries and create a combined file called zzmaster:

cd orgC/macroÄ
zzmerge qqmaster myMaster zzmaster

This can be repeated several times, gradually merging more libraries:

zzmerge master1 master2 aMaster
zzmerge aMaster master3 bMaster
zzmerge bMaster master4 zzmaster

Reducing Libraries:

If you want to select only a limited set of organizations and functions, make a copy of zzmaster, edit it, and delete the organizations and functions you don't want. Don't worry about indices and pointers, and change only two sections: ZZorganization{ and ZZfunction {.

Be careful that you don't delete too many organizations. You need the organization for every function you keep.

Then run zzselect, which creates a new, reduced zzmaster, properly rearranged with all indices and pointers. The total run may look like this:

cd orgC/macro
cp zzmaster qqmaster
cp zzmaster rrmaster
vi rrmaster ... delete some organizations and functions
zzselect qqmaster rrmaster zzmaster

 

Chapter 16: Adding New Features Chapter 18: Multi User Mode