#include <OTC/OTC.h> typedef void(*PFV)(); void terminate(); PFV set_terminate(PFV); void OTCLIB_TERMINATE();
OTCLIB_TERMINATE()
function is intended to be used in place of
exit()
,
when it is necessary to terminate the program in abnormal situations.
The function has C linkage and may be invoked in either C or C++. The
result of invoking
OTCLIB_TERMINATE()
is that the
terminate()
function will be invoked.
By default, the
terminate()
function will invoke
abort()
.
If a user terminate function is provided, by way of using
the function
set_terminate()
,
then that will be called. It is expected that the user terminate function
does not return. If it does, then
abort()
will still be called.
The terminate()
and set_terminate()
are modelled after
equivalent functions, proposed as part of the exception mechanism for C++.
Where these functions exist as part of the standard C++ library, they will
be used over the versions in this library.
core
- produced by
terminate()
if no terminate function provided, or if the user terminate function returned.