MLGetInteger8List (C 函数)

MLGetInteger8List 已经被 WSGetInteger8List 所取代.

int WLGetInteger8List( MLINK l , unsigned char ** i , int * c )

gets a list of 8-bit integers from the MathLink connection specified by l, storing the integers in the array i and the length of the list in c.

更多信息

  • MLGetInteger8List() allocates memory for the array of integers. You must call MLReleaseInteger8List() to release this memory. If MLGetInteger8List() fails and the function's return value indicates an error, do not call MLReleaseInteger8List() on the contents of i.
  • MLGetInteger8List() returns immutable data.
  • MLGetInteger8List() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLGetInteger8List() fails.
  • MLGetInteger8List() is declared in the MathLink header file mathlink.h.

范例

基本范例  (1)

#include "mathlink.h"

/* A function for reading a list of 8-bit integers from a link */

void f(MLINK l)
{
    unsigned char *data;
    int length;
    
    if(! MLGetInteger8List(l, &data, &length))
    { /* Unable to read the integer list from the link */ }

    /* ... */

    MLReleaseInteger8List(l, data, length);
}