MLReleaseUTF32ErrorMessage (C 函数)

MLReleaseUTF32ErrorMessage 已经被 WSReleaseUTF32ErrorMessage 所取代.

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

releases memory allocated by MLUTF32ErrorMessage() to store the UTF-32 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 MLUTF32ErrorMessage().
  • MLReleaseUTF32ErrorMessage() is declared in the MathLink header file mathlink.h.

范例

基本范例  (1)

#include "mathlink.h"

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

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

    message = MLUTF32ErrorMessage(l, &length);

    /* We check for length <= 1 here because MLUTF32ErrorMessage
    returns a string with a byte order mark. */

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

    /* ... */

    MLReleaseUTF32ErrorMessage(l, message, length);
}