#include "SaConsoleCalls.h"
typedef void (*SaConsoleErrHandler) SUTPROTO((char*));
void SaAddConsoleErrHandler(SaConsoleErrHandler handler);
SaAddConsoleErrHandler
allows the application developer to install a function to intercept console text. The handler must be a function with a void return and which accepts a char* parameter (referenced in the Synopsis line beginning typedef
). You must not modify the char*
parameter passed to your handler.To uninstall a handler, call this function with a NULL handler. It does not matter whether the Console is enabled or disabled when an error handler is installed or uninstalled.
#include "SaConsoleCalls.h"
#include <stdio.h>
void myHandler(err)
char* err;
{
fprintf(stderr, "%s\n", err);
}
...
SaDisableConsole();
SaAddConsoleErrHandler(myHandler);