/* ** isc_abort.c Route to handle fatal errors ** ** Copyright (c) 1991 Peter Eriksson and Per Cederqvist of the ** Lysator Academic Computer Association. ** ** history: ** 910305 pen moved into separate file */ #include #include #include #include "isc.h" #include "intern.h" /* ** External function declarations */ extern int fprintf(FILE *, char *, ...); #if defined(__sun__) && !defined(__stdlib_h) extern void abort(void); #endif static void (*isc_abortfn)(const char *msg) = (void (*)(const char *))NULL; void isc_setabortfn(void (*abortfn)(const char *msg)) { isc_abortfn = abortfn; } void isc_abort(const char *message) { if (isc_abortfn) (*isc_abortfn)(message); else { fprintf(stderr, "\n\r*** ISC SUBSYSTEM FATAL ERROR: %s\n\r", message); abort(); } }