-- File: STP.mesa Edited by: -- Smokey, 6-Jul-81 17:58:25 -- Karlton, 9-Dec-81 18:11:47 -- Bruce, 10-Nov-81 16:15:44 -- Mark, 21-May-81 15:45:50 -- JGS, 14-Aug-81 16:50:01 -- Davirro, 27-Aug-82 15:40:22 -- Loretta, 14-Sep-82 15:10:46 -- Schmidt February 6, 1983 9:03 pm -- Andrew Birrell June 1, 1983 2:45 pm DIRECTORY BasicTime USING [GMT], IO USING [STREAM], Rope USING[ROPE]; STP: CEDAR DEFINITIONS = { -- Types and data 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.ROPE]; ConfirmProcType: TYPE = PROC[file: Rope.ROPE] RETURNS [answer: Confirmation, localStream: IO.STREAM]; NoteFileProcType: TYPE = PROC [file: Rope.ROPE] RETURNS [continue: Continue]; FileInfo: TYPE = REF FileInfoObject; FileInfoObject: TYPE = RECORD [ directory, body, version: Rope.ROPE _ NIL, author: Rope.ROPE _ NIL, create, read, write: Rope.ROPE _ NIL, size: INT _ 0, type: Type _ unknown]; Type: TYPE = MACHINE DEPENDENT {unknown(0), text, binary}; -- Procedures Create: PROC RETURNS [stp: Handle]; Open: PROC [stp: Handle, host: Rope.ROPE] RETURNS [herald: Rope.ROPE]; Close: PROC [stp: Handle]; -- set credentials Login: PROC [stp: Handle, name, password: Rope.ROPE]; Connect: PROC [stp: Handle, name, password: Rope.ROPE]; -- set various properties SetHost: PROC [stp: Handle, host: Rope.ROPE]; SetDirectory: PROC [stp: Handle, directory: Rope.ROPE]; SetDesiredProperties: PROC [stp: Handle, props: DesiredProperties]; -- query various properties IsOpen: PROC [stp: Handle] RETURNS [yes: BOOL]; GetFileInfo: PROC [stp: Handle] RETURNS [FileInfo]; GetProperty: PROC [stp: Handle, prop: ValidProperties] RETURNS [Rope.ROPE]; GetDesiredProperties: PROC [stp: Handle] RETURNS [props: DesiredProperties]; -- retrieve, store, etc. CreateRemoteStream: PROC [ stp: Handle, file: Rope.ROPE, access: Access, fileType: Type _ unknown, creation: BasicTime.GMT _ NULL -- use this default iff access = read -- ] RETURNS[stream: IO.STREAM]; NextFileName: PROC [remoteStream: IO.STREAM] RETURNS [file: Rope.ROPE]; Delete: PROC [ stp: Handle, name: Rope.ROPE, confirm: ConfirmProcType _ NIL, complete: CompletionProcType _ NIL]; Enumerate: PROC [stp: Handle, name: Rope.ROPE, proc: NoteFileProcType]; Rename: PROC [stp: Handle, old, new: Rope.ROPE]; Retrieve: PROC [ stp: Handle, file: Rope.ROPE, confirm: ConfirmProcType _ NIL, complete: CompletionProcType _ NIL]; Store: PROC [ stp: Handle, file: Rope.ROPE, stream: IO.STREAM, noteFile: NoteFileProcType _ NIL, fileType: Type _ unknown, creation: BasicTime.GMT]; -- Signals and Errors Error: SIGNAL [ stp: Handle, code: ErrorCode, error: Rope.ROPE, reply: CHAR _ 0C]; ErrorCode: TYPE = { -- connection errors noSuchHost, noRouteToNetwork, noNameLookupResponse, alreadyAConnection, noConnection, connectionClosed, connectionRejected, connectionTimedOut, -- credentials errors accessDenied, illegalUserName, illegalUserPassword, illegalUserAccount, illegalConnectName, illegalConnectPassword, credentailsMissing, -- protocol errors protocolError, -- file errors illegalFileName, noSuchFile, requestRefused, -- remote stream errors accessError, -- catch all undefinedError}; ConnectionErrors: TYPE = ErrorCode[noSuchHost..connectionTimedOut]; CredentialsErrors: TYPE = ErrorCode[accessDenied..credentailsMissing]; FileErrors: TYPE = ErrorCode[illegalFileName..requestRefused]; }. -- end of STP Ê˜Jš³ÏcıœÏk œ žœžœžœžœžœ žœžœžœžœž œ œ žœžœžœžœ žœžœžœ)žœóžœžœžœžœžœžœžœÏnœžœžœ%žœŸœžœžœ žœžœ%žœžœŸœžœžœ žœžœ#žœžœ#žœžœ&žœžœžœžœ žœžœ žœ)žœžœž œ!œŸœžœžœŸœžœžœžœžœŸœžœœŸœžœ$žœŸœžœ$žœœŸœžœžœŸ œžœžœŸœžœ-œŸœžœžœžœŸ œžœžœŸ œžœ&žœžœŸœžœžœ"œŸœžœ#žœLžœžœ+œžœ žœžœŸ œžœžœžœžœ žœŸœžœ#žœ!žœ%žœŸ œžœžœŸœžœžœŸœžœ#žœ!žœ%žœŸœžœ#žœžœžœ#žœ9žœ œ žœ-žœ žœžœ œ œ–œœ5œ œ.žœCžœ>žœ7˜Ħ —…—$·