Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/

| HDF5 Last Updated on 2026-07-28 The HDF5 Field Guide

Loading...
Searching...
No Matches
H5Apublic.h File Reference
`#include "H5public.h"`
`#include "H5Ipublic.h"`
`#include "H5Opublic.h"`
`#include "H5Tpublic.h"`

## Data Structures
struct | H5A_info_t

## Typedefs
typedef herr_t(* | H5A_operator1_t) (hid_t location_id, const char *attr_name, void *operator_data)
| Typedef for H5Aiterate1() callbacks.
typedef herr_t(* | H5A_operator2_t) (hid_t location_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data)

## Functions
herr_t | H5Aclose (hid_t attr_id)
| Closes the specified attribute.
herr_t | H5Aclose_async (hid_t attr_id, hid_t es_id)
hid_t | H5Acreate1 (hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t acpl_id)
| Creates an attribute attached to a specified object.
hid_t | H5Acreate2 (hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id)
| Creates an attribute attached to a specified object.
hid_t | H5Acreate_async (hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t es_id)
hid_t | H5Acreate_by_name (hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id)
| Creates an attribute attached to a specified object.
hid_t | H5Acreate_by_name_async (hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id, hid_t es_id)
herr_t | H5Adelete (hid_t loc_id, const char *attr_name)
| Deletes an attribute from a specified location.
herr_t | H5Adelete_by_idx (hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id)
| Deletes an attribute from an object according to index order.
herr_t | H5Adelete_by_name (hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id)
| Removes an attribute from a specified location.
htri_t | H5Aexists (hid_t obj_id, const char *attr_name)
| Determines whether an attribute with a given name exists on an object.
herr_t | H5Aexists_async (hid_t obj_id, const char *attr_name, bool *exists, hid_t es_id)
htri_t | H5Aexists_by_name (hid_t obj_id, const char *obj_name, const char *attr_name, hid_t lapl_id)
| Determines whether an attribute with a given name exists on an object.
herr_t | H5Aexists_by_name_async (hid_t loc_id, const char *obj_name, const char *attr_name, bool *exists, hid_t lapl_id, hid_t es_id)
hid_t | H5Aget_create_plist (hid_t attr_id)
| Gets an attribute creation property list identifier.
herr_t | H5Aget_info (hid_t attr_id, H5A_info_t *ainfo)
| Retrieves attribute information by attribute identifier.
herr_t | H5Aget_info_by_idx (hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5A_info_t *ainfo, hid_t lapl_id)
| Retrieves attribute information by attribute index position.
herr_t | H5Aget_info_by_name (hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo, hid_t lapl_id)
| Retrieves attribute information by attribute name.
ssize_t | H5Aget_name (hid_t attr_id, size_t buf_size, char *buf)
| Gets an attribute name.
ssize_t | H5Aget_name_by_idx (hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, size_t size, hid_t lapl_id)
| Gets an attribute name by attribute index position.
int | H5Aget_num_attrs (hid_t loc_id)
| Determines the number of attributes attached to an object.
hid_t | H5Aget_space (hid_t attr_id)
| Gets a copy of the dataspace for an attribute.
hsize_t | H5Aget_storage_size (hid_t attr_id)
| Returns the amount of storage used to store an attribute.
hid_t | H5Aget_type (hid_t attr_id)
| Gets an attribute's datatype.
herr_t | H5Aiterate1 (hid_t loc_id, unsigned *idx, H5A_operator1_t op, void *op_data)
| Calls a user's function for each attribute on an object.
herr_t | H5Aiterate2 (hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data)
| Calls a user-defined function for each attribute on an object.
herr_t | H5Aiterate_by_name (hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapl_id)
| Calls user-defined function for each attribute on an object.
hid_t | H5Aopen (hid_t obj_id, const char *attr_name, hid_t aapl_id)
| Opens an attribute for an object specified by object identifier and attribute name.
hid_t | H5Aopen_async (hid_t obj_id, const char *attr_name, hid_t aapl_id, hid_t es_id)
hid_t | H5Aopen_by_idx (hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t aapl_id, hid_t lapl_id)
| Opens the nth attribute attached to an object.
hid_t | H5Aopen_by_idx_async (hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t aapl_id, hid_t lapl_id, hid_t es_id)
hid_t | H5Aopen_by_name (hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, hid_t lapl_id)
| Opens an attribute for an object by object name and attribute name.
hid_t | H5Aopen_by_name_async (hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, hid_t lapl_id, hid_t es_id)
hid_t | H5Aopen_idx (hid_t loc_id, unsigned idx)
| Opens the attribute specified by its index.
hid_t | H5Aopen_name (hid_t loc_id, const char *name)
| Opens an attribute specified by name.
herr_t | H5Aread (hid_t attr_id, hid_t type_id, void *buf)
| Reads the value of an attribute.
herr_t | H5Aread_async (hid_t attr_id, hid_t dtype_id, void *buf, hid_t es_id)
herr_t | H5Arename (hid_t loc_id, const char *old_name, const char *new_name)
| Renames an attribute.
herr_t | H5Arename_async (hid_t loc_id, const char *old_name, const char *new_name, hid_t es_id)
herr_t | H5Arename_by_name (hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id)
herr_t | H5Arename_by_name_async (hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id, hid_t es_id)
herr_t | H5Awrite (hid_t attr_id, hid_t type_id, const void *buf)
| Writes data to an attribute.
herr_t | H5Awrite_async (hid_t attr_id, hid_t type_id, const void *buf, hid_t es_id)

## Typedef Documentation

## ◆ H5A_operator1_t

typedef herr_t(* H5A_operator1_t) (hid_t location_id, const char *attr_name, void *operator_data)

Typedef for H5Aiterate1() callbacks.

Parameters

  [in] | location_id | The identifier for the group, dataset or named datatype being iterated over
  [in] | attr_name | The name of the current object attribute
  [in,out] | operator_data | A pointer to the operator data passed into H5Aiterate1()

Returns
  The return values from an operator are:
  - Zero causes the iterator to continue, returning zero when all attributes have been processed.
  - Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the next attribute.
  - Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the next attribute.

## ◆ H5A_operator2_t

typedef herr_t(* H5A_operator2_t) (hid_t location_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data)

Typedef for H5Aiterate2() / H5Aiterate_by_name() callbacks

Parameters

  [in] | location_id | The identifier for the group, dataset or named datatype being iterated over
  [in] | attr_name | The name of the current object attribute
  [in] | ainfo | The attribute's info struct
  [in,out] | op_data | A pointer to the operator data passed into H5Aiterate2() or H5Aiterate_by_name()

Returns
  The return values from an operator are:
  - Zero causes the iterator to continue, returning zero when all attributes have been processed.
  - Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the next attribute.
  - Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the next attribute.

Attention
  Leaving callback functions:
  The callback function must return normally, even in the case of error. Returning with H5_ITER_ERROR, instead of leaving by means of exceptions, exit() function, etc... will allow the HDF5 library to manage its resources and maintain a consistent state. See C++ Developers using HDF5 C-API functions warning for detail.

Since
  1.8.0