<> <> <> <<>> DIRECTORY BasicTime USING [GMT], FS USING [FileType], FSBackdoor USING [Version], IO USING [STREAM], Rope USING [ROPE] ; FSRemoteFileBackdoor: CEDAR DEFINITIONS ~ { <> GMT: TYPE ~ BasicTime.GMT; ROPE: TYPE ~ Rope.ROPE; Version: TYPE ~ FSBackdoor.Version; FileType: TYPE ~ FS.FileType; <> ServerHandle: TYPE ~ REF ServerObject; ServerObject: TYPE ~ RECORD [ flavor: ATOM, name: ROPE, -- e.g. "Palain-NFS" procs: ServerProcs, data: REF ]; ServerProcs: TYPE ~ REF ServerProcsObject; ServerProcsObject: TYPE ~ RECORD [ sweep: SweepProc _ NIL, validate: ValidateProc, delete: DeleteProc, do: DoProc, enumerateForInfo: EnumerateForInfoProc, enumerateForNames: EnumerateForNamesProc, getInfo: GetInfoProc, rename: RenameProc, retrieve: RetrieveProc, store: StoreProc, open: OpenProc, close: CloseProc, rw: RWProc ]; SweepProc: TYPE ~ PROC [h: ServerHandle, seconds: CARD]; <> ValidateProc: TYPE ~ PROC [h: ServerHandle] RETURNS [obsolete: BOOL, downMsg: ROPE]; <> <> <> <> <> <> <> <> <> <> DeleteProc: TYPE ~ PROC [h: ServerHandle, file: ROPE, wantedCreatedTime: GMT, case: BOOL, proc: ConfirmProc _ NIL]; <> <> ConfirmProc: TYPE ~ PROC [version: FSBackdoor.Version] RETURNS [ok: BOOLEAN]; DoProc: TYPE ~ PROC [h: ServerHandle, cmd: ATOM, arg: REF, result: REF]; <> EnumerateForInfoProc: TYPE ~ PROC [h: ServerHandle, pattern: ROPE, case: BOOL, proc: InfoProc]; <> InfoProc: TYPE ~ PROC [file: ROPE, bytes: INT, created: GMT, type: FileType] RETURNS [continue: BOOL]; EnumerateForNamesProc: TYPE ~ PROC [h: ServerHandle, pattern: ROPE, case: BOOL, proc: NameProc]; <> NameProc: TYPE ~ PROC [file: ROPE] RETURNS [continue: BOOL]; GetInfoProc: TYPE ~ PROC [h: ServerHandle, file: ROPE, wantedCreatedTime: GMT, case: BOOL] RETURNS [version: Version, bytes: INT, created: GMT, fileType: FileType]; <> RenameProc: TYPE ~ PROC [h: ServerHandle, fromFile: ROPE, fromCreated: GMT, toFile: ROPE, case: BOOL, proc: ConfirmProc _ NIL]; <> RetrieveProc: TYPE ~ PROC [h: ServerHandle, file: ROPE, wantedCreatedTime: GMT, case: BOOL, proc: ConfirmRetrieveProc]; <> ConfirmRetrieveProc: TYPE ~ PROC [file: ROPE, bytes: INT, created: GMT, type: FileType] RETURNS [IO.STREAM]; StoreProc: TYPE ~ PROC [h: ServerHandle, file: ROPE, case: BOOL, str: IO.STREAM, created: GMT, proc: ConfirmProc _ NIL]; <> <> <> <> FileHandle: TYPE ~ REF; OpenProc: TYPE ~ PROC [h: ServerHandle, cmd: ATOM, file: ROPE, wantedCreatedTime: GMT, case: BOOL, proc: ConfirmRetrieveProc _ NIL] RETURNS [FileHandle]; <> <> <<$read : file must already exist>> <<$write : also allows reading; file must already exist>> <<$create : like $write, but creates file if it doesn't exist>> <<$exclusiveCreate : like $write, but fails if file already exists>> CloseProc: TYPE ~ PROC [h: ServerHandle, fileHandle: FileHandle]; RWProc: TYPE ~ PROC [h: ServerHandle, fileHandle: FileHandle, cmd: ATOM, bytePos: CARD, block: REF TEXT] RETURNS [bytesTransferred: CARD]; <> <<$read : behaves like IO.GetBlock, may return a short block.>> <<$write : behaves like IO.PutBlock; short transfer is an error.>> <> Register: PROC [flavor: ATOM, getServer: GetServerProc]; <> GetServerProc: TYPE ~ PROC [server: ROPE] RETURNS [h: ServerHandle, downMsg: ROPE]; <> <> <> <> <> <> GetServer: PROC [server: ROPE] RETURNS [h: ServerHandle]; <> <> <> ErrorNotImplemented: PROC [h: ServerHandle, file, msg: ROPE _ NIL]; <> <> <> SetCachedServer: PROC [server: ROPE, flavor: ATOM]; <> ClearCachedServer: PROC [server: ROPE]; }...