MLReleaseUTF16LinkName (C 関数)

MLReleaseUTF16LinkNameWSReleaseUTF16LinkNameに置き換えられた.

void MLReleaseUTF16LinkName(MLINK l, const unsigned short *n, int v)

MLUTF16LinkName()によって割り当てられたメモリを解放して,長さ v の配列である,UTF-16でコード化されたリンク名 n を保存する.

詳細

  • リンク名 n を保持するために使われたメモリは,MLUTF16LinkName()への呼出しによって割り当てられたものでなければならない.
  • MLReleaseUTF16LinkName()は,MathLinkヘッダファイルmathlink.hで宣言される.

例題

  (1)

#include "mathlink.h"

/* A function for retrieving the name of a link */

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

    name = MLUTF16LinkName(l, &length);

    /* We test for length <= 1 because MLUTF16LinkName()
    returns a string with a byte order mark. */

    if(name == (const unsigned short *)0 || length <= 1)
    { /* Unable to get the name of the link */ }

    /* ... */

    MLReleaseUTF16LinkName(l, name, length);
}