MLReleaseUTF16ErrorMessage (C Function)

MLReleaseUTF16ErrorMessage has been replaced by WSReleaseUTF16ErrorMessage.

void MLReleaseUTF16ErrorMessage(MLINK l, const unsigned short *m, int n)

releases memory allocated by MLUTF16ErrorMessage() to store the UTF-16 encoded message in m, an array of length n.

Details

  • The memory used to contain the message m must have been allocated by a call to MLUTF16ErrorMessage().
  • MLReleaseUTF16ErrorMessage() is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include "mathlink.h"

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

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

    message = MLUTF16ErrorMessage(l, &length);

    /* We test for length <= 1 because MLUTF16Error 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 */ }

    /* ... */

    MLReleaseUTF16ErrorMessage(l, message, length);
}