MLPutUTF16Symbol (C Function)
MLPutUTF16Symbol has been replaced by WSPutUTF16Symbol.
int MLPutUTF16Symbol(MLINK link,const unsigned short *s,int len)
puts a symbol whose name is given by UTF-16 encoded string s with length len to the MathLink connection specified by link.
Details
- The symbol must be encoded in the UTF-16 character encoding form.
- The symbol s must start with a byte order mark.
- The length of the symbol len must include the byte order mark.
- MLPutUTF16Symbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.
- Use MLError() to retrieve the error code if MLPutUTF16Symbol() fails.
- MLPutUTF16Symbol() is declared in the MathLink header file mathlink.h.
Examples
Basic Examples (1)
#include "mathlink.h"
/* send the symbol $InstallationDirectory to a link */
void f(MLINK lp)
{
unsigned short symb[23];
symb[0] = 0xFEFF;
symb[1] = '$';
symb[2] = 'I';
symb[3] = 'n';
symb[4] = 's';
symb[5] = 't';
symb[6] = 'a';
symb[7] = 'l';
symb[8] = 'l';
symb[9] = 'a';
symb[10] = 't';
symb[11] = 'i';
symb[12] = 'o';
symb[13] = 'n';
symb[14] = 'D';
symb[15] = 'i';
symb[16] = 'r';
symb[17] = 'e';
symb[18] = 'c';
symb[19] = 't';
symb[20] = 'o';
symb[21] = 'r';
symb[22] = 'y';
if(! MLPutUTF16Symbol(lp, (const unsigned short *)symb, 23))
{ /* unable to put the symbol to lp */ }
}