This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function


int MLGetInteger32List(MLINK link, int **a, int *n)
gets a list of 32-bit integers from the MathLink connection specified by link, storing the integers in the array a and the length of the list in n.
  • MLGetInteger32List() allocates memory for the array of integers. You must call MLReleaseInteger32List() to disown this memory. If MLGetInteger32List() fails and the function's return value indicates an error, do not call MLReleaseInteger32() on the contents of a.
  • MLGetInteger32List() returns immutable data.
  • MLGetInteger32List() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLGetInteger32List() fails.
  • MLGetInteger32List() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

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

void f(MLINK lp)
    int *data;
    int length;

    if(! MLGetInteger32List(lp, &data, &length))
            /* unable to read the integer list from lp */

    /* ... */

    MLReleaseInteger32List(lp, data, length);