MLNextPacket()

int MLNextPacket(MLINK link)
goes to the next packet on link and returns a constant to indicate its head.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

#include "mathlink.h"

/* read the type of the incoming packet on a link */

void f(MLINK lp)
{
    switch(MLNextPacket(lp))
    {
        case CALLPKT:
            /* read the CallPacket[] */
            break;
        case EVALUATEPKT:
            /* read the EvaluatePacket[] */
            break;
        case RETURNPKT:
            /* read the EvaluatePacket[] */

        /* ... */

        case ILLEGALPKT:
            /* unable to read the next packet from lp */
    }    
}
New to Mathematica? Find your learning path »
Have a question? Ask support »