OpenersNotesSection(Spacer1)Details

WSGetUTF32Function() allocates memory for the character string corresponding to the name of the head of the function. You must call (NonWLLink[WSReleaseUTF32Symbol(), paclet:ref/c/WSReleaseUTF32Symbol]) to disown this memory. If WSGetUTF32Function() fails and the function's return value indicates an error, do not call (NonWLLink[WSReleaseUTF32Symbol(), paclet:ref/c/WSReleaseUTF32Symbol]) on the contents of s.

Programs should not modify the contents of the character string s.

The character string returned by WSGetUTF32Function() begins with a platform-appropriate byte order mark. The byte order mark is included in the length of the symbol v.

WSGetUTF32Function(l, &s, &v, &n) has the same effect as WSGetNext(l); WSGetArgCount(l, &n); WSGetUTF32Symbol(l, &s, &v).

WSGetUTF32Function() 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 WSGetUTF32Function() fails.

WSGetUTF32Function() 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 function from a link */

void f(WSLINK l)
{
	unsigned int *s;
	int length;
	int n;

	if(! WSGetUTF32Function(l, &s, &length, &n))
	{ /* Unable to read the function from the link */ }

	/* ... */

	WSReleaseUTF32Function(l, s, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSReleaseUTF32Symbol(), paclet:ref/c/WSReleaseUTF32Symbol])  ▪  (NonWLLink[WSGetFunction(), paclet:ref/c/WSGetFunction])  ▪  (NonWLLink[WSGetUCS2Function(), paclet:ref/c/WSGetUCS2Function])  ▪  (NonWLLink[WSGetUTF8Function(), paclet:ref/c/WSGetUTF8Function])  ▪  (NonWLLink[WSGetUTF16Function(), paclet:ref/c/WSGetUTF16Function])}})}})

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