MLUTF16LinkName (C 関数)
MLUTF16LinkNameはWSUTF16LinkNameに置き換えられた.
const unsigned short * MLUTF16LinkName(MLINK l, int *n)
l で指定されたMathLink接続の名前を表す,UTF-16のコード形式でコード化された長さ n の文字列を返す.
詳細

- MLUTF16LinkName()は,解放しなければならないリンク名についてメモリを割り当てる.メモリを解放するには,関数によって返される値についてMLReleaseUTF16LinkName()を呼び出す.MLUTF16LinkName()がNULLを返す場合には,NULLの値についてMLReleaseUTF16LinkName()を呼び出してはならない.
- プログラムは,MLUTF16LinkName()で返される文字列の内容を変更してはならない.
- MLUTF16LinkName()によって返されるリンク名の文字列には,バイトオーダーマークが含まれる.
- リンク名の長さ n には,バイトオーダーマークが含まれる.
- MathLinkリンクは,リンクモード,リンクプロトコル,その他のオプションを組み合せたものを使って作成される.リンク名は,リンクを作成するのに使われるリンクモードとリンクプロトコルに必要な情報を提供る.
- MLUTF16LinkName()は,MathLinkヘッダファイルmathlink.hで宣言される.
例題
例 (1)
#include "mathlink.h"
/* A function for reading the name of a link */
void f(MLINK l)
{
const unsigned short *name;
int length;
name = MLUTF16LinkName(l, &length);
/* We check length <= 1 because MLUTF16LinkName returns a string
with a byte order mark. */
if(name == (const unsigned short *)0 || length <= 1)
{ /* Unable to read the link name */ }
/* ... */
MLReleaseUTF16LinkName(l, name, length);
}