Purpose
Callback for printed output.
Synopsis
int XPRBdefcbmsg(XPRBprob prob,
void (XPRB_CC *userprint)(XPRBprob my_prob, void *my_object,
const char *msgtext), void *object);
Arguments
prob
|
Reference to a problem.
|
userprint
|
A user message handling function.
|
my_prob
|
Problem pointer passed to the callback function.
|
my_object
|
User-defined object passed to the callback function.
|
msgtext
|
The message text.
|
object
|
USer-defined object to be passed to the callback function.
|
Return value
0 if function executed successfully, 1 otherwise.
Example
The following defines a print function and then sets it as a callback.
XPRBprob prob;
...
void myprint(XPRBprob prob, void *my_object, const char *msg);
{
printf("BCL output: %s\n", msg);
}
...
XPRBdefcbmsg(prob, myprint, NULL);
Further information
1. This function defines a callback function that returns any messages enabled by the setting of
XPRBsetmsglevel, including warnings and error messages, any other output produced by BCL, and any messages from the Optimizer library. Independent
of the message printing settings, this callback also returns output printed by the user's program with function
XPRBprintf. If this callback is not defined by the user, any program output is printed to standard output with the exception of warnings
and error messages which are printed to the standard error output channel.
2. This function may be used before any problems have been created and even before BCL has been initialized (with first argument
NULL). In this case the printing function set by this callback applies to all problems that are creted subsequently.
3. A BCL program must
not define the message callback
XPRSsetcbmessage of Xpress-Optimizer (however, all other logging callbacks of the Optimizer may be used).
Related topics
If you have any comments or suggestions about these pages,
please send mail to docs@dashoptimization.com.