DIRECTORY Commander USING [CommandProc, Handle, Register], IO, VoiceUtils USING [ MakeAtom ], NamesGV USING [ AttributeSeq, AttributeSeqRec, GVGetAttributes, GVGetAttributeSeq, GVIsAuthenticated, GVSetAttribute, GVSetAttributeSeq, --GVUpdate, -- GVFlushCache, GVUpdateAll ], Rope USING [ Cat, Equal, Length, ROPE, Substr ] ; GVLarkImpl: CEDAR PROGRAM IMPORTS Commander, IO, VoiceUtils, NamesGV, Rope = { OPEN IO; ROPE: TYPE = Rope.ROPE; UpdateAll: PROC[] = { Calling["UpdateAll"]; NamesGV.GVUpdateAll[]; }; FlushAll: PROC[] = { Calling["FlushAll"]; NamesGV.GVFlushCache[]; }; LarkDetails: PROC[larkName: ROPE] = { Calling["DetailsOfLark#", larkName]; DoDetails[FullLark[larkName]]; }; Details: PROC[rName: ROPE] = { Calling["Details", rName]; DoDetails[rName]; }; DoDetails: PROC[rName: ROPE] = { SELECT NamesGV.GVIsAuthenticated[rName] FROM unknown, nonexistent => out.PutF["Couldn't find %s\n", rope[rName]]; ENDCASE => PrintDetails[rName]; }; Mode: PROC[larkNum, newMode: ROPE, update: BOOL_TRUE] = { rName: ROPE_FullLark[larkNum]; Calling["Mode", larkNum, newMode]; NamesGV.GVSetAttribute[rName, $mode, newMode]; PrintDetails[rName]; }; Instance: PROC[larkNum, newInstance: ROPE, update: BOOL_TRUE] = { aSeq: NamesGV.AttributeSeq; rName: ROPE _ FullLark[larkNum]; Calling["Instance", larkNum, newInstance]; aSeq _ NamesGV.GVGetAttributeSeq[rName, $interface]; IF aSeq=NIL THEN aSeq _ NEW[NamesGV.AttributeSeqRec[4]]; aSeq.length_4; IF aSeq[0].attributeValue=NIL THEN aSeq[0] _ [,"LarkSmarts.Lark"]; aSeq[1] _ [,newInstance.Cat[".lark"]]; IF aSeq[2].attributeValue=NIL THEN aSeq[2] _ [,"1"]; IF aSeq[3].attributeValue=NIL THEN aSeq[3] _ [,"0"]; NamesGV.GVSetAttributeSeq[rName, $interface, aSeq]; PrintDetails[rName]; }; SetAttribute: PROC[rName, attributeName, attributeValue: ROPE] = { attribute: ATOM _ VoiceUtils.MakeAtom[attributeName, FALSE]; Calling["SetAttribute", rName, attributeName, attributeValue]; NamesGV.GVSetAttribute[rName, attribute, attributeValue]; PrintDetails[rName]; }; SetProgram: PROC[larkNum, program: ROPE, update: BOOL_TRUE] = { rName: ROPE _ FullLark[larkNum]; Calling["SetProram", larkNum, program]; NamesGV.GVSetAttribute[rName, $program, program]; PrintDetails[rName]; }; SetTune: PROC[rName, doTune, tune: ROPE] = { len: INT _ tune.Length[]; larkRname: ROPE=rName.Cat[".lark"]; SetAttribute[larkRname, "dotune", doTune]; NamesGV.GVSetAttribute[larkRname, $ringtune, tune]; PrintDetails[larkRname]; }; Make: PROC[rName, extension, machine, instance, mode, net, host, program: ROPE] = { wsName: ROPE_IF net=NIL THEN NIL ELSE net.Cat["#",host,"#.Lark"]; fullUserName: ROPE_rName.Cat[".Lark"]; larkName: ROPE _ FullLark[machine]; Calling["Make", rName, extension, machine, instance, mode, net, host]; Instance[machine, instance, FALSE]; Mode[machine, mode, FALSE]; NamesGV.GVSetAttribute[larkName, $owner, fullUserName]; IF program#NIL THEN NamesGV.GVSetAttribute[larkName, $program, program]; PrintDetails[larkName]; NamesGV.GVSetAttribute[fullUserName, $larkhost, Rope.Cat["173#", machine, "#"]]; NamesGV.GVSetAttribute[fullUserName, $extension, extension]; PrintDetails[fullUserName]; IF wsName=NIL THEN RETURN; NamesGV.GVSetAttribute[wsName, $owner, rName]; NamesGV.GVSetAttribute[fullUserName, $workstationhost, wsName]; PrintDetails[wsName]; }; SemiTok: IO.BreakProc = TRUSTED {RETURN[IF char='; THEN break ELSE other]; }; CommaTok: IO.BreakProc = TRUSTED {RETURN[IF char=', THEN break ELSE other]; }; DetailsCommand: Commander.CommandProc = TRUSTED { StartTok[cmd]; Details[Token[]]; }; UpdateAllCommand: Commander.CommandProc = TRUSTED { UpdateAll[]; }; FlushAllCommand: Commander.CommandProc = TRUSTED { FlushAll[]; }; LarkCommand: Commander.CommandProc = TRUSTED { StartTok[cmd]; LarkDetails[Token[]]; }; MakeCommand: Commander.CommandProc = TRUSTED { rName, extension, machine, instance, mode, net, host, program: ROPE; StartTok[cmd]; rName_Token[]; extension_Token[]; machine_Token[]; instance_Token[]; mode _ Token[]; net_Token[]; IF net.Equal["none"] THEN net_NIL ELSE host_Token[]; program _ Token[]; Make[rName, extension, machine, instance, mode, net, host, program]; }; InstanceCommand: Commander.CommandProc = TRUSTED { a1, a2: ROPE; StartTok[cmd]; a1_Token[]; a2_Token[]; Instance[a1, a2]; }; DoProgramCommand: Commander.CommandProc = TRUSTED { a1, a2: ROPE; StartTok[cmd]; a1_Token[]; a2_Token[]; SetProgram[a1, a2]; }; ModeCommand: Commander.CommandProc = TRUSTED { a1, a2: ROPE; StartTok[cmd]; a1_Token[]; a2_Token[]; Mode[a1, a2]; }; AttributeCommand: Commander.CommandProc = TRUSTED { a1, a2, a3: ROPE; StartTok[cmd]; a1_Token[]; a2_Token[]; a3_cmdStream.GetLineRope[]; IF a3#NIL AND a3.Length[]#0 THEN a3_a3.Substr[start: 1] ELSE a3_NIL; SetAttribute[a1, a2, a3]; }; TuneCommand: Commander.CommandProc = TRUSTED { a1, a2, a3: ROPE; StartTok[cmd]; a1_Token[]; a2_Token[]; a3_cmdStream.GetLineRope[]; IF a3#NIL AND a3.Length[]#0 THEN a3_a3.Substr[start: 1] ELSE a3_NIL; SetTune[a1, a2, a3]; }; DoTuneCommand: Commander.CommandProc = TRUSTED { a1, a2: ROPE; StartTok[cmd]; a1_Token[]; a2_Token[]; SetAttribute[a1.Cat[".lark"], "dotune", a2]; }; StartTok: PROC[cmd: Commander.Handle] = { cmdStream _ IO.RIS[cmd.commandLine]; out _ cmd.out; }; Token: PROC RETURNS [r: ROPE _ NIL] = { r _ cmdStream.GetTokenRope[breakProc: IO.IDProc ! IO.EndOfStream => CONTINUE;].token; }; PrintDetails: PROC[rName: ROPE] = { attributeSeq: NamesGV.AttributeSeq _ NamesGV.GVGetAttributes[rName]; authenticity: ROPE _ SELECT NamesGV.GVIsAuthenticated[rName] FROM $authentic => " (authentic)", $bogus => " (bogus)", $perhaps => "", ENDCASE => " (??)"; out.PutF["rName: %s%s\n", rope[rName], rope[authenticity]]; IF attributeSeq#NIL THEN FOR i: INT IN [0..attributeSeq.length) DO out.PutF[" %s: %s\n", atom[attributeSeq[i].attributeName], rope[attributeSeq[i].attributeValue] ]; ENDLOOP; out.PutChar['\n]; }; FullLark: PROC[larkName: ROPE] RETURNS [fullName: ROPE] = { RETURN[Rope.Cat["173#", larkName, "#.lark"]]; }; Calling: PROC[funcName, a, b, c, d, e, f, g: ROPE_NIL] = { res: ROPE_funcName.Cat["[", a]; IF b#NIL THEN res_res.Cat[", ", b]; IF c#NIL THEN res_res.Cat[", ", c]; IF d#NIL THEN res_res.Cat[", ", d]; IF e#NIL THEN res_res.Cat[", ", e]; IF f#NIL THEN res_res.Cat[", ", f]; IF g#NIL THEN res_res.Cat[", ", g]; res_res.Cat["]\n "]; out.PutRope[res]; }; cmdStream: IO.STREAM; out: IO.STREAM; Commander.Register["GVDetails", DetailsCommand, "Print RName details\nPrints attribute fields of fully-specified RName"]; Commander.Register["GVLark", LarkCommand, "Print details for Lark\nPrints attribute fields, given string for octal representation of a Lark's host ID; network 173B assumed."]; Commander.Register["GVMake", MakeCommand, "Update data base for Lark and user\nGVMake Swinehart.pa 4473 104 Morley O 3 333 sets Swinehart.pa.lark and 173#104#.lark and 3#333#.lark (creating if necessary) to contain all necessary attribute fields for Lark operation. Use none for 3 333 to avoid associating a workstation with the Lark."]; Commander.Register["GVInstance", InstanceCommand, "Set instance field\nGVInstance 100 Morley makes Morley.Lark the instance for the type LarkSmarts.Lark for Lark numbered 173#100#."]; Commander.Register["GVMode", ModeCommand, "Set Operational Mode\nGVMode 100 O sets the mode field of RName 173#100#.lark to O."]; Commander.Register["GVAttribute", AttributeCommand, "Set attribute field\nGVAttribute 173#104#.lark interface LarkSmarts.Lark, Strowger.Lark, 1, 0\n sets the interface attribute of the specified RName as specified."]; Commander.Register["GVUpdateAll", UpdateAllCommand, "Write all dirty cache entries\nWhen you issue a change request, it is stored in the cache but not written to GV until you issue this command."]; Commander.Register["GVFlushAll", FlushAllCommand, "Forget all cached Rnames. This will cancel any changes that have been made since the last GVFlushAll or GVUpdateAll."]; Commander.Register["GVTune", TuneCommand, "GVTune Swinehart.pa TRUE TuneString (rest of line!) sets the tune to be used, and does 'GVDoTune TRUE'."]; Commander.Register["GVDoTune", DoTuneCommand, "GVDoTune Swinehart.pa TRUE indicates that ring tune replaces standard ringing; false reverts."]; Commander.Register["GVProgram", DoProgramCommand, "Set program field\nGVProgram 100 LarkA makes LarkA.obj the program for Lark numbered 173#100#."]; }. ZGVLarkImpl.mesa Last modified by D. Swinehart, November 19, 1985 12:55:05 pm PST Last Edited by: Pier, May 10, 1984 1:08:21 pm PDT Copies Action routines We don't do updates automatically these days. To really affect Grapevine requires issuing the GVUpdate command (registered by NamesAndLog.bcd) manually. It will write all dirty entries, so use the flush operation judiciously. IF update THEN NamesGV.GVUpdate[rName]; IF update THEN NamesGV.GVUpdate[rName]; NamesGV.GVUpdate[rName]; IF update THEN NamesGV.GVUpdate[rName]; NamesGV.GVUpdate[larkRname]; Command Procs Utilities Initialization Ê{˜Jšœ™Jšœ@™@J™1J˜šÏk ˜ Jšœ œ!˜0Jšœ˜Jšœ˜Jšœ´˜´Jšœœœ ˜/J˜J˜—šœ ˜š˜J˜ Jšœ˜J˜ J˜Jšœ˜Jšœœ˜—J˜—šœ™J˜Jšœœœ˜J˜—™J™J™ãJ˜šÏn œœ˜Jšœ˜J˜J˜J˜—šžœœ˜Jšœ˜J˜J˜J˜—šž œœ œ˜%Jšœ$˜$J˜J˜J˜—šžœœœ˜Jšœ˜Jšœ˜J˜—J˜šž œœœ˜ šœ"˜,J˜DJšœ˜—J˜J˜—š žœœœ œœ˜9Jšœœ˜Jšœ"˜"Jšœ.˜.Jšœœ™'Jšœ˜J˜—J˜š žœœœ œœ˜AJ˜Jšœœ˜ Jšœ*˜*Jšœ4˜4Jšœœœœ˜8J˜Jšœœœ ˜BJšœ&˜&Jšœœœ˜4Jšœœœ˜4Jšœ3˜3Jšœœ™'Jšœ˜Jšœ˜—J˜šž œœ'œ˜BJšœ œ&œ˜˜>Jšœ9˜9Jšœ™Jšœ˜Jšœ˜—J˜š ž œœœ œœ˜?Jšœœ˜ Jšœ'˜'Jšœ1˜1Jšœœ™'Jšœ˜Jšœ˜—J˜šžœœœ˜,Jšœœ˜Jšœ œ˜#Jšœ*˜*Jšœ3˜3Jšœ™Jšœ˜Jšœ˜—J˜šžœœ@œ˜SJš œœœœœœœ˜AJšœœ˜&Jšœ œ˜#JšœF˜FJšœœ˜#Jšœœ˜J˜7Jšœ œœ5˜HJšœ˜JšœP˜PJšœ<˜