<> <<.. module to scan a MEBES file and tell you about it.>> <> <> 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.ROPE _ NIL, 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.