OpenersNotesSection(Spacer1)Details

After the call to MLPutUTF32Function(), other MathLink functions must be called to send the arguments of the function.

The function name s encoded in UTF-32 must start with a byte order mark.

The length of the symbol name s stored in v must include the byte order mark.

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

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

MLPutUTF32Function() 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 to put List[1,2,3] to the link */

void f(MLINK l)
{
	unsigned int name[5];

	name[0] = 0xFEFF;
	name[1] = 'L';
	name[2] = 'i';
	name[3] = 's';
	name[4] = 't';

	if(! MLPutUTF32Function(l, (const unsigned int *)name, 5, 3))
	{ /* Unable to write the function to the link */ }

	if(! MLPutInteger8(l, 1))
	{ /* Unable to write 1 to the link */ }

	if(! MLPutInteger8(l, 2))
	{ /* Unable to write 2 to the link */ }

	if(! MLPutInteger8(l, 3))
	{ /* Unable to write 3 to the link */ }

	if(! MLEndPacket(l))
	{ /* Unable to send the end-of-packet sequence to the link */ }

	if(! MLFlush(l))
	{ /* Unable to flush the outbound data to the link */ }
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLPutFunction(), paclet:/ref/c/MLPutFunction])  ▪  (NonWLLink[MLPutUCS2Function(), paclet:/ref/c/MLPutUCS2Function])  ▪  (NonWLLink[MLPutUTF16Function(), paclet:/ref/c/MLPutUTF16Function])  ▪  (NonWLLink[MLPutUTF8Function(), paclet:/ref/c/MLPutUTF8Function])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[Handling Lists, Arrays, and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}})}})