WSPutFunction (C 関数)
int WSPutFunction(WSLINK link,const char *s,int n)
頭部がs という名前の記号によって与えられ,n 個の引数を取る関数を,link で指定されたWSTP接続に置く.
例題
例 (1)
#include "wstp.h"
/* put an Integrate[] expression to a link */
void f(WSLINK lp)
{
if(! WSPutFunction(lp, "Integrate", 2))
{ /* unable to put the function to lp */ }
if(! WSPutFunction(lp, "Times", 2))
{ /* unable to put the function to lp */ }
if(! WSPutFunction(lp, "Power", 2))
{ /* unable to put the function to lp */ }
if(! WSPutSymbol(lp, "x", 1))
{ /* unable to put the symbol to lp */ }
if( ! WSPutInteger(lp, 2))
{ /* unable to put the integer to lp */ }
if(! WSPutFunction(lp, "Power", 2))
{ /* unable to put the function to lp */ }
if(! WSPutFunction(lp, "Sqrt", 1))
{ /* unable to put the function to lp */ }
if(! WSPutSymbol(lp, "x", 1))
{ /* unable to put the symbol to lp */ }
if(! WSPutInteger(lp, -1))
{ /* unable to put the integer to lp */ }
if(! WSPutSymbol(lp, "x", 1))
{ /* unable to put the symbol to lp */ }
if(! WSEndPacket(lp))
{ /* unable to send the end-of-packet sequence to lp */ }
if(! WSFlush(lp))
{ /* unable to flush any buffered output data in lp */ }
}