WSTestHead (C 函数)
int WSTestHead(WSLINK link,const char *head,int *n)
检验从 link 中读取的下一个对象是否是一个具有标头 head 的表达式,并把表达式的自变量数存在 n 中.
范例
基本范例 (1)
#include "wstp.h"
/* test whether the head of the incoming object is "ReturnPacket" */
void f(WSLINK lp)
{
int args;
if(WSTestHead(lp, "ReturnPacket", &args))
{ /* read the contents of the ReturnPacket[] */ }
else
{ /* the head of incoming packet is not "ReturnPacket" */ }
}