MLLinkName()
This feature is not supported on the Wolfram Cloud.

has been replaced by .

const char * MLLinkName(MLINK link)
returns the name string used to create the link.

DetailsDetails

  • MLLinkName() allocates memory for the link name that must be released. To release the memory, call MLReleaseLinkName() on the value returned by the function. If MLLinkName() returns NULL, do not call MLReleaseLinkName() on the NULL value.
  • Programs should not modify the contents of the string returned by MLLinkName().
  • 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 link protocol used to create the link.
  • MLLinkName() is declared in the MathLink header file mathlink.h.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Use the Pipes protocol on Unix or Mac OS X to launch a link:

In[1]:=
Click for copyable input
Out[1]=

The link name contains the pathname and command-line arguments to use to connect to the link:

In[2]:=
Click for copyable input
Out[2]=

Use the TCPIP protocol to create a link:

In[1]:=
Click for copyable input
Out[1]=

The link name contains the port and hostname pairs to use to establish the TCP connection:

In[2]:=
Click for copyable input
Out[2]=

Use the SharedMemory protocol to create a link:

In[1]:=
Click for copyable input
Out[1]=

The link name contains the name of the shared memory object:

In[2]:=
Click for copyable input
Out[2]=

Declare a const char * variable and get the link name:

#include "mathlink.h"

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

void f(MLINK lp)
{
    const char *name;

    name = MLLinkName(lp);
    if(name == (const char *)0)
    { /* Unable to get the link name */ }

    /* ... */

    MLReleaseLinkName(lp, name);
}