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

const unsigned char * WSUTF8LinkName(WSLINK l, int *n)
returns a string of length n encoded in the UTF-8 encoding form representing the name string used to create the WSTP connection specified by l.

DetailsDetails

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

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

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

void f(WSINK l)
{
    const unsigned char *name;
    int length;

    name = WSUTF8LinkName(l, &length);

    if(name == (const unsigned char *)0 || length == 0)
    { /* Unable to get the name of the link */ }

    /* ... */

    WSReleaseUTF8LinkName(l, name, length);
}
Introduced in 2014
(10.0)