MLGetInteger64List (C 関数)

MLGetInteger64ListWSGetInteger64Listに置き換えられた.

int MLGetInteger64List(MLINK link,mlint64 **a,int *n)

link で指定されたMathLink接続からネイティブの64ビットの整数のリストを得て,その整数を配列 a に,そしてリストの長さを n に保持しておく.

詳細

  • MLGetInteger64List()は整数の配列にメモリを割り当てる.このメモリを開放するためにはMLReleaseInteger64List()を呼び出さなくてはならない.MLGetInteger64List()が不成功で関数の返す値がエラーを示す場合には,a のコンテンツについてMLReleaseInteger64List()を呼び出してはならない.
  • MLGetInteger64List()は不変のデータを返す.
  • MLGetInteger64List()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
  • MLError()を使うと,MLGetInteger64List()が不成功の場合にエラーコードを引き出すことができる.
  • MLGetInteger64List()は,MathLinkヘッダファイルmathlink.hの中で宣言される.

例題

  (1)

#include "mathlink.h"

/* read a list of 64-bit integers from a link */

void f(MLINK lp)
{
    mlint64 *data;
    int length;

    if(! MLGetInteger64List(lp, &data, &length))
        {
            /* unable to read the integer list from lp */
            return;
        }

    /* ... */

    MLReleaseInteger64List(lp, data, length);
}