MLPutUTF8Function (C 関数)
MLPutUTF8FunctionはWSPutUTF8Functionに置き換えられた.
int MLPutUTF8Function(( MLINK l , const unsigned char * s , int v , int n )
長さ v の名前 s を持つUTF-8でコード化された記号によって与えられる頭部と,n 個の引数を持つ関数を,l で指定されたMathLink接続に置く.
詳細
![](Files/MLPutUTF8Function.ja/details_1.png)
- MLPutUTF8Function()への呼出しの後,その他のMathLink関数はその関数の引数を送信するために呼び出されなければならない.
- MLPutUTF8Function()は,エラーが起った場合には0を,関数が成功した場合には非零の値を返す.
- MLPutUTF8Function()が失敗した場合には,MLError()を使ってエラーコードを得るとよい.
- MLPutUTF8Function()は,MathLinkヘッダファイルmathlink.hで宣言される.
例題
例 (1)
#include "mathlink.h"
/* A function to put List[1,2,3] to the link */
void f(MLINK l)
{
unsigned char name[4];
name[0] = 'L';
name[1] = 'i';
name[2] = 's';
name[3] = 't';
if(! MLPutUTF8Function(l, (const unsigned char *)name, 4, 3))
{ /* Unable to put the function head to the link */ }
if(! MLPutInteger8(l, 1))
{ /* Unable to write 1 to the link */ }
if(! MLPutInteger8(l, 2))
{ /* Unable to write 2 to the link */ }
if(! MLPutInteger8(l, 3))
{ /* Unable to write 3 to the link */ }
if(! MLEndPacket(l))
{ /* Unable to write the end-of-packet sequence to the link */ }
if(! MLFlush(l))
{ /* Unable to flush the outbound data to the link */ }
}