Obtain array value¶
ss_array_get
is a function defined in ssarray.c.
Synopsis:
-
void *
ss_array_get
(ss_array_t *array, hid_t mtype, size_t offset, size_t nelmts, void *buffer)¶
Formal Arguments:
array
: Array from which to retrieve data.mtype
: Datatype for memory. Passss_pers_tm
(or preferably negative) for an array of persistent object links.offset
: First element to be returned. It is an error to specify a starting element that is outside the valid range of values defined for the array.nelmts
: Number of elements to return. Theoffset
andnelmts
define a range of elements to be returned. If the range extends beyond the end of the defined range of elements forarray
then an error is raised; but ifnelmts
is the constantSS_NOSIZE
then all elements up to and including the last element are returned.buffer
: The optional caller-supplied buffer to be filled in by the request. If the caller didn’t supply a buffer then one will be created.
Description: This function extracts the array value or subpart thereof. The value is copied into the optional
caller-supplied buffer
(or a buffer is allocated). If the value consists of more than one
element then desired elements to be returned can be specified with an offset and length.
Return Value: Returns a pointer (buffer
if non-null) on success; null on failure. If the caller doesn’s supply buffer
then
this function will allocate one.
Parallel Notes: Independent
See Also:
- Variable Length Arrays: Introduction for current chapter