WSPutInteger64Array (C Function)

int WSPutInteger64Array(WSLINK link,const wsint64 *a,const int *dims,const char **heads,int d)

puts an array of native 64-bit integers to the WSTP connection specified by to form a depth- array with dimensions .

Details

  • The array must be laid out in memory like a C array declared explicitly as wsint64 a[m][n].
  • If is given as NULL, the array will be assumed to have head List at every level.
  • The length of the array at level is taken to be .
  • WSPutInteger64Array() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutInteger64Array() fails.
  • WSPutInteger64Array() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* send an array of 64-bit numbers to a link */

void f(WSLINK lp)
{
    wsint64 array[2][10][2][5];
    int dims[4];
    int i;

    for(i = 0; i < 200; i++)
        {
            *((wsint64 *)array + i) = i;
        }

    dims[0] = 2;
    dims[1] = 10;
    dims[2] = 2;
    dims[3] = 5;

    if(! WSPutInteger64Array(lp, (wsint64 *)array, (int *)dims, (char **)0, 4))
        { /* unable to send the array to lp */ }
}