Mathematica > MathLink C Language Functions >
MathLink C Function

MLMessageReady()

int MLMessageReady(MLINK link)
queries the link object link to see if the link has an out-of-band message.
  • MLMessageReady() returns a nonzero value if a message is available for reading and 0 otherwise.
  • MLMessageReady() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

/* calculate the sum of the integers in a list and check for a message on a link */

int f(MLINK lp, int *list, int len)
{
    int sum;
    while(len--)
    {
        sum += *list++;
        if(MLMessageReady(lp))
            { /* read the message */ }
    }

    return sum;
}
© 2008 Wolfram Research, Inc. japanese.gif
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team