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

void WSReleaseUTF16ErrorMessage(WSLINK l, const unsigned short *m, int n)
releases memory allocated by WSUTF16ErrorMessage() to store the UTF-16 encoded message in m, an array of length n.

DetailsDetails

  • The memory used to contain the message m must have been allocated by a call to WSUTF16ErrorMessage().
  • WSReleaseUTF16ErrorMessage() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* A function to retrieve the error message from a link */

void f(WSINK l)
{
    const unsigned short *message;
    int length;

    message = WSUTF16ErrorMessage(l, &length);

    /* We test for length <= 1 because WSUTF16Error message
    returns a string that begins with a byte order mark */

    if(message == (const unsigned short *)0 || length <= 1)
    { /* Unable to retrieve the error message from the link */ }

    /* ... */

    WSReleaseUTF16ErrorMessage(l, message, length);
}
Introduced in 2014
(10.0)