XNSCHName.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Demers, January 14, 1987 4:28:03 pm PST
DIRECTORY
CHNameP2V0 USING [DomainName, maxDomainLength, maxObjectLength, maxOrganizationLength, Name],
Rope USING [ROPE];
XNSCHName:
CEDAR
DEFINITIONS ~ {
ROPE: TYPE ~ Rope.ROPE;
Name: TYPE ~ CHNameP2V0.Name;
DomainName: TYPE ~ CHNameP2V0.DomainName;
maxDomainLength: CARD16 ~ CHNameP2V0.maxDomainLength;
maxObjectLength: CARD16 ~ CHNameP2V0.maxObjectLength;
maxOrganizationLength: CARD16 ~ CHNameP2V0.maxOrganizationLength;
FieldTooLong:
SIGNAL [which:
CARDINAL];
1 => object, 2 => domain, 3 => organization
(Note this is the order in which fields appear in a rope, it's the REVERSE of their order in the record).
Resuming this signal will truncate the offending field.
May be raised more than once per name.
NameFromRope:
PROC [rope:
ROPE,
defaultDomain:
ROPE ¬
NIL, defaultOrganization:
ROPE ¬
NIL]
RETURNS [name: Name];
! FieldTooLong
Parse a rope — e.g. "Demers:PARC" -> ["Xerox", "PARC", "Demers"]
If NIL is specified for defaultDomain or defaultOrganization then the default will be taken from DefaultRemoteNames.
RopeFromName: PROC [name: Name] RETURNS [rope: ROPE];
DomainNameFromRope:
PROC [rope:
ROPE,
defaultDomain:
ROPE ¬
NIL, defaultOrganization:
ROPE ¬
NIL]
RETURNS [domainName: DomainName];
! FieldTooLong
Parse a rope — e.g. "PARC:Xerox" -> ["Xerox", "PARC"].
If NIL is specified for defaultDomain or defaultOrganization then the default will be taken from DefaultRemoteNames.
RopeFromDomainName: PROC [domainName: DomainName] RETURNS [rope: ROPE];
}.