WSPutUTF32Function (C Function)

int WSPutUTF32Function(( WSLINK l , const unsigned int * s , int v , int n )

puts a function with head given by a UTF-32 encoded symbol with name s of length v and with n arguments to the WSTP connection specified by l.

Details

  • After the call to WSPutUTF32Function(), other WSTP functions must be called to send the arguments of the function.
  • The function name s encoded in UTF-32 must start with a byte order mark.
  • The length of the symbol name s stored in v must include the byte order mark.
  • WSPutUTF32Function() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutUTF32Function() fails.
  • WSPutUTF32Function() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* A function to put List[1,2,3] to the link */

void f(WSLINK l)
{
    unsigned int name[5];

    name[0] = 0xFEFF;
    name[1] = 'L';
    name[2] = 'i';
    name[3] = 's';
    name[4] = 't';

    if(! WSPutUTF32Function(l, (const unsigned int *)name, 5, 3))
    { /* Unable to write the function 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 send the end-of-packet sequence to the link */ }

    if(! WSFlush(l))
    { /* Unable to flush the outbound data to the link */ }
}