H5Acreate
(hid_t loc_id
,
const char *name
,
hid_t datatype
,
hid_t dataspace
,
hid_t create_plist
)
H5Acreate
creates an attribute which is attached to the object
specified with 'location_id'. The name specified with 'name' for each
attribute for an object must be unique for that object. The 'type_id'
and 'space_id' are created with the H5T and H5S interfaces respectively.
Currently only simple dataspaces are allowed for attribute dataspaces.
The 'create_plist_id' property list is currently un-used, but will be
used int the future for optional properties of attributes. The attribute
identifier returned from this function must be released with H5Aclose or resource
leaks will develop.
The link created (see H5G API documentation for more information on link types) is a hard link, so the attribute may be shared among datasets and will not be removed from the file until the reference count for the attribute is reduced to zero.
The location object may be either a group or a dataset, both of which may have any sort of attribute.
UG: H5Acreate
creates an attribute which is attached to the object
specified with loc_id. The name specified with name
for each attribute for an object must be unique for that object. The type_id
and space_id are created with the H5T and H5S interfaces
respectively. Currently only simple dataspaces are allowed for attribute
dataspaces. The create_plist_id property list is currently
unused, but will be used int the future for optional properties of
attributes. The attribute identifier returned from this function must be released
with H5Aclose or resource leaks will develop. Attempting to create an
attribute with the same name as an already existing attribute will fail,
leaving the pre-existing attribute in place.
datatype, dataspace, create_plist in the UG are type_id, space_id, and create_plist_id, respectively, in the SC
loc_id
name
datatype
dataspace
create_plist
H5Aopen_name
(hid_t loc_id
,
const char *name
)
H5Aopen_name
opens an existing attribute for access. The attribute
name specified is used to look up the corresponding attribute for the
object. The attribute identifier returned from this function must be released with
H5Aclose or resource leaks will develop.
The location object may be either a group or a dataset, both of which may have any sort of attribute.
UG: H5Aopen_name
opens an attribute which is attached to the object
specified with loc_id. The name specified with name indicates the
attribute to access. The attribute identifier returned from this function must
be released with H5Aclose or resource leaks will develop.
loc_id
name
H5Aopen_idx
(hid_t loc_id
,
unsigned int idx
)
H5Aopen_idx
opens an existing attribute for access. The attribute
index specified is used to look up the corresponding attribute for the
object. The attribute identifier returned from this function must be released with
H5Aclose or resource leaks will develop.
The location object may be either a group or a dataset, both of which may have any sort of attribute.
UG: H5Aopen_idx
opens an attribute which is attached to the object
specified with loc_id. The attribute specified with idx indicates the
idxth attribute to access, starting with '0'.
The attribute identifier returned from this function must be released with
H5Aclose or resource leaks will develop.
loc_id
idx
H5Awrite
(hid_t attr_id
,
hid_t mem_dt
,
void *buf
)
H5Awrite
writes a complete attribute to disk.
UG: H5Awrite
writes an attribute, specified with attr_id,
with mem_type_id specifying the datatype in memory.
The entire attribute is written from buf to the file.
This function returns non-negative on success, negative on failure.
mem_dt in SC is mem_type_id in UG.
attr_id
mem_dt
buf
H5Aread
(hid_t attr_id
,
hid_t mem_dt
,
void *buf
)
H5Aread
reads a complete attribute from disk.
UG: H5Aread
reads an attribute, specified with attr_id,
with mem_type_id specifying the datatype in memory.
The entire attribute is read into buf from the file.
This function returns non-negative on success, negative on failure.
mem_dt in SC is mem_type_id in UG.
attr_id
mem_dt
buf
H5Aget_space
(hid_t attr_id
)
H5Aget_space
retrieves a copy of the dataspace for an attribute.
The dataspace identifier returned from this function must be released with H5Sclose
or resource leaks will develop.
(Identical desc in UG and SC.)
attr_id
H5Aget_type
(hid_t attr_id
)
H5Aget_type
retrieves a copy of the datatype for an attribute.
The datatype identifier returned from this function must be released with
H5Tclose or resource leaks will develop.
(Identical desc in UG and SC.)
attr_id
H5Aget_name
(hid_t attr_id
,
char *buf
,
size_t buf_size
)
H5Aget_name
retrieves the name of an attribute for an attribute identifier.
Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string
terminator. If the name of the attribute is longer than 'buf_size'-1,
the string terminator is stored in the last position of the buffer to
properly terminate the string.
(Identical desc in UG and SC.)
attr_id
buf
buf_size
buf_size
, if successful.
Otherwise returns FAIL (-1).
H5Anum_attrs
(hid_t loc_id
)
H5Anum_attrs
returns the number of attributes attached to the dataset or
group, loc_id
.
(Identical desc in UG and SC.)
loc_id
H5Aiterate
(hid_t loc_id
,
unsigned * attr_num
,
H5A_operator_t op
,
void *op_data
)
The operation receives the identifier for the group or dataset being iterated over ('loc_id'), the name of the current attribute about the object ('attr_name') and the pointer to the operator data passed in to H5Aiterate ('op_data'). The return values from an operator are:
H5Aiterate
interates over the attributes of dataset or group
specified with loc_id. For each attribute of the object,
the operator_data and some additional information (specified below)
are passed to the operator function. The iteration begins with
the *attr_number object in the group and the next attribute to be
processed by the operator is returned in *attr_number.
The prototype for H5A_operator_t is:
typedef herr_t (*H5A_operator_t)(hid_t loc_id,
const char *attr_name, void *operator_data);
The operation receives the identifier for the group or dataset being iterated over (loc_id), the name of the current attribute about the object (attr_name) and the pointer to the operator data passed in to H5Aiterate (operator_data). The return values from an operator are:
loc_id
attr_num
op
op_data
H5Adelete
(hid_t loc_id
,
const char *name
)
H5Adelete
removes the named attribute from a dataset or group.
This function should not be used when attribute identifiers are open on 'loc_id'
as it may cause the internal indexes of the attributes to change and future
writes to the open attributes to produce incorrect results.
UG: H5Adelete
removes the named attribute from a dataset or group.
This function should not be used when attribute identifiers are open on loc_id as
it may cause the internal indexes of the attributes to change and future
writes to the open attributes to produce incorrect results.
Returns non-negative on success, negative on failure.
loc_id
name
H5Aclose
(hid_t attr_id
)
H5Aclose
releases an attribute from use. Further use of the
attribute identifier will result in undefined behavior.
UG: H5Aclose
releases an attribute from use.
Further use of the attribute identifier will result in undefined behavior.
This function returns non-negative on success, negative on failure.
attr_id