OpenersNotesSection(Spacer1)Details

MLGetLinksFromEnvironment() allocates memory to store the list of links that must be released by calling (NonWLLink[MLReleaseLinksFromEnvironment(), paclet:/ref/c/MLReleaseLinksFromEnvironment]). If MLGetLinksFromEnvironment() returns an error, do not call (NonWLLink[MLReleaseLinksFromEnvironment(), paclet:/ref/c/MLReleaseLinksFromEnvironment]) on the contents of links.

MLGetLinksFromEnvironment() returns 1 on success and 0 on failure.

MLGetLinksFromEnvironment() is declared in the MathLink header file (RefLink[mathlink.h, paclet:/ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

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

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

	/* ... */

	MLReleaseLinksFromEnvironment(env, theLinks, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLReleaseLinksFromEnvironment(), paclet:/ref/c/MLReleaseLinksFromEnvironment])}})}})