<> <> <> <> <> <> <> <> <> <> <> <> DIRECTORY BasicTime USING [GMT], IO USING [STREAM], Rope USING [ROPE]; STP: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; GMT: TYPE = BasicTime.GMT; <> Handle: TYPE = REF Object; Object: TYPE; Access: TYPE = {read, write}; Completion: TYPE = {ok, error}; Continue: TYPE = {yes, no}; Confirmation: TYPE = {do, skip, abort}; ValidProperties: TYPE = { userName, userPassword, connectName, connectPassword, directory, nameBody, version, createDate, readDate, writeDate, byteSize, type, size, author, eolConversion, account, userAccount, device, serverName}; DesiredProperties: TYPE = PACKED ARRAY ValidProperties OF BOOL _ ALL[FALSE]; CompletionProcType: TYPE = PROC[what: Completion, fileOrError: ROPE]; ConfirmProcType: TYPE = PROC[file: ROPE] RETURNS [answer: Confirmation, localStream: STREAM]; NoteFileProcType: TYPE = PROC [file: ROPE] RETURNS [continue: Continue]; FileInfo: TYPE = REF FileInfoObject; FileInfoObject: TYPE = RECORD [ directory, body, version: ROPE _ NIL, author: ROPE _ NIL, create, read, write: ROPE _ NIL, size: INT _ 0, type: Type _ unknown ]; Type: TYPE = MACHINE DEPENDENT {unknown(0), text, binary}; <> Create: PROC RETURNS [stp: Handle]; Open: PROC [stp: Handle, host: ROPE] RETURNS [herald: ROPE]; Close: PROC [stp: Handle]; <> Login: PROC [stp: Handle, name, password: ROPE]; Connect: PROC [stp: Handle, name, password: ROPE]; <> SetHost: PROC [stp: Handle, host: ROPE]; SetDirectory: PROC [stp: Handle, directory: ROPE]; SetDesiredProperties: PROC [stp: Handle, props: DesiredProperties]; <> IsOpen: PROC [stp: Handle] RETURNS [yes: BOOL]; GetFileInfo: PROC [stp: Handle] RETURNS [FileInfo]; GetProperty: PROC [stp: Handle, prop: ValidProperties] RETURNS [ROPE]; GetDesiredProperties: PROC [stp: Handle] RETURNS [props: DesiredProperties]; <> CreateRemoteStream: PROC [ stp: Handle, file: ROPE, access: Access, fileType: Type _ unknown, creation: GMT _ NULL -- use this default iff access = read -- ] RETURNS[stream: STREAM]; NextFileName: PROC [remoteStream: STREAM] RETURNS [file: ROPE]; Delete: PROC [ stp: Handle, name: ROPE, confirm: ConfirmProcType _ NIL, complete: CompletionProcType _ NIL]; Enumerate: PROC [stp: Handle, name: ROPE, proc: NoteFileProcType]; Rename: PROC [stp: Handle, old, new: ROPE]; Retrieve: PROC [ stp: Handle, file: ROPE, confirm: ConfirmProcType _ NIL, complete: CompletionProcType _ NIL]; Store: PROC [ stp: Handle, file: ROPE, stream: STREAM, noteFile: NoteFileProcType _ NIL, fileType: Type _ unknown, creation: GMT]; <> Error: SIGNAL [ stp: Handle, code: ErrorCode, error: ROPE, reply: CHAR _ 0C]; ErrorCode: TYPE = { <> noSuchHost, noRouteToNetwork, noNameLookupResponse, alreadyAConnection, noConnection, connectionClosed, connectionRejected, connectionTimedOut, <> accessDenied, illegalUserName, illegalUserPassword, illegalUserAccount, illegalConnectName, illegalConnectPassword, credentailsMissing, <> protocolError, <> illegalFileName, noSuchFile, requestRefused, <> accessError, <> undefinedError}; ConnectionErrors: TYPE = ErrorCode[noSuchHost..connectionTimedOut]; CredentialsErrors: TYPE = ErrorCode[accessDenied..credentailsMissing]; FileErrors: TYPE = ErrorCode[illegalFileName..requestRefused]; END.