FamousPath.Mesa
Copyright Ó 1990 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on May 4, 1990 9:36:12 am PDT
FamousPath:
CEDAR
DEFINITIONS = {
ROPE: TYPE ~ Rope.ROPE;
FName: TYPE ~ ROPE;
DirectoryList: TYPE ~ LIST OF FName;
Search:
PROC [packageName:
ROPE, relativeFName: FName]
RETURNS [fullFName, directory: FName];
Searches the famous path (which may someday depend on the given package) for the given relative file name. Returns [NIL, NIL] if not found; otherwise, fullFName is equal to directory.Concat[relativeFName] modulo case, except that relativeFName may have less specific version information than the corresponding part of fullFName.
Get:
PROC [packageName:
ROPE]
RETURNS [DirectoryList];
Returns the famous path, which might depend on the package using it.
SearchList:
PROC [list: DirectoryList, relativeFName: FName]
RETURNS [fullFName, directory: FName];
Searches the given path for the given relative file name. Returns [NIL, NIL] if not found; otherwise, fullFName is equal to directory.Concat[relativeFName] modulo case, except that relativeFName may have less specific version information than the corresponding part of fullFName.
Resolve:
PROC [packageName:
ROPE, fName: FName]
RETURNS [fullFName: FName];
If given a relative name, returns Search[packageName, fName].fullFName;
if given an absolute name, returns it.
ListResolve:
PROC [list: DirectoryList, fName: FName]
RETURNS [fullFName: FName];
If given a relative name, returns SearchList[list, fName].fullFName;
if given an absolute name, returns it.
}.