OpenersNotesSection(Spacer1)Details

MLUTF32LinkName() allocates memory for the link name that must be released. To release the memory, call (NonWLLink[MLReleaseUTF32LinkName(), paclet:/ref/c/MLReleaseUTF32LinkName]) on the value returned by the function. If MLUTF32LinkName() returns NULL, do not call (NonWLLink[MLReleaseUTF32LinkName(), paclet:/ref/c/MLReleaseUTF32LinkName]) on the NULL value.

Programs should not modify the contents of the string returned by MLUTF32LinkName().

MLUTF32LinkName() returns a string with a platform-appropriate byte order mark.

The length of the string n includes the byte order mark.

MathLink links are created using a combination of link mode, link protocol, and other options. The link name provides necessary information for the link mode and link protocol used to create the link.

MLUTF32LinkName() 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 getting the name of a link */

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

	name = MLUTF32LinkName(l, &length);

	/* We check for length <= 1 because MLUTF32LinkName returns a
	string with a byte order mark. */

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

	/* ... */

	MLReleaseUTF32LinkName(l, name, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLReleaseUTF32LinkName(), paclet:/ref/c/MLReleaseUTF32LinkName])  ▪  (NonWLLink[MLLinkName(), paclet:/ref/c/MLLinkName])  ▪  (NonWLLink[MLUCS2LinkName(), paclet:/ref/c/MLUCS2LinkName])  ▪  (NonWLLink[MLUTF16LinkName(), paclet:/ref/c/MLUTF16LinkName])  ▪  (NonWLLink[MLUTF8LinkName(), paclet:/ref/c/MLUTF8LinkName])}})}})