-- File: EFTPDefs.mesa,  Last Edit: HGM September 29, 1980  12:49 AM

DIRECTORY
  Rope USING [ROPE],
  PupTypes USING [PupAddress];

EFTPDefs: DEFINITIONS =
  BEGIN OPEN PupTypes;

  -- several places
  EFTPTimeOut: SIGNAL; -- RESUME to keep trying

  -- send half
  EFTPOpenForSending: PROCEDURE [who: PupAddress, waitForAck: BOOLEAN ← TRUE];
  EFTPAlreadySending: ERROR;
  EFTPSendBlock: PROCEDURE [LONG POINTER, CARDINAL];
  EFTPNotSending: ERROR;
  EFTPTroubleSending: ERROR [e: EFTPAbortCode, s: Rope.ROPE];
  EFTPAbortSending: PROCEDURE [STRING];
  EFTPFinishSending: PROCEDURE;

  -- receive half
  EFTPOpenForReceiving: PROCEDURE [PupAddress] RETURNS [PupAddress];
  EFTPAlreadyReceiving: ERROR;
  EFTPGetBlock: PROCEDURE [LONG POINTER, CARDINAL] RETURNS [CARDINAL];
  EFTPNotReceiving: ERROR;
  EFTPTroubleReceiving: ERROR [e: EFTPAbortCode, s: Rope.ROPE];
  EFTPEndReceiving: ERROR;
  EFTPAbortReceiving: PROCEDURE [STRING];
  EFTPFinishReceiving: PROCEDURE;

  EFTPSetRecvTimeout: PROCEDURE [ms: CARDINAL];
  EFTPSetSendTimeout: PROCEDURE [ms, tries: CARDINAL];

  EFTPAbortCode: TYPE = MACHINE DEPENDENT{
    eftpOK(0), -- pseudo code
    eftpExternalSenderAbort(1), eftpExternalReceiverAbort(2),
    eftpReceiverBusyAbort(3), eftpOutOfSyncAbort(4), eftpRejected(1001)};
  -- pseudo code

  END.