VersionMapClassify.mesa
Copyright Ó 1990, 1992 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on August 13, 1990 7:35 am PDT
DIRECTORY BasicTime, IO, Rope, VersionMap;
VersionMapClassify: CEDAR DEFINITIONS = {OPEN VersionMap;
ROPE: TYPE ~ Rope.ROPE;
NullVersion: VersionStamp = [0, 0];
BadVersion: VersionStamp = [CARD32.LAST, CARD32.LAST];
Classify: PROC [name: ROPE] RETURNS [kind: Kind];
KindSet: TYPE ~ { unknown, source, intermediate, sparc, sparcOpt, all };
Kind: TYPE ~ KindSet[unknown..sparcOpt];
KindName: READONLY ARRAY KindSet OF ROPE;
CreatedToMimosaVersionStamp: PROC [BasicTime.GMT] RETURNS [VersionStamp];
MapListLookup: PROC [mapList: MapList, fullName: ROPE, created: BasicTime.GMT, onlyOne, testCreated, testName: BOOL] RETURNS [found: BOOL, fromMap: ROPE, version: VersionStamp];
If onlyOne, try only what's reported by VersionToName[mapList, CreatedToMimosaVersionStamp[created]]; otherwise, try what's reported by ShortNameToRanges[mapList, ShortName[fullName]].
ReadVersionStamp: PROC [kind: Kind, fullName: ROPE, created: BasicTime.GMT, rejectServerInaccessible: BOOL] RETURNS [stamp: VersionStamp, whyNot, warning: ROPE];
created must be correct. Consults file contents if necessary. Either stamp=BadVersion and whyNot, #NIL, gives an error message, or whyNot=NIL. If warning#NIL, something unusual occured, but stamp#BadVersion. If rejectServerInaccessible, such errors will be allowed to propogate to caller.
}.