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 by: Jacobi July 24, 1986 10:32:07 am PDT
Last edited by: Christian Jacobi, January 28, 1987 5:26:01 pm PST
DIRECTORY
CDEnvironment,
Commander,
CommandTool,
IO,
--Process,
Rope,
UserProfile;
CDStarter: CEDAR PROGRAM
IMPORTS CDEnvironment, Commander, CommandTool, IO, --Process, --Rope, UserProfile =
BEGIN
StartPrograms: PROC [] = {
runList: LIST OF Rope.ROPE = UserProfile.ListOfTokens[key: "ChipNDale.RunPrograms"];
FOR l: LIST OF Rope.ROPE ← runList, l.rest WHILE l#NIL DO
IF ~Rope.IsEmpty[l.first] THEN {
[] ← CDEnvironment.StuffToCommandTool[l.first, CDEnvironment.GetWorkingDirectory[NIL]];
}
ENDLOOP;
};
TrojanHorse: PROC [] = {
-- This is typically commented out in released versions
-- but active in private or pre-released versions
trojanHorse: Rope.ROPE = "/ivy/jacobi/cd25/CDTroja25";
TRUSTED {Process.SetPriority[Process.priorityBackground]};
[] ← CommandTool.Run[bcdName: trojanHorse];
};
Load: Commander.CommandProc = {
IO.PutRope[cmd.out, "ChipNDale loaded\n"];
};
Quiet: Commander.CommandProc = {
};
BeQuiet: Commander.CommandProc = {
FOR ls: LIST OF Rope.ROPE ← CommandTool.ParseToList[cmd].list, ls.rest WHILE ls#NIL DO
IF ~Rope.IsEmpty[ls.first] AND Commander.Lookup[ls.first]=NIL THEN {
CDEnvironment.RegisterCommander[key: ls.first, proc: Quiet, doc: "command made quiet"];
};
ENDLOOP;
};
StartPrograms[];
TRUSTED {Process.Detach[FORK TrojanHorse[]]};
CDEnvironment.RegisterCommander[
key: "ChipNDale",
proc: Load,
doc: "loads technology independent ChipNDale"
];
CDEnvironment.RegisterCommander[
key: "BeQuiet",
proc: BeQuiet,
doc: "makes this load file beeing quiet"
];
END.