-- IODefs.Mesa  Edited by Sandman on August 12, 1980  10:01 AM 
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  Format USING [NumberFormat],
  StreamDefs USING [StreamHandle],
  StringDefs USING [SubString];

IODefs: DEFINITIONS =
  BEGIN OPEN StreamDefs;

  -- some control characters

  NUL: CHARACTER = 0C;
  ControlA: CHARACTER = 'A - 100B;
  ControlB: CHARACTER = 'B - 100B;
  ControlC: CHARACTER = 'C - 100B;
  ControlD: CHARACTER = 'D - 100B;
  ControlE: CHARACTER = 'E - 100B;
  ControlF: CHARACTER = 'F - 100B;
  ControlG, BEL: CHARACTER = 'G - 100B;
  ControlH, BS: CHARACTER = 'H - 100B;
  ControlI, TAB: CHARACTER = 'I - 100B;
  ControlJ, LF: CHARACTER = 'J - 100B;
  ControlK: CHARACTER = 'K - 100B;
  ControlL, FF: CHARACTER = 'L - 100B;
  ControlM, CR: CHARACTER = 'M - 100B;
  ControlN: CHARACTER = 'N - 100B;
  ControlO: CHARACTER = 'O - 100B;
  ControlP: CHARACTER = 'P - 100B;
  ControlQ: CHARACTER = 'Q - 100B;
  ControlR: CHARACTER = 'R - 100B;
  ControlS: CHARACTER = 'S - 100B;
  ControlT: CHARACTER = 'T - 100B;
  ControlU: CHARACTER = 'U - 100B;
  ControlV: CHARACTER = 'V - 100B;
  ControlW: CHARACTER = 'W - 100B;
  ControlX: CHARACTER = 'X - 100B;
  ControlY: CHARACTER = 'Y - 100B;
  ControlZ: CHARACTER = 'Z - 100B;
  ESC: CHARACTER = 33C;
  SP: CHARACTER = ' ;
  DEL: CHARACTER = 177C;

  -- numerical output formatting

  NumberFormat: TYPE = Format.NumberFormat;

  StreamIO: PROGRAM;

  GetInputStream, GetOutputStream: PROCEDURE RETURNS [StreamHandle];
  SetInputStream, SetOutputStream: PROCEDURE [StreamHandle];
  SetEcho: PROCEDURE [new: BOOLEAN] RETURNS [old: BOOLEAN];

  NewLine: PROCEDURE RETURNS [BOOLEAN];

  ReadChar: PROCEDURE RETURNS [CHARACTER];
  WriteChar: PROCEDURE [CHARACTER];

  ReadEditedString: PROCEDURE [
    STRING, PROCEDURE [CHARACTER] RETURNS [BOOLEAN], BOOLEAN] RETURNS [CHARACTER];

  ReadString: PROCEDURE [STRING, PROCEDURE [CHARACTER] RETURNS [BOOLEAN]];
  WriteString: PROCEDURE [STRING];
  WriteSubString: PROCEDURE [StringDefs.SubString];

  Rubout: SIGNAL;
  LineOverflow: SIGNAL [s: STRING] RETURNS [ns: STRING];

  ReadID, ReadLine: PROCEDURE [STRING];
  WriteLine: PROCEDURE [STRING];

  OutNumber: PROCEDURE [StreamHandle, UNSPECIFIED, NumberFormat];
  WriteNumber: PROCEDURE [UNSPECIFIED, NumberFormat];
  ReadNumber: PROCEDURE [default: UNSPECIFIED, radix: CARDINAL]
    RETURNS [UNSPECIFIED];
  ReadOctal: PROCEDURE RETURNS [UNSPECIFIED];
  WriteOctal: PROCEDURE [UNSPECIFIED];
  ReadDecimal: PROCEDURE RETURNS [INTEGER];
  WriteDecimal: PROCEDURE [INTEGER];

  END.