<> <> <> <> DIRECTORY BasicTime USING [GMT]; FTP, IO USING [STREAM], PupStream USING [CloseReason], Rope USING [ROPE], FTPInternal: CEDAR DEFINITIONS = BEGIN OPEN FTP; <> maxStringLength: CARDINAL = 100; <> Handle: TYPE = REF Object; Object: TYPE = RECORD [ byteStream: IO.STREAM _ NIL, pList: ARRAY LocalOrRemote OF PList, desiredProps: PropertySet _ ALL[FALSE], desiredUserDefinedProps: LIST OF ATOM _ NIL; gotMark: BOOLEAN _ FALSE, mark: [0..256) _ NULL, remoteString: Rope.ROPE _ NIL, host: Rope.ROPE _ NIL, serverType: ServerType _ unknown, plist: PList _ NIL, info: STP.FileInfo _ NIL, clientData: REF ANY _ NIL]; PList: TYPE = REF PListObject; PListObject: TYPE = RECORD [ date: ARRAY DateProperty OF BasicTime.GMT _ ALL[BasicTime.nullGMT], enumerated: ARRAY EnumeratedProperty OF EnumPropValue _ ALL[LOOPHOLE[0]], number: ARRAY NumberProperty OF INT _ ALL[0], text: ARRAY TextProperty OF ROPE _ ALL[NIL], userDefined: Atom.PropList _ NIL]; ValidProperties: TYPE = STP.ValidProperties; <> DoFiles: PROCEDURE [stp: Handle, file: Rope.ROPE, confirm: STP.ConfirmProcType, complete: STP.CompletionProcType, op: Operation]; GetCommand: PROCEDURE [stp: Handle] RETURNS[mark: [0..256), code: CHARACTER, ps: Rope.ROPE]; GetFile: PROCEDURE [stp: Handle, stream: IO.STREAM, file: Rope.ROPE] RETURNS [BOOLEAN]; GetHereIsAndPList: PROCEDURE [stp: Handle, gobbleEOC: BOOLEAN _ TRUE]; GetPList: PROCEDURE [stp: Handle, gobbleEOC: BOOLEAN _ TRUE, propertiesOk: BOOL _ FALSE]; PutCommand: PROCEDURE [stp: Handle, mark: [0..256), code: CHARACTER, string: Rope.ROPE, sendEOC: BOOLEAN _ TRUE]; PutFile: PROCEDURE [stp: Handle, stream: IO.STREAM, file: Rope.ROPE, sendEOC: BOOLEAN _ TRUE]; PutPList: PROCEDURE [stp: Handle, mark: [0..256), sendEOC: BOOLEAN _ TRUE]; <> CollectString: PROCEDURE [stp: Handle] RETURNS[ Rope.ROPE ]; CollectCode: PROCEDURE [stp: Handle] RETURNS[code: CHARACTER]; CheckConnection: PROCEDURE [stp: Handle]; ErrorIfNextNotEOC: PROCEDURE [stp: Handle]; ErrorIfNextNotYes: PROCEDURE [stp: Handle]; FindFileType: PROCEDURE [stream: IO.STREAM] RETURNS[fileType: STP.Type]; GetServerType: PROCEDURE [server: Rope.ROPE] RETURNS [serverType: ServerType]; LookAtMark: PROCEDURE [stp: Handle] RETURNS [[0..256)]; MakeRemoteName: PROCEDURE [plist: PList, type: FilenameType] RETURNS[name: Rope.ROPE]; MyGetChar: PROCEDURE [stp: Handle] RETURNS [char: CHARACTER]; MyGetMark: PROCEDURE [stp: Handle] RETURNS [[0..256)]; MyPutString: PROCEDURE [byteStream: IO.STREAM, string: Rope.ROPE]; PropertyString: PROCEDURE [prop: ValidProperties] RETURNS [string: Rope.ROPE]; SelectError: PROCEDURE [stp: Handle, s: Rope.ROPE, mark: [0..256)]; SetByteSize: PROCEDURE [stp: Handle, fileType: STP.Type]; SetCreateTime: PROCEDURE [stp: Handle, creation: BasicTime.GMT]; SetFileType: PROCEDURE [stp: Handle, fileType: STP.Type]; SmashClosed: PROCEDURE [stp: Handle]; <> DestroyPList: PROCEDURE [plist: PList] RETURNS [PList]; MakePList: PROCEDURE RETURNS[plist: PList]; NameToPList: PROCEDURE [plist: PList, name: Rope.ROPE, type: FilenameType]; PListToName: PROCEDURE [plist: PList, type: FilenameType] RETURNS[name: Rope.ROPE]; PutPListItem: PROCEDURE [byteStream: IO.STREAM, property: ValidProperties, value: Rope.ROPE]; ResetPList: PROCEDURE [plist: PList]; SetPListItem: PROCEDURE [plist: PList, property, value: Rope.ROPE]; UserStateToPList: PROCEDURE [stp: Handle]; <> BadProperty: ERROR; MarkEncountered: ERROR; ErrorCodeToSTPErrorCode: PROCEDURE [errorCode: STP.ErrorCode, code: CHARACTER] RETURNS[STP.ErrorCode]; GenerateErrorString: PROCEDURE [stp: Handle, errorCode: STP.ErrorCode, string: Rope.ROPE, code: CHARACTER _ 0C]; GenerateStreamClosingError: PROCEDURE [stp: Handle, why: PupStream.CloseReason]; GenerateProtocolError: PROCEDURE [stp: Handle, type: ProtocolError, mark: [0..256), code: CHARACTER _ 0C]; ProtocolError: TYPE = {badVersion, badMark, badPList, eocExpected, noCode}; <> markRetrieve: [0..256) = 1B; markStore: [0..256) = 2B; markYes: [0..256) = 3B; markNo: [0..256) = 4B; markHereIsFile: [0..256) = 5B; markEOC: [0..256) = 6B; markComment: [0..256) = 7B; markIAmVersion: [0..256) = 10B; markNewStore: [0..256) = 11B; markDirectory: [0..256) = 12B; markHereIsPList: [0..256) = 13B; markNewDirectory: [0..256) = 14B; markAbort: [0..256) = 15B; markDelete: [0..256) = 16B; markRename: [0..256) = 17B; <> markStoreMail: [0..256) = 20B; markRetrieveMail: [0..256) = 21B; markFlushMailBox: [0..256) = 22B; markMailBoxException: [0..256) = 23B; END.