MLGetMessage (C Function)
MLGetMessage has been replaced by WSGetMessage.
int MLGetMessage(MLINK link,int* code,int*param)
reads an out-of-band message code from the urgent message channel associated with link and stores the code in code and any parameter in param.
Details

- MLGetMessage() returns a nonzero value if it reads an out-of-band message and 0 otherwise.
- MLGetMessage() is a nonblocking function.
- MLGetMessage() can return the following messages:
-
MLTerminateMessage shut down the current program MLInterruptMessage interrupt the current operation MLAbortMessage abort the current operation MLEndPacketMessage obsolete message MLSynchronizeMessage synchronize the internal expression streams for both sides of the link MLImDyingMessage other side of the link is shutting down MLWaitingAcknowledgement other side of the link needs a response MLMarkTopLevelMessage MathLink library internal message MLLinkClosingMessage MathLink library internal message MLAuthenticationFailure failure to authenticate message MLFirstUserMessage beginning of user-defined message space MLLastUserMessage end of user-defined message space - MLFirstUserMessage should be used as the starting value for any user-defined messages. You could define a new message as #define MyAppMessage MLFirstUserMessage + 1.
- User-defined messages should not have values larger than MLLastUserMessage.
- Standard MathLink messages do not have any parameters.
- MLGetMessage() is declared in the MathLink header file mathlink.h.
Examples
Basic Examples (1)
#include "mathlink.h"
/* read an out-of-band message code from a link */
void f(MLINK lp)
{
int code, param;
if(MLMessageReady(lp))
{
if(! MLGetMessage(lp, &code, ¶m))
{ /* unable to read the message code from lp */ }
}
}