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


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)
        case CALLPKT:
            /* read the CallPacket[] */
        case EVALUATEPKT:
            /* read the EvaluatePacket[] */
        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 »