Names.Mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Last modified by Swinehart, July 19, 1985 2:40:47 pm PDT
Last Edited by: Pier, May 1, 1984 11:13:41 am PDT
This interface defines a number of groups of utility functions having to do with file names, Grapevine RNames, network host names, passwords (strings and keys), and the like.
Each group is further explained below.
DIRECTORY
Basics USING [ Comparison ],
BasicTime USING [ GMT ],
Commander USING [ Handle ],
GVBasics USING [ Password ],
Rope USING [ ROPE ],
RPC USING [ EncryptionKey, ShortROPE ],
RPCPkt USING [ Machine ]
;
Names:
CEDAR DEFINITIONS = {
ROPE: TYPE = RPC.ShortROPE;
NetAddress: TYPE = RPCPkt.Machine;
Rname: TYPE = ROPE;
anonymousRname: Rname = NIL;
File name manipulations. ParseFile will break up an old-style bracketed file name into its components.
FileSpec: TYPE = REF FileSpecBody;
FileSpecBody:
TYPE =
RECORD [
server, name, password, dirName, dirPassword, fileName: Rope.ROPE←NIL];
ParseFile:
PROCEDURE[
server: ROPE←NIL,
dirName: ROPE←NIL,
dirPassword: ROPE←NIL,
fileName: ROPE←] RETURNS [FileSpec];
adds default registry if there's no registry in the input.
Simple RName, password, net address manipulations. These just look at local machine global information or do various kinds of parsing; they don't do any communicating.
CurrentRName:
PROC
RETURNS [
ROPE];
Current logged-in name.
DefaultRegistry:
PROC
RETURNS [
ROPE];
Registry of CurrentRName[].
Registrize:
PROC[name:
ROPE]
RETURNS [
ROPE];
Adds the Default registry to the name if the name doesn't have a registry field.
CurrentPasskey: PROC[passwordText: ROPE←NIL] RETURNS [RPC.EncryptionKey];
CurrentPassword:
PROC[passwordText:
ROPE←
NIL]
RETURNS [GVBasics.Password] =
INLINE {
RETURN[LOOPHOLE[CurrentPasskey[passwordText]]]; };
Keys made from logged in password. The two types are based on client needs.
OwnNetAddress: PROC RETURNS [netAddress: NetAddress];
Rspec: TYPE = REF RspecBody;
RspecBody:
TYPE =
RECORD [
simpleName: ROPE←NIL,
registry: ROPE←NIL];
InstanceFromNetAddress:
PROC[netAddress: NetAddress, suffix:
ROPE←
NIL]
RETURNS [instance: Rname];
Returns instance name, concatenated with suffix.
Suffix could be "0" to complete a text version of a socket ID, or ".lark" to complete an RName.
RnameToRspec:
PROC[name: Rname, defaultRegistry:
ROPE←
NIL]
RETURNS [spec: Rspec];
Takes the fields of an Rname apart.
RspecToRname:
PROC[spec: Rspec]
RETURNS [name: Rname];
Puts one back together.
RspecToSortName:
PROC[spec: Rspec]
RETURNS [name:
ROPE];
Produces a rope of the form registry.name
MakeAtom:
PROC[rName: Rname, case:
BOOL←
FALSE]
RETURNS [
ATOM];
Produces a case-independent (if case=FALSE) unique atom from the RName
CommandTool parsing aid
CmdOrToken:
PROC[cmd: Commander.Handle, key:
ROPE, default:
ROPE←
NIL]
RETURNS [value: ROPE];
Some leftovers
GMTComp: PROC[t1, t2: BasicTime.GMT] RETURNS [c: Basics.Comparison];
NetProblem: TYPE = {ok, noSuchName, invalidName, noSuchIndex, noSuchFone, badPassword, notAuthenticated, tryLater, notInitialized, cantImportSmarts};
NetError: ERROR[problem: NetProblem];
}.