[Back to Interface] [Prev] [Next]

GRsetattr/mgsnatt/mgscatt

intn GRsetattr(int32 [obj]_id, char *attr_name, int32 data_type, int32 count, VOIDP values)

[obj]_id IN:

Raster image identifier (ri_id), returned by GRcreate or GRselect or GR interface identifier (gr_id), returned by GRstart

attr_name IN:

Name of the attribute

data_type IN:

Data type of the attribute

count IN:

Number of values in the attribute

values IN:

Buffer for the attribute values

Purpose

Assigns an attribute to a raster image or a file.

Return value

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

Description

GRsetattr attaches the attribute to the object specified by the parameter obj_id. The attribute is defined by its name, attr_name, data type, data_type, number of attribute values, count, and the attribute values, values. GRsetattr provides a generic way for users to define metadata. It implements the label = value data abstraction.

If an GR interface identifier (gr_id) is specified as the parameter obj_id, a global attribute is created which applies to all objects in the file. If a raster image identifier (ri_id) is specified as the parameter obj_id, an attribute is attached to the specified raster image.

The parameter attr_name can be any ASCII string.

The parameter data_type can contain any data type supported by the HDF library. These data types are listed in Table 1A in Section I of this manual.

Attribute values are passed in the parameter values. The number of attribute values is defined by the parameter count . If more than one value is stored, all values must have the same data type. If an attribute with the given name, data type and number of values exists, it will be overwritten. Currently, the only predefined attribute is the fill value, identified by the FILL_ATTR definition.

Note that there are two FORTRAN-77 versions of this routine; one for numeric data (mgsnatt) and the other for character data (mgscatt).

FORTRAN

integer function mgsnatt([obj]_id, attr_name, data_type, count, values)

integer ri_id, comp_type, comp_prm(*)

integer [obj]_id, data_type, count

character*(*) attr_name

<valid numeric data type> values(*)

integer function mgscatt([obj]_id, attr_name, data_type, count, values)

integer [obj]_id, data_type

integer count

character*(*) values, attr_name



[Back to Interface] [Prev] [Next]

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