OpenersNotesSection(Spacer1)Details

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

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

WSTP 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.

WSUTF8LinkName() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

/* A function for reading a link's name */

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

	name = WSUTF8LinkName(l, &length);

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

	/* ... */

	WSReleaseUTF8LinkName(l, name, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSReleaseUTF8LinkName(), paclet:ref/c/WSReleaseUTF8LinkName])  ▪  (NonWLLink[WSLinkName(), paclet:ref/c/WSLinkName])  ▪  (NonWLLink[WSUCS2LinkName(), paclet:ref/c/WSUCS2LinkName])  ▪  (NonWLLink[WSUTF16LinkName(), paclet:ref/c/WSUTF16LinkName])  ▪  (NonWLLink[WSUTF32LinkName(), paclet:ref/c/WSUTF32LinkName])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP Connection Management, paclet:guide/WSTPConnectionManagement])}})}})