WSGetInteger64List (C Function)

int WSGetInteger64List(WSLINK link,wsint64 **a,int *n)

gets a list of native 64-bit integers from the WSTP connection specified by link, storing the integers in the array a and the length of the list in n.

Details

  • WSGetInteger64List() allocates memory for the array of integers. You must call WSReleaseInteger64List() to disown this memory. If WSGetInteger64List() fails and the function's return value indicates an error, do not call WSReleaseInteger64List() on the contents of a.
  • WSGetInteger64List() returns immutable data.
  • WSGetInteger64List() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSGetInteger64List() fails.
  • WSGetInteger64List() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* read a list of 64-bit integers from a link */

void f(WSLINK lp)
{
    wsint64 *data;
    int length;

    if(! WSGetInteger64List(lp, &data, &length))
        {
            /* unable to read the integer list from lp */
            return;
        }

    /* ... */

    WSReleaseInteger64List(lp, data, length);
}