MesaLoadState.mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Chauser, August 31, 1990 10:50 am PDT
Willie-s, August 5, 1991 6:05 pm PDT
DIRECTORY
Rope USING [ROPE],
SafeStorage USING [Type];
MesaLoadState: CEDAR DEFINITIONS
~ BEGIN
BeginInstallation: PROC [];
Acquires the lock on the uncommitted load state. Waits if necessary.
CommitInstallation: PROC [];
Commits any changes made since the previous commit or abort. Releases the lock on the uncommitted load state. Acquires and releases the lock on the committed load state in the course of operation.
AbortInstallation: PROC[];
Aborts any changes made since the previous commit or abort. Releases the lock on the uncommitted load state. Does not use the committed load state lock.
CheckInstallation: PROC[ report: ReportProc ];
calls report for each apparent inconsistency in the uncommitted load state. Examples are: unbound imports, multiple exports to a single interface item, etc.
ReportProc: TYPE ~ PROC[ problem: InstallationProblem ];
ProblemKind: TYPE ~ {unboundImport, multipleExports, reExport, interfaceVersionMismatch, typeClash};
InstallationProblem: TYPE ~ RECORD[
interface: Interface,
item: INT,
problem: SELECT problemKind: ProblemKind FROM
unboundImport => [importer: Program],
multipleExports => [exporter: Program],
reExport => [exporter: Program],
interfaceVersionMismatch => [],
typeClash => [typeName: Rope.ROPE, now: Program, already: Program] -- it is strongly urged that a client seeing a typeClash abort the installation: safety cannot be guaranteed in the presence of typeClashes.
ENDCASE
];
InstallationProblems: TYPE ~ LIST OF InstallationProblem;
Interface: TYPE ~ REF InterfaceRecord;
Program: TYPE ~ REF ProgramRep;
Config: TYPE ~ REF ConfigRep;
InterfaceRecord: TYPE;
ProgramRep: TYPE;
ConfigRep: TYPE;
ProgramOrConfig: TYPE ~ RECORD[
SELECT type: * FROM
program => [program: Program],
config => [config: Config],
ENDCASE
];
ProgramAndConfigList: TYPE ~ LIST OF ProgramOrConfig;
GlobalConfig: PROC[] RETURNS [Config];
Parent: PROC[object: ProgramOrConfig] RETURNS [Config];
EnumerateChildren: PROC[config: Config, proc: ChildProc];
ChildProc: TYPE ~ PROC[child: ProgramOrConfig];
EnumerateInterfaces: PROC[config: Config, proc: InterfaceProc];
InterfaceProc: TYPE ~ PROC[interface: Interface, transparent: BOOL];
transparent interfaces allow references to propagate to an interface with the same name and type in an outer scope. non-transparent interfaces actually contain entries for each item.
EnumerateExports: PROC[program: Program, proc: ExportItemProc];
ExportItemProc: TYPE ~ PROC[interface: Interface, item: INT];
ObjectName: PROC[object: ProgramOrConfig] RETURNS [Rope.ROPE];
QualifiedName: PROC[object: ProgramOrConfig] RETURNS [Rope.ROPE];
ConfigName.ConfigName ... .ProgramName
ProgramType: PROC[program: Program] RETURNS[SafeStorage.Type];
InterfaceName: PROC[Interface] RETURNS [Rope.ROPE];
InterfaceType: PROC[Interface] RETURNS[SafeStorage.Type];
TypeStringFromType: PROC[type: SafeStorage.Type] RETURNS[typeString: STRING];
TypeFromTypeString: PROC[typeString: STRING] RETURNS[type: SafeStorage.Type];
ConcreteTypeFromAbstractType: PROC[abstract: SafeStorage.Type] RETURNS[concrete: SafeStorage.Type];
END.