OpenersNotesSection(Spacer1)Details

WSGetSymbol() allocates memory for the character string. You must call (NonWLLink[WSReleaseSymbol(), paclet:ref/c/WSReleaseSymbol]) to disown this memory. If WSGetSymbol() fails and the function's return value indicates an error, do not call (NonWLLink[WSReleaseSymbol(), paclet:ref/c/WSReleaseSymbol]) on the value contained in s.

WSGetSymbol() creates a string that is terminated by ∖0.

WSGetSymbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.

Use (NonWLLink[WSError(), paclet:ref/c/WSError]) to retrieve the error code if WSGetSymbol() fails.

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

/* read a symbol from a link */

void f(WSLINK lp)
{
	const char *symbol;

	if(! WSGetSymbol(lp, &symbol))
		{
			/* unable to read the symbol from lp */
			return;
		}

	/* ... */

	WSReleaseSymbol(lp, symbol);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSGetByteSymbol(), paclet:ref/c/WSGetByteSymbol])  ▪  (NonWLLink[WSGetUCS2Symbol(), paclet:ref/c/WSGetUCS2Symbol])  ▪  (NonWLLink[WSGetUTF8Symbol(), paclet:ref/c/WSGetUTF8Symbol])  ▪  (NonWLLink[WSGetUTF16Symbol(), paclet:ref/c/WSGetUTF16Symbol])  ▪  (NonWLLink[WSGetUTF32Symbol(), paclet:ref/c/WSGetUTF32Symbol])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Handling Lists, Arrays and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(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 Expressions, paclet:guide/WSTPCFunctionsForExchangingExpressions])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Symbols, paclet:guide/WSTPCFunctionsForExchangingSymbols])}})}})