MLReleaseUTF8ErrorMessage (C 函数)

MLReleaseUTF8ErrorMessage 已经被 WSReleaseUTF8ErrorMessage 所取代.

void MLReleaseUTF8ErrorMessage(MLINK l, const unsigned char *m, int n)

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

更多信息

  • The memory allocated to store the message m must have been allocated by a call to MLUTF8ErrorMessage().
  • MLReleaseUTF8ErrorMessage() is declared in the MathLink header file mathlink.h.

范例

基本范例  (1)

#include "mathlink.h"

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

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

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

    /* ... */

    MLReleaseUTF8ErrorMessage(l, message, length);
}