Names.Mesa
Last modified by Swinehart, June 13, 1984 3:24:28 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 ],
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.ROPENIL];
ParseFile: PROCEDURE[
server: ROPENIL,
dirName: ROPENIL,
dirPassword: ROPENIL,
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: ROPENIL] RETURNS [RPC.EncryptionKey];
CurrentPassword: PROC[passwordText: ROPENIL] 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: ROPENIL,
registry: ROPENIL];
InstanceFromNetAddress: PROC[netAddress: NetAddress, suffix: ROPENIL]
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: ROPENIL] 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: BOOLFALSE] RETURNS [ATOM];
Produces a case-independent (if case=FALSE) unique atom from the RName
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];
}.