DIRECTORY PFSNames USING [PATH], Rope USING [ROPE]; PFSPrefixMap: CEDAR DEFINITIONS ~ BEGIN PATH: TYPE = PFSNames.PATH; Entry: TYPE ~ RECORD [ prefix: PATH, translation: PATH ]; EntryList: TYPE ~ LIST OF Entry; TranslationWithHints: TYPE ~ RECORD [ translation: PATH, -- the complete translation. fsName: Rope.ROPE, -- the rope part of the first component of the complete translation nameOnFS: PATH, -- translation with empty server part replacedPrefix: PATH, -- components in source name replaced ... suppliedPrefixLen: CARDINAL -- number of components in translation (and nameOnFS) which replaced them ]; Translate: PROC [name: PATH] RETURNS [PATH]; TranslateAndGetHints: PROC [name: PATH] RETURNS [TranslationWithHints]; Insert: PROC [prefix: PATH, translation: PATH]; Delete: PROC [name: PATH] RETURNS [PATH]; Lookup: PROC [prefix: PATH] RETURNS [PATH]; GetMap: PROC [] RETURNS [EntryList]; SetMap: PROC [map: EntryList]; END. ς PFSPrefixMap.mesa Copyright Σ 1989 by Xerox Corporation. All rights reserved. Carl Hauser, June 8, 1989 5:38:45 pm PDT Copied Types Types Procedures 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 the map for prefix. Replace any existing translation. 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. Sets the entire map. Κ>™šœ™Icode™