OpenersNotesSection(Spacer1)Details

The memory allocated to hold the link name n must have been allocated by a call to (NonWLLink[MLUTF16LinkName(), paclet:/ref/c/MLUTF16LinkName]).

MLReleaseUTF16LinkName() 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"

/* A function for retrieving the name of a link */

void f(MLINK l)
{
	const unsigned short *name;
	int length;

	name = MLUTF16LinkName(l, &length);

	/* We test for length <= 1 because MLUTF16LinkName()
	returns a string with a byte order mark. */

	if(name == (const unsigned short *)0 || length <= 1)
	{  /* Unable to get the name of the link */ }

	/* ... */

	MLReleaseUTF16LinkName(l, name, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLUTF16LinkName(), paclet:/ref/c/MLUTF16LinkName])  ▪  (NonWLLink[MLReleaseLinkName(), paclet:/ref/c/MLReleaseLinkName])  ▪  (NonWLLink[MLReleaseUCS2LinkName(), paclet:/ref/c/MLReleaseUCS2LinkName])  ▪  (NonWLLink[MLReleaseUTF32LinkName(), paclet:/ref/c/MLReleaseUTF32LinkName])  ▪  (NonWLLink[MLReleaseUTF8LinkName(), paclet:/ref/c/MLReleaseUTF8LinkName])}})}})