WSPutInteger8List (C Function)

int WSPutInteger8List(( WSLINK l , const unsigned char * a , int n )

puts a list of n 8-bit integers starting from location a to the WSTP connection specified by l.


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


Basic Examples  (1)

#include "wstp.h"

/* A function to send a one-dimensional list of 8-bit integers to a link */

void f(WSLINK l)
    unsigned char list[10];
    int i;

    for(i = 0; i < 10; i++)
        list[i] = i;

    if(! WSPutInteger8List(l, (unsigned char *)list, 10))
    { /* Unable to send the list to the link */ }