1988-01-25 16:14:48 +00:00
|
|
|
(*$Foreign*)
|
|
|
|
DEFINITION MODULE Epilogue;
|
1988-02-19 15:54:01 +00:00
|
|
|
(*
|
|
|
|
Module: install module termination procedures to be called at
|
|
|
|
program termination
|
|
|
|
Author: Ceriel J.H. Jacobs
|
|
|
|
Version: $Header$
|
|
|
|
|
|
|
|
MODULA-2 offers a facility for the initialization of modules, but there
|
1988-01-25 16:14:48 +00:00
|
|
|
is no mechanism to have some code executed when the program finishes.
|
|
|
|
This module is a feeble attempt at solving this problem.
|
|
|
|
*)
|
1988-01-28 16:37:55 +00:00
|
|
|
PROCEDURE CallAtEnd(p: PROC): BOOLEAN;
|
1988-01-25 16:14:48 +00:00
|
|
|
(* Add procedure "p" to the list of procedures that must be executed when
|
|
|
|
the program finishes.
|
1989-03-22 17:36:20 +00:00
|
|
|
When the program finishes, these procedures are executed in the REVERSE
|
|
|
|
order in which they were added to the list.
|
1988-01-28 16:37:55 +00:00
|
|
|
This procedure returns FALSE when there are too many procedures to be
|
|
|
|
called (the list has a fixed size).
|
1988-01-25 16:14:48 +00:00
|
|
|
*)
|
|
|
|
END Epilogue.
|