H5A_CREATE is a macro that is mapped to either H5A_CREATE1 or H5A_CREATE2, depending on the needs of the application.
Such macros are provided to facilitate application compatibility. For example:
- The H5A_CREATE macro will be mapped to H5A_CREATE1 and will use the H5A_CREATE1 syntax (first signature above) if an application is coded for HDF5 Release 1.6.x.
- The H5A_CREATE macro will be mapped to H5A_CREATE2 and will use the H5A_CREATE2 syntax (second signature above) if an application is coded for HDF5 Release 1.8.x.
See API Compatibility Macros in HDF5 for information on these macros and mappings.
When both the HDF5 library and the application are built and installed with no specific compatibility flags, H5A_CREATE is mapped to the most recent version of the function, currently H5A_CREATE2. If the library and/or application is compiled for Release 1.6 emulation, H5A_CREATE will be mapped to H5A_CREATE1. Function-specific flags are available to override these settings on a function-by-function basis when the application is compiled.
Specific compile-time compatibility flags and the resulting mappings are as follows:
|No compatibility flag||H5A_CREATE2 |
|Enable deprecated symbols||H5A_CREATE2 |
|Disable deprecated symbols||H5A_CREATE2 |
|Emulate Release 1.6 interface|
H5Acreate_vers = 2
H5Acreate_vers = 1
The attribute identifier returned by this macro must be released with H5A_CLOSE or resource leaks will develop.
Interface history: Signature  above is the original H5A_CREATE interface and the only interface available prior to HDF5 Release 1.8.0. This signature and the corresponding function are now deprecated but will remain directly callable as H5A_CREATE1.
Signature  above was introduced with HDF5 Release 1.8.0 and is the recommended and default interface. It is directly callable as H5A_CREATE2.
See API Compatibility Macros in HDF5 for circumstances under which either of these functions might not be available in an installed instance of the HDF5 library.