MLUCS2LinkName (C Function)

MLUCS2LinkName has been replaced by WSUCS2LinkName.

const unsigned short * MLUCS2LinkName(MLINK l, int *n)

returns the name of the link encoded as an UCS2 encoded string of length n from the MathLink connection specified by l.

Details

  • MLUCS2LinkName() allocates memory for the link name that must be released. To release the memory, call MLReleaseUCS2LinkName() on the value returned by the function. If MLUCS2LinkName() returns NULL, do not call MLReleaseUCS2LinkName() on the NULL value.
  • Programs should not modify the contents of the string returned by MLUCS2LinkName().
  • MathLink links are created using a combination of link mode, link protocol, and other options. The link name provides necessary information for the link mode and the link protocol used to create the link.
  • MLUCS2LinkName() is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include "mathlink.h"

/* A function for reading a link's name */

void f(MLINK l)
{
    const unsigned short *name;
    int length;

    name = MLUCS2LinkName(l, &length);
    if(name == NULL || length == 0)
    { /* Unable to read link name */ }

    /* ... */

    MLReleaseUCS2LinkName(l, name, length);
}