MLGetInteger16List (C 関数)
MLGetInteger16ListはWSGetInteger16Listに置き換えられた.
int MLGetInteger16List(MLINK link,short **a,int *n)
link で指定されたMathLink接続から16ビットの整数のリストを得て,その整数を配列 a に,そしてリストの長さを n に保持しておく.
詳細

- MLGetInteger16List()は整数の配列にメモリを割り当てる.このメモリを開放するためにはMLReleaseInteger16List()を呼び出さなくてはならない.MLGetInteger16List()が不成功で関数の返す値がエラーを示している場合には,a のコンテンツについてMLReleaseInteger16List()を呼び出してはならない.
- MLGetInteger16List()は不変のデータを返す.
- MLGetInteger16List()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
- MLError()を使うと,MLGetInteger16List()が不成功の場合にエラーコードを引き出すことができる.
- MLGetInteger16List()は,MathLinkヘッダファイルmathlink.hの中で宣言される.
例題
例 (1)
#include "mathlink.h"
/* read a list of 16-bit integers from a link */
void f(MLINK lp)
{
short *data;
int length;
if(! MLGetInteger16List(lp, &data, &length))
{
/* unable to read the integer list from lp */
return;
}
/* ... */
MLReleaseInteger16List(lp, data, length);
}