DIRECTORY BasicTime USING [GMT], FS USING [FileType, Lock, OpenFile], Rope USING [ROPE]; FSBackdoor: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; FileProcs: TYPE; CreateFileProcs: PROC [ GetClass: PROC [clientFile: REF] RETURNS [ATOM] _ NIL, SameFile: PROC [clientFile1, clientFile2: REF] RETURNS [BOOL] _ NIL, GetName: PROC [clientFile: REF] RETURNS [fullFName, attachedTo: Rope.ROPE] _ NIL, GetInfo: PROC [clientFile: REF] RETURNS [keep: CARDINAL, pages, bytes: INT, created: BasicTime.GMT, lock: FS.Lock, fileType: FS.FileType] _ NIL, SetPageCount: PROC [clientFile: REF, pages: INT] _ NIL, SetByteCountAndCreatedTime: PROC [clientFile: REF, bytes: INT, created: BasicTime.GMT] _ NIL, Read: UNSAFE PROC [clientFile: REF, from, nPages: INT, to: LONG POINTER] _ NIL, Write: PROC [clientFile: REF, to: INT, nPages: INT, from: LONG POINTER] _ NIL, Close: PROC [clientFile: REF] _ NIL ] RETURNS [REF FileProcs]; CreateProcsOpenFile: PROC [clientFile: REF, fileProcs: REF FileProcs] RETURNS [FS.OpenFile]; GetClientFileAndProcs: PROC [file: FS.OpenFile] RETURNS [clientFile: REF, fileProcs: REF FileProcs]; ErrorCode: TYPE = {ok -- used internally-- , inconsistent, software, badFP, wentOffline, hardware, volumeFull, fragmented, noMoreVersions, serverInaccessible, connectionRejected, connectionTimedOut, badCredentials, accessDenied, quotaExceeded, invalidPropertyPage, badBTree, outOfPropertySpace, lockConflict, fileBusy, noCache, wrongLock, globalWriteLock, zeroKeep, badByteCount, unknownPage, invalidOpenFile, notImplemented, fileTypeMismatch, nonCedarVolume, unknownServer, unknownVolume, unknownFile, unknownCreatedTime, illegalName, patternNotAllowed, versionSpecified, globalCreation, badWorkingDir, noKeeps, cantUpdateTiogaFile }; ProduceError: PROC [code: ErrorCode, explanation: Rope.ROPE]; END. φFSBackdoor.mesa Copyright Σ 1985, 1986, 1987 by Xerox Corporation. All rights reserved. Created by M. D. Schroeder Schroeder, September 15, 1983 1:56 pm Bob Hagmann May 6, 1988 1:38:47 pm PDT Tim Diebert: January 14, 1987 10:00:46 am PST Doug Wyatt, January 19, 1987 11:14:04 am PST Backdoors to the Cedar File System Client-provided open files FS provides a way for clients to implement objects with the TYPE FS.OpenFile. The client provides procedures that implement the operations on an FS.OpenFile. Refer to FS.mesa for the semantics of these procedures. The client procedures should raise FS.Error as appropriate. Client procedures can generate code ATOM's used by FS and can produce additional code ATOM's if needed. FS.Error's with existing code ATOM's should be generated using FSBackdoor.ProduceError (see below). The client is responsible for associating any new code ATOM's with the appropriate FS.ErrorGroup. Note that no locking is done by FS on client-provided FS.OpenFile's. FS produces FS.Error[client, $notImplemented] when an attempt is make to use any client procedures that are NIL. SameFile will only get called for two clientFiles with equal "REF FileProcs". Client errors: none User errors: none Whenever any of the procedures above are called for the FS.OpenFile returned by FSBackdoor.CreateProcsOpenFile, the "clientFile" argument to CreateProcsOpenFile is passed on as the identification of the open file that is to be operated upon. Client errors: none User errors: none If "file" is a client-provided FS.OpenFile then the "clientFile" and "fileProcs" are returned, otherwise NIL is returned for both results. Client errors: $invalidOpenFile User error: none Raises FS.Error for the code ATOM that corresponds lexically to the "code". The FS.ErrorGroup in the error is properly set. The error will contain "explanation". Clients should use this procedure to generate FS.Error's for existing codes to avoid spelling the ATOM's wrong and getting the wrong FS.ErrorGroup. ΚP– "cedar" style˜codešœ™KšœH™HKšœ™K™%K™&K™-K™,—K™Kšœ"™"K™šΟk œ˜ Kšœ œœ˜Kšœœ˜$Kšœœœ˜—K˜KšΠbl œœ ˜šœ˜K˜Kšœœœ˜K˜K˜—™š$œ:œœOœœQœ<œ œ!œœœyœœ.œœœ œ^œ™όK˜—K˜Kšœ œ˜K˜š~ΟnœœŸœœœœœœŸœœœœœœŸœœœœœœŸœœœœœœœœœ œŸ œœœ œœŸœœœ œœœŸœœœœœœœœŸœœœœ œœœœŸœœœœœœ ˜πK™Kšœ>œ ™MK™Kšœ™Kšœ™K˜—K˜š Ÿœœœ œ œœ ˜\K™Kšœ8œ·™ρK™Kšœ™Kšœ™K˜—K˜š Ÿœœœ œœ œ ˜dK™KšœœHœ™ŠK™Kšœ ™ Kšœ™K™—K™Kšœ œΟcœΠ˜ϋK˜šŸ œœ%œ˜=K™Kš œœœ0œ€œ2œœ™»—™K™—K˜—K˜šœ˜K˜K™——…—.t