FSName.Mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last Edited by:
Schroeder, November 15, 1983 1:22 pm
Bob Hagmann February 4, 1985 9:39:31 am PST
DIRECTORY
FSBackdoor USING [Version],
FSFileOps USING [VolumeDesc],
Rope USING [ROPE, Text];
FSName: CEDAR DEFINITIONS = BEGIN
ParsedFName: TYPE = RECORD [fullName: Rope.ROPE, nameBody: Rope.Text, version: FSBackdoor.Version, volDesc: FSFileOps.VolumeDesc];
VersionInfo: TYPE = { missing, number, bangStar, bangH, bangL };
ParseClientName: PROCEDURE [clientName, wDir: Rope.ROPE, defaultVersionHigh: BOOLEANTRUE, pattern: BOOLEANFALSE] RETURNS [pn: ParsedFName, vI: VersionInfo];
The "clientName" and "wDir" are converted to a complete FName in brackets syntax. The default working directory will be used if "wDir" is not provided and "clientName" is not full. "pn" returns the full FName in brackets syntax inclusing version part, the name body, and the version scalar. "pn" also returns the associated volume descriptor; if the the wDir/clientName is a GName, then the volume descriptor is for the system volume. A missing version defaults high or low, depending on "defaultVersionHigh". "vI" describes the version part found in "clientName". An FS.Error[$illegalName] is raised if syntax or length constraints are violated. FS.Error[$unknownVolume] and FS.Error[$nonCedarVolume] will occur except for an LName from the system volume and a GName pn.volDesc returns as NIL instead. "*" is an allowed character if "pattern" is TRUE.
ParseCacheName: PROCEDURE [volName, cacheName: Rope.ROPE, pattern: BOOLEANFALSE] RETURNS [pn: ParsedFName, vI: VersionInfo];
Parses a name or pattern for accessing the cache. "pattern" controls whether "*" is an allowed character. The components of "pn" are set as follows: "fullName" is NIL; "nameBody" is the name body converted to brackets syntax if necessary; "version" is the version number, and "volDesc" is the volume descriptor that goes with "volName". "vI" describes the version part found in "cacheName". Can produce FS.Error[$illegalName].
ConvertNamebodyPattern: PUBLIC PROC [nbP: Rope.ROPE] RETURNS [Rope.Text];
If the length of the argument ROPE is 0 then "*" is returned. Otherwise, the argument is converted from slash to bracket syntax if necessary and returned. No syntax checking is performed and no ERROR's can be raised.
ParseName: PROCEDURE [volName, fName: Rope.ROPE] RETURNS [ParsedFName];
Parses a well-formed, complete FName (without a volume part if local). "fullName" is "fName", "nameBody" is the name body, "version" is the version number, and "volDesc" is the volume descriptor for "volName". A missing version defaults high. No syntax checking is performed.
IsLocal: PROCEDURE [name: Rope.ROPE] RETURNS [BOOLEAN];
Indictes whether a name is local or remote. RETURNS [ Rope.Length[name] = 0 OR Rope.Fetch[name, 0] # '[ OR Rope.Fetch[name, 1] = '] ].
ServerAndFileRopes: PROCEDURE [gName: Rope.ROPE] RETURNS [server, file: Rope.ROPE];
Returns the server and file parts of the full GName presented.
BangStarFile: PROCEDURE [file: Rope.ROPE] RETURNS [Rope.ROPE];
Produces a ROPE from the characters in "file" with any version part replaced by "!*".
BangVersionFile: PROCEDURE [file: Rope.ROPE, version: FSBackdoor.Version] RETURNS [Rope.ROPE];
Produces a ROPE from the characters in "file" with any version part replaced by "!" followed with the character representation of "version". If version is FSBackdoor.noVersion then the name returned will have no version part.
VersionFromRope: PROCEDURE [r: Rope.ROPE] RETURNS [FSBackdoor.Version];
Produces a version from a ROPE containing digits. Produces FSbackdoor.highestVersion if Rope.Length[r] = 0;
VersionPartFromVersion: PROCEDURE [version: FSBackdoor.Version] RETURNS [Rope.ROPE];
Produces a version part of the form "!xxxxx" from the version provided. If the version is FSBackdoor.highestVersion, FSBackdoor.noVersion, or FSBackdoor.lowestVersion then NIL is returned.
END.
Bob Hagmann February 4, 1985 9:39:13 am PST
changes to: Copyright