MLGetUTF32Symbol (C Function)

MLGetUTF32Symbol has been replaced by WSGetUTF32Symbol.

int MLGetUTF32Symbol(MLINK link,const unsigned int **s,int *len)

gets a UTF-32 character string corresponding to the name of a symbol from the MathLink connection specified by link, storing the resulting string in s and the length in len.

Details

  • MLGetUTF32Symbol() allocates memory for the character string. You must call MLReleaseUTF32Symbol() to disown this memory. If MLGetUTF32Symbol() fails and the function's return value indicates an error, do not call MLReleaseUTF32Symbol() on the contents of s.
  • MLGetUTF32Symbol() returns immutable data.
  • MLGetUTF32Symbol() stores all characters directly in the UTF-32 encoding form.
  • The symbol s returned by MLGetUTF32Symbol() begins with a byte order mark.
  • The symbol length len includes the byte order mark.
  • MLGetUTF32Symbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLGetUTF32Symbol() fails.
  • MLGetUTF32Symbol() is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include "mathlink.h"

/* read a UTF-32 encoded symbol from a link */

void f(MLINK lp)
{
    const unsigned int *symbol;
    int len;

    if(! MLGetUTF32Symbol(lp, &symbol, &len))
        {
            /* unable to read the UTF-32 symbol from lp */
            return;
        }

    /* ... */

    MLReleaseUTF32Symbol(lp, symbol, len);
}