User`s guide
MATLAB Compiler Generated Interface Functions
you modify the generated Dll Mai n (which we do not recomm end you do),
make sure you preserve this part of its functionality.
Library termination is simple.
void libtriangleTermin ate( void)
Call this function (once for each library) before calling
mclTerminateApplication.
Print and Error Handling Functions
By default, MATLAB Compiler generated applications and shared libraries
send printed output to standard output and error messages to standard e rror.
MATLAB Compiler generates a default print handler and a default error
handler that implement this policy. If you’d like to change this behavior,
you must write your own error and print handlers and pass them in to the
appropriate generated initialization function.
You may replace either, both, or neither of these two functions. Note that the
MCR sends all regular output through the print handler and all error o utput
through the error h andler. Therefore, if you redefine either of these functions,
the MCR will use your version of the function for all the output that falls into
class for which it invokes that handler.
The default print handler takes the following form.
static int mclDefaultPrintHan dler(const char *s)
The implementation is straightforward; it takes a string, p rin ts it on standa rd
output, and returns the number of characters printed. If you override or
replace this function, your version must also take a string and return the
number of characters “handled.” The MCR calls the print handler when an
executing M-file makes a request for printed output, e.g., via the MATLAB
function
disp. The print handler does not terminate the output with a
carriage return or line feed.
The default error handler has the same form as the print handler.
static int mclDefaultErrorHan dler(const char *s)
7-27