AlpineImportLocalImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by
Bob Hagmann May 31, 1985 3:45:15 pm PDT
DIRECTORY
AlpineEnvironment USING [FileStore],
AlpInstance USING [Handle],
Rope USING [Equal],
AlpineImportLocal USING [];
AlpineImportLocalImpl: CEDAR MONITOR
IMPORTS
Rope
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.