WSGetNext (C Function)

int WSGetNext(WSLINK link)

goes to the next object on link and returns its type.

Details

  • The following token values can be returned:
  • WSTKERRerror
    WSTKINTinteger
    WSTKFUNCcomposite function
    WSTKREALapproximate real number
    WSTKSTRcharacter string
    WSTKSYMsymbol
    WSTKOLDINTinteger from older versions of the WSTP library
    WSTKOLDREALapproximate real number from older versions of the WSTP library
    WSTKOLDSTRcharacter string from older versions of the WSTP library
    WSTKOLDSYMsymbol from older versions of the WSTP library
    WSTKOPTSTRcharacter string from newest versions of the WSTP library
    WSTKOPTSYMsymbol from newest versions of the WSTP library
  • WSTKINT and WSTKREAL do not necessarily signify numbers that can be stored in C int and double variables.
  • WSGetNext() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* read the next type from the link */

void f(WSLINK lp)
{
    int data;

    switch(WSGetNext(lp))
    {
        case WSTKINT:
            if(! WSGetInteger32(lp, &data))
                { /* unable to read the integer from lp */ }
        /* ... */
    }
}