/** \page api-compat-macros API Compatibility Macros \tableofcontents \section audience Audience The target audience for this document has existing applications that use the HDF5 library, and is considering moving to the latest HDF5 release to take advantage of the latest library features and enhancements. \section compat-issues Compatibility Issues With each major release of HDF5, such as 1.12 or 1.10, certain compatibility issues must be considered when migrating applications from an earlier major release. This document describes the approach taken by The HDF Group to help existing users of HDF5 address compatibility issues in the HDF5 API. \section summary Summary and Motivation In response to new and evolving requirements for the library and data format, several basic functions have changed since HDF5 was first released. To allow existing applications to continue to compile and run properly, all versions of these functions have been retained in the later releases of the HDF5 library. Given the scope of changes available with each major release of HDF5, and recognizing the potentially time-consuming task of editing all the affected calls in user applications, The HDF Group has created a set of macros that can be used to flexibly and easily map existing API calls to previous release functions. We refer to these as the \Emph{API compatibility macros}. The HDF Group generally encourages users to update applications to work with the latest HDF5 library release so that all new features and enhancements are available to them. At the same time, The HDF Group understands that, under some circumstances, updating applications may not be feasible or necessary. The API compatibility macros, described in this document, provide a bridge from old APIs to new and can be particularly helpful in situations such as these:
Original function name and signature in 1.10.0 | \Code{herr_t H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data)} |
---|---|
Updated function and signature, introduced in release 1.12.0 | \Code{herr_t H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, void *op_data)} |
Original function and signature, renamed in release 1.12.0 | \Code{herr_t H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate1_t op, void *op_data)} |
API compatibility macro, introduced in release 1.12.0 |
\Code{H5Lvisit}
The macro, \Code{H5Lvisit}, will be mapped to either \Code{H5Lvisit1} or \Code{H5Lvisit2}. The mapping is determined by a combination of the configuration options use to build the HDF5 library and compile-time options used to build the application. The calling parameters used with the \Code{H5Lvisit} compatibility macro should match the number and type of the function the macros will be mapped to (\Code{H5Lvisit1} or \Code{H5Lvisit2}). The function names ending in '1' or '2' are referred to as \Emph{versioned names}, and the corresponding functions are referred to as \Emph{versioned functions}. For new code development, The HDF Group recommends use of the compatibility macro mapped to the latest version of the function. The original version of the function should be considered deprecated and, in general, should not be used when developing new code. |
|
|
\Code{configure} flag | Macros map to release (versioned function; \Code{H5Lvisit} shown) |
Deprecated functions available? (\Code{H5Lvisit1}) |
---|---|---|
\Code{--with-default-api-version=v112} (the default in 1.12) |
1.12.x (\Code{H5Lvisit2}) | yes |
\Code{--with-default-api-version=v110} | 1.10.x (\Code{H5Lvisit1}) | yes |
\Code{--with-default-api-version=v18} | 1.8.x (\Code{H5Lvisit1}) | yes |
\Code{--with-default-api-version=v16} | 1.6.x (\Code{H5Lvisit1}) | yes |
\Code{--disable-deprecated-symbols} | 1.12.x (\Code{H5Lvisit2}) | no |
\Code{h5cc} option | Macros map to release (versioned function; \Code{H5Lvisit} shown) |
Deprecated functions available? (\Code{H5Lvisit1}) |
---|---|---|
\Code{-DH5_USE_112_API} \Emph{(Default behavior if no option specified.)} |
1.12.x (\Code{HLvisit2}) | yes* \Emph{*if available in library} |
\Code{-DH5_USE_110_API} | 1.10.x (\Code{HLvisit1}) | yes* \Emph{*if available in library} |
\Code{-DH5_USE_18_API} | 1.8.x (\Code{H5Lvisit1}) | yes* \Emph{*if available in library} |
\Code{-DH5_USE_16_API} | 1.6.x (\Code{H5Lvisit1}) | yes* \Emph{*if available in library} |
\Code{-DH5_NO_DEPRECATED_SYMBOLS} | 1.10.x (\Code{H5Lvisit1}) | no |
Macro | Function Mapping | Mapped to function or struct |
---|---|---|
\Code{H5xxx} | \Code{H5xxx_vers=1} | \Code{H5xxx1} |
\Code{H5xxx_vers=2} | \Code{H5xxx2} |
Macro (\Code{H5xxx}) |
Default function used if no macro specified
|
Function used if specifying 1.10
|
---|---|---|
H5Lget_info() | H5Lget_info2()
|
H5Lget_info1()
|
H5Lget_info_by_idx() | H5Lget_info_by_idx2()
|
H5Lget_info_by_idx1()
|
H5Literate() | H5Literate2()
|
H5Literate1()
|
H5Literate_by_name() | H5Literate_by_name2()
|
H5Literate_by_name1()
|
H5Lvisit() | H5Lvisit2()
|
H5Lvisit1()
|
H5Lvisit_by_name() | H5Lvisit_by_name2()
|
H5Lvisit_by_name1()
|
H5Oget_info() | H5Oget_info3()
|
H5Oget_info1()
|
H5Oget_info_by_idx() | H5Oget_info_by_idx3()
|
H5Oget_info_by_idx1()
|
H5Oget_info_by_name() | H5Oget_info_by_name3()
|
H5Oget_info_by_name1()
|
H5Ovisit() | H5Ovisit3()
|
H5Ovisit1()
|
H5Ovisit_by_name() | H5Ovisit_by_name3()
|
H5Ovisit_by_name1()
|
H5Pencode() | H5Pencode2()
|
H5Pencode1()
|
H5Sencode() | H5Sencode2()
|
H5Sencode1()
|
Macro | Default function used (if no macro specified) |
Introduced in | \Code{h5cc} version flag and value | Mapped to function or struct |
---|---|---|---|---|
H5Rdereference() | H5Rdereference2() | HDF5-1.10.0 | \Code{-DH5Rdereference_vers=1} | H5Rdereference1() |
\Code{-DH5Rdereference_vers=2} | H5Rdereference2() | |||
H5Fget_info() | H5Fget_info2() | HDF5-1.10.0 | \Code{-DH5Fget_info_vers=1} | H5Fget_info1() with struct \ref H5F_info1_t |
\Code{-DH5Fget_info_vers=2} | H5Fget_info2() with struct \ref H5F_info2_t | |||
H5Oget_info() | H5Oget_info1() | HDF5-1.10.3 | \Code{-DH5Oget_info_vers=1} | H5Oget_info1() |
\Code{-DH5Oget_info_vers=2} | H5Oget_info2() | |||
H5Oget_info_by_idx() | H5Oget_info_by_idx1() | HDF5-1.10.3 | \Code{-DH5Oget_info_by_idx_vers=1} | H5Oget_info_by_idx1() |
\Code{-DH5Oget_info_by_idx_vers=2} | H5Oget_info_by_idx2() | |||
H5Oget_info_by_name() | H5Oget_info_by_name1() | HDF5-1.10.3 | \Code{-DH5Oget_info_by_name_vers=1} | H5Oget_info_by_name1() |
\Code{-DH5Oget_info_by_name_vers=2} | H5Oget_info_by_name2() | |||
H5Ovisit() | H5Ovisit1() | HDF5-1.10.3 | \Code{-DH5Ovisit_vers=1} | H5Ovisit1() |
\Code{-DH5Ovisit_vers=2} | H5Ovisit2() | |||
H5Ovisit_by_name() | H5Ovisit_by_name1() | HDF5-1.10.3 | \Code{-DH5Ovisit_by_name_vers=1} | H5Ovisit_by_name1() |
\Code{-DH5Ovisit_by_name_vers=2} | H5Ovisit_by_name2() |
Macro | h5cc version flag and value |
Mapped to function or struct |
---|---|---|
H5Acreate() | \Code{DH5Acreate_vers=1} | H5Acreate1() |
\Code{DH5Acreate_vers=2} | H5Acreate2() | |
H5Aiterate() | \Code{DH5Aiterate_vers=1} | H5Aiterate1() with struct \ref H5A_operator1_t |
\Code{DH5Aiterate_vers=2} | H5Aiterate2() with struct \ref H5A_operator2_t |
|
H5Dcreate() | \Code{DH5Dcreate_vers=1} | H5Dcreate1() |
\Code{DH5Dcreate_vers=2} | H5Dcreate2() | |
H5Dopen() | \Code{DH5Dopen_vers=1} | H5Dopen1() |
\Code{DH5Dopen_vers=2} | H5Dopen2() | |
H5Eclear() | \Code{DH5Eclear_vers=1} | H5Eclear1() |
\Code{DH5Eclear_vers=2} | H5Eclear2() | |
H5Eprint() | \Code{DH5Eprint_vers=1} | H5Eprint1() |
\Code{DH5Eprint_vers=2} | H5Eprint2() | |
H5Epush() | \Code{DH5Epush_vers=1} | H5Epush1() |
\Code{DH5Epush_vers=2} | H5Epush2() | |
H5Eset_auto() | \Code{DH5Eset_auto_vers=1} | H5Eset_auto1() |
\Code{DH5Eset_auto_vers=2} | H5Eset_auto2() | |
H5Eget_auto() | \Code{DH5Eget_auto_vers=1} | H5Eget_auto1() |
\Code{DH5Eget_auto_vers=2} | H5Eget_auto2() | |
\ref H5E_auto_t struct for H5Eset_auto() and H5Eget_auto() |
\Code{DH5E_auto_t_vers=1} | \ref H5E_auto1_t |
\Code{DH5E_auto_t_vers=2} | \ref H5E_auto2_t | |
H5Ewalk() | \Code{DH5Ewalk_vers=1} | H5Ewalk1() with callback \ref H5E_walk1_t and struct \ref H5E_error1_t |
\Code{DH5Ewalk_vers=2} | H5Ewalk2() with callback \ref H5E_walk2_t and struct \ref H5E_error2_t |
|
H5Gcreate() | \Code{DH5Gcreate_vers=1} | H5Gcreate1() |
\Code{DH5Gcreate_vers=2} | H5Gcreate2() | |
H5Gopen() | \Code{DH5Gopen_vers=1} | H5Gopen1() |
\Code{DH5Gopen_vers=2} | H5Gopen2() | |
H5Pget_filter() | \Code{DH5Pget_filter_vers=1} | H5Pget_filter1() |
\Code{DH5Pget_filter_vers=2} | H5Pget_filter2() | |
H5Pget_filter_by_id() | \Code{DH5Pget_filter_by_id_vers=1} | H5Pget_filter_by_id1() |
\Code{DH5Pget_filter_by_id_vers=2} | H5Pget_filter_by_id2() | |
H5Pinsert() | \Code{DH5Pinsert_vers=1} | H5Pinsert1() |
\Code{DH5Pinsert_vers=2} | H5Pinsert2() | |
H5Pregister() | \Code{DH5Pregister_vers=1} | H5Pregister1() |
\Code{DH5Pregister_vers=2} | H5Pregister2() | |
H5Rget_obj_type() | \Code{DH5Rget_obj_typevers=1} | H5Rget_obj_type1() |
\Code{DH5Rget_obj_type_vers=2} | H5Rget_obj_type2() | |
H5Tarray_create() | \Code{DH5Tarray_create_vers=1} | H5Tarray_create1() |
\Code{DH5Tarray_create_vers=2} | H5Tarray_create2() | |
H5Tcommit() | \Code{DH5Tcommit_vers=1} | H5Tcommit1() |
\Code{DH5Tcommit_vers=2} | H5Tcommit2() | |
H5Tget_array_dims() | \Code{DH5Tget_array_dims_vers=1} | H5Tget_array_dims1() |
\Code{DH5Tget_array_dims_vers=2} | H5Tget_array_dims2() | |
H5Topen() | \Code{DH5Topen_vers=1} | H5Topen1() |
\Code{DH5Topen_vers=2} | H5Topen2() | |
\ref H5Z_class_t struct for H5Zregister() | \Code{DH5Z_class_t_vers=1} | \ref H5Z_class1_t |
\Code{DH5Z_class_t_vers=2} | \ref H5Z_class2_t |