OpenersNotesSection(Spacer1)Details

The memory used by the name n must have been created by a call to (NonWLLink[WSLinkName(), paclet:ref/c/WSLinkName]).

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

int main(int argc, char **argv)
{
	WSENV env;
	WSLINK link;
	int error;
	const char *name;

	env = WSInitialize((WSEnvironmentParameter)0);
	if(env == (WSENV)0)
	{ /* Unable to create the WSTP environment object */ }

	link = WSOpenArgcArgv(env, argc, argv, &error);
	if(link == (WSLINK)0 || error != WSEOK)
	{ /* Unable to create link */ }

	WSActivate(link);

	name = WSLinkName(link);
	if(name == (const char *)0)
	{ /* Unable to get the link name */ }

	/* ... */

	WSReleaseLinkName(link, name);

	/* ... */

	WSClose(link);
	WSDeinitialize(env);
	return 0;
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSLinkName(), paclet:ref/c/WSLinkName])  ▪  (NonWLLink[WSReleaseUCS2LinkName(), paclet:ref/c/WSReleaseUCS2LinkName])  ▪  (NonWLLink[WSReleaseUTF16LinkName(), paclet:ref/c/WSReleaseUTF16LinkName])  ▪  (NonWLLink[WSReleaseUTF32LinkName(), paclet:ref/c/WSReleaseUTF32LinkName])  ▪  (NonWLLink[WSReleaseUTF8LinkName(), paclet:ref/c/WSReleaseUTF8LinkName])}})}})

({{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 C Functions for Exchanging Lists, paclet:guide/WSTPCFunctionsForExchangingLists])}})}})