terminat.def

来自「Welcome to PMOS. PMOS is a set of module」· DEF 代码 · 共 46 行

DEF
46
字号
DEFINITION MODULE TerminationControl;

	(********************************************************)
	(*							*)
	(*	Support for program termination procedures.	*)
	(*							*)
	(*  The facility provided is that the caller can	*)
	(*  specify any number of parameterless procedures to	*)
	(*  be called when the program terminates.  This allows	*)
	(*  each module which needs it to have a final cleanup	*)
	(*  procedure to do things like releasing allocated	*)
	(*  memory, closing open files, etc.  The termination	*)
	(*  procedures are called in a last-in first-out order,	*)
	(*  which generally means that the higher-level modules	*)
	(*  are dealt with before lower-level modules (which is	*)
	(*  usually what we want).				*)
	(*							*)
	(*  Programmer:		P. Moylan			*)
	(*  Last edited:	14 December 1991		*)
	(*  Status:		OK				*)
	(*							*)
	(*  WARNING: the implementation of this facility is	*)
	(*  heavily system-dependent; some systems do not	*)
	(*  provide any way to regain control at program	*)
	(*  termination.					*)
	(*							*)
	(********************************************************)

PROCEDURE SetTerminationProcedure (TP: PROC);

    (* Adds TP to the list of procedures which will be called just	*)
    (* before program termination.  The list is ordered such that the	*)
    (* last procedure added will be the first one called.		*)

PROCEDURE Crash (errornum: CARDINAL);

    (* Terminates the program with an error report.	*)

PROCEDURE ReportTerminationError (): BOOLEAN;

    (* May be called from a termination handler, to write a screen	*)
    (* message showing the cause of termination.  Returns FALSE for	*)
    (* normal termination, TRUE for any other condition.		*)

END TerminationControl.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?