OpenersNotesSection(Spacer1)Details

The array s is laid out in memory like a C array declared as unsigned char s[m][n]….

h gives a list of character strings corresponding to the names of the symbols that appear as heads at each level in the array.

WSGetInteger8Array() allocates memory that must be released by calling (NonWLLink[WSReleaseInteger8Array(), paclet:ref/c/WSReleaseInteger8Array]). If WSGetInteger8Array() fails and the function's return value indicates an error, do not call (NonWLLink[WSReleaseInteger8Array(), paclet:ref/c/WSReleaseInteger8Array]) on the contents of s.

WSGetInteger8Array() returns immutable data.

WSGetInteger8Array() returns 0 in the event of an error, and a nonzero value if the function succeeds.

Use (NonWLLink[WSError(), paclet:ref/c/WSError]) to retrieve the error code if WSGetInteger8Array() fails.

WSGetInteger8Array() is declared in the WSTP head file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

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

void f(WSLINK l)
{
	unsigned char *data;
	int *dims;
	char **heads;
	int depth;

	if(! WSGetInteger8Array(l, &data, &dims, &heads, &depth))
	{ /* Unable to read the array of integers from l */ }

	/* ... */

	WSReleaseInteger8Array(l, data, dims, heads, depth);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSReleaseInteger8Array(), paclet:ref/c/WSReleaseInteger8Array])  ▪  (NonWLLink[WSGetInteger16Array(), paclet:ref/c/WSGetInteger16Array])  ▪  (NonWLLink[WSGetInteger32Array(), paclet:ref/c/WSGetInteger32Array])  ▪  (NonWLLink[WSGetInteger64Array(), paclet:ref/c/WSGetInteger64Array])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[Handling Lists, Arrays, and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}, {▪(RefLinkPlain[Portability of WSTP Programs, paclet:tutorial/PortabilityOfWSTPPrograms])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Integers, paclet:guide/WSTPCFunctionsForExchangingIntegers])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Multidimensional Arrays, paclet:guide/WSTPCFunctionsForExchangingMultidimensionalArrays])}})}})