Obtain attribute value

ss_attr_get is a function defined in ssattr.c.

Synopsis:

void * ss_attr_get(ss_attr_t *attr, hid_t type, size_t offset, size_t nelmts, void *buffer)

Formal Arguments:

  • attr: The attribute in question.
  • type: The desired datatype of the returned value.
  • offset: The first element of the value to return (an element index, not byte index)
  • nelmts: The total number of elements to return. If the offset and nelmts arguments describe a range of elements that is outside that which is known to the attribute then an error is raised. If nelmts is SS_NOSIZE then the number of returned values is not limited (except perhaps by the non-zero offset).
  • buffer: The optional buffer in which to store the returned values.

Description: This function extracts the attribute value, or subpart thereof. The value is converted to the desired type, which must be conversion compatible with the datatype used to store the attribute value. The converted 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’t supply buffer then this function allocates one.

Parallel Notes: Independent

See Also: