MLGetInteger8 (C 関数)

MLGetInteger8WSGetInteger8に置き換えられた.

int MLGetInteger8( MLINK l , unsigned char * i )

l で指定したMathLink接続から8ビットの整数を得て,それを i に保存する.

詳細

  • リンク上のデータが実数に対応する場合には,MLGetInteger8()はそれを整数に丸める.
  • リンク上のデータが使用中のコンピュータシステムのC unsigned charに保存するには大きすぎる整数に対応する場合には,MLGetInteger8()は失敗し,0を返す.
  • まずIntegerDigitsを使って数字のリストを生成してから,次にMLGetInteger8List()を呼び出すことによって,任意精度の整数を得ることができる.
  • MLGetInteger8()は,関数が成功した場合には,非零の関数値を返す.
  • MLGetInteger8()が失敗した場合には,MLError()を使ってエラーコードを得るとよい.
  • MLGetInteger8()は,MathLinkヘッダファイルmathlink.hで宣言される.

例題

  (1)

#include "mathlink.h"

/* A function to read an unsigned char from a link */

void f(MLINK l)
{
    unsigned char c;

    if(! MLGetInteger8(l, &c))
    { /* Unable to read the integer from l */ }

    /* Use the integer */
}