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:
-
WSTKERR error WSTKINT integer WSTKFUNC composite function WSTKREAL approximate real number WSTKSTR character string WSTKSYM symbol WSTKOLDINT integer from older versions of the WSTP library WSTKOLDREAL approximate real number from older versions of the WSTP library WSTKOLDSTR character string from older versions of the WSTP library WSTKOLDSYM symbol from older versions of the WSTP library WSTKOPTSTR character string from newest versions of the WSTP library WSTKOPTSYM symbol 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 */ }
/* ... */
}
}