DIRECTORY BcdDefs USING [VersionStamp], Rope USING [ROPE], VersionMap USING [Map, MapList, RestoreMapFromFile, VersionToName], VersionMapDefaults USING []; VersionMapDefaultsImpl: CEDAR MONITOR IMPORTS VersionMap EXPORTS VersionMapDefaults = BEGIN OPEN Rope; WhichMapList: TYPE = ATOM; assumeImmutable: BOOL _ TRUE; root: EntryList _ NIL; EntryList: TYPE = LIST OF Entry; Entry: TYPE = RECORD [key: ATOM _ NIL, mapList: VersionMap.MapList _ NIL]; FileNameFromVersion: PUBLIC PROC [which: ATOM, version: BcdDefs.VersionStamp] RETURNS [name: ROPE _ NIL] = { mapList: VersionMap.MapList _ GetMapList[which]; IF mapList # NIL THEN name _ VersionMap.VersionToName[mapList, version].name; }; GetMapList: PUBLIC ENTRY PROC [which: ATOM] RETURNS [list: VersionMap.MapList _ NIL] = { mapFileName: ROPE _ NIL; FOR eList: EntryList _ root, eList.rest WHILE eList # NIL DO IF eList.first.key = which THEN RETURN [eList.first.mapList]; ENDLOOP; SELECT which FROM $Source => mapFileName _ "CedarSource.VersionMap"; $Symbols => mapFileName _ "CedarSymbols.VersionMap"; ENDCASE => RETURN; list _ LIST[VersionMap.RestoreMapFromFile[mapFileName, TRUE]]; root _ CONS[Entry[which, list], root]; }; AddToMapList: PUBLIC ENTRY PROC [which: ATOM, map: VersionMap.Map] = { mapList: VersionMap.MapList _ LIST[map]; IF map = NIL THEN RETURN; FOR eList: EntryList _ root, eList.rest WHILE eList # NIL DO IF eList.first.key = which THEN { mapList.rest _ eList.first.mapList; eList.first.mapList _ mapList; RETURN}; ENDLOOP; root _ CONS[Entry[which, mapList], root]; }; SetMapList: PUBLIC ENTRY PROC [which: ATOM, list: VersionMap.MapList _ NIL] = { FOR eList: EntryList _ root, eList.rest WHILE eList # NIL DO IF eList.first.key = which THEN { eList.first.mapList _ list; RETURN}; ENDLOOP; root _ CONS[Entry[which, list], root]; }; END. ¸VersionMapDefaultsImpl.mesa Russ Atkinson, April 19, 1983 9:55 am These definitions give access to the default source and object version maps. Operations on default version map lists. $Source => the source symbol version map list (initially from CedarSource.VersionMap) $Symbols => the source symbol version map list (initially from CedarSymbols.VersionMap) other => a user-defined version map variety (initially empty) ... returns a name corresponding to the given version stamp in the indicated map list (does not check for multiple names, since that is the responsibility of the version map creator). ... gets the current selected version map list. If there is no such map, then NIL will be returned unless which = $Source or which = $Symbols, which will restore the official version maps from CedarSource.VersionMap or CedarSymbols.VersionMap respectively. ... adds a new map to the lookup list. Use this proc for adding personal version maps. There is no mapList under this key, so add it .. sets the current version map for source files. Since there can be a race between GetMapList and SetMapList, this operation should not be casually used! There is no mapList under this key, so add it ÊK˜Jšœ™Jšœ%™%J™J™LJ™šÏk ˜ Jšœœ˜Jšœœœ˜Jšœ œ3˜CJšœœ˜J˜—šœœ˜%Jšœ ˜Jšœ˜Jšœœœ˜J˜Jšœ(™(J˜šœœœ˜JšœU™UJšœW™WJ™=—J˜Jšœœœ˜Jšœœ˜Jšœ œœœ˜ Jš œœœœœ œ˜JJ˜šÏnœœ˜ Jš œœ!œœœ˜KJšœ·™·Jšœ0˜0šœ œ˜Jšœ7˜7—Jšœ˜J˜—šž œœœ˜Jšœœœœ˜:Jšœ‚™‚Jšœ œœ˜šœ%œ œ˜Jšœœ˜&J˜J˜—š ž œœœœ œ˜FJšœW™WJšœœ˜(Jšœœœœ˜šœ%œ œ˜<šœœ˜!Jšœ#˜#Jšœ˜Jšœ˜—Jšœ˜—Jšœ-™-Jšœœ˜)J˜J˜—š ž œœœœ œœ˜OJšœ›™›šœ%œ œ˜<šœœ˜!Jšœ˜Jšœ˜—Jšœ˜—Jšœ-™-Jšœœ˜&J˜J˜—Jšœ˜J˜J˜—J˜—…—!