<<>> <> <> <> <> <> <> <<>> 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]] }; <> ExitWorldCommand: Commander.CommandProc = { Termination.QuitWorld[userMsg: cmd.commandLine, interceptable: FALSE]; RETURN[NIL, NIL]; }; <> InterceptTerminationCommand: Commander.CommandProc = { Termination.SetDebuggingMode[]; RETURN[NIL, NIL]; }; <<>> <> 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.