runtime_entry/1 hook

Synopsis

:- multifile runtime_entry/1.

runtime_entry(+Event)

This predicate is called upon start-up and exit of stand alone applications.

Arguments


Event one of [start,abort]

Description

In a default runtime system, the program starts by executing the goal,

     runtime_entry(start)
     

When that goal terminates, either by succeeding or by failing, the runtime system terminates.

Similarly, it is possible to specify what is to be done on an abort. An abort happens when a call is made either to the built-in predicate abort/0 or to the C routine QP_action(QP_ABORT). (By default, a call of QP_action(QP_ABORT) happens when a user types ^c -- see sap-rge-iha). At this point, the current computation is abandoned and the program is restarted with the goal

     runtime_entry(abort)
     

Effectively this replaces the original call to runtime_entry(start), so that when this call succeeds or fails, the runtime system terminates.

Users of the module system should ensure that the predicate runtime_entry/1 is defined in the module user, that is, not inside any user-defined module.

See Also

QP_toplevel() fli-emb-how-mai