-- Copyright (C) 1986 by Xerox Corporation. All rights reserved. -- CRuntime.mesa -- NFS 4-Mar-86 12:00:02 DIRECTORY CBasics USING [FilePtr], CString USING [CString], PrincOps USING [GlobalFrameHandle], Stream USING [Handle]; CRuntime: DEFINITIONS = { GlobalFrameHandle: TYPE = PrincOps.GlobalFrameHandle; normalOutcome: INTEGER = 0; abortOutcome: INTEGER = -1; FilePtr: TYPE = CBasics.FilePtr; ConfigHandle: TYPE = LONG POINTER TO ConfigEntry; ConfigEntry: TYPE; << The variable processesAborted is NIL unless the user has aborted a program running in an instance of a C environment. It is here as an accelerator, since the procedure StopIfCurrentProcessAborted need not be called if processesAborted is NIL. Mesa programs need not explicity refer to this var. but can instead use the inline procedure StopIfUserAborted. Environment instances that want to note a user abort should call NoteAbortedProcess, passing the process id of the program to be aborted as a parameter.>> processesAborted: ProcessList; ProcessList: TYPE = LONG POINTER TO ProcessEntry; ProcessEntry: TYPE; StopIfUserAborted: PROCEDURE = INLINE { IF processesAborted # NIL THEN StopIfCurrentProcessAborted[]; }; StopIfCurrentProcessAborted: PROCEDURE; NoteAbortedProcess: PROCEDURE [p: PROCESS]; ProcessNotRegistered: ERROR; ProgramExited: ERROR [status: INTEGER]; TooMuchGlobalArraySpace: ERROR; log: Stream.Handle; -- CRuntime.log z: UNCOUNTED ZONE; arrayZone: UNCOUNTED ZONE; Start: PROCEDURE [ gf: GlobalFrameHandle, argc: CARDINAL, argv: LONG POINTER TO CString.CString, stdin, stdout, stderr: Stream.Handle] RETURNS [outcome: INTEGER]; Restart: PROCEDURE [ gf: GlobalFrameHandle, argc: CARDINAL, argv: LONG POINTER TO CString.CString, stdin, stdout, stderr: Stream.Handle] RETURNS [outcome: INTEGER]; GetHeap: PROCEDURE RETURNS [UNCOUNTED ZONE]; SetHeap: PROCEDURE [h: UNCOUNTED ZONE]; EnterStream: PROCEDURE [sH: Stream.Handle] RETURNS [FilePtr]; EnterStreamGlobally: PROCEDURE [sH: Stream.Handle]; RemoveStream: PROCEDURE [sH: Stream.Handle] RETURNS [canDeleteStream: BOOLEAN]; CanDelete: PROCEDURE [sh: Stream.Handle] RETURNS [BOOLEAN]; GetStdin: PROCEDURE RETURNS [FilePtr]; GetStdout: PROCEDURE RETURNS [FilePtr]; GetStderr: PROCEDURE RETURNS [FilePtr]; SetStdin: PROCEDURE [fp: FilePtr]; SetStdout: PROCEDURE [fp: FilePtr]; SetStderr: PROCEDURE [fp: FilePtr]; CleanUp: PROCEDURE; StartProgram: PROCEDURE [ fileName: CString.CString, argc: CARDINAL, argv: LONG POINTER TO CString.CString, stdin, stdout, stderr: Stream.Handle] RETURNS [outcome: INTEGER]; RemoveConfig: PROCEDURE [gf: GlobalFrameHandle]; RegisterProcess: PROCEDURE; GetConfigHandle: PROCEDURE RETURNS [ConfigHandle]; SetConfigHandle: PROCEDURE [cH: ConfigHandle]; }.