MLPutUTF16Symbol()

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.

DetailsDetails

  • The symbol must be encoded in the UTF-16 character encoding form.
  • 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.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

#include "mathlink.h"

/* send the symbol $TopDirectory to a link */

void f(MLINK lp)
{
    unsigned short symb[13];

    symb[0] = '$';
    symb[1] = 'T';
    symb[2] = 'o';
    symb[3] = 'p';
    symb[4] = 'D';
    symb[5] = 'i';
    symb[6] = 'r';
    symb[7] = 'e';
    symb[8] = 'c';
    symb[9] = 't';
    symb[10] = 'o';
    symb[11] = 'r';
    symb[12] = 'y';

    if(! MLPutUTF16Symbol(lp, (const unsigned short *)symb, 13))
        { /* unable to put the symbol to lp */ }
}
New to Mathematica? Find your learning path »
Have a question? Ask support »