CDStarter.mesa (part of ChipNDale)
Copyright © 1983, 1986 by Xerox Corporation. All rights reserved.
by Christian Jacobi, November 7, 1983 5:39 pm
last edited Christian Jacobi, March 24, 1986 1:30:31 pm PST
DIRECTORY
Commander,
CommandTool,
IO,
Process,
Rope,
TerminalIO,
UserProfile,
ViewerClasses,
ViewerOps;
CDStarter:
CEDAR
PROGRAM
IMPORTS Commander, CommandTool, IO, Rope, TerminalIO, UserProfile, ViewerOps, Process =
BEGIN
StartPrograms:
PROC[] =
BEGIN
runList: LIST OF Rope.ROPE = UserProfile.ListOfTokens[key: "ChipNDale.RunPrograms"];
FOR l:
LIST
OF Rope.
ROPE ← runList, l.rest
WHILE l#
NIL
DO
IF
NOT Rope.IsEmpty[l.first]
THEN {
msg: Rope.ROPE = CommandTool.Run[bcdName: l.first].errMsg;
IF msg#NIL THEN TerminalIO.WriteRope[msg];
}
ENDLOOP;
END;
TrojanHorse:
PROC[] =
BEGIN
-- This is typically commented out in released versions
-- but active in private or pre-released versions
trojanHorse: Rope.ROPE = "/DATools/DATools6.0/cdCommon22/CDTroja22";
TRUSTED {Process.SetPriority[Process.priorityBackground]};
[] ← CommandTool.Run[bcdName: trojanHorse];
END;
MoveTerminal:
PROC[] =
BEGIN
v: ViewerClasses.Viewer ← ViewerOps.FindViewer["Terminal"];
IF v#NIL THEN ViewerOps.ChangeColumn[v, right];
END;
Load: Commander.CommandProc =
BEGIN
cmd.out.PutRope["ChipNDale loaded\n"];
END;
Quiet: Commander.CommandProc =
BEGIN
END;
BeQuiet: Commander.CommandProc =
BEGIN
list: LIST OF Rope.ROPE;
list ← CommandTool.ParseToList[cmd].list;
FOR ls:
LIST
OF Rope.
ROPE ← list, ls.rest
WHILE ls#
NIL
DO
IF Commander.Lookup[ls.first]=
NIL
THEN
Commander.Register[key: ls.first, proc: Quiet, doc: "command made quiet"];
ENDLOOP;
END;
StartPrograms[];
IF UserProfile.Boolean["ChipNDale.TerminalStartRight", TRUE] THEN MoveTerminal[];
TRUSTED {Process.Detach[FORK TrojanHorse[]]};
Commander.Register[
key: "///commands/ChipNDale",
proc: Load,
doc: "loads technology independent ChipNDale"
];
Commander.Register[
key: "///commands/BeQuiet",
proc: BeQuiet,
doc: "makes this load file beeing quiet"
];
END.