%N bughandler_c %F $MIR/src/subs/bug.c
%D Specify the bug handler callback function
%P dhem
%: error-handling
%B
    This routine does not have a FORTRAN counterpart, as it is normally 
    only called by C clients who need to set their own error handler if
    for some reason they don't like the MIRIAD one (e.g. C++ or java
    exceptions, or NEMO's error handler, or scripting languages such as
    Ruby and Python that provide their own exception handling
    capabilities).

    Absolutely nothing is done before or after the bug handler is
    called.  This is even more of an override than bugrecover_c
    provides because on fatal errors, habort_c is called before the bug
    cleanup routine installed by bugrecover_c is called.  Another
    difference is that bug_message and bug_severity are not set;
    instead the severity and message are passed as parameters to the
    bug handler callback function..

    If NULL is passed as the new_bug_handler parameter, the default bug
    handler will be reinstated.

    Example of usage:

    void my_bug_handler(char s, onst char *m) {
        ....
    }

    ..
    bughandler_c(my_bug_handler);
    ..                                                                  
