WSFromLinkID (C Function)

WSLINK WSFromLinkID(WSENV env,long inumb)

returns the link object with ID number inumb in the WSTP environment env.

Details

  • If no link object in the environment env has the ID number inumb, WSFromLinkID() returns (WSLINK)0.
  • WSFromLinkID() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* read data from the link represented by id */

void f(WSENV env, long id)
{
    WSLINK lp;

    lp = WSFromLinkID(env, id);
    if(lp == (WSLINK)0)
        { /* unable to get the link from the id number */ }

    /* determine the type of data on lp */
    switch(WSGetNext(lp))
    {
        /* ... */
    }

    /* ... */
}