DIRECTORY BasicTime USING [GMT], Rope USING [ROPE]; GvNsMap: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Syntax: TYPE = {gv, ns, unknown}; Direction: TYPE = {gvToNs, nsToGv}; Stats: TYPE = RECORD [ lastUpdated: BasicTime.GMT, troubleOnLastUpdate: BOOL ¬ FALSE, updates: CARD ¬ 0, gvToNsMaps: CARD ¬ 0, nsToGvMaps: CARD ¬ 0, gvToNs: CARD ¬ 0, nsToGv: CARD ¬ 0 ]; DomainFromRegistry: PROC[reg: ROPE, dir: Direction ¬ gvToNs] RETURNS[domain: ROPE]; RegistryFromDomain: PROC[domain: ROPE, org: ROPE ¬ NIL, dir: Direction ¬ nsToGv] RETURNS[reg: ROPE]; NsFromGvName: PROC[gvName: ROPE, dir: Direction ¬ gvToNs] RETURNS[nsName: ROPE]; GvFromNsName: PROC[nsName: ROPE, dir: Direction ¬ nsToGv] RETURNS[gvName: ROPE]; UpdateMap: PROC; GetStats: PROC RETURNS [Stats]; SyntaxOf: PROC[name: ROPE] RETURNS[syntax: Syntax]; NsSyntax: PROC [name: ROPE, inSyntax: Syntax ¬ unknown] RETURNS [nsSyntax: ROPE]; GvSyntax: PROC [name: ROPE, inSyntax: Syntax ¬ unknown, quoteIfNeeded: BOOL ¬ TRUE] RETURNS [gvSyntax: ROPE]; NativeSyntax: PROC [name: ROPE, inSyntax: Syntax ¬ unknown] RETURNS [native: ROPE, syntax: Syntax]; QuoteIfNeeded: PROC [gvName: ROPE] RETURNS [ROPE]; BreakName: PROC[name: Rope.ROPE] RETURNS[sn, reg: Rope.ROPE]; END. Ψ GvNsMap.mesa Copyright Σ 1986, 1991 by Xerox Corporation. All rights reserved. John Larson, May 26, 1986 5:25:02 pm PDT Wes Irish, March 3, 1987 7:28:13 pm PST Willie-s, December 27, 1991 2:22 pm PST Translates between GV foreign registries and NS psuedo domains. Direction controls which of the two mapping lists are used. gvToNs is the list with GV foreign registries and valid NS domains. nsToGv is the list with NS psuedo domains and valid GV registries. In all cases the returned ROPE will be NIL if no mapping is found. If org is NIL then domain should really be "domain:org". Figure out what syntax this name is in. Should never return unknown. Returns the NS syntax for name Returns the GV syntax for name If quoteIfNeeded then, if needed, wrap quotes around the name portion of the returning name -- this is usually what you want. The incoming name can have the syntax of either world BUT it's native to one system and not the other. Fix up the syntax and indicate the native world via "syntax". Puts quotes around the name portion of a GV name if needed (ie, there is a space in it and it's not already quoted) Finds the last '. in name and returns the two parts; is no dot is found, sn is NIL and reg is name ΚΩ•NewlineDelimiter –(cedarcode) style™šœ ™ Jšœ Οeœ6™BIcode™(K™'K™'J™—šΟk ˜ Kšœ žœžœ˜Kšœžœžœ˜—K˜K™?K˜šΟnœžœž œ˜Kšž˜K˜Kšžœžœžœ˜K˜šœžœ˜!K˜—Kšœ#˜#K˜šœžœžœ˜Kšœžœ˜Kšœžœžœ˜"Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšœžœ˜Kšœžœ˜K˜—K˜Kšœˆ™ˆK™Kš Ÿœžœžœžœ žœ˜SK™Kš Ÿœžœ žœžœ!žœžœ˜dK™8K˜Kš Ÿ œžœ žœžœ žœ˜PK™Kš Ÿ œžœ žœžœ žœ˜PK˜KšΠbn œžœ˜K˜š œžœžœ ˜K˜—šŸœžœžœžœ˜3K™EK™—š Ÿœžœžœžœ žœ˜QKšœ™K˜—šŸœžœžœ-žœžœžœ žœ˜mKšœ™Kšœ}™}K™—š Ÿ œžœžœžœ žœ˜cKšœ6žœl™₯K˜—š Ÿ œžœ žœžœžœ˜2K™sK™—š Ÿ œžœ žœžœžœ˜=K™b—K˜K˜Kšžœ˜——…—Ϊ ‹