-- File: Slosh.Mesa,  Last Edit: HGM  December 20, 1980  12:25 PM

DIRECTORY
  File USING [Capability],
  Window USING [Handle],
  PupTypes USING [PupAddress];

Slosh: DEFINITIONS =
  BEGIN

  PupAddress: TYPE = PupTypes.PupAddress;

  RecvStatus: TYPE = MACHINE DEPENDENT{
    -- strange values used by GateControl
    statusFileNameRejected(2), statusContentsRejected(4),
    -- by a local checker procedure
    statusFileClobbered(6), -- ran out of disk space on copy
    statusDiskFull(8), -- disk full before copy
    statusEFTPFailed(177775B), statusStoreInProgress(177776B),
    statusStoreOk(177777B)};
  -- Other values are ok too.  ERROR codes are convient for uniqueness.

  RecvFile: PROCEDURE [
    who: Window.Handle, fileName, scratch: STRING, file: File.Capability,
    -- NIL if new
    me: PupAddress, ask: PROCEDURE] RETURNS [RecvStatus];

  SendStatus: TYPE = {ok, neverStarted, troubles};

  SendFile: PROCEDURE [
    who: Window.Handle, fileName: STRING, file: File.Capability, him: PupAddress]
    RETURNS [SendStatus];

  Why: TYPE = {check, release, arrived, failed};

  AddProcs: PROCEDURE [proc: PROCEDURE [Why, STRING, File.Capability]];

  Check: PROCEDURE [STRING, File.Capability];
  RejectThisTrash: ERROR [text: STRING];
  Release: PROCEDURE [STRING, File.Capability];
  Arrived: PROCEDURE [STRING, File.Capability];
  Failed: PROCEDURE [STRING, File.Capability];

  CopyFile: PROCEDURE [to, from: File.Capability] RETURNS [result: RecvStatus];
  RetransmissionInterval: PROCEDURE RETURNS [seconds: CARDINAL];

  END.