GmtDebug.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Hal Murray, February 11, 1986 8:45:37 pm PST
DIRECTORY
AMBridge USING [TVToLC],
BasicTime USING [GMT, nullGMT],
Convert USING [RopeFromTime],
IO USING [PutRope],
PrintTV USING [RegisterRefPrintProc, RegisterTVPrintProc, RefPrintProc, TVPrintProc],
Rope USING [];
GmtDebug: CEDAR PROGRAM
IMPORTS AMBridge, Convert, IO, PrintTV= {
GMT: TYPE = BasicTime.GMT;
PrintRefGMT: PrintTV.RefPrintProc = {
[ref: REF READONLY ANY, data: REF ANY, stream: STREAM, depth: INT ← 4, width: INT ← 32, verbose: BOOL ← FALSE] RETURNS [useOld: BOOL ← FALSE]
gmt: REF READONLY GMT;
TRUSTED { gmt ← LOOPHOLE[ref]; };
IF gmt^ = BasicTime.nullGMT THEN IO.PutRope[stream, "nullGMT"]
ELSE IO.PutRope[stream, Convert.RopeFromTime[
from: gmt^, end: seconds, useAMPM: FALSE, includeZone: FALSE] ];
};
PrintTVGMT: PrintTV.TVPrintProc = TRUSTED {
[tv: TV, data: REF ANY, stream: STREAM, depth: INT ← 4, width: INT ← 32, verbose: BOOL ← FALSE] RETURNS [useOld: BOOL ← FALSE]
gmt: GMT;
TRUSTED { gmt ← LOOPHOLE[AMBridge.TVToLC[tv]]; };
IF gmt = BasicTime.nullGMT THEN IO.PutRope[stream, "nullGMT"]
ELSE IO.PutRope[stream, Convert.RopeFromTime[
from: gmt, end: seconds, useAMPM: FALSE, includeZone: FALSE] ];
};
PrintTV.RegisterRefPrintProc[CODE[GMT], PrintRefGMT];
PrintTV.RegisterTVPrintProc[CODE[GMT], PrintTVGMT];
}.