-- StreamScan.mesa  Edited by Sandman on June 30, 1980  5:06 PM
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  AltoFileDefs USING [FA, vDA],
  DiskDefs USING [CBptr, CBZptr],
  StreamDefs USING [DiskHandle, StreamHandle];

StreamScan: DEFINITIONS =
  BEGIN

  Descriptor: TYPE = PRIVATE RECORD [
    da: PUBLIC AltoFileDefs.vDA,
    pageNumber: PUBLIC CARDINAL,
    numChars: PUBLIC CARDINAL,
    bd: StreamScan.BDHandle,
    nextPage: CARDINAL,
    thisCB: DiskDefs.CBptr,
    nextCB: DiskDefs.CBptr,
    ks: StreamDefs.DiskHandle,
    hintLastFA: AltoFileDefs.FA,
    cbz: DiskDefs.CBZptr,
    nCB: CARDINAL];

  restart: PRIVATE CARDINAL = LAST[CARDINAL];

  lSSD: PRIVATE CARDINAL = SIZE[StreamScan.Descriptor];

  Handle: TYPE = POINTER TO READONLY StreamScan.Descriptor;

  BufferDescriptor: PRIVATE TYPE = RECORD [
    nextBD: StreamScan.BDHandle, buffer: POINTER, full: BOOLEAN];

  lBD: PRIVATE CARDINAL = SIZE[BufferDescriptor];

  BDHandle: PRIVATE TYPE = POINTER TO BufferDescriptor;

  Init: PROCEDURE [
    stream: StreamDefs.StreamHandle, bufTable: POINTER, nBufs: CARDINAL]
    RETURNS [StreamScan.Handle];
  GetBuffer: PUBLIC PROCEDURE [ssd: StreamScan.Handle] RETURNS [POINTER];
  Finish: PROCEDURE [ssd: StreamScan.Handle];
  END...