previous next top contents index framed top this page unframed
OBJCOM compares two object MODULEs to see if they are the same except for their compilation dates. The MODULE can be invoked interactively or it can be called from a program using the PROCEDURE $compareObjmods.
OBJCOM has a strict notion of whether or not two MODULEs match; they must occupy the same number of MAINSAIL pages and, except for the compilation date and time fields embedded in the MODULEs, each pair of corresponding storage units must be the same. This means, e.g., that if a MODULE is compiled and then one of its PROCEDUREs is recompiled without having been changed, OBJCOM would report that the original version and the subsequent version of the MODULE do not match, because the code for the recompiled PROCEDURE is not in the same place.
Next, OBJCOM prompts for the target
abbreviation of the operating system
for which the two object MODULEs
to be compared were compiled.
Responding with <eol> means that the
MODULEs were compiled to run
on the host system (for the first pair
of MODULEs compared) or on the same system as the previous pair
of MODULEs compared (for subsequent comparisons).
OBJCOM then asks whether to ignore legal notices.
If the answer is Y,
then the two MODULEs are considered the same
even if the text of their legal notices is different.
If the two object MODULEs match,
OBJCOM reports that they matched after
comparing them.
Otherwise, it issues a short message indicating why
they did not match.
In any event, OBJCOM then prompts for the names of
two more object MODULEs to compare.
To exit OBJCOM, you should
type <eol> to the prompt for
another file name and to the prompt for
a library name.
If one of the object MODULEs examined
in the previous comparison was
in a library, then when OBJCOM
prompts for another pair of object
MODULE names, it assumes that the corresponding one of the object
MODULEs to be compared
this time is in the same library, and so it
prompts for a MODULE name without
first prompting for a file name and
then a library name.
For example, if during the previous comparison, the
first object MODULE was in a library foo
and the second was not in a
library, OBJCOM assumes that
the first MODULE it prompts for
during the next iteration is also in the library foo,
and prompts
for the name of another MODULE in foo. It makes no such
assumptions about the second MODULE for which it prompts.
If you type
<eol> in response to the MODULE name prompt,
OBJCOM prompts for
the name of a file, as it did when it was first run.
26.1. Interactive Use of OBJCOM
If OBJCOM is run interactively, it first prompts for
the names of the files containing the two
object MODULEs.
The first prompt asks for a file or MODULE name.
You can
type the name of the file containing
the object MODULE, or if MAINSAIL
can derive the object file name
from the MODULE name alone, you
can type just the MODULE name.
If the object MODULE is in a library,
you can respond to the first prompt with <eol>, in which case
OBJCOM prompts for the name
of the library file containing the object
MODULE, and then the name of the MODULE.
(If you answer * to the MODULE name prompt,
OBJCOM compares all the
MODULEs in the library
to those with the same names in another library,
whose name it asks for.)
OBJCOM goes through the same
sequence to get the names of both object MODULEs.
26.2. Calling OBJCOM from a Program
The interface to $compareObjmods
is shown in Figure 26–1.
Figure 26–1. $compareObjmods
| BOOLEAN PROCEDURE $compareObjmods (STRING file1,lib1,mod1,file2; OPTIONAL STRING lib2,mod2,target; PRODUCES OPTIONAL STRING msg; OPTIONAL BITS ctrlBits); |
$compareObjmods returns TRUE if and only if the two object MODULEs specified by its input parameters are the same except for their compilation dates.
file1, lib1, and mod1 specify the first object MODULE to be compared, and file2, lib2, and mod2 the second object MODULE.
file1 can specify the name of the object file, or just the name of the MODULE if MAINSAIL can determine the name of the object file from the MODULE name. If file1 is non-Zero, lib1 and mod1 are ignored. If the object MODULE is in a library, lib1 can specify the library's file name and mod1 can specify the MODULE name within the library, in which case file1 should be the empty STRING. file2, lib2, and mod2 specify the second MODULE in the same way that file1, lib1, and mod1 specify the first.
target specifies the target abbreviation of the operating system for which the two object MODULEs were compiled. Target operating system abbreviations are listed in Appendix B of the MAINSAIL Language Manual. If target is omitted or is the empty STRING, the host operating system is assumed.
msg is set only if $compareObjmods returns FALSE. It contains a brief description of why the PROCEDURE did not return TRUE, such as that it could not find one of the MODULEs, or that one of them was not really an object MODULE, or that the MODULEs did not match.
The only ctrlBits bit currently defined is $ignoreLegalNotices. If this bit is set, comparisons of two MODULEs ignore the MODULEs' legal notices. Otherwise, the legal notices are compared.
MAINSAIL Utilities User's Guide, Chapter 26