MLPutUTF8Symbol (C Function)
MLPutUTF8Symbol has been replaced by WSPutUTF8Symbol.
int MLPutUTF8Symbol(MLINK link,const unsigned char *s,int len)
puts a symbol whose name is given by UTF-8 encoded string s with length len to the MathLink connection specified by link.
Details
- The symbol must be encoded in the UTF-8 character encoding form.
- MLPutUTF8Symbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.
- Use MLError() to retrieve the error code if MLPutUTF8Symbol() fails.
- MLPutUTF8Symbol() is declared in the MathLink header file mathlink.h.
Examples
Basic Examples (1)
#include "mathlink.h"
/* send the symbol $HomeDirectory to a link */
void f(MLINK lp)
{
unsigned char symb[14];
symb[0] = '$';
symb[1] = 'H';
symb[2] = 'o';
symb[3] = 'm';
symb[4] = 'e';
symb[5] = 'D';
symb[6] = 'i';
symb[7] = 'r';
symb[8] = 'e';
symb[9] = 'c';
symb[10] = 't';
symb[11] = 'o';
symb[12] = 'r';
symb[13] = 'y';
if(! MLPutUT8Symbol(lp, (const unsigned char *)symb, 14))
{ /* unable to put the symbol to lp */ }
}