DIRECTORY BTree USING [UpdateType], Rope USING [ROPE], YggDID USING [DID], YggEnvironment USING [TransID]; YggNaming: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; ErrorDesc: TYPE = RECORD [code: ATOM, explanation: ROPE] _ [NIL, NIL]; Error: ERROR [error: ErrorDesc]; MkDir: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [directoryAlreadyExists: BOOL]; RmDir: PROC [trans: YggEnvironment.TransID, did: YggDID.DID] RETURNS [directoryDoesNotExist: BOOL]; UpdateItem: PROC [trans: YggEnvironment.TransID, directoryDid: YggDID.DID, name: ROPE, version: ROPE, did: YggDID.DID, updateType: BTree.UpdateType _ insertOrReplace] RETURNS [notADirectory: BOOL, nameFound: BOOL]; DeleteItem: PROC [trans: YggEnvironment.TransID, directoryDid: YggDID.DID, name: ROPE, version: ROPE] RETURNS [found: BOOLEAN]; Lookup: PROC [trans: YggEnvironment.TransID, directoryDid: YggDID.DID, namePattern: ROPE, version: ROPE] RETURNS [nameFound: BOOL, moreThanOneMatch: BOOL, didFound: YggDID.DID, nameMatched: ROPE, versionMatched: ROPE]; Version: TYPE = RECORD [CARDINAL]; EnumProc: TYPE = PROC [name: REF TEXT, version: Version, did: YggDID.DID] RETURNS [stop: BOOL _ FALSE]; EnumerateEntries: PROC [trans: YggEnvironment.TransID, directoryDid: YggDID.DID, namePattern: ROPE, version: ROPE, nameToStart: ROPE, nameToStartVersion: ROPE, proc: EnumProc] RETURNS [notADirectory: BOOL, completedEnumerate: BOOL]; HasDirectory: PROC [trans: YggEnvironment.TransID, directoryDid: YggDID.DID] RETURNS [isDirectory: BOOL]; PreCommit: PROC[tid: YggEnvironment.TransID]; Commit: PROC[tid: YggEnvironment.TransID]; Abort: PROC[tid: YggEnvironment.TransID]; END. ξYggNaming.mesa Copyright Σ 1988 by Xerox Corporation. All rights reserved. Bob Hagmann January 24, 1989 10:32:33 am PST This interface provides the naming interface to Yggdrasil. Errors An error description reports the code ATOM indicating exactly what went wrong. The "explanation" is intended to be a description of the error suitable for human consumption; it frequently contains the name of the object being operated upon. Directories ! $commitFailed => bug; should always commit. Make a new directory. If trans is not null, then a directory lock on the did is held. Caller should commit soon. ! $nullTransaction => RmDir needs a real transaction ! $cantGetDirectoryLock => could not get write lock; retry might work Destroy a directory. trans has to be a valid transaction. A directory lock on the did is held. Caller should commit soon. Files ! $nullTransaction => UpdateItem needs a real transaction ! $cantGetDirectoryLock => could not get write lock; retry might work ! $badVersionSpec => version specification is bogus Update the name/version in the directory property of the directoryDid. If nameFound is TRUE, then the name/version specifies a file that already exists and updateType was insert; no update occured. The version must be an explicit version or the string "h". An updateType = insert with a version of "h" means insert a new version with its version number one more than the highest version found. ! $nullTransaction => UpdateItem needs a real transaction ! $cantGetDirectoryLock => could not get write lock; retry might work ! $badVersionSpec => version specification is bogus Delete the name/version's in the directory property of the directoryDid. Look up the name/version in the directory property of the directoryDid. The namePattern may include "*" characters. The version is either NIL (highest version), "h" (highest version), "l" (lowest version), or the ASCII string for a number (base 10). If nameFound is TRUE, then the name/version specifies a single file and it's did is returned in didFound while its name/version is returned in nameMatched and versionMatched. If nameFound is FALSE but moreThanOneMatch is TRUE, then the name/version specifies more than one file. didFound is not interesting. If both nameFound and moreThanOneMatch are FALSE, then no names match the name/version and didFound is not interesting. ! $cantGetDirectoryLock => could not get read lock; retry might work Calls `proc' for each entry in the specified matching key values (see Lookup above). The enumeration is halted when either the matching of entries is exhausted or `proc' returns FALSE. If non-NIL, nameToStart/nameToStartVersion is less than or equal to all the names presented. Returns TRUE iff there is a directory contents Transactions Κh˜code•Mark outsideHeaderšœ™Kšœ<™