WSReleaseUCS2ErrorMessage (C Function)

void WSReleaseUCS2ErrorMessage(WSLINK l, const unsigned short *m, int n)

releases memory allocated by WSUCS2ErrorMessage() stored in m, an array of UCS2 characters of length n.

Details

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

Examples

Basic Examples  (1)

#include "wstp.h"

/* A function for getting the error message from a link */

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

    message = WSUCS2ErrorMessage(l, &length);
    if(message == (const unsigned short *)0 || length == 0)
    { /* Unable to get the error message from the link */ }

    /* ... */

    WSReleaseUCS2ErrorMessage(l, message, length);
}