WSPutUTF8Function (C 函数)
int WSPutUTF8Function(( WSLINK l , const unsigned char * s , int v , int n )
把一个函数写入由 指定的 WSTP 连接,该函数的标头由名称为 s、长度为 v、有 n 个参数并且由 UTF-8 编码的符号给定.
范例
基本范例 (1)
#include "wstp.h"
/* A function to put List[1,2,3] to the link */
void f(WSLINK l)
{
unsigned char name[4];
name[0] = 'L';
name[1] = 'i';
name[2] = 's';
name[3] = 't';
if(! WSPutUTF8Function(l, (const unsigned char *)name, 4, 3))
{ /* Unable to put the function head to the link */ }
if(! WSPutInteger8(l, 1))
{ /* Unable to write 1 to the link */ }
if(! WSPutInteger8(l, 2))
{ /* Unable to write 2 to the link */ }
if(! WSPutInteger8(l, 3))
{ /* Unable to write 3 to the link */ }
if(! WSEndPacket(l))
{ /* Unable to write the end-of-packet sequence to the link */ }
if(! WSFlush(l))
{ /* Unable to flush the outbound data to the link */ }
}