CommanderSysPImpl.mesa
Copyright Ó 1990, 1991, 1992, 1993 by Xerox Corporation. All rights reserved.
Michael Plass, February 18, 1992 4:44 pm PST
JKF, March 2, 1990 3:51:36 pm PST
Christian Jacobi, July 24, 1990 3:14 pm PDT
Willie-s, January 15, 1993 5:32 pm PST
DIRECTORY BasicTime, Commander, CommanderSys, PreDebug, Process, Rope, SafeStorage, Termination, UnixEnviron;
CommanderSysPImpl: CEDAR PROGRAM
IMPORTS BasicTime, Commander, PreDebug, Process, SafeStorage, Termination, UnixEnviron
EXPORTS CommanderSys
~
BEGIN
OPEN CommanderSys, Rope;
ExtendedNow:
PUBLIC
PROC
RETURNS [
EGMT] = {
now: BasicTime.ExtendedGMT = BasicTime.ExtendedNow[];
RETURN [[now.gmt, now.usecs]]
};
GetEnv:
PUBLIC
PROC [key:
ROPE]
RETURNS [
ROPE] = {
RETURN [UnixEnviron.GetEnv[key]]
};
CurrentProcess:
PUBLIC
PROC
RETURNS [
PROCESS] = {
RETURN [Process.GetCurrent[]];
};
AbortProcess:
PUBLIC
PROC [process:
PROCESS] =
TRUSTED {
Process.Abort[process];
};
UNCAUGHTProtect:
PUBLIC
PROC [inner:
PROC, rejectP:
PROC [
ROPE]
RETURNS [
BOOL]]
RETURNS [ok:
BOOL ¬
TRUE] = {
RETURN [PreDebug.Protect[inner, rejectP]]
};
To allow packaged worlds to quit pcr cleanly
ExitWorldCommand: Commander.CommandProc = {
Termination.QuitWorld[userMsg: cmd.commandLine, interceptable: FALSE];
RETURN[NIL, NIL];
};
To allow interception of interceptable termination
InterceptTerminationCommand: Commander.CommandProc = {
Termination.SetDebuggingMode[];
RETURN[NIL, NIL];
};
to help packaged world performance
GCollect: Commander.CommandProc = {
SafeStorage.ReclaimCollectibleObjects[];
RETURN[NIL, NIL];
};
Commander.Register[key: "ExitWorld", proc: ExitWorldCommand, doc: "Exit the PCR world", clientData: NIL];
Commander.Register[key: "ExitWorld!", proc: ExitWorldCommand, doc: "Same as ExitWorld, defeats command abbreviation danger", clientData: NIL];
Commander.Register[key: "GCollect", proc: GCollect, doc: "force a garbage collect", clientData: NIL];
END.