WSPutArgCount (C Function)

int WSPutArgCount(WSLINK link,int n)

specifies the number of arguments of a composite function to be put on link.

Details

  • WSPutArgCount() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutArgCount() fails.
  • WSPutArgCount() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* send Plus[2,3] over a link */

void f(WSLINK lp)
{
    if(! WSPutType(lp, WSTKFUNC))
        { /* unable to send the function type to lp */ }

    if(! WSPutArgCount(lp, 2))
        { /* unable to put the number of arguments to lp */ }

    if(! WSPutSymbol(lp, "Plus"))
        { /* unable to put the symbol to lp */ }

    if(! WSPutInteger(lp, 2))
        { /* unable to put the integer to lp */ }

    if(! WSPutInteger(lp, 3))
        { /* unable to put the integer to lp */ }

    if(! WSEndPacket(lp))
        { /* unable to send the end-of-packet indicator */ }

    if(! WSFlush(lp))
        { /* unable to flush the link-output buffer */ }
}