CDMEBESScan.mesa
.. module to scan a MEBES file and tell you about it.
Copyright © 1986 by Xerox Corporation. All rights reserved.
McCreight, September 24, 1986 10:22:12 am PDT
DIRECTORY BasicTime, CDMEBES, IO, Rope;
CDMEBESScan: CEDAR DEFINITIONS =
BEGIN
Meters: TYPE = REAL;
Byte: TYPE = [0..256);
blockSize: INT = CDMEBES.mebesBlockSize; -- 2048 bytes
segmentWidth: INT = CDMEBES.maskWidth; -- 32768 pixels
DropInDescriptor: TYPE = REF DropInDescriptorRec ← NIL;
DropInDescriptorRec: TYPE = RECORD [
fileName: Rope.ROPENIL,
created: BasicTime.GMT,
lastChecked: BasicTime.GMT,
pixelSize, sizeX, sizeY: Meters ← 0.0,
clip: CDMEBES.MEBESRect ← [0,0,0,0],
stripeHeight: NAT ← 255,
segDirectory: SEQUENCE nSegments: NAT OF REF StripeDirectory
.. the leftmost segment is numbered 1.
];
StripeDirectory: TYPE = RECORD [
nStripes: NAT ← 0, -- the maximum stripe that actually appears in this segment.
.. the bottom stripe is numbered 1.
stripeDirectory: SEQUENCE maxStripes: NAT OF RECORD [
firstBlock: CARDINAL ← 0,
firstWordWithinBlock: CARDINAL ← 0
]
];
ScanMebesPatternFile: PROC [ fileName: Rope.ROPE ] RETURNS [ did: DropInDescriptor ← NIL ];
NotMEBESFormat: ERROR;
ReadMebesByte: PROC [ s: IO.STREAM ] RETURNS [byte: Byte];
ReadMebesWord: PROC [ s: IO.STREAM ] RETURNS [ c: CARDINAL ];
ReadMebesDoubleWord: PROC [ s: IO.STREAM ] RETURNS [ lc: LONG CARDINAL ];
END.