MTTreeOps.mesa
Last Edited by: HGM, April 20, 1985 10:00:08 pm PST
Last Edited by: Nichols, July 14, 1983 3:12 pm
Last Edited by: Taft, February 5, 1984 1:48:47 pm PST
DIRECTORY
Rope USING [ROPE];
MTTreeOps: CEDAR DEFINITIONS
= BEGIN
discretionaryBlank: CHAR = '\201;
TreeToRope: PROC [tree: REF ANY, squeezeWhiteSpace: BOOLFALSE, insertDiscretionaryBlanks: BOOLFALSE] RETURNS [r: Rope.ROPE];
Convert the name list tree into a rope to put back into the mail header. If squeezeWhiteSpace is TRUE, then ignore the whiteSpace in the tree and insert the appropriate amount (i.e. no blanks except after certain commas and between words. If insertDiscretionaryBlanks is TRUE, put discretionaryBlank chars whereever a line break is legal.
TreeToSimpleRope: PROC [tree: REF ANY] RETURNS [r: Rope.ROPE];
Convert the name list tree into a rope, skipping comments and white space.
DomainType: TYPE = {registry, arpaDomain, unknown};
DefaultDomain: PROC [tree: REF ANY] RETURNS [domainType: DomainType, domain: REF ANY];
Given a name list tree, find the domain that should be used to default unqualified names in the header. The client is responsible for passing the name tree from the right header (From or Sender). The default domain is the domain (registry or Arpanet host) of the first qualified name in the tree. If domainType = arpaDomain, then domain points to an P1.DomainNode. If domainType = registry, then domain points to an MT1.TerminalNode.
XeroxDomain: PROC RETURNS [domain: REF ANY --P1.DomainNode-- ];
ToArpa: PROC [tree: REF ANY, defaultDomainType: DomainType, defaultDomain: REF ANY] RETURNS [newTree: REF ANY];
Given a name tree, return the tree modified to allow it to be sent on to the Arpanet. This is a destructive operation. The default domain passed in is added to unqualified names and @Xerox.Arpa is added to Grapevine names.
ToGrapevine: PROC [tree: REF ANY, defaultDomainType: DomainType, defaultDomain: REF ANY] RETURNS [newTree: REF ANY];
Given a name tree, return the tree modified to allow it to be sent to the Grapevine. This is a destructive operation. @Xerox.Arpa is removed from Grapevine names.
END.