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

int WSGetLinksFromEnvironment(WSENV env, WSLINK **links, int *l)
gets the list of currently open links in the WSTP environment env, and stores the list in links and the list length in l.

DetailsDetails

  • WSGetLinksFromEnvironment() allocates memory to store the list of links that must be released by calling WSReleaseLinksFromEnvironment(). If WSGetLinksFromEnvironment() returns an error, do not call WSReleaseLinksFromEnvironment() on the contents of links.
  • WSGetLinksFromEnvironment() returns 1 on success and 0 on failure.
  • WSGetLinksFromEnvironment() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

void examineTheLinks(MLENV env)
{
    MLINK *theLinks;
    int length;
    int apiResult;

    apiResult = WSGetLinksFromEnvironment(env, &theLinks, &length);
    if(! apiResult)
    { /* Unable to retrieve the list of open links */ }

    /* ... */

    WSReleaseLinksFromEnvironment(env, theLinks, length);
}