Procedures
GetDefaultDomain: PROC RETURNS [domainName: ROPE];
SetDefaultDomain:
PROC [domainName:
ROPE];
Manipulate default YP domain name (used by default if a NIL domainName is passed to ObtainHandle).
There is an initial default domain that is reasonable for the system site.
ObtainHandle:
PROC [domainName:
ROPE ←
NIL, conversation: SunRPCAuth.Conversation ←
NIL, serverAddress: Arpa.Address ← Arpa.nullAddress]
RETURNS [h: Handle];
Obtain a handle to talk to a server for the specified domain (or to the default domain if "domainName" is allowed to default to NIL).
If a conversation is specified, that one is used; otherwise null credentials are used to create a conversation. In any case, the conversation is owned by the handle — client should not call SunRPCAuth.Terminate[c].
If a server is specified, that one is used; otherwise the agent tries to find a server.
! Error[$noYP | $domainNotFound | $timeout | $protocol].
RefreshHandle:
PROC [h: Handle, conversation: SunRPCAuth.Conversation ←
NIL, serverAddress: Arpa.Address ← Arpa.nullAddress];
Point h at a (another) server for the domain associated with h.
If a conversation is specified, that one is used; otherwise null credentials are used to create a conversation.
If a server is specified, that one is used; otherwise the agent tries to find a server.
! Error[$noYP | $domainNotFound | $timeout | $protocol].
ReleaseHandle:
PROC [h: Handle];
It's okay to drop one on the floor occasionally.
Match:
PROC [h: Handle, map:
ROPE, key:
ROPE]
RETURNS [val:
REF
TEXT];
Find entry matching key in the given map.
! Error[$mapNotFound | $keyNotFound | $timeout | $protocol]
First:
PROC [h: Handle, map:
ROPE]
RETURNS [key:
ROPE, val:
REF
TEXT];
Return the first entry in the specified map.
! Error[$noMoreEntries | $mapNotFound | $keyNotFound | $timeout | $protocol]
Next:
PROC [h: Handle, map:
ROPE, keyBefore:
ROPE]
RETURNS [key:
ROPE, val:
REF
TEXT];
Return the next entry in the specified map.
! Error[$noMoreEntries | $mapNotFound | $keyNotFound | $timeout | $protocol]
MapList:
PROC [h: Handle, eachMap: SunYP.EachMapNameProc];
! Error[$moreEntries | $timeout | $protocol]
Utilities
For parsing values from the YP data bases
TextSeq: TYPE ~ REF TextSeqObject;
TextSeqObject:
TYPE ~
RECORD [
length: CARDINAL,
refText: SEQUENCE maxLength: CARDINAL OF REF TEXT
];
Tokenize:
PROC [in:
REF
READONLY
TEXT]
RETURNS [out: TextSeq];
Separate into tokens, delimited by white space.
TokenizeUsingSeparator:
PROC [in:
REF
READONLY
TEXT, sepChar:
CHAR, trimLeadingSpace, trimTrailingSpace:
BOOL ←
TRUE]
RETURNS [out: TextSeq];
Separate into tokens, delimited by occurrences of sepChar.
If requested, leading/trailing white space is trimmed from tokens.
}...