[Back to Interface] [Prev] [Next]

SDreadattr/sfrnatt/sfrcatt

intn SDreadattr(int32 obj_id, int32 attr_index, VOIDP attr_buf)

obj_id IN:

Identifier of the object the attribute is attached to

attr_index IN:

Index of the attribute to be read

attr_buf OUT:

Buffer for the attribute values

Purpose

Reads the values of an attribute.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

SDreadattr reads the values of the attribute specified by the parameter attr_index and stores the values in the buffer attr_buf. It is assumed that the user has called SDattrinfo to retrieve the number of attribute values and allocate sufficient space for the buffer. Note that the routine does not read a subset of attribute values.

The value of obj_id can be either an SD interface identifier (sd_id), returned by SDstart, a data set identifier (sds_id), returned by SDselect, or a dimension identifier (dim_id), returned by SDgetdimid.

The value of attr_index is a positive integer and is less than the total number of attributes. The index value can be obtained using the routines SDnametoindex and SDreftoindex. The total number of attributes for the object can be obtained using the routines SDgetinfo, SDattrinfo, SDdiminfo and SDfileinfo.

Note that this routine has two FORTRAN-77 versions: sfrnatt and sfrcatt. The sfrnatt routine reads numeric attribute data and sfrcatt reads character attribute data.

FORTRAN

integer function sfrnatt(obj_id, attr_index, attr_buffer)

integer obj_id, attr_index

<valid numeric data> attr_buffer(*)

integer function sfrcatt(obj_id, attr_index, attr_buffer)

integer obj_id, attr_index

character*(*) attr_buffer



[Back to Interface] [Prev] [Next]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.