WSNewPacket()
This feature is not supported on the Wolfram Cloud.

int WSNewPacket(WSLINK link)
skips to the end of the current packet on link.

DetailsDetails

  • WSNewPacket() works even if the head of the current top-level expression is not a standard packet type.
  • WSNewPacket() does nothing if you are already at the end of a packet.
  • WSNewPacket() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSNewPacket() fails.
  • WSNewPacket() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* read the next number from a link and ignore everything else */

void f(MLINK lp)
{
    /* determine the type of the data on the link */
    switch(WSGetType(lp))
    {
        case WSTKINT:
            /* integer data */
            break;
        case WSTKREAL:
            /* floating point data */
            break;
        default:
            /* Skip to the next packet if not a number. */
            if(! WSNewPacket(lp))
                { /* unable to jump ahead to the next packet on lp */ }
    }
}