DIRECTORY EnvironmentVariables, IO, PFS, PFSPrefixMap, Rope; PFSPrefixMapInit: CEDAR PROGRAM IMPORTS EnvironmentVariables, IO, PFS, PFSPrefixMap, Rope ~ BEGIN Item: PROC [prefix, translation: Rope.ROPE] ~ { IF Rope.IsEmpty[translation] THEN [] ¬ PFSPrefixMap.Delete[PFS.PathFromRope[prefix]] ELSE [] ¬ PFSPrefixMap.Insert[ prefix: PFS.PathFromRope[prefix], translation: PFS.PathFromRope[translation] ]; }; CheckDir: PROC[where: Rope.ROPE] RETURNS[ok: BOOL ¬ TRUE] ~ { [] ¬ PFS.FileInfo[PFS.PathFromRope[where] ! PFS.Error => { ok ¬ FALSE; CONTINUE} ]; }; CheckForEnvironmentVar: PROC ~ { fileName: Rope.ROPE ~ EnvironmentVariables.Get["CEDAR_PREFIXMAP_INIT"]; stream: IO.STREAM; IF fileName = NIL THEN RETURN; stream ¬ PFS.StreamOpen[PFS.PathFromRope[fileName] ! PFS.Error, IO.Error => CONTINUE]; IF stream = NIL THEN RETURN; BEGIN ENABLE IO.Error, IO.EndOfStream => { IO.Close[stream]; GOTO quit}; UNTIL IO.EndOf[stream] DO entry: Rope.ROPE ~ IO.GetRopeLiteral[stream]; translation: Rope.ROPE ~ IO.GetRopeLiteral[stream]; Item[entry, translation]; ENDLOOP; IO.Close[stream]; EXITS quit => NULL; END; }; Item["/cedar7.0", "-vux:/pseudo/cedar7.0"]; Item["/cedarchest7.0", "-vux:/pseudo/cedarchest7.0"]; Item["/cedarcommon2.0", "-vux:/pseudo/cedarcommon2.0"]; Item["/imagerfonts", "-ux:/import/imagerfonts"]; Item["/pcedar2.0", "-vux:/pseudo/pcedar2.0"]; Item["/release", "-vux:/project/cedar10.1/release"]; Item["/cedar10.1", "-vux:/project/cedar10.1/release"]; Item["/cedar", "-vux:/project/cedar10.1/release"]; Item["/ux/", "-ux:/"]; Item["/vux/", "-vux:/"]; Item["/xrhome", "-ux:/pseudo/xrhome"]; Item["/SchemeXerox", "-vux:/project/schemexerox"]; CheckForEnvironmentVar[]; END. Ξ PFSPrefixMapInit.mesa Copyright Σ 1989, 1990, 1991, 1992, 1993 by Xerox Corporation. All rights reserved. Carl Hauser, January 18, 1990 1:19:22 pm PST Michael Plass, February 22, 1992 0:48:07 am PST Willie-sue & Michael Plass, December 17, 1991 2:33 pm PST Willie-sue, June 25, 1993 10:39 am PDT Chauser, March 20, 1992 11:11 am PST Christian Jacobi, March 31, 1993 3:27 pm PST allows one to redefine the default prefixmap mapping early in the world the format for the file is to be (quotes are necessary): "/foo" "-vux:/a/b/c" "/fie/bar" "-ux:/z/y/x" IF CheckDir["/project/imagerfonts/"] THEN Item["/imagerfonts", "-ux:/project/imagerfonts"] ELSE Item["/imagerfonts", "-ux:/project/pcedar2.0/imagerfonts"]; ΚΔ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ ΟeœI™TK™,K™/K™9K™&K™$K™,—˜KšΟk œžœžœ˜<—K˜K˜KšΠlnœžœž˜Kš žœžœžœœœœœœ˜9šœž˜K˜šΟnœžœžœ˜/šžœžœžœ˜Tšžœ˜Kšœžœ˜!Kšœ žœ˜*Kšœ˜——K˜K˜—š  œžœ žœžœžœžœ˜=Kš œžœ žœžœžœžœ˜SK˜K˜—K™G™8K™K™K™—š œžœ˜ Kšœžœ4˜GKšœžœžœ˜Kšžœ žœžœžœ˜Kš œ žœ žœžœžœ žœ˜VKšžœ žœžœžœ˜š žœžœžœžœžœžœ˜Hšžœžœž˜Kšœ žœžœ˜-Kšœžœžœ˜3K˜Kšžœ˜—Kšžœ˜Kšžœ žœ˜Kšžœ˜—K˜—K˜K˜K˜,Kšœ5˜5Kšœ7˜7K˜0šžœ#ž™)K™0šž™K™;K™——Kšœ-˜-K˜K˜4K˜6K˜2K˜Kšœ˜Kšœ˜Kšœ&˜&Kšœ2˜2K˜—K˜Kšžœ˜K˜—…—’ 4