DIRECTORY PFSPrefixMap USING [EntryList, TranslationWithHints], PFSNames USING [PATH], Rope USING [ROPE]; PFSPrefixMapExtras: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE = Rope.ROPE; PATH: TYPE = PFSNames.PATH; EntryList: TYPE = PFSPrefixMap.EntryList; TranslationWithHints: TYPE = PFSPrefixMap.TranslationWithHints; PrefixTableList: TYPE ~ LIST OF PrefixTableEntry; PrefixTableEntry: TYPE ~ RECORD [ prefix: PATH, translation: PATH, fsName: ROPE, suppliedPrefixLen: CARDINAL _ 0 ]; TranslateWithPTable: PROC [name: PATH, pTable: PrefixTableList _ NIL] RETURNS [PATH]; TranslateAndGetHintsWithPTable: PROC [name: PATH, pTable: PrefixTableList _ NIL] RETURNS [TranslationWithHints]; InsertIntoPTable: PROC [prefix: PATH, translation: PATH, pTable: PrefixTableList _ NIL] RETURNS[newPTable: PrefixTableList]; InsertIntoNewPTable: PROC [prefix: PATH, translation: PATH] RETURNS[newPTable: PrefixTableList]; DeleteFromPTable: PROC [name: PATH, pTable: PrefixTableList _ NIL] RETURNS [existing: PATH, newPTable: PrefixTableList]; LookupWithPTable: PROC [prefix: PATH, pTable: PrefixTableList _ NIL] RETURNS [PATH]; GetMapFromPTable: PROC [pTable: PrefixTableList _ NIL] RETURNS [EntryList]; SetMapFromPTable: PROC [pTable: PrefixTableList _ NIL]; FromMapToPTable: PROC [map: EntryList _ NIL] RETURNS[PrefixTableList]; END. κ PFSPrefixMapExtras.mesa Copyright Σ 1990 by Xerox Corporation. All rights reserved. Willie-s, July 26, 1990 1:12 pm PDT Copied Types Types Procedures These are like the procedures in PFSPrefixMap, except that they can be supplied with an alternate mapping list. If pTable is NIL, it defaults to the builtin mapping. Returns name with the translation corresponding to the longest prefix of name appearing in the map substituted for that prefix. TranslationWithHints.translation = Translate[name]; Other fields could be computed by the client but are more easily computed in this impl (because they can be cached). Adds a translation to pTable for prefix. Replace any existing translation. To start a new PrefixTableList. Removes any translation in the map for prefix. Returns the existing translation (or NIL if none). Returns the translation of prefix (exact match required); NIL if none; Returns the entire map from pTable. Returns the entire map from pTable. Sets the entire map. Κ—™šœ™Icode™