MLUTF32LinkName (C 関数)

MLUTF32LinkNameWSUTF32LinkNameに置き換えられた.

l で指定されたMathLink接続の名前を表す,UTF-32のコード形式でコード化された長さ n の文字列を返す.

詳細

  • MLUTF32LinkName()は,解放しなければならないリンク名についてメモリを割り当てる.メモリを解放するには,関数によって返される値についてMLReleaseUTF32LinkName()を呼び出す.MLUTF32LinkName()NULLを返す場合には,NULLの値についてMLReleaseUTF32LinkName()を呼び出してはならない.
  • プログラムは,MLUTF32LinkName()で返される文字列の内容を変更してはならない.
  • MLUTF32LinkName()は,プラットフォームに適したバイトオーダーマークで始まる文字列を返す.
  • 文字列 n の長さには,バイトオーダーマークが含まれる.
  • MathLinkリンクは,リンクモード,リンクプロトコル,その他のオプションを組み合せたものを使って作成される.リンク名は,リンクを作成するのに使われるリンクモードとリンクプロトコルに必要な情報を提供る.
  • MLUTF32LinkName()は,MathLinkヘッダファイルmathlink.hで宣言される.

例題

  (1)

#include "mathlink.h"

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

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

    name = MLUTF32LinkName(l, &length);

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

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

    /* ... */

    MLReleaseUTF32LinkName(l, name, length);
}