ViewerGenMapImpl.mesa
Copyright Ó 1990, 1992 by Xerox Corporation. All rights reserved.
Mna, October 29, 1990 11:31 am PST
Laurie Horton, October 31, 1990 1:02 pm PST
Willie-s, January 22, 1992 5:50 pm PST
DIRECTORY
GenMapIO,
IO,
IOClasses USING [CreateDribbleOutputStream],
MessagesOut USING [PutRopes, PutMsg],
PFS USING [AccessOptions, StreamOpen, PathFromRope],
Rope,
ViewerIO USING [CreateViewerStreams];
ViewerGenMapImpl: CEDAR PROGRAM
IMPORTS IO, IOClasses, MessagesOut, PFS, ViewerIO
EXPORTS GenMapIO
= BEGIN
T Y P E S
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
Global variables
logFileStream: STREAM ¬ NIL;
Public Procs
CreateOutputStreams: PUBLIC PROC [logFileName: ROPE, typeScriptStream: STREAM ¬ NIL] RETURNS [outputStream: STREAM] = {
IF typeScriptStream # NIL THEN outputStream ¬ CreateTeeStream[logFileName, typeScriptStream]
ELSE [,outputStream] ¬ ViewerIO.CreateViewerStreams[logFileName, NIL, logFileName, FALSE];
};
CreateTeeStream: PROC [fileName: ROPE, typeScriptStream: STREAM]
RETURNS [STREAM] = {
logFileStream ¬ PFS.StreamOpen[fileName: PFS.PathFromRope[fileName], accessOptions: create];
RETURN [IOClasses.CreateDribbleOutputStream[typeScriptStream, logFileStream]];
};
CloseTeeStream : PUBLIC PROC = {
logFileStream.Close[];
logFileStream ¬ NIL;
};
PutRopes: PUBLIC PROC [stream: STREAM, r1,r2,r3,r4: ROPE ¬ NIL] = {
MessagesOut.PutRopes[stream, r1, r2, r3, r4];
};
PutMsg: PUBLIC PROC [r1,r2,r3,r4: ROPE ¬ NIL] = {
MessagesOut.PutMsg[r1, r2, r3, r4];
};
END ...