AlpineImportLocalImpl:
CEDAR MONITOR
EXPORTS
AlpineImportLocal =
BEGIN
myExportedFileStore: AlpineEnvironment.FileStore ← NIL;
registerdImportLocalProc: PROC[handle: AlpInstance.Handle] ← NIL;
Register:
PUBLIC
ENTRY
PROC [exportedFileStore: AlpineEnvironment.FileStore, importLocalProc:
PROC[handle: AlpInstance.Handle] ] = {
registerdImportLocalProc ← importLocalProc;
myExportedFileStore ← exportedFileStore;
};
Unregister:
PUBLIC
ENTRY
PROC [] = {
registerdImportLocalProc ← NIL;
myExportedFileStore ← NIL;
};
ImportIfLocal:
PUBLIC
ENTRY
PROC [handle: AlpInstance.Handle, filestore: AlpineEnvironment.FileStore]
RETURNS [success:
BOOL] = {
IF Rope.Equal[filestore, myExportedFileStore,
FALSE]
AND registerdImportLocalProc #
NIL
THEN {
registerdImportLocalProc[handle];
RETURN[TRUE];
}
ELSE RETURN[FALSE];
};
END.