summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2021-10-18 20:20:07 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2021-10-18 20:20:07 (GMT)
commit4c253cc332397a02cd172cb80d8d23d7161a485e (patch)
tree241a0c04bc7c1a19dbc846c8487d5ada84cb0fd9
parent7c5c0bb0f0e5d396b1a4afc2ed7797dcc7f0a0b0 (diff)
parentcc7c0eb910306b3e823867e8b9bb58204f0e1422 (diff)
downloadhdf5-4c253cc332397a02cd172cb80d8d23d7161a485e.zip
hdf5-4c253cc332397a02cd172cb80d8d23d7161a485e.tar.gz
hdf5-4c253cc332397a02cd172cb80d8d23d7161a485e.tar.bz2
Merge branch 'develop' into selection_io
-rw-r--r--.clang-format2
-rw-r--r--.gitattributes1
-rw-r--r--.github/CODEOWNERS12
-rw-r--r--.github/workflows/clang-format-check.yml3
-rw-r--r--.github/workflows/clang-format-fix.yml25
-rw-r--r--.github/workflows/main.yml6
-rw-r--r--.github/workflows/pr-check.yml6
-rw-r--r--CMakeFilters.cmake18
-rw-r--r--CMakeInstallation.cmake3
-rw-r--r--CMakeLists.txt84
-rw-r--r--COPYING6
-rw-r--r--MANIFEST171
-rw-r--r--Makefile.am16
-rwxr-xr-xbin/COPYING13
-rwxr-xr-xbin/format_source2
-rwxr-xr-xbin/format_source_patch2
-rwxr-xr-xbin/release11
-rwxr-xr-xbin/trace76
-rw-r--r--c++/COPYING13
-rw-r--r--c++/examples/chunks.cpp4
-rw-r--r--c++/examples/compound.cpp4
-rw-r--r--c++/examples/create.cpp4
-rw-r--r--c++/examples/extend_ds.cpp4
-rw-r--r--c++/examples/h5group.cpp4
-rw-r--r--c++/examples/readdata.cpp4
-rw-r--r--c++/examples/testh5c++.sh.in36
-rw-r--r--c++/examples/writedata.cpp4
-rw-r--r--c++/src/CMakeLists.txt17
-rw-r--r--c++/src/H5AbstractDs.cpp8
-rw-r--r--c++/src/H5AbstractDs.h6
-rw-r--r--c++/src/H5ArrayType.cpp16
-rw-r--r--c++/src/H5ArrayType.h6
-rw-r--r--c++/src/H5AtomType.cpp16
-rw-r--r--c++/src/H5AtomType.h4
-rw-r--r--c++/src/H5Attribute.cpp24
-rw-r--r--c++/src/H5Attribute.h18
-rw-r--r--c++/src/H5CommonFG.cpp9
-rw-r--r--c++/src/H5CommonFG.h6
-rw-r--r--c++/src/H5CompType.cpp20
-rw-r--r--c++/src/H5CompType.h6
-rw-r--r--c++/src/H5Cpp.h10
-rw-r--r--c++/src/H5DaccProp.cpp19
-rw-r--r--c++/src/H5DaccProp.h4
-rw-r--r--c++/src/H5DataSet.cpp77
-rw-r--r--c++/src/H5DataSet.h21
-rw-r--r--c++/src/H5DataSpace.cpp14
-rw-r--r--c++/src/H5DataSpace.h10
-rw-r--r--c++/src/H5DataType.cpp43
-rw-r--r--c++/src/H5DataType.h10
-rw-r--r--c++/src/H5DcreatProp.cpp19
-rw-r--r--c++/src/H5DcreatProp.h4
-rw-r--r--c++/src/H5DxferProp.cpp29
-rw-r--r--c++/src/H5DxferProp.h4
-rw-r--r--c++/src/H5EnumType.cpp24
-rw-r--r--c++/src/H5EnumType.h6
-rw-r--r--c++/src/H5Exception.cpp104
-rw-r--r--c++/src/H5Exception.h28
-rw-r--r--c++/src/H5FaccProp.cpp23
-rw-r--r--c++/src/H5FaccProp.h4
-rw-r--r--c++/src/H5FcreatProp.cpp19
-rw-r--r--c++/src/H5FcreatProp.h4
-rw-r--r--c++/src/H5File.cpp14
-rw-r--r--c++/src/H5File.h14
-rw-r--r--c++/src/H5FloatType.cpp16
-rw-r--r--c++/src/H5FloatType.h6
-rw-r--r--c++/src/H5Group.cpp8
-rw-r--r--c++/src/H5Group.h20
-rw-r--r--c++/src/H5IdComponent.cpp13
-rw-r--r--c++/src/H5IdComponent.h6
-rw-r--r--c++/src/H5Include.h13
-rw-r--r--c++/src/H5IntType.cpp16
-rw-r--r--c++/src/H5IntType.h6
-rw-r--r--c++/src/H5LaccProp.cpp19
-rw-r--r--c++/src/H5LaccProp.h4
-rw-r--r--c++/src/H5LcreatProp.cpp23
-rw-r--r--c++/src/H5LcreatProp.h4
-rw-r--r--c++/src/H5Library.cpp8
-rw-r--r--c++/src/H5Location.cpp38
-rw-r--r--c++/src/H5Object.cpp34
-rw-r--r--c++/src/H5Object.h6
-rw-r--r--c++/src/H5OcreatProp.cpp19
-rw-r--r--c++/src/H5OcreatProp.h4
-rw-r--r--c++/src/H5PredType.cpp193
-rw-r--r--c++/src/H5PredType.h77
-rw-r--r--c++/src/H5PropList.cpp28
-rw-r--r--c++/src/H5PropList.h10
-rw-r--r--c++/src/H5StrType.cpp22
-rw-r--r--c++/src/H5StrType.h6
-rw-r--r--c++/src/H5VarLenType.cpp16
-rw-r--r--c++/src/H5VarLenType.h6
-rw-r--r--c++/src/h5c++.in6
-rw-r--r--c++/test/CMakeVFDTests.cmake2
-rw-r--r--c++/test/dsets.cpp198
-rw-r--r--c++/test/h5cpputil.cpp24
-rw-r--r--c++/test/h5cpputil.h4
-rw-r--r--c++/test/tarray.cpp44
-rw-r--r--c++/test/tattr.cpp238
-rw-r--r--c++/test/tcompound.cpp96
-rw-r--r--c++/test/tdspl.cpp22
-rw-r--r--c++/test/testhdf5.cpp4
-rw-r--r--c++/test/tfile.cpp67
-rw-r--r--c++/test/tfilter.cpp40
-rw-r--r--c++/test/th5s.cpp26
-rw-r--r--c++/test/titerate.cpp33
-rw-r--r--c++/test/tlinks.cpp18
-rw-r--r--c++/test/tobject.cpp42
-rw-r--r--c++/test/trefer.cpp175
-rw-r--r--c++/test/ttypes.cpp24
-rw-r--r--c++/test/tvlstr.cpp66
-rw-r--r--config/COPYING13
-rw-r--r--config/clang-cxxflags14
-rw-r--r--config/clang-warnings/noerror-general6
-rw-r--r--config/cmake/ConfigureChecks.cmake130
-rw-r--r--config/cmake/H5cxx_config.h.in16
-rw-r--r--config/cmake/H5pubconf.h.in142
-rw-r--r--config/cmake/HDF5PluginCache.cmake2
-rw-r--r--config/cmake/HDF5UseFortran.cmake223
-rw-r--r--config/cmake/HDF5_Examples.cmake.in2
-rw-r--r--config/cmake/HDF5_Examples_options.cmake7
-rw-r--r--config/cmake/HDFCXXCompilerFlags.cmake406
-rw-r--r--config/cmake/HDFCompilerFlags.cmake379
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake21
-rw-r--r--config/cmake/README.txt.cmake.in2
-rw-r--r--config/cmake/UseJava.cmake838
-rw-r--r--config/cmake/UseJavaClassFilelist.cmake17
-rw-r--r--config/cmake/UseJavaSymlinks.cmake11
-rw-r--r--config/cmake/cacheinit.cmake2
-rw-r--r--config/cmake/hdf5-config-version.cmake.in2
-rw-r--r--config/cmake/hdf5-config.cmake.in1
-rw-r--r--config/cmake/javaTargets.cmake.in39
-rw-r--r--config/cmake/libh5cc.in2
-rw-r--r--config/cmake/libhdf5.settings.cmake.in1
-rw-r--r--config/cmake/scripts/HDF5config.cmake6
-rw-r--r--config/cmake/scripts/HDF5options.cmake2
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake99
-rw-r--r--config/cmake_ext_mod/HDFCXXTests.cpp102
-rw-r--r--config/cmake_ext_mod/HDFTests.c90
-rw-r--r--config/cmake_ext_mod/HDFUseCXX.cmake115
-rw-r--r--config/commence.am2
-rw-r--r--config/gnu-cxxflags24
-rw-r--r--config/gnu-fflags10
-rw-r--r--config/gnu-flags6
-rw-r--r--config/gnu-warnings/cxx-4.91
-rw-r--r--config/gnu-warnings/cxx-94
-rw-r--r--config/gnu-warnings/developer-104
-rw-r--r--config/gnu-warnings/error-general1
-rw-r--r--config/gnu-warnings/noerror-general7
-rw-r--r--config/intel-cxxflags185
-rw-r--r--config/intel-fflags62
-rw-r--r--config/intel-flags78
-rw-r--r--config/intel-warnings/1519
-rw-r--r--config/intel-warnings/182
-rw-r--r--config/intel-warnings/developer-general4
-rw-r--r--config/intel-warnings/general1
-rw-r--r--config/intel-warnings/win-developer-general1
-rw-r--r--config/intel-warnings/win-general1
-rw-r--r--config/linux-gnulibc114
-rw-r--r--config/pgi-cxxflags101
-rw-r--r--config/pgi-fflags64
-rw-r--r--config/pgi-flags87
-rw-r--r--config/sanitizer/code-coverage.cmake18
-rw-r--r--config/sanitizer/sanitizers.cmake10
-rw-r--r--config/toolchain/clang.cmake9
-rw-r--r--configure.ac191
-rw-r--r--doc/branches-explained.md41
-rw-r--r--doc/contributing.md85
-rw-r--r--doxygen/CMakeLists.txt46
-rw-r--r--doxygen/Doxyfile.in52
-rw-r--r--doxygen/aliases163
-rw-r--r--doxygen/dox/APIVersions.dox173
-rw-r--r--doxygen/dox/About.dox23
-rw-r--r--doxygen/dox/Cookbook.dox19
-rw-r--r--doxygen/dox/DDLBNF110.dox650
-rw-r--r--doxygen/dox/DDLBNF112.dox653
-rw-r--r--doxygen/dox/FileFormatSpec.dox23
-rw-r--r--doxygen/dox/GettingStarted.dox3
-rw-r--r--doxygen/dox/H5Acreate.dox9
-rw-r--r--doxygen/dox/H5Aiterate.dox9
-rw-r--r--doxygen/dox/H5Fget_info.dox47
-rw-r--r--doxygen/dox/H5Lget_info.dox18
-rw-r--r--doxygen/dox/H5Lget_info_by_idx.dox18
-rw-r--r--doxygen/dox/H5Literate.dox22
-rw-r--r--doxygen/dox/H5Literate_by_name.dox23
-rw-r--r--doxygen/dox/H5Lvisit.dox22
-rw-r--r--doxygen/dox/H5Lvisit_by_name.dox22
-rw-r--r--doxygen/dox/H5Oget_info.dox72
-rw-r--r--doxygen/dox/H5Oget_info_by_idx.dox55
-rw-r--r--doxygen/dox/H5Oget_info_by_name.dox58
-rw-r--r--doxygen/dox/H5Ovisit.dox55
-rw-r--r--doxygen/dox/H5Ovisit_by_name.dox54
-rw-r--r--doxygen/dox/H5Sencode.dox5
-rw-r--r--doxygen/dox/MetadataCachingInHDF5.dox1020
-rw-r--r--doxygen/dox/OtherSpecs.dox11
-rw-r--r--doxygen/dox/Overview.dox32
-rw-r--r--doxygen/dox/RFC.dox91
-rw-r--r--doxygen/dox/ReferenceManual.dox89
-rw-r--r--doxygen/dox/Specifications.dox22
-rw-r--r--doxygen/dox/TechnicalNotes.dox20
-rw-r--r--doxygen/dox/api-compat-macros.dox1
-rw-r--r--doxygen/dox/cookbook/Accessibility.c48
-rw-r--r--doxygen/dox/cookbook/Accessibility.dox39
-rw-r--r--doxygen/dox/cookbook/Attributes.c61
-rw-r--r--doxygen/dox/cookbook/Attributes.dox38
-rw-r--r--doxygen/dox/cookbook/Files.c87
-rw-r--r--doxygen/dox/cookbook/Files.dox71
-rw-r--r--doxygen/dox/cookbook/Performance.dox21
-rw-r--r--doxygen/dox/mainpage.dox44
-rw-r--r--doxygen/dox/maybe_metadata_reads.dox50
-rw-r--r--doxygen/dox/rm-template.dox171
-rw-r--r--doxygen/examples/FF-IH_FileGroup.gifbin0 -> 3407 bytes
-rw-r--r--doxygen/examples/FF-IH_FileObject.gifbin0 -> 2136 bytes
-rw-r--r--doxygen/examples/FileFormatSpecChunkDiagram.jpgbin0 -> 29237 bytes
-rw-r--r--doxygen/examples/H5.format.1.0.html4050
-rw-r--r--doxygen/examples/H5.format.1.1.html6439
-rw-r--r--doxygen/examples/H5.format.2.0.html14902
-rw-r--r--doxygen/examples/H5.format.html20400
-rw-r--r--doxygen/examples/H5A_examples.c145
-rw-r--r--doxygen/examples/H5D_examples.c252
-rw-r--r--doxygen/examples/H5E_examples.c97
-rw-r--r--doxygen/examples/H5F_examples.c228
-rw-r--r--doxygen/examples/H5G_examples.c186
-rw-r--r--doxygen/examples/H5I_examples.c242
-rw-r--r--doxygen/examples/H5L_examples.c156
-rw-r--r--doxygen/examples/H5O_examples.c193
-rw-r--r--doxygen/examples/H5PL_examples.c97
-rw-r--r--doxygen/examples/H5P_examples.c227
-rw-r--r--doxygen/examples/H5Pget_metadata_read_attempts.1.c22
-rw-r--r--doxygen/examples/H5Pget_metadata_read_attempts.2.c44
-rw-r--r--doxygen/examples/H5Pget_metadata_read_attempts.3.c44
-rw-r--r--doxygen/examples/H5Pget_object_flush_cb.c41
-rw-r--r--doxygen/examples/H5Pset_metadata_read_attempts.c59
-rw-r--r--doxygen/examples/H5Pset_object_flush_cb.c41
-rw-r--r--doxygen/examples/H5R_examples.c171
-rw-r--r--doxygen/examples/H5S_examples.c132
-rw-r--r--doxygen/examples/H5T_examples.c136
-rw-r--r--doxygen/examples/H5Z_examples.c108
-rw-r--r--doxygen/examples/H5_examples.c85
-rw-r--r--doxygen/examples/ImageSpec.html1203
-rw-r--r--doxygen/examples/PaletteExample1.gifbin0 -> 2731 bytes
-rw-r--r--doxygen/examples/Palettes.fm.anc.gifbin0 -> 4748 bytes
-rw-r--r--doxygen/examples/TableSpec.html193
-rw-r--r--doxygen/examples/ThreadSafeLibrary.html787
-rw-r--r--doxygen/examples/VFL.html1601
-rw-r--r--doxygen/hdf5_footer.html21
-rw-r--r--doxygen/hdf5_header.html61
-rw-r--r--doxygen/hdf5_navtree_hacks.js246
-rw-r--r--doxygen/hdf5doxy.css251
-rw-r--r--doxygen/hdf5doxy_layout.xml183
-rw-r--r--doxygen/img/FF-IH_FileGroup.gifbin0 -> 3407 bytes
-rw-r--r--doxygen/img/FF-IH_FileObject.gifbin0 -> 2136 bytes
-rw-r--r--doxygen/img/FileFormatSpecChunkDiagram.jpgbin0 -> 29237 bytes
-rw-r--r--doxygen/img/HDFG-logo.pngbin4541 -> 1689 bytes
-rw-r--r--doxygen/img/PaletteExample1.gifbin0 -> 2731 bytes
-rw-r--r--doxygen/img/Palettes.fm.anc.gifbin0 -> 4748 bytes
-rw-r--r--doxygen/img/ftv2node.pngbin0 -> 86 bytes
-rw-r--r--doxygen/img/ftv2pnode.pngbin0 -> 229 bytes
-rw-r--r--examples/CMakeTests.cmake7
-rw-r--r--examples/h5_attribute.c2
-rw-r--r--examples/h5_group.c10
-rw-r--r--examples/h5_vds.c11
-rw-r--r--examples/testh5cc.sh.in6
-rw-r--r--fortran/COPYING13
-rw-r--r--fortran/src/CMakeLists.txt109
-rw-r--r--fortran/src/H5Fff.F904
-rw-r--r--fortran/src/H5match_types.c4
-rw-r--r--fortran/src/Makefile.am2
-rw-r--r--fortran/test/CMakeLists.txt14
-rw-r--r--fortran/test/fortranlib_test.F904
-rw-r--r--fortran/test/tH5F.F90122
-rw-r--r--fortran/test/tH5Z.F907
-rw-r--r--hl/CMakeLists.txt12
-rw-r--r--hl/COPYING13
-rw-r--r--hl/Makefile.am5
-rw-r--r--hl/c++/COPYING13
-rw-r--r--hl/c++/src/CMakeLists.txt10
-rw-r--r--hl/c++/src/H5PacketTable.cpp55
-rw-r--r--hl/c++/src/H5PacketTable.h28
-rw-r--r--hl/c++/test/ptableTest.cpp23
-rw-r--r--hl/examples/ex_table_01.c8
-rw-r--r--hl/examples/ex_table_02.c10
-rw-r--r--hl/examples/ex_table_03.c6
-rw-r--r--hl/examples/ex_table_04.c10
-rw-r--r--hl/examples/ex_table_05.c4
-rw-r--r--hl/examples/ex_table_06.c2
-rw-r--r--hl/examples/ex_table_07.c10
-rw-r--r--hl/examples/ex_table_08.c10
-rw-r--r--hl/examples/ex_table_09.c10
-rw-r--r--hl/examples/ex_table_10.c8
-rw-r--r--hl/examples/ex_table_11.c10
-rw-r--r--hl/examples/ex_table_12.c10
-rw-r--r--hl/fortran/COPYING13
-rw-r--r--hl/fortran/src/CMakeLists.txt22
-rw-r--r--hl/src/CMakeLists.txt39
-rw-r--r--hl/src/COPYING13
-rw-r--r--hl/src/H5DS.c5
-rw-r--r--hl/src/H5IM.c5
-rw-r--r--hl/src/H5LD.c5
-rw-r--r--hl/src/H5LT.c137
-rw-r--r--hl/src/H5LTanalyze.c1846
-rw-r--r--hl/src/H5LTanalyze.l95
-rw-r--r--hl/src/H5LTparse.c1887
-rw-r--r--hl/src/H5LTparse.h135
-rw-r--r--hl/src/H5LTparse.y104
-rw-r--r--hl/src/H5LTpublic.h6
-rw-r--r--hl/src/H5PT.c4
-rw-r--r--hl/src/H5TB.c342
-rw-r--r--hl/src/hdf5_hl.h7
-rw-r--r--hl/test/COPYING13
-rw-r--r--hl/test/gen_test_ds.c2
-rw-r--r--hl/test/test_ds.c70
-rw-r--r--hl/test/test_file_image.c37
-rw-r--r--hl/test/test_image.c50
-rw-r--r--hl/test/test_ld.c25
-rw-r--r--hl/test/test_lite.c143
-rw-r--r--hl/test/test_packet.c8
-rw-r--r--hl/test/test_table.c46
-rw-r--r--hl/tools/COPYING13
-rw-r--r--hl/tools/gif2h5/gif.h6
-rw-r--r--hl/tools/gif2h5/gifread.c7
-rw-r--r--hl/tools/gif2h5/hdfgifwr.c4
-rw-r--r--hl/tools/h5watch/h5watch.c64
-rw-r--r--hl/tools/h5watch/h5watchgentest.c4
-rw-r--r--java/COPYING13
-rw-r--r--java/src/hdf/hdf5lib/H5.java66
-rw-r--r--java/src/hdf/hdf5lib/HDF5Constants.java10
-rw-r--r--java/src/hdf/hdf5lib/HDF5GroupInfo.java24
-rw-r--r--java/src/hdf/hdf5lib/HDFArray.java62
-rw-r--r--java/src/hdf/hdf5lib/HDFNativeData.java30
-rw-r--r--java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java2
-rw-r--r--java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java243
-rw-r--r--java/src/hdf/hdf5lib/structs/H5E_error2_t.java22
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java33
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java20
-rw-r--r--java/src/hdf/hdf5lib/structs/H5F_info2_t.java39
-rw-r--r--java/src/hdf/hdf5lib/structs/H5G_info_t.java12
-rw-r--r--java/src/hdf/hdf5lib/structs/H5L_info_t.java10
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java30
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_info_t.java39
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_native_info_t.java10
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_token_t.java10
-rw-r--r--java/src/hdf/hdf5lib/structs/H5_ih_info_t.java6
-rw-r--r--java/src/jni/exceptionImp.h6
-rw-r--r--java/src/jni/h5Constants.c12
-rw-r--r--java/src/jni/h5Imp.h6
-rw-r--r--java/src/jni/h5aImp.h6
-rw-r--r--java/src/jni/h5dImp.h6
-rw-r--r--java/src/jni/h5eImp.h6
-rw-r--r--java/src/jni/h5fImp.h6
-rw-r--r--java/src/jni/h5gImp.h6
-rw-r--r--java/src/jni/h5iImp.h6
-rw-r--r--java/src/jni/h5jni.h6
-rw-r--r--java/src/jni/h5lImp.h6
-rw-r--r--java/src/jni/h5oImp.h6
-rw-r--r--java/src/jni/h5pACPLImp.h6
-rw-r--r--java/src/jni/h5pDAPLImp.h6
-rw-r--r--java/src/jni/h5pDCPLImp.h6
-rw-r--r--java/src/jni/h5pDXPLImp.h6
-rw-r--r--java/src/jni/h5pFAPLImp.h6
-rw-r--r--java/src/jni/h5pFCPLImp.h6
-rw-r--r--java/src/jni/h5pGAPLImp.h6
-rw-r--r--java/src/jni/h5pGCPLImp.h6
-rw-r--r--java/src/jni/h5pImp.h6
-rw-r--r--java/src/jni/h5pLAPLImp.h6
-rw-r--r--java/src/jni/h5pLCPLImp.h6
-rw-r--r--java/src/jni/h5pOCPLImp.h6
-rw-r--r--java/src/jni/h5pOCpyPLImp.h6
-rw-r--r--java/src/jni/h5pStrCPLImp.h6
-rw-r--r--java/src/jni/h5plImp.h6
-rw-r--r--java/src/jni/h5rImp.c6
-rw-r--r--java/src/jni/h5rImp.h12
-rw-r--r--java/src/jni/h5sImp.h6
-rw-r--r--java/src/jni/h5tImp.h6
-rw-r--r--java/src/jni/h5util.c598
-rw-r--r--java/src/jni/h5util.h14
-rw-r--r--java/src/jni/h5vlImp.h6
-rw-r--r--java/src/jni/h5zImp.h6
-rw-r--r--java/src/jni/nativeData.h6
-rw-r--r--java/test/CMakeLists.txt10
-rw-r--r--java/test/Makefile.am2
-rw-r--r--java/test/TestAll.java4
-rw-r--r--java/test/TestH5.java119
-rw-r--r--java/test/TestH5Arw.java449
-rw-r--r--java/test/TestH5D.java2
-rw-r--r--java/test/TestH5Drw.java378
-rw-r--r--java/test/TestH5Pfapl.java2
-rw-r--r--java/test/TestH5Rref.java138
-rw-r--r--java/test/TestH5T.java4
-rw-r--r--java/test/junit.sh.in48
-rw-r--r--java/test/testfiles/JUnit-TestH5.txt4
-rw-r--r--java/test/testfiles/JUnit-TestH5Arw.txt13
-rw-r--r--java/test/testfiles/JUnit-TestH5Drw.txt13
-rw-r--r--m4/aclocal_cxx.m479
-rw-r--r--release_docs/COPYING13
-rw-r--r--release_docs/INSTALL13
-rw-r--r--release_docs/INSTALL_CMake.txt5
-rw-r--r--release_docs/INSTALL_Warnings.txt2
-rw-r--r--release_docs/README_HDF5_CMake17
-rw-r--r--release_docs/RELEASE.txt489
-rw-r--r--release_docs/USING_CMake_Examples.txt1
-rw-r--r--release_docs/USING_HDF5_CMake.txt32
-rw-r--r--src/CMakeLists.txt224
-rw-r--r--src/COPYING13
-rw-r--r--src/H5.c260
-rw-r--r--src/H5A.c377
-rw-r--r--src/H5AC.c40
-rw-r--r--src/H5ACmpio.c12
-rw-r--r--src/H5ACprivate.h28
-rw-r--r--src/H5ACpublic.h343
-rw-r--r--src/H5Adeprec.c35
-rw-r--r--src/H5Aint.c42
-rw-r--r--src/H5Amodule.h36
-rw-r--r--src/H5Apkg.h16
-rw-r--r--src/H5Apublic.h462
-rw-r--r--src/H5B2cache.c6
-rw-r--r--src/H5Bcache.c2
-rw-r--r--src/H5Bpkg.h30
-rw-r--r--src/H5C.c83
-rw-r--r--src/H5CS.c14
-rw-r--r--src/H5CX.c453
-rw-r--r--src/H5Cdbg.c25
-rw-r--r--src/H5Cimage.c11
-rw-r--r--src/H5Clog.h8
-rw-r--r--src/H5Clog_json.c52
-rw-r--r--src/H5Clog_trace.c52
-rw-r--r--src/H5Cmpio.c79
-rw-r--r--src/H5Cprivate.h26
-rw-r--r--src/H5Cpublic.h23
-rw-r--r--src/H5Cquery.c12
-rw-r--r--src/H5D.c454
-rw-r--r--src/H5Dchunk.c166
-rw-r--r--src/H5Ddeprec.c31
-rw-r--r--src/H5Dearray.c16
-rw-r--r--src/H5Dint.c27
-rw-r--r--src/H5Dio.c121
-rw-r--r--src/H5Dlayout.c17
-rw-r--r--src/H5Dmodule.h38
-rw-r--r--src/H5Dmpio.c2
-rw-r--r--src/H5Dpkg.h10
-rw-r--r--src/H5Dprivate.h11
-rw-r--r--src/H5Dpublic.h923
-rw-r--r--src/H5Dvirtual.c4
-rw-r--r--src/H5E.c117
-rw-r--r--src/H5EA.c410
-rw-r--r--src/H5EAcache.c707
-rw-r--r--src/H5EAdbg.c145
-rw-r--r--src/H5EAdblkpage.c126
-rw-r--r--src/H5EAdblock.c177
-rw-r--r--src/H5EAhdr.c317
-rw-r--r--src/H5EAiblock.c169
-rw-r--r--src/H5EAint.c32
-rw-r--r--src/H5EAsblock.c164
-rw-r--r--src/H5EAstat.c14
-rw-r--r--src/H5EAtest.c183
-rw-r--r--src/H5ES.c407
-rw-r--r--src/H5ESdevelop.h50
-rw-r--r--src/H5ESevent.c16
-rw-r--r--src/H5ESint.c434
-rw-r--r--src/H5ESmodule.h35
-rw-r--r--src/H5ESpkg.h18
-rw-r--r--src/H5ESprivate.h5
-rw-r--r--src/H5ESpublic.h227
-rw-r--r--src/H5Eint.c26
-rw-r--r--src/H5Emodule.h50
-rw-r--r--src/H5Eprivate.h92
-rw-r--r--src/H5Epublic.h808
-rw-r--r--src/H5F.c772
-rw-r--r--src/H5FA.c337
-rw-r--r--src/H5FAcache.c402
-rw-r--r--src/H5FAdbg.c79
-rw-r--r--src/H5FAdblkpage.c129
-rw-r--r--src/H5FAdblock.c155
-rw-r--r--src/H5FAhdr.c263
-rw-r--r--src/H5FAint.c32
-rw-r--r--src/H5FAstat.c16
-rw-r--r--src/H5FAtest.c129
-rw-r--r--src/H5FD.c40
-rw-r--r--src/H5FDcore.c35
-rw-r--r--src/H5FDcore.h64
-rw-r--r--src/H5FDdevelop.h284
-rw-r--r--src/H5FDdirect.c27
-rw-r--r--src/H5FDdirect.h63
-rw-r--r--src/H5FDfamily.c155
-rw-r--r--src/H5FDfamily.h52
-rw-r--r--src/H5FDhdfs.c55
-rw-r--r--src/H5FDhdfs.h29
-rw-r--r--src/H5FDint.c46
-rw-r--r--src/H5FDlog.c335
-rw-r--r--src/H5FDlog.h405
-rw-r--r--src/H5FDmirror.c45
-rw-r--r--src/H5FDmirror.h14
-rw-r--r--src/H5FDmpi.h8
-rw-r--r--src/H5FDmpio.c606
-rw-r--r--src/H5FDmpio.h225
-rw-r--r--src/H5FDmulti.c600
-rw-r--r--src/H5FDmulti.h219
-rw-r--r--src/H5FDprivate.h6
-rw-r--r--src/H5FDpublic.h360
-rw-r--r--src/H5FDros3.c3
-rw-r--r--src/H5FDros3.h14
-rw-r--r--src/H5FDsec2.c76
-rw-r--r--src/H5FDspace.c14
-rw-r--r--src/H5FDsplitter.c164
-rw-r--r--src/H5FDsplitter.h14
-rw-r--r--src/H5FDstdio.c173
-rw-r--r--src/H5FDstdio.h16
-rw-r--r--src/H5FDwindows.h30
-rw-r--r--src/H5FL.c68
-rw-r--r--src/H5FLprivate.h2
-rw-r--r--src/H5FS.c62
-rw-r--r--src/H5FScache.c4
-rw-r--r--src/H5FSsection.c56
-rw-r--r--src/H5Faccum.c2
-rw-r--r--src/H5Fdeprec.c53
-rw-r--r--src/H5Fefc.c8
-rw-r--r--src/H5Fint.c137
-rw-r--r--src/H5Fmodule.h41
-rw-r--r--src/H5Fmount.c25
-rw-r--r--src/H5Fmpi.c74
-rw-r--r--src/H5Fpkg.h33
-rw-r--r--src/H5Fprivate.h8
-rw-r--r--src/H5Fpublic.h597
-rw-r--r--src/H5Fsuper.c7
-rw-r--r--src/H5G.c95
-rw-r--r--src/H5Gcache.c2
-rw-r--r--src/H5Gcompact.c18
-rw-r--r--src/H5Gdense.c39
-rw-r--r--src/H5Gdeprec.c306
-rw-r--r--src/H5Gent.c13
-rw-r--r--src/H5Gint.c1
-rw-r--r--src/H5Gloc.c62
-rw-r--r--src/H5Gmodule.h116
-rw-r--r--src/H5Gname.c55
-rw-r--r--src/H5Gobj.c21
-rw-r--r--src/H5Gpkg.h104
-rw-r--r--src/H5Gprivate.h81
-rw-r--r--src/H5Gpublic.h826
-rw-r--r--src/H5Gstab.c31
-rw-r--r--src/H5Gtest.c6
-rw-r--r--src/H5HF.c12
-rw-r--r--src/H5HFcache.c6
-rw-r--r--src/H5HFdbg.c4
-rw-r--r--src/H5HFdblock.c2
-rw-r--r--src/H5HFpkg.h1
-rw-r--r--src/H5HGcache.c2
-rw-r--r--src/H5HL.c428
-rw-r--r--src/H5HLcache.c26
-rw-r--r--src/H5HLdbg.c30
-rw-r--r--src/H5HLdblk.c82
-rw-r--r--src/H5HLint.c60
-rw-r--r--src/H5HLpkg.h2
-rw-r--r--src/H5HLprfx.c33
-rw-r--r--src/H5HLprivate.h4
-rw-r--r--src/H5I.c20
-rw-r--r--src/H5Idbg.c21
-rw-r--r--src/H5Idevelop.h139
-rw-r--r--src/H5Iint.c197
-rw-r--r--src/H5Imodule.h81
-rw-r--r--src/H5Ipkg.h31
-rw-r--r--src/H5Iprivate.h3
-rw-r--r--src/H5Ipublic.h133
-rw-r--r--src/H5Itest.c10
-rw-r--r--src/H5L.c2615
-rw-r--r--src/H5Ldeprec.c146
-rw-r--r--src/H5Ldevelop.h314
-rw-r--r--src/H5Lexternal.c14
-rw-r--r--src/H5Lint.c2285
-rw-r--r--src/H5Lmodule.h27
-rw-r--r--src/H5Lpkg.h43
-rw-r--r--src/H5Lprivate.h48
-rw-r--r--src/H5Lpublic.h335
-rw-r--r--src/H5M.c356
-rw-r--r--src/H5MF.c129
-rw-r--r--src/H5MFaggr.c15
-rw-r--r--src/H5MFdbg.c10
-rw-r--r--src/H5MFpkg.h6
-rw-r--r--src/H5MFprivate.h3
-rw-r--r--src/H5MFsection.c24
-rw-r--r--src/H5MM.c15
-rw-r--r--src/H5MMpublic.h5
-rw-r--r--src/H5Mmodule.h45
-rw-r--r--src/H5Mpkg.h2
-rw-r--r--src/H5Mprivate.h7
-rw-r--r--src/H5Mpublic.h485
-rw-r--r--src/H5O.c473
-rw-r--r--src/H5Oalloc.c6
-rw-r--r--src/H5Ocache.c23
-rw-r--r--src/H5Odeprec.c155
-rw-r--r--src/H5Oefl.c8
-rw-r--r--src/H5Ofill.c27
-rw-r--r--src/H5Oflush.c31
-rw-r--r--src/H5Ofsinfo.c15
-rw-r--r--src/H5Oint.c10
-rw-r--r--src/H5Olayout.c29
-rw-r--r--src/H5Omodule.h41
-rw-r--r--src/H5Opkg.h5
-rw-r--r--src/H5Oprivate.h7
-rw-r--r--src/H5Opublic.h904
-rw-r--r--src/H5Osdspace.c23
-rw-r--r--src/H5Oshared.h16
-rw-r--r--src/H5PBprivate.h2
-rw-r--r--src/H5PL.c2
-rw-r--r--src/H5PLint.c6
-rw-r--r--src/H5PLmodule.h30
-rw-r--r--src/H5PLplugin_cache.c84
-rw-r--r--src/H5PLpublic.h10
-rw-r--r--src/H5Pdapl.c6
-rw-r--r--src/H5Pdcpl.c20
-rw-r--r--src/H5Pdxpl.c287
-rw-r--r--src/H5Pencdec.c2
-rw-r--r--src/H5Pfapl.c71
-rw-r--r--src/H5Pint.c3
-rw-r--r--src/H5Plapl.c2
-rw-r--r--src/H5Pmodule.h161
-rw-r--r--src/H5Ppublic.h3252
-rw-r--r--src/H5R.c205
-rw-r--r--src/H5RS.c10
-rw-r--r--src/H5RSprivate.h2
-rw-r--r--src/H5Rdeprec.c135
-rw-r--r--src/H5Rint.c13
-rw-r--r--src/H5Rmodule.h29
-rw-r--r--src/H5Rpublic.h502
-rw-r--r--src/H5S.c51
-rw-r--r--src/H5SL.c4
-rw-r--r--src/H5SM.c61
-rw-r--r--src/H5SMcache.c4
-rw-r--r--src/H5SMprivate.h2
-rw-r--r--src/H5ST.c779
-rw-r--r--src/H5STprivate.h63
-rw-r--r--src/H5Shyper.c18
-rw-r--r--src/H5Smodule.h45
-rw-r--r--src/H5Smpio.c19
-rw-r--r--src/H5Spkg.h12
-rw-r--r--src/H5Sprivate.h1
-rw-r--r--src/H5Spublic.h126
-rw-r--r--src/H5T.c32
-rw-r--r--src/H5TS.c81
-rw-r--r--src/H5TSdevelop.h (renamed from src/H5TSpublic.h)14
-rw-r--r--src/H5TSprivate.h4
-rw-r--r--src/H5Tbit.c12
-rw-r--r--src/H5Tcommit.c123
-rw-r--r--src/H5Tconv.c146
-rw-r--r--src/H5Tdevelop.h227
-rw-r--r--src/H5Tmodule.h40
-rw-r--r--src/H5Tpkg.h3
-rw-r--r--src/H5Tprivate.h5
-rw-r--r--src/H5Tpublic.h285
-rw-r--r--src/H5Tref.c125
-rw-r--r--src/H5Tvlen.c50
-rw-r--r--src/H5VL.c180
-rw-r--r--src/H5VLcallback.c1687
-rw-r--r--src/H5VLconnector.h891
-rw-r--r--src/H5VLconnector_passthru.h101
-rw-r--r--src/H5VLdyn_ops.c334
-rw-r--r--src/H5VLint.c272
-rw-r--r--src/H5VLmodule.h10
-rw-r--r--src/H5VLnative.c45
-rw-r--r--src/H5VLnative.h403
-rw-r--r--src/H5VLnative_attr.c244
-rw-r--r--src/H5VLnative_blob.c34
-rw-r--r--src/H5VLnative_dataset.c407
-rw-r--r--src/H5VLnative_datatype.c77
-rw-r--r--src/H5VLnative_file.c384
-rw-r--r--src/H5VLnative_group.c160
-rw-r--r--src/H5VLnative_introspect.c38
-rw-r--r--src/H5VLnative_link.c166
-rw-r--r--src/H5VLnative_object.c207
-rw-r--r--src/H5VLnative_private.h72
-rw-r--r--src/H5VLnative_token.c4
-rw-r--r--src/H5VLpassthru.c682
-rw-r--r--src/H5VLpkg.h12
-rw-r--r--src/H5VLprivate.h116
-rw-r--r--src/H5VLpublic.h22
-rw-r--r--src/H5VLtest.c96
-rw-r--r--src/H5VM.c386
-rw-r--r--src/H5VMprivate.h26
-rw-r--r--src/H5Zdeflate.c2
-rw-r--r--src/H5Zdevelop.h421
-rw-r--r--src/H5Zmodule.h109
-rw-r--r--src/H5Znbit.c36
-rw-r--r--src/H5Zprivate.h3
-rw-r--r--src/H5Zpublic.h348
-rw-r--r--src/H5Zscaleoffset.c381
-rw-r--r--src/H5Ztrans.c21
-rw-r--r--src/H5detect.c165
-rw-r--r--src/H5err.txt4
-rw-r--r--src/H5module.h27
-rw-r--r--src/H5mpi.c2
-rw-r--r--src/H5private.h1531
-rw-r--r--src/H5public.h434
-rw-r--r--src/H5system.c513
-rw-r--r--src/H5timer.c40
-rw-r--r--src/H5trace.c141
-rw-r--r--src/H5win32defs.h195
-rw-r--r--src/Makefile.am22
-rw-r--r--src/hdf5.h15
-rw-r--r--src/uthash.h1184
-rw-r--r--test/CMakeLists.txt21
-rw-r--r--test/CMakeTests.cmake21
-rw-r--r--test/CMakeVFDTests.cmake2
-rw-r--r--test/COPYING13
-rw-r--r--test/Makefile.am5
-rw-r--r--test/ShellTests.cmake127
-rw-r--r--test/accum.c159
-rw-r--r--test/big.c8
-rw-r--r--test/btree2.c119
-rw-r--r--test/cache.c1680
-rw-r--r--test/cache_api.c297
-rw-r--r--test/cache_common.c105
-rw-r--r--test/cache_common.h6
-rw-r--r--test/cache_image.c55
-rw-r--r--test/cache_logging.c24
-rw-r--r--test/chunk_info.c160
-rw-r--r--test/cmpd_dset.c10
-rw-r--r--test/cork.c45
-rw-r--r--test/cross_read.c23
-rw-r--r--test/cve_2020_10810.h5bin0 -> 1808 bytes
-rw-r--r--test/dangle.c5
-rw-r--r--test/direct_chunk.c110
-rw-r--r--test/dsets.c674
-rw-r--r--test/dt_arith.c117
-rw-r--r--test/dtransform.c110
-rw-r--r--test/dtypes.c513
-rw-r--r--test/earray.c115
-rw-r--r--test/efc.c5
-rw-r--r--test/enc_dec_plist.c29
-rw-r--r--test/enum.c40
-rw-r--r--test/err_compat.c273
-rw-r--r--test/error_test.c40
-rw-r--r--test/event_set.c71
-rw-r--r--test/evict_on_close.c20
-rw-r--r--test/external.c58
-rw-r--r--test/external_common.h6
-rw-r--r--test/external_fname.h6
-rw-r--r--test/farray.c30
-rw-r--r--test/fheap.c128
-rw-r--r--test/file_image.c48
-rw-r--r--test/filenotclosed.c2
-rw-r--r--test/fillval.c30
-rw-r--r--test/filter_fail.c10
-rw-r--r--test/filter_plugin.c30
-rw-r--r--test/filter_plugin1_dsets.c16
-rw-r--r--test/filter_plugin2_dsets.c18
-rw-r--r--test/filter_plugin3_dsets.c16
-rw-r--r--test/filter_plugin4_groups.c18
-rw-r--r--test/flush1.c5
-rw-r--r--test/freespace.c5
-rw-r--r--test/gen_cross.c2
-rw-r--r--test/gen_plist.c18
-rw-r--r--test/genall5.c45
-rw-r--r--test/getname.c15
-rw-r--r--test/gheap.c36
-rw-r--r--test/h5test.c87
-rw-r--r--test/h5test.h8
-rw-r--r--test/hdfs.c42
-rw-r--r--test/hyperslab.c6
-rw-r--r--test/istore.c2
-rw-r--r--test/lheap.c9
-rw-r--r--test/links.c577
-rw-r--r--test/links_env.c7
-rw-r--r--test/mf.c209
-rw-r--r--test/mount.c172
-rw-r--r--test/mtime.c2
-rw-r--r--test/null_vol_connector.c4
-rw-r--r--test/null_vol_connector.h6
-rw-r--r--test/objcopy.c49
-rw-r--r--test/objcopy_ref.c12
-rw-r--r--test/ohdr.c107
-rw-r--r--test/page_buffer.c30
-rw-r--r--test/pool.c2
-rw-r--r--test/reserved.c16
-rw-r--r--test/ros3.c57
-rw-r--r--test/s3comms.c2
-rw-r--r--test/set_extent.c35
-rw-r--r--test/stab.c19
-rw-r--r--test/swmr.c392
-rw-r--r--test/swmr_common.h6
-rw-r--r--test/swmr_generator.c2
-rw-r--r--test/swmr_start_write.c2
-rw-r--r--test/tarray.c61
-rw-r--r--test/tattr.c115
-rw-r--r--test/tcheck_version.c23
-rw-r--r--test/tconfig.c5
-rw-r--r--test/test_usecases.sh.in22
-rw-r--r--test/testcheck_version.sh.in106
-rw-r--r--test/testfiles/err_compat_126
-rw-r--r--test/testframe.c22
-rw-r--r--test/testhdf5.c1
-rw-r--r--test/testhdf5.h3
-rw-r--r--test/testswmr.sh.in40
-rw-r--r--test/testvdsswmr.sh.in16
-rw-r--r--test/tfile.c365
-rw-r--r--test/tgenprop.c2
-rw-r--r--test/th5o.c65
-rw-r--r--test/th5s.c111
-rw-r--r--test/theap.c2
-rw-r--r--test/tid.c39
-rw-r--r--test/timer.c40
-rw-r--r--test/titerate.c31
-rw-r--r--test/tmeta.c4
-rw-r--r--test/tmisc.c283
-rw-r--r--test/trefer.c17
-rw-r--r--test/trefer_deprec.c31
-rw-r--r--test/trefstr.c10
-rw-r--r--test/tselect.c129
-rw-r--r--test/tsohm.c2
-rw-r--r--test/ttsafe.c2
-rw-r--r--test/ttst.c391
-rw-r--r--test/tunicode.c2
-rw-r--r--test/tvlstr.c8
-rw-r--r--test/tvltypes.c161
-rw-r--r--test/twriteorder.c10
-rw-r--r--test/unlink.c52
-rw-r--r--test/unregister.c10
-rw-r--r--test/use_append_chunk.c10
-rw-r--r--test/use_append_chunk_mirror.c10
-rw-r--r--test/use_append_mchunks.c10
-rw-r--r--test/use_common.c29
-rw-r--r--test/use_disable_mdc_flushes.c10
-rw-r--r--test/vds.c27
-rw-r--r--test/vfd.c712
-rw-r--r--test/vol.c957
-rw-r--r--test/vol_plugin.c10
-rw-r--r--testpar/CMakeVFDTests.cmake6
-rw-r--r--testpar/COPYING13
-rw-r--r--testpar/t_bigio.c101
-rw-r--r--testpar/t_cache.c475
-rw-r--r--testpar/t_dset.c67
-rw-r--r--testpar/t_file.c59
-rw-r--r--testpar/t_filters_parallel.c415
-rw-r--r--testpar/t_filters_parallel.h20
-rw-r--r--testpar/t_mdset.c141
-rw-r--r--testpar/t_mpi.c4
-rw-r--r--testpar/t_prop.c20
-rw-r--r--testpar/t_span_tree.c5
-rw-r--r--testpar/testphdf5.c5
-rw-r--r--testpar/testphdf5.h13
-rw-r--r--tools/COPYING13
-rw-r--r--tools/lib/h5diff.c18
-rw-r--r--tools/lib/h5diff.h6
-rw-r--r--tools/lib/h5diff_array.c209
-rw-r--r--tools/lib/h5diff_attr.c2
-rw-r--r--tools/lib/h5diff_dset.c2
-rw-r--r--tools/lib/h5diff_util.c4
-rw-r--r--tools/lib/h5tools.c53
-rw-r--r--tools/lib/h5tools.h13
-rw-r--r--tools/lib/h5tools_dump.c91
-rw-r--r--tools/lib/h5tools_dump.h6
-rw-r--r--tools/lib/h5tools_error.h50
-rw-r--r--tools/lib/h5tools_ref.c2
-rw-r--r--tools/lib/h5tools_ref.h4
-rw-r--r--tools/lib/h5tools_str.c31
-rw-r--r--tools/lib/h5tools_str.h8
-rw-r--r--tools/lib/h5tools_utils.c170
-rw-r--r--tools/lib/h5tools_utils.h58
-rw-r--r--tools/lib/h5trav.c4
-rw-r--r--tools/lib/h5trav.h9
-rw-r--r--tools/lib/io_timer.h17
-rw-r--r--tools/lib/ph5diff.h6
-rw-r--r--tools/libtest/Makefile.am18
-rw-r--r--tools/libtest/h5tools_test_utils.c6
-rw-r--r--tools/src/CMakeLists.txt5
-rw-r--r--tools/src/Makefile.am2
-rw-r--r--tools/src/h5copy/h5copy.c48
-rw-r--r--tools/src/h5diff/h5diff_common.c118
-rw-r--r--tools/src/h5diff/h5diff_common.h6
-rw-r--r--tools/src/h5dump/h5dump.c264
-rw-r--r--tools/src/h5dump/h5dump.h6
-rw-r--r--tools/src/h5dump/h5dump_ddl.c20
-rw-r--r--tools/src/h5dump/h5dump_ddl.h6
-rw-r--r--tools/src/h5dump/h5dump_defines.h6
-rw-r--r--tools/src/h5dump/h5dump_extern.h6
-rw-r--r--tools/src/h5dump/h5dump_xml.c39
-rw-r--r--tools/src/h5dump/h5dump_xml.h6
-rw-r--r--tools/src/h5format_convert/h5format_convert.c43
-rw-r--r--tools/src/h5import/h5import.c175
-rw-r--r--tools/src/h5import/h5import.h6
-rw-r--r--tools/src/h5jam/h5jam.c20
-rw-r--r--tools/src/h5jam/h5unjam.c20
-rw-r--r--tools/src/h5ls/h5ls.c30
-rw-r--r--tools/src/h5perf/CMakeLists.txt103
-rw-r--r--tools/src/h5perf/Makefile.am63
-rw-r--r--tools/src/h5perf/perf.c (renamed from tools/test/perform/perf.c)368
-rw-r--r--tools/src/h5perf/pio_engine.c (renamed from tools/test/perform/pio_engine.c)2
-rw-r--r--tools/src/h5perf/pio_perf.c (renamed from tools/test/perform/pio_perf.c)323
-rw-r--r--tools/src/h5perf/pio_perf.h (renamed from tools/test/perform/pio_perf.h)17
-rw-r--r--tools/src/h5perf/sio_engine.c (renamed from tools/test/perform/sio_engine.c)14
-rw-r--r--tools/src/h5perf/sio_perf.c (renamed from tools/test/perform/sio_perf.c)233
-rw-r--r--tools/src/h5perf/sio_perf.h (renamed from tools/test/perform/sio_perf.h)8
-rw-r--r--tools/src/h5repack/h5repack.c18
-rw-r--r--tools/src/h5repack/h5repack.h20
-rw-r--r--tools/src/h5repack/h5repack_copy.c103
-rw-r--r--tools/src/h5repack/h5repack_filters.c14
-rw-r--r--tools/src/h5repack/h5repack_main.c164
-rw-r--r--tools/src/h5repack/h5repack_opttable.c2
-rw-r--r--tools/src/h5stat/h5stat.c145
-rw-r--r--tools/src/misc/h5clear.c53
-rw-r--r--tools/src/misc/h5debug.c2
-rw-r--r--tools/src/misc/h5delete.c9
-rw-r--r--tools/src/misc/h5mkgrp.c28
-rw-r--r--tools/src/misc/h5repart.c5
-rw-r--r--tools/test/h5copy/CMakeLists.txt2
-rw-r--r--tools/test/h5copy/CMakeTests.cmake22
-rw-r--r--tools/test/h5copy/dynlib_copy.c16
-rw-r--r--tools/test/h5copy/h5copygentest.c54
-rw-r--r--tools/test/h5diff/CMakeLists.txt2
-rw-r--r--tools/test/h5diff/CMakeTests.cmake65
-rw-r--r--tools/test/h5diff/dynlib_diff.c16
-rw-r--r--tools/test/h5diff/h5diffgentest.c58
-rw-r--r--tools/test/h5diff/testh5diff.sh.in2
-rw-r--r--tools/test/h5dump/CMakeLists.txt2
-rw-r--r--tools/test/h5dump/CMakeTests.cmake17
-rw-r--r--tools/test/h5dump/CMakeVFDTests.cmake2
-rw-r--r--tools/test/h5dump/dynlib_dump.c16
-rw-r--r--tools/test/h5dump/h5dumpgentest.c188
-rw-r--r--tools/test/h5dump/testh5dump.sh.in43
-rw-r--r--tools/test/h5import/h5importtest.c4
-rw-r--r--tools/test/h5jam/getub.c18
-rw-r--r--tools/test/h5jam/h5jamgentest.c447
-rw-r--r--tools/test/h5jam/tellub.c12
-rw-r--r--tools/test/h5ls/CMakeLists.txt2
-rw-r--r--tools/test/h5ls/CMakeTests.cmake4
-rw-r--r--tools/test/h5ls/CMakeTestsVDS.cmake4
-rw-r--r--tools/test/h5ls/dynlib_ls.c16
-rw-r--r--tools/test/h5repack/CMakeLists.txt4
-rw-r--r--tools/test/h5repack/CMakeTests.cmake10
-rw-r--r--tools/test/h5repack/CMakeVFDTests.cmake2
-rw-r--r--tools/test/h5repack/dynlib_rpk.c14
-rw-r--r--tools/test/h5repack/dynlib_vrpk.c14
-rw-r--r--tools/test/h5repack/h5repack.sh.in9
-rw-r--r--tools/test/h5repack/h5repackgentest.c34
-rw-r--r--tools/test/h5repack/h5repacktst.c117
-rw-r--r--tools/test/h5repack/testfiles/h5repack_CVE-2018-14460.h5bin0 -> 2560 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_CVE-2018-17432.h5 (renamed from tools/test/h5repack/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5)bin7648 -> 7648 bytes
-rw-r--r--tools/test/h5stat/CMakeTests.cmake2
-rw-r--r--tools/test/h5stat/h5stat_gentest.c145
-rw-r--r--tools/test/h5stat/testh5stat.sh.in2
-rw-r--r--tools/test/misc/CMakeTestsClear.cmake4
-rw-r--r--tools/test/misc/repart_test.c5
-rw-r--r--tools/test/misc/talign.c5
-rw-r--r--tools/test/misc/testh5clear.sh.in4
-rw-r--r--tools/test/misc/vds/UC_common.h11
-rw-r--r--tools/test/perform/CMakeLists.txt81
-rw-r--r--tools/test/perform/COPYING13
-rw-r--r--tools/test/perform/Makefile.am23
-rw-r--r--tools/test/perform/chunk.c19
-rw-r--r--tools/test/perform/chunk_cache.c36
-rw-r--r--tools/test/perform/direct_write_perf.c29
-rw-r--r--tools/test/perform/iopipe.c13
-rw-r--r--tools/test/perform/overhead.c6
-rw-r--r--tools/test/perform/perf_meta.c4
-rw-r--r--tools/test/perform/pio_standalone.c192
-rw-r--r--tools/test/perform/pio_standalone.h136
-rw-r--r--tools/test/perform/sio_standalone.c57
-rw-r--r--tools/test/perform/sio_standalone.h136
-rw-r--r--tools/test/perform/zip_perf.c92
-rw-r--r--tools/testfiles/tCVE_2018_11206_fill_new.h5bin0 -> 1752 bytes
-rw-r--r--tools/testfiles/tCVE_2018_11206_fill_old.h5bin0 -> 2560 bytes
-rw-r--r--tools/testfiles/tfloatsattrs.ddl621
-rw-r--r--tools/testfiles/tfloatsattrs.h5bin0 -> 47264 bytes
-rw-r--r--tools/testfiles/tfloatsattrs.wddl621
-rw-r--r--tools/testfiles/tldouble.ddl2
-rwxr-xr-xtools/testfiles/tldouble_scalar.ddl26
-rw-r--r--tools/testfiles/tldouble_scalar.h5bin0 -> 2144 bytes
-rw-r--r--tools/testfiles/tnbit.ddl2
-rw-r--r--tools/testfiles/treadintfilter.ddl2
-rw-r--r--utils/COPYING12
-rw-r--r--utils/mirror_vfd/mirror_writer.c5
967 files changed, 108707 insertions, 32463 deletions
diff --git a/.clang-format b/.clang-format
index 34b7563..62dc6b5 100644
--- a/.clang-format
+++ b/.clang-format
@@ -7,6 +7,7 @@ AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
#llvm10-11: AlignOperands: true - Align
#llvm11: AllowShortEnumsOnASingleLine: true
+AllowShortFunctionsOnASingleLine: None
AlwaysBreakAfterReturnType: AllDefinitions
# Can enable the following section when llvm 12.x is out
#AttributeMacros:
@@ -32,6 +33,7 @@ BreakBeforeBraces: Stroustrup
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 110 # Update $max_trace_macro_line_len in bin/trace also
+ForEachMacros: ['ALL_MEMBERS', 'UNIQUE_MEMBERS']
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
diff --git a/.gitattributes b/.gitattributes
index f72b49c..e01442a 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -785,6 +785,7 @@ tools/testfiles/tints4dimsStride2.ddl -text
tools/testfiles/tintsattrs.h5 -text svneol=unset#application/x-hdf
tools/testfiles/tlarge_objname.h5 -text
tools/testfiles/tldouble.h5 -text
+tools/testfiles/tldouble_scalar.h5 -text
tools/testfiles/tlonglinks.h5 -text
tools/testfiles/tloop.h5 -text
tools/testfiles/tloop2.h5 -text
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 97b7428..29e5866 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -13,23 +13,23 @@ CMakeTests.* @byrnHDF @derobins
/bin/ @lrknox @derobins @qkoziol
-/c++/ @bmribler @byrnHDF
+/c++/ @bmribler @byrnHDF @derobins
/config/ @lrknox @derobins @qkoziol @byrnHDF
/doc/ @gnuoyd @jrmainzer
-/examples/ @lrknox @derobins @bljhdf
+/examples/ @lrknox @derobins @bmribler
/fortran/ @brtnfld @epourmal
-/hl/ @bmribler @byrnHDF
+/hl/ @bmribler @byrnHDF @derobins
/java/ @jhendersonHDF @byrnHDF
/m4/ @lrknox @derobins
-/release_docs/ @lrknox @bljhdf @byrnHDF
+/release_docs/ @lrknox @bmribler @byrnHDF
/src/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup @jrmainzer
@@ -37,6 +37,6 @@ CMakeTests.* @byrnHDF @derobins
/testpar/ @jhendersonHDF @rawarren @jrmainzer @qkoziol
-/tools/ @byrnHDF @bmribler
+/tools/ @byrnHDF @bmribler @derobins
-/utils/ @lrknox @byrnHDF
+/utils/ @lrknox @byrnHDF @derobins
diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml
index 230a341..4f696e7 100644
--- a/.github/workflows/clang-format-check.yml
+++ b/.github/workflows/clang-format-check.yml
@@ -1,5 +1,6 @@
name: clang-format Check
-on: [workflow_dispatch, push, pull_request]
+on:
+ pull_request:
jobs:
formatting-check:
name: Formatting Check
diff --git a/.github/workflows/clang-format-fix.yml b/.github/workflows/clang-format-fix.yml
new file mode 100644
index 0000000..082d617
--- /dev/null
+++ b/.github/workflows/clang-format-fix.yml
@@ -0,0 +1,25 @@
+name: clang-format Check
+on:
+ workflow_dispatch:
+ push:
+jobs:
+ formatting-check:
+ name: Formatting Check
+ runs-on: ubuntu-latest
+ if: "!contains(github.event.head_commit.message, 'skip-ci')"
+ steps:
+ - uses: actions/checkout@v2
+ - name: Run clang-format style check for C programs.
+ uses: DoozyX/clang-format-lint-action@v0.11
+ with:
+ source: '.'
+ extensions: 'c,h,cpp,hpp'
+ clangFormatVersion: 10
+ inplace: True
+ style: file
+ exclude: './config ./hl/src/H5LTanalyze.c ./hl/src/H5LTparse.c ./hl/src/H5LTparse.h ./src/H5Epubgen.h ./src/H5Einit.h ./src/H5Eterm.h ./src/H5Edefin.h ./src/H5version.h ./src/H5overflow.h'
+ - uses: EndBug/add-and-commit@v7
+ with:
+ author_name: github-actions
+ author_email: 41898282+github-actions[bot]@users.noreply.github.com
+ message: 'Committing clang-format changes'
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4d0d3bb..ae429a2 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -36,7 +36,7 @@ jobs:
os: ubuntu-latest
build_type: "Release"
cpp: ON
- fortran: OFF
+ fortran: ON
java: ON
ts: OFF
hl: ON
@@ -82,7 +82,7 @@ jobs:
# Threadsafe runs
- name: "Windows TS MSVC"
artifact: "Windows-MSVCTS.tar.xz"
- os: windows-latest
+ os: windows-2016
build_type: "Release"
toolchain: ""
cpp: OFF
@@ -91,7 +91,7 @@ jobs:
ts: ON
hl: OFF
parallel: OFF
- generator: "-G \"Visual Studio 16 2019\" -A x64"
+ generator: "-G \"Visual Studio 15 2017 Win64\""
- name: "Ubuntu TS GCC"
artifact: "LinuxTS.tar.xz"
os: ubuntu-latest
diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml
index 8c3bb2c..0acaf2d 100644
--- a/.github/workflows/pr-check.yml
+++ b/.github/workflows/pr-check.yml
@@ -31,7 +31,7 @@ jobs:
os: ubuntu-latest
build_type: "Release"
cpp: ON
- fortran: OFF
+ fortran: ON
java: ON
ts: OFF
hl: ON
@@ -77,7 +77,7 @@ jobs:
# Threadsafe runs
- name: "Windows TS MSVC"
artifact: "Windows-MSVCTS.tar.xz"
- os: windows-latest
+ os: windows-2016
build_type: "Release"
toolchain: ""
cpp: OFF
@@ -86,7 +86,7 @@ jobs:
ts: ON
hl: OFF
parallel: OFF
- generator: "-G \"Visual Studio 16 2019\" -A x64"
+ generator: "-G \"Visual Studio 15 2017 Win64\""
- name: "Ubuntu TS GCC"
artifact: "LinuxTS.tar.xz"
os: ubuntu-latest
diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake
index d5f801e..51ac61c 100644
--- a/CMakeFilters.cmake
+++ b/CMakeFilters.cmake
@@ -10,6 +10,7 @@
# help@hdfgroup.org.
#
option (USE_LIBAEC "Use AEC library as SZip Filter" OFF)
+option (USE_LIBAEC_STATIC "Use static AEC library " OFF)
include (ExternalProject)
include (FetchContent)
@@ -110,13 +111,24 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF)
if (HDF5_ENABLE_SZIP_SUPPORT)
option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF)
if (NOT SZIP_USE_EXTERNAL)
- find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
- if (NOT SZIP_FOUND)
- find_package (SZIP) # Legacy find
+ set(SZIP_FOUND FALSE)
+ if (USE_LIBAEC)
+ set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC})
+ find_package (libaec 1.0.5 CONFIG)
if (SZIP_FOUND)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
endif ()
endif ()
+
+ if (NOT SZIP_FOUND)
+ find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
+ if (NOT SZIP_FOUND)
+ find_package (SZIP) # Legacy find
+ if (SZIP_FOUND)
+ set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
+ endif ()
+ endif ()
+ endif ()
endif ()
if (SZIP_FOUND)
set (H5_HAVE_FILTER_SZIP 1)
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake
index bff0c49..d811ea5 100644
--- a/CMakeInstallation.cmake
+++ b/CMakeInstallation.cmake
@@ -205,7 +205,6 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs")
set (release_files
${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt
- ${HDF5_SOURCE_DIR}/release_docs/COPYING
${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt
)
if (WIN32)
@@ -263,9 +262,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "")
+ set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
if (EXISTS "${HDF5_SOURCE_DIR}/release_docs")
set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt")
- set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt")
endif ()
set (CPACK_PACKAGE_RELOCATABLE TRUE)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04e34f1..13f2e35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,6 +71,13 @@ mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX)
# If the parent project needs to install hdf libraries, but avoid
# name conflicts with system versions, then a prefix may be added
# to ensure that the correct versions configured are used.
+set (HDF5_LIB_INFIX "" CACHE STRING "Use infix for custom library naming.")
+mark_as_advanced (HDF5_LIB_INFIX)
+# HDF5_LIB_INFIX :
+# This infix is added to all library names after 'hdf5'.
+# e.g. the infix '_openmpi' results in the library name 'libhdf5_openmpi.so'
+# This name is used in packages on debian based systems.
+# (see https://packages.debian.org/jessie/amd64/libhdf5-openmpi-8/filelist)
#
# HDF5_INSTALL_BIN_DIR, HDF5_INSTALL_LIB_DIR, HDF5_INSTALL_INCLUDE_DIR, HDF5_INSTALL_DATA_DIR :
# Customize the 'bin', 'lib', 'include', and 'share' installation directories.
@@ -130,20 +137,20 @@ mark_as_advanced (ALLOW_UNSUPPORTED)
#-----------------------------------------------------------------------------
# Set the core names of all the libraries
#-----------------------------------------------------------------------------
-set (HDF5_LIB_CORENAME "hdf5")
-set (HDF5_TEST_LIB_CORENAME "hdf5_test")
-set (HDF5_CPP_LIB_CORENAME "hdf5_cpp")
-set (HDF5_HL_LIB_CORENAME "hdf5_hl")
-set (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp")
-set (HDF5_TOOLS_LIB_CORENAME "hdf5_tools")
-set (HDF5_UTILS_LIB_CORENAME "hdf5_utils")
-set (HDF5_F90_LIB_CORENAME "hdf5_fortran")
-set (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub")
-set (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran")
-set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub")
-set (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran")
-set (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub")
-set (HDF5_JAVA_JNI_LIB_CORENAME "hdf5_java")
+set (HDF5_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}")
+set (HDF5_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test")
+set (HDF5_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_cpp")
+set (HDF5_HL_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl")
+set (HDF5_HL_CPP_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_cpp")
+set (HDF5_TOOLS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_tools")
+set (HDF5_UTILS_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_utils")
+set (HDF5_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_fortran")
+set (HDF5_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_f90cstub")
+set (HDF5_F90_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_fortran")
+set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_test_f90cstub")
+set (HDF5_HL_F90_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_fortran")
+set (HDF5_HL_F90_C_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_hl_f90cstub")
+set (HDF5_JAVA_JNI_LIB_CORENAME "hdf5${HDF5_LIB_INFIX}_java")
set (HDF5_JAVA_HDF5_LIB_CORENAME "jarhdf5")
set (HDF5_JAVA_TEST_LIB_CORENAME "jartest5")
@@ -501,6 +508,14 @@ else ()
endif ()
#-----------------------------------------------------------------------------
+# perl is used in some optional src and tests, check availability
+find_package (Perl)
+if (PERL_FOUND)
+ set (H5_PERL_FOUND YES)
+endif ()
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
# Option to Build Static executables
#-----------------------------------------------------------------------------
option (BUILD_STATIC_EXECS "Build Static Executables" OFF)
@@ -511,12 +526,18 @@ if (BUILD_STATIC_EXECS)
endif ()
endif ()
+option (HDF5_ENABLE_ANALYZER_TOOLS "enable the use of Clang tools" OFF)
+mark_as_advanced (HDF5_ENABLE_ANALYZER_TOOLS)
if (HDF5_ENABLE_ANALYZER_TOOLS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/tools.cmake)
endif ()
+option (HDF5_ENABLE_SANITIZERS "execute the Clang sanitizer" OFF)
+mark_as_advanced (HDF5_ENABLE_SANITIZERS)
if (HDF5_ENABLE_SANITIZERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake)
endif ()
+option (HDF5_ENABLE_FORMATTERS "format source files" OFF)
+mark_as_advanced (HDF5_ENABLE_FORMATTERS)
if (HDF5_ENABLE_FORMATTERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/formatting.cmake)
endif ()
@@ -551,20 +572,6 @@ endif ()
# endif ()
#-----------------------------------------------------------------------------
-# Option to build documentation
-#-----------------------------------------------------------------------------
-option (HDF5_BUILD_DOC "Build documentation" OFF)
-if (HDF5_BUILD_DOC AND EXISTS "${HDF5_DOXYGEN_DIR}" AND IS_DIRECTORY "${HDF5_DOXYGEN_DIR}")
-# check if Doxygen is installed
- find_package(Doxygen)
- if (DOXYGEN_FOUND)
- message(STATUS "Doxygen version: ${DOXYGEN_VERSION}")
- else ()
- message(STATUS "Doxygen needs to be installed to generate the doxygen documentation")
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
# Option to indicate using a memory checker
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF)
@@ -905,6 +912,21 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
endif ()
#-----------------------------------------------------------------------------
+# Option to build documentation
+#-----------------------------------------------------------------------------
+option (HDF5_BUILD_DOC "Build documentation" OFF)
+if (HDF5_BUILD_DOC AND EXISTS "${HDF5_DOXYGEN_DIR}" AND IS_DIRECTORY "${HDF5_DOXYGEN_DIR}")
+# check if Doxygen is installed
+ find_package(Doxygen)
+ if (DOXYGEN_FOUND)
+ message(STATUS "Doxygen version: ${DOXYGEN_VERSION}")
+ add_subdirectory (doxygen)
+ else ()
+ message(STATUS "Doxygen needs to be installed to generate the doxygen documentation")
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
#-----------------------------------------------------------------------------
option (BUILD_TESTING "Build HDF5 Unit Testing" ON)
@@ -1091,7 +1113,7 @@ endif ()
# Option to build HDF5 C++ Library
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
- option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" ON)
+ option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF)
if (HDF5_BUILD_CPP_LIB)
# check for unsupported options
if (HDF5_ENABLE_PARALLEL)
@@ -1104,12 +1126,8 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
endif ()
endif ()
- include (${HDF_RESOURCES_EXT_DIR}/HDFUseCXX.cmake)
include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake)
- if (CMAKE_NO_STD_NAMESPACE)
- set (H5_NO_STD 1)
- endif ()
add_subdirectory (c++)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++")
diff --git a/COPYING b/COPYING
index da64ef8..9d32232 100644
--- a/COPYING
+++ b/COPYING
@@ -67,6 +67,12 @@ under Prime Contract No. DE-AC02-05CH11231.
-----------------------------------------------------------------------------
+Portions of HDF5 were developed with support from Lawrence Livermore
+National Laboratory and the United States Department of Energy under
+Prime Contract No. DE-AC52-07NA27344.
+
+-----------------------------------------------------------------------------
+
Portions of HDF5 were developed with support from the University of
California, Lawrence Livermore National Laboratory (UC LLNL).
The following statement applies to those portions of the product and must
diff --git a/MANIFEST b/MANIFEST
index 4d3c027..ebad533 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -35,11 +35,11 @@
./.clang-format
./.github/CODEOWNERS _DO_NOT_DISTRIBUTE_
+./.github/workflows/clang-format-fix.yml _DO_NOT_DISTRIBUTE_
./.github/workflows/clang-format-check.yml _DO_NOT_DISTRIBUTE_
./.github/workflows/main.yml _DO_NOT_DISTRIBUTE_
./.github/workflows/pr-check.yml _DO_NOT_DISTRIBUTE_
-./m4/aclocal_cxx.m4
./m4/aclocal_fc.m4
./m4/aclocal_fc.f90
./m4/ax_check_class.m4
@@ -62,7 +62,6 @@
./m4/ax_try_compile_java.m4
./m4/ax_try_run_java.m4
-./bin/COPYING
./bin/bbrelease _DO_NOT_DISTRIBUTE_
./bin/buildhdf5
./bin/checkapi _DO_NOT_DISTRIBUTE_
@@ -121,7 +120,6 @@
./bin/pkgscrpts/makeInternalREADME.pl _DO_NOT_DISTRIBUTE_
./bin/pkgscrpts/makeOuterREADME.pl _DO_NOT_DISTRIBUTE_
-./config/COPYING
./config/BlankForm
./config/apple
./config/cce-fflags
@@ -137,6 +135,7 @@
./config/cygwin
./config/ibm-aix
./config/ibm-flags
+./config/intel-cxxflags
./config/intel-fflags
./config/intel-flags
./config/libhdf5.pc.in
@@ -148,6 +147,7 @@
./config/lt_vers.am
./config/Makefile.am.blank
./config/netbsd
+./config/pgi-cxxflags
./config/pgi-fflags
./config/pgi-flags
./config/solaris
@@ -173,6 +173,7 @@
./config/gnu-warnings/cxx-4.8
./config/gnu-warnings/cxx-4.9
./config/gnu-warnings/cxx-5
+./config/gnu-warnings/cxx-9
./config/gnu-warnings/cxx-error-5
./config/gnu-warnings/cxx-error-general
./config/gnu-warnings/cxx-noerror-5
@@ -197,38 +198,97 @@
./config/gnu-warnings/noerror-5
./config/gnu-warnings/noerror-8
./config/gnu-warnings/noerror-general
-./config/intel-warnings/ifort-general
+./config/intel-warnings/15
+./config/intel-warnings/18
+./config/intel-warnings/developer-general
./config/intel-warnings/general
+./config/intel-warnings/win-developer-general
+./config/intel-warnings/win-general
+./config/intel-warnings/ifort-general
./config/site-specific/BlankForm
+./doc/branches-explained.md
./doc/code-conventions.md
-
+./doc/contributing.md
./doxygen/aliases
+./doxygen/CMakeLists.txt
./doxygen/Doxyfile.in
-./doxygen/dox/api-compat-macros.dox
+./doxygen/dox/APIVersions.dox
+./doxygen/dox/About.dox
+./doxygen/dox/Cookbook.dox
+./doxygen/dox/DDLBNF110.dox
+./doxygen/dox/DDLBNF112.dox
+./doxygen/dox/FileFormatSpec.dox
+./doxygen/dox/GettingStarted.dox
./doxygen/dox/H5AC_cache_config_t.dox
-./doxygen/dox/H5Acreate.dox
-./doxygen/dox/H5Aiterate.dox
-./doxygen/dox/H5Fget_info.dox
-./doxygen/dox/H5Lget_info_by_idx.dox
-./doxygen/dox/H5Lget_info.dox
-./doxygen/dox/H5Literate_by_name.dox
-./doxygen/dox/H5Literate.dox
-./doxygen/dox/H5Lvisit_by_name.dox
-./doxygen/dox/H5Lvisit.dox
-./doxygen/dox/H5Oget_info_by_idx.dox
-./doxygen/dox/H5Oget_info_by_name.dox
-./doxygen/dox/H5Oget_info.dox
-./doxygen/dox/H5Ovisit_by_name.dox
-./doxygen/dox/H5Ovisit.dox
-./doxygen/dox/H5Sencode.dox
-./doxygen/dox/mainpage.dox
+./doxygen/dox/MetadataCachingInHDF5.dox
+./doxygen/dox/OtherSpecs.dox
+./doxygen/dox/Overview.dox
+./doxygen/dox/ReferenceManual.dox
+./doxygen/dox/RFC.dox
+./doxygen/dox/Specifications.dox
+./doxygen/dox/TechnicalNotes.dox
+./doxygen/dox/api-compat-macros.dox
+./doxygen/dox/maybe_metadata_reads.dox
./doxygen/dox/rm-template.dox
+./doxygen/dox/cookbook/Accessibility.c
+./doxygen/dox/cookbook/Accessibility.dox
+./doxygen/dox/cookbook/Attributes.c
+./doxygen/dox/cookbook/Attributes.dox
+./doxygen/dox/cookbook/Files.c
+./doxygen/dox/cookbook/Files.dox
+./doxygen/dox/cookbook/Performance.dox
+./doxygen/examples/FF-IH_FileGroup.gif
+./doxygen/examples/FF-IH_FileObject.gif
+./doxygen/examples/FileFormatSpecChunkDiagram.jpg
+./doxygen/examples/H5Pset_metadata_read_attempts.c
+./doxygen/examples/H5Pset_object_flush_cb.c
+./doxygen/examples/H5.format.1.0.html
+./doxygen/examples/H5.format.1.1.html
+./doxygen/examples/H5.format.2.0.html
+./doxygen/examples/H5.format.html
+./doxygen/examples/H5A_examples.c
+./doxygen/examples/H5D_examples.c
+./doxygen/examples/H5E_examples.c
./doxygen/examples/H5Fclose.c
./doxygen/examples/H5Fcreate.c
+./doxygen/examples/H5F_examples.c
+./doxygen/examples/H5G_examples.c
+./doxygen/examples/H5I_examples.c
+./doxygen/examples/H5L_examples.c
+./doxygen/examples/H5O_examples.c
+./doxygen/examples/H5PL_examples.c
+./doxygen/examples/H5Pget_metadata_read_attempts.1.c
+./doxygen/examples/H5Pget_metadata_read_attempts.2.c
+./doxygen/examples/H5Pget_metadata_read_attempts.3.c
+./doxygen/examples/H5Pget_object_flush_cb.c
+./doxygen/examples/H5P_examples.c
+./doxygen/examples/H5R_examples.c
+./doxygen/examples/H5S_examples.c
+./doxygen/examples/H5T_examples.c
+./doxygen/examples/H5Z_examples.c
+./doxygen/examples/H5_examples.c
+./doxygen/examples/ImageSpec.html
+./doxygen/examples/PaletteExample1.gif
+./doxygen/examples/Palettes.fm.anc.gif
+./doxygen/examples/TableSpec.html
+./doxygen/examples/ThreadSafeLibrary.html
+./doxygen/examples/VFL.html
./doxygen/examples/hello_hdf5.c
+./doxygen/hdf5_footer.html
+./doxygen/hdf5_header.html
+./doxygen/hdf5_navtree_hacks.js
+./doxygen/hdf5doxy.css
+./doxygen/hdf5doxy_layout.xml
+./doxygen/img/FF-IH_FileGroup.gif
+./doxygen/img/FF-IH_FileObject.gif
+./doxygen/img/FileFormatSpecChunkDiagram.jpg
./doxygen/img/HDFG-logo.png
+./doxygen/img/PaletteExample1.gif
+./doxygen/img/Palettes.fm.anc.gif
+./doxygen/img/ftv2node.png
+./doxygen/img/ftv2pnode.png
./examples/Attributes.txt
./examples/Makefile.am
@@ -280,7 +340,6 @@
#
#------------------------------------------------------------------------------
-./fortran/COPYING
./fortran/Makefile.am
./fortran/robodoc.rc
@@ -412,7 +471,6 @@
#
#------------------------------------------------------------------------------
-./c++/COPYING
./c++/Makefile.am
./c++/examples/chunks.cpp
@@ -543,7 +601,6 @@
#
#------------------------------------------------------------------------------
-./release_docs/COPYING
./release_docs/HISTORY-1_0-1_8_0_rc3.txt
./release_docs/HISTORY-1_8_0-1_10_0.txt
./release_docs/HISTORY-1_10_0-1_12_0.txt
@@ -566,7 +623,6 @@
./src/hdf5.lnt _DO_NOT_DISTRIBUTE_
./src/hdf5-win.lnt _DO_NOT_DISTRIBUTE_
./src/hdf5-lin.lnt _DO_NOT_DISTRIBUTE_
-./src/COPYING
./src/H5.c
./src/H5checksum.c
./src/H5dbg.c
@@ -690,6 +746,7 @@
./src/H5EAstat.c
./src/H5EAtest.c
./src/H5ES.c
+./src/H5ESdevelop.h
./src/H5ESevent.c
./src/H5ESint.c
./src/H5ESlist.c
@@ -733,6 +790,7 @@
./src/H5FD.c
./src/H5FDcore.c
./src/H5FDcore.h
+./src/H5FDdevelop.h
./src/H5FDdirect.c
./src/H5FDdirect.h
./src/H5FDdrvr_module.h
@@ -846,6 +904,7 @@
./src/H5HPprivate.h
./src/H5I.c
./src/H5Idbg.c
+./src/H5Idevelop.h
./src/H5Iint.c
./src/H5Imodule.h
./src/H5Ipkg.h
@@ -854,7 +913,9 @@
./src/H5Itest.c
./src/H5L.c
./src/H5Ldeprec.c
+./src/H5Ldevelop.h
./src/H5Lexternal.c
+./src/H5Lint.c
./src/H5Lmodule.h
./src/H5Lpkg.h
./src/H5Lprivate.h
@@ -994,8 +1055,6 @@
./src/H5SMpkg.h
./src/H5SMprivate.h
./src/H5SMtest.c
-./src/H5ST.c
-./src/H5STprivate.h
./src/H5T.c
./src/H5Tarray.c
./src/H5Tbit.c
@@ -1005,6 +1064,7 @@
./src/H5Tcset.c
./src/H5Tdbg.c
./src/H5Tdeprec.c
+./src/H5Tdevelop.h
./src/H5Tenum.c
./src/H5Tfields.c
./src/H5Tfixed.c
@@ -1025,14 +1085,15 @@
./src/H5Tvisit.c
./src/H5Tvlen.c
./src/H5TS.c
+./src/H5TSdevelop.h
./src/H5TSprivate.h
-./src/H5TSpublic.h
./src/H5UC.c
./src/H5UCprivate.h
./src/H5VL.c
./src/H5VLcallback.c
./src/H5VLconnector.h
./src/H5VLconnector_passthru.h
+./src/H5VLdyn_ops.c
./src/H5VLint.c
./src/H5VLmodule.h
./src/H5VLnative.c
@@ -1053,12 +1114,14 @@
./src/H5VLpkg.h
./src/H5VLprivate.h
./src/H5VLpublic.h
+./src/H5VLtest.c
./src/H5VM.c
./src/H5VMprivate.h
./src/H5WB.c
./src/H5WBprivate.h
./src/H5Z.c
./src/H5Zdeflate.c
+./src/H5Zdevelop.h
./src/H5Zfletcher32.c
./src/H5Zmodule.h
./src/H5Znbit.c
@@ -1073,9 +1136,9 @@
./src/hdf5.h
./src/libhdf5.settings.in
./src/H5win32defs.h
+./src/uthash.h
./test/AtomicWriterReader.txt
-./test/COPYING
./test/H5srcdir.h
./test/H5srcdir_str.h.in
./test/Makefile.am
@@ -1112,6 +1175,7 @@
./test/cork.c
./test/corrupt_stab_msg.h5
./test/cross_read.c
+./test/cve_2020_10810.h5
./test/dangle.c
./test/deflate.h5
./test/del_many_dense_attrs.c
@@ -1312,7 +1376,6 @@
./test/ttsafe_cancel.c
./test/ttsafe_dcreate.c
./test/ttsafe_error.c
-./test/ttst.c
./test/tunicode.c
./test/tvlstr.c
./test/tvltypes.c
@@ -1437,7 +1500,6 @@
./test/testfiles/plist_files/strcpl_64be
./test/testfiles/plist_files/strcpl_64le
-./testpar/COPYING
./testpar/Makefile.am
./testpar/t_bigio.c
./testpar/t_cache.c
@@ -1470,7 +1532,6 @@
./testpar/testphdf5.c
./testpar/testphdf5.h
-./tools/COPYING
./tools/Makefile.am
./tools/src/Makefile.am
./tools/test/Makefile.am
@@ -1983,6 +2044,9 @@
./tools/testfiles/tfill.ddl
./tools/testfiles/tfilters.h5
./tools/testfiles/tfletcher32.ddl
+./tools/testfiles/tfloatsattrs.ddl
+./tools/testfiles/tfloatsattrs.h5
+./tools/testfiles/tfloatsattrs.wddl
./tools/testfiles/tfvalues.h5
./tools/testfiles/tgroup-1.ddl
./tools/testfiles/tgroup-2.ddl
@@ -2022,6 +2086,8 @@
./tools/testfiles/tlarge_objname.h5
./tools/testfiles/tldouble.ddl
./tools/testfiles/tldouble.h5
+./tools/testfiles/tldouble_scalar.ddl
+./tools/testfiles/tldouble_scalar.h5
./tools/testfiles/tlonglinks.ddl
./tools/testfiles/tlonglinks.h5
./tools/testfiles/tloop-1.ddl
@@ -2128,6 +2194,8 @@
./tools/testfiles/twithddl.exp
./tools/testfiles/twithddlfile.ddl
./tools/testfiles/twithddlfile.exp
+./tools/testfiles/tCVE_2018_11206_fill_old.h5
+./tools/testfiles/tCVE_2018_11206_fill_new.h5
# h5dump test error files
./tools/test/h5dump/errfiles/filter_fail.err
@@ -2792,7 +2860,8 @@
./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl
./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
./tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl
-./tools/test/h5repack/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5
+./tools/test/h5repack/testfiles/h5repack_CVE-2018-17432.h5
+./tools/test/h5repack/testfiles/h5repack_CVE-2018-14460.h5
./tools/test/h5repack/testfiles/GS.h5repack_paged_nopersist.h5.ddl
./tools/test/h5repack/testfiles/S.h5repack_fsm_aggr_persist.h5.ddl
./tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl
@@ -2887,7 +2956,15 @@
./tools/testfiles/h5mkgrp_single_p.ls
./tools/testfiles/h5mkgrp_single_l.ls
-./tools/test/perform/COPYING
+./tools/src/h5perf/Makefile.am
+./tools/src/h5perf/perf.c
+./tools/src/h5perf/pio_engine.c
+./tools/src/h5perf/pio_perf.c
+./tools/src/h5perf/pio_perf.h
+./tools/src/h5perf/sio_engine.c
+./tools/src/h5perf/sio_perf.c
+./tools/src/h5perf/sio_perf.h
+
./tools/test/perform/Makefile.am
./tools/test/perform/build_h5perf_alone.sh
./tools/test/perform/build_h5perf_serial_alone.sh
@@ -2897,22 +2974,14 @@
./tools/test/perform/gen_report.pl
./tools/test/perform/iopipe.c
./tools/test/perform/overhead.c
-./tools/test/perform/perf.c
./tools/test/perform/perf_meta.c
-./tools/test/perform/pio_engine.c
-./tools/test/perform/pio_perf.c
-./tools/test/perform/pio_perf.h
./tools/test/perform/pio_standalone.c
./tools/test/perform/pio_standalone.h
-./tools/test/perform/sio_engine.c
-./tools/test/perform/sio_perf.c
-./tools/test/perform/sio_perf.h
./tools/test/perform/sio_standalone.c
./tools/test/perform/sio_standalone.h
./tools/test/perform/zip_perf.c
# Utils directory
-./utils/COPYING
./utils/Makefile.am
# Mirror VFD utilities
@@ -2924,7 +2993,6 @@
./utils/mirror_vfd/mirror_writer.c
# high level libraries
-./hl/COPYING
./hl/Makefile.am
./hl/examples/Makefile.am
./hl/examples/ex_ds1.c
@@ -2951,7 +3019,6 @@
./hl/examples/ptExampleFL.c
./hl/examples/run-hl-ex.sh
./hl/examples/run-hlc-ex.sh.in
-./hl/src/COPYING
./hl/src/Makefile.am
./hl/src/H5DO.c
./hl/src/H5DOpublic.h
@@ -2980,7 +3047,6 @@
./hl/src/H5TBprivate.h
./hl/src/H5TBpublic.h
./hl/src/hdf5_hl.h
-./hl/test/COPYING
./hl/test/H5srcdir_str.h.in
./hl/test/Makefile.am
./hl/test/dsdata.txt
@@ -3016,7 +3082,6 @@
./hl/test/usa.wri
# tools
-./hl/tools/COPYING
./hl/tools/Makefile.am
./hl/tools/gif2h5/Makefile.am
./hl/tools/gif2h5/decompress.c
@@ -3081,7 +3146,6 @@
./hl/tools/testfiles/w-help1.ddl
# hl fortran
-./hl/fortran/COPYING
./hl/fortran/Makefile.am
./hl/fortran/examples/Makefile.am
./hl/fortran/examples/run-hlfortran-ex.sh.in
@@ -3106,7 +3170,6 @@
./hl/fortran/test/tsttable.F90
# hl c++
-./hl/c++/COPYING
./hl/c++/Makefile.am
./hl/c++/examples/Makefile.am
./hl/c++/examples/ptExampleFL.cpp
@@ -3119,7 +3182,6 @@
./hl/c++/test/Makefile.am
# java
-./java/COPYING
./java/Makefile.am
./java/CMakeLists.txt
@@ -3400,9 +3462,11 @@
./java/test/junit.sh.in
./java/test/testfiles/JUnit-TestH5.txt
./java/test/testfiles/JUnit-TestH5A.txt
+./java/test/testfiles/JUnit-TestH5Arw.txt
./java/test/testfiles/JUnit-TestH5Dparams.txt
./java/test/testfiles/JUnit-TestH5D.txt
./java/test/testfiles/JUnit-TestH5Dplist.txt
+./java/test/testfiles/JUnit-TestH5Drw.txt
./java/test/testfiles/JUnit-TestH5E.txt
./java/test/testfiles/JUnit-TestH5Edefault.txt
./java/test/testfiles/JUnit-TestH5Eparams.txt
@@ -3441,9 +3505,11 @@
./java/test/h5ex_g_iterate.orig
./java/test/TestH5.java
./java/test/TestH5A.java
+./java/test/TestH5Arw.java
./java/test/TestH5Dparams.java
./java/test/TestH5D.java
./java/test/TestH5Dplist.java
+./java/test/TestH5Drw.java
./java/test/TestH5E.java
./java/test/TestH5Edefault.java
./java/test/TestH5Eparams.java
@@ -3505,7 +3571,6 @@
./config/cmake/CTestCustom.cmake
./config/cmake/fileCompareTest.cmake
./config/cmake/FindHDFS.cmake
-./config/cmake/H5cxx_config.h.in
./config/cmake/H5pubconf.h.in
./config/cmake/hdf5-config.cmake.in
./config/cmake/hdf5-config-version.cmake.in
@@ -3516,6 +3581,7 @@
./config/cmake/HDF5PluginMacros.cmake
./config/cmake/HDF5PluginCache.cmake
./config/cmake/HDF5UseFortran.cmake
+./config/cmake/javaTargets.cmake.in
./config/cmake/jrunTest.cmake
./config/cmake/jvolTest.cmake
./config/cmake/libh5cc.in
@@ -3540,11 +3606,9 @@
./config/cmake_ext_mod/hdf.bmp
./config/cmake_ext_mod/hdf.icns
./config/cmake_ext_mod/hdf.ico
-./config/cmake_ext_mod/HDFCXXTests.cpp
./config/cmake_ext_mod/HDFLibMacros.cmake
./config/cmake_ext_mod/HDFMacros.cmake
./config/cmake_ext_mod/HDFTests.c
-./config/cmake_ext_mod/HDFUseCXX.cmake
./config/cmake_ext_mod/HDFUseFortran.cmake
./config/cmake_ext_mod/NSIS.InstallOptions.ini.in
./config/cmake_ext_mod/NSIS.template.in
@@ -3656,6 +3720,7 @@
./tools/test/h5stat/CMakeLists.txt
./tools/test/h5stat/CMakeTests.cmake
./tools/src/misc/CMakeLists.txt
+./tools/src/h5perf/CMakeLists.txt
./tools/test/misc/CMakeLists.txt
./tools/test/misc/CMakeTestsClear.cmake
./tools/test/misc/CMakeTestsMkgrp.cmake
diff --git a/Makefile.am b/Makefile.am
index cc38972..8518114 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,6 +35,9 @@
include $(top_srcdir)/config/commence.am
+# include Doxygen rules (requires autoconf-archive >2016-03-20)
+@DX_RULES@
+
# Define subdirectories to build.
## Automake understands that `make distclean' should recurse into
## conditional subdirectories even if `make all' does not.
@@ -187,15 +190,10 @@ check-all-install:
trace:
@(cd src && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;
-# Run doxygen across source files.
-# Currently, only invoke doxygen in the src directory.
-doxygen:
- @echo Invoking doxygen
- for d in src; do \
- if test $$d != .; then \
- (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
- fi; \
- done
+# doxygen support
+if BUILD_DOXYGEN_CONDITIONAL
+doxygen: doxygen-doc
+endif
# Run tests with different Virtual File Drivers.
# Currently, only invoke check-vfd in the test directory.
diff --git a/bin/COPYING b/bin/COPYING
deleted file mode 100755
index 97969da..0000000
--- a/bin/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/bin/format_source b/bin/format_source
index 1128def..dce34e5 100755
--- a/bin/format_source
+++ b/bin/format_source
@@ -8,7 +8,7 @@
#
# (Remember to update both bin/format_source and bin/format_source_patch)
-find . -type d \( -path ./config \) -prune \
+find . \( -type d -path ./config -prune -and -not -path ./config \) \
-or \( \( \! \( \
-name H5LTanalyze.c \
-or -name H5LTparse.c \
diff --git a/bin/format_source_patch b/bin/format_source_patch
index 8d6be01..439baf2 100755
--- a/bin/format_source_patch
+++ b/bin/format_source_patch
@@ -8,7 +8,7 @@
#
# (Remember to update both bin/format_source and bin/format_source_patch)
-find . -type d \( -path ./config \) -prune \
+find . \( -type d -path ./config -prune -and -not -path ./config \) \
-or \( \( \! \( \
-name H5LTanalyze.c \
-or -name H5LTparse.c \
diff --git a/bin/release b/bin/release
index 2570b38..8774851 100755
--- a/bin/release
+++ b/bin/release
@@ -229,11 +229,14 @@ tar2cmakezip()
(cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201564 -C Release -V -O hdf5.log" > build-VS2015-64.bat; chmod 755 build-VS2015-64.bat)
(cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2017 -C Release -V -O hdf5.log" > build-VS2017-32.bat; chmod 755 build-VS2017-32.bat)
(cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -V -O hdf5.log" > build-VS2017-64.bat; chmod 755 build-VS2017-64.bat)
+ (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2019 -C Release -V -O hdf5.log" > build-VS2019-32.bat; chmod 755 build-VS2019-32.bat)
+ (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201964 -C Release -V -O hdf5.log" > build-VS2019-64.bat; chmod 755 build-VS2019-64.bat)
# step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files
cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmziptmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpsubdir
- cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.1-Source.zip $cmziptmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.4-Source.zip $cmziptmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-master.zip $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmziptmpsubdir
@@ -328,7 +331,8 @@ tar2cmaketgz()
# step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files
cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir
- cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.1-Source.tar.gz $cmgztmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.4-Source.tar.gz $cmgztmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-master.tar.gz $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpsubdir
@@ -411,7 +415,8 @@ tar2hpccmaketgz()
# step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files
cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir
- cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.1-Source.tar.gz $cmgztmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.14.4-Source.tar.gz $cmgztmpsubdir
+ cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-master.tar.gz $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir
diff --git a/bin/trace b/bin/trace
index 0611fa5..cc26f86 100755
--- a/bin/trace
+++ b/bin/trace
@@ -53,11 +53,14 @@ $Source = "";
"H5D_scatter_func_t" => "DS",
"H5FD_mpio_xfer_t" => "Dt",
"H5D_vds_view_t" => "Dv",
+ "H5D_chunk_iter_op_t" => "x",
"herr_t" => "e",
"H5E_auto1_t" => "Ea",
"H5E_auto2_t" => "EA",
+ "H5ES_event_complete_func_t" => "EC",
"H5E_direction_t" => "Ed",
"H5E_error_t" => "Ee",
+ "H5ES_event_insert_func_t" => "EI",
"H5ES_status_t" => "Es",
"H5E_type_t" => "Et",
"H5FD_class_t" => "FC",
@@ -158,7 +161,7 @@ $Source = "";
"H5VL_file_specific_t" => "Vh",
"H5VL_group_get_t" => "Vi",
"H5VL_group_specific_t" => "Vj",
- "H5VL_link_create_type_t" => "Vk",
+ "H5VL_link_create_t" => "Vk",
"H5VL_link_get_t" => "Vl",
"H5VL_get_conn_lvl_t" => "VL",
"H5VL_link_specific_t" => "Vm",
@@ -282,8 +285,8 @@ my $file_api = 0;
my $file_args = 0;
my $total_api = 0;
my $total_args = 0;
-sub rewrite_func ($$$$$$$$) {
- my ($file, $begin, $type, $aftertype, $name, $args, $close, $body) = @_;
+sub rewrite_func ($$$$$) {
+ my ($file, $type, $name, $args, $body) = @_;
my ($arg, $trace, $argtrace);
my (@arg_name, @arg_str, @arg_type);
local $_;
@@ -348,13 +351,35 @@ sub rewrite_func ($$$$$$$$) {
# Compose the trace macro
$trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \"";
- $argtrace = "H5ARG_TRACE" . scalar(@arg_str) . "(FUNC, \"";
+ $argtrace = "H5ARG_TRACE" . scalar(@arg_str) . "(__func__, \"";
$trace .= join("", @arg_str) . "\"";
$argtrace .= join("", @arg_str) . "\"";
- my $len = 4 + length $trace; # Add 4, for indenting the line
- for (@arg_name) {
- # Wrap lines that will be longer than the limit, after ');' is added
- if ($len + length >= ($max_trace_macro_line_len - 2)) {
+
+ # Add 4 for indenting the line
+ my $len = 4 + length($trace);
+
+ for my $i (0 .. $#arg_name) {
+ # Handle wrapping
+
+ # Be VERY careful here! clang-format and this script MUST agree
+ # on which lines get wrapped or there will be churn as each tries
+ # to undo the other's output.
+ #
+ # TWO cases must be handled:
+ # 1) The argument is that last one and ');' will be appended
+ # 2) The argument is NOT the last one and ',' will be appended
+ #
+ # NB: clang-format does NOT consider terminal newlines when
+ # counting columns for the ColumnLimit
+ #
+ # The extra '2' added after $len includes the ', ' that would be
+ # added BEFORE the argument.
+ #
+ my $adjust = ($i + 1 == scalar(@arg_str)) ? 2 : 1;
+ my $len_if_added = $len + 2 + length($arg_name[$i]) + $adjust;
+
+ # Wrap lines that will be longer than the limit
+ if ($len_if_added > $max_trace_macro_line_len) {
# Wrap line, with indention
$trace .= ",\n ";
$len = 13; # Set to 13, for indention
@@ -370,9 +395,11 @@ sub rewrite_func ($$$$$$$$) {
}
# Append argument
- $trace .= "$_";
- $argtrace .= ", $_";
- $len += length; # Add length of appended argument name
+ $trace .= "$arg_name[$i]";
+ $argtrace .= ", $arg_name[$i]";
+
+ # Add length of appended argument name
+ $len += length($arg_name[$i]);
}
# Append final ');' for macro
@@ -458,7 +485,7 @@ sub rewrite_func ($$$$$$$$) {
}
error:
- return "\n$begin$type$aftertype$name($orig_args)$close$body";
+ return "\n$type\n$name($orig_args)\n$body";
}
##############################################################################
@@ -480,25 +507,12 @@ for $file (@ARGV) {
# Make a copy of the original data
my $original = $Source;
- # Check which style of function declaration is used in this file
- if ( $Source =~ /BEGIN_FUNC/ ) {
- # Make modifications
- $Source =~ s/\n(BEGIN_FUNC.*?\n) #begin
- ([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**) #type
- (.*?\n) #aftertype
- (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
- \s*\((.*?)\)\s* #args
- (\)) #close
- (\n.*?\nEND_FUNC\([^\n]*) #body
- /rewrite_func($file,$1,$2,$4,$5,$6,$7,$8)/segx;
- } else {
- # Make modifications
- $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
- (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
- \s*\((.*?)\)\s* #args
- (\{.*?\n\}[^\n]*) #body
- /rewrite_func($file,"",$1,"\n",$3,$4,"\n",$5)/segx;
- }
+ # Make modifications
+ $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
+ (H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
+ \s*\((.*?)\)\s* #args
+ (\{.*?\n\}[^\n]*) #body
+ /rewrite_func($file,$1,$3,$4,$5)/segx;
# If the source changed then print out the new version
if ($original ne $Source) {
diff --git a/c++/COPYING b/c++/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/c++/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp
index 365a7da..3717fcb 100644
--- a/c++/examples/chunks.cpp
+++ b/c++/examples/chunks.cpp
@@ -16,11 +16,7 @@
* We will read from the file created by extend.cpp
*/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cout;
using std::endl;
diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp
index 31a572a..8975845 100644
--- a/c++/examples/compound.cpp
+++ b/c++/examples/compound.cpp
@@ -17,11 +17,7 @@
* and read back fields' subsets.
*/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cout;
using std::endl;
diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp
index ef2de36..e55230f 100644
--- a/c++/examples/create.cpp
+++ b/c++/examples/create.cpp
@@ -15,11 +15,7 @@
* This example writes a dataset to a new HDF5 file.
*/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
#include "H5Cpp.h"
diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp
index e69c1c0..24f5f3e 100644
--- a/c++/examples/extend_ds.cpp
+++ b/c++/examples/extend_ds.cpp
@@ -18,11 +18,7 @@
*
*/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
using std::cout;
diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp
index 793ff8f..f9ec176 100644
--- a/c++/examples/h5group.cpp
+++ b/c++/examples/h5group.cpp
@@ -20,11 +20,7 @@
* the C version is used in this example.
*/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cout;
using std::endl;
diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp
index 7441420..e247a8e 100644
--- a/c++/examples/readdata.cpp
+++ b/c++/examples/readdata.cpp
@@ -17,11 +17,7 @@
// information about the dataset in the SDS.h5 file is obtained.
//
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cout;
using std::endl;
diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in
index 46fe5eb..44dc9e7 100644
--- a/c++/examples/testh5c++.sh.in
+++ b/c++/examples/testh5c++.sh.in
@@ -67,11 +67,7 @@ temp_FILES="a.out $applib"
cat > $appmain <<EOF
#include <string>
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include "H5Cpp.h"
@@ -95,19 +91,11 @@ EOF
# generate prog1
cat > $prog1 <<EOF
-#ifdef OLD_HEADER_FILENAME
- #include <iostream.h>
-#else
- #include <iostream>
-#endif
+#include <iostream>
#include <string>
-#ifndef H5_NO_NAMESPACE
-#ifndef H5_NO_STD
- using std::cout;
- using std::endl;
-#endif // H5_NO_STD
-#endif
+using std::cout;
+using std::endl;
int sub1(void)
{
cout << "in sub1" << endl;
@@ -117,19 +105,11 @@ EOF
# generate prog2
cat > $prog2 <<EOF
-#ifdef OLD_HEADER_FILENAME
- #include <iostream.h>
-#else
- #include <iostream>
-#endif
+#include <iostream>
#include <string>
-#ifndef H5_NO_NAMESPACE
-#ifndef H5_NO_STD
- using std::cout;
- using std::endl;
-#endif // H5_NO_STD
-#endif
+using std::cout;
+using std::endl;
int sub2(void)
{
cout << "in sub2" << endl;
@@ -142,11 +122,7 @@ EOF
cat > $hdf5main <<EOF
#include <string>
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include "H5Cpp.h"
diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp
index ddd3460..f2b715a 100644
--- a/c++/examples/writedata.cpp
+++ b/c++/examples/writedata.cpp
@@ -20,11 +20,7 @@
* file is closed. Program reopens the file and reads and displays the result.
*/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cout;
using std::endl;
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 8608c67..2a37dea 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -2,13 +2,6 @@ cmake_minimum_required (VERSION 3.12)
project (HDF5_CPP_SRC CXX)
#-----------------------------------------------------------------------------
-# Generate configure file
-#-----------------------------------------------------------------------------
-configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in
- ${HDF5_SRC_BINARY_DIR}/H5cxx_pubconf.h
-)
-
-#-----------------------------------------------------------------------------
# Define cpp Library
#-----------------------------------------------------------------------------
set (CPP_SOURCES
@@ -199,17 +192,21 @@ set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}"
configure_file (
${HDF_CONFIG_DIR}/libhdf5.pc.in
- ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}.pc
@ONLY
)
install (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}.pc
DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
COMPONENT cpplibraries
)
if (NOT WIN32 AND NOT MINGW)
- set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
+ if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND)
+ set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER})
+ else ()
+ set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
+ endif ()
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
${HDF5_BINARY_DIR}/CMakeFiles/h5c++
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index 6e6be8d..eeb0155 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -38,7 +38,9 @@ namespace H5 {
///\brief Default constructor
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AbstractDs::AbstractDs() {}
+AbstractDs::AbstractDs()
+{
+}
//--------------------------------------------------------------------------
// Function: AbstractDs default constructor
@@ -331,6 +333,8 @@ AbstractDs::getVarLenType() const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AbstractDs::~AbstractDs() {}
+AbstractDs::~AbstractDs()
+{
+}
} // namespace H5
diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h
index fe6e033c..b84867b 100644
--- a/c++/src/H5AbstractDs.h
+++ b/c++/src/H5AbstractDs.h
@@ -12,8 +12,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef __AbstractDs_H
-#define __AbstractDs_H
+#ifndef H5AbstractDs_H
+#define H5AbstractDs_H
namespace H5 {
@@ -81,4 +81,4 @@ class H5_DLLCPP AbstractDs {
}; // end of AbstractDs
} // namespace H5
-#endif // __AbstractDs_H
+#endif // H5AbstractDs_H
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp
index edf915d..6999f1b 100644
--- a/c++/src/H5ArrayType.cpp
+++ b/c++/src/H5ArrayType.cpp
@@ -34,7 +34,9 @@ namespace H5 {
///\brief Default constructor: Creates a stub ArrayType
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-ArrayType::ArrayType() : DataType() {}
+ArrayType::ArrayType() : DataType()
+{
+}
//--------------------------------------------------------------------------
// Function: ArrayType overloaded constructor
@@ -43,14 +45,18 @@ ArrayType::ArrayType() : DataType() {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id) {}
+ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: ArrayType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-ArrayType::ArrayType(const ArrayType &original) : DataType(original) {}
+ArrayType::ArrayType(const ArrayType &original) : DataType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: ArrayType overloaded constructor
@@ -206,6 +212,8 @@ ArrayType::getArrayDims(hsize_t *dims) const
///\brief Properly terminates access to this array datatype.
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-ArrayType::~ArrayType() {}
+ArrayType::~ArrayType()
+{
+}
} // namespace H5
diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h
index 4302352..29313c4 100644
--- a/c++/src/H5ArrayType.h
+++ b/c++/src/H5ArrayType.h
@@ -37,7 +37,7 @@ class H5_DLLCPP ArrayType : public DataType {
// Returns an ArrayType object via DataType* by decoding the
// binary object description of this type.
- virtual DataType *decode() const;
+ virtual DataType *decode() const override;
// Returns the number of dimensions of this array datatype.
int getArrayNDims() const;
@@ -49,7 +49,7 @@ class H5_DLLCPP ArrayType : public DataType {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("ArrayType");
}
@@ -61,7 +61,7 @@ class H5_DLLCPP ArrayType : public DataType {
ArrayType(const hid_t existing_id);
// Noop destructor
- virtual ~ArrayType();
+ virtual ~ArrayType() override;
// Default constructor
ArrayType();
diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp
index 6730171..0b48046 100644
--- a/c++/src/H5AtomType.cpp
+++ b/c++/src/H5AtomType.cpp
@@ -35,7 +35,9 @@ namespace H5 {
// Purpose Default constructor: creates a stub atomic datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AtomType::AtomType() : DataType() {}
+AtomType::AtomType() : DataType()
+{
+}
//--------------------------------------------------------------------------
// Function: AtomType overloaded constructor [protected]
@@ -44,14 +46,18 @@ AtomType::AtomType() : DataType() {}
// Exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AtomType::AtomType(const hid_t existing_id) : DataType(existing_id) {}
+AtomType::AtomType(const hid_t existing_id) : DataType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: AtomType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AtomType::AtomType(const AtomType &original) : DataType(original) {}
+AtomType::AtomType(const AtomType &original) : DataType(original)
+{
+}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
@@ -290,7 +296,9 @@ AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AtomType::~AtomType() {}
+AtomType::~AtomType()
+{
+}
#endif // DOXYGEN_SHOULD_SKIP_THIS
} // namespace H5
diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h
index 84da5e9..1b5153e 100644
--- a/c++/src/H5AtomType.h
+++ b/c++/src/H5AtomType.h
@@ -58,7 +58,7 @@ class H5_DLLCPP AtomType : public DataType {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("AtomType");
}
@@ -68,7 +68,7 @@ class H5_DLLCPP AtomType : public DataType {
AtomType(const AtomType &original);
// Noop destructor
- virtual ~AtomType();
+ virtual ~AtomType() override;
#endif // DOXYGEN_SHOULD_SKIP_THIS
protected:
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index 81e656f..954222c 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -11,14 +11,9 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
-#include "H5private.h" // for HDfree
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -48,7 +43,9 @@ class H5Object; // forward declaration for UserData4Aiterate
///\brief Default constructor: Creates a stub attribute
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
-Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {}
+Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID)
+{
+}
//--------------------------------------------------------------------------
// Function: Attribute copy constructor
@@ -312,10 +309,10 @@ Attribute::getName(char *attr_name, size_t buf_size) const
H5std_string
Attribute::getName() const
{
- H5std_string attr_name(""); // attribute name to return
+ H5std_string attr_name; // attribute name to return
// Preliminary call to get the size of the attribute name
- ssize_t name_size = H5Aget_name(id, static_cast<size_t>(0), NULL);
+ ssize_t name_size = H5Aget_name(id, 0, NULL);
// If H5Aget_name failed, throw exception
if (name_size < 0) {
@@ -326,8 +323,8 @@ Attribute::getName() const
}
// Attribute's name exists, retrieve it
else if (name_size > 0) {
- char *name_C = new char[name_size + 1]; // temporary C-string
- HDmemset(name_C, 0, name_size + 1); // clear buffer
+ // Create buffer for C string
+ char *name_C = new char[name_size + 1]();
// Use overloaded function
name_size = getName(name_C, name_size + 1);
@@ -338,6 +335,7 @@ Attribute::getName() const
// Clean up resource
delete[] name_C;
}
+
// Return attribute's name
return (attr_name);
}
@@ -395,8 +393,8 @@ Attribute::getName(H5std_string &attr_name, size_t len) const
}
// If length is provided, get that number of characters in name
else {
- char *name_C = new char[len + 1]; // temporary C-string
- HDmemset(name_C, 0, len + 1); // clear buffer
+ // Create buffer for C string
+ char *name_C = new char[len + 1]();
// Use overloaded function
name_size = getName(name_C, len + 1);
@@ -553,7 +551,7 @@ Attribute::p_read_variable_len(const DataType &mem_type, H5std_string &strg) con
// Get string from the C char* and release resource allocated by C API
strg = strg_C;
- HDfree(strg_C);
+ free(strg_C);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h
index 41e5a31..47375a5 100644
--- a/c++/src/H5Attribute.h
+++ b/c++/src/H5Attribute.h
@@ -38,7 +38,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location {
Attribute(const hid_t attr_id);
// Closes this attribute.
- virtual void close();
+ virtual void close() override;
// Gets the name of this attribute.
ssize_t getName(char *attr_name, size_t buf_size = 0) const;
@@ -50,13 +50,13 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location {
ssize_t getName(size_t buf_size, H5std_string &attr_name) const;
// Gets a copy of the dataspace for this attribute.
- virtual DataSpace getSpace() const;
+ virtual DataSpace getSpace() const override;
// Returns the amount of storage size required for this attribute.
- virtual hsize_t getStorageSize() const;
+ virtual hsize_t getStorageSize() const override;
// Returns the in memory size of this attribute's data.
- virtual size_t getInMemDataSize() const;
+ virtual size_t getInMemDataSize() const override;
// Reads data from this attribute.
void read(const DataType &mem_type, void *buf) const;
@@ -68,21 +68,21 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("Attribute");
}
// Gets the attribute id.
- virtual hid_t getId() const;
+ virtual hid_t getId() const override;
// Destructor: properly terminates access to this attribute.
- virtual ~Attribute();
+ virtual ~Attribute() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
protected:
// Sets the attribute id.
- virtual void p_setId(const hid_t new_id);
+ virtual void p_setId(const hid_t new_id) override;
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
@@ -92,7 +92,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location {
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// sub-types
- virtual hid_t p_get_type() const;
+ virtual hid_t p_get_type() const override;
// Reads variable or fixed len strings from this attribute.
void p_read_variable_len(const DataType &mem_type, H5std_string &strg) const;
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp
index dbc88f8..8401b9c 100644
--- a/c++/src/H5CommonFG.cpp
+++ b/c++/src/H5CommonFG.cpp
@@ -13,7 +13,6 @@
#include <string>
-#include "H5private.h" // for HDstrcpy
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -357,14 +356,18 @@ CommonFG::openVarLenType(const H5std_string &name) const
///\brief Default constructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CommonFG::CommonFG() {}
+CommonFG::CommonFG()
+{
+}
//--------------------------------------------------------------------------
// Function: CommonFG destructor
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CommonFG::~CommonFG() {}
+CommonFG::~CommonFG()
+{
+}
//--------------------------------------------------------------------------
// Function: f_DataType_setId - friend
diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h
index 2e5ccf3..d87f9ca 100644
--- a/c++/src/H5CommonFG.h
+++ b/c++/src/H5CommonFG.h
@@ -12,8 +12,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef __CommonFG_H
-#define __CommonFG_H
+#ifndef H5CommonFG_H
+#define H5CommonFG_H
namespace H5 {
@@ -83,7 +83,7 @@ class H5_DLLCPP CommonFG {
}; // end of CommonFG
} // namespace H5
-#endif // __CommonFG_H
+#endif // H5CommonFG_H
/***************************************************************************
Design Note
diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp
index ca01aeb..3b38c6d 100644
--- a/c++/src/H5CompType.cpp
+++ b/c++/src/H5CompType.cpp
@@ -37,7 +37,9 @@ namespace H5 {
///\brief Default constructor: Creates a stub compound datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType() : DataType() {}
+CompType::CompType() : DataType()
+{
+}
//--------------------------------------------------------------------------
// Function: CompType copy constructor
@@ -45,7 +47,9 @@ CompType::CompType() : DataType() {}
///\param original - IN: Original CompType instance
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType(const CompType &original) : DataType(original) {}
+CompType::CompType(const CompType &original) : DataType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: CompType overloaded constructor
@@ -53,7 +57,9 @@ CompType::CompType(const CompType &original) : DataType(original) {}
///\param existing_id - IN: Id of an existing compound datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType(const hid_t existing_id) : DataType(existing_id) {}
+CompType::CompType(const hid_t existing_id) : DataType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: CompType overloaded constructor
@@ -65,7 +71,9 @@ CompType::CompType(const hid_t existing_id) : DataType(existing_id) {}
// the compound datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType(size_t size) : DataType(H5T_COMPOUND, size) {}
+CompType::CompType(size_t size) : DataType(H5T_COMPOUND, size)
+{
+}
//--------------------------------------------------------------------------
// Function: CompType overloaded constructor
@@ -549,6 +557,8 @@ CompType::setSize(size_t size) const
///\brief Properly terminates access to this compound datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::~CompType() {}
+CompType::~CompType()
+{
+}
} // namespace H5
diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h
index 6a4c093..59fd9cf 100644
--- a/c++/src/H5CompType.h
+++ b/c++/src/H5CompType.h
@@ -45,7 +45,7 @@ class H5_DLLCPP CompType : public DataType {
// Returns a CompType object via DataType* by decoding the binary
// object description of this type.
- virtual DataType *decode() const;
+ virtual DataType *decode() const override;
// Returns the type class of the specified member of this compound
// datatype. It provides to the user a way of knowing what type
@@ -108,13 +108,13 @@ class H5_DLLCPP CompType : public DataType {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("CompType");
}
// Noop destructor.
- virtual ~CompType();
+ virtual ~CompType() override;
private:
// Contains common code that is used by the member functions
diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h
index 9272bdb..202d584 100644
--- a/c++/src/H5Cpp.h
+++ b/c++/src/H5Cpp.h
@@ -48,14 +48,4 @@
#include "H5File.h"
#include "H5Library.h"
-/* Some C++ compilers do not have offsetof macro; define to bypass the problem
- - BMR- -EIP- 2007/08/01
-*/
-#ifndef H5_CXX_HAVE_OFFSETOF
-#ifdef HOFFSET
-#undef HOFFSET
-#endif
-#define HOFFSET(TYPE, MEMBER) ((size_t) & ((TYPE *)0)->MEMBER)
-#endif
-
#endif // H5Cpp_H
diff --git a/c++/src/H5DaccProp.cpp b/c++/src/H5DaccProp.cpp
index 9e2653d..1905f27 100644
--- a/c++/src/H5DaccProp.cpp
+++ b/c++/src/H5DaccProp.cpp
@@ -72,8 +72,7 @@ DSetAccPropList::getConstant()
void
DSetAccPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -88,7 +87,9 @@ const DSetAccPropList &DSetAccPropList::DEFAULT = *getConstant();
///\brief Default constructor: creates a stub dataset creation property list
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetAccPropList::DSetAccPropList() : LinkAccPropList(H5P_DATASET_ACCESS) {}
+DSetAccPropList::DSetAccPropList() : LinkAccPropList(H5P_DATASET_ACCESS)
+{
+}
//--------------------------------------------------------------------------
// Function: DSetAccPropList copy constructor
@@ -96,7 +97,9 @@ DSetAccPropList::DSetAccPropList() : LinkAccPropList(H5P_DATASET_ACCESS) {}
/// DSetAccPropList object
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetAccPropList::DSetAccPropList(const DSetAccPropList &orig) : LinkAccPropList(orig) {}
+DSetAccPropList::DSetAccPropList(const DSetAccPropList &orig) : LinkAccPropList(orig)
+{
+}
//--------------------------------------------------------------------------
// Function: DSetAccPropList overloaded constructor
@@ -104,7 +107,9 @@ DSetAccPropList::DSetAccPropList(const DSetAccPropList &orig) : LinkAccPropList(
/// existing dataset creation property list.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetAccPropList::DSetAccPropList(const hid_t plist_id) : LinkAccPropList(plist_id) {}
+DSetAccPropList::DSetAccPropList(const hid_t plist_id) : LinkAccPropList(plist_id)
+{
+}
//--------------------------------------------------------------------------
// Function: DSetAccPropList::setChunkCache
@@ -159,6 +164,8 @@ DSetAccPropList::getChunkCache(size_t &rdcc_nslots, size_t &rdcc_nbytes, double
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetAccPropList::~DSetAccPropList() {}
+DSetAccPropList::~DSetAccPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5DaccProp.h b/c++/src/H5DaccProp.h
index 7d6b250..1accbd6 100644
--- a/c++/src/H5DaccProp.h
+++ b/c++/src/H5DaccProp.h
@@ -38,7 +38,7 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("DSetAccPropList");
}
@@ -51,7 +51,7 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList {
DSetAccPropList(const hid_t plist_id);
// Noop destructor.
- virtual ~DSetAccPropList();
+ virtual ~DSetAccPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 9027d79..ce56e30 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -11,14 +11,9 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
-#include "H5private.h" // for HDfree
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -46,15 +41,15 @@ using std::endl;
//--------------------------------------------------------------------------
// Function: DataSet default constructor
///\brief Default constructor: creates a stub DataSet.
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {}
+DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID)
+{
+}
//--------------------------------------------------------------------------
// Function: DataSet overloaded constructor
///\brief Creates an DataSet object using the id of an existing dataset.
///\param existing_id - IN: Id of an existing dataset
-// Programmer Binh-Minh Ribler - 2000
// Description
// incRefCount() is needed here to prevent the id from being closed
// prematurely. That is, when application uses the id of an
@@ -71,7 +66,6 @@ DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existin
// Function: DataSet copy constructor
///\brief Copy constructor: same HDF5 object as \a original
///\param original - IN: DataSet instance to copy
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSet::DataSet(const DataSet &original) : H5Object(), AbstractDs(), id(original.id)
{
@@ -79,6 +73,20 @@ DataSet::DataSet(const DataSet &original) : H5Object(), AbstractDs(), id(origina
}
//--------------------------------------------------------------------------
+// Function: DataSet assignment operator
+///\brief Assignment operator: same HDF5 object as \a original
+///\param original - IN: DataSet instance to copy
+//--------------------------------------------------------------------------
+DataSet &
+DataSet::operator=(const DataSet &original)
+{
+ if (this != &original) {
+ setId(original.id);
+ }
+ return (*this);
+}
+
+//--------------------------------------------------------------------------
// Function: DataSet overload constructor - dereference
///\brief Given a reference, ref, to an hdf5 location, creates a
/// DataSet object
@@ -91,7 +99,6 @@ DataSet::DataSet(const DataSet &original) : H5Object(), AbstractDs(), id(origina
///\par Description
/// \c loc can be DataSet, Group, H5File, or named DataType, that
/// is a datatype that has been named by DataType::commit.
-// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
DataSet::DataSet(const H5Location &loc, const void *ref, H5R_type_t ref_type, const PropList &plist)
: H5Object(), AbstractDs(), id(H5I_INVALID_HID)
@@ -108,7 +115,6 @@ DataSet::DataSet(const H5Location &loc, const void *ref, H5R_type_t ref_type, co
///\param ref_type - IN: Reference type - default to H5R_OBJECT
///\param plist - IN: Property list - default to PropList::DEFAULT
///\exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
DataSet::DataSet(const Attribute &attr, const void *ref, H5R_type_t ref_type, const PropList &plist)
: H5Object(), AbstractDs(), id(H5I_INVALID_HID)
@@ -121,7 +127,6 @@ DataSet::DataSet(const Attribute &attr, const void *ref, H5R_type_t ref_type, co
///\brief Gets a copy of the dataspace of this dataset.
///\return DataSpace instance
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace
DataSet::getSpace() const
@@ -158,7 +163,6 @@ DataSet::p_get_type() const
///\brief Gets the dataset creation property list.
///\return DSetCreatPropList instance
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetCreatPropList
DataSet::getCreatePlist() const
@@ -202,7 +206,6 @@ DataSet::getAccessPlist() const
///\exception H5::DataSetIException
// Note: H5Dget_storage_size returns 0 when there is no data. This
// function should have no failure. (from SLU)
-// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
hsize_t
DataSet::getStorageSize() const
@@ -216,7 +219,6 @@ DataSet::getStorageSize() const
///\brief Gets the size in memory of the dataset's data.
///\return Size of data (in memory)
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Apr 2009
//--------------------------------------------------------------------------
size_t
DataSet::getInMemDataSize() const
@@ -274,7 +276,6 @@ DataSet::getInMemDataSize() const
///\brief Returns the address of this dataset in the file.
///\return Address of dataset
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
haddr_t
DataSet::getOffset() const
@@ -293,7 +294,6 @@ DataSet::getOffset() const
///\brief Determines whether space has been allocated for a dataset.
///\param status - OUT: Space allocation status
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void
DataSet::getSpaceStatus(H5D_space_status_t &status) const
@@ -311,7 +311,6 @@ DataSet::getSpaceStatus(H5D_space_status_t &status) const
///\param space - IN: Selection for the memory buffer
///\return Amount of storage
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hsize_t
DataSet::getVlenBufSize(const DataType &type, const DataSpace &space) const
@@ -336,7 +335,6 @@ DataSet::getVlenBufSize(const DataType &type, const DataSpace &space) const
// misses const's. This wrapper will be removed in future release.
// Return Amount of storage
// Exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
// Modification
// Modified to call its replacement. -BMR, 2014/04/16
// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0
@@ -356,7 +354,6 @@ DataSet::getVlenBufSize(const DataType &type, const DataSpace &space) const
///\param xfer_plist - IN: Property list used to create the buffer
///\param buf - IN: Pointer to the buffer to be reclaimed
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void
DataSet::vlenReclaim(const DataType &type, const DataSpace &space, const DSetMemXferPropList &xfer_plist,
@@ -382,7 +379,6 @@ DataSet::vlenReclaim(const DataType &type, const DataSpace &space, const DSetMem
///\param xfer_plist - IN: Property list used to create the buffer
///\param buf - IN: Pointer to the buffer to be reclaimed
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//\parDescription
// This function has better prototype for the users than the
// other, which might be removed at some point. BMR - 2006/12/20
@@ -415,7 +411,6 @@ DataSet::vlenReclaim(void *buf, const DataType &type, const DataSpace &space,
/// This function reads raw data from this dataset into the
/// buffer \a buf, converting from file datatype and dataspace
/// to memory datatype \a mem_type and dataspace \a mem_space.
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void
DataSet::read(void *buf, const DataType &mem_type, const DataSpace &mem_space, const DataSpace &file_space,
@@ -443,7 +438,6 @@ DataSet::read(void *buf, const DataType &mem_type, const DataSpace &mem_space, c
///\param file_space - IN: Dataset's dataspace in the file
///\param xfer_plist - IN: Transfer property list for this I/O operation
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
// Modification
// Jul 2009
// Follow the change to Attribute::read and use the following
@@ -492,7 +486,6 @@ DataSet::read(H5std_string &strg, const DataType &mem_type, const DataSpace &mem
/// \a buf to a dataset, converting from memory datatype
/// \a mem_type and dataspace \a mem_space to file datatype
/// and dataspace.
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void
DataSet::write(const void *buf, const DataType &mem_type, const DataSpace &mem_space,
@@ -514,7 +507,6 @@ DataSet::write(const void *buf, const DataType &mem_type, const DataSpace &mem_s
// Function: DataSet::write
///\brief This is an overloaded member function, provided for convenience.
/// It takes a reference to a \c H5std_string for the buffer.
-// Programmer Binh-Minh Ribler - 2000
// Modification
// Jul 2009
// Modified to pass the buffer into H5Dwrite properly depending
@@ -570,7 +562,6 @@ DataSet::write(const H5std_string &strg, const DataType &mem_type, const DataSpa
///\exception H5::DataSetIException
///\note This function may not work correctly yet - it's still
/// under development.
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int
DataSet::iterateElems(void *buf, const DataType &type, const DataSpace &space, H5D_operator_t op,
@@ -596,7 +587,6 @@ DataSet::iterateElems(void *buf, const DataType &type, const DataSpace &space, H
///\par Description
/// For information, please refer to the H5Dset_extent API in
/// the HDF5 C Reference Manual.
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void
DataSet::extend(const hsize_t *size) const
@@ -615,7 +605,6 @@ DataSet::extend(const hsize_t *size) const
///\param buf_type - IN: Datatype of the elements in buffer
///\param space - IN: Dataspace describing memory buffer & containing selection to use
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2014
//--------------------------------------------------------------------------
void
DataSet::fillMemBuf(const void *fill, const DataType &fill_type, void *buf, const DataType &buf_type,
@@ -641,7 +630,6 @@ DataSet::fillMemBuf(const void *fill, const DataType &fill_type, void *buf, cons
// Param buf_type - IN: Datatype of the elements in buffer
// Param space - IN: Dataspace describing memory buffer & containing selection to use
// Exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
// Modification
// Modified to call its replacement. -BMR, 2014/04/16
// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0
@@ -660,7 +648,6 @@ DataSet::fillMemBuf(const void *fill, const DataType &fill_type, void *buf, cons
///\param buf_type - IN: Datatype of the elements in buffer
///\param space - IN: Dataspace describing memory buffer & containing selection to use
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void
DataSet::fillMemBuf(void *buf, const DataType &buf_type, const DataSpace &space) const
@@ -682,7 +669,6 @@ DataSet::fillMemBuf(void *buf, const DataType &buf_type, const DataSpace &space)
// Param buf_type - IN: Datatype of the elements in buffer
// Param space - IN: Dataspace describing memory buffer & containing selection to use
// Exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
// Modification
// Modified to call its replacement. -BMR, 2014/04/16
// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0
@@ -702,7 +688,6 @@ DataSet::fillMemBuf(void *buf, const DataType &buf_type, const DataSpace &space)
// AbstractDs and Attribute are moved out of H5Object. In
// addition, member IdComponent::id is moved into subclasses, and
// IdComponent::getId now becomes pure virtual function.
-// Programmer Binh-Minh Ribler - May, 2008
//--------------------------------------------------------------------------
hid_t
DataSet::getId() const
@@ -712,11 +697,10 @@ DataSet::getId() const
//--------------------------------------------------------------------------
// Function: DataSet::p_read_fixed_len (private)
-// brief Reads a fixed length \a H5std_string from a dataset.
-// param mem_type - IN: DataSet datatype (in memory)
-// param strg - IN: Buffer for read string
-// exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Jul, 2009
+// brief Reads a fixed length \a H5std_string from a dataset.
+// param mem_type - IN: DataSet datatype (in memory)
+// param strg - IN: Buffer for read string
+// exceptio n H5::DataSetIException
// Modification
// Jul 2009
// Added in follow to the change in Attribute::read
@@ -732,8 +716,8 @@ DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, con
// If there is data, allocate buffer and read it.
if (data_size > 0) {
- char *strg_C = new char[data_size + 1];
- HDmemset(strg_C, 0, data_size + 1); // clear buffer
+ // Create buffer for C string
+ char *strg_C = new char[data_size + 1]();
herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C);
@@ -750,11 +734,10 @@ DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, con
//--------------------------------------------------------------------------
// Function: DataSet::p_read_variable_len (private)
-// brief Reads a variable length \a H5std_string from an dataset.
-// param mem_type - IN: DataSet datatype (in memory)
-// param strg - IN: Buffer for read string
-// exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Jul, 2009
+// brief Reads a variable length \a H5std_string from an dataset.
+// param mem_type - IN: DataSet datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::DataSetIException
// Modification
// Jul 2009
// Added in follow to the change in Attribute::read
@@ -775,7 +758,7 @@ DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id,
// Get string from the C char* and release resource allocated by C API
strg = strg_C;
- HDfree(strg_C);
+ free(strg_C);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -789,7 +772,6 @@ DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id,
// The underlaying reference counting in the C library ensures
// that the current valid id of this object is properly closed.
// Then the object's id is reset to the new id.
-// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void
DataSet::p_setId(const hid_t new_id)
@@ -813,7 +795,6 @@ DataSet::p_setId(const hid_t new_id)
// Applications shouldn't need to use it.
// param dset - IN/OUT: DataSet object to be changed
// param new_id - IN: New id to set
-// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
void
f_PropList_setId(PropList *plist, hid_t new_id)
@@ -828,7 +809,6 @@ f_PropList_setId(PropList *plist, hid_t new_id)
///\brief Closes this dataset.
///
///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void
DataSet::close()
@@ -846,7 +826,6 @@ DataSet::close()
//--------------------------------------------------------------------------
// Function: DataSet destructor
///\brief Properly terminates access to this dataset.
-// Programmer Binh-Minh Ribler - 2000
// Modification
// - Replaced resetIdComponent() with decRefCount() to use C
// library ID reference counting mechanism - BMR, Jun 1, 2004
diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h
index c745470..8430f7a 100644
--- a/c++/src/H5DataSet.h
+++ b/c++/src/H5DataSet.h
@@ -28,7 +28,7 @@ namespace H5 {
class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
public:
// Close this dataset.
- virtual void close();
+ virtual void close() override;
// Extends the dataset with unlimited dimension.
void extend(const hsize_t *size) const;
@@ -53,16 +53,16 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
haddr_t getOffset() const;
// Gets the dataspace of this dataset.
- virtual DataSpace getSpace() const;
+ virtual DataSpace getSpace() const override;
// Determines whether space has been allocated for a dataset.
void getSpaceStatus(H5D_space_status_t &status) const;
// Returns the amount of storage size required for this dataset.
- virtual hsize_t getStorageSize() const;
+ virtual hsize_t getStorageSize() const override;
// Returns the in memory size of this attribute's data.
- virtual size_t getInMemDataSize() const;
+ virtual size_t getInMemDataSize() const override;
// Returns the number of bytes required to store VL data.
hsize_t getVlenBufSize(const DataType &type, const DataSpace &space) const;
@@ -100,7 +100,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("DataSet");
}
@@ -117,19 +117,22 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
// Copy constructor - same as the original DataSet.
DataSet(const DataSet &original);
+ // Assignment operator
+ DataSet &operator=(const DataSet &original);
+
// Creates a copy of an existing DataSet using its id.
DataSet(const hid_t existing_id);
// Gets the dataset id.
- virtual hid_t getId() const;
+ virtual hid_t getId() const override;
// Destructor: properly terminates access to this dataset.
- virtual ~DataSet();
+ virtual ~DataSet() override;
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Sets the dataset id.
- virtual void p_setId(const hid_t new_id);
+ virtual void p_setId(const hid_t new_id) override;
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
@@ -139,7 +142,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// sub-types
- virtual hid_t p_get_type() const;
+ virtual hid_t p_get_type() const override;
// Reads variable or fixed len strings from this dataset.
void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id,
diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp
index 9c997d1..342e9fa 100644
--- a/c++/src/H5DataSpace.cpp
+++ b/c++/src/H5DataSpace.cpp
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
#include "H5Include.h"
@@ -73,8 +69,7 @@ DataSpace::getConstant()
void
DataSpace::deleteConstants()
{
- if (ALL_ != 0)
- delete ALL_;
+ delete ALL_;
}
//--------------------------------------------------------------------------
@@ -93,9 +88,8 @@ const DataSpace &DataSpace::ALL = *getConstant();
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSpace::DataSpace(H5S_class_t type) : IdComponent()
+DataSpace::DataSpace(H5S_class_t type) : IdComponent(), id{H5Screate(type)}
{
- id = H5Screate(type);
if (id < 0) {
throw DataSpaceIException("DataSpace constructor", "H5Screate failed");
}
@@ -110,9 +104,9 @@ DataSpace::DataSpace(H5S_class_t type) : IdComponent()
///\exception H5::DataSpaceIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSpace::DataSpace(int rank, const hsize_t *dims, const hsize_t *maxdims) : IdComponent()
+DataSpace::DataSpace(int rank, const hsize_t *dims, const hsize_t *maxdims)
+ : IdComponent(), id{H5Screate_simple(rank, dims, maxdims)}
{
- id = H5Screate_simple(rank, dims, maxdims);
if (id < 0) {
throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed");
}
diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h
index f16acfc..87852a2 100644
--- a/c++/src/H5DataSpace.h
+++ b/c++/src/H5DataSpace.h
@@ -43,7 +43,7 @@ class H5_DLLCPP DataSpace : public IdComponent {
DataSpace &operator=(const DataSpace &rhs);
// Closes this dataspace.
- virtual void close();
+ virtual void close() override;
// Makes copy of an existing dataspace.
void copy(const DataSpace &like_space);
@@ -115,25 +115,25 @@ class H5_DLLCPP DataSpace : public IdComponent {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("DataSpace");
}
// Gets the dataspace id.
- virtual hid_t getId() const;
+ virtual hid_t getId() const override;
// Deletes the global constant
static void deleteConstants();
// Destructor: properly terminates access to this dataspace.
- virtual ~DataSpace();
+ virtual ~DataSpace() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
protected:
// Sets the dataspace id.
- virtual void p_setId(const hid_t new_id);
+ virtual void p_setId(const hid_t new_id) override;
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index a943a55..af58a90 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
#include "H5Include.h"
@@ -36,7 +32,6 @@
#include "H5DataType.h"
#include "H5AtomType.h"
#include "H5PredType.h"
-#include "H5private.h"
#include "H5AbstractDs.h"
#include "H5DataSet.h"
#include "H5Attribute.h"
@@ -50,7 +45,9 @@ using std::endl;
///\brief Default constructor: Creates a stub datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataType::DataType() : H5Object(), id(H5I_INVALID_HID), encoded_buf(NULL), buf_size(0) {}
+DataType::DataType() : H5Object(), id(H5I_INVALID_HID), encoded_buf(NULL), buf_size(0)
+{
+}
//--------------------------------------------------------------------------
// Function: DataType overloaded constructor
@@ -78,10 +75,9 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id), encod
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object(), encoded_buf(NULL), buf_size(0)
+DataType::DataType(const H5T_class_t type_class, size_t size)
+ : H5Object(), id{H5Tcreate(type_class, size)}, encoded_buf(NULL), buf_size(0)
{
- // Call C routine to create the new datatype
- id = H5Tcreate(type_class, size);
if (id < 0) {
throw DataTypeIException("DataType constructor", "H5Tcreate failed");
}
@@ -99,9 +95,10 @@ DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object(), enco
// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
DataType::DataType(const H5Location &loc, const void *ref, H5R_type_t ref_type, const PropList &plist)
- : H5Object(), encoded_buf(NULL), buf_size(0)
+ : H5Object(), id{H5Location::p_dereference(loc.getId(), ref, ref_type, plist,
+ "constructor - by dereference")},
+ encoded_buf(NULL), buf_size(0)
{
- id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference");
}
//--------------------------------------------------------------------------
@@ -148,10 +145,9 @@ DataType::DataType(const DataType &original) : H5Object(), id(original.id), enco
// unnecessarily and will produce undefined behavior.
// -BMR, Apr 2015
//--------------------------------------------------------------------------
-DataType::DataType(const PredType &pred_type) : H5Object(), encoded_buf(NULL), buf_size(0)
+DataType::DataType(const PredType &pred_type)
+ : H5Object(), id{H5Tcopy(pred_type.getId())}, encoded_buf(NULL), buf_size(0)
{
- // Call C routine to copy the datatype
- id = H5Tcopy(pred_type.getId());
if (id < 0)
throw DataTypeIException("DataType constructor", "H5Tcopy failed");
}
@@ -170,9 +166,9 @@ DataType::DataType(const PredType &pred_type) : H5Object(), encoded_buf(NULL), b
// improve usability.
// -BMR, Dec 2016
//--------------------------------------------------------------------------
-DataType::DataType(const H5Location &loc, const char *dtype_name) : H5Object(), encoded_buf(NULL), buf_size(0)
+DataType::DataType(const H5Location &loc, const char *dtype_name)
+ : H5Object(), id{p_opentype(loc, dtype_name)}, encoded_buf(NULL), buf_size(0)
{
- id = p_opentype(loc, dtype_name);
}
//--------------------------------------------------------------------------
@@ -190,9 +186,8 @@ DataType::DataType(const H5Location &loc, const char *dtype_name) : H5Object(),
// -BMR, Dec 2016
//--------------------------------------------------------------------------
DataType::DataType(const H5Location &loc, const H5std_string &dtype_name)
- : H5Object(), encoded_buf(NULL), buf_size(0)
+ : H5Object(), id{p_opentype(loc, dtype_name.c_str())}, encoded_buf(NULL), buf_size(0)
{
- id = p_opentype(loc, dtype_name.c_str());
}
//--------------------------------------------------------------------------
@@ -320,8 +315,9 @@ DataType::encode()
// Allocate buffer and call C function again to encode
if (buf_size > 0) {
- encoded_buf = (unsigned char *)HDcalloc((size_t)1, buf_size);
- ret_value = H5Tencode(id, encoded_buf, &buf_size);
+ encoded_buf = new unsigned char[buf_size]();
+
+ ret_value = H5Tencode(id, encoded_buf, &buf_size);
if (ret_value < 0) {
throw DataTypeIException("DataType::encode", "H5Tencode failed");
}
@@ -342,10 +338,7 @@ DataType::encode()
bool
DataType::hasBinaryDesc() const
{
- if (encoded_buf != NULL)
- return true;
- else
- return false;
+ return encoded_buf != NULL;
}
//--------------------------------------------------------------------------
@@ -974,7 +967,7 @@ DataType::close()
// Free and reset buffer of encoded object description if it's been used
if (encoded_buf != NULL) {
- HDfree(encoded_buf);
+ delete[] encoded_buf;
buf_size = 0;
}
}
diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h
index 49f5348..109dcbb 100644
--- a/c++/src/H5DataType.h
+++ b/c++/src/H5DataType.h
@@ -47,7 +47,7 @@ class H5_DLLCPP DataType : public H5Object {
// PropList& plist = PropList::DEFAULT);
// Closes this datatype.
- virtual void close();
+ virtual void close() override;
// Copies an existing datatype to this datatype object.
void copy(const DataType &like_type);
@@ -133,7 +133,7 @@ class H5_DLLCPP DataType : public H5Object {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("DataType");
}
@@ -148,10 +148,10 @@ class H5_DLLCPP DataType : public H5Object {
bool hasBinaryDesc() const;
// Gets the datatype id.
- virtual hid_t getId() const;
+ virtual hid_t getId() const override;
// Destructor: properly terminates access to this datatype.
- virtual ~DataType();
+ virtual ~DataType() override;
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -162,7 +162,7 @@ class H5_DLLCPP DataType : public H5Object {
hid_t p_decode() const;
// Sets the datatype id.
- virtual void p_setId(const hid_t new_id);
+ virtual void p_setId(const hid_t new_id) override;
// Opens a datatype and returns the id.
hid_t p_opentype(const H5Location &loc, const char *dtype_name) const;
diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp
index d670b74..a9270fd 100644
--- a/c++/src/H5DcreatProp.cpp
+++ b/c++/src/H5DcreatProp.cpp
@@ -78,8 +78,7 @@ DSetCreatPropList::getConstant()
void
DSetCreatPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -94,7 +93,9 @@ const DSetCreatPropList &DSetCreatPropList::DEFAULT = *getConstant();
///\brief Default constructor: creates a stub dataset creation property list
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {}
+DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE)
+{
+}
//--------------------------------------------------------------------------
// Function: DSetCreatPropList copy constructor
@@ -102,7 +103,9 @@ DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {}
/// DSetCreatPropList object
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetCreatPropList::DSetCreatPropList(const DSetCreatPropList &orig) : ObjCreatPropList(orig) {}
+DSetCreatPropList::DSetCreatPropList(const DSetCreatPropList &orig) : ObjCreatPropList(orig)
+{
+}
//--------------------------------------------------------------------------
// Function: DSetCreatPropList overloaded constructor
@@ -110,7 +113,9 @@ DSetCreatPropList::DSetCreatPropList(const DSetCreatPropList &orig) : ObjCreatPr
/// existing dataset creation property list.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : ObjCreatPropList(plist_id) {}
+DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : ObjCreatPropList(plist_id)
+{
+}
//--------------------------------------------------------------------------
// Function: DSetCreatPropList::setChunk
@@ -780,6 +785,8 @@ DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string src_fn
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetCreatPropList::~DSetCreatPropList() {}
+DSetCreatPropList::~DSetCreatPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h
index 3c032ee..a2d5ff2 100644
--- a/c++/src/H5DcreatProp.h
+++ b/c++/src/H5DcreatProp.h
@@ -128,7 +128,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("DSetCreatPropList");
}
@@ -141,7 +141,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
DSetCreatPropList(const hid_t plist_id);
// Noop destructor.
- virtual ~DSetCreatPropList();
+ virtual ~DSetCreatPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp
index d9d7884..1fd6878 100644
--- a/c++/src/H5DxferProp.cpp
+++ b/c++/src/H5DxferProp.cpp
@@ -13,7 +13,6 @@
#include <string>
-#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -72,8 +71,7 @@ DSetMemXferPropList::getConstant()
void
DSetMemXferPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -89,7 +87,9 @@ const DSetMemXferPropList &DSetMemXferPropList::DEFAULT = *getConstant();
/// transfer property list object.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {}
+DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER)
+{
+}
//--------------------------------------------------------------------------
// Function DSetMemXferPropList constructor
@@ -110,7 +110,9 @@ DSetMemXferPropList::DSetMemXferPropList(const char *exp) : PropList(H5P_DATASET
/// list object to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList &original) : PropList(original) {}
+DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList &original) : PropList(original)
+{
+}
//--------------------------------------------------------------------------
// Function DSetMemXferPropList overloaded constructor
@@ -120,7 +122,9 @@ DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList &original) :
/// property list
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_id) {}
+DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_id)
+{
+}
//--------------------------------------------------------------------------
// Function: DSetMemXferPropList::setBuffer
@@ -170,7 +174,7 @@ DSetMemXferPropList::getBuffer(void **tconv, void **bkg) const
void
DSetMemXferPropList::setPreserve(bool status) const
{
- herr_t ret_value = H5Pset_preserve(id, (hbool_t)status);
+ herr_t ret_value = H5Pset_preserve(id, static_cast<hbool_t>(status));
if (ret_value < 0) {
throw PropListIException("DSetMemXferPropList::setPreserve", "H5Pset_preserve failed");
}
@@ -306,10 +310,10 @@ DSetMemXferPropList::getDataTransform() const
{
// Initialize string to "", so that if there is no expression, the returned
// string will be empty
- H5std_string expression("");
+ H5std_string expression;
// Preliminary call to get the expression's length
- ssize_t exp_len = H5Pget_data_transform(id, NULL, (size_t)0);
+ ssize_t exp_len = H5Pget_data_transform(id, NULL, 0);
// If H5Pget_data_transform returns a negative value, raise an exception
if (exp_len < 0) {
@@ -319,8 +323,7 @@ DSetMemXferPropList::getDataTransform() const
// If expression exists, calls C routine again to get it
else if (exp_len > 0) {
// Temporary buffer for char* expression
- char *exp_C = new char[exp_len + 1];
- HDmemset(exp_C, 0, exp_len + 1); // clear buffer
+ char *exp_C = new char[exp_len + 1]();
// Used overloaded function
exp_len = getDataTransform(exp_C, exp_len + 1);
@@ -552,6 +555,8 @@ DSetMemXferPropList::getEDCCheck() const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetMemXferPropList::~DSetMemXferPropList() {}
+DSetMemXferPropList::~DSetMemXferPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h
index 1e4d668..24f8d70 100644
--- a/c++/src/H5DxferProp.h
+++ b/c++/src/H5DxferProp.h
@@ -100,7 +100,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("DSetMemXferPropList");
}
@@ -113,7 +113,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
DSetMemXferPropList(const hid_t plist_id);
// Noop destructor
- virtual ~DSetMemXferPropList();
+ virtual ~DSetMemXferPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp
index 9b179da..2073365 100644
--- a/c++/src/H5EnumType.cpp
+++ b/c++/src/H5EnumType.cpp
@@ -13,7 +13,6 @@
#include <string>
-#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -41,7 +40,9 @@ namespace H5 {
///\brief Default constructor: Creates a stub datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType() : DataType() {}
+EnumType::EnumType() : DataType()
+{
+}
//--------------------------------------------------------------------------
// Function: EnumType overloaded constructor
@@ -50,14 +51,18 @@ EnumType::EnumType() : DataType() {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType(const hid_t existing_id) : DataType(existing_id) {}
+EnumType::EnumType(const hid_t existing_id) : DataType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: EnumType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType(const EnumType &original) : DataType(original) {}
+EnumType::EnumType(const EnumType &original) : DataType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: EnumType overloaded constructor
@@ -69,7 +74,9 @@ EnumType::EnumType(const EnumType &original) : DataType(original) {}
// the enum datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType(size_t size) : DataType(H5T_ENUM, size) {}
+EnumType::EnumType(size_t size) : DataType(H5T_ENUM, size)
+{
+}
//--------------------------------------------------------------------------
// Function: EnumType overloaded constructor
@@ -211,8 +218,7 @@ EnumType::insert(const H5std_string &name, void *value) const
H5std_string
EnumType::nameOf(void *value, size_t size) const
{
- char *name_C = new char[size + 1]; // temporary C-string for C API
- HDmemset(name_C, 0, size + 1); // clear buffer
+ char *name_C = new char[size + 1](); // temporary C-string for C API
// Calls C routine H5Tenum_nameof to get the name of the specified enum type
herr_t ret_value = H5Tenum_nameof(id, value, name_C, size);
@@ -335,6 +341,8 @@ EnumType::getMemberValue(unsigned memb_no, void *value) const
///\brief Properly terminates access to this enum datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::~EnumType() {}
+EnumType::~EnumType()
+{
+}
} // namespace H5
diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h
index 484405a..f9091ca 100644
--- a/c++/src/H5EnumType.h
+++ b/c++/src/H5EnumType.h
@@ -41,7 +41,7 @@ class H5_DLLCPP EnumType : public DataType {
// Returns an EnumType object via DataType* by decoding the
// binary object description of this type.
- virtual DataType *decode() const;
+ virtual DataType *decode() const override;
// Returns the number of members in this enumeration datatype.
int getNmembers() const;
@@ -68,7 +68,7 @@ class H5_DLLCPP EnumType : public DataType {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("EnumType");
}
@@ -82,7 +82,7 @@ class H5_DLLCPP EnumType : public DataType {
// Copy constructor: same as the original EnumType.
EnumType(const EnumType &original);
- virtual ~EnumType();
+ virtual ~EnumType() override;
}; // end of EnumType
} // namespace H5
diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp
index 1aa8ecc..a42c151 100644
--- a/c++/src/H5Exception.cpp
+++ b/c++/src/H5Exception.cpp
@@ -25,7 +25,9 @@ const char Exception::DEFAULT_MSG[] = "No detailed information provided";
///\brief Default constructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Exception::Exception() : detail_message(""), func_name("") {}
+Exception::Exception() : detail_message{""}, func_name{""}
+{
+}
//--------------------------------------------------------------------------
// Function: Exception overloaded constructor
@@ -340,7 +342,9 @@ Exception::printErrorStack(FILE *stream, hid_t err_stack)
///\brief Noop destructor
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Exception::~Exception() throw() {}
+Exception::~Exception() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: FileIException
@@ -350,7 +354,9 @@ Exception::~Exception() throw() {}
// Function: FileIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-FileIException::FileIException() : Exception() {}
+FileIException::FileIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: FileIException overloaded constructor
///\brief Creates a FileIException with the name of the function,
@@ -366,7 +372,9 @@ FileIException::FileIException(const H5std_string &func, const H5std_string &mes
// Function: FileIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-FileIException::~FileIException() throw() {}
+FileIException::~FileIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: GroupIException
@@ -376,7 +384,9 @@ FileIException::~FileIException() throw() {}
// Function: GroupIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-GroupIException::GroupIException() : Exception() {}
+GroupIException::GroupIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: GroupIException overloaded constructor
///\brief Creates a GroupIException with the name of the function,
@@ -392,7 +402,9 @@ GroupIException::GroupIException(const H5std_string &func, const H5std_string &m
// Function: GroupIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-GroupIException::~GroupIException() throw() {}
+GroupIException::~GroupIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: DataSpaceIException
@@ -402,7 +414,9 @@ GroupIException::~GroupIException() throw() {}
// Function: DataSpaceIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-DataSpaceIException::DataSpaceIException() : Exception() {}
+DataSpaceIException::DataSpaceIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: DataSpaceIException overloaded constructor
///\brief Creates a DataSpaceIException with the name of the function,
@@ -418,7 +432,9 @@ DataSpaceIException::DataSpaceIException(const H5std_string &func, const H5std_s
// Function: DataSpaceIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-DataSpaceIException::~DataSpaceIException() throw() {}
+DataSpaceIException::~DataSpaceIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: DataTypeIException
@@ -428,7 +444,9 @@ DataSpaceIException::~DataSpaceIException() throw() {}
// Function: DataTypeIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-DataTypeIException::DataTypeIException() : Exception() {}
+DataTypeIException::DataTypeIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: DataTypeIException overloaded constructor
///\brief Creates a DataTypeIException with the name of the function,
@@ -444,7 +462,9 @@ DataTypeIException::DataTypeIException(const H5std_string &func, const H5std_str
// Function: DataTypeIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-DataTypeIException::~DataTypeIException() throw() {}
+DataTypeIException::~DataTypeIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: ObjHeaderIException
@@ -454,7 +474,9 @@ DataTypeIException::~DataTypeIException() throw() {}
// Function: ObjHeaderIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-ObjHeaderIException::ObjHeaderIException() : Exception() {}
+ObjHeaderIException::ObjHeaderIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: ObjHeaderIException overloaded constructor
///\brief Creates an ObjHeaderIException with the name of the function,
@@ -470,7 +492,9 @@ ObjHeaderIException::ObjHeaderIException(const H5std_string &func, const H5std_s
// Function: ObjHeaderIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-ObjHeaderIException::~ObjHeaderIException() throw() {}
+ObjHeaderIException::~ObjHeaderIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: PropListIException
@@ -480,7 +504,9 @@ ObjHeaderIException::~ObjHeaderIException() throw() {}
// Function: PropListIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-PropListIException::PropListIException() : Exception() {}
+PropListIException::PropListIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: PropListIException overloaded constructor
///\brief Creates a PropListIException with the name of the function,
@@ -496,7 +522,9 @@ PropListIException::PropListIException(const H5std_string &func, const H5std_str
// Function: PropListIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-PropListIException::~PropListIException() throw() {}
+PropListIException::~PropListIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: DataSetIException
@@ -506,7 +534,9 @@ PropListIException::~PropListIException() throw() {}
// Function: DataSetIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-DataSetIException::DataSetIException() : Exception() {}
+DataSetIException::DataSetIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: DataSetIException overloaded constructor
///\brief Creates a DataSetIException with the name of the function,
@@ -522,7 +552,9 @@ DataSetIException::DataSetIException(const H5std_string &func, const H5std_strin
// Function: DataSetIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-DataSetIException::~DataSetIException() throw() {}
+DataSetIException::~DataSetIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: AttributeIException
@@ -532,7 +564,9 @@ DataSetIException::~DataSetIException() throw() {}
// Function: AttributeIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-AttributeIException::AttributeIException() : Exception() {}
+AttributeIException::AttributeIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: AttributeIException overloaded constructor
///\brief Creates an AttributeIException with the name of the function,
@@ -548,7 +582,9 @@ AttributeIException::AttributeIException(const H5std_string &func, const H5std_s
// Function: AttributeIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-AttributeIException::~AttributeIException() throw() {}
+AttributeIException::~AttributeIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: ReferenceException
@@ -558,7 +594,9 @@ AttributeIException::~AttributeIException() throw() {}
// Function: ReferenceException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-ReferenceException::ReferenceException() : Exception() {}
+ReferenceException::ReferenceException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: ReferenceException overloaded constructor
///\brief Creates a ReferenceException with the name of the function,
@@ -574,7 +612,9 @@ ReferenceException::ReferenceException(const H5std_string &func, const H5std_str
// Function: ReferenceException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-ReferenceException::~ReferenceException() throw() {}
+ReferenceException::~ReferenceException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: LibraryIException
@@ -584,7 +624,9 @@ ReferenceException::~ReferenceException() throw() {}
// Function: LibraryIException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-LibraryIException::LibraryIException() : Exception() {}
+LibraryIException::LibraryIException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: LibraryIException overloaded constructor
///\brief Creates a LibraryIException with the name of the function,
@@ -600,7 +642,9 @@ LibraryIException::LibraryIException(const H5std_string &func, const H5std_strin
// Function: LibraryIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-LibraryIException::~LibraryIException() throw() {}
+LibraryIException::~LibraryIException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: LocationException
@@ -610,7 +654,9 @@ LibraryIException::~LibraryIException() throw() {}
// Function: LocationException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-LocationException::LocationException() : Exception() {}
+LocationException::LocationException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: LocationException overloaded constructor
///\brief Creates a LocationException with the name of the function,
@@ -626,7 +672,9 @@ LocationException::LocationException(const H5std_string &func, const H5std_strin
// Function: LocationException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-LocationException::~LocationException() throw() {}
+LocationException::~LocationException() throw()
+{
+}
//--------------------------------------------------------------------------
// Subclass: IdComponentException
@@ -636,7 +684,9 @@ LocationException::~LocationException() throw() {}
// Function: IdComponentException default constructor
///\brief Default constructor.
//--------------------------------------------------------------------------
-IdComponentException::IdComponentException() : Exception() {}
+IdComponentException::IdComponentException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: IdComponentException overloaded constructor
///\brief Creates a IdComponentException with the name of the function,
@@ -652,6 +702,8 @@ IdComponentException::IdComponentException(const H5std_string &func, const H5std
// Function: IdComponentException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
-IdComponentException::~IdComponentException() throw() {}
+IdComponentException::~IdComponentException() throw()
+{
+}
} // namespace H5
diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h
index 566c818..e22f74b 100644
--- a/c++/src/H5Exception.h
+++ b/c++/src/H5Exception.h
@@ -18,11 +18,7 @@
#include <string>
namespace H5 {
-#ifdef H5_NO_STD
-#define H5std_string ::string
-#else
#define H5std_string std::string
-#endif
/*! \class Exception
\brief Exception provides wrappers of HDF5 error handling functions.
@@ -94,84 +90,84 @@ class H5_DLLCPP FileIException : public Exception {
public:
FileIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
FileIException();
- virtual ~FileIException() throw();
+ virtual ~FileIException() throw() override;
};
class H5_DLLCPP GroupIException : public Exception {
public:
GroupIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
GroupIException();
- virtual ~GroupIException() throw();
+ virtual ~GroupIException() throw() override;
};
class H5_DLLCPP DataSpaceIException : public Exception {
public:
DataSpaceIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
DataSpaceIException();
- virtual ~DataSpaceIException() throw();
+ virtual ~DataSpaceIException() throw() override;
};
class H5_DLLCPP DataTypeIException : public Exception {
public:
DataTypeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
DataTypeIException();
- virtual ~DataTypeIException() throw();
+ virtual ~DataTypeIException() throw() override;
};
class H5_DLLCPP ObjHeaderIException : public Exception {
public:
ObjHeaderIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
ObjHeaderIException();
- virtual ~ObjHeaderIException() throw();
+ virtual ~ObjHeaderIException() throw() override;
};
class H5_DLLCPP PropListIException : public Exception {
public:
PropListIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
PropListIException();
- virtual ~PropListIException() throw();
+ virtual ~PropListIException() throw() override;
};
class H5_DLLCPP DataSetIException : public Exception {
public:
DataSetIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
DataSetIException();
- virtual ~DataSetIException() throw();
+ virtual ~DataSetIException() throw() override;
};
class H5_DLLCPP AttributeIException : public Exception {
public:
AttributeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
AttributeIException();
- virtual ~AttributeIException() throw();
+ virtual ~AttributeIException() throw() override;
};
class H5_DLLCPP ReferenceException : public Exception {
public:
ReferenceException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
ReferenceException();
- virtual ~ReferenceException() throw();
+ virtual ~ReferenceException() throw() override;
};
class H5_DLLCPP LibraryIException : public Exception {
public:
LibraryIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
LibraryIException();
- virtual ~LibraryIException() throw();
+ virtual ~LibraryIException() throw() override;
};
class H5_DLLCPP LocationException : public Exception {
public:
LocationException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
LocationException();
- virtual ~LocationException() throw();
+ virtual ~LocationException() throw() override;
};
class H5_DLLCPP IdComponentException : public Exception {
public:
IdComponentException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
IdComponentException();
- virtual ~IdComponentException() throw();
+ virtual ~IdComponentException() throw() override;
}; // end of IdComponentException
} // namespace H5
diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp
index c8c2b24..a79ada3 100644
--- a/c++/src/H5FaccProp.cpp
+++ b/c++/src/H5FaccProp.cpp
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
using std::cerr;
@@ -80,8 +76,7 @@ FileAccPropList::getConstant()
void
FileAccPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -96,7 +91,9 @@ const FileAccPropList &FileAccPropList::DEFAULT = *getConstant();
///\brief Creates a file access property list
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {}
+FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS)
+{
+}
//--------------------------------------------------------------------------
// Function: FileAccPropList copy constructor
@@ -104,7 +101,9 @@ FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {}
///\param original - IN: FileAccPropList instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileAccPropList::FileAccPropList(const FileAccPropList &original) : PropList(original) {}
+FileAccPropList::FileAccPropList(const FileAccPropList &original) : PropList(original)
+{
+}
//--------------------------------------------------------------------------
// Function: FileAccPropList overloaded constructor
@@ -112,7 +111,9 @@ FileAccPropList::FileAccPropList(const FileAccPropList &original) : PropList(ori
/// existing one.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {}
+FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id)
+{
+}
//--------------------------------------------------------------------------
// Function: FileAccPropList::setStdio
@@ -814,6 +815,8 @@ FileAccPropList::getLibverBounds(H5F_libver_t &libver_low, H5F_libver_t &libver_
///\brief Noop destructor
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileAccPropList::~FileAccPropList() {}
+FileAccPropList::~FileAccPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h
index 998f870..7d998e2 100644
--- a/c++/src/H5FaccProp.h
+++ b/c++/src/H5FaccProp.h
@@ -137,7 +137,7 @@ class H5_DLLCPP FileAccPropList : public PropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("FileAccPropList");
}
@@ -150,7 +150,7 @@ class H5_DLLCPP FileAccPropList : public PropList {
FileAccPropList(const hid_t plist_id);
// Noop destructor
- virtual ~FileAccPropList();
+ virtual ~FileAccPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp
index d3b214b..b51ba10 100644
--- a/c++/src/H5FcreatProp.cpp
+++ b/c++/src/H5FcreatProp.cpp
@@ -68,8 +68,7 @@ FileCreatPropList::getConstant()
void
FileCreatPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -84,7 +83,9 @@ const FileCreatPropList &FileCreatPropList::DEFAULT = *getConstant();
///\brief Default constructor: Creates a file create property list
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {}
+FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE)
+{
+}
//--------------------------------------------------------------------------
// Function: FileCreatPropList copy constructor
@@ -93,7 +94,9 @@ FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {}
///\param original - IN: FileCreatPropList instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList(const FileCreatPropList &original) : PropList(original) {}
+FileCreatPropList::FileCreatPropList(const FileCreatPropList &original) : PropList(original)
+{
+}
//--------------------------------------------------------------------------
// Function: FileCreatPropList overloaded constructor
@@ -102,7 +105,9 @@ FileCreatPropList::FileCreatPropList(const FileCreatPropList &original) : PropLi
///\param plist_id - IN: FileCreatPropList id to use
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
+FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id)
+{
+}
#ifndef H5_NO_DEPRECATED_SYMBOLS
//--------------------------------------------------------------------------
@@ -376,6 +381,8 @@ FileCreatPropList::getFileSpacePagesize() const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::~FileCreatPropList() {}
+FileCreatPropList::~FileCreatPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h
index 00ae0b1..ba0c2e6 100644
--- a/c++/src/H5FcreatProp.h
+++ b/c++/src/H5FcreatProp.h
@@ -78,7 +78,7 @@ class H5_DLLCPP FileCreatPropList : public PropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("FileCreatPropList");
}
@@ -91,7 +91,7 @@ class H5_DLLCPP FileCreatPropList : public PropList {
FileCreatPropList(const hid_t plist_id);
// Noop destructor
- virtual ~FileCreatPropList();
+ virtual ~FileCreatPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index cdc9b45..f92171b 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
#include "H5Include.h"
@@ -49,7 +45,9 @@ using std::endl;
///\brief Default constructor: creates a stub H5File object.
// December 2000
//--------------------------------------------------------------------------
-H5File::H5File() : Group(), id(H5I_INVALID_HID) {}
+H5File::H5File() : Group(), id(H5I_INVALID_HID)
+{
+}
//--------------------------------------------------------------------------
// Function: H5File overloaded constructor
@@ -167,9 +165,8 @@ H5File::p_get_file(const char *name, unsigned int flags, const FileCreatPropList
// constructor is needed by the library in order to return
// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially)
//--------------------------------------------------------------------------
-H5File::H5File(hid_t existing_id) : Group()
+H5File::H5File(hid_t existing_id) : Group(), id{existing_id}
{
- id = existing_id;
incRefCount(); // increment number of references to this id
}
@@ -182,9 +179,8 @@ H5File::H5File(hid_t existing_id) : Group()
///\param original - IN: H5File instance to copy
// December 2000
//--------------------------------------------------------------------------
-H5File::H5File(const H5File &original) : Group()
+H5File::H5File(const H5File &original) : Group(original), id{original.getId()}
{
- id = original.getId();
incRefCount(); // increment number of references to this id
}
diff --git a/c++/src/H5File.h b/c++/src/H5File.h
index d287031..daed073 100644
--- a/c++/src/H5File.h
+++ b/c++/src/H5File.h
@@ -39,7 +39,7 @@ class H5_DLLCPP H5File : public Group {
const FileAccPropList &access_plist = FileAccPropList::DEFAULT);
// Close this file.
- virtual void close();
+ virtual void close() override;
// Gets a copy of the access property list of this file.
FileAccPropList getAccessPlist() const;
@@ -96,16 +96,16 @@ class H5_DLLCPP H5File : public Group {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("H5File");
}
// Throw file exception.
- virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const;
+ virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const override;
// For CommonFG to get the file id.
- virtual hid_t getLocId() const;
+ virtual hid_t getLocId() const override;
// Default constructor
H5File();
@@ -114,15 +114,15 @@ class H5_DLLCPP H5File : public Group {
H5File(const H5File &original);
// Gets the HDF5 file id.
- virtual hid_t getId() const;
+ virtual hid_t getId() const override;
// H5File destructor.
- virtual ~H5File();
+ virtual ~H5File() override;
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Sets the HDF5 file id.
- virtual void p_setId(const hid_t new_id);
+ virtual void p_setId(const hid_t new_id) override;
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp
index 58d18a7..33f8377 100644
--- a/c++/src/H5FloatType.cpp
+++ b/c++/src/H5FloatType.cpp
@@ -40,7 +40,9 @@ namespace H5 {
///\brief Default constructor: Creates a stub floating-point datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::FloatType() {}
+FloatType::FloatType()
+{
+}
//--------------------------------------------------------------------------
// Function: FloatType overloaded constructor
@@ -63,14 +65,18 @@ FloatType::FloatType(const PredType &pred_type) : AtomType()
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::FloatType(const hid_t existing_id) : AtomType(existing_id) {}
+FloatType::FloatType(const hid_t existing_id) : AtomType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: FloatType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::FloatType(const FloatType &original) : AtomType(original) {}
+FloatType::FloatType(const FloatType &original) : AtomType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: FloatType overloaded constructor
@@ -342,6 +348,8 @@ FloatType::setInpad(H5T_pad_t inpad) const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::~FloatType() {}
+FloatType::~FloatType()
+{
+}
} // namespace H5
diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h
index c76be95..387520f 100644
--- a/c++/src/H5FloatType.h
+++ b/c++/src/H5FloatType.h
@@ -36,7 +36,7 @@ class H5_DLLCPP FloatType : public AtomType {
// Returns an FloatType object via DataType* by decoding the
// binary object description of this type.
- virtual DataType *decode() const;
+ virtual DataType *decode() const override;
// Retrieves the exponent bias of a floating-point type.
size_t getEbias() const;
@@ -64,7 +64,7 @@ class H5_DLLCPP FloatType : public AtomType {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("FloatType");
}
@@ -79,7 +79,7 @@ class H5_DLLCPP FloatType : public AtomType {
FloatType(const FloatType &original);
// Noop destructor.
- virtual ~FloatType();
+ virtual ~FloatType() override;
}; // end of FloatType
} // namespace H5
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index 392f31a..fe791da 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
#include "H5Include.h"
@@ -50,7 +46,9 @@ using std::endl;
///\brief Default constructor: creates a stub Group.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {}
+Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID)
+{
+}
//--------------------------------------------------------------------------
// Function: Group copy constructor
diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h
index ae5bb4a..e72d65c 100644
--- a/c++/src/H5Group.h
+++ b/c++/src/H5Group.h
@@ -12,8 +12,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef __Group_H
-#define __Group_H
+#ifndef H5Group_H
+#define H5Group_H
namespace H5 {
@@ -24,20 +24,20 @@ namespace H5 {
class H5_DLLCPP Group : public H5Object, public CommonFG {
public:
// Close this group.
- virtual void close();
+ virtual void close() override;
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("Group");
}
// Throw group exception.
- virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const;
+ virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const override;
// for CommonFG to get the file id.
- virtual hid_t getLocId() const;
+ virtual hid_t getLocId() const override;
// Creates a group by way of dereference.
Group(const H5Location &loc, const void *ref, H5R_type_t ref_type = H5R_OBJECT,
@@ -63,10 +63,10 @@ class H5_DLLCPP Group : public H5Object, public CommonFG {
Group(const Group &original);
// Gets the group id.
- virtual hid_t getId() const;
+ virtual hid_t getId() const override;
// Destructor
- virtual ~Group();
+ virtual ~Group() override;
// Creates a copy of an existing group using its id.
Group(const hid_t group_id);
@@ -74,7 +74,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG {
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Sets the group id.
- virtual void p_setId(const hid_t new_id);
+ virtual void p_setId(const hid_t new_id) override;
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
@@ -83,4 +83,4 @@ class H5_DLLCPP Group : public H5Object, public CommonFG {
}; // end of Group
} // namespace H5
-#endif // __Group_H
+#endif // H5Group_H
diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp
index 29a28c6..e1fc687 100644
--- a/c++/src/H5IdComponent.cpp
+++ b/c++/src/H5IdComponent.cpp
@@ -13,7 +13,6 @@
#include <string>
-#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5Library.h"
@@ -327,7 +326,9 @@ IdComponent::setId(const hid_t new_id)
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IdComponent::~IdComponent() {}
+IdComponent::~IdComponent()
+{
+}
//
// Implementation of protected functions for HDF5 Reference Interface
@@ -397,8 +398,7 @@ IdComponent::p_get_file_name() const
}
// Call H5Fget_name again to get the actual file name
- char *name_C = new char[name_size + 1]; // temporary C-string for C API
- HDmemset(name_C, 0, name_size + 1); // clear buffer
+ char *name_C = new char[name_size + 1]();
name_size = H5Fget_name(temp_id, name_C, name_size + 1);
@@ -432,10 +432,7 @@ IdComponent::p_valid_id(const hid_t obj_id)
return false;
H5I_type_t id_type = H5Iget_type(obj_id);
- if (id_type <= H5I_BADID || id_type >= H5I_NTYPES)
- return false;
- else
- return true;
+ return (id_type > H5I_BADID && id_type < H5I_NTYPES);
}
// Notes about IdComponent::id
diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h
index b756a3d..383d42d 100644
--- a/c++/src/H5IdComponent.h
+++ b/c++/src/H5IdComponent.h
@@ -12,8 +12,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef __IdComponent_H
-#define __IdComponent_H
+#ifndef H5IdComponent_H
+#define H5IdComponent_H
namespace H5 {
@@ -113,4 +113,4 @@ class H5_DLLCPP IdComponent {
}; // end class IdComponent
} // namespace H5
-#endif // __IdComponent_H
+#endif // H5IdComponent_H
diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h
index 1f03150..e662d90 100644
--- a/c++/src/H5Include.h
+++ b/c++/src/H5Include.h
@@ -14,19 +14,6 @@
#include <hdf5.h>
-// Define bool type for platforms that don't support bool yet
-#ifdef BOOL_NOTDEFINED
-#ifdef false
-#undef false
-#endif
-#ifdef true
-#undef true
-#endif
-typedef int bool;
-const bool false = 0;
-const bool true = 1;
-#endif
-
// These are defined in H5Opkg.h, which should not be included in the C++ API,
// so re-define them here for now.
diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp
index da0ea36..27c4491 100644
--- a/c++/src/H5IntType.cpp
+++ b/c++/src/H5IntType.cpp
@@ -40,14 +40,18 @@ namespace H5 {
///\brief Default constructor: Creates a stub integer datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::IntType() {}
+IntType::IntType()
+{
+}
//--------------------------------------------------------------------------
// Function: IntType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::IntType(const IntType &original) : AtomType(original) {}
+IntType::IntType(const IntType &original) : AtomType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: IntType overloaded constructor
@@ -70,7 +74,9 @@ IntType::IntType(const PredType &pred_type) : AtomType()
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::IntType(const hid_t existing_id) : AtomType(existing_id) {}
+IntType::IntType(const hid_t existing_id) : AtomType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: IntType overloaded constructor
@@ -192,6 +198,8 @@ IntType::setSign(H5T_sign_t sign) const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::~IntType() {}
+IntType::~IntType()
+{
+}
} // namespace H5
diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h
index 185c8f0..ec3dd19 100644
--- a/c++/src/H5IntType.h
+++ b/c++/src/H5IntType.h
@@ -36,7 +36,7 @@ class H5_DLLCPP IntType : public AtomType {
// Returns an IntType object via DataType* by decoding the
// binary object description of this type.
- virtual DataType *decode() const;
+ virtual DataType *decode() const override;
// Retrieves the sign type for an integer type
H5T_sign_t getSign() const;
@@ -46,7 +46,7 @@ class H5_DLLCPP IntType : public AtomType {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("IntType");
}
@@ -61,7 +61,7 @@ class H5_DLLCPP IntType : public AtomType {
IntType(const IntType &original);
// Noop destructor.
- virtual ~IntType();
+ virtual ~IntType() override;
}; // end of IntType
} // namespace H5
diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp
index 559c432..acdaa13 100644
--- a/c++/src/H5LaccProp.cpp
+++ b/c++/src/H5LaccProp.cpp
@@ -70,8 +70,7 @@ LinkAccPropList::getConstant()
void
LinkAccPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -86,7 +85,9 @@ const LinkAccPropList &LinkAccPropList::DEFAULT = *getConstant();
///\brief Creates a file access property list
// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
-LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {}
+LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS)
+{
+}
//--------------------------------------------------------------------------
// Function: LinkAccPropList copy constructor
@@ -94,7 +95,9 @@ LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {}
///\param original - IN: LinkAccPropList instance to copy
// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
-LinkAccPropList::LinkAccPropList(const LinkAccPropList &original) : PropList(original) {}
+LinkAccPropList::LinkAccPropList(const LinkAccPropList &original) : PropList(original)
+{
+}
//--------------------------------------------------------------------------
// Function: LinkAccPropList overloaded constructor
@@ -102,7 +105,9 @@ LinkAccPropList::LinkAccPropList(const LinkAccPropList &original) : PropList(ori
/// existing one.
// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
-LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id) {}
+LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id)
+{
+}
//--------------------------------------------------------------------------
// Function: LinkAccPropList::setNumLinks
@@ -148,6 +153,8 @@ LinkAccPropList::getNumLinks() const
///\brief Noop destructor
// Programmer Binh-Minh Ribler - December, 2016
//--------------------------------------------------------------------------
-LinkAccPropList::~LinkAccPropList() {}
+LinkAccPropList::~LinkAccPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h
index 4fa516c..accc7cd 100644
--- a/c++/src/H5LaccProp.h
+++ b/c++/src/H5LaccProp.h
@@ -32,7 +32,7 @@ class H5_DLLCPP LinkAccPropList : public PropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("LinkAccPropList");
}
@@ -52,7 +52,7 @@ class H5_DLLCPP LinkAccPropList : public PropList {
size_t getNumLinks() const;
// Noop destructor
- virtual ~LinkAccPropList();
+ virtual ~LinkAccPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5LcreatProp.cpp b/c++/src/H5LcreatProp.cpp
index 8335071..3851d56 100644
--- a/c++/src/H5LcreatProp.cpp
+++ b/c++/src/H5LcreatProp.cpp
@@ -70,8 +70,7 @@ LinkCreatPropList::getConstant()
void
LinkCreatPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -86,7 +85,9 @@ const LinkCreatPropList &LinkCreatPropList::DEFAULT = *getConstant();
///\brief Creates a file access property list
// December, 2016
//--------------------------------------------------------------------------
-LinkCreatPropList::LinkCreatPropList() : PropList(H5P_LINK_CREATE) {}
+LinkCreatPropList::LinkCreatPropList() : PropList(H5P_LINK_CREATE)
+{
+}
//--------------------------------------------------------------------------
// Function: LinkCreatPropList copy constructor
@@ -94,7 +95,9 @@ LinkCreatPropList::LinkCreatPropList() : PropList(H5P_LINK_CREATE) {}
///\param original - IN: LinkCreatPropList instance to copy
// December, 2016
//--------------------------------------------------------------------------
-LinkCreatPropList::LinkCreatPropList(const LinkCreatPropList &original) : PropList(original) {}
+LinkCreatPropList::LinkCreatPropList(const LinkCreatPropList &original) : PropList(original)
+{
+}
//--------------------------------------------------------------------------
// Function: LinkCreatPropList overloaded constructor
@@ -102,7 +105,9 @@ LinkCreatPropList::LinkCreatPropList(const LinkCreatPropList &original) : PropLi
/// existing one.
// December, 2016
//--------------------------------------------------------------------------
-LinkCreatPropList::LinkCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
+LinkCreatPropList::LinkCreatPropList(const hid_t plist_id) : PropList(plist_id)
+{
+}
//--------------------------------------------------------------------------
// Function: LinkCreatPropList::setCreateIntermediateGroup
@@ -116,7 +121,7 @@ LinkCreatPropList::LinkCreatPropList(const hid_t plist_id) : PropList(plist_id)
void
LinkCreatPropList::setCreateIntermediateGroup(bool crt_intmd_group) const
{
- herr_t ret_value = H5Pset_create_intermediate_group(id, (unsigned)crt_intmd_group);
+ herr_t ret_value = H5Pset_create_intermediate_group(id, static_cast<unsigned>(crt_intmd_group));
// Throw exception if H5Pset_create_intermediate_group returns failure
if (ret_value < 0) {
throw PropListIException("setCreateIntermediateGroup", "H5Pset_create_intermediate_group failed");
@@ -141,7 +146,7 @@ LinkCreatPropList::getCreateIntermediateGroup() const
throw PropListIException("getCreateIntermediateGroup", "H5Pget_create_intermediate_group failed");
}
- return ((bool)crt_intmd_group);
+ return static_cast<bool>(crt_intmd_group);
}
//--------------------------------------------------------------------------
@@ -185,6 +190,8 @@ LinkCreatPropList::getCharEncoding() const
///\brief Noop destructor
// December, 2016
//--------------------------------------------------------------------------
-LinkCreatPropList::~LinkCreatPropList() {}
+LinkCreatPropList::~LinkCreatPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5LcreatProp.h b/c++/src/H5LcreatProp.h
index aea38e7..5570dbc 100644
--- a/c++/src/H5LcreatProp.h
+++ b/c++/src/H5LcreatProp.h
@@ -32,7 +32,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("LinkCreatPropList");
}
@@ -59,7 +59,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList {
H5T_cset_t getCharEncoding() const;
// Noop destructor
- virtual ~LinkCreatPropList();
+ virtual ~LinkCreatPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp
index de15f19..37516be 100644
--- a/c++/src/H5Library.cpp
+++ b/c++/src/H5Library.cpp
@@ -281,14 +281,18 @@ H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, int arr_globa
///\brief Default constructor: Creates a stub H5Library object
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5Library::H5Library() {}
+H5Library::H5Library()
+{
+}
//--------------------------------------------------------------------------
// Function: H5Library destructor
///\brief Noop destructor
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5Library::~H5Library() {}
+H5Library::~H5Library()
+{
+}
#endif // DOXYGEN_SHOULD_SKIP_THIS
} // namespace H5
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp
index 2d14bfc..eb8dd4c 100644
--- a/c++/src/H5Location.cpp
+++ b/c++/src/H5Location.cpp
@@ -15,7 +15,6 @@
#include <iostream>
using namespace std;
-#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -45,7 +44,9 @@ namespace H5 {
// Function: H5Location default constructor (protected)
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5Location::H5Location() : IdComponent() {}
+H5Location::H5Location() : IdComponent()
+{
+}
//--------------------------------------------------------------------------
// Function: H5Location overloaded constructor (protected)
@@ -346,10 +347,10 @@ H5Location::getComment(const char *name, size_t buf_size) const
{
// Initialize string to "", so that if there is no comment, the returned
// string will be empty
- H5std_string comment("");
+ H5std_string comment;
// Preliminary call to get the comment's length
- ssize_t comment_len = H5Oget_comment_by_name(getId(), name, NULL, (size_t)0, H5P_DEFAULT);
+ ssize_t comment_len = H5Oget_comment_by_name(getId(), name, NULL, 0, H5P_DEFAULT);
// If H5Oget_comment_by_name returns a negative value, raise an exception
if (comment_len < 0) {
@@ -365,8 +366,7 @@ H5Location::getComment(const char *name, size_t buf_size) const
tmp_len = comment_len;
// Temporary buffer for char* comment
- char *comment_C = new char[tmp_len + 1];
- HDmemset(comment_C, 0, tmp_len + 1); // clear buffer
+ char *comment_C = new char[tmp_len + 1]();
// Used overloaded function
ssize_t temp_len = getComment(name, tmp_len + 1, comment_C);
@@ -398,6 +398,7 @@ H5Location::getComment(const H5std_string &name, size_t buf_size) const
{
return (getComment(name.c_str(), buf_size));
}
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
@@ -646,6 +647,7 @@ H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const
return (obj_type);
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
+
#endif /* H5_NO_DEPRECATED_SYMBOLS */
//--------------------------------------------------------------------------
@@ -704,6 +706,7 @@ H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const
}
return (obj_type);
}
+#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
// Function: H5Location::getRegion
@@ -1816,7 +1819,7 @@ H5Location::getLinkval(const char *name, size_t size) const
H5L_info2_t linkinfo;
char * value_C; // value in C string
size_t val_size = size;
- H5std_string value = "";
+ H5std_string value;
herr_t ret_value;
// if user doesn't provide buffer size, determine it
@@ -1830,8 +1833,8 @@ H5Location::getLinkval(const char *name, size_t size) const
// if link has value, retrieve the value, otherwise, return null string
if (val_size > 0) {
- value_C = new char[val_size + 1]; // temporary C-string for C API
- HDmemset(value_C, 0, val_size + 1); // clear buffer
+ // Create buffer for C string
+ value_C = new char[val_size + 1]();
ret_value = H5Lget_val(getId(), name, value_C, val_size, H5P_DEFAULT);
if (ret_value < 0) {
@@ -2041,9 +2044,8 @@ H5Location::getObjnameByIdx(hsize_t idx) const
if (name_len < 0)
throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
- // now, allocate C buffer to get the name
- char *name_C = new char[name_len + 1];
- HDmemset(name_C, 0, name_len + 1); // clear buffer
+ // Create buffer for C string
+ char *name_C = new char[name_len + 1]();
name_len =
H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name_C, name_len + 1, H5P_DEFAULT);
@@ -2097,8 +2099,8 @@ H5Location::getObjnameByIdx(hsize_t idx, char *name, size_t size) const
ssize_t
H5Location::getObjnameByIdx(hsize_t idx, H5std_string &name, size_t size) const
{
- char *name_C = new char[size + 1]; // temporary C-string for object name
- HDmemset(name_C, 0, size + 1); // clear buffer
+ // Create buffer for C string
+ char *name_C = new char[size + 1]();
// call overloaded function to get the name
ssize_t name_len = getObjnameByIdx(idx, name_C, size + 1);
@@ -2294,7 +2296,6 @@ H5Location::childObjVersion(const H5std_string &objname) const
}
#ifndef H5_NO_DEPRECATED_SYMBOLS
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
// Function: H5Location::getObjTypeByIdx
///\brief Returns the type of an object in this group, given the
@@ -2372,7 +2373,6 @@ H5Location::getObjTypeByIdx(hsize_t idx, H5std_string &type_name) const
return (obj_type);
}
-#endif // DOXYGEN_SHOULD_SKIP_THIS
#endif /* H5_NO_DEPRECATED_SYMBOLS */
//--------------------------------------------------------------------------
@@ -2431,8 +2431,8 @@ f_DataSpace_setId(DataSpace *dspace, hid_t new_id)
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5Location::~H5Location() {}
-
-#endif // DOXYGEN_SHOULD_SKIP_THIS
+H5Location::~H5Location()
+{
+}
} // namespace H5
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index 725d1da..cb803af 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -13,7 +13,6 @@
#include <string>
-#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -45,9 +44,12 @@ namespace H5 {
extern "C" {
static herr_t
-userAttrOpWrpr(H5_ATTR_UNUSED hid_t loc_id, const char *attr_name, H5_ATTR_UNUSED const H5A_info_t *ainfo,
- void *op_data)
+userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data)
{
+ // Unused
+ (void)loc_id;
+ (void)ainfo;
+
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Aiterate *myData = reinterpret_cast<UserData4Aiterate *>(op_data);
myData->op(*myData->location, s_attr_name, myData->opData);
@@ -57,9 +59,11 @@ userAttrOpWrpr(H5_ATTR_UNUSED hid_t loc_id, const char *attr_name, H5_ATTR_UNUSE
// userVisitOpWrpr interfaces between the user's function and the
// C library function H5Ovisit3
static herr_t
-userVisitOpWrpr(H5_ATTR_UNUSED hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info,
- void *op_data)
+userVisitOpWrpr(hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info, void *op_data)
{
+ // Unused
+ (void)obj_id;
+
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Visit *myData = reinterpret_cast<UserData4Visit *>(op_data);
int status = myData->op(*myData->obj, s_attr_name, obj_info, myData->opData);
@@ -72,7 +76,9 @@ userVisitOpWrpr(H5_ATTR_UNUSED hid_t obj_id, const char *attr_name, const H5O_in
// Function: H5Object default constructor (protected)
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5Object::H5Object() : H5Location() {}
+H5Object::H5Object() : H5Location()
+{
+}
//--------------------------------------------------------------------------
// Function: f_Attribute_setId - friend
@@ -477,10 +483,10 @@ H5Object::getObjName(char *obj_name, size_t buf_size) const
H5std_string
H5Object::getObjName() const
{
- H5std_string obj_name(""); // object name to return
+ H5std_string obj_name; // object name to return
// Preliminary call to get the size of the object name
- ssize_t name_size = H5Iget_name(getId(), NULL, static_cast<size_t>(0));
+ ssize_t name_size = H5Iget_name(getId(), NULL, 0);
// If H5Iget_name failed, throw exception
if (name_size < 0) {
@@ -491,8 +497,8 @@ H5Object::getObjName() const
}
// Object's name exists, retrieve it
else if (name_size > 0) {
- char *name_C = new char[name_size + 1]; // temporary C-string
- HDmemset(name_C, 0, name_size + 1); // clear buffer
+ // Create buffer for C string
+ char *name_C = new char[name_size + 1]();
// Use overloaded function
name_size = getObjName(name_C, name_size + 1);
@@ -532,8 +538,8 @@ H5Object::getObjName(H5std_string &obj_name, size_t len) const
}
// If length is provided, get that number of characters in name
else {
- char *name_C = new char[len + 1]; // temporary C-string
- HDmemset(name_C, 0, len + 1); // clear buffer
+ // Create buffer for C string
+ char *name_C = new char[len + 1]();
// Use overloaded function
name_size = getObjName(name_C, len + 1);
@@ -556,7 +562,9 @@ H5Object::getObjName(H5std_string &obj_name, size_t len) const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5Object::~H5Object() {}
+H5Object::~H5Object()
+{
+}
#endif // DOXYGEN_SHOULD_SKIP_THIS
} // namespace H5
diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h
index 868f63f..9e5a541 100644
--- a/c++/src/H5Object.h
+++ b/c++/src/H5Object.h
@@ -106,7 +106,7 @@ class H5_DLLCPP H5Object : public H5Location {
void removeAttr(const H5std_string &name) const;
// Returns an identifier.
- virtual hid_t getId() const = 0;
+ virtual hid_t getId() const override = 0;
// Gets the name of this HDF5 object, i.e., Group, DataSet, or
// DataType.
@@ -122,10 +122,10 @@ class H5_DLLCPP H5Object : public H5Location {
// Sets the identifier of this object to a new value. - this one
// doesn't increment reference count
- virtual void p_setId(const hid_t new_id) = 0;
+ virtual void p_setId(const hid_t new_id) override = 0;
// Noop destructor.
- virtual ~H5Object();
+ virtual ~H5Object() override;
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp
index 70023c4..dffdeb1 100644
--- a/c++/src/H5OcreatProp.cpp
+++ b/c++/src/H5OcreatProp.cpp
@@ -70,8 +70,7 @@ ObjCreatPropList::getConstant()
void
ObjCreatPropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -86,7 +85,9 @@ const ObjCreatPropList &ObjCreatPropList::DEFAULT = *getConstant();
///\brief Creates a file access property list
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {}
+ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE)
+{
+}
//--------------------------------------------------------------------------
// Function: ObjCreatPropList copy constructor
@@ -94,7 +95,9 @@ ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {}
///\param original - IN: ObjCreatPropList instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-ObjCreatPropList::ObjCreatPropList(const ObjCreatPropList &original) : PropList(original) {}
+ObjCreatPropList::ObjCreatPropList(const ObjCreatPropList &original) : PropList(original)
+{
+}
//--------------------------------------------------------------------------
// Function: ObjCreatPropList overloaded constructor
@@ -102,7 +105,9 @@ ObjCreatPropList::ObjCreatPropList(const ObjCreatPropList &original) : PropList(
/// existing one.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
+ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id)
+{
+}
//--------------------------------------------------------------------------
// Function: ObjCreatPropList::setAttrPhaseChange
@@ -209,6 +214,8 @@ ObjCreatPropList::getAttrCrtOrder() const
///\brief Noop destructor
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-ObjCreatPropList::~ObjCreatPropList() {}
+ObjCreatPropList::~ObjCreatPropList()
+{
+}
} // namespace H5
diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h
index 7f6d411..5e2bf49 100644
--- a/c++/src/H5OcreatProp.h
+++ b/c++/src/H5OcreatProp.h
@@ -44,7 +44,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("ObjCreatPropList");
}
@@ -57,7 +57,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList {
ObjCreatPropList(const hid_t plist_id);
// Noop destructor
- virtual ~ObjCreatPropList();
+ virtual ~ObjCreatPropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp
index b58569f..72d560d 100644
--- a/c++/src/H5PredType.cpp
+++ b/c++/src/H5PredType.cpp
@@ -27,7 +27,6 @@
#include "H5DataType.h"
#include "H5AtomType.h"
#include "H5PredType.h"
-#include "H5private.h"
namespace H5 {
@@ -42,14 +41,19 @@ namespace H5 {
// the provided HDF5 predefined datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id) { id = H5Tcopy(predtype_id); }
+PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id)
+{
+ id = H5Tcopy(predtype_id);
+}
//--------------------------------------------------------------------------
// Function: PredType default constructor
///\brief Default constructor: Creates a stub predefined datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PredType::PredType() : AtomType() {}
+PredType::PredType() : AtomType()
+{
+}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
@@ -58,7 +62,9 @@ PredType::PredType() : AtomType() {}
///\param original - IN: PredType instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PredType::PredType(const PredType &original) : AtomType(original) {}
+PredType::PredType(const PredType &original) : AtomType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: PredType::operator=
@@ -83,8 +89,12 @@ PredType::operator=(const PredType &rhs)
// These dummy functions do not inherit from DataType - they'll
// throw an DataTypeIException if invoked.
void
-PredType::commit(H5_ATTR_UNUSED H5Location &loc, H5_ATTR_UNUSED const char *name)
+PredType::commit(H5Location &loc, const char *name)
{
+ // Unused
+ (void)loc;
+ (void)name;
+
throw DataTypeIException("PredType::commit",
"Error: Attempted to commit a predefined datatype. Invalid operation!");
}
@@ -109,7 +119,9 @@ PredType::committed()
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PredType::~PredType() {}
+PredType::~PredType()
+{
+}
/*****************************************************************************
The following section is regarding the global constants PredType,
@@ -237,63 +249,32 @@ PredType *PredType::NATIVE_INT32_;
PredType *PredType::NATIVE_UINT32_;
PredType *PredType::NATIVE_INT64_;
PredType *PredType::NATIVE_UINT64_;
+
// LEAST types
-#if H5_SIZEOF_INT_LEAST8_T != 0
PredType *PredType::NATIVE_INT_LEAST8_;
-#endif /* H5_SIZEOF_INT_LEAST8_T */
-#if H5_SIZEOF_UINT_LEAST8_T != 0
PredType *PredType::NATIVE_UINT_LEAST8_;
-#endif /* H5_SIZEOF_UINT_LEAST8_T */
-#if H5_SIZEOF_INT_LEAST16_T != 0
PredType *PredType::NATIVE_INT_LEAST16_;
-#endif /* H5_SIZEOF_INT_LEAST16_T */
-#if H5_SIZEOF_UINT_LEAST16_T != 0
PredType *PredType::NATIVE_UINT_LEAST16_;
-#endif /* H5_SIZEOF_UINT_LEAST16_T */
-#if H5_SIZEOF_INT_LEAST32_T != 0
PredType *PredType::NATIVE_INT_LEAST32_;
-#endif /* H5_SIZEOF_INT_LEAST32_T */
-#if H5_SIZEOF_UINT_LEAST32_T != 0
PredType *PredType::NATIVE_UINT_LEAST32_;
-#endif /* H5_SIZEOF_UINT_LEAST32_T */
-#if H5_SIZEOF_INT_LEAST64_T != 0
PredType *PredType::NATIVE_INT_LEAST64_;
-#endif /* H5_SIZEOF_INT_LEAST64_T */
-#if H5_SIZEOF_UINT_LEAST64_T != 0
PredType *PredType::NATIVE_UINT_LEAST64_;
-#endif /* H5_SIZEOF_UINT_LEAST64_T */
// FAST types
-#if H5_SIZEOF_INT_FAST8_T != 0
PredType *PredType::NATIVE_INT_FAST8_;
-#endif /* H5_SIZEOF_INT_FAST8_T */
-#if H5_SIZEOF_UINT_FAST8_T != 0
PredType *PredType::NATIVE_UINT_FAST8_;
-#endif /* H5_SIZEOF_UINT_FAST8_T */
-#if H5_SIZEOF_INT_FAST16_T != 0
PredType *PredType::NATIVE_INT_FAST16_;
-#endif /* H5_SIZEOF_INT_FAST16_T */
-#if H5_SIZEOF_UINT_FAST16_T != 0
PredType *PredType::NATIVE_UINT_FAST16_;
-#endif /* H5_SIZEOF_UINT_FAST16_T */
-#if H5_SIZEOF_INT_FAST32_T != 0
PredType *PredType::NATIVE_INT_FAST32_;
-#endif /* H5_SIZEOF_INT_FAST32_T */
-#if H5_SIZEOF_UINT_FAST32_T != 0
PredType *PredType::NATIVE_UINT_FAST32_;
-#endif /* H5_SIZEOF_UINT_FAST32_T */
-#if H5_SIZEOF_INT_FAST64_T != 0
PredType *PredType::NATIVE_INT_FAST64_;
-#endif /* H5_SIZEOF_INT_FAST64_T */
-#if H5_SIZEOF_UINT_FAST64_T != 0
PredType *PredType::NATIVE_UINT_FAST64_;
-#endif /* H5_SIZEOF_UINT_FAST64_T */
//--------------------------------------------------------------------------
// Function: PredType::getPredTypes
@@ -460,63 +441,31 @@ PredType::makePredTypes()
NATIVE_INT64_ = new PredType(H5T_NATIVE_INT64);
NATIVE_UINT64_ = new PredType(H5T_NATIVE_UINT64);
-// LEAST types
-#if H5_SIZEOF_INT_LEAST8_T != 0
- NATIVE_INT_LEAST8_ = new PredType(H5T_NATIVE_INT_LEAST8);
-#endif /* H5_SIZEOF_INT_LEAST8_T */
-#if H5_SIZEOF_UINT_LEAST8_T != 0
+ // LEAST types
+ NATIVE_INT_LEAST8_ = new PredType(H5T_NATIVE_INT_LEAST8);
NATIVE_UINT_LEAST8_ = new PredType(H5T_NATIVE_UINT_LEAST8);
-#endif /* H5_SIZEOF_UINT_LEAST8_T */
-#if H5_SIZEOF_INT_LEAST16_T != 0
- NATIVE_INT_LEAST16_ = new PredType(H5T_NATIVE_INT_LEAST16);
-#endif /* H5_SIZEOF_INT_LEAST16_T */
-#if H5_SIZEOF_UINT_LEAST16_T != 0
+ NATIVE_INT_LEAST16_ = new PredType(H5T_NATIVE_INT_LEAST16);
NATIVE_UINT_LEAST16_ = new PredType(H5T_NATIVE_UINT_LEAST16);
-#endif /* H5_SIZEOF_UINT_LEAST16_T */
-#if H5_SIZEOF_INT_LEAST32_T != 0
- NATIVE_INT_LEAST32_ = new PredType(H5T_NATIVE_INT_LEAST32);
-#endif /* H5_SIZEOF_INT_LEAST32_T */
-#if H5_SIZEOF_UINT_LEAST32_T != 0
+ NATIVE_INT_LEAST32_ = new PredType(H5T_NATIVE_INT_LEAST32);
NATIVE_UINT_LEAST32_ = new PredType(H5T_NATIVE_UINT_LEAST32);
-#endif /* H5_SIZEOF_UINT_LEAST32_T */
-#if H5_SIZEOF_INT_LEAST64_T != 0
- NATIVE_INT_LEAST64_ = new PredType(H5T_NATIVE_INT_LEAST64);
-#endif /* H5_SIZEOF_INT_LEAST64_T */
-#if H5_SIZEOF_UINT_LEAST64_T != 0
+ NATIVE_INT_LEAST64_ = new PredType(H5T_NATIVE_INT_LEAST64);
NATIVE_UINT_LEAST64_ = new PredType(H5T_NATIVE_UINT_LEAST64);
-#endif /* H5_SIZEOF_UINT_LEAST64_T */
-// FAST types
-#if H5_SIZEOF_INT_FAST8_T != 0
- NATIVE_INT_FAST8_ = new PredType(H5T_NATIVE_INT_FAST8);
-#endif /* H5_SIZEOF_INT_FAST8_T */
-#if H5_SIZEOF_UINT_FAST8_T != 0
+ // FAST types
+ NATIVE_INT_FAST8_ = new PredType(H5T_NATIVE_INT_FAST8);
NATIVE_UINT_FAST8_ = new PredType(H5T_NATIVE_UINT_FAST8);
-#endif /* H5_SIZEOF_UINT_FAST8_T */
-#if H5_SIZEOF_INT_FAST16_T != 0
- NATIVE_INT_FAST16_ = new PredType(H5T_NATIVE_INT_FAST16);
-#endif /* H5_SIZEOF_INT_FAST16_T */
-#if H5_SIZEOF_UINT_FAST16_T != 0
+ NATIVE_INT_FAST16_ = new PredType(H5T_NATIVE_INT_FAST16);
NATIVE_UINT_FAST16_ = new PredType(H5T_NATIVE_UINT_FAST16);
-#endif /* H5_SIZEOF_UINT_FAST16_T */
-#if H5_SIZEOF_INT_FAST32_T != 0
- NATIVE_INT_FAST32_ = new PredType(H5T_NATIVE_INT_FAST32);
-#endif /* H5_SIZEOF_INT_FAST32_T */
-#if H5_SIZEOF_UINT_FAST32_T != 0
+ NATIVE_INT_FAST32_ = new PredType(H5T_NATIVE_INT_FAST32);
NATIVE_UINT_FAST32_ = new PredType(H5T_NATIVE_UINT_FAST32);
-#endif /* H5_SIZEOF_UINT_FAST32_T */
-#if H5_SIZEOF_INT_FAST64_T != 0
- NATIVE_INT_FAST64_ = new PredType(H5T_NATIVE_INT_FAST64);
-#endif /* H5_SIZEOF_INT_FAST64_T */
-#if H5_SIZEOF_UINT_FAST64_T != 0
+ NATIVE_INT_FAST64_ = new PredType(H5T_NATIVE_INT_FAST64);
NATIVE_UINT_FAST64_ = new PredType(H5T_NATIVE_UINT_FAST64);
-#endif /* H5_SIZEOF_UINT_FAST64_T */
} // makePredTypes
@@ -646,63 +595,31 @@ PredType::deleteConstants()
delete NATIVE_INT64_;
delete NATIVE_UINT64_;
-// LEAST types
-#if H5_SIZEOF_INT_LEAST8_T != 0
+ // LEAST types
delete NATIVE_INT_LEAST8_;
-#endif /* H5_SIZEOF_INT_LEAST8_T */
-#if H5_SIZEOF_UINT_LEAST8_T != 0
delete NATIVE_UINT_LEAST8_;
-#endif /* H5_SIZEOF_UINT_LEAST8_T */
-#if H5_SIZEOF_INT_LEAST16_T != 0
delete NATIVE_INT_LEAST16_;
-#endif /* H5_SIZEOF_INT_LEAST16_T */
-#if H5_SIZEOF_UINT_LEAST16_T != 0
delete NATIVE_UINT_LEAST16_;
-#endif /* H5_SIZEOF_UINT_LEAST16_T */
-#if H5_SIZEOF_INT_LEAST32_T != 0
delete NATIVE_INT_LEAST32_;
-#endif /* H5_SIZEOF_INT_LEAST32_T */
-#if H5_SIZEOF_UINT_LEAST32_T != 0
delete NATIVE_UINT_LEAST32_;
-#endif /* H5_SIZEOF_UINT_LEAST32_T */
-#if H5_SIZEOF_INT_LEAST64_T != 0
delete NATIVE_INT_LEAST64_;
-#endif /* H5_SIZEOF_INT_LEAST64_T */
-#if H5_SIZEOF_UINT_LEAST64_T != 0
delete NATIVE_UINT_LEAST64_;
-#endif /* H5_SIZEOF_UINT_LEAST64_T */
-// FAST types
-#if H5_SIZEOF_INT_FAST8_T != 0
+ // FAST types
delete NATIVE_INT_FAST8_;
-#endif /* H5_SIZEOF_INT_FAST8_T */
-#if H5_SIZEOF_UINT_FAST8_T != 0
delete NATIVE_UINT_FAST8_;
-#endif /* H5_SIZEOF_UINT_FAST8_T */
-#if H5_SIZEOF_INT_FAST16_T != 0
delete NATIVE_INT_FAST16_;
-#endif /* H5_SIZEOF_INT_FAST16_T */
-#if H5_SIZEOF_UINT_FAST16_T != 0
delete NATIVE_UINT_FAST16_;
-#endif /* H5_SIZEOF_UINT_FAST16_T */
-#if H5_SIZEOF_INT_FAST32_T != 0
delete NATIVE_INT_FAST32_;
-#endif /* H5_SIZEOF_INT_FAST32_T */
-#if H5_SIZEOF_UINT_FAST32_T != 0
delete NATIVE_UINT_FAST32_;
-#endif /* H5_SIZEOF_UINT_FAST32_T */
-#if H5_SIZEOF_INT_FAST64_T != 0
delete NATIVE_INT_FAST64_;
-#endif /* H5_SIZEOF_INT_FAST64_T */
-#if H5_SIZEOF_UINT_FAST64_T != 0
delete NATIVE_UINT_FAST64_;
-#endif /* H5_SIZEOF_UINT_FAST64_T */
delete PREDTYPE_CONST_;
PREDTYPE_CONST_ = 0;
@@ -836,62 +753,30 @@ const PredType &PredType::NATIVE_INT64 = *NATIVE_INT64_;
const PredType &PredType::NATIVE_UINT64 = *NATIVE_UINT64_;
// LEAST types
-#if H5_SIZEOF_INT_LEAST8_T != 0
-const PredType &PredType::NATIVE_INT_LEAST8 = *NATIVE_INT_LEAST8_;
-#endif /* H5_SIZEOF_INT_LEAST8_T */
-#if H5_SIZEOF_UINT_LEAST8_T != 0
+const PredType &PredType::NATIVE_INT_LEAST8 = *NATIVE_INT_LEAST8_;
const PredType &PredType::NATIVE_UINT_LEAST8 = *NATIVE_UINT_LEAST8_;
-#endif /* H5_SIZEOF_UINT_LEAST8_T */
-#if H5_SIZEOF_INT_LEAST16_T != 0
-const PredType &PredType::NATIVE_INT_LEAST16 = *NATIVE_INT_LEAST16_;
-#endif /* H5_SIZEOF_INT_LEAST16_T */
-#if H5_SIZEOF_UINT_LEAST16_T != 0
+const PredType &PredType::NATIVE_INT_LEAST16 = *NATIVE_INT_LEAST16_;
const PredType &PredType::NATIVE_UINT_LEAST16 = *NATIVE_UINT_LEAST16_;
-#endif /* H5_SIZEOF_UINT_LEAST16_T */
-#if H5_SIZEOF_INT_LEAST32_T != 0
-const PredType &PredType::NATIVE_INT_LEAST32 = *NATIVE_INT_LEAST32_;
-#endif /* H5_SIZEOF_INT_LEAST32_T */
-#if H5_SIZEOF_UINT_LEAST32_T != 0
+const PredType &PredType::NATIVE_INT_LEAST32 = *NATIVE_INT_LEAST32_;
const PredType &PredType::NATIVE_UINT_LEAST32 = *NATIVE_UINT_LEAST32_;
-#endif /* H5_SIZEOF_UINT_LEAST32_T */
-#if H5_SIZEOF_INT_LEAST64_T != 0
-const PredType &PredType::NATIVE_INT_LEAST64 = *NATIVE_INT_LEAST64_;
-#endif /* H5_SIZEOF_INT_LEAST64_T */
-#if H5_SIZEOF_UINT_LEAST64_T != 0
+const PredType &PredType::NATIVE_INT_LEAST64 = *NATIVE_INT_LEAST64_;
const PredType &PredType::NATIVE_UINT_LEAST64 = *NATIVE_UINT_LEAST64_;
-#endif /* H5_SIZEOF_UINT_LEAST64_T */
// FAST types
-#if H5_SIZEOF_INT_FAST8_T != 0
-const PredType &PredType::NATIVE_INT_FAST8 = *NATIVE_INT_FAST8_;
-#endif /* H5_SIZEOF_INT_FAST8_T */
-#if H5_SIZEOF_UINT_FAST8_T != 0
+const PredType &PredType::NATIVE_INT_FAST8 = *NATIVE_INT_FAST8_;
const PredType &PredType::NATIVE_UINT_FAST8 = *NATIVE_UINT_FAST8_;
-#endif /* H5_SIZEOF_UINT_FAST8_T */
-#if H5_SIZEOF_INT_FAST16_T != 0
-const PredType &PredType::NATIVE_INT_FAST16 = *NATIVE_INT_FAST16_;
-#endif /* H5_SIZEOF_INT_FAST16_T */
-#if H5_SIZEOF_UINT_FAST16_T != 0
+const PredType &PredType::NATIVE_INT_FAST16 = *NATIVE_INT_FAST16_;
const PredType &PredType::NATIVE_UINT_FAST16 = *NATIVE_UINT_FAST16_;
-#endif /* H5_SIZEOF_UINT_FAST16_T */
-#if H5_SIZEOF_INT_FAST32_T != 0
-const PredType &PredType::NATIVE_INT_FAST32 = *NATIVE_INT_FAST32_;
-#endif /* H5_SIZEOF_INT_FAST32_T */
-#if H5_SIZEOF_UINT_FAST32_T != 0
+const PredType &PredType::NATIVE_INT_FAST32 = *NATIVE_INT_FAST32_;
const PredType &PredType::NATIVE_UINT_FAST32 = *NATIVE_UINT_FAST32_;
-#endif /* H5_SIZEOF_UINT_FAST32_T */
-#if H5_SIZEOF_INT_FAST64_T != 0
-const PredType &PredType::NATIVE_INT_FAST64 = *NATIVE_INT_FAST64_;
-#endif /* H5_SIZEOF_INT_FAST64_T */
-#if H5_SIZEOF_UINT_FAST64_T != 0
+const PredType &PredType::NATIVE_INT_FAST64 = *NATIVE_INT_FAST64_;
const PredType &PredType::NATIVE_UINT_FAST64 = *NATIVE_UINT_FAST64_;
-#endif /* H5_SIZEOF_UINT_FAST64_T */
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h
index b40d2b3..45f20ab 100644
--- a/c++/src/H5PredType.h
+++ b/c++/src/H5PredType.h
@@ -29,7 +29,7 @@ class H5_DLLCPP PredType : public AtomType {
public:
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("PredType");
}
@@ -42,7 +42,7 @@ class H5_DLLCPP PredType : public AtomType {
PredType(const PredType &original);
// Noop destructor
- virtual ~PredType();
+ virtual ~PredType() override;
/*! \brief This dummy function do not inherit from DataType - it will
throw a DataTypeIException if invoked.
@@ -176,63 +176,31 @@ class H5_DLLCPP PredType : public AtomType {
static const PredType &NATIVE_INT64;
static const PredType &NATIVE_UINT64;
-// LEAST types
-#if H5_SIZEOF_INT_LEAST8_T != 0
+ // LEAST types
static const PredType &NATIVE_INT_LEAST8;
-#endif /* H5_SIZEOF_INT_LEAST8_T */
-#if H5_SIZEOF_UINT_LEAST8_T != 0
static const PredType &NATIVE_UINT_LEAST8;
-#endif /* H5_SIZEOF_UINT_LEAST8_T */
-#if H5_SIZEOF_INT_LEAST16_T != 0
static const PredType &NATIVE_INT_LEAST16;
-#endif /* H5_SIZEOF_INT_LEAST16_T */
-#if H5_SIZEOF_UINT_LEAST16_T != 0
static const PredType &NATIVE_UINT_LEAST16;
-#endif /* H5_SIZEOF_UINT_LEAST16_T */
-#if H5_SIZEOF_INT_LEAST32_T != 0
static const PredType &NATIVE_INT_LEAST32;
-#endif /* H5_SIZEOF_INT_LEAST32_T */
-#if H5_SIZEOF_UINT_LEAST32_T != 0
static const PredType &NATIVE_UINT_LEAST32;
-#endif /* H5_SIZEOF_UINT_LEAST32_T */
-#if H5_SIZEOF_INT_LEAST64_T != 0
static const PredType &NATIVE_INT_LEAST64;
-#endif /* H5_SIZEOF_INT_LEAST64_T */
-#if H5_SIZEOF_UINT_LEAST64_T != 0
static const PredType &NATIVE_UINT_LEAST64;
-#endif /* H5_SIZEOF_UINT_LEAST64_T */
-// FAST types
-#if H5_SIZEOF_INT_FAST8_T != 0
+ // FAST types
static const PredType &NATIVE_INT_FAST8;
-#endif /* H5_SIZEOF_INT_FAST8_T */
-#if H5_SIZEOF_UINT_FAST8_T != 0
static const PredType &NATIVE_UINT_FAST8;
-#endif /* H5_SIZEOF_UINT_FAST8_T */
-#if H5_SIZEOF_INT_FAST16_T != 0
static const PredType &NATIVE_INT_FAST16;
-#endif /* H5_SIZEOF_INT_FAST16_T */
-#if H5_SIZEOF_UINT_FAST16_T != 0
static const PredType &NATIVE_UINT_FAST16;
-#endif /* H5_SIZEOF_UINT_FAST16_T */
-#if H5_SIZEOF_INT_FAST32_T != 0
static const PredType &NATIVE_INT_FAST32;
-#endif /* H5_SIZEOF_INT_FAST32_T */
-#if H5_SIZEOF_UINT_FAST32_T != 0
static const PredType &NATIVE_UINT_FAST32;
-#endif /* H5_SIZEOF_UINT_FAST32_T */
-#if H5_SIZEOF_INT_FAST64_T != 0
static const PredType &NATIVE_INT_FAST64;
-#endif /* H5_SIZEOF_INT_FAST64_T */
-#if H5_SIZEOF_UINT_FAST64_T != 0
static const PredType &NATIVE_UINT_FAST64;
-#endif /* H5_SIZEOF_UINT_FAST64_T */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -378,64 +346,31 @@ class H5_DLLCPP PredType : public AtomType {
static PredType *NATIVE_INT64_;
static PredType *NATIVE_UINT64_;
-// LEAST types
-#if H5_SIZEOF_INT_LEAST8_T != 0
+ // LEAST types
static PredType *NATIVE_INT_LEAST8_;
-#endif /* H5_SIZEOF_INT_LEAST8_T */
-#if H5_SIZEOF_UINT_LEAST8_T != 0
static PredType *NATIVE_UINT_LEAST8_;
-#endif /* H5_SIZEOF_UINT_LEAST8_T */
-#if H5_SIZEOF_INT_LEAST16_T != 0
static PredType *NATIVE_INT_LEAST16_;
-#endif /* H5_SIZEOF_INT_LEAST16_T */
-#if H5_SIZEOF_UINT_LEAST16_T != 0
static PredType *NATIVE_UINT_LEAST16_;
-#endif /* H5_SIZEOF_UINT_LEAST16_T */
-#if H5_SIZEOF_INT_LEAST32_T != 0
static PredType *NATIVE_INT_LEAST32_;
-#endif /* H5_SIZEOF_INT_LEAST32_T */
-#if H5_SIZEOF_UINT_LEAST32_T != 0
static PredType *NATIVE_UINT_LEAST32_;
-#endif /* H5_SIZEOF_UINT_LEAST32_T */
-#if H5_SIZEOF_INT_LEAST64_T != 0
static PredType *NATIVE_INT_LEAST64_;
-#endif /* H5_SIZEOF_INT_LEAST64_T */
-#if H5_SIZEOF_UINT_LEAST64_T != 0
static PredType *NATIVE_UINT_LEAST64_;
-#endif /* H5_SIZEOF_UINT_LEAST64_T */
-// FAST types
-#if H5_SIZEOF_INT_FAST8_T != 0
+ // FAST types
static PredType *NATIVE_INT_FAST8_;
-#endif /* H5_SIZEOF_INT_FAST8_T */
-#if H5_SIZEOF_UINT_FAST8_T != 0
static PredType *NATIVE_UINT_FAST8_;
-#endif /* H5_SIZEOF_UINT_FAST8_T */
-#if H5_SIZEOF_INT_FAST16_T != 0
static PredType *NATIVE_INT_FAST16_;
-#endif /* H5_SIZEOF_INT_FAST16_T */
-#if H5_SIZEOF_UINT_FAST16_T != 0
static PredType *NATIVE_UINT_FAST16_;
-#endif /* H5_SIZEOF_UINT_FAST16_T */
-#if H5_SIZEOF_INT_FAST32_T != 0
static PredType *NATIVE_INT_FAST32_;
-#endif /* H5_SIZEOF_INT_FAST32_T */
-#if H5_SIZEOF_UINT_FAST32_T != 0
static PredType *NATIVE_UINT_FAST32_;
-#endif /* H5_SIZEOF_UINT_FAST32_T */
-#if H5_SIZEOF_INT_FAST64_T != 0
static PredType *NATIVE_INT_FAST64_;
-#endif /* H5_SIZEOF_INT_FAST64_T */
-#if H5_SIZEOF_UINT_FAST64_T != 0
static PredType *NATIVE_UINT_FAST64_;
-#endif /* H5_SIZEOF_UINT_FAST64_T */
- // End of Declaration of pointers
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 3780220..7ee8395 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -11,15 +11,10 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
-#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -75,8 +70,7 @@ PropList::getConstant()
void
PropList::deleteConstants()
{
- if (DEFAULT_ != 0)
- delete DEFAULT_;
+ delete DEFAULT_;
}
//--------------------------------------------------------------------------
@@ -91,7 +85,9 @@ const PropList &PropList::DEFAULT = *getConstant();
///\brief Default constructor: creates a stub property list object.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {}
+PropList::PropList() : IdComponent(), id(H5P_DEFAULT)
+{
+}
//--------------------------------------------------------------------------
// Function: PropList copy constructor
@@ -116,11 +112,8 @@ PropList::PropList(const PropList &original) : IdComponent(), id(original.id)
// property's id to H5P_DEFAULT.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PropList::PropList(const hid_t plist_id) : IdComponent()
+PropList::PropList(const hid_t plist_id) : IdComponent(), id{H5P_DEFAULT}
{
- if (plist_id <= 0)
- id = H5P_DEFAULT;
-
H5I_type_t id_type = H5Iget_type(plist_id);
switch (id_type) {
case H5I_GENPROP_CLS:
@@ -464,8 +457,7 @@ PropList::getProperty(const char *name) const
size_t size = getPropSize(name);
// Allocate buffer then get the property
- char *prop_strg_C = new char[size + 1]; // temporary C-string for C API
- HDmemset(prop_strg_C, 0, size + 1); // clear buffer
+ char *prop_strg_C = new char[size + 1]();
herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API
@@ -551,7 +543,7 @@ PropList::getPropSize(const H5std_string &name) const
// Function: PropList::getClassName
///\brief Return the name of a generic property list class.
///\return A string containing the class name, if success, otherwise,
-/// a NULL string.
+/// an empty string.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5std_string
@@ -565,8 +557,9 @@ PropList::getClassName() const
return (class_name);
}
else
- return 0;
+ return "";
}
+
//--------------------------------------------------------------------------
// Function: PropList::getNumProps
///\brief Returns the number of properties in this property list or class.
@@ -636,11 +629,12 @@ PropList::setProperty(const char *name, void *value) const
void
PropList::setProperty(const char *name, const char *charptr) const
{
- herr_t ret_value = H5Pset(id, name, (const void *)charptr);
+ herr_t ret_value = H5Pset(id, name, static_cast<const void *>(charptr));
if (ret_value < 0) {
throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
}
}
+
//--------------------------------------------------------------------------
// Function: PropList::setProperty
///\brief This is an overloaded member function, provided for convenience.
diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h
index 12c8b4b..5320699 100644
--- a/c++/src/H5PropList.h
+++ b/c++/src/H5PropList.h
@@ -38,7 +38,7 @@ class H5_DLLCPP PropList : public IdComponent {
bool operator==(const PropList &rhs) const;
// Close this property list.
- virtual void close();
+ virtual void close() override;
// Close a property list class.
void closeClass() const;
@@ -102,7 +102,7 @@ class H5_DLLCPP PropList : public IdComponent {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("PropList");
}
@@ -114,10 +114,10 @@ class H5_DLLCPP PropList : public IdComponent {
PropList(const PropList &original);
// Gets the property list id.
- virtual hid_t getId() const;
+ virtual hid_t getId() const override;
// Destructor: properly terminates access to this property list.
- virtual ~PropList();
+ virtual ~PropList() override;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -128,7 +128,7 @@ class H5_DLLCPP PropList : public IdComponent {
hid_t id; // HDF5 property list id
// Sets the property list id.
- virtual void p_setId(const hid_t new_id);
+ virtual void p_setId(const hid_t new_id) override;
private:
static PropList *DEFAULT_;
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp
index 473cab3..57bb2c9 100644
--- a/c++/src/H5StrType.cpp
+++ b/c++/src/H5StrType.cpp
@@ -32,7 +32,6 @@
#include "H5StrType.h"
#include "H5DataSet.h"
#include "H5PredType.h"
-#include "H5private.h"
namespace H5 {
@@ -41,7 +40,9 @@ namespace H5 {
///\brief Default constructor: Creates a stub string datatype
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType() : AtomType() {}
+StrType::StrType() : AtomType()
+{
+}
//--------------------------------------------------------------------------
// Function: StrType overloaded constructor
@@ -103,8 +104,11 @@ StrType::StrType(const PredType &pred_type, const size_t &size) : AtomType()
// This constructor replaced the previous one.
// Programmer Binh-Minh Ribler - Nov 28, 2005
//--------------------------------------------------------------------------
-StrType::StrType(H5_ATTR_UNUSED const int dummy, const size_t &size) : AtomType()
+StrType::StrType(const int dummy, const size_t &size) : AtomType()
{
+ // Unused
+ (void)dummy;
+
// use DataType::copy to make a copy of the string predefined type
// then set its length
copy(PredType::C_S1);
@@ -118,14 +122,18 @@ StrType::StrType(H5_ATTR_UNUSED const int dummy, const size_t &size) : AtomType(
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType(const hid_t existing_id) : AtomType(existing_id) {}
+StrType::StrType(const hid_t existing_id) : AtomType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: StrType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType(const StrType &original) : AtomType(original) {}
+StrType::StrType(const StrType &original) : AtomType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: StrType overloaded constructor
@@ -302,6 +310,8 @@ StrType::setStrpad(H5T_str_t strpad) const
///\brief Properly terminates access to this string datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::~StrType() {}
+StrType::~StrType()
+{
+}
} // namespace H5
diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h
index d272c53..2dc3bdc 100644
--- a/c++/src/H5StrType.h
+++ b/c++/src/H5StrType.h
@@ -42,7 +42,7 @@ class H5_DLLCPP StrType : public AtomType {
// Returns an StrType object via DataType* by decoding the
// binary object description of this type.
- virtual DataType *decode() const;
+ virtual DataType *decode() const override;
// Retrieves the character set type of this string datatype.
H5T_cset_t getCset() const;
@@ -58,7 +58,7 @@ class H5_DLLCPP StrType : public AtomType {
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("StrType");
}
@@ -73,7 +73,7 @@ class H5_DLLCPP StrType : public AtomType {
StrType(const StrType &original);
// Noop destructor.
- virtual ~StrType();
+ virtual ~StrType() override;
}; // end of StrType
} // namespace H5
diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp
index 2851cc0..0270feb 100644
--- a/c++/src/H5VarLenType.cpp
+++ b/c++/src/H5VarLenType.cpp
@@ -33,7 +33,9 @@ namespace H5 {
// Function: VarLenType default constructor
///\brief Default constructor: Creates a stub variable-length datatype.
//--------------------------------------------------------------------------
-VarLenType::VarLenType() : DataType() {}
+VarLenType::VarLenType() : DataType()
+{
+}
//--------------------------------------------------------------------------
// Function: VarLenType overloaded constructor
@@ -42,14 +44,18 @@ VarLenType::VarLenType() : DataType() {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
-VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {}
+VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id)
+{
+}
//--------------------------------------------------------------------------
// Function: VarLenType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
-VarLenType::VarLenType(const VarLenType &original) : DataType(original) {}
+VarLenType::VarLenType(const VarLenType &original) : DataType(original)
+{
+}
//--------------------------------------------------------------------------
// Function: VarLenType overloaded constructor
@@ -153,6 +159,8 @@ VarLenType::decode() const
///\brief Properly terminates access to this datatype.
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
-VarLenType::~VarLenType() {}
+VarLenType::~VarLenType()
+{
+}
} // namespace H5
diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h
index f767e0e..a8d0504 100644
--- a/c++/src/H5VarLenType.h
+++ b/c++/src/H5VarLenType.h
@@ -33,11 +33,11 @@ class H5_DLLCPP VarLenType : public DataType {
// Returns an VarLenType object via DataType* by decoding the
// binary object description of this type.
- virtual DataType *decode() const;
+ virtual DataType *decode() const override;
///\brief Returns this class name.
virtual H5std_string
- fromClass() const
+ fromClass() const override
{
return ("VarLenType");
}
@@ -53,7 +53,7 @@ class H5_DLLCPP VarLenType : public DataType {
VarLenType(const H5Location &loc, const H5std_string &name);
// Noop destructor
- virtual ~VarLenType();
+ virtual ~VarLenType() override;
// Default constructor
VarLenType();
diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in
index cf993b9..573d20d 100644
--- a/c++/src/h5c++.in
+++ b/c++/src/h5c++.in
@@ -35,10 +35,10 @@ HL="@HL@"
## (Advanced usage - know what you're doing - you're on your own here.) ##
## The four variables below can be used to insert paths and flags in ##
## CPPFLAGS, CXXFLAGS, LDFLAGS, or LIBS in the h5cc compile line: ##
-## $CLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS ##
+## $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS ##
## $LDFLAGS $LIBS $clibpath $link_objs $link_args $shared_link ##
## ##
-## These settings can be overridden by setting HDF5_CXXFLAGS, ##
+## These settings can be overridden by setting HDF5_CXXFLAGS, ##
## HDF5_CPPFLAGS, HDF5_LDFLAGS, or HDF5_LIBS in the environment. ##
## ##
############################################################################
@@ -93,7 +93,7 @@ H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
H5BLD_LIBS="@LIBS@"
CXX="${HDF5_CXX:-$CXXBASE}"
-CXXLINKER="${HDF5_CLINKER:-$CXXLINKERBASE}"
+CXXLINKER="${HDF5_CXXLINKER:-$CXXLINKERBASE}"
CXXFLAGS="${HDF5_CXXFLAGS:-$CXXFLAGSBASE}"
CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}"
LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}"
diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake
index 3b555ed..360d14e 100644
--- a/c++/test/CMakeVFDTests.cmake
+++ b/c++/test/CMakeVFDTests.cmake
@@ -26,7 +26,7 @@ set (VFD_LIST
family
)
-if (DIRECT_VFD)
+if (H5_HAVE_DIRECT)
set (VFD_LIST ${VFD_LIST} direct)
endif ()
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index 65949b6..53b56fc 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -23,11 +23,9 @@
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
+#include <cfloat>
+#include <cmath>
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -46,6 +44,8 @@ const H5std_string DSET_SIMPLE_IO_NAME("simple_io");
const H5std_string DSET_TCONV_NAME("tconv");
const H5std_string DSET_COMPRESS_NAME("compressed");
const H5std_string DSET_BOGUS_NAME("bogus");
+const H5std_string DSET_OPERATOR("testing operator=");
+const H5std_string DSET_OPERATOR_PATH("/testing operator=");
/* Temporary filter IDs used for testing */
const int H5Z_FILTER_BOGUS = 305;
@@ -62,9 +62,6 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler (using C version)
- * Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
static herr_t
@@ -163,8 +160,7 @@ test_create(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
// clean up and return with failure
- if (dataset != NULL)
- delete dataset;
+ delete dataset;
return -1;
}
// catch all other exceptions
@@ -172,8 +168,7 @@ test_create(H5File &file)
issue_fail_msg("test_create", __LINE__, __FILE__);
// clean up and return with failure
- if (dataset != NULL)
- delete dataset;
+ delete dataset;
return -1;
}
} // test_create
@@ -188,9 +183,6 @@ test_create(H5File &file)
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler (using C version)
- * Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
static herr_t
@@ -199,9 +191,9 @@ test_simple_io(H5File &file)
SUBTEST("Simple I/O");
- int points[100][200];
- int check[100][200];
- int i, j, n;
+ auto points = new int[100][200];
+ auto check = new int[100][200]();
+ int i, j, n;
// Initialize the dataset
for (i = n = 0; i < 100; i++) {
@@ -243,6 +235,8 @@ test_simple_io(H5File &file)
// clean up and return with success
delete[] tconv_buf;
+ delete[] points;
+ delete[] check;
PASSED();
return 0;
} // end try
@@ -253,8 +247,9 @@ test_simple_io(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
// clean up and return with failure
- if (tconv_buf)
- delete[] tconv_buf;
+ delete[] tconv_buf;
+ delete[] points;
+ delete[] check;
return -1;
}
} // test_simple_io
@@ -267,9 +262,6 @@ test_simple_io(H5File &file)
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler
- * Thursday, March 22, 2012
*-------------------------------------------------------------------------
*/
static herr_t
@@ -329,9 +321,6 @@ test_datasize(FileAccPropList &fapl)
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler (using C version)
- * Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
static herr_t
@@ -398,13 +387,13 @@ test_tconv(H5File &file)
/* This message derives from H5Z */
const H5Z_class2_t H5Z_BOGUS[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version number */
- H5Z_FILTER_BOGUS, /* Filter id number */
- 1, 1, /* Encode and decode enabled */
- "bogus", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)filter_bogus, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version number */
+ H5Z_FILTER_BOGUS, /* Filter id number */
+ 1, 1, /* Encode and decode enabled */
+ "bogus", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ filter_bogus, /* The actual filter function */
}};
/*-------------------------------------------------------------------------
@@ -425,6 +414,13 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[
size_t *buf_size, void **buf)
// H5_ATTR_UNUSED variables caused warning, but taking them out caused failure.
{
+ // Unused
+ (void)flags;
+ (void)cd_nelmts;
+ (void)cd_values;
+ (void)buf_size;
+ (void)buf;
+
return nbytes;
}
@@ -439,9 +435,6 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler (using C version)
- * Friday, January 5, 2001
*-------------------------------------------------------------------------
*/
static herr_t
@@ -451,8 +444,8 @@ test_compression(H5File &file)
const char *not_supported;
not_supported = " Deflate compression is not enabled.";
#endif /* H5_HAVE_FILTER_DEFLATE */
- int points[100][200];
- int check[100][200];
+ auto points = new int[100][200];
+ auto check = new int[100][200];
hsize_t i, j, n;
// Initialize the dataset
@@ -687,6 +680,8 @@ test_compression(H5File &file)
*/
delete dataset;
delete[] tconv_buf;
+ delete[] points;
+ delete[] check;
return 0;
} // end try
@@ -696,10 +691,10 @@ test_compression(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
// clean up and return with failure
- if (dataset != NULL)
- delete dataset;
- if (tconv_buf)
- delete[] tconv_buf;
+ delete dataset;
+ delete[] tconv_buf;
+ delete[] points;
+ delete[] check;
return -1;
}
} // test_compression
@@ -712,10 +707,6 @@ test_compression(H5File &file)
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler
- * Friday, April 22, 2016
- *
*-------------------------------------------------------------------------
*/
const H5std_string DSET_NBIT_NAME("nbit_dataset");
@@ -739,6 +730,9 @@ test_nbit_compression(H5File &file)
SUBTEST("N-bit compression (setup)");
+ HDmemset(orig_data, 0, DIM1 * DIM2 * sizeof(s1_t));
+ HDmemset(new_data, 0, DIM1 * DIM2 * sizeof(s1_t));
+
try {
// Define datatypes of members of compound datatype
IntType i_type(PredType::NATIVE_INT);
@@ -827,9 +821,6 @@ test_nbit_compression(H5File &file)
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler (using C version)
- * Saturday, February 17, 2001
*-------------------------------------------------------------------------
*/
static herr_t
@@ -889,8 +880,7 @@ test_multiopen(H5File &file)
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
// clean up and return with failure
- if (space != NULL)
- delete space;
+ delete space;
return -1;
}
} // test_multiopen
@@ -903,9 +893,6 @@ test_multiopen(H5File &file)
* Return Success: 0
*
* Failure: -1
- *
- * Programmer Binh-Minh Ribler (using C version)
- * February 17, 2001
*-------------------------------------------------------------------------
*/
static herr_t
@@ -968,8 +955,7 @@ test_types(H5File &file)
cerr << " <<< "
<< "bitfield_1: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
- if (dset != NULL)
- delete dset;
+ delete dset;
return -1;
}
@@ -1000,8 +986,7 @@ test_types(H5File &file)
cerr << " <<< "
<< "bitfield_2: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
- if (dset != NULL)
- delete dset;
+ delete dset;
throw E; // propagate the exception
}
@@ -1035,10 +1020,8 @@ test_types(H5File &file)
cerr << " <<< "
<< "opaque_1: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
- if (dset != NULL)
- delete dset;
- if (optype != NULL)
- delete optype;
+ delete dset;
+ delete optype;
throw E; // propagate the exception
}
@@ -1071,10 +1054,8 @@ test_types(H5File &file)
cerr << " <<< "
<< "opaque_2: " << E.getFuncName() << " - " << E.getDetailMsg() << " >>>" << endl
<< endl;
- if (dset != NULL)
- delete dset;
- if (optype != NULL)
- delete optype;
+ delete dset;
+ delete optype;
throw E; // propagate the exception
}
@@ -1118,7 +1099,7 @@ test_getnativeinfo(H5File &file)
H5O_native_info_t ninfo;
HDmemset(&ninfo, 0, sizeof(ninfo));
dataset.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_HDR);
- verify_val(ninfo.hdr.nchunks, 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(ninfo.hdr.nchunks), 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
dataset.close();
// Open the dataset we created above and then close it. This is one
@@ -1126,7 +1107,7 @@ test_getnativeinfo(H5File &file)
dataset = file.openDataSet(DSET_DEFAULT_NAME);
HDmemset(&ninfo, 0, sizeof(ninfo));
dataset.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_ALL);
- verify_val(ninfo.hdr.nchunks, 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(ninfo.hdr.nchunks), 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
dataset.close();
PASSED();
@@ -1161,7 +1142,7 @@ const int RANK1 = 1;
const H5std_string FILE_ACCPLIST("test_accplist.h5");
static herr_t
-test_chunk_cache(FileAccPropList fapl)
+test_chunk_cache(const FileAccPropList &fapl)
{
SUBTEST("DSetAccPropList::set/getChunkCache");
@@ -1173,17 +1154,20 @@ test_chunk_cache(FileAccPropList fapl)
// Verify that chunk cache parameters are the same
int mdc_nelmts = 0;
size_t nslots_1 = 0, nslots_4 = 0, nbytes_1 = 0, nbytes_4 = 0;
- double w0_1 = 0.0F, w0_4 = 0.0F;
+ double w0_1 = 0.0, w0_4 = 0.0;
fapl_def.getCache(mdc_nelmts, nslots_1, nbytes_1, w0_1);
dapl.getChunkCache(nslots_4, nbytes_4, w0_4);
verify_val(nslots_1, nslots_4, "DSetAccPropList::getChunkCache", __LINE__, __FILE__);
verify_val(nbytes_1, nbytes_4, "DSetAccPropList::getChunkCache", __LINE__, __FILE__);
- verify_val(w0_1, w0_4, "DSetAccPropList::getChunkCache", __LINE__, __FILE__);
+ if (abs(w0_1 - w0_4) > DBL_EPSILON)
+ TestErrPrintf("%d: w0_1 and w0_4 different: w0_1=%f, "
+ "w0_4=%f\n",
+ __LINE__, w0_1, w0_4);
// Set a link access property on dapl to verify property list inheritance
- dapl.setNumLinks((size_t)134);
+ dapl.setNumLinks(134);
size_t nlinks = dapl.getNumLinks();
- verify_val(nlinks, (size_t)134, "DSetAccPropList::getNumLinks", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nlinks), 134, "DSetAccPropList::getNumLinks", __LINE__, __FILE__);
// Make a copy of the external fapl
FileAccPropList fapl_local(fapl);
@@ -1191,7 +1175,7 @@ test_chunk_cache(FileAccPropList fapl)
// Set new rdcc settings on fapl local
size_t nslots_2 = nslots_1 * 2;
size_t nbytes_2 = nbytes_1 * 2;
- double w0_2 = w0_1 / (double)2.0F;
+ double w0_2 = w0_1 / 2.0;
fapl_local.getCache(mdc_nelmts, nslots_2, nbytes_2, w0_2);
// Create a new file using default fcpl and the passed-in fapl
@@ -1262,10 +1246,6 @@ test_chunk_cache(FileAccPropList fapl)
*
* Return Success: 0
* Failure: number of errors
- *
- * Programmer Binh-Minh Ribler
- * Friday, March 10, 2017
- *
*-------------------------------------------------------------------------
*/
const int RANK = 2;
@@ -1298,7 +1278,8 @@ test_virtual()
// Get the current layout, should be default, H5D_CONTIGUOUS
H5D_layout_t layout = dcpl.getLayout();
- verify_val(layout, H5D_CONTIGUOUS, "DSetCreatPropList::getLayout", __LINE__, __FILE__);
+ verify_val(static_cast<long>(layout), static_cast<long>(H5D_CONTIGUOUS),
+ "DSetCreatPropList::getLayout", __LINE__, __FILE__);
// Create fixed mapping
hsize_t dims[RANK];
@@ -1320,7 +1301,8 @@ test_virtual()
// Get and verify the new layout
layout = dcpl.getLayout();
- verify_val(layout, H5D_VIRTUAL, "DSetCreatPropList::getLayout", __LINE__, __FILE__);
+ verify_val(static_cast<long>(layout), static_cast<long>(H5D_VIRTUAL), "DSetCreatPropList::getLayout",
+ __LINE__, __FILE__);
PASSED();
return 0;
@@ -1332,6 +1314,60 @@ test_virtual()
} // test_virtual
/*-------------------------------------------------------------------------
+ * Function: test_operator
+ *
+ * Purpose Tests DataSet::operator=
+ *
+ * Return Success: 0
+ *
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_operator(H5File &file)
+{
+ SUBTEST("DataSet::operator=");
+
+ try {
+ // Create a data space
+ hsize_t dims[2];
+ dims[0] = 256;
+ dims[1] = 512;
+ DataSpace space(2, dims, NULL);
+
+ // Create a dataset using the default dataset creation properties.
+ // We're not sure what they are, so we won't check.
+ DataSet dataset = file.createDataSet(DSET_OPERATOR, PredType::NATIVE_DOUBLE, space);
+
+ // Add a comment to the dataset
+ file.setComment(DSET_OPERATOR, "Dataset using operator=");
+
+ // Close the dataset
+ dataset.close();
+
+ // Re-open the dataset
+ DataSet another_dataset(file.openDataSet(DSET_OPERATOR));
+
+ // Try operator= to make another dataset
+ DataSet copied_dataset = another_dataset;
+
+ H5std_string copied_dataset_name = copied_dataset.getObjName();
+ H5std_string another_dataset_name = another_dataset.getObjName();
+
+ PASSED();
+ return 0;
+ } // try block
+
+ // catch all other exceptions
+ catch (Exception &E) {
+ issue_fail_msg("test_operator", __LINE__, __FILE__);
+
+ // clean up and return with failure
+ return -1;
+ }
+} // test_operator
+
+/*-------------------------------------------------------------------------
* Function: test_dset
*
* Purpose Tests the dataset interface (H5D)
@@ -1340,9 +1376,6 @@ test_virtual()
*
* Failure: -1
*
- * Programmer Binh-Minh Ribler (using C version)
- * Friday, January 5, 2001
- *
* Modifications:
* Nov 12, 01:
* - moved h5_cleanup to outside of try block because
@@ -1380,6 +1413,7 @@ test_dset()
nerrors += test_multiopen(file) < 0 ? 1 : 0;
nerrors += test_types(file) < 0 ? 1 : 0;
nerrors += test_virtual() < 0 ? 1 : 0;
+ nerrors += test_operator(file) < 0 ? 1 : 0;
nerrors += test_chunk_cache(fapl) < 0 ? 1 : 0;
// Close group "emit diagnostics".
diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp
index e38b34a..78169b2 100644
--- a/c++/test/h5cpputil.cpp
+++ b/c++/test/h5cpputil.cpp
@@ -19,11 +19,7 @@
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -204,7 +200,9 @@ verify_val(const char *x, const char *value, const char *where, int line, const
//--------------------------------------------------------------------------
// Function: InvalidActionException default constructor
//--------------------------------------------------------------------------
-InvalidActionException::InvalidActionException() : Exception() {}
+InvalidActionException::InvalidActionException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: InvalidActionException overloaded constructor
@@ -216,7 +214,7 @@ InvalidActionException::InvalidActionException() : Exception() {}
// func - IN: Name of the function where failure should occur
// message - IN: Message
//--------------------------------------------------------------------------
-InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message)
+InvalidActionException::InvalidActionException(const H5std_string &func, const H5std_string &message)
: Exception(func, message)
{
}
@@ -224,12 +222,16 @@ InvalidActionException::InvalidActionException(const H5std_string func, const H5
//--------------------------------------------------------------------------
// Function: InvalidActionException destructor
//--------------------------------------------------------------------------
-InvalidActionException::~InvalidActionException() throw() {}
+InvalidActionException::~InvalidActionException() throw()
+{
+}
//--------------------------------------------------------------------------
// Function: TestFailedException default constructor
//--------------------------------------------------------------------------
-TestFailedException::TestFailedException() : Exception() {}
+TestFailedException::TestFailedException() : Exception()
+{
+}
//--------------------------------------------------------------------------
// Function: TestFailedException overloaded constructor
@@ -241,7 +243,7 @@ TestFailedException::TestFailedException() : Exception() {}
// func - IN: Name of the function where failure should occur
// message - IN: Message
//--------------------------------------------------------------------------
-TestFailedException::TestFailedException(const H5std_string func, const H5std_string message)
+TestFailedException::TestFailedException(const H5std_string &func, const H5std_string &message)
: Exception(func, message)
{
}
@@ -249,4 +251,6 @@ TestFailedException::TestFailedException(const H5std_string func, const H5std_st
//--------------------------------------------------------------------------
// Function: TestFailedException destructor
//--------------------------------------------------------------------------
-TestFailedException::~TestFailedException() throw() {}
+TestFailedException::~TestFailedException() throw()
+{
+}
diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h
index 4439ae3..444bc68 100644
--- a/c++/test/h5cpputil.h
+++ b/c++/test/h5cpputil.h
@@ -48,14 +48,14 @@ void issue_fail_msg(const char *where, int line, const char *file_name, const ch
class InvalidActionException : public Exception {
public:
- InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
+ InvalidActionException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
InvalidActionException();
virtual ~InvalidActionException() throw();
};
class TestFailedException : public Exception {
public:
- TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
+ TestFailedException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
TestFailedException();
virtual ~TestFailedException() throw();
};
diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp
index ba71da8..8a976ce 100644
--- a/c++/test/tarray.cpp
+++ b/c++/test/tarray.cpp
@@ -16,11 +16,7 @@
tarray.cpp - HDF5 C++ testing the array datatype functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -85,9 +81,10 @@ test_array_compound_array()
// Initialize array data to write
for (idxi = 0; idxi < SPACE1_DIM1; idxi++)
for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) {
- wdata[idxi][idxj].i = idxi * 10 + idxj;
+ wdata[idxi][idxj].i = static_cast<int>(idxi * 10 + idxj);
for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) {
- float temp = idxi * 10.0 + idxj * 2.5 + idxk;
+ float temp = static_cast<float>(idxi) * 10.0F + static_cast<float>(idxj) * 2.5F +
+ static_cast<float>(idxk);
wdata[idxi][idxj].f[idxk] = temp;
}
} // end for
@@ -182,7 +179,8 @@ test_array_compound_array()
// Check the array dimensions
for (ii = 0; ii < ndims; ii++)
if (rdims1[ii] != tdims1[ii]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=z%d\n",
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
ii, rdims1[ii], ii, tdims1[ii]);
continue;
} // end if
@@ -200,7 +198,8 @@ test_array_compound_array()
// Check the array dimensions
for (ii = 0; ii < ndims; ii++)
if (rdims1[ii] != tdims1[ii]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=%zd\n",
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
ii, rdims1[ii], ii, tdims1[ii]);
continue;
} // end if
@@ -244,13 +243,14 @@ test_array_compound_array()
verify_val(ndims, ARRAY1_RANK, "f2_atype_check.getArrayNDims", __LINE__, __FILE__);
// Get the array dimensions
- HDmemset(rdims1, 0, H5S_MAX_RANK);
+ HDmemset(rdims1, 0, sizeof(rdims1));
f2_atype_check.getArrayDims(rdims1);
// Check the array dimensions
for (ii = 0; ii < ndims; ii++)
if (rdims1[ii] != tdims1[ii]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=%zd\n",
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
ii, rdims1[ii], ii, tdims1[ii]);
continue;
} // end if
@@ -266,9 +266,10 @@ test_array_compound_array()
for (idxi = 0; idxi < SPACE1_DIM1; idxi++) {
for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) {
if (wdata[idxi][idxj].i != rdata[idxi][idxj].i) {
- TestErrPrintf(
- "Array data information doesn't match!, wdata[%d][%d].i=%d, rdata[%d][%d].i=%d\n",
- idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i);
+ TestErrPrintf("Array data information doesn't match!, wdata[%" PRIuHSIZE "][%" PRIuHSIZE
+ "].i=%d, "
+ "rdata[%" PRIuHSIZE "][%" PRIuHSIZE "].i=%d\n",
+ idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i);
continue;
} // end if
} // end for
@@ -289,7 +290,7 @@ test_array_compound_array()
/*
* Helper routine to demonstrate the issue in HDFFV-9562
*/
-H5::DataType
+static H5::DataType
getArr()
{
hsize_t *dims = new hsize_t;
@@ -387,12 +388,13 @@ test_array_info()
// Initialize array data to write
for (idxi = 0; idxi < SPACE1_DIM1; idxi++)
for (idxj = 0; idxj < ARRAY1_DIM1; idxj++) {
- wdata[idxi][idxj].i = idxi * 10 + idxj;
+ wdata[idxi][idxj].i = static_cast<int>(idxi * 10 + idxj);
for (idxk = 0; idxk < ARRAY1_DIM1; idxk++) {
- float temp = idxi * 10.0 + idxj * 2.5 + idxk;
+ float temp = static_cast<float>(idxi) * 10.0F + static_cast<float>(idxj) * 2.5F +
+ static_cast<float>(idxk);
wdata[idxi][idxj].f[idxk] = temp;
}
- } // end for
+ }
try {
// Create File
@@ -458,11 +460,11 @@ test_array_info()
// Check the array dimensions
for (ii = 0; ii < ndims; ii++)
if (rdims1[ii] != tdims1[ii]) {
- TestErrPrintf(
- "Array dimension information doesn't match!, rdims1[%d]=%zd, tdims1[%d]=z%d\n", ii,
- rdims1[ii], ii, tdims1[ii]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ ii, rdims1[ii], ii, tdims1[ii]);
continue;
- } // end if
+ }
}
// Close all
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index e308a3a..26699d2 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -17,11 +17,9 @@
C attribute interface (H5A)
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
+#include <cfloat>
+#include <cmath>
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -97,7 +95,7 @@ struct attr4_struct {
const H5std_string ATTR5_NAME("Attr5");
const int ATTR5_RANK = 0;
-float attr_data5 = (float)-5.123; // Test data for 5th attribute
+float attr_data5 = -5.123f; // Test data for 5th attribute
/* Info for another attribute */
const H5std_string ATTR1A_NAME("Attr1_a");
@@ -173,8 +171,9 @@ test_attr_basic_write()
// Verify values read in
for (i = 0; i < ATTR1_DIM1; i++)
if (attr_data1[i] != read_data1[i])
- TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__,
- i, attr_data1[i], i, read_data1[i]);
+ TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE
+ "]=%d,read_data1[%" PRIuHSIZE "]=%d\n",
+ __LINE__, i, attr_data1[i], i, read_data1[i]);
// Create two more attributes for this dataset, but only write to one.
Attribute ds_attr2 = dataset.createAttribute(ATTR2_NAME, PredType::NATIVE_INT, att_space);
@@ -189,7 +188,8 @@ test_attr_basic_write()
// Verify values read in
for (i = 0; i < ATTR1_DIM1; i++)
if (attr_data1a[i] != read_data1[i])
- TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n",
+ TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE
+ "]=%d,read_data1[%" PRIuHSIZE "]=%d\n",
__LINE__, i, attr_data1a[i], i, read_data1[i]);
// Close both attributes
@@ -212,7 +212,7 @@ test_attr_basic_write()
// Check storage size for attribute
hsize_t attr_size = gr_attr.getStorageSize();
- verify_val((long)attr_size, (long)(ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)),
+ verify_val(static_cast<long>(attr_size), static_cast<long>(ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)),
"Attribute::getStorageSize", __LINE__, __FILE__);
// Try to create the same attribute again (should fail)
@@ -231,7 +231,7 @@ test_attr_basic_write()
// Check storage size for attribute
attr_size = gr_attr.getStorageSize();
- verify_val((long)attr_size, (long)(ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)),
+ verify_val(static_cast<long>(attr_size), static_cast<long>(ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)),
"Attribute::getStorageSize", __LINE__, __FILE__);
PASSED();
@@ -285,7 +285,7 @@ test_attr_getname()
// Check for existence of attribute FATTR1_NAME
bool attr_exists = fid1.attrExists(FATTR1_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not");
// Open attribute
@@ -302,8 +302,10 @@ test_attr_getname()
ssize_t name_size = 0; // actual length of attribute name
name_size = fattr1.getName(fattr1_name, buf_size + 1);
CHECK(name_size, FAIL, "Attribute::getName", __LINE__, __FILE__);
- verify_val((size_t)name_size, FATTR1_NAME.length(), "Attribute::getName", __LINE__, __FILE__);
- verify_val((const char *)fattr1_name, FATTR1_NAME, "Attribute::getName", __LINE__, __FILE__);
+ verify_val(static_cast<size_t>(name_size), FATTR1_NAME.length(), "Attribute::getName", __LINE__,
+ __FILE__);
+ verify_val(const_cast<const char *>(fattr1_name), FATTR1_NAME, "Attribute::getName", __LINE__,
+ __FILE__);
delete[] fattr1_name;
// 2. With arbitrary buf_size that is smaller than the name's length.
@@ -314,9 +316,10 @@ test_attr_getname()
HDmemset(fattr1_name, 0, buf_size + 1);
name_size = fattr1.getName(fattr1_name, buf_size + 1);
CHECK(name_size, FAIL, "Attribute::getName", __LINE__, __FILE__);
- verify_val((size_t)name_size, FATTR1_NAME.size(), "Attribute::getName", __LINE__, __FILE__);
- verify_val((const char *)fattr1_name, (const char *)short_name, "Attribute::getName", __LINE__,
+ verify_val(static_cast<size_t>(name_size), FATTR1_NAME.size(), "Attribute::getName", __LINE__,
__FILE__);
+ verify_val(const_cast<const char *>(fattr1_name), const_cast<const char *>(short_name),
+ "Attribute::getName", __LINE__, __FILE__);
delete[] fattr1_name;
// 3. With a buf_size that equals the name's length.
@@ -358,7 +361,7 @@ test_attr_getname()
// Check for existence of attribute
attr_exists = dataset.attrExists(ATTR1_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not");
// Open attribute
@@ -407,7 +410,7 @@ test_attr_rename()
// Check for existence of attribute
bool attr_exists = fid1.attrExists(FATTR1_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not");
// Change attribute name
@@ -433,7 +436,7 @@ test_attr_rename()
// Check for existence of attribute
attr_exists = dataset.attrExists(ATTR1_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not");
// Change attribute name
@@ -452,15 +455,16 @@ test_attr_rename()
// Verify values read in
for (i = 0; i < ATTR1_DIM1; i++)
if (attr_data1[i] != read_data1[i])
- TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__,
- i, attr_data1[i], i, read_data1[i]);
+ TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE
+ "]=%d,read_data1[%" PRIuHSIZE "]=%d\n",
+ __LINE__, i, attr_data1[i], i, read_data1[i]);
// Close attribute
attr1.close();
// Check for existence of second attribute
attr_exists = dataset.attrExists(ATTR2_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not");
// Open the second attribute
@@ -476,7 +480,8 @@ test_attr_rename()
// Verify values read in
for (i = 0; i < ATTR1_DIM1; i++)
if (attr_data1a[i] != read_data1[i])
- TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n",
+ TestErrPrintf("%d: attribute data different: attr_data1a[%" PRIuHSIZE
+ "]=%d,read_data1[%" PRIuHSIZE "]=%d\n",
__LINE__, i, attr_data1a[i], i, read_data1[i]);
// Close attribute
@@ -487,7 +492,7 @@ test_attr_rename()
// Check for existence of attribute after renaming
attr_exists = dataset.attrExists(ATTR1_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not");
PASSED();
@@ -529,7 +534,7 @@ test_attr_basic_read()
H5O_info2_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
- verify_val(oinfo.num_attrs, 3, "DataSet::getObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(oinfo.num_attrs), 3, "DataSet::getObjinfo", __LINE__, __FILE__);
// Open an attribute for the dataset
Attribute ds_attr = dataset.openAttribute(ATTR1_NAME);
@@ -541,7 +546,8 @@ test_attr_basic_read()
// Verify values read in
for (i = 0; i < ATTR1_DIM1; i++)
if (attr_data1[i] != read_data1[i])
- TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d, read_data1[%d]=%d\n",
+ TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE
+ "]=%d, read_data1[%" PRIuHSIZE "]=%d\n",
__LINE__, i, attr_data1[i], i, read_data1[i]);
/*
@@ -557,7 +563,7 @@ test_attr_basic_read()
// Verify the correct number of attributes another way
HDmemset(&oinfo, 0, sizeof(oinfo));
group.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
- verify_val(oinfo.num_attrs, 1, "Group::getObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(oinfo.num_attrs), 1, "Group::getObjinfo", __LINE__, __FILE__);
// Open an attribute for the group
Attribute gr_attr = group.openAttribute(ATTR2_NAME);
@@ -572,9 +578,10 @@ test_attr_basic_read()
for (i = 0; i < ATTR2_DIM1; i++)
for (j = 0; j < ATTR2_DIM2; j++)
if (attr_data2[i][j] != read_data2[i][j]) {
- TestErrPrintf(
- "%d: attribute data different: attr_data2[%d][%d]=%d, read_data2[%d][%d]=%d\n",
- __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]);
+ TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE
+ "]=%d, "
+ "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n",
+ __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]);
}
PASSED();
} // end try block
@@ -682,10 +689,10 @@ test_attr_compound_read()
H5O_info2_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
- verify_val(oinfo.num_attrs, 1, "DataSet::getObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(oinfo.num_attrs), 1, "DataSet::getObjinfo", __LINE__, __FILE__);
// Open 1st attribute for the dataset
- Attribute attr = dataset.openAttribute((unsigned)0);
+ Attribute attr = dataset.openAttribute(static_cast<unsigned>(0));
/* Verify Dataspace */
@@ -699,14 +706,17 @@ test_attr_compound_read()
// Get the dims of the dataspace and verify them
int ndims = space.getSimpleExtentDims(dims);
verify_val(ndims, ATTR4_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
- verify_val((long)dims[0], (long)ATTR4_DIM1, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
- verify_val((long)dims[1], (long)ATTR4_DIM2, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(static_cast<long>(dims[0]), static_cast<long>(ATTR4_DIM1),
+ "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(static_cast<long>(dims[1]), static_cast<long>(ATTR4_DIM2),
+ "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
// Get the class of the datatype that is used by attr
H5T_class_t type_class = attr.getTypeClass();
// Verify that the type is of compound datatype
- verify_val(type_class, H5T_COMPOUND, "Attribute::getTypeClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_COMPOUND), "Attribute::getTypeClass",
+ __LINE__, __FILE__);
// Get the compound datatype
CompType datatype = attr.getCompType();
@@ -738,11 +748,13 @@ test_attr_compound_read()
// Get and verify the type class of the first member
type_class = datatype.getMemberClass(0);
- verify_val(type_class, H5T_INTEGER, "DataType::getMemberClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_INTEGER), "DataType::getMemberClass",
+ __LINE__, __FILE__);
// Get and verify the order of this member's type
IntType i_type = datatype.getMemberIntType(0);
H5T_order_t order = i_type.getOrder();
- verify_val(order, PredType::NATIVE_INT.getOrder(), "DataType::getOrder", __LINE__, __FILE__);
+ verify_val(static_cast<long>(order), static_cast<long>(PredType::NATIVE_INT.getOrder()),
+ "DataType::getOrder", __LINE__, __FILE__);
// Get and verify the size of this member's type
size = i_type.getSize();
@@ -750,21 +762,25 @@ test_attr_compound_read()
// Get and verify class, order, and size of the second member's type
type_class = datatype.getMemberClass(1);
- verify_val(type_class, H5T_FLOAT, "DataType::getMemberClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_FLOAT), "DataType::getMemberClass",
+ __LINE__, __FILE__);
FloatType f_type = datatype.getMemberFloatType(1);
order = f_type.getOrder();
- verify_val(order, PredType::NATIVE_DOUBLE.getOrder(), "DataType::getOrder", __LINE__, __FILE__);
+ verify_val(static_cast<long>(order), static_cast<long>(PredType::NATIVE_DOUBLE.getOrder()),
+ "DataType::getOrder", __LINE__, __FILE__);
size = f_type.getSize();
verify_val(size, PredType::NATIVE_DOUBLE.getSize(), "DataType::getSize", __LINE__, __FILE__);
// Get and verify class, order, and size of the third member's type
type_class = datatype.getMemberClass(2);
- verify_val(type_class, H5T_INTEGER, "DataType::getMemberClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_INTEGER), "DataType::getMemberClass",
+ __LINE__, __FILE__);
// Note: H5T_INTEGER is correct here!
StrType s_type = datatype.getMemberStrType(2);
order = s_type.getOrder();
- verify_val(order, PredType::NATIVE_SCHAR.getOrder(), "DataType::getOrder", __LINE__, __FILE__);
+ verify_val(static_cast<long>(order), static_cast<long>(PredType::NATIVE_SCHAR.getOrder()),
+ "DataType::getOrder", __LINE__, __FILE__);
size = s_type.getSize();
verify_val(size, PredType::NATIVE_SCHAR.getSize(), "DataType::getSize", __LINE__, __FILE__);
@@ -775,16 +791,19 @@ test_attr_compound_read()
hsize_t ii, jj;
for (ii = 0; ii < ATTR4_DIM1; ii++)
for (jj = 0; jj < ATTR4_DIM2; jj++)
- if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct))) {
- TestErrPrintf(
- "%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",
- __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i);
- TestErrPrintf(
- "%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",
- __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d);
- TestErrPrintf(
- "%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n",
- __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c);
+ if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) {
+ TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE
+ "].i=%d, "
+ "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].i=%d\n",
+ __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i);
+ TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE
+ "].d=%f, "
+ "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].d=%f\n",
+ __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d);
+ TestErrPrintf("%d:attribute data different: attr_data4[%" PRIuHSIZE "][%" PRIuHSIZE
+ "].c=%c, "
+ "read_data4[%" PRIuHSIZE "][%" PRIuHSIZE "].c=%c\n",
+ __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c);
} /* end if */
// Verify name
@@ -906,15 +925,18 @@ test_attr_scalar_read()
// Read attribute information
float read_data2 = 0.0; // Buffer for reading 1st attribute
ds_attr.read(PredType::NATIVE_FLOAT, &read_data2);
- if (HDfabs(read_data2 - attr_data5) > FP_EPSILON)
- verify_val(read_data2, attr_data5, FP_EPSILON, "Attribute::read", __LINE__, __FILE__);
+ if (abs(read_data2 - attr_data5) > FLT_EPSILON)
+ TestErrPrintf("%d: attribute data different: read_data2=%f, "
+ "attr_data5=%f\n",
+ __LINE__, static_cast<double>(read_data2), static_cast<double>(attr_data5));
// Get the dataspace of the attribute
DataSpace att_space = ds_attr.getSpace();
// Make certain the dataspace is scalar
H5S_class_t space_type = att_space.getSimpleExtentType();
- verify_val(space_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(space_type), static_cast<long>(H5S_SCALAR),
+ "DataSpace::getSimpleExtentType", __LINE__, __FILE__);
PASSED();
} // end try block
@@ -1033,7 +1055,7 @@ test_attr_mult_read()
verify_val(num_attrs, 3, "DataSet::getNumAttrs", __LINE__, __FILE__);
// Open 1st attribute for the dataset
- Attribute attr = dataset.openAttribute((unsigned)0);
+ Attribute attr = dataset.openAttribute(static_cast<unsigned>(0));
/* Verify Dataspace */
@@ -1046,10 +1068,10 @@ test_attr_mult_read()
// Get the dims of the dataspace and verify them
hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions
- int ndims = space.getSimpleExtentDims(dims);
- if ((long)dims[0] != (long)ATTR1_DIM1)
- TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n", __LINE__,
- (int)dims[0], ATTR1_DIM1);
+ (void)space.getSimpleExtentDims(dims);
+ if (dims[0] != ATTR1_DIM1)
+ TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %" PRIuHSIZE "\n",
+ __LINE__, static_cast<int>(dims[0]), ATTR1_DIM1);
/* Verify Datatype */
@@ -1057,14 +1079,16 @@ test_attr_mult_read()
H5T_class_t type_class = attr.getTypeClass();
// Verify that the type is of integer datatype
- verify_val(type_class, H5T_INTEGER, "Attribute::getTypeClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_INTEGER), "Attribute::getTypeClass",
+ __LINE__, __FILE__);
// Get the integer datatype
IntType i_type1 = attr.getIntType();
// Get and verify the order of this type
H5T_order_t order = i_type1.getOrder();
- verify_val(order, PredType::NATIVE_INT.getOrder(), "DataType::getOrder", __LINE__, __FILE__);
+ verify_val(static_cast<long>(order), static_cast<long>(PredType::NATIVE_INT.getOrder()),
+ "DataType::getOrder", __LINE__, __FILE__);
// Get and verify the size of this type
size_t size = i_type1.getSize();
@@ -1076,8 +1100,9 @@ test_attr_mult_read()
// Verify values read in
for (i = 0; i < ATTR1_DIM1; i++)
if (attr_data1[i] != read_data1[i])
- TestErrPrintf("%d: attribute data different: attr_data1[%d]=%d,read_data1[%d]=%d\n", __LINE__,
- i, attr_data1[i], i, read_data1[i]);
+ TestErrPrintf("%d: attribute data different: attr_data1[%" PRIuHSIZE
+ "]=%d,read_data1[%" PRIuHSIZE "]=%d\n",
+ __LINE__, i, attr_data1[i], i, read_data1[i]);
// Verify Name
H5std_string attr_name = attr.getName();
@@ -1087,7 +1112,7 @@ test_attr_mult_read()
space.close();
// Open 2nd attribute for the dataset
- attr = dataset.openAttribute((unsigned)1);
+ attr = dataset.openAttribute(static_cast<unsigned>(1));
/* Verify Dataspace */
@@ -1099,10 +1124,12 @@ test_attr_mult_read()
verify_val(rank, ATTR2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
// Get the dims of the dataspace and verify them
- ndims = space.getSimpleExtentDims(dims);
+ (void)space.getSimpleExtentDims(dims);
- verify_val((long)dims[0], (long)ATTR2_DIM1, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
- verify_val((long)dims[1], (long)ATTR2_DIM2, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(static_cast<long>(dims[0]), static_cast<long>(ATTR2_DIM1),
+ "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(static_cast<long>(dims[1]), static_cast<long>(ATTR2_DIM2),
+ "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
/* Verify Datatype */
@@ -1110,14 +1137,16 @@ test_attr_mult_read()
type_class = attr.getTypeClass();
// Verify that the type is of integer datatype
- verify_val(type_class, H5T_INTEGER, "Attribute::getTypeClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_INTEGER), "Attribute::getTypeClass",
+ __LINE__, __FILE__);
// Get the integer datatype
IntType i_type2 = attr.getIntType();
// Get and verify the order of this type
order = i_type2.getOrder();
- verify_val(order, PredType::NATIVE_INT.getOrder(), "DataType::getOrder", __LINE__, __FILE__);
+ verify_val(static_cast<long>(order), static_cast<long>(PredType::NATIVE_INT.getOrder()),
+ "DataType::getOrder", __LINE__, __FILE__);
// Get and verify the size of this type
size = i_type2.getSize();
@@ -1131,9 +1160,10 @@ test_attr_mult_read()
for (i = 0; i < ATTR2_DIM1; i++)
for (j = 0; j < ATTR2_DIM2; j++)
if (attr_data2[i][j] != read_data2[i][j])
- TestErrPrintf(
- "%d: attribute data different: attr_data2[%d][%d]=%d, read_data2[%d][%d]=%d\n",
- __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]);
+ TestErrPrintf("%d: attribute data different: attr_data2[%" PRIuHSIZE "][%" PRIuHSIZE
+ "]=%d, "
+ "read_data2[%" PRIuHSIZE "][%" PRIuHSIZE "]=%d\n",
+ __LINE__, i, j, attr_data2[i][j], i, j, read_data2[i][j]);
// Verify Name
attr_name = attr.getName();
@@ -1142,7 +1172,7 @@ test_attr_mult_read()
space.close();
// Open 3rd attribute for the dataset
- attr = dataset.openAttribute((unsigned)2);
+ attr = dataset.openAttribute(static_cast<unsigned>(2));
/* Verify Dataspace */
@@ -1154,10 +1184,13 @@ test_attr_mult_read()
verify_val(rank, ATTR3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
// Get the dims of the dataspace and verify them
- ndims = space.getSimpleExtentDims(dims);
- verify_val((long)dims[0], (long)ATTR3_DIM1, "attribute dimensions", __FILE__, __LINE__);
- verify_val((long)dims[1], (long)ATTR3_DIM2, "attribute dimensions", __FILE__, __LINE__);
- verify_val((long)dims[2], (long)ATTR3_DIM3, "attribute dimensions", __FILE__, __LINE__);
+ (void)space.getSimpleExtentDims(dims);
+ verify_val(static_cast<long>(dims[0]), static_cast<long>(ATTR3_DIM1), "attribute dimensions",
+ __FILE__, __LINE__);
+ verify_val(static_cast<long>(dims[1]), static_cast<long>(ATTR3_DIM2), "attribute dimensions",
+ __FILE__, __LINE__);
+ verify_val(static_cast<long>(dims[2]), static_cast<long>(ATTR3_DIM3), "attribute dimensions",
+ __FILE__, __LINE__);
/* Verify Datatype */
@@ -1165,14 +1198,16 @@ test_attr_mult_read()
type_class = attr.getTypeClass();
// Verify that the type is of compound datatype
- verify_val(type_class, H5T_FLOAT, "Attribute::getTypeClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_FLOAT), "Attribute::getTypeClass",
+ __LINE__, __FILE__);
// Get the double datatype
FloatType f_type = attr.getFloatType();
// Get and verify the order of this type
order = f_type.getOrder();
- verify_val(order, PredType::NATIVE_DOUBLE.getOrder(), "DataType::getOrder", __LINE__, __FILE__);
+ verify_val(static_cast<long>(order), static_cast<long>(PredType::NATIVE_DOUBLE.getOrder()),
+ "DataType::getOrder", __LINE__, __FILE__);
// Get and verify the size of this type
size = f_type.getSize();
@@ -1185,9 +1220,10 @@ test_attr_mult_read()
for (i = 0; i < ATTR3_DIM1; i++)
for (j = 0; j < ATTR3_DIM2; j++)
for (k = 0; k < ATTR3_DIM3; k++)
- if (attr_data3[i][j][k] != read_data3[i][j][k])
- TestErrPrintf("%d: attribute data different: attr_data3[%d][%d][%d]=%f, "
- "read_data3[%d][%d][%d]=%f\n",
+ if (abs(attr_data3[i][j][k] - read_data3[i][j][k]) > DBL_EPSILON)
+ TestErrPrintf("%d: attribute data different: attr_data3[%" PRIuHSIZE "][%" PRIuHSIZE
+ "][%" PRIuHSIZE "]=%f, "
+ "read_data3[%" PRIuHSIZE "][%" PRIuHSIZE "][%" PRIuHSIZE "]=%f\n",
__LINE__, i, j, k, attr_data3[i][j][k], i, j, k, read_data3[i][j][k]);
// Verify Name
@@ -1234,7 +1270,7 @@ test_attr_delete()
verify_val(num_attrs, 1, "H5File::getNumAttrs", __LINE__, __FILE__);
// Verify the name of the only file attribute left
- Attribute fattr = fid1.openAttribute((unsigned)0);
+ Attribute fattr = fid1.openAttribute(static_cast<unsigned>(0));
attr_name = fattr.getName();
verify_val(attr_name, FATTR1_NAME, "Attribute::getName", __LINE__, __FILE__);
fattr.close();
@@ -1274,7 +1310,7 @@ test_attr_delete()
verify_val(num_attrs, 2, "DataSet::getNumAttrs", __LINE__, __FILE__);
// Open 1st attribute for the dataset
- Attribute attr = dataset.openAttribute((unsigned)0);
+ Attribute attr = dataset.openAttribute(static_cast<unsigned>(0));
// Verify Name
attr_name = attr.getName();
@@ -1284,7 +1320,7 @@ test_attr_delete()
attr.close();
// Open last (formally 3rd) attribute for the dataset
- attr = dataset.openAttribute((unsigned)1);
+ attr = dataset.openAttribute(static_cast<unsigned>(1));
// Verify Name
attr_name = attr.getName();
@@ -1300,7 +1336,7 @@ test_attr_delete()
verify_val(num_attrs, 1, "DataSet::getNumAttrs", __LINE__, __FILE__);
// Open the only attribute for the dataset (formally 3rd)
- attr = dataset.openAttribute((unsigned)0);
+ attr = dataset.openAttribute(static_cast<unsigned>(0));
// Verify Name
attr_name = attr.getName();
@@ -1374,7 +1410,7 @@ test_attr_dtype_shared()
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
- verify_val((int)statbuf.nlink, 1, "DataType::getObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<int>(statbuf.nlink), 1, "DataType::getObjinfo", __LINE__, __FILE__);
#endif
// Create dataspace for dataset
@@ -1385,7 +1421,7 @@ test_attr_dtype_shared()
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
- verify_val((int)statbuf.nlink, 2, "H5File::getObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<int>(statbuf.nlink), 2, "H5File::getObjinfo", __LINE__, __FILE__);
#endif
// Create attribute on dataset
@@ -1394,7 +1430,7 @@ test_attr_dtype_shared()
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
- verify_val((int)statbuf.nlink, 3, "DataSet::getObjinfo", __LINE__, __FILE__);
+ verify_val(static_cast<int>(statbuf.nlink), 3, "DataSet::getObjinfo", __LINE__, __FILE__);
#endif
// Close attribute
@@ -1406,8 +1442,8 @@ test_attr_dtype_shared()
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
- verify_val((int)statbuf.nlink, 2, "DataSet::getObjinfo after DataSet::removeAttr", __LINE__,
- __FILE__);
+ verify_val(static_cast<int>(statbuf.nlink), 2, "DataSet::getObjinfo after DataSet::removeAttr",
+ __LINE__, __FILE__);
#endif
// Create attribute on dataset
@@ -1416,7 +1452,7 @@ test_attr_dtype_shared()
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
- verify_val((int)statbuf.nlink, 3, "DataSet::createAttribute", __LINE__, __FILE__);
+ verify_val(static_cast<int>(statbuf.nlink), 3, "DataSet::createAttribute", __LINE__, __FILE__);
#endif
// Write data into the attribute
@@ -1453,7 +1489,7 @@ test_attr_dtype_shared()
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
- verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__);
+ verify_val(static_cast<int>(statbuf.nlink), 3, "DataSet::openAttribute", __LINE__, __FILE__);
#endif
} // end of second enclosing
@@ -1463,7 +1499,7 @@ test_attr_dtype_shared()
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
- verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__);
+ verify_val(static_cast<int>(statbuf.nlink), 1, "H5File::unlink", __LINE__, __FILE__);
#endif
// Unlink the named datatype
@@ -1474,7 +1510,8 @@ test_attr_dtype_shared()
// Check size of file
filesize = h5_get_file_size(FILE_DTYPE.c_str(), H5P_DEFAULT);
- verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__);
+ verify_val(static_cast<long>(filesize), static_cast<long>(empty_filesize), "Checking file size",
+ __LINE__, __FILE__);
PASSED();
} // end try block
@@ -1644,13 +1681,13 @@ test_attr_exists()
// Check for existence of attribute
bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists",
"fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not");
// Check for existence of attribute
attr_exists = fid1.attrExists(FATTR1_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists",
"fid1,FATTR2_NAMEAttribute should exist but does not");
@@ -1659,7 +1696,7 @@ test_attr_exists()
// Check for existence of attribute
attr_exists = group.attrExists(ATTR2_NAME);
- if (attr_exists == false)
+ if (!attr_exists)
throw InvalidActionException("H5File::attrExists",
"group, ATTR2_NAMEAttribute should exist but does not");
@@ -1810,7 +1847,8 @@ test_attr_corder_create_basic(FileCreatPropList &fcpl, FileAccPropList &fapl)
// Get creation order indexing on object
unsigned crt_order_flags = 0;
crt_order_flags = dcpl.getAttrCrtOrder();
- verify_val(crt_order_flags, (unsigned)0, "DSetCreatPropList::getAttrCrtOrder", __LINE__, __FILE__);
+ verify_val(static_cast<long>(crt_order_flags), 0, "DSetCreatPropList::getAttrCrtOrder", __LINE__,
+ __FILE__);
// Setting invalid combination of a attribute order creation order
// indexing on should fail
@@ -1829,7 +1867,7 @@ test_attr_corder_create_basic(FileCreatPropList &fcpl, FileAccPropList &fapl)
// verify them
dcpl.setAttrCrtOrder(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED);
crt_order_flags = dcpl.getAttrCrtOrder();
- verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED),
+ verify_val(crt_order_flags, static_cast<unsigned>(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED),
"DSetCreatPropList::getAttrCrtOrder", __LINE__, __FILE__);
// Create dataspace for dataset
@@ -1865,7 +1903,7 @@ test_attr_corder_create_basic(FileCreatPropList &fcpl, FileAccPropList &fapl)
// Query the attribute creation properties
crt_order_flags = dcpl.getAttrCrtOrder();
- verify_val(crt_order_flags, (unsigned)(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED),
+ verify_val(crt_order_flags, static_cast<unsigned>(H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED),
"DSetCreatPropList::getAttrCrtOrder", __LINE__, __FILE__);
PASSED();
diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp
index 641002e..c27171b 100644
--- a/c++/test/tcompound.cpp
+++ b/c++/test/tcompound.cpp
@@ -16,11 +16,7 @@
tcompound.cpp - HDF5 C++ testing the compound data type functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -105,11 +101,11 @@ test_compound_2()
SUBTEST("Compound Element Reordering");
try {
// Sizes should be the same, but be careful just in case
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(src_typ_t));
+ buf = static_cast<unsigned char *>(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))));
+ bkg = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(dst_typ_t)));
+ orig = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(src_typ_t)));
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
s_ptr->a = i * 8 + 0;
s_ptr->b = i * 8 + 1;
s_ptr->c[0] = i * 8 + 2;
@@ -119,7 +115,7 @@ test_compound_2()
s_ptr->d = i * 8 + 6;
s_ptr->e = i * 8 + 7;
}
- memcpy(buf, orig, nelmts * sizeof(src_typ_t));
+ HDmemcpy(buf, orig, nelmts * sizeof(src_typ_t));
// Build hdf5 datatypes
array_dt = new ArrayType(PredType::NATIVE_INT, 1, &four);
@@ -146,12 +142,12 @@ test_compound_2()
array_dt->close();
// Perform the conversion
- st.convert(dt, (size_t)nelmts, buf, bkg);
+ st.convert(dt, static_cast<size_t>(nelmts), buf, bkg);
// Compare results
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
- d_ptr = ((dst_typ_t *)buf) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
+ d_ptr = (reinterpret_cast<dst_typ_t *>(buf)) + i;
if (s_ptr->a != d_ptr->a || s_ptr->b != d_ptr->b || s_ptr->c[0] != d_ptr->c[0] ||
s_ptr->c[1] != d_ptr->c[1] || s_ptr->c[2] != d_ptr->c[2] || s_ptr->c[3] != d_ptr->c[3] ||
s_ptr->d != d_ptr->d || s_ptr->e != d_ptr->e) {
@@ -180,8 +176,7 @@ test_compound_2()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
- if (array_dt)
- delete array_dt;
+ delete array_dt;
} // test_compound_2()
/*-------------------------------------------------------------------------
@@ -219,11 +214,11 @@ test_compound_3()
SUBTEST("Compound Datatype Subset Conversions");
try {
/* Initialize */
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(src_typ_t));
+ buf = static_cast<unsigned char *>(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))));
+ bkg = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(dst_typ_t)));
+ orig = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(src_typ_t)));
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
s_ptr->a = i * 8 + 0;
s_ptr->b = i * 8 + 1;
s_ptr->c[0] = i * 8 + 2;
@@ -258,12 +253,12 @@ test_compound_3()
array_dt->close();
/* Perform the conversion */
- st.convert(dt, (size_t)nelmts, buf, bkg);
+ st.convert(dt, static_cast<size_t>(nelmts), buf, bkg);
/* Compare results */
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
- d_ptr = ((dst_typ_t *)buf) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
+ d_ptr = (reinterpret_cast<dst_typ_t *>(buf)) + i;
if (s_ptr->a != d_ptr->a || s_ptr->c[0] != d_ptr->c[0] || s_ptr->c[1] != d_ptr->c[1] ||
s_ptr->c[2] != d_ptr->c[2] || s_ptr->c[3] != d_ptr->c[3] || s_ptr->e != d_ptr->e) {
H5_FAILED();
@@ -273,8 +268,8 @@ test_compound_3()
<< ", e=" << s_ptr->e << "}" << endl;
cerr << " dst={a=" << d_ptr->a << ", c=[" << d_ptr->c[0] << "," << d_ptr->c[1] << ","
<< d_ptr->c[2] << "," << d_ptr->c[3] << "], e=" << d_ptr->e << "}" << endl;
- } // if
- } // for
+ }
+ }
/* Release resources */
HDfree(buf);
@@ -291,8 +286,7 @@ test_compound_3()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
- if (array_dt)
- delete array_dt;
+ delete array_dt;
} // test_compound_3()
/*-------------------------------------------------------------------------
@@ -335,11 +329,11 @@ test_compound_4()
SUBTEST("Compound Element Shrinking & Reordering");
try {
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(src_typ_t));
+ buf = static_cast<unsigned char *>(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))));
+ bkg = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(dst_typ_t)));
+ orig = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(src_typ_t)));
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
s_ptr->a = i * 8 + 0;
s_ptr->b = (i * 8 + 1) & 0x7fff;
s_ptr->c[0] = i * 8 + 2;
@@ -376,12 +370,12 @@ test_compound_4()
array_dt->close();
/* Perform the conversion */
- st.convert(dt, (size_t)nelmts, buf, bkg);
+ st.convert(dt, static_cast<size_t>(nelmts), buf, bkg);
/* Compare results */
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
- d_ptr = ((dst_typ_t *)buf) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
+ d_ptr = (reinterpret_cast<dst_typ_t *>(buf)) + i;
if (s_ptr->a != d_ptr->a || s_ptr->b != d_ptr->b || s_ptr->c[0] != d_ptr->c[0] ||
s_ptr->c[1] != d_ptr->c[1] || s_ptr->c[2] != d_ptr->c[2] || s_ptr->c[3] != d_ptr->c[3] ||
s_ptr->d != d_ptr->d || s_ptr->e != d_ptr->e) {
@@ -411,8 +405,7 @@ test_compound_4()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
- if (array_dt)
- delete array_dt;
+ delete array_dt;
} // test_compound_4()
/*-------------------------------------------------------------------------
@@ -480,8 +473,8 @@ test_compound_5()
/* Convert data */
memcpy(buf, src, sizeof(src));
- src_type.convert(dst_type, (size_t)2, buf, bkg);
- dst = (dst_typ_t *)buf;
+ src_type.convert(dst_type, 2, buf, bkg);
+ dst = static_cast<dst_typ_t *>(buf);
/* Cleanup */
src_type.close();
@@ -491,7 +484,7 @@ test_compound_5()
int_array.close();
/* Check results */
- if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim ||
+ if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim ||
src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] ||
src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) {
H5_FAILED();
@@ -508,8 +501,7 @@ test_compound_5()
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
- if (array_dt)
- delete array_dt;
+ delete array_dt;
} // test_compound_5()
/*-------------------------------------------------------------------------
@@ -548,11 +540,11 @@ test_compound_6()
SUBTEST("Compound Element Growing");
try {
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(dst_typ_t));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(src_typ_t));
+ buf = static_cast<unsigned char *>(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))));
+ bkg = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(dst_typ_t)));
+ orig = static_cast<unsigned char *>(HDmalloc(nelmts * sizeof(src_typ_t)));
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
s_ptr->b = (i * 8 + 1) & 0x7fff;
s_ptr->d = (i * 8 + 6) & 0x7fff;
}
@@ -568,19 +560,19 @@ test_compound_6()
dt.insertMember("d", HOFFSET(dst_typ_t, d), PredType::NATIVE_LONG);
/* Perform the conversion */
- st.convert(dt, (size_t)nelmts, buf, bkg);
+ st.convert(dt, static_cast<size_t>(nelmts), buf, bkg);
/* Compare results */
for (i = 0; i < nelmts; i++) {
- s_ptr = ((src_typ_t *)orig) + i;
- d_ptr = ((dst_typ_t *)buf) + i;
+ s_ptr = (reinterpret_cast<src_typ_t *>(orig)) + i;
+ d_ptr = (reinterpret_cast<dst_typ_t *>(buf)) + i;
if (s_ptr->b != d_ptr->b || s_ptr->d != d_ptr->d) {
H5_FAILED();
cerr << " i=" << i << endl;
cerr << " src={b=" << s_ptr->b << ", d=" << s_ptr->d << "}" << endl;
cerr << " dst={b=" << d_ptr->b << ", d=" << d_ptr->d << "}" << endl;
- } // if
- } // for
+ }
+ }
/* Release resources */
HDfree(buf);
@@ -723,22 +715,22 @@ test_compound_set_size()
// verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__);
// Expand the type, and verify that it became unpacked
- dtype.setSize((size_t)33);
+ dtype.setSize(33);
// packed = dtype.packed(); // not until C library provides API
// verify_val(packed, FALSE, "DataType::packed", __LINE__, __FILE__);
// Verify setSize() actually set size
size_t new_size = dtype.getSize();
- verify_val(new_size, (size_t)33, "DataType::getSize", __LINE__, __FILE__);
+ verify_val(static_cast<long>(new_size), 33, "DataType::getSize", __LINE__, __FILE__);
// Shrink the type, and verify that it became packed
- dtype.setSize((size_t)32);
+ dtype.setSize(32);
// packed = dtype.packed(); // not until C library provides API
// verify_val(packed, TRUE, "DataType::packed", __LINE__, __FILE__);
// Verify setSize() actually set size again
new_size = dtype.getSize();
- verify_val(new_size, (size_t)32, "DataType::getSize", __LINE__, __FILE__);
+ verify_val(static_cast<long>(new_size), 32, "DataType::getSize", __LINE__, __FILE__);
/* Close types and file */
dtype_tmp.close();
diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp
index fc73a6a..5a78133 100644
--- a/c++/test/tdspl.cpp
+++ b/c++/test/tdspl.cpp
@@ -17,11 +17,7 @@
list functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -65,11 +61,11 @@ test_transfplist()
// Find out the length of the transform expression, allocate the buffer
// for it, then read and verify the expression from the copied plist
ssize_t tran_len = dxpl_c_to_f_copy.getDataTransform(NULL);
- char * c_to_f_read = (char *)HDmalloc(tran_len + 1);
+ char * c_to_f_read = static_cast<char *>(HDmalloc(tran_len + 1));
HDmemset(c_to_f_read, 0, tran_len + 1);
dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len + 1);
- verify_val((const char *)c_to_f_read, (const char *)c_to_f, "DSetMemXferPropList::getDataTransform",
- __LINE__, __FILE__);
+ verify_val(const_cast<const char *>(c_to_f_read), const_cast<const char *>(c_to_f),
+ "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__);
HDfree(c_to_f_read);
//
@@ -80,26 +76,26 @@ test_transfplist()
// Get and verify the expression with:
// ssize_t getDataTransform(char* exp, const size_t buf_size [default=0])
tran_len = dxpl_c_to_f.getDataTransform(NULL);
- c_to_f_read = (char *)HDmalloc(tran_len + 1);
+ c_to_f_read = static_cast<char *>(HDmalloc(tran_len + 1));
HDmemset(c_to_f_read, 0, tran_len + 1);
dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len + 1);
- verify_val((const char *)c_to_f_read, (const char *)c_to_f, "DSetMemXferPropList::getDataTransform",
- __LINE__, __FILE__);
+ verify_val(const_cast<const char *>(c_to_f_read), const_cast<const char *>(c_to_f),
+ "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__);
HDfree(c_to_f_read);
// Get and verify the expression with:
// H5std_string DSetMemXferPropList::getDataTransform()
H5std_string simple_read = dxpl_simple.getDataTransform();
- verify_val((const char *)simple_read.c_str(), (const char *)simple,
+ verify_val(const_cast<const char *>(simple_read.c_str()), const_cast<const char *>(simple),
"DSetMemXferPropList::getDataTransform", __LINE__, __FILE__);
// Get and verify the expression with:
// ssize_t getDataTransform(char* exp, const size_t buf_size)
tran_len = dxpl_utrans_inv.getDataTransform(NULL, 0);
- char *utrans_inv_read = (char *)HDmalloc(tran_len + 1);
+ char *utrans_inv_read = static_cast<char *>(HDmalloc(tran_len + 1));
HDmemset(utrans_inv_read, 0, tran_len + 1);
dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len + 1);
- verify_val((const char *)utrans_inv_read, (const char *)utrans_inv,
+ verify_val(const_cast<const char *>(utrans_inv_read), const_cast<const char *>(utrans_inv),
"DSetMemXferPropList::getDataTransform", __LINE__, __FILE__);
HDfree(utrans_inv_read);
diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp
index da5e2a4..71428ce 100644
--- a/c++/test/testhdf5.cpp
+++ b/c++/test/testhdf5.cpp
@@ -38,11 +38,7 @@
GetTestNumErrs() -- Retrieve the number of testing errors
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index b082f0a..15bad64 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -20,11 +20,7 @@
h5_fileaccess() -- in h5test.c, returns a file access template
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -35,14 +31,14 @@ using namespace H5;
#include "h5test.h"
#include "h5cpputil.h" // C++ utilility header file
-const hsize_t F1_USERBLOCK_SIZE = (hsize_t)0;
+const hsize_t F1_USERBLOCK_SIZE = 0;
const size_t F1_OFFSET_SIZE = sizeof(haddr_t);
const size_t F1_LENGTH_SIZE = sizeof(hsize_t);
const unsigned F1_SYM_LEAF_K = 4;
const unsigned F1_SYM_INTERN_K = 16;
const H5std_string FILE1("tfile1.h5");
-const hsize_t F2_USERBLOCK_SIZE = (hsize_t)512;
+const hsize_t F2_USERBLOCK_SIZE = 512;
const size_t F2_OFFSET_SIZE = 8;
const size_t F2_LENGTH_SIZE = 8;
const unsigned F2_SYM_LEAF_K = 8;
@@ -50,7 +46,7 @@ const unsigned F2_SYM_INTERN_K = 32;
const unsigned F2_ISTORE = 64;
const H5std_string FILE2("tfile2.h5");
-const hsize_t F3_USERBLOCK_SIZE = (hsize_t)0;
+const hsize_t F3_USERBLOCK_SIZE = 0;
const size_t F3_OFFSET_SIZE = F2_OFFSET_SIZE;
const size_t F3_LENGTH_SIZE = F2_LENGTH_SIZE;
const unsigned F3_SYM_LEAF_K = F2_SYM_LEAF_K;
@@ -157,8 +153,8 @@ test_file_create()
FileCreatPropList tmpl1 = file1->getCreatePlist();
hsize_t ublock = tmpl1.getUserblock();
- verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__,
- __FILE__);
+ verify_val(static_cast<long>(ublock), static_cast<long>(F1_USERBLOCK_SIZE),
+ "FileCreatPropList::getUserblock", __LINE__, __FILE__);
size_t parm1, parm2; // file-creation parameters
tmpl1.getSizes(parm1, parm2);
@@ -179,14 +175,14 @@ test_file_create()
catch (InvalidActionException &E) {
cerr << " *FAILED*" << endl;
cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl;
- if (file1 != NULL) // clean up
- delete file1;
+ // clean up
+ delete file1;
}
// catch all other exceptions
catch (Exception &E) {
issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg());
- if (file1 != NULL) // clean up
- delete file1;
+ // clean up
+ delete file1;
}
// Setting this to NULL for cleaning up in failure situations
@@ -213,8 +209,8 @@ test_file_create()
// Get the file-creation parameters
hsize_t ublock = tmpl1->getUserblock();
- verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__,
- __FILE__);
+ verify_val(static_cast<long>(ublock), static_cast<long>(F2_USERBLOCK_SIZE),
+ "FileCreatPropList::getUserblock", __LINE__, __FILE__);
size_t parm1, parm2; // file-creation parameters
tmpl1->getSizes(parm1, parm2);
@@ -246,8 +242,8 @@ test_file_create()
// Get the file-creation parameters
ublock = tmpl1->getUserblock();
- verify_val((long)ublock, (long)F3_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__,
- __FILE__);
+ verify_val(static_cast<long>(ublock), static_cast<long>(F3_USERBLOCK_SIZE),
+ "FileCreatPropList::getUserblock", __LINE__, __FILE__);
tmpl1->getSizes(parm1, parm2);
verify_val(parm1, F3_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
@@ -264,8 +260,8 @@ test_file_create()
// catch all exceptions
catch (Exception &E) {
issue_fail_msg("test_file_create()", __LINE__, __FILE__, E.getCDetailMsg());
- if (tmpl1 != NULL) // clean up
- delete tmpl1;
+ // clean up
+ delete tmpl1;
}
} // test_file_create()
@@ -304,8 +300,8 @@ test_file_open()
// Get the file-creation parameters
hsize_t ublock = tmpl1.getUserblock();
- verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__,
- __FILE__);
+ verify_val(static_cast<long>(ublock), static_cast<long>(F2_USERBLOCK_SIZE),
+ "FileCreatPropList::getUserblock", __LINE__, __FILE__);
size_t parm1, parm2; // file-creation parameters
tmpl1.getSizes(parm1, parm2);
@@ -649,7 +645,8 @@ test_file_attribute()
// Get the class of a file attribute's datatype
H5T_class_t atclass = fattr1.getTypeClass();
- verify_val(atclass, H5T_FLOAT, "Attribute::getTypeClass()", __LINE__, __FILE__);
+ verify_val(static_cast<long>(atclass), static_cast<long>(H5T_FLOAT), "Attribute::getTypeClass()",
+ __LINE__, __FILE__);
// Get and verify the number of attributes attached to a file
int n_attrs = file5.getNumAttrs();
@@ -900,9 +897,9 @@ test_file_info()
// Get the file's version information.
H5F_info2_t finfo;
tempfile.getFileInfo(finfo);
- verify_val(finfo.super.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
- verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
- verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.super.version), 0, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.free.version), 0, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.sohm.version), 0, "H5File::getFileInfo", __LINE__, __FILE__);
// Close the file.
tempfile.close();
@@ -914,9 +911,10 @@ test_file_info()
fcpl.getFileSpaceStrategy(out_strategy, out_persist, out_threshold);
// Verify file space information.
- verify_val(out_strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(out_strategy), static_cast<long>(H5F_FSPACE_STRATEGY_FSM_AGGR),
+ "H5File::getFileInfo", __LINE__, __FILE__);
verify_val(out_persist, FALSE, "H5File::getFileInfo", __LINE__, __FILE__);
- verify_val(out_threshold, 1, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(out_threshold), 1, "H5File::getFileInfo", __LINE__, __FILE__);
/* Retrieve file space page size */
hsize_t out_fsp_psize = fcpl.getFileSpacePagesize();
@@ -947,9 +945,9 @@ test_file_info()
// Get the file's version information.
file7.getFileInfo(finfo);
- verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__);
- verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
- verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.super.version), 2, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.free.version), 0, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.sohm.version), 0, "H5File::getFileInfo", __LINE__, __FILE__);
// Close the file.
file7.close();
@@ -962,9 +960,9 @@ test_file_info()
// Get the file's version information.
file7.getFileInfo(finfo);
- verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__);
- verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
- verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.super.version), 2, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.free.version), 0, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(static_cast<long>(finfo.sohm.version), 0, "H5File::getFileInfo", __LINE__, __FILE__);
// Retrieve the property values & check them.
hsize_t userblock = fcpl2.getUserblock();
@@ -990,7 +988,8 @@ test_file_info()
// Get and verify the file space info from the creation property list */
fcpl2.getFileSpaceStrategy(out_strategy, out_persist, out_threshold);
- verify_val(out_strategy, strategy, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
+ verify_val(static_cast<long>(out_strategy), static_cast<long>(strategy),
+ "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
verify_val(out_persist, persist, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
verify_val(out_threshold, threshold, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp
index 1ded033..e89838c 100644
--- a/c++/test/tfilter.cpp
+++ b/c++/test/tfilter.cpp
@@ -16,11 +16,7 @@
tfilter.cpp - HDF5 C++ testing various filters and their combination.
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -49,20 +45,18 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl,
/* Temporary filter IDs used for testing */
const int H5Z_FILTER_BOGUS = 305;
-#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead
-static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
-#endif
-static size_t filter_bogus(size_t nbytes);
+static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes,
+ size_t *buf_size, void **buf);
+
/* This message derives from H5Z */
const H5Z_class2_t H5Z_BOGUS[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_BOGUS, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "bogus", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)filter_bogus, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_BOGUS, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "bogus", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ filter_bogus, /* The actual filter function */
}};
/*-------------------------------------------------------------------------
@@ -79,13 +73,15 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
-#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead
-filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
- const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
- size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
-#endif
-filter_bogus(size_t nbytes)
+filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes,
+ size_t *buf_size, void **buf)
{
+ (void)flags;
+ (void)cd_nelmts;
+ (void)cd_values;
+ (void)buf_size;
+ (void)buf;
+
return nbytes;
}
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index e57ac04..5808136 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -19,11 +19,7 @@
EXTERNAL ROUTINES/VARIABLES:
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -77,7 +73,7 @@ struct space4_struct {
unsigned u;
float f;
char c2;
-} space4_data = {'v', 987123, (float)-3.14, 'g'}; /* Test data for 4th dataspace */
+} space4_data = {'v', 987123, -3.14f, 'g'}; /* Test data for 4th dataspace */
/* Null dataspace */
int space5_data = 7;
@@ -122,7 +118,7 @@ test_h5s_basic()
// Get simple extent npoints of the dataspace sid1 and verify it
hssize_t n; // Number of dataspace elements
n = sid1.getSimpleExtentNpoints();
- verify_val((long)n, (long)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3),
+ verify_val(static_cast<long>(n), SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
"DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of dataspace sid1 and verify it
@@ -144,7 +140,7 @@ test_h5s_basic()
// Get simple extent npoints of dataspace sid2 and verify it
n = sid2.getSimpleExtentNpoints();
- verify_val((long)n, (long)(SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4),
+ verify_val(static_cast<long>(n), SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4,
"DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of dataspace sid2 and verify it
@@ -204,6 +200,7 @@ test_h5s_basic()
// CHECK_I(ret, "H5Fclose"); // leave this here, later, fake a failure
// in the p_close see how this will handle it. - BMR
+ // When running in valgrind, this PASSED macro will be missed
PASSED();
} // end of try block
@@ -252,7 +249,7 @@ test_h5s_scalar_write()
// n = H5Sget_simple_extent_npoints(sid1);
hssize_t n; // Number of dataspace elements
n = sid1.getSimpleExtentNpoints();
- verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(n), 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
int rank; // Logical rank of dataspace
rank = sid1.getSimpleExtentNdims();
@@ -267,7 +264,8 @@ test_h5s_scalar_write()
// Verify extent type
H5S_class_t ext_type; // Extent type
ext_type = sid1.getSimpleExtentType();
- verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(ext_type), static_cast<long>(H5S_SCALAR),
+ "DataSpace::getSimpleExtentType", __LINE__, __FILE__);
// Create and write a dataset
DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT, sid1);
@@ -318,7 +316,7 @@ test_h5s_scalar_read()
// Get the number of dataspace elements
hssize_t n = sid1.getSimpleExtentNpoints();
- verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(n), 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of the dataspace
int ndims = sid1.getSimpleExtentNdims();
@@ -375,7 +373,7 @@ test_h5s_null()
hssize_t n; // Number of dataspace elements
n = sid1.getSimpleExtentNpoints();
- verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(n), 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Create a dataset
DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT, sid1);
@@ -440,7 +438,7 @@ test_h5s_compound_scalar_write()
// Get the number of dataspace elements
hssize_t n = sid1.getSimpleExtentNpoints();
- verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(n), 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of the dataspace
int ndims = sid1.getSimpleExtentNdims();
@@ -500,7 +498,7 @@ test_h5s_compound_scalar_read()
// Get the number of dataspace elements
hssize_t n = sid1.getSimpleExtentNpoints();
- verify_val((long)n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(n), 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of the dataspace
int ndims = sid1.getSimpleExtentNdims();
@@ -516,7 +514,7 @@ test_h5s_compound_scalar_read()
dataset.read(&rdata, type);
// Verify read data
- if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct))) {
+ if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) {
cerr << "scalar data different: space4_data.c1=" << space4_data.c1
<< ", read_data4.c1=" << rdata.c1 << endl;
cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u
diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp
index 1fb2f57..b6a9436 100644
--- a/c++/test/titerate.cpp
+++ b/c++/test/titerate.cpp
@@ -16,11 +16,7 @@
titerate.cpp - HDF5 C++ testing iterate related functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -71,7 +67,8 @@ typedef struct {
iter_enum command; /* The type of return value */
} iter_info;
-int iter_strcmp(const void *s1, const void *s2);
+static int iter_strcmp(const void *s1, const void *s2);
+static void printelems(const Group &group, const H5std_string &dsname, const H5std_string &atname);
/*-------------------------------------------------------------------------
* Function: iter_strcmp
@@ -79,10 +76,10 @@ int iter_strcmp(const void *s1, const void *s2);
* Purpose String comparison routine for qsort
*-------------------------------------------------------------------------
*/
-int
+static int
iter_strcmp(const void *s1, const void *s2)
{
- return (HDstrcmp(*(const char *const *)s1, *(const char *const *)s2));
+ return (HDstrcmp(*reinterpret_cast<const char *const *>(s1), *reinterpret_cast<const char *const *>(s2)));
}
/*-------------------------------------------------------------------------
@@ -95,7 +92,7 @@ static herr_t
liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t H5_ATTR_UNUSED *link_info,
void *op_data)
{
- iter_info *info = (iter_info *)op_data;
+ iter_info *info = static_cast<iter_info *>(op_data);
static int count = 0;
static int count2 = 0;
@@ -137,7 +134,6 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t H5_ATTR
static void
test_iter_group(FileAccPropList &fapl)
{
- int i; /* counting variable */
hsize_t idx; /* Index in the group */
char name[NAMELEN]; /* temporary name buffer */
char * lnames[NDATASETS + 2]; /* Names of the links created */
@@ -163,7 +159,7 @@ test_iter_group(FileAccPropList &fapl)
// Create a scalar file space
DataSpace filespace;
- for (i = 0; i < NDATASETS; i++) {
+ for (int i = 0; i < NDATASETS; i++) {
sprintf(name, "Dataset %d", i);
// Create a dataset in the file
@@ -172,8 +168,7 @@ test_iter_group(FileAccPropList &fapl)
/* Keep a copy of the dataset names */
lnames[i] = HDstrdup(name);
check_values(lnames[i], "HDstrdup returns NULL", __LINE__, __FILE__);
-
- } /* end for */
+ }
/* Create a group and named datatype under root group for testing */
Group grp(file.createGroup(GROUP1, 0));
@@ -185,7 +180,7 @@ test_iter_group(FileAccPropList &fapl)
check_values(lnames[NDATASETS], "HDstrdup returns NULL", __LINE__, __FILE__);
/* Sort the dataset names */
- HDqsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp);
+ HDqsort(lnames, NDATASETS + 2, sizeof(char *), iter_strcmp);
/* Iterate through the datasets in the root group in various ways */
@@ -197,10 +192,10 @@ test_iter_group(FileAccPropList &fapl)
// Get the number of object in the root group
hsize_t nobjs = root_group.getNumObjs();
- verify_val(nobjs, (hsize_t)(NDATASETS + 2), "H5Gget_info", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nobjs), NDATASETS + 2, "H5Gget_info", __LINE__, __FILE__);
H5std_string obj_name;
- for (i = 0; i < nobjs; i++) {
+ for (hsize_t i = 0; i < nobjs; i++) {
// H5O_info2_t oinfo; /* Object info */
obj_name = root_group.getObjnameByIdx(i);
@@ -210,7 +205,7 @@ test_iter_group(FileAccPropList &fapl)
// oinfo = root_group.childObjType((hsize_t)i, H5_INDEX_NAME, H5_ITER_INC, ".");
// ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo,
// H5P_DEFAULT);
- } /* end for */
+ }
// Attempted to iterate with invalid index, should fail
try {
@@ -226,7 +221,7 @@ test_iter_group(FileAccPropList &fapl)
// Attempted to iterate with negative index, should fail
try {
info.command = RET_ZERO;
- idx = (hsize_t)-1;
+ idx = HSIZE_UNDEF;
obj_name = root_group.getObjnameByIdx(idx);
// Should FAIL but didn't, so throw an invalid action exception
@@ -272,7 +267,7 @@ test_iter_group(FileAccPropList &fapl)
} // do nothing, exception expected
/* Free the dataset names */
- for (i = 0; i < (NDATASETS + 2); i++)
+ for (int i = 0; i < NDATASETS + 2; i++)
HDfree(lnames[i]);
// Everything will be closed as they go out of scope
@@ -364,7 +359,7 @@ const H5std_string ATTR_NAME("Units");
const H5std_string FATTR_NAME("F attr");
const H5std_string GATTR_NAME("G attr");
const int DIM1 = 2;
-void
+static void
printelems(const Group &group, const H5std_string &dsname, const H5std_string &atname)
{
try {
diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp
index 231bff2..8c7f0cd 100644
--- a/c++/test/tlinks.cpp
+++ b/c++/test/tlinks.cpp
@@ -16,11 +16,7 @@
C link interface (H5L)
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -205,7 +201,8 @@ test_lcpl(hid_t fapl_id, hbool_t new_format)
// Check that its character encoding is the default.
linfo = file.getLinkInfo("/type");
- verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__);
+ verify_val(static_cast<long>(linfo.cset), static_cast<long>(H5T_CSET_ASCII),
+ "Character encoding is not default", __LINE__, __FILE__);
// Create a simple dataspace.
dims[0] = H5L_DIM1;
@@ -218,7 +215,8 @@ test_lcpl(hid_t fapl_id, hbool_t new_format)
// Check that its character encoding is the default.
linfo = file.getLinkInfo("/dataset");
- verify_val(linfo.cset, H5T_CSET_ASCII, "Character encoding is not default", __LINE__, __FILE__);
+ verify_val(static_cast<long>(linfo.cset), static_cast<long>(H5T_CSET_ASCII),
+ "Character encoding is not default", __LINE__, __FILE__);
// Create a link creation property list with the UTF-8 character encoding.
LinkCreatPropList lcpl;
@@ -230,7 +228,8 @@ test_lcpl(hid_t fapl_id, hbool_t new_format)
// Check that its character encoding is UTF-8.
linfo = file.getLinkInfo(GROUP2NAME);
- verify_val(linfo.cset, H5T_CSET_UTF8, "Character encoding is not UTF-8", __LINE__, __FILE__);
+ verify_val(static_cast<long>(linfo.cset), static_cast<long>(H5T_CSET_UTF8),
+ "Character encoding is not UTF-8", __LINE__, __FILE__);
PASSED();
} // end of try block
@@ -584,16 +583,17 @@ const H5std_string GROUP_NAME("/Data");
const H5std_string DSET1_NAME("/Data/Compressed_Data");
const H5std_string DSET2_NAME("/Data/Float_Data");
const int RANK = 2;
-const int DIM1 = 2;
// Operator function
static int
visit_obj_cb(H5Object &obj, const H5std_string name, const H5O_info2_t *oinfo, void *_op_data)
{
+ (void)obj; // Unused
+
ovisit_ud_t *op_data = static_cast<ovisit_ud_t *>(_op_data);
// Check for correct object information
- if (strcmp(op_data->info[op_data->idx].path, name.c_str()))
+ if (strcmp(op_data->info[op_data->idx].path, name.c_str()) != 0)
return (H5_ITER_ERROR);
if (op_data->info[op_data->idx].type != oinfo->type)
return (H5_ITER_ERROR);
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index 87abd43..2b694da 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -16,11 +16,7 @@
tobject.cpp - HDF5 C++ testing object related functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
#include "H5Cpp.h" // C++ API header file
@@ -91,7 +87,7 @@ test_get_objname()
if (name_len > 4) {
char *grp1_name = new char[5];
name_len = grp1.getObjName(grp1_name, 5);
- verify_val((const char *)grp1_name, "/Top", "Group::getObjName", __LINE__, __FILE__);
+ verify_val(const_cast<const char *>(grp1_name), "/Top", "Group::getObjName", __LINE__, __FILE__);
delete[] grp1_name;
}
@@ -321,8 +317,8 @@ test_get_objname_ontypes()
// Name this datatype
new_int_type.commit(grp, "IntType NATIVE_INT");
ssize_t name_len = new_int_type.getObjName(type_name); // default len
- verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName",
- __LINE__, __FILE__);
+ verify_val(name_len, static_cast<ssize_t>(HDstrlen("/typetests/IntType NATIVE_INT")),
+ "DataType::getObjName", __LINE__, __FILE__);
verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__);
// Close everything or they can be closed when objects go out of scope
@@ -370,25 +366,29 @@ test_get_objtype()
// Get and verify object type with
// H5O_type_t childObjType(const H5std_string& objname)
H5O_type_t objtype = file.childObjType(DSET_IN_FILE);
- verify_val(objtype, H5O_TYPE_DATASET, "DataSet::childObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(objtype), static_cast<long>(H5O_TYPE_DATASET), "DataSet::childObjType",
+ __LINE__, __FILE__);
// Get and verify object type with
// H5O_type_t childObjType(const char* objname)
objtype = grp1.childObjType(GROUP1_1.c_str());
- verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(objtype), static_cast<long>(H5O_TYPE_GROUP), "DataSet::childObjType",
+ __LINE__, __FILE__);
// Get and verify object type with
// H5O_type_t childObjType(hsize_t index, H5_index_t index_type,
// H5_iter_order_t order, const char* objname=".")
- objtype = grp1.childObjType((hsize_t)1, H5_INDEX_NAME, H5_ITER_INC);
- verify_val(objtype, H5O_TYPE_NAMED_DATATYPE, "DataSet::childObjType", __LINE__, __FILE__);
+ objtype = grp1.childObjType(1, H5_INDEX_NAME, H5_ITER_INC);
+ verify_val(static_cast<long>(objtype), static_cast<long>(H5O_TYPE_NAMED_DATATYPE),
+ "DataSet::childObjType", __LINE__, __FILE__);
// Get and verify object type with
// H5O_type_t childObjType(hsize_t index,
// H5_index_t index_type=H5_INDEX_NAME,
// H5_iter_order_t order=H5_ITER_INC, const char* objname=".")
- objtype = grp1.childObjType((hsize_t)2);
- verify_val(objtype, H5O_TYPE_GROUP, "DataSet::childObjType", __LINE__, __FILE__);
+ objtype = grp1.childObjType(2);
+ verify_val(static_cast<long>(objtype), static_cast<long>(H5O_TYPE_GROUP), "DataSet::childObjType",
+ __LINE__, __FILE__);
// Everything will be closed as they go out of scope
@@ -459,17 +459,20 @@ test_open_object_header()
// Make sure that each is the right kind of ID
H5I_type_t id_type = IdComponent::getHDFObjType(obj_grp);
- verify_val(id_type, H5I_GROUP, "H5Iget_type for group ID", __LINE__, __FILE__);
+ verify_val(static_cast<long>(id_type), static_cast<long>(H5I_GROUP), "H5Iget_type for group ID",
+ __LINE__, __FILE__);
id_type = IdComponent::getHDFObjType(obj_dtype);
- verify_val(id_type, H5I_DATATYPE, "H5Iget_type for datatype ID", __LINE__, __FILE__);
+ verify_val(static_cast<long>(id_type), static_cast<long>(H5I_DATATYPE), "H5Iget_type for datatype ID",
+ __LINE__, __FILE__);
id_type = IdComponent::getHDFObjType(obj_dset);
- verify_val(id_type, H5I_DATASET, "H5Iget_type for dataset ID", __LINE__, __FILE__);
+ verify_val(static_cast<long>(id_type), static_cast<long>(H5I_DATASET), "H5Iget_type for dataset ID",
+ __LINE__, __FILE__);
/* Do something more complex with each of the IDs to make sure */
Group grp2(obj_grp);
hsize_t num_objs = grp2.getNumObjs();
- verify_val(num_objs, 1, "H5Gget_info", __LINE__, __FILE__);
+ verify_val(static_cast<long>(num_objs), 1, "H5Gget_info", __LINE__, __FILE__);
// There should be one object, the datatype
// Close datatype object opened from the file
@@ -486,7 +489,8 @@ test_open_object_header()
dtype.setId(obj_dtype);
H5T_class_t type_class = dtype.getClass();
- verify_val(type_class, H5T_INTEGER, "H5Tget_class", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_INTEGER), "H5Tget_class", __LINE__,
+ __FILE__);
dtype.close();
// Close datatype object
@@ -497,7 +501,7 @@ test_open_object_header()
// Try doing something with group, the ID should still work
num_objs = grp2.getNumObjs();
- verify_val(num_objs, 1, "H5Gget_info", __LINE__, __FILE__);
+ verify_val(static_cast<long>(num_objs), 1, "H5Gget_info", __LINE__, __FILE__);
// Close the cloned group
grp2.close();
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index 5ec04cd..53a4ed3 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -17,11 +17,7 @@
Reference interface (H5R)
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -85,9 +81,9 @@ test_reference_params()
// Allocate write & read buffers
int temp_size = MAX(sizeof(unsigned), sizeof(hobj_ref_t));
- wbuf = (hobj_ref_t *)HDmalloc(temp_size * SPACE1_DIM1);
- rbuf = (hobj_ref_t *)HDmalloc(temp_size * SPACE1_DIM1);
- tbuf = (hobj_ref_t *)HDmalloc(temp_size * SPACE1_DIM1);
+ wbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
+ rbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
+ tbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
// Create file FILE1
file1 = new H5File(FILE1, H5F_ACC_TRUNC);
@@ -107,7 +103,7 @@ test_reference_params()
unsigned *tu32; // Temporary pointer to uint32 data
int i;
- for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
+ for (tu32 = reinterpret_cast<unsigned *>(wbuf), i = 0; i < SPACE1_DIM1; i++)
*tu32++ = i * 3; // from C test
// Write selection to disk
@@ -183,8 +179,7 @@ test_reference_params()
issue_fail_msg("test_reference_param()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg());
}
- if (file1)
- delete file1;
+ delete file1;
} /* test_reference_param() */
/*-------------------------------------------------------------------------
@@ -213,9 +208,9 @@ test_reference_obj()
// Allocate write & read buffers
int temp_size = MAX(sizeof(unsigned), sizeof(hobj_ref_t));
- wbuf = (hobj_ref_t *)HDmalloc(temp_size * SPACE1_DIM1);
- rbuf = (hobj_ref_t *)HDmalloc(temp_size * SPACE1_DIM1);
- tbuf = (hobj_ref_t *)HDmalloc(temp_size * SPACE1_DIM1);
+ wbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
+ rbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
+ tbuf = static_cast<hobj_ref_t *>(HDmalloc(temp_size * SPACE1_DIM1));
// Create file FILE1
file1 = new H5File(FILE1, H5F_ACC_TRUNC);
@@ -237,7 +232,7 @@ test_reference_obj()
DataSet dataset = group.createDataSet(DSET1_NAME, PredType::NATIVE_UINT, sid1);
unsigned *tu32; // Temporary pointer to uint32 data
- for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
+ for (tu32 = reinterpret_cast<unsigned *>(wbuf), i = 0; i < SPACE1_DIM1; i++)
*tu32++ = i * 3; // from C test
// Write selection to disk
@@ -273,22 +268,26 @@ test_reference_obj()
// Create reference to dataset and test getRefObjType
file1->reference(&wbuf[0], "/Group1/Dataset1");
H5O_type_t refobj_type = dataset.getRefObjType(&wbuf[0], H5R_OBJECT);
- verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(refobj_type), static_cast<long>(H5O_TYPE_DATASET),
+ "DataSet::getRefObjType", __LINE__, __FILE__);
// Create reference to dataset and test getRefObjType
file1->reference(&wbuf[1], "/Group1/Dataset2");
refobj_type = dataset.getRefObjType(&wbuf[1], H5R_OBJECT);
- verify_val(refobj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(refobj_type), static_cast<long>(H5O_TYPE_DATASET),
+ "DataSet::getRefObjType", __LINE__, __FILE__);
// Create reference to group
file1->reference(&wbuf[2], "/Group1");
refobj_type = dataset.getRefObjType(&wbuf[2], H5R_OBJECT);
- verify_val(refobj_type, H5O_TYPE_GROUP, "DataSet::getRefObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(refobj_type), static_cast<long>(H5O_TYPE_GROUP),
+ "DataSet::getRefObjType", __LINE__, __FILE__);
// Create reference to named datatype
file1->reference(&wbuf[3], "/Group1/Datatype1");
refobj_type = dataset.getRefObjType(&wbuf[3], H5R_OBJECT);
- verify_val(refobj_type, H5O_TYPE_NAMED_DATATYPE, "DataSet::getRefObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(refobj_type), static_cast<long>(H5O_TYPE_NAMED_DATATYPE),
+ "DataSet::getRefObjType", __LINE__, __FILE__);
// Write selection to disk
dataset.write(wbuf, PredType::STD_REF_OBJ);
@@ -314,13 +313,14 @@ test_reference_obj()
// Check information in the referenced dataset
sid1 = dset2.getSpace();
hssize_t n_elements = sid1.getSimpleExtentNpoints();
- verify_val((long)n_elements, 4, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(n_elements), 4, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Read from disk
dset2.read(tbuf, PredType::NATIVE_UINT);
- for (tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- verify_val(*tu32, (uint32_t)(i * 3), "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ for (tu32 = reinterpret_cast<unsigned *>(tbuf), i = 0; i < SPACE1_DIM1; i++, tu32++)
+ verify_val(*tu32, static_cast<uint32_t>(i * 3), "DataSpace::getSimpleExtentNpoints", __LINE__,
+ __FILE__);
// Close dereferenced dataset
dset2.close();
@@ -358,7 +358,8 @@ test_reference_obj()
H5T_class_t tclass;
tclass = dtype1.getClass();
- verify_val(tclass, H5T_COMPOUND, "DataType::getClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(tclass), static_cast<long>(H5T_COMPOUND), "DataType::getClass", __LINE__,
+ __FILE__);
int n_members = dtype1.getNmembers();
verify_val(n_members, 3, "CompType::getNmembers", __LINE__, __FILE__);
@@ -378,8 +379,7 @@ test_reference_obj()
issue_fail_msg("test_reference_obj()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg());
}
- if (file1)
- delete file1;
+ delete file1;
} // test_reference_obj()
/*-------------------------------------------------------------------------
@@ -474,11 +474,11 @@ test_reference_group()
// Check number of objects in the group dereferenced by constructor
hsize_t nobjs = refgroup.getNumObjs();
- verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nobjs), 3, "H5Group::getNumObjs", __LINE__, __FILE__);
// Check number of objects in the group dereferenced by ::reference
nobjs = group.getNumObjs();
- verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nobjs), 3, "H5Group::getNumObjs", __LINE__, __FILE__);
// Check getting file name given the group dereferenced via constructor
H5std_string fname = refgroup.getFileName();
@@ -491,13 +491,14 @@ test_reference_group()
// Check object type using Group::getObjinfo()
H5O_info2_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
- group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, oinfo);
- verify_val(oinfo.type, H5O_TYPE_DATASET, "Group::getObjinfo", __LINE__, __FILE__);
+ group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, 0, oinfo);
+ verify_val(static_cast<long>(oinfo.type), static_cast<long>(H5O_TYPE_DATASET), "Group::getObjinfo",
+ __LINE__, __FILE__);
// Check for out of bound query by index
try {
HDmemset(&oinfo, 0, sizeof(oinfo));
- group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)9, oinfo);
+ group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, 9, oinfo);
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("Group::getObjinfo", "Out of bound index.");
@@ -508,7 +509,7 @@ test_reference_group()
// Unlink one of the objects in the dereferenced group, and re-check
refgroup.unlink(GROUPNAME2);
nobjs = refgroup.getNumObjs();
- verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nobjs), 2, "H5Group::getNumObjs", __LINE__, __FILE__);
// Close resources
group.close();
@@ -522,8 +523,7 @@ test_reference_group()
issue_fail_msg("test_reference_group()", __LINE__, __FILE__, E.getCFuncName(), E.getCDetailMsg());
}
- if (file1)
- delete file1;
+ delete file1;
} /* test_reference_group() */
/*-------------------------------------------------------------------------
@@ -557,10 +557,10 @@ test_reference_region_1D()
*drbuf; // Buffer for reading numeric data from disk
// Allocate write & read buffers
- wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
- rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1);
- dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1);
- drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
+ wbuf = static_cast<hdset_reg_ref_t *>(HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1));
+ rbuf = static_cast<hdset_reg_ref_t *>(HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1));
+ dwbuf = static_cast<uint8_t *>(HDmalloc(sizeof(uint8_t) * SPACE3_DIM1));
+ drbuf = static_cast<uint8_t *>(HDcalloc(sizeof(uint8_t), SPACE3_DIM1));
// Create file FILE1
H5File file1(FILE2, H5F_ACC_TRUNC);
@@ -577,7 +577,7 @@ test_reference_region_1D()
uint8_t *tu8; // Temporary pointer to uint8 data
for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++)
- *tu8++ = i * 3; // from C test
+ *tu8++ = static_cast<uint8_t>(i); // from C test
// Write selection to disk
dset3.write(dwbuf, PredType::STD_U8LE);
@@ -614,7 +614,8 @@ test_reference_region_1D()
// Get and verify object type
H5O_type_t obj_type = dset1.getRefObjType(&wbuf[0], H5R_DATASET_REGION);
- verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(obj_type), static_cast<long>(H5O_TYPE_DATASET), "DataSet::getRefObjType",
+ __LINE__, __FILE__);
/* Select sequence of ten points for second reference */
coord1[0][0] = 16;
@@ -629,7 +630,7 @@ test_reference_region_1D()
coord1[9][0] = 3;
// Selects array elements to be included in the selection for sid3
- sid3.selectElements(H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ sid3.selectElements(H5S_SELECT_SET, POINT1_NPOINTS, reinterpret_cast<const hsize_t *>(coord1));
// Get and verify the number of elements in a dataspace selection
nelms = sid3.getSelectNpoints();
@@ -665,12 +666,14 @@ test_reference_region_1D()
// Get and verify object type
obj_type = dset1.getRefObjType(&rbuf[0], H5R_DATASET_REGION);
- verify_val(obj_type, H5O_TYPE_DATASET, "DataSet::getRefObjType", __LINE__, __FILE__);
+ verify_val(static_cast<long>(obj_type), static_cast<long>(H5O_TYPE_DATASET),
+ "DataSet::getRefObjType", __LINE__, __FILE__);
// Get dataspace of dset3 the verify number of elements
sid1 = dset3.getSpace();
nelms = sid1.getSimpleExtentNpoints();
- verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nelms), 100, "DataSpace::getSimpleExtentNpoints", __LINE__,
+ __FILE__);
} // End of test DataSet::dereference
{ // Test DataSet constructor -by dereference
@@ -681,7 +684,8 @@ test_reference_region_1D()
// Get dataspace of newds then verify number of elements
sid1 = newds.getSpace();
nelms = sid1.getSimpleExtentNpoints();
- verify_val((long)nelms, 100, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nelms), 100, "DataSpace::getSimpleExtentNpoints", __LINE__,
+ __FILE__);
// Close objects for this mini test
newds.close();
@@ -691,8 +695,9 @@ test_reference_region_1D()
// Read from disk
dset3.read(drbuf, PredType::STD_U8LE);
- for (tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++)
- verify_val(*tu8, (uint8_t)(i * 3), "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ for (tu8 = static_cast<uint8_t *>(drbuf), i = 0; i < SPACE3_DIM1; i++, tu8++)
+ verify_val(*tu8, static_cast<uint8_t>(i), "DataSpace::getSimpleExtentNpoints", __LINE__,
+ __FILE__);
/*
* Test getting the referenced region
@@ -703,56 +708,56 @@ test_reference_region_1D()
// Get and verify number of elements in a dataspace selection
nelms = reg_sp.getSelectNpoints();
- verify_val((long)nelms, 30, "DataSpace::getSelectNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nelms), 30, "DataSpace::getSelectNpoints", __LINE__, __FILE__);
// Get and verify number of hyperslab blocks
nelms = reg_sp.getSelectHyperNblocks();
- verify_val((long)nelms, 15, "DataSpace::getSelectNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nelms), 15, "DataSpace::getSelectNpoints", __LINE__, __FILE__);
/* Allocate space for the hyperslab blocks */
- coords = (hsize_t *)HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2);
+ coords = static_cast<hsize_t *>(HDmalloc(nelms * SPACE3_RANK * sizeof(hsize_t) * 2));
// Get the list of hyperslab blocks currently selected
- reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords);
+ reg_sp.getSelectHyperBlocklist(0, static_cast<hsize_t>(nelms), coords);
// Verify values in the list
- verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[4], (hsize_t)12, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[5], (hsize_t)13, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[6], (hsize_t)17, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[7], (hsize_t)18, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[8], (hsize_t)22, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[9], (hsize_t)23, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[10], (hsize_t)27, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[11], (hsize_t)28, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[12], (hsize_t)32, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[13], (hsize_t)33, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[14], (hsize_t)37, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[15], (hsize_t)38, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[16], (hsize_t)42, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[17], (hsize_t)43, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[18], (hsize_t)47, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[19], (hsize_t)48, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[20], (hsize_t)52, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[21], (hsize_t)53, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[22], (hsize_t)57, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[23], (hsize_t)58, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[24], (hsize_t)62, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[25], (hsize_t)63, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[26], (hsize_t)67, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[27], (hsize_t)68, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[28], (hsize_t)72, "Hyperslab Coordinates", __LINE__, __FILE__);
- verify_val(coords[29], (hsize_t)73, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[0]), 2, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[1]), 3, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[2]), 7, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[3]), 8, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[4]), 12, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[5]), 13, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[6]), 17, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[7]), 18, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[8]), 22, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[9]), 23, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[10]), 27, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[11]), 28, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[12]), 32, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[13]), 33, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[14]), 37, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[15]), 38, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[16]), 42, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[17]), 43, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[18]), 47, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[19]), 48, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[20]), 52, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[21]), 53, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[22]), 57, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[23]), 58, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[24]), 62, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[25]), 63, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[26]), 67, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[27]), 68, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[28]), 72, "Hyperslab Coordinates", __LINE__, __FILE__);
+ verify_val(static_cast<long>(coords[29]), 73, "Hyperslab Coordinates", __LINE__, __FILE__);
HDfree(coords);
// Check boundaries
reg_sp.getSelectBounds(low, high);
- verify_val(low[0], (hsize_t)2, "DataSpace::getSelectBounds", __LINE__, __FILE__);
- verify_val(high[0], (hsize_t)73, "DataSpace::getSelectBounds", __LINE__, __FILE__);
+ verify_val(static_cast<long>(low[0]), 2, "DataSpace::getSelectBounds", __LINE__, __FILE__);
+ verify_val(static_cast<long>(high[0]), 73, "DataSpace::getSelectBounds", __LINE__, __FILE__);
/* Close region space */
reg_sp.close();
@@ -766,13 +771,13 @@ test_reference_region_1D()
// Get and verify number of element points in the current selection
hssize_t nelmspts = elm_sp.getSelectElemNpoints();
- verify_val((long)nelmspts, 10, "DataSpace::getSelectNpoints", __LINE__, __FILE__);
+ verify_val(static_cast<long>(nelmspts), 10, "DataSpace::getSelectNpoints", __LINE__, __FILE__);
/* Allocate space for the hyperslab blocks */
- coords = (hsize_t *)HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t));
+ coords = static_cast<hsize_t *>(HDmalloc(nelmspts * SPACE3_RANK * sizeof(hsize_t)));
// Get the list of element points currently selected
- elm_sp.getSelectElemPointlist((hsize_t)0, (hsize_t)nelmspts, coords);
+ elm_sp.getSelectElemPointlist(0, static_cast<hsize_t>(nelmspts), coords);
// Verify points
verify_val(coords[0], coord1[0][0], "Element Coordinates", __LINE__, __FILE__);
@@ -790,8 +795,8 @@ test_reference_region_1D()
// Check boundaries
elm_sp.getSelectBounds(low, high);
- verify_val(low[0], (hsize_t)3, "DataSpace::getSelectBounds", __LINE__, __FILE__);
- verify_val(high[0], (hsize_t)97, "DataSpace::getSelectBounds", __LINE__, __FILE__);
+ verify_val(static_cast<long>(low[0]), 3, "DataSpace::getSelectBounds", __LINE__, __FILE__);
+ verify_val(static_cast<long>(high[0]), 97, "DataSpace::getSelectBounds", __LINE__, __FILE__);
// Close element space
elm_sp.close();
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index cf32b2b..69c93d1 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -16,11 +16,7 @@
ttypes.cpp - HDF5 C++ testing the general datatype functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -114,8 +110,8 @@ test_classes()
// PredType::NATIVE_DOUBLE should be in H5T_FLOAT class
tcls = PredType::NATIVE_DOUBLE.getClass();
if (H5T_FLOAT != tcls) {
- verify_val(tcls, H5T_FLOAT, "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__,
- __FILE__);
+ verify_val(static_cast<long>(tcls), static_cast<long>(H5T_FLOAT),
+ "test_class: invalid type class for NATIVE_DOUBLE -", __LINE__, __FILE__);
}
PASSED();
} // end of try block
@@ -660,7 +656,6 @@ static void
test_named()
{
static hsize_t ds_size[2] = {10, 20};
- hsize_t i;
unsigned attr_data[10][20];
DataType * ds_type = NULL;
@@ -704,7 +699,7 @@ test_named()
}
// Check that it is committed.
- if (itype.committed() == false)
+ if (!itype.committed())
cerr << "IntType::committed() returned false" << endl;
// We should not be able to modify a type after it has been committed.
@@ -730,8 +725,11 @@ test_named()
// It should be possible to define an attribute for the named type
Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space);
- for (i = 0; i < ds_size[0] * ds_size[1]; i++)
- attr_data[0][i] = (int)i; /*tricky*/
+ for (hsize_t i = 0; i < ds_size[0]; i++) {
+ for (hsize_t j = 0; j < ds_size[1]; j++) {
+ attr_data[i][j] = static_cast<unsigned>(i * ds_size[1] + j);
+ }
+ }
attr1.write(PredType::NATIVE_UINT, attr_data);
attr1.close();
@@ -806,8 +804,7 @@ test_named()
issue_fail_msg("test_named", __LINE__, __FILE__, E.getCDetailMsg());
}
- if (ds_type)
- delete ds_type;
+ delete ds_type;
} // test_named
/*-------------------------------------------------------------------------
@@ -992,7 +989,8 @@ test_encode_decode()
// Create an IntType instance from the decoded pointer and verify it
IntType * decoded_int_ptr(static_cast<IntType *>(inttyp.decode()));
H5T_sign_t int_sign = decoded_int_ptr->getSign();
- verify_val(int_sign, H5T_SGN_NONE, "DataType::decode", __LINE__, __FILE__);
+ verify_val(static_cast<long>(int_sign), static_cast<long>(H5T_SGN_NONE), "DataType::decode", __LINE__,
+ __FILE__);
verify_val(inttyp == *decoded_int_ptr, true, "DataType::decode", __LINE__, __FILE__);
delete decoded_int_ptr;
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index 5d671d1..c91b566 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -18,11 +18,7 @@
EXTERNAL ROUTINES/VARIABLES:
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -187,7 +183,7 @@ test_vlstring_dataset()
// Test scalar type dataset with 1 value.
dset1 = root.createDataSet("test_scalar_small", vlst, ds_space);
- dynstring_ds_write = (char *)HDcalloc(2, sizeof(char));
+ dynstring_ds_write = static_cast<char *>(HDcalloc(2, sizeof(char)));
HDmemset(dynstring_ds_write, 'A', 1);
// Write data to the dataset, then read it back.
@@ -289,7 +285,7 @@ test_vlstring_array_dataset()
// Create and write another dataset.
DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space));
- char * wdata2 = (char *)HDcalloc(65534, sizeof(char));
+ char * wdata2 = static_cast<char *>(HDcalloc(65534, sizeof(char)));
HDmemset(wdata2, 'A', 65533);
dataset2.write(&wdata2, vlst);
@@ -317,8 +313,7 @@ test_vlstring_array_dataset()
issue_fail_msg("test_vlstring_array_dataset()", __LINE__, __FILE__, E.getCDetailMsg());
}
- if (file1)
- delete file1;
+ delete file1;
} // end test_vlstring_array_dataset()
/*-------------------------------------------------------------------------
@@ -365,7 +360,7 @@ test_vlstrings_special()
hsize_t ii; // counting variable
for (ii = 0; ii < SPACE1_DIM1; ii++)
if (rdata[ii] != NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)ii, rdata[ii]);
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", static_cast<int>(ii), rdata[ii]);
// Write dataset to disk, then read it back.
dataset.write(wdata, vlst);
@@ -377,18 +372,19 @@ test_vlstrings_special()
size_t rlen = HDstrlen(rdata[ii]);
if (wlen != rlen) {
TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n",
- (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen);
+ static_cast<int>(ii), static_cast<unsigned>(wlen), static_cast<int>(ii),
+ static_cast<unsigned>(rlen));
continue;
- } // end if
+ }
if (HDstrcmp(wdata[ii], rdata[ii]) != 0) {
- TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii],
- (int)ii, rdata[ii]);
+ TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",
+ static_cast<int>(ii), wdata[ii], static_cast<int>(ii), rdata[ii]);
continue;
- } // end if
- } // end for
+ }
+ }
// Reclaim the read VL data.
- DataSet::vlenReclaim((void *)rdata, vlst, sid1);
+ DataSet::vlenReclaim(static_cast<void *>(rdata), vlst, sid1);
// Close Dataset.
dataset.close();
@@ -413,7 +409,7 @@ test_vlstrings_special()
// Check data read in.
for (ii = 0; ii < SPACE1_DIM1; ii++)
if (rdata[ii] != NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)ii, rdata[ii]);
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", static_cast<int>(ii), rdata[ii]);
// Try to write nil strings to disk.
dataset.write(wdata2, vlst);
@@ -424,7 +420,7 @@ test_vlstrings_special()
// Check data read in.
for (ii = 0; ii < SPACE1_DIM1; ii++)
if (rdata[ii] != NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", (int)ii, rdata[ii]);
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n", static_cast<int>(ii), rdata[ii]);
// Close objects and file.
dataset.close();
@@ -472,22 +468,26 @@ test_vlstring_type()
// Change padding and verify it.
vlst.setStrpad(H5T_STR_NULLPAD);
H5T_str_t pad = vlst.getStrpad();
- verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__);
+ verify_val(static_cast<long>(pad), static_cast<long>(H5T_STR_NULLPAD), "StrType::getStrpad", __LINE__,
+ __FILE__);
// Convert to variable-length string.
vlst.setSize(H5T_VARIABLE);
// Check if datatype is VL string.
H5T_class_t type_class = vlst.getClass();
- verify_val(type_class, H5T_STRING, "DataType::getClass", __LINE__, __FILE__);
+ verify_val(static_cast<long>(type_class), static_cast<long>(H5T_STRING), "DataType::getClass",
+ __LINE__, __FILE__);
bool is_variable_str = vlst.isVariableStr();
verify_val(is_variable_str, true, "DataType::isVariableStr", __LINE__, __FILE__);
// Check default character set and padding.
H5T_cset_t cset = vlst.getCset();
- verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__);
+ verify_val(static_cast<long>(cset), static_cast<long>(H5T_CSET_ASCII), "StrType::getCset", __LINE__,
+ __FILE__);
pad = vlst.getStrpad();
- verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__);
+ verify_val(static_cast<long>(pad), static_cast<long>(H5T_STR_NULLPAD), "StrType::getStrpad", __LINE__,
+ __FILE__);
// Commit variable-length string datatype to storage.
vlst.commit(*file1, VLSTR_TYPE);
@@ -515,9 +515,11 @@ test_vlstring_type()
// Verify character set and padding
cset = vlst2.getCset();
- verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__);
+ verify_val(static_cast<long>(cset), static_cast<long>(H5T_CSET_ASCII), "StrType::getCset", __LINE__,
+ __FILE__);
pad = vlst2.getStrpad();
- verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__);
+ verify_val(static_cast<long>(pad), static_cast<long>(H5T_STR_NULLPAD), "StrType::getStrpad", __LINE__,
+ __FILE__);
// Close datatype and file
vlst2.close();
@@ -531,8 +533,7 @@ test_vlstring_type()
issue_fail_msg("test_vlstring_type()", __LINE__, __FILE__, E.getCDetailMsg());
}
- if (file1)
- delete file1;
+ delete file1;
} // end test_vlstring_type()
/*-------------------------------------------------------------------------
@@ -584,18 +585,19 @@ test_compact_vlstring()
for (i = 0; i < SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i]) != strlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",
- (int)i, (int)strlen(wdata[i]), (int)i, (int)strlen(rdata[i]));
+ static_cast<int>(i), static_cast<int>(HDstrlen(wdata[i])), static_cast<int>(i),
+ static_cast<int>(HDstrlen(rdata[i])));
continue;
} // end if
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
- TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i],
- (int)i, rdata[i]);
+ TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",
+ static_cast<int>(i), wdata[i], static_cast<int>(i), rdata[i]);
continue;
} // end if
} // end for
// Reclaim the read VL data
- DataSet::vlenReclaim((void *)rdata, vlst, sid1);
+ DataSet::vlenReclaim(static_cast<void *>(rdata), vlst, sid1);
// Close objects and file
dataset.close();
@@ -676,7 +678,7 @@ test_vlstring_attribute()
// Test creating a "large" sized string attribute
gr_attr = root.createAttribute("test_scalar_large", vlst, att_space);
- string_att_write = (char *)HDcalloc(8192, sizeof(char));
+ string_att_write = static_cast<char *>(HDcalloc(8192, sizeof(char)));
HDmemset(string_att_write, 'A', 8191);
// Write data to the attribute, then read it back.
@@ -865,7 +867,7 @@ read_scalar_dset(H5File &file, DataType &type, DataSpace &space, char *name, cha
dset.read(&data_read, type, space, space);
dset.close();
- if (HDstrcmp(data, data_read))
+ if (HDstrcmp(data, data_read) != 0)
TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read);
HDfree(data_read);
diff --git a/config/COPYING b/config/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/config/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/config/clang-cxxflags b/config/clang-cxxflags
index e7ab6d8..c585ce7 100644
--- a/config/clang-cxxflags
+++ b/config/clang-cxxflags
@@ -113,19 +113,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then
;;
esac
- case "$host_os-$host_cpu" in
- # cygwin needs the "-std=c99" flag removed, so make
- # a specific case for Cygwin without the flag and a default
- # case to add the flag everywhere else
- cygwin-*)
- ;;
-
- *)
- H5_CXXFLAGS="$H5_CXXFLAGS -std=c++11"
- ;;
- esac
-
- H5_CXXFLAGS="$H5_CXXFLAGS $arch"
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch -std=c++11"
##############
# Production #
diff --git a/config/clang-warnings/noerror-general b/config/clang-warnings/noerror-general
index ad50dfc..4690ebd 100644
--- a/config/clang-warnings/noerror-general
+++ b/config/clang-warnings/noerror-general
@@ -1,6 +1,8 @@
#
-# HDF5 code should not trigger the following warnings under any
-# circumstances, so ask the compiler to treat them as errors:
+# These warnings will be treated as errors, using the error-general file,
+# when HDF5_ENABLE_WARNINGS_AS_ERRORS is set to true for CMake or
+# the --enable-warnings-as-errors option is specified for configure.
+# Otherwise this file will be used to treat them as warnings.
#
-Wbad-function-cast
-Wimplicit-function-declaration
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 0d82668..263cedf 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -86,14 +86,6 @@ else ()
set (HDF5_FILE_LOCKING_SETTING "no")
endif ()
-#-----------------------------------------------------------------------------
-# Are we going to use HSIZE_T
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON)
-if (HDF5_ENABLE_HSIZET)
- set (${HDF_PREFIX}_HAVE_LARGE_HSIZET 1)
-endif ()
-
# so far we have no check for this
set (${HDF_PREFIX}_HAVE_TMPFILE 1)
@@ -125,8 +117,6 @@ endif ()
# END of WINDOWS Hard code Values
# ----------------------------------------------------------------------
-CHECK_FUNCTION_EXISTS (difftime ${HDF_PREFIX}_HAVE_DIFFTIME)
-
# Find the library containing clock_gettime()
if (MINGW OR NOT WINDOWS)
CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC)
@@ -159,7 +149,7 @@ if (NOT WINDOWS)
OUTPUT_VARIABLE OUTPUT
)
if (TEST_DIRECT_VFD_WORKS_COMPILE)
- if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0)
+ if (TEST_DIRECT_VFD_WORKS_RUN EQUAL "0")
HDF_FUNCTION_TEST (HAVE_DIRECT)
set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
add_definitions ("-D_GNU_SOURCE")
@@ -221,18 +211,126 @@ endif()
# Check if C has __float128 extension
#-----------------------------------------------------------------------------
-CHECK_TYPE_SIZE("__float128" ${HDF_PREFIX}_SIZEOF___FLOAT128)
-if (${${HDF_PREFIX}_SIZEOF___FLOAT128})
+HDF_CHECK_TYPE_SIZE(__float128 _SIZEOF___FLOAT128)
+if (${_SIZEOF___FLOAT128})
set (${HDF_PREFIX}_HAVE_FLOAT128 1)
+ set (${HDF_PREFIX}_SIZEOF___FLOAT128 ${_SIZEOF___FLOAT128})
else ()
set (${HDF_PREFIX}_HAVE_FLOAT128 0)
set (${HDF_PREFIX}_SIZEOF___FLOAT128 0)
endif ()
-CHECK_TYPE_SIZE("_Quad" ${HDF_PREFIX}_SIZEOF__QUAD)
-if (NOT ${${HDF_PREFIX}_SIZEOF__QUAD})
+HDF_CHECK_TYPE_SIZE(_Quad _SIZEOF__QUAD)
+if (NOT ${_SIZEOF__QUAD})
set (${HDF_PREFIX}_SIZEOF__QUAD 0)
+else ()
+ set (${HDF_PREFIX}_SIZEOF__QUAD ${_SIZEOF__QUAD})
+endif ()
+
+#-----------------------------------------------------------------------------
+# The provided CMake C macros don't provide a general compile/run function
+# so this one is used.
+#-----------------------------------------------------------------------------
+set (RUN_OUTPUT_PATH_DEFAULT ${CMAKE_BINARY_DIR})
+macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Detecting C ${FUNCTION_NAME}")
+ endif ()
+ file (WRITE
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
+ ${SOURCE_CODE}
+ )
+ TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
+ COMPILE_DEFINITIONS "-D_SIZEOF___FLOAT128=${H5_SIZEOF___FLOAT128};-D_HAVE_QUADMATH_H=${H5_HAVE_QUADMATH_H}"
+ COMPILE_OUTPUT_VARIABLE COMPILEOUT
+ RUN_OUTPUT_VARIABLE OUTPUT_VAR
+ )
+
+ set (${RETURN_VAR} ${OUTPUT_VAR})
+
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+ message (VERBOSE "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
+ message (VERBOSE "Test COMPILE_OUTPUT ${COMPILEOUT} ")
+ message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+ message (VERBOSE "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ")
+ message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
+ endif ()
+
+ if (COMPILE_RESULT_VAR)
+ if (RUN_RESULT_VAR EQUAL "0")
+ set (${RETURN_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Testing C ${FUNCTION_NAME} - OK")
+ endif ()
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n"
+ "${OUTPUT_VAR}\n\n"
+ )
+ else ()
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "Testing C ${FUNCTION_NAME} - Fail")
+ endif ()
+ set (${RETURN_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n"
+ "${OUTPUT_VAR}\n\n")
+ endif ()
+ else ()
+ message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed")
+ endif ()
+endmacro ()
+
+set (PROG_SRC
+ "
+#include <float.h>\n\
+#include <stdio.h>\n\
+#define CHECK_FLOAT128 _SIZEOF___FLOAT128\n\
+#if CHECK_FLOAT128!=0\n\
+#if _HAVE_QUADMATH_H!=0\n\
+#include <quadmath.h>\n\
+#endif\n\
+#ifdef FLT128_DIG\n\
+#define C_FLT128_DIG FLT128_DIG\n\
+#else\n\
+#define C_FLT128_DIG 0\n\
+#endif\n\
+#else\n\
+#define C_FLT128_DIG 0\n\
+#endif\n\
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n\
+#define C_LDBL_DIG DECIMAL_DIG\n\
+#else\n\
+#define C_LDBL_DIG LDBL_DIG\n\
+#endif\n\nint main() {\nFILE *pFile = fopen(\"pac_Cconftest.out\",\"w\")\\\;\nfprintf(pFile, \"\\%d\\\;\\%d\\\;\", C_LDBL_DIG, C_FLT128_DIG)\\\;\n\nreturn 0\\\;\n}\n
+ "
+)
+
+C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_RES)
+file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_Cconftest.out" PROG_OUTPUT4)
+message (STATUS "Testing maximum decimal precision for C - ${PROG_OUTPUT4}")
+
+# dnl The output from the above program will be:
+# dnl -- long double decimal precision -- __float128 decimal precision
+
+list (GET PROG_OUTPUT4 0 H5_LDBL_DIG)
+list (GET PROG_OUTPUT4 1 H5_FLT128_DIG)
+
+if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL "0" OR FLT128_DIG EQUAL "0")
+ set (${HDF_PREFIX}_HAVE_FLOAT128 0)
+ set (${HDF_PREFIX}_SIZEOF___FLOAT128 0)
+ set (_PAC_C_MAX_REAL_PRECISION ${H5_LDBL_DIG})
+else ()
+ set (_PAC_C_MAX_REAL_PRECISION ${H5_FLT128_DIG})
+endif ()
+if (NOT ${_PAC_C_MAX_REAL_PRECISION})
+ set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION 0)
+else ()
+ set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${_PAC_C_MAX_REAL_PRECISION})
endif ()
+message (STATUS "maximum decimal precision for C var - ${${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION}")
#-----------------------------------------------------------------------------
# Macro to determine the various conversion capabilities
@@ -246,7 +344,7 @@ macro (H5ConversionTests TEST msg)
OUTPUT_VARIABLE OUTPUT
)
if (${TEST}_COMPILE)
- if (${TEST}_RUN MATCHES 0)
+ if (${TEST}_RUN EQUAL "0")
set (${TEST} 1 CACHE INTERNAL ${msg})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "${msg}... yes")
diff --git a/config/cmake/H5cxx_config.h.in b/config/cmake/H5cxx_config.h.in
deleted file mode 100644
index b5ae8ce..0000000
--- a/config/cmake/H5cxx_config.h.in
+++ /dev/null
@@ -1,16 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* src/H5cxx_config.h.in Created manually. */
-
-/* Define if offsetof extension is present */
-#cmakedefine H5_HAVE_OFFSETOF ${H5_HAVE_OFFSETOF}
-
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 4ba6303..04c0c9f 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -26,15 +26,16 @@
/* Define if using a Windows compiler (i.e. Visual Studio) */
#cmakedefine H5_HAVE_VISUAL_STUDIO @H5_HAVE_VISUAL_STUDIO@
-/* Define if C++ compiler recognizes offsetof */
-#cmakedefine H5_CXX_HAVE_OFFSETOF @CXX_HAVE_OFFSETOF@
-
/* Define the default plugins path to compile */
#cmakedefine H5_DEFAULT_PLUGINDIR "@H5_DEFAULT_PLUGINDIR@"
-/* Define if `dev_t' is a scalar */
+/* Define if dev_t is a scalar */
#cmakedefine H5_DEV_T_IS_SCALAR @H5_DEV_T_IS_SCALAR@
+/* Define if your system is IBM ppc64le and cannot convert some long double
+ values correctly. */
+#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@
+
/* Define to dummy `main' function (if any) required to link to the Fortran
libraries. */
#cmakedefine H5_FC_DUMMY_MAIN @H5_FC_DUMMY_MAIN@
@@ -88,6 +89,9 @@
/* Define to 1 if you have the `alarm' function. */
#cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#cmakedefine H5_HAVE_ARPA_INET_H @H5_HAVE_ARPA_INET_H@
+
/* Define to 1 if you have the `asprintf' function. */
#cmakedefine H5_HAVE_ASPRINTF @H5_HAVE_ASPRINTF@
@@ -98,12 +102,6 @@
and unions */
#cmakedefine H5_HAVE_C99_DESIGNATED_INITIALIZER @H5_HAVE_C99_DESIGNATED_INITIALIZER@
-/* Define if the compiler understands the __func__ keyword */
-#cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#cmakedefine H5_HAVE_ARPA_INET_H @H5_HAVE_ARPA_INET_H@
-
/* Define to 1 if you have the `clock_gettime' function. */
#cmakedefine H5_HAVE_CLOCK_GETTIME @H5_HAVE_CLOCK_GETTIME@
@@ -111,14 +109,11 @@
#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@
/* Define to 1 if you have the <curl/curl.h> header file. */
-#cmakedefine H5_HAVE_CURL_H @H5_HAVE_CURL_H@
+#cmakedefine H5_HAVE_CURL_CURL_H @H5_HAVE_CURL_H@
/* Define if Darwin or Mac OS X */
#cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@
-/* Define to 1 if you have the `difftime' function. */
-#cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@
-
/* Define if the direct I/O virtual file driver (VFD) should be compiled */
#cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@
@@ -155,18 +150,9 @@
/* Define to 1 if you have the `fork' function. */
#cmakedefine H5_HAVE_FORK @H5_HAVE_FORK@
-/* Define to 1 if you have the `frexpf' function. */
-#cmakedefine H5_HAVE_FREXPF @H5_HAVE_FREXPF@
-
-/* Define to 1 if you have the `frexpl' function. */
-#cmakedefine H5_HAVE_FREXPL @H5_HAVE_FREXPL@
-
/* Define to 1 if you have the `fseeko' function. */
#cmakedefine H5_HAVE_FSEEKO @H5_HAVE_FSEEKO@
-/* Define if the compiler understands the __FUNCTION__ keyword */
-#cmakedefine H5_HAVE_FUNCTION @H5_HAVE_FUNCTION@
-
/* Determine if INTEGER*16 is available */
#cmakedefine H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@
@@ -191,22 +177,13 @@
/* Define to 1 if you have the <hdfs.h> header file. */
#cmakedefine H5_HAVE_HDFS_H @H5_HAVE_HDFS_H@
-/* Define if the compiler understands inline */
-#cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@
-
/* Define if parallel library will contain instrumentation to detect correct
optimization operation */
#cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine H5_HAVE_INTTYPES_H @H5_HAVE_INTTYPES_H@
-
/* Define to 1 if you have the `ioctl' function. */
#cmakedefine H5_HAVE_IOCTL @H5_HAVE_IOCTL@
-/* Define to 1 if you have the <io.h> header file. */
-#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@
-
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#cmakedefine H5_HAVE_LIBCRYPTO @H5_HAVE_LIBCRYPTO@
@@ -243,21 +220,6 @@
/* Define to 1 if you have the `z' library (-lz). */
#cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@
-/* Define to 1 if you have the `llround' function. */
-#cmakedefine H5_HAVE_LLROUND @H5_HAVE_LLROUND@
-
-/* Define to 1 if you have the `llroundf' function. */
-#cmakedefine H5_HAVE_LLROUNDF @H5_HAVE_LLROUNDF@
-
-/* Define to 1 if you have the `longjmp' function. */
-#cmakedefine H5_HAVE_LONGJMP @H5_HAVE_LONGJMP@
-
-/* Define to 1 if you have the `lround' function. */
-#cmakedefine H5_HAVE_LROUND @H5_HAVE_LROUND@
-
-/* Define to 1 if you have the `lroundf' function. */
-#cmakedefine H5_HAVE_LROUNDF @H5_HAVE_LROUNDF@
-
/* Define to 1 if you have the `lseek64' function. */
#cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@
@@ -270,7 +232,7 @@
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine H5_HAVE_MEMORY_H @H5_HAVE_MEMORY_H@
-/* Define if we can build the Mirror VFD */
+/* Define whether the Mirror virtual file driver (VFD) will be compiled */
#cmakedefine H5_HAVE_MIRROR_VFD @H5_HAVE_MIRROR_VFD@
/* Define if we have MPE support */
@@ -279,10 +241,10 @@
/* Define to 1 if you have the <mpe.h> header file. */
#cmakedefine H5_HAVE_MPE_H @H5_HAVE_MPE_H@
-/* Define if MPI_Comm_c2f and MPI_Comm_f2c exists */
+/* Define if MPI_Comm_c2f and MPI_Comm_f2c exist */
#cmakedefine H5_HAVE_MPI_MULTI_LANG_Comm @H5_HAVE_MPI_MULTI_LANG_Comm@
-/* Define if MPI_Info_c2f and MPI_Info_f2c exists */
+/* Define if MPI_Info_c2f and MPI_Info_f2c exist */
#cmakedefine H5_HAVE_MPI_MULTI_LANG_Info @H5_HAVE_MPI_MULTI_LANG_Info@
/* Define to 1 if you have the <netdb.h> header file. */
@@ -309,6 +271,9 @@
/* Define to 1 if you have the <pthread.h> header file. */
#cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@
+/* Define to 1 if you have the <pwd.h> header file. */
+#cmakedefine H5_HAVE_PWD_H @H5_HAVE_PWD_H@
+
/* Define to 1 if you have the <quadmath.h> header file. */
#cmakedefine H5_HAVE_QUADMATH_H @H5_HAVE_QUADMATH_H@
@@ -322,57 +287,27 @@
compiled */
#cmakedefine H5_HAVE_ROS3_VFD @H5_HAVE_ROS3_VFD@
-/* Define to 1 if you have the `round' function. */
-#cmakedefine H5_HAVE_ROUND @H5_HAVE_ROUND@
-
-/* Define to 1 if you have the `roundf' function. */
-#cmakedefine H5_HAVE_ROUNDF @H5_HAVE_ROUNDF@
-
-/* Define to 1 if you have the `setjmp' function. */
-#cmakedefine H5_HAVE_SETJMP @H5_HAVE_SETJMP@
-
-/* Define to 1 if you have the <setjmp.h> header file. */
-#cmakedefine H5_HAVE_SETJMP_H @H5_HAVE_SETJMP_H@
-
/* Define to 1 if you have the `setsysinfo' function. */
#cmakedefine H5_HAVE_SETSYSINFO @H5_HAVE_SETSYSINFO@
/* Define to 1 if you have the `siglongjmp' function. */
#cmakedefine H5_HAVE_SIGLONGJMP @H5_HAVE_SIGLONGJMP@
-/* Define to 1 if you have the `signal' function. */
-#cmakedefine H5_HAVE_SIGNAL @H5_HAVE_SIGNAL@
-
/* Define to 1 if you have the `sigprocmask' function. */
#cmakedefine H5_HAVE_SIGPROCMASK @H5_HAVE_SIGPROCMASK@
/* Define to 1 if you have the `sigsetjmp' function. */
#cmakedefine H5_HAVE_SIGSETJMP @H5_HAVE_SIGSETJMP@
-/* Define to 1 if you have the `snprintf' function. */
-#cmakedefine H5_HAVE_SNPRINTF @H5_HAVE_SNPRINTF@
-
/* Define to 1 if you have the `srandom' function. */
#cmakedefine H5_HAVE_SRANDOM @H5_HAVE_SRANDOM@
/* Define to 1 if you have the `stat64' function. */
#cmakedefine H5_HAVE_STAT64 @H5_HAVE_STAT64@
-/* Define if `struct stat' has the `st_blocks' field */
+/* Define if struct stat has the st_blocks field */
#cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@
-/* Define to 1 if you have the <stdbool.h> header file. */
-#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine H5_HAVE_STDINT_H @H5_HAVE_STDINT_H@
-
-/* Define to 1 if you have the <stdint.h> header file for Cplusplus. */
-#cmakedefine H5_HAVE_STDINT_H_CXX @H5_HAVE_STDINT_H_CXX@
-
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@
@@ -385,12 +320,6 @@
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine H5_HAVE_STRING_H @H5_HAVE_STRING_H@
-/* Define to 1 if you have the `strtoll' function. */
-#cmakedefine H5_HAVE_STRTOLL @H5_HAVE_STRTOLL@
-
-/* Define to 1 if you have the `strtoull' function. */
-#cmakedefine H5_HAVE_STRTOULL @H5_HAVE_STRTOULL@
-
/* Define if struct text_info is defined */
#cmakedefine H5_HAVE_STRUCT_TEXT_INFO @H5_HAVE_STRUCT_TEXT_INFO@
@@ -400,9 +329,6 @@
/* Define to 1 if you have the `symlink' function. */
#cmakedefine H5_HAVE_SYMLINK @H5_HAVE_SYMLINK@
-/* Define to 1 if you have the `system' function. */
-#cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@
-
/* Define to 1 if you have the <sys/file.h> header file. */
#cmakedefine H5_HAVE_SYS_FILE_H @H5_HAVE_SYS_FILE_H@
@@ -456,9 +382,6 @@
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine H5_HAVE_VASPRINTF @H5_HAVE_VASPRINTF@
-/* Define to 1 if you have the `vsnprintf' function. */
-#cmakedefine H5_HAVE_VSNPRINTF @H5_HAVE_VSNPRINTF@
-
/* Define to 1 if you have the `waitpid' function. */
#cmakedefine H5_HAVE_WAITPID @H5_HAVE_WAITPID@
@@ -468,9 +391,6 @@
/* Define if your system has window style path name. */
#cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@
-/* Define to 1 if you have the <winsock2.h> header file. */
-#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@
-
/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@
@@ -480,13 +400,7 @@
/* Define to 1 if you have the `_scrsize' function. */
#cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@
-/* Define if the compiler understands __inline */
-#cmakedefine H5_HAVE___INLINE @H5_HAVE___INLINE@
-
-/* Define if the compiler understands __inline__ */
-#cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@
-
-/* Define if the library will ignore file locks when disabled */
+/* Define if the library will ignore file locks when disabled */
#cmakedefine H5_IGNORE_DISABLED_FILE_LOCKS @H5_IGNORE_DISABLED_FILE_LOCKS@
/* Define if the high-level library headers should be included in hdf5.h */
@@ -508,9 +422,6 @@
with special algorithm. */
#cmakedefine H5_LONG_TO_LDOUBLE_SPECIAL @H5_LONG_TO_LDOUBLE_SPECIAL@
-/* Define if your system is power6 and cannot convert some long double values. */
-#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@
-
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@
@@ -545,10 +456,10 @@
#define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION_STRING@"
/* Determine the maximum decimal precision in C */
-#cmakedefine H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@
+#define H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@
/* Define Fortran Maximum Real Decimal Precision */
-#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
+#define H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
/* Width for printf() for type `long long' or `__int64', use `ll' */
#cmakedefine H5_PRINTF_LL_WIDTH @H5_PRINTF_LL_WIDTH@
@@ -716,9 +627,6 @@
/* The size of `__int64', as computed by sizeof. */
#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@
-/* Define to 1 if you have the ANSI C header files. */
-#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@
-
/* Define if strict file format checks are enabled */
#cmakedefine H5_STRICT_FORMAT_CHECKS @H5_STRICT_FORMAT_CHECKS@
@@ -726,9 +634,6 @@
PTHREAD_SCOPE_SYSTEM) call. */
#cmakedefine H5_SYSTEM_SCOPE_THREADS @H5_SYSTEM_SCOPE_THREADS@
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#cmakedefine H5_TIME_WITH_SYS_TIME @H5_TIME_WITH_SYS_TIME@
-
/* Define using v1.6 public API symbols by default */
#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@
@@ -781,19 +686,10 @@
/* Define for large files, on AIX-style hosts. */
#cmakedefine H5__LARGE_FILES
-/* Define to empty if `const' does not conform to ANSI C. */
-#cmakedefine H5_const
-
/* Define to `long int' if <sys/types.h> does not define. */
#cmakedefine H5_off_t
/* Define to `long' if <sys/types.h> does not define. */
-#cmakedefine H5_ptrdiff_t
-
-/* Define to `unsigned long' if <sys/types.h> does not define. */
-#cmakedefine H5_size_t
-
-/* Define to `long' if <sys/types.h> does not define. */
#cmakedefine H5_ssize_t
#endif
diff --git a/config/cmake/HDF5PluginCache.cmake b/config/cmake/HDF5PluginCache.cmake
index 2b9e48c..3b085dd 100644
--- a/config/cmake/HDF5PluginCache.cmake
+++ b/config/cmake/HDF5PluginCache.cmake
@@ -20,7 +20,7 @@ set (HDF5_REPACK_EXECUTABLE $<TARGET_FILE:h5repack-shared> CACHE STRING "hdf5 h5
set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE)
-set (H5PL_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/h5plugin.git" CACHE STRING "Use plugins from HDF repository" FORCE)
+set (H5PL_GIT_URL "https://github.com/HDFGroup/hdf5_plugins.git" CACHE STRING "Use plugins from HDF repository" FORCE)
set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE)
set (H5PL_TGZ_NAME "${PLUGIN_TGZ_NAME}" CACHE STRING "Use plugins from compressed file" FORCE)
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake
index 003f24f..e192ec4 100644
--- a/config/cmake/HDF5UseFortran.cmake
+++ b/config/cmake/HDF5UseFortran.cmake
@@ -129,74 +129,12 @@ endif ()
# Determine the available KINDs for REALs and INTEGERs
#-----------------------------------------------------------------------------
-#READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" SOURCE_CODE)
-set (PROG_SRC_CODE
- "
- PROGRAM FC_AVAIL_KINDS
- IMPLICIT NONE
- INTEGER :: ik, jk, k, max_decimal_prec
- INTEGER :: num_rkinds = 1, num_ikinds = 1
- INTEGER, DIMENSION(1:10) :: list_ikinds = -1
- INTEGER, DIMENSION(1:10) :: list_rkinds = -1
-
- OPEN(8, FILE='pac_fconftest.out', FORM='formatted')
-
- ! Find integer KINDs
- list_ikinds(num_ikinds)=SELECTED_INT_KIND(1)
- DO ik = 2, 36
- k = SELECTED_INT_KIND(ik)
- IF(k.LT.0) EXIT
- IF(k.GT.list_ikinds(num_ikinds))THEN
- num_ikinds = num_ikinds + 1
- list_ikinds(num_ikinds) = k
- ENDIF
- ENDDO
-
- DO k = 1, num_ikinds
- WRITE(8,'(I0)', ADVANCE='NO') list_ikinds(k)
- IF(k.NE.num_ikinds)THEN
- WRITE(8,'(A)',ADVANCE='NO') ','
- ELSE
- WRITE(8,'()')
- ENDIF
- ENDDO
-
- ! Find real KINDs
- list_rkinds(num_rkinds)=SELECTED_REAL_KIND(1)
- max_decimal_prec = 1
-
- prec: DO ik = 2, 36
- exp: DO jk = 1, 17000
- k = SELECTED_REAL_KIND(ik,jk)
- IF(k.LT.0) EXIT exp
- IF(k.GT.list_rkinds(num_rkinds))THEN
- num_rkinds = num_rkinds + 1
- list_rkinds(num_rkinds) = k
- ENDIF
- max_decimal_prec = ik
- ENDDO exp
- ENDDO prec
-
- DO k = 1, num_rkinds
- WRITE(8,'(I0)', ADVANCE='NO') list_rkinds(k)
- IF(k.NE.num_rkinds)THEN
- WRITE(8,'(A)',ADVANCE='NO') ','
- ELSE
- WRITE(8,'()')
- ENDIF
- ENDDO
-
- WRITE(8,'(I0)') max_decimal_prec
- WRITE(8,'(I0)') num_ikinds
- WRITE(8,'(I0)') num_rkinds
- END PROGRAM FC_AVAIL_KINDS
- "
-)
+READ_SOURCE ("PROGRAM FC_AVAIL_KINDS" "END PROGRAM FC_AVAIL_KINDS" SOURCE_CODE)
if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
- check_fortran_source_runs (${PROG_SRC_CODE} FC_AVAIL_KINDS_RESULT SRC_EXT f90)
+ check_fortran_source_runs (${SOURCE_CODE} FC_AVAIL_KINDS_RESULT SRC_EXT f90)
else ()
FORTRAN_RUN ("REAL and INTEGER KINDs"
- "${PROG_SRC_CODE}"
+ "${SOURCE_CODE}"
XX
YY
FC_AVAIL_KINDS_RESULT
@@ -260,7 +198,7 @@ foreach (KIND ${VAR})
USE ISO_C_BINDING
IMPLICIT NONE
INTEGER (KIND=${KIND}) a
- OPEN(8,FILE='pac_validIntKinds.out',FORM='formatted')
+ OPEN(8,FILE='pac_validIntKinds.${KIND}.out',FORM='formatted')
WRITE(8,'(I0)') ${FC_SIZEOF_A}
CLOSE(8)
END
@@ -271,7 +209,7 @@ foreach (KIND ${VAR})
else ()
FORTRAN_RUN("INTEGER KIND SIZEOF" ${PROG_SRC_${KIND}} XX YY VALIDINTKINDS_RESULT_${KIND})
endif ()
- file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validIntKinds.out" PROG_OUTPUT1)
+ file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validIntKinds.${KIND}.out" PROG_OUTPUT1)
string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
set (pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},")
endforeach ()
@@ -309,7 +247,7 @@ foreach (KIND ${VAR} )
USE ISO_C_BINDING
IMPLICIT NONE
REAL (KIND=${KIND}) a
- OPEN(8,FILE='pac_validRealKinds.out',FORM='formatted')
+ OPEN(8,FILE='pac_validRealKinds.${KIND}.out',FORM='formatted')
WRITE(8,'(I0)') ${FC_SIZEOF_A}
CLOSE(8)
END
@@ -320,7 +258,7 @@ foreach (KIND ${VAR} )
else ()
FORTRAN_RUN ("REAL KIND SIZEOF" ${PROG_SRC2_${KIND}} XX YY VALIDREALKINDS_RESULT_${KIND})
endif ()
- file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validRealKinds.out" PROG_OUTPUT1)
+ file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_validRealKinds.${KIND}.out" PROG_OUTPUT1)
string (REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}")
set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},")
endforeach ()
@@ -375,7 +313,7 @@ if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
else ()
FORTRAN_RUN ("SIZEOF NATIVE KINDs" ${PROG_SRC3} XX YY PAC_SIZEOF_NATIVE_KINDS_RESULT)
endif ()
-file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_sizeof_native_kinds.out" PROG_OUTPUT)
+file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_sizeof_native_kinds.out" PROG_OUTPUT3)
# dnl The output from the above program will be:
# dnl -- LINE 1 -- sizeof INTEGER
# dnl -- LINE 2 -- kind of INTEGER
@@ -385,14 +323,14 @@ file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_sizeof_native_kinds.out" PROG_OUTPUT)
# dnl -- LINE 6 -- kind of DOUBLE PRECISION
# Convert the string to a list of strings by replacing the carriage return with a semicolon
-string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}")
+string (REGEX REPLACE "\n" ";" PROG_OUTPUT3 "${PROG_OUTPUT3}")
-list (GET PROG_OUTPUT 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF)
-list (GET PROG_OUTPUT 1 PAC_FORTRAN_NATIVE_INTEGER_KIND)
-list (GET PROG_OUTPUT 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF)
-list (GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND)
-list (GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF)
-list (GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND)
+list (GET PROG_OUTPUT3 0 PAC_FORTRAN_NATIVE_INTEGER_SIZEOF)
+list (GET PROG_OUTPUT3 1 PAC_FORTRAN_NATIVE_INTEGER_KIND)
+list (GET PROG_OUTPUT3 2 PAC_FORTRAN_NATIVE_REAL_SIZEOF)
+list (GET PROG_OUTPUT3 3 PAC_FORTRAN_NATIVE_REAL_KIND)
+list (GET PROG_OUTPUT3 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF)
+list (GET PROG_OUTPUT3 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND)
if (NOT PAC_FORTRAN_NATIVE_INTEGER_SIZEOF)
message (FATAL_ERROR "Failed to find SIZEOF NATIVE INTEGER KINDs for Fortran")
@@ -434,132 +372,13 @@ endif ()
set (${HDF_PREFIX}_H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}")
-string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS})
-string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR})
-set (${HDF_PREFIX}_H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)")
-
-string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF})
-string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR})
-set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)")
-
-ENABLE_LANGUAGE (C)
-
-if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
- include (CheckCSourceRuns)
-else ()
-#-----------------------------------------------------------------------------
-# The provided CMake C macros don't provide a general compile/run function
-# so this one is used.
-#-----------------------------------------------------------------------------
-macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Detecting C ${FUNCTION_NAME}")
- endif ()
- if (HDF5_REQUIRED_LIBRARIES)
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}")
- else ()
- set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
- endif ()
- file (WRITE
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
- ${SOURCE_CODE}
- )
- TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
- CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
- RUN_OUTPUT_VARIABLE OUTPUT_VAR
- )
-
- set (${RETURN_VAR} ${OUTPUT_VAR})
-
- #if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- # message (TRACE "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
- # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- # message (TRACE "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ")
- # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
- #endif ()
-
- if (${COMPILE_RESULT_VAR})
- if (${RUN_RESULT_VAR} MATCHES 1)
- set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Testing C ${FUNCTION_NAME} - OK")
- endif ()
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n"
- "${OUTPUT_VAR}\n\n"
- )
- else ()
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Testing C ${FUNCTION_NAME} - Fail")
- endif ()
- set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n"
- "${OUTPUT_VAR}\n\n")
- endif ()
- else ()
- message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed")
- endif ()
-endmacro ()
-endif ()
-
-set (PROG_SRC
- "
-#include <float.h>
-#include <stdio.h>
-#define CHECK_FLOAT128 ${${HDF_PREFIX}_SIZEOF___FLOAT128}
-#if CHECK_FLOAT128!=0
-# if ${${HDF_PREFIX}_HAVE_QUADMATH_H}!=0
-#include <quadmath.h>
-# endif
-# ifdef FLT128_DIG
-#define C_FLT128_DIG FLT128_DIG
-# else
-#define C_FLT128_DIG 0
-# endif
-#else
-#define C_FLT128_DIG 0
-#endif
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#define C_LDBL_DIG DECIMAL_DIG
-#else
-#define C_LDBL_DIG LDBL_DIG
-#endif
- int main() {
- printf(\"%d\\\\n%d\\\\n\", C_LDBL_DIG, C_FLT128_DIG)\\\;
- return 1\\\;
- }
- "
-)
-
-if (NOT CMAKE_VERSION VERSION_LESS "3.14.0")
- check_c_source_runs (${PROG_SRC} PROG_OUTPUT)
-else ()
- C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_OUTPUT)
-endif ()
-
-# dnl The output from the above program will be:
-# dnl -- LINE 1 -- long double decimal precision
-# dnl -- LINE 2 -- __float128 decimal precision
-
-# Convert the string to a list of strings by replacing the carriage return with a semicolon
-string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}")
-
-list (GET PROG_OUTPUT 0 LDBL_DIG)
-list (GET PROG_OUTPUT 1 FLT128_DIG)
-
-if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0)
- set (${HDF_PREFIX}_HAVE_FLOAT128 0)
- set (${HDF_PREFIX}_SIZEOF___FLOAT128 0)
- set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG})
-else ()
- set(${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG})
-endif ()
+string (REGEX REPLACE "{" "" OUT_VAR1 ${PAC_FC_ALL_REAL_KINDS})
+string (REGEX REPLACE "}" "" OUT_VAR1 ${OUT_VAR1})
+set (${HDF_PREFIX}_H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR1}/)")
+string (REGEX REPLACE "{" "" OUT_VAR2 ${PAC_FC_ALL_REAL_KINDS_SIZEOF})
+string (REGEX REPLACE "}" "" OUT_VAR2 ${OUT_VAR2})
+set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR2}/)")
# Setting definition if there is a 16 byte fortran integer
string (FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos)
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in
index 3eea743..2d8dc58 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -77,7 +77,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN
#TAR_SOURCE - name of tarfile
#if(NOT DEFINED TAR_SOURCE)
-# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.14.1-Source")
+# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.14.4-Source")
#endif()
###############################################################################################################
diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake
index b639b19..cdd49eb 100644
--- a/config/cmake/HDF5_Examples_options.cmake
+++ b/config/cmake/HDF5_Examples_options.cmake
@@ -42,19 +42,24 @@
### enable JAVA builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON")
+#############################################################################################
### enable FILTERS builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FILTERS:BOOL=ON")
+### default HDF5_PLUGIN_PATH to where the filter libraries are located
+#set(ENV{HDF5_PLUGIN_PATH} "${INSTALLDIR}/lib/plugin")
#############################################################################################
### enable parallel program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON")
+#############################################################################################
+### match the hdf5 library namespace
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NAMESPACE:STRING=hdf5::")
#############################################################################################
### enable threadsafe program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON")
-
#############################################################################################
### enable test program builds, requires reference files in testfiles subdirectory
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON")
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake
index 12dec20..e76150f 100644
--- a/config/cmake/HDFCXXCompilerFlags.cmake
+++ b/config/cmake/HDFCXXCompilerFlags.cmake
@@ -9,17 +9,48 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-set(CMAKE_CXX_STANDARD 98)
-set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
-set(CMAKE_CXX_EXTENSIONS OFF)
+ENABLE_LANGUAGE (CXX)
+
+set (CMAKE_CXX_STANDARD 11)
+set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
+
+set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}")
+ message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}")
endif ()
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
+if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ set (_INTEL_WINDOWS 1)
+endif ()
+
+if (WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ set (_CLANG_MSVC_WINDOWS 1)
+endif()
+
+# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
+if ((_CLANG_MSVC_WINDOWS OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.28)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105")
+ endif ()
+endif ()
+
+if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED)
+ if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
+ endif ()
+ else ()
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
+ endif ()
+ endif ()
+endif ()
+
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug")
@@ -71,156 +102,169 @@ endif ()
# HDF5 library compile options
#-----------------------------------------------------------------------------
-#-----------------------------------------------------------------------------
-# CDash is configured to only allow 3000 warnings, so
-# break into groups (from the config/gnu-flags file)
-#-----------------------------------------------------------------------------
-if (NOT MSVC AND NOT MINGW)
- if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP")
- else ()
- # General flags
- #
- # Note that some of the flags listed here really should be developer
- # flags (listed in a separate variable, below) but we put them here
- # because they are not raised by the current code and we'd like to
- # know if they do start showing up.
- #
- # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
- # warnings that are emitted. If you need it, add it at configure time.
- if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "-erroff=%none -DBSD_COMP")
+else ()
+ # General flags
+ #
+ # Note that some of the flags listed here really should be developer
+ # flags (listed in a separate variable, below) but we put them here
+ # because they are not raised by the current code and we'd like to
+ # know if they do start showing up.
+ #
+ # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
+ # warnings that are emitted. If you need it, add it at configure time.
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ if (_INTEL_WINDOWS)
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-general")
+ else ()
ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
+ endif()
+ if (NOT _INTEL_WINDOWS)
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/15")
+ endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
- list (APPEND H5_CXXFLAGS0 "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
- list (APPEND H5_CXXFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/18")
endif()
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED
- AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- # add the general CXX flags for g++ compiler versions 4.8 and above.
- ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
- else ()
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general")
- endif ()
+ endif()
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED
+ AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ # add the general CXX flags for g++ compiler versions 4.8 and above.
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general")
endif ()
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform")
- endif ()
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}")
endif ()
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform")
endif ()
-
- #-----------------------------------------------------------------------------
- # Option to allow the user to enable developer warnings
- # Developer warnings (suggestions from gcc, not code problems)
- #-----------------------------------------------------------------------------
- if (HDF5_ENABLE_DEV_WARNINGS)
- message (STATUS "....HDF5 developer group warnings are enabled")
- # if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- # list (APPEND H5_CXXFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
- # elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
- endif ()
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}")
endif ()
+endif ()
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable developer warnings
+# Developer warnings (suggestions from gcc, not code problems)
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_DEV_WARNINGS)
+ message (STATUS "....HDF5 developer group warnings are enabled")
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/developer-general")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
+ endif ()
+else ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... Only needed for gcc 4.X
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
- endif ()
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
+ endif ()
+endif ()
- # Append more extra warning flags that only gcc 4.8+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
- else ()
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
- endif ()
- endif ()
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # Technically, variable-length arrays are part of the C99 standard, but
+ # we should approach them a bit cautiously... Only needed for gcc 4.X
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
+ endif ()
- # Append more extra warning flags that only gcc 4.9+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9")
+ # Append more extra warning flags that only gcc 4.8+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.8")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
endif ()
+ endif ()
- # Append more extra warning flags that only gcc 5.1+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5")
- else ()
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5")
- endif ()
- endif ()
+ # Append more extra warning flags that only gcc 4.9+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-4.9")
+ endif ()
- # Append more extra warning flags that only gcc 6.x+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
+ # Append more extra warning flags that only gcc 5.1+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ # autotools always add the C flags with the CXX flags
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5")
endif ()
+ endif ()
- # Append more extra warning flags that only gcc 7.x+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
- if (HDF5_ENABLE_DEV_WARNINGS)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
- #else ()
- # ADD_H5_FLAGS (H5_CXXFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
- endif ()
- endif ()
+ # Append more extra warning flags that only gcc 6.x+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
+ endif ()
- # Append more extra warning flags that only gcc 8.x+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
- #if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- # ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
- #else ()
- # ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8")
- #endif ()
- if (HDF5_ENABLE_DEV_WARNINGS)
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
- else ()
- # autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
- endif ()
+ # Append more extra warning flags that only gcc 7.x+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXxFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
+ #else ()
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
endif ()
+ endif ()
- # Append more extra warning flags that only gcc 9.x+ know about
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+ # Append more extra warning flags that only gcc 8.x+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
+ else ()
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8")
+ endif ()
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
+ else ()
# autotools always add the C flags with the CXX flags
- ADD_H5_FLAGS (H5_CXXFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
endif ()
endif ()
-else ()
- if (NOT MINGW)
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/EHsc")
+
+ # Append more extra warning flags that only gcc 9.x+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-9")
+ endif ()
+
+ # Append more extra warning flags that only gcc 9.3+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.3)
+ # do not use C warnings, gnu-warnings 9.3, no cxx warniings
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3")
+ endif ()
+
+ # Append more extra warning flags that only gcc 10.x+ knows about
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ # Use the C warnings as CXX warnings are the same
+ ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10")
+ #else ()
+ # ADD_H5_FLAGS (H5_CXXFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10")
endif ()
+ endif ()
endif ()
#-----------------------------------------------------------------------------
@@ -232,97 +276,17 @@ if (HDF5_ENABLE_ALL_WARNINGS)
if (HDF5_ENABLE_DEV_WARNINGS)
if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall /wd4668")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/Wall" "/wd4668")
endif ()
else ()
if (CMAKE_CXX_COMPILER_LOADED)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
+ list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127")
endif ()
endif ()
else ()
if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0} ${H5_CXXFLAGS1} ${H5_CXXFLAGS2} ${H5_CXXFLAGS3} ${H5_CXXFLAGS4})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPZERO_WARNINGS)
- message (STATUS "....Group Zero warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W1")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS0})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPONE_WARNINGS)
- message (STATUS "....Group One warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W2")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS1})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPTWO_WARNINGS)
- message (STATUS "....Group Two warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W3")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS2})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
- message (STATUS "....Group Three warnings are enabled")
- if (MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_CXX_FLAGS "${HDF5_CMAKE_CXX_FLAGS}")
- list (APPEND HDF5_CMAKE_CXX_FLAGS "/W4")
- endif ()
- else ()
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS3})
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
- message (STATUS "....Group Four warnings are enabled")
- if (NOT MSVC)
- if (CMAKE_CXX_COMPILER_LOADED)
- list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS4})
+ list (APPEND HDF5_CMAKE_CXX_FLAGS ${H5_CXXFLAGS})
endif ()
endif ()
endif ()
@@ -340,17 +304,17 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
- if(CMAKE_CXX_COMPILER_LOADED)
- if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif ()
endif ()
elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO")
- if(CMAKE_CXX_COMPILER_LOADED)
- if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
+ if (CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-s")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
endif ()
@@ -362,7 +326,7 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_PROFILING)
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
list (APPEND HDF5_CMAKE_CXX_FLAGS "${PROFILE_CXXFLAGS}")
endif ()
endif ()
@@ -372,7 +336,7 @@ endif ()
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_OPTIMIZATION)
- if(CMAKE_CXX_COMPILER_LOADED)
+ if (CMAKE_CXX_COMPILER_LOADED)
list (APPEND HDF5_CMAKE_CXX_FLAGS "${OPTIMIZE_CXXFLAGS}")
endif ()
endif ()
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index bce906d..210e475 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -14,13 +14,42 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE)
set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Warnings Configuration: default: ${CMAKE_C_FLAGS} : ${CMAKE_CXX_FLAGS}")
+ message (VERBOSE "Warnings Configuration: C default: ${CMAKE_C_FLAGS}")
endif ()
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
+if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ set(_INTEL_WINDOWS 1)
+endif()
+
+if(WIN32 AND CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(_CLANG_MSVC_WINDOWS 1)
+endif()
+
+# Disable deprecation warnings for standard C functions.
+# really only needed for newer versions of VS, but should
+# not hurt other versions, and this will work into the
+# future
+if(MSVC OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
+else()
+endif()
+
+if(MSVC)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000")
+endif()
+
+# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
+if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.28)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd5105")
+endif()
+
+if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000")
+endif()
+
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug")
@@ -81,158 +110,175 @@ endif ()
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
-# CDash is configured to only allow 3000 warnings, so
-# break into groups (from the config/gnu-flags file)
+# Option to allow the user to interpret certain warnings as errors
+#
+# This should NOT be on by default as it can cause a lot of conflicts with
+# new operating systems and compiler versions. Header files that are out of
+# our control (MPI, HDFS, etc.) can also raise warnings.
#-----------------------------------------------------------------------------
-if (NOT MSVC AND NOT MINGW)
- #-----------------------------------------------------------------------------
- # Option to allow the user to interpret certain warnings as errors
- #
- # This should NOT be on by default as it can cause a lot of conflicts with
- # new operating systems and compiler versions. Header files that are out of
- # our control (MPI, HDFS, etc.) can also raise warnings.
- #-----------------------------------------------------------------------------
- option (HDF5_ENABLE_WARNINGS_AS_ERRORS "Interpret some warnings as errors" OFF)
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- message (STATUS "...some warnings will be interpreted as errors")
- endif ()
+option (HDF5_ENABLE_WARNINGS_AS_ERRORS "Interpret some warnings as errors" OFF)
+if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ message (STATUS "...some warnings will be interpreted as errors")
+endif ()
- if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP")
- else ()
- # General flags
- #
- # Note that some of the flags listed here really should be developer
- # flags (listed in a separate variable, below) but we put them here
- # because they are not raised by the current code and we'd like to
- # know if they do start showing up.
- #
- # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
- # warnings that are emitted. If you need it, add it at configure time.
- if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP")
+else ()
+ # General flags
+ #
+ # Note that some of the flags listed here really should be developer
+ # flags (listed in a separate variable, below) but we put them here
+ # because they are not raised by the current code and we'd like to
+ # know if they do start showing up.
+ #
+ # NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
+ # warnings that are emitted. If you need it, add it at configure time.
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ if (_INTEL_WINDOWS)
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-general")
+ else ()
ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/general")
- list (APPEND H5_CFLAGS0 "-Wcomment -Wdeprecated -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith")
- list (APPEND H5_CFLAGS0 "-Wreturn-type -Wstrict-prototypes -Wuninitialized")
- list (APPEND H5_CFLAGS0 "-Wunknown-pragmas -Wunused-function -Wunused-variable")
+ endif()
+ if (NOT _INTEL_WINDOWS)
+ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/15")
+ endif()
# this is just a failsafe
- list (APPEND H5_CFLAGS0 "-finline-functions")
+ list (APPEND H5_CFLAGS "-finline-functions")
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0)
- list (APPEND H5_CFLAGS0 "-Wextra-tokens -Wformat -Wformat-security -Wic-pointer -Wshadow")
- list (APPEND H5_CFLAGS0 "-Wsign-compare -Wtrigraphs -Wwrite-strings")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/18")
endif()
- elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- # Add general CFlags for GCC versions 4.8 and above
- if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general")
- endif ()
- endif ()
- # gcc automatically inlines based on the optimization level
- # this is just a failsafe
- list (APPEND H5_CFLAGS0 "-finline-functions")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
+ endif()
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ # Add general CFlags for GCC versions 4.8 and above
+ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general")
if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general")
else ()
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general")
endif ()
- elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
- list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform")
endif ()
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
+ # gcc automatically inlines based on the optimization level
+ # this is just a failsafe
+ list (APPEND H5_CFLAGS "-finline-functions")
+ elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
+ ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general")
endif ()
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI")
+ list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform")
+ endif ()
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
+ message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}")
endif ()
+endif ()
- #-----------------------------------------------------------------------------
- # Option to allow the user to enable developer warnings
- # Developer warnings (suggestions from gcc, not code problems)
- #-----------------------------------------------------------------------------
- option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
- if (HDF5_ENABLE_DEV_WARNINGS)
- message (STATUS "....HDF5 developer group warnings are enabled")
- if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
- list (APPEND H5_CFLAGS0 "-Winline -Wreorder -Wport -Wstrict-aliasing")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
- endif ()
- else ()
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
- elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
+#-----------------------------------------------------------------------------
+# Option to allow the user to enable developer warnings
+# Developer warnings (suggestions from gcc, not code problems)
+#-----------------------------------------------------------------------------
+option (HDF5_ENABLE_DEV_WARNINGS "Enable HDF5 developer group warnings" OFF)
+if (HDF5_ENABLE_DEV_WARNINGS)
+ message (STATUS "....HDF5 developer group warnings are enabled")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ if (_INTEL_WINDOWS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-developer-general")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/developer-general")
endif ()
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-general")
+ elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/developer-general")
endif ()
+else ()
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-general")
+ elseif (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/no-developer-general")
+ endif ()
+endif ()
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- # Technically, variable-length arrays are part of the C99 standard, but
- # we should approach them a bit cautiously... Only needed for gcc 4.X
- if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
- endif ()
+if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ # Technically, variable-length arrays are part of the C99 standard, but
+ # we should approach them a bit cautiously... Only needed for gcc 4.X
+ if (CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8-4.last")
+ endif ()
- # Append more extra warning flags that only gcc 4.8+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
- endif ()
+ # Append more extra warning flags that only gcc 4.8+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.8")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-4.8")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-4.8")
endif ()
+ endif ()
- # Append more extra warning flags that only gcc 4.9+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
- endif ()
+ # Append more extra warning flags that only gcc 4.9+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/4.9")
+ endif ()
- # Append more extra warning flags that only gcc 5.x+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
- endif ()
+ # Append more extra warning flags that only gcc 5.x+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/5")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5")
endif ()
+ endif ()
- # Append more extra warning flags that only gcc 6.x+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
- ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
- endif ()
+ # Append more extra warning flags that only gcc 6.x+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/6")
+ endif ()
- # Append more extra warning flags that only gcc 7.x+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
- ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
- #else ()
- # ADD_H5_FLAGS (H5_CFLAGS2 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
- endif ()
+ # Append more extra warning flags that only gcc 7.x+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/7")
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-7")
+ #else ()
+ # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-7")
endif ()
+ endif ()
- # Append more extra warning flags that only gcc 8.x+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
- if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
- endif ()
- if (HDF5_ENABLE_DEV_WARNINGS)
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
- else ()
- ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
- endif ()
+ # Append more extra warning flags that only gcc 8.x+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/8")
+ if (HDF5_ENABLE_WARNINGS_AS_ERRORS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8")
endif ()
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8")
+ else ()
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-8")
+ endif ()
+ endif ()
+
+ # Append more extra warning flags that only gcc 9.x+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
+ endif ()
+
+ # Append more extra warning flags that only gcc 9.3+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/9.3")
+ endif ()
- # Append more extra warning flags that only gcc 9.x+ know about
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0)
- ADD_H5_FLAGS (H5_CFLAGS4 "${HDF5_SOURCE_DIR}/config/gnu-warnings/9")
+ # Append more extra warning flags that only gcc 10.x+ knows about
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0)
+ if (HDF5_ENABLE_DEV_WARNINGS)
+ ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-10")
+ #else ()
+ # ADD_H5_FLAGS (H5_CFLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/no-developer-10")
endif ()
endif ()
endif ()
@@ -240,86 +286,19 @@ endif ()
#-----------------------------------------------------------------------------
# Option to allow the user to enable all warnings
#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF)
+option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" ON)
if (HDF5_ENABLE_ALL_WARNINGS)
message (STATUS "....All Warnings are enabled")
if (MSVC)
if (HDF5_ENABLE_DEV_WARNINGS)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/Wall /wd4668")
+ list (APPEND HDF5_CMAKE_C_FLAGS "/Wall" "/wd4668")
else ()
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
+ list (APPEND HDF5_CMAKE_C_FLAGS "/W3" "/wd4100" "/wd4706" "/wd4127")
endif ()
else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0} ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF)
-if (HDF5_ENABLE_GROUPZERO_WARNINGS)
- message (STATUS "....Group Zero warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W1")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS0})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF)
-if (HDF5_ENABLE_GROUPONE_WARNINGS)
- message (STATUS "....Group One warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W2")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS1})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF)
-if (HDF5_ENABLE_GROUPTWO_WARNINGS)
- message (STATUS "....Group Two warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W3")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS2})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF)
-if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
- message (STATUS "....Group Three warnings are enabled")
- if (MSVC)
- string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " HDF5_CMAKE_C_FLAGS "${HDF5_CMAKE_C_FLAGS}")
- list (APPEND HDF5_CMAKE_C_FLAGS "/W4")
- else ()
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS3})
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Option to allow the user to enable warnings by groups
-#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
-if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
- message (STATUS "....Group Four warnings are enabled")
- if (NOT MSVC)
- list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS4})
+ list (APPEND HDF5_CMAKE_C_FLAGS ${H5_CFLAGS})
endif ()
endif ()
@@ -354,13 +333,13 @@ MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS)
set (HDF5_ENABLE_SYMBOLS "OFF" CACHE STRING "Add debug symbols to the library independent of the build mode and optimization level (OFF NO YES)")
set_property (CACHE HDF5_ENABLE_SYMBOLS PROPERTY STRINGS OFF NO YES)
if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
- if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fno-omit-frame-pointer")
endif ()
elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO")
- if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT _INTEL_WINDOWS)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s")
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
index 8b631ad..94c40aa 100644
--- a/config/cmake/HDFFortranCompilerFlags.cmake
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -80,37 +80,38 @@ if (NOT MSVC AND NOT MINGW)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
- # Append more extra warning flags that only gcc 4.8+ know about
+ # Append more extra warning flags that only gcc 4.8+ knows about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8)
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8")
endif ()
- # Append more extra warning flags that only gcc 4.9+ know about
+ # Append more extra warning flags that only gcc 4.9+ knows about
#if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.9)
# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.9")
#endif ()
- # Append more extra warning flags that only gcc 5.x+ know about
- if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
- ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5")
- endif ()
+ # Append more extra warning flags that only gcc 5.x+ knows about
+ # do not include -Wuse-without-only
+ #if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.0)
+ # ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-5")
+ #endif ()
- # Append more extra warning flags that only gcc 6.x+ know about
+ # Append more extra warning flags that only gcc 6.x+ knows about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 6.0)
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-6")
endif ()
- # Append more extra warning flags that only gcc 7.x+ know about
+ # Append more extra warning flags that only gcc 7.x+ knows about
#if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0)
# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-7")
#endif ()
- # Append more extra warning flags that only gcc 8.x+ know about
+ # Append more extra warning flags that only gcc 8.x+ knows about
if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0)
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-8")
endif ()
- # Append more extra warning flags that only gcc 9.x+ know about
+ # Append more extra warning flags that only gcc 9.x+ knows about
#if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0)
# ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-9")
#endif ()
diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in
index f621515..9289870 100644
--- a/config/cmake/README.txt.cmake.in
+++ b/config/cmake/README.txt.cmake.in
@@ -75,6 +75,6 @@ For more information see USING_CMake_Examples.txt in the install folder.
===========================================================================
Documentation for this release can be found at the following URL:
- https://portal.hdfgroup.org/display/support
+ https://portal.hdfgroup.org/display/HDF5/HDF5
Bugs should be reported to help@hdfgroup.org.
diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake
index 375004e..2351ce8 100644
--- a/config/cmake/UseJava.cmake
+++ b/config/cmake/UseJava.cmake
@@ -4,369 +4,516 @@
UseJava
-------
-Use Module for Java
-
-This file provides functions for Java. It is assumed that
+This file provides support for ``Java``. It is assumed that
:module:`FindJava` has already been loaded. See :module:`FindJava` for
-information on how to load Java into your CMake project.
+information on how to load Java into your ``CMake`` project.
+
+Synopsis
+^^^^^^^^
+
+.. parsed-literal::
+
+ `Creating and Installing JARS`_
+ `add_jar`_ (<target_name> [SOURCES] <source1> [<source2>...] ...)
+ `install_jar`_ (<target_name> DESTINATION <destination> [COMPONENT <component>])
+ `install_jni_symlink`_ (<target_name> DESTINATION <destination> [COMPONENT <component>])
+
+ `Header Generation`_
+ `create_javah`_ ((TARGET <target> | GENERATED_FILES <VAR>) CLASSES <class>... ...)
+
+ `Exporting JAR Targets`_
+ `install_jar_exports`_ (TARGETS <jars>... FILE <filename> DESTINATION <destination> ...)
+ `export_jars`_ (TARGETS <jars>... [NAMESPACE <namespace>] FILE <filename>)
+
+ `Finding JARs`_
+ `find_jar`_ (<VAR> NAMES <name1> [<name2>...] [PATHS <path1> [<path2>... ENV <var>]] ...)
+
+ `Creating Java Documentation`_
+ `create_javadoc`_ (<VAR> (PACKAGES <pkg1> [<pkg2>...] | FILES <file1> [<file2>...]) ...)
Creating And Installing JARs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. code-block:: cmake
+.. _add_jar:
- add_jar(<target_name>
- [SOURCES] <source1> [<source2>...] [<resource1>...]
- [INCLUDE_JARS <jar1> [<jar2>...]]
- [ENTRY_POINT <entry>]
- [VERSION <version>]
- [OUTPUT_NAME <name>]
- [OUTPUT_DIR <dir>]
- [GENERATE_NATIVE_HEADERS <target> [DESTINATION <dir>]]
- )
+.. command:: add_jar
-This command creates a ``<target_name>.jar``. It compiles the given
-``<source>`` files and adds the given ``<resource>`` files to
-the jar file. Source files can be java files or listing files
-(prefixed by ``@``). If only resource files are given then just a jar file
-is created. The list of ``INCLUDE_JARS`` are added to the classpath when
-compiling the java sources and also to the dependencies of the target.
-``INCLUDE_JARS`` also accepts other target names created by ``add_jar()``.
-For backwards compatibility, jar files listed as sources are ignored (as
-they have been since the first version of this module).
+ Creates a jar file containing java objects and, optionally, resources::
-The default ``OUTPUT_DIR`` can also be changed by setting the variable
-``CMAKE_JAVA_TARGET_OUTPUT_DIR``.
+ add_jar(<target_name>
+ [SOURCES] <source1> [<source2>...] [<resource1>...]
+ [INCLUDE_JARS <jar1> [<jar2>...]]
+ [ENTRY_POINT <entry>]
+ [VERSION <version>]
+ [MANIFEST <manifest>]
+ [OUTPUT_NAME <name>]
+ [OUTPUT_DIR <dir>]
+ [GENERATE_NATIVE_HEADERS <target>
+ [DESTINATION (<dir>|INSTALL <dir> [BUILD <dir>])]]
+ )
-Optionally, using option ``GENERATE_NATIVE_HEADERS``, native header files can
-be generated for methods declared as native. These files provide the
-connective glue that allow your Java and C code to interact. An INTERFACE
-target will be created for an easy usage of generated files. Sub-option
-``DESTINATION`` can be used to specify the output directory for generated
-header files.
+ This command creates a ``<target_name>.jar``. It compiles the given
+ ``<source>`` files and adds the given ``<resource>`` files to
+ the jar file. Source files can be java files or listing files
+ (prefixed by ``@``). If only resource files are given then just a jar file
+ is created.
-``GENERATE_NATIVE_HEADERS`` option requires, at least, version 1.8 of the JDK.
+ ``SOURCES``
+ Compiles the specified source files and adds the result in the jar file.
-The ``add_jar()`` function sets the following target properties on
-``<target_name>``:
+ .. versionadded:: 3.4
+ Support for response files, prefixed by ``@``.
-``INSTALL_FILES``
- The files which should be installed. This is used by ``install_jar()``.
-``JNI_SYMLINK``
- The JNI symlink which should be installed. This is used by
- ``install_jni_symlink()``.
-``JAR_FILE``
- The location of the jar file so that you can include it.
-``CLASSDIR``
- The directory where the class files can be found. For example to use them
- with ``javah``.
+ ``INCLUDE_JARS``
+ The list of jars are added to the classpath when compiling the java sources
+ and also to the dependencies of the target. ``INCLUDE_JARS`` also accepts
+ other target names created by ``add_jar()``. For backwards compatibility,
+ jar files listed as sources are ignored (as they have been since the first
+ version of this module).
-.. code-block:: cmake
+ ``ENTRY_POINT``
+ Defines an entry point in the jar file.
- install_jar(<target_name> <destination>)
- install_jar(<target_name> DESTINATION <destination> [COMPONENT <component>])
+ ``VERSION``
+ Adds a version to the target output name.
-This command installs the ``<target_name>`` files to the given
-``<destination>``. It should be called in the same scope as ``add_jar()`` or
-it will fail.
+ The following example will create a jar file with the name
+ ``shibboleet-1.2.0.jar`` and will create a symlink ``shibboleet.jar``
+ pointing to the jar with the version information.
-The ``install_jar()`` function sets the ``INSTALL_DESTINATION`` target
-property on jars so installed. This property holds the ``<destination>`` as
-described above, and is used by ``install_jar_exports()``. You can get this
-information with :command:`get_property` and the ``INSTALL_DESTINATION``
-property key.
+ .. code-block:: cmake
-.. code-block:: cmake
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
- install_jni_symlink(<target_name> <destination>)
- install_jni_symlink(<target_name> DESTINATION <destination> [COMPONENT <component>])
+ ``MANIFEST``
+ Defines a custom manifest for the jar.
-This command installs the ``<target_name>`` JNI symlinks to the given
-``<destination>``. It should be called in the same scope as ``add_jar()`` or
-it will fail.
+ ``OUTPUT_NAME``
+ Specify a different output name for the target.
-.. code-block:: cmake
+ ``OUTPUT_DIR``
+ Sets the directory where the jar file will be generated. If not specified,
+ :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory.
- install_jar_exports(TARGETS <jars>...
- [NAMESPACE <namespace>]
- FILE <filename>
- DESTINATION <destination> [COMPONENT <component>])
+ ``GENERATE_NATIVE_HEADERS``
+ .. versionadded:: 3.11
-This command installs a target export file ``<filename>`` for the named jar
-targets to the given ``<destination>`` directory. Its function is similar to
-that of :command:`install(EXPORTS)`.
+ Generates native header files for methods declared as native. These files
+ provide the connective glue that allow your Java and C code to interact.
+ An INTERFACE target will be created for an easy usage of generated files.
+ Sub-option ``DESTINATION`` can be used to specify the output directory for
+ generated header files.
-.. code-block:: cmake
+ This option requires, at least, version 1.8 of the JDK.
- export_jars(TARGETS <jars>...
- [NAMESPACE <namespace>]
- FILE <filename>)
+ For an optimum usage of this option, it is recommended to include module
+ JNI before any call to ``add_jar()``. The produced target for native
+ headers can then be used to compile C/C++ sources with the
+ :command:`target_link_libraries` command.
-This command writes a target export file ``<filename>`` for the named ``<jars>``
-targets. Its function is similar to that of :command:`export`.
+ .. code-block:: cmake
+ find_package(JNI)
+ add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
+ add_library(bar bar.cpp)
+ target_link_libraries(bar PRIVATE foo-native)
-Examples
-""""""""
+ .. versionadded:: 3.20
+ ``DESTINATION`` sub-option now supports the possibility to specify
+ different output directories for ``BUILD`` and ``INSTALL`` steps. If
+ ``BUILD`` directory is not specified, a default directory will be used.
-To add compile flags to the target you can set these flags with the following
-variable:
+ To export the interface target generated by ``GENERATE_NATIVE_HEADERS``
+ option, sub-option ``INSTALL`` of ``DESTINATION`` is required:
-.. code-block:: cmake
+ .. code-block:: cmake
- set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
+ add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native
+ DESTINATION INSTALL include)
+ install(TARGETS foo-native EXPORT native)
+ install(DIRECTORY "$<TARGET_PROPERTY:foo-native,NATIVE_HEADERS_DIRECTORY>/"
+ DESTINATION include)
+ install(EXPORT native DESTINATION /to/export NAMESPACE foo)
+ Some variables can be set to customize the behavior of ``add_jar()`` as well
+ as the java compiler:
-To add a path or a jar file to the class path you can do this with the
-``CMAKE_JAVA_INCLUDE_PATH`` variable.
+ ``CMAKE_JAVA_COMPILE_FLAGS``
+ Specify additional flags to java compiler.
-.. code-block:: cmake
+ ``CMAKE_JAVA_INCLUDE_PATH``
+ Specify additional paths to the class path.
- set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
+ ``CMAKE_JNI_TARGET``
+ If the target is a JNI library, sets this boolean variable to ``TRUE`` to
+ enable creation of a JNI symbolic link (see also
+ :ref:`install_jni_symlink() <install_jni_symlink>`).
-To use a different output name for the target you can set it with:
+ ``CMAKE_JAR_CLASSES_PREFIX``
+ If multiple jars should be produced from the same java source filetree,
+ to prevent the accumulation of duplicate class files in subsequent jars,
+ set/reset ``CMAKE_JAR_CLASSES_PREFIX`` prior to calling the ``add_jar()``:
-.. code-block:: cmake
+ .. code-block:: cmake
- add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
+ add_jar(foo foo.java)
-To use a different output directory than ``CMAKE_CURRENT_BINARY_DIR`` you can
-set it with:
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
+ add_jar(bar bar.java)
-.. code-block:: cmake
+ The ``add_jar()`` function sets the following target properties on
+ ``<target_name>``:
- add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
+ ``INSTALL_FILES``
+ The files which should be installed. This is used by
+ :ref:`install_jar() <install_jar>`.
+ ``JNI_SYMLINK``
+ The JNI symlink which should be installed. This is used by
+ :ref:`install_jni_symlink() <install_jni_symlink>`.
+ ``JAR_FILE``
+ The location of the jar file so that you can include it.
+ ``CLASSDIR``
+ The directory where the class files can be found. For example to use them
+ with ``javah``.
+ ``NATIVE_HEADERS_DIRECTORY``
+ .. versionadded:: 3.20
-To define an entry point in your jar you can set it with the ``ENTRY_POINT``
-named argument:
+ The directory where native headers are generated. Defined when option
+ ``GENERATE_NATIVE_HEADERS`` is specified.
-.. code-block:: cmake
+.. _install_jar:
- add_jar(example ENTRY_POINT com/examples/MyProject/Main)
+.. command:: install_jar
-To define a custom manifest for the jar, you can set it with the ``MANIFEST``
-named argument:
+ This command installs the jar file to the given destination::
-.. code-block:: cmake
+ install_jar(<target_name> <destination>)
+ install_jar(<target_name> DESTINATION <destination> [COMPONENT <component>])
- add_jar(example MANIFEST /path/to/manifest)
+ This command installs the ``<target_name>`` file to the given
+ ``<destination>``. It should be called in the same scope as
+ :ref:`add_jar() <add_jar>` or it will fail.
-To add a version to the target output name you can set it using the ``VERSION``
-named argument to ``add_jar()``. The following example will create a jar file
-with the name ``shibboleet-1.0.0.jar`` and will create a symlink
-``shibboleet.jar`` pointing to the jar with the version information.
+ .. versionadded:: 3.4
+ The second signature with ``DESTINATION`` and ``COMPONENT`` options.
-.. code-block:: cmake
+ ``DESTINATION``
+ Specify the directory on disk to which a file will be installed.
- add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+ ``COMPONENT``
+ Specify an installation component name with which the install rule is
+ associated, such as "runtime" or "development".
-If the target is a JNI library, utilize the following commands to
-create a JNI symbolic link:
+ The ``install_jar()`` command sets the following target properties
+ on ``<target_name>``:
-.. code-block:: cmake
+ ``INSTALL_DESTINATION``
+ Holds the ``<destination>`` as described above, and is used by
+ :ref:`install_jar_exports() <install_jar_exports>`.
- set(CMAKE_JNI_TARGET TRUE)
- add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
- install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
- install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
+.. _install_jni_symlink:
-If a single target needs to produce more than one jar from its
-java source code, to prevent the accumulation of duplicate class
-files in subsequent jars, set/reset ``CMAKE_JAR_CLASSES_PREFIX`` prior
-to calling the ``add_jar()`` function:
+.. command:: install_jni_symlink
-.. code-block:: cmake
+ Installs JNI symlinks for target generated by :ref:`add_jar() <add_jar>`::
- set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
- add_jar(foo foo.java)
+ install_jni_symlink(<target_name> <destination>)
+ install_jni_symlink(<target_name> DESTINATION <destination> [COMPONENT <component>])
- set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
- add_jar(bar bar.java)
+ This command installs the ``<target_name>`` JNI symlinks to the given
+ ``<destination>``. It should be called in the same scope as
+ :ref:`add_jar() <add_jar>` or it will fail.
-For an optimum usage of option ``GENERATE_NATIVE_HEADERS``, it is recommended to
-include module JNI before any call to ``add_jar()``. The produced target for
-native headers can then be used to compile C/C++ sources with the
-:command:`target_link_libraries` command.
+ .. versionadded:: 3.4
+ The second signature with ``DESTINATION`` and ``COMPONENT`` options.
-.. code-block:: cmake
+ ``DESTINATION``
+ Specify the directory on disk to which a file will be installed.
- find_package(JNI)
- add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
- add_library(bar bar.cpp)
- target_link_libraries(bar PRIVATE foo-native)
+ ``COMPONENT``
+ Specify an installation component name with which the install rule is
+ associated, such as "runtime" or "development".
+ Utilize the following commands to create a JNI symbolic link:
-Finding JARs
-^^^^^^^^^^^^
+ .. code-block:: cmake
-.. code-block:: cmake
-
- find_jar(<VAR>
- <name> | NAMES <name1> [<name2>...]
- [PATHS <path1> [<path2>... ENV <var>]]
- [VERSIONS <version1> [<version2>]]
- [DOC "cache documentation string"]
- )
-
-This command is used to find a full path to the named jar. A cache
-entry named by ``<VAR>`` is created to store the result of this command.
-If the full path to a jar is found the result is stored in the
-variable and the search will not repeated unless the variable is
-cleared. If nothing is found, the result will be ``<VAR>-NOTFOUND``, and
-the search will be attempted again next time ``find_jar()`` is invoked with
-the same variable. The name of the full path to a file that is
-searched for is specified by the names listed after ``NAMES`` argument.
-Additional search locations can be specified after the ``PATHS`` argument.
-If you require special a version of a jar file you can specify it with
-the ``VERSIONS`` argument. The argument after ``DOC`` will be used for the
-documentation string in the cache.
-
-
-Javadoc
-^^^^^^^
-
-The ``create_javadoc()`` command can be used to create java documentation
-based on files or packages. For more details please read the javadoc manpage.
-
-There are two main signatures for ``create_javadoc()``. The first signature
-works with package names on a path with source files.
-
-.. code-block:: cmake
-
- create_javadoc(<VAR>
- PACKAGES <pkg1> [<pkg2>...]
- [SOURCEPATH <sourcepath>]
- [CLASSPATH <classpath>]
- [INSTALLPATH <install path>]
- [DOCTITLE "the documentation title"]
- [WINDOWTITLE "the title of the document"]
- [AUTHOR TRUE|FALSE]
- [USE TRUE|FALSE]
- [VERSION TRUE|FALSE]
- )
+ set(CMAKE_JNI_TARGET TRUE)
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+ install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
+ install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
+
+Header Generation
+^^^^^^^^^^^^^^^^^
+
+.. _create_javah:
+
+.. command:: create_javah
-For example:
-
-.. code-block:: cmake
-
- create_javadoc(my_example_doc
- PACKAGES com.example.foo com.example.bar
- SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
- CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
- WINDOWTITLE "My example"
- DOCTITLE "<h1>My example</h1>"
- AUTHOR TRUE
- USE TRUE
- VERSION TRUE
- )
-
-The second signature for ``create_javadoc()`` works on a given list of
-files.
-
-.. code-block:: cmake
-
- create_javadoc(<VAR>
- FILES <file1> [<file2>...]
- [CLASSPATH <classpath>]
- [INSTALLPATH <install path>]
- [DOCTITLE "the documentation title"]
- [WINDOWTITLE "the title of the document"]
- [AUTHOR TRUE|FALSE]
- [USE TRUE|FALSE]
- [VERSION TRUE|FALSE]
+ .. versionadded:: 3.4
+
+ Generates C header files for java classes::
+
+ create_javah(TARGET <target> | GENERATED_FILES <VAR>
+ CLASSES <class>...
+ [CLASSPATH <classpath>...]
+ [DEPENDS <depend>...]
+ [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
)
-For example:
+ .. deprecated:: 3.11
+ This command will no longer be supported starting with version 10 of the JDK
+ due to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
+ The :ref:`add_jar(GENERATE_NATIVE_HEADERS) <add_jar>` command should be
+ used instead.
+
+ Create C header files from java classes. These files provide the connective
+ glue that allow your Java and C code to interact.
+
+ There are two main signatures for ``create_javah()``. The first signature
+ returns generated files through variable specified by the ``GENERATED_FILES``
+ option. For example:
-.. code-block:: cmake
+ .. code-block:: cmake
- create_javadoc(my_example_doc
- FILES ${example_SRCS}
- CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
- WINDOWTITLE "My example"
- DOCTITLE "<h1>My example</h1>"
- AUTHOR TRUE
- USE TRUE
- VERSION TRUE
- )
+ create_javah(GENERATED_FILES files_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
-Both signatures share most of the options. These options are the same
-as what you can find in the javadoc manpage. Please look at the
-manpage for ``CLASSPATH``, ``DOCTITLE``, ``WINDOWTITLE``, ``AUTHOR``, ``USE``
-and ``VERSION``.
+ The second signature for ``create_javah()`` creates a target which
+ encapsulates header files generation. E.g.
-If you don't set the ``INSTALLPATH``, then by default the documentation will
-be installed to :
+ .. code-block:: cmake
-::
+ create_javah(TARGET target_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
- ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
+ Both signatures share same options.
+ ``CLASSES``
+ Specifies Java classes used to generate headers.
-Header Generation
-^^^^^^^^^^^^^^^^^
+ ``CLASSPATH``
+ Specifies various paths to look up classes. Here ``.class`` files, jar
+ files or targets created by command add_jar can be used.
+
+ ``DEPENDS``
+ Targets on which the javah target depends.
+
+ ``OUTPUT_NAME``
+ Concatenates the resulting header files for all the classes listed by
+ option ``CLASSES`` into ``<path>``. Same behavior as option ``-o`` of
+ ``javah`` tool.
+
+ ``OUTPUT_DIR``
+ Sets the directory where the header files will be generated. Same behavior
+ as option ``-d`` of ``javah`` tool. If not specified,
+ :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory.
+
+Exporting JAR Targets
+^^^^^^^^^^^^^^^^^^^^^
+
+.. _install_jar_exports:
+
+.. command:: install_jar_exports
+
+ .. versionadded:: 3.7
+
+ Installs a target export file::
-.. code-block:: cmake
+ install_jar_exports(TARGETS <jars>...
+ [NAMESPACE <namespace>]
+ FILE <filename>
+ DESTINATION <destination> [COMPONENT <component>])
- create_javah(TARGET <target> | GENERATED_FILES <VAR>
- CLASSES <class>...
- [CLASSPATH <classpath>...]
- [DEPENDS <depend>...]
- [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
- )
+ This command installs a target export file ``<filename>`` for the named jar
+ targets to the given ``<destination>`` directory. Its function is similar to
+ that of :command:`install(EXPORT)`.
-Create C header files from java classes. These files provide the connective glue
-that allow your Java and C code to interact.
+ ``TARGETS``
+ List of targets created by :ref:`add_jar() <add_jar>` command.
-.. deprecated:: 3.11
+ ``NAMESPACE``
+ .. versionadded:: 3.9
-.. note::
+ The ``<namespace>`` value will be prepend to the target names as they are
+ written to the import file.
- This command will no longer be supported starting with version 10 of the JDK
- due to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
- The ``add_jar(GENERATE_NATIVE_HEADERS)`` command should be used instead.
+ ``FILE``
+ Specify name of the export file.
-There are two main signatures for ``create_javah()``. The first signature
-returns generated files through variable specified by the ``GENERATED_FILES``
-option. For example:
-.. code-block:: cmake
+ ``DESTINATION``
+ Specify the directory on disk to which a file will be installed.
- create_javah(GENERATED_FILES files_headers
- CLASSES org.cmake.HelloWorld
- CLASSPATH hello.jar
- )
+ ``COMPONENT``
+ Specify an installation component name with which the install rule is
+ associated, such as "runtime" or "development".
-The second signature for ``create_javah()`` creates a target which encapsulates
-header files generation. E.g.
+.. _export_jars:
-.. code-block:: cmake
+.. command:: export_jars
- create_javah(TARGET target_headers
- CLASSES org.cmake.HelloWorld
- CLASSPATH hello.jar
- )
+ .. versionadded:: 3.7
-Both signatures share same options.
+ Writes a target export file::
-``CLASSES <class>...``
- Specifies Java classes used to generate headers.
+ export_jars(TARGETS <jars>...
+ [NAMESPACE <namespace>]
+ FILE <filename>)
-``CLASSPATH <classpath>...``
- Specifies various paths to look up classes. Here .class files, jar files or
- targets created by command add_jar can be used.
+ This command writes a target export file ``<filename>`` for the named ``<jars>``
+ targets. Its function is similar to that of :command:`export`.
-``DEPENDS <depend>...``
- Targets on which the javah target depends.
+ ``TARGETS``
+ List of targets created by :ref:`add_jar() <add_jar>` command.
-``OUTPUT_NAME <path>``
- Concatenates the resulting header files for all the classes listed by option
- ``CLASSES`` into ``<path>``. Same behavior as option ``-o`` of javah tool.
+ ``NAMESPACE``
+ .. versionadded:: 3.9
-``OUTPUT_DIR <path>``
- Sets the directory where the header files will be generated. Same behavior
- as option ``-d`` of javah tool. If not specified,
- :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory.
+ The ``<namespace>`` value will be prepend to the target names as they are
+ written to the import file.
+
+ ``FILE``
+ Specify name of the export file.
+
+Finding JARs
+^^^^^^^^^^^^
+
+.. _find_jar:
+
+.. command:: find_jar
+
+ Finds the specified jar file::
+
+ find_jar(<VAR>
+ <name> | NAMES <name1> [<name2>...]
+ [PATHS <path1> [<path2>... ENV <var>]]
+ [VERSIONS <version1> [<version2>]]
+ [DOC "cache documentation string"]
+ )
+
+ This command is used to find a full path to the named jar. A cache
+ entry named by ``<VAR>`` is created to store the result of this command.
+ If the full path to a jar is found the result is stored in the
+ variable and the search will not repeated unless the variable is
+ cleared. If nothing is found, the result will be ``<VAR>-NOTFOUND``, and
+ the search will be attempted again next time ``find_jar()`` is invoked with
+ the same variable.
+
+ ``NAMES``
+ Specify one or more possible names for the jar file.
+
+ ``PATHS``
+ Specify directories to search in addition to the default locations.
+ The ``ENV`` var sub-option reads paths from a system environment variable.
+
+ ``VERSIONS``
+ Specify jar versions.
+
+ ``DOC``
+ Specify the documentation string for the ``<VAR>`` cache entry.
+
+Creating Java Documentation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. _create_javadoc:
+
+.. command:: create_javadoc
+
+ Creates java documentation based on files and packages::
+
+ create_javadoc(<VAR>
+ (PACKAGES <pkg1> [<pkg2>...] | FILES <file1> [<file2>...])
+ [SOURCEPATH <sourcepath>]
+ [CLASSPATH <classpath>]
+ [INSTALLPATH <install path>]
+ [DOCTITLE <the documentation title>]
+ [WINDOWTITLE <the title of the document>]
+ [AUTHOR (TRUE|FALSE)]
+ [USE (TRUE|FALSE)]
+ [VERSION (TRUE|FALSE)]
+ )
+
+ The ``create_javadoc()`` command can be used to create java documentation.
+ There are two main signatures for ``create_javadoc()``.
+
+ The first signature works with package names on a path with source files:
+
+ .. code-block:: cmake
+
+ create_javadoc(my_example_doc
+ PACKAGES com.example.foo com.example.bar
+ SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+ The second signature for ``create_javadoc()`` works on a given list of files:
+
+ .. code-block:: cmake
+
+ create_javadoc(my_example_doc
+ FILES java/A.java java/B.java
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+ Both signatures share most of the options. For more details please read the
+ javadoc manpage.
+
+ ``PACKAGES``
+ Specify java packages.
+
+ ``FILES``
+ Specify java source files. If relative paths are specified, they are
+ relative to :variable:`CMAKE_CURRENT_SOURCE_DIR`.
+
+ ``SOURCEPATH``
+ Specify the directory where to look for packages. By default,
+ :variable:`CMAKE_CURRENT_SOURCE_DIR` directory is used.
+
+ ``CLASSPATH``
+ Specify where to find user class files. Same behavior as option
+ ``-classpath`` of ``javadoc`` tool.
+
+ ``INSTALLPATH``
+ Specify where to install the java documentation. If you specified, the
+ documentation will be installed to
+ ``${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>``.
+
+ ``DOCTITLE``
+ Specify the title to place near the top of the overview summary file.
+ Same behavior as option ``-doctitle`` of ``javadoc`` tool.
+
+ ``WINDOWTITLE``
+ Specify the title to be placed in the HTML ``<title>`` tag. Same behavior
+ as option ``-windowtitle`` of ``javadoc`` tool.
+
+ ``AUTHOR``
+ When value ``TRUE`` is specified, includes the ``@author`` text in the
+ generated docs. Same behavior as option ``-author`` of ``javadoc`` tool.
+
+ ``USE``
+ When value ``TRUE`` is specified, creates class and package usage pages.
+ Includes one Use page for each documented class and package. Same behavior
+ as option ``-use`` of ``javadoc`` tool.
+
+ ``VERSION``
+ When value ``TRUE`` is specified, includes the version text in the
+ generated docs. Same behavior as option ``-version`` of ``javadoc`` tool.
#]=======================================================================]
include(CMakeParseArguments)
@@ -378,7 +525,8 @@ function (__java_copy_file src dest comment)
ARGS ${src}
${dest}
DEPENDS ${src}
- COMMENT ${comment})
+ COMMENT ${comment}
+ )
endfunction ()
function(__java_lcat VAR)
@@ -409,6 +557,12 @@ set(_JAVA_EXPORT_TARGETS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/javaTargets.cmake.in)
set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
+if (CMAKE_HOST_WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+ set(_UseJava_PATH_SEP "$<SEMICOLON>")
+else ()
+ set(_UseJava_PATH_SEP ":")
+endif()
+
function(add_jar _TARGET_NAME)
cmake_parse_arguments(_add_jar
@@ -440,6 +594,9 @@ function(add_jar _TARGET_NAME)
set(_add_jar_ENTRY_POINT "${CMAKE_JAVA_JAR_ENTRY_POINT}")
endif()
+ # This *should* still work if <resources1>... are included without a
+ # named RESOURCES argument. In that case, the old behavior of potentially
+ # misplacing the within the Jar will behave as previously (incorrectly)
set(_JAVA_SOURCE_FILES ${_add_jar_SOURCES} ${_add_jar_UNPARSED_ARGUMENTS})
if (NOT DEFINED _add_jar_OUTPUT_DIR)
@@ -467,7 +624,10 @@ function(add_jar _TARGET_NAME)
if (Java_VERSION VERSION_LESS 1.8)
message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS is not supported with this version of Java.")
endif()
- cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "DESTINATION" "" ${_add_jar_GENERATE_NATIVE_HEADERS})
+
+ unset (_GENERATE_NATIVE_HEADERS_OUTPUT_DESC)
+
+ cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "" "DESTINATION" ${_add_jar_GENERATE_NATIVE_HEADERS})
if (NOT _add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS)
message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: missing required argument.")
endif()
@@ -478,11 +638,30 @@ function(add_jar _TARGET_NAME)
endif()
if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION)
set (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir/native_headers")
+ else()
+ list (LENGTH _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION length)
+ if (NOT length EQUAL 1)
+ cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "" "BUILD;INSTALL" "" "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION}")
+ if (_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_UNPARSED_ARGUMENTS)
+ message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: DESTINATION: ${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_UNPARSED_ARGUMENTS}: unexpected argument(s).")
+ endif()
+ if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_INSTALL)
+ message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS: DESTINATION: INSTALL sub-option is required.")
+ endif()
+ if (NOT _add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD)
+ set(_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir/native_headers")
+ endif()
+ set(_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD}")
+ set(_GENERATE_NATIVE_HEADERS_OUTPUT_DESC "$<BUILD_INTERFACE:${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_BUILD}>" "$<INSTALL_INTERFACE:${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION_INSTALL}>")
+ endif()
endif()
set (_GENERATE_NATIVE_HEADERS_TARGET ${_add_jar_GENERATE_NATIVE_HEADERS_UNPARSED_ARGUMENTS})
set (_GENERATE_NATIVE_HEADERS_OUTPUT_DIR "${_add_jar_GENERATE_NATIVE_HEADERS_DESTINATION}")
set (_GENERATE_NATIVE_HEADERS -h "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
+ if(NOT _GENERATE_NATIVE_HEADERS_OUTPUT_DESC)
+ set(_GENERATE_NATIVE_HEADERS_OUTPUT_DESC "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
+ endif()
endif()
if (LIBRARY_OUTPUT_PATH)
@@ -498,14 +677,8 @@ function(add_jar _TARGET_NAME)
${CMAKE_JAVA_LIBRARY_OUTPUT_PATH}
)
- if (CMAKE_HOST_WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
- set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
- else ()
- set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
- endif()
-
foreach (JAVA_INCLUDE_DIR IN LISTS CMAKE_JAVA_INCLUDE_PATH)
- string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${JAVA_INCLUDE_DIR}")
endforeach()
set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
@@ -536,7 +709,7 @@ function(add_jar _TARGET_NAME)
if (_JAVA_SOURCE_FILE MATCHES "^@(.+)$")
get_filename_component(_JAVA_FULL ${CMAKE_MATCH_1} ABSOLUTE)
- list (APPEND _JAVA_COMPILE_FILELISTS ${_JAVA_FULL})
+ list(APPEND _JAVA_COMPILE_FILELISTS ${_JAVA_FULL})
elseif (_JAVA_EXT MATCHES ".java")
file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR} ${_JAVA_FULL})
@@ -550,7 +723,7 @@ function(add_jar _TARGET_NAME)
endif ()
get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH)
- list (APPEND _JAVA_COMPILE_FILES ${_JAVA_SOURCE_FILE})
+ list(APPEND _JAVA_COMPILE_FILES ${_JAVA_SOURCE_FILE})
set(_JAVA_CLASS_FILE "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_REL_PATH}/${_JAVA_FILE}.class")
set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES} ${_JAVA_CLASS_FILE})
@@ -561,15 +734,15 @@ function(add_jar _TARGET_NAME)
# Ignored for backward compatibility
elseif (_JAVA_EXT STREQUAL "")
- list (APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH})
- list (APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}})
+ list(APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH})
+ list(APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}})
else ()
__java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE}
${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE}
"Copying ${_JAVA_SOURCE_FILE} to the build directory")
- list (APPEND _JAVA_RESOURCE_FILES ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE})
- list (APPEND _JAVA_RESOURCE_FILES_RELATIVE ${_JAVA_SOURCE_FILE})
+ list(APPEND _JAVA_RESOURCE_FILES ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE})
+ list(APPEND _JAVA_RESOURCE_FILES_RELATIVE ${_JAVA_SOURCE_FILE})
endif ()
endforeach()
@@ -577,18 +750,18 @@ function(add_jar _TARGET_NAME)
if (TARGET ${_JAVA_INCLUDE_JAR})
get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
if (_JAVA_JAR_PATH)
- string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
- list (APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
- list (APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
- list (APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH})
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${_JAVA_JAR_PATH}")
+ list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
+ list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
+ list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH})
else ()
message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar")
endif ()
else ()
- string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}")
- list (APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}")
- list (APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}")
- list (APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${_JAVA_INCLUDE_JAR}")
+ list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}")
+ list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}")
+ list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}")
endif ()
endforeach()
@@ -627,14 +800,14 @@ function(add_jar _TARGET_NAME)
OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
COMMAND ${CMAKE_COMMAND}
-DCMAKE_JAVA_CLASS_OUTPUT_PATH=${CMAKE_JAVA_CLASS_OUTPUT_PATH}
- -DCMAKE_JAR_CLASSES_PREFIX="${CMAKE_JAR_CLASSES_PREFIX}"
+ -DCMAKE_JAR_CLASSES_PREFIX=${CMAKE_JAR_CLASSES_PREFIX}
-P ${_JAVA_CLASS_FILELIST_SCRIPT}
DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
else ()
# create an empty java_class_filelist
- if (NOT EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist")
+ if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
endif()
endif ()
@@ -731,8 +904,9 @@ function(add_jar _TARGET_NAME)
# create an INTERFACE library encapsulating include directory for generated headers
add_library (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE)
target_include_directories (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE
- "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}"
+ "${_GENERATE_NATIVE_HEADERS_OUTPUT_DESC}"
${JNI_INCLUDE_DIRS})
+ set_property(TARGET ${_GENERATE_NATIVE_HEADERS_TARGET} PROPERTY NATIVE_HEADERS_DIRECTORY "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
# this INTERFACE library depends on jar generation
add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME})
@@ -985,7 +1159,7 @@ function(create_javadoc _target)
elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
- list (APPEND _javadoc_packages ${arg})
+ list(APPEND _javadoc_packages ${arg})
endif ()
elseif (_state STREQUAL "files")
if (arg STREQUAL "PACKAGES")
@@ -1009,7 +1183,7 @@ function(create_javadoc _target)
elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
- list (APPEND _javadoc_files ${arg})
+ list(APPEND _javadoc_files ${arg})
endif ()
elseif (_state STREQUAL "sourcepath")
if (arg STREQUAL "PACKAGES")
@@ -1033,7 +1207,7 @@ function(create_javadoc _target)
elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
- list (APPEND _javadoc_sourcepath ${arg})
+ list(APPEND _javadoc_sourcepath ${arg})
endif ()
elseif (_state STREQUAL "classpath")
if (arg STREQUAL "PACKAGES")
@@ -1057,7 +1231,7 @@ function(create_javadoc _target)
elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
- list (APPEND _javadoc_classpath ${arg})
+ list(APPEND _javadoc_classpath ${arg})
endif ()
elseif (_state STREQUAL "installpath")
if (arg STREQUAL "PACKAGES")
@@ -1238,68 +1412,45 @@ function(create_javadoc _target)
set(_javadoc_options -d ${_javadoc_builddir})
if (_javadoc_sourcepath)
- set(_start TRUE)
- foreach(_path IN LISTS _javadoc_sourcepath)
- if (_start)
- set(_sourcepath ${_path})
- set(_start FALSE)
- else ()
- set(_sourcepath ${_sourcepath}:${_path})
- endif ()
- endforeach()
- set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath})
+ list(JOIN _javadoc_sourcepath "${_UseJava_PATH_SEP}" _javadoc_sourcepath)
+ list(APPEND _javadoc_options -sourcepath "\"${_javadoc_sourcepath}\"")
endif ()
if (_javadoc_overview)
- set(_start TRUE)
- foreach(_path IN LISTS _javadoc_overview)
- if (_start)
- set(_overview ${_path})
- set(_start FALSE)
- else ()
- set(_overview ${_overview}:${_path})
- endif ()
- endforeach ()
- set(_javadoc_options ${_javadoc_options} -overview ${_overview})
+ list(JOIN _javadoc_overview "${_UseJava_PATH_SEP}" _javadoc_overview)
+ list(APPEND _javadoc_options -overview "\"${_javadoc_overview}\"")
endif ()
if (_javadoc_classpath)
- set(_start TRUE)
- foreach(_path IN LISTS _javadoc_classpath)
- if (_start)
- set(_classpath ${_path})
- set(_start FALSE)
- else ()
- set(_classpath ${_classpath}:${_path})
- endif ()
- endforeach()
- set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}")
+ list(JOIN _javadoc_classpath "${_UseJava_PATH_SEP}" _javadoc_classpath)
+ list(APPEND _javadoc_options -classpath "\"${_javadoc_classpath}\"")
endif ()
if (_javadoc_doctitle)
- set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}')
+ list(APPEND _javadoc_options -doctitle '${_javadoc_doctitle}')
endif ()
if (_javadoc_windowtitle)
- set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}')
+ list(APPEND _javadoc_options -windowtitle '${_javadoc_windowtitle}')
endif ()
if (_javadoc_author)
- set(_javadoc_options ${_javadoc_options} -author)
+ list(APPEND _javadoc_options -author)
endif ()
if (_javadoc_use)
- set(_javadoc_options ${_javadoc_options} -use)
+ list(APPEND _javadoc_options -use)
endif ()
if (_javadoc_version)
- set(_javadoc_options ${_javadoc_options} -version)
+ list(APPEND _javadoc_options -version)
endif ()
add_custom_target(${_target}_javadoc ALL
- COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options}
- ${_javadoc_files}
- ${_javadoc_packages}
+ COMMAND ${Java_JAVADOC_EXECUTABLE}
+ ${_javadoc_options}
+ ${_javadoc_files}
+ ${_javadoc_packages}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
@@ -1335,11 +1486,6 @@ function (create_javah)
endif()
set (_output_files)
- if (WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
- set(_classpath_sep "$<SEMICOLON>")
- else ()
- set(_classpath_sep ":")
- endif()
# handle javah options
set (_javah_options)
@@ -1365,7 +1511,7 @@ function (create_javah)
message(SEND_ERROR "create_javah: CLASSPATH entry ${_path} does not exist.")
endif()
endforeach()
- string (REPLACE ";" "${_classpath_sep}" _classpath "${_classpath}")
+ string (REPLACE ";" "${_UseJava_PATH_SEP}" _classpath "${_classpath}")
list (APPEND _javah_options -classpath "${_classpath}")
endif()
diff --git a/config/cmake/UseJavaClassFilelist.cmake b/config/cmake/UseJavaClassFilelist.cmake
index 8348e4c..d90ca48 100644
--- a/config/cmake/UseJavaClassFilelist.cmake
+++ b/config/cmake/UseJavaClassFilelist.cmake
@@ -1,17 +1,8 @@
# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-#[=======================================================================[.rst:
-UseJavaClassFilelist
---------------------
-
-
-
-
-
-This script create a list of compiled Java class files to be added to
-a jar file. This avoids including cmake files which get created in
-the binary directory.
-#]=======================================================================]
+# This script creates a list of compiled Java class files to be added to
+# a jar file. This avoids including cmake files which get created in
+# the binary directory.
if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
@@ -23,7 +14,7 @@ if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${JAR_CLASS_PREFIX}/*.class")
if (_JAVA_GLOBBED_TMP_FILES)
- list (APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES})
+ list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES})
endif ()
endforeach()
else()
diff --git a/config/cmake/UseJavaSymlinks.cmake b/config/cmake/UseJavaSymlinks.cmake
index a4db5c1..cb2e282 100644
--- a/config/cmake/UseJavaSymlinks.cmake
+++ b/config/cmake/UseJavaSymlinks.cmake
@@ -1,15 +1,6 @@
# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
-#[=======================================================================[.rst:
-UseJavaSymlinks
----------------
-
-
-
-
-
-Helper script for UseJava.cmake
-#]=======================================================================]
+# Helper script for UseJava.cmake
if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
if (_JAVA_TARGET_OUTPUT_NAME)
diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake
index fc85277..e423deb 100644
--- a/config/cmake/cacheinit.cmake
+++ b/config/cmake/cacheinit.cmake
@@ -21,6 +21,8 @@ set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace (can be empty)" FORCE)
+set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build C++ support" FORCE)
+
set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
set (HDF5_INSTALL_MOD_FORTRAN "NO" CACHE STRING "Copy FORTRAN mod files to include directory (NO SHARED STATIC)" FORCE)
diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in
index 8e93dc6..20ce630 100644
--- a/config/cmake/hdf5-config-version.cmake.in
+++ b/config/cmake/hdf5-config-version.cmake.in
@@ -33,7 +33,7 @@ else()
endif()
if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
- (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
+ (PACKAGE_FIND_VERSION_MINOR STRLESS_EQUAL CVF_VERSION_MINOR))
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index 4d02c9c..8faa2fe 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -38,6 +38,7 @@ set (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
set (${HDF5_PACKAGE_NAME}_BUILD_JAVA @HDF5_BUILD_JAVA@)
set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
+set (${HDF5_PACKAGE_NAME}_BUILD_HL_TOOLS @HDF5_BUILD_HL_TOOLS@)
set (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE @HDF5_ENABLE_THREADSAFE@)
set (${HDF5_PACKAGE_NAME}_ENABLE_PLUGIN_SUPPORT @HDF5_ENABLE_PLUGIN_SUPPORT@)
set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
diff --git a/config/cmake/javaTargets.cmake.in b/config/cmake/javaTargets.cmake.in
new file mode 100644
index 0000000..6e14256
--- /dev/null
+++ b/config/cmake/javaTargets.cmake.in
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 2.8.12)
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.8)
+
+#----------------------------------------------------------------
+# Generated CMake Java target import file.
+#----------------------------------------------------------------
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_targetsDefined)
+set(_targetsNotDefined)
+set(_expectedTargets)
+foreach(_expectedTarget @__targets__@)
+ list(APPEND _expectedTargets ${_expectedTarget})
+ if(TARGET ${_expectedTarget})
+ list(APPEND _targetsDefined ${_expectedTarget})
+ else()
+ list(APPEND _targetsNotDefined ${_expectedTarget})
+ endif()
+endforeach()
+if("%${_targetsDefined}" STREQUAL "%${_expectedTargets}")
+ unset(_targetsDefined)
+ unset(_targetsNotDefined)
+ unset(_expectedTargets)
+ cmake_policy(POP)
+ return()
+endif()
+if(NOT "${_targetsDefined}" STREQUAL "")
+ message(FATAL_ERROR
+ "Some (but not all) targets in this export set were already defined.\n"
+ "Targets Defined: ${_targetsDefined}\n"
+ "Targets not yet defined: ${_targetsNotDefined}\n")
+endif()
+unset(_targetsDefined)
+unset(_targetsNotDefined)
+unset(_expectedTargets)
+
+@__targetdefs__@
+cmake_policy(POP)
diff --git a/config/cmake/libh5cc.in b/config/cmake/libh5cc.in
index f7cab98..ecdd13e 100644
--- a/config/cmake/libh5cc.in
+++ b/config/cmake/libh5cc.in
@@ -29,4 +29,4 @@ printf 'dir is %s\n' "$dir"
export PKG_CONFIG_PATH=$dir/lib/pkgconfig
-@_PKG_CONFIG_COMPILER@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@-@_PKG_CONFIG_VERSION@` $@
+@_PKG_CONFIG_COMPILER@ $@ `pkg-config --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@`
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index ebcbd61..eb83c3a 100644
--- a/config/cmake/libhdf5.settings.cmake.in
+++ b/config/cmake/libhdf5.settings.cmake.in
@@ -70,6 +70,7 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
High-level library: @HDF5_BUILD_HL_LIB@
Build HDF5 Tests: @BUILD_TESTING@
Build HDF5 Tools: @HDF5_BUILD_TOOLS@
+ Build High-level HDF5 Tools: @HDF5_BUILD_HL_TOOLS@
Threadsafety: @HDF5_ENABLE_THREADSAFE@
Default API mapping: @DEFAULT_API_VERSION@
With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index 08e38e8..8df7dd4 100644
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -11,7 +11,7 @@
#
#############################################################################################
### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ###
-### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ###
+### BUILD_GENERATOR required [Unix, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564] ###
### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ###
#############################################################################################
@@ -68,7 +68,7 @@ endif ()
# build generator must be defined
if (NOT DEFINED BUILD_GENERATOR)
- message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
+ message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2019, VS201964, VS2017, or VS201764, VS2015, VS201564")
endif ()
###################################################################
@@ -163,7 +163,7 @@ if (NOT DEFINED HPC)
set (SITE_COMPILER_NAME "vs2012")
set (SITE_COMPILER_VERSION "11")
else ()
- message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
+ message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2019, VS201964, VS2017, or VS201764, VS2015, VS201564")
endif ()
## Set the following to unique id your computer ##
set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX")
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake
index 7133e6c..136f55d 100644
--- a/config/cmake/scripts/HDF5options.cmake
+++ b/config/cmake/scripts/HDF5options.cmake
@@ -69,7 +69,7 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
#### package examples ####
-#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.14.1-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}")
+#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.14.4-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}")
#############################################################################################
### enable parallel builds
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 004aded..1dd1440 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -53,7 +53,6 @@ if (MINGW)
set (${HDF_PREFIX}_HAVE_MINGW 1)
set (WINDOWS 1) # MinGW tries to imitate Windows
set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
- set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
set (__USE_MINGW_ANSI_STDIO 1)
endif ()
@@ -72,11 +71,8 @@ if (WINDOWS)
set (${HDF_PREFIX}_HAVE_WIN32_API 1)
set (${HDF_PREFIX}_HAVE_LIBM 1)
set (${HDF_PREFIX}_HAVE_STRDUP 1)
- set (${HDF_PREFIX}_HAVE_SYSTEM 1)
- set (${HDF_PREFIX}_HAVE_LONGJMP 1)
if (NOT MINGW)
set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1)
- set (${HDF_PREFIX}_HAVE_FUNCTION 1)
endif ()
if (NOT UNIX AND NOT CYGWIN)
set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1)
@@ -118,25 +114,8 @@ CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
-CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H)
-CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H)
-CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)
-
-# Windows
-CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H)
-if (NOT CYGWIN)
- CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
-endif ()
-
-if (CMAKE_SYSTEM_NAME MATCHES "OSF")
- CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H)
- CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H)
-else ()
- set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE)
- set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE)
-endif ()
-
+CHECK_INCLUDE_FILE_CONCAT ("pwd.h" ${HDF_PREFIX}_HAVE_PWD_H)
CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
@@ -146,12 +125,9 @@ CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H)
CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H)
CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H)
-CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H)
CHECK_INCLUDE_FILE_CONCAT ("arpa/inet.h" ${HDF_PREFIX}_HAVE_ARPA_INET_H)
-# _Bool type support
-CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H)
## Check for non-standard extenstion quadmath.h
@@ -238,11 +214,6 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
endmacro ()
#-----------------------------------------------------------------------------
-# Check for these functions before the time headers are checked
-#-----------------------------------------------------------------------------
-HDF_FUNCTION_TEST (STDC_HEADERS)
-
-#-----------------------------------------------------------------------------
# Check for large file support
#-----------------------------------------------------------------------------
@@ -394,15 +365,13 @@ HDF_CHECK_TYPE_SIZE (uint_least64_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST64_T)
HDF_CHECK_TYPE_SIZE (int_fast64_t ${HDF_PREFIX}_SIZEOF_INT_FAST64_T)
HDF_CHECK_TYPE_SIZE (uint_fast64_t ${HDF_PREFIX}_SIZEOF_UINT_FAST64_T)
-if (NOT APPLE)
- HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T)
- HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T)
- if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
- set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
- endif ()
- if (MINGW OR NOT WINDOWS)
- HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
- endif ()
+HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T)
+HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T)
+if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
+ set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
+endif ()
+if (MINGW OR NOT WINDOWS)
+ HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
endif ()
HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T)
@@ -416,13 +385,9 @@ HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T)
# Extra C99 types
#-----------------------------------------------------------------------------
-# _Bool type support
-if (HAVE_STDBOOL_H)
- set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
- HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL)
-else ()
- HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
-endif ()
+# Size of bool
+set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
+HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
@@ -441,7 +406,6 @@ if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE_TM_GMTOFF)
CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE___TM_GMTOFF)
- CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_TIME_WITH_SYS_TIME)
if (${HDF_PREFIX}_HAVE_SYS_TIME_H)
CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE)
else ()
@@ -495,61 +459,37 @@ CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM)
CHECK_FUNCTION_EXISTS (fcntl ${HDF_PREFIX}_HAVE_FCNTL)
CHECK_FUNCTION_EXISTS (flock ${HDF_PREFIX}_HAVE_FLOCK)
CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK)
-CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF)
-CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL)
CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME)
CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE)
-CHECK_FUNCTION_EXISTS (llround ${HDF_PREFIX}_HAVE_LLROUND)
-CHECK_FUNCTION_EXISTS (llroundf ${HDF_PREFIX}_HAVE_LLROUNDF)
-CHECK_FUNCTION_EXISTS (lround ${HDF_PREFIX}_HAVE_LROUND)
-CHECK_FUNCTION_EXISTS (lroundf ${HDF_PREFIX}_HAVE_LROUNDF)
CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT)
CHECK_FUNCTION_EXISTS (pread ${HDF_PREFIX}_HAVE_PREAD)
CHECK_FUNCTION_EXISTS (pwrite ${HDF_PREFIX}_HAVE_PWRITE)
CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R)
CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM)
-CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND)
-CHECK_FUNCTION_EXISTS (roundf ${HDF_PREFIX}_HAVE_ROUNDF)
CHECK_FUNCTION_EXISTS (setsysinfo ${HDF_PREFIX}_HAVE_SETSYSINFO)
-CHECK_FUNCTION_EXISTS (signal ${HDF_PREFIX}_HAVE_SIGNAL)
-CHECK_FUNCTION_EXISTS (longjmp ${HDF_PREFIX}_HAVE_LONGJMP)
-CHECK_FUNCTION_EXISTS (setjmp ${HDF_PREFIX}_HAVE_SETJMP)
CHECK_FUNCTION_EXISTS (siglongjmp ${HDF_PREFIX}_HAVE_SIGLONGJMP)
CHECK_FUNCTION_EXISTS (sigsetjmp ${HDF_PREFIX}_HAVE_SIGSETJMP)
CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK)
-CHECK_FUNCTION_EXISTS (snprintf ${HDF_PREFIX}_HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM)
CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP)
-CHECK_FUNCTION_EXISTS (strtoll ${HDF_PREFIX}_HAVE_STRTOLL)
-CHECK_FUNCTION_EXISTS (strtoull ${HDF_PREFIX}_HAVE_STRTOULL)
CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK)
-CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM)
CHECK_FUNCTION_EXISTS (tmpfile ${HDF_PREFIX}_HAVE_TMPFILE)
CHECK_FUNCTION_EXISTS (asprintf ${HDF_PREFIX}_HAVE_ASPRINTF)
CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID)
-CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF)
-if (MINGW OR NOT WINDOWS)
- if (${HDF_PREFIX}_HAVE_VSNPRINTF)
- HDF_FUNCTION_TEST (VSNPRINTF_WORKS)
- endif ()
-endif ()
-
#-----------------------------------------------------------------------------
# sigsetjmp is special; may actually be a macro
#-----------------------------------------------------------------------------
if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP)
- if (${HDF_PREFIX}_HAVE_SETJMP_H)
- CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
- if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
- set (${HDF_PREFIX}_HAVE_SIGSETJMP 1)
- endif ()
+ CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
+ if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
+ set (${HDF_PREFIX}_HAVE_SIGSETJMP 1)
endif ()
endif ()
@@ -559,9 +499,6 @@ endif ()
if (MINGW OR NOT WINDOWS)
foreach (other_test
HAVE_ATTRIBUTE
- HAVE_C99_FUNC
-# STDC_HEADERS
- HAVE_FUNCTION
HAVE_C99_DESIGNATED_INITIALIZER
SYSTEM_SCOPE_THREADS
HAVE_SOCKLEN_T
@@ -633,14 +570,6 @@ if (WINDOWS)
endif ()
#-----------------------------------------------------------------------------
-# Determine how 'inline' is used
-#-----------------------------------------------------------------------------
-foreach (inline_test inline __inline__ __inline)
- string (TOUPPER ${inline_test} INLINE_TEST_MACRO)
- HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO})
-endforeach ()
-
-#-----------------------------------------------------------------------------
# Check how to print a Long Long integer
#-----------------------------------------------------------------------------
if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown")
diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp
deleted file mode 100644
index f05151b..0000000
--- a/config/cmake_ext_mod/HDFCXXTests.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#ifdef OLD_HEADER_FILENAME
-
-#include <iostream>
-
-int main(void) { return 0; }
-
-#endif
-
-
-#ifdef HDF_NO_NAMESPACE
-
-namespace HDF {
-int fnord;
-}
-
-int main(void) {
- using namespace HDF;
- fnord = 37;
- return 0;
-}
-
-#endif
-
-#ifdef HDF_NO_STD
-
-#include <string>
-
-using namespace std;
-
-int main(void) {
- string myString("testing namespace std");
- return 0;
-}
-
-#endif
-
-#ifdef BOOL_NOTDEFINED
-int main(void) {
- bool flag;
- return 0;
-}
-
-#endif
-
-#ifdef NO_STATIC_CAST
-
-int main(void) {
- float test_float;
- int test_int;
- test_float = 37.0;
- test_int = static_cast <int> (test_float);
- return 0;
-}
-
-#endif
-
-#ifdef CXX_HAVE_OFFSETOF
-
-#include <stdio.h>
-#include <stddef.h>
-
-#ifdef FC_DUMMY_MAIN
-#ifndef FC_DUMMY_MAIN_EQ_F77
-# ifdef __cplusplus
-extern "C"
-# endif
-int FC_DUMMY_MAIN()
-{ return 1;}
-#endif
-#endif
-int
-main ()
-{
-
- struct index_st
- {
- unsigned char type;
- unsigned char num;
- unsigned int len;
- };
- typedef struct index_st index_t;
- int x,y;
- x = offsetof(struct index_st, len);
- y = offsetof(index_t, num)
-
- ;
- return 0;
-}
-
-#endif
diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c
index 2d7e1b4..c434be5 100644
--- a/config/cmake_ext_mod/HDFTests.c
+++ b/config/cmake_ext_mod/HDFTests.c
@@ -44,59 +44,6 @@ main ()
#endif
-#ifdef HAVE_C99_FUNC
-
-#ifdef FC_DUMMY_MAIN
-#ifndef FC_DUMMY_MAIN_EQ_F77
-# ifdef __cplusplus
- extern "C"
-# endif
- int FC_DUMMY_MAIN() { return 1; }
-#endif
-#endif
-int
-main ()
-{
- const char *fname = __func__;
- ;
- return 0;
-}
-
-#endif
-
-#ifdef VSNPRINTF_WORKS
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-int test_vsnprintf(const char *fmt,...)
-{
- va_list ap;
- char *s = malloc(16);
- int ret;
-
- va_start(ap, fmt);
- ret=vsnprintf(s,16,"%s",ap);
- va_end(ap);
-
- return(ret!=42 ? 1 : 0);
-}
-
-int main(void)
-{
- return(test_vsnprintf("%s","A string that is longer than 16 characters"));
-}
-#endif
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-int main() { return 0; }
-#endif /* STDC_HEADERS */
-
-
#ifdef HAVE_ATTRIBUTE
#if 0
@@ -123,26 +70,6 @@ int __attribute__((unused)) x
#endif /* HAVE_ATTRIBUTE */
-#ifdef HAVE_FUNCTION
-
-#ifdef FC_DUMMY_MAIN
-#ifndef FC_DUMMY_MAIN_EQ_F77
-# ifdef __cplusplus
- extern "C"
-# endif
- int FC_DUMMY_MAIN() { return 1; }
-#endif
-#endif
-int
-main ()
-{
-(void)__FUNCTION__
- ;
- return 0;
-}
-
-#endif /* HAVE_FUNCTION */
-
#ifdef HAVE_TIMEZONE
#ifdef HAVE_SYS_TIME_H
@@ -364,20 +291,3 @@ int main ()
}
#endif /* HAVE_IOEO */
-
-#if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE )
-#ifndef __cplusplus
-#if defined( HAVE_INLINE )
-# define INLINE_KW inline
-#elif defined ( HAVE___INLINE__ )
-# define INLINE_KW __inline__
-#elif defined ( HAVE___INLINE )
-# define INLINE_KW __inline
-#endif /* HAVE_INLINE */
-typedef int foo_t;
-static INLINE_KW foo_t static_foo () { return 0; }
-INLINE_KW foo_t foo () {return 0; }
-int main(void) { return 0; }
-#endif /* __cplusplus */
-#endif /* defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) */
-
diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake
deleted file mode 100644
index 28e7f8a..0000000
--- a/config/cmake_ext_mod/HDFUseCXX.cmake
+++ /dev/null
@@ -1,115 +0,0 @@
-#
-# Copyright by The HDF Group.
-# All rights reserved.
-#
-# This file is part of HDF5. The full HDF5 copyright notice, including
-# terms governing use, modification, and redistribution, is contained in
-# the COPYING file, which can be found at the root of the source code
-# distribution tree, or in https://www.hdfgroup.org/licenses.
-# If you do not have access to either file, you may request a copy from
-# help@hdfgroup.org.
-#
-#
-# This file provides functions for C++ support.
-#
-#-------------------------------------------------------------------------------
-ENABLE_LANGUAGE (CXX)
-set (HDF_PREFIX "H5")
-
-#-------------------------------------------------------------------------------
-# Fix CXX flags if we are compiling staticly on Windows using
-# Windows_MT.cmake from config/cmake/UserMacros
-#-------------------------------------------------------------------------------
-if (BUILD_STATIC_CRT_LIBS)
- TARGET_STATIC_CRT_FLAGS ()
-endif ()
-
-#-----------------------------------------------------------------------------
-# Configure Checks which require CXX compilation must go in here
-# not in the main ConfigureChecks.cmake files, because if the user has
-# no CXX compiler, problems arise.
-#-----------------------------------------------------------------------------
-include (CheckIncludeFileCXX)
-include (TestForSTDNamespace)
-
-# IF the c compiler found stdint, check the C++ as well. On some systems this
-# file will be found by C but not C++, only do this test IF the C++ compiler
-# has been initialized (e.g. the project also includes some c++)
-if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
- CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
- if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX)
- set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
- set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
- endif ()
-endif ()
-
-# For other CXX specific tests, use this MACRO.
-macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
- if (NOT DEFINED ${OTHER_TEST})
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
- set (OTHER_TEST_ADD_LIBRARIES)
- if (HDF5_REQUIRED_LIBRARIES)
- set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}")
- endif ()
-
- foreach (def
- HAVE_SYS_TIME_H
- HAVE_UNISTD_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_FILE_H
- )
- if ("${${HDF_PREFIX}_${def}}")
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}")
- endif ()
- endforeach ()
-
- if (LARGEFILE)
- set (MACRO_CHECK_FUNCTION_DEFINITIONS
- "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
- )
- endif ()
-
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (TRACE "Performing ${OTHER_TEST}")
- endif ()
- TRY_COMPILE (${OTHER_TEST}
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
- "${OTHER_TEST_ADD_LIBRARIES}"
- OUTPUT_VARIABLE OUTPUT
- )
- if (${OTHER_TEST} EQUAL 0)
- set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}")
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Success")
- endif ()
- else ()
- if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
- message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Failed")
- endif ()
- set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}")
- file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
- "Performing CXX Test ${OTHER_TEST} failed with the following output:\n"
- "${OUTPUT}\n"
- )
- endif ()
- endif ()
-endmacro ()
-
-#-----------------------------------------------------------------------------
-# Check a bunch of cxx functions
-#-----------------------------------------------------------------------------
-if (CMAKE_CXX_COMPILER_LOADED)
- foreach (cxx_test
- OLD_HEADER_FILENAME
- HDF_NO_NAMESPACE
- HDF_NO_STD
- BOOL_NOTDEFINED
- NO_STATIC_CAST
- CXX_HAVE_OFFSETOF
- )
- HDF_CXX_FUNCTION_TEST (${cxx_test})
- endforeach ()
-endif ()
diff --git a/config/commence.am b/config/commence.am
index 96c2fc2..3fddc6a 100644
--- a/config/commence.am
+++ b/config/commence.am
@@ -45,7 +45,7 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
docdir = $(exec_prefix)/doc
# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
+# has been removed. According to the official description of DESTDIR by GNU at
# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
# prepended to the normal and complete install path that it precedes for the
# purpose of installing in a temporary directory which is useful for building
diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags
index 3fe13d8..9f11406 100644
--- a/config/gnu-cxxflags
+++ b/config/gnu-cxxflags
@@ -119,7 +119,7 @@ if test "X-g++" = "X-$cxx_vendor"; then
esac
# C++-specific
- H5_CXXFLAGS="$H5_CXXFLAGS $arch"
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch -std=c++11"
##############
# Production #
@@ -148,7 +148,7 @@ if test "X-g++" = "X-$cxx_vendor"; then
# Enhanced Diagnostics #
########################
- if test $cc_vers_major -ge 10; then
+ if test $cxx_vers_major -ge 10; then
NO_DIAGS_CXXFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color"
fi
DIAGS_CXXFLAGS=
@@ -183,7 +183,6 @@ if test "X-g++" = "X-$cxx_vendor"; then
# Warnings #
############
-# First load the C warnings then add CXX warnings (if needed)
###########
# General #
@@ -199,6 +198,7 @@ if test "X-g++" = "X-$cxx_vendor"; then
# Developer warnings #
######################
+ # Use the C warnings as CXX warnings are the same
NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general)
DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general)
@@ -210,6 +210,7 @@ if test "X-g++" = "X-$cxx_vendor"; then
# GCC 4.8 through the end of GCC 4 series
if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8-4.last)"
fi
@@ -220,13 +221,13 @@ if test "X-g++" = "X-$cxx_vendor"; then
# gcc >= 4.8
if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.8)"
+ # Use the C warnings as CXX warnings are the same
DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)"
NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)"
fi
# gcc >= 4.9
if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 9; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.9)"
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.9)"
fi
@@ -239,27 +240,40 @@ if test "X-g++" = "X-$cxx_vendor"; then
# gcc >= 6
if test $cxx_vers_major -ge 6; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 6)"
fi
# gcc >= 7
if test $cxx_vers_major -ge 7; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 7)"
DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-7)"
fi
# gcc 8
if test $cxx_vers_major -ge 8; then
+ # Use the C warnings as CXX warnings are the same
H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)"
#H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)"
#H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments noerror-8)"
+ # Use the C warnings as CXX warnings are the same
DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)"
NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-8)"
fi
# gcc 9
if test $cxx_vers_major -ge 9; then
- H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 9)"
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-9)"
+ fi
+
+ # gcc >= 9.3
+ # no cxx warnings, do NOT use C warnings
+
+ # gcc >= 10
+ if test $cxx_vers_major -ge 10; then
+ # Use the C warnings as CXX warnings are the same
+ DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-10)"
fi
#################
diff --git a/config/gnu-fflags b/config/gnu-fflags
index d4f876d..ce12561 100644
--- a/config/gnu-fflags
+++ b/config/gnu-fflags
@@ -109,7 +109,7 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# Enhanced Diagnostics #
########################
- if test $cc_vers_major -ge 10; then
+ if test $f9x_vers_major -ge 10; then
NO_DIAGS_FCFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color"
fi
DIAGS_FCFLAGS=
@@ -161,10 +161,10 @@ if test "X-gfortran" = "X-$f9x_vendor"; then
# gfortran 4.9 (nothing new)
- # gfortran >= 5
- if test $f9x_vers_major -ge 5; then
- H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)"
- fi
+ # gfortran >= 5 (do not include -Wuse-without-only)
+ #if test $f9x_vers_major -ge 5; then
+ # H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-5)"
+ #fi
# gfortran >= 6
if test $f9x_vers_major -ge 6; then
diff --git a/config/gnu-flags b/config/gnu-flags
index 01533de..3e4ceb2 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -207,9 +207,9 @@ if test "X-gcc" = "X-$cc_vendor"; then
H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)"
H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-general)"
- ######################
- # Developer warnings #
- ######################
+ ######################
+ # Developer warnings #
+ ######################
NO_DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments no-developer-general)
DEVELOPER_WARNING_CFLAGS=$(load_gnu_arguments developer-general)
diff --git a/config/gnu-warnings/cxx-4.9 b/config/gnu-warnings/cxx-4.9
index 046d6db..30553bd 100644
--- a/config/gnu-warnings/cxx-4.9
+++ b/config/gnu-warnings/cxx-4.9
@@ -1 +1,2 @@
+-Wdate-time
-Wopenmp-simd
diff --git a/config/gnu-warnings/cxx-9 b/config/gnu-warnings/cxx-9
new file mode 100644
index 0000000..8f843a4
--- /dev/null
+++ b/config/gnu-warnings/cxx-9
@@ -0,0 +1,4 @@
+-Wattribute-alias=2
+-Wmissing-profile
+# Turn this on when the C++ wrappers obey the Rule of Five
+-Wno-deprecated-copy
diff --git a/config/gnu-warnings/developer-10 b/config/gnu-warnings/developer-10
index fcd460d..022c97f 100644
--- a/config/gnu-warnings/developer-10
+++ b/config/gnu-warnings/developer-10
@@ -1,6 +1,2 @@
# New warning
-Warith-conversion
-
-# Enable static analysis of program flow
--fanalyzer
--fdiagnostics-path-format=none
diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general
index 4358b20..8405c40 100644
--- a/config/gnu-warnings/error-general
+++ b/config/gnu-warnings/error-general
@@ -3,7 +3,6 @@
# circumstances, so ask the compiler to treat them as errors:
#
-Werror=bad-function-cast
--Werror=declaration-after-statement
-Werror=implicit-function-declaration
-Werror=missing-declarations
-Werror=missing-prototypes
diff --git a/config/gnu-warnings/noerror-general b/config/gnu-warnings/noerror-general
index e19014f..f49d89a 100644
--- a/config/gnu-warnings/noerror-general
+++ b/config/gnu-warnings/noerror-general
@@ -1,9 +1,10 @@
#
-# HDF5 code should not trigger the following warnings under any
-# circumstances, so ask the compiler to treat them as errors:
+# These warnings will be treated as errors, using the error-general file,
+# when HDF5_ENABLE_WARNINGS_AS_ERRORS is set to true for CMake or
+# the --enable-warnings-as-errors option is specified for configure.
+# Otherwise this file will be used to treat them as warnings.
#
-Wbad-function-cast
--Wdeclaration-after-statement
-Wimplicit-function-declaration
-Wmissing-declarations
-Wmissing-prototypes
diff --git a/config/intel-cxxflags b/config/intel-cxxflags
new file mode 100644
index 0000000..107b087
--- /dev/null
+++ b/config/intel-cxxflags
@@ -0,0 +1,185 @@
+# -*- shell-script -*-
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://www.hdfgroup.org/licenses.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+
+
+# This file should be sourced into configure if the compiler is the
+# Intel icpc compiler or a derivative. It is careful not to do anything
+# if the compiler is not Intel; otherwise `cxx_flags_set' is set to `yes'
+#
+
+#
+# Prepend `$srcdir/config/intel-warnings/` to the filename suffix(es) given as
+# subroutine argument(s), remove comments starting with # and ending
+# at EOL, replace spans of whitespace (including newlines) with spaces,
+# and re-emit the file(s) thus filtered on the standard output stream.
+#
+load_intel_arguments()
+{
+ set -- $(for arg; do
+ sed 's,#.*$,,' $srcdir/config/intel-warnings/${arg}
+ done)
+ IFS=' ' echo "$*"
+}
+
+# Get the compiler version in a way that works for icpc
+# icpc unless a compiler version is already known
+#
+# cxx_vendor: The compiler name: icpc
+# cxx_version: Version number: 8.0
+#
+if test X = "X$cxx_flags_set"; then
+ cxx_version="`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 |grep 'Version'`"
+ if test X != "X$cxx_version"; then
+ cxx_vendor=icpc
+ cxx_version=`echo $cxx_version |sed 's/.*Version \([-a-z0-9\.\-]*\).*/\1/'`
+ echo "compiler '$CXX' is Intel $cxx_vendor-$cxx_version"
+
+ # Some version numbers
+ # Intel version numbers are of the form: "major.minor"
+ cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
+ cxx_vers_minor=`echo $cxx_version | cut -f2 -d.`
+ #cxx_vers_patch=`echo $cxx_version | cut -f2 -d.`
+ test -n "$cxx_vers_major" || cxx_vers_major=0
+ test -n "$cxx_vers_minor" || cxx_vers_minor=0
+ test -n "$cxx_vers_patch" || cxx_vers_patch=0
+ cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch`
+ fi
+fi
+
+# Common Intel flags for various situations
+if test "X-icpc" = "X-$cxx_vendor"; then
+ # Insert section about version specific problems from compiler flags here,
+ # if necessary.
+
+ arch=
+ # Architecture-specific flags
+ # Nothing currently. (Uncomment code below and modify to add any)
+ #case "$host_os-$host_cpu" in
+ # *-i686)
+ # arch="-march=i686"
+ # ;;
+ #esac
+
+ # Host-specific flags
+ # Nothing currently. (Uncomment code below and modify to add any)
+ #case "`hostname`" in
+ # sleipnir.ncsa.uiuc.edu)
+ # arch="$arch -pipe"
+ # ;;
+ #esac
+
+ ###########
+ # General #
+ ###########
+
+ # Default to C++11 standard
+ H5_CXXFLAGS="$H5_CXXFLAGS $arch -std=c++11"
+
+ ##############
+ # Production #
+ ##############
+
+ PROD_CXXFLAGS=
+
+ #########
+ # Debug #
+ #########
+
+ # NDEBUG is handled explicitly in configure
+ # -g is handled by the symbols flags
+ DEBUG_CXXFLAGS=
+
+ ###########
+ # Symbols #
+ ###########
+
+ NO_SYMBOLS_CXXFLAGS="-Wl,-s"
+ SYMBOLS_CXXFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
+
+ PROFILE_CXXFLAGS="-p"
+
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CXXFLAGS="-O3"
+ DEBUG_OPT_CXXFLAGS="-O0"
+ NO_OPT_CXXFLAGS="-O0"
+
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ # Add various general warning flags in intel-warnings.
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments general)"
+
+ ######################
+ # Developer warnings #
+ ######################
+
+ # Use the C warnings as CXX warnings are the same
+ #NO_DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments no-developer-general)
+ #DEVELOPER_WARNING_CXXFLAGS=$(load_intel_arguments developer-general)
+
+ #############################
+ # Version-specific warnings #
+ #############################
+
+ # intel == 8.0
+ if test $cxx_vers_major -eq 8 -a $cxx_vers_minor -eq 0; then
+ # v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2.
+ HIGH_OPT_CFLAGS="-O2"
+ fi
+
+ # intel == 10
+ if test $cxx_vers_major -eq 10; then
+ HIGH_OPT_CFLAGS="-O1"
+ fi
+
+ # intel >= 15
+ if test $cxx_vers_major -ge 15; then
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments 15)"
+ fi
+
+ # intel >= 18
+ if test $cxx_vers_major -ge 18; then
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments 18)"
+ fi
+
+ # intel <= 19
+ if test $cxx_vers_major -le 19; then
+ # Use the C warnings as CXX warnings are the same
+ H5_CXXFLAGS="$H5_CXXFLAGS $(load_intel_arguments general-19)"
+ fi
+
+ #################
+ # Flags are set #
+ #################
+ cxx_flags_set=yes
+fi
+
+# Clear cxx info if no flags set
+if test "X-$cxx_flags_set" = "X-"; then
+ cxx_vendor=
+ cxx_version=
+fi
diff --git a/config/intel-fflags b/config/intel-fflags
index b759dfa..42c1781 100644
--- a/config/intel-fflags
+++ b/config/intel-fflags
@@ -56,13 +56,17 @@ if test X = "X$f9x_flags_set"; then
fi
fi
-# Common Intel flags for various situations
if test "X-ifort" = "X-$f9x_vendor"; then
- # Insert section about version specific problems from compiler flags here,
- # if necessary.
+
+ FC_BASENAME=ifort
+ F9XSUFFIXFLAG=""
+ FSEARCH_DIRS=""
+
+ ###############################
+ # Architecture-specific flags #
+ ###############################
arch=
- # Architecture-specific flags
# Nothing currently. (Uncomment code below and modify to add any)
#case "$host_os-$host_cpu" in
# *-i686)
@@ -78,32 +82,55 @@ if test "X-ifort" = "X-$f9x_vendor"; then
# ;;
#esac
- # General
- FC_BASENAME=ifort
- F9XSUFFIXFLAG=""
- FSEARCH_DIRS=""
- H5_FCFLAGS="$H5_FCFLAGS -stand:f03 -free"
- H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)"
+ ##############
+ # Production #
+ ##############
- # Production
PROD_FCFLAGS=
- # Debug
+ #########
+ # Debug #
+ #########
+
DEBUG_FCFLAGS="-check all"
- # Symbols
- SYMBOLS_FCFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_FCFLAGS=
+ SYMBOLS_FCFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
- # Use this for profiling with gprof
PROFILE_FCFLAGS="-p"
- # Optimization
+ ################
+ # Optimization #
+ ################
+
HIGH_OPT_FCFLAGS="-O3"
DEBUG_OPT_FCFLAGS=
NO_OPT_FCFLAGS=
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ H5_FCFLAGS="$H5_FCFLAGS -stand:f03 -free"
+ H5_FCFLAGS="$H5_FCFLAGS $(load_intel_arguments ifort-general)"
+
+ #############################
+ # Version-specific warnings #
+ #############################
+
+
#################
# Flags are set #
#################
@@ -116,4 +143,3 @@ if test "X-$f9x_flags_set" = "X-"; then
f9x_version=
fi
-
diff --git a/config/intel-flags b/config/intel-flags
index 409ffe9..f46da0a 100644
--- a/config/intel-flags
+++ b/config/intel-flags
@@ -78,26 +78,43 @@ if test "X-icc" = "X-$cc_vendor"; then
# ;;
#esac
- # General
+ ###########
+ # General #
+ ###########
+
# Default to C99 standard.
H5_CFLAGS="$H5_CFLAGS $arch -std=c99"
- # Production
+ ##############
+ # Production #
+ ##############
+
PROD_CFLAGS=
- # Debug
+ #########
+ # Debug #
+ #########
+
# NDEBUG is handled explicitly in configure
DEBUG_CFLAGS=
- # Symbols
- SYMBOLS_CFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_CFLAGS="-Wl,-s"
+ SYMBOLS_CFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
- # Use this for profiling with gprof
PROFILE_CFLAGS="-p"
- # Optimization
+ ################
+ # Optimization #
+ ################
+
HIGH_OPT_CFLAGS="-O3"
DEBUG_OPT_CFLAGS="-O0"
NO_OPT_CFLAGS="-O0"
@@ -110,32 +127,51 @@ if test "X-icc" = "X-$cc_vendor"; then
# General #
###########
+ # Add various general warning flags in intel-warnings.
H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general)"
+ ######################
+ # Developer warnings #
+ ######################
+
+ #NO_DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments no-developer-general)
+ #DEVELOPER_WARNING_CFLAGS=$(load_intel_arguments developer-general)
+
#############################
# Version-specific warnings #
#############################
-case "$cc_vendor-$cc_version" in
- icc-1[5-6]*)
- H5_CFLAGS="$H5_CFLAGS -Wcomment -Wdeprecated -Wextra-tokens -Wformat -Wformat-security -Wmain -Wmissing-declarations -Wmissing-prototypes -Wp64 -Wpointer-arith -Wreturn-type -Wshadow -Wstrict-prototypes -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-variable -Wwrite-strings"
- ;;
- icc-10*)
- HIGH_OPT_CFLAGS="-O1"
- ;;
- icc-8.0*)
+ # intel == 8.0
+ if test $cc_vers_major -eq 8 -a $cc_vers_minor -eq 0; then
# v8.0 -O3 infinite loops when compiling test/tselect.c. Use -O2.
HIGH_OPT_CFLAGS="-O2"
- ;;
- icc-*)
- ;;
-esac
+ fi
+
+ # intel == 10
+ if test $cc_vers_major -eq 10; then
+ HIGH_OPT_CFLAGS="-O1"
+ fi
+
+ # intel >= 15
+ if test $cc_vers_major -ge 15; then
+ H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 15)"
+ fi
+
+ # intel >= 18
+ if test $cc_vers_major -ge 18; then
+ H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments 18)"
+ fi
+
+ # intel <= 19
+ # this file has warnings only available before oneapi versions
+ if test $cc_vers_major -le 19; then
+ H5_CFLAGS="$H5_CFLAGS $(load_intel_arguments general-19)"
+ fi
#################
# Flags are set #
#################
cc_flags_set=yes
-
fi
# Clear cc info if no flags set
diff --git a/config/intel-warnings/15 b/config/intel-warnings/15
new file mode 100644
index 0000000..6746f97
--- /dev/null
+++ b/config/intel-warnings/15
@@ -0,0 +1,19 @@
+-Wcomment
+-Wdeprecated
+-Wextra-tokens
+-Wformat
+-Wformat-security
+-Wmain
+-Wmissing-declarations
+-Wmissing-prototypes
+-Wp64
+-Wpointer-arith
+-Wreturn-type
+-Wshadow
+-Wstrict-prototypes
+-Wtrigraphs
+-Wuninitialized
+-Wunknown-pragmas
+-Wunused-function
+-Wunused-variable
+-Wwrite-strings
diff --git a/config/intel-warnings/18 b/config/intel-warnings/18
new file mode 100644
index 0000000..02bcdea
--- /dev/null
+++ b/config/intel-warnings/18
@@ -0,0 +1,2 @@
+-Wic-pointer
+-Wsign-compare
diff --git a/config/intel-warnings/developer-general b/config/intel-warnings/developer-general
new file mode 100644
index 0000000..fae56f0
--- /dev/null
+++ b/config/intel-warnings/developer-general
@@ -0,0 +1,4 @@
+-Winline
+-Wreorder
+-Wport
+-Wstrict-aliasing
diff --git a/config/intel-warnings/general b/config/intel-warnings/general
index d0b2e25..bd866b6 100644
--- a/config/intel-warnings/general
+++ b/config/intel-warnings/general
@@ -1,2 +1 @@
-Wall
--Wcheck \ No newline at end of file
diff --git a/config/intel-warnings/win-developer-general b/config/intel-warnings/win-developer-general
new file mode 100644
index 0000000..6cd7ed7
--- /dev/null
+++ b/config/intel-warnings/win-developer-general
@@ -0,0 +1 @@
+/Wport
diff --git a/config/intel-warnings/win-general b/config/intel-warnings/win-general
new file mode 100644
index 0000000..ef54b2b
--- /dev/null
+++ b/config/intel-warnings/win-general
@@ -0,0 +1 @@
+/Wall
diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1
index 0fef161..d952c4e 100644
--- a/config/linux-gnulibc1
+++ b/config/linux-gnulibc1
@@ -199,9 +199,16 @@ if test -z "$CXX"; then
CXX_BASENAME=g++
fi
+# Figure out Intel CXX compiler flags
+# Do this ahead of GNU to avoid icpc being detected as g++
+. $srcdir/config/intel-cxxflags
+
# Figure out GNU CXX compiler flags
. $srcdir/config/gnu-cxxflags
+# Figure out PGI CXX compiler flags
+. $srcdir/config/pgi-cxxflags
+
# Figure out Clang CXX compiler flags
. $srcdir/config/clang-cxxflags
@@ -314,6 +321,9 @@ fi
# check if the compiler_version_info is already set
if test -z "$cxx_version_info"; then
case $CXX in
+ *pgc++*)
+ cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'pgc++'`
+ ;;
*g++*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'`
@@ -322,10 +332,6 @@ case $CXX in
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'Version' |\
sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
;;
- *pgCC*)
- cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -V 2>&1 | grep 'pgCC'`
- ;;
-
*mpicxx*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS -v 2>&1 | grep 'version' |\
sed 's/^[a-z0-9]* for //' |\
diff --git a/config/pgi-cxxflags b/config/pgi-cxxflags
new file mode 100644
index 0000000..7d8bdeb
--- /dev/null
+++ b/config/pgi-cxxflags
@@ -0,0 +1,101 @@
+# -*- shell-script -*-
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://www.hdfgroup.org/licenses.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+
+
+# This file should be sourced into configure if the compiler is the
+# PGI pgc++ compiler or a derivative. It is careful not to do anything
+# if the compiler is not PGI; otherwise `cxx_flags_set' is set to `yes'
+#
+
+# Get the compiler version in a way that works for pgc++
+# pgc++ unless a compiler version is already known
+#
+# cxx_vendor: The compiler name: pgc++
+# cxx_version: Version number: 5.0-2, 5.2-2
+#
+if test X = "X$cxx_flags_set"; then
+ cxx_version="`$CXX $CXXFLAGS -V 2>&1 |grep '^pgc++ '`"
+ if test X != "X$cxx_version"; then
+ cxx_vendor=`echo $cxx_version |sed 's/\([a-z]*++\).*/\1/'`
+ cxx_version=`echo $cxx_version |sed 's/pgc++ \([-a-z0-9\.\-]*\).*/\1/'`
+ echo "compiler '$CXX' is PGI $cxx_vendor-$cxx_version"
+
+ # Some version numbers
+ # PGI version numbers are of the form: "major.minor-patch"
+ cxx_vers_major=`echo $cxx_version | cut -f1 -d.`
+ cxx_vers_minor=`echo $cxx_version | cut -f2 -d. | cut -f1 -d-`
+ cxx_vers_patch=`echo $cxx_version | cut -f2 -d. | cut -f2 -d-`
+ test -n "$cxx_vers_major" || cxx_vers_major=0
+ test -n "$cxx_vers_minor" || cxx_vers_minor=0
+ test -n "$cxx_vers_patch" || cxx_vers_patch=0
+ cxx_vers_all=`expr $cxx_vers_major '*' 1000000 + $cxx_vers_minor '*' 1000 + $cxx_vers_patch`
+ fi
+fi
+
+# Common PGI flags for various situations
+if test "X-pgc++" = "X-$cxx_vendor"; then
+
+ ###########
+ # General #
+ ###########
+
+ # Default to C++11 standard
+ H5_CXXFLAGS="$H5_CXXFLAGS -std=c++11 -Minform=warn"
+
+ ##############
+ # Production #
+ ##############
+
+ PROD_CXXFLAGS=
+
+ #########
+ # Debug #
+ #########
+
+ # NDEBUG is handled explicitly in configure
+ # -g is handled by the symbols flags
+ DEBUG_CXXFLAGS="-Mbounds"
+
+ ###########
+ # Symbols #
+ ###########
+
+ NO_SYMBOLS_CXXFLAGS="-s"
+ SYMBOLS_CXXFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
+
+ PROFILE_CXXFLAGS="-Mprof=func,line"
+ # Use this for profiling with gprof
+ #PROFILE_CXXFLAGS="-pg"
+
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CXXFLAGS="-O4"
+ DEBUG_OPT_CXXFLAGS="-gopt -O2"
+ NO_OPT_CXXFLAGS="-O0"
+
+ #################
+ # Flags are set #
+ #################
+ cxx_flags_set=yes
+fi
+
+# Clear cxx info if no flags set
+if test "X-$cxx_flags_set" = "X-"; then
+ cxx_vendor=
+ cxx_version=
+fi
diff --git a/config/pgi-fflags b/config/pgi-fflags
index 3171695..6401d8d 100644
--- a/config/pgi-fflags
+++ b/config/pgi-fflags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -45,11 +45,12 @@ fi
# Common PGI flags for various situations
if test "X-pgf90" = "X-$f9x_vendor"; then
- # Insert section about version specific problems from gnu-flags here, if
- # necessary.
+
+ ###############################
+ # Architecture-specific flags #
+ ###############################
arch=
- # Architecture-specific flags
# Nothing currently. (Uncomment code below and modify to add any)
#case "$host_os-$host_cpu" in
# *-i686)
@@ -65,15 +66,10 @@ if test "X-pgf90" = "X-$f9x_vendor"; then
# ;;
#esac
- # General
- FC_BASENAME=pgf90
- Fortran_COMPILER_ID=PGI
- F9XSUFFIXFLAG=""
- FSEARCH_DIRS=""
- # Uncomment the following to add something specific for FCFLAGS.
- #FCFLAGS="$FCFLAGS"
+ ##############
+ # Production #
+ ##############
- # Production
# Check for MPI wrapper being used and tweak down compiler options
# Comment out the Tweaking since it caused problems to mpich1.2.6.
# Need to investigate the reasons to tweak.
@@ -84,24 +80,55 @@ if test "X-pgf90" = "X-$f9x_vendor"; then
#fi
PROD_FCFLAGS="-fast -Mnoframe"
- # Debug
+ #########
+ # Debug #
+ #########
+
DEBUG_FCFLAGS="-Mbounds -Mchkptr -Mdclchk"
- # Symbols
- SYMBOLS_FCFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_FCFLAGS="-s"
+ SYMBOLS_FCFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
PROFILE_FCFLAGS="-Mprof=func,line"
# Use this for profiling with gprof
#PROFILE_FCFLAGS="-pg"
- # Optimization
+ ################
+ # Optimization #
+ ################
+
HIGH_OPT_FCFLAGS=
DEBUG_OPT_FCFLAGS=
NO_OPT_FCFLAGS=
- # Flags are set
+ ############
+ # Warnings #
+ ############
+
+ ###########
+ # General #
+ ###########
+
+ FC_BASENAME=pgf90
+ Fortran_COMPILER_ID=PGI
+ F9XSUFFIXFLAG=""
+ FSEARCH_DIRS=""
+ # Uncomment the following to add something specific for FCFLAGS.
+ #FCFLAGS="$FCFLAGS"
+
+
+
+ #################
+ # Flags are set #
+ #################
f9x_flags_set=yes
fi
@@ -111,4 +138,3 @@ if test "X-$f9x_flags_set" = "X-"; then
f9x_version=
fi
-
diff --git a/config/pgi-flags b/config/pgi-flags
index e1bec00..b197a1c 100644
--- a/config/pgi-flags
+++ b/config/pgi-flags
@@ -1,4 +1,4 @@
-# -*- shell-script -*-
+# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@@ -45,8 +45,8 @@ fi
# Common PGI flags for various situations
if test "X-pgcc" = "X-$cc_vendor"; then
- # Insert section about version specific problems from gnu-flags here, if
- # necessary.
+ # Insert section about version specific problems from compiler flags here,
+ # if necessary.
arch=
# Architecture-specific flags
@@ -65,58 +65,59 @@ if test "X-pgcc" = "X-$cc_vendor"; then
# ;;
#esac
- # General
- H5_CFLAGS="$H5_CFLAGS $arch -c99 -Minform=inform"
-
- # Production
- case "$cc_vendor-$cc_version" in
- pgcc-10.6*)
- PROD_CFLAGS=
- ;;
- pgcc-9.*)
- PROD_CFLAGS=
- ;;
- *)
- PROD_CFLAGS="-fast"
- ;;
- esac
-
- # Debug
+ ###########
+ # General #
+ ###########
+
+ # Default to C99 standard.
+ H5_CFLAGS="$H5_CFLAGS $arch -c99 -Minform=warn"
+
+ ##############
+ # Production #
+ ##############
+
+ # NDEBUG is handled explicitly by the configure script
+ PROD_CFLAGS="-fast"
+
+ #########
+ # Debug #
+ #########
+
# NDEBUG is handled explicitly by the configure script
+ # -g is handled by the symbols flags
DEBUG_CFLAGS="-Mbounds"
- # Symbols
- SYMBOLS_CFLAGS="-g"
+ ###########
+ # Symbols #
+ ###########
+
NO_SYMBOLS_CFLAGS="-s"
+ SYMBOLS_CFLAGS="-g"
+
+ #############
+ # Profiling #
+ #############
- # Profiling
PROFILE_CFLAGS="-Mprof=func,line"
# Use this for profiling with gprof
#PROFILE_CFLAGS="-pg"
- # Optimization
- case "$cc_vendor-$cc_version" in
- # Tweak down compiler optimizations for v10.6, it has a bug
- pgcc-10.6*)
- HIGH_OPT_CFLAGS="-O1"
- ;;
- # Tweak down compiler optimizations for v9.x
- pgcc-9.*)
- HIGH_OPT_CFLAGS="-O1"
- ;;
- *)
- HIGH_OPT_CFLAGS=
- ;;
- esac
- DEBUG_OPT_CFLAGS=
- NO_OPT_CFLAGS=
-
- # Flags are set
+ ################
+ # Optimization #
+ ################
+
+ HIGH_OPT_CFLAGS="-O4"
+ DEBUG_OPT_CFLAGS="-gopt -O2"
+ NO_OPT_CFLAGS="-O0"
+
+ #################
+ # Flags are set #
+ #################
cc_flags_set=yes
fi
# Clear cc info if no flags set
if test "X-$cc_flags_set" = "X-"; then
- cc_vendor=
- cc_version=
+ cc_vendor=
+ cc_version=
fi
diff --git a/config/sanitizer/code-coverage.cmake b/config/sanitizer/code-coverage.cmake
index 8d765f7..c79aeac 100644
--- a/config/sanitizer/code-coverage.cmake
+++ b/config/sanitizer/code-coverage.cmake
@@ -99,8 +99,7 @@ if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED)
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}
DEPENDS ccov-clean)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
# Messages
message(STATUS "Building with llvm Code Coverage Tools")
@@ -206,8 +205,7 @@ function(target_code_coverage TARGET_NAME)
if(CODE_COVERAGE)
# Add code coverage instrumentation to the target's linker command
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
target_compile_options(${TARGET_NAME} PRIVATE -fprofile-instr-generate
-fcoverage-mapping)
set_property(
@@ -229,8 +227,7 @@ function(target_code_coverage TARGET_NAME)
# Add shared library to processing for 'all' targets
if(target_type STREQUAL "SHARED_LIBRARY" AND target_code_coverage_ALL)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
add_custom_target(
ccov-run-${TARGET_NAME}
COMMAND echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
@@ -250,8 +247,7 @@ function(target_code_coverage TARGET_NAME)
# For executables add targets to run and produce output
if(target_type STREQUAL "EXECUTABLE")
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Cc]lang")
# If there are shared objects to also work with, generate the string to
# add them here
@@ -409,8 +405,7 @@ endfunction()
# any subdirectories. To add coverage instrumentation to only specific targets,
# use `target_code_coverage`.
function(add_code_coverage)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
add_link_options(-fprofile-instr-generate -fcoverage-mapping)
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
@@ -435,8 +430,7 @@ function(add_code_coverage_all_targets)
"${multi_value_keywords}" ${ARGN})
if(CODE_COVERAGE)
- if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
- OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
+ if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
# Merge the profile data for all of the run executables
add_custom_target(
diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake
index 0803279..8bf1d5b 100644
--- a/config/sanitizer/sanitizers.cmake
+++ b/config/sanitizer/sanitizers.cmake
@@ -30,13 +30,13 @@ endfunction()
message(STATUS "USE_SANITIZER=${USE_SANITIZER}, CMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}")
if(USE_SANITIZER)
- if(INTEL_CLANG OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
+ if(INTEL_CLANG OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
- append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
- message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}")
-
if(UNIX)
+ append("-fno-omit-frame-pointer" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
+ message(STATUS "Building with sanitize, base flags=${CMAKE_C_SANITIZER_FLAGS}")
+
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
append("-O1" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
endif()
@@ -83,7 +83,7 @@ if(USE_SANITIZER)
elseif(MSVC)
if(USE_SANITIZER MATCHES "([Aa]ddress)")
message(STATUS "Building with Address sanitizer")
- append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
+ append("/fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
else()
message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}")
endif()
diff --git a/config/toolchain/clang.cmake b/config/toolchain/clang.cmake
index 5e3b13a..af176aa 100644
--- a/config/toolchain/clang.cmake
+++ b/config/toolchain/clang.cmake
@@ -3,8 +3,13 @@
set(CMAKE_COMPILER_VENDOR "clang")
-set(CMAKE_C_COMPILER clang)
-set(CMAKE_CXX_COMPILER clang++)
+if(WIN32)
+ set(CMAKE_C_COMPILER clang-cl)
+ set(CMAKE_CXX_COMPILER clang-cl)
+else()
+ set(CMAKE_C_COMPILER clang)
+ set(CMAKE_CXX_COMPILER clang++)
+endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# the following is used if cross-compiling
diff --git a/configure.ac b/configure.ac
index c2c38e6..eb101cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,12 +95,12 @@ AC_CONFIG_COMMANDS([pubconf], [
sed 's/#define /#define H5_/' <src/H5config.h |\
sed 's/#undef /#undef H5_/' >pubconf
if test ! -f src/H5pubconf.h; then
- /bin/mv -f pubconf src/H5pubconf.h
+ mv -f pubconf src/H5pubconf.h
elif (diff pubconf src/H5pubconf.h >/dev/null); then
rm -f pubconf
echo "src/H5pubconf.h is unchanged"
else
- /bin/mv -f pubconf src/H5pubconf.h
+ mv -f pubconf src/H5pubconf.h
fi
echo "Post process src/libhdf5.settings"
sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP
@@ -476,15 +476,9 @@ esac
## Data types and their sizes.
##
AC_TYPE_OFF_T
-AC_CHECK_TYPE([size_t], [],
- [AC_DEFINE_UNQUOTED([size_t], [unsigned long],
- [Define to `unsigned long' if <sys/types.h> does not define.])])
AC_CHECK_TYPE([ssize_t], [],
[AC_DEFINE_UNQUOTED([ssize_t], [long],
[Define to `long' if <sys/types.h> does not define.])])
-AC_CHECK_TYPE([ptrdiff_t], [],
- [AC_DEFINE_UNQUOTED([ptrdiff_t], [long],
- [Define to `long' if <sys/types.h> does not define.])])
AC_C_BIGENDIAN
AC_CHECK_SIZEOF([char])
AC_CHECK_SIZEOF([short])
@@ -776,20 +770,6 @@ if test "X$HDF_CXX" = "Xyes"; then
## Change to the C++ language
AC_LANG_PUSH(C++)
- ## Checking if C++ needs old style header files in includes
- PAC_PROG_CXX_HEADERS
-
- ## Checking if C++ can handle namespaces
- PAC_PROG_CXX_NAMESPACE
-
- ## if C++ can handle static cast
- PAC_PROG_CXX_STATIC_CAST
-
- ## Checking if C++ has offsetof extension,
- ## note: this test has to be the last of the C++ tests because it sets a definition
- ## which would be used in the other tests, causing them to fail.
- PAC_PROG_CXX_OFFSETOF
-
else
AC_MSG_RESULT([no])
CXX="no"
@@ -806,6 +786,7 @@ AC_LANG_POP(C++)
## This needs to be exposed for the library info file even if the HL
## library is disabled.
AC_SUBST([HDF5_HL])
+AC_SUBST([HDF5_HL_TOOLS])
## The high-level library is enabled unless the build mode is clean.
if test "X-$BUILD_MODE" = "X-clean" ; then
@@ -822,6 +803,9 @@ HL=""
## Fortran high-level library
AC_SUBST(HL_FOR)
HL_FOR=""
+## Tools high-level library
+AC_SUBST(HL_TOOLS)
+HL_TOOLS=""
AC_MSG_CHECKING([if the high-level library is enabled])
AC_ARG_ENABLE([hl],
@@ -840,6 +824,21 @@ else
AC_MSG_RESULT([no])
fi
+AC_MSG_CHECKING([if the high-level tools are enabled])
+AC_ARG_ENABLE([hltools],
+ [AS_HELP_STRING([--enable-hltools],
+ [Enable the high-level tools.
+ [default=yes)]
+ ])],
+ [HDF5_HL_TOOLS=$enableval])
+
+if test "X${HDF5_HL}" = "Xyes" -a "X-$HDF5_HL_TOOLS" = "X-yes"; then
+ AC_MSG_RESULT([yes])
+ HL_TOOLS="tools"
+else
+ AC_MSG_RESULT([no])
+fi
+
## ----------------------------------------------------------------------
## Check which archiving tool to use. This needs to be done before
@@ -1116,18 +1115,43 @@ if test "X$HDF5_DOXYGEN" = "Xyes"; then
AC_SUBST([DOXYGEN_OPTIMIZE_OUTPUT_FOR_C])
AC_SUBST([DOXYGEN_MACRO_EXPANSION])
AC_SUBST([DOXYGEN_OUTPUT_DIRECTORY])
-
+ AC_SUBST([DOXYGEN_EXAMPLES_DIRECTORY])
+ AC_SUBST([DOXYGEN_LAYOUT_FILE])
+ AC_SUBST([DOXYGEN_HTML_HEADER])
+ AC_SUBST([DOXYGEN_HTML_FOOTER])
+ AC_SUBST([DOXYGEN_HTML_EXTRA_STYLESHEET])
+ AC_SUBST([DOXYGEN_HTML_EXTRA_FILES])
+ AC_SUBST([DOXYGEN_TAG_FILE])
+ AC_SUBST([DOXYGEN_SERVER_BASED_SEARCH])
+ AC_SUBST([DOXYGEN_EXTERNAL_SEARCH])
+ AC_SUBST([DOXYGEN_SEARCHENGINE_URL])
+ AC_SUBST([DOXYGEN_STRIP_FROM_PATH])
+ AC_SUBST([DOXYGEN_PREDEFINED])
+
+# SRCDIR Environment variables used inside doxygen macro for the source location:
DOXYGEN_PACKAGE=${PACKAGE_NAME}
DOXYGEN_VERSION_STRING=${PACKAGE_VERSION}
DOXYGEN_INCLUDE_ALIASES='$(SRCDIR)/doxygen/aliases'
DOXYGEN_PROJECT_LOGO='$(SRCDIR)/doxygen/img/HDFG-logo.png'
- DOXYGEN_PROJECT_BRIEF="C-API Reference"
+ DOXYGEN_PROJECT_BRIEF='C-API Reference'
DOXYGEN_INPUT_DIRECTORY='$(SRCDIR) $(SRCDIR)/doxygen/dox'
DOXYGEN_OPTIMIZE_OUTPUT_FOR_C=YES
DOXYGEN_MACRO_EXPANSION=YES
DOXYGEN_OUTPUT_DIRECTORY=hdf5lib_docs
-
- DX_INIT_DOXYGEN([HDF5], [../doxygen/Doxyfile], [hdf5lib_docs])
+ DOXYGEN_EXAMPLES_DIRECTORY='$(SRCDIR)/doxygen/dox/cookbook $(SRCDIR)/doxygen/examples $(SRCDIR)/src $(SRCDIR)/examples $(SRCDIR)/test'
+ DOXYGEN_LAYOUT_FILE='$(SRCDIR)/doxygen/hdf5doxy_layout.xml'
+ DOXYGEN_HTML_HEADER='$(SRCDIR)/doxygen/hdf5_header.html'
+ DOXYGEN_HTML_FOOTER='$(SRCDIR)/doxygen/hdf5_footer.html'
+ DOXYGEN_HTML_EXTRA_STYLESHEET='$(SRCDIR)/doxygen/hdf5doxy.css'
+ DOXYGEN_HTML_EXTRA_FILES='$(SRCDIR)/doxygen/hdf5_navtree_hacks.js $(SRCDIR)/doxygen/img/ftv2node.png $(SRCDIR)/doxygen/img/ftv2pnode.png'
+ DOXYGEN_TAG_FILE=hdf5.tag
+ DOXYGEN_SERVER_BASED_SEARCH=NO
+ DOXYGEN_EXTERNAL_SEARCH=NO
+ DOXYGEN_SEARCHENGINE_URL=
+ DOXYGEN_STRIP_FROM_PATH='$(SRCDIR)'
+ DOXYGEN_PREDEFINED='H5_HAVE_DIRECT H5_HAVE_LIBHDFS H5_HAVE_MAP_API H5_HAVE_PARALLEL H5_HAVE_ROS3_VFD'
+
+ DX_INIT_DOXYGEN([HDF5], [./doxygen/Doxyfile], [hdf5lib_docs])
else
AC_MSG_RESULT([no])
@@ -1224,17 +1248,11 @@ AC_CHECK_LIB([dl], [dlopen])
## ----------------------------------------------------------------------
## Check for system header files.
##
-AC_HEADER_STDC
-AC_HEADER_TIME
## Unix
-AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h])
-AC_CHECK_HEADERS([sys/socket.h sys/types.h sys/file.h])
-AC_CHECK_HEADERS([stddef.h setjmp.h features.h])
-AC_CHECK_HEADERS([dirent.h])
-AC_CHECK_HEADERS([stdint.h], [C9x=yes])
-AC_CHECK_HEADERS([stdbool.h])
-AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h])
+AC_CHECK_HEADERS([dirent.h features.h pwd.h unistd.h])
+AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/resource.h])
+AC_CHECK_HEADERS([sys/stat.h sys/time.h sys/types.h])
## Darwin
AC_SUBST([H5_IS_DARWIN])
@@ -1248,19 +1266,14 @@ esac
## Windows
case "`uname`" in
- CYGWIN*)
- AC_CHECK_HEADERS([io.h sys/timeb.h])
- UNAME_CYGWIN="yes"
- ;;
MINGW*)
- AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h])
AC_HAVE_LIBRARY([ws2_32])
;;
- *)
- AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h])
- ;;
esac
+# Mirror VFD networking
+AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/socket.h])
+
## ----------------------------------------------------------------------
## Some platforms require that all symbols are resolved when a library
## is linked. We can use the -no-undefined flag to tell libtool that
@@ -1348,17 +1361,6 @@ CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS"
## Checkpoint the cache
AC_CACHE_SAVE
-## Posix.1g types (C9x)
-cat >>confdefs.h <<\EOF
-#include <sys/types.h>
-EOF
-
-if test "X$C9x" = "Xyes"; then
- cat >>confdefs.h <<\EOF
-#include <stdint.h>
-EOF
-fi
-
AC_CHECK_SIZEOF( [int8_t])
AC_CHECK_SIZEOF( [uint8_t])
AC_CHECK_SIZEOF( [int_least8_t])
@@ -1387,34 +1389,12 @@ AC_CHECK_SIZEOF([uint_least64_t])
AC_CHECK_SIZEOF( [int_fast64_t])
AC_CHECK_SIZEOF( [uint_fast64_t])
+AC_CHECK_SIZEOF([bool], [], [#include <stdbool.h>])
+AC_CHECK_SIZEOF([off_t])
+AC_CHECK_SIZEOF([ptrdiff_t])
AC_CHECK_SIZEOF([size_t])
AC_CHECK_SIZEOF([ssize_t])
-AC_CHECK_SIZEOF([ptrdiff_t])
-
-cat >>confdefs.h <<\EOF
-#include <sys/types.h> /*for off_t definition*/
-EOF
-AC_CHECK_SIZEOF([off_t])
-
-if test "X$C9x" = "Xyes"; then
- cat >>confdefs.h <<\EOF
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h> /* for bool definition */
-#else
-#define bool _Bool
-#endif
-EOF
-AC_CHECK_SIZEOF([bool])
-fi
-
-AC_CHECK_SIZEOF(time_t, [], [
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-])
+AC_CHECK_SIZEOF([time_t], [], [#include <time.h>])
## Checkpoint the cache
AC_CACHE_SAVE
@@ -1919,10 +1899,8 @@ if test "X$THREADSAFE" = "Xyes"; then
AC_CACHE_VAL([hdf5_cv_system_scope_threads],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([
- #if STDC_HEADERS
#include <stdlib.h>
#include <pthread.h>
- #endif
],[
pthread_attr_t attribute;
int ret;
@@ -2047,41 +2025,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
## NOTE: clock_gettime may require linking to the rt or posix4 library
## so we'll search for it before calling AC_CHECK_FUNCS.
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
-AC_CHECK_FUNCS([alarm clock_gettime difftime fcntl flock fork frexpf])
-AC_CHECK_FUNCS([frexpl gethostname getrusage gettimeofday])
+AC_CHECK_FUNCS([alarm asprintf clock_gettime fcntl flock fork])
+AC_CHECK_FUNCS([gethostname getrusage gettimeofday])
AC_CHECK_FUNCS([lstat rand_r random setsysinfo])
-AC_CHECK_FUNCS([signal longjmp setjmp siglongjmp sigsetjmp sigprocmask])
-AC_CHECK_FUNCS([snprintf srandom strdup symlink system])
-AC_CHECK_FUNCS([strtoll strtoull])
-AC_CHECK_FUNCS([tmpfile asprintf vasprintf vsnprintf waitpid])
-AC_CHECK_FUNCS([roundf lroundf llroundf round lround llround])
+AC_CHECK_FUNCS([siglongjmp sigsetjmp sigprocmask])
+AC_CHECK_FUNCS([srandom strdup symlink])
+AC_CHECK_FUNCS([tmpfile vasprintf waitpid])
## ----------------------------------------------------------------------
## Check compiler characteristics
##
-AC_C_CONST
-
-AC_MSG_CHECKING([if the compiler understands __inline__])
-AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE([[static __inline__ void f(void){return;};]])],
- [AC_DEFINE([HAVE___INLINE__], [1], [Define if the compiler understands __inline__]) AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])]
-)
-
-AC_MSG_CHECKING([if the compiler understands __inline])
-AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE([[static __inline void f(void){return;};]])],
- [AC_DEFINE([HAVE___INLINE], [1], [Define if the compiler understands __inline]) AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])]
-)
-
-AC_MSG_CHECKING([if the compiler understands inline])
-AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE([[static inline void f(void){return;};]])],
- [AC_DEFINE([HAVE_INLINE], [1], [Define if the compiler understands inline]) AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])]
-)
-
AC_MSG_CHECKING([for __attribute__ extension])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int __attribute__((unused)) x]])],
[AC_DEFINE([HAVE_ATTRIBUTE], [1],
@@ -2089,18 +2042,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int __attribute__((unused)) x]])],
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
-AC_MSG_CHECKING([for __func__ extension])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ const char *fname = __func__; ]])],
- [AC_DEFINE([HAVE_C99_FUNC], [1],
- [Define if the compiler understands the __func__ keyword])
- AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])])
-AC_MSG_CHECKING([for __FUNCTION__ extension])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],,[[ const char *fname = __FUNCTION__; ]])],
- [AC_DEFINE([HAVE_FUNCTION], [1],
- [Define if the compiler understands the __FUNCTION__ keyword])
- AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([for C99 designated initialization support])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
typedef struct {
@@ -3928,6 +3869,7 @@ AM_CONDITIONAL([BUILD_HDF5_HL_CONDITIONAL], [test "X$HDF5_HL" = "Xyes"])
AM_CONDITIONAL([BUILD_TESTS_CONDITIONAL], [test "X$HDF5_TESTS" = "Xyes"])
AM_CONDITIONAL([BUILD_TESTS_PARALLEL_CONDITIONAL], [test -n "$TESTPARALLEL"])
AM_CONDITIONAL([BUILD_TOOLS_CONDITIONAL], [test "X$HDF5_TOOLS" = "Xyes"])
+AM_CONDITIONAL([BUILD_TOOLS_HL_CONDITIONAL], [test "X$HDF5_HL_TOOLS" = "Xyes"])
AM_CONDITIONAL([BUILD_DOXYGEN_CONDITIONAL], [test "X$HDF5_DOXYGEN" = "Xyes"])
## ----------------------------------------------------------------------
@@ -4103,6 +4045,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
tools/test/misc/vds/Makefile
tools/test/h5stat/Makefile
tools/test/h5stat/testh5stat.sh
+ tools/src/h5perf/Makefile
tools/test/perform/Makefile
examples/Makefile
examples/run-c-ex.sh
diff --git a/doc/branches-explained.md b/doc/branches-explained.md
new file mode 100644
index 0000000..22b9c8f
--- /dev/null
+++ b/doc/branches-explained.md
@@ -0,0 +1,41 @@
+# HDF5 Git Branching Model Explained
+
+This document describes current HDF5 branches.
+
+Branches are tested nightly and testing results are available at https://cdash-internal.hdfgroup.org/ and https://cdash.hdfgroup.org/.
+Commits that break daily testing should be fixed by 3:00 pm Central time or reverted.
+We encourage code contributors to check the status of their commits. If you have any questions, please contact help@hdfgroup.org.
+
+## `develop`
+Develop is the main branch whose source code always reflects a state with the latest delivered development changes for the next major release of HDF5.
+This is also considered the integration branch, as **all** new features are integrated into this branch from respective feature branches.
+
+## `Maintenance branches`
+
+Each currently supported release-line of HDF5 (e.g. 1.8.x, 1.10.x, 1.12.x) has a support branch with the name 1_8, 1_10, 1_12.
+Maintenance branches are similar to the develop branch, except the source code in a maintenance branch always reflects a state
+with the latest delivered development changes for the next **maintenance** release of that particular supported release-line of HDF5.
+**Some** new features will be integrated into a release maintenance branch, depending on whether or not those features can be
+introduced in minor releases. Maintenance branches are removed when a release-line is retired from support.
+
+## `feature/*`
+Feature branches are temporary branches used to develop new features in HDF5.
+Feature branches branch off of develop and exist as long as the feature is under development.
+When the feature is complete, the branch is merged back into develop, as well as into any support branches in which the change will be included, and then the feature branch is removed.
+
+## `release/*`
+Release branches are used to prepare a new production release. They are primarily used to allow for last minute dotting of i's and crossing of t's
+(things like setting the release version, finalizing release notes, et cetera) and do not include new development.
+They are created from the maintenance branch at the time of the maintenance release and have
+names 1_8_N, 1_10_N, 1_12_N, where N is the minor release number. Once the release is done it is tagged.
+Patches can be applied to the release branch for patch releases that are treated as "scaled down" maintenance releases as defined by Release coordinator.
+
+## `1.X/master/*` where X is 8, 10 or 12
+These branches are used to tag 1.X.* maintenance releases.
+
+## `inactive/<name>/*`
+These branches are for experimental features that were developed in the past and have not been merged to develop, and are not under active development. The features
+can be out of sync with the develop branch.
+
+This document was last updated on March 16, 2021
+
diff --git a/doc/contributing.md b/doc/contributing.md
new file mode 100644
index 0000000..d32ab4d
--- /dev/null
+++ b/doc/contributing.md
@@ -0,0 +1,85 @@
+# How to contribute to HDF5
+
+The HDF Group encourages community members to contribute to the HDF5 project. We accept and are very grateful for any contributions,
+from minor typos and bug fixes to new features. The HDF Group is committed to work with the code contributors and make contribution process enjoyable and straightforward.
+
+This document describes guiding principles for the HDF5 code contributors and does not pretend to address any possible
+contribution. If in doubt, please do not hesitate to ask us for guidance.
+***Note that no contribution may be accepted unless the donor agrees with the HDF Group software license terms
+found in the COPYING file in every branch's top source directory.***
+
+
+> We will assume that you are familiar with `git` and `GitHub`. If not, you may go through the GitHub tutorial found at [https://guides.github.com/activities/hello-world/](https://guides.github.com/activities/hello-world/). This tutorial should only take around 10 minutes.
+
+## Table of Contents
+
+* [Workflow](#workflow)
+* [Acceptance criteria for a pull request](#criteria)
+* [Check List](#checklist)
+
+# Workflow <A NAME="workflow"></A>
+
+The process for contributing code to HDF5 is as follows:
+
+* Open an issue on [HDF5 GitHub](https://github.com/HDFGroup/hdf5/issues).
+
+> This step is ***required*** unless the change is minor (e.g., typo fix).
+
+* Fork the [HDF5](https://github.com/HDFGroup/hdf5) repository.
+* Make the desired changes to the HDF5 software.
+ * New features should always go to _develop_ branch first and later should be merged to the appropriate maintenance branches.
+ * Bug fixes should go to all appropriate branches (_develop_ and maintenance).
+* Build and test your changes. Detailed instructions on building and testing HDF5 can be found in the `INSTALL*` files in the `release_docs` directory.
+* Push your changes to GitHub.
+* Issue a pull request and address any code formatting and testing issues reported.
+
+Once a pull request is correctly formatted and passes **ALL** CI tests, it will be reviewed and evaluated by The HDF Group developers and HDF5 community members who can approve pull requests.
+The HDF Group developers will work with you to ensure that the pull request satisfies the acceptance criteria described in the next section.
+
+# Acceptance criteria for a pull request <A NAME="criteria"></A>
+
+We appreciate every contribution we receive, but we may not accept them all. Those that we *do* satisfy the following criteria:
+
+* **The pull request has a clear purpose** - What does the pull request address? How does it benefit the HDF5 community?
+If the pull request does not have a clear purpose and benefits, it will not be accepted.
+
+* **The pull request is documented** - The HDF5 developers must understand not only *what* a change is doing, but *how* it is doing it.
+ Documenting the code makes it easier for us to understand your patch and maintain the code in the future.
+
+* **The pull request passes HDF5 regression testing** - Any issue fixed or functionality added should be accompanied by the corresponding
+tests and pass HDF5 regression testing run by The HDF Group. We do not expect you to perform comprehensive testing across multiple platforms
+before we accept the pull request. If the pull request does not pass regression testing after the merge, The HDF Group developers will work with you on the fixes.
+
+* **The pull request does not compromise the principles behind HDF5** - HDF5 has a 100% commitment to backward compatibility.
+ * Any file ever created with HDF5 must be readable by any future version of HDF5.
+ If your patch's purpose is to modify the HDF5 data model or file format,
+ **please** discuss this with us first. File format changes and features required by those changes can be introduced only in a new major release.
+ * HDF5 has a commitment to remaining *machine-independent*; data created on one platform/environment/architecture **must** remain readable by HDF5 on any other.
+ * For binary compatibility, no changes are allowed to public APIs and data structures in the maintenance releases; new APIs can be added.
+
+* **New features are documented** - Any new features should have proper documentation; talk to us if you have any questions.
+
+
+# Checklist <A NAME="checklist"></A>
+
+Please make sure that you check the items applicable to your pull request:
+
+* Code
+ * [ ] Does the pull request have a corresponding GitHub issue and clear purpose?
+ * [ ] Does the pull request follow HDF5 best practices (naming conventions, code portability, code structure, etc.)? <<TODO: link to the document>>
+ * [ ] If changes were done to Autotools build, were they added to CMake and vice versa?
+ * [ ] Is the pull request applicable to any other branches? If yes, which ones? Please document it in the GitHub issue.
+ * [ ] Is the new code sufficiently documented for future maintenance?
+ * [ ] Does the new feature require a change to an existing API? See "API Compatibility Macros" document (https://portal.hdfgroup.org/display/HDF5/API+Compatibility+Macros)
+* Documentation
+ * [ ] Was the change described in the release_docs/RELEASE.txt file?
+ * [ ] Was MANIFEST updated if new files had been added to the source?
+ * [ ] Was the new function documented in the corresponding public header file using [Doxygen](https://docs.hdfgroup.org/hdf5/develop/_r_m_t.html)?
+ * [ ] Was new functionality documented for the HDF5 community (the level of documentation depends on the feature; ask us what would be appropriate)
+* Testing
+ * [ ] Does the pull request have tests?
+ * [ ] Does the pull request affect HDF5 library performance?
+
+We want as many contributions as we can get, and we are here to help. Feel free to reach out to us if you have any questions
+
+Thank you for your contribution!
diff --git a/doxygen/CMakeLists.txt b/doxygen/CMakeLists.txt
new file mode 100644
index 0000000..36ce590
--- /dev/null
+++ b/doxygen/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required (VERSION 3.12)
+project (HDF5_DOXYGEN C)
+
+#-----------------------------------------------------------------------------
+# Option to build documentation
+#-----------------------------------------------------------------------------
+if (DOXYGEN_FOUND)
+ set (DOXYGEN_PACKAGE ${HDF5_PACKAGE_NAME})
+ set (DOXYGEN_VERSION_STRING ${HDF5_PACKAGE_VERSION_STRING})
+ set (DOXYGEN_INCLUDE_ALIASES_PATH ${HDF5_DOXYGEN_DIR})
+ set (DOXYGEN_INCLUDE_ALIASES aliases)
+ set (DOXYGEN_VERBATIM_VARS DOXYGEN_INCLUDE_ALIASES)
+ set (DOXYGEN_PROJECT_LOGO ${HDF5_DOXYGEN_DIR}/img/HDFG-logo.png)
+ set (DOXYGEN_PROJECT_BRIEF "C-API Reference")
+ set (DOXYGEN_INPUT_DIRECTORY "${HDF5_SOURCE_DIR} ${HDF5_DOXYGEN_DIR}/dox ${HDF5_GENERATED_SOURCE_DIR}")
+ set (DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
+ set (DOXYGEN_MACRO_EXPANSION YES)
+ set (DOXYGEN_OUTPUT_DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs)
+ set (DOXYGEN_EXAMPLES_DIRECTORY "${HDF5_DOXYGEN_DIR}/dox/cookbook ${HDF5_DOXYGEN_DIR}/examples ${HDF5_SRC_DIR} ${HDF5_SOURCE_DIR}/examples ${HDF5_TEST_SRC_DIR}")
+ set (DOXYGEN_LAYOUT_FILE ${HDF5_DOXYGEN_DIR}/hdf5doxy_layout.xml)
+ set (DOXYGEN_HTML_HEADER ${HDF5_DOXYGEN_DIR}/hdf5_header.html)
+ set (DOXYGEN_HTML_FOOTER ${HDF5_DOXYGEN_DIR}/hdf5_footer.html)
+ set (DOXYGEN_HTML_EXTRA_STYLESHEET ${HDF5_DOXYGEN_DIR}/hdf5doxy.css)
+ set (DOXYGEN_HTML_EXTRA_FILES "${HDF5_DOXYGEN_DIR}/hdf5_navtree_hacks.js ${HDF5_DOXYGEN_DIR}/img/ftv2node.png ${HDF5_DOXYGEN_DIR}/img/ftv2pnode.png")
+ set (DOXYGEN_TAG_FILE ${HDF5_BINARY_DIR}/hdf5.tag)
+ set (DOXYGEN_SERVER_BASED_SEARCH NO)
+ set (DOXYGEN_EXTERNAL_SEARCH NO)
+ set (DOXYGEN_SEARCHENGINE_URL)
+ set (DOXYGEN_STRIP_FROM_PATH ${HDF5_SOURCE_DIR})
+ set (DOXYGEN_PREDEFINED "H5_HAVE_DIRECT H5_HAVE_LIBHDFS H5_HAVE_MAP_API H5_HAVE_PARALLEL H5_HAVE_ROS3_VFD")
+
+# This configure and individual custom targets work together
+ # Replace variables inside @@ with the current values
+ configure_file (${HDF5_DOXYGEN_DIR}/Doxyfile.in ${HDF5_BINARY_DIR}/Doxyfile @ONLY)
+
+ install (
+ DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs/html
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}
+ COMPONENT Documents
+ )
+
+ if (NOT TARGET doxygen)
+ add_custom_target (doxygen)
+ endif ()
+
+endif ()
diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in
index 24fc4ba..44d9974 100644
--- a/doxygen/Doxyfile.in
+++ b/doxygen/Doxyfile.in
@@ -170,7 +170,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-STRIP_FROM_PATH =
+STRIP_FROM_PATH = @DOXYGEN_STRIP_FROM_PATH@
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
@@ -263,6 +263,7 @@ TAB_SIZE = 4
ALIASES =
+@INCLUDE_PATH = @DOXYGEN_INCLUDE_ALIASES_PATH@
@INCLUDE = @DOXYGEN_INCLUDE_ALIASES@
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
@@ -737,7 +738,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
-LAYOUT_FILE =
+LAYOUT_FILE = @DOXYGEN_LAYOUT_FILE@
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@@ -854,10 +855,24 @@ INPUT_ENCODING = UTF-8
FILE_PATTERNS = H5*public.h \
H5*module.h \
+ H5FDcore.h \
+ H5FDdirect.h \
+ H5FDfamily.h \
+ H5FDhdfs.h \
+ H5FDlog.h \
+ H5FDmirror.h \
+ H5FDmpi.h \
H5FDmpio.h \
+ H5FDmulti.h \
+ H5FDros3.h \
+ H5FDsec2.h \
+ H5FDsplitter.h \
+ H5FDstdio.h \
+ H5FDwindows.h \
H5VLconnector.h \
H5VLconnector_passthru.h \
H5VLnative.h \
+ H5Zdevelop.h \
H5version.h \
*.dox
@@ -907,7 +922,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH = ../src ../examples ../test examples
+EXAMPLE_PATH = @DOXYGEN_EXAMPLES_DIRECTORY@
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -1111,13 +1126,6 @@ CLANG_DATABASE_PATH =
ALPHABETICAL_INDEX = YES
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX = 5
-
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
@@ -1168,7 +1176,7 @@ HTML_FILE_EXTENSION = .html
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_HEADER =
+HTML_HEADER = @DOXYGEN_HTML_HEADER@
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
@@ -1178,7 +1186,7 @@ HTML_HEADER =
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_FOOTER =
+HTML_FOOTER = @DOXYGEN_HTML_FOOTER@
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
@@ -1203,7 +1211,7 @@ HTML_STYLESHEET =
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_EXTRA_STYLESHEET =
+HTML_EXTRA_STYLESHEET = @DOXYGEN_HTML_EXTRA_STYLESHEET@
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
@@ -1213,7 +1221,7 @@ HTML_EXTRA_STYLESHEET =
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_EXTRA_FILES =
+HTML_EXTRA_FILES = @DOXYGEN_HTML_EXTRA_FILES@
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
@@ -1271,7 +1279,7 @@ HTML_DYNAMIC_MENUS = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_DYNAMIC_SECTIONS = NO
+HTML_DYNAMIC_SECTIONS = YES
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
# shown in the various tree structured indices initially; the user can expand
@@ -1483,7 +1491,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
-DISABLE_INDEX = NO
+DISABLE_INDEX = YES
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information. If the tag
@@ -1631,7 +1639,7 @@ MATHJAX_CODEFILE =
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
-SEARCHENGINE = NO
+SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using JavaScript. There
@@ -1643,7 +1651,7 @@ SEARCHENGINE = NO
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
-SERVER_BASED_SEARCH = YES
+SERVER_BASED_SEARCH = @DOXYGEN_SERVER_BASED_SEARCH@
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
@@ -1659,7 +1667,7 @@ SERVER_BASED_SEARCH = YES
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
-EXTERNAL_SEARCH = NO
+EXTERNAL_SEARCH = @DOXYGEN_EXTERNAL_SEARCH@
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
# which will return the search results when EXTERNAL_SEARCH is enabled.
@@ -1670,7 +1678,7 @@ EXTERNAL_SEARCH = NO
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
-SEARCHENGINE_URL =
+SEARCHENGINE_URL = @DOXYGEN_SEARCHENGINE_URL@
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
@@ -2167,7 +2175,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED =
+PREDEFINED = @DOXYGEN_PREDEFINED@
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2211,7 +2219,7 @@ TAGFILES =
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
-GENERATE_TAGFILE =
+GENERATE_TAGFILE = @DOXYGEN_TAG_FILE@
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be
diff --git a/doxygen/aliases b/doxygen/aliases
index 2255c9b..06c3445 100644
--- a/doxygen/aliases
+++ b/doxygen/aliases
@@ -1,3 +1,5 @@
+ALIASES += THG="The HDF Group"
+
################################################################################
# Styling
################################################################################
@@ -14,11 +16,17 @@ ALIASES += success{1}="\Bold{Success:} \1"
ALIASES += failure{1}="\Bold{Failure:} \1"
ALIASES += herr_t="Returns a non-negative value if successful; otherwise returns a negative value."
+ALIASES += herr_t_iter="\li Zero causes the iterator to continue, returning zero when the iteration is complete. \li A positive value causes the iterator to immediately return that positive value, indicating short-circuit success. \li A negative value causes the iterator to immediately return that value, indicating failure."
ALIASES += hid_t{1}="Returns a \1 identifier if successful; otherwise returns #H5I_INVALID_HID. "
ALIASES += hid_ti{1}="Returns an \1 identifier if successful; otherwise returns #H5I_INVALID_HID. "
ALIASES += hid_tv{1}="Returns an \1 identifier if successful; otherwise returns a negative value. "
ALIASES += htri_t="Returns zero (false), a positive (true) or a negative (failure) value."
+ALIASES += api_vers_2{3}="\1() is a macro that is mapped to either \2() or \3().\n\see \ref api-compat-macros"
+ALIASES += api_vers_3{4}="\1() is a macro that is mapped to either \2() or \3() or \4().\n\see \ref api-compat-macros"
+
+ALIASES += deprecation_note{1}="\deprecated Superseded by \1."
+
################################################################################
# General
################################################################################
@@ -35,6 +43,15 @@ ALIASES += op{1}="\param[in] \1 Callback function"
ALIASES += op_data="\param[in,out] op_data User-defined callback function context"
ALIASES += op_data{1}="\param[in,out] \1 User-defined callback function context"
+ALIASES += op_data_in="\param[in] op_data User-defined callback function context"
+ALIASES += op_data_in{1}="\param[in] \1 User-defined callback function context"
+
+################################################################################
+# Asynchronous
+################################################################################
+
+ALIASES += async_variant_of{1}="Asynchronous version of \1()"
+
################################################################################
# Attributes
################################################################################
@@ -67,6 +84,13 @@ ALIASES += file_type_id{1}="\param[in] \1 Datatype (in-file) identifier"
ALIASES += mem_type_id{1}="\param[in] \1 Datatype (in-memory) identifier"
################################################################################
+# Errors
+################################################################################
+
+ALIASES += estack_id="\param[in] estack_id Error stack identifier"
+ALIASES += estack_id{1}="\param[in] \1 Error stack identifier"
+
+################################################################################
# Files
################################################################################
@@ -103,9 +127,18 @@ ALIASES += fg_loc_id="\loc_id. The identifier may be that of a file or group."
ALIASES += fg_loc_id{1}="\loc_id{\1}. The identifier may be that of a file or group."
################################################################################
+# Maps
+################################################################################
+
+ALIASES += map_id="\param[in] map_id Map identifier"
+ALIASES += map_id{1}="\param[in] \1 Map identifier"
+
+################################################################################
# Property lists
################################################################################
+ALIASES += plist_unused{1}="\note The \p \1 parameter is currently not used; specify #H5P_DEFAULT."
+
ALIASES += aapl_id="\param[in] aapl_id Attribute access property list identifier"
ALIASES += aapl_id{1}="\param[in] \1 Attribute access property list identifier"
@@ -121,6 +154,9 @@ ALIASES += dcpl_id{1}="\param[in] \1 Dataset creation property list identifier"
ALIASES += dxpl_id="\param[in] dxpl_id Dataset transfer property list identifier"
ALIASES += dxpl_id{1}="\param[in] \1 Dataset transfer property list identifier"
+ALIASES += gacpl_id="\param[in] plist_id File, group, dataset, datatype, link, or attribute access property list identifier"
+ALIASES += gacpl_id{1}="\param[in] \1 File, group, dataset, datatype, link, or attribute access property list identifier"
+
ALIASES += gapl_id="\param[in] gapl_id Group access property list identifier"
ALIASES += gapl_id{1}="\param[in] \1 Group access property list identifier"
@@ -133,9 +169,18 @@ ALIASES += lapl_id{1}="\param[in] \1 Link access property list identifier"
ALIASES += lcpl_id="\param[in] lcpl_id Link creation property list identifier"
ALIASES += lcpl_id{1}="\param[in] \1 Link creation property list identifier"
+ALIASES += mapl_id="\param[in] mapl_id Map access property list identifier"
+ALIASES += mapl_id{1}="\param[in] \1 Map access property list identifier"
+
+ALIASES += mcpl_id="\param[in] mcpl_id Map creation property list identifier"
+ALIASES += mcpl_id{1}="\param[in] \1 Map creation property list identifier"
+
ALIASES += oapl_id="\param[in] oapl_id Object access property list identifier"
ALIASES += oapl_id{1}="\param[in] \1 Object access property list identifier"
+ALIASES += ocpl_id="\param[in] oapl_id Object creation property list identifier"
+ALIASES += ocpl_id{1}="\param[in] \1 Object creation property list identifier"
+
ALIASES += plist_id="\param[in] plist_id Property list identifier"
ALIASES += plist_id{1}="\param[in] \1 Property list identifier"
@@ -173,19 +218,129 @@ ALIASES += fgdta_loc_obj_id{1}="\loc_obj_id{\1}. The identifier may be that of a
ALIASES += app_file="\param[in] app_file For internal use only, not a visible user parameter"
ALIASES += app_func="\param[in] app_func For internal use only, not a visible user parameter"
ALIASES += app_line="\param[in] app_line For internal use only, not a visible user parameter"
-ALIASES += es_id="\param[in] es_id The event set ID to add this asynchronous operation to. H5ES_NONE may be used for synchronous execution."
+ALIASES += es_id="\param[in] es_id Event set identifier"
+ALIASES += es_id{1}="\param[in] \1 Event set identifier"
################################################################################
# Others
################################################################################
-ALIASES += estack_id="\param[in] estack_id Error stack identifier"
-ALIASES += estack_id{1}="\param[in] \1 Error stack identifier"
+ALIASES += cpp_c_api_note="\attention \Bold{C++ Developers using HDF5 C-API functions beware:}\n Several functions in this C-API take function pointers or callbacks as arguments. Examples include H5Pset_elink_cb(), H5Pset_type_conv_cb(), H5Tconvert(), and H5Ewalk2(). Application code must ensure that those callback functions return normally such to allow the HDF5 to manage its resources and maintain a consistent state. For instance, those functions must not use the C \c setjmp / \c longjmp mechanism to leave those callback functions. Within the context of C++, any exceptions thrown within the callback function must be caught, such as with a \Code{catch(…)} statement. Any exception state can be placed within the provided user data function call arguments, and may be thrown again once the calling function has returned. Exceptions raised and not handled inside the callback are not supported as it might leave the HDF5 library in an inconsistent state. Similarly, using C++20 coroutines cannot be used as callbacks, since they do not support plain return statements. If a callback function yields execution to another C++20 coroutine calling HDF5 functions as well, this may lead to undefined behavior."
+ALIASES += par_compr_note="\attention If you are planning to use compression with parallel HDF5, ensure that calls to H5Dwrite() occur in collective mode. In other words, all MPI ranks (in the relevant communicator) call H5Dwrite() and pass a dataset transfer property list with the MPI-IO collective option property set to #H5FD_MPIO_COLLECTIVE_IO.\n Note that data transformations are currently \Bold{not} supported when writing to datasets in parallel and with compression enabled."
+ALIASES += sa_metadata_ops="\sa \li H5Pget_all_coll_metadata_ops() \li H5Pget_coll_metadata_write() \li H5Pset_all_coll_metadata_ops() \li H5Pset_coll_metadata_write() \li \ref maybe_metadata_reads"
+
+################################################################################
+# References
+################################################################################
+
+ALIASES += ref_cons_semantics="<a href=\"https://portal.hdfgroup.org/display/HDF5/Enabling+a+Strict+Consistency+Semantics+Model+in+Parallel+HDF5\">Enabling a Strict Consistency Semantics Model in Parallel HDF5</a>"
+ALIASES += ref_dld_filters="<a href=\"https://portal.hdfgroup.org/display/HDF5/HDF5+Dynamically+Loaded+Filters\">HDF5 Dynamically Loaded Filters</a>"
+ALIASES += ref_file_image_ops="<a href=\"https://portal.hdfgroup.org/display/HDF5/HDF5+File+Image+Operations\">HDF5 File Image Operations</a>"
+ALIASES += ref_filter_pipe="<a href=\"https://portal.hdfgroup.org/display/HDF5/HDF5+Data+Flow+Pipeline+for+H5Dread\">Data Flow Pipeline for H5Dread()</a>"
+ALIASES += ref_group_impls="<a href=\"https://portal.hdfgroup.org/display/HDF5/Groups\">Group implementations in HDF5</a>"
+ALIASES += ref_h5lib_relver="<a href=\"https://portal.hdfgroup.org/display/HDF5/HDF5+Library+Release+Version+Numbers\">HDF5 Library Release Version Numbers</a>"
+ALIASES += ref_mdc_in_hdf5="<a href=\"https://portal.hdfgroup.org/display/HDF5/Metadata+Caching+in+HDF5\">Metadata Caching in HDF5</a>"
+ALIASES += ref_mdc_logging="<a href=\"https://portal.hdfgroup.org/display/HDF5/H5F_START_MDC_LOGGING\">Metadata Cache Logging</a>"
+ALIASES += ref_news_112="<a href=\"https://portal.hdfgroup.org/display/HDF5/New+Features+in+HDF5+Release+1.12\">New Features in HDF5 Release 1.12</a>"
+ALIASES += ref_h5ocopy="<a href=\"https://portal.hdfgroup.org/display/HDF5/Copying+Committed+Datatypes+with+H5Ocopy\">Copying Committed Datatypes with H5Ocopy()</a>"
+ALIASES += ref_sencode_fmt_change="<a href=\"https://portal.hdfgroup.org/pages/viewpage.action?pageId=58100093&preview=/58100093/58100094/encode_format_RFC.pdf\">RFC H5Secnode() / H5Sdecode() Format Change</a>"
+ALIASES += ref_vlen_strings="\Emph{Creating variable-length string datatypes}"
+ALIASES += ref_vol_doc="VOL documentation"
+
+################################################################################
+# RFCs
+################################################################################
+
+ALIASES += ref_rfc20210528="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_multi_thread.pdf\">Multi-Thread HDF5</a>"
+ALIASES += ref_rfc20190923="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/2019-09-23-RFC_VOL_feature_flags.pdf\">Virtual Object Layer (VOL) API Compatibility</a>"
+ALIASES += ref_rfc20190410="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_VFD_Plugin.docx.pdf\">A Plugin Interface for HDF5 Virtual File Drivers</a>"
+ALIASES += ref_rfc20181231="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_Min_Obj_Headers_181231.pdf\">Dataset Object Header Size</a>"
+ALIASES += ref_rfc20181220="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/3.2.1_3.2.2_deliverable_181220_v4.pdf\">MS 3.2 – Addressing Scalability: Scalability of open, close, flush CASE STUDY: CGNS Hotspot analysis of CGNS cgp_open</a>"
+ALIASES += ref_rfc20180620="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-Chunking%20Functions-2018-06-20-v3.docx.pdf\">Chunk query functionality in HDF5</a>"
+ALIASES += ref_rfc20180610="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/VFD_SWMR_RFC_200916.pdf\">VFD SWMR</a>"
+ALIASES += ref_rfc20180321="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-API_Contexts-2018-03-21.docx.pdf\">API Contexts</a>"
+ALIASES += ref_rfc20180125="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/enhance_h5clear.docx.pdf\">Enhancement to the tool <tt>h5clear</tt></a>"
+ALIASES += ref_rfc20170707="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/H5Sencode_format.docx.pdf\"><tt>H5Sencode/H5Sdecode</tt> Format Change</a>"
+ALIASES += ref_rfc20160105="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-bounds.pdf\">Setting Bounds for Object Creation in HDF5 1.10.0</a>"
+ALIASES += ref_rfc20150915="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/2015-09-28-RFC-HDF5-1.10.0-File-Format-Superblock-Changes-EP.docx.pdf\">File Format Changes in HDF5 1.10.0</a>"
+ALIASES += ref_rfc20150709="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-Page_Buffering.pdf\">Page Buffering</a>"
+ALIASES += ref_rfc20150615="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/cache_image_RFC_150929-QAK.docx.pdf\">Metadata Cache Image</a>"
+ALIASES += ref_rfc20150429="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/new_datatypes.pdf\">New Datatypes</a>"
+ALIASES += ref_rfc20150424="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-CollectiveMetadataWrites.pdf\">Collective Metadata Writes</a>"
+ALIASES += ref_rfc20150423="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-CollectiveMetadataReads.pdf\">Enabling Collective Metadata Reads</a>"
+ALIASES += ref_rfc20150301="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/sent_RFC_format_convert-v3.docx.pdf\">The Tool to Handle HDF5 File Format Compatibility for Chunked Datasets</a>"
+ALIASES += ref_rfc20150212="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_H5LTget_hardlinkds.docx.pdf\"><tt>H5LTget_hardlinks</tt> – High-level API to list all the hard links to an object</a>"
+ALIASES += ref_rfc20150205="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_F2003_v6.docx.pdf\">HDF5 Fortran Wrappers Maintenance: Dropping Support for Non-Fortran 2003 Standard Compliant Compilers</a>"
+ALIASES += ref_rfc20150202="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC%20New%20Autotools%20Behavior.docx.pdf\">New Autotools Behavior</a>"
+ALIASES += ref_rfc20141210="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/HDF5-VDS-requirements-use-cases-2014-12-10.pdf\">HDF5 Virtual Dataset</a>"
+ALIASES += ref_rfc20141201="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC%20filter%20memory%20issues%20on%20Windows.docx.pdf\">Allocate/Free Mismatches in HDF5 Filter Code on Windows</a>"
+ALIASES += ref_rfc20140916="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_VOL.pdf\">Virtual Object Layer</a>"
+ALIASES += ref_rfc20140827="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/CompressNChunk_RFC.pdf\">Chunking and Compression Performance Tool Requirements</a>"
+ALIASES += ref_rfc20140729="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/h5fis_accessible.pdf\">Replacing H5Fis_hdf5() with H5Fis_accessible()</a>"
+ALIASES += ref_rfc20140722="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/64bit_hid_t-v1.docx.pdf\">Switching to a 64-bit <tt>hid_t</tt> Space in HDF5</a>"
+ALIASES += ref_rfc20140717="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/analysis_ext.pdf\">Data Analysis Extensions</a>"
+ALIASES += ref_rfc20140707="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/2014-08-28-RFC_VOL.pdf\">Virtual Object Layer</a>"
+ALIASES += ref_rfc20140524="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-Why%20does%20not%20compression%20work-GH-EP.docx.pdf\">HDF5 Compression Demystified</a>"
+ALIASES += ref_rfc20140318="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC%20H5free_memory%20v2.pdf\">Freeing Memory Allocated by the HDF5 Library</a>"
+ALIASES += ref_rfc20140313="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-Compat-Tool-v2.docx.pdf\">Options to handle compatibility issues for HDF5 files</a>"
+ALIASES += ref_rfc20140224="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/Design-MetadataCache-Logging-THG20140224-v4.pdf\">Design: Metadata Cache Logging</a>"
+ALIASES += ref_rfc20131211="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC%20H5Ocork%20v5%20new%20fxn%20names.pdf\">Fine-Grained Control of Metadata Cache Flushes</a>"
+ALIASES += ref_rfc20130930="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-Read-Attempts-for-Metadata-with-Checksum-v3.pdf\">Read Attempts for Metadata with Checksum</a>"
+ALIASES += ref_rfc20130919="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/core%20CFD%20paging%20v5.docx.pdf\">Core VFD Backing Store Paged Writes</a>"
+ALIASES += ref_rfc20130630="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/Design-HDF5-FlushDependencyTesting-20130630-v1.1.pdf\">Flush Dependency Testing</a>"
+ALIASES += ref_rfc20130316="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/HDF5DynamicallyLoadedFilters.pdf\">HDF5 Dynamically Loaded Filters</a>"
+ALIASES += ref_rfc20121114="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/DECTRIS%20Integration%20RFC%202012-11-29.pdf\">Direct Chunk Write</a>"
+ALIASES += ref_rfc20121024="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/FileSpaceManagement.pdf\">HDF5 File Space Management</a>"
+ALIASES += ref_rfc20120828="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/H5HPC_MultiDset_RW_IO_RFC_v4_20130320.docx.pdf\">New HDF5 API Routines for HPC Applications</a>"
+ALIASES += ref_rfc20120523="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/paged_aggregation.pdf\">HDF5 File Space Management: Paged Aggregation</a>"
+ALIASES += ref_rfc20120501="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/HDF5FileImageOperations.pdf\">HDF5 File Image Operations</a>"
+ALIASES += ref_rfc20120305="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC%20PHDF5%20Consistency%20Semantics%20MC%20120328.docx.pdf\">Enabling a Strict Consistency Semantics Model in Parallel HDF5</a>"
+ALIASES += ref_rfc20120220="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/h5repack_improve_hyperslab_over_chunked_dataset_v1.pdf\"><tt>h5repack</tt>: Improved Hyperslab selections for Large Chunked Datasets</a>"
+ALIASES += ref_rfc20120120="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/2012-1-25-Maintainers-guide-for-datatype.docx.pdf\">A Maintainer’s Guide for the Datatype Module in HDF5 Library</a>"
+ALIASES += ref_rfc20120104="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_actual_io_v4-1_done.docx.pdf\">Actual I/O Mode</a>"
+ALIASES += ref_rfc20111119="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-H5Ocompare-review_v6.pdf\">New public functions to handle comparison</a>"
+ALIASES += ref_rfc20110825="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/2011-08-31-RFC_H5Ocopy_Named_DT_v2.docx.pdf\">Merging Named Datatypes in H5Ocopy()</a>"
+ALIASES += ref_rfc20110811="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_Enhancement_Hyperslab_Selection-1.4.docx.pdf\">Expanding the HDF5 Hyperslab Selection Interface</a>"
+ALIASES += ref_rfc20110726="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/metadata_aggregation_RFC_v03.docx.pdf\">HDF5 File Space Allocation and Aggregation</a>"
+ALIASES += ref_rfc20110614="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_h5dump_refactor_v3.docx.pdf\"> Refactor <tt>h5dump</tt> to Improve Maintenance</a>"
+ALIASES += ref_rfc20110329="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_Tools_Extlink_Cache_v3_r2.docx.pdf\">Support External Link Open File Cache in HDF5 Tools</a>"
+ALIASES += ref_rfc20110118="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC%20for%20h5diff%20Attribute%20Comparisons_v7.docx.pdf\"><tt>h5diff</tt> Attribute Comparisons</a>"
+ALIASES += ref_rfc20101122="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_swmr_timeouts_v2.docx.pdf\">SWMR Timeouts</a>"
+ALIASES += ref_rfc20101104="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/CacheExternalLinkFileOpens.pdf\">Caching Files Opened Through External Links</a>"
+ALIASES += ref_rfc20101018="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/HDF5-comparisons_v3-RFC-2011-08-03.pdf\">HDF5 File and Object Comparison Specification</a>"
+ALIASES += ref_rfc20100902="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/H5edit-RFC-Draft-v5.pdf\"><tt>h5edit</tt> – An HDF5 File Editing Tool</a>"
+ALIASES += ref_rfc20100727="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_HDF5_reservedCharacters-v2.pdf\">Reserved Characters for HDF5 Applications</a>"
+ALIASES += ref_rfc20100726="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/H5HPC_RFC-2010-09-28.pdf\">High-Level HDF5 API routines for HPC Applications</a>"
+ALIASES += ref_rfc20100511="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_h5diff_exclude_obj_v1_3.pdf\"><tt>h5diff</tt> – Exclude Object(s) from Comparison</a>"
+ALIASES += ref_rfc20100422="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_gen_attribute_tool_v2_f.pdf\">Generating attributes into an object with a tool</a>"
+ALIASES += ref_rfc20100312="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_Support_HDF518_in_Tools.pdf\">Supporting HDF5 1.8 in HDF5 Command Line Tools</a>"
+ALIASES += ref_rfc20091218="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RCF_h5diff_link_v1.2.docx.pdf\">Supporting soft-link and external-link for <tt>h5diff</tt></a>"
+ALIASES += ref_rfc20090907="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_Tools_Lib_v2.pdf\">HDF5 Tools Library Functions</a>"
+ALIASES += ref_rfc20090612="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_h5diff_default_epsilon.pdf\">Default EPSILON values for comparing floating point data</a>"
+ALIASES += ref_rfc20081218="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_h5diff_NonComparable.pdf\">Reporting of Non-Comparable Datasets by <tt>h5diff</tt></a>"
+ALIASES += ref_rfc20080915="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/FileFreeSpacePerformance.pdf\">Performance Report for Free-space Manager</a>"
+ALIASES += ref_rfc20080904="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/ExternalLinkFileAccessProperty.pdf\">Setting File Access Property List for accessing External Link</a>"
+ALIASES += ref_rfc20080301="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/DynamicTransformations_RFC.pdf\">Dynamic Transformations to HDF5 Data</a>"
+ALIASES += ref_rfc20080209="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-Using-SVN-branching-Feb9.pdf\">Using SVN branching to improve software development process at THG</a>"
+ALIASES += ref_rfc20080206="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC-HIS-REL-1.8_Feb6.pdf\">Maintaining the <tt>HISTORY.txt</tt> and <tt>RELEASE.txt</tt> files in HDF5</a>"
+ALIASES += ref_rfc20071111="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/AURA-corruption-2007-11-12.pdf\">Addressing HDF5 file corruption issue</a>"
+ALIASES += ref_rfc20071018="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/RFC_NaNsHDF5.pdf\"><tt>NaN</tt> detection in HDF5</a>"
+ALIASES += ref_rfc20070801="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/Metadata_Journaling_RFC.pdf\">Metadata Journaling to Improve Crash Survivability</a>"
+ALIASES += ref_rfc20070413="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/API_Compatibility_RFC.txt.pdf\">API Compatibility Strategies for HDF5</a>"
+ALIASES += ref_rfc20070115="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/PrivateHeap.pdf\">A 'Private' Heap for HDF5</a>"
+ALIASES += ref_rfc20060623="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/coll_ind_dd6.pdf\">Performance Comparison of Collective I/O and Independent I/O with Derived Datatypes</a>"
+ALIASES += ref_rfc20060604="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/h5stat_spec_v3_2006-06-04.pdf\"><tt>h5stat</tt> tool</a>"
+ALIASES += ref_rfc20060505="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/Simple%20Performance%20Test%20on%20Fletcher32%20Filter.pdf\">Simple Performance Test on Fletcher32 Filter</a>"
+ALIASES += ref_rfc20060410="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/h5chk_Requirements.pdf\">Requirement Specifications of an HDF5 File Format Validation Tool</a>"
+ALIASES += ref_rfc20060317="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/sec2driver-RFC.pdf\">Proposed changes to the <tt>sec2</tt> driver </a>"
+ALIASES += ref_rfc20060124="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/FITS%20to%20HDF5%20mapping.pdf\">Mapping FITS data to HDF5</a>"
+ALIASES += ref_rfc20040811="<a href=\"https://docs.hdfgroup.org/hdf5/rfc/text-dtype.htm.pdf\">Conversion Between Text and Datatype</a>"
################################################################################
# The Usual Suspects
################################################################################
+ALIASES += click4more="(Click on a enumerator, field, or type for more information.)"
ALIASES += csets="<table><tr><td>#H5T_CSET_ASCII</td><td>US ASCII</td></tr><tr><td>#H5T_CSET_UTF8</td><td>UTF-8 Unicode encoding</td></tr></table>"
ALIASES += datatype_class=" \li #H5T_INTEGER \li #H5T_FLOAT \li #H5T_STRING \li #H5T_BITFIELD \li #H5T_OPAQUE \li #H5T_COMPOUND \li #H5T_REFERENCE \li #H5T_ENUM \li #H5T_VLEN \li #H5T_ARRAY"
ALIASES += file_access="<table><tr><td>#H5F_ACC_RDWR</td><td>File was opened with read/write access.</td></tr><tr><td>#H5F_ACC_RDONLY</td><td>File was opened with read-only access.</td></tr><tr><td>#H5F_ACC_SWMR_WRITE</td><td>File was opened with read/write access for a single-writer/multiple-reader (SWMR) scenario. Note that the writer process must also open the file with the #H5F_ACC_RDWR flag.</td></tr><tr><td>#H5F_ACC_SWMR_READ</td><td>File was opened with read-only access for a single-writer/multiple-reader (SWMR) scenario. Note that the reader process must also open the file with the #H5F_ACC_RDONLY flag.</td></tr></table>"
@@ -201,5 +356,5 @@ ALIASES += scopes="<table><tr><td>#H5F_SCOPE_GLOBAL</td><td>Flushes the entire v
ALIASES += sign_prop="<table><tr><td>#H5T_SGN_NONE</td><td>0</td><td>Unsigned integer type</td></tr><tr><td>#H5T_SGN_2</td><td>1</td><td>Two's complement signed integer type</td></tr></table>"
ALIASES += storage_type="<table><tr><td>#H5G_STORAGE_TYPE_COMPACT</td><td>Compact storage</td></tr><tr><td>#H5G_STORAGE_TYPE_DENSE</td><td>Indexed storage</td></tr><tr><td>#H5G_STORAGE_TYPE_SYMBOL_TABLE</td><td>Symbol tables, the original HDF5 structure</td></tr></table>"
ALIASES += str_pad_type="<table><tr><td>#H5T_STR_NULLTERM</td><td>0</td><td>Null terminate (as C does)</td></tr><tr><td>#H5T_STR_NULLPAD</td><td>1</td><td>Pad with zeros</td></tr><tr><td>#H5T_STR_SPACEPAD</td><td>2</td><td>Pad with spaces (as FORTRAN does)</td></tr></table>"
-ALIASES += virtual=" \see Supporting Functions: \li H5Pget_layout() \li H5Pset_layout() \li H5Sget_regular_hyperslab() \li H5Sis_regular_hyperslab() \li H5Sselect_hyperslab() \see VDS Functions: \li H5Pget_virtual_count() \li H5Pget_virtual_dsetname() \li H5Pget_virtual_filename() \li H5Pget_virtual_prefix() \li H5Pget_virtual_printf_gap() \li H5Pget_virtual_srcspace() \li H5Pget_virtual_view() \li H5Pget_virtual_vspace() \li H5Pset_virtual \li H5Pset_virtual_prefix() \li H5Pset_virtual_printf_gap() \li H5Pset_virtual_view()"
+ALIASES += see_virtual=" \see Supporting Functions: H5Pget_layout(), H5Pset_layout(), H5Sget_regular_hyperslab(), H5Sis_regular_hyperslab(), H5Sselect_hyperslab() \see VDS Functions: H5Pget_virtual_count(), H5Pget_virtual_dsetname(), H5Pget_virtual_filename(), H5Pget_virtual_prefix(), H5Pget_virtual_printf_gap(), H5Pget_virtual_srcspace(), H5Pget_virtual_view(), H5Pget_virtual_vspace(), H5Pset_virtual(), H5Pset_virtual_prefix(), H5Pset_virtual_printf_gap(), H5Pset_virtual_view()"
ALIASES += obj_info_fields="<table><tr><th>Flag</th><th>Purpose</th></tr><tr><td>#H5O_INFO_BASIC</td><td>Fill in the fileno, addr, type, and rc fields</td></tr><tr> <td>#H5O_INFO_TIME</td><td>Fill in the atime, mtime, ctime, and btime fields</td></tr><tr> <td>#H5O_INFO_NUM_ATTRS</td> <td>Fill in the num_attrs field</td></tr><tr><td>#H5O_INFO_HDR</td><td>Fill in the num_attrs field</td></tr><tr><td>#H5O_INFO_META_SIZE</td><td>Fill in the meta_size field</td></tr><tr><td>#H5O_INFO_ALL</td><td>#H5O_INFO_BASIC | #H5O_INFO_TIME | #H5O_INFO_NUM_ATTRS | #H5O_INFO_HDR | #H5O_INFO_META_SIZE</td></tr></table>"
diff --git a/doxygen/dox/APIVersions.dox b/doxygen/dox/APIVersions.dox
new file mode 100644
index 0000000..3658f06
--- /dev/null
+++ b/doxygen/dox/APIVersions.dox
@@ -0,0 +1,173 @@
+/**
+ * \ingroup H5A
+ * \def H5Acreate
+ * \api_vers_2{H5Acreate,H5Acreate1,H5Acreate2}
+ */
+
+/**
+ * \ingroup H5A
+ * \def H5Aiterate
+ * \api_vers_2{H5Aiterate,H5Aiterate1,H5Aiterate2}
+ */
+
+/**
+ * \ingroup H5D
+ * \def H5Dcreate
+ * \api_vers_2{H5Dcreate,H5Dcreate1,H5Dcreate2}
+ */
+
+/**
+ * \ingroup H5E
+ * \def H5Eget_auto
+ * \api_vers_2{H5Eget_auto,H5Eget_auto1,H5Eget_auto2}
+ */
+
+/**
+ * \ingroup H5E
+ * \def H5Eprint
+ * \api_vers_2{H5Eprint,H5Eprint1,H5Eprint2}
+ */
+
+/**
+ * \ingroup H5E
+ * \def H5Epush
+ * \api_vers_2{H5Epush,H5Epush1,H5Epush2}
+ */
+
+/**
+ * \ingroup H5E
+ * \def H5Eset_auto
+ * \api_vers_2{H5Eset_auto,H5Eset_auto1,H5Eset_auto2}
+ */
+
+/**
+ * \ingroup H5E
+ * \def H5Ewalk
+ * \api_vers_2{H5Ewalk,H5Ewalk1,H5Ewalk2}
+ */
+
+/**
+ * \ingroup H5F
+ * \def H5Fget_info
+ * \api_vers_2{H5Fget_info,H5Fget_info1,H5Fget_info2}
+ */
+
+/**
+ * \ingroup H5G
+ * \def H5Gcreate
+ * \api_vers_2{H5Gcreate,H5Gcreate1,H5Gcreate2}
+ */
+
+/**
+ * \ingroup H5G
+ * \def H5Gopen
+ * \api_vers_2{H5Gopen,H5Gopen1,H5Gopen2}
+ */
+
+/**
+ * \ingroup H5L
+ * \def H5Lget_info
+ * \api_vers_2{H5Lget_info,H5Lget_info1,H5Lget_info2}
+ */
+
+/**
+ * \ingroup H5L
+ * \def H5Lget_info_by_idx
+ * \api_vers_2{H5Lget_info_by_idx,H5Lget_info_by_idx1,H5Lget_info_by_idx2}
+ */
+
+/**
+ * \ingroup TRAV
+ * \def H5Literate
+ * \api_vers_2{H5Literate,H5Literate1,H5Literate2}
+ */
+
+/**
+ * \ingroup TRAV
+ * \def H5Literate_by_name
+ * \api_vers_2{H5Literate_by_name,H5Literate_by_name1,H5Literate_by_name2}
+ */
+
+/**
+ * \ingroup TRAV
+ * \def H5Lvisit
+ * \api_vers_2{H5Lvisit,H5Lvisit1,H5Lvisit2}
+ */
+
+/**
+ * \ingroup TRAV
+ * \def H5Lvisit_by_name
+ * \api_vers_2{H5Lvisit_by_name,H5Lvisit_by_name1,H5Lvisit_by_name2}
+ */
+
+/**
+ * \ingroup H5O
+ * \def H5Oget_info
+ * \api_vers_3{H5Oget_info,H5Oget_info1,H5Oget_info2,H5Oget_info3}
+ */
+
+/**
+ * \ingroup H5O
+ * \def H5Oget_info_by_idx
+ * \api_vers_3{H5Oget_info_by_idx,H5Oget_info_by_idx1,H5Oget_info_by_idx2,H5Oget_info_by_idx3}
+ */
+
+/**
+ * \ingroup H5O
+ * \def H5Oget_info_by_name
+ * \api_vers_3{H5Oget_info_by_name,H5Oget_info_by_name1,H5Oget_info_by_name2,H5Oget_info_by_name3}
+ */
+
+/**
+ * \ingroup H5O
+ * \def H5Ovisit
+ * \api_vers_3{H5Ovisit,H5Ovisit1,H5Ovisit2,H5Ovisit3}
+ */
+
+/**
+ * \ingroup H5O
+ * \def H5Ovisit_by_name
+ * \api_vers_3{H5Ovisit_by_name,H5Ovisit_by_name1,H5Ovisit_by_name2,H5Ovisit_by_name3}
+ */
+
+/**
+ * \ingroup H5R
+ * \def H5Rdereference
+ * \api_vers_2{H5Rdereference,H5Rdereference1,H5Rdereference2}
+ */
+
+/**
+ * \ingroup H5R
+ * \def H5Rget_obj_type
+ * \api_vers_3{H5Rget_obj_type,H5Rget_obj_type1,H5Rget_obj_type2,H5R_get_obj_type3}
+ */
+
+/**
+ * \ingroup H5S
+ * \def H5Sencode
+ * \api_vers_2{H5Sencode,H5Sencode1,H5Sencode2}
+ */
+
+/**
+ * \ingroup H5T
+ * \def H5Tcommit
+ * \api_vers_2{H5Tcommit,H5Tcommit1,H5Tcommit2}
+ */
+
+/**
+ * \ingroup H5T
+ * \def H5Topen
+ * \api_vers_2{H5Topen,H5Topen1,H5Topen2}
+ */
+
+/**
+ * \ingroup ARRAY
+ * \def H5Tarray_create
+ * \api_vers_2{H5Tarray_create,H5Tarray_create1,H5Tarray_create2}
+ */
+
+/**
+ * \ingroup ARRAY
+ * \def H5Tget_array_dims
+ * \api_vers_2{H5Tget_array_dims,H5Tget_array_dims1,H5Tget_array_dims2}
+ */
diff --git a/doxygen/dox/About.dox b/doxygen/dox/About.dox
new file mode 100644
index 0000000..32930a8
--- /dev/null
+++ b/doxygen/dox/About.dox
@@ -0,0 +1,23 @@
+/** \page About About
+
+\section about_history History
+
+The implementation of this documentation set is based on the fantastic work of the
+<a href="https://eigen.tuxfamily.org/index.php?title=Main_Page">Eigen project</a>.
+Please refer to their <a href="https://gitlab.com/libeigen/eigen">GitLab repository</a>
+and the online version of their
+<a href="http://eigen.tuxfamily.org/dox/">Doxygen-based documentation</a>.
+Not only does Eigen set a standard as a piece of software, but also as an example
+of <em>documentation done right</em>.
+
+\section about_documentation Documentation about Documentation
+
+\li \todo Describe how to add a reference or a new RFC
+\li \todo Describe how to add an example
+\li \todo Describe how to include plain HTML
+\li \todo Describe how to add an API macro
+\li \todo Describe the custom commands
+\li \todo Describe the S3 bucket layout and update routine
+\li \todo Link the RM template
+
+*/ \ No newline at end of file
diff --git a/doxygen/dox/Cookbook.dox b/doxygen/dox/Cookbook.dox
new file mode 100644
index 0000000..56523e2
--- /dev/null
+++ b/doxygen/dox/Cookbook.dox
@@ -0,0 +1,19 @@
+/** \page Cookbook Cookbook
+
+ Healthy, everyday recipes for every taste and budget...
+
+\ref Files
+\li \ref CB_FreeSpace
+\li \ref CB_RemoveUnusedSpace
+\li \ref CB_UserBlock
+
+\ref Attributes
+\li \ref CB_LargeAttributes
+
+\ref Accessibility
+\li \ref CB_MaintainCompat
+
+\ref Performance
+\li \ref CB_MDCPerf
+
+ */ \ No newline at end of file
diff --git a/doxygen/dox/DDLBNF110.dox b/doxygen/dox/DDLBNF110.dox
new file mode 100644
index 0000000..f7e4267
--- /dev/null
+++ b/doxygen/dox/DDLBNF110.dox
@@ -0,0 +1,650 @@
+/** \page DDLBNF110 DDL in BNF through HDF5 1.10
+
+\todo Revise this & break it up!
+
+\section intro110 Introduction
+
+This document contains the data description language (DDL) for an HDF5 file. The
+description is in Backus-Naur Form (BNF).
+
+\section expo110 Explanation of Symbols
+
+This section contains a brief explanation of the symbols used in the DDL.
+
+\code{.unparsed}
+::= defined as
+ <tname> a token with the name tname
+ <a> | <b> one of <a> or <b>
+ <a>opt zero or one occurrence of <a>
+ <a>* zero or more occurrence of <a>
+ <a>+ one or more occurrence of <a>
+ [0-9] an element in the range between 0 and 9
+ '[' the token within the quotes (used for special characters)
+ TBD To Be Decided
+\endcode
+
+\section ddl110 The DDL
+
+\code{.unparsed}
+<file> ::= HDF5 <file_name> { <file_super_block>opt <root_group> }
+
+<file_name> ::= <identifier>
+
+<file_super_block> ::= SUPER_BLOCK {
+ SUPERBLOCK_VERSION <int_value>
+ FREELIST_VERSION <int_value>
+ SYMBOLTABLE_VERSION <int_value>
+ OBJECTHEADER_VERSION <int_value>
+ OFFSET_SIZE <int_value>
+ LENGTH_SIZE <int_value>
+ BTREE_RANK <int_value>
+ BTREE_LEAF <int_value>
+ ISTORE_K <int_value>
+ <super_block_filespace>
+ USER_BLOCK {
+ USERBLOCK_SIZE <int_value>
+ }
+ }
+
+<super_block_filespace> ::= FILE_SPACE_STRATEGY <super_block_strategy>
+ FREE_SPACE_PERSIST <boolean_value>
+ FREE_SPACE_SECTION_THRESHOLD <int_value>
+ FILE_SPACE_PAGE_SIZE <int_value>
+
+<super_block_strategy> ::= H5F_FSPACE_STRATEGY_FSM_AGGR | H5F_FSPACE_STRATEGY_PAGE |
+ H5F_FSPACE_STRATEGY_AGGR | H5F_FSPACE_STRATEGY_NONE |
+ Unknown strategy
+
+<root_group> ::= GROUP "/" {
+ <anon_named_datatype>*
+ <object_id>opt
+ <group_comment>opt
+ <group_attribute>*
+ <group_member>*
+ }
+
+<datatype> ::= <atomic_type> | <compound_type> | <variable_length_type> | <array_type>
+
+<anon_named_datatype> ::= DATATYPE <anon_named_type_name> {
+ <datatype>
+ }
+
+<anon_named_type_name> ::= the assigned name for anonymous named type is
+ in the form of #oid, where oid is the object id
+ of the type
+
+<atomic_type> ::= <integer> | <float> | <time> | <string> |
+ <bitfield> | <opaque> | <reference> | <enum>
+
+<boolean_value> ::= FALSE | TRUE
+
+<integer> ::= H5T_STD_I8BE | H5T_STD_I8LE |
+ H5T_STD_I16BE | H5T_STD_I16LE |
+ H5T_STD_I32BE | H5T_STD_I32LE |
+ H5T_STD_I64BE | H5T_STD_I64LE |
+ H5T_STD_U8BE | H5T_STD_U8LE |
+ H5T_STD_U16BE | H5T_STD_U16LE |
+ H5T_STD_U32BE | H5T_STD_U32LE |
+ H5T_STD_U64BE | H5T_STD_U64LE |
+ H5T_NATIVE_CHAR | H5T_NATIVE_UCHAR |
+ H5T_NATIVE_SHORT | H5T_NATIVE_USHORT |
+ H5T_NATIVE_INT | H5T_NATIVE_UINT |
+ H5T_NATIVE_LONG | H5T_NATIVE_ULONG |
+ H5T_NATIVE_LLONG | H5T_NATIVE_ULLONG
+
+<float> ::= H5T_IEEE_F32BE | H5T_IEEE_F32LE |
+ H5T_IEEE_F64BE | H5T_IEEE_F64LE |
+ H5T_NATIVE_FLOAT | H5T_NATIVE_DOUBLE |
+ H5T_NATIVE_LDOUBLE
+
+<time> ::= H5T_TIME: not yet implemented
+
+<string> ::= H5T_STRING {
+ STRSIZE <strsize>;
+ STRPAD <strpad>;
+ CSET <cset>;
+ CTYPE <ctype>;
+ }
+
+<strsize> ::= <int_value>
+
+<strpad> ::= H5T_STR_NULLTERM | H5T_STR_NULLPAD | H5T_STR_SPACEPAD
+
+<cset> ::= H5T_CSET_ASCII | H5T_CSET_UTF8
+
+<ctype> ::= H5T_C_S1 | H5T_FORTRAN_S1
+
+<bitfield> ::= H5T_STD_B8BE | H5T_STD_B8LE |
+ H5T_STD_B16BE | H5T_STD_B16LE |
+ H5T_STD_B32BE | H5T_STD_B32LE |
+ H5T_STD_B64BE | H5T_STD_B64LE
+
+<opaque> ::= H5T_OPAQUE {
+ OPAQUE_TAG <identifier>;
+ OPAQUE_SIZE <int_value>;opt
+ }
+
+<reference> ::= H5T_REFERENCE { <ref_type> }
+
+<ref_type> ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG | H5T_STD_REF | UNDEFINED
+
+<compound_type> ::= H5T_COMPOUND {
+ <member_type_def>+
+ }
+
+<member_type_def> ::= <datatype> <field_name>;
+
+<field_name> ::= <identifier>
+
+<variable_length_type> ::= H5T_VLEN { <datatype> }
+
+<array_type> ::= H5T_ARRAY { <dim_sizes> <datatype> }
+
+<dim_sizes> ::= '['<dimsize>']' | '['<dimsize>']'<dim_sizes>
+
+<dimsize> ::= <int_value>
+
+<attribute> ::= ATTRIBUTE <attr_name> {
+ <dataset_type>
+ <dataset_space>
+ <data>opt
+ }
+
+<attr_name> ::= <identifier>
+
+<dataset_type> ::= DATATYPE <path_name> | <datatype>
+
+<enum> ::= H5T_ENUM {
+ <enum_base_type> <enum_def>+
+ }
+
+<enum_base_type> ::= <integer>
+// Currently enums can only hold integer type data, but they may be expanded
+// in the future to hold any datatype
+
+<enum_def> ::= <enum_symbol> <enum_val>;
+
+<enum_symbol> ::= <identifier>
+
+<enum_val> ::= <int_value>
+
+<path_name> ::= <path_part>+
+
+<path_part> ::= /<identifier>
+
+<dataspace> ::= <scalar_space> | <simple_space> | <complex_space> | <null_space>
+
+<null_space> ::= NULL
+
+<scalar_space> ::= SCALAR
+
+<simple_space> ::= SIMPLE { <current_dims> / <max_dims> }
+
+<complex_space> ::= COMPLEX { <complex_space_definition> }
+
+<dataset_space> ::= DATASPACE <path_name> | <dataspace>
+
+<current_dims> ::= <dims>
+
+<max_dims> ::= '(' <max_dim_list> ')'
+
+<max_dim_list> ::= <max_dim> | <max_dim>, <max_dim_list>
+
+<max_dim> ::= <int_value> | H5S_UNLIMITED
+
+<data> ::= <subset> | <data_values>
+
+<data_values> ::= DATA {
+ <scalar_space_data> | <simple_space_data>
+ }
+
+<scalar_space_data> ::= <any_element>
+
+<any_element> ::= <atomic_element> | <compound_element> |
+ <variable_length_element> | <array_element>
+
+<any_data_seq> ::= <any_element> | <any_element>, <any_data_seq>
+
+<atomic_element> :: = <integer_data> | <float_data> | <time_data> |
+ <string_data> | <bitfield_data> | <opaque_data> |
+ <enum_data> | <reference_data>
+
+<subset> ::= SUBSET {
+ <start>;
+ <stride>;
+ <count>;
+ <block>;
+ DATA {
+ <simple_space_data>
+ }
+ }
+
+<start> ::= START (<coor_list>)
+
+<stride> ::= STRIDE (<pos_list>)
+
+<count> ::= COUNT (<max_dim_list>)
+
+<block> ::= BLOCK (<max_dim_list>)
+
+<coor_list> ::= <coor_data>, <coor_list> | <coor_data>
+
+<coor_data> ::= <integer_data> | H5S_UNLIMITED
+
+<integer_data> ::= <int_value>
+
+<float_data> ::= a floating point number
+
+<time_data> ::= DATA{ not yet implemented.}
+
+<string_data> ::= a string
+// A string is enclosed in double quotes.
+// If a string is displayed on more than one line, string concatenate
+// operator '//'is used.
+
+<bitfield_data> ::= <hex_value>
+
+<opaque_data> ::= <hex_value>:<hex_value> | <hex_value>
+
+<enum_data> ::= <enum_symbol>
+
+<reference_data> ::= <object_ref_data> | <data_region_data> | <attribute_data> | NULL
+
+<object_ref_data> ::= <object_type> <object_num>
+
+<object_type> ::= DATASET | GROUP | DATATYPE
+
+<object_id> ::= OBJECTID { <object_num> }
+
+<object_num> ::= <int_value>:<int_value> | <int_value>
+
+<attribute_data> ::= ATTRIBUTE <attr_name>
+
+<data_region_data> ::= DATASET <dataset_name> {
+ <data_region_type>opt <data_region_data_list>
+ <dataset_type>opt <dataset_space>opt
+ <data>opt
+ }
+
+<data_region_type> ::= REGION_TYPE <data_region_data_type>
+
+<data_region_data_type> ::= POINT | BLOCK
+
+<data_region_data_list> ::= <data_region_data_info>, <data_region_data_list> |
+ <data_region_data_info>
+
+<data_region_data_info> ::= <region_info> | <point_info>
+
+<region_info> ::= (<lower_region_vals>)-(<upper_region_vals>)
+
+<lower_region_vals> ::= <lower_bound>, <lower_region_vals> | <lower_bound>
+
+<upper_region_vals> ::= <upper_bound>, <upper_region_vals> | <upper_bound>
+
+<lower_bound> ::= <int_value>
+
+<upper_bound> ::= <int_value>
+
+<point_info> ::= (<point_vals>)
+
+<point_vals> ::= <int_value> | <int_value>, <point_vals>
+
+<compound_element> ::= { <any_data_seq> }
+
+<atomic_simple_data> :: = <atomic_element>, <atomic_simple_data> |
+ <atomic_element>
+
+<simple_space_data> :: = <any_data_seq>
+
+<variable_length_element> ::= ( <any_data_seq> )
+
+<array_element> ::= '[' <any_data_seq> ']'
+
+<named_datatype> ::= DATATYPE <type_name> { <datatype> }
+
+<type_name> ::= <identifier>
+
+<hardlink> ::= HARDLINK <path_name>
+
+<group> ::= GROUP <group_name> { <hardlink> | <group_info> }
+
+<group_comment> ::= COMMENT <string_data>
+
+<group_name> ::= <identifier>
+
+<group_info> ::= <object_id>opt <group_comment>opt <group_attribute>*
+ <group_member>*
+
+<group_attribute> ::= <attribute>
+
+<group_member> ::= <named_datatype> | <group> | <dataset> |
+ <softlink> | <external_link>
+
+<dataset> ::= DATASET <dataset_name> { <hardlink> | <dataset_info> }
+
+<dataset_info> ::= <dataset_type>
+ <dataset_space>
+ <dcpl_info>opt
+ <dataset_attribute>* <object_id>opt
+ <data>opt
+// Tokens above can be in any order as long as <data> is
+// after <dataset_type> and <dataset_space>.
+
+<dcpl_info> ::= <storagelayout>
+ <compression_filters>
+ <fillvalue>
+ <allocationtime>
+
+<dataset_name> ::= <identifier>
+
+<storagelayout> :: = STORAGE_LAYOUT {
+ <contiguous_layout> | <chunked_layout> |
+ <compact_layout> | <virtual_layout>
+ }
+
+<contiguous_layout> ::= CONTIGUOUS
+ <internal_layout> | <external_layout>
+
+<chunked_layout> ::= CHUNKED <dims>
+ <filter_ratio>opt
+
+<compact_layout> ::= COMPACT
+ <size>
+
+<internal_layout> ::= <size>
+ <offset>
+
+<external_layout> ::= EXTERNAL {
+ <external_file>+
+ }
+
+<virtual_layout> ::= <vmaps>*opt
+
+<vmaps> ::= MAPPING <int_value> {
+ <virtual_map>
+ <source_map>
+ }
+
+<virtual_map> ::= VIRTUAL {
+ <vmaps_selection>
+ }
+
+<source_map> ::= SOURCE {
+ FILE <file_name>
+ DATASET <dataset_name>
+ <vmaps_selection>
+ }
+
+<vmaps_selection> ::= <regular_hyperslab> | <irregular_hyperslab> |
+ <select_points> | <select_none> | <select_all>
+
+<regular_hyperslab> ::= SELECTION REGULAR_HYPERSLAB {
+ <start>
+ <stride>
+ <count>
+ <block>
+ }
+
+<irregular_hyperslab> ::= SELECTION IRREGULAR_HYPERSLAB {
+ <region_info>+
+ }
+
+<select_points> ::= SELECTION POINT {
+ (<coor_list>)+
+ }
+
+<select_none> ::= SELECTION NONE
+
+<select_all> ::= SELECTION ALL
+
+<dims> ::= (<dims_values>)
+
+<dims_values> ::= <int_value> | <int_value>, <dims_values>
+
+<external_file> ::= FILENAME <file_name> <size> <offset>
+
+<offset> ::= OFFSET <int_value>
+
+<size> ::= SIZE <int_value>
+
+<filter_ratio> ::= <size> | <compressionratio>
+
+<compressionratio> :: = <size> (<float_data>:1 COMPRESSION)
+
+<compression_filters> :: = FILTERS {
+ <filter_type>+ | NONE
+ }
+
+<filter_type> :: = <filter_deflate> | <filter_shuffle> |
+ <filter_flecther> | <filter_szip> |
+ <filter_nbit> | <filter_scaleoffset> |
+ <filter_default>
+
+<filter_default> :: = <filter_user> {
+ FILTER_ID <int_value>
+ <filter_comment>opt
+ <filter_params>opt
+ }
+
+<filter_user> :: = USER_DEFINED_FILTER
+
+<filter_deflate> :: = COMPRESSION DEFLATE { LEVEL <int_value> }
+
+<filter_shuffle> :: = PREPROCESSING SHUFFLE
+
+<filter_flecther> :: = CHECKSUM FLETCHER32
+
+<filter_szip> :: = COMPRESSION SZIP {
+ PIXELS_PER_BLOCK <int_value>
+ <filter_szip_mode>opt
+ <filter_szip_coding>opt
+ <filter_szip_order>opt
+ <filter_szip_header>opt
+ }
+
+<filter_szip_mode> :: = MODE HARDWARE | K13
+
+<filter_szip_coding> :: = CODING ENTROPY | NEAREST NEIGHBOUR
+
+<filter_szip_order> :: = BYTE_ORDER LSB | MSB
+
+<filter_szip_header> :: = HEADER RAW
+
+<filter_nbit> :: = CHECKSUM NBIT
+
+<filter_scaleoffset> :: = COMPRESSION SCALEOFFSET { MIN BITS <int_value> }
+
+<filter_comment> :: = COMMENT <identifier>
+
+<filter_params> :: = PARAMS { <int_value>* }
+
+<fillvalue> ::= FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_ALLOC | H5D_FILL_TIME_NEVER | H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_UNDEFINED | H5D_FILL_VALUE_DEFAULT | <any_element>
+ }
+
+<allocationtime> ::= ALLOCATION_TIME {
+ H5D_ALLOC_TIME_EARLY | H5D_ALLOC_TIME_INCR |
+ H5D_ALLOC_TIME_LATE
+ }
+
+<dataset_attribute> ::= <attribute>
+
+<softlink> ::= SOFTLINK <softlink_name> {
+ LINKTARGET <target>
+ }
+
+<softlink_name> ::= <identifier>
+
+<target> ::= <identifier>
+
+<external_link> ::= EXTERNAL_LINK <external_link_name> {
+ TARGETFILE <targetfile>
+ TARGETPATH <targetpath> <targetobj>opt
+ }
+
+<external_link_name> ::= <identifier>
+
+<user_defined_link> ::= USERDEFINED_LINK <external_link_name> {
+ LINKCLASS <user_link_type>
+ }
+
+<user_link_type> ::= <int_value>
+
+<targetfile> ::= <file_name>
+
+<targetpath> ::= <identifier>
+
+<targetobj> ::= <named_datatype> | <group> | <dataset>
+
+<identifier> ::= "a string"
+// character '/' should be used with care.
+
+<pos_list> ::= <pos_int>, <pos_list> | <pos_int>
+
+<int_value> ::= 0 | <pos_int>
+
+<pos_int> ::= [1-9][0-9]*
+
+<hex_value> ::= 0x[0-F][0-F]+ | [0-F][0-F]+
+\endcode
+
+\section example110 An Example of an HDF5 File in DDL
+
+\code{.unparsed}
+HDF5 "example.h5" {
+GROUP "/" {
+ ATTRIBUTE "attr1" {
+ DATATYPE H5T_STRING {
+ STRSIZE 17;
+ STRPAD H5T_STR_NULLTERM;
+ CSET H5T_CSET_ASCII;
+ CTYPE H5T_C_S1;
+ }
+ DATASPACE SCALAR
+ DATA {
+ "string attribute"
+ }
+ }
+ DATASET "dset1" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) }
+ DATA {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
+ }
+ }
+ DATASET "dset2" {
+ DATATYPE H5T_COMPOUND {
+ H5T_STD_I32BE "a";
+ H5T_IEEE_F32BE "b";
+ H5T_IEEE_F64BE "c";
+ }
+ DATASPACE SIMPLE { ( 5 ) / ( 5 ) }
+ DATA {
+ {
+ 1,
+ 0.1,
+ 0.01
+ },
+ {
+ 2,
+ 0.2,
+ 0.02
+ },
+ {
+ 3,
+ 0.3,
+ 0.03
+ },
+ {
+ 4,
+ 0.4,
+ 0.04
+ },
+ {
+ 5,
+ 0.5,
+ 0.05
+ }
+ }
+ }
+ GROUP "group1" {
+ COMMENT "This is a comment for group1";
+ DATASET "dset3" {
+ DATATYPE "/type1"
+ DATASPACE SIMPLE { ( 5 ) / ( 5 ) }
+ DATA {
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ }
+ }
+ }
+ }
+ DATASET "dset3" {
+ DATATYPE H5T_VLEN { H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+ DATA {
+ (0), (10, 11), (20, 21, 22), (30, 31, 32, 33)
+ }
+ }
+ GROUP "group2" {
+ HARDLINK "/group1"
+ }
+ SOFTLINK "slink1" {
+ LINKTARGET "somevalue"
+ }
+ DATATYPE "type1" H5T_COMPOUND {
+ H5T_ARRAY { [4] H5T_STD_I32BE } "a";
+ H5T_ARRAY { [5][6] H5T_IEEE_F32BE } "b";
+ }
+}
+}
+\endcode
+
+ */ \ No newline at end of file
diff --git a/doxygen/dox/DDLBNF112.dox b/doxygen/dox/DDLBNF112.dox
new file mode 100644
index 0000000..6809a06
--- /dev/null
+++ b/doxygen/dox/DDLBNF112.dox
@@ -0,0 +1,653 @@
+/** \page DDLBNF112 DDL in BNF for HDF5 1.12 and above
+
+\todo Revise this & break it up!
+
+\section intro112 Introduction
+
+This document contains the data description language (DDL) for an HDF5 file. The
+description is in Backus-Naur Form (BNF).
+
+\section expo112 Explanation of Symbols
+
+This section contains a brief explanation of the symbols used in the DDL.
+
+\code{.unparsed}
+::= defined as
+ <tname> a token with the name tname
+ <a> | <b> one of <a> or <b>
+ <a>opt zero or one occurrence of <a>
+ <a>* zero or more occurrence of <a>
+ <a>+ one or more occurrence of <a>
+ [0-9] an element in the range between 0 and 9
+ '[' the token within the quotes (used for special characters)
+ TBD To Be Decided
+\endcode
+
+\section ddl112 The DDL
+
+\code{.unparsed}
+<file> ::= HDF5 <file_name> { <file_super_block>opt <root_group> }
+
+<file_name> ::= <identifier>
+
+<file_super_block> ::= SUPER_BLOCK {
+ SUPERBLOCK_VERSION <int_value>
+ FREELIST_VERSION <int_value>
+ SYMBOLTABLE_VERSION <int_value>
+ OBJECTHEADER_VERSION <int_value>
+ OFFSET_SIZE <int_value>
+ LENGTH_SIZE <int_value>
+ BTREE_RANK <int_value>
+ BTREE_LEAF <int_value>
+ ISTORE_K <int_value>
+ <super_block_filespace>
+ USER_BLOCK {
+ USERBLOCK_SIZE <int_value>
+ }
+ }
+
+<super_block_filespace> ::= FILE_SPACE_STRATEGY <super_block_strategy>
+ FREE_SPACE_PERSIST <boolean_value>
+ FREE_SPACE_SECTION_THRESHOLD <int_value>
+ FILE_SPACE_PAGE_SIZE <int_value>
+
+<super_block_strategy> ::= H5F_FSPACE_STRATEGY_FSM_AGGR | H5F_FSPACE_STRATEGY_PAGE |
+ H5F_FSPACE_STRATEGY_AGGR | H5F_FSPACE_STRATEGY_NONE |
+ Unknown strategy
+
+<root_group> ::= GROUP "/" {
+ <anon_named_datatype>*
+ <object_id>opt
+ <group_comment>opt
+ <group_attribute>*
+ <group_member>*
+ }
+
+<datatype> ::= <atomic_type> | <compound_type> | <variable_length_type> | <array_type>
+
+<anon_named_datatype> ::= DATATYPE <anon_named_type_name> {
+ <datatype>
+ }
+
+<anon_named_type_name> ::= the assigned name for anonymous named type is
+ in the form of #oid, where oid is the object id
+ of the type
+
+<atomic_type> ::= <integer> | <float> | <time> | <string> |
+ <bitfield> | <opaque> | <reference> | <enum>
+
+<boolean_value> ::= FALSE | TRUE
+
+<integer> ::= H5T_STD_I8BE | H5T_STD_I8LE |
+ H5T_STD_I16BE | H5T_STD_I16LE |
+ H5T_STD_I32BE | H5T_STD_I32LE |
+ H5T_STD_I64BE | H5T_STD_I64LE |
+ H5T_STD_U8BE | H5T_STD_U8LE |
+ H5T_STD_U16BE | H5T_STD_U16LE |
+ H5T_STD_U32BE | H5T_STD_U32LE |
+ H5T_STD_U64BE | H5T_STD_U64LE |
+ H5T_NATIVE_CHAR | H5T_NATIVE_UCHAR |
+ H5T_NATIVE_SHORT | H5T_NATIVE_USHORT |
+ H5T_NATIVE_INT | H5T_NATIVE_UINT |
+ H5T_NATIVE_LONG | H5T_NATIVE_ULONG |
+ H5T_NATIVE_LLONG | H5T_NATIVE_ULLONG
+
+<float> ::= H5T_IEEE_F32BE | H5T_IEEE_F32LE |
+ H5T_IEEE_F64BE | H5T_IEEE_F64LE |
+ H5T_NATIVE_FLOAT | H5T_NATIVE_DOUBLE |
+ H5T_NATIVE_LDOUBLE
+
+<time> ::= H5T_TIME: not yet implemented
+
+<string> ::= H5T_STRING {
+ STRSIZE <strsize>;
+ STRPAD <strpad>;
+ CSET <cset>;
+ CTYPE <ctype>;
+ }
+
+<strsize> ::= <int_value>
+
+<strpad> ::= H5T_STR_NULLTERM | H5T_STR_NULLPAD | H5T_STR_SPACEPAD
+
+<cset> ::= H5T_CSET_ASCII | H5T_CSET_UTF8
+
+<ctype> ::= H5T_C_S1 | H5T_FORTRAN_S1
+
+<bitfield> ::= H5T_STD_B8BE | H5T_STD_B8LE |
+ H5T_STD_B16BE | H5T_STD_B16LE |
+ H5T_STD_B32BE | H5T_STD_B32LE |
+ H5T_STD_B64BE | H5T_STD_B64LE
+
+<opaque> ::= H5T_OPAQUE {
+ OPAQUE_TAG <identifier>;
+ OPAQUE_SIZE <int_value>;opt
+ }
+
+<reference> ::= H5T_REFERENCE { <ref_type> }
+
+<ref_type> ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG | H5T_STD_REF | UNDEFINED
+
+<compound_type> ::= H5T_COMPOUND {
+ <member_type_def>+
+ }
+
+<member_type_def> ::= <datatype> <field_name>;
+
+<field_name> ::= <identifier>
+
+<variable_length_type> ::= H5T_VLEN { <datatype> }
+
+<array_type> ::= H5T_ARRAY { <dim_sizes> <datatype> }
+
+<dim_sizes> ::= '['<dimsize>']' | '['<dimsize>']'<dim_sizes>
+
+<dimsize> ::= <int_value>
+
+<attribute> ::= ATTRIBUTE <attr_name> {
+ <dataset_type>
+ <dataset_space>
+ <data>opt
+ }
+
+<attr_name> ::= <identifier>
+
+<dataset_type> ::= DATATYPE <path_name> | <datatype>
+
+<enum> ::= H5T_ENUM {
+ <enum_base_type> <enum_def>+
+ }
+
+<enum_base_type> ::= <integer>
+// Currently enums can only hold integer type data, but they may be expanded
+// in the future to hold any datatype
+
+<enum_def> ::= <enum_symbol> <enum_val>;
+
+<enum_symbol> ::= <identifier>
+
+<enum_val> ::= <int_value>
+
+<path_name> ::= <path_part>+
+
+<path_part> ::= /<identifier>
+
+<dataspace> ::= <scalar_space> | <simple_space> | <complex_space> | <null_space>
+
+<null_space> ::= NULL
+
+<scalar_space> ::= SCALAR
+
+<simple_space> ::= SIMPLE { <current_dims> / <max_dims> }
+
+<complex_space> ::= COMPLEX { <complex_space_definition> }
+
+<dataset_space> ::= DATASPACE <path_name> | <dataspace>
+
+<current_dims> ::= <dims>
+
+<max_dims> ::= '(' <max_dim_list> ')'
+
+<max_dim_list> ::= <max_dim> | <max_dim>, <max_dim_list>
+
+<max_dim> ::= <int_value> | H5S_UNLIMITED
+
+<data> ::= <subset> | <data_values>
+
+<data_values> ::= DATA {
+ <scalar_space_data> | <simple_space_data>
+ }
+
+<scalar_space_data> ::= <any_element>
+
+<any_element> ::= <atomic_element> | <compound_element> |
+ <variable_length_element> | <array_element>
+
+<any_data_seq> ::= <any_element> | <any_element>, <any_data_seq>
+
+<atomic_element> :: = <integer_data> | <float_data> | <time_data> |
+ <string_data> | <bitfield_data> | <opaque_data> |
+ <enum_data> | <reference_data>
+
+<subset> ::= SUBSET {
+ <start>;
+ <stride>;
+ <count>;
+ <block>;
+ DATA {
+ <simple_space_data>
+ }
+ }
+
+<start> ::= START (<coor_list>)
+
+<stride> ::= STRIDE (<pos_list>)
+
+<count> ::= COUNT (<max_dim_list>)
+
+<block> ::= BLOCK (<max_dim_list>)
+
+<coor_list> ::= <coor_data>, <coor_list> | <coor_data>
+
+<coor_data> ::= <integer_data> | H5S_UNLIMITED
+
+<integer_data> ::= <int_value>
+
+<float_data> ::= a floating point number
+
+<time_data> ::= DATA{ not yet implemented.}
+
+<string_data> ::= a string
+// A string is enclosed in double quotes.
+// If a string is displayed on more than one line, string concatenate
+// operator '//'is used.
+
+<bitfield_data> ::= <hex_value>
+
+<opaque_data> ::= <hex_value>:<hex_value> | <hex_value>
+
+<enum_data> ::= <enum_symbol>
+
+<reference_data> ::= <object_ref_data> | <data_region_data> | <attribute_data> | NULL
+
+<object_ref_data> ::= <object_type> <object_ref>
+
+<object_type> ::= ATTRIBUTE | DATASET | GROUP | DATATYPE
+
+<object_ref> ::= <object_id>
+
+<object_id> ::= <path_name> | OBJECTID { <object_num> }
+
+<object_num> ::= <int_value>:<int_value> | <int_value>
+
+<attribute_data> ::= ATTRIBUTE <attr_name>opt
+ <data>opt
+
+<data_region_data> ::= DATASET <dataset_name> {
+ <data_region_type>opt <data_region_data_list>
+ <dataset_type>opt <dataset_space>opt
+ <data>opt
+ }
+
+<data_region_type> ::= REGION_TYPE <data_region_data_type>
+
+<data_region_data_type> ::= POINT | BLOCK
+
+<data_region_data_list> ::= <data_region_data_info>, <data_region_data_list> |
+ <data_region_data_info>
+
+<data_region_data_info> ::= <region_info> | <point_info>
+
+<region_info> ::= (<lower_region_vals>)-(<upper_region_vals>)
+
+<lower_region_vals> ::= <lower_bound>, <lower_region_vals> | <lower_bound>
+
+<upper_region_vals> ::= <upper_bound>, <upper_region_vals> | <upper_bound>
+
+<lower_bound> ::= <int_value>
+
+<upper_bound> ::= <int_value>
+
+<point_info> ::= (<point_vals>)
+
+<point_vals> ::= <int_value> | <int_value>, <point_vals>
+
+<compound_element> ::= { <any_data_seq> }
+
+<atomic_simple_data> :: = <atomic_element>, <atomic_simple_data> |
+ <atomic_element>
+
+<simple_space_data> :: = <any_data_seq>
+
+<variable_length_element> ::= ( <any_data_seq> )
+
+<array_element> ::= '[' <any_data_seq> ']'
+
+<named_datatype> ::= DATATYPE <type_name> { <datatype> }
+
+<type_name> ::= <identifier>
+
+<hardlink> ::= HARDLINK <path_name>
+
+<group> ::= GROUP <group_name> { <hardlink> | <group_info> }
+
+<group_comment> ::= COMMENT <string_data>
+
+<group_name> ::= <identifier>
+
+<group_info> ::= <object_id>opt <group_comment>opt <group_attribute>*
+ <group_member>*
+
+<group_attribute> ::= <attribute>
+
+<group_member> ::= <named_datatype> | <group> | <dataset> |
+ <softlink> | <external_link>
+
+<dataset> ::= DATASET <dataset_name> { <hardlink> | <dataset_info> }
+
+<dataset_info> ::= <dataset_type>
+ <dataset_space>
+ <dcpl_info>opt
+ <dataset_attribute>* <object_id>opt
+ <data>opt
+// Tokens above can be in any order as long as <data> is
+// after <dataset_type> and <dataset_space>.
+
+<dcpl_info> ::= <storagelayout>
+ <compression_filters>
+ <fillvalue>
+ <allocationtime>
+
+<dataset_name> ::= <identifier>
+
+<storagelayout> :: = STORAGE_LAYOUT {
+ <contiguous_layout> | <chunked_layout> |
+ <compact_layout> | <virtual_layout>
+ }
+
+<contiguous_layout> ::= CONTIGUOUS
+ <internal_layout> | <external_layout>
+
+<chunked_layout> ::= CHUNKED <dims>
+ <filter_ratio>opt
+
+<compact_layout> ::= COMPACT
+ <size>
+
+<internal_layout> ::= <size>
+ <offset>
+
+<external_layout> ::= EXTERNAL {
+ <external_file>+
+ }
+
+<virtual_layout> ::= <vmaps>*opt
+
+<vmaps> ::= MAPPING <int_value> {
+ <virtual_map>
+ <source_map>
+ }
+
+<virtual_map> ::= VIRTUAL {
+ <vmaps_selection>
+ }
+
+<source_map> ::= SOURCE {
+ FILE <file_name>
+ DATASET <dataset_name>
+ <vmaps_selection>
+ }
+
+<vmaps_selection> ::= <regular_hyperslab> | <irregular_hyperslab> |
+ <select_points> | <select_none> | <select_all>
+
+<regular_hyperslab> ::= SELECTION REGULAR_HYPERSLAB {
+ <start>
+ <stride>
+ <count>
+ <block>
+ }
+
+<irregular_hyperslab> ::= SELECTION IRREGULAR_HYPERSLAB {
+ <region_info>+
+ }
+
+<select_points> ::= SELECTION POINT {
+ (<coor_list>)+
+ }
+
+<select_none> ::= SELECTION NONE
+
+<select_all> ::= SELECTION ALL
+
+<dims> ::= (<dims_values>)
+
+<dims_values> ::= <int_value> | <int_value>, <dims_values>
+
+<external_file> ::= FILENAME <file_name> <size> <offset>
+
+<offset> ::= OFFSET <int_value>
+
+<size> ::= SIZE <int_value>
+
+<filter_ratio> ::= <size> | <compressionratio>
+
+<compressionratio> :: = <size> (<float_data>:1 COMPRESSION)
+
+<compression_filters> :: = FILTERS {
+ <filter_type>+ | NONE
+ }
+
+<filter_type> :: = <filter_deflate> | <filter_shuffle> |
+ <filter_flecther> | <filter_szip> |
+ <filter_nbit> | <filter_scaleoffset> |
+ <filter_default>
+
+<filter_default> :: = <filter_user> {
+ FILTER_ID <int_value>
+ <filter_comment>opt
+ <filter_params>opt
+ }
+
+<filter_user> :: = USER_DEFINED_FILTER
+
+<filter_deflate> :: = COMPRESSION DEFLATE { LEVEL <int_value> }
+
+<filter_shuffle> :: = PREPROCESSING SHUFFLE
+
+<filter_flecther> :: = CHECKSUM FLETCHER32
+
+<filter_szip> :: = COMPRESSION SZIP {
+ PIXELS_PER_BLOCK <int_value>
+ <filter_szip_mode>opt
+ <filter_szip_coding>opt
+ <filter_szip_order>opt
+ <filter_szip_header>opt
+ }
+
+<filter_szip_mode> :: = MODE HARDWARE | K13
+
+<filter_szip_coding> :: = CODING ENTROPY | NEAREST NEIGHBOUR
+
+<filter_szip_order> :: = BYTE_ORDER LSB | MSB
+
+<filter_szip_header> :: = HEADER RAW
+
+<filter_nbit> :: = CHECKSUM NBIT
+
+<filter_scaleoffset> :: = COMPRESSION SCALEOFFSET { MIN BITS <int_value> }
+
+<filter_comment> :: = COMMENT <identifier>
+
+<filter_params> :: = PARAMS { <int_value>* }
+
+<fillvalue> ::= FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_ALLOC | H5D_FILL_TIME_NEVER | H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_UNDEFINED | H5D_FILL_VALUE_DEFAULT | <any_element>
+ }
+
+<allocationtime> ::= ALLOCATION_TIME {
+ H5D_ALLOC_TIME_EARLY | H5D_ALLOC_TIME_INCR |
+ H5D_ALLOC_TIME_LATE
+ }
+
+<dataset_attribute> ::= <attribute>
+
+<softlink> ::= SOFTLINK <softlink_name> {
+ LINKTARGET <target>
+ }
+
+<softlink_name> ::= <identifier>
+
+<target> ::= <identifier>
+
+<external_link> ::= EXTERNAL_LINK <external_link_name> {
+ TARGETFILE <targetfile>
+ TARGETPATH <targetpath> <targetobj>opt
+ }
+
+<external_link_name> ::= <identifier>
+
+<user_defined_link> ::= USERDEFINED_LINK <external_link_name> {
+ LINKCLASS <user_link_type>
+ }
+
+<user_link_type> ::= <int_value>
+
+<targetfile> ::= <file_name>
+
+<targetpath> ::= <identifier>
+
+<targetobj> ::= <named_datatype> | <group> | <dataset>
+
+<identifier> ::= "a string"
+// character '/' should be used with care.
+
+<pos_list> ::= <pos_int>, <pos_list> | <pos_int>
+
+<int_value> ::= 0 | <pos_int>
+
+<pos_int> ::= [1-9][0-9]*
+
+<hex_value> ::= 0x[0-F][0-F]+ | [0-F][0-F]+
+\endcode
+
+\section example112 An Example of an HDF5 File in DDL
+
+\code{.unparsed}
+HDF5 "example.h5" {
+GROUP "/" {
+ ATTRIBUTE "attr1" {
+ DATATYPE H5T_STRING {
+ STRSIZE 17;
+ STRPAD H5T_STR_NULLTERM;
+ CSET H5T_CSET_ASCII;
+ CTYPE H5T_C_S1;
+ }
+ DATASPACE SCALAR
+ DATA {
+ "string attribute"
+ }
+ }
+ DATASET "dset1" {
+ DATATYPE H5T_STD_I32BE
+ DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) }
+ DATA {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
+ }
+ }
+ DATASET "dset2" {
+ DATATYPE H5T_COMPOUND {
+ H5T_STD_I32BE "a";
+ H5T_IEEE_F32BE "b";
+ H5T_IEEE_F64BE "c";
+ }
+ DATASPACE SIMPLE { ( 5 ) / ( 5 ) }
+ DATA {
+ {
+ 1,
+ 0.1,
+ 0.01
+ },
+ {
+ 2,
+ 0.2,
+ 0.02
+ },
+ {
+ 3,
+ 0.3,
+ 0.03
+ },
+ {
+ 4,
+ 0.4,
+ 0.04
+ },
+ {
+ 5,
+ 0.5,
+ 0.05
+ }
+ }
+ }
+ GROUP "group1" {
+ COMMENT "This is a comment for group1";
+ DATASET "dset3" {
+ DATATYPE "/type1"
+ DATASPACE SIMPLE { ( 5 ) / ( 5 ) }
+ DATA {
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ },
+ {
+ [ 0, 1, 2, 3 ],
+ [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
+ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
+ 0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
+ 0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
+ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ]
+ }
+ }
+ }
+ }
+ DATASET "dset3" {
+ DATATYPE H5T_VLEN { H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+ DATA {
+ (0), (10, 11), (20, 21, 22), (30, 31, 32, 33)
+ }
+ }
+ GROUP "group2" {
+ HARDLINK "/group1"
+ }
+ SOFTLINK "slink1" {
+ LINKTARGET "somevalue"
+ }
+ DATATYPE "type1" H5T_COMPOUND {
+ H5T_ARRAY { [4] H5T_STD_I32BE } "a";
+ H5T_ARRAY { [5][6] H5T_IEEE_F32BE } "b";
+ }
+}
+}
+\endcode
+
+*/ \ No newline at end of file
diff --git a/doxygen/dox/FileFormatSpec.dox b/doxygen/dox/FileFormatSpec.dox
new file mode 100644
index 0000000..fc10574
--- /dev/null
+++ b/doxygen/dox/FileFormatSpec.dox
@@ -0,0 +1,23 @@
+/** \page FMT3 HDF5 File Format Specification Version 3.0
+
+\htmlinclude H5.format.html
+
+*/
+
+/** \page FMT2 HDF5 File Format Specification Version 2.0
+
+\htmlinclude H5.format.2.0.html
+
+*/
+
+/** \page FMT11 HDF5 File Format Specification Version 1.1
+
+\htmlinclude H5.format.1.1.html
+
+*/
+
+/** \page FMT1 HDF5 File Format Specification Version 1.0
+
+\htmlinclude H5.format.1.0.html
+
+*/ \ No newline at end of file
diff --git a/doxygen/dox/GettingStarted.dox b/doxygen/dox/GettingStarted.dox
new file mode 100644
index 0000000..880491d
--- /dev/null
+++ b/doxygen/dox/GettingStarted.dox
@@ -0,0 +1,3 @@
+/** \page GettingStarted \Code{Hello, HDF5!}
+
+ */ \ No newline at end of file
diff --git a/doxygen/dox/H5Acreate.dox b/doxygen/dox/H5Acreate.dox
deleted file mode 100644
index 18d648f..0000000
--- a/doxygen/dox/H5Acreate.dox
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * \ingroup H5A
- * \def H5Acreate()
- * H5Acreate() is a macro that is mapped to either H5Acreate1() or
- * H5Acreate2().
- *
- *
- * \todo Standardize the way we describe these macros!
- */
diff --git a/doxygen/dox/H5Aiterate.dox b/doxygen/dox/H5Aiterate.dox
deleted file mode 100644
index 46b9bb4..0000000
--- a/doxygen/dox/H5Aiterate.dox
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * \ingroup H5A
- * \def H5Aiterate()
- * H5Aiterate() is a macro that is mapped to either H5Aiterate1() or
- * H5Aiterate2().
- *
- *
- * \todo Standardize the way we describe these macros!
- */
diff --git a/doxygen/dox/H5Fget_info.dox b/doxygen/dox/H5Fget_info.dox
deleted file mode 100644
index b2eeb6c..0000000
--- a/doxygen/dox/H5Fget_info.dox
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * \ingroup H5F
- * \def H5Fget_info()
- * H5Fget_info() is a macro that is mapped to either H5Fget_info1()
- * or H5Fget_info2(), depending on the needs of the application.
- * Similarly, the macro for the \ref H5F_info_t struct is mapped to either
- * H5F_info1_t or H5F_info2_t.
- *
- * Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in "API Compatibility
- * Macros in HDF5".
- *
- * When both the HDF5 library and the application are built and installed with
- * no specific compatibility flags, H5Fget_info() is mapped to the most recent
- * version of the function, currently H5Fget_info2(). If the library and/or
- * application is compiled for Release 1.8 emulation, H5Fget_info() will be
- * mapped to H5Fget_info1(). Since there was no H5Fget_info() function in
- * Release 1.6, if the library and/or application is compiled for Release 1.6
- * emulation, H5Fget_info() will be mapped to the most recent version of the
- * function, currently H5Fget_info2(). 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:
- *
- * \Bold{Global settings}\n
- * \li No compatibility flag: H5Fget_info2() and H5F_info2_t
- * \li Enable deprecated symbols: H5Fget_info2() and H5F_info2_t
- * \li Disable deprecated symbols: H5Fget_info2() and H5F_info2_t
- * \li Emulate Release 1.6 interface: H5Fget_info2() and H5F_info2_t
- * \li Emulate Release 1.8 interface: H5Fget_info1() and H5F_info1_t
- *
- * \Bold{Function- and struct-level macros}\n
- * \li \Code{H5Fget_info_vers=2}: H5Fget_info2()
- * \li \Code{H5Fget_info_vers=1}: H5Fget_info1()
- * \li \Code{H5F_info_t_vers=2}: H5F_info2_t
- * \li \Code{H5F_info_t_vers=1}: H5F_info1_t
- *
- * \todo Fix the reference.
- *
- * \version 1.10.0 The C function H5Fget_info() and H5F_info_t renamed to
- * H5Fget_info1() and H5F_info1_t, respectively, and deprecated
- * in this release. The C macro #H5Fget_info, the C function
- * H5Fget_info2(), and the struct H5F_info2_t introduced in this
- * release.
- */
diff --git a/doxygen/dox/H5Lget_info.dox b/doxygen/dox/H5Lget_info.dox
deleted file mode 100644
index 686dfe4..0000000
--- a/doxygen/dox/H5Lget_info.dox
+++ /dev/null
@@ -1,18 +0,0 @@
- /**
- * \ingroup LMGT
- * \def H5Lget_info()
- * H5Lget_info() is a macro that is mapped to either H5Lget_info1()
- * or H5Lget_info2() Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in Compatibility
- * Macros in HDF5. If the library and/or application is compiled for Release
- * 1.12 emulation, H5Lget_info() will be mapped to H5Lget_info2() and
- * H5Lget_info1() is deprecated. With earlier versions, H5Lget_info() is mapped to
- * H5Lget_info1(). Specific compile-time compatibility flags and the resulting
- * mappings are as follows:
- * \li No compatibility flag: H5Lget_info2() (using 1.12 source) H5Lget_info1()
- * (using 1.10 or 1.8 source)
- * \li Emulate Release 1.12: H5Lget_info2()
- * \li Emulate Release 1.8 or 1.10 interface: H5Lget_info1()
- *
- * \todo Fix the reference.
- */
diff --git a/doxygen/dox/H5Lget_info_by_idx.dox b/doxygen/dox/H5Lget_info_by_idx.dox
deleted file mode 100644
index 8f1511e..0000000
--- a/doxygen/dox/H5Lget_info_by_idx.dox
+++ /dev/null
@@ -1,18 +0,0 @@
- /**
- * \ingroup LMGT
- * \def H5Lget_info_by_idx()
- * H5Lget_info_by_idx() is a macro that is mapped to either H5Lget_info_by_idx1()
- * or H5Lget_info_by_idx2() Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in Compatibility
- * Macros in HDF5. If the library and/or application is compiled for Release
- * 1.12 emulation, H5Lget_info_by_idx() will be mapped to H5Lget_info_by_idx2() and
- * H5Lget_info_by_idx1() is deprecated. With earlier versions, H5Lget_infoby_idx() is mapped to
- * H5Lget_info_by_idx1(). Specific compile-time compatibility flags and the resulting
- * mappings are as follows:
- * \li No compatibility flag: H5Lget_info_by_idx2() (using 1.12 source) H5Lget_info_by_idx1()
- * (using 1.10 or 1.8 source)
- * \li Emulate Release 1.12: H5Lget_info_by_idx2()
- * \li Emulate Release 1.8 or 1.10 interface: H5Lget_info_by_idx1()
- *
- * \todo Fix the reference.
- */
diff --git a/doxygen/dox/H5Literate.dox b/doxygen/dox/H5Literate.dox
deleted file mode 100644
index 4d3a8dc..0000000
--- a/doxygen/dox/H5Literate.dox
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * \ingroup TRAV
- * \def H5Literate()
- * H5Literate() is a macro that is mapped to either H5Literate1() or
- * H5Literate2() Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * Compatibility Macros in HDF5. If the library and/or application is
- * compiled for Release 1.12 emulation, H5Literate() will be mapped to
- * H5Literate2() and H5Literate1() is deprecated. With earlier versions,
- * H5Literate() is mapped to H5Literate1(). Specific compile-time compatibility
- * flags and the resulting mappings are as follows:
- * \li No compatibility flag: H5Literate2() (using 1.12 source) H5Literate1()
- * (using 1.10 or 1.8 source)
- * \li Emulate Release 1.12: H5Literate2()
- * \li Emulate Release 1.8 or 1.10 interface: H5Literate1()
- *
- * \todo Fix the reference.
- *
- * \version 1.12.0 The function H5Literate() was renamed to H5Literate1() and
- * deprecated in this release. The macro H5Literate() and the
- * function H5Literate2() were introduced in this release.
- */
diff --git a/doxygen/dox/H5Literate_by_name.dox b/doxygen/dox/H5Literate_by_name.dox
deleted file mode 100644
index 174157a..0000000
--- a/doxygen/dox/H5Literate_by_name.dox
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * \ingroup TRAV
- * \def H5Literate_by_name()
- * H5Literate_by_name() is a macro that is mapped to either
- * H5Literate_by_name1() or H5Literate_by_name2() Such macros are provided to
- * facilitate application compatibility. Their use and mappings are fully
- * described in Compatibility Macros in HDF5. If the library and/or application is
- * compiled for Release 1.12 emulation, H5Literate_by_name() will be mapped to
- * H5Literate_by_name2() and H5Literate_by_name1() is deprecated. With earlier
- * versions, H5Literate_by_name() is mapped to H5Literate_by_name1().
- * Specific compile-time compatibility flags and the resulting mappings are as
- * follows:
- * \li No compatibility flag: H5Literate_by_name2() (using 1.12 source)
- * H5Literate_by_name1() (using 1.10 or 1.8 source)
- * \li Emulate Release 1.12: H5Literate_by_name2()
- * \li Emulate Release 1.8 or 1.10 interface: H5Literate_by_name1()
- *
- * \todo Fix the reference.
- *
- * \version 1.12.0 The function H5Literate_by_name() was renamed to H5Literate_by_name1() and
- * deprecated in this release. The macro H5Literate_by_name() and the
- * function H5Literate_by_name2() were introduced in this release.
- */
diff --git a/doxygen/dox/H5Lvisit.dox b/doxygen/dox/H5Lvisit.dox
deleted file mode 100644
index e356576..0000000
--- a/doxygen/dox/H5Lvisit.dox
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * \ingroup TRAV
- * \def H5Lvisit()
- * H5Lvisit() is a macro that is mapped to either H5Lvisit1() or
- * H5Lvisit2() Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * Compatibility Macros in HDF5. If the library and/or application is
- * compiled for Release 1.12 emulation, H5Lvisit() will be mapped to
- * H5Lvisit2() and H5Lvisit1() is deprecated. With earlier versions,
- * H5Lvisit() is mapped to H5Lvisit1(). Specific compile-time compatibility
- * flags and the resulting mappings are as follows:
- * \li No compatibility flag: H5Lvisit2() (using 1.12 source) H5Lvisit1()
- * (using 1.10 or 1.8 source)
- * \li Emulate Release 1.12: H5Lvisit2()
- * \li Emulate Release 1.8 or 1.10 interface: H5Lvisit1()
- *
- * \todo Fix the reference.
- *
- * \version 1.12.0 The function H5Lvisit() was renamed to H5Lvisit1() and
- * deprecated in this release. The macro H5Lvisit() and the
- * function H5Lvisit2() were introduced in this release.
- */
diff --git a/doxygen/dox/H5Lvisit_by_name.dox b/doxygen/dox/H5Lvisit_by_name.dox
deleted file mode 100644
index 0bb482e..0000000
--- a/doxygen/dox/H5Lvisit_by_name.dox
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * \ingroup TRAV
- * \def H5Lvisit_by_name()
- * H5Lvisit_by_name() is a macro that is mapped to either H5Lvisit_by_name1() or
- * H5Lvisit_by_name2() Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * Compatibility Macros in HDF5. If the library and/or application is
- * compiled for Release 1.12 emulation, H5Lvisit_by_name() will be mapped to
- * H5Lvisit_by_name2() and H5Lvisit_by_name1() is deprecated. With earlier versions,
- * H5Lvisit_by_name() is mapped to H5Lvisit_by_name1(). Specific compile-time
- * compatibility flags and the resulting mappings are as follows:
- * \li No compatibility flag: H5Lvisit_by_name2() (using 1.12 source) H5Lvisit_by_name1()
- * (using 1.10 or 1.8 source)
- * \li Emulate Release 1.12: H5Lvisit_by_name2()
- * \li Emulate Release 1.8 or 1.10 interface: H5Lvisit_by_name1()
- *
- * \todo Fix the reference.
- *
- * \version 1.12.0 The function H5Lvisit_by_name() was renamed to H5Lvisit_by_name1() and
- * deprecated in this release. The macro H5Lvisit_by_name() and the
- * function H5Lvisit_by_name2() were introduced in this release.
- */
diff --git a/doxygen/dox/H5Oget_info.dox b/doxygen/dox/H5Oget_info.dox
deleted file mode 100644
index ee4cd1c..0000000
--- a/doxygen/dox/H5Oget_info.dox
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * \ingroup H5O
- * \def H5Oget_info
- *
- * #H5Oget_info is a macro that is mapped to:
- * \li #H5Oget_info3
- * \li #H5Oget_info1
- *
- * \details Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * API Compatibility Macros in HDF5; we urge you to read that
- * document closely.
- *
- * In HDF5 versions 1.12 and after, #H5Oget_info is mapped to
- * #H5Oget_info3 and #H5Oget_info1 is deprecated.
- * In version 1.10 #H5Oget_info is identical to #H5Oget_info1.
- *
- * Specific compile-time compatibility flags and the resulting
- * mappings are as follows:
- * \par
- * <table>
- * <tr>
- * <th>Compatibility setting</th>
- * <th>H5Oget_info</th>
- * </tr>
- * <tr>
- * <td>No compatibility flag \n &nbsp;</td>
- * <td>#H5Oget_info3 (in release 1.12) \n
- * #H5Oget_info1 (in 1.8 or 1.10)</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.12</td>
- * <td>#H5Oget_info3</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.10/1.8 interface</td>
- * <td>#H5Oget_info1</td>
- * </tr>
- * </table>
- *
- * \note If you are iterating through a lot of different objects to
- * retrieve information via the #H5Oget_info family of routines,
- * you may see memory building up. This can be due to memory
- * allocation for metadata such as object headers and messages
- * when the iterated objects are put into the metadata cache.
- * \note
- * If the memory buildup is not desirable, you can configure a
- * smaller cache via #H5Fset_mdc_config or set the file access
- * property list via #H5Pset_mdc_config. A smaller sized cache
- * will force metadata entries to be evicted from the cache,
- * thus freeing the memory associated with the entries.
- *
- * \version 1.12.0 The macro #H5Oget_info and the function #H5Oget_info3
- * were added, and #H5Oget_info1 was deprecated.
- * \version 1.10.5 The macro #H5Oget_info was removed. The functions
- * #H5Oget_info1 and #H5Oget_info are identical
- * in this release. This change was added to restore the
- * broken API compatibility introduced in HDF5-1.10.3.
- * \version 1.10.3 The function #H5Oget_info was renamed
- * #H5Oget_info1. The macro #H5Oget_info and the function
- * #H5Oget_info2 were introduced in this release.
- * \version 1.8.15 Added a note about the valid values for the \c version field
- * in the H5O_hdr_info_t structure.
- * \version 1.8.11 Fortran subroutine introduced in this release.
- * \version 1.8.10 Added #H5O_type_t structure to the Description section.
- * Separated H5O_hdr_info_t structure from
- * #H5O_info_t in the Description section. Clarified the
- * definition and implementation of the time fields.
- *
- * \since 1.8.0
- *
- */
diff --git a/doxygen/dox/H5Oget_info_by_idx.dox b/doxygen/dox/H5Oget_info_by_idx.dox
deleted file mode 100644
index 49b8031..0000000
--- a/doxygen/dox/H5Oget_info_by_idx.dox
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * \ingroup H5O
- * \def H5Oget_info_by_idx
- *
- * #H5Oget_info_by_idx is a macro that is mapped to:
- * \li #H5Oget_info_by_idx3
- * \li #H5Oget_info_by_idx1
- *
- * \details Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * API Compatibility Macros in HDF5; we urge you to read that
- * document closely.
- *
- * In HDF5 versions 1.12 and after, #H5Oget_info_by_idx is mapped to
- * #H5Oget_info_by_idx3 and #H5Oget_info_by_idx1 is deprecated.
- * In version 1.10 #H5Oget_info_by_idx is identical to #H5Oget_info_by_idx1.
- *
- * Specific compile-time compatibility flags and the resulting
- * mappings are as follows:
- *
- * \par
- * <table>
- * <tr>
- * <th>Compatibility setting</th>
- * <th>H5Oget_info_by_idx</th>
- * </tr>
- * <tr>
- * <td>No compatibility flag \n &nbsp;</td>
- * <td>#H5Oget_info_by_idx3 for 1.12 \n
- * #H5Oget_info_by_idx1 for 1.8/1.10</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.12</td>
- * <td>#H5Oget_info_by_idx3</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.10/1.8 interface</td>
- * <td>#H5Oget_info_by_idx1</td>
- * </tr>
- * </table>
- *
- * \version 1.12.0 The macro #H5Oget_info_by_idx and function #H5Oget_info_by_idx3 were added,
- * and #H5Oget_info_by_idx1 was deprecated.
- * \version 1.10.5 The macro #H5Oget_info_by_idx was removed. The functions
- * #H5Oget_info_by_idx and #H5Oget_info_by_idx1 are
- * identical in this release. This change was added to restore the
- * broken API compatibility introduced in HDF5-1.10.3.
- * \version 1.10.3 The function #H5Oget_info_by_idx was renamed #H5Oget_info_by_idx1.
- * The macro #H5Oget_info_by_idx and the function #H5Oget_info_by_idx2
- * were introduced in this release.
- * \version 1.8.11 Fortran subroutine introduced in this release.
- *
- * \since 1.8.0
- *
- */
diff --git a/doxygen/dox/H5Oget_info_by_name.dox b/doxygen/dox/H5Oget_info_by_name.dox
deleted file mode 100644
index 18f7d28..0000000
--- a/doxygen/dox/H5Oget_info_by_name.dox
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * \ingroup H5O
- * \def H5Oget_info_by_name
- *
- * #H5Oget_info_by_name is a macro that is mapped to:
- * \li #H5Oget_info_by_name3
- * \li #H5Oget_info_by_name1
- *
- * \details Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * API Compatibility Macros in HDF5; we urge you to read that
- * document closely.
- *
- * In HDF5 versions 1.12 and after, #H5Oget_info_by_name is mapped to
- * #H5Oget_info_by_name3. In version 1.10 #H5Oget_info_by_name is
- * identical to #H5Oget_info_by_name1.
- *
- * Specific compile-time compatibility flags and the resulting
- * mappings are as follows:
- *
- * \par
- * <table>
- * <tr>
- * <th>Compatibility setting</th>
- * <th>H5Oget_info_by_name</th>
- * </tr>
- * <tr>
- * <td>No compatibility flag \n &nbsp;</td>
- * <td>#H5Oget_info_by_name3 for 1.12 and above \n
- * #H5Oget_info_by_name1 for 1.8 or 1.10</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.12</td>
- * <td>#H5Oget_info_by_name3</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.10 or 1.8 interface</td>
- * <td>#H5Oget_info_by_name1</td>
- * </tr>
- * </table>
- *
- * \version 1.12.0 The macro #H5Oget_info_by_name and function
- * #H5Oget_info_by_name3 were added and
- * #H5Oget_info_by_name1 was deprecated.
- * \version 1.10.5 The macro #H5Oget_info_by_name was removed. The functions
- * #H5Oget_info_by_name and #H5Oget_info_by_name1 are
- * identical in this release. This change was added to restore
- * the broken API compatibility introduced in HDF5-1.10.3.
- * \version 1.10.3 The function #H5Oget_info_by_name was renamed
- * to #H5Oget_info_by_name1. The macro #H5Oget_info_by_name
- * and the function #H5Oget_info_by_name2 were introduced
- * in this release.
- * \version 1.8.8 Fortran 2003 subroutine and \c h5o_info_t derived
- * type introduced in this release.</td>
- *
- * \since 1.8.0
- *
- */
diff --git a/doxygen/dox/H5Ovisit.dox b/doxygen/dox/H5Ovisit.dox
deleted file mode 100644
index 1e2a3ea..0000000
--- a/doxygen/dox/H5Ovisit.dox
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * \ingroup H5O
- * \def H5Ovisit
- *
- * #H5Ovisit is a macro that is mapped to one of the following:
- * \li #H5Ovisit3
- * \li #H5Ovisit1
- *
- * \details Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * API Compatibility Macros in HDF5; we urge you to read that
- * document closely.
- *
- * In HDF5 versions 1.12 and after, #H5Ovisit is mapped to
- * #H5Ovisit3. In version 1.10, #H5Ovisit is identical
- * to #H5Ovisit1.
- *
- * Specific compile-time compatibility flags and the resulting
- * mappings are as follows:
- *
- * \par
- * <table>
- * <tr>
- * <th>Compatibility settings</th>
- * <th>H5Ovisit</th>
- * </tr>
- * <tr>
- * <td>No compatibility flag \n &nbsp;</td>
- * <td>#H5Ovisit3 in 1.12 or after \n
- * #H5Ovisit1 for 1.8 and 1.10</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.12</td>
- * <td>#H5Ovisit3</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.10 or 1.8 interface</td>
- * <td>#H5Ovisit1</td>
- * </tr>
- * </table>
- *
- * \version 1.12.0 The macro #H5Ovisit and function #H5Ovisit3 were added,
- * and #H5Ovisit1 was deprecated.
- * \version 1.10.5 The macro #H5Ovisit was removed. The functions
- * #H5Ovisit and #H5Ovisit1 are identical in this release.
- * This change was added to restore the broken API compatibility
- * introduced in HDF5-1.10.3.
- * \version 1.10.3 The function #H5Ovisit was renamed to #H5Ovisit1.
- * The macro #H5Ovisit and the function #H5Ovisit2 were
- * introduced in this release.
- * \version 1.8.8 Fortran subroutine and data structure added.
- *
- * \since 1.8.0
- *
- */
diff --git a/doxygen/dox/H5Ovisit_by_name.dox b/doxygen/dox/H5Ovisit_by_name.dox
deleted file mode 100644
index 2ba4846..0000000
--- a/doxygen/dox/H5Ovisit_by_name.dox
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * \ingroup H5O
- * \def H5Ovisit_by_name
- *
- * #H5Ovisit_by_name is a macro that is mapped to one of the following:
- * \li #H5Ovisit_by_name3
- * \li #H5Ovisit_by_name1
- *
- * \details Such macros are provided to facilitate application
- * compatibility. Their use and mappings are fully described in
- * API Compatibility Macros in HDF5; we urge you to read that
- * document closely.
- *
- * In HDF5 versions 1.12 and after, #H5Ovisit_by_name is mapped to
- * #H5Ovisit_by_name3. In version 1.10, #H5Ovisit_by_name
- * is identical to #H5Ovisit_by_name1.
- *
- * Specific compile-time compatibility flags and the resulting
- * mappings are as follows:
- *
- * \par
- * <table>
- * <tr>
- * <th>Compatibility settings</th>
- * <th>H5Ovisit_by_name</th>
- * </tr>
- * <tr>
- * <td>No compatibility flag \n &nbsp;</td>
- * <td>#H5Ovisit_by_name3 for 1.12 and above \n
- * #H5Ovisit_by_name1 for 1.10 or 1.8</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.12 interface</td>
- * <td>#H5Ovisit_by_name3</td>
- * </tr>
- * <tr>
- * <td>Emulate Release 1.10 or 1.8 interface</td>
- * <td>#H5Ovisit_by_name1</td>
- * </tr>
- * </table>
- *
- * \version 1.12.0 The macro #H5Ovisit_by_name and function #H5Ovisit_by_name3 were added.
- * \version 1.10.5 The macro #H5Ovisit_by_name was removed. The functions
- * #H5Ovisit_by_name and #H5Ovisit_by_name1 are identical
- * in this release. This change was added to restore the
- * broken API compatibility introduced in HDF5-1.10.3.
- * \version 1.10.3 The function #H5Ovisit_by_name was renamed to #H5Ovisit_by_name1.
- * The macro #H5Ovisit_by_name and the function #H5Ovisit_by_name2
- * were introduced in this release.
- * \version 1.8.8 Fortran subroutine introduced in this release.
- *
- * \since 1.8.0
- *
- */
diff --git a/doxygen/dox/H5Sencode.dox b/doxygen/dox/H5Sencode.dox
deleted file mode 100644
index fe0995c..0000000
--- a/doxygen/dox/H5Sencode.dox
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * \ingroup H5S
- * \def H5Sencode()
- * H5Sencode() is a macro that is mapped to either H5Sencode1() or H5Sencode2().
-*/
diff --git a/doxygen/dox/MetadataCachingInHDF5.dox b/doxygen/dox/MetadataCachingInHDF5.dox
new file mode 100644
index 0000000..b84ddea
--- /dev/null
+++ b/doxygen/dox/MetadataCachingInHDF5.dox
@@ -0,0 +1,1020 @@
+/** \page TNMDC Metadata Caching in HDF5
+
+\todo Revise this!
+
+\section intro Introduction
+
+In the 1.6.4 release, we introduced a re-implementation of the metadata
+cache. That release contained an incomplete version of the cache which could not
+be controlled via the API. The version in the 1.8 release is more mature and
+includes new API calls that allow the user program to configure the metadata
+cache both on file open and at run time.
+
+From the user perspective, the most striking effect of the new cache should be a
+large reduction in the cache memory requirements when working with complex HDF5
+files.
+
+Those working with such files may also notice a reduction in file close time.
+
+Those working with HDF5 files with a simple structure shouldn't notice any
+particular changes in most cases. In rare cases, there may be a significant
+improvement in performance.
+
+The remainder of this document contains an architectural overview of the old and
+new metadata caches, a discussion of algorithms used to automatically adjust
+cache size to circumstances, and a high-level discussion of the cache
+configuration controls. It can be safely skipped by anyone who works only with
+HDF5 files with relatively simple structure (i.e. no huge groups, no datasets
+with large numbers of chunks, and no objects with large numbers of attributes.)
+
+On the other hand, it is mandatory reading if you want to use something other
+than the default metadata cache configuration. The documentation on the metadata
+cache-related API calls will not make much sense without this background.
+
+\section oldnew Old and New Metadata Cache
+
+\subsection old The Old Metadata Cache
+
+The old metadata cache indexed the cache with a hash table with no provision for
+collisions. Instead, collisions were handled by evicting the existing entry to
+make room for the new entry. Aside from flushes, there was no other mechanism
+for evicting entries, so the replacement policy could best be described as
+"Evict on Collision".
+
+As a result, if two frequently used entries hashed to the same location, they
+would evict each other regularly. To decrease the likelihood of this situation,
+the default hash table size was set fairly large -- slightly more than
+10,000. This worked well, but since the size of metadata entries is not bounded,
+and since entries were only evicted on collision, the large hash table size
+allowed the cache size to explode when working with HDF5 files with complex
+structure.
+
+The "Evict on Collision" replacement policy also caused problems with the
+parallel version of the HDF5 library, as a collision with a dirty entry could
+force a write in response to a metadata read. Since all metadata writes must be
+collective in the parallel case while reads need not be, this could cause the
+library to hang if only some of the processes participated in a metadata read
+that forced a write. Prior to the implementation of the new metadata cache, we
+dealt with this issue by maintaining a shadow cache for dirty entries evicted by
+a read.
+
+\subsection new The New Metadata Cache
+
+The new metadata cache was designed to address the above issues. After
+implementation, it became evident that the working set size for HDF5 files
+varies widely depending on both structure and access patterns. Thus it was
+necessary to add support for cache size adjustment under either automatic or
+user program control (see section 2.3 for details).
+
+When the cache is operating under direct user program control, it is also
+possible to temporarily disable evictions from the metadata cache so as to
+maximize raw data throughput at the expense of allowing the cache to grow
+without bound until evictions are enabled again.
+
+Structurally, the new metadata cache can be thought of as a heavily modified
+version of the UNIX buffer cache as described in chapter three of M. J. Bach's
+"The Design of the UNIX Operating System" In essence, the UNIX buffer cache uses
+a hash table with chaining to index a pool of fixed-size buffers. It uses the
+LRU replacement policy to select candidates for eviction.
+
+Since HDF5 metadata entries are not of fixed size and may grow arbitrarily
+large, the size of the new metadata cache cannot be controlled by setting a
+maximum number of entries. Instead, the new cache keeps a running sum of the
+sizes of all entries and attempts to evict entries as necessary to stay within a
+user-specified maximum size. (Note the use of the word "attempts" here -- as
+will be seen, it is possible for the cache to exceed its currently specified
+maximum size.) At present, the LRU replacement policy is the only option for
+selecting candidates for eviction.
+
+Per the standard Unix buffer cache, dirty entries are given two passes through
+the LRU list before being evicted. The first time they reach the end of the LRU
+list, they are flushed, marked as clean, and moved to the head of the LRU
+list. When a clean entry reaches the end of the LRU list, it is simply evicted
+if space is needed.
+
+The cache cannot evict entries that are locked, and thus it will temporarily
+grow beyond its maximum size if there are insufficient unlocked entries
+available for eviction.
+
+In the parallel version of the library, only the cache running under process 0
+of the file communicator is allowed to write metadata to file. All the other
+caches must retain dirty metadata until the process 0 cache tells them that the
+metadata is clean.
+
+Since all operations modifying metadata must be collective, all caches see the
+same stream of dirty metadata. This fact is used to allow them to synchronize
+every n bytes of dirty metadata, where n is a user-configurable value that
+defaults to 256 KB.
+
+To avoid sending the other caches messages from the future, process 0 must not
+write any dirty entries until it reaches a synchronization point. When it
+reaches a synchronization point, it writes entries as needed, and then
+broadcasts the list of flushed entries to the other caches. The caches on the
+other processes use this list to mark entries clean before they leave the
+synchronization point, allowing them to evict those entries as needed.
+
+The caches will also synchronize on a user-initiated flush.
+
+To minimize overhead when running in parallel, the cache maintains a "clean" LRU
+list in addition to the regular LRU list. This list contains only clean entries
+and is used as a source of candidates for eviction when flushing dirty entries
+is not allowed.
+
+Since flushing entries is forbidden most of the time when running in parallel,
+the caches can be forced to exceed their maximum sizes if they run out of clean
+entries to evict.
+
+To decrease the likelihood of this event, the new cache allows the user to
+specify a minimum clean size -- which is a minimum total size of all the entries
+on the clean LRU plus all unused space in the cache.
+
+While the clean LRU list is only maintained in the parallel version of the HDF5
+library, the notion of a minimum clean size still applies in the serial
+case. Here it is used to force a mix of clean and dirty entries in the cache
+even in the write-only case.
+
+This, in turn, reduces the number of redundant flushes by avoiding the case in
+which the cache fills with dirty metadata and all entries must be flushed before
+a clean entry can be evicted to make room for a new entry.
+
+Observe that in both the serial and parallel cases, the maintenance of a minimum
+clean size modifies the replacement policy, as dirty entries may be flushed
+earlier than would otherwise be the case so as to maintain the desired amount of
+clean and/or empty space in the cache.
+
+While the new metadata cache only supports the LRU replacement policy at
+present, that may change. Support for multiple replacement policies was very
+much in mind when the cache was designed, as was the ability to switch
+replacement policies at run time. The situation has been complicated by the
+later addition of the adaptive cache resizing requirement, as two of the
+resizing algorithms piggyback on the LRU list. However, if there is a need for
+additional replacement policies, it shouldn't be too hard to implement them.
+
+\section adapt Adaptive Cache Resizing in the New Metadata Cache
+
+As mentioned earlier, the metadata working set size for an HDF5 file varies
+wildly depending on the structure of the file and the access pattern. For
+example, a 2MB limit on metadata cache size is excessive for an H5repack of
+almost all HDF5 files we have tested. However, I have a file submitted by one of
+our users that will run a 13% hit rate with this cache size and will lock up one
+of our Linux boxes using the old metadata cache. Increase the new metadata cache
+size to 4 MB, and the hit rate exceeds 99%.
+
+In this case, the main culprit is a root group with more than 20,000 entries in
+it. As a result, the root group heap exceeds 1 MB, which tends to crowd out the
+rest of the metadata in a 2 MB cache
+
+This case and a number of synthetic tests convinced us that we needed to modify
+the new metadata cache to expand and contract according to need within
+user-specified bounds.
+
+I was unable to find any previous work on this problem, so I invented solutions
+as I went along. If you are aware of prior work, please send me references. The
+closest I was able to come was a group of embedded CPU designers who were
+turning off sections of their cache to conserve power.
+
+\subsection increasing Increasing the Cache Size
+
+In the context of the HDF5 library, the problem of increasing the cache size as
+necessary to contain the current working set turns out to involve two rather
+different issues.
+
+The first of these, which was recognized immediately, is the problem of
+recognizing long term changes in working set size, and increasing the cache size
+accordingly, while not reacting to transients.
+
+The second, which I recognized the hard way, is to adjust the cache size for
+sudden, dramatic increases in working set size caused by requests for large
+pieces of metadata which may be larger than the current metadata cache size.
+
+The algorithms for handling these situations are discussed below. These problems
+are largely orthogonal to each other, so both algorithms may be used
+simultaneously.
+
+\subsubsection hrtcsi Hit Rate Threshold Cache Size Increment
+
+Perhaps the most obvious heuristic for identifying cases in which the cache is
+too small involves monitoring the hit rate. If the hit rate is low for a while,
+and the cache is at its current maximum size, the current maximum cache size is
+probably too small.
+
+The hit rate threshold algorithm for increasing cache size applies this
+intuition directly.
+
+Hit rate statistics are collected over a user-specified number of cache
+accesses. This period is known as an epoch.
+
+At the end of each epoch, the hit rate is computed, and the counters are
+reset. If the hit rate is below a user-specified threshold and the cache is at
+its current maximum size, the maximum size of the cache is increased by a
+user-specified multiple. If required, the new cache maximum size is clipped to
+stay within the user-specified upper bound on the maximum cache size, and
+optionally, within a user-specified maximum increment.
+
+My tests indicate that this algorithm works well in most cases. However, in a
+synthetic test in which hit rate increased slowly with cache size, and load
+remained steady for many epochs, I observed a case in which cache size increased
+until the hit rate just exceeded the specified minimum and then stalled. This is
+a problem, as to avoid volatility, it is necessary to set the minimum hit rate
+threshold well below the desired hit rate. Thus we may find ourselves with a
+cache running with a 91% hit rate when we really want it to increase its size
+until the hit rate is about 99%.
+
+If this case occurs frequently in actual use, I will have to come up with an
+improved algorithm. Please let me know if you see this behavior. However, I had
+to work rather hard to create it in my synthetic tests, so I would expect it to
+be uncommon.
+
+\subsubsection fcsi Flash Cache Size Increment
+
+A fundamental problem with the above algorithm is that contains the hidden
+assumption that cache entries are relatively small in comparison to the cache
+itself. While I knew this assumption was not generally true when I developed the
+algorithm, I thought that cases, where it failed, would be so rare as to not be
+worth considering, as even if they did occur, the above algorithm would rectify
+the situation within an epoch or two.
+
+While it is true that such occurrences are rare, and it is true that the hit
+rate threshold cache size increment algorithm will rectify the situation
+eventually, the performance degradation experienced by users while waiting for
+the epoch to end was so extreme that some way of accelerating response to such
+situations was essential.
+
+To understand the problem, consider the following use case:
+
+Suppose we create a group, and then repeatedly create a new data set in the
+group, write some data to it and then close it.
+
+In some versions of the HDF5 file format, the names of the datasets will be
+stored in a local heap associated with the group, and the space for that heap
+will be allocated in a single, contiguous chunk. When this local heap is full,
+we allocate a new chunk twice the size of the old, copy the data from the old
+local heap into the new, and discard the old local heap.
+
+By default, the minimum metadata cache size is set to 2 MB. Thus in this use
+case, our hit rate will be fine as long as the local heap is no larger than a
+little less than 2 MB, as the group related metadata is accessed frequently and
+never evicted, and the data set related metadata is never accessed once the data
+set is closed, and thus is evicted smoothly to make room for new data sets.
+
+All this changes abruptly when the local heap finally doubles in size to a value
+above the slightly less than 2 MB limit. All of a sudden, the local heap is the
+size of the metadata cache, and the cache must constantly swap it in to access
+it, and then swap it out to make room for other metadata.
+
+The hit rate threshold-based algorithm for increasing the cache size will fix
+this problem eventually, but performance will be very bad until it does, as the
+metadata cache will largely ineffective until its size is increased.
+
+An obvious heuristic for addressing this "big rock in a small pond" issue is to
+watch for large "incoming rocks", and increase the size of the "pond" if the
+rock is so big that it will force most of the "water" out of the "pond".
+
+The add space flash cache size increment algorithm applies this intuition
+directly:
+
+Let x be either the size of a newly inserted entry, a newly loaded entry, or the
+number of bytes by which the size of an existing entry has been increased
+(i.e. the size of the "rock").
+
+If x is greater than some user-specified fraction of the current maximum cache
+size, increase the current maximum cache size by x times some user-specified
+multiple, less any free space that was in the cache, to begin with. Further, to
+avoid confusing the other cache size increment/decrement code, start a new
+epoch.
+
+At present, this algorithm pays no attention to any user-specified limit on the
+maximum size of any single cache size increase, but it DOES stay within the
+user-specified upper bound on the maximum cache size.
+
+While it should be easy to see how this algorithm could be fooled into
+inactivity by a large number of entries that were not quite large enough to
+cross the threshold, in practice it seems to work reasonably well.
+
+Needless to say, I will revisit the issue should this cease to be the case.
+
+\subsection decreasing Decreasing the Cache Size
+
+Identifying cases in which the maximum cache size is larger than necessary
+turned out to be more difficult.
+
+\subsubsection hrtcsr Hit Rate Threshold Cache Size Reduction
+
+One obvious heuristic is to monitor the hit rate and guess that we can safely
+decrease cache size if the hit rate exceeds some user-supplied threshold (say
+.99995). The hit rate threshold size decrement algorithm implemented in the new
+metadata cache implements this intuition as follows:
+
+At the end of each epoch (this is the same epoch that is used in the cache size
+increment algorithm), the hit rate is compared with the user-specified
+threshold. If the hit rate exceeds that threshold, the current maximum cache
+size is decreased by a user-specified factor. If required, the size of the
+reduction is clipped to stay within a user-specified lower bound on the maximum
+cache size, and optionally, within a user-specified maximum decrement.
+
+In my synthetic tests, this algorithm works poorly. Even with a very high
+threshold and a small maximum reduction, it results in cache size
+oscillations. The size increment code typically increments the maximum cache
+size above the working set size. This results in a high hit rate, which causes
+the threshold size decrement code to reduce the maximum cache size below the
+working set size, which causes the hit rate to crash causing the cycle to
+repeat. The resulting average hit rate is poor.
+
+It remains to be seen if this behavior will be seen in the field. The algorithm
+is available for use, but it wouldn't be my first choice. If you use it, please
+report back.
+
+\subsubsection acsr Ageout Cache Size Reduction
+
+Another heuristic for dealing with oversized cache conditions is to look for
+entries that haven't been accessed for a long time, evict them, and reduce the
+cache size accordingly.
+
+The age out cache size reduction applies this intuition as follows: At the end
+of each epoch (again the same epoch as used in the cache size increment
+algorithm), all entries that haven't been accessed for a user-configurable
+number of epochs (1 - 10 at present) are evicted. The maximum cache size is then
+reduced to equal the sum of the sizes of the remaining entries. The size of the
+reduction is clipped to stay within a user-specified lower bound on maximum
+cache size, and optionally, within a user-specified maximum decrement.
+
+In addition, the user may specify a minimum fraction of the cache which must be
+empty before the cache size is reduced. Thus if an empty reserve of 0.1 was
+specified on a 10 MB cache, there would be no cache size reduction unless the
+eviction of aged out entries resulted in more than 1 MB of empty space. Further,
+even after the reduction, the cache would be one-tenth empty.
+
+In my synthetic tests, the age out algorithm works rather well, although it is
+somewhat sensitive to the epoch length and age out period selection.
+
+\subsubsection awhrtcsr Ageout With Hit Rate Threshold Cache Size Reduction
+
+To address these issues, I combined the hit rate threshold and age out
+heuristics.
+
+Age out with threshold works just like age out, except that the algorithm is not
+run unless the hit rate exceeded a user-specified threshold in the previous
+epoch.
+
+In my synthetic tests, age out with threshold seems to work nicely, with no
+observed oscillation. Thus I have selected it as the default cache size
+reduction algorithm.
+
+For those interested in such things, the age out algorithm is implemented by
+inserting a marker entry at the head of the LRU list at the beginning of each
+epoch. Entries that haven't been accessed for at least n epochs are simply
+entries that appear in the LRU list after the n-th marker at the end of an
+epoch.
+
+\section configuring Configuring the New Metadata Cache
+
+Due to a lack of resources, the design work on the automatic cache size
+adjustment algorithms was done hastily, using primarily synthetic tests. I don't
+think I spent more than a couple weeks writing and running performance tests --
+most time went into coding and functional testing.
+
+As a result, while I think the algorithms provided for adaptive cache resizing
+will work well in actual use, I don't really know (although preliminary results
+from the field are promising). Fortunately, the issue shouldn't arise for the
+vast majority of HDF5 users, and those for whom it may arise should be savvy
+enough to recognize problems and deal with them.
+
+For this latter class of users, I have implemented a number of new API calls
+allowing the user to select and configure the cache resize algorithms, or to
+turn them off and control cache size directly from the user program. There are
+also API calls that allow the user program to monitor hit rate and cache size.
+
+From the user perspective, all the cache configuration data for a given file is
+contained in an instance of the \ref H5AC_cache_config_t structure -- the definition
+of which is given below:
+
+\snippet H5ACpublic.h H5AC_cache_config_t_snip
+
+This structure is defined in \c H5ACpublic.h. Each field is discussed below and in
+the associated header comment.
+
+The C API allows you to get and set this structure directly. Unfortunately, the
+Fortran API has to do this with individual parameters for each of the fields
+(with the exception of version).
+
+While the API calls are discussed individually in the reference manual, the
+following high-level discussion of what fields to change for different purposes
+should be useful.
+
+\subsection gconfig General Configuration
+
+The \c version field is intended to allow \THG to change the \c
+H5AC_cache_config_t structure without breaking old code. For now, this field
+should always be set to \c H5AC__CURR_CACHE_CONFIG_VERSION, even when you are
+getting the current configuration data from the cache. The library needs the
+version number to know where fields are located with reference to the supplied
+base address.
+
+The \ref H5AC_cache_config_t.rpt_fcn_enabled "rpt_fcn_enabled" field is a
+boolean flag that allows you to turn on and off the resize reporting function
+that reports the activities of the adaptive cache resize code at the end of each
+epoch -- assuming that it is enabled.
+
+The report function is unsupported, so you are on your own if you use it. Since
+it dumps status data to stdout, you should not attempt to use it with Windows
+unless you modify the source. You may find it useful if you want to experiment
+with different adaptive resize configurations. It is also a convenient way of
+diagnosing poor cache configuration. Finally, if you do lots of runs with
+identical behavior, you can use it to determine the metadata cache size needed
+in each phase of your program so you can set the required cache sizes manually.
+
+The trace file fields are also unsupported. They allow one to open and close a
+trace file in which all calls to the metadata cache are logged in a
+user-specified file for later analysis. The feature is intended primarily for
+THG use in debugging or optimizing the metadata cache in cases where users in
+the field observe obscure failures or poor performance that we cannot re-create
+in the lab. The trace file will allow us to re-create the exact sequence of
+cache operations that are triggering the problem.
+
+At present we do not have a playback utility for trace files, although I imagine
+that we will write one quickly when and if we need it.
+
+To enable the trace file, you load the full path of the desired trace file into
+\ref H5AC_cache_config_t.trace_file_name "trace_file_name", and set \ref
+H5AC_cache_config_t.open_trace_file "open_trace_file" to \c TRUE. In the
+parallel case, an ASCII representation of the rank of each process is appended
+to the supplied trace file name to create a unique trace file name for that
+process.
+
+To close an open trace file, set \ref H5AC_cache_config_t.close_trace_file
+"close_trace_file" to \c TRUE.
+
+It must be emphasized that you are on your own if you play with the trace file
+feature absent a request from \THG. Needless to say, the trace file feature is
+disabled by default. If you enable it, you will take a large performance hit and
+generate huge trace files.
+
+The \ref H5AC_cache_config_t.evictions_enabled "evictions_enabled" field is a
+boolean flag allowing the user to disable the eviction of entries from the
+metadata cache. Under normal operation conditions, this field will always be set
+to \c TRUE.
+
+In rare circumstances, the raw data throughput requirements may be so high that
+the user wishes to postpone metadata writes so as to reserve I/O throughput for
+raw data. The \ref H5AC_cache_config_t.evictions_enabled "evictions_enabled"
+field exists to allow this -- although the user is to be warned that the
+metadata cache will grow without bound while evictions are disabled. Thus
+evictions should be re-enabled as soon as possible, and it may be wise to
+monitor cache size and statistics (to see how to enable statistics, see the
+debugging facilities section below).
+
+Evictions may only be disabled when the automatic cache resize code is disabled
+as well. Thus to disable evictions, not only must the user set the \ref
+H5AC_cache_config_t.evictions_enabled "evictions_enabled" field to \c FALSE, but
+he must also set \ref H5AC_cache_config_t.incr_mode "incr_mode" to
+#H5C_incr__off, set \ref H5AC_cache_config_t.flash_incr_mode "flash_incr_mode"
+to #H5C_flash_incr__off, and set \ref H5AC_cache_config_t.decr_mode "decr_mode"
+to #H5C_decr__off.
+
+To re-enable evictions, just set \ref H5AC_cache_config_t.evictions_enabled
+"evictions_enabled" back to \c TRUE.
+
+Before passing on to other subjects, it is worth re-iterating that disabling
+evictions is an extreme step. Before attempting it, you might consider setting a
+large cache size manually, and flushing the cache just before high raw data
+throughput is required. This may yield the desired results without the risks
+inherent in disabling evictions.
+
+The \ref H5AC_cache_config_t.set_initial_size "set_initial_size" and \ref
+H5AC_cache_config_t.initial_size "initial_size" fields allow you to specify an
+initial maximum cache size. If \ref H5AC_cache_config_t.set_initial_size
+"set_initial_size" is \c TRUE, \ref H5AC_cache_config_t.initial_size
+"initial_size" must lie in the interval [\ref H5AC_cache_config_t.min_size
+"min_size", \ref H5AC_cache_config_t.max_size "max_size"] (see below for a
+discussion of the \ref H5AC_cache_config_t.min_size "min_size" and \ref
+H5AC_cache_config_t.max_size "max_size" fields).
+
+If you disable the adaptive cache resizing code (done by setting \ref
+H5AC_cache_config_t.incr_mode "incr_mode" to #H5C_incr__off, \ref
+H5AC_cache_config_t.flash_incr_mode "flash_incr_mode" to #H5C_flash_incr__off,
+and \ref H5AC_cache_config_t.decr_mode "decr_mode" to #H5C_decr__off), you can
+use these fields to control maximum cache size manually, as the maximum cache
+size will remain at the initial size.
+
+Note, that the maximum cache size is only modified when \ref
+H5AC_cache_config_t.set_initial_size "set_initial_size" is \c TRUE. This allows
+the use of configurations specified at compile time to change resize
+configuration without altering the current maximum size of the cache. Without
+this feature, an additional call would be required to get the current maximum
+cache size so as to set the \ref H5AC_cache_config_t.initial_size "initial_size"
+to the current maximum cache size, and thereby avoid changing it.
+
+The \ref H5AC_cache_config_t.min_clean_fraction "min_clean_fraction" sets the
+current minimum clean size as a fraction of the current max cache size. While
+this field was originally used only in the parallel version of the library, it
+now applies to the serial version as well. Its value must lie in the range
+\Code{[0.0, 1.0]}. 0.01 is reasonable in the serial case, and 0.3 in the
+parallel.
+
+A potential interaction, discovered at release 1.8.3, between the enforcement of
+the \ref H5AC_cache_config_t.min_clean_fraction "min_clean_fraction" and the
+adaptive cache resize code can severely degrade performance. While this
+interaction is easily dealt with in the serial case by setting \ref
+H5AC_cache_config_t.min_clean_fraction "min_clean_fraction" to 0.01, the problem
+is more difficult in the parallel case. Please see the Interactions section
+below for further details.
+
+The \ref H5AC_cache_config_t.max_size "max_size" and \ref
+H5AC_cache_config_t.min_size "min_size" fields specify the range of maximum
+sizes that may be set for the cache by the automatic resize code. \ref
+H5AC_cache_config_t.min_size "min_size" must be less than or equal to
+\ref H5AC_cache_config_t.max_size "max_size", and both must lie in the range
+\Code{[H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE]} -- currently [1 KB,
+128 MB]. If you routinely run a cache size in the top half of this range, you
+should increase the hash table size. To do this, modify the \c
+H5C__HASH_TABLE_LEN \Code{\#define} in \c H5Cpkg.h and re-compile. At present,
+\c H5C__HASH_TABLE_LEN must be a power of two.
+
+The \c epoch_length is the number of cache accesses between runs of the adaptive
+cache size control algorithms. It is ignored if these algorithms are turned
+off. It must lie in the range \Code{[H5C__MIN_AR_EPOCH_LENGTH,
+H5C__MAX_AR_EPOCH_LENGTH]} -- currently [100, 1000000]. The above constants are
+defined in \c H5Cprivate.h. 50000 is a reasonable value.
+
+\subsection increment Increment Configuration
+
+The \ref H5AC_cache_config_t.incr_mode "incr_mode" field specifies the cache
+size increment algorithm used. Its value must be a member of the \ref
+H5C_cache_incr_mode enum type -- currently either #H5C_incr__off or
+#H5C_incr__threshold (note the double underscores after \c "incr"). This type is
+defined in H5Cpublic.h.
+
+If \ref H5AC_cache_config_t.incr_mode "incr_mode" is set to #H5C_incr__off,
+regular automatic cache size increases are disabled, and the \ref
+H5AC_cache_config_t.lower_hr_threshold "lower_hr_threshold", \ref
+H5AC_cache_config_t.increment "increment", \ref
+H5AC_cache_config_t.apply_max_increment "apply_max_increment", and \ref
+H5AC_cache_config_t.max_increment "max_increment", fields are ignored.
+
+The \ref H5AC_cache_config_t.flash_incr_mode "flash_incr_mode" field specifies
+the flash cache size increment algorithm used. Its value must be a member of the
+\ref H5C_cache_flash_incr_mode enum type -- currently either
+#H5C_flash_incr__off or #H5C_flash_incr__add_space (note the double underscores
+after \c "incr"). This type is defined in H5Cpublic.h.
+
+If \ref H5AC_cache_config_t.flash_incr_mode "flash_incr_mode" is set to
+#H5C_flash_incr__off, flash cache size increases are disabled, and the \ref
+H5AC_cache_config_t.flash_multiple "flash_multiple", and \ref
+H5AC_cache_config_t.flash_threshold "flash_threshold", fields are ignored.
+
+\subsubsection hrtcsic Hit Rate Threshold Cache Size Increase Configuration
+
+If \ref H5AC_cache_config_t.incr_mode "incr_mode" is #H5C_incr__threshold, the
+cache size is increased via the hit rate threshold algorithm. The remaining
+fields in the section are then used as follows:
+
+\ref H5AC_cache_config_t.lower_hr_threshold "lower_hr_threshold" is the
+threshold below which the hit rate must fall to trigger an increase. The value
+must lie in the range \Code{[0.0 - 1.0]}. In my tests, a relatively high value
+seems to work best -- 0.9 for example.
+
+\ref H5AC_cache_config_t.increment "increment" is the factor by which the old
+maximum cache size is multiplied to obtain an initial new maximum cache size
+when an increment is needed. The actual change in size may be smaller as
+required by \ref H5AC_cache_config_t.max_size "max_size" (above) and \c
+max_increment (discussed below). increment must be greater than or equal to
+1.0. If you set it to 1.0, you will effectively turn off the increment code. 2.0
+is a reasonable value.
+
+\ref H5AC_cache_config_t.apply_max_increment "apply_max_increment" and \ref
+H5AC_cache_config_t.max_increment "max_increment" allow the user to specify a
+maximum increment. If \ref H5AC_cache_config_t.apply_max_increment
+"apply_max_increment" is \c TRUE, the cache size will never be increased by more
+than the number of bytes specified in \ref H5AC_cache_config_t.max_increment
+"max_increment" in any single increase.
+
+\subsubsection fcsic Flash Cache Size Increase Configuration
+
+If \ref H5AC_cache_config_t.flash_incr_mode "flash_incr_mode" is set to
+#H5C_flash_incr__add_space, flash cache size increases are enabled. The size of
+the cache will be increased under the following circumstances:
+
+Let \c t be the current maximum cache size times the value of the \ref
+H5AC_cache_config_t.flash_threshold "flash_threshold" field.
+
+Let \c x be either the size of the newly inserted entry, the size of the newly
+loaded entry, or the number of bytes added to the size of the entry under
+consideration for triggering a flash cache size increase.
+
+If \Code{t < x}, the basic condition for a flash cache size increase is met, and
+we proceed as follows:
+
+Let \c space_needed equal \c x less the amount of free space in the cache.
+
+Further, let \ref H5AC_cache_config_t.increment "increment" equal \c
+space_needed times the value of the \ref H5AC_cache_config_t.flash_multiple
+"flash_multiple" field. If \ref H5AC_cache_config_t.increment "increment" plus
+the current cache size is greater than \ref H5AC_cache_config_t.max_size
+"max_size" (discussed above), reduce \ref H5AC_cache_config_t.increment
+"increment" so that \ref H5AC_cache_config_t.increment "increment" plus the
+current cache size is equal to \ref H5AC_cache_config_t.max_size "max_size".
+
+If the increment is greater than zero, increase the current cache size by \ref
+H5AC_cache_config_t.increment "increment". To avoid confusing the other cache
+size increment or decrement algorithms, start a new epoch. Note, however, that
+we do not cycle the epoch markers if some variant of the age out algorithm is in
+use.
+
+The use of the \ref H5AC_cache_config_t.flash_threshold "flash_threshold" field
+is discussed above. It must be a floating-point value in the range of
+\Code{[0.1, 1.0]}. 0.25 is a reasonable value.
+
+The use of the \ref H5AC_cache_config_t.flash_multiple "flash_multiple" field is
+also discussed above. It must be a floating-point value in the range of
+\Code{[0.1, 10.0]}. 1.4 is a reasonable value.
+
+\subsection decrement Decrement Configuration
+
+The \ref H5AC_cache_config_t.decr_mode "decr_mode" field specifies the cache
+size decrement algorithm used. Its value must be a member of the \ref
+H5C_cache_decr_mode enum type -- currently either #H5C_decr__off,
+#H5C_decr__threshold, #H5C_decr__age_out, or #H5C_decr__age_out_with_threshold
+(note the double underscores after \c "decr"). This type is defined in
+H5Cpublic.h.
+
+If \ref H5AC_cache_config_t.decr_mode "decr_mode" is set to #H5C_decr__off,
+automatic cache size decreases are disabled, and the remaining fields in the
+cache size decrease control section are ignored.
+
+\subsubsection hrtcsdc Hit Rate Threshold Cache Size Decrease Configuration
+
+If \ref H5AC_cache_config_t.decr_mode "decr_mode" is #H5C_decr__threshold, the
+cache size is decreased by the threshold algorithm, and the remaining fields of
+the decrement section are used as follows:
+
+\ref H5AC_cache_config_t.upper_hr_threshold "upper_hr_threshold" is the
+threshold above which the hit rate must rise to trigger cache size reduction. It
+must be in the range \Code{[0.0, 1.0]}. In my synthetic tests, very high values
+like .9995 or .99995 seemed to work best.
+
+\ref H5AC_cache_config_t.decrement "decrement" is the factor by which the
+current maximum cache size is multiplied to obtain a tentative new maximum cache
+size. It must lie in the range \Code{[0.0, 1.0]}. Relatively large values like
+.9 seem to work best in my synthetic tests. Note that the actual size reduction
+may be smaller as required by \ref H5AC_cache_config_t.min_size "min_size" and
+\ref H5AC_cache_config_t.max_decrement "max_decrement" (discussed below). \ref
+H5AC_cache_config_t.apply_max_decrement "apply_max_decrement" and \ref
+H5AC_cache_config_t.max_decrement "max_decrement" allow the user to specify a
+maximum decrement. If \ref H5AC_cache_config_t.apply_max_decrement
+"apply_max_decrement" is \c TRUE, the cache size will never be reduced by more
+than \ref H5AC_cache_config_t.max_decrement "max_decrement" bytes in any single
+reduction.
+
+With the hit rate threshold cache size decrement algorithm, the remaining fields
+in the section are ignored.
+
+\subsubsection dacsr Ageout Cache Size Reduction
+
+If \ref H5AC_cache_config_t.decr_mode "decr_mode" is #H5C_decr__age_out the
+cache size is decreased by the ageout algorithm, and the remaining fields of the
+decrement section are used as follows:
+
+\ref H5AC_cache_config_t.epochs_before_eviction "epochs_before_eviction" is the
+number of epochs an entry must reside unaccessed in the cache before it is
+evicted. This value must lie in the range \Code{[1, H5C__MAX_EPOCH_MARKERS]}. \c
+H5C__MAX_EPOCH_MARKERS is defined in H5Cprivate.h, and is currently set to 10.
+
+\ref H5AC_cache_config_t.apply_max_decrement "apply_max_decrement" and \ref
+H5AC_cache_config_t.max_decrement "max_decrement" are used as in section
+2.4.3.1.
+
+\ref H5AC_cache_config_t.apply_empty_reserve "apply_emty_reserve" and \ref
+H5AC_cache_config_t.empty_reserve "empty_reserve" allow the user to specify a
+minimum empty reserve as discussed in section 2.3.2.2. An empty reserve of 0.05
+or 0.1 seems to work well.
+
+The \ref H5AC_cache_config_t.decrement "decrement" and \ref
+H5AC_cache_config_t.upper_hr_threshold "upper_hr_threshold" fields are ignored
+in this case.
+
+\subsubsection dawhrtcsr Ageout With Hit Rate Threshold Cache Size Reduction
+
+If \ref H5AC_cache_config_t.decr_mode "decr_mode" is
+#H5C_decr__age_out_with_threshold, the cache size is decreased by the ageout
+with hit rate threshold algorithm, and the fields of decrement section are used
+as per the Ageout algorithm (see 5.3.2) with the exception of \ref
+H5AC_cache_config_t.upper_hr_threshold "upper_hr_threshold".
+
+Here, \ref H5AC_cache_config_t.upper_hr_threshold "upper_hr_threshold" is the
+threshold above which the hit rate must rise to trigger cache size reduction. It
+must be in the range \Code{[0.0, 1.0]}. In my synthetic tests, high values like
+.999 seemed to work well.
+
+\subsection parallel Parallel Configuration
+
+This section is a catch-all for parallel specific configuration data. At
+present, it has only one field --
+\ref H5AC_cache_config_t.dirty_bytes_threshold "dirty_bytes_threshold".
+
+In PHDF5, all operations that modify metadata must be executed collectively. We
+used to think that this was enough to ensure consistency across the metadata
+caches, but since we allow processes to read metadata individually, the order of
+dirty entries in the LRU list can vary across processes. This, in turn, can
+change the order in which dirty metadata cache entries reach the bottom of the
+LRU and are flushed to disk -- opening the door to messages from the past and
+messages from the future bugs.
+
+To prevent this, only the metadata cache on process 0 of the file communicator
+is allowed to write to file, and then only after entering a sync point with the
+other caches. After it writes entries to file, it sends the base addresses of
+the now clean entries to the other caches, so they can mark these entries clean
+as well, and then leaves the sync point. The other caches mark the specified
+entries as clean before they leave the synch point as well. (Observe, that since
+all caches see the same stream of dirty metadata, they will all have the same
+set of dirty entries upon sync point entry and exit.)
+
+The different caches know when to synchronize by counting the number of bytes of
+dirty metadata created by the collective operations modifying metadata. Whenever
+this count exceeds the value specified in the \ref
+H5AC_cache_config_t.dirty_bytes_threshold "dirty_bytes_threshold", they all
+enter the sync point, and process 0 flushes down to its minimum clean size and
+sends the list of newly cleaned entries to the other caches.
+
+Needless to say, the value of the \ref H5AC_cache_config_t.dirty_bytes_threshold
+"dirty_bytes_threshold" field must be consistent across all the caches operating
+on a given file.
+
+All dirty metadata can also by flushed under programmatic control via the
+H5Fflush() call. This call must be collective and will reset the dirty data
+counts on each metadata cache.
+
+Absent calls to H5Fflush(), dirty metadata will only be flushed when the \ref
+H5AC_cache_config_t.dirty_bytes_threshold "dirty_bytes_threshold" is exceeded,
+and then only down to the H5AC_cache_config_t.min_clean_fraction
+"min_clean_fraction". Thus, if a program does all its metadata modifications in
+one phase, and then doesn't modify metadata thereafter, a residue of dirty
+metadata will be frozen in the metadata caches for the remainder of the
+computation -- effectively reducing the sizes of the caches.
+
+In the default configuration, the caches will eventually resize themselves to
+maintain an acceptable hit rate. However, this will take time, and it will
+increase the application's footprint in memory.
+
+If your application behaves in this manner, you can avoid this by a collective
+call to H5Fflush() immediately after the metadata modification phase.
+
+\subsection interactions Interactions
+
+Evictions may not be disabled unless the automatic cache resize code is disabled
+as well (by setting \ref H5AC_cache_config_t.decr_mode "decr_mode" to
+#H5C_decr__off, \c flash_decr_mode to #H5C_flash_incr__add_space, and \ref
+H5AC_cache_config_t.incr_mode "incr_mode" to #H5C_incr__off) -- thus placing the
+cache size under the direct control of the user program.
+
+There is no logical necessity for this restriction. It is imposed because it
+simplifies testing greatly and because I can't see any reason why one would want
+to disable evictions while the automatic cache size adjustment code was
+enabled. This restriction can be relaxed if anyone can come up with a good
+reason to do so.
+
+At present, there are two interactions between the increment and decrement
+sections of the configuration.
+
+If \ref H5AC_cache_config_t.incr_mode "incr_mode" is #H5C_incr__threshold, and
+\ref H5AC_cache_config_t.decr_mode "decr_mode" is either #H5C_decr__threshold or
+#H5C_decr__age_out_with_threshold, then \ref
+H5AC_cache_config_t.lower_hr_threshold "lower_hr_threshold" must be strictly
+less than \ref H5AC_cache_config_t.upper_hr_threshold "upper_hr_threshold".
+
+Also, if the flash cache size increment code is enabled and is triggered, it
+will restart the current epoch without calling any other cache size increment or
+decrement code.
+
+In both the serial and parallel cases, there is the potential for an interaction
+between the \ref H5AC_cache_config_t.min_clean_fraction "min_clean_fraction" and
+the cache size increment code that can severely degrade
+performance. Specifically, if the \ref H5AC_cache_config_t.min_clean_fraction
+"min_clean_fraction" is large enough, it is possible that keeping the specified
+fraction of the cache clean may generate enough flushes to seriously degrade
+performance even though the hit rate is excellent.
+
+In the serial case, this is easily dealt with by selecting a very small \ref
+H5AC_cache_config_t.min_clean_fraction "min_clean_fraction" -- 0.01 for example
+-- as this still avoids the "metadata blizzard" phenomenon that appears when the
+cache fills with dirty metadata and must then flush all of it before evicting an
+entry to make space for a new entry.
+
+The problem is more difficult in the parallel case, as the \ref
+H5AC_cache_config_t.min_clean_fraction "min_clean_fraction" is used to ensure
+that the cache contains clean entries that can be evicted to make space for new
+entries when metadata writes are forbidden -- i.e. between sync points.
+
+This issue was discovered shortly before release 1.8.3 and an automated solution
+has not been implemented. Should it become an issue for an application, try
+manually setting the cache size to ~1.5 times the maximum working set size for
+the application, and leave \ref H5AC_cache_config_t.min_clean_fraction
+"min_clean_fraction" set to 0.3.
+
+You can approximate the working set size of your application via repeated calls
+to H5Fget_mdc_size() and H5Fget_mdc_hit_rate() while running your program with
+the cache resize code enabled. The maximum value returned by H5Fget_mdc_size()
+should be a reasonable approximation -- particularly if the associated hit rate
+is good. In the parallel case, there is also an interaction between \c
+min_clean_fraction and \ref H5AC_cache_config_t.dirty_bytes_threshold
+"dirty_bytes_threshold". Absent calls to H5Fflush() (discussed above), the upper
+bound on the amount of dirty data in the metadata caches will oscillate between
+(1 - \ref H5AC_cache_config_t.min_clean_fraction "min_clean_fraction") times
+current maximum cache size, and that value plus the \ref
+H5AC_cache_config_t.dirty_bytes_threshold "dirty_bytes_threshold". Needless to
+say, it will be best if the \ref H5AC_cache_config_t.min_size "min_size", \ref
+H5AC_cache_config_t.min_clean_fraction "min_clean_fraction", and the \ref
+H5AC_cache_config_t.dirty_bytes_threshold "dirty_bytes_threshold"
+are chosen so that the cache can't fill with dirty data.
+
+\subsection defaults Default Metadata Cache Configuration
+
+Starting with release 1.8.3, HDF5 provides different default metadata cache
+configurations depending on whether the library is compiled for serial or
+parallel.
+
+The default configuration for the serial case is as follows:
+
+\code{.c}
+{
+ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
+ /* hbool_t rpt_fcn_enabled = */ FALSE,
+ /* hbool_t open_trace_file = */ FALSE,
+ /* hbool_t close_trace_file = */ FALSE,
+ /* char trace_file_name[] = */ "",
+ /* hbool_t evictions_enabled = */ TRUE,
+ /* hbool_t set_initial_size = */ TRUE,
+ /* size_t initial_size = */ ( 2 * 1024 * 1024),
+ /* double min_clean_fraction = */ 0.01,
+ /* size_t max_size = */ (32 * 1024 * 1024),
+ /* size_t min_size = */ ( 1 * 1024 * 1024),
+ /* long int epoch_length = */ 50000,
+ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
+ /* hbool_t apply_max_increment = */ TRUE,
+ /* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__add_space,
+ /* double flash_multiple = */ 1.4,
+ /* double flash_threshold = */ 0.25,
+ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
+ /* hbool_t apply_max_decrement = */ TRUE,
+ /* size_t max_decrement = */ (1 * 1024 * 1024),
+ /* int epochs_before_eviction = */ 3,
+ /* hbool_t apply_empty_reserve = */ TRUE,
+ /* double empty_reserve = */ 0.1,
+ /* int dirty_bytes_threshold = */ (256 * 1024)
+}
+\endcode
+
+The default configuration for the parallel case is as follows:
+
+\code{.c}
+{
+ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
+ /* hbool_t rpt_fcn_enabled = */ FALSE,
+ /* hbool_t open_trace_file = */ FALSE,
+ /* hbool_t close_trace_file = */ FALSE,
+ /* char trace_file_name[] = */ "",
+ /* hbool_t evictions_enabled = */ TRUE,
+ /* hbool_t set_initial_size = */ TRUE,
+ /* size_t initial_size = */ ( 2 * 1024 * 1024),
+ /* double min_clean_fraction = */ 0.3,
+ /* size_t max_size = */ (32 * 1024 * 1024),
+ /* size_t min_size = */ ( 1 * 1024 * 1024),
+ /* long int epoch_length = */ 50000,
+ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
+ /* hbool_t apply_max_increment = */ TRUE,
+ /* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__add_space,
+ /* double flash_multiple = */ 1.0,
+ /* double flash_threshold = */ 0.25,
+ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
+ /* hbool_t apply_max_decrement = */ TRUE,
+ /* size_t max_decrement = */ (1 * 1024 * 1024),
+ /* int epochs_before_eviction = */ 3,
+ /* hbool_t apply_empty_reserve = */ TRUE,
+ /* double empty_reserve = */ 0.1,
+ /* int dirty_bytes_threshold = */ (256 * 1024)
+}
+\endcode
+
+The default serial configuration should be adequate for most serial HDF5 users.
+
+The same may not be true for the default parallel configuration due to the
+interaction between the \ref H5AC_cache_config_t.min_clean_fraction "min_clean_fraction" and the cache size increase code. See
+the Interactions section for further details.
+
+Should you need to change the default configuration, it can be found in
+H5ACprivate.h. Look for the definition of H5AC__DEFAULT_RESIZE_CONFIG.
+
+\section controlling Controlling the New Metadata Cache Size From Your Program
+
+You have already seen how \ref H5AC_cache_config_t has facilities that allow you
+to control the metadata cache size directly. Use H5Fget_mdc_config() and
+H5Fset_mdc_config() to get and set the metadata cache configuration on an open
+file. Use H5Pget_mdc_config() and H5Pset_mdc_config() to get and set the initial
+metadata cache configuration in a file access property list. Recall that this
+list contains configuration data used when opening a file.
+
+Use H5Fget_mdc_hit_rate() to get the average hit rate since the last time the
+hit rate stats were reset. This happens automatically at the beginning of each
+epoch if the adaptive cache resize code is enabled. You can also do it manually
+with H5Freset_mdc_hit_rate_stats(). Be careful about doing this if the adaptive
+cache resize code is enabled, as you may confuse it.
+
+Use H5Fget_mdc_size() to get metadata cache size data on an open file.
+
+Finally, note that cache size and cache footprint are two different things -- in
+my tests, the cache footprint (as inferred from the UNIX \c top command) is
+typically about three times the maximum cache size. I haven't tracked it down
+yet, but I would guess that most of this is due to the very small typical cache
+entry size combined with the rather large size of the cache entry header
+structure. This should be investigated further, but there are other matters of
+higher priority.
+
+\section news New Metadata Cache Debugging Facilities
+
+The new metadata cache has a variety of debugging facilities that may be of
+use. I doubt that any other than the report function and the trace file will
+ever be accessible via the API, but they are relatively easy to turn on in the
+source code.
+
+Note that none of this should be viewed as supported -- it is described here on
+the off chance that you want to use it, but you are on your own if you do. Also,
+there are no promises as to consistency between versions.
+
+As mentioned above, you can use the \ref H5AC_cache_config_t.rpt_fcn_enabled "rpt_fcn_enabled" field of the
+configuration structure to enable the default reporting function
+(H5C_def_auto_resize_rpt_fcn() in H5C.c). If this function doesn't work for you,
+you will have to write your own. In particular, remember that it uses \c stdout,
+so it will probably be unhappy under Windows.
+
+Again, remember that this facility is not supported. Further, it is likely to
+change every time I do any serious work on the cache.
+
+There is also an extensive statistics collection code. Use
+H5C_COLLECT_CACHE_STATS and H5C_COLLECT_CACHE_ENTRY_STATS in H5Cprivate.h to
+turn this on. If you also turn on H5AC_DUMP_STATS_ON_CLOSE in H5ACprivate.h,
+stats will be dumped when you close a file. Alternatively you can call
+H5C_stats() and H5C_stats__reset() within the library to dump and reset
+stats. Both of these functions are defined in H5C.c.
+
+Finally, the cache also contains an extensive sanity checking code. Much of this
+is turned on when you compile in debug mode, but to enable the full suite, turn
+on H5C_DO_SANITY_CHECKS in H5Cprivate.h.
+
+\section trouble Trouble Shooting
+
+Absent major bugs in the cache, the only troubleshooting you should have to do
+is diagnosing and fixing problems with your cache configuration.
+
+Assuming it runs on your platform (I've only used it under Linux), the reporting
+function is probably the most convenient diagnosis tool. However, since it is
+unsupported code, I will not discuss it further beyond directing you to the
+source (H5C_def_auto_resize_rpt_fcn() in H5C.c).
+
+Absent the reporting function, regular calls to H5Fget_mdc_hit_rate() should
+give you a good idea of the hit rate over time. Remember that the hit rate stats
+are reset at the end of each epoch (when adaptive cache resizing is enabled), so
+you should expect some jitter.
+
+Similar calls to H5Fget_mdc_size() should allow you to monitor cache size and
+the fraction of the current maximum cache size that is actually in use.
+
+If the hit rate is consistently low, and the cache it at its current maximum
+size, increasing the maximum size is an obvious fix.
+
+If you see hit rate and cache size oscillations, try disabling adaptive cache
+resizing and setting a fixed cache size a bit greater than the high end of the
+cache size oscillations you observed.
+
+If the hit rate oscillations don't go away, you are probably looking at a
+feature of your application that can't be helped without major changes to the
+cache. Please send along a description of the situation.
+
+If the oscillations do go away, you may be able to come up with a configuration
+that deals with the situation. If that fails, control the cache size manually,
+and write to me, so I can try to develop an adaptive resize algorithm that works
+in your case.
+
+Needless to say, you should give the cache a few epochs to adapt to
+circumstances. If that is too slow for you, try manual cache size control.
+
+If you find it necessary to disable evictions, you may find it useful to enable
+the internal statistics collection code mentioned above in the section on
+debugging facilities.
+
+Amongst many other things, the stats code will report the maximum cache size,
+and the average successful and unsuccessful search depths in the hash table. If
+these latter figures are significantly above 1, you should increase the size of
+the hash table.
+
+ */ \ No newline at end of file
diff --git a/doxygen/dox/OtherSpecs.dox b/doxygen/dox/OtherSpecs.dox
new file mode 100644
index 0000000..e53f26e
--- /dev/null
+++ b/doxygen/dox/OtherSpecs.dox
@@ -0,0 +1,11 @@
+/** \page IMG HDF5 Image and Palette Specification Version 1.2
+
+\htmlinclude ImageSpec.html
+
+*/
+
+/** \page TBL HDF5 Table Specification Version 1.0
+
+\htmlinclude TableSpec.html
+
+*/
diff --git a/doxygen/dox/Overview.dox b/doxygen/dox/Overview.dox
new file mode 100644
index 0000000..754722e
--- /dev/null
+++ b/doxygen/dox/Overview.dox
@@ -0,0 +1,32 @@
+
+/** \mainpage notitle
+
+This is the documentation set for HDF5. You can
+<a href="hdf5-doc.tgz">download</a> it as a tgz archive for offline reading.
+
+This is the documention set for HDF5 in terms of specifications and software
+developed and maintained by <a href="https://www.hdfgroup.org/">The HDF
+Group</a>. It is impractical to document the entire HDF5 ecosystem in one place,
+and you should also consult the documentation sets of the many outstanding
+community projects.
+
+For a first contact with HDF5, the best place is to have a look at the \link
+GettingStarted getting started \endlink page that shows you how to write and
+compile your first program with HDF5.
+
+The \b main \b documentation is organized by documentation flavor. Most
+technical documentation consists to varying degrees of information related to
+<em>tasks</em>, <em>concepts</em>, or <em>reference</em> material. As its title
+suggests, the \link RM Reference Manual \endlink is 100% reference material,
+while the \link Cookbook \endlink is focused on tasks. The different guide-type
+documents cover a mix of tasks, concepts, and reference, to help a certain
+<em>audience</em> succeed.
+
+Finally, do not miss the search engine (top right-hand corner)! If you are
+looking for a specific function, it'll take you there directly. If unsure, it'll
+give you an idea of what's on offer and a few promising leads.
+
+\par ToDo List
+ There is plenty of <a href="./todo.html">unfinished business</a>.
+
+*/
diff --git a/doxygen/dox/RFC.dox b/doxygen/dox/RFC.dox
new file mode 100644
index 0000000..c16dcea
--- /dev/null
+++ b/doxygen/dox/RFC.dox
@@ -0,0 +1,91 @@
+/** \page RFC RFCs
+
+<table>
+<tr><th>RFC ID</th><th>Title</th><th>Comments</th></tr>
+<tr> <td>2021-05-28</td> <td>\ref_rfc20210528</td> <td></td></tr>
+<tr> <td>2019-09-23</td> <td>\ref_rfc20190923</td> <td></td></tr>
+<tr> <td>2019-04-10</td> <td>\ref_rfc20190410</td> <td></td> </tr>
+<tr> <td>2018-12-31</td> <td>\ref_rfc20181231</td> <td></td> </tr>
+<tr> <td>2018-12-20</td> <td>\ref_rfc20181220</td> <td></td> </tr>
+<tr> <td>2018-06-20</td> <td>\ref_rfc20180620</td> <td></td> </tr>
+<tr> <td>2018-06-10</td> <td>\ref_rfc20180610</td> <td></td> </tr>
+<tr> <td>2018-03-21</td> <td>\ref_rfc20180321</td> <td></td> </tr>
+<tr> <td>2018-01-25</td> <td>\ref_rfc20180125</td> <td></td> </tr>
+<tr> <td>2017-07-07</td> <td>\ref_rfc20170707</td> <td></td> </tr>
+<tr> <td>2016-01-05</td> <td>\ref_rfc20160105</td> <td></td> </tr>
+<tr> <td>2015-09-15</td> <td>\ref_rfc20150915</td> <td></td> </tr>
+<tr> <td>2015-07-09</td> <td>\ref_rfc20150709</td> <td></td> </tr>
+<tr> <td>2015-06-15</td> <td>\ref_rfc20150615</td> <td></td> </tr>
+<tr> <td>2015-04-29</td> <td>\ref_rfc20150429</td> <td></td> </tr>
+<tr> <td>2015-04-24</td> <td>\ref_rfc20150424</td> <td></td> </tr>
+<tr> <td>2015-04-23</td> <td>\ref_rfc20150423</td> <td></td> </tr>
+<tr> <td>2015-03-01</td> <td>\ref_rfc20150301</td> <td></td> </tr>
+<tr> <td>2015-02-12</td> <td>\ref_rfc20150212</td> <td></td> </tr>
+<tr> <td>2015-02-05</td> <td>\ref_rfc20150205</td> <td></td> </tr>
+<tr> <td>2015-02-02</td> <td>\ref_rfc20150202</td> <td></td> </tr>
+<tr> <td>2014-12-10</td> <td>\ref_rfc20141210</td> <td></td> </tr>
+<tr> <td>2014-12-01</td> <td>\ref_rfc20141201</td> <td></td> </tr>
+<tr> <td>2014-09-16</td> <td>\ref_rfc20140916</td> <td></td> </tr>
+<tr> <td>2014-08-27</td> <td>\ref_rfc20140827</td> <td></td> </tr>
+<tr> <td>2014-07-29</td> <td>\ref_rfc20140729</td> <td></td> </tr>
+<tr> <td>2014-07-22</td> <td>\ref_rfc20140722</td> <td></td> </tr>
+<tr> <td>2014-07-17</td> <td>\ref_rfc20140717</td> <td></td> </tr>
+<tr> <td>2014-07-07</td> <td>\ref_rfc20140707</td> <td></td> </tr>
+<tr> <td>2014-05-24</td> <td>\ref_rfc20140524</td> <td></td> </tr>
+<tr> <td>2014-03-18</td> <td>\ref_rfc20140318</td> <td></td> </tr>
+<tr> <td>2014-03-13</td> <td>\ref_rfc20140313</td> <td></td> </tr>
+<tr> <td>2014-02-24</td> <td>\ref_rfc20140224</td> <td></td> </tr>
+<tr> <td>2013-12-11</td> <td>\ref_rfc20131211</td> <td></td> </tr>
+<tr> <td>2013-09-30</td> <td>\ref_rfc20130930</td> <td></td> </tr>
+<tr> <td>2013-09-19</td> <td>\ref_rfc20130919</td> <td></td> </tr>
+<tr> <td>2013-06-30</td> <td>\ref_rfc20130630</td> <td></td> </tr>
+<tr> <td>2013-03-16</td> <td>\ref_rfc20130316</td> <td></td> </tr>
+<tr> <td>2012-11-14</td> <td>\ref_rfc20121114</td> <td></td> </tr>
+<tr> <td>2012-10-24</td> <td>\ref_rfc20121024</td> <td></td> </tr>
+<tr> <td>2012-08-28</td> <td>\ref_rfc20120828</td> <td></td> </tr>
+<tr> <td>2012-05-23</td> <td>\ref_rfc20120523</td> <td></td> </tr>
+<tr> <td>2012-05-01</td> <td>\ref_rfc20120501</td> <td></td> </tr>
+<tr> <td>2012-03-05</td> <td>\ref_rfc20120305</td> <td></td> </tr>
+<tr> <td>2012-02-20</td> <td>\ref_rfc20120220</td> <td></td> </tr>
+<tr> <td>2012-01-20</td> <td>\ref_rfc20120120</td> <td></td> </tr>
+<tr> <td>2012-01-04</td> <td>\ref_rfc20120104</td> <td></td> </tr>
+<tr> <td>2011-11-19</td> <td>\ref_rfc20111119</td> <td></td> </tr>
+<tr> <td>2011-08-25</td> <td>\ref_rfc20110825</td> <td></td> </tr>
+<tr> <td>2011-08-11</td> <td>\ref_rfc20110811</td> <td></td> </tr>
+<tr> <td>2011-07-26</td> <td>\ref_rfc20110726</td> <td></td> </tr>
+<tr> <td>2011-06-14</td> <td>\ref_rfc20110614</td> <td></td> </tr>
+<tr> <td>2011-03-29</td> <td>\ref_rfc20110329</td> <td></td> </tr>
+<tr> <td>2011-01-18</td> <td>\ref_rfc20110118</td> <td></td> </tr>
+<tr> <td>2010-11-22</td> <td>\ref_rfc20101122</td> <td></td> </tr>
+<tr> <td>2010-11-04</td> <td>\ref_rfc20101104</td> <td></td> </tr>
+<tr> <td>2010-10-18</td> <td>\ref_rfc20101018</td> <td></td> </tr>
+<tr> <td>2010-09-02</td> <td>\ref_rfc20100902</td> <td></td> </tr>
+<tr> <td>2010-07-27</td> <td>\ref_rfc20100727</td> <td></td> </tr>
+<tr> <td>2010-07-26</td> <td>\ref_rfc20100726</td> <td></td> </tr>
+<tr> <td>2010-05-11</td> <td>\ref_rfc20100511</td> <td></td> </tr>
+<tr> <td>2010-04-22</td> <td>\ref_rfc20100422</td> <td></td> </tr>
+<tr> <td>2010-03-12</td> <td>\ref_rfc20100312</td> <td></td> </tr>
+<tr> <td>2009-12-18</td> <td>\ref_rfc20091218</td> <td></td> </tr>
+<tr> <td>2009-09-07</td> <td>\ref_rfc20090907</td> <td></td> </tr>
+<tr> <td>2009-06-12</td> <td>\ref_rfc20090612</td> <td></td> </tr>
+<tr> <td>2008-12-18</td> <td>\ref_rfc20081218</td> <td></td> </tr>
+<tr> <td>2008-09-15</td> <td>\ref_rfc20080915</td> <td></td> </tr>
+<tr> <td>2008-09-04</td> <td>\ref_rfc20080904</td> <td></td> </tr>
+<tr> <td>2008-03-01</td> <td>\ref_rfc20080301</td> <td></td> </tr>
+<tr> <td>2008-02-09</td> <td>\ref_rfc20080209</td> <td></td> </tr>
+<tr> <td>2008-02-06</td> <td>\ref_rfc20080206</td> <td></td> </tr>
+<tr> <td>2007-11-11</td> <td>\ref_rfc20071111</td> <td></td> </tr>
+<tr> <td>2007-10-18</td> <td>\ref_rfc20071018</td> <td></td> </tr>
+<tr> <td>2007-08-01</td> <td>\ref_rfc20070801</td> <td></td> </tr>
+<tr> <td>2007-04-13</td> <td>\ref_rfc20070413</td> <td></td> </tr>
+<tr> <td>2007-01-15</td> <td>\ref_rfc20070115</td> <td></td> </tr>
+<tr> <td>2006-06-23</td> <td>\ref_rfc20060623</td> <td></td> </tr>
+<tr> <td>2006-06-04</td> <td>\ref_rfc20060604</td> <td></td> </tr>
+<tr> <td>2006-05-05</td> <td>\ref_rfc20060505</td> <td></td> </tr>
+<tr> <td>2006-04-10</td> <td>\ref_rfc20060410</td> <td></td> </tr>
+<tr> <td>2006-03-17</td> <td>\ref_rfc20060317</td> <td></td> </tr>
+<tr> <td>2006-01-24</td> <td>\ref_rfc20060124</td> <td></td> </tr>
+<tr> <td>2004-08-11</td> <td>\ref_rfc20040811</td> <td></td> </tr>
+</table>
+
+*/ \ No newline at end of file
diff --git a/doxygen/dox/ReferenceManual.dox b/doxygen/dox/ReferenceManual.dox
new file mode 100644
index 0000000..cc0f99b
--- /dev/null
+++ b/doxygen/dox/ReferenceManual.dox
@@ -0,0 +1,89 @@
+/** \page RM Reference Manual
+
+The functions provided by the HDF5 C-API are grouped into the following
+\Emph{modules}:
+
+<table>
+<tr><th>Modules</th></tr>
+<tr valign="top">
+<td>
+
+<table>
+<tr><td style="border: none;">
+\li \ref H5A "Attributes (H5A)"
+\li \ref H5D "Datasets (H5D)"
+\li \ref H5S "Dataspaces (H5S)"
+\li \ref H5T "Datatypes (H5T)"
+\li \ref H5E "Error Handling (H5E)"
+\li \ref H5ES "Event Sets (H5ES)"
+\li \ref H5F "Files (H5F)"
+\li \ref H5Z "Filters (H5Z)"
+\li \ref H5G "Groups (H5G)"
+</td><td style="border: none;">
+\li \ref H5I "Identifiers (H5I)"
+\li \ref H5 "Library General (H5)"
+\li \ref H5L "Links (H5L)"
+\li \ref H5M "Maps (H5M)"
+\li \ref H5O "Objects (H5O)"
+\li \ref H5P "Property Lists (H5P)"
+\li \ref H5PL "Dynamically-loaded Plugins (H5PL)"
+\li \ref H5R "References (H5R)"
+\li \ref H5VL "Virtual Object Layer (H5VL)"
+</td><td style="border: none;vertical-align: top;">
+\li Functions with \ref ASYNC "asynchronous variants"
+\li \ref api-compat-macros
+\li <a href="./deprecated.html">Deprecated functions</a>
+\li High-level Extensions
+ <ul>
+ <li><a href="https://portal.hdfgroup.org/display/HDF5/Lite">\Bold{HDF5 Lite} (H5LT)</a></li>
+ <li><a href="https://portal.hdfgroup.org/display/HDF5/Images">\Bold{HDF5 Image} (H5IM)</a></li>
+ <li><a href="https://portal.hdfgroup.org/display/HDF5/Tables">\Bold{HDF5 Table} (H5TB)</a></li>
+ <li><a href="https://portal.hdfgroup.org/display/HDF5/Packet+Tables">\Bold{HDF5 Packet Table} (H5TB)</a></li>
+ <li><a href="https://portal.hdfgroup.org/display/HDF5/Dimension+Scales">\Bold{HDF5 Dimension Scale} (H5DS)</a></li>
+ </ul>
+</td></tr>
+<tr><td colspan="3" style="border: none;">
+\ref H5 \ref H5A \ref H5D \ref H5E \ref H5ES \ref H5F \ref H5G \ref H5I \ref H5L
+\ref H5M \ref H5O \ref H5P \ref H5PL \ref H5R \ref H5S \ref H5T \ref H5VL \ref H5Z
+</td></tr>
+</table>
+
+</td></tr>
+<tr><th>Mind the gap</th></tr>
+<tr><td>
+Follow these simple rules and stay out of trouble:
+
+\li \Bold{Handle discipline:} The HDF5 C-API is rife with handles or
+ identifiers, which you typically obtain by creating new HDF5 items, copying
+ items, or retrieving facets of items. \Emph{You acquire a handle, you own it!}
+ (Colin Powell) In other words, you are responsible for releasing the underlying
+ resources via the matching \Code{H5*close()} call, or deal with the consequences
+ of resource leakage.
+\li \Bold{Closed means closed:} Do not pass identifiers that were previously
+ \Code{H5*close()}-d to other API functions! It will generate an error.
+\li \Bold{Dynamic memory allocation:} The API contains a few functions in which the
+ HDF5 library dynamically allocates memory on the caller's behalf. The caller owns
+ this memory and eventually must free it by calling H5free_memory(). (\Bold{Not}
+ the `free` function \Emph{du jour}!)
+\li \Bold{Be careful with that saw:} Do not modify the underlying collection when an
+ iteration is in progress!
+\li \Bold{Use of locations:} Certain API functions, typically called \Code{H5***_by_name}
+ use a combination of identifiers and path names to refer to HDF5 objects.
+ If the identifier fully specifies the object in question, pass \Code{'.'} (a dot)
+ for the name!
+
+Break a leg!
+</td>
+</tr>
+</table>
+
+\cpp_c_api_note
+
+\par Don't like what you see? - You can help to improve this Reference Manual
+ Complete the survey linked near the top of this page!\n
+ We treat documentation like code: Fork the
+ <a href="https://github.com/HDFGroup/hdf5">HDF5 repo</a>, make changes, and create a
+ <a href="https://github.com/HDFGroup/hdf5/pulls">pull request</a> !\n
+ See the \ref RMT for general guidance.
+
+*/ \ No newline at end of file
diff --git a/doxygen/dox/Specifications.dox b/doxygen/dox/Specifications.dox
new file mode 100644
index 0000000..4ae48d0
--- /dev/null
+++ b/doxygen/dox/Specifications.dox
@@ -0,0 +1,22 @@
+/** \page SPEC Specifications
+
+\section DDL
+
+\li \ref DDLBNF110 "DDL in BNF through HDF5 1.10"
+\li \ref DDLBNF112 "DDL in BNF for HDF5 1.12 and above"
+
+\section File Format
+
+\li \ref FMT1 "HDF5 File Format Specification Version 1.0"
+\li \ref FMT11 "HDF5 File Format Specification Version 1.1"
+\li \ref FMT2 "HDF5 File Format Specification Version 2.0"
+\li \ref FMT3 "HDF5 File Format Specification Version 3.0"
+
+\section Other
+
+\li \ref IMG "HDF5 Image and Palette Specification Version 1.2"
+\li \ref TBL "HDF5 Table Specification Version 1.0"
+\li <a href="https://support.hdfgroup.org/HDF5/doc/HL/H5DS_Spec.pdf">
+ HDF5 Dimension Scale Specification</a>
+
+*/ \ No newline at end of file
diff --git a/doxygen/dox/TechnicalNotes.dox b/doxygen/dox/TechnicalNotes.dox
new file mode 100644
index 0000000..2bda175
--- /dev/null
+++ b/doxygen/dox/TechnicalNotes.dox
@@ -0,0 +1,20 @@
+/** \page TN Technical Notes
+
+\li \link api-compat-macros API Compatibility Macros \endlink
+\li \ref TNMDC "Metadata Caching in HDF5"
+\li \ref MT "Thread Safe library"
+\li \ref VFL "Virtual File Layer"
+
+ */
+
+/** \page MT HDF5 Thread Safe library
+
+\htmlinclude ThreadSafeLibrary.html
+
+*/
+
+/** \page VFL HDF5 Virtual File Layer
+
+\htmlinclude VFL.html
+
+*/
diff --git a/doxygen/dox/api-compat-macros.dox b/doxygen/dox/api-compat-macros.dox
index 6b85ccb..4a1578d 100644
--- a/doxygen/dox/api-compat-macros.dox
+++ b/doxygen/dox/api-compat-macros.dox
@@ -1,5 +1,4 @@
/** \page api-compat-macros API Compatibility Macros
- \tableofcontents
\section audience Audience
The target audience for this document has existing applications that use the
diff --git a/doxygen/dox/cookbook/Accessibility.c b/doxygen/dox/cookbook/Accessibility.c
new file mode 100644
index 0000000..f4cc905
--- /dev/null
+++ b/doxygen/dox/cookbook/Accessibility.c
@@ -0,0 +1,48 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [set_libver_bounds] -->
+ {
+ __label__ fail_fapl, fail_file;
+ hid_t fapl, file, aspace, attr;
+
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fapl;
+ }
+#if H5_VERSION_GE(1, 10, 0)
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0) {
+#elif H5_VERSION_GE(1, 8, 0)
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+#else
+#error Only HDF5 1.8.x and later supported.
+#endif
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((file = H5Fcreate("set_libver_bounds.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ H5Fclose(file);
+fail_file:
+ H5Pclose(fapl);
+fail_fapl:;
+ }
+ //! <!-- [set_libver_bounds] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/dox/cookbook/Accessibility.dox b/doxygen/dox/cookbook/Accessibility.dox
new file mode 100644
index 0000000..f100283
--- /dev/null
+++ b/doxygen/dox/cookbook/Accessibility.dox
@@ -0,0 +1,39 @@
+/** \page Accessibility
+
+\section Accessibility
+
+\subsection CB_MaintainCompat Maintaining Compatibility with other HDF5 Library Versions
+
+\par Problem
+You want to ensure that the HDF5 files you produce or modify are accessible by all
+releavnt tools and applications
+
+\par Solution
+For HDF5 items (objects, attributes, etc.) that you would like to
+create in new or existing HDF5 files, ascertain the supported range of HDF5
+library versions as lower and upper bounds. When creating new or opening
+existing HDF5 files, use a file access property list and configure the supported
+range via the H5Pset_libver_bounds() function.\n
+In the example below, we restrict HDF5 item creation to the HDF5 1.8.x family of
+library versions.
+\snippet{lineno} Accessibility.c set_libver_bounds
+
+\par Discussion
+See RFC \ref_rfc20160105 for a detailed and comprehensive account of HDF5
+versioning (library, file format spec., etc.) and the H5Pset_libver_bounds()
+function.\n
+The default range #H5F_LIBVER_EARLIEST (low) - #H5F_LIBVER_LATEST (high) offers the
+widest compatibility range, but may not be suitable for certain (feature-)use
+cases.\n
+The HDF5 library comes with a \Emph{forward-} and \Emph{backward-compatibility}
+guarantee: This means that the latest version of the library can always read
+HDF5 files created by a version realesed earlier (backward compatibility).
+It also means that a given release of the library can read the contents of
+HDF5 files created with later versions of the library as long as the files
+do not contain features introduced in later versions (forward compatibility).
+
+\par See Also
+See the recipe \ref CB_LargeAttributes for an example where we use HDF5
+compatibility settings to enable the creation of large HDF5 attributes.
+
+*/ \ No newline at end of file
diff --git a/doxygen/dox/cookbook/Attributes.c b/doxygen/dox/cookbook/Attributes.c
new file mode 100644
index 0000000..f4e894f
--- /dev/null
+++ b/doxygen/dox/cookbook/Attributes.c
@@ -0,0 +1,61 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [large_attribute] -->
+ {
+ __label__ fail_attr, fail_aspace, fail_fapl, fail_file;
+ hid_t fapl, file, aspace, attr;
+
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fapl;
+ }
+#if H5_VERSION_GE(1, 10, 0)
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) {
+#elif H5_VERSION_GE(1, 8, 0)
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+#else
+#error Only HDF5 1.8.x and later supported.
+#endif
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((file = H5Fcreate("large_attribute.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ if ((aspace = H5Screate_simple(1, (hsize_t[]){1024 * 1024}, NULL)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_aspace;
+ }
+ if ((attr = H5Acreate(file, "4MiB", H5T_IEEE_F32LE, aspace, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+
+ H5Aclose(attr);
+fail_attr:
+ H5Sclose(aspace);
+fail_aspace:
+ H5Fclose(file);
+fail_file:
+ H5Pclose(fapl);
+fail_fapl:;
+ }
+ //! <!-- [large_attribute] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/dox/cookbook/Attributes.dox b/doxygen/dox/cookbook/Attributes.dox
new file mode 100644
index 0000000..68fd159
--- /dev/null
+++ b/doxygen/dox/cookbook/Attributes.dox
@@ -0,0 +1,38 @@
+/** \page Attributes
+
+\section Attributes
+
+\subsection CB_LargeAttributes Creating "Large" HDF5 Attributes
+
+\par Problem
+You would like to use HDF5 attributes the size of whose values
+exceeds a few dozen kilobytes
+
+\par Solution
+A file format change in the HDF5 1.8.x family of library releases made it
+possible to have attributes larger than about 64 KiB. Ensure that the lower
+library version bound for new HDF5 item creation is at least 1.8.x, and create
+larger attributes as usual.\n
+In the example below, we create an attribute whose value occupies 4 MiB.
+
+\note This feature is only supported in HDF5 1.8.x+
+
+\snippet{lineno} Attributes.c large_attribute
+
+\par Discussion
+Large attributes are supported only in HDF5 versions 1.8.x and higher.
+This has implications for the accessibility of your HDF5 files and
+is your call.\n
+Since there are no size limitations for large attributes, it might
+seem tempting to mistake them for dataset stand-ins. This is not the
+case, for at least two reasons:
+1. Attributes decorate HDF5 objects, have their own local namespace,
+ and can't be link targets.
+2. Attribute I/O treats the attribute value as atomic, i.e., there
+ is no support for partial I/O. A large attribute will always be
+ read or written in its entirety.
+
+\par See Also
+See \ref CB_MaintainCompat for HDF5 compatibility implications.
+
+ */ \ No newline at end of file
diff --git a/doxygen/dox/cookbook/Files.c b/doxygen/dox/cookbook/Files.c
new file mode 100644
index 0000000..b824933
--- /dev/null
+++ b/doxygen/dox/cookbook/Files.c
@@ -0,0 +1,87 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [free_space] -->
+ {
+ __label__ fail_fcpl, fail_fapl, fail_file;
+ hid_t fcpl, fapl, file;
+
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fcpl;
+ }
+#if H5_VERSION_GE(1, 10, 1)
+ if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 1, 4096) < 0) {
+#else
+#error HDF5 1.10.1+ required
+#endif
+ ret_val = EXIT_FAILURE;
+ goto fail_fapl;
+ }
+
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fapl;
+ }
+#if H5_VERSION_GE(1, 10, 1)
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_V110, H5F_LIBVER_LATEST) < 0) {
+#else
+#error HDF5 1.10.x+ required
+#endif
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ if ((file = H5Fcreate("free_space.h5", H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ H5Fclose(file);
+
+fail_file:
+ H5Pclose(fapl);
+fail_fapl:
+ H5Pclose(fcpl);
+fail_fcpl:;
+ }
+ //! <!-- [free_space] -->
+
+ //! <!-- [user_block] -->
+ {
+ __label__ fail_fcpl, fail_file;
+ hid_t fcpl, file;
+
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fcpl;
+ }
+ if (H5Pset_userblock(fcpl, 8192 * 1024) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((file = H5Fcreate("userblock.h5", H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ H5Fclose(file);
+
+fail_file:
+ H5Pclose(fcpl);
+fail_fcpl:;
+ }
+ //! <!-- [user_block] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/dox/cookbook/Files.dox b/doxygen/dox/cookbook/Files.dox
new file mode 100644
index 0000000..169d638
--- /dev/null
+++ b/doxygen/dox/cookbook/Files.dox
@@ -0,0 +1,71 @@
+/** \page Files
+
+\section Files
+
+\subsection CB_FreeSpace Tracking Free Space in HDF5 Files
+
+\par Problem
+You sometimes delete objects in HDF5 files and don't have new content to use the
+free space, but would like to reuse it in the future.
+
+\par Solution
+At file creation time, set the file space management strategy and persistence of
+free space tracking information via H5Pset_file_space_strategy().
+
+\note This feature is only supported in HDF5 1.10.1+.
+
+\snippet{lineno} Files.c free_space
+
+\par Discussion
+Free space tracking is supported only in HDF5 versions 1.10.x and higher.
+This has implications for the accessibility of your HDF5 files and
+should be considered carefully. If compatibility with previous versions of
+HDF5 must be maintained, space reclamation via \Code{h5repack} might be an option.\n
+The file space strategy #H5F_FSPACE_STRATEGY_FSM_AGGR is not the only option
+that supports free-space tracking. #H5F_FSPACE_STRATEGY_PAGE is another option,
+which adds paged allocation and is used most effectively with page buffering.\n
+For an in-depth account of HDF5 file space management, paged-allocation, and
+page buffering, see the following documents:
+\li \ref_rfc20121024
+\li \ref_rfc20120523
+\li \ref_rfc20150709
+
+\par See Also
+See \ref CB_MaintainCompat for HDF5 compatibility implications.
+
+
+\subsection CB_RemoveUnusedSpace Removing Unused Space from HDF5 Files
+
+\par Problem
+Based on estimates or \Code{h5stat} output you know that a large portion
+of an HDF5 file consists of free or unaccounted space, and you would like
+to remove it.
+
+
+\subsection CB_UserBlock Creating an HDF5 File User Block
+
+\par Problem
+You would like to include certain ancillary, non-HDF5 content in an
+HDF5 file such that it can be accessed without the HDF5 library.
+
+\par Solution
+Use a file creation property list in which the user block size is set via
+H5Pset_userblock(). In the example below, we create an 8 MiB user block.
+\snippet{lineno} Files.c user_block
+
+\par Discussion
+The user block begins at offset 0 and must be at least 512 bytes and a power
+of 2. The HDF5 library ignores any content between the beginning of the
+file and the end of the user block.\n
+You can add or strip a user block to/from an existing HDF5 file with the
+\Code{h5jam}/\Code{h5unjam} tool, respectively.
+\warning
+If you try to embed content into the user block for use by other applications,
+pay close attention to how they handle space beyond the last used byte in the
+user block or the user block in general. In the worst case, applications might
+try to truncate the rest of the file and destroy the HDF5 portion of the file.
+
+\par See Also
+References to related recipes
+
+ */ \ No newline at end of file
diff --git a/doxygen/dox/cookbook/Performance.dox b/doxygen/dox/cookbook/Performance.dox
new file mode 100644
index 0000000..7ac3a18
--- /dev/null
+++ b/doxygen/dox/cookbook/Performance.dox
@@ -0,0 +1,21 @@
+/** \page Performance
+
+\section Performance
+
+\subsection CB_MDCPerf Assessing HDF5 Metadata Cache Performance
+
+\par Problem
+You are trying to diagnose and improve the I/O performance of an application
+and would like to understand if a simple metadata cache adjustment might
+yield substantial performance gains
+
+\par Solution
+The to-the-point solution, i.e., the solution w/o any background or explanation
+
+\par Discussion
+A discussion of the fine points and variants of the solution
+
+\par See Also
+References to related recipes
+
+ */ \ No newline at end of file
diff --git a/doxygen/dox/mainpage.dox b/doxygen/dox/mainpage.dox
deleted file mode 100644
index eda967b..0000000
--- a/doxygen/dox/mainpage.dox
+++ /dev/null
@@ -1,44 +0,0 @@
-/*! \mainpage HDF5 C-API Reference
- *
- * The HDF5 C-API provides applications with fine-grained control over all
- * aspects HDF5 functionality. This functionality is grouped into the following
- * \Emph{modules}:
- * \li \ref H5A "Attributes" — Management of HDF5 attributes (\ref H5A)
- * \li \ref H5D "Datasets" — Management of HDF5 datasets (\ref H5D)
- * \li \ref H5S "Dataspaces" — Management of HDF5 dataspaces which describe the shape of datasets and attributes (\ref H5S)
- * \li \ref H5T "Datatypes" — Management of datatypes which describe elements of datasets and attributes (\ref H5T)
- * \li \ref H5E "Error Handling" — Functions for handling errors that occur within HDF5 (\ref H5E)
- * \li \ref H5F "Files" — Management of HDF5 files (\ref H5F)
- * \li \ref H5Z "Filters" — Configuration of filters that process data during I/O operation (\ref H5Z)
- * \li \ref H5G "Groups" — Management of groups in HDF5 files (\ref H5G)
- * \li \ref H5I "Identifiers" — Management of object identifiers and object names (\ref H5I)
- * \li \ref H5 "Library" — General purpose library functions (\ref H5)
- * \li \ref H5L "Links" — Management of links in HDF5 groups (\ref H5L)
- * \li \ref H5O "Objects" — Management of objects in HDF5 files (\ref H5O)
- * \li \ref H5PL "Plugins" — Programmatic control over dynamically loaded plugins (\ref H5PL)
- * \li \ref H5P "Property Lists" — Management of property lists to control HDF5 library behavior (\ref H5P)
- * \li \ref H5R "References" — Management of references to specific objects and data regions in an HDF5 file (\ref H5R)
- * \li \ref H5VL "Virtual Object Layer" — Management of the Virtual Object Layer (\ref H5VL)
- *
- * Here are a few simple rules to follow:
- *
- * \li \Bold{Handle discipline:} If you acquire a handle (by creation or coopy), \Emph{you own it!} (..., i.e., you have to close it.)
- * \li \Bold{Dynamic memory allocation:} ...
- * \li \Bold{Use of locations:} Identifier + name combo
- *
- * \attention \Bold{C++ Developers using HDF5 C-API functions beware:}\n
- * If a C routine that takes a function pointer as an argument is called from
- * within C++ code, the C routine should be returned from normally.
- * Examples of this kind of routine include callbacks such as H5Pset_elink_cb()
- * and H5Pset_type_conv_cb() and functions such as H5Tconvert() and H5Ewalk2().\n
- * Exiting the routine in its normal fashion allows the HDF5 C library to clean
- * up its work properly. In other words, if the C++ application jumps out of
- * the routine back to the C++ \c catch statement, the library is not given the
- * opportunity to close any temporary data structures that were set up when the
- * routine was called. The C++ application should save some state as the
- * routine is started so that any problem that occurs might be diagnosed.
- *
- * \todo Fix the search form for server deployments.
- * \todo Make it mobile-friendly
- *
- */ \ No newline at end of file
diff --git a/doxygen/dox/maybe_metadata_reads.dox b/doxygen/dox/maybe_metadata_reads.dox
new file mode 100644
index 0000000..1bb53e0
--- /dev/null
+++ b/doxygen/dox/maybe_metadata_reads.dox
@@ -0,0 +1,50 @@
+/**
+ * \page maybe_metadata_reads Functions with No Access Property List Parameter that May Generate Metadata Reads
+ *
+ * \ingroup GACPL
+ *
+ * Currently there are several operations in HDF5 that can issue metadata reads
+ * from the metadata cache, but that take no property list. It is therefore not
+ * possible to set a collective requirement individually for those operations. The
+ * only solution with the HDF5 1.10.0 release is to set the collective requirement
+ * globally on H5Fopen() or H5Fcreate() for all metadata operations to be
+ * collective.
+ *
+ * The following is a list of those functions in the HDF5 library. This list is
+ * integral to the discussion in the H5Pset_all_coll_metadata_ops() entry:
+ *
+ * H5Awrite(), H5Aread(), H5Arename(), H5Aiterate2(), H5Adelete(), H5Aexists()
+ *
+ * H5Dget_space_status(), H5Dget_storage_size(), H5Dset_extent(), H5Ddebug(),
+ * H5Dclose(), H5Dget_create_plist(), H5Dget_space() (for virtual datasets)
+ *
+ * H5Gget_create_plist(), H5Gget_info(), H5Gclose()
+ *
+ * H5Literate(), H5Lvisit()
+ *
+ * H5Rcreate(), H5Rdereference2() (for object references),
+ * H5Rget_region(), H5Rget_obj_type2(), H5Rget_name()
+ *
+ * H5Ocopy(), H5Oopen_by_addr(), H5Oincr_refcount(), H5Odecr_refcount(),
+ * H5Oget_info(), H5Oset_comment(), H5Ovisit()
+ *
+ * H5Fis_hdf5(), H5Fflush(), H5Fclose(), H5Fget_file_image(), H5Freopen(),
+ * H5Fget_freespace(), H5Fget_info2(), H5Fget_free_sections(), H5Fmount(),
+ * H5Funmount()
+ *
+ * H5Iget_name()
+ *
+ * H5Tget_create_plist(), H5Tclose()
+ *
+ * H5Zunregister()
+ *
+ * In addition, \b most deprecated functions fall into this category.
+ *
+ * The HDF Group may address the above limitation in a future major release, but
+ * no decision has been made at this time. Such a change might, for example,
+ * include adding new versions of some or all the above functions with an extra
+ * property list parameter to allow an individual setting for the collective
+ * calling requirement.
+ *
+ * \sa_metadata_ops
+ */
diff --git a/doxygen/dox/rm-template.dox b/doxygen/dox/rm-template.dox
index 64e4770..ebf8aed 100644
--- a/doxygen/dox/rm-template.dox
+++ b/doxygen/dox/rm-template.dox
@@ -1,72 +1,99 @@
-/**\ingroup H5XYZ
- *
- * \brief A synopsis of what H5XYZgreat_function does
- *
- * \param[in] name1 Description of IN parameter \p name1
- * \param[out] name2 Description of OUT parameter \p name2
- * \param[in,out] name3 Description of INOUT parameter \p name3
- *
- * \return Returns what you always wanted
- *
- * \pre Describe preconditions for an entity. Can be repreated.
- *
- * \invariant Describe invariants for an entity. Can be repeated.
- *
- * \post Describe postconditions for an entity. Can be repreated.
- *
- * \deprecated This was my favorite function while it lasted.
- *
- * \details Describe the normal behavior flow of the function here. Try to be
- * helpful!
- *
- * Make reference to other functions like this: H5Fopen().
- *
- * Make reference to formal parameters like this: \p name1
- *
- * Make reference to macros like this: #H5P_DEFAULT.
- *
- * Make reference to enumeration constants like this: #H5F_CLOSE_WEAK.
- *
- * Include code snippets like this:
- * \snippet H5Zpublic.h H5Z_class2_t_snip
- *
- * Lists are supported:
- * - mouse events
- * -# mouse move event
- * -# mouse click event\n
- * More info about the click event.
- * -# mouse double click event
- * - keyboard events
- * 1. key down event
- * 2. key up event
- *
- * The distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is
- * \f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.\n
- * For tables, see
- * <a href="https://www.doxygen.nl/manual/tables.html">this example</a>.
- *
- * This is an example of how to use the H5XYZgreat_function().\n
- * The contents of the file hello_hdf5.c will be included.
- * \include hello_hdf5.c
- *
- * \note Dear reader, ...
- *
- * \attention Colorless green ideas sleep furiously.
- *
- * \warning Don't do this at home!
- *
- * \author This function was written by an esteemed author. Repeat this
- * command for multiple authors.
- *
- * \date Record the function's birthdate!
- *
- * \since 1.MAJOR.MINOR The 'since' command can also be used to record a
- * function's introduction (via its initial release
- * version).
- *
- * \version 1.MAJOR.MINOR An important event in the version history of this
- * function. There can be multiple such events.
- *
- * \see H5XYZanother_great_function(), H5XYZnot_so_great_a_function()
- *
- */
+/** \page RMT Reference Manual (RM) Page Template
+
+We treat documentation like code and use
+<a href="https://www.doxygen.nl/index.html">Doxygen</a> to
+<a href="https://github.com/HDFGroup/hdf5/blob/develop/src/H5Fpublic.h">markup
+comments in the code</a> or create
+<a href="https://github.com/HDFGroup/hdf5/blob/develop/doxygen/dox/Overview.dox">stand-alone pages</a>.
+
+Every RM entry consists of a subset of the elements listed below. Not every RM
+entry warrants the full set. More is better, and we can, perhaps, distinguish
+minimal, typical, and great RM entries.
+
+A minimal RM entry must include elements 1-3, 8, 11, and 7 if applicable.
+
+A \Emph{typical} RM entry is a minimal RM entry that in addition has elements
+9, 10, and 12.
+
+A \Bold{great} RM entry is a typical RM entry plus everything else.
+
+The current RM is a mixed bag. Take what's there with a pinch of salt and apply
+the <a href="https://www.oreilly.com/library/view/97-things-every/9780596809515/ch08.html">Scout Rule</a>!
+
+\par RM entry elements
+
+1. Module indication
+ - Indicate the HDF5 module in which the function will appear.
+ \verbatim
+ * \ingroup H5XYZ
+ \endverbatim
+2. Synopsis
+ - A phrase or sentence that summarizes the function's purpose
+ \verbatim
+ * \brief Simplifies your life
+ \endverbatim
+3. Prototype (parameters and return value)
+ - A description of the function parameters and return value
+ \verbatim
+ * \param[in] name1 Description of IN parameter \p name1
+ * \param[out] name2 Description of OUT parameter \p name2
+ * \param[in,out] name3 Description of INOUT parameter \p name3
+ * \return Returns what you always wanted
+ \endverbatim
+ - Clearly indicate the parameter direction as \c in, \c out, or
+ \Code{in,out}
+ - Make reference to other parameters using \Code{\\p}
+4. Preconditions
+ - A set of preconditions that must be met.
+ \verbatim
+ * \pre The argmument supplied in parameter \p name2 must be even.
+ \endverbatim
+5. Invariants
+ - A set of invariants.
+ \verbatim
+ * \invariant The mouse pointer will always be visible.
+ \endverbatim
+6. Postconditions
+ - What will be true when the function returns.
+ \verbatim
+ * \post On error, the output parameters will be unmodified.
+ \endverbatim
+7. Deprecation note
+ - If a function was deprecated, list the version in which the function was
+ deprecated (below), why it was deprecated, and which function(s) succeed it.
+ \verbatim
+ * \deprecated Deprecated in favor of another great function.
+ \endverbatim
+8. Details
+ - A detailed description of the function's behavior
+ \verbatim
+ * \details This is the heart of the matter. Try to be helpful!
+ \endverbatim
+9. Example
+ - The function in context and action, usually a (Doxygen) snippet.
+ \verbatim
+ * \par Example
+ * \snippet H5F_examples.c minimal
+ \endverbatim
+10. Instruction (attention, note, warning)
+ - Behaviors, features, side-effects, etc. the user should be aware of
+ \verbatim
+ * \note Dear reader, ...
+ *
+ * \attention Colorless green ideas sleep furiously.
+ *
+ * \warning Don't do this at home!
+ \endverbatim
+11. Since
+ - The HDF5 library version in which the function was introduced
+ \verbatim
+ * \since 1.MAJOR.MINOR
+ \endverbatim
+12. Version
+ - Use this element to record a deprecation version, a change in parameter
+ types, changes in behavior, etc.
+ \verbatim
+ * \version 1.MAJOR.MINOR Function was deprecated in this release
+ \endverbatim
+
+*/ \ No newline at end of file
diff --git a/doxygen/examples/FF-IH_FileGroup.gif b/doxygen/examples/FF-IH_FileGroup.gif
new file mode 100644
index 0000000..b0d76f5
--- /dev/null
+++ b/doxygen/examples/FF-IH_FileGroup.gif
Binary files differ
diff --git a/doxygen/examples/FF-IH_FileObject.gif b/doxygen/examples/FF-IH_FileObject.gif
new file mode 100644
index 0000000..8eba623
--- /dev/null
+++ b/doxygen/examples/FF-IH_FileObject.gif
Binary files differ
diff --git a/doxygen/examples/FileFormatSpecChunkDiagram.jpg b/doxygen/examples/FileFormatSpecChunkDiagram.jpg
new file mode 100644
index 0000000..03fd90a
--- /dev/null
+++ b/doxygen/examples/FileFormatSpecChunkDiagram.jpg
Binary files differ
diff --git a/doxygen/examples/H5.format.1.0.html b/doxygen/examples/H5.format.1.0.html
new file mode 100644
index 0000000..2d3ffbe
--- /dev/null
+++ b/doxygen/examples/H5.format.1.0.html
@@ -0,0 +1,4050 @@
+<html>
+ <head>
+ <title>
+ HDF5 File Format Specification
+ </title>
+ </head>
+ <body bgcolor="#FFFFFF">
+
+ <center>
+ <table border=0 width=90%>
+ <tr>
+ <td valign=top>
+ <ol type=I>
+ <li><a href="#Intro">Introduction</a>
+ <li><a href="#BootBlock">Disk Format Level 0 - File Signature and Super Block</a>
+ <li><a href="#Group">Disk Format Level 1 - File Infrastructure</a>
+ <font size=-2>
+ <ol type=A>
+ <li><a href="#Btrees">Disk Format Level 1A - B-link Trees and B-tree Nodes</a>
+ <li><a href="#SymbolTable">Disk Format Level 1B - Group</a>
+ <li><a href="#SymbolTableEntry">Disk Format Level 1C - Group Entry</a>
+ <li><a href="#LocalHeap">Disk Format Level 1D - Local Heaps</a>
+ <li><a href="#GlobalHeap">Disk Format Level 1E - Global Heap</a>
+ <li><a href="#FreeSpaceIndex">Disk Format Level 1F - Free-space Index</a>
+ </ol>
+ </font>
+ <li><a href="#DataObject">Disk Format Level 2 - Data Objects</a>
+ <font size=-2>
+ <ol type=A>
+ <li><a href="#ObjectHeader">Disk Format Level 2a - Data Object Headers</a>
+ <ol type=1>
+ <li><a href="#NILMessage">Name: NIL</a> <!-- 0x0000 -->
+ <li><a href="#SimpleDataSpace">Name: Simple Dataspace</a> <!-- 0x0001 -->
+<!--
+ <li><a href="#DataSpaceMessage">Name: Complex Dataspace</a> --> <!-- 0x0002 -->
+ <li><a href="#DataTypeMessage">Name: Datatype</a> <!-- 0x0003 -->
+ <li><a href="#FillValueMessage">Name: Data Storage - Fill Value</a> <!-- 0x0004 -->
+ <li><a href="#ReservedMessage_0005">Name: Reserved - not assigned yet</a> <!-- 0x0005 -->
+ </ol>
+ </ol>
+ </font>
+ </ol>
+ </td><td>&nbsp;&nbsp;</td><td valign=top>
+ <ol type=I>
+
+ <li><a href="#DataObject">Disk Format Level 2 - Data Objects</a>
+ <font size=-2><i>(Continued)</i>
+ <ol type=A>
+ <li><a href="#ObjectHeader">Disk Format Level 2a - Data Object Headers</a><i>(Continued)</i>
+ <ol type=1>
+ <li><a href="#CompactDataStorageMessage">Name: Data Storage - Compact</a> <!-- 0x0006 -->
+ <li><a href="#ExternalFileListMessage">Name: Data Storage - External Data Files</a> <!-- 0x0007 -->
+ <li><a href="#LayoutMessage">Name: Data Storage - Layout</a> <!-- 0x0008 -->
+ <li><a href="#ReservedMessage_0009">Name: Reserved - not assigned yet</a> <!-- 0x0009 -->
+ <li><a href="#ReservedMessage_000A">Name: Reserved - not assigned yet</a> <!-- 0x000a -->
+ <li><a href="#FilterMessage">Name: Data Storage - Filter Pipeline</a> <!-- 0x000b -->
+ <li><a href="#AttributeMessage">Name: Attribute</a> <!-- 0x000c -->
+ <li><a href="#NameMessage">Name: Object Name</a> <!-- 0x000d -->
+ <li><a href="#ModifiedMessage">Name: Object Modification Date and Time</a> <!-- 0x000e -->
+ <li><a href="#SharedMessage">Name: Shared Object Message</a> <!-- 0x000f -->
+ <li><a href="#ContinuationMessage">Name: Object Header Continuation</a> <!-- 0x0010 -->
+ <li><a href="#SymbolTableMessage">Name: Group Message</a> <!-- 0x0011 -->
+ </ol>
+ <li><a href="#SharedObjectHeader">Disk Format: Level 2b - Shared Data Object Headers</a>
+ <li><a href="#DataStorage">Disk Format: Level 2c - Data Object Data Storage</a>
+ </ol>
+ </font>
+ </ol>
+</td></tr>
+</table>
+</center>
+
+<br><br>
+
+
+ <h2>Introduction</h2>
+
+ <table align=right width=100>
+ <tr><td>&nbsp;</td><td align=center>
+ <hr>
+ <img src="FF-IH_FileGroup.gif" alt="HDF5 Groups" hspace=15 vspace=15>
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align=center>
+ <strong>Figure 1:</strong> Relationships among the HDF5 root group, other groups, and objects
+ <hr>
+ </td><td>&nbsp;</td></tr>
+
+ <tr><td>&nbsp;</td><td align=center>
+ <img src="FF-IH_FileObject.gif" alt="HDF5 Objects" hspace=15 vspace=15>
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align=center>
+ <strong>Figure 2:</strong> HDF5 objects -- datasets, datatypes, or dataspaces
+ <hr>
+ </td><td>&nbsp;</td></tr>
+ </table>
+
+
+ <P>The format of an HDF5 file on disk encompasses several
+ key ideas of the HDF4 and AIO file formats as well as
+ addressing some shortcomings therein. The new format is
+ more self-describing than the HDF4 format and is more
+ uniformly applied to data objects in the file.
+
+ <P>An HDF5 file appears to the user as a directed graph.
+ The nodes of this graph are the higher-level HDF5 objects
+ that are exposed by the HDF5 APIs:
+
+ <ul>
+ <li>Groups
+ <li>Datasets
+ <li>Datatypes
+ <li>Dataspaces
+ </ul>
+
+ <P>At the lowest level, as information is actually written to the disk,
+ an HDF5 file is made up of the following objects:
+ <ul>
+ <li>A super block
+ <li>B-tree nodes (containing either symbol nodes or raw data chunks)
+ <li>Object headers
+
+ <li>Collections
+ <li>Local heaps
+ <li>Free space
+ </ul>
+
+ The HDF5 library uses these lower-level objects to represent the
+ higher-level objects that are then presented to the user or
+ to applications through the APIs.
+ For instance, a group is an object header that contains a message that
+ points to a local heap and to a B-tree which points to symbol nodes.
+ A dataset is an object header that contains messages that describe
+ datatype, space, layout, filters, external files, fill value, etc
+ with the layout message pointing to either a raw data chunk or to a
+ B-tree that points to raw data chunks.
+
+
+ <h3>This Document</h3>
+
+ <p>This document describes the lower-level data objects;
+ the higher-level objects and their properties are described
+ in the <a href="H5.user.html"><cite>HDF5 User's Guide</cite></a>.
+
+
+<!--
+<blockquote>
+<pre>
+
+Elena> NOTE: give reference to the detailed discussion of the B-trees
+Elena> when needed. Right now we do not have specification (only general one)
+Elena> for the Symbol Table B-trees and B-trees used to manage chunked datasets.
+Elena> B-trees
+Elena> General Discussion
+Elena> Object related discussions
+Elena> Symbol Tables
+Elena> Global heap
+Elena> "Free-space object"
+
+
+</pre>
+</blockquote>
+-->
+
+
+
+ <P>Three levels of information comprise the file format.
+ Level 0 contains basic information for identifying and
+ defining information about the file. Level 1 information contains
+ the group information (stored as a B-tree) and is used as the
+ index for all the objects in the file. Level 2 is the rest
+ of the file and contains all of the data objects, with each object
+ partitioned into header information, also known as
+ <em>meta information</em>, and data.
+
+ <p>The sizes of various fields in the following layout tables are
+ determined by looking at the number of columns the field spans
+ in the table. There are three exceptions: (1) The size may be
+ overridden by specifying a size in parentheses, (2) the size of
+ addresses is determined by the <em>Size of Offsets</em> field
+ in the super block, and (3) the size of size fields is determined
+ by the <em>Size of Lengths</em> field in the super block.
+
+
+
+<br><br>
+<br><br>
+
+
+ <h2><a name="BootBlock">
+ Disk Format: Level 0 - File Signature and Super Block</a></h2>
+
+ <P>The super block may begin at certain predefined offsets within
+ the HDF5 file, allowing a block of unspecified content for
+ users to place additional information at the beginning (and
+ end) of the HDF5 file without limiting the HDF5 library's
+ ability to manage the objects within the file itself. This
+ feature was designed to accommodate wrapping an HDF5 file in
+ another file format or adding descriptive information to the
+ file without requiring the modification of the actual file's
+ information. The super block is located by searching for the
+ HDF5 file signature at byte offset 0, byte offset 512 and at
+ successive locations in the file, each a multiple of two of
+ the previous location, i.e. 0, 512, 1024, 2048, etc.
+
+ <P>The super block is composed of a file signature, followed by
+ super block and group version numbers, information
+ about the sizes of offset and length values used to describe
+ items within the file, the size of each group page,
+ and a group entry for the root object in the file.
+
+ <p>
+ <center>
+ <table border align=center cellpadding=4 width="80%">
+ <caption align=top>
+ <B>HDF5 Super Block Layout</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>HDF5 File Signature (8 bytes)<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td>Version # of Super Block</td>
+ <td>Version # of Global Free-space Storage</td>
+ <td>Version # of Group</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td>Version # of Shared Header Message Format</td>
+ <td>Size of Offsets</td>
+ <td>Size of Lengths</td>
+ <td>Reserved (zero)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Group Leaf Node K</td>
+ <td colspan=2>Group Internal Node K</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>File Consistency Flags</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Base Address*</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Address of Global Free-space Heap*</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>End of File Address*</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Driver Information Block Address*</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Root Group Address*</td>
+ </tr>
+ </table>
+
+ <table width="80%" border=0>
+ <tr><td>
+ <div align=right>
+ (Items marked with an asterisk (*) in the above table
+ <br>
+ are of the size specified in "Size of Offsets.")
+ </div>
+ </td></tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>File Signature</td>
+ <td>This field contains a constant value and can be used to
+ quickly identify a file as being an HDF5 file. The
+ constant value is designed to allow easy identification of
+ an HDF5 file and to allow certain types of data corruption
+ to be detected. The file signature of an HDF5 file always
+ contains the following values:
+
+ <br><br><center>
+ <table border align=center cellpadding=4 width="100%">
+ <tr align=center>
+ <td>decimal</td>
+ <td width="8%">137</td>
+ <td width="8%">72</td>
+ <td width="8%">68</td>
+ <td width="8%">70</td>
+ <td width="8%">13</td>
+ <td width="8%">10</td>
+ <td width="8%">26</td>
+ <td width="8%">10</td>
+ </tr>
+
+ <tr align=center>
+ <td>hexadecimal</td>
+ <td width="8%">89</td>
+ <td width="8%">48</td>
+ <td width="8%">44</td>
+ <td width="8%">46</td>
+ <td width="8%">0d</td>
+ <td width="8%">0a</td>
+ <td width="8%">1a</td>
+ <td width="8%">0a</td>
+ </tr>
+
+ <tr align=center>
+ <td>ASCII C Notation</td>
+ <td width="8%">\211</td>
+ <td width="8%">H</td>
+ <td width="8%">D</td>
+ <td width="8%">F</td>
+ <td width="8%">\r</td>
+ <td width="8%">\n</td>
+ <td width="8%">\032</td>
+ <td width="8%">\n</td>
+ </tr>
+ </table>
+ </center>
+ <br>
+
+ This signature both identifies the file as an HDF5 file
+ and provides for immediate detection of common
+ file-transfer problems. The first two bytes distinguish
+ HDF5 files on systems that expect the first two bytes to
+ identify the file type uniquely. The first byte is
+ chosen as a non-ASCII value to reduce the probability
+ that a text file may be misrecognized as an HDF5 file;
+ also, it catches bad file transfers that clear bit
+ 7. Bytes two through four name the format. The CR-LF
+ sequence catches bad file transfers that alter newline
+ sequences. The control-Z character stops file display
+ under MS-DOS. The final line feed checks for the inverse
+ of the CR-LF translation problem. (This is a direct
+ descendent of the PNG file signature.)</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Version Number of the Super Block</td>
+ <td>This value is used to determine the format of the
+ information in the super block. When the format of the
+ information in the super block is changed, the version number
+ is incremented to the next integer and can be used to
+ determine how the information in the super block is
+ formatted.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Version Number of the Global Free-space Heap</td>
+ <td>This value is used to determine the format of the
+ information in the Global Free-space Heap.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Version Number of the Group</td>
+ <td>This value is used to determine the format of the
+ information in the Group. When the format of
+ the information in the Group is changed, the
+ version number is incremented to the next integer and can be
+ used to determine how the information in the Group
+ is formatted.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Version Number of the Shared Header Message Format</td>
+ <td>This value is used to determine the format of the
+ information in a shared object header message, which is
+ stored in the global small-data heap. Since the format
+ of the shared header messages differs from the private
+ header messages, a version number is used to identify changes
+ in the format.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Size of Offsets</td>
+ <td>This value contains the number of bytes used to store
+ addresses in the file. The values for the addresses of
+ objects in the file are offsets relative to a base address,
+ usually the address of the super block signature. This
+ allows a wrapper to be added after the file is created
+ without invalidating the internal offset locations.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Size of Lengths</td>
+ <td>This value contains the number of bytes used to store
+ the size of an object.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Group Leaf Node K</td>
+ <td>Each leaf node of a group B-tree will have at
+ least this many entries but not more than twice this
+ many. If a group has a single leaf node then it
+ may have fewer entries.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Group Internal Node K</td>
+ <td>Each internal node of a group B-tree will have
+ at least K pointers to other nodes but not more than 2K
+ pointers. If the group has only one internal
+ node then it might have fewer than K pointers.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Bytes per B-tree Page</td>
+ <td>This value contains the number of bytes used for symbol
+ pairs per page of the B-trees used in the file. All
+ B-tree pages will have the same size per page.
+ <br>
+ For 32-bit file offsets, 340 objects is the maximum
+ per 4KB page; for 64-bit file offset, 254 objects will fit
+ per 4KB page. In general, the equation is:
+ <br>
+ <code>&nbsp;&nbsp;&nbsp;&lt;<i>number of objects</i>&gt; =
+ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ FLOOR((&lt;<i>page size</i>&gt; - &lt;<i>offset size</i>&gt;) /
+ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ (&lt;<i>Symbol size</i>&gt; + &lt;<i>offset size</i>&gt;))
+ - 1 </code></td>
+ </tr>
+
+ <tr valign=top>
+ <td>File Consistency Flags</td>
+ <td>This value contains flags to indicate information
+ about the consistency of the information contained
+ within the file. Currently, the following bit flags are
+ defined:
+ <ul>
+ <li>Bit 0 set indicates that the file is opened for
+ write-access.
+ <li>Bit 1 set indicates that the file has
+ been verified for consistency and is guaranteed to be
+ consistent with the format defined in this document.
+ <li>Bits 2-31 are reserved for future use.
+ </ul>
+ Bit 0 should be
+ set as the first action when a file is opened for write
+ access and should be cleared only as the final action
+ when closing a file. Bit 1 should be cleared during
+ normal access to a file and only set after the file's
+ consistency is guaranteed by the library or a
+ consistency utility.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Base Address</td>
+ <td>This is the absolute file address of the first byte of
+ the HDF5 data within the file. The library currently
+ constrains this value to be the absolute file address
+ of the super block itself when creating new files;
+ future versions of the library may provide greater
+ flexibility. Unless otherwise noted,
+ all other file addresses are relative to this base
+ address.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of Global Free-space Heap</td>
+ <td>Free-space management is not yet defined in the HDF5
+ file format and is not handled by the library.
+ Currently this field always contains the
+ undefined address <code>0xfff...ff</code>.
+<!--
+ <td>This value contains the relative address of the B-tree
+ used to manage the blocks of data which are unused in the
+ file currently. The free-space heap is used to manage the
+ blocks of bytes at the file-level which become unused when
+ objects are moved within the file.</td>
+-->
+ </tr>
+
+ <tr valign=top>
+ <td>End of File Address</td>
+ <td>This is the relative file address of the first byte past
+ the end of all HDF5 data. It is used to determine whether a
+ file has been accidently truncated and as an address where
+ file data allocation can occur if the free list is not
+ used.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Driver Information Block Address</td>
+ <td>This is the relative file address of the file driver
+ information block which contains driver-specific
+ information needed to reopen the file. If there is no
+ driver information block then this entry should be the
+ undefined address (all bits set).</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Root Group Address</td>
+ <td>This is the address of the root group (described later
+ in this document), which serves as the entry point into
+ the group graph.</td>
+ </tr>
+ </table>
+ </center>
+
+
+ <p>The <em>file driver information block</em> is an optional region of the
+ file which contains information needed by the file driver in
+ order to reopen a file. The format of the file driver information
+ block is:
+
+ <p>
+ <center>
+ <table border align=center cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Driver Information Block</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Driver Information Size (4 bytes)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Driver Identification (8 bytes)<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br><br>Driver Information<br><br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version</td>
+ <td>The version number of the driver information block. The
+ file format documented here is version zero.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Driver Information Size</td>
+ <td>The size in bytes of the Driver Information part of this
+ structure.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Driver Identification</td>
+ <td>This is an eight-byte ASCII string without null
+ termination which identifies the driver and version number
+ of the Driver Information block. The predefined drivers
+ supplied with the HDF5 library are identified by the
+ letters <code>NCSA</code> followed by the first four characters of
+ the driver name. If the Driver Information block is not
+ the original version then the last letter(s) of the
+ identification will be replaced by a version number in
+ ASCII.
+ For example, the various versions of the <em>family driver</em>
+ will be identified by <code>NCSAfami</code>, <code>NCSAfam0</code>,
+ <code>NCSAfam1</code>, etc.
+ (<code>NCSAfami</code> is simply <code>NCSAfamily</code> truncated
+ to eight characters. Subsequent identifiers will be created by
+ substituting sequential numerical values for the final character,
+ starting with zero.)
+ <p>
+ Identification for user-defined drivers
+ is arbitrary but should be unique.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Driver Information</td>
+ <td>Driver information is stored in a format defined by the
+ file driver and encoded/decoded by the driver callbacks
+ invoked from the <code>H5FD_sb_encode</code> and
+ <code>H5FD_sb_decode</code> functions.</td>
+ </tr>
+ </table>
+ </center>
+
+
+ <br><br>
+ <br><br>
+
+
+ <h2><a name="Group">
+ Disk Format: Level 1 - File Infrastructure</a></h2>
+ <h3><a name="Btrees">Disk Format: Level 1A - B-link Trees and B-tree Nodes</a></h3>
+
+ <p>B-link trees allow flexible storage for objects which tend to grow
+ in ways that cause the object to be stored discontiguously. B-trees
+ are described in various algorithms books including "Introduction to
+ Algorithms" by Thomas H. Cormen, Charles E. Leiserson, and Ronald
+ L. Rivest. The B-link tree, in which the sibling nodes at a
+ particular level in the tree are stored in a doubly-linked list,
+ is described in the "Efficient Locking for Concurrent Operations
+ on B-trees" paper by Phillip Lehman and S. Bing Yao as published
+ in the <em>ACM Transactions on Database Systems</em>, Vol. 6,
+ No. 4, December 1981.
+
+ <p>The B-link trees implemented by the file format contain one more
+ key than the number of children. In other words, each child
+ pointer out of a B-tree node has a left key and a right key.
+ The pointers out of internal nodes point to sub-trees while
+ the pointers out of leaf nodes point to symbol nodes and
+ raw data chunks.
+ Aside from that difference, internal nodes and leaf nodes
+ are identical.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>B-tree Nodes</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Node Signature</td>
+
+ <tr align=center>
+ <td>Node Type</td>
+ <td>Node Level</td>
+ <td colspan=2>Entries Used</td>
+
+ <tr align=center>
+ <td colspan=4>Address of Left Sibling</td>
+
+ <tr align=center>
+ <td colspan=4>Address of Right Sibling</td>
+
+ <tr align=center>
+ <td colspan=4>Key 0 (variable size)</td>
+
+ <tr align=center>
+ <td colspan=4>Address of Child 0</td>
+
+ <tr align=center>
+ <td colspan=4>Key 1 (variable size)</td>
+
+ <tr align=center>
+ <td colspan=4>Address of Child 1</td>
+
+ <tr align=center>
+ <td colspan=4>...</td>
+
+ <tr align=center>
+ <td colspan=4>Key 2<em>K</em> (variable size)</td>
+
+ <tr align=center>
+ <td colspan=4>Address of Child 2<em>K</em></td>
+
+ <tr align=center>
+ <td colspan=4>Key 2<em>K</em>+1 (variable size)</td>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Node Signature</td>
+ <td>The ASCII character string <code>TREE</code> is
+ used to indicate the
+ beginning of a B-link tree node. This gives file
+ consistency checking utilities a better chance of
+ reconstructing a damaged file.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Node Type</td>
+ <td>Each B-link tree points to a particular type of data.
+ This field indicates the type of data as well as
+ implying the maximum degree <em>K</em> of the tree and
+ the size of each Key field.
+ <br>
+ <dl compact>
+ <dt>0
+ <dd>This tree points to group nodes.
+ <dt>1
+ <dd>This tree points to a new data chunk.
+ </dl>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Node Level</td>
+ <td>The node level indicates the level at which this node
+ appears in the tree (leaf nodes are at level zero). Not
+ only does the level indicate whether child pointers
+ point to sub-trees or to data, but it can also be used
+ to help file consistency checking utilities reconstruct
+ damanged trees.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Entries Used</td>
+ <td>This determines the number of children to which this
+ node points. All nodes of a particular type of tree
+ have the same maximum degree, but most nodes will point
+ to less than that number of children. The valid child
+ pointers and keys appear at the beginning of the node
+ and the unused pointers and keys appear at the end of
+ the node. The unused pointers and keys have undefined
+ values.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of Left Sibling</td>
+ <td>This is the file address of the left sibling of the
+ current node relative to the super block. If the current
+ node is the left-most node at this level then this field
+ is the undefined address (all bits set).</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of Right Sibling</td>
+ <td>This is the file address of the right sibling of the
+ current node relative to the super block. If the current
+ node is the right-most node at this level then this
+ field is the undefined address (all bits set).</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Keys and Child Pointers</td>
+ <td>Each tree has 2<em>K</em>+1 keys with 2<em>K</em>
+ child pointers interleaved between the keys. The number
+ of keys and child pointers actually containing valid
+ values is determined by the <em>Entries Used</em> field. If
+ that field is <em>N</em> then the B-link tree contains
+ <em>N</em> child pointers and <em>N</em>+1 keys.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Key</td>
+ <td>The format and size of the key values is determined by
+ the type of data to which this tree points. The keys are
+ ordered and are boundaries for the contents of the child
+ pointer; that is, the key values represented by child
+ <em>N</em> fall between Key <em>N</em> and Key
+ <em>N</em>+1. Whether the interval is open or closed on
+ each end is determined by the type of data to which the
+ tree points.
+ <p>
+ The format of the key depends on the node type.
+ For nodes of node type 1, the key is formatted as follows:
+ <center>
+ <table>
+ <tr valign=top align=left>
+ <td width=40%>Bytes 1-4</td>
+ <td>Size of chunk in bytes.</td>
+ <tr valign=top align=left></tr>
+ <td>Bytes 4-8</td>
+ <td>Filter mask, a 32-bit bitfield indicating which
+ filters have been applied to that chunk.</td>
+ </tr><tr valign=top align=left>
+ <td><i>N</i> fields of 8 bytes each</td>
+ <td>A 64-bit index indicating the offset of the
+ chunk within the dataset where <i>N</i> is the number
+ of dimensions of the dataset. For example, if
+ a chunk in a 3-dimensional dataset begins at the
+ position <code>[5,5,5]</code>, there will be three
+ such 8-bit indices, each with the value of
+ <code>5</code>.</td>
+ </tr>
+ </table>
+ </center>
+ <p>
+ For nodes of node type 0, the key is formatted as follows:
+ <center>
+ <table>
+ <tr valign=top align=left>
+ <td width=40%>A single field of <i>Size of Lengths</i>
+ bytes</td>
+ <td>Indicates the byte offset into the local heap
+ for the first object name in the subtree which
+ that key describes.</td>
+ </tr>
+ </table>
+ </center>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Child Pointers</td>
+ <td>The tree node contains file addresses of subtrees or
+ data depending on the node level. Nodes at Level 0 point
+ to data addresses, either data chunk or group nodes.
+ Nodes at non-zero levels point to other nodes of the
+ same B-tree.</td>
+ </tr>
+ </table>
+ </center>
+
+<p>
+ Each B-tree node looks like this:
+
+ <center>
+ <table>
+ <tr valign=top align=center>
+ <td>key[0]</td><td>&nbsp;&nbsp;</td>
+ <td>child[0]</td><td>&nbsp;&nbsp;</td>
+ <td>key[1]</td><td>&nbsp;&nbsp;</td>
+ <td>child[1]</td><td>&nbsp;&nbsp;</td>
+ <td>key[2]</td><td>&nbsp;&nbsp;</td>
+ <td>...</td><td>&nbsp;&nbsp;</td>
+ <td>...</td><td>&nbsp;&nbsp;</td>
+ <td>key[<i>N</i>-1]</td><td>&nbsp;&nbsp;</td>
+ <td>child[<i>N</i>-1]</td><td>&nbsp;&nbsp;</td>
+ <td>key[<i>N</i>]</td>
+ </tr>
+ </table>
+ </center>
+
+ where child[<i>i</i>] is a pointer to a sub-tree (at a level
+ above Level 0) or to data (at Level 0).
+ Each key[<i>i</i>] describes an <i>item</i> stored by the B-tree
+ (a chunk or an object of a group node). The range of values
+ represented by child[<i>i</i>] are indicated by key[<i>i</i>]
+ and key[<i>i</i>+1].
+
+
+ <p>The following question must next be answered:
+ "Is the value described by key[<i>i</i>] contained in
+ child[<i>i</i>-1] or in child[<i>i</i>]?"
+ The answer depends on the type of tree.
+ In trees for groups (node type 0) the object described by
+ key[<i>i</i>] is the greatest object contained in
+ child[<i>i</i>-1] while in chunk trees (node type 1) the
+ chunk described by key[<i>i</i>] is the least chunk in
+ child[<i>i</i>].
+
+ <p>That means that key[0] for group trees is sometimes unused;
+ it points to offset zero in the heap, which is always the
+ empty string and compares as "less-than" any valid object name.
+
+ <p>And key[<i>N</i>] for chunk trees is sometimes unused;
+ it contains a chunk offset which compares as "greater-than"
+ any other chunk offset and has a chunk byte size of zero
+ to indicate that it is not actually allocated.
+
+
+ <h3><a name="SymbolTable">Disk Format: Level 1B - Group and Symbol Nodes</a></h3>
+
+ <p>A group is an object internal to the file that allows
+ arbitrary nesting of objects (including other groups).
+ A group maps a set of names to a set of file
+ address relative to the base address. Certain meta data
+ for an object to which the group points can be duplicated
+ in the group symbol table in addition to the object header.
+
+ <p>An HDF5 object name space can be stored hierarchically by
+ partitioning the name into components and storing each
+ component in a group. The group entry for a
+ non-ultimate component points to the group containing
+ the next component. The group entry for the last
+ component points to the object being named.
+
+ <p>A group is a collection of group nodes pointed
+ to by a B-link tree. Each group node contains entries
+ for one or more symbols. If an attempt is made to add a
+ symbol to an already full group node containing
+ 2<em>K</em> entries, then the node is split and one node
+ contains <em>K</em> symbols and the other contains
+ <em>K</em>+1 symbols.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Group Node (A Leaf of a B-tree)</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Node Signature</td>
+
+ <tr align=center>
+ <td>Version Number</td>
+ <td>Reserved for Future Use</td>
+ <td colspan=2>Number of Symbols</td>
+
+ <tr align=center>
+ <td colspan=4><br><br>Group Entries<br><br><br></td>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Node Signature</td>
+ <td>The ASCII character string <code>SNOD</code> is
+ used to indicate the
+ beginning of a group node. This gives file
+ consistency checking utilities a better chance of
+ reconstructing a damaged file.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Version Number</td>
+ <td>The version number for the group node. This
+ document describes version 1.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Number of Symbols</td>
+ <td>Although all group nodes have the same length,
+ most contain fewer than the maximum possible number of
+ symbol entries. This field indicates how many entries
+ contain valid data. The valid entries are packed at the
+ beginning of the group node while the remaining
+ entries contain undefined values.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Group Entries</td>
+ <td>Each symbol has an entry in the group node.
+ The format of the entry is described below.</td>
+ </tr>
+ </table>
+ </center>
+
+ <h3><a name="SymbolTableEntry">
+ Disk Format: Level 1C - Group Entry </a></h3>
+
+ <p>Each group entry in a group node is designed
+ to allow for very fast browsing of stored objects.
+ Toward that design goal, the group entries
+ include space for caching certain constant meta data from the
+ object header.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Group Entry</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Name Offset (&lt;size&gt; bytes)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Object Header Address</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Cache Type</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br><br>Scratch-pad Space (16 bytes)<br><br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Name Offset</td>
+ <td>This is the byte offset into the group local
+ heap for the name of the object. The name is null
+ terminated.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Object Header Address</td>
+ <td>Every object has an object header which serves as a
+ permanent location for the object's meta data. In addition
+ to appearing in the object header, some meta data can be
+ cached in the scratch-pad space.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Cache Type</td>
+ <td>The cache type is determined from the object header.
+ It also determines the format for the scratch-pad space.
+ <br>
+ <dl compact>
+ <dt>0
+ <dd>No data is cached by the group entry. This
+ is guaranteed to be the case when an object header
+ has a link count greater than one.
+
+ <dt>1
+ <dd>Object header meta data is cached in the group
+ entry. This implies that the group
+ entry refers to another group.
+
+ <dt>2
+ <dd>The entry is a symbolic link. The first four bytes
+ of the scratch-pad space are the offset into the local
+ heap for the link value. The object header address
+ will be undefined.
+
+ <dt><em>N</em>
+ <dd>Other cache values can be defined later and
+ libraries that do not understand the new values will
+ still work properly.
+ </dl>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Reserved</td>
+ <td>These four bytes are present so that the scratch-pad
+ space is aligned on an eight-byte boundary. They are
+ always set to zero.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Scratch-pad Space</td>
+ <td>This space is used for different purposes, depending
+ on the value of the Cache Type field. Any meta-data
+ about a dataset object represented in the scratch-pad
+ space is duplicated in the object header for that
+ dataset. This meta data can include the datatype
+ and the size of the dataspace for a dataset whose datatype
+ is atomic and whose dataspace is fixed and less than
+ four dimensions.
+ Furthermore, no data is cached in the group
+ entry scratch-pad space if the object header for
+ the group entry has a link count greater than
+ one.</td>
+ </tr>
+ </table>
+ </center>
+
+ <h4>Format of the Scratch-pad Space</h4>
+
+ <p>The group entry scratch-pad space is formatted
+ according to the value in the Cache Type field.
+
+ <p>If the Cache Type field contains the value zero
+ (<code>0</code>) then no information is
+ stored in the scratch-pad space.
+
+ <p>If the Cache Type field contains the value one
+ (<code>1</code>), then the scratch-pad space
+ contains cached meta data for another object header
+ in the following format:
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Object Header Scratch-pad Format</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Address of B-tree</td>
+
+ <tr align=center>
+ <td colspan=4>Address of Name Heap</td>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of B-tree</td>
+ <td>This is the file address for the root of the
+ group's B-tree.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of Name Heap</td>
+ <td>This is the file address for the group's local
+ heap, in which are stored the symbol names.</td>
+ </tr>
+ </table>
+ </center>
+
+
+ <p>If the Cache Type field contains the value two
+ (<code>2</code>), then the scratch-pad space
+ contains cached meta data for another symbolic link
+ in the following format:
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Symbolic Link Scratch-pad Format</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Offset to Link Value</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Offset to Link Value</td>
+ <td>The value of a symbolic link (that is, the name of the
+ thing to which it points) is stored in the local heap.
+ This field is the 4-byte offset into the local heap for
+ the start of the link value, which is null terminated.</td>
+ </tr>
+ </table>
+ </center>
+
+ <h3><a name="LocalHeap">Disk Format: Level 1D - Local Heaps</a></h3>
+
+ <p>A heap is a collection of small heap objects. Objects can be
+ inserted and removed from the heap at any time.
+ The address of a heap does not change once the heap is created.
+ References to objects are stored in the group table;
+ the names of those objects are stored in the local heap.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Local Heaps</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Heap Signature</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved (zero)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Data Segment Size</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Offset to Head of Free-list (&lt;size&gt; bytes)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Address of Data Segment</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Heap Signature</td>
+ <td>The ASCII character string <code>HEAP</code>
+ is used to indicate the
+ beginning of a heap. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Data Segment Size</td>
+ <td>The total amount of disk memory allocated for the heap
+ data. This may be larger than the amount of space
+ required by the object stored in the heap. The extra
+ unused space holds a linked list of free blocks.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Offset to Head of Free-list</td>
+ <td>This is the offset within the heap data segment of the
+ first free block (or all 0xff bytes if there is no free
+ block). The free block contains &lt;size&gt; bytes that
+ are the offset of the next free chunk (or all 0xff bytes
+ if this is the last free chunk) followed by &lt;size&gt;
+ bytes that store the size of this free chunk.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of Data Segment</td>
+ <td>The data segment originally starts immediately after
+ the heap header, but if the data segment must grow as a
+ result of adding more objects, then the data segment may
+ be relocated, in its entirety, to another part of the
+ file.</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>Objects within the heap should be aligned on an 8-byte boundary.
+
+ <h3><a name="GlobalHeap">Disk Format: Level 1E - Global Heap</a></h3>
+
+ <p>Each HDF5 file has a global heap which stores various types of
+ information which is typically shared between datasets. The
+ global heap was designed to satisfy these goals:
+
+ <ol type="A">
+ <li>Repeated access to a heap object must be efficient without
+ resulting in repeated file I/O requests. Since global heap
+ objects will typically be shared among several datasets, it is
+ probable that the object will be accessed repeatedly.
+
+ <br><br>
+ <li>Collections of related global heap objects should result in
+ fewer and larger I/O requests. For instance, a dataset of
+ void pointers will have a global heap object for each
+ pointer. Reading the entire set of void pointer objects
+ should result in a few large I/O requests instead of one small
+ I/O request for each object.
+
+ <br><br>
+ <li>It should be possible to remove objects from the global heap
+ and the resulting file hole should be eligible to be reclaimed
+ for other uses.
+ <br><br>
+ </ol>
+
+ <p>The implementation of the heap makes use of the memory
+ management already available at the file level and combines that
+ with a new top-level object called a <em>collection</em> to
+ achieve Goal B. The global heap is the set of all collections.
+ Each global heap object belongs to exactly one collection and
+ each collection contains one or more global heap objects. For
+ the purposes of disk I/O and caching, a collection is treated as
+ an atomic object.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>A Global Heap Collection</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Magic Number</td>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td colspan=3>Reserved</td>
+ </td>
+
+ <tr align=center>
+ <td colspan=4>Collection Size</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Global Heap Object 1
+ <i>(described below)</i><br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Global Heap Object 2<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>...<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Global Heap Object <em>N</em><br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Global Heap Object 0 (free space)<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Magic Number</td>
+ <td>The magic number for global heap collections are the
+ four bytes <code>G</code>, <code>C</code>, <code>O</code>,
+ and <code>L</code>.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Version</td>
+ <td>Each collection has its own version number so that new
+ collections can be added to old files. This document
+ describes version zero of the collections.
+ </tr>
+
+ <tr valign=top>
+ <td>Collection Data Size</td>
+ <td>This is the size in bytes of the entire collection
+ including this field. The default (and minimum)
+ collection size is 4096 bytes which is a typical file
+ system block size and which allows for 170 16-byte heap
+ objects plus their overhead.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Object 1 through <em>N</em></td>
+ <td>The objects are stored in any order with no
+ intervening unused space.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Object 0</td>
+ <td>Object 0 (zero), when present, represents the free space in
+ the collection. Free space always appears at the end of
+ the collection. If the free space is too small to store
+ the header for Object 0 (described below) then the
+ header is implied and the collection contains no free space.
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Global Heap Object</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Object ID</td>
+ <td colspan=2>Reference Count</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Object Data Size</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Object Data<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Object ID</td>
+ <td>Each object has a unique identification number within a
+ collection. The identification numbers are chosen so that
+ new objects have the smallest value possible with the
+ exception that the identifier <code>0</code> always refers to the
+ object which represents all free space within the
+ collection.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Reference Count</td>
+ <td>All heap objects have a reference count field. An
+ object which is referenced from some other part of the
+ file will have a positive reference count. The reference
+ count for Object 0 is always zero.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Reserved</td>
+ <td>Zero padding to align next field on an 8-byte
+ boundary.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Object Size</td> <td>This is the size of the the fields
+ above plus the object data stored for the object. The
+ actual storage size is rounded up to a multiple of
+ eight.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Object Data</td>
+ <td>The object data is treated as a one-dimensional array
+ of bytes to be interpreted by the caller.</td>
+ </tr>
+ </table>
+ </center>
+
+ <h3><a name="FreeSpaceIndex">Disk Format: Level 1F - Free-space Heap</a></h3>
+
+ <p>The Free-space Index is a collection of blocks of data,
+ dispersed throughout the file, which are currently not used by
+ any file objects.
+
+ <p>The super block contains a pointer to root of the free-space description;
+ that pointer is currently (i.e., in HDF5 Release 1.2) required
+ to be the undefined address <code>0xfff...ff</code>.
+
+ <p>The free-sapce index is not otherwise publicly defined at this time.
+
+
+ <!--
+ <p>The Free-space Index is a collection of blocks of data,
+ dispersed throughout the file, which are currently not used by
+ any file objects. The blocks of data are indexed by a B-tree of
+ their length within the file.
+
+
+ <p>Each B-tree page is composed of the following entries and
+ B-tree management information, organized as follows:
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Free-space Heap Page</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Free-space Heap Signature</td>
+ <tr align=center>
+ <td colspan=4>B-tree Left-link Offset</td>
+ <tr align=center>
+ <td colspan=4><br>Length of Free-block #1<br> <br></td>
+ <tr align=center>
+ <td colspan=4><br>Offset of Free-block #1<br> <br></td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4><br>Length of Free-block #n<br> <br></td>
+ <tr align=center>
+ <td colspan=4><br>Offset of Free-block #n<br> <br></td>
+ <tr align=center>
+ <td colspan=4>"High" Offset</td>
+ <tr align=center>
+ <td colspan=4>Right-link Offset</td>
+ </table>
+ </center>
+
+ <p>
+ <dl>
+ <dt> The elements of the free-space heap page are described below:
+ <dd>
+ <dl>
+ <dt>Free-space Heap Signature: (4 bytes)
+ <dd>The ASCII character string <code>FREE</code>
+ is used to indicate the
+ beginning of a free-space heap B-tree page. This gives
+ file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+
+ <dt>B-tree Left-link Offset: (&lt;offset&gt; bytes)
+ <dd>This value is used to indicate the offset of all offsets
+ in the B-link-tree which are smaller than the value of the
+ offset in entry #1. This value is also used to indicate a
+ leaf node in the B-link-tree by being set to all ones.
+
+ <dt>Length of Free-block #n: (&lt;length&gt; bytes)
+ <dd>This value indicates the length of an unused block in
+ the file.
+
+ <dt>Offset of Free-block #n: (&lt;offset&gt; bytes)
+ <dd>This value indicates the offset in the file of an
+ unused block in the file.
+
+ <dt>"High" Offset: (4-bytes)
+ <dd>This offset is used as the upper bound on offsets
+ contained within a page when the page has been split.
+
+ <dt>Right-link Offset: (&lt;offset&gt; bytes)
+ <dd>This value is used to indicate the offset of the next
+ child to the right of the parent of this group
+ page. When there is no node to the right, this value is
+ all zeros.
+ </dl>
+ </dl>
+
+ <p>The algorithms for searching and inserting objects in the
+ B-tree pages are described fully in the Lehman and Yao paper,
+ which should be read to provide a full description of the
+ B-tree's usage.
+-->
+
+
+<br><br>
+<br><br>
+
+
+ <h2><a name="DataObject">Disk Format: Level 2 - Data Objects </a></h2>
+
+ <p>Data objects contain the real information in the file. These
+ objects compose the scientific data and other information which
+ are generally thought of as "data" by the end-user. All the
+ other information in the file is provided as a framework for
+ these data objects.
+
+ <p>A data object is composed of header information and data
+ information. The header information contains the information
+ needed to interpret the data information for the data object as
+ well as additional "meta-data" or pointers to additional
+ "meta-data" used to describe or annotate each data object.
+
+ <h3><a name="ObjectHeader">
+ Disk Format: Level 2a - Data Object Headers</a></h3>
+
+ <p>The header information of an object is designed to encompass
+ all the information about an object which would be desired to be
+ known, except for the data itself. This information includes
+ the dimensionality, number-type, information about how the data
+ is stored on disk (in external files, compressed, broken up in
+ blocks, etc.), as well as other information used by the library
+ to speed up access to the data objects or maintain a file's
+ integrity. The header of each object is not necessarily located
+ immediately prior to the object's data in the file and in fact
+ may be located in any position in the file.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Object Headers</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=1 width="25%">Version # of Object Header</td>
+ <td colspan=1 width="25%">Reserved</td>
+ <td colspan=2 width="50%">Number of Header Messages</td>
+ </tr>
+ <tr align=center>
+ <td colspan=4>Object Reference Count</td>
+ </tr>
+ <tr align=center>
+ <td colspan=4><br>Total Object Header Size<br><br></td>
+ </tr>
+ <tr align=center>
+ <td colspan=2>Header Message Type #1</td>
+ <td colspan=2>Size of Header Message Data #1</td>
+ </tr>
+ <tr align=center>
+ <td>Flags</td>
+ <td colspan=3>Reserved</td>
+ </tr>
+ <tr align=center>
+ <td colspan=4><br>Header Message Data #1<br><br></td>
+ </tr>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ </tr>
+ <tr align=center>
+ <td colspan=2>Header Message Type #n</td>
+ <td colspan=2>Size of Header Message Data #n</td>
+ </tr>
+ <tr align=center>
+ <td>Flags</td>
+ <td colspan=3>Reserved</td>
+ </tr>
+ <tr align=center>
+ <td colspan=4><br>Header Message Data #n<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version number of the object header</td>
+ <td>This value is used to determine the format of the
+ information in the object header. When the format of the
+ information in the object header is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Reserved</td>
+ <td>Always set to zero.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Number of header messages</td>
+ <td>This value determines the number of messages listed in
+ this object header. This provides a fast way for software
+ to prepare storage for the messages in the header.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Object Reference Count</td>
+ <td>This value specifies the number of references to this
+ object within the current file. References to the
+ data object from external files are not tracked.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Total Object Header Size</td>
+ <td>This value specifies the total number of bytes of header
+ message data following this length field for the current
+ message as well as any continuation data located elsewhere
+ in the file.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Header Message Type</td>
+ <td>The header message type specifies the type of
+ information included in the header message data following
+ the type along with a small amount of other information.
+ Bit 15 of the message type is set if the message is
+ constant (constant messages cannot be changed since they
+ may be cached in group entries throughout the
+ file). The header message types for the pre-defined
+ header messages will be included in further discussion
+ below.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Size of Header Message Data</td>
+ <td>This value specifies the number of bytes of header
+ message data following the header message type and length
+ information for the current message. The size includes
+ padding bytes to make the message a multiple of eight
+ bytes.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Flags</td>
+ <td>This is a bit field with the following definition:
+ <dl>
+ <dt><code>0</code>
+ <dd>If set, the message data is constant. This is used
+ for messages like the datatype message of a dataset.
+ <dt><code>1</code>
+ <dd>If set, the message is stored in the global heap and
+ the Header Message Data field contains a Shared Object
+ message and the Size of Header Message Data field
+ contains the size of that Shared Object message.
+ <dt><code>2-7</code>
+ <dd>Reserved
+ </dl>
+ </td>
+
+ <tr valign=top>
+ <td>Header Message Data</td>
+ <td>The format and length of this field is determined by the
+ header message type and size respectively. Some header
+ message types do not require any data and this information
+ can be eliminated by setting the length of the message to
+ zero. The data is padded with enough zeros to make the
+ size a multiple of eight.</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>The header message types and the message data associated with
+ them compose the critical "meta-data" about each object. Some
+ header messages are required for each object while others are
+ optional. Some optional header messages may also be repeated
+ several times in the header itself, the requirements and number
+ of times allowed in the header will be noted in each header
+ message description below.
+
+ <P>The following is a list of currently defined header messages:
+
+ <hr>
+ <h4><a name="NILMessage">Name: NIL</a></h4>
+ <b>Type: </b>0x0000<br>
+ <b>Length:</b> varies<br>
+ <b>Status:</b> Optional, may be repeated.<br>
+ <b>Purpose and Description:</b> The NIL message is used to
+ indicate a message
+ which is to be ignored when reading the header messages for a data object.
+ [Probably one which has been deleted for some reason.]<br>
+ <b>Format of Data:</b> Unspecified.<br>
+
+<!-- Delete examples throughout doc
+ <b>Examples:</b> None.
+-->
+
+
+ <hr>
+ <h4><a name="SimpleDataSpace">Name: Simple Dataspace</a></h4>
+
+ <b>Type: </b>0x0001<br>
+ <b>Length:</b> Varies according to the number of dimensions,
+ as described in the following table<br>
+ <b>Status:</b> The <em>Simple Dataspace</em> message is required
+ and may not be repeated. This message is currently used with
+ datasets and named dataspaces.<br>
+
+ <p>The <em>Simple Dataspace</em> message describes the number
+ of dimensions and size of each dimension that the data object
+ has. This message is only used for datasets which have a
+ simple, rectilinear grid layout; datasets requiring a more
+ complex layout (irregularly structured or unstructured grids, etc.)
+ must use the <em>Complex Dataspace</em> message for expressing
+ the space the dataset inhabits.
+ <i>(Note: The <em>Complex Dataspace</em> functionality is
+ not yet implemented (as of HDF5 Release 1.2). It is not described
+ in this document.)</i>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Simple Dataspace Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Flags</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Dimension Size #1 (&lt;size&gt; bytes)</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Dimension Size #n (&lt;size&gt; bytes)</td>
+ <tr align=center>
+ <td colspan=4>Dimension Maximum #1 (&lt;size&gt; bytes)</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Dimension Maximum #n (&lt;size&gt; bytes)</td>
+ <tr align=center>
+ <td colspan=4>Permutation Index #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Permutation Index #n</td>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version </td>
+ <td>This value is used to determine the format of the
+ Simple Dataspace Message. When the format of the
+ information in the message is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Dimensionality</td>
+ <td>This value is the number of dimensions that the data
+ object has.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Flags</td>
+ <td>This field is used to store flags to indicate the
+ presence of parts of this message. Bit 0 (the least
+ significant bit) is used to indicate that maximum
+ dimensions are present. Bit 1 is used to indicate that
+ permutation indices are present for each dimension.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Dimension Size #n (&lt;size&gt; bytes)</td>
+ <td>This value is the current size of the dimension of the
+ data as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Dimension Maximum #n (&lt;size&gt; bytes)</td>
+ <td>This value is the maximum size of the dimension of the
+ data as stored in the file. This value may be the special
+ value &lt;UNLIMITED&gt; (all bits set) which indicates
+ that the data may expand along this dimension
+ indefinitely. If these values are not stored, the maximum
+ value of each dimension is assumed to be the same as the
+ current size value.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Permutation Index #n (4 bytes)</td>
+ <td>This value is the index permutation used to map
+ each dimension from the canonical representation to an
+ alternate axis for each dimension. If these values are
+ not stored, the first dimension stored in the list of
+ dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.</td>
+ </tr>
+ </table>
+ </center>
+
+<!-- Delete examples throughout doc
+ <h4>Examples</h4>
+ <dl>
+ <dt> Example #1
+ <dd>A sample 640 horizontally by 480 vertically raster image
+ dimension header. The number of dimensions would be set to 2
+ and the first dimension's size and maximum would both be set
+ to 480. The second dimension's size and maximum would both be
+ set to 640
+.
+ <dt>Example #2
+ <dd>A sample 4 dimensional scientific dataset which is composed
+ of 30x24x3 slabs of data being written out in an unlimited
+ series every several minutes as timestep data (currently there
+ are five slabs). The number of dimensions is 4. The first
+ dimension size is 5 and its maximum is &lt;UNLIMITED&gt;. The
+ second through fourth dimension's size and maximum value are
+ set to 3, 24, and 30 respectively.
+
+ <dt>Example #3
+ <dd>A sample unlimited length text string, currently of length
+ 83. The number of dimensions is 1, the size of the first
+ dimension is 83 and the maximum of the first dimension is set
+ to &lt;UNLIMITED&gt;, allowing further text data to be
+ appended to the string or possibly the string to be replaced
+ with another string of a different size. (This could also be
+ stored as a scalar dataset with number-type set to "string")
+ </dl>
+-->
+
+<!-- DELETE ENTIRE DATASPACE SECTION -->
+<!--
+ <hr>
+ <h4><a name="DataSpaceMessage">Name: Complex Dataspace (Fiber Bundle?)</a></h4>
+ <b>Type: </b>0x0002<br>
+ <b>Length:</b> varies<br>
+
+ <b>Status:</b> One of the <em>Simple Dataspace</em> or
+ <em>Complex Dataspace</em> messages is required (but not both) and may
+ not be repeated.<br> <b>Purpose and Description:</b> The
+ <em>Dataspace</em> message describes space that the dataset is
+ mapped onto in a more comprehensive way than the <em>Simple
+ Dimensionality</em> message is capable of handling. The
+ dataspace of a dataset encompasses the type of coordinate system
+ used to locate the dataset's elements as well as the structure and
+ regularity of the coordinate system. The dataspace also
+ describes the number of dimensions which the dataset inhabits as
+ well as a possible higher dimensional space in which the dataset
+ is located within.
+
+ <br>
+ <b>Format of Data:</b>
+
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Message Layout</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Mesh Type</td>
+ <tr align=center>
+ <td colspan=4>Logical Dimensionality</td>
+ </table>
+ </center>
+
+ <p>
+ <dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Mesh Type: (unsigned 32-bit integer)
+ <dd>This value indicates whether the grid is
+ polar/spherical/cartesion,
+ structured/unstructured and regular/irregular. <br>
+ The mesh type value is broken up as follows: <br>
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Mesh-type Layout</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=1>Mesh Embedding</td>
+ <td colspan=1>Coordinate System</td>
+ <td colspan=1>Structure</td>
+ <td colspan=1>Regularity</td>
+ </table>
+ </center>
+ The following are the definitions of mesh-type bytes:
+ <dl>
+ <dt>Mesh Embedding
+ <dd>This value indicates whether the dataset dataspace
+ is located within
+ another dataspace or not:
+ <dl> <dl>
+ <dt>&lt;STANDALONE&gt;
+ <dd>The dataset mesh is self-contained and is not
+ embedded in another mesh.
+ <dt>&lt;EMBEDDED&gt;
+ <dd>The dataset's dataspace is located within
+ another dataspace, as
+ described in information below.
+ </dl> </dl>
+ <dt>Coordinate System
+ <dd>This value defines the type of coordinate system
+ used for the mesh:
+ <dl> <dl>
+ <dt>&lt;POLAR&gt;
+ <dd>The last two dimensions are in polar
+ coordinates, higher dimensions are
+ cartesian.
+ <dt>&lt;SPHERICAL&gt;
+ <dd>The last three dimensions are in spherical
+ coordinates, higher dimensions
+ are cartesian.
+ <dt>&lt;CARTESIAN&gt;
+ <dd>All dimensions are in cartesian coordinates.
+ </dl> </dl>
+ <dt>Structure
+ <dd>This value defines the locations of the grid-points
+ on the axes:
+ <dl> <dl>
+ <dt>&lt;STRUCTURED&gt;
+ <dd>All grid-points are on integral, sequential
+ locations, starting from 0.
+ <dt>&lt;UNSTRUCTURED&gt;
+ <dd>Grid-points locations in each dimension are
+ explicitly defined and
+ may be of any numeric datatype.
+ </dl> </dl>
+ <dt>Regularity
+ <dd>This value defines the locations of the dataset
+ points on the grid:
+ <dl> <dl>
+ <dt>&lt;REGULAR&gt;
+ <dd>All dataset elements are located at the
+ grid-points defined.
+ <dt>&lt;IRREGULAR&gt;
+ <dd>Each dataset element has a particular
+ grid-location defined.
+ </dl> </dl>
+ </dl>
+ <p>The following grid combinations are currently allowed:
+ <dl> <dl>
+ <dt>&lt;POLAR-STRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-STRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-STRUCTURED-REGULAR&gt;
+ <dt>&lt;POLAR-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-IRREGULAR&gt;
+ </dl> </dl>
+ All of the above grid types can be embedded within another
+ dataspace.
+ <br> <br>
+ <dt>Logical Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions that the dataset occupies.
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Embedded Dimensionality Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Embedded Dimensionality</td>
+ <tr align=center>
+ <td colspan=4>Embedded Dimension Size #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Embedded Dimension Size #n</td>
+ <tr align=center>
+ <td colspan=4>Embedded Origin Location #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Embedded Origin Location #n</td>
+ </table>
+ </center>
+
+ <dt>Embedded Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions of the space the
+ dataset is located
+ within. i.e. a planar dataset located within a 3-D space,
+ or a 3-D dataset
+ which is a subset of another 3-D space, etc.
+ <dt>Embedded Dimension Size: (unsigned 32-bit integer)
+ <dd>These values are the sizes of the dimensions of the
+ embedded dataspace
+ that the dataset is located within.
+ <dt>Embedded Origin Location: (unsigned 32-bit integer)
+ <dd>These values comprise the location of the dataset's
+ origin within the embedded dataspace.
+ </dl>
+ </dl>
+ [Comment: need some way to handle different orientations of the
+ dataset dataspace
+ within the embedded dataspace]<br>
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Structured/Regular Grid Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Logical Dimension Size #1</td>
+ <tr align=center>
+ <td colspan=4>Logical Dimension Maximum #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Logical Dimension Size #n</td>
+ <tr align=center>
+ <td colspan=4>Logical Dimension Maximum #n</td>
+ </table>
+ </center>
+
+ <p>
+ <dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Logical Dimension Size #n: (unsigned 32-bit integer)
+ <dd>This value is the current size of the dimension of the
+ data as stored in
+ the file. The first dimension stored in the list of
+ dimensions is the slowest
+ changing dimension and the last dimension stored is the
+ fastest changing
+ dimension.
+ <dt>Logical Dimension Maximum #n: (unsigned 32-bit integer)
+ <dd>This value is the maximum size of the dimension of the
+ data as stored in
+ the file. This value may be the special value
+ &lt;UNLIMITED&gt; which
+ indicates that the data may expand along this dimension
+ indefinitely.
+ </dl>
+ </dl>
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Structured/Irregular Grid Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4># of Grid Points in Dimension #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4># of Grid Points in Dimension #n</td>
+ <tr align=center>
+ <td colspan=4>Datatype of Grid Point Locations</td>
+ <tr align=center>
+ <td colspan=4>Location of Grid Points in Dimension #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Location of Grid Points in Dimension #n</td>
+ </table>
+ </center>
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Unstructured Grid Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4># of Grid Points</td>
+ <tr align=center>
+ <td colspan=4>Datatype of Grid Point Locations</td>
+ <tr align=center>
+ <td colspan=4>Grid Point Locations<br>.<br>.<br></td>
+ </table>
+ </center>
+
+ <h4><a name="DataSpaceExample">Examples:</a></h4>
+ Need some good examples, this is complex!
+-->
+
+
+ <hr>
+ <h4><a name="DataTypeMessage">Name: Datatype</a></h4>
+
+ <b>Type:</b> 0x0003<br>
+ <b>Length:</b> variable<br>
+ <b>Status:</b> One required per dataset or named datatype<br>
+
+ <p>The datatype message defines the datatype for each data point
+ of a dataset. A datatype can describe an atomic type like a
+ fixed- or floating-point type or a compound type like a C
+ struct. A datatype does not, however, describe how data points
+ are combined to produce a dataset. Datatypes are stored on disk
+ as a datatype message, which is a list of datatype classes and
+ their associated properties.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Datatype Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td>Type Class and Version</td>
+ <td colspan=3>Class Bit Field</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Size in Bytes (4 bytes)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br><br>Properties<br><br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>The Class Bit Field and Properties fields vary depending
+ on the Type Class, which is the low-order four bits of the Type
+ Class and Version field (the high-order four bits are the
+ version, which should be set to the value one). The type class
+ is one of 0 (fixed-point number), 1 (floating-point number),
+ 2 (date and time), 3 (text string), 4 (bit field), 5 (opaque),
+ 6 (compound), 7 (reference), 8 (enumeration), or 9 (variable-length).
+ The Class Bit Field is zero and the size of the
+ Properties field is zero except for the cases noted here.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Fixed-point Numbers (Class 0)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0</td>
+ <td><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>1, 2</td>
+ <td><b>Padding type.</b> Bit 1 is the lo_pad type and bit 2
+ is the hi_pad type. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>3</td>
+ <td><b>Signed.</b> If this bit is set then the fixed-point
+ number is in 2's complement form.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>4-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Properties for Fixed-point Numbers (Class 0)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Bit Offset</td>
+ <td colspan=2>Bit Precision</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Floating-point Numbers (Class 1)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0</td>
+ <td><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>1, 2, 3</td>
+ <td><b>Padding type.</b> Bit 1 is the low bits pad type, bit 2
+ is the high bits pad type, and bit 3 is the internal bits
+ pad type. If a datum has unused bits at either or between
+ the sign bit, exponent, or mantissa, then the value of bit
+ 1, 2, or 3 is copied to those locations.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>4-5</td>
+ <td><b>Normalization.</b> The value can be 0 if there is no
+ normalization, 1 if the most significant bit of the
+ mantissa is always set (except for 0.0), and 2 if the most
+ signficant bit of the mantissa is not stored but is
+ implied to be set. The value 3 is reserved and will not
+ appear in this field.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>6-7</td>
+ <td>Reserved (zero).</td>
+ </tr>
+
+ <tr valign=top>
+ <td>8-15</td>
+ <td><b>Sign.</b> This is the bit position of the sign
+ bit.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>16-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Properties for Floating-point Numbers (Class 1)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Bit Offset</td>
+ <td colspan=2>Bit Precision</td>
+ </tr>
+
+ <tr align=center>
+ <td>Exponent Location</td>
+ <td>Exponent Size in Bits</td>
+ <td>Mantissa Location</td>
+ <td>Mantissa Size in Bits</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Exponent Bias</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Strings (Class 3)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0-3</td>
+ <td><b>Padding type.</b> This four-bit value determines the
+ type of padding to use for the string. The values are:
+
+ <dl>
+ <dt><code>0</code> Null terminate.
+ <dd>A zero byte marks the end of the string and is
+ guaranteed to be present after converting a long
+ string to a short string. When converting a short
+ string to a long string the value is padded with
+ additional null characters as necessary.
+
+ <br><br>
+ <dt><code>1</code> Null pad.
+ <dd>Null characters are added to the end of the value
+ during conversions from short values to long values
+ but conversion in the opposite direction simply
+ truncates the value.
+
+ <br><br>
+ <dt><code>2</code> Space pad.
+ <dd>Space characters are added to the end of the value
+ during conversions from short values to long values
+ but conversion in the opposite direction simply
+ truncates the value. This is the Fortran
+ representation of the string.
+
+ <br><br>
+ <dt><code>3-15</code> Reserved.
+ <dd>These values are reserved for future use.
+ </dl>
+ </tr>
+
+ <tr valign=top>
+ <td>4-7</td>
+ <td><b>Character Set.</b> The character set to use for
+ encoding the string. The only character set supported is
+ the 8-bit ASCII (zero) so no translations have been defined
+ yet.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>8-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Bitfield Types (Class 4)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0</td>
+ <td><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>1, 2</td>
+ <td><b>Padding type.</b> Bit 1 is the lo_pad type and bit 2
+ is the hi_pad type. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>3-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Properties for Bitfield Types (Class 4)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Bit Offset</td>
+ <td colspan=2>Bit Precision</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Opaque Types (Class 5)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Properties for Opaque Types (Class 5)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Null-terminated ASCII Tag<br>
+ (multiple of 8 bytes)<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Compound Types (Class 6)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0-15</td>
+ <td><b>Number of Members.</b> This field contains the number
+ of members defined for the compound datatype. The member
+ definitions are listed in the Properties field of the data
+ type message.
+ </tr>
+
+ <tr valign=top>
+ <td>15-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>The Properties field of a compound datatype is a list of the
+ member definitions of the compound datatype. The member
+ definitions appear one after another with no intervening bytes.
+ The member types are described with a recursive datatype
+ message.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Properties for Compound Types (Class 6)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br><br>Name (null terminated, multiple of
+ eight bytes)<br><br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Byte Offset of Member in Compound Instance</td>
+ </tr>
+
+ <tr align=center>
+ <td>Dimensionality</td>
+ <td colspan=3>reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Dimension Permutation</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Size of Dimension 0 (required)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Size of Dimension 1 (required)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Size of Dimension 2 (required)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Size of Dimension 3 (required)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br><br>Member Type Message<br><br><br></td>
+ </tr>
+
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Enumeration Types (Class 8)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0-15</td>
+ <td><b>Number of Members.</b> The number of name/value
+ pairs defined for the enumeration type.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>16-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Properties for Enumeration Types (Class 8)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Parent Type<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Names<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Values<br><br></td>
+ </tr>
+
+ </table>
+ </center>
+
+ <center>
+ <table border=0 cellpadding=4 width="80%">
+ <tr align=left valign=top>
+ <td valign=top width=20%>Parent Type:</td>
+ <td valign=top>Each enumeration type is based on some parent type,
+ usually an integer. The information for that parent type is
+ described recursively by this field.</td>
+ </tr><tr align=left valign=top>
+ <td valign=top>Names:</td>
+ <td valign=top>The name for each name/value pair. Each name is
+ stored as a null terminated ASCII string in a multiple of
+ eight bytes. The names are in no particular order.</td>
+ </tr><tr align=left valign=top>
+ <td valign=top>Values:</td>
+ <td valign=top>The list of values in the same order as the names.
+ The values are packed (no inter-value padding) and the
+ size of each value is determined by the parent type.</td>
+ </tr>
+ </table>
+ </center>
+
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Bit Field for Variable-length Types (Class 9)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="10%">Bits</th>
+ <th width="90%">Meaning</th>
+ </tr>
+
+ <tr valign=top>
+ <td>0-3</td>
+ <td><dl><dt><b>Type</b></dt>
+ <dt>0 Variable-length sequence</dt>
+ <dd>This variable-length datatype can be of any sequence
+ of data. Variable-length sequences do not have padding
+ or character set information.</dd>
+ <dt>1 Variable-length string</dt>
+ <dd>This variable-length datatype is composed of a series of
+ characters. Variable-length strings have padding and
+ character set information.</dd></dl>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>4-7</td>
+ <td><dl><dt><b>Padding type</b> (variable-length string only)</dt>
+ <dd>This four-bit value determines the type of padding
+ used for variable-length strings. The values are the same
+ as for the string padding type, as follows:</dd>
+ <dt>0 Null terminate</dt>
+ <dd>A zero byte marks the end of a string and is guaranteed
+ to be present after converting a long string to a short
+ string. When converting a short string to a long string,
+ the value is padded with additional null characters
+ as necessary.
+ <dt>1 Null pad</dt>
+ <dd>Null characters are added to the end of the value
+ during conversion from a short string to a longer string.
+ Conversion from a long string to a shorter string
+ simply truncates the value.</dd>
+ <dt>2 Space pad</dt>
+ <dd>Space characters are added to the end of the value
+ during conversion from a short string to a longer string.
+ Conversion from a long string to a shorter string simply
+ truncates the value.
+ This is the Fortran representation of the string.
+ </dd>
+ <dt>3-15 Reserved</dt>
+ <dd>These values are reserved for future use.</dd></dl>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>8-11</td>
+ <td><dl><dt><b>Character set</b> (variable-length string only)</dt>
+ <dd>This four-bit value specifies the character set
+ to be used for encoding the string.</dd>
+ <dt>0 8-bit ASCII</dt>
+ <dd>As of this writing (July 2002, Release 1.4.4),
+ 8-bit ASCII is the only character set supported.
+ Therefore, no translations have been defined.</dd></dl>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>12-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Properties for Variable-length Types (Class 9)</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Parent Type<br><br></td>
+ </tr>
+
+ </table>
+ </center>
+
+ <center>
+ <table border=0 cellpadding=4 width="80%">
+ <tr align=left valign=top>
+ <td valign=top width=20%>Parent Type:</td>
+ <td valign=top>Each variable-length type is based on
+ some parent type. The information for that parent type is
+ described recursively by this field.</td>
+ </tr>
+ </table>
+ </center>
+
+
+
+ <p>
+
+<!--
+ <p>Datatype examples are <a href="Datatypes.html">here</a>.
+-->
+
+
+ <hr>
+ <h4><a name="FillValueMessage">Name: Data Storage - Fill Value</a></h4>
+ <b>Type:</b> 0x0004<br>
+ <b>Length:</b> varies<br>
+ <b>Status:</b> Optional, may not be repeated.<br>
+
+ <p>The fill value message stores a single data point value which
+ is returned to the application when an uninitialized data point
+ is read from the dataset. The fill value is interpretted with
+ the same datatype as the dataset. If no fill value message is
+ present then a fill value of all zero is assumed.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Fill Value Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Size (4 bytes)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Fill Value<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Size (4 bytes)</td>
+ <td>This is the size of the Fill Value field in bytes.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Fill Value</td>
+ <td>The fill value. The bytes of the fill value are
+ interpreted using the same datatype as for the dataset.</td>
+ </tr>
+ </table>
+ </center>
+
+ <hr>
+ <h4><a name="ReservedMessage_0005">Name: Reserved - Not Assigned Yet</a></h4>
+ <b>Type:</b> 0x0005<br>
+ <b>Length:</b> N/A<br>
+ <b>Status:</b> N/A<br>
+
+
+
+ <hr>
+ <h4><a name="CompactDataStorageMessage">Name: Data Storage - Compact</a></h4>
+
+ <b>Type:</b> 0x0006<br>
+ <b>Length:</b> varies<br>
+ <b>Status:</b> Optional, may not be repeated.<br>
+
+ <p>This message indicates that the data for the data object is
+ stored within the current HDF file by including the actual
+ data as the header data for this message. The data is
+ stored internally in
+ the <em>normal format</em>, i.e. in one chunk, uncompressed, etc.
+
+ <P>Note that one and only one of the <em>Data Storage</em> headers can be
+ stored for each data object.
+
+ <P><b>Format of Data:</b> The message data is actually composed
+ of dataset data, so the format will be determined by the dataset
+ format.
+
+<!-- Delete examples throughout doc
+ <h4><a name="CompactDataStorageExample">Examples:</a></h4>
+ [very straightforward]
+-->
+
+ <hr>
+ <h4><a name="ExternalFileListMessage">Name: Data Storage -
+ External Data Files</a></h4>
+ <b>Type:</b> 0x0007<BR>
+ <b>Length:</b> varies<BR>
+ <b>Status:</b> Optional, may not be repeated.<BR>
+
+ <p><b>Purpose and Description:</b> The external object message
+ indicates that the data for an object is stored outside the HDF5
+ file. The filename of the object is stored as a Universal
+ Resource Location (URL) of the actual filename containing the
+ data. An external file list record also contains the byte offset
+ of the start of the data within the file and the amount of space
+ reserved in the file for that data.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>External File List Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td colspan=3>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Allocated Slots</td>
+ <td colspan=2>Used Slots</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Heap Address<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Slot Definitions...<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version </td>
+ <td>This value is used to determine the format of the
+ External File List Message. When the format of the
+ information in the message is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Reserved</td>
+ <td>This field is reserved for future use.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Allocated Slots</td>
+ <td>The total number of slots allocated in the message. Its
+ value must be at least as large as the value contained in
+ the Used Slots field.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Used Slots</td>
+ <td>The number of initial slots which contain valid
+ information. The remaining slots are zero filled.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Heap Address</td>
+ <td>This is the address of a local name heap which contains
+ the names for the external files. The name at offset zero
+ in the heap is always the empty string.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Slot Definitions</td>
+ <td>The slot definitions are stored in order according to
+ the array addresses they represent. If more slots have
+ been allocated than what has been used then the defined
+ slots are all at the beginning of the list.</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>External File List Slot</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Name Offset (&lt;size&gt; bytes)<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>File Offset (&lt;size&gt; bytes)<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Size<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Name Offset (&lt;size&gt; bytes)</td>
+ <td>The byte offset within the local name heap for the name
+ of the file. File names are stored as a URL which has a
+ protocol name, a host name, a port number, and a file
+ name:
+ <code><em>protocol</em>:<em>port</em>//<em>host</em>/<em>file</em></code>.
+ If the protocol is omitted then "file:" is assumed. If
+ the port number is omitted then a default port for that
+ protocol is used. If both the protocol and the port
+ number are omitted then the colon can also be omitted. If
+ the double slash and host name are omitted then
+ "localhost" is assumed. The file name is the only
+ mandatory part, and if the leading slash is missing then
+ it is relative to the application's current working
+ directory (the use of relative names is not
+ recommended).</td>
+ </tr>
+
+ <tr valign=top>
+ <td>File Offset (&lt;size&gt; bytes)</td>
+ <td>This is the byte offset to the start of the data in the
+ specified file. For files that contain data for a single
+ dataset this will usually be zero.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Size</td>
+ <td>This is the total number of bytes reserved in the
+ specified file for raw data storage. For a file that
+ contains exactly one complete dataset which is not
+ extendable, the size will usually be the exact size of the
+ dataset. However, by making the size larger one allows
+ HDF5 to extend the dataset. The size can be set to a value
+ larger than the entire file since HDF5 will read zeros
+ past the end of the file without failing.</td>
+ </tr>
+ </table>
+ </center>
+
+
+ <hr>
+ <h4><a name="LayoutMessage">Name: Data Storage - Layout</a></h4>
+
+ <b>Type:</b> 0x0008<BR>
+ <b>Length:</b> varies<BR>
+ <b>Status:</b> Required for datasets, may not be repeated.
+
+ <p><b>Purpose and Description:</b> Data layout describes how the
+ elements of a multi-dimensional array are arranged in the linear
+ address space of the file. Two types of data layout are
+ supported:
+
+ <ol>
+ <li>The array can be stored in one contiguous area of the file.
+ The layout requires that the size of the array be constant and
+ does not permit chunking, compression, checksums, encryption,
+ etc. The message stores the total size of the array and the
+ offset of an element from the beginning of the storage area is
+ computed as in C.
+
+ <li>The array domain can be regularly decomposed into chunks and
+ each chunk is allocated separately. This layout supports
+ arbitrary element traversals, compression, encryption, and
+ checksums, and the chunks can be distributed across external
+ raw data files (these features are described in other
+ messages). The message stores the size of a chunk instead of
+ the size of the entire array; the size of the entire array can
+ be calculated by traversing the B-tree that stores the chunk
+ addresses.
+ </ol>
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <B>Data Layout Message</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Layout Class</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Address<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Dimension 0 (4-bytes)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Dimension 1 (4-bytes)</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>...</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version</td>
+ <td>A version number for the layout message. This
+ documentation describes version one.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Dimensionality</td>
+ <td>An array has a fixed dimensionality. This field
+ specifies the number of dimension size fields later in the
+ message.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Layout Class</td>
+ <td>The layout class specifies how the other fields of the
+ layout message are to be interpreted. A value of one
+ indicates contiguous storage while a value of two
+ indicates chunked storage. Other values will be defined
+ in the future.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address</td>
+ <td>For contiguous storage, this is the address of the first
+ byte of storage. For chunked storage this is the address
+ of the B-tree that is used to look up the addresses of the
+ chunks.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Dimensions</td>
+ <td>For contiguous storage the dimensions define the entire
+ size of the array while for chunked storage they define
+ the size of a single chunk.</td>
+ </tr>
+ </table>
+ </center>
+
+
+ <hr>
+ <h4><a name="ReservedMessage_0009">Name: Reserved - Not Assigned Yet</a></h4>
+ <b>Type:</b> 0x0009<BR>
+ <b>Length:</b> N/A<BR>
+ <b>Status:</b> N/A<BR>
+ <b>Purpose and Description:</b> N/A<BR>
+ <b>Format of Data:</b> N/A
+
+ <hr>
+ <h4><a name="ReservedMessage_000A">Name: Reserved - Not Assigned Yet</a></h4>
+ <b>Type:</b> 0x000A<BR>
+ <b>Length:</b> N/A<BR>
+ <b>Status:</b> N/A<BR>
+ <b>Purpose and Description:</b> N/A<BR>
+ <b>Format of Data:</b> N/A
+
+ <hr>
+ <h4><a name="FilterMessage">Name: Data Storage - Filter Pipeline</a></h4>
+ <b>Type:</b> 0x000B<BR>
+ <b>Length:</b> varies<BR>
+ <b>Status:</b> Optional, may not be repeated.
+
+ <p><b>Purpose and Description:</b> This message describes the
+ filter pipeline which should be applied to the data stream by
+ providing filter identification numbers, flags, a name, an
+ client data.
+
+ <p>
+ <center>
+ <table border align=center cellpadding=4 witdh="80%">
+ <caption align=top>
+ <b>Filter Pipeline Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td>Number of Filters</td>
+ <td colspan=2>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Filter List<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version</td>
+ <td>The version number for this message. This document
+ describes version one.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Number of Filters</td>
+ <td>The total number of filters described by this
+ message. The maximum possible number of filters in a
+ message is 32.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Filter List</td>
+ <td>A description of each filter. A filter description
+ appears in the next table.</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table border align=center cellpadding=4 witdh="80%">
+ <caption align=top>
+ <b>Filter Pipeline Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Filter Identification</td>
+ <td colspan=2>Name Length</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Flags</td>
+ <td colspan=2>Client Data Number of Values</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Client Data<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Padding</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Filter Identification</td>
+ <td>This is a unique (except in the case of testing)
+ identifier for the filter. Values from zero through 255
+ are reserved for filters defined by the NCSA HDF5
+ library. Values 256 through 511 have been set aside for
+ use when developing/testing new filters. The remaining
+ values are allocated to specific filters by contacting the
+ <a href="mailto:hdf5dev@ncsa.uiuc.edu">HDF5 Development
+ Team</a>.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Name Length</td>
+ <td>Each filter has an optional null-terminated ASCII name
+ and this field holds the length of the name including the
+ null termination padded with nulls to be a multiple of
+ eight. If the filter has no name then a value of zero is
+ stored in this field.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Flags</td>
+ <td>The flags indicate certain properties for a filter. The
+ bit values defined so far are:
+
+ <dl>
+ <dt><code>bit 1</code>
+ <dd>If set then the filter is an optional filter.
+ During output, if an optional filter fails it will be
+ silently removed from the pipeline.
+ </dl>
+ </tr>
+
+ <tr valign=top>
+ <td>Client Data Number of Values</td>
+ <td>Each filter can store a few integer values to control
+ how the filter operates. The number of entries in the
+ Client Data array is stored in this field.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Name</td>
+ <td>If the Name Length field is non-zero then it will
+ contain the size of this field, a multiple of eight. This
+ field contains a null-terminated, ASCII character
+ string to serve as a comment/name for the filter.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Client Data</td>
+ <td>This is an array of four-byte integers which will be
+ passed to the filter function. The Client Data Number of
+ Values determines the number of elements in the
+ array.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Padding</td>
+ <td>Four bytes of zeros are added to the message at this
+ point if the Client Data Number of Values field contains
+ an odd number.</td>
+ </tr>
+ </table>
+ </center>
+
+ <hr>
+ <h4><a name="AttributeMessage">Name: Attribute</a></h4>
+ <b>Type:</b> 0x000C<BR>
+ <b>Length:</b> varies<BR>
+ <b>Status:</b> Optional, may be repeated.<BR>
+
+ <p><b>Purpose and Description:</b> The <em>Attribute</em>
+ message is used to list objects in the HDF file which are used
+ as attributes, or "meta-data" about the current object. An
+ attribute is a small dataset; it has a name, a datatype, a data
+ space, and raw data. Since attributes are stored in the object
+ header they must be relatively small (<64kb) and can be
+ associated with any type of object which has an object header
+ (groups, datasets, named types and spaces, etc.).
+
+ <p>
+ <center>
+ <table border align=center cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Attribute Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td>Reserved</td>
+ <td colspan=2>Name Size</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Type Size</td>
+ <td colspan=2>Space Size</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Type<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Space<br><br></td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Data<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version</td>
+ <td>Version number for the message. This document describes
+ version 1 of attribute messages.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Reserved</td>
+ <td>This field is reserved for later use and is set to
+ zero.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Name Size</td>
+ <td>The length of the attribute name in bytes including the
+ null terminator. Note that the Name field below may
+ contain additional padding not represented by this
+ field.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Type Size</td>
+ <td>The length of the datatype description in the Type
+ field below. Note that the Type field may contain
+ additional padding not represented by this field.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Space Size</td>
+ <td>The length of the dataspace description in the Space
+ field below. Note that the Space field may contain
+ additional padding not represented by this field.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Name</td>
+ <td>The null-terminated attribute name. This field is
+ padded with additional null characters to make it a
+ multiple of eight bytes.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Type</td>
+ <td>The datatype description follows the same format as
+ described for the datatype object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Space</td>
+ <td>The dataspace description follows the same format as
+ described for the dataspace object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Data</td>
+ <td>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions. This
+ field is <em>not</em> padded with additional zero
+ bytes.</td>
+ </tr>
+ </table>
+ </center>
+
+ <hr>
+ <h4><a name="NameMessage">Name: Object Name</a></h4>
+
+ <p><b>Type:</b> 0x000D<br>
+ <b>Length:</b> varies<br>
+ <b>Status:</b> Optional, may not be repeated.
+
+ <p><b>Purpose and Description:</b> The object name or comment is
+ designed to be a short description of an object. An object name
+ is a sequence of non-zero (<code>\0</code>) ASCII characters with no other
+ formatting included by the library.
+
+ <p>
+ <center>
+ <table border align=center cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Name Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Name</td>
+ <td>A null terminated ASCII character string.</td>
+ </tr>
+ </table>
+ </center>
+
+ <hr>
+ <h4><a name="ModifiedMessage">Name: Object Modification Date &amp; Time</a></h4>
+
+ <p><b>Type:</b> 0x000E<br>
+ <b>Length:</b> fixed<br>
+ <b>Status:</b> Optional, may not be repeated.
+
+ <p><b>Purpose and Description:</b> The object modification date
+ and time is a timestamp which indicates (using ISO-8601 date and
+ time format) the last modification of an object. The time is
+ updated when any object header message changes according to the
+ system clock where the change was posted.
+
+ <p>
+ <center>
+ <table border align=center cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Modification Time Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Year</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Month</td>
+ <td colspan=2>Day of Month</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Hour</td>
+ <td colspan=2>Minute</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=2>Second</td>
+ <td colspan=2>Reserved</td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Year</td>
+ <td>The four-digit year as an ASCII string. For example,
+ <code>1998</code>. All fields of this message should be interpreted
+ as coordinated universal time (UTC)</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Month</td>
+ <td>The month number as a two digit ASCII string where
+ January is <code>01</code> and December is <code>12</code>.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Day of Month</td>
+ <td>The day number within the month as a two digit ASCII
+ string. The first day of the month is <code>01</code>.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Hour</td>
+ <td>The hour of the day as a two digit ASCII string where
+ midnight is <code>00</code> and 11:00pm is <code>23</code>.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Minute</td>
+ <td>The minute of the hour as a two digit ASCII string where
+ the first minute of the hour is <code>00</code> and
+ the last is <code>59</code>.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Second</td>
+ <td>The second of the minute as a two digit ASCII string
+ where the first second of the minute is <code>00</code>
+ and the last is <code>59</code>.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Reserved</td>
+ <td>This field is reserved and should always be zero.</td>
+ </tr>
+ </table>
+ </center>
+
+ <hr>
+ <h4><a name="SharedMessage">Name: Shared Object Message</a></h4>
+ <b>Type:</b> 0x000F<br>
+ <b>Length:</b> 4 Bytes<br>
+ <b>Status:</b> Optional, may be repeated.
+
+ <p>A constant message can be shared among several object headers
+ by writing that message in the global heap and having the object
+ headers all point to it. The pointing is accomplished with a
+ Shared Object message which is understood directly by the object
+ header layer of the library. It is also possible to have a
+ message of one object header point to a message in some other
+ object header, but care must be exercised to prevent cycles.
+
+ <p>If a message is shared, then the message appears in the global
+ heap and its message ID appears in the Header Message Type
+ field of the object header. Also, the Flags field in the object
+ header for that message will have bit two set (the
+ <code>H5O_FLAG_SHARED</code> bit). The message body in the
+ object header will be that of a Shared Object message defined
+ here and not that of the pointed-to message.
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=top>
+ <b>Shared Message Message</b>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ </tr>
+
+ <tr align=center>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan=2>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr align=center>
+ <td colspan=4><br>Pointer<br><br></td>
+ </tr>
+ </table>
+ </center>
+
+ <p>
+ <center>
+ <table align=center width="80%">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th width="70%">Description</th>
+ </tr>
+
+ <tr valign=top>
+ <td>Version</td>
+ <td>The version number for the message. This document
+ describes version one of shared messages.</td>
+ </tr>
+
+ <tr valign=top>
+ <td>Flags</td>
+ <td>The Shared Message message points to a message which is
+ shared among multiple object headers. The Flags field
+ describes the type of sharing:
+
+ <dl>
+ <dt><code>Bit 0</code>
+ <dd>If this bit is clear then the actual message is the
+ first message in some other object header; otherwise
+ the actual message is stored in the global heap.
+
+ <dt><code>Bits 2-7</code>
+ <dd>Reserved (always zero)
+ </dl>
+ </tr>
+
+ <tr valign=top>
+ <td>Pointer</td>
+ <td>This field points to the actual message. The format of
+ the pointer depends on the value of the Flags field. If
+ the actual message is in the global heap then the pointer
+ is the file address of the global heap collection that
+ holds the message, and a four-byte index into that
+ collection. Otherwise the pointer is a group entry
+ that points to some other object header.</td>
+ </tr>
+ </table>
+ </center>
+
+
+<hr>
+<h4><a name="ContinuationMessage">Name: Object Header Continuation</a></h4>
+<b>Type:</b> 0x0010<BR>
+<b>Length:</b> fixed<BR>
+<b>Status:</b> Optional, may be repeated.<BR>
+<b>Purpose and Description:</b> The object header continuation is the location
+in the file of more header messages for the current data object. This can be
+used when header blocks are large, or likely to change over time.<BR>
+<b>Format of Data:</b><p>
+ The object header continuation is formatted as follows (assuming a 4-byte
+length &amp; offset are being used in the current file):
+
+<P>
+<center>
+<table border cellpadding=4 width=60%>
+<caption align=bottom>
+<B>HDF5 Object Header Continuation Message Layout</B>
+</caption>
+
+<tr align=center>
+<th width=25%>byte</th>
+<th width=25%>byte</th>
+<th width=25%>byte</th>
+<th width=25%>byte</th>
+
+<tr align=center>
+<td colspan=4>Header Continuation Offset</td>
+<tr align=center>
+<td colspan=4>Header Continuation Length</td>
+</table>
+</center>
+
+<P>
+<dl>
+<dt>The elements of the Header Continuation Message are described below:
+<dd>
+<dl>
+<dt>Header Continuation Offset: (&lt;offset&gt; bytes)
+<dd>This value is the offset in bytes from the beginning of the file where the
+header continuation information is located.
+<dt>Header Continuation Length: (&lt;length&gt; bytes)
+<dd>This value is the length in bytes of the header continuation information in
+the file.
+</dl>
+</dl>
+
+<!-- Delete examples throughout doc
+<h4><a name="ContinuationExample">Examples:</a></h4>
+ [straightforward]
+-->
+
+<hr>
+<h4><a name="SymbolTableMessage">Name: Group Message</a></h4>
+<b>Type:</b> 0x0011<BR>
+<b>Length:</b> fixed<BR>
+<b>Status:</b> Required for groups, may not be repeated.<BR>
+<b>Purpose and Description:</b> Each group has a B-tree and a
+name heap which are pointed to by this message.<BR>
+<b>Format of data:</b>
+<p>The group message is formatted as follows:
+
+<p>
+<center>
+<table border cellpadding=4 width="80%">
+<caption align=bottom>
+<b>HDF5 Object Header Group Message Layout</b>
+</caption>
+
+<tr align=center>
+<th width="25%">byte</th>
+<th width="25%">byte</th>
+<th width="25%">byte</th>
+<th width="25%">byte</th>
+
+<tr align=center>
+<td colspan=4>B-tree Address</td>
+
+<tr align=center>
+<td colspan=4>Heap Address</td>
+</table>
+</center>
+
+<P>
+<dl>
+<dt>The elements of the Group Message are described below:
+<dd>
+<dl>
+<dt>B-tree Address (&lt;offset&gt; bytes)
+<dd>This value is the offset in bytes from the beginning of the file
+where the B-tree is located.
+<dt>Heap Address (&lt;offset&gt; bytes)
+<dd>This value is the offset in bytes from the beginning of the file
+where the group name heap is located.
+</dl>
+</dl>
+
+<h3><a name="SharedObjectHeader">Disk Format: Level 2b - Shared Data Object Headers</a></h3>
+<P>In order to share header messages between several dataset objects, object
+header messages may be placed into the global heap. Since these
+messages require additional information beyond the basic object header message
+information, the format of the shared message is detailed below.
+
+<BR> <BR>
+<center>
+<table border cellpadding=4 width=60%>
+<caption align=bottom>
+<B>HDF5 Shared Object Header Message</B>
+</caption>
+
+<tr align=center>
+<th width=25%>byte</th>
+<th width=25%>byte</th>
+<th width=25%>byte</th>
+<th width=25%>byte</th>
+
+<tr align=center>
+<td colspan=4>Reference Count of Shared Header Message</td>
+<tr align=center>
+<td colspan=4><br> Shared Object Header Message<br> <br></td>
+</table>
+</center>
+
+<p>
+<dl>
+<dt> The elements of the shared object header message are described below:
+<dd>
+<dl>
+<dt>Reference Count of Shared Header Message: (32-bit unsigned integer)
+<dd>This value is used to keep a count of the number of dataset objects which
+refer to this message from their dataset headers. When this count reaches zero,
+the shared message header may be removed from the global heap.
+<dt>Shared Object Header Message: (various lengths)
+<dd>The data stored for the shared object header message is formatted in the
+same way as the private object header messages described in the object header
+description earlier in this document and begins with the header message Type.
+</dl>
+</dl>
+
+
+<h3><a name="DataStorage">Disk Format: Level 2c - Data Object Data Storage</a></h3>
+<P>The data for an object is stored separately from the header
+information in the file and may not actually be located in the HDF5 file
+itself if the header indicates that the data is stored externally. The
+information for each record in the object is stored according to the
+dimensionality of the object (indicated in the dimensionality header message).
+Multi-dimensional data is stored in C order [same as current scheme], i.e. the
+"last" dimension changes fastest.
+<P>Data whose elements are composed of simple number-types are stored in
+native-endian IEEE format, unless they are specifically defined as being stored
+in a different machine format with the architecture-type information from the
+number-type header message. This means that each architecture will need to
+[potentially] byte-swap data values into the internal representation for that
+particular machine.
+<P> Data with a "variable" sized number-type is stored in a data heap
+internal to the HDF5 file. Global heap identifiers are stored in the
+data object storage.
+<P>Data whose elements are composed of pointer number-types are stored in several
+different ways depending on the particular pointer type involved. Simple
+pointers are just stored as the dataset offset of the object being pointed to with the
+size of the pointer being the same number of bytes as offsets in the file.
+Partial-object pointers are stored as a heap-ID which points to the following
+information within the file-heap: an offset of the object pointed to, number-type
+information (same format as header message), dimensionality information (same
+format as header message), sub-set start and end information (i.e. a coordinate
+location for each), and field start and end names (i.e. a [pointer to the]
+string indicating the first field included and a [pointer to the] string name
+for the last field).
+
+<P>Data of a compound datatype is stored as a contiguous stream of the items
+in the structure, with each item formatted according to its datatype.
+
+</body>
+</html>
diff --git a/doxygen/examples/H5.format.1.1.html b/doxygen/examples/H5.format.1.1.html
new file mode 100644
index 0000000..ebbbe8e
--- /dev/null
+++ b/doxygen/examples/H5.format.1.1.html
@@ -0,0 +1,6439 @@
+<html>
+ <head>
+ <title>
+ HDF5 File Format Specification Version 1.1
+ </title>
+
+<STYLE TYPE="text/css">
+
+P { text-indent: 2em}
+P.item { margin-left: 2em; text-indent: -2em}
+P.item2 { margin-left: 2em; text-indent: 2em}
+
+TABLE.format { border:solid; border-collapse:collapse; caption-side:top; text-align:center; width:80%;}
+TABLE.format TH { border:ridge; padding:4px; width:25%;}
+TABLE.format TD { border:ridge; padding:4px; }
+TABLE.format CAPTION { font-weight:bold; font-size:larger;}
+
+TABLE.note {border:none; text-align:right; width:80%;}
+
+TABLE.desc { border:solid; border-collapse:collapse; caption-size:top; text-align:left; width:80%;}
+TABLE.desc TR { vertical-align:top;}
+TABLE.desc TH { border-style:ridge; font-size:larger; padding:4px; text-decoration:underline;}
+TABLE.desc TD { border-style:ridge; padding:4px; }
+TABLE.desc CAPTION { font-weight:bold; font-size:larger;}
+
+TABLE.list { border:none; }
+TABLE.list TR { vertical-align:top;}
+TABLE.list TH { border:none; text-decoration:underline;}
+TABLE.list TD { border:none; }
+
+</STYLE>
+</head>
+ <body>
+
+ <center>
+ <table border=0 width=90%>
+ <tr>
+ <td valign=top>
+ <ol type=I>
+ <li><a href="#Intro">Introduction</a>
+ <li><a href="#FileMetaData">Disk Format Level 0 - File Metadata</a>
+ <font size=-2>
+ <ol type=A>
+ <li><a href="#SuperBlock">Disk Format Level 0A - File Signature and Super Block</a>
+ <li><a href="#DriverInfo">Disk Format Level 0B - File Driver Info</a>
+ </ol>
+ </font>
+ <li><a href="#FileInfra">Disk Format Level 1 - File Infrastructure</a>
+ <font size=-2>
+ <ol type=A>
+ <li><a href="#Btrees">Disk Format Level 1A - B-link Trees and B-tree Nodes</a>
+ <li><a href="#SymbolTable">Disk Format Level 1B - Group</a>
+ <li><a href="#SymbolTableEntry">Disk Format Level 1C - Group Entry</a>
+ <li><a href="#LocalHeap">Disk Format Level 1D - Local Heaps</a>
+ <li><a href="#GlobalHeap">Disk Format Level 1E - Global Heap</a>
+ <li><a href="#FreeSpaceIndex">Disk Format Level 1F - Free-space Index</a>
+ </ol>
+ </font>
+ <li><a href="#DataObject">Disk Format Level 2 - Data Objects</a>
+ <font size=-2>
+ <ol type=A>
+ <li><a href="#ObjectHeader">Disk Format Level 2a - Data Object Headers</a>
+ <ol type=1>
+ <li><a href="#NILMessage">Name: NIL</a> <!-- 0x0000 -->
+ <li><a href="#SimpleDataSpace">Name: Simple Dataspace</a> <!-- 0x0001 -->
+<!-- <li><a href="#DataSpaceMessage">Name: Complex Dataspace</a> --> <!-- 0x0002 -->
+ <li><a href="#ReservedMessage_0002">Name: Reserved - not assigned yet</a> <!-- 0x0002 -->
+ <li><a href="#DataTypeMessage">Name: Datatype</a> <!-- 0x0003 -->
+ <li><a href="#OldFillValueMessage">Name: Data Storage - Fill Value (Old)</a> <!-- 0x0004 -->
+ <li><a href="#FillValueMessage">Name: Data Storage - Fill Value</a> <!-- 0x0005 -->
+ </ol>
+ </ol>
+ </font>
+ </ol>
+ </td><td>&nbsp;&nbsp;</td><td valign=top>
+ <ol type=I start=4>
+
+ <li><a href="#DataObject">Disk Format Level 2 - Data Objects</a>
+ <font size=-2><i>(Continued)</i>
+ <ol type=A>
+ <li><a href="#ObjectHeader">Disk Format Level 2a - Data Object Headers</a><i>(Continued)</i>
+ <ol type=1 start=6>
+<!-- <li><a href="#CompactDataStorageMessage">Name: Data Storage - Compact</a> --> <!-- 0x0006 -->
+ <li><a href="#ReservedMessage_0006">Name: Reserved - not assigned yet</a> <!-- 0x0006 -->
+ <li><a href="#ExternalFileListMessage">Name: Data Storage - External Data Files</a> <!-- 0x0007 -->
+ <li><a href="#LayoutMessage">Name: Data Storage - Layout</a> <!-- 0x0008 -->
+ <li><a href="#ReservedMessage_0009">Name: Reserved - not assigned yet</a> <!-- 0x0009 -->
+ <li><a href="#ReservedMessage_000A">Name: Reserved - not assigned yet</a> <!-- 0x000a -->
+ <li><a href="#FilterMessage">Name: Data Storage - Filter Pipeline</a> <!-- 0x000b -->
+ <li><a href="#AttributeMessage">Name: Attribute</a> <!-- 0x000c -->
+ <li><a href="#CommentMessage">Name: Object Comment</a> <!-- 0x000d -->
+ <li><a href="#OldModifiedMessage">Name: Object Modification Date and Time (Old)</a> <!-- 0x000e -->
+ <li><a href="#SharedMessage">Name: Shared Object Message</a> <!-- 0x000f -->
+ <li><a href="#ContinuationMessage">Name: Object Header Continuation</a> <!-- 0x0010 -->
+ <li><a href="#SymbolTableMessage">Name: Group Message</a> <!-- 0x0011 -->
+ <li><a href="#ModifiedMessage">Name: Object Modification Date and Time</a> <!-- 0x0012 -->
+ </ol>
+ <li><a href="#DataStorage">Disk Format: Level 2b - Data Object Data Storage</a>
+ </ol>
+ </font>
+ <LI><A href="#Appendix">Appendix</A>
+ </ol>
+</td></tr>
+</table>
+</center>
+
+ <BR>
+ <HR>
+
+
+ <h2>Introduction</h2>
+
+ <table align=right width=100>
+ <tr><td>&nbsp;</td><td align=center>
+ <hr>
+ <img src="FF-IH_FileGroup.gif" alt="HDF5 Groups" hspace=15 vspace=15>
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align=center>
+ <strong>Figure 1:</strong> Relationships among the HDF5 root group, other groups, and objects
+ <hr>
+ </td><td>&nbsp;</td></tr>
+
+ <tr><td>&nbsp;</td><td align=center>
+ <img src="FF-IH_FileObject.gif" alt="HDF5 Objects" hspace=15 vspace=15>
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align=center>
+ <strong>Figure 2:</strong> HDF5 objects -- datasets, datatypes, or dataspaces
+ <hr>
+ </td><td>&nbsp;</td></tr>
+ </table>
+
+
+ <P>The format of an HDF5 file on disk encompasses several
+ key ideas of the HDF4 and AIO file formats as well as
+ addressing some shortcomings therein. The new format is
+ more self-describing than the HDF4 format and is more
+ uniformly applied to data objects in the file.
+
+ <P>An HDF5 file appears to the user as a directed graph.
+ The nodes of this graph are the higher-level HDF5 objects
+ that are exposed by the HDF5 APIs:
+
+ <ul>
+ <li>Groups
+ <li>Datasets
+ <li>Named datatypes
+ </ul>
+
+ <P>At the lowest level, as information is actually written to the disk,
+ an HDF5 file is made up of the following objects:
+ <ul>
+ <li>A super block
+ <li>B-tree nodes (containing either symbol nodes or raw data chunks)
+ <li>Object headers
+ <li>A global heap
+ <li>Local heaps
+ <li>Free space
+ </ul>
+
+ <P>The HDF5 library uses these low-level objects to represent the
+ higher-level objects that are then presented to the user or
+ to applications through the APIs.
+ For instance, a group is an object header that contains a message that
+ points to a local heap and to a B-tree which points to symbol nodes.
+ A dataset is an object header that contains messages that describe
+ datatype, space, layout, filters, external files, fill value, etc
+ with the layout message pointing to either a raw data chunk or to a
+ B-tree that points to raw data chunks.
+
+
+ <h3>This Document</h3>
+
+ <p>This document describes the lower-level data objects;
+ the higher-level objects and their properties are described
+ in the <a href="H5.user.html"><cite>HDF5 User's Guide</cite></a>.
+
+ <P>Three levels of information comprise the file format.
+ Level 0 contains basic information for identifying and
+ defining information about the file. Level 1 information contains
+ the information about the pieces of a file shared by many objects
+ in the file (such as a B-trees and heaps). Level 2 is the rest
+ of the file and contains all of the data objects, with each object
+ partitioned into header information, also known as
+ <em>metadata</em>, and data.
+
+ <p>The sizes of various fields in the following layout tables are
+ determined by looking at the number of columns the field spans
+ in the table. There are three exceptions: (1) The size may be
+ overridden by specifying a size in parentheses, (2) the size of
+ addresses is determined by the <em>Size of Offsets</em> field
+ in the super block and is indicated in this document with a
+ superscripted 'O', and (3) the size of length fields is determined
+ by the <em>Size of Lengths</em> field in the super block and is
+ indicated in this document with a superscripted 'L'.
+
+ <P>Values for all fields in this document should be treated as unsigned
+ integers, unless otherwise noted in the description of a field.
+ Additionally, all metadata fields are stored in little-endian byte
+ order.
+ </P>
+
+ <BR>
+ <HR>
+
+ <h2><a name="FileMetaData">
+ Disk Format: Level 0 - File Metadata</a></h2>
+
+ <H3><A name="SuperBlock">
+ Disk Format: Level 0A - File Signature and Super Block</A></H3>
+
+ <P>The super block may begin at certain predefined offsets within
+ the HDF5 file, allowing a block of unspecified content for
+ users to place additional information at the beginning (and
+ end) of the HDF5 file without limiting the HDF5 library's
+ ability to manage the objects within the file itself. This
+ feature was designed to accommodate wrapping an HDF5 file in
+ another file format or adding descriptive information to the
+ file without requiring the modification of the actual file's
+ information. The super block is located by searching for the
+ HDF5 file signature at byte offset 0, byte offset 512 and at
+ successive locations in the file, each a multiple of two of
+ the previous location, i.e. 0, 512, 1024, 2048, etc.
+
+ <P>The super block is composed of a file signature, followed by
+ super block and group version numbers, information
+ about the sizes of offset and length values used to describe
+ items within the file, the size of each group page,
+ and a group entry for the root object in the file.
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ HDF5 Super Block Layout
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>HDF5 File Signature (8 bytes)<br><br></td>
+ </tr>
+
+ <tr>
+ <td>Version # of Super Block</td>
+ <td>Version # of Global Free-space Storage</td>
+ <td>Version # of Root Group Symbol Table Entry</td>
+ <td>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td>Version # of Shared Header Message Format</td>
+ <td>Size of Offsets</td>
+ <td>Size of Lengths</td>
+ <td>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Group Leaf Node K</td>
+ <td colspan=2>Group Internal Node K</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>File Consistency Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan=2 style="border:dotted;">Indexed Storage Internal Node K<sup>1</sup></td>
+ <td colspan=2 style="border:dotted;">Reserved (zero)<sup>1</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Base Address<sup>O</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Address of Global Free-space Heap<sup>O</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>End of File Address<sup>O</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Driver Information Block Address<sup>O</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Root Group Symbol Table Entry</td>
+ </tr>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'O' the above table are
+ <br>
+ of the size specified in "Size of Offsets.")
+ </td></tr>
+ <tr><td>
+ (Items marked with an '1' the above table are
+ <br>
+ new in version 1 of the superblock)
+ </td></tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>HDF5 File Signature</td>
+ <td>
+ <P>This field contains a constant value and can be used to
+ quickly identify a file as being an HDF5 file. The
+ constant value is designed to allow easy identification of
+ an HDF5 file and to allow certain types of data corruption
+ to be detected. The file signature of an HDF5 file always
+ contains the following values:
+ </P>
+
+ <center>
+ <table border align=center cellpadding=4>
+ <tr align=center>
+ <td align=right>Decimal:</td>
+ <td width="8%">137</td>
+ <td width="8%">72</td>
+ <td width="8%">68</td>
+ <td width="8%">70</td>
+ <td width="8%">13</td>
+ <td width="8%">10</td>
+ <td width="8%">26</td>
+ <td width="8%">10</td>
+ </tr>
+
+ <tr align=center>
+ <td align=right>Hexadecimal:</td>
+ <td>89</td>
+ <td>48</td>
+ <td>44</td>
+ <td>46</td>
+ <td>0d</td>
+ <td>0a</td>
+ <td>1a</td>
+ <td>0a</td>
+ </tr>
+
+ <tr align=center>
+ <td align=right>ASCII C Notation:</td>
+ <td>\211</td>
+ <td>H</td>
+ <td>D</td>
+ <td>F</td>
+ <td>\r</td>
+ <td>\n</td>
+ <td>\032</td>
+ <td>\n</td>
+ </tr>
+ </table>
+ </center>
+ <br>
+
+ <P>This signature both identifies the file as an HDF5 file
+ and provides for immediate detection of common
+ file-transfer problems. The first two bytes distinguish
+ HDF5 files on systems that expect the first two bytes to
+ identify the file type uniquely. The first byte is
+ chosen as a non-ASCII value to reduce the probability
+ that a text file may be misrecognized as an HDF5 file;
+ also, it catches bad file transfers that clear bit
+ 7. Bytes two through four name the format. The CR-LF
+ sequence catches bad file transfers that alter newline
+ sequences. The control-Z character stops file display
+ under MS-DOS. The final line feed checks for the inverse
+ of the CR-LF translation problem. (This is a direct
+ descendent of the <A href="http://www.libpng.org/pub/png/spec/PNG-Rationale.html#R.PNG-file-signature">PNG</A> file
+ signature.)
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Version Number of the Super Block</td>
+ <td>
+ <P>This value is used to determine the format of the
+ information in the super block. When the format of the
+ information in the super block is changed, the version number
+ is incremented to the next integer and can be used to
+ determine how the information in the super block is
+ formatted.
+ </P>
+
+ <P>Values of 0 and 1 are defined for this field.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Version Number of the File Free-space Information</td>
+ <td>
+ <P>This value is used to determine the format of the
+ information in the File Free-space Information.
+ </P>
+ <P>The only value currently valid in this field is '0', which
+ indicates that the free space index is formatted as described
+ <A href="#FreeSpaceIndex">below</A>.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Version Number of the Root Group Symbol Table Entry</td>
+ <td>
+ <P>This value is used to determine the format of the
+ information in the Root Group Symbol Table Entry. When the
+ format of the information in that field is changed, the
+ version number is incremented to the next integer and can be
+ used to determine how the information in the field
+ is formatted.
+ </P>
+ <P>The only value currently valid in this field is '0', which
+ indicates that the root group symbol table entry is formatted as
+ described <A href="#SymbolTableEntry">below</A>.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Version Number of the Shared Header Message Format</td>
+ <td>
+ <P>This value is used to determine the format of the
+ information in a shared object header message. Since the format
+ of the shared header messages differs from the other private
+ header messages, a version number is used to identify changes
+ in the format.
+ </P>
+ <P>The only value currently valid in this field is '0', which
+ indicates that shared header messages are formatted as
+ described <A href="#SharedMessage">below</A>.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Size of Offsets</td>
+ <td>
+ <P>This value contains the number of bytes used to store
+ addresses in the file. The values for the addresses of
+ objects in the file are offsets relative to a base address,
+ usually the address of the super block signature. This
+ allows a wrapper to be added after the file is created
+ without invalidating the internal offset locations.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Size of Lengths</td>
+ <td>
+ <P>This value contains the number of bytes used to store
+ the size of an object.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Group Leaf Node K</td>
+ <td>
+ <P>Each leaf node of a group B-tree will have at
+ least this many entries but not more than twice this
+ many. If a group has a single leaf node then it
+ may have fewer entries.
+ </P>
+ <P>This value must be greater than zero.
+ </P>
+ <P>See the <A href="#Btrees">description</A> of B-trees below.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Group Internal Node K</td>
+ <td>
+ <P>Each internal node of a group B-tree will have at
+ least this many entries but not more than twice this
+ many. If the group has only one internal
+ node then it might have fewer entries.
+ </P>
+ <P>This value must be greater than zero.
+ </P>
+ <P>See the <A href="#Btrees">description</A> of B-trees below.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>File Consistency Flags</td>
+ <td>
+ <P>This value contains flags to indicate information
+ about the consistency of the information contained
+ within the file. Currently, the following bit flags are
+ defined:
+ <ul>
+ <li>Bit 0 set indicates that the file is opened for
+ write-access.
+ <li>Bit 1 set indicates that the file has
+ been verified for consistency and is guaranteed to be
+ consistent with the format defined in this document.
+ <li>Bits 2-31 are reserved for future use.
+ </ul>
+ Bit 0 should be
+ set as the first action when a file is opened for write
+ access and should be cleared only as the final action
+ when closing a file. Bit 1 should be cleared during
+ normal access to a file and only set after the file's
+ consistency is guaranteed by the library or a
+ consistency utility.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Indexed Storage Internal Node K</td>
+ <td>
+ <P>Each internal node of a indexed storage B-tree will have at
+ least this many entries but not more than twice this
+ many. If the group has only one internal
+ node then it might have fewer entries.
+ </P>
+ <P>This value must be greater than zero.
+ </P>
+ <P>See the <A href="#Btrees">description</A> of B-trees below.
+ </P>
+
+ <P><EM>This field is present in version 1+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Base Address</td>
+ <td>
+ <P>This is the absolute file address of the first byte of
+ the HDF5 data within the file. The library currently
+ constrains this value to be the absolute file address
+ of the super block itself when creating new files;
+ future versions of the library may provide greater
+ flexibility. When opening an existing file and this address does
+ not match the offset of the superblock, the library assumes
+ that the entire contents of the HDF5 file have been adjusted in
+ the file and adjusts the base address and end of file address to
+ reflect their new positions in the file. Unless otherwise noted,
+ all other file addresses are relative to this base
+ address.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Address of Global Free-space Index</td>
+ <td>
+ <P>Free-space management is not yet defined in the HDF5
+ file format and is not handled by the library.
+ Currently this field always contains the
+ <A href="#UndefinedAddress">undefined address</A>.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>End of File Address</td>
+ <td>
+ <P>This is the absolute file address of the first byte past
+ the end of all HDF5 data. It is used to determine whether a
+ file has been accidently truncated and as an address where
+ file data allocation can occur if space from the free list is
+ not used.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Driver Information Block Address</td>
+ <td>
+ <P>This is the relative file address of the file driver
+ information block which contains driver-specific
+ information needed to reopen the file. If there is no
+ driver information block then this entry should be the
+ <A href="#UndefinedAddress">undefined address</A>.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Root Group Symbol Table Entry</td>
+ <td>
+ <P>This is the <A href="#SymbolTableEntry">symbol table entry</A>
+ of the root group, which serves as the entry point into
+ the group graph for the file.
+ </P>
+
+ <P><EM>This field is present in version 0+ of the superblock.</EM>
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <H3><A name="DriverInfo">
+ Disk Format: Level 0B - File Driver Info</A></H3>
+
+ <p>The <em>file driver information block</em> is an optional region of the
+ file which contains information needed by the file driver in
+ order to reopen a file. The format of the file driver information
+ block is:
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Driver Information Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Driver Information Size (4 bytes)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Driver Identification (8 bytes)<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br><br>Driver Information (<em>n</em> bytes)<br><br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>The version number of the driver information block. The
+ file format documented here is version zero.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Driver Information Size</td>
+ <td>
+ <P>The size in bytes of the Driver Information part of this
+ structure.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Driver Identification</td>
+ <td>
+ <P>This is an eight-byte ASCII string without null
+ termination which identifies the driver and version number
+ of the Driver Information block. The predefined drivers
+ supplied with the HDF5 library are identified by the
+ letters <code>NCSA</code> followed by the first four characters of
+ the driver name. If the Driver Information block is not
+ the original version then the last letter(s) of the
+ identification will be replaced by a version number in
+ ASCII.
+ </P>
+ <P>
+ For example, the various versions of the <em>multi driver</em>
+ will be identified by <code>NCSAmult</code>.
+ (<code>NCSAmult</code> is simply <code>NCSAmulti</code> truncated
+ to eight characters. Subsequent identifiers will be created by
+ substituting sequential numerical values for the final character,
+ starting with zero.) <em>multi driver</em> is the only default driver that
+ is encoded in this field.
+ </P>
+ <P>
+ Identification for user-defined drivers
+ is eight-byte long and arbitrary but should be unique and avoid
+ the four character prefix "NCSA".
+ </P>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Driver Information</td>
+ <td>Driver information is encoded/decoded in a format defined by the
+ file driver. <em>multi driver</em> is the only default driver that has driver
+ information stored in this field. Its format is explained in the
+ following block.</td>
+ </tr>
+ </table>
+ </div>
+
+ <BR>
+ <P><em>Multi driver</em> has the following format:</P>
+
+ <div align=center>
+ <table class=format>
+ <caption>
+ Multi Driver Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ </tr>
+
+ <tr>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Reserved</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Address of Member File 1<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>End of Address for Member File 1<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Address of Member File 2<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>End of Address for Member File 2<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>... ...<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name of Member File 1<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name of Member File 2<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>... ...<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Member Mapping</td>
+ <td><P><em>Multi driver</em> enables different types of HDF5 data and
+ metadata to be written to separate files. These files are viewed by the
+ library as a single virtual HDF5 file with a single file address.
+ It allows maximal 6 files to be created.
+ In sequence, these <em>Member Mapping</em> fields are for super block,
+ B-tree, raw data, global heap, local heap,
+ and object header. More than one type of data can be written to the
+ same file.</P>
+ <P>These <em>Member Mapping</em> fields are integer values from 1 to 6
+ indicating how the data can be mapped to or merged with another type of
+ data.
+ <table class=list>
+ <tr>
+ <th width="30%">Member Mapping</th>
+ <th align=left>Description</th>
+ </tr>
+ <tr>
+ <td align=center>1</td>
+ <td>The super block data.</td>
+ </tr>
+ <tr>
+ <td align=center>2</td>
+ <td>The B-tree data.</td>
+ </tr>
+ <tr>
+ <td align=center>3</td>
+ <td>The raw data.</td>
+ </tr>
+ <tr>
+ <td align=center>4</td>
+ <td>The global heap data.</td>
+ </tr>
+ <tr>
+ <td align=center>5</td>
+ <td>The local heap data.</td>
+ </tr>
+ <tr>
+ <td align=center>6</td>
+ <td>The object header data.</td>
+ </tr>
+ </table></P>
+ For example, if the third field has the value 3 and all the rest have the
+ value 1, it means there are two files, one for raw data, one for super block,
+ B-tree, global heap, local heap, and object header.
+ </td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td><P>These fields are reserved and should always be zero.</P></td>
+ </tr>
+
+ <tr>
+ <td>Address of Member File</td>
+ <td><P>Specifies the virtual address. A normally eight-byte integer with
+ the value from <em>0</em> (zero) to maximal value,
+ at which the member file starts.</P></td>
+ </tr>
+
+ <tr>
+ <td>End of Address for Member File</td>
+ <td><P>The end of allocated address for the member file. A normally eight-byte
+ integer value.</P></td>
+ </tr>
+
+ <tr>
+ <td>Name of Member File</td>
+ <td><P>The null-terminated name of member file. Its length should be multiples of
+ 8 bytes. Additional bytes will be padded with <em>NULL</em>s. The default naming
+ convention is <em>%%s-X.h5</em>, where <em>X</em> is one of the letters
+ <em>s</em> (for super block), <em>b</em> (for B-tree), <em>r</em> (for raw data),
+ <em>g</em> (for global heap), <em>l</em> (for local heap), and <em>o</em> (for
+ object header). The name for the whole HDF5 file will substitute the <em>%s</em>
+ in the string.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <BR>
+ <HR>
+
+ <h2><a name="FileInfra">
+ Disk Format: Level 1 - File Infrastructure</a></h2>
+ <h3><a name="Btrees">Disk Format: Level 1A - B-link Trees and B-tree Nodes</a></h3>
+
+ <p>B-link trees allow flexible storage for objects which tend to grow
+ in ways that cause the object to be stored discontiguously. B-trees
+ are described in various algorithms books including "Introduction to
+ Algorithms" by Thomas H. Cormen, Charles E. Leiserson, and Ronald
+ L. Rivest. The B-link tree, in which the sibling nodes at a
+ particular level in the tree are stored in a doubly-linked list,
+ is described in the "Efficient Locking for Concurrent Operations
+ on B-trees" paper by Phillip Lehman and S. Bing Yao as published
+ in the <cite>ACM Transactions on Database Systems</cite>, Vol. 6,
+ No. 4, December 1981.
+
+ <p>The B-link trees implemented by the file format contain one more
+ key than the number of children. In other words, each child
+ pointer out of a B-tree node has a left key and a right key.
+ The pointers out of internal nodes point to sub-trees while
+ the pointers out of leaf nodes point to symbol nodes and
+ raw data chunks.
+ Aside from that difference, internal nodes and leaf nodes
+ are identical.
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ B-tree Nodes
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+
+ <tr>
+ <td colspan=4>Signature</td>
+
+ <tr>
+ <td>Node Type</td>
+ <td>Node Level</td>
+ <td colspan=2>Entries Used</td>
+
+ <tr>
+ <td colspan=4>Address of Left Sibling<sup>O</sup></td>
+
+ <tr>
+ <td colspan=4>Address of Right Sibling<sup>O</sup></td>
+
+ <tr>
+ <td colspan=4>Key 0 (variable size)</td>
+
+ <tr>
+ <td colspan=4>Address of Child 0<sup>O</sup></td>
+
+ <tr>
+ <td colspan=4>Key 1 (variable size)</td>
+
+ <tr>
+ <td colspan=4>Address of Child 1<sup>O</sup></td>
+
+ <tr>
+ <td colspan=4>...</td>
+
+ <tr>
+ <td colspan=4>Key 2<em>K</em> (variable size)</td>
+
+ <tr>
+ <td colspan=4>Address of Child 2<em>K</em><sup>O</sup></td>
+
+ <tr>
+ <td colspan=4>Key 2<em>K</em>+1 (variable size)</td>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'O' the above table are
+ <br>
+ of the size specified in "Size of Offsets.")
+ </td></tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Signature</td>
+ <td>
+ <P>The ASCII character string "<code>TREE</code>" is
+ used to indicate the
+ beginning of a B-link tree node. This gives file
+ consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Node Type</td>
+ <td>
+ <P>Each B-link tree points to a particular type of data.
+ This field indicates the type of data as well as
+ implying the maximum degree <em>K</em> of the tree and
+ the size of each Key field.
+ </P>
+
+ <table class=list>
+ <tr>
+ <th width="30%">Node Type</th>
+ <th align=left>Description</th>
+ </tr>
+ <tr>
+ <td align=center>0</td>
+ <td>This tree points to group nodes.</td>
+ </tr>
+ <tr>
+ <td align=center>1</td>
+ <td>This tree points to raw data chunk nodes.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Node Level</td>
+ <td>
+ <P>The node level indicates the level at which this node
+ appears in the tree (leaf nodes are at level zero). Not
+ only does the level indicate whether child pointers
+ point to sub-trees or to data, but it can also be used
+ to help file consistency checking utilities reconstruct
+ damanged trees.
+ </P>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Entries Used</td>
+ <td>
+ <P>This determines the number of children to which this
+ node points. All nodes of a particular type of tree
+ have the same maximum degree, but most nodes will point
+ to less than that number of children. The valid child
+ pointers and keys appear at the beginning of the node
+ and the unused pointers and keys appear at the end of
+ the node. The unused pointers and keys have undefined
+ values.
+ </P>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of Left Sibling</td>
+ <td>
+ <P>This is the relative file address of the left sibling of
+ the current node. If the current
+ node is the left-most node at this level then this field
+ is the <A href="#UndefinedAddress">undefined address</A>.
+ </P>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Address of Right Sibling</td>
+ <td>
+ <P>This is the relative file address of the right sibling of
+ the current node. If the current
+ node is the right-most node at this level then this
+ field is the <A href="#UndefinedAddress">undefined address</A>.
+ </P>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Keys and Child Pointers</td>
+ <td>
+ <P>Each tree has 2<em>K</em>+1 keys with 2<em>K</em>
+ child pointers interleaved between the keys. The number
+ of keys and child pointers actually containing valid
+ values is determined by the node's <em>Entries Used</em> field.
+ If that field is <em>N</em> then the B-link tree contains
+ <em>N</em> child pointers and <em>N</em>+1 keys.
+ </P>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Key</td>
+ <td>
+ <P>The format and size of the key values is determined by
+ the type of data to which this tree points. The keys are
+ ordered and are boundaries for the contents of the child
+ pointer; that is, the key values represented by child
+ <em>N</em> fall between Key <em>N</em> and Key
+ <em>N</em>+1. Whether the interval is open or closed on
+ each end is determined by the type of data to which the
+ tree points.
+ </P>
+
+ <P>
+ The format of the key depends on the node type.
+ For nodes of node type 0 (group nodes), the key is formatted as
+ follows:
+ <center>
+ <table class=list>
+ <tr>
+ <td width=30%>A single field of <i>Size of Lengths</i>
+ bytes:</td>
+ <td>Indicates the byte offset into the local heap
+ for the first object name in the subtree which
+ that key describes.
+ </td>
+ </tr>
+ </table>
+ </center>
+ </P>
+
+ <P>
+ For nodes of node type 1 (chunked raw data nodes), the key is
+ formatted as follows:
+ <center>
+ <table class=list>
+ <tr>
+ <td width=30%>Bytes 1-4:</td>
+ <td>Size of chunk in bytes.</td>
+ </tr>
+ <tr>
+ <td>Bytes 4-8:</td>
+ <td>Filter mask, a 32-bit bitfield indicating which
+ filters have been skipped for this chunk. Each filter
+ has an index number in the pipeline (starting at 0, with
+ the first filter to apply) and if that filter is skipped,
+ the bit corresponding to it's index is set.</td>
+ </tr>
+ <tr>
+ <td><em>N</em> 64-bit fields:</td>
+ <td>A 64-bit index indicating the offset of the
+ chunk within the dataset where <i>N</i> is the number
+ of dimensions of the dataset. For example, if
+ a chunk in a 3-dimensional dataset begins at the
+ position <code>[5,5,5]</code>, there will be three
+ such 64-bit indices, each with the value of
+ <code>5</code>.</td>
+ </tr>
+ </table>
+ </center>
+ </P>
+ </td>
+ </tr>
+
+ <tr valign=top>
+ <td>Child Pointer</td>
+ <td>
+ <P>The tree node contains file addresses of subtrees or
+ data depending on the node level. Nodes at Level 0 point
+ to data addresses, either raw data chunk or group nodes.
+ Nodes at non-zero levels point to other nodes of the
+ same B-tree.
+ </P>
+ <P>For raw data chunk nodes, the child pointer is the address
+ of a single raw data chunk. For group nodes, the child pointer
+ points to a <A href="#SymbolTable">symbol table</A>, which contains
+ information for multiple symbol table entries.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <p>
+ Conceptually, each B-tree node looks like this:
+ <center>
+ <table>
+ <tr valign=top align=center>
+ <td>key[0]</td><td>&nbsp;</td>
+ <td>child[0]</td><td>&nbsp;</td>
+ <td>key[1]</td><td>&nbsp;</td>
+ <td>child[1]</td><td>&nbsp;</td>
+ <td>key[2]</td><td>&nbsp;</td>
+ <td>...</td><td>&nbsp;</td>
+ <td>...</td><td>&nbsp;</td>
+ <td>key[<i>N</i>-1]</td><td>&nbsp;</td>
+ <td>child[<i>N</i>-1]</td><td>&nbsp;</td>
+ <td>key[<i>N</i>]</td>
+ </tr>
+ </table>
+ </center>
+ <br>
+
+ where child[<i>i</i>] is a pointer to a sub-tree (at a level
+ above Level 0) or to data (at Level 0).
+ Each key[<i>i</i>] describes an <i>item</i> stored by the B-tree
+ (a chunk or an object of a group node). The range of values
+ represented by child[<i>i</i>] is indicated by key[<i>i</i>]
+ and key[<i>i</i>+1].
+
+
+ <p>The following question must next be answered:
+ "Is the value described by key[<i>i</i>] contained in
+ child[<i>i</i>-1] or in child[<i>i</i>]?"
+ The answer depends on the type of tree.
+ In trees for groups (node type 0) the object described by
+ key[<i>i</i>] is the greatest object contained in
+ child[<i>i</i>-1] while in chunk trees (node type 1) the
+ chunk described by key[<i>i</i>] is the least chunk in
+ child[<i>i</i>].
+
+ <p>That means that key[0] for group trees is sometimes unused;
+ it points to offset zero in the heap, which is always the
+ empty string and compares as "less-than" any valid object name.
+
+ <p>And key[<i>N</i>] for chunk trees is sometimes unused;
+ it contains a chunk offset which compares as "greater-than"
+ any other chunk offset and has a chunk byte size of zero
+ to indicate that it is not actually allocated.
+
+
+ <h3><a name="SymbolTable">Disk Format: Level 1B - Group and Symbol Nodes</a></h3>
+
+ <p>A group is an object internal to the file that allows
+ arbitrary nesting of objects within the file (including other groups).
+ A group maps a set of names in the group to a set of relative
+ file addresses where objects with those names are located in
+ the file. Certain metadata for an object to which the group points
+ can be cached in the group's symbol table in addition to the
+ object's header.
+
+ <p>An HDF5 object name space can be stored hierarchically by
+ partitioning the name into components and storing each
+ component in a group. The group entry for a
+ non-ultimate component points to the group containing
+ the next component. The group entry for the last
+ component points to the object being named.
+
+ <p>A group is a collection of group nodes pointed
+ to by a B-link tree. Each group node contains entries
+ for one or more symbols. If an attempt is made to add a
+ symbol to an already full group node containing
+ 2<em>K</em> entries, then the node is split and one node
+ contains <em>K</em> symbols and the other contains
+ <em>K</em>+1 symbols.
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Group Node (A Leaf of a B-tree)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+
+ <tr>
+ <td colspan=4>Signature</td>
+
+ <tr>
+ <td>Version Number</td>
+ <td>Reserved (0)</td>
+ <td colspan=2>Number of Symbols</td>
+
+ <tr>
+ <td colspan=4><br><br>Group Entries<br><br><br></td>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Signature</td>
+ <td>
+ <P>The ASCII character string "<code>SNOD</code>" is
+ used to indicate the
+ beginning of a group node. This gives file
+ consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Version Number</td>
+ <td>
+ <P>The version number for the group node. This
+ document describes version 1. (There is no version '0'
+ of the group node)
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Number of Symbols</td>
+ <td>
+ <P>Although all group nodes have the same length,
+ most contain fewer than the maximum possible number of
+ symbol entries. This field indicates how many entries
+ contain valid data. The valid entries are packed at the
+ beginning of the group node while the remaining
+ entries contain undefined values.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Group Entries</td>
+ <td>
+ <P>Each symbol has an entry in the group node.
+ The format of the entry is described below.
+ There are 2<EM>K</EM> entries in each group node, where
+ <EM>K</EM> is the "Group Leaf Node K" value from the
+ <A href="#SuperBlock">super block</A>.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <h3><a name="SymbolTableEntry">
+ Disk Format: Level 1C - Group Entry </a></h3>
+
+ <p>Each group entry in a group node is designed
+ to allow for very fast browsing of stored objects.
+ Toward that design goal, the group entries
+ include space for caching certain constant metadata from the
+ object header.
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Group Entry
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4>Name Offset<sup>O</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Object Header Address<sup>O</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Cache Type</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br><br>Scratch-pad Space (16 bytes)<br><br><br></td>
+ </tr>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'O' the above table are
+ <br>
+ of the size specified in "Size of Offsets.")
+ </td></tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Name Offset</td>
+ <td>
+ <P>This is the byte offset into the group local
+ heap for the name of the object. The name is null
+ terminated.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Object Header Address</td>
+ <td>
+ <P>Every object has an object header which serves as a
+ permanent location for the object's metadata. In addition
+ to appearing in the object header, some metadata can be
+ cached in the scratch-pad space.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Cache Type</td>
+ <td>
+ <P>The cache type is determined from the object header.
+ It also determines the format for the scratch-pad space:
+ <br>
+ <table class=list>
+ <tr align=left>
+ <th>Type:</th>
+ <th>Description:</th>
+ </tr>
+ <tr>
+ <td width="10%" align=center>0</td>
+ <td>No data is cached by the group entry. This
+ is guaranteed to be the case when an object header
+ has a link count greater than one.
+ </td>
+ </tr>
+ <tr>
+ <td align=center>1</td>
+ <td>Object header metadata is cached in the group
+ entry. This implies that the group
+ entry refers to another group.
+ </td>
+ </tr>
+ <tr>
+ <td align=center>2</td>
+ <td>The entry is a symbolic link. The first four bytes
+ of the scratch-pad space are the offset into the local
+ heap for the link value. The object header address
+ will be undefined.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><em>N</em></td>
+ <td>Other cache values can be defined later and
+ libraries that do not understand the new values will
+ still work properly.
+ </td>
+ </tr>
+ </table>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td>
+ <P>These four bytes are present so that the scratch-pad
+ space is aligned on an eight-byte boundary. They are
+ always set to zero.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Scratch-pad Space</td>
+ <td>
+ <P>This space is used for different purposes, depending
+ on the value of the Cache Type field. Any metadata
+ about a dataset object represented in the scratch-pad
+ space is duplicated in the object header for that
+ dataset. This metadata can include the datatype
+ and the size of the dataspace for a dataset whose datatype
+ is atomic and whose dataspace is fixed and less than
+ four dimensions.
+ </P>
+ <P>
+ Furthermore, no data is cached in the group
+ entry scratch-pad space if the object header for
+ the group entry has a link count greater than
+ one.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <h4>Format of the Scratch-pad Space</h4>
+
+ <p>The group entry scratch-pad space is formatted
+ according to the value in the Cache Type field.
+
+ <p>If the Cache Type field contains the value zero
+ <code>(0)</code> then no information is
+ stored in the scratch-pad space.
+
+ <p>If the Cache Type field contains the value one
+ <code>(1)</code>, then the scratch-pad space
+ contains cached metadata for another object header
+ in the following format:
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Object Header Scratch-pad Format
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+
+ <tr>
+ <td colspan=4>Address of B-tree<sup>O</sup></td>
+
+ <tr>
+ <td colspan=4>Address of Name Heap<sup>O</sup></td>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'O' the above table are
+ <br>
+ of the size specified in "Size of Offsets.")
+ </td></tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Address of B-tree</td>
+ <td>
+ <P>This is the file address for the root of the
+ group's B-tree.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Address of Name Heap</td>
+ <td>
+ <P>This is the file address for the group's local
+ heap, in which are stored the group's symbol names.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <P>If the Cache Type field contains the value two
+ <code>(2)</code>, then the scratch-pad space
+ contains cached metadata for another symbolic link
+ in the following format:
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Symbolic Link Scratch-pad Format
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4>Offset to Link Value</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Offset to Link Value</td>
+ <td>
+ <P>The value of a symbolic link (that is, the name of the
+ thing to which it points) is stored in the local heap.
+ This field is the 4-byte offset into the local heap for
+ the start of the link value, which is null terminated.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <h3><a name="LocalHeap">Disk Format: Level 1D - Local Heaps</a></h3>
+
+ <P>A heap is a collection of small heap objects. Objects can be
+ inserted and removed from the heap at any time.
+ The address of a heap does not change once the heap is created.
+ References to objects are stored in the group table;
+ the names of those objects are stored in the local heap.
+ </P>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Local Heap
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4>Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Data Segment Size<sup>L</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Offset to Head of Free-list<sup>L</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Address of Data Segment<sup>O</sup></td>
+ </tr>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'L' the above table are
+ <br>
+ of the size specified in "Size of Lengths.")
+ </td></tr>
+ <tr><td>
+ (Items marked with an 'O' the above table are
+ <br>
+ of the size specified in "Size of Offsets.")
+ </td></tr>
+ </table>
+ </div>
+
+ <p>
+ <center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Signature</td>
+ <td>
+ <P>The ASCII character string "<code>HEAP</code>"
+ is used to indicate the
+ beginning of a heap. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>Each local heap has its own version number so that new
+ heaps can be added to old files. This document
+ describes version zero (0) of the local heap.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Data Segment Size</td>
+ <td>
+ <P>The total amount of disk memory allocated for the heap
+ data. This may be larger than the amount of space
+ required by the objects stored in the heap. The extra
+ unused space in the heap holds a linked list of free blocks.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Offset to Head of Free-list</td>
+ <td>
+ <P>This is the offset within the heap data segment of the
+ first free block (or the
+ <A href="#UndefinedAddress">undefined address</A> if there is no
+ free block). The free block contains "Size of Lengths" bytes that
+ are the offset of the next free block (or the
+ value '1' if this is the
+ last free block) followed by "Size of Lengths" bytes that store
+ the size of this free block. The size of the free block includes
+ the space used to store the offset of the next free block and
+ the of the current block, making the minimum size of a free block
+ 2 * "Size of Lengths".
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Address of Data Segment</td>
+ <td>
+ <P>The data segment originally starts immediately after
+ the heap header, but if the data segment must grow as a
+ result of adding more objects, then the data segment may
+ be relocated, in its entirety, to another part of the
+ file.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </center>
+
+ <p>Objects within the heap should be aligned on an 8-byte boundary.
+
+ <h3><a name="GlobalHeap">Disk Format: Level 1E - Global Heap</a></h3>
+
+ <P>Each HDF5 file has a global heap which stores various types of
+ information which is typically shared between datasets. The
+ global heap was designed to satisfy these goals:
+
+ <ol type="A">
+ <li>Repeated access to a heap object must be efficient without
+ resulting in repeated file I/O requests. Since global heap
+ objects will typically be shared among several datasets, it is
+ probable that the object will be accessed repeatedly.
+ <li>Collections of related global heap objects should result in
+ fewer and larger I/O requests. For instance, a dataset of
+ object references will have a global heap object for each
+ reference. Reading the entire set of object references
+ should result in a few large I/O requests instead of one small
+ I/O request for each reference.
+ <li>It should be possible to remove objects from the global heap
+ and the resulting file hole should be eligible to be reclaimed
+ for other uses.
+ </ol>
+ </P>
+
+ <P>The implementation of the heap makes use of the memory
+ management already available at the file level and combines that
+ with a new top-level object called a <em>collection</em> to
+ achieve Goal B. The global heap is the set of all collections.
+ Each global heap object belongs to exactly one collection and
+ each collection contains one or more global heap objects. For
+ the purposes of disk I/O and caching, a collection is treated as
+ an atomic object.
+ </P>
+
+ <P>The HDF5 library creates global heap collections as needed, so there may
+ be multiple collections throughout the file. The set of all of them is
+ abstractly called the "global heap", although they don't actually link
+ to each other, and there is no global place in the file where you can
+ discover all of the collections. The collections are found simply by
+ finding a reference to one through another object in the file (eg.
+ variable-length datatype elements, etc).
+ </P>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ A Global Heap Collection
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4>Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Collection Size<sup>L</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Global Heap Object 1<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Global Heap Object 2<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>...<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Global Heap Object <em>N</em><br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Global Heap Object 0 (free space)<br><br></td>
+ </tr>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'L' the above table are
+ <br>
+ of the size specified in "Size of Lengths.")
+ </td></tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Signature</td>
+ <td>
+ <P>The ASCII character string "<code>GCOL</code>"
+ is used to indicate the
+ beginning of a collection. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>Each collection has its own version number so that new
+ collections can be added to old files. This document
+ describes version one (1) of the collections (there is no
+ version zero (0)).
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Collection Size</td>
+ <td>
+ <P>This is the size in bytes of the entire collection
+ including this field. The default (and minimum)
+ collection size is 4096 bytes which is a typical file
+ system block size. This allows for 127 16-byte heap
+ objects plus their overhead (the collection header of 16 bytes
+ and the 16 bytes of information about each heap object).
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Global Heap Object 1 through <em>N</em></td>
+ <td>
+ <P>The objects are stored in any order with no
+ intervening unused space.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Global Heap Object 0</td>
+ <td>
+ <P>Global Heap Object 0 (zero), when present, represents the free
+ space in the collection. Free space always appears at the end of
+ the collection. If the free space is too small to store the header
+ for Object 0 (described below) then the header is implied and the
+ collection contains no free space.
+ </P>
+ </td>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Global Heap Object
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=2>Heap Object ID</td>
+ <td colspan=2>Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Object Size<sup>L</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Object Data<br><br></td>
+ </tr>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'L' the above table are
+ <br>
+ of the size specified in "Size of Lengths.")
+ </td></tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Heap Object ID</td>
+ <td>
+ <P>Each object has a unique identification number within a
+ collection. The identification numbers are chosen so that
+ new objects have the smallest value possible with the
+ exception that the identifier <code>0</code> always refers to the
+ object which represents all free space within the
+ collection.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Reference Count</td>
+ <td>
+ <P>All heap objects have a reference count field. An
+ object which is referenced from some other part of the
+ file will have a positive reference count. The reference
+ count for Object 0 is always zero.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td>
+ <P>Zero padding to align next field on an 8-byte boundary.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Object Size</td>
+ <td>
+ <P>This is the size of the object data stored for the object.
+ The actual storage space allocated for the object data is rounded
+ up to a multiple of eight.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Object Data</td>
+ <td>
+ <P>The object data is treated as a one-dimensional array
+ of bytes to be interpreted by the caller.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <h3><a name="FreeSpaceIndex">Disk Format: Level 1F - Free-space Index</a></h3>
+
+ <p>The free-space index is a collection of blocks of data,
+ dispersed throughout the file, which are currently not used by
+ any file objects.
+
+ <p>The super block contains a pointer to root of the free-space description;
+ that pointer is currently required to be the
+ <A href="#UndefinedAddress">undefined address</A>.
+
+ <p>The format of the free-space index is not defined at this time.
+
+<!--
+ <p>The Free-space Index is a collection of blocks of data,
+ dispersed throughout the file, which are currently not used by
+ any file objects. The blocks of data are indexed by a B-tree of
+ their length within the file.
+
+
+ <p>Each B-tree page is composed of the following entries and
+ B-tree management information, organized as follows:
+
+ <p>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Free-space Heap Page</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Signature</td>
+ <tr align=center>
+ <td colspan=4>B-tree Left-link Offset</td>
+ <tr align=center>
+ <td colspan=4><br>Length of Free-block #1<br> <br></td>
+ <tr align=center>
+ <td colspan=4><br>Offset of Free-block #1<br> <br></td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4><br>Length of Free-block #n<br> <br></td>
+ <tr align=center>
+ <td colspan=4><br>Offset of Free-block #n<br> <br></td>
+ <tr align=center>
+ <td colspan=4>"High" Offset</td>
+ <tr align=center>
+ <td colspan=4>Right-link Offset</td>
+ </table>
+ </center>
+
+ <p>
+ <dl>
+ <dt> The elements of the free-space heap page are described below:
+ <dd>
+ <dl>
+ <dt>Signature: (4 bytes)
+ <dd>The ASCII character string <code>FREE</code>
+ is used to indicate the
+ beginning of a free-space heap B-tree page. This gives
+ file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+
+ <dt>B-tree Left-link Offset: (&lt;offset&gt; bytes)
+ <dd>This value is used to indicate the offset of all offsets
+ in the B-link-tree which are smaller than the value of the
+ offset in entry #1. This value is also used to indicate a
+ leaf node in the B-link-tree by being set to all ones.
+
+ <dt>Length of Free-block #n: (&lt;length&gt; bytes)
+ <dd>This value indicates the length of an unused block in
+ the file.
+
+ <dt>Offset of Free-block #n: (&lt;offset&gt; bytes)
+ <dd>This value indicates the offset in the file of an
+ unused block in the file.
+
+ <dt>"High" Offset: (4-bytes)
+ <dd>This offset is used as the upper bound on offsets
+ contained within a page when the page has been split.
+
+ <dt>Right-link Offset: (&lt;offset&gt; bytes)
+ <dd>This value is used to indicate the offset of the next
+ child to the right of the parent of this group
+ page. When there is no node to the right, this value is
+ all zeros.
+ </dl>
+ </dl>
+
+ <p>The algorithms for searching and inserting objects in the
+ B-tree pages are described fully in the Lehman and Yao paper,
+ which should be read to provide a full description of the
+ B-tree's usage.
+-->
+
+ <BR>
+ <HR>
+
+ <h2><a name="DataObject">Disk Format: Level 2 - Data Objects </a></h2>
+
+ <P>Data objects contain the real information in the file. These
+ objects compose the scientific data and other information which
+ are generally thought of as "data" by the end-user. All the
+ other information in the file is provided as a framework for
+ these data objects.
+ </P>
+
+ <P>A data object is composed of header information and data
+ information. The header information contains the information
+ needed to interpret the data information for the data object as
+ well as additional "metadata" or pointers to additional
+ "metadata" used to describe or annotate each data object.
+ </P>
+
+ <h3><a name="ObjectHeader">
+ Disk Format: Level 2A - Data Object Headers</a></h3>
+
+ <P>The header information of an object is designed to encompass
+ all the information about an object, except for the data itself.
+ This information includes
+ the dataspace, datatype, information about how the data
+ is stored on disk (in external files, compressed, broken up in
+ blocks, etc.), as well as other information used by the library
+ to speed up access to the data objects or maintain a file's
+ integrity. Information stored by user applications as attributes
+ is also stored in the object's header. The header of each object is
+ not necessarily located immediately prior to the object's data in the
+ file and in fact may be located in any position in the file. The order
+ of the messages in an object header is not significant.
+ </P>
+
+ <P>Header messages are aligned on 8-byte boundaries.
+ </P>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Object Headers
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Reserved (zero)</td>
+ <td colspan=2>Number of Header Messages</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Object Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Object Header Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Header Message Type #1</td>
+ <td colspan=2>Size of Header Message Data #1</td>
+ </tr>
+
+ <tr>
+ <td>Header Message #1 Flags</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Header Message Data #1<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>.<br>.<br>.<br></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Header Message Type #n</td>
+ <td colspan=2>Size of Header Message Data #n</td>
+ </tr>
+
+ <tr>
+ <td>Header Message #n Flags</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Header Message Data #n<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>This value is used to determine the format of the
+ information in the object header. When the format of the
+ information in the object header is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted. This
+ document describes version one (1) (there was no version
+ zero (0)).
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Number of Header Messages</td>
+ <td>
+ <P>This value determines the number of messages listed in
+ object headers for this object. This value includes the messages
+ in continuation messages for this object.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Object Reference Count</td>
+ <td>
+ <P>This value specifies the number of "hard links" to this object
+ within the current file. References to the object from external
+ files, "soft links" in this file and object references in this
+ file are not tracked.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Object Header Size</td>
+ <td>
+ <P>This value specifies the number of bytes of header message data
+ following this length field that contain object header messages
+ for this object header. This value does not include the size of
+ object header continuation blocks for this object elsewhere in the
+ file.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Header Message Type</td>
+ <td>
+ <P>This value specifies the type of information included in the
+ following header message data. The header message types for the
+ pre-defined header messages are included in sections below.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Size of Header Message Data</td>
+ <td>
+ <P>This value specifies the number of bytes of header
+ message data following the header message type and length
+ information for the current message. The size includes
+ padding bytes to make the message a multiple of eight
+ bytes.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Header Message Flags</td>
+ <td>
+ <P>This is a bit field with the following definition:
+ <table class=list>
+ <tr>
+ <th width="30%">Bit</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>If set, the message data is constant. This is used
+ for messages like the datatype message of a dataset.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>If set, the message is stored in the global heap.
+ The Header Message Data field contains a Shared Object
+ message and the Size of Header Message Data field
+ contains the size of that Shared Object message.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Header Message Data</td>
+ <td>
+ <P>The format and length of this field is determined by the
+ header message type and size respectively. Some header
+ message types do not require any data and this information
+ can be eliminated by setting the length of the message to
+ zero. The data is padded with enough zeros to make the
+ size a multiple of eight.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <P>The header message types and the message data associated with
+ them compose the critical "metadata" about each object. Some
+ header messages are required for each object while others are
+ optional. Some optional header messages may also be repeated
+ several times in the header itself, the requirements and number
+ of times allowed in the header will be noted in each header
+ message description below.
+ </P>
+
+ <P>The following is a list of currently defined header messages:
+ </P>
+
+ <hr>
+ <h4><a name="NILMessage">Name: NIL</a></h4>
+
+ <P class=item><B>Header Message Type: </B>0x0000
+ </P>
+ <P class=item><B>Length:</B> varies
+ </P>
+ <P class=item><B>Status:</B> Optional, may be repeated.
+ </P>
+ <P class=item><B>Purpose and Description:</B> The NIL message is used to indicate a
+ message which is to be ignored when reading the header messages for a
+ data object. [Possibly one which has been deleted for some reason.]
+ </P>
+ <P class=item><B>Format of Data:</B> Unspecified.
+ </P>
+
+ <hr>
+ <h4><a name="SimpleDataSpace">Name: Simple Dataspace</a></h4>
+
+ <P class=item><B>Header Message Type: </B>0x0001
+ </P>
+ <P class=item><B>Length:</B> Varies according to the number of dimensions,
+ as described in the following table.
+ </P>
+ <P class=item><B>Status:</B> Required for dataset objects, may not be
+ repeated.
+ </P>
+ <P class=item><B>Description:</B> The simple dataspace message describes the
+ number of dimensions (i.e. "rank") and size of each dimension that the
+ data object has. This message is only used for datasets which have a
+ simple, rectilinear grid layout; datasets requiring a more complex
+ layout (irregularly structured or unstructured grids, etc.) must use
+ the <em>Complex Dataspace</em> message for expressing the space the
+ dataset inhabits. <i>(Note: The <em>Complex Dataspace</em>
+ functionality is not yet implemented and it is not described in this
+ document.)</i>
+ </P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Simple Dataspace Message
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Flags</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension #1 Size<sup>L</sup></td>
+ <tr>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr>
+ <td colspan=4>Dimension #n Size<sup>L</sup></td>
+ <tr>
+ <td colspan=4>Dimension #1 Maximum Size<sup>L</sup></td>
+ <tr>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr>
+ <td colspan=4>Dimension #n Maximum Size<sup>L</sup></td>
+ <tr>
+ <td colspan=4>Permutation Index #1<sup>L</sup></td>
+ <tr>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr>
+ <td colspan=4>Permutation Index #n<sup>L</sup></td>
+ </table>
+
+ <table class=note>
+ <tr><td>
+ (Items marked with an 'L' the above table are
+ <br>
+ of the size specified in "Size of Lengths.")
+ </td></tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>This value is used to determine the format of the
+ Simple Dataspace Message. When the format of the
+ information in the message is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted. This
+ document describes version one (1) (there was no version
+ zero (0)).
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td>
+ <P>This value is the number of dimensions that the data
+ object has.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td>
+ <P>This field is used to store flags to indicate the
+ presence of parts of this message. Bit 0 (the least
+ significant bit) is used to indicate that maximum
+ dimensions are present. Bit 1 is used to indicate that
+ permutation indices are present.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimension #n Size</td>
+ <td>
+ <P>This value is the current size of the dimension of the
+ data as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimension #n Maximum Size</td>
+ <td>
+ <P>This value is the maximum size of the dimension of the
+ data as stored in the file. This value may be the special
+ "<A href="#UnlimitedDim">unlimited</A>" size which indicates
+ that the data may expand along this dimension indefinitely.
+ If these values are not stored, the maximum size of each
+ dimension is assumed to be the dimension's current size.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Permutation Index #n</td>
+ <td>
+ <P>This value is the index permutation used to map
+ each dimension from the canonical representation to an
+ alternate axis for each dimension. If these values are
+ not stored, the first dimension stored in the list of
+ dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </P>
+
+<!--
+ <hr>
+ <h4><a name="DataSpaceMessage">Name: Complex Dataspace (Fiber Bundle?)</a></h4>
+ <b>Header Message Type: </b>0x0002<br>
+ <b>Length:</b> varies<br>
+
+ <b>Status:</b> One of the <em>Simple Dataspace</em> or
+ <em>Complex Dataspace</em> messages is required (but not both) and may
+ not be repeated.<br> <b>Purpose and Description:</b> The
+ <em>Dataspace</em> message describes space that the dataset is
+ mapped onto in a more comprehensive way than the <em>Simple
+ Dimensionality</em> message is capable of handling. The
+ dataspace of a dataset encompasses the type of coordinate system
+ used to locate the dataset's elements as well as the structure and
+ regularity of the coordinate system. The dataspace also
+ describes the number of dimensions which the dataset inhabits as
+ well as a possible higher dimensional space in which the dataset
+ is located within.
+
+ <br>
+ <b>Format of Data:</b>
+
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Message Layout</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Mesh Type</td>
+ <tr align=center>
+ <td colspan=4>Logical Dimensionality</td>
+ </table>
+ </center>
+
+ <p>
+ <dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Mesh Type: (unsigned 32-bit integer)
+ <dd>This value indicates whether the grid is
+ polar/spherical/cartesion,
+ structured/unstructured and regular/irregular. <br>
+ The mesh type value is broken up as follows: <br>
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Mesh-type Layout</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=1>Mesh Embedding</td>
+ <td colspan=1>Coordinate System</td>
+ <td colspan=1>Structure</td>
+ <td colspan=1>Regularity</td>
+ </table>
+ </center>
+ The following are the definitions of mesh-type bytes:
+ <dl>
+ <dt>Mesh Embedding
+ <dd>This value indicates whether the dataset dataspace
+ is located within
+ another dataspace or not:
+ <dl> <dl>
+ <dt>&lt;STANDALONE&gt;
+ <dd>The dataset mesh is self-contained and is not
+ embedded in another mesh.
+ <dt>&lt;EMBEDDED&gt;
+ <dd>The dataset's dataspace is located within
+ another dataspace, as
+ described in information below.
+ </dl> </dl>
+ <dt>Coordinate System
+ <dd>This value defines the type of coordinate system
+ used for the mesh:
+ <dl> <dl>
+ <dt>&lt;POLAR&gt;
+ <dd>The last two dimensions are in polar
+ coordinates, higher dimensions are
+ cartesian.
+ <dt>&lt;SPHERICAL&gt;
+ <dd>The last three dimensions are in spherical
+ coordinates, higher dimensions
+ are cartesian.
+ <dt>&lt;CARTESIAN&gt;
+ <dd>All dimensions are in cartesian coordinates.
+ </dl> </dl>
+ <dt>Structure
+ <dd>This value defines the locations of the grid-points
+ on the axes:
+ <dl> <dl>
+ <dt>&lt;STRUCTURED&gt;
+ <dd>All grid-points are on integral, sequential
+ locations, starting from 0.
+ <dt>&lt;UNSTRUCTURED&gt;
+ <dd>Grid-points locations in each dimension are
+ explicitly defined and
+ may be of any numeric datatype.
+ </dl> </dl>
+ <dt>Regularity
+ <dd>This value defines the locations of the dataset
+ points on the grid:
+ <dl> <dl>
+ <dt>&lt;REGULAR&gt;
+ <dd>All dataset elements are located at the
+ grid-points defined.
+ <dt>&lt;IRREGULAR&gt;
+ <dd>Each dataset element has a particular
+ grid-location defined.
+ </dl> </dl>
+ </dl>
+ <p>The following grid combinations are currently allowed:
+ <dl> <dl>
+ <dt>&lt;POLAR-STRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-STRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-STRUCTURED-REGULAR&gt;
+ <dt>&lt;POLAR-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-IRREGULAR&gt;
+ </dl> </dl>
+ All of the above grid types can be embedded within another
+ dataspace.
+ <br> <br>
+ <dt>Logical Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions that the dataset occupies.
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Embedded Dimensionality Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Embedded Dimensionality</td>
+ <tr align=center>
+ <td colspan=4>Embedded Dimension Size #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Embedded Dimension Size #n</td>
+ <tr align=center>
+ <td colspan=4>Embedded Origin Location #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Embedded Origin Location #n</td>
+ </table>
+ </center>
+
+ <dt>Embedded Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions of the space the
+ dataset is located
+ within. i.e. a planar dataset located within a 3-D space,
+ or a 3-D dataset
+ which is a subset of another 3-D space, etc.
+ <dt>Embedded Dimension Size: (unsigned 32-bit integer)
+ <dd>These values are the sizes of the dimensions of the
+ embedded dataspace
+ that the dataset is located within.
+ <dt>Embedded Origin Location: (unsigned 32-bit integer)
+ <dd>These values comprise the location of the dataset's
+ origin within the embedded dataspace.
+ </dl>
+ </dl>
+ [Comment: need some way to handle different orientations of the
+ dataset dataspace
+ within the embedded dataspace]<br>
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Structured/Regular Grid Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4>Logical Dimension Size #1</td>
+ <tr align=center>
+ <td colspan=4>Logical Dimension Maximum #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Logical Dimension Size #n</td>
+ <tr align=center>
+ <td colspan=4>Logical Dimension Maximum #n</td>
+ </table>
+ </center>
+
+ <p>
+ <dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Logical Dimension Size #n: (unsigned 32-bit integer)
+ <dd>This value is the current size of the dimension of the
+ data as stored in
+ the file. The first dimension stored in the list of
+ dimensions is the slowest
+ changing dimension and the last dimension stored is the
+ fastest changing
+ dimension.
+ <dt>Logical Dimension Maximum #n: (unsigned 32-bit integer)
+ <dd>This value is the maximum size of the dimension of the
+ data as stored in
+ the file. This value may be the special value
+ &lt;UNLIMITED&gt; which
+ indicates that the data may expand along this dimension
+ indefinitely.
+ </dl>
+ </dl>
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Structured/Irregular Grid Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4># of Grid Points in Dimension #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4># of Grid Points in Dimension #n</td>
+ <tr align=center>
+ <td colspan=4>Datatype of Grid Point Locations</td>
+ <tr align=center>
+ <td colspan=4>Location of Grid Points in Dimension #1</td>
+ <tr align=center>
+ <td colspan=4>.<br>.<br>.<br></td>
+ <tr align=center>
+ <td colspan=4>Location of Grid Points in Dimension #n</td>
+ </table>
+ </center>
+
+ <P>
+ <center>
+ <table border cellpadding=4 width="80%">
+ <caption align=bottom>
+ <B>HDF5 Dataspace Unstructured Grid Information</B>
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+
+ <tr align=center>
+ <td colspan=4># of Grid Points</td>
+ <tr align=center>
+ <td colspan=4>Datatype of Grid Point Locations</td>
+ <tr align=center>
+ <td colspan=4>Grid Point Locations<br>.<br>.<br></td>
+ </table>
+ </center>
+-->
+
+ <hr>
+ <h4><a name="ReservedMessage_0002">Name: Reserved - Not Assigned Yet</a></h4>
+ <b>Header Message Type:</b> 0x0002<BR>
+ <b>Length:</b> N/A<BR>
+ <b>Status:</b> N/A<BR>
+ <b>Format of Data:</b> N/A<BR>
+
+ <p><b>Purpose and Description:</b> This message type was skipped during
+ the initial specification of the file format and may be used in a
+ future expansion to the format.
+
+
+ <hr>
+ <h4><a name="DataTypeMessage">Name: Datatype</a></h4>
+
+ <P class=item><B>Header Message Type:</B> 0x0003
+ </P>
+ <P class=item><B>Length:</B> variable
+ </P>
+ <P class=item><B>Status:</B> Required for dataset or named datatype objects,
+ may not be repeated.
+ </P>
+
+ <P class=item><B>Description:</B> The datatype message defines the datatype
+ for each element of a dataset. A datatype can describe an atomic type
+ like a fixed- or floating-point type or a compound type like a C
+ struct.
+ Datatypes messages are stored
+ as a list of datatype classes and
+ their associated properties.
+ </P>
+
+ <P class=item2>Datatype messages that are part of a dataset object,
+ do not describe how elements are related to one another, the dataspace
+ message is used for that purpose. Datatype messages that are part of
+ a named datatype message describe an "abstract" datatype that can be
+ used by other objects in the file.
+ </P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Datatype Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Class and Version</td>
+ <td>Class Bit Field, Bits 0-7</td>
+ <td>Class Bit Field, Bits 8-15</td>
+ <td>Class Bit Field, Bits 16-23</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br><br>Properties<br><br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Class and Version</td>
+ <td>
+ <P>The version of the datatype message and the datatype's class
+ information are packed together in this field. The version
+ number is packed in the top 4 bits of the field and the class
+ is contained in the bottom 4 bits.
+ </P>
+ <P>The version number information is used for changes in the
+ format of the datatype message and is described here:
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Used by early versions of the library to encode
+ compound datatypes with explicit array fields.
+ See the compound datatype description below for
+ further details.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>The current version used by the library.
+ </td>
+ </tr>
+ </table>
+ </P>
+ <P>The class of the datatype determines the format for the class
+ bit field and properties portion of the datatype message, which
+ are described below. The
+ following classes are currently defined:
+ <table width=100% class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Fixed-Point</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Floating-Point</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Time</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>3</code></td>
+ <td>String</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>4</code></td>
+ <td>Bitfield</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>5</code></td>
+ <td>Opaque</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>6</code></td>
+ <td>Compound</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>7</code></td>
+ <td>Reference</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>8</code></td>
+ <td>Enumerated</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>9</code></td>
+ <td>Variable-Length</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>10</code></td>
+ <td>Array</td>
+ </tr>
+ </table>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Class Bit Fields</td>
+ <td>
+ <P>The information in these bit fields is specific to each datatype
+ class and is described below. All bits not defined for a
+ datatype class are set to zero.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Size</td>
+ <td>
+ <P>The size of the datatype in bytes.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Properties</td>
+ <td>
+ <P>This variable-sized field encodes information specific to each
+ datatype class and is described below. If there is no
+ property information specified for a datatype class, the size
+ of this field is zero.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Fixed-Point Numbers (Class 0):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0</td>
+ <td><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</td>
+ </tr>
+
+ <tr>
+ <td>1, 2</td>
+ <td><b>Padding type.</b> Bit 1 is the lo_pad type and bit 2
+ is the hi_pad type. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</td>
+ </tr>
+
+ <tr>
+ <td>3</td>
+ <td><b>Signed.</b> If this bit is set then the fixed-point
+ number is in 2's complement form.</td>
+ </tr>
+
+ <tr>
+ <td>4-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Descriptions
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=2>Bit Offset</td>
+ <td colspan=2>Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Bit Offset</td>
+ <td>
+ <P>The bit offset of the first significant bit of the fixed-point
+ value within the datatype. The bit offset specifies the number
+ of bits "to the right of" the value.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Bit Precision</td>
+ <td>
+ <P>The number of bits of precision of the fixed-point value
+ within the datatype.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Floating-Point Numbers (Class 1):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0</td>
+ <td><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</td>
+ </tr>
+
+ <tr>
+ <td>1, 2, 3</td>
+ <td><b>Padding type.</b> Bit 1 is the low bits pad type, bit 2
+ is the high bits pad type, and bit 3 is the internal bits
+ pad type. If a datum has unused bits at either end or between
+ the sign bit, exponent, or mantissa, then the value of bit
+ 1, 2, or 3 is copied to those locations.</td>
+ </tr>
+
+ <tr>
+ <td>4-5</td>
+ <td><b>Normalization.</b> The value can be 0 if there is no
+ normalization, 1 if the most significant bit of the
+ mantissa is always set (except for 0.0), and 2 if the most
+ signficant bit of the mantissa is not stored but is
+ implied to be set. The value 3 is reserved and will not
+ appear in this field.</td>
+ </tr>
+
+ <tr>
+ <td>6-7</td>
+ <td>Reserved (zero).</td>
+ </tr>
+
+ <tr>
+ <td>8-15</td>
+ <td><b>Sign Location.</b> This is the bit position of the sign
+ bit. Bits are numbered with the least significant bit zero.</td>
+ </tr>
+
+ <tr>
+ <td>16-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Descriptions
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=2>Bit Offset</td>
+ <td colspan=2>Bit Precision</td>
+ </tr>
+
+ <tr>
+ <td>Exponent Location</td>
+ <td>Exponent Size</td>
+ <td>Mantissa Location</td>
+ <td>Mantissa Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Exponent Bias</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Bit Offset</td>
+ <td>
+ <P>The bit offset of the first significant bit of the floating-point
+ value within the datatype. The bit offset specifies the number
+ of bits "to the right of" the value.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Bit Precision</td>
+ <td>
+ <P>The number of bits of precision of the floating-point value
+ within the datatype.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Exponent Location</td>
+ <td>
+ <P>The bit position of the exponent field. Bits are numbered with
+ the least significant bit number zero.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Exponent Size</td>
+ <td>
+ <P>The size of the exponent field in bits.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Mantissa Location</td>
+ <td>
+ <P>The bit position of the mantissa field. Bits are numbered with
+ the least significant bit number zero.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Mantissa Size</td>
+ <td>
+ <P>The size of the mantissa field in bits.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Exponent Bias</td>
+ <td>
+ <P>The bias of the exponent field.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Time (Class 2):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0</td>
+ <td><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</td>
+ </tr>
+
+ <tr>
+ <td>1-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Descriptions
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=2>Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Bit Precision</td>
+ <td>
+ <P>The number of bits of precision of the time value.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Strings (Class 3):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0-3</td>
+ <td><b>Padding type.</b> This four-bit value determines the
+ type of padding to use for the string. The values are:
+
+ <table width=100% class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Null Terminate: A zero byte marks the end of the
+ string and is guaranteed to be present after
+ converting a long string to a short string. When
+ converting a short string to a long string the value is
+ padded with additional null characters as necessary.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Null Pad: Null characters are added to the end of
+ the value during conversions from short values to long
+ values but conversion in the opposite direction simply
+ truncates the value.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Space Pad: Space characters are added to the end of
+ the value during conversions from short values to long
+ values but conversion in the opposite direction simply
+ truncates the value. This is the Fortran
+ representation of the string.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>3-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table>
+ </tr>
+
+ <tr>
+ <td>4-7</td>
+ <td><b>Character Set.</b> The character set to use for
+ encoding the string. The only character set supported is
+ the 8-bit ASCII (zero) so no translations have been defined
+ yet.</td>
+ </tr>
+
+ <tr>
+ <td>8-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <P>There are no properties defined for the string class.
+ </P>
+ </P>
+
+ <P>Class specific information for Bitfields (Class 4):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0</td>
+ <td><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</td>
+ </tr>
+
+ <tr>
+ <td>1, 2</td>
+ <td><b>Padding type.</b> Bit 1 is the lo_pad type and bit 2
+ is the hi_pad type. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</td>
+ </tr>
+
+ <tr>
+ <td>3-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=2>Bit Offset</td>
+ <td colspan=2>Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Bit Offset</td>
+ <td>
+ <P>The bit offset of the first significant bit of the bitfield
+ within the datatype. The bit offset specifies the number
+ of bits "to the right of" the value.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Bit Precision</td>
+ <td>
+ <P>The number of bits of precision of the bitfield
+ within the datatype.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Opaque (Class 5):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0-7</td>
+ <td>Length of ASCII tag in bytes.</td>
+ </tr>
+
+ <tr>
+ <td>8-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>ASCII Tag<br>
+ <br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>ASCII Tag</td>
+ <td>
+ <P>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Compound (Class 6):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0-15</td>
+ <td><b>Number of Members.</b> This field contains the number
+ of members defined for the compound datatype. The member
+ definitions are listed in the Properties field of the data
+ type message.
+ </tr>
+
+ <tr>
+ <td>15-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+ </P>
+
+ <P>The Properties field of a compound datatype is a list of the
+ member definitions of the compound datatype. The member
+ definitions appear one after another with no intervening bytes.
+ The member types are described with a recursive datatype
+ message.
+
+ <P>Note that the property descriptions are different for different
+ versions of the datatype version. Additionally note that the version
+ 0 properties are deprecated and have been replaced with the version
+ 1 properties in versions of the HDF5 library from the 1.4 release
+ onward.
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Properties Description for Datatype Version 1
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Byte Offset of Member</td>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension Permutation</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension #1 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension #2 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension #3 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension #4 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Member Type Message<br><br></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Name</td>
+ <td>
+ <P>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Byte Offset of Member</td>
+ <td>
+ <P>This is the byte offset of the member within the datatype.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td>
+ <P>If set to zero, this field indicates a scalar member. If set
+ to a value greater than zero, this field indicates that the
+ member is an array of values. For array members, the size of
+ the array is indicated by the 'Size of Dimension n' field in
+ this message.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimension Permutation</td>
+ <td>
+ <P>This field was intended to allow an array field to have
+ it's dimensions permuted, but this was never implemented.
+ This field should always be set to zero.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimension #n Size</td>
+ <td>
+ <P>This field is the size of a dimension of the array field as
+ stored in the file. The first dimension stored in the list of
+ dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Member Type Message</td>
+ <td>
+ <P>This field is a datatype message describing the datatype of
+ the member.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Properties Description for Datatype Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Byte Offset of Member</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Member Type Message<br><br></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Name</td>
+ <td>
+ <P>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Byte Offset of Member</td>
+ <td>
+ <P>This is the byte offset of the member within the datatype.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Member Type Message</td>
+ <td>
+ <P>This field is a datatype message describing the datatype of
+ the member.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Reference (Class 7):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0-3</td>
+ <td><b>Type.</b> This four-bit value contains the type of reference
+ described. The values defined are:
+
+ <table width=100% class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Object Reference: A reference to another object in this
+ HDF5 file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Dataset Region Reference: A reference to a region within
+ a dataset in this HDF5 file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Internal Reference: A reference to a region within the
+ current dataset. (Not currently implemented)
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>3-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td>15-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <P>There are no properties defined for the reference class.
+ </P>
+ </P>
+
+ <P>Class specific information for Enumeration (Class 8):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0-15</td>
+ <td><b>Number of Members.</b> The number of name/value
+ pairs defined for the enumeration type.</td>
+ </tr>
+
+ <tr>
+ <td>16-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Base Type<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Names<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Values<br><br></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Base Type</td>
+ <td>
+ <P>Each enumeration type is based on some parent type, usually an
+ integer. The information for that parent type is described
+ recursively by this field.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Names</td>
+ <td>
+ <P>The name for each name/value pair. Each name is stored as a null
+ terminated ASCII string in a multiple of eight bytes. The names
+ are in no particular order.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Values</td>
+ <td>
+ <P>The list of values in the same order as the names. The values
+ are packed (no inter-value padding) and the size of each value
+ is determined by the parent type.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </P>
+
+
+ <P>Class specific information for Variable-Length (Class 9):
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <caption>
+ Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td>0-3</td>
+ <td><b>Type.</b> This four-bit value contains the type of
+ variable-length datatype described. The values defined are:
+
+ <table width=100% class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Sequence: A variable-length sequence of any sequence of
+ data. Variable-length sequences do not have padding or
+ character set information.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>String: A variable-length sequence of characters.
+ Variable-length strings have padding and character set
+ information.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td>4-7</td>
+ <td><b>Padding type.</b> (variable-length string only)
+ This four-bit value determines the type of padding
+ used for variable-length strings. The values are the same
+ as for the string padding type, as follows:
+ <table width=100% class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Null terminate: A zero byte marks the end of a string
+ and is guaranteed to be present after converting a long
+ string to a short string. When converting a short string
+ to a long string, the value is padded with additional null
+ characters as necessary.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Null pad: Null characters are added to the end of the
+ value during conversion from a short string to a longer
+ string. Conversion from a long string to a shorter string
+ simply truncates the value.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Space pad: Space characters are added to the end of the
+ value during conversion from a short string to a longer
+ string. Conversion from a long string to a shorter string
+ simply truncates the value. This is the Fortran
+ representation of the string.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>3-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table>
+
+ This value is set to zero for variable-length sequences.
+
+ </td>
+ </tr>
+
+ <tr>
+ <td>8-11</td>
+ <td><b>Character Set.</b> (variable-length string only)
+ This four-bit value specifies the character set
+ to be used for encoding the string:
+ <table width=100% class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>ASCII: As of this writing (July 2003, Release 1.6.0),
+ 8-bit ASCII is the only character set supported. Therefore,
+ no translations have been defined.
+ </td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table>
+
+ This value is set to zero for variable-length sequences.
+
+ </td>
+ </tr>
+
+ <tr>
+ <td>12-23</td>
+ <td>Reserved (zero).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Base Type<br><br></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Base Type</td>
+ <td>
+ <P>Each variable-length type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </P>
+
+ <P>Class specific information for Array (Class 10):
+
+ <P>There are no bit fields defined for the array class.
+ </P>
+
+ <P>Note that the dimension information defined in the property for this
+ datatype class is independent of dataspace information for a dataset.
+ The dimension information here describes the dimensionality of the
+ information within a data element (or a component of an element, if the
+ array datatype is nested within another datatype) and the dataspace for a
+ dataset describes the location of the elements in a dataset.
+ </P>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan=3>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension #1 Size</td>
+ </tr>
+ <tr>
+ <td colspan=4>.<br>.<br>.<br></td>
+ </tr>
+ <tr>
+ <td colspan=4>Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Permutation Index #1</td>
+ </tr>
+ <tr>
+ <td colspan=4>.<br>.<br>.<br></td>
+ </tr>
+ <tr>
+ <td colspan=4>Permutation Index #n</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Base Type<br><br></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td>
+ <P>This value is the number of dimensions that the array has.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimension #n Size</td>
+ <td>
+ <P>This value is the size of the dimension of the array
+ as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Permutation Index #n</td>
+ <td>
+ <P>This value is the index permutation used to map
+ each dimension from the canonical representation to an
+ alternate axis for each dimension. Currently, dimension
+ permutations are not supported and these indices should be set
+ to the index position minus one (i.e. the first dimension should
+ be set to 0, the second dimension should be set to 1, etc.)
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Base Type</td>
+ <td>
+ <P>Each array type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ </P>
+
+ <hr>
+ <h4><a name="OldFillValueMessage">Name: Data Storage - Fill Value (Old)</a></h4>
+
+ <P class=item><B>Header Message Type:</B> 0x0004
+ </P>
+ <P class=item><B>Length:</B> varies
+ </P>
+ <P class=item><B>Status:</B> Optional, may not be repeated.
+ </P>
+
+ <P class=item><B>Description:</B> The fill value message stores a single
+ data value which is returned to the application when an uninitialized
+ data element is read from a dataset. The fill value is interpreted
+ with the same datatype as the dataset. If no fill value message is
+ present then a fill value of all zero bytes is assumed.
+ </P>
+
+ <P class=item2>This fill value message is deprecated in favor of the "new"
+ fill value message (Message Type 0x0005) and is only written to the
+ file for forward compatibility with versions of the HDF5 library before
+ the 1.6.0 version. Additionally, it only appears for datasets with a
+ user defined fill value (as opposed to the library default fill value
+ or an explicitly set "undefined" fill value).
+ </P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Fill Value Message (Old)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4>Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Fill Value<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Size</td>
+ <td>
+ <P>This is the size of the Fill Value field in bytes.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Fill Value</td>
+ <td>
+ <P>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </P>
+
+ <hr>
+ <h4><a name="FillValueMessage">Name: Data Storage - Fill Value </a></h4>
+
+ <P class=item><B>Header Message Type:</B> 0x0005
+ </P>
+ <P class=item><B>Length:</B> varies
+ </P>
+ <P class=item><B>Status:</B> Required for dataset objects, may not be repeated.
+ </P>
+
+ <P class=item><B>Description:</B> The fill value message stores a single
+ data value which is returned to the application when an uninitialized
+ data element is read from a dataset. The fill value is interpreted
+ with the same datatype as the dataset.
+ </P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Fill Value Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Space Allocation Time</td>
+ <td>Fill Value Write Time</td>
+ <td>Fill Value Defined</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Fill Value<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>The version number information is used for changes in the
+ format of the fill value message and is described here:
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Used by version 1.6.x of the library to encode
+ fill values. In this version, the Size field is
+ always present.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>The current version used by the library (version
+ 1.7.3 or later). In this version, the Size and
+ Fill Value fields are
+ only present if the Fill Value Defined field is set
+ to 1.
+ </td>
+ </tr>
+ </table>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Space Allocation Time</td>
+ <td>
+ <P>When the storage space for the dataset's raw data will be
+ allocated. The allowed values are:
+ <table class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Early allocation. Storage space for the entire dataset
+ should be allocated in the file when the dataset is
+ created.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Late allocation. Storage space for the entire dataset
+ should not be allocated until the dataset is written
+ to.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>3</code></td>
+ <td>Incremental allocation. Storage space for the
+ dataset should not be allocated until the portion
+ of the dataset is written to. This is currently
+ used in conjunction with chunked data storage for
+ datasets.
+ </td>
+ </tr>
+ </table>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Fill Value Write Time</td>
+ <td>
+ <P>At the time that storage space for the dataset's raw data is
+ allocated, this value indicates whether the fill value should
+ be written to the raw data storage elements. The allowed values
+ are:
+ <table class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>On allocation. The fill value is always written to
+ the raw data storage when the storage space is allocated.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Never. The fill value should never be written to
+ the raw data storage.
+ </td>
+ </tr>
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Fill value written if set by user. The fill value
+ will be written to the raw data storage when the storage
+ space is allocated only if the user explicitly set
+ the fill value. If the fill value is the library
+ default or is undefined, it will not be written to
+ the raw data storage.
+ </td>
+ </tr>
+ </table>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Fill Value Defined</td>
+ <td>
+ <P>This value indicates if a fill value is defined for this
+ dataset. If this value is 0, the fill value is undefined.
+ If this value is 1, a fill value is defined for this dataset.
+ For version 2 or later of the fill value message, this value
+ controls the presence of the Size field.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Size</td>
+ <td>
+ <P>This is the size of the Fill Value field in bytes. This field
+ is not present if the Version field is >1 and the Fill Value
+ Defined field is set to 0.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Fill Value</td>
+ <td>
+ <P>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset. This field is
+ not present if the Version field is >1 and the Fill Value
+ Defined field is set to 0.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </P>
+
+<!--
+ <hr>
+ <h4><a name="CompactDataStorageMessage">Name: Data Storage - Compact</a></h4>
+
+ <b>Header Message Type:</b> 0x0006<br>
+ <b>Length:</b> varies<br>
+ <b>Status:</b> Optional, may not be repeated.<br>
+
+ <p>This message indicates that the data for the data object is
+ stored within the current HDF file by including the actual
+ data as the header data for this message. The data is
+ stored internally in
+ the <em>normal format</em>, i.e. in one chunk, uncompressed, etc.
+
+ <P>Note that one and only one of the <em>Data Storage</em> headers can be
+ stored for each data object.
+
+ <P><b>Format of Data:</b> The message data is actually composed
+ of dataset data, so the format will be determined by the dataset
+ format.
+-->
+
+ <hr>
+ <h4><a name="ReservedMessage_0006">Name: Reserved - Not Assigned Yet</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x0006</P>
+ <P class=item><B>Length:</B> N/A</P>
+ <P class=item><B>Status:</B> N/A</P>
+ <P class=item><B>Format of Data:</B> N/A</P>
+
+ <P class=item><B>Purpose and Description:</B> This message type was skipped during
+ the initial specification of the file format and may be used in a
+ future expansion to the format.</P>
+
+ <hr>
+ <h4><a name="ExternalFileListMessage">Name: Data Storage -
+ External Data Files</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x0007 </P>
+ <P class=item><B>Length:</B> varies</P>
+ <P class=item><B>Status:</B> Optional, may not be repeated.</P>
+
+ <P class=item><B>Purpose and Description:</B> The external object message
+ indicates that the data for an object is stored outside the HDF5
+ file. The filename of the object is stored as a Universal
+ Resource Location (URL) of the actual filename containing the
+ data. An external file list record also contains the byte offset
+ of the start of the data within the file and the amount of space
+ reserved in the file for that data.</P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ External File List Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan=3>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Allocated Slots</td>
+ <td colspan=2>Used Slots</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Heap Address<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Slot Definitions...<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>The version number information is used for changes in the format of External File
+ List Message and is described here:
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Never used.
+ </tr>
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>The current version used by the library.
+ </tr>
+ </table>
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td>
+ <P>This field is reserved for future use.</P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Allocated Slots</td>
+ <td>
+ <P>The total number of slots allocated in the message. Its value must be at least as
+ large as the value contained in the Used Slots field. (The current library simply
+ uses the number of Used Slots for this message)</P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Used Slots</td>
+ <td>
+ <P>The number of initial slots which contains valid information.</P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Heap Address</td>
+ <td>
+ <P>This is the address of a local heap which contains the names for the external
+ files (The local heap information can be found in Disk Format Level 1D in this
+ document). The name at offset zero in the heap is always the empty string.</P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Slot Definitions</td>
+ <td>
+ <P>The slot definitions are stored in order according to the array addresses they
+ represent.</P>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ External File List Slot
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name Offset(&lt;size&gt; bytes)<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>File Offset(&lt;size&gt; bytes)<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Size<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Name Offset(&lt;size&gt; bytes)</td>
+ <td>
+ <P>The byte offset within the local name heap for the name
+ of the file. File names are stored as a URL which has a
+ protocol name, a host name, a port number, and a file
+ name:
+ <code><em>protocol</em>:<em>port</em>//<em>host</em>/<em>file</em></code>.
+ If the protocol is omitted then "file:" is assumed. If
+ the port number is omitted then a default port for that
+ protocol is used. If both the protocol and the port
+ number are omitted then the colon can also be omitted. If
+ the double slash and host name are omitted then
+ "localhost" is assumed. The file name is the only
+ mandatory part, and if the leading slash is missing then
+ it is relative to the application's current working
+ directory (the use of relative names is not
+ recommended).</P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>File Offset(&lt;size&gt; bytes)</td>
+ <td>
+ <P>This is the byte offset to the start of the data in the
+ specified file. For files that contain data for a single
+ dataset this will usually be zero.</P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Size</td>
+ <td>
+ <P>This is the total number of bytes reserved in the
+ specified file for raw data storage. For a file that
+ contains exactly one complete dataset which is not
+ extendable, the size will usually be the exact size of the
+ dataset. However, by making the size larger one allows
+ HDF5 to extend the dataset. The size can be set to a value
+ larger than the entire file since HDF5 will read zeros
+ past the end of the file without failing.</P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <hr>
+ <h4><a name="LayoutMessage">Name: Data Storage - Layout</a></h4>
+
+ <P class=item><B>Header Message Type:</B> 0x0008</P>
+ <P class=item><B>Length:</B> varies</P>
+ <P class=item><B>Status:</B> Required for datasets, may not be repeated.</P>
+
+ <P class=item><B>Purpose and Description:</B> Data layout describes how the
+ elements of a multi-dimensional array are arranged in the linear
+ address space of the file. Three types of data layout are
+ supported:
+
+ <ol>
+ <li>Contiguous: The array can be stored in one contiguous area of the file.
+ The layout requires that the size of the array be constant and
+ does not permit chunking, compression, checksums, encryption,
+ etc. The message stores the total size of the array and the
+ offset of an element from the beginning of the storage area is
+ computed as in C.
+
+ <li>Chunked: The array domain can be regularly decomposed into chunks and
+ each chunk is allocated separately. This layout supports
+ arbitrary element traversals, compression, encryption, and
+ checksums, and the chunks can be distributed across external
+ raw data files (these features are described in other
+ messages). The message stores the size of a chunk instead of
+ the size of the entire array; the size of the entire array can
+ be calculated by traversing the B-tree that stores the chunk
+ addresses.
+
+ <li>Compact: The array can be stored in one contiguous block, as part of
+ this object header message (this is called "compact" storage below).
+ </ol>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Data Layout Message (Versions 1 and 2)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Layout Class</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Address<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension 0 (4-bytes)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension 1 (4-bytes)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>...</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dataset Element Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Compact Data Size (4-bytes)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Compact Data...<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>The version number information is used for changes in the format of the data
+ layout message and is described here:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Used by version 1.4 and before of the library to encode layout information.
+ Data space is always allocated when the data set is created.</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Used by version 1.6.x of the library to encode layout information.
+ Data space is allocated only when it is necessary.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td><P>An array has a fixed dimensionality. This field
+ specifies the number of dimension size fields later in the
+ message.</P></td>
+ </tr>
+
+ <tr>
+ <td>Layout Class</td>
+ <td><P>The layout class specifies how the other fields of the
+ layout message are to be interpreted. A value of one
+ indicates contiguous storage, a value of two indicates chunked storage,
+ while a value of zero indicates compact storage. Other values will be defined
+ in the future.</P></td>
+ </tr>
+
+ <tr>
+ <td>Address</td>
+ <td><P>For contiguous storage, this is the address of the first
+ byte of storage. For chunked storage this is the address
+ of the B-tree that is used to look up the addresses of the
+ chunks. This field is not present for compact storage.
+ If the version for this message is set to 2, the address
+ may have the "undefined address" value, to indicate that
+ storage has not yet been allocated for this array.</P></td>
+ </tr>
+
+ <tr>
+ <td>Dimensions</td>
+ <td><P>For contiguous and compact storage the dimensions define
+ the entire size of the array while for chunked storage they define
+ the size of a single chunk. In all cases, they are in units of
+ array elements (not bytes). The first dimension stored in the list
+ of dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dataset Element Size</td>
+ <td><P>The size of a dataset element, in bytes. This field is only
+ present for chunked storage.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Compact Data Size</td>
+ <td><P>This field is only present for compact data storage.
+ It contains the size of the raw data for the dataset array.</P></td>
+
+ <tr>
+ <td>Compact Data</td>
+ <td><P>This field is only present for compact data storage.
+ It contains the raw data for the dataset array.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <P>Version 3 of this message re-structured the format into specific
+ properties that are required for each layout class.
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ <B>Data Layout Message (Version 3)</B>
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Layout Class</td>
+ <td colspan=2 bgcolor=#DDDDDD>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Properties<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>
+ <P>The version number information is used for changes in the format of layout message
+ and is described here:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>3</code></td>
+ <td>Used by the version 1.6.3 and later of the library to store properties
+ for each layout class.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Layout Class</td>
+ <td><P>The layout class specifies how the other fields of the layout message are to be
+ interpreted. A value of one indicates contiguous storage, a value of two
+ indicates chunked storage, while a value of zero indicates compact storage.</P></td>
+ </tr>
+
+ <tr>
+ <td>Properties</td>
+ <td><P>This variable-sized field encodes information specific to each
+ layout class and is described below. If there is no property
+ information specified for a layout class, the size of this field
+ is zero bytes.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <P>Class-specific information for compact layout (Class 0): (Note: The dimensionality information
+ is in the Dataspace message)
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Descriptions
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=2>Size</td>
+ <td colspan=2 bgcolor=#DDDDDD>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Raw Data...<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Size</td>
+ <td><P>This field contains the size of the raw data for the dataset array.</P></td>
+ </tr>
+
+ <tr>
+ <td>Raw Data</td>
+ <td><P>This field contains the raw data for the dataset array.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <P>Class-specific information for contiguous layout (Class 1): (Note: The dimensionality information
+ is in the Dataspace message)
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Descriptions
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Address<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Size<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Address</td>
+ <td><P>This is the address of the first byte of raw data storage.
+ The address may have the "undefined address" value, to indicate
+ that storage has not yet been allocated for this array.</P></td>
+ </tr>
+
+ <tr>
+ <td>Size</td>
+ <td><P>This field contains the size allocated to store the raw data.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <P>Class-specific information for chunked layout (Class 2):
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Property Descriptions
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan=3 bgcolor=#DDDDDD>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Address<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension 0 (4-bytes)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dimension 1 (4-bytes)</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>...</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Dataset Element Size</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td><P>A chunk has a fixed dimensionality. This field specifies
+ the number of dimension size fields later in the message.</P></td>
+ </tr>
+
+ <tr>
+ <td>Address</td>
+ <td><P>This is the address of the B-tree that is used to look up the addresses of the
+ chunks. The address may have the "undefined address" value, to indicate that
+ storage has not yet been allocated for this array.</P></td>
+ </tr>
+
+ <tr>
+ <td>Dimensions</td>
+ <td><P>These values define the dimension size of a single chunk, in
+ units of array elements (not bytes). The first dimension stored in
+ the list of dimensions is the slowest changing dimension and the
+ last dimension stored is the fastest changing dimension.
+ </P>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Dataset Element Size</td>
+ <td><P>The size of a dataset element, in bytes.
+ </P>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <hr>
+ <h4><a name="ReservedMessage_0009">Name: Reserved - Not Assigned Yet</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x0009</P>
+ <P class=item><B>Length:</B> N/A</P>
+ <P class=item><B>Status:</B> N/A</P>
+ <P class=item><B>Format of Data:</B> N/A</P>
+
+ <P class=item><B>Purpose and Description:</B> This message type was skipped during the initial
+ specification of the file format and may be used in a future expansion to the format.
+
+ <hr>
+ <h4><a name="ReservedMessage_000A">Name: Reserved - Not Assigned Yet</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x0009</P>
+ <P class=item><B>Length:</B> N/A</P>
+ <P class=item><B>Status:</B> N/A</P>
+ <P class=item><B>Format of Data:</B> N/A</P>
+
+ <P class=item><B>Purpose and Description:</B> This message type was skipped during the initial
+ specification of the file format and may be used in a future expansion to the format.
+
+ <hr>
+ <h4><a name="FilterMessage">Name: Data Storage - Filter Pipeline</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x000B</P>
+ <P class=item><B>Length:</B> varies</P>
+ <P class=item><B>Status:</B> Optional, may not be repeated.</P>
+
+ <P class=item><B>Description:</B> This message describes the
+ filter pipeline which should be applied to the data stream by
+ providing filter identification numbers, flags, a name, and
+ client data.</P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Filter Pipeline Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Number of Filters</td>
+ <td colspan=2>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Filter List<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td><P>The version number for this message. This document
+ describes version 1.</P></td>
+ </tr>
+
+ <tr>
+ <td>Number of Filters</td>
+ <td><P>The total number of filters described by this
+ message. The maximum possible number of filters in a
+ message is 32.</P></td>
+ </tr>
+
+ <tr>
+ <td>Filter List</td>
+ <td><P>A description of each filter. A filter description
+ appears in the next table.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Filter Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=2>Filter Identification</td>
+ <td colspan=2>Name Length</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Flags</td>
+ <td colspan=2>Number of Values for Client Data</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Client Data<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Padding</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Filter Identification</td>
+ <td>
+ <p>
+ This value, often referred to as a filter identifier,
+ is designed to be a unique identifier for the filter.
+ Values from zero through 32,767 are reserved for filters
+ supported by The HDF Group in the HDF5 library and for
+ filters requested and supported by third parties.
+ Filters supported by The HDF Group are documented immediately
+ below. Information on 3rd-party filters can be found at
+ <a href="/services/contributions.html#filters">
+ <code>https://support.hdfgroup.org/services/contributions.html#filters</code></a>.
+ <a href="#Footnote1Change"><sup><small>1</small></sup></a>
+ <p>
+ To request a filter identifier, please contact
+ The HDF Group&rsquo;s Help Desk at
+ <img src="Graphics/help.png" valign="center" height=14>.
+ You will be asked to provide the following information:
+ <ol>
+ <li>Contact information for the developer requesting the
+ new identifier
+ <li>A short description of the new filter
+ <li>Links to any relevant information, including licensing
+ information
+ </ol>
+ <p>
+ Values from 32768 to 65535 are reserved for non-distributed uses
+ (for example, internal company usage) or for application usage
+ when testing a feature. The HDF Group does not track or document
+ the use of the filters with identifiers from this range.
+
+ <p>
+ The filters currently in library version 1.6.5 are
+ listed below:
+ <table class=list>
+ <tr>
+ <th width="30%">Identification</th>
+ <th align=left>Name</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>deflate</td>
+ <td>GZIP deflate compression</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>shuffle</td>
+ <td>Data element shuffling</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>3</code></td>
+ <td>fletcher32</td>
+ <td>Fletcher32 checksum</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>4</code></td>
+ <td>szip</td>
+ <td>SZIP compression</td>
+ </tr>
+ </table>
+ </P></td>
+ </tr>
+
+ <tr>
+ <td>Name Length</td>
+ <td><P>Each filter has an optional null-terminated ASCII name
+ and this field holds the length of the name including the
+ null termination padded with nulls to be a multiple of
+ eight. If the filter has no name then a value of zero is
+ stored in this field.</P></td>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td><P>The flags indicate certain properties for a filter. The
+ bit values defined so far are:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>bit 1</code></td>
+ <td>If set then the filter is an optional filter.
+ During output, if an optional filter fails it will be
+ silently removed from the pipeline.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Client Data Number of Values</td>
+ <td><P>Each filter can store a few integer values to control
+ how the filter operates. The number of entries in the
+ Client Data array is stored in this field.</P></td>
+ </tr>
+
+ <tr>
+ <td>Name</td>
+ <td><P>If the Name Length field is non-zero then it will
+ contain the size of this field, a multiple of eight. This
+ field contains a null-terminated, ASCII character
+ string to serve as a comment/name for the filter.</P></td>
+ </tr>
+
+ <tr>
+ <td>Client Data</td>
+ <td><P>This is an array of four-byte integers which will be
+ passed to the filter function. The Client Data Number of
+ Values determines the number of elements in the array.</P></td>
+ </tr>
+
+ <tr>
+ <td>Padding</td>
+ <td><P>Four bytes of zeros are added to the message at this
+ point if the Client Data Number of Values field contains
+ an odd number.</P></td>
+ </tr>
+ </table>
+ </div>
+ <p>
+ <hr align="left" width="50">
+ <a name="Footnote1Change"><sup>1</sup></a>If you are reading
+ an earlier version of this document, this link may have changed.
+ If the link does not work, use the latest version of this document
+ on <a href="https://support.hdfgroup.org">The HDF Group</a>&rsquo;s website,
+ <a href="/HDF5/doc/H5.format.html">
+ <code>https://support.hdfgroup.org/HDF5/doc/H5.format.html</code></a>;
+ the link there will always be correct.
+ <small><a href="#FilterMessage">(Return)</a>
+ </P>
+
+ <hr>
+ <h4><a name="AttributeMessage">Name: Attribute</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x000C
+ <P class=item><B>Length:</B> varies
+ <P class=item><B>Status:</B> Optional, may be repeated.
+
+ <P class=item><B>Description:</B> The <em>Attribute</em>
+ message is used to list objects in the HDF file which are used
+ as attributes, or "metadata" about the current object. An
+ attribute is a small dataset; it has a name, a datatype, a data
+ space, and raw data. Since attributes are stored in the object
+ header they must be relatively small (<64KB) and can be
+ associated with any type of object which has an object header
+ (groups, datasets, named types and spaces, etc.).
+
+ <P class=item2>Note: Attributes on an object must have unique names. (The HDF5 library
+ currently enforces this by causing the creation of an attribute with
+ a duplicate name to fail). Attributes on different objects may have the
+ same name, however.
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Attribute Message (Version 1)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Reserved</td>
+ <td colspan=2>Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Datatype Size</td>
+ <td colspan=2>Dataspace Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Datatype<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Dataspace<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Data<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td><P>The version number information is used for changes in the format of the
+ attribute message and is described here:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Used by the library before version 1.6 to encode attribute message.
+ This version does not support shared data type.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td><P>This field is reserved for later use and is set to
+ zero.</P></td>
+ </tr>
+
+ <tr>
+ <td>Name Size</td>
+ <td><P>The length of the attribute name in bytes including the
+ null terminator. Note that the Name field below may
+ contain additional padding not represented by this
+ field.</P></td>
+ </tr>
+
+ <tr>
+ <td>Datatype Size</td>
+ <td><P>The length of the datatype description in the Datatype
+ field below. Note that the Datatype field may contain
+ additional padding not represented by this field.</P></td>
+ </tr>
+
+ <tr>
+ <td>Dataspace Size</td>
+ <td><P>The length of the dataspace description in the Dataspace
+ field below. Note that the Dataspace field may contain
+ additional padding not represented by this field.</P></td>
+ </tr>
+
+ <tr>
+ <td>Name</td>
+ <td><P>The null-terminated attribute name. This field is
+ padded with additional null characters to make it a
+ multiple of eight bytes.</P></td>
+ </tr>
+
+ <tr>
+ <td>Datatype</td>
+ <td><P>The datatype description follows the same format as
+ described for the datatype object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</P></td>
+ </tr>
+
+ <tr>
+ <td>Dataspace</td>
+ <td><P>The dataspace description follows the same format as
+ described for the dataspace object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</P></td>
+ </tr>
+
+ <tr>
+ <td>Data</td>
+ <td><P>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions. This
+ field is <em>not</em> padded with additional bytes.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Attribute Message (Version 2)
+ </caption>
+
+ <tr align=center>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flag</td>
+ <td colspan=2>Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Type Size</td>
+ <td colspan=2>Space Size</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Name<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Type<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Space<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Data<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td><P>The version number information is used for changes in the format of the
+ attribute message and is described here:</P>
+ <table class=list width="90%">
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Used by the library of version 1.6.x and after to encode attribute message.
+ This version supports shared data type. The fields of name, type, and space
+ are not padded with additional bytes of zero.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Flag</td>
+ <td><P>This field indicates whether the data type of this attribute is shared:</P>
+ <table class=list width="90%">
+ <tr>
+ <th width="30%">Value</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Datatype is <em>not</em> shared.</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Datatype is shared.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Name Size</td>
+ <td><P>The length of the attribute name in bytes including the
+ null terminator.</P></td>
+ </tr>
+
+ <tr>
+ <td>Datatype Size</td>
+ <td><P>The length of the datatype description in the Datatype
+ field below.</P></td>
+ </tr>
+
+ <tr>
+ <td>Dataspace Size</td>
+ <td><P>The length of the dataspace description in the Dataspace
+ field below.</P></td>
+ </tr>
+
+ <tr>
+ <td>Name</td>
+ <td><P>The null-terminated attribute name. This field is <em>not</em>
+ padded with additional bytes.</P></td>
+ </tr>
+
+ <tr>
+ <td>Datatype</td>
+ <td><P>The datatype description follows the same format as
+ described for the datatype object header message. This
+ field is <em>not</em> padded with additional bytes.</P></td>
+ </tr>
+
+ <tr>
+ <td>Dataspace</td>
+ <td><P>The dataspace description follows the same format as
+ described for the dataspace object header message. This
+ field is <em>not</em> padded with additional bytes.</P></td>
+ </tr>
+
+ <tr>
+ <td>Data</td>
+ <td><P>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions. This
+ field is <em>not</em> padded with additional zero
+ bytes.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <hr>
+ <h4><a name="CommentMessage">Name: Object Comment</a></h4>
+
+ <P class=item><B>Header Message Type:</B> 0x000D</P>
+ <P class=item><B>Length:</B> varies</P>
+ <P class=item><B>Status:</B> Optional, may not be repeated.</P>
+
+ <P class=item><B>Description:</B> The object comment is
+ designed to be a short description of an object. An object comment
+ is a sequence of non-zero (<code>\0</code>) ASCII characters with no other
+ formatting included by the library.</P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Name Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Comment<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Name</td>
+ <td>A null terminated ASCII character string.</td>
+ </tr>
+ </table>
+ </div>
+
+ <hr>
+ <h4><a name="OldModifiedMessage">Name: Object Modification Date &amp; Time (Old)</a></h4>
+
+ <P class=item><B>Header Message Type:</B> 0x000E</P>
+ <P class=item><B>Length:</B> fixed</P>
+ <P class=item><B>Status:</B> Optional, may not be repeated.</P>
+
+ <P class=item><B>Description:</B> The object modification date
+ and time is a timestamp which indicates (using ISO-8601 date and
+ time format) the last modification of an object. The time is
+ updated when any object header message changes according to the
+ system clock where the change was posted.
+
+ <br><br>This modification time message is deprecated in favor of the "new"
+ modification time message (Message Type 0x0012) and is no longer written
+ to the file in versions of the HDF5 library after the 1.6.0 version.
+ </P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Modification Time Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4>Year</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Month</td>
+ <td colspan=2>Day of Month</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Hour</td>
+ <td colspan=2>Minute</td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Second</td>
+ <td colspan=2>Reserved</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Year</td>
+ <td><P>The four-digit year as an ASCII string. For example,
+ <code>1998</code>. All fields of this message should be interpreted
+ as coordinated universal time (UTC)</P></td>
+ </tr>
+
+ <tr>
+ <td>Month</td>
+ <td><P>The month number as a two digit ASCII string where
+ January is <code>01</code> and December is <code>12</code>.</P></td>
+ </tr>
+
+ <tr>
+ <td>Day of Month</td>
+ <td><P>The day number within the month as a two digit ASCII
+ string. The first day of the month is <code>01</code>.</P></td>
+ </tr>
+
+ <tr>
+ <td>Hour</td>
+ <td><P>The hour of the day as a two digit ASCII string where
+ midnight is <code>00</code> and 11:00pm is <code>23</code>.</P></td>
+ </tr>
+
+ <tr>
+ <td>Minute</td>
+ <td><P>The minute of the hour as a two digit ASCII string where
+ the first minute of the hour is <code>00</code> and
+ the last is <code>59</code>.</P></td>
+ </tr>
+
+ <tr>
+ <td>Second</td>
+ <td><P>The second of the minute as a two digit ASCII string
+ where the first second of the minute is <code>00</code>
+ and the last is <code>59</code>.</P></td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td><P>This field is reserved and should always be zero.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <hr>
+ <h4><a name="SharedMessage">Name: Shared Object Message</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x000F</P>
+ <P class=item><B>Length:</B> Fixed</P>
+ <P class=item><B>Status:</B> Optional, may be repeated.</P>
+
+ <P class=item><B>Description:</B> A constant message can be shared among
+ several object headers. A <em>Shared Object</em> Message contains the address of
+ the object message to be shared. Care must be exercised to prevent cycles when a
+ message of one object header points to a message in some other object header.
+ Starting from Version 2 of the Shared Object Message, the <em>Flags</em>
+ field becomes unused.
+ </P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Shared Object Message (Version 1)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan=2>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Pointer<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td><P>The version number is used when there are changes in the format
+ of a shared object message and is described here:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Used by the library before version 1.6.1. In this version,
+ the Flags field is used to indicate whether the actual message is
+ stored in the global heap (never implemented). The Pointer field
+ either contains the the header message address in the global heap
+ (never implemented) or the address of the shared object header.</td>
+ </tr>
+ </table>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td><P>The Shared Message message points to a message which is
+ shared among multiple object headers. The Flags field
+ describes the type of sharing:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Bit</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>If this bit is clear then the actual message is the
+ first message in some other object header; otherwise
+ the actual message is stored in the global heap (never
+ implemented).</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>2-7</code></td>
+ <td>Reserved (always zero)</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Pointer</td>
+ <td><P>The address of the object header
+ containing the message to be shared.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Shared Object Message (Version 2)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ <th width="25%">byte</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan=2 bgcolor=#DDDDDD>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Pointer<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td><P>The version number is used when there are changes in the format
+ of a shared object message and is described here:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>2</code></td>
+ <td>Used by the library of version 1.6.1 and after. In this version,
+ The Flags field is not used and the Pointer field contains the address
+ of the object header containing the message to be shared. </td>
+ </tr>
+ </table>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td><P>Unused.</P></td>
+ </tr>
+
+ <tr>
+ <td>Pointer</td>
+ <td><P>The address of the object header
+ containing the message to be shared.</P></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <hr>
+ <h4><a name="ContinuationMessage">Name: Object Header Continuation</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x0010</P>
+ <P class=item><B>Length:</B> fixed</P>
+ <P class=item><B>Status:</B> Optional, may be repeated.</P>
+ <P class=item><B>Description:</B> The object header continuation is the location
+ in the file of more header messages for the current data object. This can be
+ used when header blocks become too large or are likely to change over time.</P>
+
+ <P class=item><B>Format of Data:</B>
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Object Header Continuation Message
+ </caption>
+
+ <tr>
+ <th width=25%>byte</th>
+ <th width=25%>byte</th>
+ <th width=25%>byte</th>
+ <th width=25%>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Offset<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Length<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width=30%>Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Offset</td>
+ <td><P>This value is the offset in bytes from the beginning of the file where the
+ header continuation information is located.</P></td>
+ </tr>
+
+ <tr>
+ <td>Length</td>
+ <td><P>This value is the length in bytes of the header continuation information in
+ the file.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <hr>
+ <h4><a name="SymbolTableMessage">Name: Group Message</a></h4>
+ <P class=item><B>Header Message Type:</B> 0x0011</P>
+ <P class=item><B>Length:</B> fixed</P>
+ <P class=item><B>Status:</B> Required for groups, may not be repeated.</P>
+ <P class=item><B>Description:</B> Each group has a B-tree and a
+ name heap which are pointed to by this message.</P>
+ <P class=item><B>Format of data:</B>
+
+ <br>
+ <div align=center>
+ <table class=format>
+ <caption>
+ <B>Group Message</B>
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>B-tree Address<br><br></td>
+ </tr>
+
+ <tr>
+ <td colspan=4><br>Heap Address<br><br></td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width=30%>Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>B-tree Address</td>
+ <td><P>This value is the offset in bytes from the beginning of the file
+ where the B-tree is located.</P></td>
+ </tr>
+
+ <tr>
+ <td>Heap Address</td>
+ <td><P>This value is the offset in bytes from the beginning of the file
+ where the group name heap is located.</P></td>
+ </tr>
+ </table>
+ </div>
+
+ <hr>
+ <h4><a name="ModifiedMessage">Name: Object Modification Date &amp; Time</a></h4>
+
+ <P class=item><B>Header Message Type:</B> 0x0012 </P>
+ <P class=item><B>Length:</B> Fixed </P>
+ <P class=item><B>Status:</B> Optional, may not be repeated. </P>
+
+ <P class=item><B>Description:</B> The object modification date
+ and time is a timestamp which indicates the last modification of an object.
+ The time is updated when any object header message changes according to the
+ system clock where the change was posted.
+ </P>
+
+ <P class=item><B>Format of Data:</B>
+ <div align=center>
+ <table class=format>
+ <caption>
+ Modification Time Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan=3>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan=4>Seconds After Epoch</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align=center>
+ <table class=desc>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td><P>The version number is used for changes in the format of Object Modification Time
+ and is described here:</P>
+ <table class=list>
+ <tr>
+ <th width="30%">Version</th>
+ <th align=left>Description</th>
+ </tr>
+
+ <tr>
+ <td align=center><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align=center><code>1</code></td>
+ <td>Used by Version 1.6.1 and after of the library to encode time. In
+ this version, the time is the seconds after Epoch.</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td><P>This field is reserved and should always be zero.</P></td>
+ </tr>
+
+ <tr>
+ <td>Seconds After Epoch</td>
+ <td><P>The number of seconds since 0 hours, 0 minutes, 0 seconds,
+ January 1, 1970, Coordinated Universal Time.</P></td>
+ </tr>
+ </table>
+ </div>
+
+<hr>
+<h3><a name="DataStorage">Disk Format: Level 2b - Data Object Data Storage</a></h3>
+<P>The data for an object is stored separately from the header
+information in the file and may not actually be located in the HDF5 file
+itself if the header indicates that the data is stored externally. The
+information for each record in the object is stored according to the
+dimensionality of the object (indicated in the dimensionality header message).
+Multi-dimensional data is stored in C order [same as current scheme], i.e. the
+"last" dimension changes fastest.
+<P>Data whose elements are composed of simple number-types are stored in
+native-endian IEEE format, unless they are specifically defined as being stored
+in a different machine format with the architecture-type information from the
+number-type header message. This means that each architecture will need to
+[potentially] byte-swap data values into the internal representation for that
+particular machine.
+<P> Data with a variable-length datatype is stored in the global heap
+of the HDF5 file. Global heap identifiers are stored in the
+data object storage.
+<P>Data whose elements are composed of pointer number-types are stored in several
+different ways depending on the particular pointer type involved. Simple
+pointers are just stored as the dataset offset of the object being pointed to with the
+size of the pointer being the same number of bytes as offsets in the file.
+Dataset region references are stored as a heap-ID which points to the following
+information within the file-heap: an offset of the object pointed to, number-type
+information (same format as header message), dimensionality information (same
+format as header message), sub-set start and end information (i.e. a coordinate
+location for each), and field start and end names (i.e. a [pointer to the]
+string indicating the first field included and a [pointer to the] string name
+for the last field).
+
+<P>Data of a compound datatype is stored as a contiguous stream of the items
+in the structure, with each item formatted according to its datatype.</p>
+
+<hr>
+<h3><a name="Appendix">Appendix</a></h3>
+<P>Definitions of various terms used in this document.
+</P>
+<P>The <A name="UndefinedAddress">"undefined address"</A> for a file is a
+file address with all bits set, i.e. <code>0xffff...ff</code>.
+<P>The <A name="UnlimitedDim">"unlimited size"</A> for a size is a
+value with all bits set, i.e. <code>0xffff...ff</code>.
+
+</body>
+</html>
diff --git a/doxygen/examples/H5.format.2.0.html b/doxygen/examples/H5.format.2.0.html
new file mode 100644
index 0000000..3653489
--- /dev/null
+++ b/doxygen/examples/H5.format.2.0.html
@@ -0,0 +1,14902 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>
+ HDF5 File Format Specification Version 2.0
+ </title>
+
+<style>
+h1 { display: block;
+ margin-top: 24px;
+ margin-bottom: 24px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ }
+
+h2 { display: block;
+ margin-top: 8x;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ }
+<!-- A horizontal rule (<hr />) should be placed on the line above
+each h2 tag. The h2 tags are used on the main sections along with
+the hr tags. -->
+
+h3 { display: block;
+ margin-top: 8px;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ }
+
+h4 { display: block;
+ margin-top: 8px;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ }
+
+p { display: block;
+ margin-top: 8px;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ }
+<!--
+p.item { margin-left: 2em;
+ text-indent: -2em
+ } -->
+<!-- p.item2 { margin-left: 2em; text-indent: 2em} -->
+
+table.format { border:solid;
+ border-collapse:collapse;
+ caption-side:top;
+ text-align:center;
+ width:80%;
+ }
+table.format th { border:ridge;
+ padding:4px;
+ width:25%;
+ }
+table.format td { border:ridge;
+ padding:4px;
+ }
+table.format caption { font-weight:bold;
+ font-size:larger;
+ }
+
+table.note {border:none;
+ text-align:right;
+ width:80%;
+ }
+
+table.desc { border:solid;
+ border-collapse:collapse;
+ caption-size:top;
+ text-align:left;
+ width:80%;
+ }
+table.desc tr { vertical-align:top;
+ }
+table.desc th { border-style:ridge;
+ font-size:larger;
+ padding:4px;
+ <!-- text-decoration:underline; -->
+ }
+table.desc td { border-style:ridge;
+ <!-- padding: 4px; -->
+ vertical-align:text-top;
+ }
+table.desc caption { font-weight:bold;
+ font-size:larger;
+ }
+
+table.list { border:none;
+ width:100%
+ }
+table.list tr { vertical-align:text-top;
+ }
+table.list th { border:none;
+ text-decoration:underline;
+ vertical-align:text-top;
+ }
+table.list td { border:none;
+ vertical-align:text-top;
+ }
+
+table.msgdesc { border:none;
+ text-align:left;
+ width: 80%
+ }
+table.msgdesc tr { vertical-align:text-top;
+ border-spacing:0;
+ padding:0; }
+table.msgdesc th { border:none;
+ text-decoration:underline;
+ vertical-align:text-top; }
+table.msgdesc td { border:none;
+ vertical-align:text-top;
+ }
+
+table.list80 { border:none;
+ width:80%
+ }
+table.list80 tr { vertical-align:text-top;
+ }
+table.list80 th { border:none;
+ text-decoration:underline;
+ vertical-align:text-top;
+ }
+table.list80 td { border:none;
+ vertical-align:text-top;
+ }
+
+table.glossary { border:none;
+ text-align:left;
+ width: 80%
+ }
+table.glossary tr { vertical-align:text-top;
+ border-spacing:0;
+ padding:0; }
+table.glossary th { border:none;
+ text-align:left;
+ text-decoration:underline;
+ vertical-align:text-top; }
+table.glossary td { border:none;
+ text-align:left;
+ vertical-align:text-top;
+ }
+
+div { page-break-inside:avoid;
+ page-break-after:auto
+ }
+
+</style>
+
+ <center>
+ <table border="0" width="90%">
+ <tr>
+ <td valign="top">
+ <ol type="I">
+ <li><a href="#Intro">Introduction</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#ThisDocument">This Document</a></li>
+ <li><a href="#ChangesForHdf5_1_10">Changes for HDF5 1.10</a></li>
+ </ol>
+ </font>
+
+ <li><a href="#FileMetaData">Disk Format: Level 0 - File Metadata</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#Superblock">Disk Format: Level 0A - Format Signature and Superblock</a></li>
+ <li><a href="#DriverInfo">Disk Format: Level 0B - File Driver Info</a></li>
+ <li><a href="#SuperblockExt">Disk Format: Level 0C - Superblock Extension</a></li>
+ </ol>
+ </font>
+ <li><a href="#FileInfra">Disk Format: Level 1 - File Infrastructure</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#Btrees">Disk Format: Level 1A - B-trees and B-tree
+ Nodes</a></li>
+ <ol type="1">
+ <li><a href="#V1Btrees">Disk Format: Level 1A1 - Version 1
+ B-trees (B-link Trees)</a></li>
+ <li><a href="#V2Btrees">Disk Format: Level 1A2 - Version 2
+ B-trees</a></li>
+ </ol>
+ <li><a href="#SymbolTable">Disk Format: Level 1B - Group Symbol Table Nodes</a></li>
+ <li><a href="#SymbolTableEntry">Disk Format: Level 1C - Symbol Table Entry</a></li>
+ <li><a href="#LocalHeap">Disk Format: Level 1D - Local Heaps</a></li>
+ <li><a href="#GlobalHeap">Disk Format: Level 1E - Global Heap</a></li>
+ <li><a href="#FractalHeap">Disk Format: Level 1F - Fractal Heap</a></li>
+ <li><a href="#FreeSpaceManager">Disk Format: Level 1G - Free-space Manager</a></li>
+ <li><a href="#SOHMTable">Disk Format: Level 1H - Shared Object Header Message Table</a></li>
+ </ol>
+ </font>
+ <li><a href="#DataObject">Disk Format: Level 2 - Data Objects</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#ObjectHeader">Disk Format: Level 2A - Data Object Headers</a></li>
+ <ol type="1">
+ <li><a href="#ObjectHeaderPrefix">Disk Format: Level 2A1 - Data Object Header Prefix</a></li>
+ <ol type="a">
+ <li><a href="#V1ObjectHeaderPrefix">Version 1 Data Object Header Prefix</a></li>
+ <li><a href="#V2ObjectHeaderPrefix">Version 2 Data Object Header Prefix</a></li>
+ </ol>
+ <li><a href="#ObjectHeaderMessages">Disk Format: Level 2A2 - Data Object Header Messages</a></li>
+ <ol type="a">
+ <li><a href="#NILMessage">The NIL Message</a></li> <!-- 0x0000 -->
+ <li><a href="#DataspaceMessage">The Dataspace Message</a></li> <!-- 0x0001 -->
+ <li><a href="#LinkInfoMessage">The Link Info Message</a></li> <!-- 0x0002 -->
+ </ol>
+ </ol>
+ </ol>
+ </font>
+ </ol>
+ </td>
+
+ <td>&nbsp;</td>
+
+ <td valign="top">
+ <ol type="I" start="4">
+ <li><a href="#DataObject">Disk Format: Level 2 - Data
+ Objects</a><font size="-1"><i> (Continued)</i></li>
+ <ol type="A">
+ <li><a href="#ObjectHeader">Disk Format: Level 2A - Data Object
+ Headers</a><i> (Continued)</i></li>
+ <ol type="1" start="2">
+ <li><a href="#ObjectHeaderMessages">Disk Format: Level 2A2 -
+ Data Object Header Messages</a><i> (Continued)</i></li>
+ <ol type="a" start="4">
+ <li><a href="#DatatypeMessage">The Datatype Message</a></li> <!-- 0x0003 -->
+ <li><a href="#OldFillValueMessage">The Data Storage -
+ Fill Value (Old) Message</a></li> <!-- 0x0004 -->
+ <li><a href="#FillValueMessage">The Data Storage -
+ Fill Value Message</a></li> <!-- 0x0005 -->
+ <li><a href="#LinkMessage">The Link Message</a></li> <!-- 0x0006 -->
+ <li><a href="#ExternalFileListMessage">The Data Storage -
+ External Data Files Message</a></li> <!-- 0x0007 -->
+ <li><a href="#LayoutMessage">The Data Storage -
+ Layout Message</a></li> <!-- 0x0008 -->
+ <li><a href="#BogusMessage">The Bogus Message</a></li> <!-- 0x0009 -->
+ <li><a href="#GroupInfoMessage">The Group Info
+ Message</a></li> <!-- 0x000a -->
+ <li><a href="#FilterMessage">The Data Storage -
+ Filter Pipeline Message</a></li> <!-- 0x000b -->
+ <li><a href="#AttributeMessage">The Attribute
+ Message</a></li> <!-- 0x000c -->
+ <li><a href="#CommentMessage">The Object Comment
+ Message</a></li> <!-- 0x000d -->
+ <li><a href="#OldModificationTimeMessage">The Object
+ Modification Time (Old) Message</a></li> <!-- 0x000e -->
+ <li><a href="#SOHMTableMessage">The Shared Message
+ Table Message</a></li> <!-- 0x000f -->
+ <li><a href="#ContinuationMessage">The Object Header
+ Continuation Message</a></li> <!-- 0x0010 -->
+ <li><a href="#SymbolTableMessage">The Symbol
+ Table Message</a></li> <!-- 0x0011 -->
+ <li><a href="#ModificationTimeMessage">The Object
+ Modification Time Message</a></li> <!-- 0x0012 -->
+ <li><a href="#BtreeKValuesMessage">The B-tree
+ &lsquo;K&rsquo; Values Message</a></li> <!-- 0x0013 -->
+ <li><a href="#DrvInfoMessage">The Driver Info
+ Message</a></li> <!-- 0x0014 -->
+ <li><a href="#AinfoMessage">The Attribute Info
+ Message</a></li> <!-- 0x0015 -->
+ <li><a href="#RefCountMessage">The Object Reference
+ Count Message</a></li> <!-- 0x0016 -->
+ <li><a href="#FsinfoMessage">The File Space Info
+ Message</a></li> <!-- 0x0018 -->
+ </ol>
+ </ol>
+ <li><a href="#DataStorage">Disk Format: Level 2B - Data Object Data Storage</a></li>
+ </ol>
+ </font>
+ <li><a href="#AppendixA">Appendix A: Definitions</a></li>
+ <li><a href="#AppendixB">Appendix B: File Memory Allocation Types</a></li>
+ </ol>
+</td></tr>
+</table>
+</center>
+
+
+
+<br />
+<br />
+<hr />
+<a name="Intro"><h2>I. Introduction</h2></a>
+
+ <table align="right" width="100">
+ <tr><td>&nbsp;</td><td align="center">
+ <hr />
+ <img src="FF-IH_FileGroup.gif" alt="HDF5 Groups" hspace="15" vspace="15">
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align="center">
+ <strong>Figure 1:</strong> Relationships among the HDF5 root group, other groups, and objects
+ <hr />
+ </td><td>&nbsp;</td></tr>
+
+ <tr><td>&nbsp;</td><td align="center">
+ <img src="FF-IH_FileObject.gif" alt="HDF5 Objects" hspace="15" vspace="15">
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align="center">
+ <strong>Figure 2:</strong> HDF5 objects -- datasets, datatypes, or dataspaces
+ <hr />
+ </td><td>&nbsp;</td></tr>
+ </table>
+
+
+ <p>The format of an HDF5 file on disk encompasses several
+ key ideas of the HDF4 and AIO file formats as well as
+ addressing some shortcomings therein. The new format is
+ more self-describing than the HDF4 format and is more
+ uniformly applied to data objects in the file.</p>
+
+ <p>An HDF5 file appears to the user as a directed graph.
+ The nodes of this graph are the higher-level HDF5 objects
+ that are exposed by the HDF5 APIs:</p>
+
+ <ul>
+ <li>Groups</li>
+ <li>Datasets</li>
+ <li>Committed (formerly Named) datatypes</li>
+ </ul>
+
+ <p>At the lowest level, as information is actually written to the disk,
+ an HDF5 file is made up of the following objects:</p>
+ <ul>
+ <li>A superblock</li>
+ <li>B-tree nodes</li>
+ <li>Heap blocks</li>
+ <li>Object headers</li>
+ <li>Object data</li>
+ <li>Free space</li>
+ </ul>
+
+ <p>The HDF5 Library uses these low-level objects to represent the
+ higher-level objects that are then presented to the user or
+ to applications through the APIs. For instance, a group is an
+ object header that contains a message that points to a local
+ heap (for storing the links to objects in the group) and to a
+ B-tree (which indexes the links). A dataset is an object header
+ that contains messages that describe datatype, dataspace, layout,
+ filters, external files, fill value, and other elements with the
+ layout message pointing to either a raw data chunk or to a
+ B-tree that points to raw data chunks.</p>
+
+
+<br />
+<a name="ThisDocument"><h3>I.A. This Document</h3></a>
+
+ <p>This document describes the lower-level data objects;
+ the higher-level objects and their properties are described
+ in the <a href="UG/HDF5_Users_Guide-Responsive HTML5/index.html"><cite>HDF5 User&rsquo;s Guide</cite></a>.</p>
+
+ <p>Three levels of information comprise the file format.
+ Level 0 contains basic information for identifying and
+ defining information about the file. Level 1 information contains
+ the information about the pieces of a file shared by many objects
+ in the file (such as a B-trees and heaps). Level 2 is the rest
+ of the file and contains all of the data objects, with each object
+ partitioned into header information, also known as
+ <em>metadata</em>, and data.</p>
+
+ <p>The sizes of various fields in the following layout tables are
+ determined by looking at the number of columns the field spans
+ in the table. There are three exceptions: (1) The size may be
+ overridden by specifying a size in parentheses, (2) the size of
+ addresses is determined by the <em>Size of Offsets</em> field
+ in the superblock and is indicated in this document with a
+ superscripted &lsquo;O&rsquo;, and (3) the size of length fields is determined
+ by the <em>Size of Lengths</em> field in the superblock and is
+ indicated in this document with a superscripted &lsquo;L&rsquo;.</p>
+
+ <p>Values for all fields in this document should be treated as unsigned
+ integers, unless otherwise noted in the description of a field.
+ Additionally, all metadata fields are stored in little-endian byte
+ order.
+ </p>
+
+ <p>All checksums used in the format are computed with the
+ <a href="http://www.burtleburtle.net/bob/hash/doobs.html">Jenkins&rsquo;
+ lookup3</a> algorithm.
+ </p>
+
+ <p>Whenever a bit flag or field is mentioned for an entry, bits are
+ numbered from the lowest bit position in the entry.
+ </p>
+
+ <p>Various tables in this document aligned with &ldquo;This space inserted
+ only to align table nicely&rdquo;. These entries in the table are just
+ to make the table presentation nicer and do not represent any values
+ or padding in the file.
+ </p>
+
+
+<br />
+<a name="ChangesForHdf5_1_10"><h3>I.B. Changes for HDF5 1.10</h3></a>
+
+ <p>As of October 2015, changes in the file format for HDF5 1.10
+ have not yet been finalized.</p>
+
+
+
+<br />
+<br />
+<hr />
+<h2><a name="FileMetaData">
+II. Disk Format: Level 0 - File Metadata</a></h2>
+
+<br />
+<h3><a name="Superblock">
+II.A. Disk Format: Level 0A - Format Signature and Superblock</a></h3>
+
+ <p>The superblock may begin at certain predefined offsets within
+ the HDF5 file, allowing a block of unspecified content for
+ users to place additional information at the beginning (and
+ end) of the HDF5 file without limiting the HDF5 Library&rsquo;s
+ ability to manage the objects within the file itself. This
+ feature was designed to accommodate wrapping an HDF5 file in
+ another file format or adding descriptive information to an HDF5
+ file without requiring the modification of the actual file&rsquo;s
+ information. The superblock is located by searching for the
+ HDF5 format signature at byte offset 0, byte offset 512, and at
+ successive locations in the file, each a multiple of two of
+ the previous location; in other words, at these byte offsets:
+ 0, 512, 1024, 2048, and so on.</p>
+
+ <p>The superblock is composed of the format signature, followed by a
+ superblock version number and information that is specific to each
+ version of the superblock.
+ Currently, there are three versions of the superblock format.
+ Version 0 is the default format, while version 1 is basically the same
+ as version 0 with additional information when a non-default B-tree &lsquo;K&rsquo;
+ value is stored. Version 2 is the latest format, with some fields
+ eliminated or compressed and with superblock extension and checksum
+ support.</p>
+
+ <p>Version 0 and 1 of the superblock are described below:</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Superblock (Versions 0 and 1)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Format Signature (8 bytes)<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td>Version # of Superblock</td>
+ <td>Version # of File&rsquo;s Free Space Storage</td>
+ <td>Version # of Root Group Symbol Table Entry</td>
+ <td>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td>Version # of Shared Header Message Format</td>
+ <td>Size of Offsets</td>
+ <td>Size of Lengths</td>
+ <td>Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Group Leaf Node K</td>
+ <td colspan="2">Group Internal Node K</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">File Consistency Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2" style="border:dotted;">Indexed Storage Internal Node K<sup>1</sup></td>
+ <td colspan="2" style="border:dotted;">Reserved (zero)<sup>1</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of File Free space Info<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of File Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Driver Information Block Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Root Group Symbol Table Entry</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in &ldquo;Size of Offsets.&rdquo;)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with a &lsquo;1&rsquo; in the above table are
+ new in version 1 of the superblock)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Format Signature</p></td>
+ <td><p>This field contains a constant value and can be used to
+ quickly identify a file as being an HDF5 file. The
+ constant value is designed to allow easy identification of
+ an HDF5 file and to allow certain types of data corruption
+ to be detected. The file signature of an HDF5 file always
+ contains the following values:</p>
+ <center>
+ <table border align="center" cellpadding="4">
+ <tr align="center">
+ <td align="right">Decimal:</td>
+ <td width="8%">137</td>
+ <td width="8%">72</td>
+ <td width="8%">68</td>
+ <td width="8%">70</td>
+ <td width="8%">13</td>
+ <td width="8%">10</td>
+ <td width="8%">26</td>
+ <td width="8%">10</td>
+ </tr>
+
+ <tr align="center">
+ <td align="right">Hexadecimal:</td>
+ <td>89</td>
+ <td>48</td>
+ <td>44</td>
+ <td>46</td>
+ <td>0d</td>
+ <td>0a</td>
+ <td>1a</td>
+ <td>0a</td>
+ </tr>
+
+ <tr align="center">
+ <td align="right">ASCII C Notation:</td>
+ <td>\211</td>
+ <td>H</td>
+ <td>D</td>
+ <td>F</td>
+ <td>\r</td>
+ <td>\n</td>
+ <td>\032</td>
+ <td>\n</td>
+ </tr>
+ </table>
+ </center>
+ <p>This signature both identifies the file as an HDF5 file
+ and provides for immediate detection of common
+ file-transfer problems. The first two bytes distinguish
+ HDF5 files on systems that expect the first two bytes to
+ identify the file type uniquely. The first byte is
+ chosen as a non-ASCII value to reduce the probability
+ that a text file may be misrecognized as an HDF5 file;
+ also, it catches bad file transfers that clear bit
+ 7. Bytes two through four name the format. The CR-LF
+ sequence catches bad file transfers that alter newline
+ sequences. The control-Z character stops file display
+ under MS-DOS. The final line feed checks for the inverse
+ of the CR-LF translation problem. (This is a direct
+ descendent of the
+ <a href="http://www.libpng.org/pub/png/spec/iso/index-object.html#5PNG-file-signature">PNG</a> file
+ signature.)</p>
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Superblock</p></td>
+ <td><p>This value is used to determine the format of the
+ information in the superblock. When the format of the
+ information in the superblock is changed, the version number
+ is incremented to the next integer and can be used to
+ determine how the information in the superblock is
+ formatted.</p>
+
+ <p>Values of 0, 1 and 2 are defined for this field. (The format
+ of version 2 is described below, not here)
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the File&rsquo;s Free Space
+ Information</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ file&rsquo;s free space information.
+ </p>
+ <p>The only value currently valid in this field is &lsquo;0&rsquo;, which
+ indicates that the file&rsquo;s free space is as described
+ <a href="#FreeSpaceManager">below</a>.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Root Group Symbol Table
+ Entry</p></td>
+ <td><p>This value is used to determine the format of the
+ information in the Root Group Symbol Table Entry. When the
+ format of the information in that field is changed, the
+ version number is incremented to the next integer and can be
+ used to determine how the information in the field
+ is formatted.</p>
+ <p>The only value currently valid in this field is &lsquo;0&rsquo;,
+ which indicates that the root group symbol table entry is
+ formatted as described <a href="#SymbolTableEntry">below</a>.</p>
+ <p><em>This field is present in version 0 and 1 of the
+ superblock.</em></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Shared Header Message Format</p></td>
+ <td><p>This value is used to determine the format of the
+ information in a shared object header message. Since the format
+ of the shared header messages differs from the other private
+ header messages, a version number is used to identify changes
+ in the format.
+ </p>
+ <p>The only value currently valid in this field is &lsquo;0&rsquo;, which
+ indicates that shared header messages are formatted as
+ described <a href="#ObjectHeaderMessages">below</a>.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Offsets</p></td>
+ <td><p>This value contains the number of bytes used to store
+ addresses in the file. The values for the addresses of
+ objects in the file are offsets relative to a base address,
+ usually the address of the superblock signature. This
+ allows a wrapper to be added after the file is created
+ without invalidating the internal offset locations.
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Lengths</p></td>
+ <td><p>This value contains the number of bytes used to store
+ the size of an object.
+ </p>
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Leaf Node K</p></td>
+ <td>
+ <p>Each leaf node of a group B-tree will have at
+ least this many entries but not more than twice this
+ many. If a group has a single leaf node then it
+ may have fewer entries.
+ </p>
+ <p>This value must be greater than zero.
+ </p>
+ <p>See the <a href="#Btrees">description</a> of B-trees below.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Internal Node K</p></td>
+ <td>
+ <p>Each internal node of a group B-tree will have at
+ least this many entries but not more than twice this
+ many. If the group has only one internal
+ node then it might have fewer entries.
+ </p>
+ <p>This value must be greater than zero.
+ </p>
+ <p>See the <a href="#Btrees">description</a> of B-trees below.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>File Consistency Flags</p></td>
+ <td>
+ <p>This value contains flags to indicate information
+ about the consistency of the information contained
+ within the file. Currently, the following bit flags are
+ defined:
+ <ul>
+ <li>Bit 0 set indicates that the file is opened for
+ write-access.</li>
+ <li>Bit 1 set indicates that the file has
+ been verified for consistency and is guaranteed to be
+ consistent with the format defined in this document.</li>
+ <li>Bits 2-31 are reserved for future use.</li>
+ </ul>
+ Bit 0 should be
+ set as the first action when a file is opened for write
+ access and should be cleared only as the final action
+ when closing a file. Bit 1 should be cleared during
+ normal access to a file and only set after the file&rsquo;s
+ consistency is guaranteed by the library or a
+ consistency utility.
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Indexed Storage Internal Node K</p></td>
+ <td>
+ <p>Each internal node of an indexed storage B-tree will have at
+ least this many entries but not more than twice this
+ many. If the index storage B-tree has only one internal
+ node then it might have fewer entries.
+ </p>
+ <p>This value must be greater than zero.
+ </p>
+ <p>See the <a href="#Btrees">description</a> of B-trees below.
+ </p>
+
+ <p><em>This field is present in version 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Base Address</p></td>
+ <td>
+ <p>This is the absolute file address of the first byte of
+ the HDF5 data within the file. The library currently
+ constrains this value to be the absolute file address
+ of the superblock itself when creating new files;
+ future versions of the library may provide greater
+ flexibility. When opening an existing file and this address does
+ not match the offset of the superblock, the library assumes
+ that the entire contents of the HDF5 file have been adjusted in
+ the file and adjusts the base address and end of file address to
+ reflect their new positions in the file. Unless otherwise noted,
+ all other file addresses are relative to this base
+ address.
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Global Free-space Index</p></td>
+ <td>
+ <p>The file&rsquo;s free space is not persistent for version 0 and 1 of
+ the superblock.
+ Currently this field always contains the
+ <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>End of File Address</p></td>
+ <td>
+ <p>This is the absolute file address of the first byte past
+ the end of all HDF5 data. It is used to determine whether a
+ file has been accidently truncated and as an address where
+ file data allocation can occur if space from the free list is
+ not used.
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information Block Address</p></td>
+ <td>
+ <p>This is the relative file address of the file driver
+ information block which contains driver-specific
+ information needed to reopen the file. If there is no
+ driver information block then this entry should be the
+ <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Root Group Symbol Table Entry</p></td>
+ <td>
+ <p>This is the <a href="#SymbolTableEntry">symbol table entry</a>
+ of the root group, which serves as the entry point into
+ the group graph for the file.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <p>Version 2 of the superblock is described below:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Superblock (Version 2)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Format Signature (8 bytes)<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td>Version # of Superblock</td>
+ <td>Size of Offsets</td>
+ <td>Size of Lengths</td>
+ <td>File Consistency Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Superblock Extension Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of File Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Root Group Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Superblock Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in &ldquo;Size of Offsets.&rdquo;)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Format Signature</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 of the
+ superblock.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Superblock</p></td>
+ <td>
+ <p>This field has a value of 2 and has the same meaning as for
+ versions 0 and 1.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Offsets</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 of the
+ superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Lengths</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 of the
+ superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>File Consistency Flags</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 except
+ that it is smaller (the number of reserved bits has been reduced
+ from 30 to 6).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Base Address</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 of the
+ superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Superblock Extension Address</p></td>
+ <td>
+ <p>The field is the address of the object header for the
+ <a href="#SuperblockExt">superblock extension</a>.
+ If there is no extension then this entry should be the
+ <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>End of File Address</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 of the
+ superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Root Group Object Header Address</p></td>
+ <td>
+ <p>This is the address of
+ the <a href="#DataObject">root group object header</a>,
+ which serves as the entry point into the group graph for the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Superblock Checksum</p></td>
+ <td>
+ <p>The checksum for the superblock.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+<br />
+<h3><a name="DriverInfo">
+II.B. Disk Format: Level 0B - File Driver Info</a></h3>
+
+ <p>The <b>driver information block</b> is an optional region of the
+ file which contains information needed by the file driver
+ to reopen a file. The format is described below:</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Driver Information Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Driver Information Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Driver Identification (8 bytes)<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Driver Information (<em>variable size</em>)<br /><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number of the Driver Information Block.
+ This document describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information Size</p></td>
+ <td>
+ <p>The size in bytes of the <em>Driver Information</em> field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Identification</p></td>
+ <td>
+ <p>This is an eight-byte ASCII string without null
+ termination which identifies the driver and/or version number
+ of the Driver Information Block. The predefined driver encoded
+ in this field by the HDF5 Library is identified by the
+ letters <code>NCSA</code> followed by the first four characters of
+ the driver name. If the Driver Information block is not
+ the original version then the last letter(s) of the
+ identification will be replaced by a version number in
+ ASCII, starting with 0.
+ </p>
+ <p>
+ Identification for user-defined drivers is also eight-byte long.
+ It can be arbitrary but should be unique to avoid
+ the four character prefix &ldquo;NCSA&rdquo;.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Driver Information</p></td>
+ <td>Driver information is stored in a format defined by the
+ file driver (see description below).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ The two drivers encoded in the <em>Driver Identification</em> field are as follows:
+ <ul>
+ <li>
+ Multi driver:
+ <p>
+ The identifier for this driver is &ldquo;NCSAmulti&rdquo;.
+ This driver provides a mechanism for segregating raw data and different types of metadata
+ into multiple files.
+ These files are viewed by the library as a single virtual HDF5 file with a single file address.
+ A maximum of 6 files will be created for the following data:
+ superblock, B-tree, raw data, global heap, local heap, and object header.
+ More than one type of data can be written to the same file.
+ </p></li>
+ <li>
+ Family driver
+ <p>
+ The identifier for this driver is &ldquo;NCSAfami&rdquo; and is encoded in this field for library version 1.8 and after.
+ This driver is designed for systems that do not support files larger than 2 gigabytes
+ by splitting the HDF5 file address space across several smaller files.
+ It does nothing to segregate metadata and raw data;
+ they are mixed in the address space just as they would be in a single contiguous file.
+ </p></li>
+ </ul>
+ <p>The format of the <em>Driver Information</em> field for the
+ above two drivers are described below:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Multi Driver Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ </tr>
+
+ <tr>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Reserved</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Member File 1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of Address for Member File 1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Member File 2<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of Address for Member File 2<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />... ...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Member File N<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of Address for Member File N<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name of Member File 1 <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name of Member File 2 <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />... ...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name of Member File N <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Member Mapping</p></td>
+ <td><p>These fields are integer values from 1 to 6
+ indicating how the data can be mapped to or merged with another type of
+ data.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Member Mapping</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>The superblock data.</td>
+ </tr>
+ <tr>
+ <td align="center">2</td>
+ <td>The B-tree data.</td>
+ </tr>
+ <tr>
+ <td align="center">3</td>
+ <td>The raw data.</td>
+ </tr>
+ <tr>
+ <td align="center">4</td>
+ <td>The global heap data.</td>
+ </tr>
+ <tr>
+ <td align="center">5</td>
+ <td>The local heap data.</td>
+ </tr>
+ <tr>
+ <td align="center">6</td>
+ <td>The object header data.</td>
+ </tr>
+ </table></p>
+ <p>For example, if the third field has the value 3 and all the rest have the
+ value 1, it means there are two files: one for raw data, and one for superblock,
+ B-tree, global heap, local heap, and object header.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td><p>These fields are reserved and should always be zero.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Member File N</p></td>
+ <td><p>This field Specifies the virtual address at which the member file starts.</p>
+ <p>N is the number of member files.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>End of Address for Member File N</p></td>
+ <td><p>This field is the end of the allocated address for the member file.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name of Member File N</p></td>
+ <td><p>This field is the null-terminated name of the member file and
+ its length should be multiples of 8 bytes.
+ Additional bytes will be padded with <em>NULL</em>s. The default naming
+ convention is <em>%s-X.h5</em>, where <em>X</em> is one of the letters
+ <em>s</em> (for superblock), <em>b</em> (for B-tree), <em>r</em> (for raw data),
+ <em>g</em> (for global heap), <em>l</em> (for local heap), and <em>o</em> (for
+ object header). The name of the whole HDF5 file will substitute the <em>%s</em>
+ in the string.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Family Driver Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="8"><br />Size of Member File<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Size of Member File</p></td>
+ <td><p>This field is the size of the member file in the family of files.</p></td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h3><a name="SuperblockExt">
+II.C. Disk Format: Level 0C - Superblock Extension</a></h3>
+
+ <p>The <em>superblock extension</em> is used to store superblock metadata
+ which is either optional, or added after the version of the superblock
+ was defined. Superblock extensions may only exist when version 2+ of
+ superblock is used. A superblock extension is an object header which may
+ hold the following messages:</p>
+ <ul>
+ <li>
+ <a href="#SOHMTableMessage">Shared Message Table message</a> containing
+ information to locate the master table of shared object header message
+ indices.</li>
+ <li>
+ <a href="#BtreeKValuesMessage">B-tree &lsquo;K&rsquo; Values message</a> containing
+ non-default B-tree &lsquo;K&rsquo; values.</li>
+ <li>
+ <a href="#DrvInfoMessage">Driver Info message</a> containing information
+ needed by the file driver in order to reopen a file.
+ See also the
+ <a href="#DriverInfo">&ldquo;Disk Format: Level 0B - File Driver
+ Info&rdquo;</a> section above.</li>
+ <li>
+ <a href="#FsinfoMessage">File Space Info message</a> containing
+ information about file space handling in the file.</li>
+ </ul>
+
+
+
+<br />
+<br />
+<hr />
+<h2><a name="FileInfra">
+III. Disk Format: Level 1 - File Infrastructure</a></h2>
+
+<br />
+<h3><a name="Btrees">
+III.A. Disk Format: Level 1A - B-trees and B-tree Nodes</a></h3>
+
+ <p>B-trees allow flexible storage for objects which tend to grow
+ in ways that cause the object to be stored discontiguously. B-trees
+ are described in various algorithms books including &ldquo;Introduction to
+ Algorithms&rdquo; by Thomas H. Cormen, Charles E. Leiserson, and Ronald
+ L. Rivest. B-trees are used in several places in the HDF5 file format,
+ when an index is needed for another data structure.</p>
+
+ <p>The version 1 B-tree structure described below is the original index
+ structure, but are limited by some bugs in our implementation (mainly in
+ how they handle deleting records). The version 1 B-trees are being phased
+ out in favor of the version 2 B-trees described below, although both
+ types of structures may be found in the same file, depending on
+ application settings when creating the file.</p>
+
+<br />
+<h4><a name="V1Btrees">
+III.A.1. Disk Format: Level 1A1 - Version 1 B-trees (B-link Trees)</a></h4>
+
+ <p>Version 1 B-trees in HDF5 files an implementation of the B-link tree,
+ in which the sibling nodes at a particular level in the tree are stored
+ in a doubly-linked list, is described in the &ldquo;Efficient Locking for
+ Concurrent Operations on B-trees&rdquo; paper by Phillip Lehman and S. Bing Yao
+ as published in the <cite>ACM Transactions on Database Systems</cite>,
+ Vol. 6, No. 4, December 1981.</p>
+
+ <p>The B-link trees implemented by the file format contain one more
+ key than the number of children. In other words, each child
+ pointer out of a B-tree node has a left key and a right key.
+ The pointers out of internal nodes point to sub-trees while
+ the pointers out of leaf nodes point to symbol nodes and
+ raw data chunks.
+ Aside from that difference, internal nodes and leaf nodes
+ are identical.</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ B-link Tree Nodes
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Node Type</td>
+ <td>Node Level</td>
+ <td colspan="2">Entries Used</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Left Sibling<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Right Sibling<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 0 (variable size)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Child 0<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 1 (variable size)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Child 1<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 2<em>K</em> (variable size)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Child 2<em>K</em><sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 2<em>K</em>+1 (variable size)</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>TREE</code>&rdquo; is
+ used to indicate the
+ beginning of a B-link tree node. This gives file
+ consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Node Type</p></td>
+ <td>
+ <p>Each B-link tree points to a particular type of data.
+ This field indicates the type of data as well as
+ implying the maximum degree <em>K</em> of the tree and
+ the size of each Key field.
+
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Node Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>This tree points to group nodes.</td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>This tree points to raw data chunk nodes.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Node Level</p></td>
+ <td>
+ <p>The node level indicates the level at which this node
+ appears in the tree (leaf nodes are at level zero). Not
+ only does the level indicate whether child pointers
+ point to sub-trees or to data, but it can also be used
+ to help file consistency checking utilities reconstruct
+ damaged trees.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Entries Used</p></td>
+ <td>
+ <p>This determines the number of children to which this
+ node points. All nodes of a particular type of tree
+ have the same maximum degree, but most nodes will point
+ to less than that number of children. The valid child
+ pointers and keys appear at the beginning of the node
+ and the unused pointers and keys appear at the end of
+ the node. The unused pointers and keys have undefined
+ values.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Address of Left Sibling</p></td>
+ <td>
+ <p>This is the relative file address of the left sibling of
+ the current node. If the current
+ node is the left-most node at this level then this field
+ is the <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Address of Right Sibling</p></td>
+ <td>
+ <p>This is the relative file address of the right sibling of
+ the current node. If the current
+ node is the right-most node at this level then this
+ field is the <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Keys and Child Pointers</p></td>
+ <td>
+ <p>Each tree has 2<em>K</em>+1 keys with 2<em>K</em>
+ child pointers interleaved between the keys. The number
+ of keys and child pointers actually containing valid
+ values is determined by the node&rsquo;s <em>Entries Used</em> field.
+ If that field is <em>N</em> then the B-link tree contains
+ <em>N</em> child pointers and <em>N</em>+1 keys.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Key</p></td>
+ <td>
+ <p>The format and size of the key values is determined by
+ the type of data to which this tree points. The keys are
+ ordered and are boundaries for the contents of the child
+ pointer; that is, the key values represented by child
+ <em>N</em> fall between Key <em>N</em> and Key
+ <em>N</em>+1. Whether the interval is open or closed on
+ each end is determined by the type of data to which the
+ tree points.
+ </p>
+
+ <p>
+ The format of the key depends on the node type.
+ For nodes of node type 0 (group nodes), the key is formatted as
+ follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">A single field of <i>Size of Lengths</i>
+ bytes:</td>
+ <td width="80%">Indicates the byte offset into the local heap
+ for the first object name in the subtree which
+ that key describes.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+
+ <p>
+ For nodes of node type 1 (chunked raw data nodes), the key is
+ formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-4:</td>
+ <td width="80%">Size of chunk in bytes.</td>
+ </tr>
+ <tr>
+ <td>Bytes 4-8:</td>
+ <td>Filter mask, a 32-bit bit field indicating which
+ filters have been skipped for this chunk. Each filter
+ has an index number in the pipeline (starting at 0, with
+ the first filter to apply) and if that filter is skipped,
+ the bit corresponding to its index is set.</td>
+ </tr>
+ <tr>
+ <td>(<em>D + 1</em>) 64-bit fields:</td>
+ <td>The offset of the
+ chunk within the dataset where <i>D</i> is the number
+ of dimensions of the dataset, and the last value is the
+ offset within the dataset&rsquo;s datatype and should always be
+ zero. For example, if
+ a chunk in a 3-dimensional dataset begins at the
+ position <code>[5,5,5]</code>, there will be three
+ such 64-bit values, each with the value of
+ <code>5</code>, followed by a <code>0</code> value.</td>
+ </tr>
+ </table>
+ </p>
+
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Child Pointer</p></td>
+ <td>
+ <p>The tree node contains file addresses of subtrees or
+ data depending on the node level. Nodes at Level 0 point
+ to data addresses, either raw data chunks or group nodes.
+ Nodes at non-zero levels point to other nodes of the
+ same B-tree.
+ </p>
+ <p>For raw data chunk nodes, the child pointer is the address
+ of a single raw data chunk. For group nodes, the child pointer
+ points to a <a href="#SymbolTable">symbol table</a>, which contains
+ information for multiple symbol table entries.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <p>
+ Conceptually, each B-tree node looks like this:</p>
+ <center>
+ <table>
+ <tr valign="top" align="center">
+ <td>key[0]</td><td>&nbsp;</td>
+ <td>child[0]</td><td>&nbsp;</td>
+ <td>key[1]</td><td>&nbsp;</td>
+ <td>child[1]</td><td>&nbsp;</td>
+ <td>key[2]</td><td>&nbsp;</td>
+ <td>...</td><td>&nbsp;</td>
+ <td>...</td><td>&nbsp;</td>
+ <td>key[<i>N</i>-1]</td><td>&nbsp;</td>
+ <td>child[<i>N</i>-1]</td><td>&nbsp;</td>
+ <td>key[<i>N</i>]</td>
+ </tr>
+ </table>
+ </center>
+ <br />
+
+ where child[<i>i</i>] is a pointer to a sub-tree (at a level
+ above Level 0) or to data (at Level 0).
+ Each key[<i>i</i>] describes an <i>item</i> stored by the B-tree
+ (a chunk or an object of a group node). The range of values
+ represented by child[<i>i</i>] is indicated by key[<i>i</i>]
+ and key[<i>i</i>+1].
+
+
+ <p>The following question must next be answered:
+ &ldquo;Is the value described by key[<i>i</i>] contained in
+ child[<i>i</i>-1] or in child[<i>i</i>]?&rdquo;
+ The answer depends on the type of tree.
+ In trees for groups (node type 0) the object described by
+ key[<i>i</i>] is the greatest object contained in
+ child[<i>i</i>-1] while in chunk trees (node type 1) the
+ chunk described by key[<i>i</i>] is the least chunk in
+ child[<i>i</i>].</p>
+
+ <p>That means that key[0] for group trees is sometimes unused;
+ it points to offset zero in the heap, which is always the
+ empty string and compares as &ldquo;less-than&rdquo; any valid object name.</p>
+
+ <p>And key[<i>N</i>] for chunk trees is sometimes unused;
+ it contains a chunk offset which compares as &ldquo;greater-than&rdquo;
+ any other chunk offset and has a chunk byte size of zero
+ to indicate that it is not actually allocated.</p>
+
+<br />
+<h4><a name="V2Btrees">
+III.A.2. Disk Format: Level 1A2 - Version 2 B-trees</a></h4>
+
+ <p>Version 2 B-trees are &ldquo;traditional&rdquo; B-trees, with one major difference.
+ Instead of just using a simple pointer (or address in the file) to a
+ child of an internal node, the pointer to the child node contains two
+ additional pieces of information: the number of records in the child
+ node itself, and the total number of records in the child node and
+ all its descendants. Storing this additional information allows fast
+ array-like indexing to locate the n<sup>th</sup> record in the B-tree.</p>
+
+ <p>The entry into a version 2 B-tree is a header which contains global
+ information about the structure of the B-tree. The <em>root node
+ address</em>
+ field in the header points to the B-tree root node, which is either an
+ internal or leaf node, depending on the value in the header&rsquo;s
+ <em>depth</em> field. An internal node consists of records plus
+ pointers to further leaf or internal nodes in the tree. A leaf node
+ consists of solely of records. The format of the records depends on
+ the B-tree type (stored in the header).</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Node Size</td>
+ </tr>
+ <tr>
+ <td colspan="2">Record Size</td>
+ <td colspan="2">Depth</td>
+ </tr>
+ <tr>
+ <td>Split Percent</td>
+ <td>Merge Percent</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Root Node Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="2">Number of Records in Root Node</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Total Number of Records in B-tree<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>BTHD</code>&rdquo; is
+ used to indicate the header of a version 2 B-link tree node.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this B-tree header. This document
+ describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field indicates the type of B-tree:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>A &ldquo;testing&rdquo; B-tree, this value should <em>not</em> be
+ used for storing records in actual HDF5 files.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>This B-tree is used for indexing indirectly accessed,
+ non-filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">2</td>
+ <td>This B-tree is used for indexing indirectly accessed,
+ filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">3</td>
+ <td>This B-tree is used for indexing directly accessed,
+ non-filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">4</td>
+ <td>This B-tree is used for indexing directly accessed,
+ filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">5</td>
+ <td>This B-tree is used for indexing the &lsquo;name&rsquo; field for
+ links in indexed groups.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">6</td>
+ <td>This B-tree is used for indexing the &lsquo;creation order&rsquo;
+ field for links in indexed groups.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">7</td>
+ <td>This B-tree is used for indexing shared object header
+ messages.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">8</td>
+ <td>This B-tree is used for indexing the &lsquo;name&rsquo; field for
+ indexed attributes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">9</td>
+ <td>This B-tree is used for indexing the &lsquo;creation order&rsquo;
+ field for indexed attributes.
+ </td>
+ </tr>
+ </table></p>
+ <p>The format of records for each type is described below.</p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Node Size</p></td>
+ <td>
+ <p>This is the size in bytes of all B-tree nodes.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Record Size</p></td>
+ <td>
+ <p>This field is the size in bytes of the B-tree record.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Depth</p></td>
+ <td>
+ <p>This is the depth of the B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Split Percent</p></td>
+ <td>
+ <p>The percent full that a node needs to increase above before it
+ is split.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Merge Percent</p></td>
+ <td>
+ <p>The percent full that a node needs to be decrease below before it
+ is split.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Root Node Address</p></td>
+ <td>
+ <p>This is the address of the root B-tree node. A B-tree with
+ no records will have the <a href="#UndefinedAddress">undefined
+ address</a> in this field.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Number of Records in Root Node</p></td>
+ <td>
+ <p>This is the number of records in the root node.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Total Number of Records in B-tree</p></td>
+ <td>
+ <p>This is the total number of records in the entire B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the B-tree header.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree Internal Node
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2">Records 0, 1, 2...N-1 <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Child Node Pointer 0<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Number of Records N<sub>0</sub> for Child Node 0 <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Total Number of Records for Child Node 0 <em>(optional, variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Child Node Pointer 1<sup>O</sup><br /><br /></td>
+ </tr>
+ <td colspan="4"><br />Number of Records N<sub>1</sub> for Child Node 1 <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Total Number of Records for Child Node 1 <em>(optional, variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Child Node Pointer N<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Number of Records N<sub>n</sub> for Child Node N <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Total Number of Records for Child Node N <em>(optional, variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>BTIN</code>&rdquo; is
+ used to indicate the internal node of a B-link tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this B-tree internal node.
+ This document describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field is the type of the B-tree node. It should always
+ be the same as the B-tree type in the header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Records</p></td>
+ <td>
+ <p>The size of this field is determined by the number of records
+ for this node and the record size (from the header). The format
+ of records depends on the type of B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Child Node Pointer</p></td>
+ <td>
+ <p>This field is the address of the child node pointed to by the
+ internal node.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Records in Child Node</p></td>
+ <td>
+ <p>This is the number of records in the child node pointed to by
+ the corresponding <em>Node Pointer</em>.
+ </p>
+ <p>The number of bytes used to store this field is determined by
+ the maximum possible number of records able to be stored in the
+ child node.
+ </p>
+ <p>
+ The maximum number of records in a child node is computed
+ in the following way:
+
+ <ul>
+ <li>Subtract the fixed size overhead for
+ the child node (for example, its signature, version,
+ checksum, and so on and <em>one</em> pointer triplet
+ of information for the child node (because there is one
+ more pointer triplet than records in each internal node))
+ from the size of nodes for the B-tree. </li>
+ <li>Divide that result by the size of a record plus the
+ pointer triplet of information stored to reach each
+ child node from this node.
+ </ul>
+
+ </p>
+ <p>
+ Note that leaf nodes do not encode any
+ child pointer triplets, so the maximum number of records in a
+ leaf node is just the node size minus the leaf node overhead,
+ divided by the record size.
+ </p>
+ <p>
+ Also note that the first level of internal nodes above the
+ leaf nodes do not encode the <em>Total Number of Records in Child
+ Node</em> value in the child pointer triplets (since it is the
+ same as the <em>Number of Records in Child Node</em>), so the
+ maximum number of records in these nodes is computed with the
+ equation above, but using (<em>Child Pointer</em>, <em>Number of
+ Records in Child Node</em>) pairs instead of triplets.
+ </p>
+ <p>
+ The number of
+ bytes used to encode this field is the least number of bytes
+ required to encode the maximum number of records in a child
+ node value for the child nodes below this level
+ in the B-tree.
+ </p>
+ <p>
+ For example, if the maximum number of child records is
+ 123, one byte will be used to encode these values in this
+ node; if the maximum number of child records is
+ 20000, two bytes will be used to encode these values in this
+ node; and so on. The maximum number of bytes used to
+ encode these values is 8 (in other words, an unsigned
+ 64-bit integer).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Number of Records in Child Node</p></td>
+ <td>
+ <p>This is the total number of records for the node pointed to by
+ the corresponding <em>Node Pointer</em> and all its children.
+ This field exists only in nodes whose depth in the B-tree node
+ is greater than 1 (in other words, the &ldquo;twig&rdquo;
+ internal nodes, just above leaf nodes, do not store this
+ field in their child node pointers).
+ </p>
+ <p>The number of bytes used to store this field is determined by
+ the maximum possible number of records able to be stored in the
+ child node and its descendants.
+ </p>
+ <p>
+ The maximum possible number of records able to be stored in a
+ child node and its descendants is computed iteratively, in the
+ following way: The maximum number of records in a leaf node
+ is computed, then that value is used to compute the maximum
+ possible number of records in the first level of internal nodes
+ above the leaf nodes. Multiplying these two values together
+ determines the maximum possible number of records in child node
+ pointers for the level of nodes two levels above leaf nodes.
+ This process is continued up to any level in the B-tree.
+ </p>
+ <p>
+ The number of bytes used to encode this value is computed in
+ the same way as for the <em>Number of Records in Child Node</em>
+ field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for this node.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree Leaf Node
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2">Record 0, 1, 2...N-1 <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>BTLF</code>&ldquo; is
+ used to indicate the leaf node of a version 2 B-link tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this B-tree leaf node.
+ This document describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field is the type of the B-tree node. It should always
+ be the same as the B-tree type in the header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Records</p></td>
+ <td>
+ <p>The size of this field is determined by the number of records
+ for this node and the record size (from the header). The format
+ of records depends on the type of B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for this node.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <p>The record layout for each stored (in other words, non-testing)
+ B-tree type is as follows:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 1 Record Layout - Indirectly Accessed, Non-Filtered,
+ &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object ID<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Address</p></td>
+ <td>
+ <p>The address of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Length</p></td>
+ <td>
+ <p>The length of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object ID</p></td>
+ <td>
+ <p>The heap ID for the huge object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 2 Record Layout - Indirectly Accessed, Filtered,
+ &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Memory Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object ID<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Address</p></td>
+ <td>
+ <p>The address of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Length</p></td>
+ <td>
+ <p>The length of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td>
+ <p>A 32-bit bit field indicating which filters have been skipped for
+ this chunk. Each filter has an index number in the pipeline
+ (starting at 0, with the first filter to apply) and if that
+ filter is skipped, the bit corresponding to its index is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Memory Size</p></td>
+ <td>
+ <p>The size of the de-filtered huge object in memory.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object ID</p></td>
+ <td>
+ <p>The heap ID for the huge object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 3 Record Layout - Directly Accessed, Non-Filtered,
+ &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Address</p></td>
+ <td>
+ <p>The address of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Length</p></td>
+ <td>
+ <p>The length of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 4 Record Layout - Directly Accessed, Filtered,
+ &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Memory Size<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Address</p></td>
+ <td>
+ <p>The address of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Length</p></td>
+ <td>
+ <p>The length of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td>
+ <p>A 32-bit bit field indicating which filters have been skipped for
+ this chunk. Each filter has an index number in the pipeline
+ (starting at 0, with the first filter to apply) and if that
+ filter is skipped, the bit corresponding to its index is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Memory Size</p></td>
+ <td>
+ <p>The size of the de-filtered huge object in memory.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 5 Record Layout - Link Name for Indexed Group
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Hash of Name</td>
+ </tr>
+ <tr>
+ <td colspan="4">ID <em>(bytes 1-4)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="3">ID <em>(bytes 5-7)</em></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the name for the link. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the link&rsquo;s name.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>ID</p></td>
+ <td>
+ <p>This is a 7-byte sequence of bytes and is the heap ID for the
+ link record in the group&rsquo;s fractal heap.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 6 Record Layout - Creation Order for Indexed Group
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Creation Order <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">ID <em>(bytes 1-4)</em></td>
+ </tr>
+ <tr>
+ <td colspan="3">ID <em>(bytes 5-7)</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td>
+ <p>This field is the creation order value for the link.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>ID</p></td>
+ <td>
+ <p>This is a 7-byte sequence of bytes and is the heap ID for the
+ link record in the group&rsquo;s fractal heap.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 7 Record Layout - Shared Object Header Messages (Sub-Type 0 - Message in Heap)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Hash</td>
+ </tr>
+ <tr>
+ <td colspan="4">Reference Count</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Heap ID <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This field Indicates the location where the message is stored:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>Shared message is stored in shared message index heap.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>Shared message is stored in object header.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the shared message. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the shared message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td>
+ <p>The number of objects which reference this message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte sequence of bytes and is the heap ID for the
+ shared message in the shared message index&rsquo;s fractal heap.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 7 Record Layout - Shared Object Header Messages (Sub-Type 1 - Message in Object Header)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Hash</td>
+ </tr>
+ <tr>
+ <td>Reserved (zero)</td>
+ <td>Message Type</td>
+ <td colspan="2">Object Header Index</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This field Indicates the location where the message is stored:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>Shared message is stored in shared message index heap.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>Shared message is stored in object header.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the shared message. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the shared message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Type</p></td>
+ <td>
+ <p>The object header message type of the shared message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Index</p></td>
+ <td>
+ <p>This field indicates that the shared message is the n<sup>th</sup> message
+ of its type in the specified object header.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Address</p></td>
+ <td>
+ <p>The address of the object header containing the shared message.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 8 Record Layout - Attribute Name for Indexed Attributes
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap ID <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan>Message Flags</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Creation Order</td>
+ </tr>
+ <tr>
+ <td colspan="4">Hash of Name</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte sequence of bytes and is the heap ID for the
+ attribute in the object&rsquo;s attribute fractal heap.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Flags</p></td>
+ <td><p>The object header message flags for the attribute message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td>
+ <p>This field is the creation order value for the attribute.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the name for the attribute. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the attribute&rsquo;s name.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 B-tree, Type 9 Record Layout- Creation Order for Indexed Attributes
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap ID <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan>Message Flags</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Creation Order</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte sequence of bytes and is the heap ID for the
+ attribute in the object&rsquo;s attribute fractal heap.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Flags</p></td>
+ <td>
+ <p>The object header message flags for the attribute message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td>
+ <p>This field is the creation order value for the attribute.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+<br />
+<h3><a name="SymbolTable">
+III.B. Disk Format: Level 1B - Group Symbol Table Nodes</a></h3>
+
+ <p>A group is an object internal to the file that allows
+ arbitrary nesting of objects within the file (including other groups).
+ A group maps a set of link names in the group to a set of relative
+ file addresses of objects in the file. Certain metadata for an object to
+ which the group points can be cached in the group&rsquo;s symbol table entry in
+ addition to being in the object&rsquo;s header.</p>
+
+ <p>An HDF5 object name space can be stored hierarchically by
+ partitioning the name into components and storing each
+ component as a link in a group. The link for a
+ non-ultimate component points to the group containing
+ the next component. The link for the last
+ component points to the object being named.</p>
+
+ <p>One implementation of a group is a collection of symbol table nodes
+ indexed by a B-link tree. Each symbol table node contains entries
+ for one or more links. If an attempt is made to add a link to an already
+ full symbol table node containing 2<em>K</em> entries, then the node is
+ split and one node contains <em>K</em> symbols and the other contains
+ <em>K</em>+1 symbols.</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Symbol Table Node (A Leaf of a B-link tree)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version Number</td>
+ <td>Reserved (zero)</td>
+ <td colspan="2">Number of Symbols</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Group Entries<br /><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>SNOD</code>&rdquo; is
+ used to indicate the
+ beginning of a symbol table node. This gives file
+ consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number</p></td>
+ <td>
+ <p>The version number for the symbol table node. This
+ document describes version 1. (There is no version &lsquo;0&rsquo;
+ of the symbol table node)
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Entries</p></td>
+ <td>
+ <p>Although all symbol table nodes have the same length,
+ most contain fewer than the maximum possible number of
+ link entries. This field indicates how many entries
+ contain valid data. The valid entries are packed at the
+ beginning of the symbol table node while the remaining
+ entries contain undefined values.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Symbol Table Entries</p></td>
+ <td>
+ <p>Each link has an entry in the symbol table node.
+ The format of the entry is described below.
+ There are 2<em>K</em> entries in each group node, where
+ <em>K</em> is the &ldquo;Group Leaf Node K&rdquo; value from the
+ <a href="#Superblock">superblock</a>.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h3><a name="SymbolTableEntry">
+III.C. Disk Format: Level 1C - Symbol Table Entry </a></h3>
+
+ <p>Each symbol table entry in a symbol table node is designed
+ to allow for very fast browsing of stored objects.
+ Toward that design goal, the symbol table entries
+ include space for caching certain constant metadata from the
+ object header.</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Symbol Table Entry
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Link Name Offset<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Cache Type</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Scratch-pad Space (16 bytes)<br /><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Link Name Offset</p></td>
+ <td>
+ <p>This is the byte offset into the group&rsquo;s local
+ heap for the name of the link. The name is null
+ terminated.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Address</p></td>
+ <td>
+ <p>Every object has an object header which serves as a
+ permanent location for the object&rsquo;s metadata. In addition
+ to appearing in the object header, some of the object&rsquo;s metadata
+ can be cached in the scratch-pad space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Cache Type</p></td>
+ <td>
+ <p>The cache type is determined from the object header.
+ It also determines the format for the scratch-pad space:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>No data is cached by the group entry. This
+ is guaranteed to be the case when an object header
+ has a link count greater than one.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>Group object header metadata is cached in the
+ scratch-pad space. This implies that the symbol table
+ entry refers to another group.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">2</td>
+ <td>The entry is a symbolic link. The first four bytes
+ of the scratch-pad space are the offset into the local
+ heap for the link value. The object header address
+ will be undefined.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td>
+ <p>These four bytes are present so that the scratch-pad
+ space is aligned on an eight-byte boundary. They are
+ always set to zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Scratch-pad Space</p></td>
+ <td>
+ <p>This space is used for different purposes, depending
+ on the value of the Cache Type field. Any metadata
+ about an object represented in the scratch-pad
+ space is duplicated in the object header for that
+ object.
+ </p>
+ <p>
+ Furthermore, no data is cached in the group
+ entry scratch-pad space if the object header for
+ the object has a link count greater than one.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4>Format of the Scratch-pad Space</h4>
+
+ <p>The symbol table entry scratch-pad space is formatted
+ according to the value in the Cache Type field.</p>
+
+ <p>If the Cache Type field contains the value zero
+ <code>(0)</code> then no information is
+ stored in the scratch-pad space.</p>
+
+ <p>If the Cache Type field contains the value one
+ <code>(1)</code>, then the scratch-pad space
+ contains cached metadata for another object header
+ in the following format:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Object Header Scratch-pad Format
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of B-tree<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Name Heap<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address of B-tree</p></td>
+ <td>
+ <p>This is the file address for the root of the
+ group&rsquo;s B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Name Heap</p></td>
+ <td>
+ <p>This is the file address for the group&rsquo;s local
+ heap, in which are stored the group&rsquo;s symbol names.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <p>If the Cache Type field contains the value two
+ <code>(2)</code>, then the scratch-pad space
+ contains cached metadata for a symbolic link
+ in the following format:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Symbolic Link Scratch-pad Format
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Offset to Link Value</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Offset to Link Value</p></td>
+ <td>
+ <p>The value of a symbolic link (that is, the name of the
+ thing to which it points) is stored in the local heap.
+ This field is the 4-byte offset into the local heap for
+ the start of the link value, which is null terminated.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h3><a name="LocalHeap">
+III.D. Disk Format: Level 1D - Local Heaps</a></h3>
+
+ <p>A local heap is a collection of small pieces of data that are particular
+ to a single object in the HDF5 file. Objects can be
+ inserted and removed from the heap at any time.
+ The address of a heap does not change once the heap is created.
+ For example, a group stores addresses of objects in symbol table nodes
+ with the names of links stored in the group&rsquo;s local heap.
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Local Heap
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Segment Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset to Head of Free-list<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Data Segment<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>HEAP</code>&rdquo;
+ is used to indicate the
+ beginning of a heap. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>Each local heap has its own version number so that new
+ heaps can be added to old files. This document
+ describes version zero (0) of the local heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Segment Size</p></td>
+ <td>
+ <p>The total amount of disk memory allocated for the heap
+ data. This may be larger than the amount of space
+ required by the objects stored in the heap. The extra
+ unused space in the heap holds a linked list of free blocks.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset to Head of Free-list</p></td>
+ <td>
+ <p>This is the offset within the heap data segment of the
+ first free block (or the
+ <a href="#UndefinedAddress">undefined address</a> if there is no
+ free block). The free block contains &ldquo;Size of Lengths&rdquo; bytes that
+ are the offset of the next free block (or the
+ value &lsquo;1&rsquo; if this is the
+ last free block) followed by &ldquo;Size of Lengths&rdquo; bytes that store
+ the size of this free block. The size of the free block includes
+ the space used to store the offset of the next free block and
+ the size of the current block, making the minimum size of a free
+ block 2 * &ldquo;Size of Lengths&rdquo;.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Data Segment</p></td>
+ <td>
+ <p>The data segment originally starts immediately after
+ the heap header, but if the data segment must grow as a
+ result of adding more objects, then the data segment may
+ be relocated, in its entirety, to another part of the
+ file.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <p>Objects within a local heap should be aligned on an 8-byte boundary.</p>
+
+<br />
+<h3><a name="GlobalHeap">
+III.E. Disk Format: Level 1E - Global Heap</a></h3>
+
+ <p>Each HDF5 file has a global heap which stores various types of
+ information which is typically shared between datasets. The
+ global heap was designed to satisfy these goals:</p>
+
+ <ol type="A">
+ <li>Repeated access to a heap object must be efficient without
+ resulting in repeated file I/O requests. Since global heap
+ objects will typically be shared among several datasets, it is
+ probable that the object will be accessed repeatedly.</li>
+ <li>Collections of related global heap objects should result in
+ fewer and larger I/O requests. For instance, a dataset of
+ object references will have a global heap object for each
+ reference. Reading the entire set of object references
+ should result in a few large I/O requests instead of one small
+ I/O request for each reference.</li>
+ <li>It should be possible to remove objects from the global heap
+ and the resulting file hole should be eligible to be reclaimed
+ for other uses.</li>
+ </ol>
+
+
+ <p>The implementation of the heap makes use of the memory management
+ already available at the file level and combines that with a new
+ object called a <em>collection</em> to achieve goal B. The global heap
+ is the set of all collections. Each global heap object belongs to
+ exactly one collection and each collection contains one or more global
+ heap objects. For the purposes of disk I/O and caching, a collection is
+ treated as an atomic object, addressing goal A.
+ </p>
+
+ <p>When a global heap object is deleted from a collection (which occurs
+ when its reference count falls to zero), objects located after the
+ deleted object in the collection are packed down toward the beginning
+ of the collection and the collection&rsquo;s global heap object 0 is created
+ (if possible) or its size is increased to account for the recently
+ freed space. There are no gaps between objects in each collection,
+ with the possible exception of the final space in the collection, if
+ it is not large enough to hold the header for the collection&rsquo;s global
+ heap object 0. These features address goal C.
+ </p>
+
+ <p>The HDF5 Library creates global heap collections as needed, so there may
+ be multiple collections throughout the file. The set of all of them is
+ abstractly called the &ldquo;global heap&rdquo;, although they do not actually link
+ to each other, and there is no global place in the file where you can
+ discover all of the collections. The collections are found simply by
+ finding a reference to one through another object in the file. For
+ example, data of variable-length datatype elements is stored in the
+ global heap and is accessed via a global heap ID. The format for
+ global heap IDs is described at the end of this section.
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ A Global Heap Collection
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Collection Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object 1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object 2<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object <em>N</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object 0 (free space)<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>GCOL</code>&rdquo;
+ is used to indicate the
+ beginning of a collection. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>Each collection has its own version number so that new
+ collections can be added to old files. This document
+ describes version one (1) of the collections (there is no
+ version zero (0)).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Collection Size</p></td>
+ <td>
+ <p>This is the size in bytes of the entire collection
+ including this field. The default (and minimum)
+ collection size is 4096 bytes which is a typical file
+ system block size. This allows for 127 16-byte heap
+ objects plus their overhead (the collection header of 16 bytes
+ and the 16 bytes of information about each heap object).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Global Heap Object 1 through <em>N</em></p></td>
+ <td>
+ <p>The objects are stored in any order with no
+ intervening unused space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Global Heap Object 0</p></td>
+ <td>
+ <p>Global Heap Object 0 (zero), when present, represents the free
+ space in the collection. Free space always appears at the end of
+ the collection. If the free space is too small to store the header
+ for Object 0 (described below) then the header is implied and the
+ collection contains no free space.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Global Heap Object
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Heap Object Index</td>
+ <td colspan="2">Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Data<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Heap Object Index</p></td>
+ <td>
+ <p>Each object has a unique identification number within a
+ collection. The identification numbers are chosen so that
+ new objects have the smallest value possible with the
+ exception that the identifier <code>0</code> always refers to the
+ object which represents all free space within the
+ collection.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td>
+ <p>All heap objects have a reference count field. An
+ object which is referenced from some other part of the
+ file will have a positive reference count. The reference
+ count for Object 0 is always zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td>
+ <p>Zero padding to align next field on an 8-byte boundary.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Size</p></td>
+ <td>
+ <p>This is the size of the object data stored for the object.
+ The actual storage space allocated for the object data is rounded
+ up to a multiple of eight.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Data</p></td>
+ <td>
+ <p>The object data is treated as a one-dimensional array
+ of bytes to be interpreted by the caller.
+ </p>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+
+ <br />
+ <p>
+ The format for the ID used to locate an object in the global heap is
+ described here:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Global Heap ID
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Collection Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Object Index</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Collection Address</p></td>
+ <td>
+ <p>This field is the address of the global heap collection
+ where the data object is stored.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>ID</p></td>
+ <td>
+ <p>This field is the index of the data object within the
+ global heap collection.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+<br />
+<h3><a name="FractalHeap">
+III.F. Disk Format: Level 1F - Fractal Heap</a></h3>
+
+ <p>
+ Each fractal heap consists of a header and zero or more direct and
+ indirect blocks (described below). The header contains general
+ information as well as
+ initialization parameters for the doubling table. The <em>Root
+ Block Address</em> in the header points to the first direct or
+ indirect block in the heap.
+ </p>
+
+ <p>
+ Fractal heaps are based on a data structure called a <em>doubling
+ table</em>. A doubling table provides a mechanism for quickly
+ extending an array-like data structure that minimizes the number of
+ empty blocks in the heap, while retaining very fast lookup of any
+ element within the array. More information on fractal heaps and
+ doubling tables can be found in the RFC
+ &ldquo;<a href="Supplements/FractalHeap/PrivateHeap.pdf">Private
+ Heaps in HDF5</a>.&rdquo;
+ </p>
+
+ <p>
+ The fractal heap implements the doubling table structure with
+ indirect and direct blocks.
+ Indirect blocks in the heap do not actually contain data for
+ objects in the heap, their &ldquo;size&rdquo; is abstract -
+ they represent the indexing structure for locating the
+ direct blocks in the doubling table.
+ Direct blocks
+ contain the actual data for objects stored in the heap.
+ </p>
+
+ <p>
+ All indirect blocks have a constant number of block entries in each
+ row, called the <em>width</em> of the doubling table (stored in
+ the heap header).
+
+ The number
+ of rows for each indirect block in the heap is determined by the
+ size of the block that the indirect block represents in the
+ doubling table (calculation of this is shown below) and is
+ constant, except for the &ldquo;root&rdquo;
+ indirect block, which expands and shrinks its number of rows as
+ needed.
+ </p>
+
+ <p>
+ Blocks in the first <em>two</em> rows of an indirect block
+ are <em>Starting Block Size</em> number of bytes in size,
+ and the blocks in each subsequent row are twice the size of
+ the blocks in the previous row. In other words, blocks in
+ the third row are twice the <em>Starting Block Size</em>,
+ blocks in the fourth row are four times the
+ <em>Starting Block Size</em>, and so on. Entries for
+ blocks up to the <em>Maximum Direct Block Size</em> point to
+ direct blocks, and entries for blocks greater than that size
+ point to further indirect blocks (which have their own
+ entries for direct and indirect blocks).
+ </p>
+
+ <p>
+ The number of rows of blocks, <em>nrows</em>, in an
+ indirect block of size <em>iblock_size</em> is given by the
+ following expression:
+ <br /> <br />
+ <em>nrows</em> = (log<sub>2</sub>(<em>iblock_size</em>) -
+ log<sub>2</sub>(<em>&lt;Starting Block Size&gt;</em> *
+ <em>&lt;Width&gt;</em>)) + 1
+ </p>
+
+ <p>
+ The maximum number of rows of direct blocks, <em>max_dblock_rows</em>,
+ in any indirect block of a fractal heap is given by the
+ following expression:
+ <br /> <br />
+ <em>max_dblock_rows</em> =
+ (log<sub>2</sub>(<em>&lt;Max. Direct Block Size&gt;</em>) -
+ log<sub>2</sub>(<em>&lt;Starting Block Size&gt;</em>)) + 2
+ </p>
+
+ <p>
+ Using the computed values for <em>nrows</em> and
+ <em>max_dblock_rows</em>, along with the <em>Width</em> of the
+ doubling table, the number of direct and indirect block entries
+ (<em>K</em> and <em>N</em> in the indirect block description, below)
+ in an indirect block can be computed:
+ <br /> <br />
+ <em>K</em> = MIN(<em>nrows</em>, <em>max_dblock_rows</em>) *
+ <em>Width</em>
+
+ <br /> <br />
+ If <em>nrows</em> is less than or equal to <em>max_dblock_rows</em>,
+ <em>N</em> is 0. Otherwise, <em>N</em> is simply computed:
+ <br /> <br />
+ <em>N</em> = <em>K</em> - (<em>max_dblock_rows</em> *
+ <em>Width</em>)
+ </p>
+
+ <p>
+ The size indirect blocks on disk is determined by the number
+ of rows in the indirect block (computed above). The size of direct
+ blocks on disk is exactly the size of the block in the doubling
+ table.
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fractal Heap Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Heap ID Length</td>
+ <td colspan="2">I/O Filters&rsquo; Encoded Length</td>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Maximum Size of Managed Objects</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Next Huge Object ID<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />v2 B-tree Address of Huge Objects<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Amount of Free Space in Managed Blocks<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Managed Block Free Space Manager<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Amount of Managed Space in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Amount of Allocated Managed Space in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset of Direct Block Allocation Iterator in Managed Space<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Managed Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Huge Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Huge Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Tiny Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Tiny Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Table Width</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Starting Block Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Maximum Direct Block Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Maximum Heap Size</td>
+ <td colspan="2">Starting # of Rows in Root Indirect Block</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Root Block<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Current # of Rows in Root Indirect Block</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Filtered Root Direct Block <em>(optional)</em><sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">I/O Filter Mask<em> (optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">I/O Filter Information<em> (optional, variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FRHP</code>&rdquo;
+ is used to indicate the
+ beginning of a fractal heap header. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID Length</p></td>
+ <td>
+ <p>This is the length in bytes of heap object IDs for this heap.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>I/O Filters&rsquo; Encoded Length</p></td>
+ <td>
+ <p>This is the size in bytes of the encoded <em>I/O Filter Information</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is the heap status flag and is a bit field
+ indicating additional information about the fractal heap.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit(s)</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, the ID value to use for huge object has wrapped
+ around. If the value for the <em>Next Huge Object ID</em>
+ has wrapped around, each new huge object inserted into the
+ heap will require a search for an ID value.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the direct blocks in the heap are checksummed.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Size of Managed Objects</p></td>
+ <td>
+ <p>This is the maximum size of managed objects allowed in the heap.
+ Objects greater than this this are &lsquo;huge&rsquo; objects and will be
+ stored in the file directly, rather than in a direct block for
+ the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Next Huge Object ID</p></td>
+ <td>
+ <p>This is the next ID value to use for a huge object in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>v2 B-tree Address of Huge Objects</p></td>
+ <td>
+ <p>This is the address of the <a href="#V2Btrees">v2 B-tree</a>
+ used to track huge objects in the heap. The type of records
+ stored in the <em>v2 B-tree</em> will
+ be determined by whether the address & length of a huge object
+ can fit into a heap ID (if yes, it is a &ldquo;directly&rdquo; accessed
+ huge object) and whether there is a filter used on objects
+ in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Amount of Free Space in Managed Blocks</p></td>
+ <td>
+ <p>This is the total amount of free space in managed direct blocks
+ (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Managed Block Free Space Manager</p></td>
+ <td>
+ <p>This is the address of the
+ <em><a href="#FreeSpaceManager">Free-space Manager</a></em> for
+ managed blocks.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Amount of Managed Space in Heap</p></td>
+ <td>
+ <p>This is the total amount of managed space in the heap (in bytes),
+ essentially the upper bound of the heap&rsquo;s linear address space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Amount of Allocated Managed Space in Heap</p></td>
+ <td>
+ <p>This is the total amount of managed space (in bytes) actually
+ allocated in
+ the heap. This can be less than the <em>Amount of Managed Space
+ in Heap</em> field, if some direct blocks in the heap&rsquo;s linear
+ address space are not allocated.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset of Direct Block Allocation Iterator in Managed Space</p></td>
+ <td>
+ <p>This is the linear heap offset where the next direct
+ block should be allocated at (in bytes). This may be less than
+ the <em>Amount of Managed Space in Heap</em> value because the
+ heap&rsquo;s address space is increased by a &ldquo;row&rdquo; of direct blocks
+ at a time, rather than by single direct block increments.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Managed Objects in Heap</p></td>
+ <td>
+ <p>This is the number of managed objects in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Huge Objects in Heap</p></td>
+ <td>
+ <p>This is the total size of huge objects in the heap (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Huge Objects in Heap</p></td>
+ <td>
+ <p>This is the number of huge objects in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Tiny Objects in Heap</p></td>
+ <td>
+ <p>This is the total size of tiny objects that are packed in heap
+ IDs (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Tiny Objects in Heap</p></td>
+ <td>
+ <p>This is the number of tiny objects that are packed in heap IDs.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Table Width</p></td>
+ <td>
+ <p>This is the number of columns in the doubling table for managed
+ blocks. This value must be a power of two.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Starting Block Size</p></td>
+ <td>
+ <p>This is the starting block size to use in the doubling table for
+ managed blocks (in bytes). This value must be a power of two.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Direct Block Size</p></td>
+ <td>
+ <p>This is the maximum size allowed for a managed direct block.
+ Objects inserted into the heap that are larger than this value
+ (less the # of bytes of direct block prefix/suffix)
+ are stored as &lsquo;huge&rsquo; objects. This value must be a power of
+ two.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Heap Size</p></td>
+ <td>
+ <p>This is the maximum size of the heap&rsquo;s linear address space for
+ managed objects (in bytes). The value stored is the log2 of
+ the actual value, that is: the # of bits of the address space.
+ &lsquo;Huge&rsquo; and &lsquo;tiny&rsquo; objects are not counted in this value, since
+ they do not store objects in the linear address space of the
+ heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Starting # of Rows in Root Indirect Block</p></td>
+ <td>
+ <p>This is the starting number of rows for the root indirect block.
+ A value of 0 indicates that the root indirect block will have
+ the maximum number of rows needed to address the heap&rsquo;s <em>Maximum
+ Heap Size</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Root Block</p></td>
+ <td>
+ <p>This is the address of the root block for the heap. It can
+ be the <a href="#UndefinedAddress">undefined address</a> if
+ there is no data in the heap. It either points to a direct
+ block (if the <em>Current # of Rows in the Root Indirect Block</em>
+ value is 0), or an indirect block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Current # of Rows in Root Indirect Block</p></td>
+ <td>
+ <p>This is the current number of rows in the root indirect block.
+ A value of 0 indicates that <em>Address of Root Block</em>
+ points to direct block instead of indirect block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Filtered Root Direct Block</p></td>
+ <td>
+ <p>This is the size of the root direct block, if filters are
+ applied to heap objects (in bytes). This field is only
+ stored in the header if the <em>I/O Filters&rsquo; Encoded Length</em>
+ is greater than 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>I/O Filter Mask</p></td>
+ <td>
+ <p>This is the filter mask for the root direct block, if filters
+ are applied to heap objects. This mask has the same format as
+ that used for the filter mask in chunked raw data records in a
+ <a href="#V1Btrees">v1 B-tree</a>.
+ This field is only
+ stored in the header if the <em>I/O Filters&rsquo; Encoded Length</em>
+ is greater than 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>I/O Filter Information</p></td>
+ <td>
+ <p>This is the I/O filter information encoding direct blocks and
+ huge objects, if filters are applied to heap objects. This
+ field is encoded as a <a href="#FilterMessage">Filter Pipeline</a>
+ message.
+ The size of this field is determined by <em>I/O Filters&rsquo;
+ Encoded Length</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the header.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fractal Heap Direct Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Block Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FHDB</code>&rdquo;
+ is used to indicate the
+ beginning of a fractal heap direct block. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap Header Address</p></td>
+ <td>
+ <p>This is the address for the fractal heap header that this
+ block belongs to. This field is principally used for file
+ integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Offset</p></td>
+ <td>
+ <p>This is the offset of the block within the fractal heap&rsquo;s
+ address space (in bytes). The number of bytes used to encode
+ this field is the <em>Maximum Heap Size</em> (in the heap&rsquo;s
+ header) divided by 8 and rounded up to the next highest integer,
+ for values that are not a multiple of 8. This value is
+ principally used for file integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the direct block.</p>
+ <p>This field is only present if bit 1 of <em>Flags</em> in the
+ heap&rsquo;s header is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Data</p></td>
+ <td>
+ <p>This section of the direct block stores the actual data for
+ objects in the heap. The size of this section is determined by
+ the direct block&rsquo;s size minus the size of the other fields
+ stored in the direct block (for example, the <em>Signature</em>,
+ <em>Version</em>, and others including the <em>Checksum</em> if it is
+ present).
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fractal Heap Indirect Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Block Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Direct Block #0 Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Size of Filtered Direct Block #0 <em>(optional)</em> <sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask for Direct Block #0 <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Direct Block #1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Size of Filtered Direct Block #1 <em>(optional)</em><sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask for Direct Block #1 <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Direct Block #K-1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Size of Filtered Direct Block #K-1 <em>(optional)</em><sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask for Direct Block #K-1 <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Indirect Block #0 Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Indirect Block #1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Indirect Block #N-1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FHIB</code>&rdquo; is used to
+ indicate the beginning of a fractal heap indirect block. This
+ gives file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap Header Address</p></td>
+ <td>
+ <p>This is the address for the fractal heap header that this
+ block belongs to. This field is principally used for file
+ integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Offset</p></td>
+ <td>
+ <p>This is the offset of the block within the fractal heap&rsquo;s
+ address space (in bytes). The number of bytes used to encode
+ this field is the <em>Maximum Heap Size</em> (in the heap&rsquo;s
+ header) divided by 8 and rounded up to the next highest integer,
+ for values that are not a multiple of 8. This value is
+ principally used for file integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Child Direct Block #K Address</p></td>
+ <td>
+ <p>This field is the address of the child direct block.
+ The size of the [uncompressed] direct block can be computed by
+ its offset in the heap&rsquo;s linear address space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Filtered Direct Block #K</p></td>
+ <td>
+ <p>This is the size of the child direct block after passing through
+ the I/O filters defined for this heap (in bytes). If no I/O
+ filters are present for this heap, this field is not present.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>Filter Mask for Direct Block #K</p></td>
+ <td>
+ <p>This is the I/O filter mask for the filtered direct block.
+ This mask has the same format as that used for the filter mask
+ in chunked raw data records in a <a href="#V1Btrees">v1 B-tree</a>.
+ If no I/O filters are present for this heap, this field is not
+ present.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Child Indirect Block #N Address</p></td>
+ <td>
+ <p>This field is the address of the child indirect block.
+ The size of the indirect block can be computed by
+ its offset in the heap&rsquo;s linear address space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the indirect block.</p>
+ </td>
+ </tr>
+
+ </table>
+
+ </div>
+
+ <br />
+ <p>An object in the fractal heap is identified by means of a fractal heap ID,
+ which encodes information to locate the object in the heap.
+ Currently, the fractal heap stores an object in one of three ways,
+ depending on the object&rsquo;s size:</p>
+
+ <div align="center">
+ <table class="list80">
+ <tr>
+ <th width="20%">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center">Tiny</td>
+ <td>
+ <p>When an object is small enough to be encoded in the heap ID, the
+ object&rsquo;s data is embedded in the fractal heap ID itself. There are
+ 2 sub-types for this type of object: normal and extended. The
+ sub-type for tiny heap IDs depends on whether the heap ID is large
+ enough to store objects greater than 16 bytes or not. If the
+ heap ID length is 18 bytes or smaller, the &lsquo;normal&rsquo; tiny heap ID
+ form is used. If the heap ID length is greater than 18 bytes in
+ length, the &ldquo;extented&rdquo; form is used. See format description below
+ for both sub-types.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center">Huge</td>
+ <td>
+ <p>When the size of an object is larger than <em>Maximum Size of
+ Managed Objects</em> in the <em>Fractal Heap Header</em>, the
+ object&rsquo;s data is stored on its own in the file and the object
+ is tracked/indexed via a version 2 B-tree. All huge objects
+ for a particular fractal heap use the same v2 B-tree. All huge
+ objects for a particular fractal heap use the same format for
+ their huge object IDs.
+ </p>
+
+ <p>Depending on whether the IDs for a heap are large enough to hold
+ the object&rsquo;s retrieval information and whether I/O pipeline filters
+ are applied to the heap&rsquo;s objects, 4 sub-types are derived for
+ huge object IDs for this heap:</p>
+
+ <div align="center">
+ <table class="list">
+ <tr>
+ <th align="left" width="35%">Sub-type</th>
+ <th align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="left">Directly accessed, non-filtered</td>
+ <td>
+ <p>The object&rsquo;s address and length are embedded in the
+ fractal heap ID itself and the object is directly accessed
+ from them. This allows the object to be accessed without
+ resorting to the B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left">Directly accessed, filtered</td>
+ <td>
+ <p>The filtered object&rsquo;s address, length, filter mask and
+ de-filtered size are embedded in the fractal heap ID itself
+ and the object is accessed directly with them. This allows
+ the object to be accessed without resorting to the B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left">Indirectly accessed, non-filtered</td>
+ <td>
+ <p>The object is located by using a B-tree key embedded in
+ the fractal heap ID to retrieve the address and length from
+ the version 2 B-tree for huge objects. Then, the address
+ and length are used to access the object.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left">Indirectly accessed, filtered</td>
+ <td>
+ <p>The object is located by using a B-tree key embedded in
+ the fractal heap ID to retrieve the filtered object&rsquo;s
+ address, length, filter mask and de-filtered size from the
+ version 2 B-tree for huge objects. Then, this information
+ is used to access the object.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center">Managed</td>
+ <td>
+ <p>When the size of an object does not meet the above two
+ conditions, the object is stored and managed via the direct and
+ indirect blocks based on the doubling table.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <p>The specific format for each type of heap ID is described below:
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>Fractal Heap ID for Tiny Objects (sub-type 1 - &lsquo;Normal&rsquo;)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version, Type & Length</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version, Type & Length</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Tiny objects have a value of <code>2</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>The length of the tiny object. The value stored
+ is one less than the actual length (since zero-length
+ objects are not allowed to be stored in the heap).
+ For example, an object of actual length 1 has an
+ encoded length of 0, an object of actual length 2
+ has an encoded length of 1, and so on.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td>
+ <p>This is the data for the object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>Fractal Heap ID for Tiny Objects (sub-type 2 - &lsquo;Extended&rsquo;)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version, Type & Length</td>
+ <td>Extended Length</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Data <em>(variable size)</em></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version, Type & Length</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Tiny objects have a value of <code>2</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>These 4 bits, together with the next byte, form an
+ unsigned 12-bit integer for holding the length of the
+ object. These 4-bits are bits 8-11 of the 12-bit integer.
+ See description for the <em>Extended Length</em> field below.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Extended Length</p></td>
+ <td>
+ <p>This byte, together with the 4 bits in the previous byte,
+ forms an unsigned 12-bit integer for holding the length of
+ the tiny object. These 8 bits are bits 0-7 of the 12-bit
+ integer formed. The value stored is one less than the actual
+ length (since zero-length objects are not allowed to be
+ stored in the heap). For example, an object of actual length
+ 1 has an encoded length of 0, an object of actual length
+ 2 has an encoded length of 1, and so on.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td>
+ <p>This is the data for the object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>Fractal Heap ID for Huge Objects (sub-type 1 & 2): indirectly accessed, non-filtered/filtered
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version & Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />v2 B-tree Key<sup>L</sup><em> (variable size)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version & Type</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Huge objects have a value of <code>1</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>v2 B-tree Key</p></td>
+ <td><p>This field is the B-tree key for retrieving the information
+ from the version 2 B-tree for huge objects needed to access the
+ object. See the description of <a href="#V2Btrees">v2 B-tree</a>
+ records sub-type 1 & 2 for a description of the fields. New key
+ values are derived from <em>Next Huge Object ID</em> in the
+ <em>Fractal Heap Header</em>.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>Fractal Heap ID for Huge Objects (sub-type 3): directly accessed, non-filtered
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version & Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address <sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Length <sup>L</sup><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version & Type</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Huge objects have a value of <code>1</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This field is the address of the object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This field is the length of the object in the file.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>Fractal Heap ID for Huge Objects (sub-type 4): directly accessed, filtered
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version & Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address <sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Length <sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />De-filtered Size <sup>L</sup><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>(Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version & Type</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Huge objects have a value of <code>1</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This field is the address of the filtered object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This field is the length of the filtered object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td><p>This field is the I/O pipeline filter mask for the
+ filtered object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Size</p></td>
+ <td><p>This field is the size of the de-filtered object in the file.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>Fractal Heap ID for Managed Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version & Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Length <em>(variable size)</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version & Type</p></td>
+ <td><p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Managed objects have a value of <code>0</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset</p></td>
+ <td><p>This field is the offset of the object in the heap.
+ This field&rsquo;s size is the minimum number of bytes
+ necessary to encode the <em>Maximum Heap Size</em> value
+ (from the <em>Fractal Heap Header</em>). For example, if the
+ value of the <em>Maximum Heap Size</em> is less than 256 bytes,
+ this field is 1 byte in length, a <em>Maximum Heap Size</em>
+ of 256-65535 bytes uses a 2 byte length, and so on.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This field is the length of the object in the heap. It
+ is determined by taking the minimum value of <em>Maximum
+ Direct Block Size</em> and <em>Maximum Size of Managed
+ Objects</em> in the <em>Fractal Heap Header</em>. Again,
+ the minimum number of bytes needed to encode that value is
+ used for the size of this field.</p></td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h3><a name="FreeSpaceManager">
+III.G. Disk Format: Level 1G - Free-space Manager</a></h3>
+
+ <p>
+ Free-space managers are used to describe space within a heap or
+ the entire HDF5 file that is not currently used for that heap or
+ file.
+ </p>
+
+ <p>
+ The <em>free-space manager header</em> contains metadata information
+ about the space being tracked, along with the address of the list
+ of <em>free space sections</em> which actually describes the free
+ space. The header records information about free-space sections being
+ tracked, creation parameters for handling free-space sections of a
+ client, and section information used to locate the collection of
+ free-space sections.
+ </p>
+
+ <p>
+ The <em>free-space section list</em> stores a collection of
+ free-space sections that is specific to each <em>client</em> of the
+ free-space manager.
+
+ For example, the fractal heap is a client of the free space manager
+ and uses it to track unused space within the heap. There are 4
+ types of section records for the fractal heap, each of which has
+ its own format, listed below.
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Free-space Manager Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Total Space Tracked<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Total Number of Sections<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Serialized Sections<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Un-Serialized Sections<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Section Classes</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Shrink Percent</td>
+ <td colspan="2">Expand Percent</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Size of Address Space</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Maximum Section Size <sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Serialized Section List<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Serialized Section List Used<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Allocated Size of Serialized Section List<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="35%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FSHD</code>&rdquo; is used to
+ indicate the beginning of the Free-space Manager Header.
+ This gives file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This is the version number for the Free-space Manager Header
+ and this document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>This is the client ID for identifying the user of this
+ free-space manager:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Fractal heap
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>File
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Space Tracked</p></td>
+ <td>
+ <p>This is the total amount of free space being tracked, in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Number of Sections</p></td>
+ <td>
+ <p>This is the total number of free-space sections being tracked.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Serialized Sections</p></td>
+ <td>
+ <p>This is the number of serialized free-space sections being
+ tracked.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>Number of Un-Serialized Sections</p></td>
+ <td>
+ <p>This is the number of un-serialized free-space sections being
+ managed. Un-serialized sections are created by the free-space
+ client when the list of sections is read in.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Section Classes</p></td>
+ <td>
+ <p>This is the number of section classes handled by this free space
+ manager for the free-space client.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Shrink Percent</p></td>
+ <td>
+ <p>This is the percent of current size to shrink the allocated
+ serialized free-space section list.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Expand Percent</p></td>
+ <td>
+ <p>This is the percent of current size to expand the allocated
+ serialized free-space section list.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Address Space</p></td>
+ <td>
+ <p>This is the size of the address space that free-space sections
+ are within. This is stored as the log<sub>2</sub> of the
+ actual value (in other words, the number of bits required
+ to store values within that address space).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Section Size</p></td>
+ <td>
+ <p>This is the maximum size of a section to be tracked.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Serialized Section List</p></td>
+ <td>
+ <p>This is the address where the serialized free-space section
+ list is stored.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Serialized Section List Used</p></td>
+ <td>
+ <p>This is the size of the serialized free-space section
+ list used (in bytes). This value must be less than
+ or equal to the <em>allocated size of serialized section
+ list</em>, below.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Allocated Size of Serialized Section List</p></td>
+ <td>
+ <p>This is the size of serialized free-space section list
+ actually allocated (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the free-space manager header.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <p>The free-space sections being managed are stored in a
+ <em>free-space section list</em>, described below. The sections
+ in the free-space section list are stored in the following way:
+ a count of the number of sections describing a particular size of
+ free space and the size of the free-space described (in bytes),
+ followed by a list of section description records; then another
+ section count and size, followed by the list of section
+ descriptions for that size; and so on.</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Free-space Section List
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Free-space Manager Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Number of Section Records in Set #0 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size of Free-space Section Described in Record Set #0 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #0 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #0 Section Record #0 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #0 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #K-1 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #0 Section Record #K-1 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #K-1 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Number of Section Records in Set #1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size of Free-space Section Described in Record Set #1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #0 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #1 Section Record #0 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #0 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #K-1 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #1 Section Record #K-1 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #K-1 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><strong>...</strong></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><strong>...</strong></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Number of Section Records in Set #N-1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size of Free-space Section Described in Record Set #N-1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #0 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #N-1 Section Record #0 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #0 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #K-1 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #N-1 Section Record #K-1 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #K-1 Data <em>(variable size)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="35%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FSSE</code>&rdquo; is used to
+ indicate the beginning of the Free-space Section Information.
+ This gives file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This is the version number for the Free-space Section List
+ and this document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Free-space Manager Header Address</p></td>
+ <td>
+ <p>This is the address of the <em>Free-space Manager Header</em>.
+ This field is principally used for file
+ integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Section Records for Set #N</p></td>
+ <td>
+ <p>This is the number of free-space section records for set #N.
+ The length of this field is the minimum number of bytes needed
+ to store the <em>number of serialized sections</em> (from the
+ <em>free-space manager header</em>).
+ </p>
+
+ <p>
+ The number of sets of free-space section records is
+ determined by the <em>size of serialized section list</em> in
+ the <em>free-space manager header</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Section Size for Record Set #N</p></td>
+ <td>
+ <p>This is the size (in bytes) of the free-space section described
+ for <em>all</em> the section records in set #N.
+ </p>
+
+ <p>
+ The length of this field is the minimum number of bytes needed
+ to store the <em>maximum section size</em> (from the
+ <em>free-space manager header</em>).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Record Set #N Section #K Offset</p></td>
+ <td>
+ <p>This is the offset (in bytes) of the free-space section within
+ the client for the free-space manager.
+ </p>
+
+ <p>
+ The length of this field is the minimum number of bytes needed
+ to store the <em>size of address space</em> (from the
+ <em>free-space manager header</em>).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Record Set #N Section #K Type</p></td>
+ <td>
+ <p>This is the type of the section record, used to decode the
+ <em>record set #N section #K data</em> information. The defined
+ record type for <em>file</em> client is:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>File&rsquo;s section (a range of actual bytes in file)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ <p>The defined record types for a <em>fractal heap</em> client are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Fractal heap &ldquo;single&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Fractal heap &ldquo;first row&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Fractal heap &ldquo;normal row&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Fractal heap &ldquo;indirect&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Record Set #N Section #K Data</p></td>
+ <td>
+ <p>This is the section-type specific information for each record
+ in the record set, described below.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the <em>Free-space Section List</em>.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <p>
+ The section-type specific data for each free-space section record is
+ described below:
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ File&rsquo;s Section Data Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>No additional record data stored</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fractal Heap &ldquo;Single&rdquo; Section Data Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>No additional record data stored</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fractal Heap &ldquo;First Row&rdquo; Section Data Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>Same format as &ldquo;indirect&rdquo; section data</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fractal Heap &ldquo;Normal Row&rdquo; Section Data Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>No additional record data stored</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fractal Heap &ldquo;Indirect&rdquo; Section Data Record
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Fractal Heap Indirect Block Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Block Start Row</td>
+ <td colspan="2">Block Start Column</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Blocks</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Block Offset</p></td>
+ <td>
+ <p>The offset of the indirect block in the fractal heap&rsquo;s address
+ space containing the empty blocks.
+ </p>
+ <p>
+ The number of bytes used to encode this field is the minimum
+ number of bytes needed to encode values for the <em>Maximum
+ Heap Size</em> (in the fractal heap&rsquo;s header).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Start Row</p></td>
+ <td>
+ <p>This is the row that the empty blocks start in.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Start Column</p></td>
+ <td>
+ <p>This is the column that the empty blocks start in.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Blocks</p></td>
+ <td>
+ <p>This is the number of empty blocks covered by the section.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h3><a name="SOHMTable">
+III.H. Disk Format: Level 1H - Shared Object Header Message Table</a></h3>
+
+ <p>
+ The <em>shared object header message table</em> is used to locate
+ object
+ header messages that are shared between two or more object headers
+ in the file. Shared object header messages are stored and indexed
+ in the file in one of two ways: indexed sequentially in a
+ <em>shared header message list</em> or indexed with a v2 B-tree.
+ The shared messages themselves are either stored in a fractal
+ heap (when two or more objects share the message), or remain in an
+ object&rsquo;s header (when only one object uses the message currently,
+ but the message can be shared in the future).
+ </p>
+
+ <p>
+ The <em>shared object header message table</em>
+ contains a list of shared message index headers. Each index header
+ records information about the version of the index format, the index
+ storage type, flags for the message types indexed, the number of
+ messages in the index, the address where the index resides,
+ and the fractal heap address if shared messages are stored there.
+ </p>
+
+ <p>
+ Each index can be either a list or a v2 B-tree and may transition
+ between those two forms as the number of messages in the index
+ varies. Each shared message record contains information used to
+ locate the shared message from either a fractal heap or an object
+ header. The types of messages that can be shared are: <em>Dataspace,
+ Datatype, Fill Value, Filter Pipeline and Attribute</em>.
+ </p>
+
+ <p>
+ The <em>shared object header message table</em> is pointed to
+ from a <a href="#SOHMTableMessage">shared message table</a> message
+ in the superblock extension for a file. This message stores the
+ version of the table format, along with the number of index headers
+ in the table.
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Object Header Message Table
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version for index #0</td>
+ <td>Index Type for index #0</td>
+ <td colspan="2">Message Type Flags for index #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Minimum Message Size for index #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">List Cutoff for index #0</td>
+ <td colspan="2">v2 B-tree Cutoff for index #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Messages for index #0</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Index Address<sup>O</sup> for index #0<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup> for index #0<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td>Version for index #N-1</td>
+ <td>Index Type for index #N-1</td>
+ <td colspan="2">Message Type Flags for index #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Minimum Message Size for index #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">List Cutoff for index #N-1</td>
+ <td colspan="2">v2 B-tree Cutoff for index #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Messages for index #N-1</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Index Address<sup>O</sup> for index #N-1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup> for index #N-1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="35%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>SMTB</code>&rdquo; is used to
+ indicate the beginning of the Shared Object Header Message table.
+ This gives file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version for index #N</p></td>
+ <td>
+ <p>This is the version number for the list of shared object header message
+ indexes and this document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Index Type for index #N</p></td>
+ <td>
+ <p>The type of index can be an unsorted list or a v2 B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Type Flags for index #N</p></td>
+ <td>
+ <p>This field indicates the type of messages tracked in the index,
+ as follows:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bits</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, the index tracks <em>Dataspace Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the message tracks <em>Datatype Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>If set, the message tracks <em>Fill Value Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>If set, the message tracks <em>Filter Pipeline Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>If set, the message tracks <em>Attribute Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5-15</code></td>
+ <td>Reserved (zero).
+ </td>
+ </tr>
+ </table></p>
+
+
+ <p>
+ An index can track more than one type of message, but each type
+ of message can only by in one index.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Minimum Message Size for index #N</p></td>
+ <td>
+ <p>This is the message size sharing threshold for the index.
+ If the encoded size of the message is less than this value, the
+ message is not shared.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>List Cutoff for index #N</p></td>
+ <td>
+ <p>This is the cutoff value for the indexing of messages to
+ switch from a list to a v2 B-tree. If the number of messages
+ is greater than this value, the index should be a v2 B-tree.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>v2 B-tree Cutoff for index #N</p></td>
+ <td>
+ <p>This is is the cutoff value for the indexing of messages to
+ switch from a v2 B-tree back to a list. If the number of
+ messages is less than this value, the index should be a list.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Messages for index #N</p></td>
+ <td>
+ <p>The number of shared messages being tracked for the index.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Index Address for index #N</p></td>
+ <td>
+ <p>This field is the address of the list or v2 B-tree where the
+ index nodes reside.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Address for index #N</p></td>
+ <td>
+ <p>This field is the address of the fractal heap if shared messages
+ are stored there.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the table.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <p>
+ Shared messages are indexed either with a <em>shared message record
+ list</em>, described below, or using a v2 B-tree (using record type 7).
+ The number of records in the <em>shared message record list</em> is
+ determined in the index&rsquo;s entry in the <em>shared object header message
+ table</em>.
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Message Record List
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Shared Message Record #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Shared Message Record #1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Shared Message Record #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>SMLI</code>&rdquo; is used to
+ indicate the beginning of a list of index nodes.
+ This gives file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Shared Message Record #N</p></td>
+ <td>
+ <p>The record for locating the shared message, either in the
+ fractal heap for the index, or an object header (see format for
+ <em>index nodes</em> below).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the list.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <p>
+ The record for each shared message in an index is stored in one of the
+ following forms:
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Message Record, for messages stored in a fractal heap
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Hash Value</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap ID<br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This has a value of 0 indicating that the message is stored in
+ the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash Value</p></td>
+ <td>
+ <p>This is the hash value for the message.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td>
+ <p>This is the number of times the message is used in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte fractal heap ID for the message as stored in
+ the fractal heap for the index.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Message Record, for messages stored in an object header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Hash Value</td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td>Message Type</td>
+ <td colspan="2">Creation Index</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This has a value of 1 indicating that the message is stored in
+ an object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash Value</p></td>
+ <td>
+ <p>This is the hash value for the message.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Type</p></td>
+ <td>
+ <p>This is the message type in the object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Index</p></td>
+ <td>
+ <p>This is the creation index of the message within the object
+ header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Address</p></td>
+ <td>
+ <p>This is the address of the object header where the message is
+ located.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+
+<br />
+<br />
+<hr />
+<h2><a name="DataObject">
+IV. Disk Format: Level 2 - Data Objects </a></h2>
+
+ <p>Data objects contain the &ldquo;real&rdquo; user-visible information in the file.
+ These objects compose the scientific data and other information which
+ are generally thought of as &ldquo;data&rdquo; by the end-user. All the
+ other information in the file is provided as a framework for
+ storing and accessing these data objects.
+ </p>
+
+ <p>A data object is composed of header and data
+ information. The header information contains the information
+ needed to interpret the data information for the object as
+ well as additional &ldquo;metadata&rdquo; or pointers to additional
+ &ldquo;metadata&rdquo; used to describe or annotate each object.
+ </p>
+
+<br />
+<h3><a name="ObjectHeader">
+IV.A. Disk Format: Level 2A - Data Object Headers</a></h3>
+
+ <p>The header information of an object is designed to encompass
+ all of the information about an object, except for the data itself.
+ This information includes the dataspace, the datatype, information
+ about how the data is stored on disk (in external files, compressed,
+ broken up in blocks, and so on), as well as other information used
+ by the library to speed up access to the data objects or maintain
+ a file&rsquo;s integrity. Information stored by user applications
+ as attributes is also stored in the object&rsquo;s header. The header
+ of each object is not necessarily located immediately prior to the
+ object&rsquo;s data in the file and in fact may be located in any
+ position in the file. The order of the messages in an object header
+ is not significant.</p>
+
+ <p>Object headers are composed of a prefix and a set of messages. The
+ prefix contains the information needed to interpret the messages and
+ a small amount of metadata about the object, and the messages contain
+ the majority of the metadata about the object.
+ </p>
+
+<br />
+<h3><a name="ObjectHeaderPrefix">
+IV.A.1. Disk Format: Level 2A1 - Data Object Header Prefix</a></h3>
+
+<br />
+<h4><a name="V1ObjectHeaderPrefix">
+IV.A.1.a. Version 1 Data Object Header Prefix</a></h4>
+
+ <p>Header messages are aligned on 8-byte boundaries for version 1
+ object headers.
+ </p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 1 Object Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Reserved (zero)</td>
+ <td colspan="2">Total Number of Header Messages</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Object Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Object Header Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message Type #1</td>
+ <td colspan="2">Size of Header Message Data #1</td>
+ </tr>
+
+ <tr>
+ <td>Header Message #1 Flags</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message Type #n</td>
+ <td colspan="2">Size of Header Message Data #n</td>
+ </tr>
+
+ <tr>
+ <td>Header Message #n Flags</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #n<br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ information in the object header. When the format of the
+ object header is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted. This
+ is version one (1) (there was no version zero (0)) of the
+ object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Number of Header Messages</p></td>
+ <td>
+ <p>This value determines the total number of messages listed in
+ object headers for this object. This value includes the messages
+ in continuation messages for this object.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Reference Count</p></td>
+ <td>
+ <p>This value specifies the number of &ldquo;hard links&rdquo; to this object
+ within the current file. References to the object from external
+ files, &ldquo;soft links&rdquo; in this file and object references in this
+ file are not tracked.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Size</p></td>
+ <td>
+ <p>This value specifies the number of bytes of header message data
+ following this length field that contain object header messages
+ for this object header. This value does not include the size of
+ object header continuation blocks for this object elsewhere in the
+ file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Type</p></td>
+ <td>
+ <p>This value specifies the type of information included in the
+ following header message data. The message types for
+ header messages are defined in sections below.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Header Message #n Data</p></td>
+ <td>
+ <p>This value specifies the number of bytes of header
+ message data following the header message type and length
+ information for the current message. The size includes
+ padding bytes to make the message a multiple of eight
+ bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Flags</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, the message data is constant. This is used
+ for messages like the datatype message of a dataset.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the message is <em>shared</em> and stored
+ in another location than the object header. The Header
+ Message Data field contains a Shared Message
+ (described in the <a href="#ObjectHeaderMessages">Data Object Header Messages</a>
+ section below)
+ and the Size of Header Message Data field
+ contains the size of that Shared Message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>If set, the message should not be shared.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>If set, the HDF5 decoder should fail to open this object
+ if it does not understand the message&rsquo;s type and the file
+ is open with permissions allowing write access to the file.
+ (Normally, unknown messages can just be ignored by HDF5
+ decoders)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>If set, the HDF5 decoder should set bit 5 of this
+ message&rsquo;s flags (in other words, this bit field)
+ if it does not understand the message&rsquo;s type
+ and the object is modified in any way. (Normally,
+ unknown messages can just be ignored by HDF5
+ decoders)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>If set, this object was modified by software that did not
+ understand this message.
+ (Normally, unknown messages should just be ignored by HDF5
+ decoders) (Can be used to invalidate an index or a similar
+ feature)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td>If set, this message is shareable.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>7</code></td>
+ <td>If set, the HDF5 decoder should always fail to open this
+ object if it does not understand the message&rsquo;s type (whether
+ it is open for read-only or read-write access). (Normally,
+ unknown messages can just be ignored by HDF5 decoders)
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Data</p></td>
+ <td>
+ <p>The format and length of this field is determined by the
+ header message type and size respectively. Some header
+ message types do not require any data and this information
+ can be eliminated by setting the length of the message to
+ zero. The data is padded with enough zeroes to make the
+ size a multiple of eight.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="V2ObjectHeaderPrefix">
+IV.A.1.b. Version 2 Data Object Header Prefix</a></h4>
+
+ <p>Note that the &ldquo;total number of messages&rdquo; field has been dropped from
+ the data object header prefix in this version. The number of messages
+ in the data object header is just determined by the messages encountered
+ in all the object header blocks.</p>
+
+ <p>Note also that the fields and messages in this version of data object
+ headers have <em>no</em> alignment or padding bytes inserted - they are
+ stored packed together.</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 Object Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Access time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Modification Time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Change Time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Birth Time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Maximum # of compact attributes <em>(optional)</em></td>
+ <td colspan="2">Minimum # of dense attributes <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td>Size of Chunk #0 <em>(variable size)</em></td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td>Header Message Type #1</td>
+ <td colspan="2">Size of Header Message Data #1</td>
+ <td>Header Message #1 Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #1 Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td>Header Message Type #n</td>
+ <td colspan="2">Size of Header Message Data #n</td>
+ <td>Header Message #n Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #n Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #n<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Gap <em>(optional, variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>OHDR</code>&rdquo;
+ is used to indicate the
+ beginning of an object header. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This field has a value of 2 indicating version 2 of the object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is a bit field indicating additional information
+ about the object header.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit(s)</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0-1</code></td>
+ <td>This two bit field determines the size of the
+ <em>Size of Chunk #0</em> field. The values are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 1 byte.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 2 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 4 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 8 bytes.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>If set, attribute creation order is tracked.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>If set, attribute creation order is indexed.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>If set, non-default attribute storage phase change
+ values are stored.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>If set, access, modification, change and birth times
+ are stored.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Access Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after the
+ UNIX epoch when the object&rsquo;s raw data was last accessed
+ (in other words, read or written).
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Modification Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after
+ the UNIX epoch when the object&rsquo;s raw data was last
+ modified (in other words, written).
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Change Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after the
+ UNIX epoch when the object&rsquo;s metadata was last changed.
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Birth Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after the
+ UNIX epoch when the object was created.
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum # of compact attributes</p></td>
+ <td>
+ <p>This is the maximum number of attributes to store in the compact
+ format before switching to the indexed format.
+ </p>
+ <p>This field is present if bit 4 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Minimum # of dense attributes</p></td>
+ <td>
+ <p>This is the minimum number of attributes to store in the indexed
+ format before switching to the compact format.
+ </p>
+ <p>This field is present if bit 4 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Chunk #0</p></td>
+ <td>
+ <p>
+ This unsigned value specifies the number of bytes of header
+ message data following this field that contain object header
+ information.
+ </p>
+ <p>
+ This value does not include the size of object header
+ continuation blocks for this object elsewhere in the file.
+ </p>
+ <p>
+ The length of this field varies depending on bits 0 and 1 of
+ the <em>flags</em> field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Type</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Header Message #n Data</p></td>
+ <td>
+ <p>This value specifies the number of bytes of header
+ message data following the header message type and length
+ information for the current message. The size of messages
+ in this version does <em>not</em> include any padding bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Flags</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Creation Order</p></td>
+ <td>
+ <p>This field stores the order that a message of a given type
+ was created in.
+ </p>
+ <p>This field is present if bit 2 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Data</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Gap</p></td>
+ <td>
+ <p>A gap in an object header chunk is inferred by the end of the
+ messages for the chunk before the beginning of the chunk&rsquo;s
+ checksum. Gaps are always smaller than the size of an
+ object header message prefix (message type + message size +
+ message flags).
+ </p>
+ <p>Gaps are formed when a message (typically an attribute message)
+ in an earlier chunk is deleted and a message from a later
+ chunk that does not quite fit into the free space is moved
+ into the earlier chunk.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the object header chunk.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <p>The header message types and the message data associated with
+ them compose the critical &ldquo;metadata&rdquo; about each object. Some
+ header messages are required for each object while others are
+ optional. Some optional header messages may also be repeated
+ several times in the header itself, the requirements and number
+ of times allowed in the header will be noted in each header
+ message description below.
+ </p>
+
+
+<br />
+<h3><a name="ObjectHeaderMessages">
+IV.A.2. Disk Format: Level 2A2 - Data Object Header Messages</a></h3>
+
+ <p>Data object header messages are small pieces of metadata that are
+ stored in the data object header for each object in an HDF5 file.
+ Data object header messages provide the metadata required to describe
+ an object and its contents, as well as optional pieces of metadata
+ that annotate the meaning or purpose of the object.
+ </p>
+
+ <p>Data object header messages are either stored directly in the data
+ object header for the object or are shared between multiple objects
+ in the file. When a message is shared, a flag in the <em>Message Flags</em>
+ indicates that the actual <em>Message Data</em>
+ portion of that message is stored in another location (such as another
+ data object header, or a heap in the file) and the <em>Message Data</em>
+ field contains the information needed to locate the actual information
+ for the message.
+ </p>
+
+ <p>
+ The format of shared message data is described here:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Message (Version 1)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number is used when there are changes in the format
+ of a shared object message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by the library before version 1.6.1.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td><p>The type of shared message location:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Message stored in another object&rsquo;s header (a <em>committed</em>
+ message).
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the object header
+ containing the message to be shared.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Message (Version 2)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number is used when there are changes in the format
+ of a shared object message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used by the library of version 1.6.1 and after.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td><p>The type of shared message location:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Message stored in another object&rsquo;s header (a <em>committed</em>
+ message).
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the object header
+ containing the message to be shared.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Message (Version 3)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Location <em>(variable size)</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number indicates changes in the format of shared
+ object message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used by the library of version 1.8 and after. In this
+ version, the <em>Type</em> field can indicate that
+ the message is stored in the fractal heap.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td><p>The type of shared message location:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Message is not shared and is not shareable.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Message stored in file&rsquo;s <em>shared object header message</em>
+ heap (a <em>shared</em> message).
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Message stored in another object&rsquo;s header (a <em>committed</em>
+ message).
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Message stored is not shared, but is sharable.
+ </td>
+ </tr>
+
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Location</p></td>
+ <td><p>This field contains either a <em>Size of Offsets</em>-bytes
+ address of the object header
+ containing the message to be shared, or an 8-byte fractal heap ID
+ for the message in the file&rsquo;s <em>shared object header message</em>
+ heap.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <p>The following is a list of currently defined header messages:
+ </p>
+
+<br />
+<h4><a name="NILMessage">IV.A.2.a. The NIL Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> NIL</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0000</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The NIL message is used to indicate a message which is to be
+ ignored when reading the header messages for a data object.
+ [Possibly one which has been deleted for some reason.]
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> Unspecified</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+
+<br />
+<h4><a name="DataspaceMessage">IV.A.2.b. The Dataspace Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Dataspace</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0001</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies according to the number of
+ dimensions, as described in the following table.</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for dataset objects;
+ may not be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The dataspace message describes the number of dimensions (in
+ other words, &ldquo;rank&rdquo;) and size of each dimension that
+ the data object has. This message is only used for datasets which
+ have a simple, rectilinear, array-like layout; datasets requiring
+ a more complex layout are not yet supported.
+ </td>
+ </tr>
+
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Dataspace Message - Version 1
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Flags</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension #1 Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #1 Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Permutation Index #1<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Permutation Index #n<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ Dataspace Message. When the format of the
+ information in the message is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted. This
+ document describes version one (1) (there was no version
+ zero (0)).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the data
+ object has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is used to store flags to indicate the
+ presence of parts of this message. Bit 0 (the least
+ significant bit) is used to indicate that maximum
+ dimensions are present. Bit 1 is used to indicate that
+ permutation indices are present.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the current size of the dimension of the
+ data as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Maximum Size</p></td>
+ <td>
+ <p>This value is the maximum size of the dimension of the
+ data as stored in the file. This value may be the special
+ &ldquo;<a href="#UnlimitedDim">unlimited</a>&rdquo; size which indicates
+ that the data may expand along this dimension indefinitely.
+ If these values are not stored, the maximum size of each
+ dimension is assumed to be the dimension&rsquo;s current size.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Permutation Index #n</p></td>
+ <td>
+ <p>This value is the index permutation used to map
+ each dimension from the canonical representation to an
+ alternate axis for each dimension. If these values are
+ not stored, the first dimension stored in the list of
+ dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+
+ <br />
+ <p>Version 2 of the dataspace message dropped the optional
+ permutation index value support, as it was never implemented in the
+ HDF5 Library:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Dataspace Message - Version 2
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Flags</td>
+ <td>Type</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension #1 Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #1 Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ Dataspace Message. This field should be &lsquo;2&rsquo; for version 2
+ format messages.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the data object has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is used to store flags to indicate the
+ presence of parts of this message. Bit 0 (the least
+ significant bit) is used to indicate that maximum
+ dimensions are present.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field indicates the type of the dataspace:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>A <em>scalar</em> dataspace; in other words,
+ a dataspace with a single, dimensionless element.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>A <em>simple</em> dataspace; in other words,
+ a dataspace with a rank > 0 and an appropriate # of
+ dimensions.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>A <em>null</em> dataspace; in other words,
+ a dataspace with no elements.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the current size of the dimension of the
+ data as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Maximum Size</p></td>
+ <td>
+ <p>This value is the maximum size of the dimension of the
+ data as stored in the file. This value may be the special
+ &ldquo;<a href="#UnlimitedDim">unlimited</a>&rdquo; size which indicates
+ that the data may expand along this dimension indefinitely.
+ If these values are not stored, the maximum size of each
+ dimension is assumed to be the dimension&rsquo;s current size.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+
+<!--
+<br />
+<h4><a name="DataSpaceMessage">Header Message Name: Complex Dataspace (Fiber Bundle?)</a></h4>
+
+ <!-- start msgdesc table --
+ <center>
+ <table class="msgdesc">
+ <p><b>Header Message Name: ???????</b></td></tr>
+ <b>Header Message Type: </b>0x0002<br />
+ <b>Length:</b> Varies</td></tr>
+
+ <b>Status:</b> One of the <em>Simple Dataspace</em> or
+ <em>Complex Dataspace</em> messages is required (but not both) and may
+ not be repeated.<br /> <b>Description:</b> The
+ <em>Dataspace</em> message describes space that the dataset is
+ mapped onto in a more comprehensive way than the <em>Simple
+ Dimensionality</em> message is capable of handling. The
+ dataspace of a dataset encompasses the type of coordinate system
+ used to locate the dataset&rsquo;s elements as well as the structure and
+ regularity of the coordinate system. The dataspace also
+ describes the number of dimensions which the dataset inhabits as
+ well as a possible higher dimensional space in which the dataset
+ is located within.
+
+ <br />
+ <p><b>Format of Data:</b></p>
+
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Message Layout</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4">Mesh Type</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimensionality</td>
+ </tr>
+ </table>
+ </center>
+
+ <br />
+ <dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Mesh Type: (unsigned 32-bit integer)
+ <dd>This value indicates whether the grid is
+ polar/spherical/cartesion,
+ structured/unstructured and regular/irregular. <br />
+ The mesh type value is broken up as follows: <br />
+
+ <br />
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Mesh-type Layout</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="1">Mesh Embedding</td>
+ <td colspan="1">Coordinate System</td>
+ <td colspan="1">Structure</td>
+ <td colspan="1">Regularity</td>
+ </tr>
+ </table>
+ </center>
+ The following are the definitions of mesh-type bytes:
+ <dl>
+ <dt>Mesh Embedding
+ <dd>This value indicates whether the dataset dataspace
+ is located within
+ another dataspace or not:
+ <dl> <dl>
+ <dt>&lt;STANDALONE&gt;
+ <dd>The dataset mesh is self-contained and is not
+ embedded in another mesh.
+ <dt>&lt;EMBEDDED&gt;
+ <dd>The dataset&rsquo;s dataspace is located within
+ another dataspace, as
+ described in information below.
+ </dl> </dl>
+ <dt>Coordinate System
+ <dd>This value defines the type of coordinate system
+ used for the mesh:
+ <dl> <dl>
+ <dt>&lt;POLAR&gt;
+ <dd>The last two dimensions are in polar
+ coordinates, higher dimensions are
+ cartesian.
+ <dt>&lt;SPHERICAL&gt;
+ <dd>The last three dimensions are in spherical
+ coordinates, higher dimensions
+ are cartesian.
+ <dt>&lt;CARTESIAN&gt;
+ <dd>All dimensions are in cartesian coordinates.
+ </dl> </dl>
+ <dt>Structure
+ <dd>This value defines the locations of the grid-points
+ on the axes:
+ <dl> <dl>
+ <dt>&lt;STRUCTURED&gt;
+ <dd>All grid-points are on integral, sequential
+ locations, starting from 0.
+ <dt>&lt;UNSTRUCTURED&gt;
+ <dd>Grid-points locations in each dimension are
+ explicitly defined and
+ may be of any numeric datatype.
+ </dl> </dl>
+ <dt>Regularity
+ <dd>This value defines the locations of the dataset
+ points on the grid:
+ <dl> <dl>
+ <dt>&lt;REGULAR&gt;
+ <dd>All dataset elements are located at the
+ grid-points defined.
+ <dt>&lt;IRREGULAR&gt;
+ <dd>Each dataset element has a particular
+ grid-location defined.
+ </dl> </dl>
+ </dl>
+ <p>The following grid combinations are currently allowed:</p>
+ <dl> <dl>
+ <dt>&lt;POLAR-STRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-STRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-STRUCTURED-REGULAR&gt;
+ <dt>&lt;POLAR-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-IRREGULAR&gt;
+ </dl> </dl>
+ All of the above grid types can be embedded within another
+ dataspace.
+ <br /> <br />
+ <dt>Logical Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions that the dataset occupies.
+
+ <br />
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Embedded Dimensionality Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4">Embedded Dimensionality</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Dimension Size #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Dimension Size #n</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Origin Location #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Origin Location #n</td>
+ </tr>
+ </table>
+ </center>
+
+ <dt>Embedded Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions of the space the
+ dataset is located within: in other words, a planar dataset
+ located within a 3-D space, a 3-D dataset
+ which is a subset of another 3-D space, and so on.
+ <dt>Embedded Dimension Size: (unsigned 32-bit integer)
+ <dd>These values are the sizes of the dimensions of the
+ embedded dataspace
+ that the dataset is located within.
+ <dt>Embedded Origin Location: (unsigned 32-bit integer)
+ <dd>These values comprise the location of the dataset&rsquo;s
+ origin within the embedded dataspace.
+ </dl>
+ </dl>
+ [Comment: need some way to handle different orientations of the
+ dataset dataspace
+ within the embedded dataspace]<br />
+
+ <br />
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Structured/Regular Grid Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4">Logical Dimension Size #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimension Maximum #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimension Size #n</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimension Maximum #n</td>
+ </tr>
+ </table>
+ </center>
+
+ <br />
+ <dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Logical Dimension Size #n: (unsigned 32-bit integer)
+ <dd>This value is the current size of the dimension of the
+ data as stored in
+ the file. The first dimension stored in the list of
+ dimensions is the slowest
+ changing dimension and the last dimension stored is the
+ fastest changing
+ dimension.
+ <dt>Logical Dimension Maximum #n: (unsigned 32-bit integer)
+ <dd>This value is the maximum size of the dimension of the
+ data as stored in
+ the file. This value may be the special value
+ &lt;UNLIMITED&gt; which
+ indicates that the data may expand along this dimension
+ indefinitely.
+ </dl>
+ </dl>
+ <br />
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Structured/Irregular Grid Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4"># of Grid Points in Dimension #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4"># of Grid Points in Dimension #n</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Datatype of Grid Point Locations</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Location of Grid Points in Dimension #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Location of Grid Points in Dimension #n</td>
+ </tr>
+ </table>
+ </center>
+
+ <br />
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Unstructured Grid Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4"># of Grid Points</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Datatype of Grid Point Locations</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Grid Point Locations<br />.<br />.<br /></td>
+ </tr>
+ </table>
+ </center>
+-->
+
+<br />
+<h4><a name="LinkInfoMessage">IV.A.2.c. The Link Info Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Link Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x002 </td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies </td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated. </td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The link info message tracks variable information about the
+ current state of the links for a &ldquo;new style&rdquo;
+ group&rsquo;s behavior. Variable information will be stored in
+ this message and constant information will be stored in the
+ <a href="#GroupInfoMessage">Group Info</a> message.
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Link Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Maximum Creation Index <em>(8 bytes, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of v2 B-tree for Name Index<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of v2 B-tree for Creation Order Index<sup>O</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This field determines various optional aspects of the link
+ info message:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, creation order for the links is tracked.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, creation order for the links is indexed.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Creation Index</p></td>
+ <td><p>This 64-bit value is the maximum creation order index value
+ stored for a link in this group.</p>
+ <p>This field is present if bit 0 of <em>flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Address</p></td>
+ <td>
+ <p>
+ This is the address of the fractal heap to store dense links.
+ Each link stored in the fractal heap is stored as a
+ <a href="#LinkMessage">Link Message</a>.
+ </p>
+ <p>
+ If there are no links in the group, or the group&rsquo;s links
+ are stored &ldquo;compactly&rdquo; (as object header messages), this
+ value will be the <a href="#UndefinedAddress">undefined
+ address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of v2 B-tree for Name Index</p></td>
+ <td><p>This is the address of the version 2 B-tree to index names of links.</p>
+ <p>If there are no links in the group, or the group&rsquo;s links
+ are stored &ldquo;compactly&rdquo; (as object header messages), this
+ value will be the <a href="#UndefinedAddress">undefined
+ address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of v2 B-tree for Creation Order Index</p></td>
+ <td><p>This is the address of the version 2 B-tree to index creation order of links.</p>
+ <p>If there are no links in the group, or the group&rsquo;s links
+ are stored &ldquo;compactly&rdquo; (as object header messages), this
+ value will be the <a href="#UndefinedAddress">undefined
+ address</a>.
+ </p>
+ <p>This field exists if bit 1 of <em>flags</em> is set.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+<br />
+<h4><a name="DatatypeMessage">IV.A.2.d. The Datatype Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Datatype</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0003
+ </td></tr>
+ <tr><td colspan="2"><b>Length:</b> Variable</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for dataset or committed
+ datatype (formerly named datatype) objects; may not be repeated.
+ </td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The datatype message defines the datatype for each element
+ of a dataset or a common datatype for sharing between multiple
+ datasets. A datatype can describe an atomic type like a fixed-
+ or floating-point type or more complex types like a C struct
+ (compound datatype), array (array datatype) or C++ vector
+ (variable-length datatype).</p>
+ <p>Datatype messages that are part of a dataset object do not
+ describe how elements are related to one another; the dataspace
+ message is used for that purpose. Datatype messages that are part of
+ a committed datatype (formerly named datatype) message describe
+ a common datatype that can be shared by multiple datasets in the
+ file.</p>
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Datatype Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Class and Version</td>
+ <td>Class Bit Field, Bits 0-7</td>
+ <td>Class Bit Field, Bits 8-15</td>
+ <td>Class Bit Field, Bits 16-23</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Properties<br /><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Class and Version</p></td>
+ <td>
+ <p>The version of the datatype message and the datatype&rsquo;s class
+ information are packed together in this field. The version
+ number is packed in the top 4 bits of the field and the class
+ is contained in the bottom 4 bits.
+ </p>
+ <p>The version number information is used for changes in the
+ format of the datatype message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by early versions of the library to encode
+ compound datatypes with explicit array fields.
+ See the compound datatype description below for
+ further details.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used when an array datatype needs to be encoded.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used when a VAX byte-ordered type needs to be
+ encoded. Packs various other datatype classes more
+ efficiently also.
+ </td>
+ </tr>
+ </table></p>
+
+ <p>The class of the datatype determines the format for the class
+ bit field and properties portion of the datatype message, which
+ are described below. The
+ following classes are currently defined:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Fixed-Point</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Floating-Point</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Time</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>String</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>Bit field</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>Opaque</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td>Compound</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>7</code></td>
+ <td>Reference</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>8</code></td>
+ <td>Enumerated</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>9</code></td>
+ <td>Variable-Length</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>10</code></td>
+ <td>Array</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Class Bit Fields</p></td>
+ <td>
+ <p>The information in these bit fields is specific to each datatype
+ class and is described below. All bits not defined for a
+ datatype class are set to zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>The size of a datatype element in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Properties</p></td>
+ <td>
+ <p>This variable-sized sequence of bytes encodes information
+ specific to each datatype class and is described for each class
+ below. If there is no property information specified for a
+ datatype class, the size of this field is zero bytes.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Fixed-Point Numbers (Class 0):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fixed-point Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0</p></td>
+ <td><p><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>1, 2</p></td>
+ <td><p><b>Padding type.</b> Bit 1 is the lo_pad bit and bit 2
+ is the hi_pad bit. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>3</p></td>
+ <td><p><b>Signed.</b> If this bit is set then the fixed-point
+ number is in 2&rsquo;s complement form.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>4-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fixed-Point Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Offset</td>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Offset</p></td>
+ <td>
+ <p>The bit offset of the first significant bit of the fixed-point
+ value within the datatype. The bit offset specifies the number
+ of bits &ldquo;to the right of&rdquo; the value (which are set to the
+ lo_pad bit value).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the fixed-point value
+ within the datatype. This value, combined with the datatype
+ element&rsquo;s size and the Bit Offset field specifies the number
+ of bits &ldquo;to the left of&rdquo; the value (which are set to the
+ hi_pad bit value).
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Floating-Point Numbers (Class 1):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Floating-Point Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0, 6</p></td>
+ <td><p><b>Byte Order.</b> These two non-contiguous bits specify the
+ &ldquo;endianness&rdquo; of the bytes in the datatype element.
+ <table class="list">
+ <tr>
+ <th width="10%" align="center">Bit 6</th>
+ <th width="10%" align="center">Bit 0</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td align="center"><code>0</code></td>
+ <td>Byte order is little-endian
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td align="center"><code>1</code></td>
+ <td>Byte order is big-endian
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td align="center"><code>0</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td align="center"><code>1</code></td>
+ <td>Byte order is VAX-endian
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>1, 2, 3</p></td>
+ <td><p><b>Padding type.</b> Bit 1 is the low bits pad type, bit 2
+ is the high bits pad type, and bit 3 is the internal bits
+ pad type. If a datum has unused bits at either end or between
+ the sign bit, exponent, or mantissa, then the value of bit
+ 1, 2, or 3 is copied to those locations.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>4-5</p></td>
+ <td><p><b>Mantissa Normalization.</b> This 2-bit bit field specifies
+ how the most significant bit of the mantissa is managed.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>No normalization
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The most significant bit of the mantissa is always set
+ (except for 0.0).
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>The most significant bit of the mantissa is not stored,
+ but is implied to be set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>7</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+
+ <tr>
+ <td><p>8-15</p></td>
+ <td><p><b>Sign Location.</b> This is the bit position of the sign
+ bit. Bits are numbered with the least significant bit zero.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>16-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Floating-Point Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Offset</td>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+
+ <tr>
+ <td>Exponent Location</td>
+ <td>Exponent Size</td>
+ <td>Mantissa Location</td>
+ <td>Mantissa Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Exponent Bias</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Offset</p></td>
+ <td>
+ <p>The bit offset of the first significant bit of the floating-point
+ value within the datatype. The bit offset specifies the number
+ of bits &ldquo;to the right of&rdquo; the value.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the floating-point value
+ within the datatype.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Exponent Location</p></td>
+ <td>
+ <p>The bit position of the exponent field. Bits are numbered with
+ the least significant bit number zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Exponent Size</p></td>
+ <td>
+ <p>The size of the exponent field in bits.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Mantissa Location</p></td>
+ <td>
+ <p>The bit position of the mantissa field. Bits are numbered with
+ the least significant bit number zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Mantissa Size</p></td>
+ <td>
+ <p>The size of the mantissa field in bits.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Exponent Bias</p></td>
+ <td>
+ <p>The bias of the exponent field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Time (Class 2):</p>
+
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Time Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0</p></td>
+ <td><p><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>1-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Time Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the time value.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Strings (Class 3):</p>
+
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ String Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-3</p></td>
+ <td><p><b>Padding type.</b> This four-bit value determines the
+ type of padding to use for the string. The values are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Null Terminate: A zero byte marks the end of the
+ string and is guaranteed to be present after
+ converting a long string to a short string. When
+ converting a short string to a long string the value is
+ padded with additional null characters as necessary.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Null Pad: Null characters are added to the end of
+ the value during conversions from short values to long
+ values but conversion in the opposite direction simply
+ truncates the value.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Space Pad: Space characters are added to the end of
+ the value during conversions from short values to long
+ values but conversion in the opposite direction simply
+ truncates the value. This is the Fortran
+ representation of the string.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>4-7</p></td>
+ <td><p><b>Character Set.</b> The character set used to
+ encode the string.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>8-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <p>There are no properties defined for the string class.
+ </p>
+
+
+ <p>Class specific information for bit fields (Class 4):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bitfield Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0</p></td>
+ <td><p><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>1, 2</p></td>
+ <td><p><b>Padding type.</b> Bit 1 is the lo_pad type and bit 2
+ is the hi_pad type. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>3-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Bit Field Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Offset</td>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Offset</p></td>
+ <td>
+ <p>The bit offset of the first significant bit of the bit field
+ within the datatype. The bit offset specifies the number
+ of bits &ldquo;to the right of&rdquo; the value.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the bit field
+ within the datatype.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Opaque (Class 5):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Opaque Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-7</p></td>
+ <td><p>Length of ASCII tag in bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>8-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Opaque Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />ASCII Tag<br />
+ <br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>ASCII Tag</p></td>
+ <td>
+ <p>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Compound (Class 6):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Compound Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-15</p></td>
+ <td><p><b>Number of Members.</b> This field contains the number
+ of members defined for the compound datatype. The member
+ definitions are listed in the Properties field of the data
+ type message.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>16-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <p>The Properties field of a compound datatype is a list of the
+ member definitions of the compound datatype. The member
+ definitions appear one after another with no intervening bytes.
+ The member types are described with a (recursively) encoded datatype
+ message.</p>
+
+ <p>Note that the property descriptions are different for different
+ versions of the datatype version. Additionally note that the version
+ 0 datatype encoding is deprecated and has been replaced with later
+ encodings in versions of the HDF5 Library from the 1.4 release
+ onward.</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Compound Properties Description for Datatype Version 1
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Byte Offset of Member</td>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension Permutation</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #1 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #2 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #3 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #4 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Member Type Message<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td>
+ <p>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Byte Offset of Member</p></td>
+ <td>
+ <p>This is the byte offset of the member within the datatype.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>If set to zero, this field indicates a scalar member. If set
+ to a value greater than zero, this field indicates that the
+ member is an array of values. For array members, the size of
+ the array is indicated by the &lsquo;Size of Dimension n&rsquo; field in
+ this message.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension Permutation</p></td>
+ <td>
+ <p>This field was intended to allow an array field to have
+ its dimensions permuted, but this was never implemented.
+ This field should always be set to zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This field is the size of a dimension of the array field as
+ stored in the file. The first dimension stored in the list of
+ dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Member Type Message</p></td>
+ <td>
+ <p>This field is a datatype message describing the datatype of
+ the member.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Compound Properties Description for Datatype Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Byte Offset of Member</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Member Type Message<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td>
+ <p>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Byte Offset of Member</p></td>
+ <td>
+ <p>This is the byte offset of the member within the datatype.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Member Type Message</p></td>
+ <td>
+ <p>This field is a datatype message describing the datatype of
+ the member.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Compound Properties Description for Datatype Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Byte Offset of Member <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Member Type Message<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>This NUL-terminated string provides a description for the
+ opaque type. It is <em>not</em> NUL-padded to a multiple of 8
+ bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Byte Offset of Member</p></td>
+ <td><p>This is the byte offset of the member within the datatype.
+ The field size is the minimum number of bytes necessary,
+ based on the size of the datatype element. For example, a
+ datatype element size of less than 256 bytes uses a 1 byte
+ length, a datatype element size of 256-65535 bytes uses a
+ 2 byte length, and so on.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Member Type Message</p></td>
+ <td><p>This field is a datatype message describing the datatype of
+ the member.</p></td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Reference (Class 7):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Reference Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-3</p></td>
+ <td><p><b>Type.</b> This four-bit value contains the type of reference
+ described. The values defined are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Object Reference: A reference to another object in this
+ HDF5 file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Dataset Region Reference: A reference to a region within
+ a dataset in this HDF5 file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>4-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <p>There are no properties defined for the reference class.
+ </p>
+
+
+ <br />
+ <p>Class specific information for Enumeration (Class 8):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Enumeration Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-15</p></td>
+ <td><p><b>Number of Members.</b> The number of name/value
+ pairs defined for the enumeration type.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>16-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Enumeration Property Description for Datatype Versions 1 & 2
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Names<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Values<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each enumeration type is based on some parent type, usually an
+ integer. The information for that parent type is described
+ recursively by this field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Names</p></td>
+ <td>
+ <p>The name for each name/value pair. Each name is stored as a null
+ terminated ASCII string in a multiple of eight bytes. The names
+ are in no particular order.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Values</p></td>
+ <td>
+ <p>The list of values in the same order as the names. The values
+ are packed (no inter-value padding) and the size of each value
+ is determined by the parent type.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Enumeration Property Description for Datatype Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Names<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Values<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each enumeration type is based on some parent type, usually an
+ integer. The information for that parent type is described
+ recursively by this field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Names</p></td>
+ <td>
+ <p>The name for each name/value pair. Each name is stored as a null
+ terminated ASCII string, <em>not</em> padded to a multiple of
+ eight bytes. The names are in no particular order.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Values</p></td>
+ <td>
+ <p>The list of values in the same order as the names. The values
+ are packed (no inter-value padding) and the size of each value
+ is determined by the parent type.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+
+ <br />
+ <p>Class specific information for Variable-Length (Class 9):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Variable-Length Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-3</p></td>
+ <td><p><b>Type.</b> This four-bit value contains the type of
+ variable-length datatype described. The values defined are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Sequence: A variable-length sequence of any datatype.
+ Variable-length sequences do not have padding or
+ character set information.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>String: A variable-length sequence of characters.
+ Variable-length strings have padding and character set
+ information.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>4-7</p></td>
+ <td><p><b>Padding type.</b> (variable-length string only)
+ This four-bit value determines the type of padding
+ used for variable-length strings. The values are the same
+ as for the string padding type, as follows:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Null terminate: A zero byte marks the end of a string
+ and is guaranteed to be present after converting a long
+ string to a short string. When converting a short string
+ to a long string, the value is padded with additional null
+ characters as necessary.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Null pad: Null characters are added to the end of the
+ value during conversion from a short string to a longer
+ string. Conversion from a long string to a shorter string
+ simply truncates the value.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Space pad: Space characters are added to the end of the
+ value during conversion from a short string to a longer
+ string. Conversion from a long string to a shorter string
+ simply truncates the value. This is the Fortran
+ representation of the string.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This value is set to zero for variable-length sequences.</p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>8-11</p></td>
+ <td><p><b>Character Set.</b> (variable-length string only)
+ This four-bit value specifies the character set
+ to be used for encoding the string:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This value is set to zero for variable-length sequences.</p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>12-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Variable-Length Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="10%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each variable-length type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class specific information for Array (Class 10):</p>
+
+ <p>There are no bit fields defined for the array class.
+ </p>
+
+ <p>Note that the dimension information defined in the property for this
+ datatype class is independent of dataspace information for a dataset.
+ The dimension information here describes the dimensionality of the
+ information within a data element (or a component of an element, if the
+ array datatype is nested within another datatype) and the dataspace for a
+ dataset describes the size and locations of the elements in a dataset.
+ </p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Array Property Description for Datatype Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #1 Size</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Permutation Index #1</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Permutation Index #n</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the array has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the size of the dimension of the array
+ as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Permutation Index #n</p></td>
+ <td>
+ <p>This value is the index permutation used to map
+ each dimension from the canonical representation to an
+ alternate axis for each dimension. Currently, dimension
+ permutations are not supported, and these indices should
+ be set to the index position minus one. In other words,
+ the first dimension should be set to 0, the second dimension
+ should be set to 1, and so on.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each array type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Array Property Description for Datatype Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #1 Size</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the array has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the size of the dimension of the array
+ as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each array type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+
+<br />
+<h4><a name="OldFillValueMessage">IV.A.2.e. The Data Storage -
+Fill Value (Old) Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Fill Value
+ (old)</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0004</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The fill value message stores a single data value which
+ is returned to the application when an uninitialized data element
+ is read from a dataset. The fill value is interpreted with the
+ same datatype as the dataset. If no fill value message is present
+ then a fill value of all zero bytes is assumed.</p>
+ <p>This fill value message is deprecated in favor of the
+ &ldquo;new&rdquo; fill value message (Message Type 0x0005) and
+ is only written to the file for forward compatibility with
+ versions of the HDF5 Library before the 1.6.0 version.
+ Additionally, it only appears for datasets with a user-defined
+ fill value (as opposed to the library default fill value or an
+ explicitly set &ldquo;undefined&rdquo; fill value).</p>
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fill Value Message (Old)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fill Value <em>(optional, variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>This is the size of the Fill Value field in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value</p></td>
+ <td>
+ <p>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+<br />
+<h4><a name="FillValueMessage">IV.A.2.f. The Data Storage -
+Fill Value Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Fill
+ Value</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0005</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for dataset objects;
+ may not be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The fill value message stores a single data value which is
+ returned to the application when an uninitialized data element
+ is read from a dataset. The fill value is interpreted with the
+ same datatype as the dataset.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fill Value Message - Versions 1 & 2
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Space Allocation Time</td>
+ <td>Fill Value Write Time</td>
+ <td>Fill Value Defined</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fill Value <em>(optional, variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the
+ format of the fill value message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Initial version of this message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>In this version, the Size and Fill Value fields are
+ only present if the Fill Value Defined field is set
+ to 1.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>This version packs the other fields in the message
+ more efficiently than version 2.
+ </td>
+ </tr>
+ </table></p>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Space Allocation Time</p></td>
+ <td>
+ <p>When the storage space for the dataset&rsquo;s raw data will be
+ allocated. The allowed values are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Not used.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Early allocation. Storage space for the entire dataset
+ should be allocated in the file when the dataset is
+ created.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Late allocation. Storage space for the entire dataset
+ should not be allocated until the dataset is written
+ to.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Incremental allocation. Storage space for the
+ dataset should not be allocated until the portion
+ of the dataset is written to. This is currently
+ used in conjunction with chunked data storage for
+ datasets.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value Write Time</p></td>
+ <td>
+ <p>At the time that storage space for the dataset&rsquo;s raw data is
+ allocated, this value indicates whether the fill value should
+ be written to the raw data storage elements. The allowed values
+ are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>On allocation. The fill value is always written to
+ the raw data storage when the storage space is allocated.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Never. The fill value should never be written to
+ the raw data storage.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Fill value written if set by user. The fill value
+ will be written to the raw data storage when the storage
+ space is allocated only if the user explicitly set
+ the fill value. If the fill value is the library
+ default or is undefined, it will not be written to
+ the raw data storage.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value Defined</p></td>
+ <td>
+ <p>This value indicates if a fill value is defined for this
+ dataset. If this value is 0, the fill value is undefined.
+ If this value is 1, a fill value is defined for this dataset.
+ For version 2 or later of the fill value message, this value
+ controls the presence of the Size and Fill Value fields.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>This is the size of the Fill Value field in bytes. This field
+ is not present if the Version field is greater than 1,
+ and the Fill Value Defined field is set to 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value</p></td>
+ <td>
+ <p>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset. This field is
+ not present if the Version field is greater than 1,
+ and the Fill Value Defined field is set to 0.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Fill Value Message - Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fill Value <em>(optional, variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the
+ format of the fill value message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Initial version of this message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>In this version, the Size and Fill Value fields are
+ only present if the Fill Value Defined field is set
+ to 1.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>This version packs the other fields in the message
+ more efficiently than version 2.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>When the storage space for the dataset&rsquo;s raw data will be
+ allocated. The allowed values are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bits</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0-1</code></td>
+ <td>Space Allocation Time, with the same
+ values as versions 1 and 2 of the message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-3</code></td>
+ <td>Fill Value Write Time, with the same
+ values as versions 1 and 2 of the message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>Fill Value Undefined, indicating that the fill
+ value has been marked as &ldquo;undefined&rdquo; for this dataset.
+ Bits 4 and 5 cannot both be set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>Fill Value Defined, with the same values as
+ versions 1 and 2 of the message.
+ Bits 4 and 5 cannot both be set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>Reserved (zero).
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>This is the size of the Fill Value field in bytes. This field
+ is not present if the Version field is greater than 1,
+ and the Fill Value Defined flag is set to 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value</p></td>
+ <td>
+ <p>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset. This field is
+ not present if the Version field is greater than 1,
+ and the Fill Value Defined flag is set to 0.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+<br />
+<h4><a name="LinkMessage">IV.A.2.g. The Link Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Link</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0006</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies </td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be
+ repeated. </td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>This message encodes the information for a link in a
+ group&rsquo;s object header, when the group is storing its links
+ &ldquo;compactly&rdquo;, or in the group&rsquo;s fractal heap,
+ when the group is storing its links &ldquo;densely&rdquo;.</p>
+ <p>A group is storing its links compactly when the fractal heap
+ address in the <em><a href="#LinkInfoMessage">Link Info
+ Message</a></em> is set to the &ldquo;undefined address&rdquo;
+ value.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Link Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td>Link type <em>(optional)</em></td>
+ <td bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Creation Order <em>(8 bytes, optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td>Link Name Character Set <em>(optional)</em></td>
+ <td>Length of Link Name (variable size)</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Link Name (variable size)</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Link Information (variable size)<br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes version 1.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This field contains information about the link and controls
+ the presence of other fields below.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bits</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0-1</code></td>
+ <td>Determines the size of the <em>Length of Link Name</em>
+ field.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 1 byte.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 2 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 4 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 8 bytes.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Creation Order Field Present: if set, the <em>Creation
+ Order</em> field is present. If not set, creation order
+ information is not stored for links in this group.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Link Type Field Present: if set, the link is not
+ a hard link and the <em>Link Type</em> field is present.
+ If not set, the link is a hard link.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>Link Name Character Set Field Present: if set, the
+ link name is not represented with the ASCII character
+ set and the <em>Link Name Character Set</em> field is
+ present. If not set, the link name is represented with
+ the ASCII character set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5-7</code></td>
+ <td>Reserved (zero).
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link type</p></td>
+ <td><p>This is the link class type and can be one of the following
+ values:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>A hard link (should never be stored in the file)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>A soft link.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-63</code></td>
+ <td>Reserved for future HDF5 internal use.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>64</code></td>
+ <td>An external link.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>65-255</code></td>
+ <td>Reserved, but available for user-defined link types.
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This field is present if bit 3 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td><p>This 64-bit value is an index of the link&rsquo;s creation time within
+ the group. Values start at 0 when the group is created an increment
+ by one for each link added to the group. Removing a link from a
+ group does not change existing links&rsquo; creation order field.
+ </p>
+ <p>This field is present if bit 2 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link Name Character Set</p></td>
+ <td><p>This is the character set for encoding the link&rsquo;s name:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding (this should never be stored
+ in the file)
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This field is present if bit 4 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Length of link name</p></td>
+ <td><p>This is the length of the link&rsquo;s name. The size of this field
+ depends on bits 0 and 1 of <em>Flags</em>.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link name</p></td>
+ <td><p>This is the name of the link, non-NULL terminated.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link information</p></td>
+ <td><p>The format of this field depends on the <em>link type</em>.</p>
+ <p>For <b>hard</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%"><i>Size of Offsets</i> bytes:</td>
+ <td width="80%">The address of the object header for the object that the
+ link points to.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+ <p>
+ For <b>soft</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-2:</td>
+ <td width="80%">Length of soft link value.</td>
+ </tr>
+ <tr>
+ <td><em>Length of soft link value</em> bytes:</td>
+ <td>A non-NULL-terminated string storing the value of the
+ soft link.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+ <p>
+ For <b>external</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-2:</td>
+ <td width="80%">Length of external link value.</td>
+ </tr>
+ <tr>
+ <td><em>Length of external link value</em> bytes:</td>
+ <td>The first byte contains the version number in the
+ upper 4 bits and flags in the lower 4 bits for the external
+ link. Both version and flags are defined to be zero in
+ this document. The remaining bytes consist of two
+ NULL-terminated strings, with no padding between them.
+ The first string is the name of the HDF5 file containing
+ the object linked to and the second string is the full path
+ to the object linked to, within the HDF5 file&rsquo;s
+ group hierarchy.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+ <p>
+ For <b>user-defined</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-2:</td>
+ <td width="80%">Length of user-defined data.</td>
+ </tr>
+ <tr>
+ <td><em>Length of user-defined link value</em> bytes:</td>
+ <td>The data supplied for the user-defined link type.</td>
+ </tr>
+ </table>
+ </p>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="ExternalFileListMessage">IV.A.2.h. The Data Storage -
+External Data Files Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> External
+ Data Files</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0007</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The external data storage message indicates that the data
+ for an object is stored outside the HDF5 file. The filename of
+ the object is stored as a Universal Resource Location (URL) of
+ the actual filename containing the data. An external file list
+ record also contains the byte offset of the start of the data
+ within the file and the amount of space reserved in the file
+ for that data.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ External File List Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Allocated Slots</td>
+ <td colspan="2">Used Slots</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Slot Definitions...<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the format of
+ External Data Storage Message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The current version used by the library.</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Allocated Slots</p></td>
+ <td>
+ <p>The total number of slots allocated in the message. Its value must be at least as
+ large as the value contained in the Used Slots field. (The current library simply
+ uses the number of Used Slots for this message)</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Used Slots</p></td>
+ <td>
+ <p>The number of initial slots which contains valid information.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap Address</p></td>
+ <td>
+ <p>This is the address of a local heap which contains the names for the external
+ files (The local heap information can be found in Disk Format Level 1D in this
+ document). The name at offset zero in the heap is always the empty string.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Slot Definitions</p></td>
+ <td>
+ <p>The slot definitions are stored in order according to the array addresses they
+ represent.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ External File List Slot
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name Offset in Local Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset in External Data File<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Size in External File<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name Offset in Local Heap</p></td>
+ <td>
+ <p>The byte offset within the local name heap for the name
+ of the file. File names are stored as a URL which has a
+ protocol name, a host name, a port number, and a file
+ name:
+ <code><em>protocol</em>:<em>port</em>//<em>host</em>/<em>file</em></code>.
+ If the protocol is omitted then &ldquo;file:&rdquo; is assumed. If
+ the port number is omitted then a default port for that
+ protocol is used. If both the protocol and the port
+ number are omitted then the colon can also be omitted. If
+ the double slash and host name are omitted then
+ &ldquo;localhost&rdquo; is assumed. The file name is the only
+ mandatory part, and if the leading slash is missing then
+ it is relative to the application&rsquo;s current working
+ directory (the use of relative names is not
+ recommended).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset in External Data File</p></td>
+ <td>
+ <p>This is the byte offset to the start of the data in the
+ specified file. For files that contain data for a single
+ dataset this will usually be zero.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Size in External File</p></td>
+ <td>
+ <p>This is the total number of bytes reserved in the
+ specified file for raw data storage. For a file that
+ contains exactly one complete dataset which is not
+ extendable, the size will usually be the exact size of the
+ dataset. However, by making the size larger one allows
+ HDF5 to extend the dataset. The size can be set to a value
+ larger than the entire file since HDF5 will read zeroes
+ past the end of the file without failing.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+<br />
+<h4><a name="LayoutMessage">IV.A.2.i. The Data Storage - Layout
+Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Data Storage -
+ Layout</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0008</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for datasets; may not
+ be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>Data layout describes how the elements of a multi-dimensional
+ array are stored in the HDF5 file. Three types of data layout
+ are supported:
+ <ol>
+ <li>Contiguous: The array is stored in one contiguous area of
+ the file. This layout requires that the size of the array be
+ constant: data manipulations such as chunking, compression,
+ checksums, or encryption are not permitted. The message stores
+ the total storage size of the array. The offset of an element
+ from the beginning of the storage area is computed as in a C
+ array.</li>
+ <li>Chunked: The array domain is regularly decomposed into
+ chunks, and each chunk is allocated and stored separately. This
+ layout supports arbitrary element traversals, compression,
+ encryption, and checksums. (these features are described
+ in other messages). The message stores the size of a chunk
+ instead of the size of the entire array; the storage size of
+ the entire array can be calculated by traversing the B-tree
+ that stores the chunk addresses.</li>
+ <li>Compact: The array is stored in one contiguous block, as
+ part of this object header message.</li>
+ </ol></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Data Layout Message (Versions 1 and 2)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Layout Class</td>
+ <td>Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Address<sup>O</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 0 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 1 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dataset Element Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Compact Data Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Compact Data... <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the format of the data
+ layout message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by version 1.4 and before of the library to encode layout information.
+ Data space is always allocated when the data set is created.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used by version 1.6.x of the library to encode layout information.
+ Data space is allocated only when it is necessary.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td><p>An array has a fixed dimensionality. This field
+ specifies the number of dimension size fields later in the
+ message. The value stored for chunked storage is 1 greater than
+ the number of dimensions in the dataset&rsquo;s dataspace.
+ For example, 2 is stored for a 1 dimensional dataset.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Layout Class</p></td>
+ <td><p>The layout class specifies the type of storage for the data
+ and how the other fields of the layout message are to be
+ interpreted.
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Compact Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Contiguous Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Chunked Storage
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Address</p></td>
+ <td><p>For contiguous storage, this is the address of the raw
+ data in the file. For chunked storage this is the address
+ of the v1 B-tree that is used to look up the addresses of the
+ chunks. This field is not present for compact storage.
+ If the version for this message is greater than 1, the address
+ may have the &ldquo;undefined address&rdquo; value, to indicate that
+ storage has not yet been allocated for this array.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td><p>For contiguous and compact storage the dimensions define
+ the entire size of the array while for chunked storage they define
+ the size of a single chunk. In all cases, they are in units of
+ array elements (not bytes). The first dimension stored in the list
+ of dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataset Element Size</p></td>
+ <td><p>The size of a dataset element, in bytes. This field is only
+ present for chunked storage.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Compact Data Size</p></td>
+ <td><p>This field is only present for compact data storage.
+ It contains the size of the raw data for the dataset array, in
+ bytes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Compact Data</p></td>
+ <td><p>This field is only present for compact data storage.
+ It contains the raw data for the dataset array.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <p>Version 3 of this message re-structured the format into specific
+ properties that are required for each layout class.</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ <b>Data Layout Message (Version 3)</b>
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Layout Class</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Properties <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the format of layout message
+ and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used by the version 1.6.3 and later of the library to store properties
+ for each layout class.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Layout Class</p></td>
+ <td><p>The layout class specifies the type of storage for the data
+ and how the other fields of the layout message are to be
+ interpreted.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Compact Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Contiguous Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Chunked Storage
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Properties</p></td>
+ <td><p>This variable-sized field encodes information specific to each
+ layout class and is described below. If there is no property
+ information specified for a layout class, the size of this field
+ is zero bytes.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <p>Class-specific information for compact layout (Class 0): (Note: The dimensionality information
+ is in the Dataspace message)</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Compact Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Size</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Raw Data... <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td><p>This field contains the size of the raw data for the dataset
+ array, in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Raw Data</p></td>
+ <td><p>This field contains the raw data for the dataset array.</p></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class-specific information for contiguous layout (Class 1): (Note: The dimensionality information
+ is in the Dataspace message)</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Contiguous Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This is the address of the raw data in the file.
+ The address may have the &ldquo;undefined address&rdquo; value, to indicate
+ that storage has not yet been allocated for this array.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td><p>This field contains the size allocated to store the raw data,
+ in bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class-specific information for chunked layout (Class 2):</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Chunked Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 0 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 1 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dataset Element Size</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td><p>A chunk has a fixed dimensionality. This field specifies
+ the number of dimension size fields later in the message.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This is the address of the v1 B-tree that is used to look up the
+ addresses of the chunks that actually store portions of the array
+ data. The address may have the &ldquo;undefined address&rdquo; value, to
+ indicate that storage has not yet been allocated for this array.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td><p>These values define the dimension size of a single chunk, in
+ units of array elements (not bytes). The first dimension stored in
+ the list of dimensions is the slowest changing dimension and the
+ last dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataset Element Size</p></td>
+ <td><p>The size of a dataset element, in bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="BogusMessage">IV.A.2.j. The Bogus Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Bogus</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0009</td></tr>
+ <tr><td colspan="2"><b>Length:</b> 4 bytes</td></tr>
+ <tr><td colspan="2"><b>Status:</b> For testing only; should never
+ be stored in a valid file.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message is used for testing the HDF5 Library&rsquo;s
+ response to an &ldquo;unknown&rdquo; message type and should
+ never be encountered in a valid HDF5 file.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Bogus Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Bogus Value</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bogus Value</p></td>
+ <td>
+ <p>This value should always be: <code>0xdeadbeef</code>.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="GroupInfoMessage">IV.A.2.k. The Group Info Message
+</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Group Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000A</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>This message stores information for the constants defining
+ a &ldquo;new style&rdquo; group&rsquo;s behavior. Constant
+ information will be stored in this message and variable
+ information will be stored in the
+ <a href="#LinkInfoMessage">Link Info</a> message.</p>
+ <p>Note: the &ldquo;estimated entry&rdquo; information below is
+ used when determining the size of the object header for the
+ group when it is created.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Group Info Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Link Phase Change: Maximum Compact Value <em>(optional)</em></td>
+ </tr>
+ <tr>
+ <td colspan="2">Link Phase Change: Minimum Dense Value <em>(optional)</em></td>
+ <td colspan="2">Estimated Number of Entries <em>(optional)</em></td>
+ </tr>
+ <tr>
+ <td colspan="2">Estimated Link Name Length of Entries <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This is the group information flag with the following definition:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, link phase change values are stored.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the estimated entry information is non-default
+ and is stored.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link Phase Change: Maximum Compact Value</p></td>
+ <td><p>The is the maximum number of links to store &ldquo;compactly&rdquo; (in
+ the group&rsquo;s object header).</p>
+ <p>This field is present if bit 0 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link Phase Change: Minimum Dense Value</p></td>
+ <td><p>This is the minimum number of links to store &ldquo;densely&rdquo; (in
+ the group&rsquo;s fractal heap). The fractal heap&rsquo;s address is
+ located in the <a href="#LinkInfoMessage">Link Info</a>
+ message.</p>
+ <p>This field is present if bit 0 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Estimated Number of Entries</p></td>
+ <td><p>This is the estimated number of entries in groups.</p>
+ <p>If this field is not present, the default value of <code>4</code>
+ will be used for the estimated number of group entries.</p>
+ <p>This field is present if bit 1 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Estimated Link Name Length of Entries</p></td>
+ <td><p>This is the estimated length of entry name.</p>
+ <p>If this field is not present, the default value of <code>8</code>
+ will be used for the estimated link name length of group entries.</p>
+ <p>This field is present if bit 1 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </p>
+
+<br />
+<h4><a name="FilterMessage">IV.A.2.l. The Data Storage - Filter
+Pipeline Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b>
+ Data Storage - Filter Pipeline</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000B</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>This message describes the filter pipeline which should
+ be applied to the data stream by providing filter identification
+ numbers, flags, a name, and client data.</p>
+ <p>This message may be present in the object headers of both
+ dataset and group objects. For datasets, it specifies the
+ filters to apply to raw data. For groups, it specifies the
+ filters to apply to the group&rsquo;s fractal heap. Currently,
+ only datasets using chunked data storage use the filter
+ pipeline on their raw data.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Filter Pipeline Message - Version 1
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Number of Filters</td>
+ <td colspan="2">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filter Description List <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This table
+ describes version 1.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Filters</p></td>
+ <td><p>The total number of filters described in this
+ message. The maximum possible number of filters in a
+ message is 32.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Description List</p></td>
+ <td><p>A description of each filter. A filter description
+ appears in the next table.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Filter Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Filter Identification Value</td>
+ <td colspan="2">Name Length</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Flags</td>
+ <td colspan="2">Number Client Data Values</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Client Data <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Padding <em>(variable size, optional)</em></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filter Identification Value</p></td>
+ <td>
+ <p>
+ This value, often referred to as a filter identifier,
+ is designed to be a unique identifier for the filter.
+ Values from zero through 32,767 are reserved for filters
+ supported by The HDF Group in the HDF5 Library and for
+ filters requested and supported by third parties.
+ Filters supported by The HDF Group are documented immediately
+ below. Information on 3rd-party filters can be found at
+ The HDF Group&rsquo;s
+ <a href="http://www.hdfgroup.org/services/contributions.html">
+ Contributions</a> page.</p>
+
+ <p>
+ To request a filter identifier, please contact
+ The HDF Group&rsquo;s Help Desk at
+ <img src="Graphics/help.png" valign="middle" height="14"
+ alt="The HDF Group Help Desk">.
+ You will be asked to provide the following information:</p>
+ <ol>
+ <li>Contact information for the developer requesting the
+ new identifier</li>
+ <li>A short description of the new filter</li>
+ <li>Links to any relevant information, including licensing
+ information</li>
+ </ol>
+ <p>
+ Values from 32768 to 65535 are reserved for non-distributed uses
+ (for example, internal company usage) or for application usage
+ when testing a feature. The HDF Group does not track or document
+ the use of the filters with identifiers from this range.</p>
+
+ <p>
+ The filters currently in library version 1.8.0 are
+ listed below:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Identification</th>
+ <th width="15%" align="left">Name</th>
+ <th width="65%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>N/A</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>deflate</td>
+ <td>GZIP deflate compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>shuffle</td>
+ <td>Data element shuffling</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>fletcher32</td>
+ <td>Fletcher32 checksum</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>szip</td>
+ <td>SZIP compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>nbit</td>
+ <td>N-bit packing</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td>scaleoffset</td>
+ <td>Scale and offset encoded values</td>
+ </tr>
+ </table>
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name Length</p></td>
+ <td><p>Each filter has an optional null-terminated ASCII name
+ and this field holds the length of the name including the
+ null termination padded with nulls to be a multiple of
+ eight. If the filter has no name then a value of zero is
+ stored in this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>The flags indicate certain properties for a filter. The
+ bit values defined so far are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set then the filter is an optional filter.
+ During output, if an optional filter fails it will be
+ silently skipped in the pipeline.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1-15</code></td>
+ <td>Reserved (zero)</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Client Data Values</p></td>
+ <td><p>Each filter can store integer values to control
+ how the filter operates. The number of entries in the
+ <em>Client Data</em> array is stored in this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>If the <em>Name Length</em> field is non-zero then it will
+ contain the size of this field, padded to a multiple of eight. This
+ field contains a null-terminated, ASCII character
+ string to serve as a comment/name for the filter.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Client Data</p></td>
+ <td><p>This is an array of four-byte integers which will be
+ passed to the filter function. The <em>Client Data Number</em> of
+ Values determines the number of elements in the array.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Padding</p></td>
+ <td><p>Four bytes of zeroes are added to the message at this
+ point if the Client Data Number of Values field contains
+ an odd number.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Filter Pipeline Message - Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Number of Filters</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filter Description List <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This table
+ describes version 2.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Filters</p></td>
+ <td><p>The total number of filters described in this
+ message. The maximum possible number of filters in a
+ message is 32.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Description List</p></td>
+ <td><p>A description of each filter. A filter description
+ appears in the next table.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Filter Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Filter Identification Value</td>
+ <td colspan="2">Name Length <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Flags</td>
+ <td colspan="2">Number Client Data Values</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Client Data <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filter Identification Value</p></td>
+ <td>
+ <p>
+ This value, often referred to as a filter identifier,
+ is designed to be a unique identifier for the filter.
+ Values from zero through 32,767 are reserved for filters
+ supported by The HDF Group in the HDF5 Library and for
+ filters requested and supported by third parties.
+ Filters supported by The HDF Group are documented immediately
+ below. Information on 3rd-party filters can be found at
+ The HDF Group&rsquo;s
+ <a href="http://www.hdfgroup.org/services/contributions.html">
+ Contributions</a> page.</p>
+
+ <p>
+ To request a filter identifier, please contact
+ The HDF Group&rsquo;s Help Desk at
+ <img src="Graphics/help.png" valign="middle" height="14"
+ alt="The HDF Group Help Desk">.
+ You will be asked to provide the following information:</p>
+ <ol>
+ <li>Contact information for the developer requesting the
+ new identifier</li>
+ <li>A short description of the new filter</li>
+ <li>Links to any relevant information, including licensing
+ information</li>
+ </ol>
+ <p>
+ Values from 32768 to 65535 are reserved for non-distributed uses
+ (for example, internal company usage) or for application usage
+ when testing a feature. The HDF Group does not track or document
+ the use of the filters with identifiers from this range.</p>
+
+ <p>
+ The filters currently in library version 1.8.0 are
+ listed below:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Identification</th>
+ <th width="15%" align="left">Name</th>
+ <th width="65%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>N/A</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>deflate</td>
+ <td>GZIP deflate compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>shuffle</td>
+ <td>Data element shuffling</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>fletcher32</td>
+ <td>Fletcher32 checksum</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>szip</td>
+ <td>SZIP compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>nbit</td>
+ <td>N-bit packing</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td>scaleoffset</td>
+ <td>Scale and offset encoded values</td>
+ </tr>
+ </table>
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name Length</p></td>
+ <td><p>Each filter has an optional null-terminated ASCII name
+ and this field holds the length of the name including the
+ null termination padded with nulls to be a multiple of
+ eight. If the filter has no name then a value of zero is
+ stored in this field.</p>
+ <p>Filters with IDs less than 256 (in other words, filters
+ that are defined in this format documentation) do not store
+ the <em>Name Length</em> or <em>Name</em> fields.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>The flags indicate certain properties for a filter. The
+ bit values defined so far are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set then the filter is an optional filter.
+ During output, if an optional filter fails it will be
+ silently skipped in the pipeline.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1-15</code></td>
+ <td>Reserved (zero)</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Client Data Values</p></td>
+ <td><p>Each filter can store integer values to control
+ how the filter operates. The number of entries in the
+ <em>Client Data</em> array is stored in this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>If the <em>Name Length</em> field is non-zero then it will
+ contain the size of this field, <em>not</em> padded to a multiple
+ of eight. This field contains a <em>non-</em>null-terminated,
+ ASCII character string to serve as a comment/name for the filter.
+ </p>
+ <p>Filters that are defined in this format documentation
+ such as deflate and shuffle do not store the <em>Name
+ Length</em> or <em>Name</em> fields.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client Data</p></td>
+ <td><p>This is an array of four-byte integers which will be
+ passed to the filter function. The Client Data Number of
+ Values</em> determines the number of elements in the array.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="AttributeMessage">IV.A.2.m. The Attribute Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Attribute</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000C</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The <em>Attribute</em> message is used to store objects
+ in the HDF5 file which are used as attributes, or
+ &ldquo;metadata&rdquo; about the current object. An attribute
+ is a small dataset; it has a name, a datatype, a dataspace, and
+ raw data. Since attributes are stored in the object header, they
+ should be relatively small (in other words, less than 64KB).
+ They can be associated with any type of object which has an
+ object header (groups, datasets, or committed (named)
+ datatypes).</p>
+ <p>In 1.8.x versions of the library, attributes can be larger
+ than 64KB. See the
+ <a href="UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FAttributes%2FHDF5_Attributes.htm%3Frhtocid%3Dtoc8.2_1%23TOC_8_5_Special_Issuesbc-13">
+ &ldquo;Special Issues&rdquo;</a> section of the Attributes chapter
+ in the <cite>HDF5 User&rsquo;s Guide</cite> for more information.</p>
+ <p>Note: Attributes on an object must have unique names:
+ the HDF5 Library currently enforces this by causing the
+ creation of an attribute with a duplicate name to fail.
+ Attributes on different objects may have the same name,
+ however.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Attribute Message (Version 1)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Reserved (zero)</td>
+ <td colspan="2">Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Datatype Size</td>
+ <td colspan="2">Dataspace Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Datatype <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dataspace <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number information is used for changes in the format of the
+ attribute message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by the library before version 1.6 to encode attribute message.
+ This version does not support shared datatypes.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name Size</p></td>
+ <td><p>The length of the attribute name in bytes including the
+ null terminator. Note that the <em>Name</em> field below may
+ contain additional padding not represented by this
+ field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype Size</p></td>
+ <td><p>The length of the datatype description in the <em>Datatype</em>
+ field below. Note that the <em>Datatype</em> field may contain
+ additional padding not represented by this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Size</p></td>
+ <td><p>The length of the dataspace description in the <em>Dataspace</em>
+ field below. Note that the <em>Dataspace</em> field may contain
+ additional padding not represented by this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>The null-terminated attribute name. This field is
+ padded with additional null characters to make it a
+ multiple of eight bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype</p></td>
+ <td><p>The datatype description follows the same format as
+ described for the datatype object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace</p></td>
+ <td><p>The dataspace description follows the same format as
+ described for the dataspace object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td><p>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions. This
+ field is <em>not</em> padded with additional bytes.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Attribute Message (Version 2)
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Datatype Size</td>
+ <td colspan="2">Dataspace Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Datatype <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dataspace <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number information is used for changes in the
+ format of the attribute message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used by the library of version 1.6.x and after to encode
+ attribute messages.
+ This version supports shared datatypes. The fields of
+ name, datatype, and dataspace are not padded with
+ additional bytes of zero.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This bit field contains extra information about
+ interpreting the attribute message:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, datatype is shared.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, dataspace is shared.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name Size</p></td>
+ <td><p>The length of the attribute name in bytes including the
+ null terminator.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype Size</p></td>
+ <td><p>The length of the datatype description in the <em>Datatype</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Size</p></td>
+ <td><p>The length of the dataspace description in the <em>Dataspace</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>The null-terminated attribute name. This field is <em>not</em>
+ padded with additional bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype</p></td>
+ <td><p>The datatype description follows the same format as
+ described for the datatype object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s datatype is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the datatype encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace</p></td>
+ <td><p>The dataspace description follows the same format as
+ described for the dataspace object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s dataspace is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the dataspace encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td><p>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions.
+ </p>
+ <p>This field is <em>not</em> padded with additional zero bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Attribute Message (Version 3)
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Datatype Size</td>
+ <td colspan="2">Dataspace Size</td>
+ </tr>
+
+ <tr>
+ <td>Name Character Set Encoding</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Datatype <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dataspace <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number information is used for changes in the
+ format of the attribute message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used by the library of version 1.8.x and after to
+ encode attribute messages.
+ This version supports attributes with non-ASCII names.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This bit field contains extra information about
+ interpreting the attribute message:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, datatype is shared.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, dataspace is shared.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name Size</p></td>
+ <td><p>The length of the attribute name in bytes including the
+ null terminator.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype Size</p></td>
+ <td><p>The length of the datatype description in the <em>Datatype</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Size</p></td>
+ <td><p>The length of the dataspace description in the <em>Dataspace</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name Character Set Encoding</p></td>
+ <td><p>The character set encoding for the attribute&rsquo;s name:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>The null-terminated attribute name. This field is <em>not</em>
+ padded with additional bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype</p></td>
+ <td><p>The datatype description follows the same format as
+ described for the datatype object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s datatype is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the datatype encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace</p></td>
+ <td><p>The dataspace description follows the same format as
+ described for the dataspace object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s dataspace is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the dataspace encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td><p>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions.
+ </p>
+ <p>This field is <em>not</em> padded with additional zero bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="CommentMessage">IV.A.2.n. The Object Comment
+Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object
+ Comment</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000D</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The object comment is designed to be a short description of
+ an object. An object comment is a sequence of non-zero
+ (<code>\0</code>) ASCII characters with no other formatting
+ included by the library.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Name Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Comment <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>A null terminated ASCII character string.</p></td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="OldModificationTimeMessage">IV.A.2.o. The Object
+Modification Time (Old) Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object
+ Modification Time (Old)</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000E</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The object modification date and time is a timestamp
+ which indicates (using ISO-8601 date and time format) the last
+ modification of an object. The time is updated when any object
+ header message changes according to the system clock where the
+ change was posted. All fields of this message should be
+ interpreted as coordinated universal time (UTC).</p>
+ <p>This modification time message is deprecated in favor of
+ the &ldquo;new&rdquo; <a href="#ModificationTimeMessage">Object
+ Modification Time</a> message and is no longer written to the
+ file in versions of the HDF5 Library after the 1.6.0
+ version.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Modification Time Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Year</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Month</td>
+ <td colspan="2">Day of Month</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Hour</td>
+ <td colspan="2">Minute</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Second</td>
+ <td colspan="2">Reserved</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Year</p></td>
+ <td><p>The four-digit year as an ASCII string. For example,
+ <code>1998</code>.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Month</p></td>
+ <td><p>The month number as a two digit ASCII string where
+ January is <code>01</code> and December is <code>12</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Day of Month</p></td>
+ <td><p>The day number within the month as a two digit ASCII
+ string. The first day of the month is <code>01</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Hour</p></td>
+ <td><p>The hour of the day as a two digit ASCII string where
+ midnight is <code>00</code> and 11:00pm is <code>23</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Minute</p></td>
+ <td><p>The minute of the hour as a two digit ASCII string where
+ the first minute of the hour is <code>00</code> and
+ the last is <code>59</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Second</p></td>
+ <td><p>The second of the minute as a two digit ASCII string
+ where the first second of the minute is <code>00</code>
+ and the last is <code>59</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td><p>This field is reserved and should always be zero.</p></td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="SOHMTableMessage">IV.A.2.p. The Shared Message Table
+Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Shared Message
+ Table</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000F</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message is used to locate the table of shared object
+ header message (SOHM) indexes. Each index consists of information
+ to find the shared messages from either the heap or object header.
+ This message is <em>only</em> found in the superblock
+ extension.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Shared Message Table Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Shared Object Header Message Table Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td>Number of Indices</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes version 0.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Shared Object Header Message Table Address</p></td>
+ <td><p>This field is the address of the master table for shared
+ object header message indexes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Indices</p></td>
+ <td><p>This field is the number of indices in the master table.
+ </p></td>
+ </tr>
+
+ </table>
+ </div>
+
+<br />
+<h4><a name="ContinuationMessage">IV.A.2.q. The Object Header
+Continuation Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object Header
+ Continuation</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0010</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The object header continuation is the location in the file
+ of a block containing more header messages for the current data
+ object. This can be used when header blocks become too large or
+ are likely to change over time.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Object Header Continuation Message
+ </caption>
+
+ <tr>
+ <th width=25%>byte</th>
+ <th width=25%>byte</th>
+ <th width=25%>byte</th>
+ <th width=25%>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Length<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Offset</p></td>
+ <td><p>This value is the address in the file where the
+ header continuation block is located.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This value is the length in bytes of the header continuation
+ block in the file.</p></td>
+ </tr>
+ </table>
+ </div>
+ <br />
+
+ <p>The format of the header continuation block that this message points
+ to depends on the version of the object header that the message is
+ contained within.
+ </p>
+
+ <p>
+ Continuation blocks for version 1 object headers have no special
+ formatting information; they are merely a list of object header
+ message info sequences (type, size, flags, reserved bytes and data
+ for each message sequence). See the description
+ of <a href="#V1ObjectHeaderPrefix">Version 1 Data Object Header Prefix.</a>
+ </p>
+
+ <p>Continuation blocks for version 2 object headers <em>do</em> have
+ special formatting information as described here
+ (see also the description of
+ <a href="#V2ObjectHeaderPrefix">Version 2 Data Object Header Prefix.</a>):
+ </p>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Version 2 Object Header Continuation Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Header Message Type #1</td>
+ <td colspan="2">Size of Header Message Data #1</td>
+ <td>Header Message #1 Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #1 Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td>Header Message Type #n</td>
+ <td colspan="2">Size of Header Message Data #n</td>
+ <td>Header Message #n Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #n Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #n<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Gap <em>(optional, variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>OCHK</code>&rdquo;
+ is used to indicate the
+ beginning of an object header continuation block. This gives file
+ consistency checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Type</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Header Message #n Data</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Flags</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Creation Order</p></td>
+ <td>
+ <p>This field stores the order that a message of a given type
+ was created in.</p>
+ <p>This field is present if bit 2 of <em>flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Data</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Gap</p></td>
+ <td>
+ <p>A gap in an object header chunk is inferred by the end of the
+ messages for the chunk before the beginning of the chunk&rsquo;s
+ checksum. Gaps are always smaller than the size of an
+ object header message prefix (message type + message size +
+ message flags).</p>
+ <p>Gaps are formed when a message (typically an attribute message)
+ in an earlier chunk is deleted and a message from a later
+ chunk that does not quite fit into the free space is moved
+ into the earlier chunk.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the object header chunk.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="SymbolTableMessage">IV.A.2.r. The Symbol Table
+Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Symbol Table
+ Message</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0011</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for
+ &ldquo;old style&rdquo; groups; may not be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>Each &ldquo;old style&rdquo; group has a v1 B-tree and a
+ local heap for storing symbol table entries, which are located
+ with this message.</td></tr>
+ <tr><td colspan="2"><b>Format of data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ <b>Symbol Table Message</b>
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />v1 B-tree Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Local Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>v1 B-tree Address</p></td>
+ <td><p>This value is the address of the v1 B-tree containing the
+ symbol table entries for the group.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Local Heap Address</p></td>
+ <td><p>This value is the address of the local heap containing
+ the link names for the symbol table entries for the group.</p></td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="ModificationTimeMessage">IV.A.2.s. The Object
+Modification Time Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object
+ Modification Time</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0012</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The object modification time is a timestamp which indicates
+ the time of the last modification of an object. The time is
+ updated when any object header message changes according to
+ the system clock where the change was posted.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Modification Time Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Seconds After UNIX Epoch</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number is used for changes in the format of Object Modification Time
+ and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by Version 1.6.1 and after of the library to encode time. In
+ this version, the time is the seconds after Epoch.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Seconds After UNIX Epoch</p></td>
+ <td><p>A 32-bit unsigned integer value that stores the number of
+ seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970,
+ Coordinated Universal Time.</p></td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="BtreeKValuesMessage">IV.A.2.t. The B-tree
+&lsquo;K&rsquo; Values Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> B-tree
+ &lsquo;K&rsquo; Values</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0013</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message retrieves non-default &lsquo;K&rsquo; values
+ for internal and leaf nodes of a group or indexed storage v1
+ B-trees. This message is <em>only</em> found in the superblock
+ extension.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ B-tree &lsquo;K&rsquo; Values Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="2">Indexed Storage Internal Node K</td>
+ <td bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Group Internal Node K</td>
+ <td colspan="2">Group Leaf Node K</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Indexed Storage Internal Node K</p></td>
+ <td><p>This is the node &lsquo;K&rsquo; value for each internal node of an
+ indexed storage v1 B-tree. See the description of this field
+ in version 0 and 1 of the superblock as well the section on
+ v1 B-trees.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Internal Node K</p></td>
+ <td><p>This is the node &lsquo;K&rsquo; value for each internal node of a group
+ v1 B-tree. See the description of this field in version 0 and
+ 1 of the superblock as well as the section on v1 B-trees.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Leaf Node K</p></td>
+ <td><p>This is the node &lsquo;K&rsquo; value for each leaf node of a group v1
+ B-tree. See the description of this field in version 0 and 1
+ of the superblock as well as the section on v1 B-trees.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+<br />
+<h4><a name="DrvInfoMessage">IV.A.2.u. The Driver Info
+Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Driver
+ Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0014</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+
+ <tr><td>
+ <b>Description:</b></td>
+ <td>This message contains information needed by the file driver
+ to reopen a file. This message is <em>only</em> found in the
+ superblock extension: see the <a href="#SuperblockExt">
+ &ldquo;Disk Format: Level 0C - Superblock Extension&rdquo;</a>
+ section for more information. For more information on the fields
+ in the driver info message, see the <a href="#DriverInfo">
+ &ldquo;Disk Format : Level 0B - File Driver Info&rdquo;</a>
+ section; those who use the multi and family file drivers will
+ find this section particularly helpful.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Driver Info Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Driver Identification</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Driver Information Size</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Driver Information <em>(variable size)</em><br /><br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Identification</p></td>
+ <td><p>This is an eight-byte ASCII string without null termination which
+ identifies the driver.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information Size</p></td>
+ <td><p>The size in bytes of the <em>Driver Information</em> field of this
+ message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information</p></td>
+ <td><p>Driver information is stored in a format defined by the file driver.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+<br />
+<h4><a name="AinfoMessage">IV.A.2.v. The Attribute Info
+Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Attribute
+ Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0015</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message stores information about the attributes on an
+ object, such as the maximum creation index for the attributes
+ created and the location of the attribute storage when the
+ attributes are stored &ldquo;densely&rdquo;.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Attribute Info Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Maximum Creation Index <em>(optional)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Attribute Name v2 B-tree Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Attribute Creation Order v2 B-tree Address<sup>O</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This is the attribute index information flag with the
+ following definition:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, creation order for attributes is tracked.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, creation order for attributes is indexed.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Creation Index</p></td>
+ <td><p>The is the maximum creation order index value for the
+ attributes on the object.</p>
+ <p>This field is present if bit 0 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Address</p></td>
+ <td><p>This is the address of the fractal heap to store dense
+ attributes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Attribute Name v2 B-tree Address</p></td>
+ <td><p>This is the address of the version 2 B-tree to index the
+ names of densely stored attributes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Attribute Creation Order v2 B-tree Address</p></td>
+ <td><p>This is the address of the version 2 B-tree to index the
+ creation order of densely stored attributes.</p>
+ <p>This field is present if bit 1 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+<br />
+<h4><a name="RefCountMessage">IV.A.2.w. The Object Reference
+Count Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object Reference
+ Count</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0016</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message stores the number of hard links (in groups or
+ objects) pointing to an object: in other words, its
+ <em>reference count</em>.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Object Reference Count
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reference count</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td><p>The unsigned 32-bit integer is the reference count for the
+ object. This message is only present in &ldquo;version 2&rdquo;
+ (or later) object headers, and if not present those object
+ header versions, the reference count for the object is assumed
+ to be 1.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+<br />
+<h4><a name="FsinfoMessage">IV.A.2.x. The File Space Info
+Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> File Space
+ Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0018</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td>
+ <b>Description:</b></td>
+ <td>This message stores the file space management strategy (see
+ description below) that the library uses in handling file space
+ request for the file. It also contains the free-space section
+ threshold used by the library&rsquo;s free-space managers for
+ the file. If the strategy is 1, this message also contains the
+ addresses of the file&rsquo;s free-space managers which track
+ free space for each type of file space allocation. There are
+ six basic types of file space allocation: superblock, B-tree,
+ raw data, global heap, local heap, and object header. See the
+ description of <a href="#FreeSpaceManager">Free-space
+ Manager</a> as well the description of allocation types in
+ <a href="#AppendixB">Appendix B</a>.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ File Space Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Strategy</td>
+ <td colspan="2">Threshold<sup>L</sup></td>
+ </tr>
+ <tr>
+ <td colspan="4">Super-block Free-space Manager Address<sup>O</sup></td>
+ </tr>
+ <tr>
+ <td colspan="4">B-tree Free-space Manager Address<sup>O</sup></td>
+ </tr>
+ <tr>
+ <td colspan="4">Raw Data Free-space Manager Address<sup>O</sup></td>
+ </tr>
+ <tr>
+ <td colspan="4">Global Heap Free-space Manager Address<sup>O</sup></td>
+ </tr>
+ <tr>
+ <td colspan="4">Local Heap Free-space Manager Address<sup>O</sup></td>
+ </tr>
+ <tr>
+ <td colspan="4">Object Header Free-space Manager Address<sup>O</sup></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Offsets&rdquo; field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are of the size
+ specified in &ldquo;Size of Lengths&rdquo; field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>This is the version number of this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Strategy</p></td>
+ <td><p>This is the file space management strategy for the file.
+ There are four types of strategies:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>With this strategy, the HDF5 Library&rsquo;s free-space managers track the
+ free space that results from the manipulation of HDF5 objects
+ in the HDF5 file. The free space information is saved when the
+ file is closed, and reloaded when the file is reopened.
+ <br />
+ When space is needed for file metadata or raw data,
+ the HDF5 Library first requests space from the library&rsquo;s free-space
+ managers. If the request is not satisfied, the library requests space
+ from the aggregators. If the request is still not satisfied,
+ the library requests space from the virtual file driver.
+ That is, the library will use all of the mechanisms for allocating
+ space.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>This is the HDF5 Library&rsquo;s default file space management strategy.
+ With this strategy, the library&rsquo;s free-space managers track the free space
+ that results from the manipulation of HDF5 objects in the HDF5 file.
+ The free space information is NOT saved when the file is closed and
+ the free space that exists upon file closing becomes unaccounted
+ space in the file.
+ <br />
+ As with strategy #1, the library will try all of the mechanisms
+ for allocating space. When space is needed for file metadata or
+ raw data, the library first requests space from the free-space
+ managers. If the request is not satisfied, the library requests
+ space from the aggregators. If the request is still not satisfied,
+ the library requests space from the virtual file driver.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>With this strategy, the HDF5 Library does not track free space that results
+ from the manipulation of HDF5 objects in the HDF5 file and
+ the free space becomes unaccounted space in the file.
+ <br />
+ When space is needed for file metadata or raw data,
+ the library first requests space from the aggregators.
+ If the request is not satisfied, the library requests space from
+ the virtual file driver.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>With this strategy, the HDF5 Library does not track free space that results
+ from the manipulation of HDF5 objects in the HDF5 file and
+ the free space becomes unaccounted space in the file.
+ <br />
+ When space is needed for file metadata or raw data,
+ the library requests space from the virtual file driver.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Threshold</p></td>
+ <td><p>This is the free-space section threshold.
+ The library&rsquo;s free-space managers will track only
+ free-space sections with size greater than or equal to
+ <em>threshold</em>. The default is to track free-space
+ sections of all sizes.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>Superblock Free-space Manager Address</p></td>
+ <td><p>This is the address of the free-space manager for
+ H5FD_MEM_SUPER allocation type.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>B-tree Free-space Manager Address</p></td>
+ <td><p>This is the address of the free-space manager for
+ H5FD_MEM_BTREE allocation type.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Raw Data Free-space Manager Address</p></td>
+ <td><p>This is the address of the free-space manager for
+ H5FD_MEM_DRAW allocation type.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Global Heap Free-space Manager Address</p></td>
+ <td><p>This is the address of the free-space manager for
+ H5FD_MEM_GHEAP allocation type.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Local Heap Free-space Manager Address</p></td>
+ <td><p>This is the address of the free-space manager for
+ H5FD_MEM_LHEAP allocation type.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Free-space Manager Address</p></td>
+ <td><p>This is the address of the free-space manager for
+ H5FD_MEM_OHDR allocation type.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <br />
+
+
+<br />
+<h3><a name="DataStorage">
+IV.B. Disk Format: Level 2B - Data Object Data Storage</a></h3>
+
+<p>The data for an object is stored separately from its header
+ information in the file and may not actually be located in the HDF5 file
+ itself if the header indicates that the data is stored externally. The
+ information for each record in the object is stored according to the
+ dimensionality of the object (indicated in the dataspace header message).
+ Multi-dimensional array data is stored in C order; in other words, the
+ &ldquo;last&rdquo; dimension changes fastest.</p>
+
+<p>Data whose elements are composed of atomic datatypes are stored in IEEE
+ format, unless they are specifically defined as being stored in a different
+ machine format with the architecture-type information from the datatype
+ header message. This means that each architecture will need to [potentially]
+ byte-swap data values into the internal representation for that particular
+ machine.</p>
+
+<p> Data with a variable-length datatype is stored in the global heap
+ of the HDF5 file. Global heap identifiers are stored in the
+ data object storage.</p>
+
+<p>Data whose elements are composed of reference datatypes are stored in
+ several different ways depending on the particular reference type involved.
+ Object pointers are just stored as the offset of the object header being
+ pointed to with the size of the pointer being the same number of bytes as
+ offsets in the file.</p>
+
+<p>Dataset region references are stored as a heap-ID which points to
+the following information within the file-heap: an offset of the object
+pointed to, number-type information (same format as header message),
+dimensionality information (same format as header message), sub-set start
+and end information (in other words, a coordinate location for each),
+and field start and end names (in other words, a [pointer to the] string
+indicating the first field included and a [pointer to the] string name
+for the last field). </p>
+
+<p>Data of a compound datatype is stored as a contiguous stream of the items
+ in the structure, with each item formatted according to its datatype.</p>
+
+
+
+<br />
+<br />
+<hr />
+<h2><a name="AppendixA">
+V. Appendix A: Definitions</a></h2>
+
+<p>Definitions of various terms used in this document are included in
+this section.</p>
+
+ <div align="center">
+ <table class="glossary">
+ <tr>
+ <th width="20%">Term</th>
+ <th>Definition</th>
+ </tr>
+
+ <tr>
+ <td>Undefined Address</td>
+ <td>The <a name="UndefinedAddress">undefined
+ address</a> for a file is a file address with all bits
+ set: in other words, <code>0xffff...ff</code>.</td>
+ </tr>
+
+ <tr>
+ <td>Unlimited Size</td>
+ <td>The <a name="UnlimitedDim">unlimited size</a>
+ for a size is a value with all bits set: in other words,
+ <code>0xffff...ff</code>.</td>
+ </tr>
+
+ </table>
+ </div>
+
+
+
+<br />
+<br />
+<hr />
+<h2><a name="AppendixB">
+VI. Appendix B: File Memory Allocation Types</a></h2>
+
+<p>There are six basic types of file memory allocation as follows:
+</p>
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Basic Allocation Type</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_SUPER</td>
+ <td>File memory allocated for <em>Superblock.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_BTREE</td>
+ <td>File memory allocated for <em>B-tree.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_DRAW</td>
+ <td>File memory allocated for raw data.</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_GHEAP</td>
+ <td>File memory allocated for <em>Global Heap.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_LHEAP</td>
+ <td>File memory allocated for <em>Local Heap.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_OHDR</td>
+ <td>File memory allocated for <em>Object Header.</em></td>
+ </tr>
+ </table>
+ </div>
+
+<p>There are other file memory allocation types that are mapped to the
+above six basic allocation types because they are similar in nature.
+The mapping is listed in the following table:
+</p>
+
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Basic Allocation Type</th>
+ <th>Mapping of Allocation Types to Basic Allocation Types</th>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_SUPER</td>
+ <td><em>none</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_BTREE</td>
+ <td>H5FD_MEM_SOHM_INDEX</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_DRAW</td>
+ <td>H5FD_MEM_FHEAP_HUGE_OBJ</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_GHEAP</td>
+ <td><em>none</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_LHEAP</td>
+ <td>H5FD_MEM_FHEAP_DBLOCK, H5FD_MEM_FSPACE_SINFO</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_OHDR</td>
+ <td>H5FD_MEM_FHEAP_HDR, H5FD_MEM_FHEAP_IBLOCK, H5FD_MEM_FSPACE_HDR, H5FD_MEM_SOHM_TABLE</td>
+ </tr>
+ </table>
+ </div>
+
+<p>Allocation types that are mapped to basic allocation types are described below:
+</p>
+
+ <div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Allocation Type</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_HDR</td>
+ <td>File memory allocated for <em>Fractal Heap Header.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_DBLOCK</td>
+ <td>File memory allocated for <em>Fractal Heap Direct Blocks.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_IBLOCK</td>
+ <td>File memory allocated for <em>Fractal Heap Indirect Blocks.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_HUGE_OBJ</td>
+ <td>File memory allocated for huge objects in the fractal heap.</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FSPACE_HDR</td>
+ <td>File memory allocated for <em>Free-space Manager Header.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FSPACE_SINFO</td>
+ <td>File memory allocated for <em>Free-space Section List</em> of the free-space manager.</td>
+ </tr>
+ <tr>
+ <td>H5FD_MEM_SOHM_TABLE</td>
+ <td>File memory allocated for <em>Shared Object Header Message Table.</em></td>
+ </tr>
+ <tr>
+ <td>H5FD_MEM_SOHM_INDEX</td>
+ <td>File memory allocated for <em>Shared Message Record List.</em></td>
+ </tr>
+ </table>
+ </div>
+</body>
+</html>
diff --git a/doxygen/examples/H5.format.html b/doxygen/examples/H5.format.html
new file mode 100644
index 0000000..e16805f
--- /dev/null
+++ b/doxygen/examples/H5.format.html
@@ -0,0 +1,20400 @@
+<html>
+ <head>
+ <title>
+ HDF5 File Format Specification Version 3.0
+ </title>
+
+ <style>
+ h1 { display: block;
+ margin-top: 24px;
+ margin-bottom: 24px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ font-size: 300%;
+ }
+
+ h2 { display: block;
+ margin-top: 60px;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ border-style: solid;
+ border-top-style: medium;
+ border-top-color: #A9A9A9;
+ border-bottom: none;
+ border-left: none;
+ border-right: none;
+ font-size: 250%;
+ }
+
+ h3 { display: block;
+ margin-top: 40px;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ font-size: 200%;
+ }
+
+ h4 { display: block;
+ margin-top: 32px;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ font-size: 150%;
+ }
+
+ p { display: block;
+ margin-top: 8px;
+ margin-bottom: 8px;
+ margin-left: 0px;
+ margin-right: 0px;
+ text-indent: 0px;
+ font-size: 100%;
+ }
+ <!--
+ p.item { margin-left: 2em;
+ text-indent: -2em
+ } -->
+ <!-- p.item2 { margin-left: 2em; text-indent: 2em} -->
+
+ table.format { border:solid;
+ border-collapse:collapse;
+ caption-side:top;
+ text-align:center;
+ width:80%;
+ }
+ table.format th { border:ridge;
+ padding:4px;
+ width:25%;
+ }
+ table.format td { border:ridge;
+ padding:4px;
+ }
+ table.format caption { font-weight:bold;
+ font-size:larger;
+ }
+
+ table.note {border:none;
+ text-align:right;
+ width:80%;
+ }
+
+ table.desc { border:solid;
+ border-collapse:collapse;
+ caption-size:top;
+ text-align:left;
+ width:80%;
+ }
+ table.desc tr { vertical-align:top;
+ }
+ table.desc th { border-style:ridge;
+ font-size:larger;
+ padding:4px;
+ <!-- text-decoration:underline; -->
+ }
+ table.desc td { border-style:ridge;
+ <!-- padding: 4px; -->
+ vertical-align:text-top;
+ }
+ table.desc caption { font-weight:bold;
+ font-size:larger;
+ }
+
+ table.list { border:none;
+ width:100%
+ }
+ table.list tr { vertical-align:text-top;
+ }
+ table.list th { border:none;
+ text-decoration:underline;
+ vertical-align:text-top;
+ }
+ table.list td { border:none;
+ vertical-align:text-top;
+ }
+
+ table.msgdesc { border:none;
+ text-align:left;
+ width: 80%
+ }
+ table.msgdesc tr { vertical-align:text-top;
+ border-spacing:0;
+ padding:0; }
+ table.msgdesc th { border:none;
+ text-decoration:underline;
+ vertical-align:text-top; }
+ table.msgdesc td { border:none;
+ vertical-align:text-top;
+ }
+
+ table.list80 { border:none;
+ width:80%
+ }
+ table.list80 tr { vertical-align:text-top;
+ }
+ table.list80 th { border:none;
+ text-decoration:underline;
+ vertical-align:text-top;
+ }
+ table.list80 td { border:none;
+ vertical-align:text-top;
+ }
+
+ table.glossary { border:none;
+ text-align:left;
+ width: 80%
+ }
+ table.glossary tr { vertical-align:text-top;
+ border-spacing:0;
+ padding:0; }
+ table.glossary th { border:none;
+ text-align:left;
+ text-decoration:underline;
+ vertical-align:text-top; }
+ table.glossary td { border:none;
+ text-align:left;
+ vertical-align:text-top;
+ }
+
+ div { page-break-inside:avoid;
+ page-break-after:auto
+ }
+
+ </style>
+
+ <!-- #BeginLibraryItem "/ed_libs/styles_Format.lbi" -->
+ <!--
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ -->
+ <!-- #EndLibraryItem --><!-- #BeginLibraryItem "/ed_libs/NavBar_ADevG.lbi" -->
+ </head>
+ <body>
+ <!-- #EndLibraryItem -->
+
+ <center>
+ <table border="0" width="90%">
+ <tr>
+ <td valign="top">
+ <ol type="I">
+ <li><a href="#Intro">Introduction</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#ThisDocument">This Document</a></li>
+ <li><a href="#ChangesForHdf5_1_12">Changes for HDF5 1.12</a></li>
+ <li><a href="#ChangesForHdf5_1_10">Changes for HDF5 1.10</a></li>
+ </ol>
+ </font>
+
+ <li><a href="#FileMetaData">Disk Format: Level 0 - File Metadata</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#Superblock">Disk Format: Level 0A - Format Signature
+ and Superblock</a></li>
+ <li><a href="#DriverInfo">Disk Format: Level 0B - File Driver
+ Info</a></li>
+ <li><a href="#SuperblockExt">Disk Format: Level 0C - Superblock
+ Extension</a></li>
+ </ol>
+ </font>
+ <li><a href="#FileInfra">Disk Format: Level 1 - File Infrastructure</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#Btrees">Disk Format: Level 1A - B-trees and B-tree
+ Nodes</a>
+ <ol type="1">
+ <li><a href="#V1Btrees">Disk Format: Level 1A1 - Version 1
+ B-trees</a></li>
+ <li><a href="#V2Btrees">Disk Format: Level 1A2 - Version 2
+ B-trees</a></li>
+ </ol>
+ </li>
+ <li><a href="#SymbolTable">Disk Format: Level 1B - Group Symbol
+ Table Nodes</a></li>
+ <li><a href="#SymbolTableEntry">Disk Format: Level 1C - Symbol
+ Table Entry</a></li>
+ <li><a href="#LocalHeap">Disk Format: Level 1D - Local Heaps</a></li>
+ <li><a href="#GlobalHeap">Disk Format: Level 1E - Global Heap</a></li>
+ <li><a href="#GlobalHeapVDS">Disk Format: Level 1F - Global Heap
+ Block for Virtual Datasets</a></li>
+ <li><a href="#FractalHeap">Disk Format: Level 1G - Fractal Heap</a></li>
+ <li><a href="#FreeSpaceManager">Disk Format: Level 1H - Free-space
+ Manager</a></li>
+ <li><a href="#SOHMTable">Disk Format: Level 1I - Shared Object
+ Header Message Table</a></li>
+ </ol>
+ </font>
+ <li><a href="#DataObject">Disk Format: Level 2 - Data Objects</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#ObjectHeader">Disk Format: Level 2A - Data Object Headers</a></li>
+ <ol type="1">
+ <li><a href="#ObjectHeaderPrefix">Disk Format: Level 2A1 -
+ Data Object Header Prefix</a>
+ <ol type="a">
+ <li><a href="#V1ObjectHeaderPrefix">Version 1 Data
+ Object Header Prefix</a></li>
+ <li><a href="#V2ObjectHeaderPrefix">Version 2 Data
+ Object Header Prefix</a></li>
+ </ol>
+ </li>
+ <li><a href="#ObjectHeaderMessages">Disk Format: Level 2A2 -
+ Data Object Header Messages</a></li>
+ <ol type="a">
+ <li><a href="#NILMessage">The NIL Message</a></li> <!-- 0x0000 -->
+ <li><a href="#DataspaceMessage">The Dataspace Message</a></li> <!-- 0x0001 -->
+ <li><a href="#LinkInfoMessage">The Link Info Message</a></li> <!-- 0x0002 -->
+ <li><a href="#DatatypeMessage">The Datatype Message</a></li> <!-- 0x0003 -->
+ <li><a href="#OldFillValueMessage">The Data Storage -
+ Fill Value (Old) Message</a></li> <!-- 0x0004 -->
+ </ol>
+ </ol>
+ </ol>
+ </font>
+ </ol>
+ </td>
+
+ <td>&nbsp;</td>
+
+ <td valign="top">
+ <ol type="I" start="4">
+ <li><a href="#DataObject">Disk Format: Level 2 - Data
+ Objects</a><font size="-1"><i> (Continued)</i></li>
+ <ol type="A">
+ <li><a href="#ObjectHeader">Disk Format: Level 2A - Data Object
+ Headers</a><i> (Continued)</i>
+ <ol type="1" start="2">
+ <li><a href="#ObjectHeaderMessages">Disk Format: Level 2A2 -
+ Data Object Header Messages</a><i> (Continued)</i></li>
+ <ol type="a" start="6">
+ <li><a href="#FillValueMessage">The Data Storage -
+ Fill Value Message</a></li> <!-- 0x0005 -->
+ <li><a href="#LinkMessage">The Link Message</a></li> <!-- 0x0006 -->
+ <li><a href="#ExternalFileListMessage">The Data Storage -
+ External Data Files Message</a></li> <!-- 0x0007 -->
+ <li><a href="#LayoutMessage">The Data Layout Message</a></li> <!-- 0x0008 -->
+ <li><a href="#BogusMessage">The Bogus Message</a></li> <!-- 0x0009 -->
+ <li><a href="#GroupInfoMessage">The Group Info
+ Message</a></li> <!-- 0x000a -->
+ <li><a href="#FilterMessage">The Data Storage -
+ Filter Pipeline Message</a></li> <!-- 0x000b -->
+ <li><a href="#AttributeMessage">The Attribute
+ Message</a></li> <!-- 0x000c -->
+ <li><a href="#CommentMessage">The Object Comment
+ Message</a></li> <!-- 0x000d -->
+ <li><a href="#OldModificationTimeMessage">The Object
+ Modification Time (Old) Message</a></li> <!-- 0x000e -->
+ <li><a href="#SOHMTableMessage">The Shared Message
+ Table Message</a></li> <!-- 0x000f -->
+ <li><a href="#ContinuationMessage">The Object Header
+ Continuation Message</a></li> <!-- 0x0010 -->
+ <li><a href="#SymbolTableMessage">The Symbol
+ Table Message</a></li> <!-- 0x0011 -->
+ <li><a href="#ModificationTimeMessage">The Object
+ Modification Time Message</a></li> <!-- 0x0012 -->
+ <li><a href="#BtreeKValuesMessage">The B-tree
+ &lsquo;K&rsquo; Values Message</a></li> <!-- 0x0013 -->
+ <li><a href="#DrvInfoMessage">The Driver Info
+ Message</a></li> <!-- 0x0014 -->
+ <li><a href="#AinfoMessage">The Attribute Info
+ Message</a></li> <!-- 0x0015 -->
+ <li><a href="#RefCountMessage">The Object Reference
+ Count Message</a></li> <!-- 0x0016 -->
+ <li><a href="#FsinfoMessage">The File Space Info
+ Message</a></li> <!-- 0x0017 -->
+ </ol>
+ </ol>
+ </li>
+ <li><a href="#DataStorage">Disk Format: Level 2B - Data Object Data Storage</a></li>
+ </ol>
+ </font>
+ <li><a href="#AppendixA">Appendix A: Definitions</a></li>
+ <li><a href="#AppendixB">Appendix B: File Space Allocation
+ Types</a></li>
+ <li><a href="#AppendixC">
+ Appendix C: Types of Indexes for Dataset Chunks</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#SingleChunk">The Single Chunk Index</a></li>
+ <li><a href="#Implicit">The Implicit Index</a></li>
+ <li><a href="#FixedArray">The Fixed Array Index</a></li>
+ <li><a href="#ExtensibleArray">The Extensible Array Index</a></li>
+ <li><a href="#AppendV2Btrees">The Version 2 B-trees Index</a></li>
+ </ol>
+ </font>
+ <li><a href="#AppendixD">
+ Appendix D: Encoding for Dataspace and Reference</a></li>
+ <font size="-1">
+ <ol type="A">
+ <li><a href="#DataspaceEncode">Dataspace Encoding</a></li>
+ <li><a href="#ReferenceEncodeRV">Reference Encoding (Revised)</a></li>
+ <li><a href="#ReferenceEncodeDP">Reference Encoding (Backward Compatibility)</a></li>
+ </ol>
+ </font>
+ </ol>
+ </td></tr>
+ </table>
+ </center>
+
+
+ <a name="Intro"><h2>I. Introduction</h2></a>
+
+ <table align="right" width="100">
+ <tr><td>&nbsp;</td><td align="center">
+ <hr />
+ <img src="FF-IH_FileGroup.gif" alt="HDF5 Groups" hspace="15" vspace="15">
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align="center">
+ <strong>Figure 1:</strong> Relationships among the HDF5 root group, other groups, and objects
+ <hr />
+ </td><td>&nbsp;</td></tr>
+
+ <tr><td>&nbsp;</td><td align="center">
+ <img src="FF-IH_FileObject.gif" alt="HDF5 Objects" hspace="15" vspace="15">
+ </td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align="center">
+ <strong>Figure 2:</strong> HDF5 objects -- datasets, datatypes, or dataspaces
+ <hr />
+ </td><td>&nbsp;</td></tr>
+ </table>
+
+
+ <p>The format of an HDF5 file on disk encompasses several
+ key ideas of the HDF4 and AIO file formats as well as
+ addressing some shortcomings therein. The new format is
+ more self-describing than the HDF4 format and is more
+ uniformly applied to data objects in the file.</p>
+
+ <p>An HDF5 file appears to the user as a directed graph.
+ The nodes of this graph are the higher-level HDF5 objects
+ that are exposed by the HDF5 APIs:</p>
+
+ <ul>
+ <li>Groups</li>
+ <li>Datasets</li>
+ <li>Committed (formerly Named) datatypes</li>
+ </ul>
+
+ <p>At the lowest level, as information is actually written to the disk,
+ an HDF5 file is made up of the following objects:</p>
+ <ul>
+ <li>A superblock</li>
+ <li>B-tree nodes</li>
+ <li>Heap blocks</li>
+ <li>Object headers</li>
+ <li>Object data</li>
+ <li>Free space</li>
+ </ul>
+
+ <p>The HDF5 Library uses these low-level objects to represent the
+ higher-level objects that are then presented to the user or
+ to applications through the APIs. For instance, a group is an
+ object header that contains a message that points to a local
+ heap (for storing the links to objects in the group) and to a
+ B-tree (which indexes the links). A dataset is an object header
+ that contains messages that describe the datatype, dataspace,
+ layout, filters, external files, fill value, and other elements
+ with the layout message pointing to either a raw data chunk or
+ to a B-tree that points to raw data chunks.</p>
+
+
+ <a name="ThisDocument"><h3>I.A. This Document</h3></a>
+
+ <p>This document describes the lower-level data objects;
+ the higher-level objects and their properties are described
+ in the <a href="UG/HDF5_Users_Guide-Responsive HTML5/index.html"><cite>HDF5 User&rsquo;s Guide</cite></a>.</p>
+
+ <p>Three levels of information comprise the file format.
+ Level 0 contains basic information for identifying and
+ defining information about the file. Level 1 information contains
+ the information about the pieces of a file shared by many objects
+ in the file (such as B-trees and heaps). Level 2 is the rest
+ of the file and contains all of the data objects with each object
+ partitioned into header information, also known as
+ <em>metadata</em>, and data.</p>
+
+ <p>The various components of the lower-level data objects are
+ described in pairs of tables. The first table shows the format
+ layout, and the second table describes the fields. The titles
+ of format layout tables begin with &ldquo;Layout&rdquo;. The
+ titles of the tables where the fields are described begin with
+ &ldquo;Fields&rdquo;. For example, the table that describes the
+ format of the <a href="#V2Btrees">version 2 B-tree header</a> has
+ a title of &ldquo;Layout: Version 2 B-tree Header&rdquo;, and the
+ fields in the version 2 B-tree header are described in the table
+ titled &ldquo;Fields: Version 2 B-tree Header&rdquo;.
+
+ <p>The sizes of various fields in the following layout tables are
+ determined by looking at the number of columns the field spans
+ in the table. There are exceptions: </p>
+ <ul>
+ <li> The size may be overridden by specifying a size in
+ parentheses</li>
+ <li> The size of addresses is determined by the
+ <em><a href="#SizeOfOffsetsV0">Size of Offsets</a></em> field
+ in the superblock and is indicated in this document with a
+ superscripted &lsquo;O&rsquo;</li>
+ <li> The size of length fields is determined by the
+ <em><a href="#SizeOfLengthsV0">Size of Lengths</a></em> field in
+ the superblock and is indicated in this document with a
+ superscripted &lsquo;L&rsquo;</li>
+ </ul>
+
+ <p>Values for all fields in this document should be treated as unsigned
+ integers, unless otherwise noted in the description of a field.
+ Additionally, all metadata fields are stored in little-endian byte
+ order.
+ </p>
+
+ <p>All checksums used in the format are computed with the
+ <a href="http://www.burtleburtle.net/bob/hash/doobs.html">Jenkins&rsquo;
+ lookup3</a> algorithm.
+ </p>
+
+ <p>Whenever a bit flag or field is mentioned for an entry, bits are
+ numbered from the lowest bit position in the entry.
+ </p>
+
+ <p>Various format tables in this document have cells with
+ &ldquo;This space inserted only to align table nicely&rdquo;. These
+ entries in the table are just to make the table presentation nicer
+ and do not represent any values or padding in the file.
+ </p>
+
+ <a name="ChangesForHdf5_1_12">
+ <h3>I.B. Changes for HDF5 1.12</h3></a>
+ <p>The following sections have been
+ changed or added for the 1.12 release:</p>
+ <ul>
+ <li>Under <a href="#DatatypeMessage">&ldquo;The Datatype Message&rdquo;</a>,
+ in the Description for &ldquo;Fields:Datatype Message&rdquo;,
+ version 4 was added and Reference class (7) of the datatype was updated to describe version 4.</li>
+ <li><a href="#AppendixD">
+ &ldquo;Appendix D: Encoding for Dataspace and Reference&rdquo;</a>
+ was added. </li>
+ </ul>
+
+
+ <a name="ChangesForHdf5_1_10">
+ <h3>I.C. Changes for HDF5 1.10</h3></a>
+
+ <p>The following sections have been
+ changed or added for the 1.10 release:</p>
+ <ul>
+ <li>In the <a href="#Superblock">
+ &ldquo;Disk Format: Level 0A - Format Signature and
+ Superblock&rdquo;</a> section, version 3 of the superblock was
+ added. </li>
+ <li>In the <a href="#SuperblockExt">
+ &ldquo;Disk Format: Level 0C - Superblock Extension&rdquo;</a>
+ section, a link to the Data Storage message was added. </li>
+ <li>In the <a href="#V2Btrees">
+ &ldquo;Disk Format: Level 1A2 - Version 2 B-trees&rdquo;</a>
+ section, additional B-tree types were added. Tables that
+ describe the <a href="#V2BtreesType10">type 10</a> and
+ <a href="#V2BtreesType11">11</a> record layouts were added at
+ the end of the section.</li>
+ <li>The <a href="#GlobalHeapVDS">&ldquo;Disk Format: Level 1F -
+ Global Heap Block for Virtual Datasets&rdquo;</a> was added.
+ </li>
+ <li><a href="#LayoutMessage">
+ &ldquo;The Data Layout Message&rdquo;</a> section was changed.
+ The name was changed, and <a href="#DataLayoutV4">version 4</a>
+ of the data layout message was added for the virtual type.</li>
+ <li>The <a href="#FsinfoMessage">
+ &ldquo;The File Space Info Message&rdquo;</a> header message
+ type was added.</li>
+ <li><a href="#AppendixC">
+ &ldquo;Appendix C: Types of Indexes for Dataset Chunks&rdquo;</a>
+ was added. Five indexing types were added.</li>
+ </ul>
+
+
+
+ <h2><a name="FileMetaData">
+ II. Disk Format: Level 0 - File Metadata</a></h2>
+
+
+
+ <h3><a name="Superblock">
+ II.A. Disk Format: Level 0A - Format Signature and Superblock</a></h3>
+
+ <p>The superblock may begin at certain predefined offsets within
+ the HDF5 file, allowing a block of unspecified content for
+ users to place additional information at the beginning (and
+ end) of the HDF5 file without limiting the HDF5 Library&rsquo;s
+ ability to manage the objects within the file itself. This
+ feature was designed to accommodate wrapping an HDF5 file in
+ another file format or adding descriptive information to an HDF5
+ file without requiring the modification of the actual file&rsquo;s
+ information. The superblock is located by searching for the
+ HDF5 format signature at byte offset 0, byte offset 512, and at
+ successive locations in the file, each a multiple of two of
+ the previous location; in other words, at these byte offsets:
+ 0, 512, 1024, 2048, and so on.</p>
+
+ <p>The superblock is composed of the format signature, followed by a
+ superblock version number and information that is specific to each
+ version of the superblock.
+
+ <p>Currently, there are four versions of the superblock format:
+ <ul>
+ <li>Version 0 is the default format.</li>
+ <li>Version 1 is the same as version 0 but with the
+ &ldquo;<em>Indexed Storage Internal Node K</em>&rdquo; field
+ for storing non-default B-tree &lsquo;K&rsquo; value.</li>
+ <li>Version 2 has some fields eliminated and compressed from
+ superblock format versions 0 and 1. It has added checksum support
+ and superblock extension to store additional superblock
+ metadata.</li>
+ <li>Version 3 is the same as version 2 except that the field
+ &ldquo;<em>File Consistency Flags</em>&rdquo; is used for file
+ locking. This format version will enable support for the latest
+ version.</li>
+ </ul>
+
+ <p>Versions 0 and 1 of the superblock are described below:</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Superblock (Versions 0 and 1)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Format Signature
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td>Version # of Superblock</td>
+ <td>Version # of File&rsquo;s Free Space Storage</td>
+ <td>Version # of Root Group Symbol Table Entry</td>
+ <td>Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td>Version Number of Shared Header Message Format</td>
+ <td>Size of Offsets</td>
+ <td>Size of Lengths</td>
+ <td>Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Group Leaf Node K</td>
+ <td colspan="2">Group Internal Node K</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">File Consistency Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2" style="border:dotted;">Indexed Storage Internal Node K<sup>1</sup></td>
+ <td colspan="2" style="border:dotted;">Reserved
+ <em>(zero)</em><sup>1</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of File Free space Info<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of File Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Driver Information Block Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Root Group Symbol Table Entry</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with a &lsquo;1&rsquo; in the above table are
+ new in version 1 of the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Superblock (Versions 0 and 1)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Format Signature</p></td>
+ <td><p>This field contains a constant value and can be used to
+ quickly identify a file as being an HDF5 file. The
+ constant value is designed to allow easy identification of
+ an HDF5 file and to allow certain types of data corruption
+ to be detected. The file signature of an HDF5 file always
+ contains the following values:</p>
+ <center>
+ <table border align="center" cellpadding="4">
+ <tr align="center">
+ <td align="right">Decimal:</td>
+ <td width="8%">137</td>
+ <td width="8%">72</td>
+ <td width="8%">68</td>
+ <td width="8%">70</td>
+ <td width="8%">13</td>
+ <td width="8%">10</td>
+ <td width="8%">26</td>
+ <td width="8%">10</td>
+ </tr>
+
+ <tr align="center">
+ <td align="right">Hexadecimal:</td>
+ <td>89</td>
+ <td>48</td>
+ <td>44</td>
+ <td>46</td>
+ <td>0d</td>
+ <td>0a</td>
+ <td>1a</td>
+ <td>0a</td>
+ </tr>
+
+ <tr align="center">
+ <td align="right">ASCII C Notation:</td>
+ <td>\211</td>
+ <td>H</td>
+ <td>D</td>
+ <td>F</td>
+ <td>\r</td>
+ <td>\n</td>
+ <td>\032</td>
+ <td>\n</td>
+ </tr>
+ </table>
+ </center>
+ <p>This signature both identifies the file as an HDF5 file
+ and provides for immediate detection of common
+ file-transfer problems. The first two bytes distinguish
+ HDF5 files on systems that expect the first two bytes to
+ identify the file type uniquely. The first byte is
+ chosen as a non-ASCII value to reduce the probability
+ that a text file may be misrecognized as an HDF5 file;
+ also, it catches bad file transfers that clear bit
+ 7. Bytes two through four name the format. The CR-LF
+ sequence catches bad file transfers that alter newline
+ sequences. The control-Z character stops file display
+ under MS-DOS. The final line feed checks for the inverse
+ of the CR-LF translation problem. (This is a direct
+ descendent of the
+ <a href="http://www.libpng.org/pub/png/spec/iso/index-object.html#5PNG-file-signature">PNG</a> file
+ signature.)</p>
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Superblock</p></td>
+ <td><p>This value is used to determine the format of the
+ information in the superblock. When the format of the
+ information in the superblock is changed, the version number
+ is incremented to the next integer and can be used to
+ determine how the information in the superblock is
+ formatted.</p>
+
+ <p>Values of 0, 1 and 2 are defined for this field (the
+ format of version 2 is described below, not here).
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the File&rsquo;s Free Space
+ Information</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ file&rsquo;s free space information.
+ </p>
+ <p>The only value currently valid in this field is &lsquo;0&rsquo;, which
+ indicates that the file&rsquo;s free space is as described
+ <a href="#FreeSpaceManager">below</a>.
+ </p>
+
+ <p><em>This field is present in versions 0 and 1 of the
+ superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Root Group Symbol Table
+ Entry</p></td>
+ <td><p>This value is used to determine the format of the
+ information in the Root Group Symbol Table Entry. When the
+ format of the information in that field is changed, the
+ version number is incremented to the next integer and can be
+ used to determine how the information in the field
+ is formatted.</p>
+ <p>The only value currently valid in this field is &lsquo;0&rsquo;,
+ which indicates that the root group symbol table entry is
+ formatted as described <a href="#SymbolTableEntry">below</a>.</p>
+ <p><em>This field is present in version 0 and 1 of the
+ superblock.</em></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Shared Header Message Format</p></td>
+ <td><p>This value is used to determine the format of the
+ information in a shared object header message. Since the format
+ of the shared header messages differs from the other private
+ header messages, a version number is used to identify changes
+ in the format.
+ </p>
+ <p>The only value currently valid in this field is &lsquo;0&rsquo;, which
+ indicates that shared header messages are formatted as
+ described <a href="#ObjectHeaderMessages">below</a>.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p><a name="SizeOfOffsetsV0">Size of Offsets</a></p></td>
+ <td><p>This value contains the number of bytes used to store
+ addresses in the file. The values for the addresses of
+ objects in the file are offsets relative to a base address,
+ usually the address of the superblock signature. This
+ allows a wrapper to be added after the file is created
+ without invalidating the internal offset locations.
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p><a name="SizeOfLengthsV0">Size of Lengths</a></p></td>
+ <td><p>This value contains the number of bytes used to store
+ the size of an object.
+ </p>
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Leaf Node K</p></td>
+ <td>
+ <p>Each leaf node of a group B-tree will have at
+ least this many entries but not more than twice this
+ many. If a group has a single leaf node then it
+ may have fewer entries.
+ </p>
+ <p>This value must be greater than zero.
+ </p>
+ <p>See the <a href="#Btrees">description</a> of B-trees below.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Internal Node K</p></td>
+ <td>
+ <p>Each internal node of a group B-tree will have at
+ least this many entries but not more than twice this
+ many. If the group has only one internal
+ node then it might have fewer entries.
+ </p>
+ <p>This value must be greater than zero.
+ </p>
+ <p>See the <a href="#Btrees">description</a> of B-trees below.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>File Consistency Flags</p></td>
+ <td>
+ <p>This field is unused and should be ignored.
+ </p>
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Indexed Storage Internal Node K</p></td>
+ <td>
+ <p>Each internal node of an indexed storage B-tree will have at
+ least this many entries but not more than twice this
+ many. If the index storage B-tree has only one internal
+ node then it might have fewer entries.
+ </p>
+ <p>This value must be greater than zero.
+ </p>
+ <p>See the <a href="#Btrees">description</a> of B-trees below.
+ </p>
+
+ <p><em>This field is present in version 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Base Address</p></td>
+ <td>
+ <p>This is the absolute file address of the first byte of
+ the HDF5 data within the file. The library currently
+ constrains this value to be the absolute file address
+ of the superblock itself when creating new files;
+ future versions of the library may provide greater
+ flexibility. When opening an existing file and this address does
+ not match the offset of the superblock, the library assumes
+ that the entire contents of the HDF5 file have been adjusted in
+ the file and adjusts the base address and end of file address to
+ reflect their new positions in the file. Unless otherwise noted,
+ all other file addresses are relative to this base
+ address.
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Global Free-space Index</p></td>
+ <td>
+ <p>The file&rsquo;s free space is not persistent for version 0 and 1 of
+ the superblock.
+ Currently this field always contains the
+ <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>End of File Address</p></td>
+ <td>
+ <p>This is the absolute file address of the first byte past
+ the end of all HDF5 data. It is used to determine whether a
+ file has been accidently truncated and as an address where
+ file data allocation can occur if space from the free list is
+ not used.
+ </p>
+
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information Block Address</p></td>
+ <td>
+ <p>This is the relative file address of the file driver
+ information block which contains driver-specific
+ information needed to reopen the file. If there is no
+ driver information block then this entry should be the
+ <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Root Group Symbol Table Entry</p></td>
+ <td>
+ <p>This is the <a href="#SymbolTableEntry">symbol table entry</a>
+ of the root group, which serves as the entry point into
+ the group graph for the file.
+ </p>
+
+ <p><em>This field is present in version 0 and 1 of the superblock.</em>
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <p>Versions 2 and 3 of the superblock are described below:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Superblock (Versions 2 and 3)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Format Signature
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td>Version # of Superblock</td>
+ <td>Size of Offsets</td>
+ <td>Size of Lengths</td>
+ <td>File Consistency Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Superblock Extension Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of File Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Root Group Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Superblock Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Superblock (Versions 2 and 3)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Format Signature</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 of the
+ superblock.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number of the Superblock</p></td>
+ <td>
+ <p>This field has a value of 2 and has the same meaning as for
+ versions 0 and 1.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Offsets</p></td>
+ <td>
+ <p>This field is the same as described for
+ <a href="#SizeOfOffsetsV0">versions 0 and 1</a> of the
+ superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Lengths</p></td>
+ <td>
+ <p>This field is the same as described for
+ <a href="#SizeOfLengthsV0">versions 0 and 1</a> of the
+ superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>File Consistency Flags</p></td>
+
+ <td>
+ <p>For superblock version
+ 2: This field is unused and should be ignored.</p>
+ <p>For superblock version
+ 3: This value contains flags to ensure file consistency for
+ file locking. Currently, the following bit flags are defined:
+ <ul>
+ <li>Bit 0 if set indicates that the file has been opened for
+ write access.</li>
+ <li>Bit 1 is reserved for future use.</li>
+ <li>Bit 2 if set indicates that the file has been opened for
+ single-writer/multiple-reader (SWMR) write access.</li>
+ <li>Bits 3-7 are reserved for future use.</li>
+ </ul>
+ <p>
+ Bit 0 should be set as the first action when a file has been
+ opened for write access. Bit 2 should be set when a file
+ has been opened for SWMR write access. These two bits should
+ be cleared only as the final action when closing a file.
+ </p>
+ <p><em>This field is present in version 0+ of the superblock.</em>
+ </p>
+ <p><em>The size of this
+ field has been reduced from 4 bytes in superblock format
+ versions 0 and 1 to 1 byte.</em>
+ </p>
+ </td>
+
+ </tr>
+
+ <tr>
+ <td><p>Base Address</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and
+ 1 of the superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Superblock Extension Address</p></td>
+ <td>
+ <p>The field is the address of the object header for the
+ <a href="#SuperblockExt">superblock extension</a>.
+ If there is no extension then this entry should be the
+ <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>End of File Address</p></td>
+ <td>
+ <p>This field is the same as described for versions 0 and 1 of the
+ superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Root Group Object Header Address</p></td>
+ <td>
+ <p>This is the address of
+ the <a href="#DataObject">root group object header</a>,
+ which serves as the entry point into the group graph for the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Superblock Checksum</p></td>
+ <td>
+ <p>The checksum for the superblock.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+
+ <h3><a name="DriverInfo">
+ II.B. Disk Format: Level 0B - File Driver Info</a></h3>
+
+ <p>The <b>driver information block</b> is an optional region of the
+ file which contains information needed by the file driver
+ to reopen a file. The format is described below:</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Driver Information Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Driver Information Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Driver Identification
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Driver Information
+ <em>(variable size)</em><br /><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Driver Information Block
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number of the Driver Information Block.
+ This document describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information Size</p></td>
+ <td>
+ <p>The size in bytes of the <em>Driver Information</em> field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Identification</p></td>
+ <td>
+ <p>This is an eight-byte ASCII string without null
+ termination which identifies the driver and/or version number
+ of the Driver Information Block. The predefined driver encoded
+ in this field by the HDF5 Library is identified by the
+ letters <code>NCSA</code> followed by the first four characters of
+ the driver name. If the Driver Information block is not
+ the original version then the last letter(s) of the
+ identification will be replaced by a version number in
+ ASCII, starting with 0.
+ </p>
+ <p>
+ Identification for user-defined drivers is also eight-byte long.
+ It can be arbitrary but should be unique to avoid
+ the four character prefix &ldquo;NCSA&rdquo;.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Driver Information</p></td>
+ <td>Driver information is stored in a format defined by the
+ file driver (see description below).</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <p>The two drivers encoded in the <em>Driver Identification</em>
+ field are as follows:</p>
+ <ul>
+ <li>
+ Multi driver:
+ <p>
+ The identifier for this driver is &ldquo;NCSAmulti&rdquo;.
+ This driver provides a mechanism for segregating raw data and different types of metadata
+ into multiple files.
+ These files are viewed by the library as a single virtual HDF5 file with a single file address.
+ A maximum of 6 files will be created for the following data:
+ superblock, B-tree, raw data, global heap, local heap, and object header.
+ More than one type of data can be written to the same file.
+ </p></li>
+ <li>
+ Family driver
+ <p>
+ The identifier for this driver is &ldquo;NCSAfami&rdquo; and is encoded in this field for library version 1.8 and after.
+ This driver is designed for systems that do not support files larger than 2 gigabytes
+ by splitting the HDF5 file address space across several smaller files.
+ It does nothing to segregate metadata and raw data;
+ they are mixed in the address space just as they would be in a single contiguous file.
+ </p></li>
+ </ul>
+ <p>The format of the <em>Driver Information</em> field for the
+ above two drivers are described below:</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Multi Driver Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ </tr>
+
+ <tr>
+ <td>Member Mapping</td>
+ <td>Member Mapping</td>
+ <td>Reserved</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Member File 1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of Address for Member File 1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Member File 2<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of Address for Member File 2<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />... ...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Member File N<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />End of Address for Member File N<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name of Member File 1
+ <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name of Member File 2
+ <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />... ...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name of Member File N
+ <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Multi Driver Information
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Member Mapping</p></td>
+ <td><p>These fields are integer values from 1 to 6
+ indicating how the data can be mapped to or merged with another type of
+ data.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Member Mapping</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>The superblock data.</td>
+ </tr>
+ <tr>
+ <td align="center">2</td>
+ <td>The B-tree data.</td>
+ </tr>
+ <tr>
+ <td align="center">3</td>
+ <td>The raw data.</td>
+ </tr>
+ <tr>
+ <td align="center">4</td>
+ <td>The global heap data.</td>
+ </tr>
+ <tr>
+ <td align="center">5</td>
+ <td>The local heap data.</td>
+ </tr>
+ <tr>
+ <td align="center">6</td>
+ <td>The object header data.</td>
+ </tr>
+ </table></p>
+ <p>For example, if the third field has the value 3 and all the rest have the
+ value 1, it means there are two files: one for raw data, and one for superblock,
+ B-tree, global heap, local heap, and object header.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td><p>These fields are reserved and should always be zero.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Member File N</p></td>
+ <td><p>This field Specifies the virtual address at which the member file starts.</p>
+ <p>N is the number of member files.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>End of Address for Member File N</p></td>
+ <td><p>This field is the end of the allocated address for the member file.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name of Member File N</p></td>
+ <td><p>This field is the null-terminated name of the member file and
+ its length should be multiples of 8 bytes.
+ Additional bytes will be padded with <em>NULL</em>s. The default naming
+ convention is <em>%s-X.h5</em>, where <em>X</em> is one of the letters
+ <em>s</em> (for superblock), <em>b</em> (for B-tree), <em>r</em> (for raw data),
+ <em>g</em> (for global heap), <em>l</em> (for local heap), and <em>o</em> (for
+ object header). The name of the whole HDF5 file will substitute the <em>%s</em>
+ in the string.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Family Driver Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="8"><br />Size of Member File<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Family Driver Information
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Size of Member File</p></td>
+ <td><p>This field is the size of the member file in the family of files.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <h3><a name="SuperblockExt">
+ II.C. Disk Format: Level 0C - Superblock Extension</a></h3>
+
+ <p>The <em>superblock extension</em> is used to store superblock metadata
+ which is either optional, or added after the version of the superblock
+ was defined. Superblock extensions may only exist when version 2
+ or later of the superblock is used. A superblock extension is an object
+ header which may hold the following messages:</p>
+ <ul>
+ <li>
+ <a href="#SOHMTableMessage">Shared Message Table message</a> containing
+ information to locate the master table of shared object header message
+ indices.</li>
+ <li>
+ <a href="#BtreeKValuesMessage">B-tree &lsquo;K&rsquo; Values message</a> containing
+ non-default B-tree &lsquo;K&rsquo; values.</li>
+ <li>
+ <a href="#DrvInfoMessage">Driver Info message</a> containing information
+ needed by the file driver in order to reopen a file.
+ See also the
+ <a href="#DriverInfo">&ldquo;Disk Format: Level 0B - File Driver
+ Info&rdquo;</a> section above.</li>
+ <li>
+ <a href="#FsinfoMessage">File Space Info message</a> containing
+ information about file space handling in the file.</li>
+ </ul>
+
+
+
+ <h2><a name="FileInfra">
+ III. Disk Format: Level 1 - File Infrastructure</a></h2>
+
+ <h3><a name="Btrees">
+ III.A. Disk Format: Level 1A - B-trees and B-tree Nodes</a></h3>
+
+ <p>B-trees allow flexible storage for objects which tend to grow
+ in ways that cause the object to be stored discontiguously. B-trees
+ are described in various algorithms books including &ldquo;Introduction to
+ Algorithms&rdquo; by Thomas H. Cormen, Charles E. Leiserson, and Ronald
+ L. Rivest. B-trees are used in several places in the HDF5 file format,
+ when an index is needed for another data structure.</p>
+
+ <p>The version 1 B-tree structure described below is the original
+ index structure. The version 1 B-trees are being phased out in
+ favor of the version 2 B-trees described below. Note that both
+ types of structures may be found in the same file depending on
+ the application settings when creating the file.</p>
+
+ <h4><a name="V1Btrees">
+ III.A.1. Disk Format: Level 1A1 - Version 1 B-trees</a></h4>
+
+ <p>Version 1 B-trees in HDF5 files are an implementation of the
+ B-link tree. The sibling nodes at a particular level in
+ the tree are stored in a doubly-linked list. See the
+ &ldquo;Efficient Locking for Concurrent Operations on B-trees&rdquo;
+ paper by Phillip Lehman and S. Bing Yao as published in the
+ <cite>ACM Transactions on Database Systems</cite>, Vol. 6, No. 4,
+ December 1981.</p>
+
+ <p>The B-trees implemented by the file format contain one more
+ key than the number of children. In other words, each child
+ pointer out of a B-tree node has a left key and a right key.
+ The pointers out of internal nodes point to sub-trees while
+ the pointers out of leaf nodes point to symbol nodes and
+ raw data chunks.
+ Aside from that difference, internal nodes and leaf nodes
+ are identical.</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: B-tree Nodes
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Node Type</td>
+ <td>Node Level</td>
+ <td colspan="2">Entries Used</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Left Sibling<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Right Sibling<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Child 1<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 2 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Child 2<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 2<em>K</em> <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Child 2<em>K</em><sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Key 2<em>K</em>+1
+ <em>(variable size)</em></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: B-tree Nodes
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>TREE</code>&rdquo;
+ is used to indicate the beginning of a B-tree node. This
+ gives file consistency checking utilities a better chance
+ of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Node Type</p></td>
+ <td>
+ <p>Each B-tree points to a particular type of data.
+ This field indicates the type of data as well as
+ implying the maximum degree <em>K</em> of the tree and
+ the size of each Key field.
+
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Node Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>This tree points to group nodes.</td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>This tree points to raw data chunk nodes.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Node Level</p></td>
+ <td>
+ <p>The node level indicates the level at which this node
+ appears in the tree (leaf nodes are at level zero). Not
+ only does the level indicate whether child pointers
+ point to sub-trees or to data, but it can also be used
+ to help file consistency checking utilities reconstruct
+ damaged trees.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Entries Used</p></td>
+ <td>
+ <p>This determines the number of children to which this
+ node points. All nodes of a particular type of tree
+ have the same maximum degree, but most nodes will point
+ to less than that number of children. The valid child
+ pointers and keys appear at the beginning of the node
+ and the unused pointers and keys appear at the end of
+ the node. The unused pointers and keys have undefined
+ values.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Address of Left Sibling</p></td>
+ <td>
+ <p>This is the relative file address of the left sibling of
+ the current node. If the current
+ node is the left-most node at this level then this field
+ is the <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Address of Right Sibling</p></td>
+ <td>
+ <p>This is the relative file address of the right sibling of
+ the current node. If the current
+ node is the right-most node at this level then this
+ field is the <a href="#UndefinedAddress">undefined address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Keys and Child Pointers</p></td>
+ <td>
+ <p>Each tree has 2<em>K</em>+1 keys with 2<em>K</em>
+ child pointers interleaved between the keys. The number
+ of keys and child pointers actually containing valid
+ values is determined by the node&rsquo;s <em>Entries
+ Used</em> field. If that field is <em>N</em>, then the
+ B-tree contains <em>N</em> child pointers and
+ <em>N</em>+1 keys.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Key</p></td>
+ <td>
+ <p>The format and size of the key values is determined by
+ the type of data to which this tree points. The keys are
+ ordered and are boundaries for the contents of the child
+ pointer; that is, the key values represented by child
+ <em>N</em> fall between Key <em>N</em> and Key
+ <em>N</em>+1. Whether the interval is open or closed on
+ each end is determined by the type of data to which the
+ tree points.
+ </p>
+
+ <p>
+ The format of the key depends on the node type.
+ For nodes of node type 0 (group nodes), the key is formatted as
+ follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">A single field of
+ <i><a href="#SizeOfLengthsV0">Size of Lengths</a></i>
+ bytes:</td>
+ <td width="80%">Indicates the byte offset into the local heap
+ for the first object name in the subtree which
+ that key describes.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+
+ <p>
+ For nodes of node type 1 (chunked raw data nodes), the key is
+ formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-4:</td>
+ <td width="80%">Size of chunk in bytes.</td>
+ </tr>
+ <tr>
+ <td>Bytes 4-8:</td>
+ <td>Filter mask, a 32-bit bit field indicating which
+ filters have been skipped for this chunk. Each filter
+ has an index number in the pipeline (starting at 0, with
+ the first filter to apply) and if that filter is skipped,
+ the bit corresponding to its index is set.</td>
+ </tr>
+ <tr>
+ <td>(<em>D + 1</em>) 64-bit fields:</td>
+ <td>The offset of the
+ chunk within the dataset where <i>D</i> is the number
+ of dimensions of the dataset, and the last value is the
+ offset within the dataset&rsquo;s datatype and should
+ always be zero. For example, if
+ a chunk in a 3-dimensional dataset begins at the
+ position <code>[5,5,5]</code>, there will be three
+ such 64-bit values, each with the value of
+ <code>5</code>, followed by a <code>0</code> value.</td>
+ </tr>
+ </table>
+ </p>
+
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Child Pointer</p></td>
+ <td>
+ <p>The tree node contains file addresses of subtrees or
+ data depending on the node level. Nodes at Level 0 point
+ to data addresses, either raw data chunks or group nodes.
+ Nodes at non-zero levels point to other nodes of the
+ same B-tree.
+ </p>
+ <p>For raw data chunk nodes, the child pointer is the address
+ of a single raw data chunk. For group nodes, the child pointer
+ points to a <a href="#SymbolTable">symbol table</a>, which contains
+ information for multiple symbol table entries.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <p>
+ Conceptually, each B-tree node looks like this:</p>
+ <center>
+ <table>
+ <tr valign="top" align="center">
+ <td>key[0]</td><td>&nbsp;</td>
+ <td>child[0]</td><td>&nbsp;</td>
+ <td>key[1]</td><td>&nbsp;</td>
+ <td>child[1]</td><td>&nbsp;</td>
+ <td>key[2]</td><td>&nbsp;</td>
+ <td>...</td><td>&nbsp;</td>
+ <td>...</td><td>&nbsp;</td>
+ <td>key[<i>N</i>-1]</td><td>&nbsp;</td>
+ <td>child[<i>N</i>-1]</td><td>&nbsp;</td>
+ <td>key[<i>N</i>]</td>
+ </tr>
+ </table>
+ </center>
+ <br />
+
+ where child[<i>i</i>] is a pointer to a sub-tree (at a level
+ above Level 0) or to data (at Level 0).
+ Each key[<i>i</i>] describes an <i>item</i> stored by the B-tree
+ (a chunk or an object of a group node). The range of values
+ represented by child[<i>i</i>] is indicated by key[<i>i</i>]
+ and key[<i>i</i>+1].
+
+
+ <p>The following question must next be answered:
+ &ldquo;Is the value described by key[<i>i</i>] contained in
+ child[<i>i</i>-1] or in child[<i>i</i>]?&rdquo;
+ The answer depends on the type of tree.
+ In trees for groups (node type 0), the object described by
+ key[<i>i</i>] is the greatest object contained in
+ child[<i>i</i>-1] while in chunk trees (node type 1) the
+ chunk described by key[<i>i</i>] is the least chunk in
+ child[<i>i</i>].</p>
+
+ <p>That means that key[0] for group trees is sometimes unused;
+ it points to offset zero in the heap, which is always the
+ empty string and compares as &ldquo;less-than&rdquo; any valid
+ object name.</p>
+
+ <p>And key[<i>N</i>] for chunk trees is sometimes unused;
+ it contains a chunk offset which compares as &ldquo;greater-than&rdquo;
+ any other chunk offset and has a chunk byte size of zero
+ to indicate that it is not actually allocated.</p>
+
+ <h4><a name="V2Btrees">
+ III.A.2. Disk Format: Level 1A2 - Version 2 B-trees</a></h4>
+
+ <p>Version 2 (v2) B-trees are &ldquo;traditional&rdquo; B-trees
+ with one major difference. Instead of just using a simple pointer
+ (or address in the file) to a child of an internal node, the pointer
+ to the child node contains two additional pieces of information:
+ the number of records in the child node itself, and the total number
+ of records in the child node and all its descendants. Storing this
+ additional information allows fast array-like indexing to locate
+ the n<sup>th</sup> record in the B-tree.</p>
+
+ <p>The entry into a version 2 B-tree is a header which contains global
+ information about the structure of the B-tree. The <em>root node
+ address</em>
+ field in the header points to the B-tree root node, which is either an
+ internal or leaf node, depending on the value in the header&rsquo;s
+ <em>depth</em> field. An internal node consists of records plus
+ pointers to further leaf or internal nodes in the tree. A leaf node
+ consists of solely of records. The format of the records depends on
+ the B-tree type (stored in the header).</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Node Size</td>
+ </tr>
+ <tr>
+ <td colspan="2">Record Size</td>
+ <td colspan="2">Depth</td>
+ </tr>
+ <tr>
+ <td>Split Percent</td>
+ <td>Merge Percent</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Root Node Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="2">Number of Records in Root Node</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Total Number of Records in B-tree<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree Header
+ </caption>
+
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>BTHD</code>&rdquo;
+ is used to indicate the header of a version 2 (v2) B-tree
+ node.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this B-tree header. This document
+ describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field indicates the type of B-tree:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>This B-tree is used for testing only. This
+ value should <em>not</em> be used for storing
+ records in actual HDF5 files.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>This B-tree is used for indexing indirectly accessed,
+ non-filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">2</td>
+ <td>This B-tree is used for indexing indirectly accessed,
+ filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">3</td>
+ <td>This B-tree is used for indexing directly accessed,
+ non-filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">4</td>
+ <td>This B-tree is used for indexing directly accessed,
+ filtered &lsquo;huge&rsquo; fractal heap objects.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">5</td>
+ <td>This B-tree is used for indexing the &lsquo;name&rsquo; field for
+ links in indexed groups.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">6</td>
+ <td>This B-tree is used for indexing the &lsquo;creation order&rsquo;
+ field for links in indexed groups.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">7</td>
+ <td>This B-tree is used for indexing shared object header
+ messages.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">8</td>
+ <td>This B-tree is used for indexing the &lsquo;name&rsquo; field for
+ indexed attributes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">9</td>
+ <td>This B-tree is used for indexing the &lsquo;creation order&rsquo;
+ field for indexed attributes.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center">10</td>
+ <td>This B-tree is used for indexing chunks of
+ datasets with no filters and with more than one
+ dimension of unlimited extent.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center">11</td>
+ <td>This B-tree is used for indexing chunks of
+ datasets with filters and more than one dimension
+ of unlimited extent.
+ </td>
+ </tr>
+ </table></p>
+ <p>The format of records for each type is described below.</p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Node Size</p></td>
+ <td>
+ <p>This is the size in bytes of all B-tree nodes.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Record Size</p></td>
+ <td>
+ <p>This field is the size in bytes of the B-tree record.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Depth</p></td>
+ <td>
+ <p>This is the depth of the B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Split Percent</p></td>
+ <td>
+ <p>The percent full that a node needs to increase above before it
+ is split.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Merge Percent</p></td>
+ <td>
+ <p>The percent full that a node needs to be decrease below before it
+ is split.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Root Node Address</p></td>
+ <td>
+ <p>This is the address of the root B-tree node. A B-tree with
+ no records will have the <a href="#UndefinedAddress">undefined
+ address</a> in this field.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Number of Records in Root Node</p></td>
+ <td>
+ <p>This is the number of records in the root node.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Total Number of Records in B-tree</p></td>
+ <td>
+ <p>This is the total number of records in the entire B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the B-tree header.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree Internal Node
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2">Records 0, 1, 2...N-1 <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Child Node Pointer 0<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Number of Records N<sub>0</sub> for Child
+ Node 0 <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Total Number of Records for Child Node 0
+ <em>(optional, variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Child Node Pointer 1<sup>O</sup><br /><br /></td>
+ </tr>
+ <td colspan="4"><br />Number of Records N<sub>1</sub> for
+ Child Node 1 <em>(variable size)</em></td>
+</tr>
+<tr>
+ <td colspan="4"><br />Total Number of Records for Child Node 1
+ <em>(optional, variable size)</em></td>
+</tr>
+<tr>
+ <td colspan="4">...</td>
+</tr>
+<tr>
+ <td colspan="4"><br />Child Node Pointer N<sup>O</sup><br /><br /></td>
+</tr>
+<tr>
+ <td colspan="4"><br />Number of Records N<sub>n</sub> for
+ Child Node N <em>(variable size)</em></td>
+</tr>
+<tr>
+ <td colspan="4"><br />Total Number of Records for Child Node N
+ <em>(optional, variable size)</em></td>
+</tr>
+<tr>
+ <td colspan="4">Checksum</td>
+</tr>
+</table>
+
+<table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+</table>
+</div>
+
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree Internal Node
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>BTIN</code>&rdquo; is
+ used to indicate the internal node of a B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this B-tree internal node.
+ This document describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field is the type of the B-tree node. It should always
+ be the same as the B-tree type in the header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Records</p></td>
+ <td>
+ <p>The size of this field is determined by the number of records
+ for this node and the record size (from the header). The format
+ of records depends on the type of B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Child Node Pointer</p></td>
+ <td>
+ <p>This field is the address of the child node pointed to by the
+ internal node.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Records in Child Node</p></td>
+ <td>
+ <p>This is the number of records in the child node pointed to by
+ the corresponding <em>Node Pointer</em>.
+ </p>
+ <p>The number of bytes used to store this field is determined by
+ the maximum possible number of records able to be stored in the
+ child node.
+ </p>
+ <p>
+ The maximum number of records in a child node is computed
+ in the following way:
+
+ <ul>
+ <li>Subtract the fixed size overhead for
+ the child node (for example, its signature, version,
+ checksum, and so on and <em>one</em> pointer triplet
+ of information for the child node (because there is one
+ more pointer triplet than records in each internal node))
+ from the size of nodes for the B-tree. </li>
+ <li>Divide that result by the size of a record plus the
+ pointer triplet of information stored to reach each
+ child node from this node.</li>
+ </ul>
+
+ </p>
+ <p>
+ Note that leaf nodes do not encode any
+ child pointer triplets, so the maximum number of records in a
+ leaf node is just the node size minus the leaf node overhead,
+ divided by the record size.
+ </p>
+ <p>
+ Also note that the first level of internal nodes above the
+ leaf nodes do not encode the <em>Total Number of Records in Child
+ Node</em> value in the child pointer triplets (since it is the
+ same as the <em>Number of Records in Child Node</em>), so the
+ maximum number of records in these nodes is computed with the
+ equation above, but using (<em>Child Pointer</em>, <em>Number of
+ Records in Child Node</em>) pairs instead of triplets.
+ </p>
+ <p>
+ The number of
+ bytes used to encode this field is the least number of bytes
+ required to encode the maximum number of records in a child
+ node value for the child nodes below this level
+ in the B-tree.
+ </p>
+ <p>
+ For example, if the maximum number of child records is
+ 123, one byte will be used to encode these values in this
+ node; if the maximum number of child records is
+ 20000, two bytes will be used to encode these values in this
+ node; and so on. The maximum number of bytes used to
+ encode these values is 8 (in other words, an unsigned
+ 64-bit integer).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Number of Records in Child Node</p></td>
+ <td>
+ <p>This is the total number of records for the node pointed to by
+ the corresponding <em>Node Pointer</em> and all its children.
+ This field exists only in nodes whose depth in the B-tree node
+ is greater than 1 (in other words, the &ldquo;twig&rdquo;
+ internal nodes, just above leaf nodes, do not store this
+ field in their child node pointers).
+ </p>
+ <p>The number of bytes used to store this field is determined by
+ the maximum possible number of records able to be stored in the
+ child node and its descendants.
+ </p>
+ <p>
+ The maximum possible number of records able to be stored in a
+ child node and its descendants is computed iteratively, in the
+ following way: The maximum number of records in a leaf node
+ is computed, then that value is used to compute the maximum
+ possible number of records in the first level of internal nodes
+ above the leaf nodes. Multiplying these two values together
+ determines the maximum possible number of records in child node
+ pointers for the level of nodes two levels above leaf nodes.
+ This process is continued up to any level in the B-tree.
+ </p>
+ <p>
+ The number of bytes used to encode this value is computed in
+ the same way as for the <em>Number of Records in Child Node</em>
+ field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for this node.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree Leaf Node
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2">Record 0, 1, 2...N-1 <em>(variable size)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree Leaf Node
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>BTLF</code>&ldquo;
+ is used to indicate the leaf node of a version 2 (v2) B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this B-tree leaf node.
+ This document describes version 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field is the type of the B-tree node. It should always
+ be the same as the B-tree type in the header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Records</p></td>
+ <td>
+ <p>The size of this field is determined by the number of records
+ for this node and the record size (from the header). The format
+ of records depends on the type of B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for this node.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<p>The record layout for each stored (in other words, non-testing)
+ B-tree type is as follows:</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 1 Record Layout - Indirectly
+ Accessed, Non-filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object ID<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 1 Record Layout - Indirectly
+ Accessed, Non-filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Address</p></td>
+ <td>
+ <p>The address of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Length</p></td>
+ <td>
+ <p>The length of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object ID</p></td>
+ <td>
+ <p>The heap ID for the huge object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 2 Record Layout - Indirectly
+ Accessed, Filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Memory Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object ID<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 2 Record Layout - Indirectly
+ Accessed, Filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Address</p></td>
+ <td>
+ <p>The address of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Length</p></td>
+ <td>
+ <p>The length of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td>
+ <p>A 32-bit bit field indicating which filters have been skipped for
+ this chunk. Each filter has an index number in the pipeline
+ (starting at 0, with the first filter to apply) and if that
+ filter is skipped, the bit corresponding to its index is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Memory Size</p></td>
+ <td>
+ <p>The size of the de-filtered huge object in memory.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object ID</p></td>
+ <td>
+ <p>The heap ID for the huge object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 3 Record Layout - Directly
+ Accessed, Non-filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 3 Record Layout - Directly
+ Accessed, Non-filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Address</p></td>
+ <td>
+ <p>The address of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Huge Object Length</p></td>
+ <td>
+ <p>The length of the huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 4 Record Layout - Directly
+ Accessed, Filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Length<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Filtered Huge Object Memory Size<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 4 Record Layout - Directly
+ Accessed, Filtered, &lsquo;Huge&rsquo; Fractal Heap Objects
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Address</p></td>
+ <td>
+ <p>The address of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Length</p></td>
+ <td>
+ <p>The length of the filtered huge object in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td>
+ <p>A 32-bit bit field indicating which filters have been skipped for
+ this chunk. Each filter has an index number in the pipeline
+ (starting at 0, with the first filter to apply) and if that
+ filter is skipped, the bit corresponding to its index is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Huge Object Memory Size</p></td>
+ <td>
+ <p>The size of the de-filtered huge object in memory.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 5 Record Layout - Link Name
+ for Indexed Group
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Hash of Name</td>
+ </tr>
+ <tr>
+ <td colspan="4">ID <em>(bytes 1-4)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="3">ID <em>(bytes 5-7)</em></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 5 Record Layout - Link Name
+ for Indexed Group
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the name for the link. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the link&rsquo;s name.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>ID</p></td>
+ <td>
+ <p>This is a 7-byte sequence of bytes and is the heap ID for the
+ link record in the group&rsquo;s fractal heap.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 6 Record Layout - Creation
+ Order for Indexed Group
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Creation Order
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">ID <em>(bytes 1-4)</em></td>
+ </tr>
+ <tr>
+ <td colspan="3">ID <em>(bytes 5-7)</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 6 Record Layout - Creation
+ Order for Indexed Group
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td>
+ <p>This field is the creation order value for the link.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>ID</p></td>
+ <td>
+ <p>This is a 7-byte sequence of bytes and is the heap ID for the
+ link record in the group&rsquo;s fractal heap.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 7 Record Layout - Shared
+ Object Header Messages (Sub-type 0 - Message in Heap)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Hash</td>
+ </tr>
+ <tr>
+ <td colspan="4">Reference Count</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Heap ID <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 7 Record Layout - Shared
+ Object Header Messages (Sub-type 0 - Message in Heap)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This field Indicates the location where the message is stored:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>Shared message is stored in shared message index heap.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>Shared message is stored in object header.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the shared message. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the shared message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td>
+ <p>The number of objects which reference this message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte sequence of bytes and is the heap ID for the
+ shared message in the shared message index&rsquo;s fractal heap.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 7 Record Layout - Shared
+ Object Header Messages (Sub-type 1 - Message in Object Header)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Hash</td>
+ </tr>
+ <tr>
+ <td>Reserved (zero)</td>
+ <td>Message Type</td>
+ <td colspan="2">Object Header Index</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 7 Record Layout - Shared
+ Object Header Messages (Sub-type 1 - Message in Object Header)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This field Indicates the location where the message is stored:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>Shared message is stored in shared message index heap.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>Shared message is stored in object header.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the shared message. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the shared message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Type</p></td>
+ <td>
+ <p>The object header message type of the shared message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Index</p></td>
+ <td>
+ <p>This field indicates that the shared message is the n<sup>th</sup> message
+ of its type in the specified object header.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Address</p></td>
+ <td>
+ <p>The address of the object header containing the shared message.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 8 Record Layout - Attribute
+ Name for Indexed Attributes
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap ID <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan>Message Flags</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Creation Order</td>
+ </tr>
+ <tr>
+ <td colspan="4">Hash of Name</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 8 Record Layout - Attribute
+ Name for Indexed Attributes
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte sequence of bytes and is the heap ID for the
+ attribute in the object&rsquo;s attribute fractal heap.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Flags</p></td>
+ <td><p>The object header message flags for the attribute message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td>
+ <p>This field is the creation order value for the attribute.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash</p></td>
+ <td>
+ <p>This field is hash value of the name for the attribute. The hash
+ value is the Jenkins&rsquo; lookup3 checksum algorithm applied to
+ the attribute&rsquo;s name.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree, Type 9 Record Layout - Creation
+ Order for Indexed Attributes
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap ID <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan>Message Flags</td>
+ <td colspan="3" bgcolor="#DDDDDD">
+ <em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Creation Order</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 9 Record Layout - Creation
+ Order for Indexed Attributes
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte sequence of bytes and is the heap ID for the
+ attribute in the object&rsquo;s attribute fractal heap.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Flags</p></td>
+ <td>
+ <p>The object header message flags for the attribute message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td>
+ <p>This field is the creation order value for the attribute.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<a name="V2BtType10"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ <a name="V2BtreesType10"></a>
+ Layout: Version 2 B-tree, Type 10 Record Layout -
+ Non-filtered Dataset Chunks
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension 0 Scaled Offset
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension 1 Scaled Offset
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension #n Scaled Offset
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 10 Record Layout -
+ Non-filtered Dataset Chunks
+</caption>
+<tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+</tr>
+
+<tr>
+ <td><p>Address</p></td>
+ <td>
+ <p>This field is the address of the dataset chunk in the file.</p>
+ </td>
+</tr>
+
+<tr>
+ <td><p>Dimension #n Scaled Offset</p></td>
+ <td>
+ <p>This field is the scaled offset of the chunk within the
+ dataset. <em>n</em> is the number of dimensions for the
+ dataset. The first scaled offset stored in the list is for
+ the slowest changing dimension, and the last scaled offset
+ stored is for the fastest changing dimension. Scaled offset
+ is calculated by dividing the chunk dimension sizes into
+ the chunk offsets.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ <a name="V2BtreesType11"></a>
+ Layout: Version 2 B-tree, Type 11 Record Layout - Filtered
+ Dataset Chunks
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Chunk Size
+ <em>(variable size; at most 8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension 0 Scaled Offset
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension 1 Scaled Offset
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension #n Scaled Offset
+ <em>(8 bytes)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree, Type 11 Record Layout - Filtered
+ Dataset Chunks
+</caption>
+<tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+</tr>
+
+<tr>
+ <td><p>Address</p></td>
+ <td>
+ <p>This field is the address of the dataset chunk in the file.</p>
+ </td>
+</tr>
+
+<tr>
+ <td><p>Chunk Size</p></td>
+ <td>
+ <p>This field is the size of the dataset chunk in bytes.</p>
+ </td>
+</tr>
+
+<tr>
+ <td><p>Filter Mask</p></td>
+ <td>
+ <p>This field is the filter mask which indicates the filter
+ to skip for the dataset chunk. Each filter has an index
+ number in the pipeline and if that filter is skipped,
+ the bit corresponding to its index is set.</p>
+ </td>
+</tr>
+
+<tr>
+ <td><p>Dimension #n Scaled Offset</p></td>
+ <td>
+ <p>This field is the scaled offset of the chunk within
+ the dataset. <em>n</em> is the number of dimensions for
+ the dataset. The first scaled offset stored in the list
+ is for the slowest changing dimension, and the last scaled
+ offset stored is for the fastest changing dimension.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<h3><a name="SymbolTable">
+ III.B. Disk Format: Level 1B - Group Symbol Table Nodes</a></h3>
+
+<p>A group is an object internal to the file that allows
+ arbitrary nesting of objects within the file (including other
+ groups). A group maps a set of link names in the group to a set
+ of relative file addresses of objects in the file. Certain metadata
+ for an object to which the group points can be cached in the
+ group&rsquo;s symbol table entry in addition to being in the
+ object&rsquo;s header.</p>
+
+<p>An HDF5 object name space can be stored hierarchically by
+ partitioning the name into components and storing each
+ component as a link in a group. The link for a
+ non-ultimate component points to the group containing
+ the next component. The link for the last
+ component points to the object being named.</p>
+
+<p>One implementation of a group is a collection of symbol table
+ nodes indexed by a B-tree. Each symbol table node contains entries
+ for one or more links. If an attempt is made to add a link to an
+ already full symbol table node containing 2<em>K</em> entries, then
+ the node is split and one node contains <em>K</em> symbols and the
+ other contains <em>K</em>+1 symbols.</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Symbol Table Node (A Leaf of a B-tree)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version Number</td>
+ <td>Reserved <em>(zero)</em></td>
+ <td colspan="2">Number of Symbols</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Group Entries<br /><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Symbol Table Node (A Leaf of a B-tree)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>SNOD</code>&rdquo; is
+ used to indicate the
+ beginning of a symbol table node. This gives file
+ consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version Number</p></td>
+ <td>
+ <p>The version number for the symbol table node. This
+ document describes version 1. (There is no version &lsquo;0&rsquo;
+ of the symbol table node)
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Entries</p></td>
+ <td>
+ <p>Although all symbol table nodes have the same length,
+ most contain fewer than the maximum possible number of
+ link entries. This field indicates how many entries
+ contain valid data. The valid entries are packed at the
+ beginning of the symbol table node while the remaining
+ entries contain undefined values.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Symbol Table Entries</p></td>
+ <td>
+ <p>Each link has an entry in the symbol table node.
+ The format of the entry is described below.
+ There are 2<em>K</em> entries in each group node, where
+ <em>K</em> is the &ldquo;Group Leaf Node K&rdquo; value from the
+ <a href="#Superblock">superblock</a>.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h3><a name="SymbolTableEntry">
+ III.C. Disk Format: Level 1C - Symbol Table Entry </a></h3>
+
+<p>Each symbol table entry in a symbol table node is designed
+ to allow for very fast browsing of stored objects.
+ Toward that design goal, the symbol table entries
+ include space for caching certain constant metadata from the
+ object header.</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Symbol Table Entry
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Link Name Offset<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Cache Type</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Scratch-pad Space
+ <em>(16 bytes)</em><br /><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Symbol Table Entry
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Link Name Offset</p></td>
+ <td>
+ <p>This is the byte offset into the group&rsquo;s local
+ heap for the name of the link. The name is null
+ terminated.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Address</p></td>
+ <td>
+ <p>Every object has an object header which serves as a
+ permanent location for the object&rsquo;s metadata. In addition
+ to appearing in the object header, some of the object&rsquo;s metadata
+ can be cached in the scratch-pad space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Cache Type</p></td>
+ <td>
+ <p>The cache type is determined from the object header.
+ It also determines the format for the scratch-pad space:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td>No data is cached by the group entry. This
+ is guaranteed to be the case when an object header
+ has a link count greater than one.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td>Group object header metadata is cached in the
+ scratch-pad space. This implies that the symbol table
+ entry refers to another group.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">2</td>
+ <td>The entry is a symbolic link. The first four bytes
+ of the scratch-pad space are the offset into the local
+ heap for the link value. The object header address
+ will be undefined.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td>
+ <p>These four bytes are present so that the scratch-pad
+ space is aligned on an eight-byte boundary. They are
+ always set to zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Scratch-pad Space</p></td>
+ <td>
+ <p>This space is used for different purposes, depending
+ on the value of the Cache Type field. Any metadata
+ about an object represented in the scratch-pad
+ space is duplicated in the object header for that
+ object.
+ </p>
+ <p>
+ Furthermore, no data is cached in the group
+ entry scratch-pad space if the object header for
+ the object has a link count greater than one.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h4>Format of the Scratch-pad Space</h4>
+
+<p>The symbol table entry scratch-pad space is formatted
+ according to the value in the Cache Type field.</p>
+
+<p>If the Cache Type field contains the value zero
+ <code>(0)</code> then no information is
+ stored in the scratch-pad space.</p>
+
+<p>If the Cache Type field contains the value one
+ <code>(1)</code>, then the scratch-pad space
+ contains cached metadata for another object header
+ in the following format:</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Object Header Scratch-pad Format
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of B-tree<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Name Heap<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Object Header Scratch-pad Format
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address of B-tree</p></td>
+ <td>
+ <p>This is the file address for the root of the
+ group&rsquo;s B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Name Heap</p></td>
+ <td>
+ <p>This is the file address for the group&rsquo;s local
+ heap, in which are stored the group&rsquo;s symbol names.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+
+<br />
+<br />
+<br />
+<p>If the Cache Type field contains the value two
+ <code>(2)</code>, then the scratch-pad space
+ contains cached metadata for a symbolic link
+ in the following format:</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Symbolic Link Scratch-pad Format
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Offset to Link Value</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Symbolic Link Scratch-pad Format
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Offset to Link Value</p></td>
+ <td>
+ <p>The value of a symbolic link (that is, the name of the
+ thing to which it points) is stored in the local heap.
+ This field is the 4-byte offset into the local heap for
+ the start of the link value, which is null terminated.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h3><a name="LocalHeap">
+ III.D. Disk Format: Level 1D - Local Heaps</a></h3>
+
+<p>A local heap is a collection of small pieces of data that are particular
+ to a single object in the HDF5 file. Objects can be
+ inserted and removed from the heap at any time.
+ The address of a heap does not change once the heap is created.
+ For example, a group stores addresses of objects in symbol table nodes
+ with the names of links stored in the group&rsquo;s local heap.
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Local Heap
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Segment Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset to Head of Free-list<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Data Segment<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Local Heap
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>HEAP</code>&rdquo;
+ is used to indicate the
+ beginning of a heap. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>Each local heap has its own version number so that new
+ heaps can be added to old files. This document
+ describes version zero (0) of the local heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Segment Size</p></td>
+ <td>
+ <p>The total amount of disk memory allocated for the heap
+ data. This may be larger than the amount of space
+ required by the objects stored in the heap. The extra
+ unused space in the heap holds a linked list of free blocks.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset to Head of Free-list</p></td>
+ <td>
+ <p>This is the offset within the heap data segment of the
+ first free block (or the
+ <a href="#UndefinedAddress">undefined address</a> if there is no
+ free block). The free block contains
+ <a href="#SizeOfLengthsV0">Size of Lengths</a> bytes that
+ are the offset of the next free block (or the
+ value &lsquo;1&rsquo; if this is the
+ last free block) followed by Size of Lengths bytes that store
+ the size of this free block. The size of the free block includes
+ the space used to store the offset of the next free block and
+ the size of the current block, making the minimum size of a free
+ block 2 * Size of Lengths.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Data Segment</p></td>
+ <td>
+ <p>The data segment originally starts immediately after
+ the heap header, but if the data segment must grow as a
+ result of adding more objects, then the data segment may
+ be relocated, in its entirety, to another part of the
+ file.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<p>Objects within a local heap should be aligned on an 8-byte boundary.</p>
+
+<h3><a name="GlobalHeap">
+ III.E. Disk Format: Level 1E - Global Heap</a></h3>
+
+<p>Each HDF5 file has a global heap which stores various types of
+ information which is typically shared between datasets. The
+ global heap was designed to satisfy these goals:</p>
+
+<ol type="A">
+ <li>Repeated access to a heap object must be efficient without
+ resulting in repeated file I/O requests. Since global heap
+ objects will typically be shared among several datasets, it is
+ probable that the object will be accessed repeatedly.</li>
+ <li>Collections of related global heap objects should result in
+ fewer and larger I/O requests. For instance, a dataset of
+ object references will have a global heap object for each
+ reference. Reading the entire set of object references
+ should result in a few large I/O requests instead of one small
+ I/O request for each reference.</li>
+ <li>It should be possible to remove objects from the global heap
+ and the resulting file hole should be eligible to be reclaimed
+ for other uses.</li>
+</ol>
+
+
+<p>The implementation of the heap makes use of the memory management
+ already available at the file level and combines that with a new
+ object called a <em>collection</em> to achieve goal B. The global heap
+ is the set of all collections. Each global heap object belongs to
+ exactly one collection, and each collection contains one or more global
+ heap objects. For the purposes of disk I/O and caching, a collection is
+ treated as an atomic object, addressing goal A.
+</p>
+
+<p>When a global heap object is deleted from a collection (which
+ occurs when its reference count falls to zero), objects located
+ after the deleted object in the collection are packed down toward
+ the beginning of the collection, and the collection&rsquo;s
+ global heap object 0 is created (if possible), or its size is
+ increased to account for the recently freed space. There are
+ no gaps between objects in each collection, with the possible
+ exception of the final space in the collection, if it is not
+ large enough to hold the header for the collection&rsquo;s
+ global heap object 0. These features address goal C.
+</p>
+
+<p>The HDF5 Library creates global heap collections as needed, so there may
+ be multiple collections throughout the file. The set of all of them is
+ abstractly called the &ldquo;global heap&rdquo;, although they do not actually link
+ to each other, and there is no global place in the file where you can
+ discover all of the collections. The collections are found simply by
+ finding a reference to one through another object in the file. For
+ example, data of variable-length datatype elements is stored in the
+ global heap and is accessed via a global heap ID. The format for
+ global heap IDs is described at the end of this section.
+</p>
+
+<p>For more information on global heaps for virtual datasets, see
+ <a href="#GlobalHeapVDS">&ldquo;Disk Format: Level 1F - Global Heap
+ Block for Virtual Datasets.&rdquo;</a></p>
+<br />
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: A Global Heap Collection
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Collection Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object 1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object 2<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />...<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object <em>N</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Global Heap Object 0 (free space)<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: A Global Heap Collection
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>GCOL</code>&rdquo;
+ is used to indicate the
+ beginning of a collection. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>Each collection has its own version number so that new
+ collections can be added to old files. This document
+ describes version one (1) of the collections (there is no
+ version zero (0)).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Collection Size</p></td>
+ <td>
+ <p>This is the size in bytes of the entire collection
+ including this field. The default (and minimum)
+ collection size is 4096 bytes which is a typical file
+ system block size. This allows for 127 16-byte heap
+ objects plus their overhead (the collection header of 16 bytes
+ and the 16 bytes of information about each heap object).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Global Heap Object 1 through <em>N</em></p></td>
+ <td>
+ <p>The objects are stored in any order with no
+ intervening unused space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Global Heap Object 0</p></td>
+ <td>
+ <p>Global Heap Object 0 (zero), when present, represents the free
+ space in the collection. Free space always appears at the end of
+ the collection. If the free space is too small to store the header
+ for Object 0 (described below) then the header is implied and is not
+ written.
+ <p>
+ The field <em>Object Size</em> for Object 0 indicates the
+ amount of possible free space in the collection including the 16-byte
+ header size of Object 0.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Global Heap Object
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Heap Object Index</td>
+ <td colspan="2">Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Data<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Global Heap Object
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Heap Object Index</p></td>
+ <td>
+ <p>Each object has a unique identification number within a
+ collection. The identification numbers are chosen so that
+ new objects have the smallest value possible with the
+ exception that the identifier <code>0</code> always refers to the
+ object which represents all free space within the
+ collection.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td>
+ <p>All heap objects have a reference count field. An
+ object which is referenced from some other part of the
+ file will have a positive reference count. The reference
+ count for Object 0 is always zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td>
+ <p>Zero padding to align next field on an 8-byte boundary.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Size</p></td>
+ <td>
+ <p>This is the size of the object data stored for the object.
+ The actual storage space allocated for the object data is rounded
+ up to a multiple of eight.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Data</p></td>
+ <td>
+ <p>The object data is treated as a one-dimensional array
+ of bytes to be interpreted by the caller.
+ </p>
+ </td>
+ </tr>
+ </table>
+
+</div>
+
+<br />
+<br />
+<br />
+<p>
+ <a name="GlobalHeapID"></a>
+ The format for the ID used to locate an object in the global heap is
+ described here:</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Global Heap ID
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Collection Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Object Index</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Global Heap ID
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Collection Address</p></td>
+ <td>
+ <p>This field is the address of the global heap collection
+ where the data object is stored.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>ID</p></td>
+ <td>
+ <p>This field is the index of the data object within the
+ global heap collection.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+
+
+<h3><a name="GlobalHeapVDS"> III.F. Disk Format: Level 1F - Global
+ Heap Block for Virtual Datasets</a></h3>
+
+<p>The layout for the global heap block used with virtual datasets is
+ described below. For more information on global heaps, see
+ <a href="#GlobalHeap"></a>&ldquo;Disk Format: Level 1E - Global Heap.&rdquo;</p>
+
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Global Heap Block for Virtual Dataset
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Num Entries<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Source Filename #1 <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Source Dataset #1 <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Source Selection #1 <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Virtual Selection #1 <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Source Filename #n <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Source Dataset #n <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Source Selection #n <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Virtual Selection #n <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Global Heap Block for Virtual Dataset
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for the block; the value is 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Num Entries</p></td>
+ <td><p>The number of entries in the block.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Source Filename #n</p></td>
+ <td>
+ <p>The source file name where the source dataset is located.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Source Dataset #n</p></td>
+ <td><p>The source dataset name that is mapped to the
+ virtual dataset.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Source Selection #n</p></td>
+ <td>
+ <p>The <a href="#DataspaceSEL">dataspace selection</a> in the
+ source dataset that is mapped to the virtual selection.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Virtual Selection #n</p></td>
+ <td>
+ <p>This is the <a href="#DataspaceSEL">dataspace selection</a> in the virtual dataset that is
+ mapped to the source selection.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the block.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+<br>
+
+<h3><a name="FractalHeap">
+ III.G. Disk Format: Level 1G - Fractal Heap</a></h3>
+
+<p>
+ Each fractal heap consists of a header and zero or more direct and
+ indirect blocks (described below). The header contains general
+ information as well as
+ initialization parameters for the doubling table. The <em>Address
+ of Root Block</em> field in the header points to the first direct or
+ indirect block in the heap.
+</p>
+
+<p>
+ Fractal heaps are based on a data structure called a <em>doubling
+ table</em>. A doubling table provides a mechanism for quickly
+ extending an array-like data structure that minimizes the number of
+ empty blocks in the heap, while retaining very fast lookup of any
+ element within the array. More information on fractal heaps and
+ doubling tables can be found in the RFC
+ &ldquo;<a href="Supplements/FractalHeap/PrivateHeap.pdf">Private
+ Heaps in HDF5</a>.&rdquo;
+</p>
+
+<p>
+ The fractal heap implements the doubling table structure with
+ indirect and direct blocks.
+ Indirect blocks in the heap do not actually contain data for
+ objects in the heap, their &ldquo;size&rdquo; is abstract -
+ they represent the indexing structure for locating the
+ direct blocks in the doubling table.
+ Direct blocks
+ contain the actual data for objects stored in the heap.
+</p>
+
+<p>
+ All indirect blocks have a constant number of block entries in each
+ row, called the <em>width</em> of the doubling table
+ (see <em>Table Width</em> field in the header).
+
+ The number
+ of rows for each indirect block in the heap is determined by the
+ size of the block that the indirect block represents in the
+ doubling table (calculation of this is shown below) and is
+ constant, except for the &ldquo;root&rdquo;
+ indirect block, which expands and shrinks its number of rows as
+ needed.
+</p>
+
+<p>
+ Blocks in the first <em>two</em> rows of an indirect block
+ are <em>Starting Block Size</em> number of bytes in size.
+ For example, if the row <em>width</em> of the doubling table is 4,
+ then the first eight block entries in the
+ indirect block are <em>Starting Block Size</em> number of bytes in size.
+ The blocks in each subsequent row are twice the size of
+ the blocks in the previous row. In other words, blocks in
+ the third row are twice the <em>Starting Block Size</em>,
+ blocks in the fourth row are four times the
+ <em>Starting Block Size</em>, and so on. Entries for
+ blocks up to the <em>Maximum Direct Block Size</em> point to
+ direct blocks, and entries for blocks greater than that size
+ point to further indirect blocks (which have their own
+ entries for direct and indirect blocks).
+ <em>Starting Block Size</em> and
+ <em>Maximum Direct Block Size</em> are fields
+ stored in the header.
+</p>
+
+<p>
+ The number of rows of blocks, <em>nrows</em>, in an
+ indirect block is calculated by the following expression:
+ <br /> <br />
+ <em>nrows</em> = (log<sub>2</sub>(<em>block_size</em>) -
+ log<sub>2</sub>(<em>&lt;Starting Block Size&gt;</em>)) + 1
+</p>
+where <em>block_size</em> is the size of the block that the indirect block
+represents in the doubling table.
+For example, to represent a block with <em>block_size</em> equals to 1024,
+and <em>Starting Block Size</em> equals to 256,
+three rows are needed.
+<p>
+ The maximum number of rows of direct blocks, <em>max_dblock_rows</em>,
+ in any indirect block of a fractal heap is given by the
+ following expression:
+ <br /> <br />
+ <em>max_dblock_rows</em> =
+ (log<sub>2</sub>(<em>&lt;Maximum Direct Block Size&gt;</em>) -
+ log<sub>2</sub>(<em>&lt;Starting Block Size&gt;</em>)) + 2
+</p>
+<p>
+ Using the computed values for <em>nrows</em> and
+ <em>max_dblock_rows</em>, along with the <em>width</em> of the
+ doubling table, the number of direct and indirect block entries
+ (<em>K</em> and <em>N</em> in the indirect block description, below)
+ in an indirect block can be computed:
+ <br /> <br />
+ <em>K</em> = MIN(<em>nrows</em>, <em>max_dblock_rows</em>) *
+ <em>&lt;Table Width&gt;</em>
+
+ <br /> <br />
+ If <em>nrows</em> is less than or equal to <em>max_dblock_rows</em>,
+ <em>N</em> is 0. Otherwise, <em>N</em> is simply computed:
+ <br /> <br />
+ <em>N</em> = <em>K</em> - (<em>max_dblock_rows</em> *
+ <em>&lt;Table Width&gt;</em>)
+</p>
+
+<p>
+ The size of indirect blocks on disk is determined by the number
+ of rows in the indirect block (computed above). The size of direct
+ blocks on disk is exactly the size of the block in the doubling
+ table.
+</p>
+<br>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Heap ID Length</td>
+ <td colspan="2">I/O Filters&rsquo; Encoded Length</td>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Maximum Size of Managed Objects</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Next Huge Object ID<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />v2 B-tree Address of Huge Objects<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Amount of Free Space in Managed Blocks<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Managed Block Free Space Manager<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Amount of Managed Space in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Amount of Allocated Managed Space in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset of Direct Block Allocation Iterator in Managed Space<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Managed Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Huge Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Huge Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Tiny Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Tiny Objects in Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Table Width</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Starting Block Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Maximum Direct Block Size<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Maximum Heap Size</td>
+ <td colspan="2">Starting # of Rows in Root Indirect Block</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Root Block<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Current # of Rows in Root Indirect Block</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Filtered Root Direct Block <em>(optional)</em><sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">I/O Filter Mask<em> (optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">I/O Filter Information<em> (optional, variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap Header
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FRHP</code>&rdquo;
+ is used to indicate the
+ beginning of a fractal heap header. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap ID Length</p></td>
+ <td>
+ <p>This is the length in bytes of heap object IDs for this heap.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>I/O Filters&rsquo; Encoded Length</p></td>
+ <td>
+ <p>This is the size in bytes of the encoded <em>I/O Filter Information</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is the heap status flag and is a bit field
+ indicating additional information about the fractal heap.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit(s)</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, the ID value to use for huge object has wrapped
+ around. If the value for the <em>Next Huge Object ID</em>
+ has wrapped around, each new huge object inserted into the
+ heap will require a search for an ID value.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the direct blocks in the heap are checksummed.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Size of Managed Objects</p></td>
+ <td>
+ <p>This is the maximum size of managed objects allowed in the heap.
+ Objects greater than this this are &lsquo;huge&rsquo; objects and will be
+ stored in the file directly, rather than in a direct block for
+ the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Next Huge Object ID</p></td>
+ <td>
+ <p>This is the next ID value to use for a huge object in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>v2 B-tree Address of Huge Objects</p></td>
+ <td>
+ <p>This is the address of the <a href="#V2Btrees">v2 B-tree</a>
+ used to track huge objects in the heap. The type of records
+ stored in the <em>v2 B-tree</em> will
+ be determined by whether the address and length of a huge object
+ can fit into a heap ID (if yes, it is a &ldquo;directly&rdquo; accessed
+ huge object) and whether there is a filter used on objects
+ in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Amount of Free Space in Managed Blocks</p></td>
+ <td>
+ <p>This is the total amount of free space in managed direct blocks
+ (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Managed Block Free Space Manager</p></td>
+ <td>
+ <p>This is the address of the
+ <em><a href="#FreeSpaceManager">Free-space Manager</a></em> for
+ managed blocks.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Amount of Managed Space in Heap</p></td>
+ <td>
+ <p>This is the total amount of managed space in the heap (in bytes),
+ essentially the upper bound of the heap&rsquo;s linear address space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Amount of Allocated Managed Space in Heap</p></td>
+ <td>
+ <p>This is the total amount of managed space (in bytes) actually
+ allocated in
+ the heap. This can be less than the <em>Amount of Managed Space
+ in Heap</em> field, if some direct blocks in the heap&rsquo;s linear
+ address space are not allocated.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset of Direct Block Allocation Iterator in Managed Space</p></td>
+ <td>
+ <p>This is the linear heap offset where the next direct
+ block should be allocated at (in bytes). This may be less than
+ the <em>Amount of Managed Space in Heap</em> value because the
+ heap&rsquo;s address space is increased by a &ldquo;row&rdquo; of direct blocks
+ at a time, rather than by single direct block increments.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Managed Objects in Heap</p></td>
+ <td>
+ <p>This is the number of managed objects in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Huge Objects in Heap</p></td>
+ <td>
+ <p>This is the total size of huge objects in the heap (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Huge Objects in Heap</p></td>
+ <td>
+ <p>This is the number of huge objects in the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Tiny Objects in Heap</p></td>
+ <td>
+ <p>This is the total size of tiny objects that are packed in heap
+ IDs (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Tiny Objects in Heap</p></td>
+ <td>
+ <p>This is the number of tiny objects that are packed in heap IDs.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Table Width</p></td>
+ <td>
+ <p>This is the number of columns in the doubling table for managed
+ blocks. This value must be a power of two.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Starting Block Size</p></td>
+ <td>
+ <p>This is the starting block size to use in the doubling table for
+ managed blocks (in bytes). This value must be a power of two.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Direct Block Size</p></td>
+ <td>
+ <p>This is the maximum size allowed for a managed direct block.
+ Objects inserted into the heap that are larger than this value
+ (less the number of bytes of direct block prefix/suffix)
+ are stored as &lsquo;huge&rsquo; objects. This value must be a power of
+ two.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Heap Size</p></td>
+ <td>
+ <p>This is the maximum size of the heap&rsquo;s linear address space for
+ managed objects (in bytes). The value stored is the log2 of
+ the actual value, that is: the number of bits of the address space.
+ &lsquo;Huge&rsquo; and &lsquo;tiny&rsquo; objects are not counted in this value, since
+ they do not store objects in the linear address space of the
+ heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Starting # of Rows in Root Indirect Block</p></td>
+ <td>
+ <p>This is the starting number of rows for the root indirect block.
+ A value of 0 indicates that the root indirect block will have
+ the maximum number of rows needed to address the heap&rsquo;s <em>Maximum
+ Heap Size</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Root Block</p></td>
+ <td>
+ <p>This is the address of the root block for the heap. It can
+ be the <a href="#UndefinedAddress">undefined address</a> if
+ there is no data in the heap. It either points to a direct
+ block (if the <em>Current # of Rows in the Root Indirect
+ Block</em> value is 0), or an indirect block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Current # of Rows in Root Indirect Block</p></td>
+ <td>
+ <p>This is the current number of rows in the root indirect block.
+ A value of 0 indicates that <em>Address of Root Block</em>
+ points to direct block instead of indirect block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Filtered Root Direct Block</p></td>
+ <td>
+ <p>This is the size of the root direct block, if filters are
+ applied to heap objects (in bytes). This field is only
+ stored in the header if the <em>I/O Filters&rsquo; Encoded Length</em>
+ is greater than 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>I/O Filter Mask</p></td>
+ <td>
+ <p>This is the filter mask for the root direct block, if filters
+ are applied to heap objects. This mask has the same format as
+ that used for the filter mask in chunked raw data records in a
+ <a href="#V1Btrees">v1 B-tree</a>.
+ This field is only
+ stored in the header if the <em>I/O Filters&rsquo; Encoded Length</em>
+ is greater than 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>I/O Filter Information</p></td>
+ <td>
+ <p>This is the I/O filter information encoding direct blocks and
+ huge objects, if filters are applied to heap objects. This
+ field is encoded as a <a href="#FilterMessage">Filter Pipeline</a>
+ message.
+ The size of this field is determined by <em>I/O Filters&rsquo;
+ Encoded Length</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the header.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap Direct Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Block Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap Direct Block
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FHDB</code>&rdquo;
+ is used to indicate the
+ beginning of a fractal heap direct block. This gives file consistency
+ checking utilities a better chance of reconstructing a
+ damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap Header Address</p></td>
+ <td>
+ <p>This is the address for the fractal heap header that this
+ block belongs to. This field is principally used for file
+ integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Offset</p></td>
+ <td>
+ <p>This is the offset of the block within the fractal heap&rsquo;s
+ address space (in bytes). The number of bytes used to encode
+ this field is the <em>Maximum Heap Size</em> (in the heap&rsquo;s
+ header) divided by 8 and rounded up to the next highest integer,
+ for values that are not a multiple of 8. This value is
+ principally used for file integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the direct block.</p>
+ <p>This field is only present if bit 1 of <em>Flags</em> in the
+ heap&rsquo;s header is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Data</p></td>
+ <td>
+ <p>This section of the direct block stores the actual data for
+ objects in the heap. The size of this section is determined by
+ the direct block&rsquo;s size minus the size of the other fields
+ stored in the direct block (for example, the <em>Signature</em>,
+ <em>Version</em>, and others including the <em>Checksum</em> if it is
+ present).
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap Indirect Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Block Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Direct Block #0 Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Size of Filtered Direct Block #0 <em>(optional)</em> <sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask for Direct Block #0 <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Direct Block #1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Size of Filtered Direct Block #1 <em>(optional)</em><sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask for Direct Block #1 <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Direct Block #K-1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Size of Filtered Direct Block #K-1 <em>(optional)</em><sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Filter Mask for Direct Block #K-1 <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Indirect Block #0 Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Indirect Block #1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Child Indirect Block #N-1 Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap Indirect Block
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FHIB</code>&rdquo; is used to
+ indicate the beginning of a fractal heap indirect block. This
+ gives file consistency checking utilities a better chance of
+ reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap Header Address</p></td>
+ <td>
+ <p>This is the address for the fractal heap header that this
+ block belongs to. This field is principally used for file
+ integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Offset</p></td>
+ <td>
+ <p>This is the offset of the block within the fractal heap&rsquo;s
+ address space (in bytes). The number of bytes used to encode
+ this field is the <em>Maximum Heap Size</em> (in the heap&rsquo;s
+ header) divided by 8 and rounded up to the next highest integer,
+ for values that are not a multiple of 8. This value is
+ principally used for file integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Child Direct Block #K Address</p></td>
+ <td>
+ <p>This field is the address of the child direct block.
+ The size of the [uncompressed] direct block can be computed by
+ its offset in the heap&rsquo;s linear address space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Filtered Direct Block #K</p></td>
+ <td>
+ <p>This is the size of the child direct block after passing through
+ the I/O filters defined for this heap (in bytes). If no I/O
+ filters are present for this heap, this field is not present.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>Filter Mask for Direct Block #K</p></td>
+ <td>
+ <p>This is the I/O filter mask for the filtered direct block.
+ This mask has the same format as that used for the filter mask
+ in chunked raw data records in a <a href="#V1Btrees">v1 B-tree</a>.
+ If no I/O filters are present for this heap, this field is not
+ present.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Child Indirect Block #N Address</p></td>
+ <td>
+ <p>This field is the address of the child indirect block.
+ The size of the indirect block can be computed by
+ its offset in the heap&rsquo;s linear address space.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the indirect block.</p>
+ </td>
+ </tr>
+
+ </table>
+
+</div>
+
+<br />
+<p>An object in the fractal heap is identified by means of a fractal heap ID,
+ which encodes information to locate the object in the heap.
+ Currently, the fractal heap stores an object in one of three ways,
+ depending on the object&rsquo;s size:</p>
+
+<div align="center">
+ <table class="list80">
+ <tr>
+ <th width="20%">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center">Tiny</td>
+ <td>
+ <p>When an object is small enough to be encoded in the
+ heap ID, the object&rsquo;s data is embedded in the fractal
+ heap ID itself. There are two sub-types for this type of
+ object: normal and extended. The sub-type for tiny heap
+ IDs depends on whether the heap ID is large enough to
+ store objects greater than 16 bytes or not. If the
+ heap ID length is 18 bytes or smaller, the
+ &lsquo;normal&rsquo; tiny heap ID form is used. If the
+ heap ID length is greater than 18 bytes in length, the
+ &ldquo;extended&rdquo; form is used. See the format
+ description below for both sub-types.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center">Huge</td>
+ <td>
+ <p>When the size of an object is larger than <em>Maximum Size of
+ Managed Objects</em> in the <em>Fractal Heap Header</em>, the
+ object&rsquo;s data is stored on its own in the file and the object
+ is tracked/indexed via a version 2 B-tree. All huge objects
+ for a particular fractal heap use the same v2 B-tree. All huge
+ objects for a particular fractal heap use the same format for
+ their huge object IDs.
+ </p>
+
+ <p>Depending on whether the IDs for a heap are large enough to hold
+ the object&rsquo;s retrieval information and whether I/O pipeline filters
+ are applied to the heap&rsquo;s objects, 4 sub-types are derived for
+ huge object IDs for this heap:</p>
+
+ <div align="center">
+ <table class="list">
+ <tr>
+ <th align="left" width="35%">Sub-type</th>
+ <th align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="left">Directly accessed, non-filtered</td>
+ <td>
+ <p>The object&rsquo;s address and length are embedded in the
+ fractal heap ID itself and the object is directly accessed
+ from them. This allows the object to be accessed without
+ resorting to the B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left">Directly accessed, filtered</td>
+ <td>
+ <p>The filtered object&rsquo;s address, length, filter mask and
+ de-filtered size are embedded in the fractal heap ID itself
+ and the object is accessed directly with them. This allows
+ the object to be accessed without resorting to the B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left">Indirectly accessed, non-filtered</td>
+ <td>
+ <p>The object is located by using a B-tree key embedded in
+ the fractal heap ID to retrieve the address and length from
+ the version 2 B-tree for huge objects. Then, the address
+ and length are used to access the object.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left">Indirectly accessed, filtered</td>
+ <td>
+ <p>The object is located by using a B-tree key embedded in
+ the fractal heap ID to retrieve the filtered object&rsquo;s
+ address, length, filter mask and de-filtered size from the
+ version 2 B-tree for huge objects. Then, this information
+ is used to access the object.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center">Managed</td>
+ <td>
+ <p>When the size of an object does not meet the above two
+ conditions, the object is stored and managed via the direct and
+ indirect blocks based on the doubling table.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+
+<br />
+<p>The specific format for each type of heap ID is described below:
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap ID for Tiny Objects (Sub-type 1 -
+ &lsquo;Normal&rsquo;)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version, Type, and Length</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap ID for Tiny Objects (Sub-type 1 -
+ &lsquo;Normal&rsquo;)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version, Type, and Length</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Tiny objects have a value of <code>2</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>The length of the tiny object. The value stored
+ is one less than the actual length (since zero-length
+ objects are not allowed to be stored in the heap).
+ For example, an object of actual length 1 has an
+ encoded length of 0, an object of actual length 2
+ has an encoded length of 1, and so on.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td>
+ <p>This is the data for the object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap ID for Tiny Objects (Sub-type 2 -
+ &lsquo;Extended&rsquo;)
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version, Type, and Length</td>
+ <td>Extended Length</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Data <em>(variable size)</em></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap ID for Tiny Objects (Sub-type 2 -
+ &lsquo;Extended&rsquo;)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version, Type, and Length</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Tiny objects have a value of <code>2</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>These 4 bits, together with the next byte, form an
+ unsigned 12-bit integer for holding the length of the
+ object. These 4-bits are bits 8-11 of the 12-bit integer.
+ See description for the <em>Extended Length</em> field below.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Extended Length</p></td>
+ <td>
+ <p>This byte, together with the 4 bits in the previous byte,
+ forms an unsigned 12-bit integer for holding the length of
+ the tiny object. These 8 bits are bits 0-7 of the 12-bit
+ integer formed. The value stored is one less than the actual
+ length (since zero-length objects are not allowed to be
+ stored in the heap). For example, an object of actual length
+ 1 has an encoded length of 0, an object of actual length
+ 2 has an encoded length of 1, and so on.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td>
+ <p>This is the data for the object.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap ID for Huge Objects (Sub-types 1 and 2):
+ Indirectly Accessed, Non-filtered/Filtered
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version and Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />v2 B-tree Key<sup>L</sup><em> (variable size)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap ID for Huge Objects (Sub-types 1 and 2):
+ Indirectly Accessed, Non-filtered/Filtered
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version and Type</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Huge objects have a value of <code>1</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>v2 B-tree Key</p></td>
+ <td><p>This field is the B-tree key for retrieving the information
+ from the version 2 B-tree for huge objects needed to access the
+ object. See the description of <a href="#V2Btrees">v2 B-tree</a>
+ records sub-types 1 and 2 for a description of the fields. New key
+ values are derived from <em>Next Huge Object ID</em> in the
+ <em>Fractal Heap Header</em>.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap ID for Huge Objects (Sub-type 3):
+ Directly Accessed, Non-filtered
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version and Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address <sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Length <sup>L</sup><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap ID for Huge Objects (Sub-type 3):
+ Directly Accessed, Non-filtered
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version and Type</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Huge objects have a value of <code>1</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This field is the address of the object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This field is the length of the object in the file.</p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap ID for Huge Objects (Sub-type 4):
+ Directly Accessed, Filtered
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version and Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address <sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Length <sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />De-filtered Size <sup>L</sup><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap ID for Huge Objects (Sub-type 4):
+ Directly Accessed, Filtered
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version and Type</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Huge objects have a value of <code>1</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This field is the address of the filtered object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This field is the length of the filtered object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td><p>This field is the I/O pipeline filter mask for the
+ filtered object in the file.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filtered Size</p></td>
+ <td><p>This field is the size of the de-filtered object in the file.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap ID for Managed Objects
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version and Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Length <em>(variable size)</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap ID for Managed Objects
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version and Type</p></td>
+ <td><p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>The current version of ID format. This document
+ describes version 0.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4-5</code></td>
+ <td>The ID type. Managed objects have a value of <code>0</code>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0-3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset</p></td>
+ <td><p>This field is the offset of the object in the heap.
+ This field&rsquo;s size is the minimum number of bytes
+ necessary to encode the <em>Maximum Heap Size</em> value
+ (from the <em>Fractal Heap Header</em>). For example, if the
+ value of the <em>Maximum Heap Size</em> is less than 256 bytes,
+ this field is 1 byte in length, a <em>Maximum Heap Size</em>
+ of 256-65535 bytes uses a 2 byte length, and so on.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This field is the length of the object in the heap. It
+ is determined by taking the minimum value of <em>Maximum
+ Direct Block Size</em> and <em>Maximum Size of Managed
+ Objects</em> in the <em>Fractal Heap Header</em>. Again,
+ the minimum number of bytes needed to encode that value is
+ used for the size of this field.</p></td>
+ </tr>
+ </table>
+</div>
+
+<h3><a name="FreeSpaceManager">
+ III.H. Disk Format: Level 1H - Free-space Manager</a></h3>
+
+<p>
+ Free-space managers are used to describe space within a heap or
+ the entire HDF5 file that is not currently used for that heap or
+ file.
+</p>
+
+<p>
+ The <em>free-space manager header</em> contains metadata information
+ about the space being tracked, along with the address of the list
+ of <em>free space sections</em> which actually describes the free
+ space. The header records information about free-space sections being
+ tracked, creation parameters for handling free-space sections of a
+ client, and section information used to locate the collection of
+ free-space sections.
+</p>
+
+<p>
+ The <em>free-space section list</em> stores a collection of
+ free-space sections that is specific to each <em>client</em> of the
+ free-space manager.
+
+ For example, the fractal heap is a client of the free space manager
+ and uses it to track unused space within the heap. There are 4
+ types of section records for the fractal heap, each of which has
+ its own format, listed below.
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Free-space Manager Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Total Space Tracked<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Total Number of Sections<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Serialized Sections<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Number of Un-Serialized Sections<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Section Classes</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Shrink Percent</td>
+ <td colspan="2">Expand Percent</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Size of Address Space</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Maximum Section Size <sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of Serialized Section List<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Serialized Section List Used<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Allocated Size of Serialized Section List<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Free-space Manager Header
+ </caption>
+ <tr>
+ <th width="35%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FSHD</code>&rdquo;
+ is used to indicate the beginning of the Free-space Manager
+ Header. This gives file consistency checking utilities a
+ better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This is the version number for the Free-space Manager Header
+ and this document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>This is the client ID for identifying the user of this
+ free-space manager:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Fractal heap
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>File
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Space Tracked</p></td>
+ <td>
+ <p>This is the total amount of free space being tracked, in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Number of Sections</p></td>
+ <td>
+ <p>This is the total number of free-space sections being tracked.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Serialized Sections</p></td>
+ <td>
+ <p>This is the number of serialized free-space sections being
+ tracked.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>Number of Un-Serialized Sections</p></td>
+ <td>
+ <p>This is the number of un-serialized free-space sections being
+ managed. Un-serialized sections are created by the free-space
+ client when the list of sections is read in.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Section Classes</p></td>
+ <td>
+ <p>This is the number of section classes handled by this free space
+ manager for the free-space client.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Shrink Percent</p></td>
+ <td>
+ <p>This is the percent of current size to shrink the allocated
+ serialized free-space section list.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Expand Percent</p></td>
+ <td>
+ <p>This is the percent of current size to expand the allocated
+ serialized free-space section list.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Address Space</p></td>
+ <td>
+ <p>This is the size of the address space that free-space sections
+ are within. This is stored as the log<sub>2</sub> of the
+ actual value (in other words, the number of bits required
+ to store values within that address space).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Section Size</p></td>
+ <td>
+ <p>This is the maximum size of a section to be tracked.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of Serialized Section List</p></td>
+ <td>
+ <p>This is the address where the serialized free-space section
+ list is stored.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Serialized Section List Used</p></td>
+ <td>
+ <p>This is the size of the serialized free-space section
+ list used (in bytes). This value must be less than
+ or equal to the <em>allocated size of serialized section
+ list</em>, below.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Allocated Size of Serialized Section List</p></td>
+ <td>
+ <p>This is the size of serialized free-space section list
+ actually allocated (in bytes).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the free-space manager header.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<p>The free-space sections being managed are stored in a
+ <em>free-space section list</em>, described below. The sections
+ in the free-space section list are stored in the following way:
+ a count of the number of sections describing a particular size of
+ free space and the size of the free-space described (in bytes),
+ followed by a list of section description records; then another
+ section count and size, followed by the list of section
+ descriptions for that size; and so on.</p>
+
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Free-space Section List
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Free-space Manager Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Number of Section Records in Set #0 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size of Free-space Section Described in Record Set #0 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #0 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #0 Section Record #0 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #0 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #K-1 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #0 Section Record #K-1 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #0 Section Record #K-1 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Number of Section Records in Set #1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size of Free-space Section Described in Record Set #1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #0 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #1 Section Record #0 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #0 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #K-1 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #1 Section Record #K-1 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #1 Section Record #K-1 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><strong>...</strong></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><strong>...</strong></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Number of Section Records in Set #N-1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size of Free-space Section Described in Record Set #N-1 <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #0 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #N-1 Section Record #0 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #0 Data <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #K-1 Offset<em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="1">Record Set #N-1 Section Record #K-1 Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Record Set #N-1 Section Record #K-1 Data <em>(variable size)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Free-space Section List
+ </caption>
+ <tr>
+ <th width="35%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FSSE</code>&rdquo;
+ is used to indicate the beginning of the Free-space Section
+ Information. This gives file consistency checking utilities
+ a better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This is the version number for the Free-space Section List
+ and this document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Free-space Manager Header Address</p></td>
+ <td>
+ <p>This is the address of the <em>Free-space Manager Header</em>.
+ This field is principally used for file
+ integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Section Records for Set #N</p></td>
+ <td>
+ <p>This is the number of free-space section records for set #N.
+ The length of this field is the minimum number of bytes needed
+ to store the <em>number of serialized sections</em> (from the
+ <em>free-space manager header</em>).
+ </p>
+
+ <p>
+ The number of sets of free-space section records is
+ determined by the <em>size of serialized section list</em> in
+ the <em>free-space manager header</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Section Size for Record Set #N</p></td>
+ <td>
+ <p>This is the size (in bytes) of the free-space section described
+ for <em>all</em> the section records in set #N.
+ </p>
+
+ <p>
+ The length of this field is the minimum number of bytes needed
+ to store the <em>maximum section size</em> (from the
+ <em>free-space manager header</em>).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Record Set #N Section #K Offset</p></td>
+ <td>
+ <p>This is the offset (in bytes) of the free-space section within
+ the client for the free-space manager.
+ </p>
+
+ <p>
+ The length of this field is the minimum number of bytes needed
+ to store the <em>size of address space</em> (from the
+ <em>free-space manager header</em>).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Record Set #N Section #K Type</p></td>
+ <td>
+ <p>This is the type of the section record, used to decode the
+ <em>record set #N section #K data</em> information. The defined
+ record type for <em>file</em> client is:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>File&rsquo;s section (a range of actual bytes in file)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ <p>The defined record types for a <em>fractal heap</em> client are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Type</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Fractal heap &ldquo;single&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Fractal heap &ldquo;first row&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Fractal heap &ldquo;normal row&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Fractal heap &ldquo;indirect&rdquo; section
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Record Set #N Section #K Data</p></td>
+ <td>
+ <p>This is the section-type specific information for each record
+ in the record set, described below.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the <em>Free-space Section List</em>.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<p>
+ The section-type specific data for each free-space section record is
+ described below:
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: File&rsquo;s Section Data Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>No additional record data stored</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap &ldquo;Single&rdquo; Section Data Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>No additional record data stored</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap &ldquo;First Row&rdquo; Section Data
+ Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>Same format as &ldquo;indirect&rdquo;
+ section data</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap &ldquo;Normal Row&rdquo; Section Data
+ Record
+ </caption>
+
+ <tr>
+ <td colspan="4"><em>No additional record data stored</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fractal Heap &ldquo;Indirect&rdquo; Section
+ Data Record
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Fractal Heap Indirect Block Offset <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Block Start Row</td>
+ <td colspan="2">Block Start Column</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Blocks</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fractal Heap &ldquo;Indirect&rdquo; Section
+ Data Record
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Block Offset</p></td>
+ <td>
+ <p>The offset of the indirect block in the fractal heap&rsquo;s address
+ space containing the empty blocks.
+ </p>
+ <p>
+ The number of bytes used to encode this field is the minimum
+ number of bytes needed to encode values for the <em>Maximum
+ Heap Size</em> (in the fractal heap&rsquo;s header).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Start Row</p></td>
+ <td>
+ <p>This is the row that the empty blocks start in.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Start Column</p></td>
+ <td>
+ <p>This is the column that the empty blocks start in.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Blocks</p></td>
+ <td>
+ <p>This is the number of empty blocks covered by the section.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h3><a name="SOHMTable">
+ III.I. Disk Format: Level 1I - Shared Object Header Message Table</a></h3>
+
+<p>
+ The <em>shared object header message table</em> is used to locate
+ object
+ header messages that are shared between two or more object headers
+ in the file. Shared object header messages are stored and indexed
+ in the file in one of two ways: indexed sequentially in a
+ <em>shared header message list</em> or indexed with a v2 B-tree.
+ The shared messages themselves are either stored in a fractal
+ heap (when two or more objects share the message), or remain in an
+ object&rsquo;s header (when only one object uses the message currently,
+ but the message can be shared in the future).
+</p>
+
+<p>
+ The <em>shared object header message table</em>
+ contains a list of shared message index headers. Each index header
+ records information about the version of the index format, the index
+ storage type, flags for the message types indexed, the number of
+ messages in the index, the address where the index resides,
+ and the fractal heap address if shared messages are stored there.
+</p>
+
+<p>
+ Each index can be either a list or a v2 B-tree and may transition
+ between those two forms as the number of messages in the index
+ varies. Each shared message record contains information used to
+ locate the shared message from either a fractal heap or an object
+ header. The types of messages that can be shared are: <em>Dataspace,
+ Datatype, Fill Value, Filter Pipeline and Attribute</em>.
+</p>
+
+<p>
+ The <em>shared object header message table</em> is pointed to
+ from a <a href="#SOHMTableMessage">shared message table</a> message
+ in the superblock extension for a file. This message stores the
+ version of the table format, along with the number of index headers
+ in the table.
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Shared Object Header Message Table
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version for index #0</td>
+ <td>Index Type for index #0</td>
+ <td colspan="2">Message Type Flags for index #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Minimum Message Size for index #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">List Cutoff for index #0</td>
+ <td colspan="2">v2 B-tree Cutoff for index #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Messages for index #0</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Index Address<sup>O</sup> for index #0<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup> for index #0<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td>Version for index #N-1</td>
+ <td>Index Type for index #N-1</td>
+ <td colspan="2">Message Type Flags for index #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Minimum Message Size for index #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">List Cutoff for index #N-1</td>
+ <td colspan="2">v2 B-tree Cutoff for index #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Number of Messages for index #N-1</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Index Address<sup>O</sup> for index #N-1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup> for index #N-1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Object Header Message Table
+ </caption>
+ <tr>
+ <th width="35%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>SMTB</code>&rdquo;
+ is used to indicate the beginning of the Shared Object
+ Header Message table. This gives file consistency checking
+ utilities a better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version for index #N</p></td>
+ <td>
+ <p>This is the version number for the list of shared object header message
+ indexes and this document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Index Type for index #N</p></td>
+ <td>
+ <p>The type of index can be an unsorted list or a v2 B-tree.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Type Flags for index #N</p></td>
+ <td>
+ <p>This field indicates the type of messages tracked in the index,
+ as follows:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bits</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, the index tracks <em>Dataspace Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the message tracks <em>Datatype Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>If set, the message tracks <em>Fill Value Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>If set, the message tracks <em>Filter Pipeline Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>If set, the message tracks <em>Attribute Messages</em>.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5-15</code></td>
+ <td>Reserved (zero).
+ </td>
+ </tr>
+ </table></p>
+
+
+ <p>
+ An index can track more than one type of message, but each type
+ of message can only by in one index.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Minimum Message Size for index #N</p></td>
+ <td>
+ <p>This is the message size sharing threshold for the index.
+ If the encoded size of the message is less than this value, the
+ message is not shared.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>List Cutoff for index #N</p></td>
+ <td>
+ <p>This is the cutoff value for the indexing of messages to
+ switch from a list to a v2 B-tree. If the number of messages
+ is greater than this value, the index should be a v2 B-tree.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>v2 B-tree Cutoff for index #N</p></td>
+ <td>
+ <p>This is the cutoff value for the indexing of messages
+ to switch from a v2 B-tree back to a list. If the number
+ of messages is less than this value, the index should be
+ a list.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Messages for index #N</p></td>
+ <td>
+ <p>The number of shared messages being tracked for the index.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Index Address for index #N</p></td>
+ <td>
+ <p>This field is the address of the list or v2 B-tree where the
+ index nodes reside.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Address for index #N</p></td>
+ <td>
+ <p>This field is the address of the fractal heap if shared messages
+ are stored there.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the table.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<p>
+ Shared messages are indexed either with a <em>shared message record
+ list</em>, described below, or using a v2 B-tree (using record type 7).
+ The number of records in the <em>shared message record list</em> is
+ determined in the index&rsquo;s entry in the <em>shared object header message
+ table</em>.
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Shared Message Record List
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Shared Message Record #0</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Shared Message Record #1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Shared Message Record #N-1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Message Record List
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>SMLI</code>&rdquo;
+ is used to indicate the beginning of a list of index nodes.
+ This gives file consistency checking utilities a better
+ chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Shared Message Record #N</p></td>
+ <td>
+ <p>The record for locating the shared message, either in the
+ fractal heap for the index, or an object header (see format for
+ <em>index nodes</em> below).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the list.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<p>
+ The record for each shared message in an index is stored in one
+ of the following forms:
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Shared Message Record for Messages Stored in a
+ Fractal Heap
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Hash Value</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap ID<br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Message Record for Messages Stored in a
+ Fractal Heap
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This has a value of 0 indicating that the message is stored in
+ the heap.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash Value</p></td>
+ <td>
+ <p>This is the hash value for the message.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td>
+ <p>This is the number of times the message is used in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap ID</p></td>
+ <td>
+ <p>This is an 8-byte fractal heap ID for the message as stored in
+ the fractal heap for the index.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Shared Message Record for Messages Stored in an
+ Object Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Message Location</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Hash Value</td>
+ </tr>
+
+ <tr>
+ <td>Reserved</td>
+ <td>Message Type</td>
+ <td colspan="2">Creation Index</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Message Record for Messages Stored in an
+ Object Header
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Message Location</p></td>
+ <td>
+ <p>This has a value of 1 indicating that the message is stored in
+ an object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Hash Value</p></td>
+ <td>
+ <p>This is the hash value for the message.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Message Type</p></td>
+ <td>
+ <p>This is the message type in the object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Index</p></td>
+ <td>
+ <p>This is the creation index of the message within the object
+ header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Address</p></td>
+ <td>
+ <p>This is the address of the object header where the message is
+ located.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h2><a name="DataObject">
+ IV. Disk Format: Level 2 - Data Objects </a></h2>
+
+<p>Data objects contain the &ldquo;real&rdquo; user-visible information in the file.
+ These objects compose the scientific data and other information which
+ are generally thought of as &ldquo;data&rdquo; by the end-user. All the
+ other information in the file is provided as a framework for
+ storing and accessing these data objects.
+</p>
+
+<p>A data object is composed of header and data
+ information. The header information contains the information
+ needed to interpret the data information for the object as
+ well as additional &ldquo;metadata&rdquo; or pointers to additional
+ &ldquo;metadata&rdquo; used to describe or annotate each object.
+</p>
+
+<h3><a name="ObjectHeader">
+ IV.A. Disk Format: Level 2A - Data Object Headers</a></h3>
+
+<p>The header information of an object is designed to encompass
+ all of the information about an object, except for the data itself.
+ This information includes the dataspace, the datatype, information
+ about how the data is stored on disk (in external files, compressed,
+ broken up in blocks, and so on), as well as other information used
+ by the library to speed up access to the data objects or maintain
+ a file&rsquo;s integrity. Information stored by user applications
+ as attributes is also stored in the object&rsquo;s header. The header
+ of each object is not necessarily located immediately prior to the
+ object&rsquo;s data in the file and in fact may be located in any
+ position in the file. The order of the messages in an object header
+ is not significant.</p>
+
+<p>Object headers are composed of a prefix and a set of messages. The
+ prefix contains the information needed to interpret the messages and
+ a small amount of metadata about the object, and the messages contain
+ the majority of the metadata about the object.
+</p>
+
+<h3><a name="ObjectHeaderPrefix">
+ IV.A.1. Disk Format: Level 2A1 - Data Object Header Prefix</a></h3>
+
+
+
+<h4><a name="V1ObjectHeaderPrefix">
+ IV.A.1.a. Version 1 Data Object Header Prefix</a></h4>
+
+<p>Header messages are aligned on 8-byte boundaries for version 1
+ object headers.
+</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 1 Object Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Reserved (zero)</td>
+ <td colspan="2">Total Number of Header Messages</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Object Reference Count</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Object Header Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message Type #1</td>
+ <td colspan="2">Size of Header Message Data #1</td>
+ </tr>
+
+ <tr>
+ <td>Header Message #1 Flags</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message Type #n</td>
+ <td colspan="2">Size of Header Message Data #n</td>
+ </tr>
+
+ <tr>
+ <td>Header Message #n Flags</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #n<br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 1 Object Header
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ information in the object header. When the format of the
+ object header is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted. This
+ is version one (1) (there was no version zero (0)) of the
+ object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Total Number of Header Messages</p></td>
+ <td>
+ <p>This value determines the total number of messages listed in
+ object headers for this object. This value includes the messages
+ in continuation messages for this object.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Reference Count</p></td>
+ <td>
+ <p>This value specifies the number of &ldquo;hard links&rdquo; to this object
+ within the current file. References to the object from external
+ files, &ldquo;soft links&rdquo; in this file and object references in this
+ file are not tracked.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Object Header Size</p></td>
+ <td>
+ <p>This value specifies the number of bytes of header message data
+ following this length field that contain object header messages
+ for this object header. This value does not include the size of
+ object header continuation blocks for this object elsewhere in the
+ file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Type</p></td>
+ <td>
+ <p>This value specifies the type of information included in the
+ following header message data. The message types for
+ header messages are defined in sections below.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Header Message #n Data</p></td>
+ <td>
+ <p>This value specifies the number of bytes of header
+ message data following the header message type and length
+ information for the current message. The size includes
+ padding bytes to make the message a multiple of eight
+ bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Flags</p></td>
+ <td>
+ <p>This is a bit field with the following definition:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, the message data is constant. This is used
+ for messages like the datatype message of a dataset.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the message is <em>shared</em> and stored
+ in another location than the object header. The Header
+ Message Data field contains a Shared Message
+ (described in the <a href="#ObjectHeaderMessages">Data Object Header Messages</a>
+ section below)
+ and the Size of Header Message Data field
+ contains the size of that Shared Message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>If set, the message should not be shared.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>If set, the HDF5 decoder should fail to open this object
+ if it does not understand the message&rsquo;s type and the file
+ is open with permissions allowing write access to the file.
+ (Normally, unknown messages can just be ignored by HDF5
+ decoders)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>If set, the HDF5 decoder should set bit 5 of this
+ message&rsquo;s flags (in other words, this bit field)
+ if it does not understand the message&rsquo;s type
+ and the object is modified in any way. (Normally,
+ unknown messages can just be ignored by HDF5
+ decoders)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>If set, this object was modified by software that did not
+ understand this message.
+ (Normally, unknown messages should just be ignored by HDF5
+ decoders) (Can be used to invalidate an index or a similar
+ feature)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td>If set, this message is shareable.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>7</code></td>
+ <td>If set, the HDF5 decoder should always fail to open this
+ object if it does not understand the message&rsquo;s type (whether
+ it is open for read-only or read-write access). (Normally,
+ unknown messages can just be ignored by HDF5 decoders)
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Data</p></td>
+ <td>
+ <p>The format and length of this field is determined by the
+ header message type and size respectively. Some header
+ message types do not require any data and this information
+ can be eliminated by setting the length of the message to
+ zero. The data is padded with enough zeroes to make the
+ size a multiple of eight.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="V2ObjectHeaderPrefix">
+ IV.A.1.b. Version 2 Data Object Header Prefix</a></h4>
+
+<p>Note that the &ldquo;total number of messages&rdquo; field has been dropped from
+ the data object header prefix in this version. The number of messages
+ in the data object header is just determined by the messages encountered
+ in all the object header blocks.</p>
+
+<p>Note also that the fields and messages in this version of data object
+ headers have <em>no</em> alignment or padding bytes inserted - they are
+ stored packed together.</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 Object Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Access time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Modification Time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Change Time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Birth Time <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Maximum # of compact attributes <em>(optional)</em></td>
+ <td colspan="2">Minimum # of dense attributes <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td>Size of Chunk #0 <em>(variable size)</em></td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td>Header Message Type #1</td>
+ <td colspan="2">Size of Header Message Data #1</td>
+ <td>Header Message #1 Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #1 Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td>Header Message Type #n</td>
+ <td colspan="2">Size of Header Message Data #n</td>
+ <td>Header Message #n Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #n Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #n<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Gap <em>(optional, variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 Object Header
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>OHDR</code>&rdquo;
+ is used to indicate the beginning of an object header. This
+ gives file consistency checking utilities a better chance
+ of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This field has a value of 2 indicating version 2 of the object header.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is a bit field indicating additional information
+ about the object header.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit(s)</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0-1</code></td>
+ <td>This two bit field determines the size of the
+ <em>Size of Chunk #0</em> field. The values are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 1 byte.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 2 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 4 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>The <em>Size of Chunk #0</em> field is 8 bytes.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>If set, attribute creation order is tracked.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>If set, attribute creation order is indexed.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>If set, non-default attribute storage phase change
+ values are stored.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>If set, access, modification, change and birth times
+ are stored.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Access Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after the
+ UNIX epoch when the object&rsquo;s raw data was last accessed
+ (in other words, read or written).
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Modification Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after
+ the UNIX epoch when the object&rsquo;s raw data was last
+ modified (in other words, written).
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Change Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after the
+ UNIX epoch when the object&rsquo;s metadata was last changed.
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Birth Time</p></td>
+ <td>
+ <p>This 32-bit value represents the number of seconds after the
+ UNIX epoch when the object was created.
+ </p>
+ <p>This field is present if bit 5 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum # of compact attributes</p></td>
+ <td>
+ <p>This is the maximum number of attributes to store in the compact
+ format before switching to the indexed format.
+ </p>
+ <p>This field is present if bit 4 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Minimum # of dense attributes</p></td>
+ <td>
+ <p>This is the minimum number of attributes to store in the indexed
+ format before switching to the compact format.
+ </p>
+ <p>This field is present if bit 4 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Chunk #0</p></td>
+ <td>
+ <p>
+ This unsigned value specifies the number of bytes of header
+ message data following this field that contain object header
+ information.
+ </p>
+ <p>
+ This value does not include the size of object header
+ continuation blocks for this object elsewhere in the file.
+ </p>
+ <p>
+ The length of this field varies depending on bits 0 and 1 of
+ the <em>flags</em> field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Type</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Header Message #n Data</p></td>
+ <td>
+ <p>This value specifies the number of bytes of header
+ message data following the header message type and length
+ information for the current message. The size of messages
+ in this version does <em>not</em> include any padding bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Flags</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Creation Order</p></td>
+ <td>
+ <p>This field stores the order that a message of a given type
+ was created in.
+ </p>
+ <p>This field is present if bit 2 of <em>flags</em> is set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Data</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Gap</p></td>
+ <td>
+ <p>A gap in an object header chunk is inferred by the end of the
+ messages for the chunk before the beginning of the chunk&rsquo;s
+ checksum. Gaps are always smaller than the size of an
+ object header message prefix (message type + message size +
+ message flags).
+ </p>
+ <p>Gaps are formed when a message (typically an attribute message)
+ in an earlier chunk is deleted and a message from a later
+ chunk that does not quite fit into the free space is moved
+ into the earlier chunk.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the object header chunk.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<p>The header message types and the message data associated with
+ them compose the critical &ldquo;metadata&rdquo; about each object. Some
+ header messages are required for each object while others are
+ optional. Some optional header messages may also be repeated
+ several times in the header itself, the requirements and number
+ of times allowed in the header will be noted in each header
+ message description below.
+</p>
+
+
+<h3><a name="ObjectHeaderMessages">
+ IV.A.2. Disk Format: Level 2A2 - Data Object Header Messages</a></h3>
+
+<p>Data object header messages are small pieces of metadata that are
+ stored in the data object header for each object in an HDF5 file.
+ Data object header messages provide the metadata required to describe
+ an object and its contents, as well as optional pieces of metadata
+ that annotate the meaning or purpose of the object.
+</p>
+
+<p>Data object header messages are either stored directly in the data
+ object header for the object or are shared between multiple objects
+ in the file. When a message is shared, a flag in the <em>Message Flags</em>
+ indicates that the actual <em>Message Data</em>
+ portion of that message is stored in another location (such as another
+ data object header, or a heap in the file) and the <em>Message Data</em>
+ field contains the information needed to locate the actual information
+ for the message.
+</p>
+
+<p>
+ The format of shared message data is described here:</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Shared Message (Version 1)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Message (Version 1)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number is used when there are changes in the format
+ of a shared object message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by the library before version 1.6.1.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td><p>The type of shared message location:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Message stored in another object&rsquo;s header (a <em>committed</em>
+ message).
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the object header
+ containing the message to be shared.</p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+
+ <caption>
+ Layout: Shared Message (Version 2)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Message (Version 2)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number is used when there are changes in the format
+ of a shared object message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used by the library of version 1.6.1 and after.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td><p>The type of shared message location:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Message stored in another object&rsquo;s header (a <em>committed</em>
+ message).
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the object header
+ containing the message to be shared.</p></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Shared Message (Version 3)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Type</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Location <em>(variable size)</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Message (Version 3)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number indicates changes in the format of shared
+ object message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used by the library of version 1.8 and after. In this
+ version, the <em>Type</em> field can indicate that
+ the message is stored in the fractal heap.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td><p>The type of shared message location:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Message is not shared and is not shareable.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Message stored in file&rsquo;s <em>shared object header message</em>
+ heap (a <em>shared</em> message).
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Message stored in another object&rsquo;s header (a <em>committed</em>
+ message).
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Message stored is not shared, but is sharable.
+ </td>
+ </tr>
+
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Location</p></td>
+ <td><p>This field contains either a <a href="#SizeOfOffsetsV0">
+ <em>Size of Offsets</em></a>-bytes address of the object header
+ containing the message to be shared, or an 8-byte fractal heap
+ ID for the message in the file&rsquo;s <em>shared object header
+ message</em> heap.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+
+<p>The following is a list of currently defined header messages:
+</p>
+
+<h4><a name="NILMessage">IV.A.2.a. The NIL Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> NIL</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0000</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The NIL message is used to indicate a message which is to be
+ ignored when reading the header messages for a data object.
+ [Possibly one which has been deleted for some reason.]
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> Unspecified</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+
+<h4><a name="DataspaceMessage">IV.A.2.b. The Dataspace Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Dataspace</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0001</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies according to the number of
+ dimensions, as described in the following table.</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for dataset objects;
+ may not be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The dataspace message describes the number of dimensions (in
+ other words, &ldquo;rank&rdquo;) and size of each dimension that
+ the data object has. This message is only used for datasets which
+ have a simple, rectilinear, array-like layout; datasets requiring
+ a more complex layout are not yet supported.
+ </td>
+ </tr>
+
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Dataspace Message - Version 1
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Flags</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension #1 Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #1 Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Permutation Index #1<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Permutation Index #n<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Dataspace Message - Version 1
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ Dataspace Message. When the format of the
+ information in the message is changed, the version number
+ is incremented and can be used to determine how the
+ information in the object header is formatted. This
+ document describes version one (1) (there was no version
+ zero (0)).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the data
+ object has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is used to store flags to indicate the
+ presence of parts of this message. Bit 0 (the least
+ significant bit) is used to indicate that maximum
+ dimensions are present. Bit 1 is used to indicate that
+ permutation indices are present.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the current size of the dimension of the
+ data as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Maximum Size</p></td>
+ <td>
+ <p>This value is the maximum size of the dimension of the
+ data as stored in the file. This value may be the special
+ &ldquo;<a href="#UnlimitedDim">unlimited</a>&rdquo; size which indicates
+ that the data may expand along this dimension indefinitely.
+ If these values are not stored, the maximum size of each
+ dimension is assumed to be the dimension&rsquo;s current size.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Permutation Index #n</p></td>
+ <td>
+ <p>This value is the index permutation used to map
+ each dimension from the canonical representation to an
+ alternate axis for each dimension. If these values are
+ not stored, the first dimension stored in the list of
+ dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+
+
+<br />
+<p>Version 2 of the dataspace message dropped the optional
+ permutation index value support, as it was never implemented in the
+ HDF5 Library:</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Dataspace Message - Version 2
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Flags</td>
+ <td>Type</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dimension #1 Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #1 Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Dimension #n Maximum Size<sup>L</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Dataspace Message - Version 2
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This value is used to determine the format of the
+ Dataspace Message. This field should be &lsquo;2&rsquo; for version 2
+ format messages.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the data object has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>This field is used to store flags to indicate the
+ presence of parts of this message. Bit 0 (the least
+ significant bit) is used to indicate that maximum
+ dimensions are present.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Type</p></td>
+ <td>
+ <p>This field indicates the type of the dataspace:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>A <em>scalar</em> dataspace; in other words,
+ a dataspace with a single, dimensionless element.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>A <em>simple</em> dataspace; in other words,
+ a dataspace with a rank greater than 0 and an
+ appropriate number of dimensions.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>A <em>null</em> dataspace; in other words,
+ a dataspace with no elements.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the current size of the dimension of the
+ data as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Maximum Size</p></td>
+ <td>
+ <p>This value is the maximum size of the dimension of the
+ data as stored in the file. This value may be the special
+ &ldquo;<a href="#UnlimitedDim">unlimited</a>&rdquo; size which indicates
+ that the data may expand along this dimension indefinitely.
+ If these values are not stored, the maximum size of each
+ dimension is assumed to be the dimension&rsquo;s current size.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+
+
+<!--
+ <h4><a name="DataSpaceMessage">Header Message Name: Complex Dataspace (Fiber Bundle?)</a></h4>
+
+ <!-- start msgdesc table --
+ <center>
+ <table class="msgdesc">
+ <p><b>Header Message Name: ???????</b></td></tr>
+<b>Header Message Type: </b>0x0002<br />
+<b>Length:</b> Varies</td></tr>
+
+<b>Status:</b> One of the <em>Simple Dataspace</em> or
+<em>Complex Dataspace</em> messages is required (but not both) and may
+not be repeated.<br /> <b>Description:</b> The
+<em>Dataspace</em> message describes space that the dataset is
+mapped onto in a more comprehensive way than the <em>Simple
+ Dimensionality</em> message is capable of handling. The
+dataspace of a dataset encompasses the type of coordinate system
+used to locate the dataset&rsquo;s elements as well as the structure and
+regularity of the coordinate system. The dataspace also
+describes the number of dimensions which the dataset inhabits as
+well as a possible higher dimensional space in which the dataset
+is located within.
+
+<br />
+<p><b>Format of Data:</b></p>
+
+<center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Message Layout</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4">Mesh Type</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimensionality</td>
+ </tr>
+ </table>
+</center>
+
+<br />
+<dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Mesh Type: (unsigned 32-bit integer)
+ <dd>This value indicates whether the grid is
+ polar/spherical/cartesion,
+ structured/unstructured and regular/irregular. <br />
+ The mesh type value is broken up as follows: <br />
+
+ <br />
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Mesh-type Layout</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="1">Mesh Embedding</td>
+ <td colspan="1">Coordinate System</td>
+ <td colspan="1">Structure</td>
+ <td colspan="1">Regularity</td>
+ </tr>
+ </table>
+ </center>
+ The following are the definitions of mesh-type bytes:
+ <dl>
+ <dt>Mesh Embedding
+ <dd>This value indicates whether the dataset dataspace
+ is located within
+ another dataspace or not:
+ <dl> <dl>
+ <dt>&lt;STANDALONE&gt;
+ <dd>The dataset mesh is self-contained and is not
+ embedded in another mesh.
+ <dt>&lt;EMBEDDED&gt;
+ <dd>The dataset&rsquo;s dataspace is located within
+ another dataspace, as
+ described in information below.
+ </dl> </dl>
+ <dt>Coordinate System
+ <dd>This value defines the type of coordinate system
+ used for the mesh:
+ <dl> <dl>
+ <dt>&lt;POLAR&gt;
+ <dd>The last two dimensions are in polar
+ coordinates, higher dimensions are
+ cartesian.
+ <dt>&lt;SPHERICAL&gt;
+ <dd>The last three dimensions are in spherical
+ coordinates, higher dimensions
+ are cartesian.
+ <dt>&lt;CARTESIAN&gt;
+ <dd>All dimensions are in cartesian coordinates.
+ </dl> </dl>
+ <dt>Structure
+ <dd>This value defines the locations of the grid-points
+ on the axes:
+ <dl> <dl>
+ <dt>&lt;STRUCTURED&gt;
+ <dd>All grid-points are on integral, sequential
+ locations, starting from 0.
+ <dt>&lt;UNSTRUCTURED&gt;
+ <dd>Grid-points locations in each dimension are
+ explicitly defined and
+ may be of any numeric datatype.
+ </dl> </dl>
+ <dt>Regularity
+ <dd>This value defines the locations of the dataset
+ points on the grid:
+ <dl> <dl>
+ <dt>&lt;REGULAR&gt;
+ <dd>All dataset elements are located at the
+ grid-points defined.
+ <dt>&lt;IRREGULAR&gt;
+ <dd>Each dataset element has a particular
+ grid-location defined.
+ </dl> </dl>
+ </dl>
+ <p>The following grid combinations are currently allowed:</p>
+ <dl> <dl>
+ <dt>&lt;POLAR-STRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-STRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-STRUCTURED-REGULAR&gt;
+ <dt>&lt;POLAR-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;SPHERICAL-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-REGULAR&gt;
+ <dt>&lt;CARTESIAN-UNSTRUCTURED-IRREGULAR&gt;
+ </dl> </dl>
+ All of the above grid types can be embedded within another
+ dataspace.
+ <br /> <br />
+ <dt>Logical Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions that the dataset occupies.
+
+ <br />
+ <center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Embedded Dimensionality Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4">Embedded Dimensionality</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Dimension Size #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Dimension Size #n</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Origin Location #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Embedded Origin Location #n</td>
+ </tr>
+ </table>
+ </center>
+
+ <dt>Embedded Dimensionality: (unsigned 32-bit integer)
+ <dd>This value is the number of dimensions of the space the
+ dataset is located within: in other words, a planar dataset
+ located within a 3-D space, a 3-D dataset
+ which is a subset of another 3-D space, and so on.
+ <dt>Embedded Dimension Size: (unsigned 32-bit integer)
+ <dd>These values are the sizes of the dimensions of the
+ embedded dataspace
+ that the dataset is located within.
+ <dt>Embedded Origin Location: (unsigned 32-bit integer)
+ <dd>These values comprise the location of the dataset&rsquo;s
+ origin within the embedded dataspace.
+ </dl>
+</dl>
+[Comment: need some way to handle different orientations of the
+dataset dataspace
+within the embedded dataspace]<br />
+
+<br />
+<center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Structured/Regular Grid Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4">Logical Dimension Size #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimension Maximum #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimension Size #n</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Logical Dimension Maximum #n</td>
+ </tr>
+ </table>
+</center>
+
+<br />
+<dl>
+ <dt>The elements of the dimensionality message are described below:
+ <dd>
+ <dl>
+ <dt>Logical Dimension Size #n: (unsigned 32-bit integer)
+ <dd>This value is the current size of the dimension of the
+ data as stored in
+ the file. The first dimension stored in the list of
+ dimensions is the slowest
+ changing dimension and the last dimension stored is the
+ fastest changing
+ dimension.
+ <dt>Logical Dimension Maximum #n: (unsigned 32-bit integer)
+ <dd>This value is the maximum size of the dimension of the
+ data as stored in
+ the file. This value may be the special value
+ &lt;UNLIMITED&gt; which
+ indicates that the data may expand along this dimension
+ indefinitely.
+ </dl>
+</dl>
+<br />
+<center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Structured/Irregular Grid Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4"># of Grid Points in Dimension #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4"># of Grid Points in Dimension #n</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Datatype of Grid Point Locations</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Location of Grid Points in Dimension #1</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Location of Grid Points in Dimension #n</td>
+ </tr>
+ </table>
+</center>
+
+<br />
+<center>
+ <table border cellpadding="4" width="80%">
+ <caption align="bottom">
+ <b>HDF5 Dataspace Unstructured Grid Information</b>
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr align="center">
+ <td colspan="4"># of Grid Points</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Datatype of Grid Point Locations</td>
+ </tr>
+ <tr align="center">
+ <td colspan="4">Grid Point Locations<br />.<br />.<br /></td>
+ </tr>
+ </table>
+</center>
+-->
+
+<h4><a name="LinkInfoMessage">IV.A.2.c. The Link Info Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Link Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x002 </td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies </td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated. </td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The link info message tracks variable information about the
+ current state of the links for a &ldquo;new style&rdquo;
+ group&rsquo;s behavior. Variable information will be stored in
+ this message and constant information will be stored in the
+ <a href="#GroupInfoMessage">Group Info</a> message.
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Link Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Maximum Creation Index <em>(8 bytes, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of v2 B-tree for Name Index<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address of v2 B-tree for Creation Order Index<sup>O</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Link Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This field determines various optional aspects of the link
+ info message:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, creation order for the links is tracked.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, creation order for the links is indexed.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Creation Index</p></td>
+ <td><p>This 64-bit value is the maximum creation order index value
+ stored for a link in this group.</p>
+ <p>This field is present if bit 0 of <em>flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Address</p></td>
+ <td>
+ <p>
+ This is the address of the fractal heap to store dense links.
+ Each link stored in the fractal heap is stored as a
+ <a href="#LinkMessage">Link Message</a>.
+ </p>
+ <p>
+ If there are no links in the group, or the group&rsquo;s links
+ are stored &ldquo;compactly&rdquo; (as object header messages), this
+ value will be the <a href="#UndefinedAddress">undefined
+ address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of v2 B-tree for Name Index</p></td>
+ <td><p>This is the address of the version 2 B-tree to index names of links.</p>
+ <p>If there are no links in the group, or the group&rsquo;s links
+ are stored &ldquo;compactly&rdquo; (as object header messages), this
+ value will be the <a href="#UndefinedAddress">undefined
+ address</a>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address of v2 B-tree for Creation Order Index</p></td>
+ <td><p>This is the address of the version 2 B-tree to index creation order of links.</p>
+ <p>If there are no links in the group, or the group&rsquo;s links
+ are stored &ldquo;compactly&rdquo; (as object header messages), this
+ value will be the <a href="#UndefinedAddress">undefined
+ address</a>.
+ </p>
+ <p>This field exists if bit 1 of <em>flags</em> is set.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+
+<h4><a name="DatatypeMessage">IV.A.2.d. The Datatype Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Datatype</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0003
+ </td></tr>
+ <tr><td colspan="2"><b>Length:</b> Variable</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for dataset or committed
+ datatype (formerly named datatype) objects; may not be repeated.
+ </td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The datatype message defines the datatype for each element
+ of a dataset or a common datatype for sharing between multiple
+ datasets. A datatype can describe an atomic type like a fixed-
+ or floating-point type or more complex types like a C struct
+ (compound datatype), array (array datatype), or C++ vector
+ (variable-length datatype).</p>
+ <p>Datatype messages that are part of a dataset object do not
+ describe how elements are related to one another; the dataspace
+ message is used for that purpose. Datatype messages that are part of
+ a committed datatype (formerly named datatype) message describe
+ a common datatype that can be shared by multiple datasets in the
+ file.</p>
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Datatype Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Class and Version</td>
+ <td>Class Bit Field, Bits 0-7</td>
+ <td>Class Bit Field, Bits 8-15</td>
+ <td>Class Bit Field, Bits 16-23</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Properties<br /><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Datatype Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Class and Version</p></td>
+ <td>
+ <p>The version of the datatype message and the datatype&rsquo;s class
+ information are packed together in this field. The version
+ number is packed in the top 4 bits of the field and the class
+ is contained in the bottom 4 bits.
+ </p>
+ <p>The version number information is used for changes in the
+ format of the datatype message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by early versions of the library to encode
+ compound datatypes with explicit array fields.
+ See the compound datatype description below for
+ further details.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used when an array datatype needs to be encoded.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used when a VAX byte-ordered type needs to be
+ encoded. Packs various other datatype classes more
+ efficiently also.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>Used to encode the revised reference datatype.
+ </td>
+ </tr>
+ </table></p>
+
+ <p>The class of the datatype determines the format for the class
+ bit field and properties portion of the datatype message, which
+ are described below. The
+ following classes are currently defined:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td><a href="#ClassFixedPoint">Fixed-Point</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td><a href="#ClassFloatingPoint">Floating-Point</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td> <a href="#ClassTime">Time</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td><a href="#ClassString">String</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td><a href="#ClassBitField">Bit field</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td><a href="#ClassOpaque">Opaque</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td><a href="#ClassCompound">Compound</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>7</code></td>
+ <td><a href="#ClassReference">Reference</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>8</code></td>
+ <td><a href="#ClassEnum">Enumerated</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>9</code></td>
+ <td><a href="#ClassVarLen">Variable-Length</a></td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>10</code></td>
+ <td><a href="#ClassArray">Array</a></td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Class Bit Fields</p></td>
+ <td>
+ <p>The information in these bit fields is specific to each datatype
+ class and is described below. All bits not defined for a
+ datatype class are set to zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>The size of a datatype element in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Properties</p></td>
+ <td>
+ <p>This variable-sized sequence of bytes encodes information
+ specific to each datatype class and is described for each class
+ below. If there is no property information specified for a
+ datatype class, the size of this field is zero bytes.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+
+<br />
+<br />
+<a name="ClassFixedPoint"></a>
+ <p>Class specific information for the Fixed-point Numbers class
+ (Class 0):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Fixed-point Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0</p></td>
+ <td><p><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>1, 2</p></td>
+ <td><p><b>Padding type.</b> Bit 1 is the lo_pad bit and bit 2
+ is the hi_pad bit. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>3</p></td>
+ <td><p><b>Signed.</b> If this bit is set then the fixed-point
+ number is in 2&rsquo;s complement form.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>4-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fixed-point Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Offset</td>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fixed-point Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Offset</p></td>
+ <td>
+ <p>The bit offset of the first significant bit of the fixed-point
+ value within the datatype. The bit offset specifies the number
+ of bits &ldquo;to the right of&rdquo; the value (which are set to the
+ lo_pad bit value).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the fixed-point value
+ within the datatype. This value, combined with the datatype
+ element&rsquo;s size and the Bit Offset field specifies the number
+ of bits &ldquo;to the left of&rdquo; the value (which are set to the
+ hi_pad bit value).
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <a name="ClassFloatingPoint"></a>
+ <p>Class specific information for the Floating-point Numbers class
+ (Class 1):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Floating-point Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0, 6</p></td>
+ <td><p><b>Byte Order.</b> These two non-contiguous bits specify the
+ &ldquo;endianness&rdquo; of the bytes in the datatype element.
+ <table class="list">
+ <tr>
+ <th width="10%" align="center">Bit 6</th>
+ <th width="10%" align="center">Bit 0</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td align="center"><code>0</code></td>
+ <td>Byte order is little-endian
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td align="center"><code>1</code></td>
+ <td>Byte order is big-endian
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td align="center"><code>0</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td align="center"><code>1</code></td>
+ <td>Byte order is VAX-endian
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>1, 2, 3</p></td>
+ <td><p><b>Padding type.</b> Bit 1 is the low bits pad type, bit 2
+ is the high bits pad type, and bit 3 is the internal bits
+ pad type. If a datum has unused bits at either end or between
+ the sign bit, exponent, or mantissa, then the value of bit
+ 1, 2, or 3 is copied to those locations.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>4-5</p></td>
+ <td><p><b>Mantissa Normalization.</b> This 2-bit bit field specifies
+ how the most significant bit of the mantissa is managed.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>No normalization
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The most significant bit of the mantissa is always set
+ (except for 0.0).
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>The most significant bit of the mantissa is not stored,
+ but is implied to be set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>7</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+
+ <tr>
+ <td><p>8-15</p></td>
+ <td><p><b>Sign Location.</b> This is the bit position of the sign
+ bit. Bits are numbered with the least significant bit zero.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>16-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Floating-point Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Offset</td>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+
+ <tr>
+ <td>Exponent Location</td>
+ <td>Exponent Size</td>
+ <td>Mantissa Location</td>
+ <td>Mantissa Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Exponent Bias</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Floating-point Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Offset</p></td>
+ <td>
+ <p>The bit offset of the first significant bit of the floating-point
+ value within the datatype. The bit offset specifies the number
+ of bits &ldquo;to the right of&rdquo; the value.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the floating-point value
+ within the datatype.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Exponent Location</p></td>
+ <td>
+ <p>The bit position of the exponent field. Bits are numbered with
+ the least significant bit number zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Exponent Size</p></td>
+ <td>
+ <p>The size of the exponent field in bits.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Mantissa Location</p></td>
+ <td>
+ <p>The bit position of the mantissa field. Bits are numbered with
+ the least significant bit number zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Mantissa Size</p></td>
+ <td>
+ <p>The size of the mantissa field in bits.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Exponent Bias</p></td>
+ <td>
+ <p>The bias of the exponent field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <a name="ClassTime"></a>
+ <p>Class specific information for the Time class (Class 2):</p>
+
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Time Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0</p></td>
+ <td><p><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>1-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Time Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Time Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the time value.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <a name="ClassString"></a>
+ <p>Class specific information for the Strings class (Class 3):</p>
+
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: String Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-3</p></td>
+ <td><p><b>Padding type.</b> This four-bit value determines the
+ type of padding to use for the string. The values are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Null Terminate: A zero byte marks the end of the
+ string and is guaranteed to be present after
+ converting a long string to a short string. When
+ converting a short string to a long string the value is
+ padded with additional null characters as necessary.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Null Pad: Null characters are added to the end of
+ the value during conversions from short values to long
+ values but conversion in the opposite direction simply
+ truncates the value.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Space Pad: Space characters are added to the end of
+ the value during conversions from short values to long
+ values but conversion in the opposite direction simply
+ truncates the value. This is the Fortran
+ representation of the string.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>4-7</p></td>
+ <td><p><b>Character Set.</b> The character set used to
+ encode the string.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>8-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <p>There are no properties defined for the string class.
+ </p>
+
+ <br />
+ <br />
+ <a name="ClassBitField"></a>
+ <p>Class specific information for the Bit Fields class (Class 4):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Bitfield Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0</p></td>
+ <td><p><b>Byte Order.</b> If zero, byte order is little-endian;
+ otherwise, byte order is big endian.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>1, 2</p></td>
+ <td><p><b>Padding type.</b> Bit 1 is the lo_pad type and bit 2
+ is the hi_pad type. If a datum has unused bits at either
+ end, then the lo_pad or hi_pad bit is copied to those
+ locations.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>3-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Bit Field Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Bit Offset</td>
+ <td colspan="2">Bit Precision</td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Bit Field Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bit Offset</p></td>
+ <td>
+ <p>The bit offset of the first significant bit of the bit field
+ within the datatype. The bit offset specifies the number
+ of bits &ldquo;to the right of&rdquo; the value.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Bit Precision</p></td>
+ <td>
+ <p>The number of bits of precision of the bit field
+ within the datatype.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <a name="ClassOpaque"></a>
+ <p>Class specific information for the Opaque class (Class 5):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Opaque Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-7</p></td>
+ <td><p>Length of ASCII tag in bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>8-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Opaque Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />ASCII Tag<br />
+ <br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Opaque Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>ASCII Tag</p></td>
+ <td>
+ <p>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <a name="ClassCompound"></a>
+ <p>Class specific information for the Compound class (Class 6):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Compound Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-15</p></td>
+ <td><p><b>Number of Members.</b> This field contains the number
+ of members defined for the compound datatype. The member
+ definitions are listed in the Properties field of the data
+ type message.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>16-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <p>The Properties field of a compound datatype is a list of the
+ member definitions of the compound datatype. The member
+ definitions appear one after another with no intervening bytes.
+ The member types are described with a (recursively) encoded datatype
+ message.</p>
+
+ <p>Note that the property descriptions are different for different
+ versions of the datatype version. Additionally note that the version
+ 0 datatype encoding is deprecated and has been replaced with later
+ encodings in versions of the HDF5 Library from the 1.4 release
+ onward.</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Compound Properties Description for Datatype Version 1
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Byte Offset of Member</td>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension Permutation</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #1 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #2 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #3 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #4 Size (required)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Member Type Message<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Compound Properties Description for Datatype Version 1
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td>
+ <p>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Byte Offset of Member</p></td>
+ <td>
+ <p>This is the byte offset of the member within the datatype.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>If set to zero, this field indicates a scalar member. If set
+ to a value greater than zero, this field indicates that the
+ member is an array of values. For array members, the size of
+ the array is indicated by the &lsquo;Size of Dimension n&rsquo; field in
+ this message.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension Permutation</p></td>
+ <td>
+ <p>This field was intended to allow an array field to have
+ its dimensions permuted, but this was never implemented.
+ This field should always be set to zero.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This field is the size of a dimension of the array field as
+ stored in the file. The first dimension stored in the list of
+ dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Member Type Message</p></td>
+ <td>
+ <p>This field is a datatype message describing the datatype of
+ the member.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Compound Properties Description for Datatype Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Byte Offset of Member</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Member Type Message<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Compound Properties Description for Datatype Version 2
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td>
+ <p>This NUL-terminated string provides a description for the
+ opaque type. It is NUL-padded to a multiple of 8 bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Byte Offset of Member</p></td>
+ <td>
+ <p>This is the byte offset of the member within the datatype.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Member Type Message</p></td>
+ <td>
+ <p>This field is a datatype message describing the datatype of
+ the member.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Compound Properties Description for Datatype Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Byte Offset of Member <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Member Type Message<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Compound Properties Description for Datatype Version 3
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>This NUL-terminated string provides a description for the
+ opaque type. It is <em>not</em> NUL-padded to a multiple of 8
+ bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Byte Offset of Member</p></td>
+ <td><p>This is the byte offset of the member within the datatype.
+ The field size is the minimum number of bytes necessary,
+ based on the size of the datatype element. For example, a
+ datatype element size of less than 256 bytes uses a 1 byte
+ length, a datatype element size of 256-65535 bytes uses a
+ 2 byte length, and so on.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Member Type Message</p></td>
+ <td><p>This field is a datatype message describing the datatype of
+ the member.</p></td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <a name="ClassReference"></a>
+ <p>Class specific information for the Reference class (Class 7):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Reference Bit Field Description for Datatype Version &lt; 4
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-3</p></td>
+ <td><p><b>Type.</b> This four-bit value contains the reference types which are supported for
+ backward compatibility. The values defined are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Object Reference (H5R_OBJECT1): A reference to another object in this
+ HDF5 file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Dataset Region Reference (H5R_DATASET_REGION1): A reference to a region within
+ a dataset in this HDF5 file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>4-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Reference Bit Field Description for Datatype Version 4
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-3</p></td>
+ <td><p><b>Type.</b> This four-bit value contains the revised reference types.
+ The values defined are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Object Reference (H5R_OBJECT2): A reference to another object
+ in this file or an external file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Dataset Region Reference (H5R_DATASET_REGION2): A reference to a region within
+ a dataset in this file or an external file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>Attribute Reference (H5R_ATTR): A reference to an attribute attached to an
+ object in this file or an external file.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>4-7</p></td>
+ <td><p><b>Version.</b> This four-bit value contains the version for encoding
+ the revised reference types. The values defined are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Unused
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The version for encoding the revised reference types: Object Reference (2),
+ Dataset Region Reference (3) and Attribute Reference (4).
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>8-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <p>There are no properties defined for the reference class.
+ </p>
+
+
+ <br />
+ <br />
+ <a name="ClassEnum"></a>
+ <p>Class specific information for the Enumeration class (Class 8):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Enumeration Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-15</p></td>
+ <td><p><b>Number of Members.</b> The number of name/value
+ pairs defined for the enumeration type.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>16-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Enumeration Property Description for Datatype Versions
+ 1 and 2
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Names<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Values<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Enumeration Property Description for Datatype Versions
+ 1 and 2
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each enumeration type is based on some parent type, usually an
+ integer. The information for that parent type is described
+ recursively by this field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Names</p></td>
+ <td>
+ <p>The name for each name/value pair. Each name is stored as a null
+ terminated ASCII string in a multiple of eight bytes. The names
+ are in no particular order.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Values</p></td>
+ <td>
+ <p>The list of values in the same order as the names. The values
+ are packed (no inter-value padding) and the size of each value
+ is determined by the parent type.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Enumeration Property Description for Datatype Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Names<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Values<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Enumeration Property Description for Datatype Version 3
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each enumeration type is based on some parent type, usually an
+ integer. The information for that parent type is described
+ recursively by this field.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Names</p></td>
+ <td>
+ <p>The name for each name/value pair. Each name is stored as a null
+ terminated ASCII string, <em>not</em> padded to a multiple of
+ eight bytes. The names are in no particular order.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Values</p></td>
+ <td>
+ <p>The list of values in the same order as the names. The values
+ are packed (no inter-value padding) and the size of each value
+ is determined by the parent type.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+
+ <br />
+ <a name="ClassVarLen"></a>
+ <p>Class specific information for the Variable-length class (Class 9):</p>
+
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Bits: Variable-length Bit Field Description
+ </caption>
+
+ <tr>
+ <th width="10%">Bits</th>
+ <th>Meaning</th>
+ </tr>
+
+ <tr>
+ <td><p>0-3</p></td>
+ <td><p><b>Type.</b> This four-bit value contains the type of
+ variable-length datatype described. The values defined are:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Sequence: A variable-length sequence of any datatype.
+ Variable-length sequences do not have padding or
+ character set information.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>String: A variable-length sequence of characters.
+ Variable-length strings have padding and character set
+ information.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>4-7</p></td>
+ <td><p><b>Padding type.</b> (variable-length string only)
+ This four-bit value determines the type of padding
+ used for variable-length strings. The values are the same
+ as for the string padding type, as follows:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Null terminate: A zero byte marks the end of a string
+ and is guaranteed to be present after converting a long
+ string to a short string. When converting a short string
+ to a long string, the value is padded with additional null
+ characters as necessary.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Null pad: Null characters are added to the end of the
+ value during conversion from a short string to a longer
+ string. Conversion from a long string to a shorter string
+ simply truncates the value.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Space pad: Space characters are added to the end of the
+ value during conversion from a short string to a longer
+ string. Conversion from a long string to a shorter string
+ simply truncates the value. This is the Fortran
+ representation of the string.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This value is set to zero for variable-length sequences.</p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>8-11</p></td>
+ <td><p><b>Character Set.</b> (variable-length string only)
+ This four-bit value specifies the character set
+ to be used for encoding the string:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2-15</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This value is set to zero for variable-length sequences.</p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>12-23</p></td>
+ <td><p>Reserved (zero).</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Variable-length Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Variable-length Property Description
+ </caption>
+ <tr>
+ <th width="10%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each variable-length type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <a name="ClassArray"></a>
+ <p>Class specific information for the Array class (Class 10):</p>
+
+ <p>There are no bit fields defined for the array class.
+ </p>
+
+ <p>Note that the dimension information defined in the property for this
+ datatype class is independent of dataspace information for a dataset.
+ The dimension information here describes the dimensionality of the
+ information within a data element (or a component of an element, if the
+ array datatype is nested within another datatype) and the dataspace for a
+ dataset describes the size and locations of the elements in a dataset.
+ </p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Array Property Description for Datatype Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #1 Size</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Permutation Index #1</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Permutation Index #n</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Array Property Description for Datatype Version 2
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the array has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the size of the dimension of the array
+ as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Permutation Index #n</p></td>
+ <td>
+ <p>This value is the index permutation used to map
+ each dimension from the canonical representation to an
+ alternate axis for each dimension. Currently, dimension
+ permutations are not supported, and these indices should
+ be set to the index position minus one. In other words,
+ the first dimension should be set to 0, the second dimension
+ should be set to 1, and so on.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each array type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Array Property Description for Datatype Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ <th width="25%">Byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #1 Size</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Base Type<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Array Property Description for Datatype Version 3
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td>
+ <p>This value is the number of dimensions that the array has.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td>
+ <p>This value is the size of the dimension of the array
+ as stored in the file. The first dimension stored in
+ the list of dimensions is the slowest changing dimension
+ and the last dimension stored is the fastest changing
+ dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Base Type</p></td>
+ <td>
+ <p>Each array type is based on some parent type. The
+ information for that parent type is described recursively by
+ this field.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+
+
+ <h4><a name="OldFillValueMessage">IV.A.2.e. The Data Storage -
+ Fill Value (Old) Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Fill Value
+ (old)</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0004</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The fill value message stores a single data value which
+ is returned to the application when an uninitialized data element
+ is read from a dataset. The fill value is interpreted with the
+ same datatype as the dataset. If no fill value message is present
+ then a fill value of all zero bytes is assumed.</p>
+ <p>This fill value message is deprecated in favor of the
+ &ldquo;new&rdquo; fill value message (Message Type 0x0005) and
+ is only written to the file for forward compatibility with
+ versions of the HDF5 Library before the 1.6.0 version.
+ Additionally, it only appears for datasets with a user-defined
+ fill value (as opposed to the library default fill value or an
+ explicitly set &ldquo;undefined&rdquo; fill value).</p>
+ </td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fill Value Message (Old)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fill Value <em>(optional, variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fill Value Message (Old)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>This is the size of the Fill Value field in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value</p></td>
+ <td>
+ <p>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <h4><a name="FillValueMessage">IV.A.2.f. The Data Storage -
+ Fill Value Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Fill
+ Value</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0005</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for dataset objects;
+ may not be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The fill value message stores a single data value which is
+ returned to the application when an uninitialized data element
+ is read from a dataset. The fill value is interpreted with the
+ same datatype as the dataset.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fill Value Message - Versions 1 and 2
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Space Allocation Time</td>
+ <td>Fill Value Write Time</td>
+ <td>Fill Value Defined</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fill Value <em>(optional, variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fill Value Message - Versions 1 and 2
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the
+ format of the fill value message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Initial version of this message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>In this version, the Size and Fill Value fields are
+ only present if the Fill Value Defined field is set
+ to 1.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>This version packs the other fields in the message
+ more efficiently than version 2.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Space Allocation Time</p></td>
+ <td>
+ <p>When the storage space for the dataset&rsquo;s raw data will be
+ allocated. The allowed values are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Not used.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Early allocation. Storage space for the entire dataset
+ should be allocated in the file when the dataset is
+ created.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Late allocation. Storage space for the entire dataset
+ should not be allocated until the dataset is written
+ to.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Incremental allocation. Storage space for the
+ dataset should not be allocated until the portion
+ of the dataset is written to. This is currently
+ used in conjunction with chunked data storage for
+ datasets.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value Write Time</p></td>
+ <td>
+ <p>At the time that storage space for the dataset&rsquo;s raw data is
+ allocated, this value indicates whether the fill value should
+ be written to the raw data storage elements. The allowed values
+ are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>On allocation. The fill value is always written to
+ the raw data storage when the storage space is allocated.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Never. The fill value should never be written to
+ the raw data storage.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Fill value written if set by user. The fill value
+ will be written to the raw data storage when the storage
+ space is allocated only if the user explicitly set
+ the fill value. If the fill value is the library
+ default or is undefined, it will not be written to
+ the raw data storage.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value Defined</p></td>
+ <td>
+ <p>This value indicates if a fill value is defined for this
+ dataset. If this value is 0, the fill value is undefined.
+ If this value is 1, a fill value is defined for this dataset.
+ For version 2 or later of the fill value message, this value
+ controls the presence of the Size and Fill Value fields.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>This is the size of the Fill Value field in bytes. This field
+ is not present if the Version field is greater than 1,
+ and the Fill Value Defined field is set to 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value</p></td>
+ <td>
+ <p>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset. This field is
+ not present if the Version field is greater than 1,
+ and the Fill Value Defined field is set to 0.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fill Value Message - Version 3
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Fill Value <em>(optional, variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fill Value Message - Version 3
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the
+ format of the fill value message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Initial version of this message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>In this version, the Size and Fill Value fields are
+ only present if the Fill Value Defined field is set
+ to 1.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>This version packs the other fields in the message
+ more efficiently than version 2.
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td>
+ <p>When the storage space for the dataset&rsquo;s raw data will be
+ allocated. The allowed values are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bits</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0-1</code></td>
+ <td>Space Allocation Time, with the same
+ values as versions 1 and 2 of the message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-3</code></td>
+ <td>Fill Value Write Time, with the same
+ values as versions 1 and 2 of the message.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>Fill Value Undefined, indicating that the fill
+ value has been marked as &ldquo;undefined&rdquo; for this dataset.
+ Bits 4 and 5 cannot both be set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>Fill Value Defined, with the same values as
+ versions 1 and 2 of the message.
+ Bits 4 and 5 cannot both be set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>6-7</code></td>
+ <td>Reserved (zero).
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td>
+ <p>This is the size of the Fill Value field in bytes. This field
+ is not present if the Version field is greater than 1,
+ and the Fill Value Defined flag is set to 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fill Value</p></td>
+ <td>
+ <p>The fill value. The bytes of the fill value are interpreted
+ using the same datatype as for the dataset. This field is
+ not present if the Version field is greater than 1,
+ and the Fill Value Defined flag is set to 0.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <h4><a name="LinkMessage">IV.A.2.g. The Link Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Link</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0006</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies </td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be
+ repeated. </td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>This message encodes the information for a link in a
+ group&rsquo;s object header, when the group is storing its links
+ &ldquo;compactly&rdquo;, or in the group&rsquo;s fractal heap,
+ when the group is storing its links &ldquo;densely&rdquo;.</p>
+ <p>A group is storing its links compactly when the fractal heap
+ address in the <em><a href="#LinkInfoMessage">Link Info
+ Message</a></em> is set to the &ldquo;undefined address&rdquo;
+ value.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Link Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td>Link type <em>(optional)</em></td>
+ <td bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Creation Order <em>(8 bytes, optional)</em><br /><br /></td>
+ </tr>
+ <tr>
+ <td>Link Name Character Set <em>(optional)</em></td>
+ <td>Length of Link Name (variable size)</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Link Name (variable size)</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Link Information (variable size)<br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Link Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes version 1.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This field contains information about the link and controls
+ the presence of other fields below.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bits</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0-1</code></td>
+ <td>Determines the size of the <em>Length of Link Name</em>
+ field.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 1 byte.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 2 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 4 bytes.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>The size of the <em>Length of Link Name</em>
+ field is 8 bytes.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Creation Order Field Present: if set, the <em>Creation
+ Order</em> field is present. If not set, creation order
+ information is not stored for links in this group.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Link Type Field Present: if set, the link is not
+ a hard link and the <em>Link Type</em> field is present.
+ If not set, the link is a hard link.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>Link Name Character Set Field Present: if set, the
+ link name is not represented with the ASCII character
+ set and the <em>Link Name Character Set</em> field is
+ present. If not set, the link name is represented with
+ the ASCII character set.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>5-7</code></td>
+ <td>Reserved (zero).
+ </td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link type</p></td>
+ <td><p>This is the link class type and can be one of the following
+ values:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>A hard link (should never be stored in the file)
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>A soft link.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-63</code></td>
+ <td>Reserved for future HDF5 internal use.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>64</code></td>
+ <td>An external link.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>65-255</code></td>
+ <td>Reserved, but available for user-defined link types.
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This field is present if bit 3 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Creation Order</p></td>
+ <td><p>This 64-bit value is an index of the link&rsquo;s creation time within
+ the group. Values start at 0 when the group is created an increment
+ by one for each link added to the group. Removing a link from a
+ group does not change existing links&rsquo; creation order field.
+ </p>
+ <p>This field is present if bit 2 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link Name Character Set</p></td>
+ <td><p>This is the character set for encoding the link&rsquo;s name:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding (this should never be stored
+ in the file)
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+ </table></p>
+
+ <p>This field is present if bit 4 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Length of link name</p></td>
+ <td><p>This is the length of the link&rsquo;s name. The size of this field
+ depends on bits 0 and 1 of <em>Flags</em>.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link name</p></td>
+ <td><p>This is the name of the link, non-NULL terminated.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link information</p></td>
+ <td><p>The format of this field depends on the <em>link type</em>.</p>
+ <p>For <b>hard</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%"><i><a href="#SizeOfOffsetsV0">
+ Size of Offsets</a></i> bytes:</td>
+ <td width="80%">The address of the object header for the object that the
+ link points to.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+ <p>
+ For <b>soft</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-2:</td>
+ <td width="80%">Length of soft link value.</td>
+ </tr>
+ <tr>
+ <td><em>Length of soft link value</em> bytes:</td>
+ <td>A non-NULL-terminated string storing the value of the
+ soft link.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+ <p>
+ For <b>external</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-2:</td>
+ <td width="80%">Length of external link value.</td>
+ </tr>
+ <tr>
+ <td><em>Length of external link value</em> bytes:</td>
+ <td>The first byte contains the version number in the
+ upper 4 bits and flags in the lower 4 bits for the external
+ link. Both version and flags are defined to be zero in
+ this document. The remaining bytes consist of two
+ NULL-terminated strings, with no padding between them.
+ The first string is the name of the HDF5 file containing
+ the object linked to and the second string is the full path
+ to the object linked to, within the HDF5 file&rsquo;s
+ group hierarchy.
+ </td>
+ </tr>
+ </table>
+ </p>
+
+ <p>
+ For <b>user-defined</b> links, the field is formatted as follows:
+
+ <table class="list">
+ <tr>
+ <td width="20%">Bytes 1-2:</td>
+ <td width="80%">Length of user-defined data.</td>
+ </tr>
+ <tr>
+ <td><em>Length of user-defined link value</em> bytes:</td>
+ <td>The data supplied for the user-defined link type.</td>
+ </tr>
+ </table>
+ </p>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <h4><a name="ExternalFileListMessage">IV.A.2.h. The Data Storage -
+ External Data Files Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> External
+ Data Files</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0007</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The external data storage message indicates that the data
+ for an object is stored outside the HDF5 file. The filename of
+ the object is stored as a Universal Resource Location (URL) of
+ the actual filename containing the data. An external file list
+ record also contains the byte offset of the start of the data
+ within the file and the amount of space reserved in the file
+ for that data.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: External File List Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Allocated Slots</td>
+ <td colspan="2">Used Slots</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Slot Definitions...<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: External File List Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the format of
+ External Data Storage Message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>The current version used by the library.</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Allocated Slots</p></td>
+ <td>
+ <p>The total number of slots allocated in the message. Its value must be at least as
+ large as the value contained in the Used Slots field. (The current library simply
+ uses the number of Used Slots for this message)</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Used Slots</p></td>
+ <td>
+ <p>The number of initial slots which contains valid information.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Heap Address</p></td>
+ <td>
+ <p>This is the address of a local heap which contains the names for the external
+ files (The local heap information can be found in Disk Format Level 1D in this
+ document). The name at offset zero in the heap is always the empty string.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Slot Definitions</p></td>
+ <td>
+ <p>The slot definitions are stored in order according to the array addresses they
+ represent.</p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: External File List Slot
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name Offset in Local Heap<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset in External Data File<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Size in External File<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: External File List Slot
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name Offset in Local Heap</p></td>
+ <td>
+ <p>The byte offset within the local name heap for the name
+ of the file. File names are stored as a URL which has a
+ protocol name, a host name, a port number, and a file
+ name:
+ <code><em>protocol</em>:<em>port</em>//<em>host</em>/<em>file</em></code>.
+ If the protocol is omitted then &ldquo;file:&rdquo; is assumed. If
+ the port number is omitted then a default port for that
+ protocol is used. If both the protocol and the port
+ number are omitted then the colon can also be omitted. If
+ the double slash and host name are omitted then
+ &ldquo;localhost&rdquo; is assumed. The file name is the only
+ mandatory part, and if the leading slash is missing then
+ it is relative to the application&rsquo;s current working
+ directory (the use of relative names is not
+ recommended).
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Offset in External Data File</p></td>
+ <td>
+ <p>This is the byte offset to the start of the data in the
+ specified file. For files that contain data for a single
+ dataset this will usually be zero.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Size in External File</p></td>
+ <td>
+ <p>This is the total number of bytes reserved in the
+ specified file for raw data storage. For a file that
+ contains exactly one complete dataset which is not
+ extendable, the size will usually be the exact size of the
+ dataset. However, by making the size larger one allows
+ HDF5 to extend the dataset. The size can be set to a value
+ larger than the entire file since HDF5 will read zeroes
+ past the end of the file without failing.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <h4><a name="LayoutMessage">IV.A.2.i. The Data Layout Message</a></h4>
+
+ <!-- start msgdesc table -->
+ <center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Data Layout</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0008</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for datasets; may not
+ be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The Data Layout message
+ describes how the elements of a multi-dimensional array are stored
+ in the HDF5 file. Four types of data layout are supported:
+ <ol>
+ <li>Contiguous: The array is stored in one contiguous area of
+ the file. This layout requires that the size of the array be
+ constant: data manipulations such as chunking, compression,
+ checksums, or encryption are not permitted. The message stores
+ the total storage size of the array. The offset of an element
+ from the beginning of the storage area is computed as in a C
+ array.</li>
+ <li>Chunked: The array domain is regularly decomposed into
+ chunks, and each chunk is allocated and stored separately. This
+ layout supports arbitrary element traversals, compression,
+ encryption, and checksums (these features are described
+ in other messages). The message stores the size of a chunk
+ instead of the size of the entire array; the storage size of
+ the entire array can be calculated by traversing the chunk index
+ that stores the chunk addresses.</li>
+ <li>Compact: The array is stored in one contiguous block as
+ part of this object header message.</li>
+ <li>Virtual: This is only supported for version 4 of the Data
+ Layout message. The message stores information that is used to
+ locate the global heap collection containing the Virtual Dataset
+ (VDS) mapping information. The mapping associates the VDS to
+ the source dataset elements that are stored across a collection
+ of HDF5 files.</li>
+ </ol></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+ </table></center>
+ <!-- end msgdesc table -->
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Data Layout Message (Versions 1 and 2)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Dimensionality</td>
+ <td>Layout Class</td>
+ <td>Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Address<sup>O</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 1 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 2 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dataset Element Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Compact Data Size <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Compact Data... <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Data Layout Message (Versions 1 and 2)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the format of the data
+ layout message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by version 1.4 and before of the library to encode layout information.
+ Data space is always allocated when the data set is created.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used by version 1.6.[0,1,2] of the library to encode layout information.
+ Data space is allocated only when it is necessary.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td><p>An array has a fixed dimensionality. This field
+ specifies the number of dimension size fields later in the
+ message. The value stored for chunked storage is 1 greater than
+ the number of dimensions in the dataset&rsquo;s dataspace.
+ For example, 2 is stored for a 1 dimensional dataset.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Layout Class</p></td>
+ <td><p>The layout class specifies the type of storage for the data
+ and how the other fields of the layout message are to be
+ interpreted.
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Compact Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Contiguous Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Chunked Storage
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Address</p></td>
+ <td><p>For contiguous storage, this is the address of the raw
+ data in the file. For chunked storage this is the address
+ of the <a href="#V1Btrees">v1 B-tree</a> that is used to look up the addresses of the
+ chunks. This field is not present for compact storage.
+ If the version for this message is greater than 1, the address
+ may have the &ldquo;undefined address&rdquo; value, to indicate that
+ storage has not yet been allocated for this array.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td><p>For contiguous and compact storage the dimensions define
+ the entire size of the array while for chunked storage they define
+ the size of a single chunk. In all cases, they are in units of
+ array elements (not bytes). The first dimension stored in the list
+ of dimensions is the slowest changing dimension and the last
+ dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataset Element Size</p></td>
+ <td><p>The size of a dataset element, in bytes. This field is only
+ present for chunked storage.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Compact Data Size</p></td>
+ <td><p>This field is only present for compact data storage.
+ It contains the size of the raw data for the dataset array, in
+ bytes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Compact Data</p></td>
+ <td><p>This field is only present for compact data storage.
+ It contains the raw data for the dataset array.</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <p>Version 3 of this message re-structured the format into specific
+ properties that are required for each layout class.</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Data Layout Message (Version 3)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Layout Class</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Properties <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Data Layout Message (Version 3)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The version number information is used for changes in the format of layout message
+ and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used by the version 1.6.3 and later of the library to store properties
+ for each layout class.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Layout Class</p></td>
+ <td><p>The layout class specifies the type of storage for the data
+ and how the other fields of the layout message are to be
+ interpreted.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Compact Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Contiguous Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Chunked Storage
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Properties</p></td>
+ <td><p>This variable-sized field encodes information specific to each
+ layout class and is described below. If there is no property
+ information specified for a layout class, the size of this field
+ is zero bytes.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <a name="CompactStorage"></a>
+ <p>Class-specific information for compact storage (layout class 0): (Note: The dimensionality information
+ is in the Dataspace message)</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Compact Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Size</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Raw Data... <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Compact Storage Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td><p>This field contains the size of the raw data for the dataset
+ array, in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Raw Data</p></td>
+ <td><p>This field contains the raw data for the dataset array.</p></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <a name="ContiguousStorage"></a>
+ <p>Class-specific information for contiguous storage (layout class 1):
+ (Note: The dimensionality information is in the Dataspace message)</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Contiguous Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Contiguous Storage Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This is the address of the raw data in the file.
+ The address may have the &ldquo;undefined address&rdquo; value, to indicate
+ that storage has not yet been allocated for this array.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Size</p></td>
+ <td><p>This field contains the size allocated to store the raw data,
+ in bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <p>Class-specific information for chunked storage (layout class 2):</p>
+
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Chunked Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Dimensionality</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 0 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 1 Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #n Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dataset Element Size</td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Chunked Storage Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td><p>A chunk has a fixed dimensionality. This field specifies
+ the number of dimension size fields later in the message.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This is the address of the <a href="#V1Btrees">v1 B-tree</a>
+ that is used to look up the
+ addresses of the chunks that actually store portions of the array
+ data. The address may have the &ldquo;undefined address&rdquo; value, to
+ indicate that storage has not yet been allocated for this array.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td><p>These values define the dimension size of a single chunk, in
+ units of array elements (not bytes). The first dimension stored in
+ the list of dimensions is the slowest changing dimension and the
+ last dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataset Element Size</p></td>
+ <td><p>The size of a dataset element, in bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+
+ <p><a name="DataLayoutV4">
+ Version 4</a> of this message is similar to version 3 but has
+ additional information for the virtual layout class as well as
+ indexing information for the chunked layout class.</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Data Layout Message (Version 4)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Layout Class</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Properties <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Data Layout Message (Version 4)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>The value for this field is 4 and is used by version 1.10.0
+ and later of the library to store properties for each layout
+ class and indexing information for the chunked layout.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Layout Class</p></td>
+ <td><p>The layout class specifies the type of storage for the data
+ and how the other fields of the layout message are to be
+ interpreted.
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Compact Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Contiguous Storage
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Chunked Storage
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Virtual Storage
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Properties</p></td>
+ <td><p>This variable-sized field encodes information specific to a
+ layout class as follows:
+ <table class="list">
+ <tr>
+ <th align="left" width="20%">Layout Class</th>
+ <th align="left" width="80%">Description</th>
+ </tr>
+
+ <tr>
+ <td align="left">Compact Storage</td>
+ <td>See <a href="#CompactStorage">Compact Storage
+ Property Description</i></a> for the version 3
+Data Layout message.
+</td>
+</tr>
+
+<tr>
+ <td align="left">Contiguous Storage</td>
+ <td>See <a href="#ContiguousStorage">Contiguous Storage
+ Property Description</i></a> for the version 3
+Data Layout message.
+</td>
+</tr>
+
+<tr>
+ <td align="left">Chunked Storage</td>
+ <td>See <a href="#ChunkedStorage">Chunked Storage
+ Property Description</i></a> below.
+</td>
+</tr>
+
+<tr>
+ <td align="left">Virtual Storage</td>
+ <td>See <a href="#VirtualStorage">Virtual Storage
+ Property Description</i></a> below.
+</td>
+</tr>
+</table>
+
+</p></td>
+</tr>
+</table>
+</div>
+
+<br />
+<a name="ChunkedStorage"></a>
+<p>Class-specific information for chunked storage (layout
+ class 2):</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Chunked Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td>Dimensionality</td>
+ <td>Dimension Size Encoded Length</td>
+ <td colspan="1" bgcolor="#DDDDDD"><em>This space inserted to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 0 Size <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension 1 Size <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">...</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Dimension #n Size <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td>Chunk Indexing Type</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Indexing Type Information <em>(variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Chunked Storage Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This is the chunked layout feature flag:</p>
+
+ <table class="list">
+ <tr>
+ <th width="55%" align="left">Value</th>
+ <th width="45%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="left"><code>DONT_FILTER_PARTIAL_BOUND_CHUNKS (bit 0)</code></td>
+ <td>Do not apply filter to a partial edge chunk.
+
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left"><code>SINGLE_INDEX_WITH_FILTER (bit 1)</code></td>
+ <td>A filtered chunk for <i>Single Chunk</i> indexing.
+ </td>
+ </tr>
+
+ </table>
+
+ </td>
+
+ </tr>
+
+ <tr>
+ <td><p>Dimensionality</p></td>
+ <td><p>A chunk has fixed dimension. This field specifies
+ the number of <em>Dimension Size</em> fields later in the message.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension Size Encoded Length</p></td>
+ <td>
+ <p>This is the size in bytes used to encode <em>Dimension Size</em>.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dimension #n Size</p></td>
+ <td><p>These values define the dimension size of a single chunk, in
+ units of array elements (not bytes). The first dimension stored in
+ the list of dimensions is the slowest changing dimension and the
+ last dimension stored is the fastest changing dimension.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Chunk Indexing Type</p></td>
+ <td><p>There are five indexing types used to look up addresses
+ of the chunks. For more information on each type, see
+ <a href="#AppendixC">&ldquo;Appendix C: Types of Indexes for
+ Dataset Chunks.&rdquo;</a>
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td><a href="#SingleChunk"><i>Single Chunk</i></a> indexing type.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td><a href="#Implicit"><i>Implicit</i></a> indexing type.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td><a href="#FixedArray"><i>Fixed Array</i></a> indexing type.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td><a href="#ExtensibleArray"><i>Extensible Array</i></a> indexing type.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td><a href="#V2Btrees"><i>Version 2 B-tree</i></a> indexing type.
+ </td>
+ </tr>
+
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Indexing Type Information</p></td>
+ <td><p>This variable-sized field encodes information specific to
+ an indexing type. More information on what is encoded with
+ each type can be found below this table.
+ <ul>
+ <li>See <a href="#IndexInfoSingle"><i>Single Chunk</i></a> below.</li>
+ <li>See <a href="#IndexInfoImplicit"><i>Implicit</i></a> below.</li>
+ <li>See <a href="#IndexInfoFixed"><i>Fixed Array</i></a> below.</li>
+ <li>See <a href="#IndexInfoExtensible"><i>Extensible Array</i></a> below.</li>
+ <li>See <a href="#IndexInfoV2Btrees"><i>Version 2 B-tree</i></a> below.</li>
+ </ul>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This is the address specific to an indexing type.
+ The address may be undefined if the chunk or index storage is not allocated yet.
+ <table class="list">
+ <tr>
+ <th width="40%" align="left">Value</th>
+ <th width="60%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="left"><i>Single Chunk index</i></td>
+ <td align="left">Address of the single chunk.</td>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left"><i>Implicit index</i></td>
+ <td align="left">Address of the array of dataset chunks.</td>
+</td>
+</tr>
+
+<tr>
+ <td align="left"><i>Fixed Array index</i></td>
+ <td align="left">Address of the index.</td>
+</tr>
+
+<tr>
+ <td align="left"><i>Extensible Array index</i></td>
+ <td align="left">Address of the index.</td>
+</td>
+</tr>
+
+<tr>
+ <td align="left"><i>Version 2 B-tree index</i></td>
+ <td align="left">Address of the index.</td>
+</td>
+</tr>
+
+</table>
+
+</p>
+</td>
+</tr>
+
+</table>
+</div>
+
+<br />
+
+<ol>
+ <li>
+ <a name="IndexInfoSingle"></a>
+ Index-specific information for <i>Single Chunk</i>:
+ </li>
+
+ <p>The following information exists only when the chunk is filtered.
+ In other words, when <code>DONT_FILTER_PARTIAL_BOUND_CHUNKS</code>
+ (bit 0) is enabled in the field <em>flags</em>.</p>
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Single Chunk Indexing Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of filtered chunk<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Filters for chunk</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="55%">&nbsp;</td>
+ <td width="45%"> <!-- width is slightly different: these
+ tables are part of an ordered list; see <ol> tags. -->
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Single Chunk Indexing Information
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Size of filtered chunk</p></td>
+ <td><p>This field is the size of a filtered chunk.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Filters for chunk</p></td>
+ <td><p>This field contains filters for the chunk.</p></td>
+ </tr>
+ </table>
+ </div>
+</p>
+
+<br />
+
+<li>
+ <a name="IndexInfoImplicit"></a>
+ Index-specific information for <i>Implicit</i>:
+</li>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Implicit Indexing Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4" bgcolor="#DDDDDD">
+ <em>No specific indexing information</em></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<li>
+ <a name="IndexInfoFixed"></a>
+ Index-specific information for <i>Fixed Array</i>:
+</li>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fixed Array Indexing Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="1">Page Bits</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fixed Array Indexing Information
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Page Bits</p></td>
+ <td><p>This field contains the number of bits needed to store the
+ maximum number of elements in a data block page.</p></td>
+ </tr>
+
+ </table>
+</div>
+</p>
+
+<br />
+<li>
+ <a name="IndexInfoExtensible"></a>
+ Index-specific information for <i>Extensible Array</i>:
+</li>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Extensible Array Indexing Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Max Bits</td>
+ <td>Index Elements</td>
+ <td>Min Pointers</td>
+ <td>Min Elements</td>
+ </tr>
+
+ <td colspan="2">Page Bits</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Extensible Array Indexing Information
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Max Bits</p></td>
+ <td><p>This field contains the number of bits needed to store the maximum number of elements
+ in the array.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Index Elements</p></td>
+ <td><p>This field contains the number of elements to store in the
+ index block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Min Pointers</p></td>
+ <td><p>This field contains the minimum number of data block pointers
+ for a superblock.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Min Elements</p></td>
+ <td><p>This field contains the minimum number of elements per data block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Page Bits</p></td>
+ <td><p>This field contains the number of bits needed to store the
+ maximum number of elements in a data block page.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+</p>
+<br />
+
+<li>
+ <a name="IndexInfoV2Btrees"></a>
+ Index-specific information for <i>Version 2 B-tree</i>:
+</li>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 B-tree Indexing Information
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Node Size</td>
+ </tr>
+
+ <tr>
+ <td>Split Percent</td>
+ <td>Merge Percent</td>
+ <td colspan="2" bgcolor="#DDDDDD">
+ <em>This space inserted only to align table nicely</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 B-tree Indexing Information
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Node Size</p></td>
+ <td><p>This field is the size in bytes of a B-tree node.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Split Percent</p></td>
+ <td><p>This field is the percentage full of a B-tree node at which to split the node.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Merge Percent</p></td>
+ <td><p>This field is the percentage full of a B-tree node at which to merge the node.</p></td>
+ </tr>
+ </table>
+</div>
+</ol>
+
+
+
+<br />
+<a name="VirtualStorage"></a>
+<p>
+ Class-specific information for virtual storage (layout class 3):</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Virtual Storage Property Description
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Index</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Virtual Storage Property Description
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>This is the address of the global heap collection where
+ the VDS mapping entries are stored.
+ See <a href="#GlobalHeapVDS">&ldquo;Disk Format: Level 1F -
+ Global Heap Block for Virtual Datasets.&rdquo;</a>
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Index</p></td>
+ <td><p>This is the index of the data object within the global heap collection.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="BogusMessage">IV.A.2.j. The Bogus Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Bogus</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0009</td></tr>
+ <tr><td colspan="2"><b>Length:</b> 4 bytes</td></tr>
+ <tr><td colspan="2"><b>Status:</b> For testing only; should never
+ be stored in a valid file.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message is used for testing the HDF5 Library&rsquo;s
+ response to an &ldquo;unknown&rdquo; message type and should
+ never be encountered in a valid HDF5 file.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Bogus Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Bogus Value</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Bogus Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Bogus Value</p></td>
+ <td>
+ <p>This value should always be: <code>0xdeadbeef</code>.</p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="GroupInfoMessage">IV.A.2.k. The Group Info Message
+</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Group Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000A</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>This message stores information for the constants defining
+ a &ldquo;new style&rdquo; group&rsquo;s behavior. Constant
+ information will be stored in this message and variable
+ information will be stored in the
+ <a href="#LinkInfoMessage">Link Info</a> message.</p>
+ <p>Note: the &ldquo;estimated entry&rdquo; information below is
+ used when determining the size of the object header for the
+ group when it is created.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Group Info Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Link Phase Change: Maximum Compact Value <em>(optional)</em></td>
+ </tr>
+ <tr>
+ <td colspan="2">Link Phase Change: Minimum Dense Value <em>(optional)</em></td>
+ <td colspan="2">Estimated Number of Entries <em>(optional)</em></td>
+ </tr>
+ <tr>
+ <td colspan="2">Estimated Link Name Length of Entries <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Group Info Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This is the group information flag with the following definition:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, link phase change values are stored.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, the estimated entry information is non-default
+ and is stored.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link Phase Change: Maximum Compact Value</p></td>
+ <td><p>The is the maximum number of links to store &ldquo;compactly&rdquo; (in
+ the group&rsquo;s object header).</p>
+ <p>This field is present if bit 0 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Link Phase Change: Minimum Dense Value</p></td>
+ <td><p>This is the minimum number of links to store &ldquo;densely&rdquo; (in
+ the group&rsquo;s fractal heap). The fractal heap&rsquo;s address is
+ located in the <a href="#LinkInfoMessage">Link Info</a>
+ message.</p>
+ <p>This field is present if bit 0 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Estimated Number of Entries</p></td>
+ <td><p>This is the estimated number of entries in groups.</p>
+ <p>If this field is not present, the default value of <code>4</code>
+ will be used for the estimated number of group entries.</p>
+ <p>This field is present if bit 1 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Estimated Link Name Length of Entries</p></td>
+ <td><p>This is the estimated length of entry name.</p>
+ <p>If this field is not present, the default value of <code>8</code>
+ will be used for the estimated link name length of group entries.</p>
+ <p>This field is present if bit 1 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+<!-- </p> -->
+
+<h4><a name="FilterMessage">IV.A.2.l. The Data Storage - Filter
+ Pipeline Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b>
+ Data Storage - Filter Pipeline</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000B</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>This message describes the filter pipeline which should
+ be applied to the data stream by providing filter identification
+ numbers, flags, a name, and client data.</p>
+ <p>This message may be present in the object headers of both
+ dataset and group objects. For datasets, it specifies the
+ filters to apply to raw data. For groups, it specifies the
+ filters to apply to the group&rsquo;s fractal heap. Currently,
+ only datasets using chunked data storage use the filter
+ pipeline on their raw data.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Filter Pipeline Message - Version 1
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Number of Filters</td>
+ <td colspan="2">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved (zero)</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filter Description List <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Filter Pipeline Message - Version 1
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This table
+ describes version 1.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Filters</p></td>
+ <td><p>The total number of filters described in this
+ message. The maximum possible number of filters in a
+ message is 32.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Description List</p></td>
+ <td><p>A description of each filter. A filter description
+ appears in the next table.</p></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Filter Description - Version 1
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Filter Identification Value</td>
+ <td colspan="2">Name Length</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Flags</td>
+ <td colspan="2">Number Client Data Values</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Client Data <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Padding <em>(variable size, optional)</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Filter Description - Version 1
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filter Identification Value</p></td>
+ <td>
+ <p>
+ This value, often referred to as a filter identifier,
+ is designed to be a unique identifier for the filter.
+ Values from zero through 32,767 are reserved for filters
+ supported by The HDF Group in the HDF5 Library and for
+ filters requested and supported by third parties.
+ Filters supported by The HDF Group are documented immediately
+ below. Information on 3rd-party filters can be found at
+ The HDF Group&rsquo;s
+ <a href="http://www.hdfgroup.org/services/contributions.html">
+ Contributions</a> page.</p>
+
+ <p>
+ To request a filter identifier, please contact
+ The HDF Group&rsquo;s Help Desk at
+ <img src="Graphics/help.png" valign="middle" height="14"
+ alt="The HDF Group Help Desk">.
+ You will be asked to provide the following information:</p>
+ <ol>
+ <li>Contact information for the developer requesting the
+ new identifier</li>
+ <li>A short description of the new filter</li>
+ <li>Links to any relevant information, including licensing
+ information</li>
+ </ol>
+ <p>
+ Values from 32768 to 65535 are reserved for non-distributed uses
+ (for example, internal company usage) or for application usage
+ when testing a feature. The HDF Group does not track or document
+ the use of the filters with identifiers from this range.</p>
+
+ <p>
+ The filters currently in library version 1.8.0 are
+ listed below:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Identification</th>
+ <th width="15%" align="left">Name</th>
+ <th width="65%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>N/A</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>deflate</td>
+ <td>GZIP deflate compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>shuffle</td>
+ <td>Data element shuffling</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>fletcher32</td>
+ <td>Fletcher32 checksum</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>szip</td>
+ <td>SZIP compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>nbit</td>
+ <td>N-bit packing</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td>scaleoffset</td>
+ <td>Scale and offset encoded values</td>
+ </tr>
+ </table>
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name Length</p></td>
+ <td><p>Each filter has an optional null-terminated ASCII name
+ and this field holds the length of the name including the
+ null termination padded with nulls to be a multiple of
+ eight. If the filter has no name then a value of zero is
+ stored in this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>The flags indicate certain properties for a filter. The
+ bit values defined so far are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set then the filter is an optional filter.
+ During output, if an optional filter fails it will be
+ silently skipped in the pipeline.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1-15</code></td>
+ <td>Reserved (zero)</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Client Data Values</p></td>
+ <td><p>Each filter can store integer values to control
+ how the filter operates. The number of entries in the
+ <em>Client Data</em> array is stored in this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>If the <em>Name Length</em> field is non-zero then it will
+ contain the size of this field, padded to a multiple of eight. This
+ field contains a null-terminated, ASCII character string to serve
+ as a comment/name for the filter.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Client Data</p></td>
+ <td><p>This is an array of four-byte integers which will be
+ passed to the filter function. The <em>Client Data Number</em> of
+ Values determines the number of elements in the array.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Padding</p></td>
+ <td><p>Four bytes of zeroes are added to the message at this
+ point if the Client Data Number of Values field contains
+ an odd number.</p></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Filter Pipeline Message - Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Number of Filters</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Filter Description List <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Filter Pipeline Message - Version 2
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This table
+ describes version 2.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Filters</p></td>
+ <td><p>The total number of filters described in this
+ message. The maximum possible number of filters in a
+ message is 32.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Description List</p></td>
+ <td><p>A description of each filter. A filter description
+ appears in the next table.</p></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Filter Description - Version 2
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="2">Filter Identification Value</td>
+ <td colspan="2">Name Length <em>(optional)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Flags</td>
+ <td colspan="2">Number Client Data Values</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Client Data <em>(variable size, optional)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Filter Description - Version 2
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Filter Identification Value</p></td>
+ <td>
+ <p>
+ This value, often referred to as a filter identifier,
+ is designed to be a unique identifier for the filter.
+ Values from zero through 32,767 are reserved for filters
+ supported by The HDF Group in the HDF5 Library and for
+ filters requested and supported by third parties.
+ Filters supported by The HDF Group are documented immediately
+ below. Information on 3rd-party filters can be found at
+ The HDF Group&rsquo;s
+ <a href="http://www.hdfgroup.org/services/contributions.html">
+ Contributions</a> page.</p>
+
+ <p>
+ To request a filter identifier, please contact
+ The HDF Group&rsquo;s Help Desk at
+ <img src="Graphics/help.png" valign="middle" height="14"
+ alt="The HDF Group Help Desk">.
+ You will be asked to provide the following information:</p>
+ <ol>
+ <li>Contact information for the developer requesting the
+ new identifier</li>
+ <li>A short description of the new filter</li>
+ <li>Links to any relevant information, including licensing
+ information</li>
+ </ol>
+ <p>
+ Values from 32768 to 65535 are reserved for non-distributed uses
+ (for example, internal company usage) or for application usage
+ when testing a feature. The HDF Group does not track or document
+ the use of the filters with identifiers from this range.</p>
+
+ <p>
+ The filters currently in library version 1.8.0 are
+ listed below:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Identification</th>
+ <th width="15%" align="left">Name</th>
+ <th width="65%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>N/A</td>
+ <td>Reserved</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>deflate</td>
+ <td>GZIP deflate compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>shuffle</td>
+ <td>Data element shuffling</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>fletcher32</td>
+ <td>Fletcher32 checksum</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>szip</td>
+ <td>SZIP compression</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>5</code></td>
+ <td>nbit</td>
+ <td>N-bit packing</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>6</code></td>
+ <td>scaleoffset</td>
+ <td>Scale and offset encoded values</td>
+ </tr>
+ </table>
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name Length</p></td>
+ <td><p>Each filter has an optional null-terminated ASCII name
+ and this field holds the length of the name including the
+ null termination padded with nulls to be a multiple of
+ eight. If the filter has no name then a value of zero is
+ stored in this field.</p>
+ <p>Filters with IDs less than 256 (in other words, filters
+ that are defined in this format documentation) do not store
+ the <em>Name Length</em> or <em>Name</em> fields.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>The flags indicate certain properties for a filter. The
+ bit values defined so far are:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set then the filter is an optional filter.
+ During output, if an optional filter fails it will be
+ silently skipped in the pipeline.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1-15</code></td>
+ <td>Reserved (zero)</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Client Data Values</p></td>
+ <td><p>Each filter can store integer values to control
+ how the filter operates. The number of entries in the
+ <em>Client Data</em> array is stored in this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>If the <em>Name Length</em> field is non-zero, then it will
+ contain the size of this field, <em>not</em> padded to a multiple
+ of eight. This field contains a <em>non-</em>null-terminated,
+ ASCII character string to serve as a comment/name for the filter.
+ </p>
+ <p>Filters that are defined in this format documentation
+ such as deflate and shuffle do not store the <em>Name
+ Length</em> or <em>Name</em> fields.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client Data</p></td>
+ <td><p>This is an array of four-byte integers which will be
+ passed to the filter function. The Client Data Number of
+ Values</em> determines the number of elements in the array.</p>
+</td>
+</tr>
+</table>
+</div>
+
+<h4><a name="AttributeMessage">IV.A.2.m. The Attribute Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Attribute</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000C</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The <em>Attribute</em> message is used to store objects
+ in the HDF5 file which are used as attributes, or
+ &ldquo;metadata&rdquo; about the current object. An attribute
+ is a small dataset; it has a name, a datatype, a dataspace, and
+ raw data. Since attributes are stored in the object header, they
+ should be relatively small (in other words, less than 64KB).
+ They can be associated with any type of object which has an
+ object header (groups, datasets, or committed (named)
+ datatypes).</p>
+ <p>In 1.8.x versions of the library, attributes can be larger
+ than 64KB. See the
+ <a href="UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FAttributes%2FHDF5_Attributes.htm%3Frhtocid%3Dtoc8.2_1%23TOC_8_5_Special_Issuesbc-13">
+ &ldquo;Special Issues&rdquo;</a> section of the Attributes chapter
+ in the <cite>HDF5 User&rsquo;s Guide</cite> for more information.</p>
+ <p>Note: Attributes on an object must have unique names:
+ the HDF5 Library currently enforces this by causing the
+ creation of an attribute with a duplicate name to fail.
+ Attributes on different objects may have the same name,
+ however.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Attribute Message (Version 1)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Reserved (zero)</td>
+ <td colspan="2">Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Datatype Size</td>
+ <td colspan="2">Dataspace Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Datatype <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dataspace <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Attribute Message (Version 1)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number information is used for changes in the format of the
+ attribute message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by the library before version 1.6 to encode attribute message.
+ This version does not support shared datatypes.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name Size</p></td>
+ <td><p>The length of the attribute name in bytes including the
+ null terminator. Note that the <em>Name</em> field below may
+ contain additional padding not represented by this
+ field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype Size</p></td>
+ <td><p>The length of the datatype description in the <em>Datatype</em>
+ field below. Note that the <em>Datatype</em> field may contain
+ additional padding not represented by this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Size</p></td>
+ <td><p>The length of the dataspace description in the <em>Dataspace</em>
+ field below. Note that the <em>Dataspace</em> field may contain
+ additional padding not represented by this field.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>The null-terminated attribute name. This field is
+ padded with additional null characters to make it a
+ multiple of eight bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype</p></td>
+ <td><p>The datatype description follows the same format as
+ described for the datatype object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace</p></td>
+ <td><p>The dataspace description follows the same format as
+ described for the dataspace object header message. This
+ field is padded with additional zero bytes to make it a
+ multiple of eight bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td><p>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions. This
+ field is <em>not</em> padded with additional bytes.</p></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Attribute Message (Version 2)
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Datatype Size</td>
+ <td colspan="2">Dataspace Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Datatype <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dataspace <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Attribute Message (Version 2)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number information is used for changes in the
+ format of the attribute message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Used by the library of version 1.6.x and after to encode
+ attribute messages.
+ This version supports shared datatypes. The fields of
+ name, datatype, and dataspace are not padded with
+ additional bytes of zero.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This bit field contains extra information about
+ interpreting the attribute message:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, datatype is shared.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, dataspace is shared.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name Size</p></td>
+ <td><p>The length of the attribute name in bytes including the
+ null terminator.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype Size</p></td>
+ <td><p>The length of the datatype description in the <em>Datatype</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Size</p></td>
+ <td><p>The length of the dataspace description in the <em>Dataspace</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>The null-terminated attribute name. This field is <em>not</em>
+ padded with additional bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype</p></td>
+ <td><p>The datatype description follows the same format as
+ described for the datatype object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s datatype is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the datatype encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace</p></td>
+ <td><p>The dataspace description follows the same format as
+ described for the dataspace object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s dataspace is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the dataspace encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td><p>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions.
+ </p>
+ <p>This field is <em>not</em> padded with additional zero bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Attribute Message (Version 3)
+ </caption>
+
+ <tr align="center">
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Name Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Datatype Size</td>
+ <td colspan="2">Dataspace Size</td>
+ </tr>
+
+ <tr>
+ <td>Name Character Set Encoding</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Name <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Datatype <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Dataspace <em>(variable size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Attribute Message (Version 3)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number information is used for changes in the
+ format of the attribute message and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Used by the library of version 1.8.x and after to
+ encode attribute messages.
+ This version supports attributes with non-ASCII names.
+ </td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This bit field contains extra information about
+ interpreting the attribute message:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, datatype is shared.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, dataspace is shared.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name Size</p></td>
+ <td><p>The length of the attribute name in bytes including the
+ null terminator.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype Size</p></td>
+ <td><p>The length of the datatype description in the <em>Datatype</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Size</p></td>
+ <td><p>The length of the dataspace description in the <em>Dataspace</em>
+ field below.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Name Character Set Encoding</p></td>
+ <td><p>The character set encoding for the attribute&rsquo;s name:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>ASCII character set encoding
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>UTF-8 character set encoding
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>The null-terminated attribute name. This field is <em>not</em>
+ padded with additional bytes.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Datatype</p></td>
+ <td><p>The datatype description follows the same format as
+ described for the datatype object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s datatype is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the datatype encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace</p></td>
+ <td><p>The dataspace description follows the same format as
+ described for the dataspace object header message.
+ </p>
+ <p>If the
+ <em>Flag</em> field indicates this attribute&rsquo;s dataspace is
+ shared, this field will contain a &ldquo;shared message&rdquo; encoding
+ instead of the dataspace encoding.
+ </p>
+ <p>This field is <em>not</em> padded with additional bytes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data</p></td>
+ <td><p>The raw data for the attribute. The size is determined
+ from the datatype and dataspace descriptions.
+ </p>
+ <p>This field is <em>not</em> padded with additional zero bytes.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="CommentMessage">IV.A.2.n. The Object Comment
+ Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object
+ Comment</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000D</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The object comment is designed to be a short description of
+ an object. An object comment is a sequence of non-zero
+ (<code>\0</code>) ASCII characters with no other formatting
+ included by the library.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Object Comment Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Comment <em>(variable size)</em><br /><br /></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Object Comment Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Name</p></td>
+ <td><p>A null terminated ASCII character string.</p></td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="OldModificationTimeMessage">IV.A.2.o. The Object
+ Modification Time (Old) Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object
+ Modification Time (Old)</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000E</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td><p>The object modification date and time is a timestamp
+ which indicates (using ISO-8601 date and time format) the last
+ modification of an object. The time is updated when any object
+ header message changes according to the system clock where the
+ change was posted. All fields of this message should be
+ interpreted as coordinated universal time (UTC).</p>
+ <p>This modification time message is deprecated in favor of
+ the &ldquo;new&rdquo; <a href="#ModificationTimeMessage">Object
+ Modification Time</a> message and is no longer written to the
+ file in versions of the HDF5 Library after the 1.6.0
+ version.</p></td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Modification Time Message (Old)
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Year</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Month</td>
+ <td colspan="2">Day of Month</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Hour</td>
+ <td colspan="2">Minute</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Second</td>
+ <td colspan="2">Reserved</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Modification Time Message (Old)
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Year</p></td>
+ <td><p>The four-digit year as an ASCII string. For example,
+ <code>1998</code>.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Month</p></td>
+ <td><p>The month number as a two digit ASCII string where
+ January is <code>01</code> and December is <code>12</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Day of Month</p></td>
+ <td><p>The day number within the month as a two digit ASCII
+ string. The first day of the month is <code>01</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Hour</p></td>
+ <td><p>The hour of the day as a two digit ASCII string where
+ midnight is <code>00</code> and 11:00pm is <code>23</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Minute</p></td>
+ <td><p>The minute of the hour as a two digit ASCII string where
+ the first minute of the hour is <code>00</code> and
+ the last is <code>59</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Second</p></td>
+ <td><p>The second of the minute as a two digit ASCII string
+ where the first second of the minute is <code>00</code>
+ and the last is <code>59</code>.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Reserved</p></td>
+ <td><p>This field is reserved and should always be zero.</p></td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="SOHMTableMessage">IV.A.2.p. The Shared Message Table
+ Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Shared Message
+ Table</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x000F</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message is used to locate the table of shared object
+ header message (SOHM) indexes. Each index consists of information
+ to find the shared messages from either the heap or object header.
+ This message is <em>only</em> found in the superblock
+ extension.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Shared Message Table Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Shared Object Header Message Table Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td>Number of Indices</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Shared Message Table Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes version 0.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Shared Object Header Message Table Address</p></td>
+ <td><p>This field is the address of the master table for shared
+ object header message indexes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Number of Indices</p></td>
+ <td><p>This field is the number of indices in the master table.
+ </p></td>
+ </tr>
+
+ </table>
+</div>
+
+<h4><a name="ContinuationMessage">IV.A.2.q. The Object Header
+ Continuation Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object Header
+ Continuation</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0010</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The object header continuation is the location in the file
+ of a block containing more header messages for the current data
+ object. This can be used when header blocks become too large or
+ are likely to change over time.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Object Header Continuation Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Offset<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Length<sup>L</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Object Header Continuation Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Offset</p></td>
+ <td><p>This value is the address in the file where the
+ header continuation block is located.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>This value is the length in bytes of the header continuation
+ block in the file.</p></td>
+ </tr>
+ </table>
+</div>
+<br />
+
+<p>The format of the header continuation block that this message points
+ to depends on the version of the object header that the message is
+ contained within.
+</p>
+
+<p>
+ Continuation blocks for version 1 object headers have no special
+ formatting information; they are merely a list of object header
+ message info sequences (type, size, flags, reserved bytes and data
+ for each message sequence). See the description
+ of <a href="#V1ObjectHeaderPrefix">Version 1 Data Object Header Prefix.</a>
+</p>
+
+<p>Continuation blocks for version 2 object headers <em>do</em> have
+ special formatting information as described here
+ (see also the description of
+ <a href="#V2ObjectHeaderPrefix">Version 2 Data Object Header Prefix.</a>):
+</p>
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 Object Header Continuation Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+ <tr>
+ <td>Header Message Type #1</td>
+ <td colspan="2">Size of Header Message Data #1</td>
+ <td>Header Message #1 Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #1 Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #1<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td>Header Message Type #n</td>
+ <td colspan="2">Size of Header Message Data #n</td>
+ <td>Header Message #n Flags</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Header Message #n Creation Order <em>(optional)</em></td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Message Data #n<br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Gap <em>(optional, variable size)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 Object Header Continuation Block
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>OCHK</code>&rdquo;
+ is used to indicate the beginning of an object header
+ continuation block. This gives file consistency checking
+ utilities a better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Type</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Header Message #n Data</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Flags</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Creation Order</p></td>
+ <td>
+ <p>This field stores the order that a message of a given type
+ was created in.</p>
+ <p>This field is present if bit 2 of <em>flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Message #n Data</p></td>
+ <td>
+ <p>Same format as version 1 of the object header, described above.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Gap</p></td>
+ <td>
+ <p>A gap in an object header chunk is inferred by the end of the
+ messages for the chunk before the beginning of the chunk&rsquo;s
+ checksum. Gaps are always smaller than the size of an
+ object header message prefix (message type + message size +
+ message flags).</p>
+ <p>Gaps are formed when a message (typically an attribute message)
+ in an earlier chunk is deleted and a message from a later
+ chunk that does not quite fit into the free space is moved
+ into the earlier chunk.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>This is the checksum for the object header chunk.
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="SymbolTableMessage">IV.A.2.r. The Symbol Table
+ Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Symbol Table
+ Message</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0011</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Required for
+ &ldquo;old style&rdquo; groups; may not be repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>Each &ldquo;old style&rdquo; group has a v1 B-tree and a
+ local heap for storing symbol table entries, which are located
+ with this message.</td></tr>
+ <tr><td colspan="2"><b>Format of data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Symbol Table Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />v1 B-tree Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Local Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Symbol Table Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>v1 B-tree Address</p></td>
+ <td><p>This value is the address of the v1 B-tree containing the
+ symbol table entries for the group.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Local Heap Address</p></td>
+ <td><p>This value is the address of the local heap containing
+ the link names for the symbol table entries for the group.</p></td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="ModificationTimeMessage">IV.A.2.s. The Object
+ Modification Time Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object
+ Modification Time</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0012</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>The object modification time is a timestamp which indicates
+ the time of the last modification of an object. The time is
+ updated when any object header message changes according to
+ the system clock where the change was posted.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Modification Time Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3">Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Seconds After UNIX Epoch</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Modification Time Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number is used for changes in the format of Object Modification Time
+ and is described here:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Never used.</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Used by Version 1.6.1 and after of the library to encode time. In
+ this version, the time is the seconds after Epoch.</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Seconds After UNIX Epoch</p></td>
+ <td><p>A 32-bit unsigned integer value that stores the number of
+ seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970,
+ Coordinated Universal Time.</p></td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="BtreeKValuesMessage">IV.A.2.t. The B-tree
+ &lsquo;K&rsquo; Values Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> B-tree
+ &lsquo;K&rsquo; Values</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0013</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message retrieves non-default &lsquo;K&rsquo; values
+ for internal and leaf nodes of a group or indexed storage v1
+ B-trees. This message is <em>only</em> found in the superblock
+ extension.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: B-tree &lsquo;K&rsquo; Values Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="2">Indexed Storage Internal Node K</td>
+ <td bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Group Internal Node K</td>
+ <td colspan="2">Group Leaf Node K</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: B-tree &lsquo;K&rsquo; Values Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Indexed Storage Internal Node K</p></td>
+ <td><p>This is the node &lsquo;K&rsquo; value for each internal node of an
+ indexed storage v1 B-tree. See the description of this field
+ in version 0 and 1 of the superblock as well the section on
+ v1 B-trees.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Internal Node K</p></td>
+ <td><p>This is the node &lsquo;K&rsquo; value for each internal node of a group
+ v1 B-tree. See the description of this field in version 0 and
+ 1 of the superblock as well as the section on v1 B-trees.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Group Leaf Node K</p></td>
+ <td><p>This is the node &lsquo;K&rsquo; value for each leaf node of a group v1
+ B-tree. See the description of this field in version 0 and 1
+ of the superblock as well as the section on v1 B-trees.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<h4><a name="DrvInfoMessage">IV.A.2.u. The Driver Info
+ Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Driver
+ Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0014</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+
+ <tr><td>
+ <b>Description:</b></td>
+ <td>This message contains information needed by the file driver
+ to reopen a file. This message is <em>only</em> found in the
+ superblock extension: see the <a href="#SuperblockExt">
+ &ldquo;Disk Format: Level 0C - Superblock Extension&rdquo;</a>
+ section for more information. For more information on the fields
+ in the driver info message, see the <a href="#DriverInfo">
+ &ldquo;Disk Format: Level 0B - File Driver Info&rdquo;</a>
+ section; those who use the multi and family file drivers will
+ find this section particularly helpful.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Driver Info Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Driver Identification</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Driver Information Size</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Driver Information <em>(variable size)</em><br /><br /><br /></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Driver Info Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Identification</p></td>
+ <td><p>This is an eight-byte ASCII string without null termination which
+ identifies the driver.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information Size</p></td>
+ <td><p>The size in bytes of the <em>Driver Information</em> field of this
+ message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Driver Information</p></td>
+ <td><p>Driver information is stored in a format defined by the file driver.</p>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<h4><a name="AinfoMessage">IV.A.2.v. The Attribute Info
+ Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Attribute
+ Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0015</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Varies</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message stores information about the attributes on an
+ object, such as the maximum creation index for the attributes
+ created and the location of the attribute storage when the
+ attributes are stored &ldquo;densely&rdquo;.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Attribute Info Message
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Flags</td>
+ <td colspan="2">Maximum Creation Index <em>(optional)</em></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Fractal Heap Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Attribute Name v2 B-tree Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Attribute Creation Order v2 B-tree Address<sup>O</sup> <em>(optional)</em><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Attribute Info Message
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This is the attribute index information flag with the
+ following definition:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, creation order for attributes is tracked.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>If set, creation order for attributes is indexed.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Maximum Creation Index</p></td>
+ <td><p>The is the maximum creation order index value for the
+ attributes on the object.</p>
+ <p>This field is present if bit 0 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Fractal Heap Address</p></td>
+ <td><p>This is the address of the fractal heap to store dense
+ attributes.
+ Each attribute stored in the fractal heap is described by
+ the <a href="#AttributeMessage">Attribute Message.</a>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Attribute Name v2 B-tree Address</p></td>
+ <td><p>This is the address of the version 2 B-tree to index the
+ names of densely stored attributes.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Attribute Creation Order v2 B-tree Address</p></td>
+ <td><p>This is the address of the version 2 B-tree to index the
+ creation order of densely stored attributes.</p>
+ <p>This field is present if bit 1 of <em>Flags</em> is set.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<h4><a name="RefCountMessage">IV.A.2.w. The Object Reference
+ Count Message</a></h4>
+
+<!-- start msgdesc table -->
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> Object Reference
+ Count</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0016</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td><b>Description:</b></td>
+ <td>This message stores the number of hard links (in groups or
+ objects) pointing to an object: in other words, its
+ <em>reference count</em>.</td></tr>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<!-- end msgdesc table -->
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Object Reference Count
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reference count</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Object Reference Count
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for this message. This document describes
+ version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Reference Count</p></td>
+ <td><p>The unsigned 32-bit integer is the reference count for the
+ object. This message is only present in &ldquo;version 2&rdquo;
+ (or later) object headers, and if not present those object
+ header versions, the reference count for the object is assumed
+ to be 1.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+
+<h4><a name="FsinfoMessage">IV.A.2.x. The File Space Info
+ Message</a></h4>
+
+<center>
+ <table class="msgdesc">
+ <tr><td colspan="2"><b>Header Message Name:</b> File Space
+ Info</td></tr>
+ <tr><td colspan="2"><b>Header Message Type:</b> 0x0017</td></tr>
+ <tr><td colspan="2"><b>Length:</b> Fixed</td></tr>
+ <tr><td colspan="2"><b>Status:</b> Optional; may not be
+ repeated.</td></tr>
+ <tr><td>
+ <b>Description:</b></td>
+ <td>This message stores the file space management information
+ that the library uses in handling file space
+ requests for the file. Version 0 of the message is used for release 1.10.0 only.
+ Version 1 of the message is used for release 1.10.1+.
+ There is no File Space Info message before release 1.10 as the library does
+ not track file space across multiple file opens.
+ <p>
+ Note that version 0 is deprecated starting release 1.10.1.
+ That means when the 1.10.1+ library opens an HDF5 file with a version 0 message,
+ the library will decode and map the message to version 1.
+ On file close, it will encode the message as a version 1 message.
+ <p>
+ The library uses the following three mechanisms to manage file space in an HDF5 file:
+ <ul>
+ <li> Free-space managers
+ <br> They track free-space sections of various sizes in the file that are not currently
+ allocated. Each free-space manager corresponds to a file space type.
+ There are two main groups of file space types: metadata and raw data.
+ Metadata is further divided into five types: superblock, B-tree, global heap,
+ local heap, and object header.
+ See the description of <a href="#FreeSpaceManager">Free-space
+ Manager</a> as well the description of file space allocation types in
+ <a href="#AppendixB">Appendix B</a>
+ </li>
+ <li> Aggregators
+ <br> The library manages two aggregators, one for metadata and one for raw data.
+ Aggregator is a contiguous block of free-space in the file.
+ The size of each aggregator is tunable via public routines
+ <code>H5Pset_meta_block_size</code> and <code>H5Pset_small_data_block_size</code> respectively.
+ </li>
+ <li> Virtual file drivers
+ <br> The library's virtual file driver interface dispatches requests for additional
+ space to the allocation routine of the file driver associated with the file.
+ For example, if the sec2 file driver is being used, its allocation routine will
+ increase the size of the file to service the requests.
+ </li>
+ </ul>
+ <p>
+ For release 1.10.0, the library derives the following four file space strategies
+ based on the mechanisms:
+ <ul>
+ <li>H5F_FILE_SPACE_ALL
+ <ul>
+ <li>Mechanisms used: free-space managers, aggregators, and virtual file drivers</li>
+ <li>Does not persist free-space across file opens</li>
+ <li>This strategy is the library default</li>
+ </ul>
+ </li>
+ <li>H5F_FILE_SPACE_ALL_PERSIST</li>
+ <ul>
+ <li>Mechanisms used: free-space managers, aggregators, and virtual file drivers</li>
+ <li>Persist free-space across file opens</li>
+ </ul>
+ <li>H5F_FILE_SPACE_AGGR_VFD</li>
+ <ul>
+ <li>Mechanisms used: aggregators and virtual file drivers</li>
+ <li>Does not persist free-space across file opens</li>
+ </ul>
+ <li>H5F_FILE_SPACE_VFD</li>
+ <ul>
+ <li>Mechanisms used: virtual file drivers</li>
+ <li>Does not persist free-space across file opens</li>
+ </ul>
+ </ul>
+ For release 1.10.1+, the free-space manager mechanism is modified to handle paged aggregation
+ which aggregates small metadata and raw data allocations into constant-sized well-aligned pages
+ to allow efficient I/O accesses.
+ With the support of this feature, the library derives the following four file space strategies:
+ <ul>
+ <li>H5F_FSPACE_STRATEGY_FSM_AGGR </li>
+ <ul>
+ <li>Mechanisms used: free-space managers, aggregators, and virtual file drivers</li>
+ <li>This strategy is the library default</li>
+ </ul>
+ <li>H5F_FSPACE_STRATEGY_PAGE</li>
+ <ul>
+ <li>Mechanisms used: free-space managers with embedded paged aggregation and virtual file drivers</li>
+ </ul>
+ <li>H5F_FSPACE_STRATEGY_AGGR</li>
+ <ul>
+ <li>Mechanisms used: aggregators and virtual file drivers</li>
+ </ul>
+ <li>H5F_FSPACE_STRATEGY_NONE</li>
+ <ul>
+ <li>Mechanisms used: virtual file drivers</li>
+ </ul>
+ </ul>
+ The default is not persisting free-space across file opens for the above four strategies.
+ User can use the public routine <code>H5Pset_file_space_strategy</code> to request
+ persisting free-space.
+ </td></tr>
+ <p>
+ <tr><td colspan="2"><b>Format of Data:</b> See the tables
+ below.</td></tr>
+</table></center>
+<p>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: File Space Info - Version 0
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Strategy</td>
+ <td colspan="2">Threshold<sup>L</sup></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Free-space manager address<sup>O</sup> for H5FD_MEM_SUPER<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Free-space manager address<sup>0</sup> for H5FD_MEM_BTREE<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Free-space manager address<sup>0</sup> for H5FD_MEM_DRAW<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Free-space manager address<sup>0</sup> for H5FD_MEM_GHEAP<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Free-space manager address<sup>0</sup> for H5FD_MEM_LHEAP<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Free-space manager address<sup>0</sup> for H5FD_MEM_OHDR<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: File Space Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>This is version 0 of this message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Strategy</p></td>
+ <td><p>This is the file space strategy used to manage file space.
+ There are four types:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>H5F_FILE_SPACE_ALL_PERSIST</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>H5F_FILE_SPACE_ALL</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>H5F_FILE_SPACE_AGGR_VFD</td>
+ </tr>
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>H5F_FILE_SPACE_VFD</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Threshold</p></td>
+ <td><p>This is the smallest free-space section size that the
+ free-space manager will track.
+ </td>
+ </tr>
+ <tr>
+ <td><p>Free-space manager addresses</p></td>
+ <td><p>These are the six free-space manager addresses for the
+ six file space allocation types:
+ <ul>
+ <li>H5FD_MEM_SUPER</li>
+ <li>H5FD_MEM_BTREE</li>
+ <li>H5FD_MEM_DRAW</li>
+ <li>H5FD_MEM_GHEAP</li>
+ <li>H5FD_MEM_LHEAP</li>
+ <li>H5FD_MEM_OHDR</li>
+ </ul>
+ Note that these six fields exist only if the value for the field
+ &ldquo;<em>Strategy</em>&rdquo; is H5F_FILE_SPACE_ALL_PERSIST.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <br />
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: File Space Info - Version 1
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Strategy</td>
+ <td>Persisting free-space</td>
+ <td colspan="1" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Free-space Section Threshold<sup>L</sup></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">File Space Page Size</td>
+ </tr>
+
+ <tr>
+ <td colspan="2">Page-end Metadata threshold</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />EOA<sup>0</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of small-sized free-space manager for H5FD_MEM_SUPER<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of small-sized free-space manager for H5FD_MEM_BTREE<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of small-sized free-space manager for H5FM_MEM_DRAW<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of small-sized free-space manager for H5FD_MEM_GHEAP<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of small-sized free-space manager for H5FD_MEM_LHEAP<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of small-sized free-space manager for H5FD_MEM_OHDR<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of large-sized free-space manager for H5FD_MEM_SUPER<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of large-sized free-space manager for H5FD_MEM_BTREE<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of large-sized free-space manager for H5FM_MEM_DRAW<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of large-sized free-space manager for H5FD_MEM_GHEAP<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of large-sized free-space manager for H5FD_MEM_LHEAP<br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup> of large-sized free-space manager for H5FD_MEM_OHDR<br /><br /></td>
+ </tr>
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: File Space Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>This is version 1 of this message.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Strategy</p></td>
+ <td><p>This is the file space strategy used to manage file space.
+ There are four types:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>H5F_FSPACE_STRATEGY_FSM_AGGR</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>H5F_FSPACE_STRATEGY_PAGE</td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>H5F_FSPACE_STRATEGY_AGGR</td>
+ </tr>
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>H5F_FSPACE_STRATEGY_NONE</td>
+ </tr>
+ </table></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Persisting free-space</p></td>
+ <td><p>True or false in persisting free-space.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Free-space Section Threshold</p></td>
+ <td><p>This is the smallest free-space section size that the
+ free-space manager will track.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>File space page size</p></td>
+ <td><p>This is the file space page size, which is used when the paged aggregation feature
+ is enabled.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Page-end metadata threshold</p></td>
+ <td><p>This is the smallest free-space section size at the end of a page that
+ the free-space manager will track. This is used when the paged aggregation feature
+ is enabled.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>EOA</p></td>
+ <td><p>The EOA before the allocation of free-space manager header and section info for the
+ self-referential free-space managers when persisting free-space.
+ <br>
+ Note that self-referential free-space managers are managers that involve file space
+ allocation for the managers' free-space header and section info.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Addresses of small-sized free-space managers</p></td>
+ <td><p>These are the addresses of the six small-sized free-space managers for
+ the six file space allocation types:
+ </p>
+ <ul>
+ <li>H5FD_MEM_SUPER</li>
+ <li>H5FD_MEM_BTREE</li>
+ <li>H5FD_MEM_DRAW</li>
+ <li>H5FD_MEM_GHEAP</li>
+ <li>H5FD_MEM_LHEAP</li>
+ <li>H5FD_MEM_OHDR</li>
+ </ul>
+ Note that these six fields exist only if the value for the field
+ &ldquo;<em>Persisting free-space</em>&rdquo; is true.
+</ul>
+</td>
+</tr>
+
+<tr>
+ <td><p>Addresses of large-sized free-space managers</p></td>
+ <td><p>These are the addresses of the six large-sized free-space managers for
+ the six file space allocation types:
+ </p>
+ <ul>
+ <li>H5FD_MEM_SUPER</li>
+ <li>H5FD_MEM_BTREE</li>
+ <li>H5FD_MEM_DRAW</li>
+ <li>H5FD_MEM_GHEAP</li>
+ <li>H5FD_MEM_LHEAP</li>
+ <li>H5FD_MEM_OHDR</li>
+ </ul>
+ Note that these six fields exist only if the value for the field
+ &ldquo;<em>Persisting free-space</em>&rdquo; is true.
+</ul>
+</td>
+</tr>
+
+</table>
+</div>
+
+<h3><a name="DataStorage">
+ IV.B. Disk Format: Level 2B - Data Object Data Storage</a></h3>
+
+<p>The data for an object is stored separately from its header
+ information in the file and may not actually be located in the HDF5 file
+ itself if the header indicates that the data is stored externally. The
+ information for each record in the object is stored according to the
+ dimensionality of the object (indicated in the dataspace header message).
+ Multi-dimensional array data is stored in C order; in other words, the
+ &ldquo;last&rdquo; dimension changes fastest.</p>
+
+<p>Data whose elements are composed of atomic datatypes are stored in IEEE
+ format, unless they are specifically defined as being stored in a different
+ machine format with the architecture-type information from the datatype
+ header message. This means that each architecture will need to [potentially]
+ byte-swap data values into the internal representation for that particular
+ machine.</p>
+
+<p> Data with a variable-length datatype is stored in the global heap
+ of the HDF5 file. Global heap identifiers are stored in the
+ data object storage.</p>
+
+<p>Data whose elements are composed of reference datatypes are stored in
+ several different ways depending on the particular reference type involved.
+ Object pointers are just stored as the offset of the object header being
+ pointed to with the size of the pointer being the same number of bytes as
+ offsets in the file.</p>
+
+<p>Dataset region references are stored as a heap-ID which points to
+ the following information within the file-heap: an offset of the object
+ pointed to, number-type information (same format as header message),
+ dimensionality information (same format as header message), sub-set start
+ and end information (in other words, a coordinate location for each),
+ and field start and end names (in other words, a [pointer to the] string
+ indicating the first field included and a [pointer to the] string name
+ for the last field). </p>
+
+<p>Data of a compound datatype is stored as a contiguous stream of the items
+ in the structure, with each item formatted according to its datatype.
+<p>
+ Description of datatypes for variable-length, references and compound classes can be found
+ in <a href="#DatatypeMessage">Datatype Message</a>.
+<p>
+ Information about global heap and heap ID can be found in <a href="#GlobalHeap">Global Heap</a>.
+<p>
+ For reference datatype,
+ see also the encoding description for <a href="#ReferenceEncodeRV">Reference Encoding (Revised) </a> and
+ <a href="#ReferenceEncodeDP">Reference Encoding (Backward Compatibility)</a> in Appendix D.
+</p>
+
+<h2><a name="AppendixA">
+ V. Appendix A: Definitions</a></h2>
+
+<p>Definitions of various terms used in this document are included in
+ this section.</p>
+
+<div align="center">
+ <table class="glossary">
+ <tr>
+ <th width="20%">Term</th>
+ <th>Definition</th>
+ </tr>
+
+ <tr>
+ <td>Undefined Address</td>
+ <td>The <a name="UndefinedAddress">undefined
+ address</a> for a file is a file address with all bits
+ set: in other words, <code>0xffff...ff</code>.</td>
+ </tr>
+
+ <tr>
+ <td>Unlimited Size</td>
+ <td>The <a name="UnlimitedDim">unlimited size</a>
+ for a size is a value with all bits set: in other words,
+ <code>0xffff...ff</code>.</td>
+ </tr>
+
+ </table>
+</div>
+
+
+<h2><a name="AppendixB">
+ VI. Appendix B: File Space Allocation Types</a></h2>
+
+<p>There are six basic types of file space allocation as follows:
+</p>
+<div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Basic Allocation Type</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_SUPER</td>
+ <td>File space allocated for <em>Superblock.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_BTREE</td>
+ <td>File space allocated for <em>B-tree.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_DRAW</td>
+ <td>File space allocated for <em>raw data</em>.</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_GHEAP</td>
+ <td>File space allocated for <em>Global Heap.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_LHEAP</td>
+ <td>File space allocated for <em>Local Heap.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_OHDR</td>
+ <td>File space allocated for <em>Object Header.</em></td>
+ </tr>
+ </table>
+</div>
+
+<br />
+<p>There are other file space allocation types that are mapped to the
+ above six basic types because they are similar in nature.
+ The mapping and the corresponding description are listed in the following two tables:
+</p>
+
+<div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Basic Allocation Type</th>
+ <th>Mapping of Allocation Types to Basic Allocation Types</th>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_SUPER</td>
+ <td><em>none</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_BTREE</td>
+ <td>H5FD_MEM_SOHM_INDEX</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_DRAW</td>
+ <td>H5FD_MEM_FHEAP_HUGE_OBJ</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_GHEAP</td>
+ <td><em>none</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_LHEAP</td>
+ <td>H5FD_MEM_FHEAP_DBLOCK, H5FD_MEM_FSPACE_SINFO</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_OHDR</td>
+ <td>H5FD_MEM_FHEAP_HDR, H5FD_MEM_FHEAP_IBLOCK, H5FD_MEM_FSPACE_HDR, H5FD_MEM_SOHM_TABLE</td>
+ </tr>
+ </table>
+</div>
+
+<br />
+</p>
+
+<div align="center">
+ <table class="desc">
+ <tr>
+ <th width="30%">Allocation Type</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_HDR</td>
+ <td>File space allocated for <em>Fractal Heap Header.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_DBLOCK</td>
+ <td>File space allocated for <em>Fractal Heap Direct Blocks.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_IBLOCK</td>
+ <td>File space allocated for <em>Fractal Heap Indirect Blocks.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FHEAP_HUGE_OBJ</td>
+ <td>File space allocated for huge objects in the fractal heap.</td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FSPACE_HDR</td>
+ <td>File space allocated for <em>Free-space Manager Header.</em></td>
+ </tr>
+
+ <tr>
+ <td>H5FD_MEM_FSPACE_SINFO</td>
+ <td>File space allocated for <em>Free-space Section List</em> of the free-space manager.</td>
+ </tr>
+ <tr>
+ <td>H5FD_MEM_SOHM_TABLE</td>
+ <td>File space allocated for <em>Shared Object Header Message Table.</em></td>
+ </tr>
+ <tr>
+ <td>H5FD_MEM_SOHM_INDEX</td>
+ <td>File space allocated for <em>Shared Message Record List.</em></td>
+ </tr>
+ </table>
+</div>
+
+<h2><a name="AppendixC"> VII. Appendix C:
+ Types of Indexes for Dataset Chunks</a></h2>
+
+<p>For an HDF5 file without the latest format enabled, the library
+ uses the <a href="#V1Btrees">Version 1 B-tree</a> to index dataset
+ chunks.</p>
+
+<p>For an HDF5 file with the latest format enabled, the library uses
+ one of the following five indexing types depending on a chunked
+ dataset&rsquo;s dimension specification and the way it is extended.
+</p>
+
+<a name="SingleChunk">
+ <h3>VII.A. The Single Chunk Index</h3></a>
+
+<p>The <i>Single Chunk</i> index can be used when the dataset fulfills
+ the following condition:</p>
+
+<ul>
+ <li>the current, maximum, and chunk dimension sizes are all the same</li>
+</ul>
+
+<p>The dataset has only one chunk, and the address of the single
+ chunk is stored in the version 4 <i>Data Layout</i> message.
+ See the <a href="#ChunkedStorage">Chunked Storage Property
+ Description</i></a> layout and field description tables.</p>
+
+<a name="Implicit">
+ <h3>VII.B. The Implicit Index</h3></a>
+
+<p>The <i>Implicit</i> index can be used when the dataset fulfills
+ the following conditions:</p>
+
+<ul>
+ <li>fixed maximum dimension sizes</li>
+ <li>no filter applied to the dataset</li>
+ <li>the timing for the space allocation of the dataset chunks is
+ <code>H5P_ALLOC_TIME_EARLY</code></li>
+</ul>
+
+<p>Since the dataset&rsquo;s dimension sizes are known and storage space
+ is to be allocated early, an array of dataset chunks are allocated
+ based on the maximum dimension sizes when the dataset is created.
+ The base address of the array is stored in the version 4
+ <i>Data Layout</i> message. See the
+ <a href="#ChunkedStorage">Chunked Storage Property
+ Description</i></a> layout and field description tables.
+</p>
+
+<p>When accessing a dataset chunk with a specified offset, the
+ address of the chunk in the array is computed as below:</p>
+
+<dir><p><code>base address + (size of a chunk in bytes * chunk index
+ associated with the offset)</code></p></dir>
+
+<p>A chunk index starts at 0 and increases according to the
+ fastest changing dimension, then the next fastest, and so on.
+ <a name="ChunkIndex"></a>
+ The chunk index for a dataset chunk offset is computed as below:
+ <ol>
+ <li>Calculate the scaled offset for each dimension in
+ <code>scaled_offset</code>:
+ <br />
+ <pre>
+ scaled_offset = chunk_offset/chunk_dims
+ </pre></li>
+ <li>Calculate the # of chunks for each dimension in
+ <code>nchunks</code>:
+ <br />
+ <pre>
+ nchunks = (curr_dims + chunk_dims - 1)/chunk_dims
+ </pre></li>
+
+ <li>Calculate the down chunks for each dimension in
+ <code>down_chunks</code>:
+ <br />
+ <pre>
+ /* n is the # of dimensions */
+ for(i = (int)(n-1), acc = 1; i >= 0; i--) {
+ down_chunks[i] = acc;
+ acc *= nchunks[i];
+ }
+ </pre>
+ </li>
+
+ <li>Calculate the chunk index in <code>chunk_index</code>:
+ <br />
+ <pre>
+ /* n is the # of dimensions */
+ for(u = 0, chunk_index = 0; u < n; u++)
+ chunk_index += down_chunks[u] * scaled_offset[u];
+ </pre>
+ </li>
+ </ol>
+<p>
+ For example, for a 2-dimensional dataset with
+ <code>curr_dims[4,5]</code> and <code>chunk_dims[3,2]</code>,
+ there will be a total of 6 chunks, with 3 chunks in the fastest
+ changing dimension and 2 chunks in the slowest changing dimension.
+ See the figure below.
+ The chunk index for the chunk offset <code>[3,4]</code>
+ is computed as below:
+ <ol>
+ <code>
+ <li>scaled_offset[0] = 1, scaled_offset[1] = 2</li>
+ <li>nchunks[0] = 2, nchunks[1] = 3</li>
+ <li>down_chunks[0] = 3, down_chunks[1] = 1</li>
+ <li>chunk_index = 5</li>
+ </code>
+ </ol>
+
+
+ <table align="center" width="400" border="0">
+ <tr valign="center" align="center">
+ <td>
+ <hr size="2"/>
+ <img height="250" src="FileFormatSpecChunkDiagram.jpg"
+ alt="Chunk Diagram"></td>
+ </tr>
+ <tr valign="top" align="center">
+ <td>
+ <hr size="1" />
+ <b>Figure 3. Implicit index chunk diagram </b>
+ <hr size="2"/></td>
+ </tr>
+ </table>
+
+
+
+
+
+ <a name="FixedArray">
+ <h3>VII.C. The Fixed Array Index</h3></a>
+
+<p>The <i>Fixed Array</i> index can be used when the dataset fulfills
+ the following condition:</p>
+<ul>
+ <li>fixed maximum dimension sizes</li>
+</ul>
+
+<p>Since the maximum number of chunks is known, an array of
+ in-file-on-disk addresses based on the maximum number of chunks is
+ allocated when data is written to the dataset. To access a dataset
+ chunk with a specified offset, the
+ <a href="#ChunkIndex">chunk index</i></a> associated with the offset
+is calculated. The index is mapped into the array to locate the
+disk address for the chunk.</p>
+
+<p>The Fixed Array (FA) index structure provides space and speed
+ improvements in locating chunks over index structures that handle
+ more dynamic data accesses like a
+ <a href="#AppendV2Btrees">Version 2 B-tree</a> index.
+ The entry into the Fixed Array is the Fixed Array header which
+ contains metadata about the entries stored in the array. The
+ header contains a pointer to a data block which stores the array
+ of entries that describe the dataset chunks. For greater efficiency,
+ the array will be divided into multiple pages if the number of
+ entries exceeds a threshold value. The space for the data block
+ and possibly data block pages are allocated as a single contiguous
+ block of space.</p>
+
+<p>The content of the data block depends on whether paging is
+ activated or not. When paging is not used, elements that describe
+ the chunks are stored in the data block. If paging is turned on,
+ the data block contains a bitmap indicating which pages are
+ initialized. Then subsequent data block pages will contain the
+ entries that describe the chunks.</p>
+
+<p>An entry describes either a filtered or non-filtered dataset
+ chunk. The formats for both element types are described below.
+</p>
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fixed Array Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td>Entry Size</td>
+ <td>Page Bits</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Max Num
+ Entries<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Block
+ Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fixed Array Header
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FAHD</code>&rdquo;
+ is used to indicate the beginning of a Fixed Array header.
+ This gives file consistency checking utilities a better
+ chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>The ID for identifying the client of the
+ Fixed Array:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Non-filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Entry Size</p></td>
+ <td>
+ <p>The size in bytes of an entry in the Fixed Array.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Page Bits</p></td>
+ <td>
+ <p>The number of bits needed to store the maximum
+ number of entries in a
+ <a href="#FADataBlockPage">data block page.</a></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Max Num Entries</p></td>
+ <td>
+ <p>The maximum number of entries in the Fixed
+ Array.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Block Address</p></td>
+ <td>
+ <p>The address of the data block in the Fixed Array.
+ </p>
+ </td>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for the header.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Fixed Array Data Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Page Bitmap <em>(variable size and
+ optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Elements <em>(variable size and
+ optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fixed Array Data Block
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>FADB</code>&rdquo;
+ is used to indicate the beginning of a Fixed Array data
+ block. This gives file consistency checking utilities a
+ better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>The ID for identifying the client of the
+ Fixed Array:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Non-filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Address</p></td>
+ <td>
+ <p>The address of the Fixed Array header. Principally used
+ for file integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Page Bitmap</p></td>
+ <td><p>A bitmap indicating which data block pages are initialized.</p>
+ <p>Exists only if the data block is paged.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Elements</p></td>
+ <td>
+ <p>Contains the elements stored in the data block
+ and exists only if the data block is not paged.
+ There are two element types:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td><a href="#FaNonFilterChunk">Non-filtered
+ dataset chunks</i></a>
+</td>
+</tr>
+<tr>
+ <td align="center"><code>1</code></td>
+ <td><a href="#FaFilterChunk">Filtered dataset
+ chunks</i></a>
+</td>
+</tr>
+</table>
+</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for the Fixed Array data block.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption><a name="FADataBlockPage">
+ Layout: Fixed Array Data Block Page</a>
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Elements <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Fixed Array Data Block Page
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Elements</p></td>
+ <td>
+ <p>Contains the elements stored in the data block page.
+ There are two element types:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td><a href="#FaNonFilterChunk">Non-filtered dataset chunks</i></a>
+</td>
+</tr>
+<tr>
+ <td align="center"><code>1</code></td>
+ <td><a href="#FaFilterChunk">Filtered dataset chunks</i></a>
+</td>
+</tr>
+</table>
+</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for a Fixed Array data block page.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+<a name="FaNonFilterChunk"></a>
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Data Block Element for Non-filtered Dataset Chunk
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Data Block Element for Non-filtered Dataset Chunk
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the dataset chunk in the file.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+<!-- </p> -->
+
+<br />
+<br />
+<br />
+<a name="FaFilterChunk"></a>
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Data Block Element for Filtered Dataset Chunk
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Chunk Size <em>(variable size; at most
+ 8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Data Block Element for Filtered Dataset Chunk
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the dataset chunk in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Chunk Size</p></td>
+ <td><p>The size of the dataset chunk in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td><p>Indicates the filter to skip for the dataset chunk. Each
+ filter has an index number in the pipeline; if that filter is
+ skipped, the bit corresponding to its index is set.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<a name="ExtensibleArray">
+ <h3>VII.D. The Extensible Array Index</h3></a>
+
+<p>The <i>Extensible Array</i> index can be used when the dataset
+ fulfills the following condition:</p>
+
+<ul>
+ <li>only one dimension of unlimited extent</li>
+</ul>
+
+<p>The Extensible Array (EA) is a data structure that is used as a
+ chunk index in datasets where the dataspace has a single
+ unlimited dimension. In other words, one dimension is set to
+ <code>H5S_UNLIMITED</code>, and the other dimensions are any number
+ of fixed-size dimensions. The idea behind the extensible array is
+ that a particular data object can be located via a lightweight
+ indexing structure of fixed depth for a given address space. This
+ indexing structure requires only a few (2-3) file operations per
+ element lookup and gives good cache performance. Unlike the B-tree
+ structure, the extensible array is optimized for appends. Where a
+ B-tree would always add at the rightmost node under these
+ circumstances, either creating a deep tree (version 1) or requiring
+ expensive rebalances to correct (version 2), the extensible array
+ has already mapped out a pre-balanced internal structure. This
+ optimized internal structure is instantiated as needed when chunk
+ records are inserted into the structure.</p>
+
+
+
+<!--
+
+ <p>A description of the rationale that leads to the present
+ implementation of the extensible array can be found at
+ <a href="https://svn.hdfgroup.org/hdf5doc/trunk/projects/1_10_alpha/ReviseChunks/skip_lists">
+ https://svn.hdfgroup.org/hdf5doc/trunk/projects/1_10_alpha/ReviseChunks/skip_lists</a>.
+ </p>
+
+<p>The current implementation differs from the data structure
+ described in that reference in some ways, but the basic idea is the
+ same.</p>
+
+-->
+
+
+
+<p>An Extensible Array consists of a header, an index block,
+ secondary blocks, data blocks, and (optional) data block pages. The
+ general scheme is that the index block is used to reference a
+ secondary block, which is, in turn, used to reference the data block
+ page where the chunk information is stored. The data blocks will
+ be paged for efficiency when their size passes a threshold value.
+ These pages are laid out contiguously on the disk after the data
+ block, are initialized as needed, and are tracked via bitmaps
+ stored in the secondary block. The number of secondary and data
+ blocks/pages in a chunk index varies as they are allocated as
+ needed and the first few are (conceptually) stored in parent
+ elements as an optimization.</p>
+
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Extensible Array Header
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td>Element Size</td>
+ <td>Max Nelmts Bits</td>
+ </tr>
+
+ <tr>
+ <td>Index Blk Elmts</td>
+ <td>Data Blk Min Elmts</td>
+ <td>Secondary Blk Min Data Ptrs</td>
+ <td>Max Data Blk Page Nelmts Bits</td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Num Secondary Blks<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Secondary Blk Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Num Data Blks<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Data Blk Size<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Max Index Set<sup>L</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Num Elements<sup>L</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Index Block Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;L&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfLengthsV0">Size
+ of Lengths</a> field in the superblock.)
+ </td></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Extensible Array Header
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>EAHD</code>&rdquo;
+ is used to indicate the beginning of an Extensible Array
+ header. This gives file consistency checking utilities a
+ better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>The ID for identifying the client of the
+ Fixed Array:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Non-filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Element Size</p></td>
+ <td>
+ <p>The size in bytes of an element in the Extensible Array.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Max Nelmts Bits</p></td>
+ <td>
+ <p>The number of bits needed to store the
+ maximum number of elements in the Extensible Array.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Index Blk Elmts</p></td>
+ <td>
+ <p>The number of elements to store in the index block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Blk Min Elmts</p></td>
+ <td>
+ <p>The minimum number of elements per data block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Secondary Blk Min Data Ptrs</p></td>
+ <td>
+ <p>The minimum number of data block pointers for a
+ secondary block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Max Dblk Page Nelmts Bits</p></td>
+ <td>
+ <p>The number of bits needed to store the maximum number
+ of elements in a data block page.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Num Secondary Blks</p></td>
+ <td>
+ <p>The number of secondary blocks created.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Secondary Blk Size</p></td>
+ <td>
+ <p>The size of the secondary blocks created.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Num Data Blks</p></td>
+ <td>
+ <p>The number of data blocks created.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Blk Size</p></td>
+ <td>
+ <p>The size of the data blocks created.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Max Index Set</p></td>
+ <td>
+ <p>The maximum index set.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Num Elmts</p></td>
+ <td>
+ <p>The number of elements realized.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Index Block Address</p></td>
+ <td>
+ <p>The address of the index block.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for the header.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Extensible Array Index Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Elements <em>(variable size and
+ optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Block Addresses <em>(variable
+ size and optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Secondary Block Addresses <em>(variable
+ size and optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Extensible Array Index Block
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>EAIB</code>&rdquo;
+ is used to indicate the beginning of an Extensible Array
+ Index Block. This gives file consistency checking utilities
+ a better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>The client ID for identifying the user of the
+ Extensible Array:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Non-filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Address</p></td>
+ <td>
+ <p>The address of the Extensible Array header. Principally
+ used for file integrity checking.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Elements</p></td>
+ <td>
+ <p>Contains the elements that are stored directly in
+ the index block. An optimization to avoid unnecessary
+ secondary blocks.
+ <br />
+ <br />
+ There are two element types:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td><a href="#EaNonFilterChunk">Non-filtered dataset chunks</i></a>
+</td>
+</tr>
+<tr>
+ <td align="center"><code>1</code></td>
+ <td><a href="#EaFilterChunk">Filtered dataset chunks</i></a>
+</td>
+</tr>
+</table>
+</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Data Block Addresses</p></td>
+ <td>
+ <p>Contains the addresses of the data blocks
+ that are stored directly in the Index Block. An
+ optimization to avoid unnecessary secondary blocks.</p>
+ </td>
+</tr>
+
+<tr>
+ <td><p>Secondary Block Addresses</p></td>
+ <td>
+ <p>Contains the addresses of the secondary
+ blocks.</p>
+ </td>
+</tr>
+
+<tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for the Extensible Array Index Block.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Extensible Array Secondary Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Block Offset <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Page Bitmap <em>(variable size and
+ optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Data Block Addresses <em>(variable
+ size and optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Extensible Array Secondary Block
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>EASB</code>&rdquo;
+ is used to indicate the beginning of an Extensible Array
+ Secondary Block. This gives file consistency checking utilities
+ a better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>The ID for identifying the client of the
+ Extensible Array:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Non-filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Address</p></td>
+ <td>
+ <p>The address of the Extensible Array header. Principally
+ used for file integrity checking.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Offset</p></td>
+ <td>
+ <p>Stores the offset of the block in the array.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Page Bitmap</p></td>
+ <td>
+ <p>A bitmap indicating which
+ data block pages are initialized.
+ <p>
+ Exists only if the data block is paged.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Data Block Addresses</p></td>
+ <td>
+ <p>Contains the addresses of the data blocks
+ referenced by this secondary block.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for the Extensible Array
+ Secondary Block.</p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Extensible Array Data Block
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Signature</td>
+ </tr>
+
+ <tr>
+ <td>Version</td>
+ <td>Client ID</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Header Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Block Offset <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Elements <em>(variable size and
+ optional)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Extensible Array Data Block
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Signature</p></td>
+ <td>
+ <p>The ASCII character string &ldquo;<code>EADB</code>&rdquo;
+ is used to indicate the beginning of an Extensible Array
+ data block. This gives file consistency checking utilities
+ a better chance of reconstructing a damaged file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td>
+ <p>This document describes version 0.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Client ID</p></td>
+ <td>
+ <p>The ID for identifying the client of the
+ Extensible Array:
+
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Non-filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Filtered dataset chunks
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>2+</code></td>
+ <td>Reserved.
+ </td>
+ </tr>
+ </table>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Header Address</p></td>
+ <td>
+ <p>The address of the Extensible Array header. Principally
+ used for file integrity checking.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Block Offset</p></td>
+ <td>
+ <p>The offset of the block in the array.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Elements</p></td>
+ <td>
+ <p>Contains the elements stored in the data block and
+ exists only if the data block is not paged.
+ <br />
+ <br />
+ There are two element types:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td><a href="#EaNonFilterChunk">Non-filtered dataset chunks</i></a>
+</td>
+</tr>
+<tr>
+ <td align="center"><code>1</code></td>
+ <td><a href="#EaFilterChunk">Filtered dataset chunks</i></a>
+</td>
+</tr>
+</table>
+</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for the Extensible Array data block.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Extensible Array Data Block Page
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Elements <em>(variable
+ size)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Checksum</td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Extensible Array Data Block Page
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Elements</p></td>
+ <td>
+ <p>Contains the elements stored in the data block
+ page.</p>
+ <p>
+ There are two element types:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">ID</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td><a href="#EaNonFilterChunk">Non-filtered dataset chunks</i></a>
+</td>
+</tr>
+<tr>
+ <td align="center"><code>1</code></td>
+ <td><a href="#EaFilterChunk">Filtered dataset chunks</i></a>
+</td>
+</tr>
+</table>
+</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Checksum</p></td>
+ <td>
+ <p>The checksum for an Extensible Array data block
+ page.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+<a name="EaNonFilterChunk"></a>
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Data Block Element for Non-filtered Dataset Chunk
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr><td>
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Data Block Element for Non-filtered Dataset Chunk
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the dataset chunk in the file.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+</p>
+
+<br />
+<br />
+<br />
+<a name="EaFilterChunk"></a>
+<div align="center">
+ <table class="format">
+ <caption>
+ Layout: Data Block Element for Filtered Dataset Chunk
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Chunk Size<em> (variable size; at
+ most 8 bytes)</em><br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Filter Mask</td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+</div>
+
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Data Block Element for Filtered Dataset Chunk
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Address</p></td>
+ <td><p>The address of the dataset chunk in the file.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Chunk Size</p></td>
+ <td><p>The size of the dataset chunk in bytes.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Filter Mask</p></td>
+ <td><p>Indicates the filter to skip for the dataset chunk.
+ Each filter has an index number in the pipeline; if that
+ filter is skipped, the bit corresponding to its index is set.
+ </p>
+ </td>
+ </tr>
+
+ </table>
+</div>
+
+<a name="AppendV2Btrees">
+ <h3>VII.E. The Version 2 B-trees Index</h3></a>
+
+<p>The <i>Version 2 B-trees</i> index can be used when the dataset
+ fulfills the following condition:</p>
+
+<ul>
+ <li>more than one dimension of unlimited extent</li>
+</ul>
+
+<p>Version 2 B-trees can be used to index various objects in the
+ library. See <a href="#V2Btrees">&ldquo;Version 2 B-trees&rdquo;</a>
+ for more information. The B-tree types <a href="#V2BtType10">10</a>
+ and <a href="#V2BtreesType11">11</a> record layouts are for
+ indexing dataset chunks.</p>
+
+<h2><a name="AppendixD"> VIII. Appendix D:
+ Encoding for dataspace and reference</a></h2>
+
+<a name="DataspaceEncode">
+ <h3>VIII.A. Dataspace Encoding </h3></a>
+<i>H5Sencode</i> is a public routine that encodes a dataspace description into a buffer while
+<i>H5Sdecode</i> is the corresponding routine that decodes the description encoded in the buffer.
+<p>
+ See the reference manual description for these two public routines.
+
+ <br />
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Dataspace Description for H5Sencode/H5Sdecode
+ </caption>
+
+ <tr>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ <th>byte</th>
+ </tr>
+
+ <tr>
+ <td>Dataspace ID</td>
+ <td>Encode Version</td>
+ <td>Size of Size</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Size of Extent
+ <br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Dataspace Message
+ <em>(variable size)</em>
+ <br /><br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br /><br />Dataspace Selection
+ <em>(variable size)</em>
+ <br /><br /></td>
+ </tr>
+
+ </table>
+
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Dataspace Description for H5Sencode/H5Sdecode
+ </caption>
+ <tr>
+ <th width="40%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace ID</p></td>
+ <td>
+ <p>The datspace message ID which is 1.</p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Encode Version</p></td>
+ <td>
+ <p>H5S_ENCODE_VERSION which is 0.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Size</p></td>
+ <td>
+ <p>The number of bytes used to store the size of an object.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Size of Extent</p></td>
+ <td>
+ <p>Size of the dataspace message.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Message</p></td>
+ <td>
+ <p>The dataspace message information. See
+ <a href="#DataspaceMessage">Dataspace Message.</a></p>
+</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Dataspace Selection</p></td>
+ <td>
+ <p>The dataspace selection information. See
+ <a href="#DataspaceSEL">Dataspace Selection.</a></p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+
+<br />
+<br />
+<br />
+<a name="DataspaceSEL"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Dataspace Selection
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Selection Type</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Selection Info (<em>variable
+ size</em>)<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Dataspace Selection
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Selection Type</p></td>
+ <td>
+ <p>There are 4 types of selection:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>H5S_SEL_NONE: Nothing selected
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>H5S_SEL_POINTS: Sequence of points selected
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>H5S_SEL_HYPER: Hyperslab selected
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>H5S_SEL_ALL: Entire extent selected
+ </td>
+ </tr>
+ </table>
+ </td>
+
+ </tr>
+
+ <tr>
+ <td><p>Selection Info</p></td>
+ <td>
+ <p>There are 4 types of selection info:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>Selection info for <a href="#SelNONE">H5S_SEL_NONE</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>Selection info for <a href="#SelPOINTS">H5S_SEL_POINTS</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>Selection info for <a href="#SelHYPER">H5S_SEL_HYPER</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>Selection for <a href="#SelALL">H5S_SEL_ALL</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <br />
+<a name="SelNONE"/></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Selection Info for H5S_SEL_NONE
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Version</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Reserved <em>(zero, 8 bytes)</em><br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Selection Info for H5S_SEL_NONE
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for the H5S_SEL_NONE Selection Info.
+ The value is 1.</p></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <br />
+ <a name="SelPOINTS"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Selection Info for H5S_SEL_POINTS
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Version</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br /><br />Points Selection Info <em>(variable size)</em>
+ <br /><br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Selection Info for H5S_SEL_POINTS
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for the H5S_SEL_POINTS Selection Info.
+ The value is either 1 or 2.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Points Selection Info</p></td>
+ <td><p>Depending on <em>version</em>:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>See <a href="#SelPOINTSV1">Version 1 Points Selection Info</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>See <a href="#SelPOINTSV2">Version 2 Points Selection Info</a>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <a name="SelPOINTSV1"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 1 Points Selection Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved <em>(zero)</em></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Length</td>
+ </tr>
+ <tr>
+ <td colspan="4">Rank</td>
+ </tr>
+ <tr>
+ <td colspan="4">Num Points</td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #1: coordinate #1</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #1: coordinate #u</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #n: coordinate #1</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #n: coordinate #u</td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 1 Points Selection Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>The size in bytes from <em>Length</em> to the end of the
+ selection info.</td>
+ </tr>
+
+ <tr>
+ <td><p>Rank</p></td>
+ <td><p>The number of dimensions.</p></td>
+ </tr>
+ <tr>
+ <td><p>Num Points</p></td>
+ <td><p>The number of points in the selection.</p></td>
+ </tr>
+ <tr>
+ <td><p>Point #n: coordinate #u</p></td>
+ <td><p>The array of points in the selection.
+ <p>The points selected are #1 to #n where n is <em>Num Points</em>.
+ <p>The list of coordinates for each point are #1 to #u where u is
+ <em>Rank</em>.</p></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <br />
+ <a name="SelPOINTSV2"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 Points Selection Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="1">Encode Size</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted only to align table nicely</em>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Rank</td>
+ </tr>
+ <tr>
+ <td colspan="4">Num Points<p>(2, 4 or 8 bytes)<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #1: coordinate #1<p>(2, 4 or 8 bytes)<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #1: coordinate #u<p>(2, 4 or 8 bytes)<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #n: coordinate #1 <p>(2, 4 or 8 bytes)<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Point #n: coordinate #u<p>(2, 4 or 8 bytes)<br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 Points Selection Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Encode Size</td>
+ <td><p>The size for encoding the points selection info which can be 2, 4 or 8 bytes.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Rank</p></td>
+ <td><p>The number of dimensions.</p></td>
+ </tr>
+ <tr>
+ <td><p>Num Points</p></td>
+ <td><p>The number of points in the selection.
+ <p>The field <em>Encode Size</em> indicates the size of this field</p></td>
+ </tr>
+ <tr>
+ <td><p>Point #n: coordinate #u</p></td>
+ <td><p>The array of points in the selection.
+ <p>The points selected are #1 to #n where n is <em>Num Points</em>.
+ <p>The list of coordinates for each point are #1 to #u where u is
+ <em>Rank</em>.
+ <p>The field <em>Encode Size</em> indicates the size of this field</p></td>
+ </tr>
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <br />
+ <a name="SelHYPER"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Selection Info for H5S_SEL_HYPER
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Version</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Hyperslab Selection Info
+ (<em>variable size</em>)<br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Selection Info for H5S_SEL_HYPER
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for the H5S_SEL_HYPER selection info.
+ The value is 1, 2 or 3.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Hyperslab Selection Info</p></td>
+ <td><p>Depending on <em>version</em>:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Version</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>1</code></td>
+ <td>See <a href="#SelHYPERV1">Version 1 Hyperslab Selection Info</a>.
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>See <a href="#SelHYPERV2">Version 2 Hyperslab Selection Info</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>See <a href="#SelHYPERV3">Version 3 Hyperslab Selection Info</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <a name="SelHYPERV1"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 1 Hyperslab Selection Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Reserved</td>
+ </tr>
+ <tr>
+ <td colspan="4">Length</td>
+ </tr>
+ <tr>
+ <td colspan="4">Rank</td>
+ </tr>
+ <tr>
+ <td colspan="4">Num Blocks</td>
+ </tr>
+ <tr>
+ <td colspan="4">Starting Offset #1 for Block #1</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Starting Offset #n for Block #1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Ending Offset #1 for Block #1</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Ending Offset #n for Block #1</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Starting Offset #1 for Block #u</td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Starting Offset #n for Block #u</td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Ending Offset #1 for Block #u</em></td>
+</tr>
+<tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+</tr>
+<tr>
+ <td colspan="4">Ending Offset #n for Block #u</td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 1 Hyperslab Selection Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>The size in bytes from the field <em>Rank</em> to the
+ end of the Selection Info.</td>
+ </tr>
+
+ <tr>
+ <td><p>Rank</p></td>
+ <td><p>The number of dimensions in the dataspace.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Num Blocks</p></td>
+ <td><p>The number of blocks in the selection.</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Starting Offset #n for Block #u</p></td>
+ <td><p>The offset #n of the starting element in block #u.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>#u is from 1 to <em>Num Blocks</em> moving from the fastest
+ changing dimension to the slowest changing dimension.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Ending Offset #n for Block #u</p></td>
+ <td><p>The offset #n of the ending element in block #u.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>#u is from 1 to <em>Num Blocks</em> moving from the fastest
+ changing dimension to the slowest changing dimension.
+ </p></td>
+ </tr>
+
+ </table>
+</div>
+
+<br />
+<br />
+<br />
+<a name="SelHYPERV2"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 2 Hyperslab Selection Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Length</td>
+ </tr>
+ <tr>
+ <td colspan="4">Rank</td>
+ </tr>
+ <tr>
+ <td colspan="4">Start #1 <em>(8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Stride #1 <em>(8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Count #1 <em>(8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Block #1 <em>(8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Start #n <em>(8 bytes)</em><p></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Stride #n <em>(8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Count #n <em>(8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Block #n <em>(8 bytes)</em><p></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 2 Hyperslab Selection Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This is a bit field with the following definition.
+ Currently, this is always set to 0x1.
+ <p>
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, it a a regular hyperslab, otherwise, irregular.
+ </td>
+ </tr>
+
+ </table>
+ </td>
+
+ </tr>
+
+ <tr>
+ <td><p>Length</p></td>
+ <td><p>The size in bytes from the field <em>Rank</em> to the
+ end of the Selection Info.</td>
+ </tr>
+
+ <tr>
+ <td><p>Rank</p></td>
+ <td><p>The number of dimensions in the dataspace.</td>
+ </tr>
+
+ <tr>
+ <td><p>Start #n</p></td>
+ <td><p>The offset of the starting element in the block.
+ <p>#n is from 1 to <em>Rank</em>.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Stride #n</p></td>
+ <td><p>The number of elements to move in each dimension.
+ <p>#n is from 1 to <em>Rank</em>.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Count #n</p></td>
+ <td><p>The number of blocks to select in each dimension.
+ <p>#n is from 1 to <em>Rank</em>.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Block #n</p></td>
+ <td><p>The size (in elements) of each block in each dimension.
+ <p>#n is from 1 to <em>Rank</em>.
+ </p></td>
+ </tr>
+ </table>
+ </div>
+
+
+
+
+ <br />
+ <br />
+ <br />
+ <a name="SelHYPERV3"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 3 Hyperslab Selection Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Flags</td>
+ <td>Encode Size</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan="4">Rank</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Regular/Irregular Hyperslab Selection Info
+ <p><em>(variable size)</em><br /><br/></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 3 Hyperslab Selection Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This is a bit field with the following definition:
+ <p>
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, it is a regular hyperslab, otherwise, irregular.
+ </td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Encode Size</p></td>
+ <td><p>The size for encoding hyperslab selection info, which can 2, 4 or 8 bytes.</td>
+ </tr>
+
+ <tr>
+ <td><p>Rank</p></td>
+ <td><p>The number of dimensions in the dataspace.</td>
+ </tr>
+
+ <tr>
+ <td><p>Regular/Irregular Hyperslab Selection Info</p></td>
+ <td><p>This is the selection info for version 3 hyperslab which can be regular or irregular.
+ <p>If bit 0 of the field <em>Flags</em> is set,
+ See <a href="#SelHYPERV3REG">Version 3 Regular Hyperslab Selection Info</a>
+ <p>Otherwise, see <a href="#SelHYPERV3IRREG">Version 3 Irregular Hyperslab Selection Info</a>
+ </td>
+
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <br />
+ <a name="SelHYPERV3REG"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 3 Regular Hyperslab Selection Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Start #1 <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Stride #1 <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Count #1 <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Block #1 <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Start #n <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Stride #n <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Count #n <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Block #n <p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 3 Regular Hyperslab Selection Info
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Start #n</p></td>
+ <td><p>The offset of the starting element in the block.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>The field <em>Encode Size</em> indicates the size of this field.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Stride #n</p></td>
+ <td><p>The number of elements to move in each dimension.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>The field <em>Encode Size</em> indicates the size of this field.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Count #n</p></td>
+ <td><p>The number of blocks to select in each dimension.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>The field <em>Encode Size</em> indicates the size of this field.
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Block #n</p></td>
+ <td><p>The size (in elements) of each block in each dimension.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>The field <em>Encode Size</em> indicates the size of this field.
+ </p></td>
+ </tr>
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+ <a name="SelHYPERV3IRREG"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Version 3 Irregular Hyperslab Selection Info
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Num Blocks<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">Starting Offset #1 for Block #1<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Starting Offset #n for Block #1<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Ending Offset #1 for Block #1<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Ending Offset #n for Block #1<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Starting Offset #1 for Block #u<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Starting Offset #n for Block #u<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+
+ <tr>
+ <td colspan="4">Ending Offset #1 for Block #u<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+ <tr>
+ <td colspan="4">.<br />.<br />.<br /></td>
+ </tr>
+ <tr>
+ <td colspan="4">Ending Offset #n for Block #u<p><em>(2, 4 or 8 bytes)</em><p></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Version 3 Irregular Hyperslab Selection Info
+ </caption>
+
+ <tr>
+ <td><p>Num Blocks</p></td>
+ <td><p>The number of blocks in the selection.
+ <p>The field <em>Encode Size</em> indicates the size of this field</p></td>
+ </tr>
+
+ <tr>
+ <td><p>Starting Offset #n for Block #u</p></td>
+ <td><p>The offset #n of the starting element in block #u.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>#u is from 1 to <em>Num Blocks</em> moving from the fastest
+ changing dimension to the slowest changing dimension.
+ <p>The field <em>Encode Size</em> indicates the size of this field
+ </p></td>
+ </tr>
+
+ <tr>
+ <td><p>Ending Offset #n for Block #u</p></td>
+ <td><p>The offset #n of the ending element in block #u.
+ <p>#n is from 1 to <em>Rank</em>.
+ <p>#u is from 1 to <em>Num Blocks</em> moving from the fastest
+ changing dimension to the slowest changing dimension.
+ <p>The field <em>Encode Size</em> indicates the size of this field
+ </p></td>
+ </tr>
+
+ </table>
+ </div>
+
+
+ <br />
+ <br />
+ <br />
+ <a name="SelALL"></a>
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Selection Info for H5S_SEL_ALL
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">Version</td>
+ </tr>
+ <tr>
+ <td colspan="4"><br />Reserved <em>(zero,
+ 8 bytes)</em><br /><br /></td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Selection Info for H5S_SEL_ALL
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Version</p></td>
+ <td><p>The version number for the H5S_SEL_ALL Selection Info;
+ the value is 1.</p></td>
+ </tr>
+ </table>
+ </div>
+
+ <a name="ReferenceEncodeRV">
+ <h3>VIII.B. Reference Encoding (Revised)</h3></a>
+ <p>
+ <br />
+ For the following reference type,
+ the Reference Header and Reference Block are stored together as the dataset's raw data:
+ <ul>
+ <li>Object Reference (H5R_OBJECT2) (without reference to an external file)</li>
+ </ul>
+ <p>
+ For the following reference types,
+ the Reference Header plus the <a href="#GlobalHeapID">Global Heap ID</a> are stored
+ as the dataset's raw data in the file.
+ The global heap ID is used to locate the Reference Block stored in the global heap:
+ <ul>
+ <li>Object Reference (H5R_OBJECT2) (with reference to an external file)</li>
+ <li>Dataset Region Reference (H5R_DATASET_REGION2) (with/without reference to an external file)</li>
+ <li>Attribute Reference (H5R_ATTR) (with/without reference to an external file)</li>
+ </ul>
+ <br />
+ <br />
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Reference Header
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Reference Type</td>
+ <td>Flags</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+
+ </table>
+
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Reference Header
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Reference Type</p></td>
+ <td>
+ <p>There are 3 types of references:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Value</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>2</code></td>
+ <td>H5R_OBJECT2: Object Reference
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>3</code></td>
+ <td>H5R_DATASET_REGION2: Dataset Region Reference
+ </td>
+ </tr>
+
+ <tr>
+ <td align="center"><code>4</code></td>
+ <td>H5R_ATTR: Attribute Reference
+ </td>
+ </tr>
+
+ </table>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Flags</p></td>
+ <td><p>This field describes the reference:
+ <table class="list">
+ <tr>
+ <th width="20%" align="center">Bit</th>
+ <th width="80%" align="left">Description</th>
+ </tr>
+
+ <tr>
+ <td align="center"><code>0</code></td>
+ <td>If set, the reference is to an external file.
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><code>1-7</code></td>
+ <td>Reserved</td>
+ </tr>
+ </table></p>
+
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Reference Block
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td>Token Size</td>
+ <td colspan="3" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan=4><br /><br />Token
+ <em>(variable size)</em><br /> <br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan=2>Length of External File Name</td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+ </tr>
+ <tr>
+ <td colspan=4><br /><br />External File Name
+ <em>(variable size)</em><br /><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan=4>Size of Dataspace Selection</td>
+ </tr>
+ <tr>
+ <td colspan=4>Rank of Dataspace Selection</td>
+ </tr>
+ <tr>
+ <td colspan=4><br /><br />Dataspace Selection Information
+ <em>(variable size)</em><br /><br /> <br /></td>
+</td>
+</tr>
+<tr>
+ <td colspan=2>Length of Attribute Name </td>
+ <td colspan="2" bgcolor="#DDDDDD"><em>This space inserted
+ only to align table nicely</em></td>
+</tr>
+<tr>
+ <td colspan=4><br /><br />Attribute Name
+ <em>(variable size)</em><br /><br /><br /></td>
+</tr>
+
+</table>
+
+</div>
+
+<br />
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Reference Block
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Token size</p></td>
+ <td><p>This is the size of the token for the object.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Token</p></td>
+ <td>
+ <p>
+ This is the token for the object.
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Length fo External File Name</p></td>
+ <td><p>This is the length for the external file name.
+ <p>This field exists if bit 0 of <em>flags</em> is set.</p>
+ </p>
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>External File Name</p></td>
+ <td><p>This is the name of the external file being referenced.</p>
+</p>
+<p>This field exists if bit 0 of <em>flags</em> is set.</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Dataspace Selection Information</p></td>
+ <td><p>See <a href="#DataspaceSEL">Dataspace Selection.</a></p>
+</p>
+<p>This field exists if the <em>Reference Type</em> is H5R_DATASET_REGION2.</p>
+</td>
+</tr>
+
+<tr>
+ <td><p>Length of Attribute Name</p></td>
+ <td><p>This is the length of the attribute name.
+ <p>This field exists if the <em>Reference Type</em> is H5R_ATTRIBUTE.</p>
+ </td>
+</tr>
+
+<tr>
+ <td><p>Attribute Name</p></td>
+ <td><p>This is the name of the attribute being referenced.
+ <p>This field exists if the <em>Reference Type</em> is H5R_ATTRIBUTE.</p>
+ </td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+
+
+<a name="ReferenceEncodeDP">
+ <h3>VIII.C. Reference Encoding (Backward Compatibility)</h3></a>
+<p>
+ <br />
+ The two references described below are maintained to preserve compatibility with previous versions of the library.
+<p>
+ For the following reference type,
+ the reference encoding is stored as the dataset's raw data in the file:
+ <ul>
+ <li>Object Reference (H5R_OBJECT1)</li>
+ </ul>
+<p>
+ For the following reference type,
+ the <a href="#GlobalHeapID">Global Heap ID</a> is stored as the dataset's raw data in the file.
+ The global heap ID is used to locate the reference encoding
+ stored in the global heap:
+ <ul>
+ <li>Dataset Region Reference (H5R_DATASET_REGION1)</li>
+ </ul>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Reference for H5R_OBJECT1
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+
+ </table>
+
+ <table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+ </table>
+
+ </div>
+
+ <br />
+ <br />
+ <div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Reference for H5R_OBJECT1
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Object Address</p></td>
+ <td>
+ <p>Address of the object being referenced
+ </td>
+ </tr>
+
+ </table>
+ </div>
+
+ <br />
+ <br />
+ <br />
+
+ <div align="center">
+ <table class="format">
+ <caption>
+ Layout: Reference for H5R_DATASET_REGION1
+ </caption>
+
+ <tr>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ <th width="25%">byte</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><br />Object Address<sup>O</sup><br /><br /></td>
+ </tr>
+ <tr>
+ <td colspan=4><br /><br />Dataspace Selection Information
+ <em>(variable size)</em><br /><br /> <br /></td>
+</td>
+</tr>
+
+</table>
+
+<table class="note">
+ <tr>
+ <td width="60%">&nbsp;</td>
+ <td width="40%">
+ (Items marked with an &lsquo;O&rsquo; in the above table are
+ of the size specified in the <a href="#SizeOfOffsetsV0">Size
+ of Offsets</a> field in the superblock.)
+ </td></tr>
+</table>
+
+</div>
+
+<br />
+<br />
+<div align="center">
+ <table class="desc">
+ <caption>
+ Fields: Reference for H5R_DATASET_REGION1
+ </caption>
+ <tr>
+ <th width="30%">Field Name</th>
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><p>Object Address</p></td>
+ <td><p>This is the address of the object being referenced.
+ </td>
+ </tr>
+
+ <tr>
+ <td><p>Dataspace Selection Information</p></td>
+ <td><p>This is the dataspace selection for the object being referenced.
+ See <a href="#DataspaceSEL">Dataspace Selection.</a></p>
+</p>
+</td>
+</tr>
+
+</table>
+</div>
+
+<br />
+<br />
+<br />
+
+
+</body>
+</html>
diff --git a/doxygen/examples/H5A_examples.c b/doxygen/examples/H5A_examples.c
new file mode 100644
index 0000000..f332efa
--- /dev/null
+++ b/doxygen/examples/H5A_examples.c
@@ -0,0 +1,145 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_acpl, fail_attr, fail_file;
+ hid_t file, acpl, fspace, attr;
+
+ unsigned mode = H5F_ACC_TRUNC;
+ char file_name[] = "f1.h5";
+ // attribute names can be arbitrary Unicode strings
+ char attr_name[] = "Χαρακτηριστικό";
+
+ if ((file = H5Fcreate(file_name, mode, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_acpl;
+ }
+ // use UTF-8 encoding for the attribute name
+ if (H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fspace;
+ }
+ // create a scalar (singleton) attribute
+ if ((fspace = H5Screate(H5S_SCALAR)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fspace;
+ }
+ // create an attribute on the root group
+ if ((attr = H5Acreate2(file, attr_name, H5T_STD_I32LE, fspace, acpl, H5P_DEFAULT)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+
+ H5Aclose(attr);
+fail_attr:
+ H5Sclose(fspace);
+fail_fspace:
+ H5Pclose(acpl);
+fail_acpl:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_attr, fail_file;
+ hid_t file, attr;
+
+ unsigned mode = H5F_ACC_RDONLY;
+ char file_name[] = "f1.h5";
+ char attr_name[] = "Χαρακτηριστικό";
+ int value;
+
+ if ((file = H5Fopen(file_name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((attr = H5Aopen(file, attr_name, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+ // read the attribute value
+ if (H5Aread(attr, H5T_NATIVE_INT, &value) < 0)
+ ret_val = EXIT_FAILURE;
+
+ // do something w/ the attribute value
+
+ H5Aclose(attr);
+fail_attr:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_attr, fail_file;
+ hid_t file, attr;
+
+ unsigned mode = H5F_ACC_RDWR;
+ char file_name[] = "f1.h5";
+ char attr_name[] = "Χαρακτηριστικό";
+ int value = 1234;
+
+ if ((file = H5Fopen(file_name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((attr = H5Aopen(file, attr_name, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+ // update the attribute value
+ if (H5Awrite(attr, H5T_NATIVE_INT, &value) < 0)
+ ret_val = EXIT_FAILURE;
+
+ H5Aclose(attr);
+fail_attr:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_attr, fail_file;
+ hid_t file;
+
+ unsigned mode = H5F_ACC_RDWR;
+ char file_name[] = "f1.h5";
+ char attr_name[] = "Χαρακτηριστικό";
+
+ if ((file = H5Fopen(file_name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // delete the attribute
+ if (H5Adelete(file, attr_name) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+
+fail_attr:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5D_examples.c b/doxygen/examples/H5D_examples.c
new file mode 100644
index 0000000..4e54c1d
--- /dev/null
+++ b/doxygen/examples/H5D_examples.c
@@ -0,0 +1,252 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+//! <!-- [H5Dchunk_iter_cb] -->
+int
+chunk_cb(const hsize_t *offset, uint32_t filter_mask, haddr_t addr, uint32_t nbytes, void *op_data)
+{
+ // only print the allocated chunk size only
+ printf("%d\n", nbytes);
+ return EXIT_SUCCESS;
+}
+//! <!-- [H5Dchunk_iter_cb] -->
+
+//! <!-- [H5Ovisit_cb] -->
+herr_t
+H5Ovisit_cb(hid_t obj, const char *name, const H5O_info2_t *info, void *op_data)
+{
+ herr_t retval = 0;
+ char * base_path = (char *)op_data;
+
+ if (info->type == H5O_TYPE_DATASET) // current object is a dataset
+ {
+ hid_t dset, dcpl;
+ if ((dset = H5Dopen(obj, name, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ retval = -1;
+ goto func_leave;
+ }
+ if ((dcpl = H5Dget_create_plist(dset)) == H5I_INVALID_HID) {
+ retval = -1;
+ goto fail_dcpl;
+ }
+ if (H5Pget_layout(dcpl) == H5D_CHUNKED) // dataset is chunked
+ {
+ __label__ fail_dtype, fail_dspace, fail_shape;
+ hid_t dspace, dtype;
+ size_t size, i;
+ int rank;
+ hsize_t cdims[H5S_MAX_RANK];
+
+ // get resources
+ if ((dtype = H5Dget_type(dset)) < 0) {
+ retval = -1;
+ goto fail_dtype;
+ }
+ if ((dspace = H5Dget_space(dset)) < 0) {
+ retval = -1;
+ goto fail_dspace;
+ }
+ // get the shape
+ if ((size = H5Tget_size(dtype)) == 0 || (rank = H5Sget_simple_extent_ndims(dspace)) < 0 ||
+ H5Pget_chunk(dcpl, H5S_MAX_RANK, cdims) < 0) {
+ retval = -1;
+ goto fail_shape;
+ }
+ // calculate the nominal chunk size
+ size = 1;
+ for (i = 0; i < (size_t)rank; ++i)
+ size *= cdims[i];
+ // print dataset info
+ printf("%s%s : nominal chunk size %lu [B] \n", base_path, name, size);
+ // get the allocated chunk sizes
+ if (H5Dchunk_iter(dset, H5P_DEFAULT, &chunk_cb, NULL) < 0) {
+ retval = -1;
+ goto fail_fig;
+ }
+
+fail_shape:
+ H5Sclose(dspace);
+fail_dspace:
+ H5Tclose(dtype);
+fail_dtype:;
+ }
+
+ H5Pclose(dcpl);
+fail_dcpl:
+ H5Dclose(dset);
+ }
+
+func_leave:
+ return retval;
+}
+//! <!-- [H5Ovisit_cb] -->
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_lcpl, fail_dset, fail_file;
+ hid_t file, lcpl, fspace, dset;
+
+ unsigned mode = H5F_ACC_TRUNC;
+ char file_name[] = "d1.h5";
+ // link names can be arbitrary Unicode strings
+ char dset_name[] = "σύνολο/δεδομένων";
+
+ if ((file = H5Fcreate(file_name, mode, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((lcpl = H5Pcreate(H5P_LINK_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_lcpl;
+ }
+ // use UTF-8 encoding for link names
+ if (H5Pset_char_encoding(lcpl, H5T_CSET_UTF8) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fspace;
+ }
+ // create intermediate groups as needed
+ if (H5Pset_create_intermediate_group(lcpl, 1) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fspace;
+ }
+ // create a 1D dataspace
+ if ((fspace = H5Screate_simple(1, (hsize_t[]){10}, NULL)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fspace;
+ }
+ // create a 32-bit integer dataset
+ if ((dset = H5Dcreate2(file, dset_name, H5T_STD_I32LE, fspace, lcpl, H5P_DEFAULT, H5P_DEFAULT)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dset;
+ }
+
+ H5Dclose(dset);
+fail_dset:
+ H5Sclose(fspace);
+fail_fspace:
+ H5Pclose(lcpl);
+fail_lcpl:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_dset, fail_file;
+ hid_t file, dset;
+
+ unsigned mode = H5F_ACC_RDONLY;
+ char file_name[] = "d1.h5";
+ // assume a priori knowledge of dataset name and size
+ char dset_name[] = "σύνολο/δεδομένων";
+ int elts[10];
+
+ if ((file = H5Fopen(file_name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((dset = H5Dopen2(file, dset_name, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dset;
+ }
+ // read all dataset elements
+ if (H5Dread(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, elts) < 0)
+ ret_val = EXIT_FAILURE;
+
+ // do something w/ the dataset elements
+
+ H5Dclose(dset);
+fail_dset:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_update, fail_fspace, fail_dset, fail_file;
+ hid_t file, dset, fspace;
+
+ unsigned mode = H5F_ACC_RDWR;
+ char file_name[] = "d1.h5";
+ char dset_name[] = "σύνολο/δεδομένων";
+ int new_elts[6][2] = {{-1, 1}, {-2, 2}, {-3, 3}, {-4, 4}, {-5, 5}, {-6, 6}};
+
+ if ((file = H5Fopen(file_name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if ((dset = H5Dopen2(file, dset_name, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dset;
+ }
+ // get the dataset's dataspace
+ if ((fspace = H5Dget_space(dset)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fspace;
+ }
+ // select the first 5 elements in odd positions
+ if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, (hsize_t[]){1}, (hsize_t[]){2}, (hsize_t[]){5},
+ NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_update;
+ }
+
+ // (implicitly) select and write the first 5 elements of the second column of NEW_ELTS
+ if (H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, fspace, H5P_DEFAULT, new_elts) < 0)
+ ret_val = EXIT_FAILURE;
+
+fail_update:
+ H5Sclose(fspace);
+fail_fspace:
+ H5Dclose(dset);
+fail_dset:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_delete, fail_file;
+ hid_t file;
+
+ unsigned mode = H5F_ACC_RDWR;
+ char file_name[] = "d1.h5";
+ char group_name[] = "σύνολο";
+ char dset_name[] = "σύνολο/δεδομένων";
+
+ if ((file = H5Fopen(file_name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // delete (unlink) the dataset
+ if (H5Ldelete(file, dset_name, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_delete;
+ }
+ // the previous call deletes (unlinks) only the dataset
+ if (H5Ldelete(file, group_name, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_delete;
+ }
+
+fail_delete:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5E_examples.c b/doxygen/examples/H5E_examples.c
new file mode 100644
index 0000000..deea838
--- /dev/null
+++ b/doxygen/examples/H5E_examples.c
@@ -0,0 +1,97 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_push, fail_minor, fail_major, fail_class;
+ hid_t cls, major, minor;
+
+ // register a new error class for this "application"
+ if ((cls = H5Eregister_class("Custom error class", "H5E_examples", "0.1")) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_class;
+ }
+
+ // create custom major and minor error codes
+ if ((major = H5Ecreate_msg(cls, H5E_MAJOR, "Okay, Houston, we've had a problem here")) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_major;
+ }
+ if ((minor = H5Ecreate_msg(cls, H5E_MINOR, "Oops!")) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_minor;
+ }
+
+ // push a custom error message onto the default stack
+ if (H5Epush2(H5E_DEFAULT, __FILE__, __FUNCTION__, __LINE__, cls, major, minor, "Hello, Error!\n") <
+ 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_push;
+ }
+
+ // print the default error stack
+ if (H5Eprint(H5E_DEFAULT, stderr) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+fail_push:
+ H5Eclose_msg(minor);
+fail_minor:
+ H5Eclose_msg(major);
+fail_major:
+ H5Eunregister_class(cls);
+fail_class:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_count;
+
+ // check the number of error messages on the default stack
+ // and print what's there
+ ssize_t count = H5Eget_num(H5E_DEFAULT);
+ if (count < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_count;
+ }
+ else if (H5Eprint(H5E_DEFAULT, stderr) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+fail_count:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ // pop 10 error messages off the default error stack
+ // popping off non-existent messages is OK, but might be confusing
+ if (H5Epop(H5E_DEFAULT, 10) < 0)
+ ret_val = EXIT_FAILURE;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ // clear the default error stack (for the current thread)
+ if (H5Eclear2(H5E_DEFAULT) < 0)
+ ret_val = EXIT_FAILURE;
+ }
+ //! <!-- [delete] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5F_examples.c b/doxygen/examples/H5F_examples.c
new file mode 100644
index 0000000..4e89fde
--- /dev/null
+++ b/doxygen/examples/H5F_examples.c
@@ -0,0 +1,228 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_fapl, fail_fcpl, fail_file;
+ hid_t fcpl, fapl, file;
+
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fcpl;
+ }
+ else {
+ // adjust the file creation properties
+ }
+
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fapl;
+ }
+ else {
+ // adjust the file access properties
+ }
+
+ unsigned mode = H5F_ACC_EXCL;
+ char name[] = "f1.h5";
+
+ if ((file = H5Fcreate(name, mode, fcpl, fapl)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // do something useful with FILE
+
+ H5Fclose(file);
+fail_file:
+ H5Pclose(fapl);
+fail_fapl:
+ H5Pclose(fcpl);
+fail_fcpl:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_fapl, fail_file;
+ hid_t fapl, file;
+ hsize_t size;
+
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fapl;
+ }
+ else {
+ // adjust the file access properties
+ }
+
+ unsigned mode = H5F_ACC_RDONLY;
+ char name[] = "f1.h5";
+
+ if ((file = H5Fopen(name, mode, fapl)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ if (H5Fget_filesize(file, &size) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+ printf("File size: %llu bytes\n", size);
+
+ H5Fclose(file);
+fail_file:
+ H5Pclose(fapl);
+fail_fapl:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_file;
+ hid_t file;
+
+ unsigned mode = H5F_ACC_RDWR;
+ char name[] = "f1.h5";
+
+ if ((file = H5Fopen(name, mode, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // create a cycle by hard linking the root group in the root group
+ if (H5Lcreate_hard(file, ".", file, "loopback", H5P_DEFAULT, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [minimal] -->
+ {
+ unsigned mode = H5F_ACC_TRUNC;
+ char name[] = "f11.h5";
+
+ hid_t file = H5Fcreate(name, mode, H5P_DEFAULT, H5P_DEFAULT);
+ if (file != H5I_INVALID_HID)
+ H5Fclose(file);
+ else
+ ret_val = EXIT_FAILURE;
+ }
+ //! <!-- [minimal] -->
+
+ //! <!-- [open] -->
+ {
+ unsigned mode = H5F_ACC_RDONLY;
+ char name[] = "f11.h5";
+
+ hid_t file = H5Fopen(name, mode, H5P_DEFAULT);
+ if (file != H5I_INVALID_HID)
+ H5Fclose(file);
+ else
+ ret_val = EXIT_FAILURE;
+ }
+ //! <!-- [open] -->
+
+ //! <!-- [flush] -->
+ {
+ unsigned mode = H5F_ACC_RDWR;
+ char name[] = "f11.h5";
+
+ hid_t file = H5Fopen(name, mode, H5P_DEFAULT);
+ if (file != H5I_INVALID_HID) {
+ int step;
+ for (step = 0; step < 1000; ++step) {
+
+ // do important work & flush every 20 steps
+
+ if (step % 20 == 0) {
+ if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) {
+ perror("H5Fflush failed.");
+ ret_val = EXIT_FAILURE;
+ break;
+ }
+ }
+ }
+
+ if (H5Fclose(file) < 0)
+ perror("H5Fclose failed.");
+ }
+ else
+ ret_val = EXIT_FAILURE;
+ }
+ //! <!-- [flush] -->
+
+ //! <!-- [libver_bounds] -->
+ {
+ unsigned mode = H5F_ACC_RDWR;
+ char name[] = "f11.h5";
+
+ hid_t file = H5Fopen(name, mode, H5P_DEFAULT);
+ if (file != H5I_INVALID_HID) {
+ if (H5Fset_libver_bounds(file, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) >= 0) {
+
+ // object creation will not exceed HDF5 version 1.8.x
+ }
+ else
+ perror("H5Fset_libver_bounds failed.");
+
+ if (H5Fclose(file) < 0)
+ perror("H5Fclose failed.");
+ }
+ else
+ ret_val = EXIT_FAILURE;
+ }
+ //! <!-- [libver_bounds] -->
+
+ //! <!-- [mount] -->
+ {
+ hid_t file = H5Fopen("f11.h5", H5F_ACC_RDWR, H5P_DEFAULT);
+ if (file != H5I_INVALID_HID) {
+ hid_t group, child;
+ if ((group = H5Gcreate1(file, "mount_point", H5P_DEFAULT)) != H5I_INVALID_HID) {
+ if ((child = H5Fopen("f1.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) != H5I_INVALID_HID) {
+ if (H5Fmount(group, ".", child, H5P_DEFAULT) >= 0) {
+
+ // do something useful w/ the mounted file
+ }
+ else {
+ ret_val = EXIT_FAILURE;
+ perror("H5Fmount failed.");
+ }
+ H5Fclose(child);
+ }
+ H5Gclose(group);
+ }
+ H5Fclose(file);
+ }
+ else
+ ret_val = EXIT_FAILURE;
+ }
+ //! <!-- [mount] -->
+
+ //! <!-- [delete] -->
+ {
+#if H5_VERSION_GE(1, 12, 0)
+
+ // this function is only available in HDF5 1.12.x
+ if (H5Fdelete("f1.h5", H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+#endif
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5G_examples.c b/doxygen/examples/H5G_examples.c
new file mode 100644
index 0000000..3109efb
--- /dev/null
+++ b/doxygen/examples/H5G_examples.c
@@ -0,0 +1,186 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_group, fail_prop, fail_lcpl, fail_file;
+ hid_t file, lcpl, group;
+ char fname[] = "g1.h5";
+ char path[] = "/αυτή/είναι/μια/νέα/ομάδα";
+
+ if ((file = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ if ((lcpl = H5Pcreate(H5P_LINK_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_lcpl;
+ }
+ // ensure that intermediate groups are created automatically
+ if (H5Pset_create_intermediate_group(lcpl, 1) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ // use UTF-8 encoding for link names
+ if (H5Pset_char_encoding(lcpl, H5T_CSET_UTF8) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ // create five groups
+ if ((group = H5Gcreate(file, path, lcpl, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_group;
+ }
+
+ H5Gclose(group);
+fail_group:
+fail_prop:
+ H5Pclose(lcpl);
+fail_lcpl:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_file;
+ char fname[] = "g1.h5";
+ char path[] = "/αυτή/είναι";
+ hid_t file;
+ H5G_info_t info;
+
+ if ((file = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // open one of the intermediate groups
+ if (H5Gget_info_by_name(file, path, &info, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_info;
+ }
+
+ printf("Link count: %llu\n", info.nlinks);
+ switch (info.storage_type) {
+ case H5G_STORAGE_TYPE_COMPACT:
+ printf("Compact storage\n");
+ break;
+ case H5G_STORAGE_TYPE_DENSE:
+ printf("Compact storage\n");
+ break;
+ case H5G_STORAGE_TYPE_SYMBOL_TABLE:
+ printf("Symbol table\n");
+ break;
+ default:
+ printf("UFO\n");
+ break;
+ }
+
+fail_info:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_group, fail_prop, fail_lcpl, fail_file;
+ hid_t file, lcpl, group;
+ char fname[] = "g1.h5";
+ char path[] = "/αυτή/είναι/μια/άλλη/νέα/ομάδα";
+
+ if ((file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ if ((lcpl = H5Pcreate(H5P_LINK_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_lcpl;
+ }
+ // ensure that intermediate groups are created automatically
+ if (H5Pset_create_intermediate_group(lcpl, 1) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ // use UTF-8 encoding for link names
+ if (H5Pset_char_encoding(lcpl, H5T_CSET_UTF8) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ // create an anonymous group
+ if ((group = H5Gcreate_anon(file, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_group;
+ }
+ // link the new group to existing the group at "/αυτή/είναι/μια"
+ if (H5Lcreate_hard(group, ".", file, path, lcpl, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+ H5Gclose(group);
+fail_group:
+fail_prop:
+ H5Pclose(lcpl);
+fail_lcpl:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_info, fail_object, fail_file;
+ hid_t file, obj;
+ char fname[] = "g1.h5";
+ char path[] = "/αυτή/είναι/μια/άλλη/νέα/ομάδα";
+ char delete_path[] = "/αυτή/είναι/μια";
+ H5O_info_t info;
+
+ if ((file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // open a "leaf" group as object
+ if ((obj = H5Oopen(file, path, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_object;
+ }
+ // delete the link to an intermediate group on the path to the leaf
+ if (H5Ldelete(file, delete_path, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+ // link deletion will propagate along hard links along all paths
+ // reachable from the intermediate group and cause reference counts to
+ // be decremented, freeing the objects if the count reaches 0
+ if (H5Oget_info(obj, &info, H5O_INFO_BASIC) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_info;
+ }
+
+ printf("Leaf reference count: %d\n", info.rc);
+
+fail_info:
+ H5Oclose(obj);
+fail_object:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [delete] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5I_examples.c b/doxygen/examples/H5I_examples.c
new file mode 100644
index 0000000..4aa4783
--- /dev/null
+++ b/doxygen/examples/H5I_examples.c
@@ -0,0 +1,242 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_dcpl;
+ hid_t dcpl;
+
+ // create an ID of a pre-defined ID type
+ if ((dcpl = H5Pcreate(H5P_DATASET_XFER)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+
+ // we can reliably predict the ID type
+ assert(H5Iget_type(dcpl) == H5I_GENPROP_LST);
+ printf("%d\n", H5Iget_type(dcpl));
+
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_dcpl;
+ hid_t dcpl;
+
+ // create an ID of a pre-defined ID type
+ if ((dcpl = H5Pcreate(H5P_DATASET_XFER)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+
+ // this better be valid
+ assert(H5Iis_valid(dcpl) > 0);
+
+ // this ID is NOT associated with any HDF5 file;
+ // see the error message
+ assert(H5Iget_file_id(dcpl) == H5I_INVALID_HID);
+
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_rc, fail_dcpl;
+ hid_t dcpl;
+ int rc;
+
+ // create an ID of a pre-defined ID type
+ if ((dcpl = H5Pcreate(H5P_DATASET_XFER)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+
+ // retrieve the IDs reference count
+ if ((rc = H5Iget_ref(dcpl)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_rc;
+ }
+ printf("Reference count: %d\n", rc);
+
+ // bump its reference count (by 1)
+ if ((rc = H5Iinc_ref(dcpl)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_rc;
+ }
+ printf("Reference count: %d\n", rc);
+
+fail_rc:
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_rc, fail_dcpl;
+ hid_t dcpl;
+ int rc;
+
+ // create an ID of a pre-defined ID type
+ if ((dcpl = H5Pcreate(H5P_DATASET_XFER)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+
+ // decrease its reference count (from 1) to 0
+ if ((rc = H5Idec_ref(dcpl)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_rc;
+ }
+ printf("Reference count: %d\n", rc);
+
+ // at this point, the ID is no longer valid
+ assert(H5Iis_valid(dcpl) == 0);
+
+ // dropping the ref. count to 0 has the side-effect of closing
+ // the associated item, and calling H5Pclose would create an error
+ goto fail_dcpl;
+
+fail_rc:
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [delete] -->
+
+ //! <!-- [create_ud] -->
+ herr_t free_func(void *obj)
+ {
+ printf("Calling free_func...\n");
+ H5free_memory(obj);
+ return 0;
+ }
+
+ {
+ __label__ fail_id, fail_obj, fail_register;
+ H5I_type_t type;
+ int * obj;
+ hid_t obj_id;
+
+ // register a new ID type
+ if ((type = H5Iregister_type(128, 1024, &free_func)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_register;
+ }
+ printf("New identifier type ID: %d\n", type);
+
+ // create a new object
+ if ((obj = H5allocate_memory(10 * sizeof(int), 0)) == NULL) {
+ ret_val = EXIT_FAILURE;
+ goto fail_obj;
+ }
+
+ // obtain an ID for the new object
+ if ((obj_id = H5Iregister(type, obj)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_id;
+ }
+ printf("New object identifier: %ld\n", obj_id);
+
+fail_id:
+ H5Iclear_type(type, 1);
+fail_obj:
+ H5Idestroy_type(type);
+fail_register:;
+ }
+ //! <!-- [create_ud] -->
+
+ //! <!-- [read_ud] -->
+ {
+ __label__ fail_query, fail_register;
+ H5I_type_t type;
+ hsize_t count;
+
+ // register a new ID type
+ if ((type = H5Iregister_type(128, 1024, NULL)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_register;
+ }
+ printf("New FOO identifier type ID: %d\n", type);
+
+ // return the number of identifiers of TYPE currently in use
+ if (H5Inmembers(type, &count) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_query;
+ }
+ printf("%llu FOO identifiers in use\n", count);
+
+fail_query:
+ H5Idestroy_type(type);
+fail_register:;
+ }
+ //! <!-- [read_ud] -->
+
+ //! <!-- [update_ud] -->
+ {
+ __label__ fail_id, fail_register;
+ H5I_type_t type;
+ int obj = 42;
+ hid_t obj_id;
+
+ // register a new ID type
+ if ((type = H5Iregister_type(128, 1024, NULL)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_register;
+ }
+ printf("New identifier type ID: %d\n", type);
+
+ // obtain an ID for the new object
+ if ((obj_id = H5Iregister(type, &obj)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_id;
+ }
+ printf("New object identifier: %ld\n", obj_id);
+
+ // bump the reference count
+ assert(H5Iinc_ref(obj_id) == 2);
+
+ // force the deletion of all IDs regardless of reference count
+ H5Iclear_type(type, 1);
+fail_id:
+ H5Idestroy_type(type);
+fail_register:;
+ }
+ //! <!-- [update_ud] -->
+
+ //! <!-- [delete_ud] -->
+ {
+ __label__ fail_register;
+ H5I_type_t type;
+
+ // register a new ID type
+ if ((type = H5Iregister_type(128, 1024, NULL)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_register;
+ }
+ printf("New identifier type ID: %d\n", type);
+
+ // decrementing the identifier type's ref. count to 0 triggers
+ // the type to be destroyed
+ assert(H5Idec_type_ref(type) == 0);
+
+fail_register:;
+ }
+ //! <!-- [delete_ud] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5L_examples.c b/doxygen/examples/H5L_examples.c
new file mode 100644
index 0000000..63f54fe
--- /dev/null
+++ b/doxygen/examples/H5L_examples.c
@@ -0,0 +1,156 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+//! <!-- [iter_cb] -->
+herr_t
+iter_cb(hid_t group, const char *name, const H5L_info_t *info, void *op_data)
+{
+ printf("Link \"%s\" is a", name);
+ switch (info->type) {
+ case H5L_TYPE_HARD:
+ printf(" hard link.\n");
+ break;
+ case H5L_TYPE_SOFT:
+ printf(" soft link.\n");
+ break;
+ case H5L_TYPE_EXTERNAL:
+ printf("n external link.\n");
+ break;
+ default:
+ printf(" UFO link.\n");
+ break;
+ }
+
+ return 0;
+}
+//! <!-- [iter_cb] -->
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_link, fail_prop, fail_lcpl, fail_create;
+
+ hid_t file, lcpl;
+
+ if ((file = H5Fcreate("l1.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_create;
+ }
+
+ // make link creation easier by auto-creating intermediate
+ // groups and UTF-8 encoding of link names
+ if ((lcpl = H5Pcreate(H5P_LINK_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_lcpl;
+ }
+ if (H5Pset_create_intermediate_group(lcpl, 1) < 0 || H5Pset_char_encoding(lcpl, H5T_CSET_UTF8) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+
+ // create a loop by hard linking the root group
+ if (H5Lcreate_hard(file, ".", file, "√", lcpl, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_link;
+ }
+ // create a soft link to nowhere
+ if (H5Lcreate_soft("e1 62 80 87 04 09 43 ba 02 d3", file, "/path/to/nowhere", lcpl, H5P_DEFAULT) <
+ 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_link;
+ }
+ // create an external link to nowhere in a non-existent file
+ if (H5Lcreate_external("non-existent-file.h5", "???", file, "external", lcpl, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_link;
+ }
+
+fail_link:
+fail_prop:
+ H5Pclose(lcpl);
+fail_lcpl:
+ H5Fclose(file);
+fail_create:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_iterate, fail_read;
+ hid_t file;
+ hsize_t idx = 0;
+
+ if ((file = H5Fopen("l1.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_read;
+ }
+
+ if (H5Literate(file, H5_INDEX_NAME, H5_ITER_NATIVE, &idx, iter_cb, NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_iterate;
+ }
+
+fail_iterate:
+ H5Fclose(file);
+fail_read:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_move, fail_update;
+ hid_t file;
+
+ if ((file = H5Fopen("l1.h5", H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_update;
+ }
+
+ // move the "√" link to the group at "/path/to"
+ // the cycle remains!
+ if (H5Lmove(file, "√", file, "path/to/√", H5P_DEFAULT, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_move;
+ }
+
+fail_move:
+ H5Fclose(file);
+fail_update:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_delete, fail_file;
+ hid_t file;
+
+ if ((file = H5Fopen("l1.h5", H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // delete the "external" link
+ if (H5Ldelete(file, "external", H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_delete;
+ }
+
+fail_delete:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [delete] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5O_examples.c b/doxygen/examples/H5O_examples.c
new file mode 100644
index 0000000..296acd1
--- /dev/null
+++ b/doxygen/examples/H5O_examples.c
@@ -0,0 +1,193 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define H5P_DEFAULTx2 H5P_DEFAULT, H5P_DEFAULT
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_file;
+ hid_t file, group;
+ char src_path[] = "/a/few/groups";
+
+ if ((file = H5Fcreate("o1.h5", H5F_ACC_TRUNC, H5P_DEFAULTx2)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // create a few groups
+ {
+ __label__ fail_group, fail_lcpl;
+ hid_t lcpl;
+ if ((lcpl = H5Pcreate(H5P_LINK_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_lcpl;
+ }
+ if (H5Pset_create_intermediate_group(lcpl, 1) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_group;
+ }
+ if ((group = H5Gcreate(file, src_path, lcpl, H5P_DEFAULTx2)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_group;
+ }
+
+ H5Gclose(group);
+fail_group:
+ H5Pclose(lcpl);
+fail_lcpl:;
+ }
+
+ // create a copy
+ if (H5Ocopy(file, ".", file, "copy of", H5P_DEFAULTx2) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_info, fail_file;
+ hid_t file;
+ char path[] = "/a/few/groups";
+ H5O_info2_t info;
+
+ if ((file = H5Fopen("o1.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // retrieve information about the object
+ if (H5Oget_info_by_name(file, path, &info, H5O_INFO_BASIC | H5O_INFO_NUM_ATTRS, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_info;
+ }
+
+ // determine the object type
+ switch (info.type) {
+ case H5O_TYPE_GROUP:
+ printf("HDF5 group\n");
+ break;
+ case H5O_TYPE_DATASET:
+ printf("HDF5 dataset\n");
+ break;
+ case H5O_TYPE_NAMED_DATATYPE:
+ printf("HDF5 datatype\n");
+ break;
+ default:
+ printf("UFO?\n");
+ break;
+ }
+ // print basic information
+ printf("Reference count: %u\n", info.rc);
+ printf("Attribute count: %lld\n", info.num_attrs);
+
+fail_info:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_obj, fail_incr, fail_file;
+ hid_t file, obj;
+ char path[] = "/a/few/groups";
+ H5O_info2_t info;
+
+ if ((file = H5Fopen("o1.h5", H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // open an object by path name
+ if ((obj = H5Oopen(file, path, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_obj;
+ }
+
+ // bump its reference count (by 1)
+ if (H5Oincr_refcount(obj) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_incr;
+ }
+
+ // confirm the new reference count
+ if (H5Oget_info(obj, &info, H5O_INFO_BASIC) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_incr;
+ }
+ printf("Reference count: %u\n", info.rc);
+
+fail_incr:
+ H5Oclose(obj);
+fail_obj:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_obj, fail_delete, fail_file;
+ hid_t file, obj;
+ char path[] = "/a/few/groups";
+ H5O_info2_t info;
+
+ if ((file = H5Fopen("o1.h5", H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // open an object by path name
+ if ((obj = H5Oopen(file, path, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_obj;
+ }
+
+ // render it inaccessible from the root group by deleting the one and
+ // only link to it; this drops the reference count by 1
+ if (H5Ldelete(file, path, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_delete;
+ }
+
+ // confirm the new reference count
+ if (H5Oget_info(obj, &info, H5O_INFO_BASIC) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_delete;
+ }
+ printf("Reference count: %u\n", info.rc);
+
+ // if we close the file at this point, we'd be creating a tombstone,
+ // an object that cannot be reached and that cannot be reclaimed by the
+ // freespace manager; decrement the reference count to zero to prevent that
+ if (H5Idec_ref(obj) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_delete;
+ }
+ else
+ // attempting to close the object would be like a double H5Oclose and fail
+ goto fail_obj;
+
+fail_delete:
+ H5Oclose(obj);
+fail_obj:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5PL_examples.c b/doxygen/examples/H5PL_examples.c
new file mode 100644
index 0000000..d012d1b
--- /dev/null
+++ b/doxygen/examples/H5PL_examples.c
@@ -0,0 +1,97 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_set;
+ // enable ONLY filter plugins
+ if (H5PLset_loading_state(H5PL_FILTER_PLUGIN) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_set;
+ }
+
+ // ensure that "/tmp" is at the front of the search path list
+ if (H5PLprepend("/tmp") < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+fail_set:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_read;
+ unsigned size, mask;
+ char buf[255];
+
+ // retrieve the number of entries in the plugin path list
+ if (H5PLsize(&size) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_read;
+ }
+ printf("Number of stored plugin paths: %d\n", size);
+
+ // check the plugin state mask
+ if (H5PLget_loading_state(&mask) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_read;
+ }
+ printf("Filter plugins %s be loaded.\n", (mask & H5PL_FILTER_PLUGIN) == 1 ? "can" : "can't");
+ printf("VOL plugins %s be loaded.\n", (mask & H5PL_VOL_PLUGIN) == 2 ? "can" : "can't");
+
+ // print the paths in the plugin path list
+ for (unsigned i = 0; i < size; ++i) {
+ if (H5PLget(i, buf, 255) < 0) {
+ ret_val = EXIT_FAILURE;
+ break;
+ }
+ printf("%s\n", buf);
+ }
+
+fail_read:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ // replace "/tmp" with something more sensible
+ if (H5PLreplace("/foo/bar", 0) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_delete;
+ unsigned size;
+
+ if (H5PLsize(&size) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_delete;
+ }
+
+ // clean out the list of plugin paths
+ for (int i = size - 1; i >= 0; --i) {
+ if (H5PLremove(i) < 0) {
+ ret_val = EXIT_FAILURE;
+ break;
+ }
+ }
+
+fail_delete:;
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5P_examples.c b/doxygen/examples/H5P_examples.c
new file mode 100644
index 0000000..cdfc03b
--- /dev/null
+++ b/doxygen/examples/H5P_examples.c
@@ -0,0 +1,227 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_dcpl;
+ hid_t dcpl;
+
+ // every property list is created as an instance of a suitable
+ // property list class
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+
+ // ...
+
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_dcpl, fail_plist_cls_id;
+ hid_t dcpl, plist_cls_id;
+
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+ // to perform introspection on any kind of property list,
+ // we need to determine its property list class by obtaining a handle
+ if ((plist_cls_id = H5Pget_class(dcpl)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_plist_cls_id;
+ }
+ // Compare the handle to the handles of built-in or user-defined
+ // property list classes
+ assert(H5Pequal(plist_cls_id, H5P_DATASET_CREATE) > 0);
+
+fail_plist_cls_id:
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_dcpl, fail_prop;
+ hid_t dcpl;
+
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+
+ // a property list is updated by adding (or removing) properties
+ if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+
+fail_prop:
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_dcpl;
+ hid_t dcpl;
+
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dcpl;
+ }
+
+ // a property list is "deleted" by closing it
+ H5Pclose(dcpl);
+fail_dcpl:;
+ }
+ //! <!-- [delete] -->
+
+ //! <!-- [create_class] -->
+ {
+ __label__ fail_cls, fail_prop;
+ hid_t plist_cls, plist;
+ int izero = 0;
+ double dzero = 0.0;
+
+ // create a new property list class
+ if ((plist_cls = H5Pcreate_class(H5P_ROOT, "int & double", NULL, NULL, NULL, NULL, NULL, NULL)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_cls;
+ }
+ // add a permanent integer property
+ if (H5Pregister2(plist_cls, "int", sizeof(int), &izero, NULL, NULL, NULL, NULL, NULL, NULL, NULL) <
+ 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ // add a permanent double property
+ if (H5Pregister2(plist_cls, "double", sizeof(double), &dzero, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ // create an instance of this user-defined property list class
+ if ((plist = H5Pcreate(plist_cls)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+
+ // ...
+
+ H5Pclose(plist);
+fail_prop:
+ H5Pclose_class(plist_cls);
+fail_cls:;
+ }
+ //! <!-- [create_class] -->
+
+ //! <!-- [read_class] -->
+ {
+ __label__ fail_cls, fail_prop, fail_plist;
+ hid_t plist_cls, plist;
+ size_t nprops;
+
+ if ((plist_cls = H5Pcreate_class(H5P_ROOT, "ud_plist", NULL, NULL, NULL, NULL, NULL, NULL)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_cls;
+ }
+ if ((plist = H5Pcreate(plist_cls)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ if (H5Pinsert2(plist, "temp", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_plist;
+ }
+ // count the registered properties of this class
+ if (H5Pget_nprops(plist_cls, &nprops) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_plist;
+ }
+ // this will be 0 as there are no registered properties
+ printf("Property list class has %lu registered properties.\n", nprops);
+
+ // count the properties in this property list
+ if (H5Pget_nprops(plist, &nprops) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_plist;
+ }
+ // will be 1 as there is one temporary property
+ printf("Property list has %lu property.\n", nprops);
+
+fail_plist:
+ H5Pclose(plist);
+fail_prop:
+ H5Pclose_class(plist_cls);
+fail_cls:;
+ }
+ //! <!-- [read_class] -->
+
+ //! <!-- [update_class] -->
+ {
+ __label__ fail_cls, fail_prop, fail_plist;
+ hid_t plist_cls, plist;
+
+ if ((plist_cls = H5Pcreate_class(H5P_ROOT, "ud_plist", NULL, NULL, NULL, NULL, NULL, NULL)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_cls;
+ }
+ // create an instance of this user-defined property list class
+ if ((plist = H5Pcreate(plist_cls)) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_prop;
+ }
+ // insert a temporary property
+ if (H5Pinsert2(plist, "temp", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_plist;
+ }
+
+fail_plist:
+ H5Pclose(plist);
+fail_prop:
+ H5Pclose_class(plist_cls);
+fail_cls:;
+ }
+ //! <!-- [update_class] -->
+
+ //! <!-- [delete_class] -->
+ {
+ __label__ fail_cls;
+ hid_t plist_cls;
+
+ if ((plist_cls = H5Pcreate_class(H5P_ROOT, "int & double", NULL, NULL, NULL, NULL, NULL, NULL)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_cls;
+ }
+ // ...
+
+ // a user defined property list class is destroyed by closing the handle
+ H5Pclose_class(plist_cls);
+fail_cls:;
+ }
+ //! <!-- [delete_class] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5Pget_metadata_read_attempts.1.c b/doxygen/examples/H5Pget_metadata_read_attempts.1.c
new file mode 100644
index 0000000..da325c0
--- /dev/null
+++ b/doxygen/examples/H5Pget_metadata_read_attempts.1.c
@@ -0,0 +1,22 @@
+/* Get a copy of file access property list */
+fapl = H5Pcreate(H5P_FILE_ACCESS);
+
+/* Retrieve the # of read attempts from the file access property list */
+H5Pget_metadata_read_attempts(fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 1 (default for non-SWMR access).
+ */
+
+/* Set the # of read attempts to 20 */
+H5Pset_metadata_read_attempts(fapl, 20);
+
+/* Retrieve the # of read attempts from the file access property list */
+H5Pget_metadata_read_attempts(fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 20 as set.
+ */
+
+/* Close the property list */
+H5Pclose(fapl);
diff --git a/doxygen/examples/H5Pget_metadata_read_attempts.2.c b/doxygen/examples/H5Pget_metadata_read_attempts.2.c
new file mode 100644
index 0000000..2cd12db
--- /dev/null
+++ b/doxygen/examples/H5Pget_metadata_read_attempts.2.c
@@ -0,0 +1,44 @@
+/* Open the file with SWMR access and default file access property list */
+fid = H5Fopen(FILE, (H5F_ACC_RDONLY | H5F_ACC_SWMR_READ), H5P_DEFAULT);
+
+/* Get the file's file access roperty list */
+file_fapl = H5Fget_access_plist(fid);
+
+/* Retrieve the # of read attempts from the file's file access property list */
+H5Pget_metadata_read_attempts(file_fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 100 (default for SWMR access).
+ */
+
+/* Close the property list */
+H5Pclose(file_fapl);
+
+/* Close the file */
+H5Fclose(fid);
+
+/* Create a copy of file access property list */
+fapl = H5Pcreate(H5P_FILE_ACCESS);
+
+/* Set the # of read attempts */
+H5Pset_metadata_read_attempts(fapl, 20);
+
+/* Open the file with SWMR access and the non-default file access property list */
+fid = H5Fopen(FILE, (H5F_ACC_RDONLY | H5F_ACC_SWMR_READ), fapl);
+
+/* Get the file's file access roperty list */
+file_fapl = H5Fget_access_plist(fid);
+
+/* Retrieve the # of read attempts from the file's file access property list */
+H5Pget_metadata_read_attempts(file_fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 20.
+ */
+
+/* Close the property lists */
+H5Pclose(file_fapl);
+H5Pclose(fapl);
+
+/* Close the file */
+H5Fclose(fid);
diff --git a/doxygen/examples/H5Pget_metadata_read_attempts.3.c b/doxygen/examples/H5Pget_metadata_read_attempts.3.c
new file mode 100644
index 0000000..4b5ea3a
--- /dev/null
+++ b/doxygen/examples/H5Pget_metadata_read_attempts.3.c
@@ -0,0 +1,44 @@
+/* Open the file with non-SWMR access and default file access property list */
+fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+
+/* Get the file's file access roperty list */
+file_fapl = H5Fget_access_plist(fid);
+
+/* Retrieve the # of read attempts from the file's file access property list */
+H5Pget_metadata_read_attempts(file_fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 1 (default for non-SWMR access).
+ */
+
+/* Close the property list */
+H5Pclose(file_fapl);
+
+/* Close the file */
+H5Fclose(fid);
+
+/* Create a copy of file access property list */
+fapl = H5Pcreate(H5P_FILE_ACCESS);
+
+/* Set the # of read attempts */
+H5Pset_metadata_read_attempts(fapl, 20);
+
+/* Open the file with non-SWMR access and the non-default file access property list */
+fid = H5Fopen(FILE, H5F_ACC_RDONLY, fapl);
+
+/* Get the file's file access roperty list */
+file_fapl = H5Fget_access_plist(fid);
+
+/* Retrieve the # of read attempts from the file's file access property list */
+H5Pget_metadata_read_attempts(file_fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 1 (default for non-SWMR access).
+ */
+
+/* Close the property lists */
+H5Pclose(file_fapl);
+H5Pclose(fapl);
+
+/* Close the file */
+H5Fclose(fid);
diff --git a/doxygen/examples/H5Pget_object_flush_cb.c b/doxygen/examples/H5Pget_object_flush_cb.c
new file mode 100644
index 0000000..d18f3df
--- /dev/null
+++ b/doxygen/examples/H5Pget_object_flush_cb.c
@@ -0,0 +1,41 @@
+hid_t fapl_id;
+unsigned counter;
+H5F_object_flush_t *ret_cb;
+unsigned * ret_counter;
+
+/* Create a copy of the file access property list */
+fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+
+/* Set up the object flush property values */
+/* flush_cb: callback function to invoke when an object flushes (see below) */
+/* counter: user data to pass along to the callback function */
+H5Pset_object_flush_cb(fapl_id, flush_cb, &counter);
+
+/* Open the file */
+file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT);
+
+/* Get the file access property list for the file */
+fapl = H5Fget_access_plist(file_id);
+
+/* Retrieve the object flush property values for the file */
+H5Pget_object_flush_cb(fapl, &ret_cb, &ret_counter);
+/* ret_cb will point to flush_cb() */
+/* ret_counter will point to counter */
+
+/*
+.
+.
+.
+.
+.
+.
+*/
+
+/* The callback function for the object flush property */
+static herr_t
+flush_cb(hid_t obj_id, void *_udata)
+{
+ unsigned *flush_ct = (unsigned *)_udata;
+ ++(*flush_ct);
+ return 0;
+}
diff --git a/doxygen/examples/H5Pset_metadata_read_attempts.c b/doxygen/examples/H5Pset_metadata_read_attempts.c
new file mode 100644
index 0000000..7c2f65d
--- /dev/null
+++ b/doxygen/examples/H5Pset_metadata_read_attempts.c
@@ -0,0 +1,59 @@
+//! [SWMR Access]
+/* Create a copy of file access property list */
+fapl = H5Pcreate(H5P_FILE_ACCESS);
+
+/* Set the # of read attempts */
+H5Pset_metadata_read_attempts(fapl, 20);
+
+/* Open the file with SWMR access and the non-default file access property list */
+fid = H5Fopen(FILE, (H5F_ACC_RDONLY | H5F_ACC_SWMR_READ), fapl);
+
+/* Get the file's file access roperty list */
+file_fapl = H5Fget_access_plist(fid);
+
+/* Retrieve the # of read attempts from the file's file access property list */
+H5Pget_metadata_read_attempts(file_fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 20.
+ * The library will use 20 as the number of read attempts
+ * when reading checksummed metadata in the file
+ */
+
+/* Close the property list */
+H5Pclose(fapl);
+H5Pclose(file_fapl);
+
+/* Close the file */
+H5Fclose(fid);
+//! [SWMR Access]
+
+//! [non-SWMR Access]
+/* Create a copy of file access property list */
+fapl = H5Pcreate(H5P_FILE_ACCESS);
+
+/* Set the # of read attempts */
+H5Pset_metadata_read_attempts(fapl, 20);
+
+/* Open the file with SWMR access and the non-default file access property list */
+fid = H5Fopen(FILE, H5F_ACC_RDONLY, fapl);
+
+/* Get the file's file access roperty list */
+file_fapl = H5Fget_access_plist(fid);
+
+/* Retrieve the # of read attempts from the file's file access property list */
+H5Pget_metadata_read_attempts(file_fapl, &attempts);
+
+/*
+ * The value returned in "attempts" will be 1 (default for non-SWMR access).
+ * The library will use 1 as the number of read attempts
+ * when reading checksummed metadata in the file
+ */
+
+/* Close the property lists */
+H5Pclose(fapl);
+H5Pclose(file_fapl);
+
+/* Close the file */
+H5Fclose(fid);
+//! [non-SWMR Access]
diff --git a/doxygen/examples/H5Pset_object_flush_cb.c b/doxygen/examples/H5Pset_object_flush_cb.c
new file mode 100644
index 0000000..1dfa90d
--- /dev/null
+++ b/doxygen/examples/H5Pset_object_flush_cb.c
@@ -0,0 +1,41 @@
+hid_t file_id, fapl_id;
+hid_t dataset_id, dapl_id;
+unsigned counter;
+
+/* Create a copy of the file access property list */
+fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+
+/* Set up the object flush property values */
+/* flush_cb: callback function to invoke when an object flushes (see below) */
+/* counter: user data to pass along to the callback function */
+H5Pset_object_flush_cb(fapl_id, flush_cb, &counter);
+
+/* Open the file */
+file_id = H5Fopen(FILE, H5F_ACC_RDWR, H5P_DEFAULT);
+
+/* Create a group */
+gid = H5Gcreate2(fid, “group”, H5P_DEFAULT, H5P_DEFAULT_H5P_DEFAULT);
+
+/* Open a dataset */
+dataset_id = H5Dopen2(file_id, DATASET, H5P_DEFAULT);
+
+/* The flush will invoke flush_cb() with counter */
+H5Dflush(dataset_id);
+/* counter will be equal to 1 */
+
+/* ... */
+
+/* The flush will invoke flush_cb() with counter */
+H5Gflush(gid);
+/* counter will be equal to 2 */
+
+/* ... */
+
+/* The callback function for object flush property */
+static herr_t
+flush_cb(hid_t obj_id, void *_udata)
+{
+ unsigned *flush_ct = (unsigned *)_udata;
+ ++(*flush_ct);
+ return 0;
+}
diff --git a/doxygen/examples/H5R_examples.c b/doxygen/examples/H5R_examples.c
new file mode 100644
index 0000000..b40b992
--- /dev/null
+++ b/doxygen/examples/H5R_examples.c
@@ -0,0 +1,171 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_file, fail_fspace, fail_dset, fail_sel, fail_aspace, fail_attr, fail_awrite;
+ hid_t file, fspace, dset, aspace, attr;
+ H5R_ref_t ref;
+
+ if ((file = H5Fcreate("reference.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // create a region reference which selects all elements of the dataset at "/data"
+ if ((fspace = H5Screate_simple(2, (hsize_t[]){10, 20}, NULL)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_fspace;
+ }
+ if ((dset = H5Dcreate(file, "data", H5T_STD_I32LE, fspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dset;
+ }
+ if (H5Sselect_all(fspace) < 0 || H5Rcreate_region(file, "data", fspace, H5P_DEFAULT, &ref) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_sel;
+ }
+ // store the region reference in a scalar attribute of the root group called "region"
+ if ((aspace = H5Screate(H5S_SCALAR)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_aspace;
+ }
+ if ((attr = H5Acreate(file, "region", H5T_STD_REF, aspace, H5P_DEFAULT, H5P_DEFAULT)) ==
+ H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+ if (H5Awrite(attr, H5T_STD_REF, &ref) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_awrite;
+ }
+
+fail_awrite:
+ H5Aclose(attr);
+fail_attr:
+ H5Sclose(aspace);
+fail_aspace:
+ H5Rdestroy(&ref);
+fail_sel:
+ H5Dclose(dset);
+fail_dset:
+ H5Sclose(fspace);
+fail_fspace:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_file, fail_attr, fail_aread;
+ hid_t file, attr;
+ H5R_ref_t ref;
+
+ if ((file = H5Fopen("reference.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // read the dataset region reference from the attribute
+ if ((attr = H5Aopen(file, "region", H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+ if (H5Aread(attr, H5T_STD_REF, &ref) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_aread;
+ }
+ assert(H5Rget_type(&ref) == H5R_DATASET_REGION2);
+
+ // get an HDF5 path name for the dataset of the region reference
+ {
+ char buf[255];
+ if (H5Rget_obj_name(&ref, H5P_DEFAULT, buf, 255) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+ printf("Object name: \"%s\"\n", buf);
+ }
+
+ H5Rdestroy(&ref);
+fail_aread:
+ H5Aclose(attr);
+fail_attr:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_file, fail_attr, fail_ref;
+ hid_t file, attr;
+ H5R_ref_t ref;
+
+ if ((file = H5Fopen("reference.h5", H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+
+ // H5T_STD_REF is a generic reference type
+ // we can "update" the attribute value to refer to the attribute itself
+ if ((attr = H5Aopen(file, "region", H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_attr;
+ }
+ if (H5Rcreate_attr(file, "data", "region", H5P_DEFAULT, &ref) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_ref;
+ }
+
+ assert(H5Rget_type(&ref) == H5R_ATTR);
+
+ if (H5Awrite(attr, H5T_STD_REF, &ref) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+ H5Rdestroy(&ref);
+fail_ref:
+ H5Aclose(attr);
+fail_attr:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_file, fail_ref;
+ hid_t file;
+ H5R_ref_t ref;
+
+ // create an HDF5 object reference to the root group
+ if ((file = H5Fopen("reference.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ if (H5Rcreate_object(file, ".", H5P_DEFAULT, &ref) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_ref;
+ }
+
+ // H5Rdestroy() releases all resources associated with an HDF5 reference
+ H5Rdestroy(&ref);
+fail_ref:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5S_examples.c b/doxygen/examples/H5S_examples.c
new file mode 100644
index 0000000..c542ec0
--- /dev/null
+++ b/doxygen/examples/H5S_examples.c
@@ -0,0 +1,132 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_dspace;
+ hid_t dspace;
+
+ // create a 2D chess board shape (8x8)
+ if ((dspace = H5Screate_simple(2, (hsize_t[]){8, 8}, NULL)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dspace;
+ }
+
+ H5Sclose(dspace);
+fail_dspace:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_dspace;
+ hid_t dspace;
+
+ if ((dspace = H5Screate(H5S_NULL)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dspace;
+ }
+
+ // make changes to the selection on DSPACE
+ // ...
+ // parse the resulting selection
+
+ switch (H5Sget_select_type(dspace)) {
+ case H5S_SEL_HYPERSLABS:
+ // we are dealing with a hyperslab selection
+ // determine the regularity and block structure
+ break;
+ case H5S_SEL_POINTS:
+ // we are dealing with a point selection
+ // for example, retrieve the point list
+ break;
+ case H5S_SEL_ALL:
+ // all dataset elements are selected
+ break;
+ case H5S_SEL_NONE:
+ // the selection is empty
+ break;
+ default:
+ ret_val = EXIT_FAILURE;
+ break;
+ }
+
+ if (dspace != H5S_ALL)
+ H5Sclose(dspace);
+
+fail_dspace:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_select, fail_dspace;
+ hid_t dspace;
+
+ // create a 2D chess board shape (8x8)
+ if ((dspace = H5Screate_simple(2, (hsize_t[]){8, 8}, NULL)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dspace;
+ }
+ // select all black fields: do this w/ a hyperslab union in two steps
+
+ // select the black fields on even rows
+ if (H5Sselect_hyperslab(dspace, H5S_SELECT_SET, (hsize_t[]){0, 0}, (hsize_t[]){2, 2},
+ (hsize_t[]){4, 4}, NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_select;
+ }
+ // select the black fields on odd rows
+ // notice the H5S_SELECT_OR operator
+ if (H5Sselect_hyperslab(dspace, H5S_SELECT_OR, (hsize_t[]){1, 1}, (hsize_t[]){2, 2},
+ (hsize_t[]){4, 4}, NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_select;
+ }
+
+ // should be 32
+ printf("%lld elements selected.\n", H5Sget_select_npoints(dspace));
+
+fail_select:
+ H5Sclose(dspace);
+fail_dspace:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_select, fail_dspace;
+ hid_t dspace;
+
+ if ((dspace = H5Screate(H5S_NULL)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dspace;
+ }
+
+ // make changes to and work with the selection on DSPACE
+ // ...
+ // finally, clear the selection
+
+ if (H5Sselect_none(dspace) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_select;
+ }
+
+fail_select:
+ if (dspace != H5S_ALL)
+ H5Sclose(dspace);
+fail_dspace:;
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5T_examples.c b/doxygen/examples/H5T_examples.c
new file mode 100644
index 0000000..7cfa7d4
--- /dev/null
+++ b/doxygen/examples/H5T_examples.c
@@ -0,0 +1,136 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_insert, fail_dtype, fail_file;
+ hid_t file, dtype;
+
+ if ((file = H5Fcreate("t1.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // create a compound datatype with room for real and imaginary parts
+ if ((dtype = H5Tcreate(H5T_COMPOUND, 2 * sizeof(double))) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dtype;
+ }
+ // add the real part now and the imaginary part later
+ if (H5Tinsert(dtype, "re", 0, H5T_IEEE_F64LE) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_insert;
+ }
+ // commit the datatype definition to the file
+ if (H5Tcommit(file, "pre-complex", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+fail_insert:
+ H5Tclose(dtype);
+fail_dtype:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_dtype, fail_file;
+ hid_t file, dtype;
+
+ if ((file = H5Fopen("t1.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // open the datatype object stored in the file
+ if ((dtype = H5Topen(file, "pre-complex", H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dtype;
+ }
+
+ switch (H5Tget_class(dtype)) { // this time we are only interested in compounds
+ case H5T_COMPOUND:
+ printf("Record size: %lu bytes\n", H5Tget_size(dtype));
+ printf("Record has %d field(s).\n", H5Tget_nmembers(dtype));
+ break;
+ default:
+ break;
+ }
+
+ H5Tclose(dtype);
+fail_dtype:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ __label__ fail_insert, fail_clone, fail_dtype, fail_file;
+ hid_t file, dtype, clone;
+
+ if ((file = H5Fopen("t1.h5", H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // open the datatype object stored in the file
+ if ((dtype = H5Topen(file, "pre-complex", H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_dtype;
+ }
+ // the original datatype object is immutable and we need to clone it
+ if ((clone = H5Tcopy(dtype)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_clone;
+ }
+ // remember that the original has enough room for real and imaginary parts
+ // add the imaginary part
+ if (H5Tinsert(clone, "im", sizeof(double), H5T_IEEE_F64LE) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_insert;
+ }
+ // commit the "updated" datatype definition to the file
+ if (H5Tcommit(file, "complex", clone, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+fail_insert:
+ H5Tclose(clone);
+fail_clone:
+ H5Tclose(dtype);
+fail_dtype:
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ __label__ fail_file;
+ hid_t file;
+
+ if ((file = H5Fopen("t1.h5", H5F_ACC_RDWR, H5P_DEFAULT)) == H5I_INVALID_HID) {
+ ret_val = EXIT_FAILURE;
+ goto fail_file;
+ }
+ // delete the "pre-complex" datatype by unlinking
+ if (H5Ldelete(file, "pre-complex", H5P_DEFAULT) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+
+ H5Fclose(file);
+fail_file:;
+ }
+ //! <!-- [delete] -->
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5Z_examples.c b/doxygen/examples/H5Z_examples.c
new file mode 100644
index 0000000..28a1ea2
--- /dev/null
+++ b/doxygen/examples/H5Z_examples.c
@@ -0,0 +1,108 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+//! <!-- [filter] -->
+size_t
+filter(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[], size_t nbytes, size_t *buf_size,
+ void **buf)
+{
+ buf_size = 0;
+
+ if (flags & H5Z_FLAG_REVERSE) {
+ // read data, e.g., decompress data
+ // ...
+ }
+ else {
+ // write data, e.g., compress data
+ // ...
+ }
+
+ return nbytes;
+}
+//! <!-- [filter] -->
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ __label__ fail_register;
+ H5Z_class_t cls;
+ cls.version = H5Z_CLASS_T_VERS;
+ cls.id = 256;
+ cls.encoder_present = 1;
+ cls.decoder_present = 1;
+ cls.name = "Identity filter";
+ cls.can_apply = NULL;
+ cls.set_local = NULL;
+ cls.filter = &filter;
+
+ // register the filter
+ if (H5Zregister(&cls) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_register;
+ }
+
+ // do something with filter
+ // ...
+
+ // unregister the filter if no longer required
+ // ...
+
+fail_register:;
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_avail;
+
+ H5Z_filter_t flt = H5Z_FILTER_DEFLATE;
+ unsigned flags = 0;
+
+ // check if the deflate filter is available
+ if (H5Zfilter_avail(flt) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_avail;
+ }
+ // retrieve the deflate filter info
+ if (H5Zget_filter_info(flt, &flags) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_avail;
+ }
+
+ // check if the deflate encoder or decoder is enabled
+ if (H5Z_FILTER_CONFIG_ENCODE_ENABLED & flags)
+ printf("Deflate encoder enabled.\n");
+ if (H5Z_FILTER_CONFIG_DECODE_ENABLED & flags)
+ printf("Deflate decoder enabled.\n");
+
+fail_avail:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ // N/A
+ } //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+ // unregister the identity filter
+ if (H5Zunregister(256) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+ }
+ //! <!-- [delete] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/examples/H5_examples.c b/doxygen/examples/H5_examples.c
new file mode 100644
index 0000000..ef52ed0
--- /dev/null
+++ b/doxygen/examples/H5_examples.c
@@ -0,0 +1,85 @@
+/* -*- c-file-style: "stroustrup" -*- */
+
+#include "hdf5.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+//! <!-- [closing_shop] -->
+void
+closing_shop(void *ctx)
+{
+ printf("GoodBye, Cruel World!\n");
+}
+//! <!-- [closing_shop] -->
+
+int
+main(void)
+{
+ int ret_val = EXIT_SUCCESS;
+
+ //! <!-- [create] -->
+ {
+ // an HDF5 library instance is automatically initialized as
+ // part of the first HDF5 API call, but there's no harm in
+ // calling H5open().
+ if (H5open() < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+ }
+ //! <!-- [create] -->
+
+ //! <!-- [read] -->
+ {
+ __label__ fail_read;
+ unsigned majnum, minnum, relnum;
+ hbool_t flag;
+
+ // retrieve the library version
+ if (H5get_libversion(&majnum, &minnum, &relnum) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_read;
+ }
+ // is this a thread-safe library build?
+ if (H5is_library_threadsafe(&flag) < 0) {
+ ret_val = EXIT_FAILURE;
+ goto fail_read;
+ }
+
+ printf("Welcome to HDF5 %d.%d.%d\n", majnum, minnum, relnum);
+ printf("Thread-safety %s\n", (flag > 0) ? "enabled" : "disabled");
+
+fail_read:;
+ }
+ //! <!-- [read] -->
+
+ //! <!-- [update] -->
+ {
+ // update the library instance free list limits
+ if (H5set_free_list_limits(512 * 1024, 32 * 1024, 2048 * 1024, 128 * 1024, 8192 * 1024, 512 * 1024) <
+ 0) {
+ ret_val = EXIT_FAILURE;
+ }
+ }
+ //! <!-- [update] -->
+
+ //! <!-- [delete] -->
+ {
+#if H5_VERSION_GE(1, 13, 0)
+ // install a finalization routine
+ if (H5atclose(&closing_shop, NULL) < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+#endif
+ // close shop
+ if (H5close() < 0) {
+ ret_val = EXIT_FAILURE;
+ }
+ }
+ //! <!-- [delete] -->
+
+ assert(ret_val == EXIT_SUCCESS);
+
+ return ret_val;
+}
diff --git a/doxygen/examples/ImageSpec.html b/doxygen/examples/ImageSpec.html
new file mode 100644
index 0000000..1b700ff
--- /dev/null
+++ b/doxygen/examples/ImageSpec.html
@@ -0,0 +1,1203 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.72 [en] (WinNT; U) [Netscape]">
+ <title>Image Specification</title>
+
+The HDF5 specification defines the standard objects and storage for the
+standard HDF5 objects. (For information about the HDF5 library, model and
+specification, see the HDF documentation.)&nbsp; This document is an additional
+specification do define a standard profile for how to store image data
+in HDF5. Image data in HDF5 is stored as HDF5 datasets with standard attributes
+to define the properties of the image.
+<p>This specification is primarily concerned with two dimensional raster
+data similar to HDF4 Raster Images.&nbsp; Specifications for storing other
+types of imagery will be covered in other documents.
+<p>This specification defines:
+<ul>
+<li>
+Standard storage and attributes for an Image dataset (<a href="#Sect1">Section
+1</a>)</li>
+
+<li>
+Standard storage and attributes for Palettes (<a href="#sect2">Section
+2</a>)</li>
+
+<li>
+Standard for associating Palettes with Images. (<a href="#Sect3">Section
+3</a>)</li>
+</ul>
+
+<h2>
+<a NAME="Sect1"></a>1. HDF5 Image Specification</h2>
+
+<h3>
+1.1 Overview</h3>
+Image data is stored as an HDF5 dataset with values of HDF5 class Integer
+or Float.&nbsp; A common example would be a two dimensional dataset, with
+elements of class Integer, e.g., a two dimensional array of unsigned 8
+bit integers.&nbsp; However, this specification does not limit the dimensions
+or number type that may be used for an Image.
+<p>The dataset for an image is distinguished from other datasets by giving
+it an attribute "CLASS=IMAGE".&nbsp; In addition, the Image dataset may
+have an optional attribute "PALETTE" that is an array of object references
+for zero or more palettes. The Image dataset may have additional attributes
+to describe the image data, as defined in <a href="#Sect1.2">Section 1.2</a>.
+<p>A Palette is an HDF5 dataset which contains color map information.&nbsp;
+A Pallet dataset has an attribute "CLASS=PALETTE" and other attributes
+indicating the type and size of the palette, as defined in <a href="#sect2">Section
+2.1</a>.&nbsp; A Palette is an independent object, which can be shared
+among several Image datasets.
+<h3>
+<a NAME="Sect1.2"></a>1.2&nbsp; Image Attributes</h3>
+The attributes for the Image are scalars unless otherwise noted.&nbsp;
+The length of String valued attributes should be at least the number of
+characters. Optionally, String valued attributes may be stored in a String
+longer than the minimum, in which case it must be zero terminated or null
+padded.&nbsp; "Required" attributes must always be used. "Optional" attributes
+must be used when required.
+<br>&nbsp;
+<h4>
+Attributes</h4>
+
+<dl>
+<dt>
+Attribute name="<b>CLASS</b>" (Required)</dt>
+
+<dd>
+This attribute is type H5T_C_S1, with size 5.</dd>
+
+<dd>
+For all Images, the value of this attribute is "IMAGE".</dd>
+
+<dd>
+</dd>
+
+<dd>
+This attribute identifies this data set as intended to be interpreted as
+an image that conforms to the specifications on this page.</dd>
+</dl>
+
+<dt>
+Attribute name="<b>PALETTE</b>"</dt>
+
+<dl>
+<dd>
+A Image dataset within an HDF5 file may optionally specify an array of
+palettes to be viewed with. The dataset will have an attribute field called
+"<b>PALETTE</b>" which contains a one-dimensional array of object reference
+pointers (HDF5 datatype H5T_STD_REF_OBJ) which refer to palettes in the
+file. The palette datasets must conform to the Palette specification in
+<a href="#sect2">section
+2 below</a>. The first palette in this array will be the default palette
+that the data may be viewed with.</dd>
+</dl>
+
+<dl>
+<dt>
+</dt>
+
+<dt>
+Attribute name="<b>IMAGE_SUBCLASS</b>"</dt>
+
+<dd>
+If present, the value of this attribute indicates the type of Palette that
+should be used with the Image.&nbsp; This attribute is a scalar of type
+H5T_C_S1, with size according to the string plus one.&nbsp; The values
+are:</dd>
+
+<dl>
+<dt>
+"IMAGE_GRAYSCALE" (length 15)</dt>
+
+<dd>
+A grayscale image</dd>
+
+<dt>
+"IMAGE_BITMAP" (length 12)</dt>
+
+<dd>
+A bit map image</dd>
+
+<dt>
+"IMAGE_TRUECOLOR" (length 15)</dt>
+
+<dd>
+A truecolor image</dd>
+
+<dt>
+"IMAGE_INDEXED" (length 13)</dt>
+
+<dd>
+An indexed image</dd>
+
+<dd>
+</dd>
+</dl>
+
+<dt>
+Attribute name="<b>INTERLACE_MODE</b>"</dt>
+
+<dd>
+For images with more than one component for each pixel, this optional attribute
+specifies the layout of the data. The values are type H5T_C_S1 of length
+15. See <a href="#Section1.3">section 1.3</a> for information about the
+storage layout for data.</dd>
+
+<dd>
+"INTERLACE_PIXEL" (default): the component value for a pixel are contiguous.</dd>
+
+<dd>
+"INTERLACE_PLANE": each component is stored as a plane.</dd>
+
+<dt>
+</dt>
+
+<dt>
+Attribute name="<b>DISPLAY_ORIGIN</b>"</dt>
+
+<dd>
+This optional attribute indicates the intended orientation of the data
+on a two-dimensional raster display.&nbsp; The value indicates which corner
+the pixel at (0, 0) should be viewed.&nbsp; The values are type H5T_C_S1
+of length 2. If DISPLAY_ORIGIN is not set, the orientation is undefined.</dd>
+
+<dd>
+"UL": (0,0) is at the upper left.</dd>
+
+<dd>
+"LL": (0,0) is at the lower left.</dd>
+
+<dd>
+"UR": (0,0) is at the upper right.</dd>
+
+<dd>
+"LR": (0,0) is at the lower right.</dd>
+</dl>
+
+<dt>
+Attribute name="<b>IMAGE_WHITE_IS_ZERO</b>"</dt>
+
+<dl>
+<dd>
+This attribute is of type H5T_NATIVE_UCHAR.&nbsp; 0 = false, 1 = true .&nbsp;
+This is used for images with IMAGE_SUBCLASS="IMAGE_GRAYSCALE" or "IMAGE_BITMAP".</dd>
+</dl>
+
+<dl>
+<dt>
+Attribute name="<b>IMAGE_MINMAXRANGE</b>"</dt>
+
+<dd>
+If present, this attribute is an array of two numbers, of the same HDF5
+datatype as the data.&nbsp; The first element is the minimum value of the
+data, and the second is the maximum.&nbsp; This is used for images with
+IMAGE_SUBCLASS="IMAGE_GRAYSCALE", "IMAGE_BITMAP" or "IMAGE_INDEXED".</dd>
+</dl>
+
+<dt>
+Attribute name="<b>IMAGE_BACKGROUNDINDEX</b>"</dt>
+
+<dl>
+<dd>
+If set, this attribute indicates the index value that should be interpreted
+as the "background color".&nbsp; This attribute is HDF5 type H5T_NATIVE_UINT.</dd>
+</dl>
+
+<dt>
+Attribute name="<b>IMAGE_TRANSPARENCY</b>"</dt>
+
+<dl>
+<dd>
+If set, this attribute indicates the index value that should be interpreted
+as the "transparent color".&nbsp; This attribute is HDF5 type H5T_NATIVE_UINT.&nbsp;
+This attribute may not be used for IMAGE_SUBCLASS="IMAGE_TRUE_COLOR".</dd>
+</dl>
+
+<dt>
+Attribute name="<b>IMAGE_ASPECTRATIO</b>"</dt>
+
+<dl>
+<dd>
+If set, this attribute indicates the aspect ratio.</dd>
+</dl>
+
+<dt>
+Attribute name="<b>IMAGE_COLORMODEL</b>"</dt>
+
+<dl>
+<dd>
+If set, this attribute indicates the color model of Palette that should
+be used with the Image.&nbsp; This attribute is of type H5T_C_S1, with
+size 3, 4, or 5.&nbsp; The value is one of the color models described in
+the Palette specification in <a href="#sect2.2">section 2.2 below</a>.&nbsp;
+This attribute may be used only for IMAGE_SUBCLASS="IMAGE_TRUECOLOR" or
+"IMAGE_INDEXED".</dd>
+</dl>
+
+<dt>
+Attribute name="<b>IMAGE_GAMMACORRECTION</b>"</dt>
+
+<dl>
+<dd>
+If set, this attribute gives the Gamma correction.&nbsp; The attribute
+is type H5T_NATIVE_FLOAT.&nbsp; This attribute may be used only for IMAGE_SUBCLASS="IMAGE_TRUECOLOR"
+or "IMAGE_INDEXED".</dd>
+</dl>
+Attribute name="<b>IMAGE_VERSION</b>" (Required)
+<dl>
+<dd>
+This attribute is of type H5T_C_S1, with size corresponding to the length
+of the version string.&nbsp; This attribute identifies the version number
+of this specification to which it conforms.&nbsp; The current version number
+is "1.2".</dd>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<center><table BORDER=2 BGCOLOR="#FFFFFF" >
+<caption><b>Table 1. Attributes of an Image Dataset</b></caption>
+
+<tr>
+<td><b>Attribute Name</b></td>
+
+<td><b>(R = Required</b>
+<br><b>O= Optional)</b></td>
+
+<td><b>Type</b></td>
+
+<td><b>String Size</b></td>
+
+<td><b>Value</b></td>
+</tr>
+
+<tr>
+<td>CLASS</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>5</td>
+
+<td>"IMAGE"</td>
+</tr>
+
+<tr>
+<td>PALETTE</td>
+
+<td>O</td>
+
+<td>Array Object References</td>
+
+<td></td>
+
+<td>&lt;references to Palette datasets><sup>1</sup></td>
+</tr>
+
+<tr>
+<td>IMAGE_SUBCLASS</td>
+
+<td>O<sup>2</sup></td>
+
+<td>String</td>
+
+<td>15,&nbsp;
+<br>12,&nbsp;
+<br>15,
+<br>13</td>
+
+<td>
+<dt>
+"IMAGE_GRAYSCALE",</dt>
+
+<dt>
+"IMAGE_BITMAP",</dt>
+
+<dt>
+"IMAGE_TRUECOLOR",</dt>
+
+<dt>
+"IMAGE_INDEXED"</dt>
+</td>
+</tr>
+
+<tr>
+<td>INTERLACE_MODE</td>
+
+<td>O<sup>3,6</sup></td>
+
+<td>String</td>
+
+<td>15</td>
+
+<td>The layout of components if more than one component per pixel.</td>
+</tr>
+
+<tr>
+<td>DISPLAY_ORIGIN</td>
+
+<td>O</td>
+
+<td>String</td>
+
+<td>2</td>
+
+<td>If set, indicates the intended location of the pixel (0,0).</td>
+</tr>
+
+<tr>
+<td>IMAGE_WHITE_IS_ZERO</td>
+
+<td>O<sup>3,4</sup></td>
+
+<td>Unsigned Integer</td>
+
+<td></td>
+
+<td>0 = false, 1 = true</td>
+</tr>
+
+<tr>
+<td>IMAGE_MINMAXRANGE</td>
+
+<td>O<sup>3,5</sup></td>
+
+<td>Array [2] &lt;same datatype as data values></td>
+
+<td></td>
+
+<td>The (&lt;minimum>, &lt;maximum>) value of the data.</td>
+</tr>
+
+<tr>
+<td>IMAGE_BACKGROUNDINDEX</td>
+
+<td>O<sup>3</sup></td>
+
+<td>Unsigned Integer</td>
+
+<td></td>
+
+<td>The index of the background color.</td>
+</tr>
+
+<tr>
+<td>IMAGE_TRANSPARENCY</td>
+
+<td>O<sup>3,5</sup></td>
+
+<td>Unsigned Integer</td>
+
+<td></td>
+
+<td>The index of the transparent color.</td>
+</tr>
+
+<tr>
+<td>IMAGE_ASPECTRATIO</td>
+
+<td>O<sup>3,4</sup></td>
+
+<td>Unsigned Integer</td>
+
+<td></td>
+
+<td>The aspect ratio.</td>
+</tr>
+
+<tr>
+<td>IMAGE_COLORMODEL</td>
+
+<td>O<sup>3,6</sup></td>
+
+<td>String</td>
+
+<td>3, 4, or 5</td>
+
+<td>The color model, as defined below in the Palette specification for
+attribute <b>PAL_COLORMODEL</b>.</td>
+</tr>
+
+<tr>
+<td>IMAGE_GAMMACORRECTION</td>
+
+<td>O<sup>3,6</sup></td>
+
+<td>Float</td>
+
+<td></td>
+
+<td>The gamma correction.</td>
+</tr>
+
+<tr>
+<td>IMAGE_VERSION</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>3</td>
+
+<td>"1.2"</td>
+</tr>
+</table></center>
+
+<dl><font size=-1>1.&nbsp; The first element of the array is the default
+Palette.</font>
+<br><font size=-1>2.&nbsp; This attribute is <b>required</b> for images
+that use one of the standard color map types listed.</font>
+<br><font size=-1>3. This attribute is <b>required</b> if set for the source
+image, in the case that the image is translated from another file into
+HDF5.</font>
+<br><font size=-1>4.&nbsp; This applies to:&nbsp; IMAGE_SUBCLASS="IMAGE_GRAYSCALE"
+or "IMAGE_BITMAP".</font>
+<br><font size=-1>5.&nbsp; This applies to:&nbsp; IMAGE_SUBCLASS="IMAGE_GRAYSCALE",
+"IMAGE_BITMAP", or "IMAGE_INDEXED".</font>
+<br><font size=-1>6.&nbsp; This applies to: IMAGE_SUBCLASS="IMAGE_TRUECOLOR",
+or "IMAGE_INDEXED".</font></dl>
+</dl>
+Table 2 summarizes the standard attributes for an Image datasets using
+the common sub-classes. R means that the attribute listed on the leftmost
+column is Required for the image subclass on the first row, O means that
+the attribute is Optional for that subclass and N that the attribute cannot
+be applied to that subclass. The two first rows show the only required
+attributes
+for all subclasses.
+<br>&nbsp;
+<table BORDER WIDTH="100%" >
+<caption><b>Table 2a. Applicability of Attributes to IMAGE sub-classes</b></caption>
+
+<tr>
+<td WIDTH="20%"><b>IMAGE_SUBCLASS</b><sup>1</sup></td>
+
+<td WIDTH="20%"><b>IMAGE_GRAYSCALE</b></td>
+
+<td WIDTH="20%"><b>IMAGE_BITMAP</b></td>
+</tr>
+
+<tr>
+<td WIDTH="20%">CLASS</td>
+
+<td WIDTH="20%">R</td>
+
+<td WIDTH="20%">R</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_VERSION</td>
+
+<td WIDTH="20%">R</td>
+
+<td WIDTH="20%">R</td>
+</tr>
+
+<tr>
+<td>INTERLACE_MODE</td>
+
+<td>N</td>
+
+<td>N</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_WHITE_IS_ZERO</td>
+
+<td WIDTH="20%">R</td>
+
+<td WIDTH="20%">R</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_MINMAXRANGE</td>
+
+<td WIDTH="20%">O</td>
+
+<td WIDTH="20%">O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_BACKGROUNDINDEX</td>
+
+<td WIDTH="20%">O</td>
+
+<td WIDTH="20%">O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_TRANSPARENCY</td>
+
+<td WIDTH="20%">O</td>
+
+<td WIDTH="20%">O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_ASPECTRATIO</td>
+
+<td WIDTH="20%">O</td>
+
+<td WIDTH="20%">O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_COLORMODEL</td>
+
+<td WIDTH="20%">N</td>
+
+<td WIDTH="20%">N</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_GAMMACORRECTION</td>
+
+<td WIDTH="20%">N</td>
+
+<td WIDTH="20%">N</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">PALETTE</td>
+
+<td WIDTH="20%">O</td>
+
+<td WIDTH="20%">O</td>
+</tr>
+
+<tr>
+<td>DISPLAY_ORIGIN</td>
+
+<td>O</td>
+
+<td>O</td>
+</tr>
+</table>
+
+<blockquote>&nbsp;</blockquote>
+
+<table BORDER WIDTH="100%" >
+<caption><b>Table 2b. Applicability of Attributes to IMAGE sub-classes</b></caption>
+
+<tr>
+<td WIDTH="20%"><b>IMAGE_SUBCLASS</b></td>
+
+<td WIDTH="20%"><b>IMAGE_TRUECOLOR</b></td>
+
+<td><b>IMAGE_INDEXED</b></td>
+</tr>
+
+<tr>
+<td WIDTH="20%">CLASS</td>
+
+<td WIDTH="20%">R</td>
+
+<td>R</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_VERSION</td>
+
+<td WIDTH="20%">R</td>
+
+<td>R</td>
+</tr>
+
+<tr>
+<td>INTERLACE_MODE</td>
+
+<td>R</td>
+
+<td>N</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_WHITE_IS_ZERO</td>
+
+<td WIDTH="20%">N</td>
+
+<td>N</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_MINMAXRANGE</td>
+
+<td WIDTH="20%">N</td>
+
+<td>O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_BACKGROUNDINDEX</td>
+
+<td WIDTH="20%">N</td>
+
+<td>O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_TRANSPARENCY</td>
+
+<td WIDTH="20%">N</td>
+
+<td>O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_ASPECTRATIO</td>
+
+<td WIDTH="20%">O</td>
+
+<td>O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_COLORMODEL</td>
+
+<td WIDTH="20%">O</td>
+
+<td>O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">IMAGE_GAMMACORRECTION</td>
+
+<td WIDTH="20%">O</td>
+
+<td>O</td>
+</tr>
+
+<tr>
+<td WIDTH="20%">PALETTE</td>
+
+<td WIDTH="20%">O</td>
+
+<td>O</td>
+</tr>
+
+<tr>
+<td>DISPLAY_ORIGIN</td>
+
+<td>O</td>
+
+<td>O</td>
+</tr>
+</table>
+
+<h3>
+<a NAME="Section1.3"></a>1.3 Storage Layout and Properties for Images</h3>
+In the case of an image with more than one component per pixel (e.g., Red,
+Green, and Blue), the data may be arranged in one of two ways.&nbsp; Following
+HDF4 terminology, the data may be interlaced by pixel or by plane, which
+should be indicated by the INTERLACE_MODE&nbsp; attribute.&nbsp; In both
+cases, the dataset will have a dataspace with three dimensions, height,
+width, and components.&nbsp; The interlace modes specify different orders
+for the dimensions.
+<br>&nbsp;
+<table BORDER COLS=2 WIDTH="100%" >
+<caption><b>Table 3. Storage of multiple component image data.</b></caption>
+
+<tr>
+<td><b>Interlace Mode</b></td>
+
+<td><b>Dimensions in the Dataspace</b></td>
+</tr>
+
+<tr>
+<td>INTERLACE_PIXEL</td>
+
+<td>[height][width][pixel components]</td>
+</tr>
+
+<tr>
+<td>INTERLACE_PLANE</td>
+
+<td>[pixel components][height][width]</td>
+</tr>
+</table>
+
+<p>For example, consider a 5 (rows) by 10 (column) image, with Red, Green,
+and Blue components.&nbsp; Each component is an unsigned byte. In HDF5,
+the datatype would be declared as an unsigned 8 bit integer.&nbsp; For
+pixel interlace, the dataspace would be a three dimensional array, with
+dimensions: [10][5][3].&nbsp; For plane interleave, the dataspace would
+be three dimensions: [3][10][5].
+<p>In the case of images with only one component, the dataspace may be
+either a two dimensional array, or a three dimensional array with the third
+dimension of size 1.&nbsp; For example, a 5 by 10 image with 8 bit color
+indexes would be an HDF5 dataset with type unsigned 8 bit integer.&nbsp;
+The dataspace could be either a two dimensional array, with dimensions
+[10][5], or three dimensions, with dimensions either [10][5][1] or [1][10][5].
+<p>Image datasets may be stored with any chunking or compression properties
+supported by HDF5.
+<p><b>A note concerning compatibility with HDF5 GR interface: </b>An Image
+dataset is stored as an HDF5 dataset.&nbsp; It is important to note that
+the order of the dimensions is the same as for any other HDF5 dataset.&nbsp;
+For a two dimensional image that is to be stored as a series of horizontal
+scan lines, with the scan lines contiguous (i.e., the fastest changing
+dimension is 'width'), the image will have a dataspace with <i>dim[0] =
+height</i> and <i>dim[1]</i> = <i>width</i>.&nbsp; This is completely consistent
+with all other HDF5 datasets.
+<p>Users familiar with HDF4 should be cautioned that <i>this is not the
+same as HDF4</i>, and specifically is not consistent with what the HDF4
+GR interface does.
+<br>&nbsp;
+<h2>
+<a NAME="sect2"></a>2.&nbsp; HDF5 Palette Specification</h2>
+
+<h3>
+2.1 Overview</h3>
+A palette is the means by which color is applied to an image and is also
+referred to as a color lookup table. It is a table in which every row contains
+the numerical representation of a particular color. In the example of an
+8 bit standard RGB color model palette, this numerical representation of
+a color is presented as a triplet specifying the intensity of red, green,
+and blue components that make up each color.
+<center>
+<p><img SRC="Palettes.fm.anc.gif" ></center>
+
+<p>In this example, the color component numeric type is an 8 bit unsigned
+integer. While this is most common and recommended for general use, other
+component color numeric datatypes, such as a 16 bit unsigned integer ,
+may be used. This type is specified as the type attribute of the palette
+dataset. (see H5Tget_type(), H5Tset_type())
+<p>The minimum and maximum values of the component color numeric are specified
+as attribute of the palette dataset. See below (attribute PAL_MINMAXNUMERIC).
+If these attributes do not exist, it is assumed that the range of values
+will fill the space of the color numeric type. i.e. with an 8 bit unsigned
+integer, the valid range would be 0 to 255 for each color component.
+<p>The HDF5 palette specification additionally allows for color models
+beyond RGB. YUV, HSV, CMY, CMYK, YCbCr color models are supported, and
+may be specified as a color model attribute of the palette dataset. <i>(see
+"Palette Attributes" for details)</i>.
+<p>In HDF 4 and earlier, palettes were limited to 256 colors. The HDF5
+palette specification allows for palettes of varying length. The length
+is specified as the number of rows of the palette dataset.
+<br>&nbsp;
+<br>&nbsp;
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#666666" >
+<tr>
+<td><font color="#FFFFFF">Important Note: The specification of the Indexed
+Palette will change substantially in the next version.&nbsp; The Palette
+described here is <i>denigrated</i> and is not supported.</font></td>
+</tr>
+</table>
+
+<br>&nbsp;
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td><i>Denigrated</i>
+<p>In a standard palette, the color entries are indexed directly. HDF5
+supports the notion of a range index table. Such a table defines an ascending
+ordered list of ranges that map dataset values to the palette. If a range
+index table exists for the palette, the PAL_TYPE attribute will be set
+to "RANGEINDEX", and the PAL_RANGEINDEX attribute will contain an object
+reference to a range index table array. If not, the PAL_TYPE attribute
+either does not exist, or will be set to "STANDARD".
+<p>The range index table array consists of a one dimensional array with
+the same length as the palette dataset - 1. Ideally, the range index would
+be of the same type as the dataset it refers to, however this is not a
+requirement.
+<p><b>Example 2: A range index array of type floating point</b>
+<center>
+<p><img SRC="PaletteExample1.gif" ></center>
+
+<p>The range index array attribute defines the "<i>to</i>" of the range.
+Notice that the range index array attribute is one less entry in size than
+the palette. The first entry of 0.1259, specifies that all values below
+and up to 0.1259 inclusive, will map to the first palette entry. The second
+entry signifies that all values greater than 0.1259 up to 0.3278 inclusive,
+will map to the second palette entry, etc. All value greater than the last
+range index array attribute (100000) map to the last entry in the palette.</td>
+</tr>
+</table>
+
+<h3>
+<a NAME="sect2.2"></a>2.2. Palette Attributes</h3>
+A palette exists in an HDF file as an independent data set with accompanying
+attributes.&nbsp; The Palette attributes are scalars except where noted
+otherwise.&nbsp; String values should have size the length of the string
+value plus one.&nbsp; "Required" attributes must be used.&nbsp; "Optional"
+attributes must be used when required.
+<p>These attributes are defined as follows:
+<dl>
+<dt>
+Attribute name="<b>CLASS</b>" (Required)</dt>
+
+<dd>
+This attribute is of type H5T_C_S1, with size 7.</dd>
+
+<dd>
+For all palettes, the value of this attribute is "PALETTE". This attribute
+identifies this palette data set as a palette that conforms to the specifications
+on this page.</dd>
+
+<dt>
+Attribute name="<b>PAL_COLORMODEL</b>" (Required)</dt>
+
+<dd>
+This attribute is of type H5T_C_S1, with size 3, 4, or 5.</dd>
+
+<dd>
+Possible values for this are "RGB", "YUV", "CMY", "CMYK", "YCbCr", "HSV".</dd>
+
+<dd>
+This defines the color model that the entries in the palette data set represent.</dd>
+
+<dl>
+<dt>
+"RGB"</dt>
+
+<dd>
+Each color index contains a triplet where the the first value defines the
+red component, second defines the green component, and the third the blue
+component.</dd>
+
+<dt>
+"CMY"</dt>
+
+<dd>
+Each color index contains a triplet where the the first value defines the
+cyan component, second defines the magenta component, and the third the
+yellow component.</dd>
+
+<dt>
+"CMYK"</dt>
+
+<dd>
+Each color index contains a quadruplet where the the first value defines
+the cyan component, second defines the magenta component, the third the
+yellow component, and the forth the black component.</dd>
+
+<dt>
+"YCbCr"</dt>
+
+<dd>
+Class Y encoding model. Each color index contains a triplet where the the
+first value defines the luminance, second defines the Cb Chromonance, and
+the third the Cr Chromonance.</dd>
+
+<dt>
+"YUV"</dt>
+
+<dd>
+Composite encoding color model. Each color index contains a triplet where
+the the first value defines the luminance component, second defines the
+chromonance component, and the third the value component.</dd>
+
+<dt>
+"HSV"</dt>
+
+<dd>
+Each color index contains a triplet where the the first value defines the
+hue component, second defines the saturation component, and the third the
+value component. The hue component defines the hue spectrum with a low
+value representing magenta/red progressing to a high value which would
+represent blue/magenta, passing through yellow, green, cyan. A low value
+for the saturation component means less color saturation than a high value.
+A low value for <i>value</i> will be darker than a high value.</dd>
+
+<dd>
+</dd>
+</dl>
+
+<dt>
+Attribute name="<b>PAL_TYPE</b>" (Required)</dt>
+
+<dd>
+This attribute is of type H5T_C_S1, with size 9 or 10.</dd>
+
+<dd>
+The current supported values for this attribute are : "STANDARD8" or "RANGEINDEX"</dd>
+
+<dd>
+A PAL_TYPE of "STANDARD8" defines a palette dataset such that the first
+entry defines index 0, the second entry defines index 1, etc. up until
+the length of the palette - 1. This assumes an image dataset with direct
+indexes into the palette.</dd>
+</dl>
+
+<dl>&nbsp;
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td><i>Denigrated</i>
+<p>If the PAL_TYPE is set to "RANGEINDEX", there will be an additional
+attribute with a name of "<b>PAL_RANGEINDEX</b>",&nbsp; (See example 2
+for more details)</td>
+</tr>
+</table>
+
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td>
+<dt>
+Attribute name="<b>PAL_RANGEINDEX</b>"&nbsp;&nbsp; <i>(Denigrated)</i></dt>
+
+<dl>
+<dd>
+The <b>PAL_RANGEINDEX</b> attribute contains an HDF object reference (HDF5
+datatype H5T_STD_REF_OBJ) pointer which specifies a range index array in
+the file to be used for color lookups for the palette.&nbsp; (Only for
+PAL_TYPE="RANGEINDEX")</dd>
+</dl>
+</td>
+</tr>
+</table>
+
+<dt>
+Attribute name="<b>PAL_MINMAXNUMERIC</b>"</dt>
+
+<dl>
+<dt>
+If present, this attribute is an array of two numbers, of the same HDF5
+datatype as the palette elements or color numerics.</dt>
+
+<br>They specify the minimum and maximum values of the color numeric components.
+For example, if the palette was an RGB of type Float, the color numeric
+range for Red, Green, and Blue could be set to be between 0.0 and 1.0.
+The intensity of the color guns would then be scaled accordingly to be
+between this minimum and maximum attribute.</dl>
+Attribute name="<b>PAL_VERSION</b>"&nbsp; (Required)
+<dl>This attribute is of type H5T_C_S1, with size corresponding to the
+length of the version string.&nbsp; This attribute identifies the version
+number of this specification to which it conforms.&nbsp; The current version
+is "1.2".</dl>
+
+<center><table BORDER=2 BGCOLOR="#FFFFFF" >
+<caption><b>Table 4. Attributes of a Palette Dataset</b></caption>
+
+<tr>
+<td><b>Attribute Name</b></td>
+
+<td><b>(R = Required,</b>
+<br><b>O = Optional)</b></td>
+
+<td><b>Type</b></td>
+
+<td><b>String Size</b></td>
+
+<td><b>Value</b></td>
+</tr>
+
+<tr>
+<td>CLASS</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>
+<center>7</center>
+</td>
+
+<td>"PALETTE"</td>
+</tr>
+
+<tr>
+<td>PAL_COLORMODEL</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>
+<center>3, 4, or 5</center>
+</td>
+
+<td>Color Model:&nbsp; "RGB", YUV", "CMY", "CMYK", "YCbCr", or "HSV"</td>
+</tr>
+
+<tr>
+<td>PAL_TYPE</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>
+<center>9</center>
+
+<p><br>
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td>or 10</td>
+</tr>
+</table>
+</td>
+
+<td>"STANDARD8"&nbsp;
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td>or "RANGEINDEX" <i>(Denigrated)</i></td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td><i>Denigrated</i>
+<br>RANGE_INDEX</td>
+</tr>
+</table>
+</td>
+
+<td></td>
+
+<td>
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td>Object Reference&nbsp;</td>
+</tr>
+</table>
+</td>
+
+<td></td>
+
+<td>
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td>&lt;Object Reference to Dataset of range index values></td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>PAL_MINMAXNUMERIC</td>
+
+<td>O</td>
+
+<td>Array[2] of &lt;same datatype as palette></td>
+
+<td></td>
+
+<td>The first value is the &lt;Minimum value for color values>, the second
+value is &lt;Maximum value for color values><sup>2</sup></td>
+</tr>
+
+<tr>
+<td>PAL_VERSION</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>4</td>
+
+<td>"1.2"</td>
+</tr>
+</table></center>
+
+<dl>&nbsp;
+<table BORDER COLS=1 WIDTH="100%" BGCOLOR="#CCCCCC" >
+<tr>
+<td><font size=-1>1.&nbsp; The RANGE_INDEX attribute is required if the
+PAL_TYPE is "RANGEINDEX".&nbsp; Otherwise, the RANGE_INDEX attribute should
+be omitted. (Range index is denigrated.)</font></td>
+</tr>
+</table>
+<font size=-1>2.&nbsp; The minimum and maximum are optional.&nbsp; If not
+set, the range is assumed to the maximum range of the number type.&nbsp;
+If one of these attributes is set, then both should be set.&nbsp; The value
+of the minimum must be less than or equal to the value of the maximum.</font></dl>
+</dl>
+Table 5 summarized the uses of the standard attributes for a palette dataset.
+R means that the attribute listed on the leftmost column is Required for
+the palette type on the first row, O means that the attribute is Optional
+for that type and N that the attribute cannot be applied to that type.
+The four first rows show the attributes that are always required&nbsp;
+for the two palette types.
+<br>&nbsp;
+<br>&nbsp;
+<table BORDER WIDTH="100%" >
+<caption><b>Table 5. Applicability of Attributes</b></caption>
+
+<tr>
+<td WIDTH="33%"><b>PAL_TYPE</b></td>
+
+<td WIDTH="33%"><b>STANDARD8</b></td>
+
+<td WIDTH="34%"><b>RANGEINDEX</b></td>
+</tr>
+
+<tr>
+<td WIDTH="33%">CLASS</td>
+
+<td WIDTH="33%">R</td>
+
+<td WIDTH="34%">R</td>
+</tr>
+
+<tr>
+<td WIDTH="33%">PAL_VERSION</td>
+
+<td WIDTH="33%">R</td>
+
+<td WIDTH="34%">R</td>
+</tr>
+
+<tr>
+<td WIDTH="33%">PAL_COLORMODEL</td>
+
+<td WIDTH="33%">R</td>
+
+<td WIDTH="34%">R</td>
+</tr>
+
+<tr>
+<td WIDTH="33%">RANGE_INDEX</td>
+
+<td WIDTH="33%">N</td>
+
+<td WIDTH="34%">R</td>
+</tr>
+
+<tr>
+<td WIDTH="33%">PAL_MINMAXNUMERIC</td>
+
+<td WIDTH="33%">O</td>
+
+<td WIDTH="34%">O</td>
+</tr>
+</table>
+
+<h3>
+2.3. Storage Layout for Palettes</h3>
+The values of the Palette are stored as a dataset.&nbsp; The datatype can
+be any HDF 5 atomic numeric type.&nbsp; The dataset will have dimensions
+(<tt>nentries</tt>&nbsp; by&nbsp; <tt>ncomponents</tt>), where '<tt>nentries</tt>'
+is the number of colors (usually 256) and '<tt>ncomponents'</tt> is the
+number of values per color (3 for <b>RGB</b>, 4 for <b>CMYK</b>, etc.)
+<br>&nbsp;
+<h2>
+<a NAME="Sect3"></a>3.&nbsp; Consistency and Correlation of Image and Palette
+Attributes</h2>
+The objects in this specification are an extension to the base HDF5 specification
+and library.&nbsp; They are accessible with the standard HDF5 library,
+but the semantics of the objects are not enforced by the base library.&nbsp;
+For example, it is perfectly possible to add an attribute called <b>IMAGE</b>
+to <i>any</i> dataset, or to include an object reference to <i>any</i>
+HDF5 dataset in a <b>PALETTE</b> attribute.&nbsp; This would be a valid
+HDF5 file, but not conformant to this specification.&nbsp; The rules defined
+in this specification must be implemented with appropriate software, and
+applications must use conforming software to assure correctness.
+<p>The Image and Palette specifications include several redundant standard
+attributes, such as the <b>IMAGE_COLORMODEL</b> and the <b>PAL_COLORMODEL</b>.&nbsp;
+These attributes are informative not normative, in that it is acceptable
+to attach a Palette to an Image dataset even if their attributes do not
+match.&nbsp; Software is not required to enforce consistency, and files
+may contain mismatched associations of Images and Palettes.&nbsp; In all
+cases, it is up to applications to determine what kinds of images and color
+models can be supported.
+<p>For example, an Image that was created from a file with an "RGB" may
+have a "YUV" Palette in its <b>PALETTE</b> attribute array.&nbsp; This
+would be a legal HDF5 file and also conforms to this specification, although
+it may or may not be correct for a given application.</p>
+
+</body>
+</html>
diff --git a/doxygen/examples/PaletteExample1.gif b/doxygen/examples/PaletteExample1.gif
new file mode 100644
index 0000000..8694d9d
--- /dev/null
+++ b/doxygen/examples/PaletteExample1.gif
Binary files differ
diff --git a/doxygen/examples/Palettes.fm.anc.gif b/doxygen/examples/Palettes.fm.anc.gif
new file mode 100644
index 0000000..d344c03
--- /dev/null
+++ b/doxygen/examples/Palettes.fm.anc.gif
Binary files differ
diff --git a/doxygen/examples/TableSpec.html b/doxygen/examples/TableSpec.html
new file mode 100644
index 0000000..474176e
--- /dev/null
+++ b/doxygen/examples/TableSpec.html
@@ -0,0 +1,193 @@
+<html>
+<head>
+ <title>HDF5 Table Specification</title>
+</head>
+
+The HDF5 specification defines the standard objects and storage for the
+standard HDF5 objects. (For information about the HDF5 library, model and
+specification, see the HDF documentation.)&nbsp; This document is an additional
+specification do define a standard profile for how to store tables in HDF5.
+Table data in HDF5 is stored as HDF5 datasets with standard attributes to define
+the properties of the tables.
+
+<h2>
+1. Overview</h2>
+A generic table is a sequence of records, each record has a name and a type.
+Table data is stored as an HDF5 one dimensional compound dataset.&nbsp; A table
+is defined as a collection of records whose values are stored in fixed-length
+fields. All records have the same structure and all values in each field have
+the same data type.
+<p>The dataset for a table is distinguished from other datasets by giving
+it an attribute &quot;CLASS=TABLE&quot;.&nbsp;&nbsp;
+Optional attributes allow the storage of a title for the Table and for
+each column, and a fill value for each column.
+<h2>
+2.&nbsp; Table Attributes</h2>
+The attributes for the Table are strings.&nbsp;They are written with the <a href="RM_H5LT.html#H5LTset_attribute_string"><code>H5LTset_attribute_string</code></a>
+Lite API function.&nbsp; "Required" attributes must always be used. "Optional" attributes
+must be used when required.
+<br>&nbsp;
+<h4>
+Attributes</h4>
+
+<dl>
+<dt>
+Attribute name="<b>CLASS</b>" (Required)</dt>
+
+<dd>
+This attribute is type H5T_C_S1, with size 5.</dd>
+
+<dd>
+For all Tables, the value of this attribute is &quot;TABLE&quot;.</dd>
+
+<dd>
+This attribute identifies this data set as intended to be interpreted as Table that conforms to the specifications on this page.</dd>
+</dl>
+
+<dl>
+Attribute name="<b>VERSION</b>" (Required)
+
+<dd>
+This attribute is of type H5T_C_S1, with size corresponding to the length
+of the version string.&nbsp; This attribute identifies the version number
+of this specification to which it conforms.&nbsp; The current version number
+is &quot;0.2&quot;.</dd>
+
+</dl>
+
+<dl>
+<dt>
+Attribute name="<b>TITLE</b>" (Optional)</dt>
+
+<dd>
+The <b>TITLE</b> is an optional String that is to be used as the
+informative title of the whole table.
+The <b>TITLE</b> is set with the parameter <code> table_title</code> of the function
+<a href="RM_H5TB.html#H5TBmake_table"> <code> H5TBmake_table</code></a>.&nbsp;</dd>
+</dl>
+
+<dl>
+<dt>
+Attribute name="<b>FIELD_(n)_NAME</b>" (Required)</dt>
+
+<dd>
+The <b>FIELD_(n)_NAME</b> is an optional String that is to be used as the
+informative title of column <b>n</b> of the table.
+For each of the fields the word FIELD_ is concatenated with
+ the zero based field (n) index together with the name of the field.</dd>
+
+</dl>
+<dl>
+<dt>
+Attribute name="<b>FIELD_(n)_FILL</b>" (Optional)</dt>
+
+<dd>
+The <b>FIELD_(n)_FILL</b> is an optional String that is the fill value for
+column <b>n</b> of the table.
+For each of the fields the word FIELD_ is concatenated with
+ the zero based field (n) index together with the fill value, if present.
+This value is written only when a fill value is defined for the table.</dd>
+
+</dl>
+
+<dl>
+
+<br>&nbsp;
+<center><table BORDER=2 BGCOLOR="#FFFFFF" >
+<caption><b>Table 1. Attributes of an Image Dataset</b></caption>
+
+<tr>
+<td><b>Attribute Name</b></td>
+
+<td><b>(R = Required</b>
+<br><b>O= Optional)</b></td>
+
+<td><b>Type</b></td>
+
+<td><b>String Size</b></td>
+
+<td><b>Value</b></td>
+</tr>
+
+<tr>
+<td>CLASS</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>5</td>
+
+<td>&quot;TABLE&quot;</td>
+</tr>
+
+<tr>
+<td>VERSION</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>3</td>
+
+<td>&quot;0.2&quot;</td>
+</tr>
+
+<tr>
+<td>TITLE</td>
+
+<td>O</td>
+
+<td>String</td>
+
+<td>&nbsp;</td>
+
+<td>
+
+<tr>
+<td>FIELD_(n)_NAME</td>
+
+<td>R</td>
+
+<td>String</td>
+
+<td>&nbsp;</td>
+
+<td>
+&nbsp;
+
+<tr>
+<td>FIELD_(n)_FILL</td>
+
+<td>O*</td>
+
+<td>String</td>
+
+<td>&nbsp;</td>
+
+<td>
+&nbsp;
+</table>
+</center>
+
+ </dl>
+<p>
+<center>
+&nbsp;
+</center>
+<i>* </i>The attribute FIELD_(n)_FILL is written to the table if a fill value is
+specified on the creation of the Table. Otherwise, it is not.<p>The following
+section of code shows the calls necessary to the creation of a table.
+
+<p><code>/* Create a new HDF5 file using default properties. */<br>
+ file_id = H5Fcreate( &quot;my_table.h5&quot;, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT );</code> </p>
+
+<p><code>/* Call the make table function */<br>
+</code> <code>H5TBmake_table( "Table Title", file_id, "Table1", NFIELDS, NRECORDS, dst_size,&nbsp;<br>
+ field_names, dst_offset, field_type,&nbsp;<br>
+ chunk_size, fill_data, compress, p_data )&nbsp;</code> </p>
+
+<p><code> /* Close the file. */<br>
+ status = H5Fclose( file_id );</code> </p>
+
+</body>
diff --git a/doxygen/examples/ThreadSafeLibrary.html b/doxygen/examples/ThreadSafeLibrary.html
new file mode 100644
index 0000000..2ea42b4
--- /dev/null
+++ b/doxygen/examples/ThreadSafeLibrary.html
@@ -0,0 +1,787 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html lang="en-US">
+<head>
+ <title>Thread Safe Library</title>
+</head>
+
+<h1>1. Library header files and conditional compilation</h1>
+
+<p>
+The following code is placed at the beginning of H5private.h:
+</p>
+
+<blockquote>
+ <pre>
+ #ifdef H5_HAVE_THREADSAFE
+ #include &lt;pthread.h&gt;
+ #endif
+ </pre>
+</blockquote>
+
+<p>
+<code>H5_HAVE_THREADSAFE</code> is defined when the HDF-5 library is
+compiled with the --enable-threadsafe configuration option. In general,
+code for the non-threadsafe version of HDF-5 library are placed within
+the <code>#else</code> part of the conditional compilation. The exception
+to this rule are the changes to the <code>FUNC_ENTER</code> (in
+H5private.h), <code>HRETURN</code> and <code>HRETURN_ERROR</code> (in
+H5Eprivate.h) macros (see section 3.2).
+</p>
+
+
+<h1>2. Global variables/structures</h1>
+
+<h2>2.1 Global library initialization variable</h2>
+
+<p>
+In the threadsafe implementation, the global library initialization
+variable <code>H5_libinit_g</code> is changed to a global structure
+consisting of the variable with its associated lock (locks are explained
+in section 4.1):
+</p>
+
+<blockquote>
+ <pre>
+ hbool_t H5_libinit_g = FALSE;
+ </pre>
+</blockquote>
+
+<p>
+becomes
+</p>
+
+<blockquote>
+ <pre>
+ H5_api_t H5_g;
+ </pre>
+</blockquote>
+
+<p>
+where <code>H5_api_t</code> is
+</p>
+
+<blockquote>
+ <pre>
+ typedef struct H5_api_struct {
+ H5_mutex_t init_lock; /* API entrance mutex */
+ hbool_t H5_libinit_g;
+ } H5_api_t;
+ </pre>
+</blockquote>
+
+<p>
+All former references to <code>H5_libinit_g</code> in the library are now
+made using the macro <code>H5_INIT_GLOBAL</code>. If the threadsafe
+library is to be used, the macro is set to <code>H5_g.H5_libinit_g</code>
+instead.
+</p>
+
+<h2>2.2 Global serialization variable</h2>
+
+<p>
+A new global boolean variable <code>H5_allow_concurrent_g</code> is used
+to determine if multiple threads are allowed to an API call
+simultaneously. This is set to <code>FALSE</code>.
+</p>
+
+<p>
+All APIs that are allowed to do so have their own local variable that
+shadows the global variable and is set to <code>TRUE</code>. In phase 1,
+no such APIs exist.
+</p>
+
+<p>
+It is defined in <code>H5.c</code> as follows:
+</p>
+
+<blockquote>
+ <pre>
+ hbool_t H5_allow_concurrent_g = FALSE;
+ </pre>
+</blockquote>
+
+<h2>2.3 Global thread initialization variable</h2>
+
+<p>
+The global variable <code>H5_first_init_g</code> of type
+<code>pthread_once_t</code> is used to allow only the first thread in the
+application process to call an initialization function using
+<code>pthread_once</code>. All subsequent calls to
+<code>pthread_once</code> by any thread are disregarded.
+</p>
+
+<p>
+The call sets up the mutex in the global structure <code>H5_g</code> (see
+section 3.1) via an initialization function
+<code>H5_first_thread_init</code>. The first thread initialization
+function is described in section 4.2.
+</p>
+
+<p>
+<code>H5_first_init_g</code> is defined in <code>H5.c</code> as follows:
+</p>
+
+<blockquote>
+ <pre>
+ pthread_once_t H5_first_init_g = PTHREAD_ONCE_INIT;
+ </pre>
+</blockquote>
+
+<h2>2.4 Global key for per-thread error stacks</h2>
+
+<p>
+A global pthread-managed key <code>H5_errstk_key_g</code> is used to
+allow pthreads to maintain a separate error stack (of type
+<code>H5E_t</code>) for each thread. This is defined in <code>H5.c</code>
+as:
+</p>
+
+<blockquote>
+ <pre>
+ pthread_key_t H5_errstk_key_g;
+ </pre>
+</blockquote>
+
+<p>
+Error stack management is described in section 4.3.
+</p>
+
+<h2>2.5 Global structure and key for thread cancellation prevention</h2>
+
+<p>
+We need to preserve the thread cancellation status of each thread
+individually by using a key <code>H5_cancel_key_g</code>. The status is
+preserved using a structure (of type <code>H5_cancel_t</code>) which
+maintains the cancellability state of the thread before it entered the
+library and a count (which works very much like the recursive lock
+counter) which keeps track of the number of API calls the thread makes
+within the library.
+</p>
+
+<p>
+The structure is defined in <code>H5private.h</code> as:
+</p>
+
+<blockquote>
+ <pre>
+ /* cancelability structure */
+ typedef struct H5_cancel_struct {
+ int previous_state;
+ unsigned int cancel_count;
+ } H5_cancel_t;
+ </pre>
+</blockquote>
+
+<p>
+Thread cancellation is described in section 4.4.
+</p>
+
+
+<h1>3. Changes to Macro expansions</h1>
+
+<h2>3.1 Changes to FUNC_ENTER</h2>
+
+<p>
+The <code>FUNC_ENTER</code> macro is now extended to include macro calls
+to initialize first threads, disable cancellability and wraps a lock
+operation around the checking of the global initialization flag. It
+should be noted that the cancellability should be disabled before
+acquiring the lock on the library. Doing so otherwise would allow the
+possibility that the thread be cancelled just after it has acquired the
+lock on the library and in that scenario, if the cleanup routines are not
+properly set, the library would be permanently locked out.
+</p>
+
+<p>
+The additional macro code and new macro definitions can be found in
+Appendix E.1 to E.5. The changes are made in <code>H5private.h</code>.
+</p>
+
+<h2>3.2 Changes to HRETURN and HRETURN_ERROR</h2>
+
+<p>
+The <code>HRETURN</code> and <code>HRETURN_ERROR</code> macros are the
+counterparts to the <code>FUNC_ENTER</code> macro described in section
+3.1. <code>FUNC_LEAVE</code> makes a macro call to <code>HRETURN</code>,
+so it is also covered here.
+</p>
+
+<p>
+The basic changes to these two macros involve adding macro calls to call
+an unlock operation and re-enable cancellability if necessary. It should
+be noted that the cancellability should be re-enabled only after the
+thread has released the lock to the library. The consequence of doing
+otherwise would be similar to that described in section 3.1.
+</p>
+
+<p>
+The additional macro code and new macro definitions can be found in
+Appendix E.9 to E.9. The changes are made in <code>H5Eprivate.h</code>.
+</p>
+
+<h1>4. Implementation of threadsafe functionality</h1>
+
+<h2>4.1 Recursive Locks</h2>
+
+<p>
+A recursive mutex lock m allows a thread t1 to successfully lock m more
+than once without blocking t1. Another thread t2 will block if t2 tries
+to lock m while t1 holds the lock to m. If t1 makes k lock calls on m,
+then it also needs to make k unlock calls on m before it releases the
+lock.
+</p>
+
+<p>
+Our implementation of recursive locks is built on top of a pthread mutex
+lock (which is not recursive). It makes use of a pthread condition
+variable to have unsuccessful threads wait on the mutex. Waiting threads
+are awaken by a signal from the final unlock call made by the thread
+holding the lock.
+</p>
+
+<p>
+Recursive locks are defined to be the following type
+(<code>H5private.h</code>):
+</p>
+
+<blockquote>
+ <pre>
+ typedef struct H5_mutex_struct {
+ pthread_t owner_thread; /* current lock owner */
+ pthread_mutex_t atomic_lock; /* lock for atomicity of new mechanism */
+ pthread_cond_t cond_var; /* condition variable */
+ unsigned int lock_count;
+ } H5_mutex_t;
+ </pre>
+</blockquote>
+
+<p>
+Detailed implementation code can be found in Appendix A. The
+implementation changes are made in <code>H5TS.c</code>.
+</p>
+
+<h2>4.2 First thread initialization</h2>
+
+<p>
+Because the mutex lock associated with a recursive lock cannot be
+statically initialized, a mechanism is required to initialize the
+recursive lock associated with <code>H5_g</code> so that it can be used
+for the first time.
+</p>
+
+<p>
+The pthreads library allows this through the pthread_once call which as
+described in section 3.3 allows only the first thread accessing the
+library in an application to initialize <code>H5_g</code>.
+</p>
+
+<p>
+In addition to initializing <code>H5_g</code>, it also initializes the
+key (see section 3.4) for use with per-thread error stacks (see section
+4.3).
+</p>
+
+<p>
+The first thread initialization mechanism is implemented as the function
+call <code>H5_first_thread_init()</code> in <code>H5TS.c</code>. This is
+described in appendix B.
+</p>
+
+<h2>4.3 Per-thread error stack management</h2>
+
+<p>
+Pthreads allows individual threads to access dynamic and persistent
+per-thread data through the use of keys. Each key is associated with
+a table that maps threads to data items. Keys can be initialized by
+<code>pthread_key_create()</code> in pthreads (see sections 3.4 and 4.2).
+Per-thread data items are accessed using a key through the
+<code>pthread_getspecific()</code> and <code>pthread_setspecific()</code>
+calls to read and write to the association table respectively.
+</p>
+
+<p>
+Per-thread error stacks are accessed through the key
+<code>H5_errstk_key_g</code> which is initialized by the first thread
+initialization call (see section 4.2).
+</p>
+
+<p>
+In the non-threadsafe version of the library, there is a global stack
+variable <code>H5E_stack_g[1]</code> which is no longer defined in the
+threadsafe version. At the same time, the macro call to gain access to
+the error stack <code>H5E_get_my_stack</code> is changed from:
+</p>
+
+<blockquote>
+ <pre>
+ #define H5E_get_my_stack() (H5E_stack_g+0)
+ </pre>
+</blockquote>
+
+<p>
+to:
+</p>
+
+<blockquote>
+ <pre>
+ #define H5E_get_my_stack() H5E_get_stack()
+ </pre>
+</blockquote>
+
+<p>
+where <code>H5E_get_stack()</code> is a surrogate function that does the
+following operations:
+</p>
+
+<ol>
+ <li>if a thread is attempting to get an error stack for the first
+ time, the error stack is dynamically allocated for the thread and
+ associated with <code>H5_errstk_key_g</code> using
+ <code>pthread_setspecific()</code>. The way we detect if it is the
+ first time is through <code>pthread_getspecific()</code> which
+ returns <code>NULL</code> if no previous value is associated with
+ the thread using the key.</li>
+
+ <li>if <code>pthread_getspecific()</code> returns a non-null value,
+ then that is the pointer to the error stack associated with the
+ thread and the stack can be used as usual.</li>
+</ol>
+
+<p>
+A final change to the error reporting routines is as follows; the current
+implementation reports errors to always be detected at thread 0. In the
+threadsafe implementation, this is changed to report the number returned
+by a call to <code>pthread_self()</code>.
+</p>
+
+<p>
+The change in code (reflected in <code>H5Eprint</code> of file
+<code>H5E.c</code>) is as follows:
+</p>
+
+<blockquote>
+ <pre>
+ #ifdef H5_HAVE_THREADSAFE
+ fprintf (stream, "HDF5-DIAG: Error detected in thread %d."
+ ,pthread_self());
+ #else
+ fprintf (stream, "HDF5-DIAG: Error detected in thread 0.");
+ #endif
+ </pre>
+</blockquote>
+
+<p>
+Code for <code>H5E_get_stack()</code> can be found in Appendix C. All the
+above changes were made in <code>H5E.c</code>.
+</p>
+
+<h2>4.4 Thread Cancellation safety</h2>
+
+<p>
+To prevent thread cancellations from killing a thread while it is in the
+library, we maintain per-thread information about the cancellability
+status of the thread before it entered the library so that we can restore
+that same status when the thread leaves the library.
+</p>
+
+<p>
+By <i>enter</i> and <i>leave</i> the library, we mean the points when a
+thread makes an API call from a user application and the time that API
+call returns. Other API or callback function calls made from within that
+API call are considered <i>within</i> the library.
+</p>
+
+<p>
+Because other API calls may be made from within the first API call, we
+need to maintain a counter to determine which was the first and
+correspondingly the last return.
+</p>
+
+<p>
+When a thread makes an API call, the macro <code>H5_API_SET_CANCEL</code>
+calls the worker function <code>H5_cancel_count_inc()</code> which does
+the following:
+</p>
+
+<ol>
+ <li>if this is the first time the thread has entered the library,
+ a new cancellability structure needs to be assigned to it.</li>
+ <li>if the thread is already within the library when the API call is
+ made, then cancel_count is simply incremented. Otherwise, we set
+ the cancellability state to <code>PTHREAD_CANCEL_DISABLE</code>
+ while storing the previous state into the cancellability structure.
+ <code>cancel_count</code> is also incremented in this case.</li>
+</ol>
+
+<p>
+When a thread leaves an API call, the macro
+<code>H5_API_UNSET_CANCEL</code> calls the worker function
+<code>H5_cancel_count_dec()</code> which does the following:
+</p>
+
+<ol>
+ <li>if <code>cancel_count</code> is greater than 1, indicating that the
+ thread is not yet about to leave the library, then
+ <code>cancel_count</code> is simply decremented.</li>
+ <li>otherwise, we reset the cancellability state back to its original
+ state before it entered the library and decrement the count (back
+ to zero).</li>
+</ol>
+
+<p>
+<code>H5_cancel_count_inc</code> and <code>H5_cancel_count_dec</code> are
+described in Appendix D and may be found in <code>H5TS.c</code>.
+</p>
+
+<h1>5. Test programs</h1>
+
+<p>
+Except where stated, all tests involve 16 simultaneous threads that make
+use of HDF-5 API calls without any explicit synchronization typically
+required in a non-threadsafe environment.
+</p>
+
+<h2>5.1 Data set create and write</h2>
+
+<p>
+The test program sets up 16 threads to simultaneously create 16
+different datasets named from <i>zero</i> to <i>fifteen</i> for a single
+file and then writing an integer value into that dataset equal to the
+dataset's named value.
+</p>
+
+<p>
+The main thread would join with all 16 threads and attempt to match the
+resulting HDF-5 file with expected results - that each dataset contains
+the correct value (0 for <i>zero</i>, 1 for <i>one</i> etc ...) and all
+datasets were correctly created.
+</p>
+
+<p>
+The test is implemented in the file <code>ttsafe_dcreate.c</code>.
+</p>
+
+<h2>5.2 Test on error stack</h2>
+
+<p>
+The error stack test is one in which 16 threads simultaneously try to
+create datasets with the same name. The result, when properly serialized,
+should be equivalent to 16 attempts to create the dataset with the same
+name.
+</p>
+
+<p>
+The error stack implementation runs correctly if it reports 15 instances
+of the dataset name conflict error and finally generates a correct HDF-5
+containing that single dataset. Each thread should report its own stack
+of errors with a thread number associated with it.
+</p>
+
+<p>
+The test is implemented in the file <code>ttsafe_error.c</code>.
+</p>
+
+<h2>5.3 Test on cancellation safety</h2>
+
+<p>
+The main idea in thread cancellation safety is as follows; a child thread
+is spawned to create and write to a dataset. Following that, it makes a
+<code>H5Diterate</code> call on that dataset which activates a callback
+function.
+</p>
+
+<p>
+A deliberate barrier is invoked at the callback function which waits for
+both the main and child thread to arrive at that point. After that
+happens, the main thread proceeds to make a thread cancel call on the
+child thread while the latter sleeps for 3 seconds before proceeding to
+write a new value to the dataset.
+</p>
+
+<p>
+After the iterate call, the child thread logically proceeds to wait
+another 3 seconds before writing another newer value to the dataset.
+</p>
+
+<p>
+The test is correct if the main thread manages to read the second value
+at the end of the test. This means that cancellation did not take place
+until the end of the iteration call despite of the 3 second wait within
+the iteration callback and the extra dataset write operation.
+Furthermore, the cancellation should occur before the child can proceed
+to write the last value into the dataset.
+</p>
+
+<h2>5.4 Test on attribute creation</h2>
+
+<p>
+A main thread makes 16 threaded calls to <code>H5Acreate</code> with a
+generated name for each attribute. Sixteen attributes should be created
+for the single dataset in random (chronological) order and receive values
+depending on its generated attribute name (e.g. <i>attrib010</i> would
+receive the value 10).
+</p>
+
+<p>
+After joining with all child threads, the main thread proceeds to read
+each attribute by generated name to see if the value tallies. Failure is
+detected if the attribute name does not exist (meaning they were never
+created) or if the wrong values were read back.
+</p>
+
+<h1>A. Recursive Lock implementation code</h1>
+
+<blockquote>
+ <pre>
+ void H5_mutex_init(H5_mutex_t *H5_mutex)
+ {
+ H5_mutex-&gt;owner_thread = NULL;
+ pthread_mutex_init(&amp;H5_mutex-&gt;atomic_lock, NULL);
+ pthread_cond_init(&amp;H5_mutex-&gt;cond_var, NULL);
+ H5_mutex-&gt;lock_count = 0;
+ }
+
+ void H5_mutex_lock(H5_mutex_t *H5_mutex)
+ {
+ pthread_mutex_lock(&amp;H5_mutex-&gt;atomic_lock);
+
+ if (pthread_equal(pthread_self(), H5_mutex-&gt;owner_thread)) {
+ /* already owned by self - increment count */
+ H5_mutex-&gt;lock_count++;
+ } else {
+ if (H5_mutex-&gt;owner_thread == NULL) {
+ /* no one else has locked it - set owner and grab lock */
+ H5_mutex-&gt;owner_thread = pthread_self();
+ H5_mutex-&gt;lock_count = 1;
+ } else {
+ /* if already locked by someone else */
+ while (1) {
+ pthread_cond_wait(&amp;H5_mutex-&gt;cond_var, &amp;H5_mutex-&gt;atomic_lock);
+
+ if (H5_mutex-&gt;owner_thread == NULL) {
+ H5_mutex-&gt;owner_thread = pthread_self();
+ H5_mutex-&gt;lock_count = 1;
+ break;
+ } /* else do nothing and loop back to wait on condition*/
+ }
+ }
+ }
+
+ pthread_mutex_unlock(&amp;H5_mutex-&gt;atomic_lock);
+ }
+
+ void H5_mutex_unlock(H5_mutex_t *H5_mutex)
+ {
+ pthread_mutex_lock(&amp;H5_mutex-&gt;atomic_lock);
+ H5_mutex-&gt;lock_count--;
+
+ if (H5_mutex-&gt;lock_count == 0) {
+ H5_mutex-&gt;owner_thread = NULL;
+ pthread_cond_signal(&amp;H5_mutex-&gt;cond_var);
+ }
+ pthread_mutex_unlock(&amp;H5_mutex-&gt;atomic_lock);
+ }
+ </pre>
+</blockquote>
+
+<h1>B. First thread initialization</h1>
+
+<blockquote>
+ <pre>
+ void H5_first_thread_init(void)
+ {
+ /* initialize global API mutex lock */
+ H5_g.H5_libinit_g = FALSE;
+ H5_g.init_lock.owner_thread = NULL;
+ pthread_mutex_init(&amp;H5_g.init_lock.atomic_lock, NULL);
+ pthread_cond_init(&amp;H5_g.init_lock.cond_var, NULL);
+ H5_g.init_lock.lock_count = 0;
+
+ /* initialize key for thread-specific error stacks */
+ pthread_key_create(&amp;H5_errstk_key_g, NULL);
+
+ /* initialize key for thread cancellability mechanism */
+ pthread_key_create(&amp;H5_cancel_key_g, NULL);
+ }
+ </pre>
+</blockquote>
+
+
+<h1>C. Per-thread error stack acquisition</h1>
+
+<blockquote>
+ <pre>
+ H5E_t *H5E_get_stack(void)
+ {
+ H5E_t *estack;
+
+ if (estack = pthread_getspecific(H5_errstk_key_g)) {
+ return estack;
+ } else {
+ /* no associated value with current thread - create one */
+ estack = (H5E_t *)malloc(sizeof(H5E_t));
+ pthread_setspecific(H5_errstk_key_g, (void *)estack);
+ return estack;
+ }
+ }
+ </pre>
+</blockquote>
+
+<h1>D. Thread cancellation mechanisms</h1>
+
+<blockquote>
+ <pre>
+ void H5_cancel_count_inc(void)
+ {
+ H5_cancel_t *cancel_counter;
+
+ if (cancel_counter = pthread_getspecific(H5_cancel_key_g)) {
+ /* do nothing here */
+ } else {
+ /*
+ * first time thread calls library - create new counter and
+ * associate with key
+ */
+ cancel_counter = (H5_cancel_t *)malloc(sizeof(H5_cancel_t));
+ cancel_counter-&gt;cancel_count = 0;
+ pthread_setspecific(H5_cancel_key_g, (void *)cancel_counter);
+ }
+
+ if (cancel_counter-&gt;cancel_count == 0) {
+ /* thread entering library */
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,
+ &amp;(cancel_counter-&gt;previous_state));
+ }
+
+ cancel_counter-&gt;cancel_count++;
+ }
+
+ void H5_cancel_count_dec(void)
+ {
+ H5_cancel_t *cancel_counter = pthread_getspecific(H5_cancel_key_g);
+
+ if (cancel_counter-&gt;cancel_count == 1)
+ pthread_setcancelstate(cancel_counter-&gt;previous_state, NULL);
+
+ cancel_counter-&gt;cancel_count--;
+ }
+ </pre>
+</blockquote>
+
+<h1>E. Macro expansion codes</h1>
+
+<h2>E.1 <code>FUNC_ENTER</code></h2>
+
+<blockquote>
+ <pre>
+ /* Initialize the library */ \
+ H5_FIRST_THREAD_INIT \
+ H5_API_UNSET_CANCEL \
+ H5_API_LOCK_BEGIN \
+ if (!(H5_INIT_GLOBAL)) { \
+ H5_INIT_GLOBAL = TRUE; \
+ if (H5_init_library() &lt; 0) { \
+ HRETURN_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
+ "library initialization failed"); \
+ } \
+ } \
+ H5_API_LOCK_END \
+ :
+ :
+ :
+ </pre>
+</blockquote>
+
+<h2>E.2 <code>H5_FIRST_THREAD_INIT</code></h2>
+
+<blockquote>
+ <pre>
+ /* Macro for first thread initialization */
+ #define H5_FIRST_THREAD_INIT \
+ pthread_once(&amp;H5_first_init_g, H5_first_thread_init);
+ </pre>
+</blockquote>
+
+
+<h2>E.3 <code>H5_API_UNSET_CANCEL</code></h2>
+
+<blockquote>
+ <pre>
+ #define H5_API_UNSET_CANCEL \
+ if (H5_IS_API(__func__)) { \
+ H5_cancel_count_inc(); \
+ }
+ </pre>
+</blockquote>
+
+
+<h2>E.4 <code>H5_API_LOCK_BEGIN</code></h2>
+
+<blockquote>
+ <pre>
+ #define H5_API_LOCK_BEGIN \
+ if (H5_IS_API(__func__)) { \
+ H5_mutex_lock(&amp;H5_g.init_lock);
+ </pre>
+</blockquote>
+
+
+<h2>E.5 <code>H5_API_LOCK_END</code></h2>
+
+<blockquote>
+ <pre>
+ #define H5_API_LOCK_END }
+ </pre>
+</blockquote>
+
+
+<h2>E.6 <code>HRETURN</code> and <code>HRETURN_ERROR</code></h2>
+
+<blockquote>
+ <pre>
+ :
+ :
+ H5_API_UNLOCK_BEGIN \
+ H5_API_UNLOCK_END \
+ H5_API_SET_CANCEL \
+ return ret_val; \
+ }
+ </pre>
+</blockquote>
+
+<h2>E.7 <code>H5_API_UNLOCK_BEGIN</code></h2>
+
+<blockquote>
+ <pre>
+ #define H5_API_UNLOCK_BEGIN \
+ if (H5_IS_API(__func__)) { \
+ H5_mutex_unlock(&amp;H5_g.init_lock);
+ </pre>
+</blockquote>
+
+<h2>E.8 <code>H5_API_UNLOCK_END</code></h2>
+
+<blockquote>
+ <pre>
+ #define H5_API_UNLOCK_END }
+ </pre>
+</blockquote>
+
+
+<h2>E.9 <code>H5_API_SET_CANCEL</code></h2>
+
+<blockquote>
+ <pre>
+ #define H5_API_SET_CANCEL \
+ if (H5_IS_API(__func__)) { \
+ H5_cancel_count_dec(); \
+ }
+ </pre>
+</blockquote>
+
+<h2>By Chee Wai Lee</h2>
+<h4>By Bill Wendling</h4>
+
+</body>
+</html>
diff --git a/doxygen/examples/VFL.html b/doxygen/examples/VFL.html
new file mode 100644
index 0000000..9776f96
--- /dev/null
+++ b/doxygen/examples/VFL.html
@@ -0,0 +1,1601 @@
+<HTML>
+<HEAD>
+<!-- This HTML file has been created by texi2html 1.51
+ from VFL.texi on 18 November 1999 -->
+
+<TITLE>HDF5 Virtual File Layer</TITLE>
+</HEAD>
+
+
+<!--
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ -->
+
+
+<BODY>
+
+<strong>Revision History</strong>
+<p>Initial document, 18 November 1999.</p>
+
+<p>Updated on 10/24/00, Quincey Koziol</p>
+
+<p>Added the section &ldquo;Programming Note for C++ Developers Using C
+Functions,&rdquo; 08/23/2012, Mark Evans
+
+
+
+<P>
+<P><HR><P>
+<H1>Table of Contents</H1>
+<UL>
+<LI><A NAME="TOC1" HREF="#SEC1">Introduction</A>
+<LI><A NAME="TOC2" HREF="#SEC2">Using a File Driver</A>
+<UL>
+<LI><A NAME="TOC3" HREF="#SEC3">Driver Header Files</A>
+<LI><A NAME="TOC4" HREF="#SEC4">Creating and Opening Files</A>
+<LI><A NAME="TOC5" HREF="#SEC5">Performing I/O</A>
+<LI><A NAME="TOC6" HREF="#SEC6">File Driver Interchangeability</A>
+</UL>
+<LI><A NAME="TOC7" HREF="#SEC7">Implementation of a Driver</A>
+<UL>
+<LI><A NAME="TOC8" HREF="#SEC8">Mode Functions</A>
+<LI><A NAME="TOC9" HREF="#SEC9">File Functions</A>
+<UL>
+<LI><A NAME="TOC10" HREF="#SEC10">Opening Files</A>
+<LI><A NAME="TOC11" HREF="#SEC11">Closing Files</A>
+<LI><A NAME="TOC12" HREF="#SEC12">File Keys</A>
+<LI><A NAME="TOC13" HREF="#SEC13">Saving Modes Across Opens</A>
+</UL>
+<LI><A NAME="TOC14" HREF="#SEC14">Address Space Functions</A>
+<UL>
+<LI><A NAME="TOC15" HREF="#SEC15">Userblock and Superblock</A>
+<LI><A NAME="TOC16" HREF="#SEC16">Allocation of Format Regions</A>
+<LI><A NAME="TOC17" HREF="#SEC17">Freeing Format Regions</A>
+<LI><A NAME="TOC18" HREF="#SEC18">Querying Address Range</A>
+</UL>
+<LI><A NAME="TOC19" HREF="#SEC19">Data Functions</A>
+<UL>
+<LI><A NAME="TOC20" HREF="#SEC20">Contiguous I/O Functions</A>
+<LI><A NAME="TOC21" HREF="#SEC21">Flushing Cached Data</A>
+</UL>
+<LI><A NAME="TOC22" HREF="#SEC22">Optimization Functions</A>
+<LI><A NAME="TOC23" HREF="#SEC23">Registration of a Driver</A>
+ <ul>
+ <li><a name="TOCProgNote" href="#SECProgNote">
+ Programming Note for C++ Developers Using C Functions</a>
+ </li>
+ </ul>
+<LI><A NAME="TOC24" HREF="#SEC24">Querying Driver Information</A>
+</UL>
+<LI><A NAME="TOC25" HREF="#SEC25">Miscellaneous</A>
+</UL>
+<P><HR><P>
+
+
+<H1><A NAME="SEC1" HREF="#TOC1">Introduction</A></H1>
+
+<P>
+The HDF5 file format describes how HDF5 data structures and dataset raw
+data are mapped to a linear <STRONG>format address space</STRONG> and the HDF5
+library implements that bidirectional mapping in terms of an
+API. However, the HDF5 format specifications do <EM>not</EM> indicate how
+the format address space is mapped onto storage and HDF (version 5 and
+earlier) simply mapped the format address space directly onto a single
+file by convention.
+
+</P>
+<P>
+Since early versions of HDF5 it became apparent that users want the ability to
+map the format address space onto different types of storage (a single file,
+multiple files, local memory, global memory, network distributed global
+memory, a network protocol, <I>etc</I>.) with various types of maps. For
+instance, some users want to be able to handle very large format address
+spaces on operating systems that support only 2GB files by partitioning the
+format address space into equal-sized parts each served by a separate
+file. Other users want the same multi-file storage capability but want to
+partition the address space according to purpose (raw data in one file, object
+headers in another, global heap in a third, <I>etc.</I>) in order to improve I/O
+speeds.
+
+</P>
+<P>
+In fact, the number of storage variations is probably larger than the
+number of methods that the HDF5 team is capable of implementing and
+supporting. Therefore, a <STRONG>Virtual File Layer</STRONG> API is being
+implemented which will allow application teams or departments to design
+and implement their own mapping between the HDF5 format address space
+and storage, with each mapping being a separate <STRONG>file driver</STRONG>
+(possibly written in terms of other file drivers). The HDF5 team will
+provide a small set of useful file drivers which will also serve as
+examples for those who which to write their own:
+
+</P>
+<DL COMPACT>
+
+<DT><CODE>H5FD_SEC2</CODE>
+<DD>
+This is the default driver which uses Posix file-system functions like
+<CODE>read</CODE> and <CODE>write</CODE> to perform I/O to a single file. All I/O
+requests are unbuffered although the driver does optimize file seeking
+operations to some extent.
+
+<DT><CODE>H5FD_STDIO</CODE>
+<DD>
+This driver uses functions from <TT>`stdio.h'</TT> to perform buffered I/O
+to a single file.
+
+<DT><CODE>H5FD_CORE</CODE>
+<DD>
+This driver performs I/O directly to memory and can be used to create small
+temporary files that never exist on permanent storage. This type of storage is
+generally very fast since the I/O consists only of memory-to-memory copy
+operations.
+
+<DT><CODE>H5FD_MPIIO</CODE>
+<DD>
+This is the driver of choice for accessing files in parallel using MPI and
+MPI-IO. It is only predefined if the library is compiled with parallel I/O
+support.
+
+<DT><CODE>H5FD_FAMILY</CODE>
+<DD>
+Large format address spaces are partitioned into more manageable pieces and
+sent to separate storage locations using an underlying driver of the user's
+choice. The <CODE>h5repart</CODE> tool can be used to change the sizes of the
+family members when stored as files or to convert a family of files to a
+single file or vice versa.
+
+<DT><CODE>H5FD_SPLIT</CODE>
+<DD>
+The format address space is split into meta data and raw data and each is
+mapped onto separate storage using underlying drivers of the user's
+choice. The meta data storage can be read by itself (for limited
+functionality) or both files can be accessed together.
+</DL>
+
+
+
+<H1><A NAME="SEC2" HREF="#TOC2">Using a File Driver</A></H1>
+
+<P>
+Most application writers will use a driver defined by the HDF5 library or
+contributed by another programming team. This chapter describes how existing
+drivers are used.
+
+</P>
+
+
+
+<H2><A NAME="SEC3" HREF="#TOC3">Driver Header Files</A></H2>
+
+<P>
+Each file driver is defined in its own public header file which should
+be included by any application which plans to use that driver. The
+predefined drivers are in header files whose names begin with
+<SAMP>`H5FD'</SAMP> followed by the driver name and <SAMP>`.h'</SAMP>. The <TT>`hdf5.h'</TT>
+header file includes all the predefined driver header files.
+
+</P>
+<P>
+Once the appropriate header file is included a symbol of the form
+<SAMP>`H5FD_'</SAMP> followed by the upper-case driver name will be the driver
+identification number.<A NAME="DOCF1" HREF="#FOOT1">(1)</A> However, the
+value may change if the library is closed (<I>e.g.</I>, by calling
+<CODE>H5close</CODE>) and the symbol is referenced again.
+
+</P>
+
+
+<H2><A NAME="SEC4" HREF="#TOC4">Creating and Opening Files</A></H2>
+
+<P>
+In order to create or open a file one must define the method by which the
+storage is accessed<A NAME="DOCF2" HREF="#FOOT2">(2)</A> and does so by creating a file access property list<A NAME="DOCF3" HREF="#FOOT3">(3)</A> which is passed to the <CODE>H5Fcreate</CODE> or
+<CODE>H5Fopen</CODE> function. A default file access property list is created by
+calling <CODE>H5Pcreate</CODE> and then the file driver information is inserted by
+calling a driver initialization function such as <CODE>H5Pset_fapl_family</CODE>:
+
+</P>
+
+<PRE>
+hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
+size_t member_size = 100*1024*1024; /*100MB*/
+H5Pset_fapl_family(fapl, member_size, H5P_DEFAULT);
+hid_t file = H5Fcreate("foo%05d.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+H5Pclose(fapl);
+</PRE>
+
+<P>
+Each file driver will have its own initialization function
+whose name is <CODE>H5Pset_fapl_</CODE> followed by the driver name and which
+takes a file access property list as the first argument followed by
+additional driver-dependent arguments.
+
+</P>
+<P>
+An alternative to using the driver initialization function is to set the
+driver directly using the <CODE>H5Pset_driver</CODE> function.<A NAME="DOCF4" HREF="#FOOT4">(4)</A> Its second argument is the file driver identifier, which may
+have a different numeric value from run to run depending on the order in which
+the file drivers are registered with the library. The third argument
+encapsulates the additional arguments of the driver initialization
+function. This method only works if the file driver writer has made the
+driver-specific property list structure a public datatype, which is
+often not the case.
+
+</P>
+
+<PRE>
+hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
+static H5FD_family_fapl_t fa = {100*1024*1024, H5P_DEFAULT};
+H5Pset_driver(fapl, H5FD_FAMILY, &#38;fa);
+hid_t file = H5Fcreate("foo.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+H5Pclose(fapl);
+</PRE>
+
+<P>
+It is also possible to query the file driver information from a file access
+property list by calling <CODE>H5Pget_driver</CODE> to determine the driver and then
+calling a driver-defined query function to obtain the driver information:
+
+</P>
+
+<PRE>
+hid_t driver = H5Pget_driver(fapl);
+if (H5FD_SEC2==driver) {
+ /*nothing further to get*/
+} else if (H5FD_FAMILY==driver) {
+ hid_t member_fapl;
+ haddr_t member_size;
+ H5Pget_fapl_family(fapl, &#38;member_size, &#38;member_fapl);
+} else if (....) {
+ ....
+}
+</PRE>
+
+
+
+<H2><A NAME="SEC5" HREF="#TOC5">Performing I/O</A></H2>
+
+<P>
+The <CODE>H5Dread</CODE> and <CODE>H5Dwrite</CODE> functions transfer data between
+application memory and the file. They both take an optional data transfer
+property list which has some general driver-independent properties and
+optional driver-defined properties. An application will typically perform I/O
+in one of three styles via the <CODE>H5Dread</CODE> or <CODE>H5Dwrite</CODE> function:
+
+</P>
+<P>
+Like file access properties in the previous section, data transfer properties
+can be set using a driver initialization function or a general purpose
+function. For example, to set the MPI-IO driver to use independent access for
+I/O operations one would say:
+
+</P>
+
+<PRE>
+hid_t dxpl = H5Pcreate(H5P_DATA_XFER);
+H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_INDEPENDENT);
+H5Dread(dataset, type, mspace, fspace, buffer, dxpl);
+H5Pclose(dxpl);
+</PRE>
+
+<P>
+The alternative is to initialize a driver defined C <CODE>struct</CODE> and pass it
+to the <CODE>H5Pset_driver</CODE> function:
+
+</P>
+
+<PRE>
+hid_t dxpl = H5Pcreate(H5P_DATA_XFER);
+static H5FD_mpio_dxpl_t dx = {H5FD_MPIO_INDEPENDENT};
+H5Pset_driver(dxpl, H5FD_MPIO, &#38;dx);
+H5Dread(dataset, type, mspace, fspace, buffer, dxpl);
+</PRE>
+
+<P>
+The transfer propery list can be queried in a manner similar to the file
+access property list: the driver provides a function (or functions) to return
+various information about the transfer property list:
+
+</P>
+
+<PRE>
+hid_t driver = H5Pget_driver(dxpl);
+if (H5FD_MPIO==driver) {
+ H5FD_mpio_xfer_t xfer_mode;
+ H5Pget_dxpl_mpio(dxpl, &#38;xfer_mode);
+} else {
+ ....
+}
+</PRE>
+
+
+
+<H2><A NAME="SEC6" HREF="#TOC6">File Driver Interchangeability</A></H2>
+
+<P>
+The HDF5 specifications describe two things: the mapping of data onto a linear
+<STRONG>format address space</STRONG> and the C API which performs the mapping.
+However, the mapping of the format address space onto storage intentionally
+falls outside the scope of the HDF5 specs. This is a direct result of the fact
+that it is not generally possible to store information about how to access
+storage inside the storage itself. For instance, given only the file name
+<TT>`/arborea/1225/work/f%03d'</TT> the HDF5 library is unable to tell whether the
+name refers to a file on the local file system, a family of files on the local
+file system, a file on host <SAMP>`arborea'</SAMP> port 1225, a family of files on a
+remote system, <I>etc</I>.
+
+</P>
+<P>
+Two ways which library could figure out where the storage is located are:
+storage access information can be provided by the user, or the library can try
+all known file access methods. This implementation uses the former method.
+
+</P>
+<P>
+In general, if a file was created with one driver then it isn't possible to
+open it with another driver. There are of course exceptions: a file created
+with MPIO could probably be opened with the sec2 driver, any file created
+by the sec2 driver could be opened as a family of files with one member,
+<I>etc</I>. In fact, sometimes a file must not only be opened with the same
+driver but also with the same driver properties. The predefined drivers are
+written in such a way that specifying the correct driver is sufficient for
+opening a file.
+
+</P>
+
+
+<H1><A NAME="SEC7" HREF="#TOC7">Implementation of a Driver</A></H1>
+
+<P>
+A driver is simply a collection of functions and data structures which are
+registered with the HDF5 library at runtime. The functions fall into these
+categories:
+
+</P>
+
+<UL>
+<LI>Functions which operate on modes
+
+<LI>Functions which operate on files
+
+<LI>Functions which operate on the address space
+
+<LI>Functions which operate on data
+
+<LI>Functions for driver initialization
+
+<LI>Optimization functions
+
+</UL>
+
+
+
+<H2><A NAME="SEC8" HREF="#TOC8">Mode Functions</A></H2>
+
+<P>
+Some drivers need information about file access and data transfers which are
+very specific to the driver. The information is usually implemented as a pair
+of pointers to C structs which are allocated and initialized as part of an
+HDF5 property list and passed down to various driver functions. There are two
+classes of settings: file access modes that describe how to access the file
+through the driver, and data transfer modes which are settings that control
+I/O operations. Each file opened by a particular driver may have a different
+access mode; each dataset I/O request for a particular file may have a
+different data transfer mode.
+
+</P>
+<P>
+Since each driver has its own particular requirements for various settings,
+each driver is responsible for defining the mode structures that it
+needs. Higher layers of the library treat the structures as opaque but must be
+able to copy and free them. Thus, the driver provides either the size of the
+structure or a pair of function pointers for each of the mode types.
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The family driver needs to know how the format address
+space is partitioned and the file access property list to use for the
+family members.
+
+</P>
+
+<PRE>
+/* Driver-specific file access properties */
+typedef struct H5FD_family_fapl_t {
+ hsize_t memb_size; /*size of each member */
+ hid_t memb_fapl_id; /*file access property list of each memb*/
+} H5FD_family_fapl_t;
+
+/* Driver specific data transfer properties */
+typedef struct H5FD_family_dxpl_t {
+ hid_t memb_dxpl_id; /*data xfer property list of each memb */
+} H5FD_family_dxpl_t;
+</PRE>
+
+<P>
+In order to copy or free one of these structures the member file access
+or data transfer properties must also be copied or freed. This is done
+by providing a copy and close function for each structure:
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The file access property list copy and close functions
+for the family driver:
+
+</P>
+
+<PRE>
+static void *
+H5FD_family_fapl_copy(const void *_old_fa)
+{
+ const H5FD_family_fapl_t *old_fa = (const H5FD_family_fapl_t*)_old_fa;
+ H5FD_family_fapl_t *new_fa = malloc(sizeof(H5FD_family_fapl_t));
+ assert(new_fa);
+
+ memcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t));
+ new_fa-&#62;memb_fapl_id = H5Pcopy(old_fa-&#62;memb_fapl_id);
+ return new_fa;
+}
+
+static herr_t
+H5FD_family_fapl_free(void *_fa)
+{
+ H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa;
+ H5Pclose(fa-&#62;memb_fapl_id);
+ free(fa);
+ return 0;
+}
+</PRE>
+
+<P>
+Generally when a file is created or opened the file access properties
+for the driver are copied into the file pointer which is returned and
+they may be modified from their original value (for instance, the file
+family driver modifies the member size property when opening an existing
+family). In order to support the <CODE>H5Fget_access_plist</CODE> function the
+driver must provide a <CODE>fapl_get</CODE> callback which creates a copy of
+the driver-specific properties based on a particular file.
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The file family driver copies the member size file
+access property list into the return value:
+
+</P>
+
+<PRE>
+static void *
+H5FD_family_fapl_get(H5FD_t *_file)
+{
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ H5FD_family_fapl_t *fa = calloc(1, sizeof(H5FD_family_fapl_t*));
+
+ fa-&#62;memb_size = file-&#62;memb_size;
+ fa-&#62;memb_fapl_id = H5Pcopy(file-&#62;memb_fapl_id);
+ return fa;
+}
+</PRE>
+
+
+
+<H2><A NAME="SEC9" HREF="#TOC9">File Functions</A></H2>
+
+<P>
+The higher layers of the library expect files to have a name and allow the
+file to be accessed in various modes. The driver must be able to create a new
+file, replace an existing file, or open an existing file. Opening or creating
+a file should return a handle, a pointer to a specialization of the
+<CODE>H5FD_t</CODE> struct, which allows read-only or read-write access and which
+will be passed to the other driver functions as they are
+called.<A NAME="DOCF5" HREF="#FOOT5">(5)</A>
+
+</P>
+
+<PRE>
+typedef struct {
+ /* Public fields */
+ H5FD_class_t *cls; /*class data defined below*/
+
+ /* Private fields -- driver-defined */
+
+} H5FD_t;
+</PRE>
+
+<P>
+<STRONG>Example:</STRONG> The family driver requires handles to the underlying
+storage, the size of the members for this particular file (which might be
+different than the member size specified in the file access property list if
+an existing file family is being opened), the name used to open the file in
+case additional members must be created, and the flags to use for creating
+those additional members. The <CODE>eoa</CODE> member caches the size of the format
+address space so the family members don't have to be queried in order to find
+it.
+
+</P>
+
+<PRE>
+/* The description of a file belonging to this driver. */
+typedef struct H5FD_family_t {
+ H5FD_t pub; /*public stuff, must be first */
+ hid_t memb_fapl_id; /*file access property list for members */
+ hsize_t memb_size; /*maximum size of each member file */
+ int nmembs; /*number of family members */
+ int amembs; /*number of member slots allocated */
+ H5FD_t **memb; /*dynamic array of member pointers */
+ haddr_t eoa; /*end of allocated addresses */
+ char *name; /*name generator printf format */
+ unsigned flags; /*flags for opening additional members */
+} H5FD_family_t;
+</PRE>
+
+<P>
+<STRONG>Example:</STRONG> The sec2 driver needs to keep track of the underlying Unix
+file descriptor and also the end of format address space and current Unix file
+size. It also keeps track of the current file position and last operation
+(read, write, or unknown) in order to optimize calls to <CODE>lseek</CODE>. The
+<CODE>device</CODE> and <CODE>inode</CODE> fields are defined on Unix in order to uniquely
+identify the file and will be discussed below.
+
+</P>
+
+<PRE>
+typedef struct H5FD_sec2_t {
+ H5FD_t pub; /*public stuff, must be first */
+ int fd; /*the unix file */
+ haddr_t eoa; /*end of allocated region */
+ haddr_t eof; /*end of file; current file size*/
+ haddr_t pos; /*current file I/O position */
+ int op; /*last operation */
+ dev_t device; /*file device number */
+ ino_t inode; /*file i-node number */
+} H5FD_sec2_t;
+</PRE>
+
+
+
+<H3><A NAME="SEC10" HREF="#TOC10">Opening Files</A></H3>
+
+<P>
+All drivers must define a function for opening/creating a file. This
+function should have a prototype which is:
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static H5FD_t * <B>open</B> <I>(const char *<VAR>name</VAR>, unsigned <VAR>flags</VAR>, hid_t <VAR>fapl</VAR>, haddr_t <VAR>maxaddr</VAR>)</I>
+<DD><A NAME="IDX1"></A>
+
+</P>
+<P>
+The file name <VAR>name</VAR> and file access property list <VAR>fapl</VAR> are
+the same as were specified in the <CODE>H5Fcreate</CODE> or <CODE>H5Fopen</CODE>
+call. The <VAR>flags</VAR> are the same as in those calls also except the
+flag <CODE>H5F_ACC_CREATE</CODE> is also present if the call was to
+<CODE>H5Fcreate</CODE> and they are documented in the <TT>`H5Fpublic.h'</TT>
+file. The <VAR>maxaddr</VAR> argument is the maximum format address that the
+driver should be prepared to handle (the minimum address is always
+zero).
+</DL>
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The sec2 driver opens a Unix file with the requested name
+and saves information which uniquely identifies the file (the Unix device
+number and inode).
+
+</P>
+
+<PRE>
+static H5FD_t *
+H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id/*unused*/,
+ haddr_t maxaddr)
+{
+ unsigned o_flags;
+ int fd;
+ struct stat sb;
+ H5FD_sec2_t *file=NULL;
+
+ /* Check arguments */
+ if (!name || !*name) return NULL;
+ if (0==maxaddr || HADDR_UNDEF==maxaddr) return NULL;
+ if (ADDR_OVERFLOW(maxaddr)) return NULL;
+
+ /* Build the open flags */
+ o_flags = (H5F_ACC_RDWR &#38; flags) ? O_RDWR : O_RDONLY;
+ if (H5F_ACC_TRUNC &#38; flags) o_flags |= O_TRUNC;
+ if (H5F_ACC_CREAT &#38; flags) o_flags |= O_CREAT;
+ if (H5F_ACC_EXCL &#38; flags) o_flags |= O_EXCL;
+
+ /* Open the file */
+ if ((fd=open(name, o_flags, 0666))&#60;0) return NULL;
+ if (fstat(fd, &#38;sb)&#60;0) {
+ close(fd);
+ return NULL;
+ }
+
+ /* Create the new file struct */
+ file = calloc(1, sizeof(H5FD_sec2_t));
+ file-&#62;fd = fd;
+ file-&#62;eof = sb.st_size;
+ file-&#62;pos = HADDR_UNDEF;
+ file-&#62;op = OP_UNKNOWN;
+ file-&#62;device = sb.st_dev;
+ file-&#62;inode = sb.st_ino;
+
+ return (H5FD_t*)file;
+}
+</PRE>
+
+
+
+<H3><A NAME="SEC11" HREF="#TOC11">Closing Files</A></H3>
+
+<P>
+Closing a file simply means that all cached data should be flushed to the next
+lower layer, the file should be closed at the next lower layer, and all
+file-related data structures should be freed. All information needed by the
+close function is already present in the file handle.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static herr_t <B>close</B> <I>(H5FD_t *<VAR>file</VAR>)</I>
+<DD><A NAME="IDX2"></A>
+
+</P>
+<P>
+The <VAR>file</VAR> argument is the handle which was returned by the <CODE>open</CODE>
+function, and the <CODE>close</CODE> should free only memory associated with the
+driver-specific part of the handle (the public parts will have already been released by HDF5's virtual file layer).
+</DL>
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The sec2 driver just closes the underlying Unix file,
+making sure that the actual file size is the same as that known to the
+library by writing a zero to the last file position it hasn't been
+written by some previous operation (which happens in the same code which
+flushes the file contents and is shown below).
+
+</P>
+
+<PRE>
+static herr_t
+H5FD_sec2_close(H5FD_t *_file)
+{
+ H5FD_sec2_t *file = (H5FD_sec2_t*)_file;
+
+ if (H5FD_sec2_flush(_file)&#60;0) return -1;
+ if (close(file-&#62;fd)&#60;0) return -1;
+ free(file);
+ return 0;
+}
+</PRE>
+
+
+
+<H3><A NAME="SEC12" HREF="#TOC12">File Keys</A></H3>
+
+<P>
+Occasionally an application will attempt to open a single file more than one
+time in order to obtain multiple handles to the file. HDF5 allows the files to
+share information<A NAME="DOCF6" HREF="#FOOT6">(6)</A> but in order to
+accomplish this HDF5 must be able to tell when two names refer to the same
+file. It does this by associating a driver-defined key with each file opened
+by a driver and comparing the key for an open request with the keys for all
+other files currently open by the same driver.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> const int <B>cmp</B> <I>(const H5FD_t *<VAR>f1</VAR>, const H5FD_t *<VAR>f2</VAR>)</I>
+<DD><A NAME="IDX3"></A>
+
+</P>
+<P>
+The driver may provide a function which compares two files <VAR>f1</VAR> and
+<VAR>f2</VAR> belonging to the same driver and returns a negative, positive, or
+zero value <I>a la</I> the <CODE>strcmp</CODE> function.<A NAME="DOCF7" HREF="#FOOT7">(7)</A> If this
+function is not provided then HDF5 assumes that all calls to the <CODE>open</CODE>
+callback return unique files regardless of the arguments and it is up to the
+application to avoid doing this if that assumption is incorrect.
+</DL>
+
+</P>
+<P>
+Each time a file is opened the library calls the <CODE>cmp</CODE> function to
+compare that file with all other files currently open by the same driver and
+if one of them matches (at most one can match) then the file which was just
+opened is closed and the previously opened file is used instead.
+
+</P>
+<P>
+Opening a file twice with incompatible flags will result in failure. For
+instance, opening a file with the truncate flag is a two step process which
+first opens the file without truncation so keys can be compared, and if no
+matching file is found already open then the file is closed and immediately
+reopened with the truncation flag set (if a matching file is already open then
+the truncating open will fail).
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The sec2 driver uses the Unix device and i-node as the
+key. They were initialized when the file was opened.
+
+</P>
+
+<PRE>
+static int
+H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+{
+ const H5FD_sec2_t *f1 = (const H5FD_sec2_t*)_f1;
+ const H5FD_sec2_t *f2 = (const H5FD_sec2_t*)_f2;
+
+ if (f1-&#62;device &#60; f2-&#62;device) return -1;
+ if (f1-&#62;device &#62; f2-&#62;device) return 1;
+
+ if (f1-&#62;inode &#60; f2-&#62;inode) return -1;
+ if (f1-&#62;inode &#62; f2-&#62;inode) return 1;
+
+ return 0;
+}
+</PRE>
+
+
+
+<H3><A NAME="SEC13" HREF="#TOC13">Saving Modes Across Opens</A></H3>
+
+<P>
+Some drivers may also need to store certain information in the file superblock
+in order to be able to reliably open the file at a later date. This is done by
+three functions: one to determine how much space will be necessary to store
+the information in the superblock, one to encode the information, and one to
+decode the information. These functions are optional, but if any one is
+defined then the other two must also be defined.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static hsize_t <B>sb_size</B> <I>(H5FD_t *<VAR>file</VAR>)</I>
+<DD><A NAME="IDX4"></A>
+<DT><U>Function:</U> static herr_t <B>sb_encode</B> <I>(H5FD_t *<VAR>file</VAR>, char *<VAR>name</VAR>, unsigned char *<VAR>buf</VAR>)</I>
+<DD><A NAME="IDX5"></A>
+<DT><U>Function:</U> static herr_t <B>sb_decode</B> <I>(H5FD_t *<VAR>file</VAR>, const char *<VAR>name</VAR>, const unsigned char *<VAR>buf</VAR>)</I>
+<DD><A NAME="IDX6"></A>
+
+</P>
+<P>
+The <CODE>sb_size</CODE> function returns the number of bytes necessary to encode
+information needed later if the file is reopened. The <CODE>sb_encode</CODE>
+function encodes information from the file into buffer <VAR>buf</VAR>
+allocated by the caller. It also writes an 8-character (plus null
+termination) into the <CODE>name</CODE> argument, which should be a unique
+identification for the driver. The <CODE>sb_decode</CODE> function looks at
+the <VAR>name</VAR>
+
+</P>
+<P>
+ decodes
+data from the buffer <VAR>buf</VAR> and updates the <VAR>file</VAR> argument with the new information,
+advancing <VAR>*p</VAR> in the process.
+</DL>
+
+</P>
+<P>
+The part of this which is somewhat tricky is that the file must be readable
+before the superblock information is decoded. File access modes fall outside
+the scope of the HDF5 file format, but they are placed inside the boot block
+for convenience.<A NAME="DOCF8" HREF="#FOOT8">(8)</A>
+
+</P>
+<P>
+<STRONG>Example:</STRONG> <EM>To be written later.</EM>
+
+</P>
+
+
+<H2><A NAME="SEC14" HREF="#TOC14">Address Space Functions</A></H2>
+
+<P>
+HDF5 does not assume that a file is a linear address space of bytes. Instead,
+the library will call functions to allocate and free portions of the HDF5
+format address space, which in turn map onto functions in the file driver to
+allocate and free portions of file address space. The library tells the file
+driver how much format address space it wants to allocate and the driver
+decides what format address to use and how that format address is mapped onto
+the file address space. Usually the format address is chosen so that the file
+address can be calculated in constant time for data I/O operations (which are
+always specified by format addresses).
+
+</P>
+
+
+
+<H3><A NAME="SEC15" HREF="#TOC15">Userblock and Superblock</A></H3>
+
+<P>
+The HDF5 format allows an optional userblock to appear before the actual HDF5
+data in such a way that if the userblock is <STRONG>sucked out</STRONG> of the file and
+everything remaining is shifted downward in the file address space, then the
+file is still a valid HDF5 file. The userblock size can be zero or any
+multiple of two greater than or equal to 512 and the file superblock begins
+immediately after the userblock.
+
+</P>
+<P>
+HDF5 allocates space for the userblock and superblock by calling an
+allocation function defined below, which must return a chunk of memory at
+format address zero on the first call.
+
+</P>
+
+
+<H3><A NAME="SEC16" HREF="#TOC16">Allocation of Format Regions</A></H3>
+
+<P>
+The library makes many types of allocation requests:
+
+</P>
+<DL COMPACT>
+
+<DT><CODE>H5FD_MEM_SUPER</CODE>
+<DD>
+An allocation request for the userblock and/or superblock.
+<DT><CODE>H5FD_MEM_BTREE</CODE>
+<DD>
+An allocation request for a node of a B-tree.
+<DT><CODE>H5FD_MEM_DRAW</CODE>
+<DD>
+An allocation request for the raw data of a dataset.
+<DT><CODE>H5FD_MEM_META</CODE>
+<DD>
+An allocation request for the raw data of a dataset which
+the user has indicated will be relatively small.
+<DT><CODE>H5FD_MEM_GROUP</CODE>
+<DD>
+An allocation request for a group leaf node (internal nodes of the group tree
+are allocated as H5MF_BTREE).
+<DT><CODE>H5FD_MEM_GHEAP</CODE>
+<DD>
+An allocation request for a global heap collection. Global heaps are used to
+store certain types of references such as dataset region references. The set
+of all global heap collections can become quite large.
+<DT><CODE>H5FD_MEM_LHEAP</CODE>
+<DD>
+An allocation request for a local heap. Local heaps are used to store the
+names which are members of a group. The combined size of all local heaps is a
+function of the number of object names in the file.
+<DT><CODE>H5FD_MEM_OHDR</CODE>
+<DD>
+An allocation request for (part of) an object header. Object headers are
+relatively small and include meta information about objects (like the data
+space and type of a dataset) and attributes.
+</DL>
+
+<P>
+When a chunk of memory is freed the library adds it to a free list and
+allocation requests are satisfied from the free list before requesting memory
+from the file driver. Each type of allocation request enumerated above has its
+own free list, but the file driver can specify that certain object types can
+share a free list. It does so by providing an array which maps a request type
+to a free list. If any value of the map is <CODE>H5MF_DEFAULT</CODE> (zero) then the
+object's own free list is used. The special value <CODE>H5MF_NOLIST</CODE> indicates
+that the library should not attempt to maintain a free list for that
+particular object type, instead calling the file driver each time an object of
+that type is freed.
+
+</P>
+<P>
+Mappings predefined in the <TT>`H5FDpublic.h'</TT> file are:
+<DL COMPACT>
+
+<DT><CODE>H5FD_FLMAP_SINGLE</CODE>
+<DD>
+All memory usage types are mapped to a single free list.
+<DT><CODE>H5FD_FLMAP_DICHOTOMY</CODE>
+<DD>
+Memory usage is segregated into meta data and raw data for the purposes of
+memory management.
+<DT><CODE>H5FD_FLMAP_DEFAULT</CODE>
+<DD>
+Each memory usage type has its own free list.
+</DL>
+
+<P>
+<STRONG>Example:</STRONG> To make a map that manages object headers on one free list
+and everything else on another free list one might initialize the map with the
+following code: (the use of <CODE>H5FD_MEM_SUPER</CODE> is arbitrary)
+
+</P>
+
+<PRE>
+H5FD_mem_t mt, map[H5FD_MEM_NTYPES];
+
+for (mt=0; mt&#60;H5FD_MEM_NTYPES; mt++) {
+ map[mt] = (H5FD_MEM_OHDR==mt) ? mt : H5FD_MEM_SUPER;
+}
+</PRE>
+
+<P>
+If an allocation request cannot be satisfied from the free list then one of
+two things happen. If the driver defines an allocation callback then it is
+used to allocate space; otherwise new memory is allocated from the end of the
+format address space by incrementing the end-of-address marker.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static haddr_t <B>alloc</B> <I>(H5FD_t *<VAR>file</VAR>, H5MF_type_t <VAR>type</VAR>, hsize_t <VAR>size</VAR>)</I>
+<DD><A NAME="IDX7"></A>
+
+</P>
+<P>
+The <VAR>file</VAR> argument is the file from which space is to be allocated,
+<VAR>type</VAR> is the type of memory being requested (from the list above) without
+being mapped according to the freelist map and <VAR>size</VAR> is the number of
+bytes being requested. The library is allowed to allocate large chunks of
+storage and manage them in a layer above the file driver (although the current
+library doesn't do that). The allocation function should return a format
+address for the first byte allocated. The allocated region extends from that
+address for <VAR>size</VAR> bytes. If the request cannot be honored then the
+undefined address value is returned (<CODE>HADDR_UNDEF</CODE>). The first call to
+this function for a file which has never had memory allocated <EM>must</EM>
+return a format address of zero or <CODE>HADDR_UNDEF</CODE> since this is how the
+library allocates space for the userblock and/or superblock.
+</DL>
+
+</P>
+
+<P>
+<STRONG>Example:</STRONG> <EM>To be written later.</EM>
+
+</P>
+
+
+<H3><A NAME="SEC17" HREF="#TOC17">Freeing Format Regions</A></H3>
+
+<P>
+When the library is finished using a certain region of the format address
+space it will return the space to the free list according to the type of
+memory being freed and the free list map described above. If the free list has
+been disabled for a particular memory usage type (according to the free list
+map) and the driver defines a <CODE>free</CODE> callback then it will be
+invoked. The <CODE>free</CODE> callback is also invoked for all entries on the free
+list when the file is closed.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static herr_t <B>free</B> <I>(H5FD_t *<VAR>file</VAR>, H5MF_type_t <VAR>type</VAR>, haddr_t <VAR>addr</VAR>, hsize_t <VAR>size</VAR>)</I>
+<DD><A NAME="IDX8"></A>
+
+</P>
+<P>
+The <VAR>file</VAR> argument is the file for which space is being freed; <VAR>type</VAR>
+is the type of object being freed (from the list above) without being mapped
+according to the freelist map; <VAR>addr</VAR> is the first format address to free;
+and <VAR>size</VAR> is the size in bytes of the region being freed. The region
+being freed may refer to just part of the region originally allocated and/or
+may cross allocation boundaries provided all regions being freed have the same
+usage type. However, the library will never attempt to free regions which have
+already been freed or which have never been allocated.
+</DL>
+
+</P>
+<P>
+A driver may choose to not define the <CODE>free</CODE> function, in which case
+format addresses will be leaked. This isn't normally a huge problem since the
+library contains a simple free list of its own and freeing parts of the format
+address space is not a common occurrence.
+
+</P>
+<P>
+<STRONG>Example:</STRONG> <EM>To be written later.</EM>
+
+</P>
+
+
+<H3><A NAME="SEC18" HREF="#TOC18">Querying Address Range</A></H3>
+
+<P>
+Each file driver must have some mechanism for setting and querying the end of
+address, or <STRONG>EOA</STRONG>, marker. The EOA marker is the first format address
+after the last format address ever allocated. If the last part of the
+allocated address range is freed then the driver may optionally decrease the
+eoa marker.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static haddr_t <B>get_eoa</B> <I>(H5FD_t *<VAR>file</VAR>)</I>
+<DD><A NAME="IDX9"></A>
+
+</P>
+<P>
+This function returns the current value of the EOA marker for the specified
+file.
+</DL>
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The sec2 driver just returns the current eoa marker value
+which is cached in the file structure:
+
+</P>
+
+<PRE>
+static haddr_t
+H5FD_sec2_get_eoa(H5FD_t *_file)
+{
+ H5FD_sec2_t *file = (H5FD_sec2_t*)_file;
+ return file-&#62;eoa;
+}
+</PRE>
+
+<P>
+The eoa marker is initially zero when a file is opened and the library may set
+it to some other value shortly after the file is opened (after the superblock
+is read and the saved eoa marker is determined) or when allocating additional
+memory in the absence of an <CODE>alloc</CODE> callback (described above).
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The sec2 driver simply caches the eoa marker in the file
+structure and does not extend the underlying Unix file. When the file is
+flushed or closed then the Unix file size is extended to match the eoa marker.
+
+</P>
+
+<PRE>
+static herr_t
+H5FD_sec2_set_eoa(H5FD_t *_file, haddr_t addr)
+{
+ H5FD_sec2_t *file = (H5FD_sec2_t*)_file;
+ file-&#62;eoa = addr;
+ return 0;
+}
+</PRE>
+
+
+
+<H2><A NAME="SEC19" HREF="#TOC19">Data Functions</A></H2>
+
+<P>
+These functions operate on data, transferring a region of the format address
+space between memory and files.
+
+</P>
+
+
+
+<H3><A NAME="SEC20" HREF="#TOC20">Contiguous I/O Functions</A></H3>
+
+<P>
+A driver must specify two functions to transfer data from the library to the
+file and vice versa.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static herr_t <B>read</B> <I>(H5FD_t *<VAR>file</VAR>, H5FD_mem_t <VAR>type</VAR>, hid_t <VAR>dxpl</VAR>, haddr_t <VAR>addr</VAR>, hsize_t <VAR>size</VAR>, void *<VAR>buf</VAR>)</I>
+<DD><A NAME="IDX10"></A>
+<DT><U>Function:</U> static herr_t <B>write</B> <I>(H5FD_t *<VAR>file</VAR>, H5FD_mem_t <VAR>type</VAR>, hid_t <VAR>dxpl</VAR>, haddr_t <VAR>addr</VAR>, hsize_t <VAR>size</VAR>, const void *<VAR>buf</VAR>)</I>
+<DD><A NAME="IDX11"></A>
+
+</P>
+<P>
+The <CODE>read</CODE> function reads data from file <VAR>file</VAR> beginning at address
+<VAR>addr</VAR> and continuing for <VAR>size</VAR> bytes into the buffer <VAR>buf</VAR>
+supplied by the caller. The <CODE>write</CODE> function transfers data in the
+opposite direction. Both functions take a data transfer property list
+<VAR>dxpl</VAR> which indicates the fine points of how the data is to be
+transferred and which comes directly from the <CODE>H5Dread</CODE> or
+<CODE>H5Dwrite</CODE> function. Both functions receive <VAR>type</VAR> of
+data being written, which may allow a driver to tune it's behavior for
+different kinds of data.
+</DL>
+
+</P>
+<P>
+Both functions should return a negative value if they fail to transfer the
+requested data, or non-negative if they succeed. The library will never
+attempt to read from unallocated regions of the format address space.
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The sec2 driver just makes system calls. It tries not to
+call <CODE>lseek</CODE> if the current operation is the same as the previous
+operation and the file position is correct. It also fills the output buffer
+with zeros when reading between the current EOF and EOA markers and restarts
+system calls which were interrupted.
+
+</P>
+
+<PRE>
+static herr_t
+H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t type/*unused*/, hid_t dxpl_id/*unused*/,
+ haddr_t addr, hsize_t size, void *buf/*out*/)
+{
+ H5FD_sec2_t *file = (H5FD_sec2_t*)_file;
+ ssize_t nbytes;
+
+ assert(file &#38;&#38; file-&#62;pub.cls);
+ assert(buf);
+
+ /* Check for overflow conditions */
+ if (REGION_OVERFLOW(addr, size)) return -1;
+ if (addr+size&#62;file-&#62;eoa) return -1;
+
+ /* Seek to the correct location */
+ if ((addr!=file-&#62;pos || OP_READ!=file-&#62;op) &#38;&#38;
+ file_seek(file-&#62;fd, (file_offset_t)addr, SEEK_SET)&#60;0) {
+ file-&#62;pos = HADDR_UNDEF;
+ file-&#62;op = OP_UNKNOWN;
+ return -1;
+ }
+
+ /*
+ * Read data, being careful of interrupted system calls, partial results,
+ * and the end of the file.
+ */
+ while (size&#62;0) {
+ do nbytes = read(file-&#62;fd, buf, size);
+ while (-1==nbytes &#38;&#38; EINTR==errno);
+ if (-1==nbytes) {
+ /* error */
+ file-&#62;pos = HADDR_UNDEF;
+ file-&#62;op = OP_UNKNOWN;
+ return -1;
+ }
+ if (0==nbytes) {
+ /* end of file but not end of format address space */
+ memset(buf, 0, size);
+ size = 0;
+ }
+ assert(nbytes&#62;=0);
+ assert((hsize_t)nbytes&#60;=size);
+ size -= (hsize_t)nbytes;
+ addr += (haddr_t)nbytes;
+ buf = (char*)buf + nbytes;
+ }
+
+ /* Update current position */
+ file-&#62;pos = addr;
+ file-&#62;op = OP_READ;
+ return 0;
+}
+</PRE>
+
+<P>
+<STRONG>Example:</STRONG> The sec2 <CODE>write</CODE> callback is similar except it updates
+the file EOF marker when extending the file.
+
+</P>
+
+
+<H3><A NAME="SEC21" HREF="#TOC21">Flushing Cached Data</A></H3>
+
+<P>
+Some drivers may desire to cache data in memory in order to make larger I/O
+requests to the underlying file and thus improving bandwidth. Such drivers
+should register a cache flushing function so that the library can insure that
+data has been flushed out of the drivers in response to the application
+calling <CODE>H5Fflush</CODE>.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> static herr_t <B>flush</B> <I>(H5FD_t *<VAR>file</VAR>)</I>
+<DD><A NAME="IDX12"></A>
+
+</P>
+<P>
+Flush all data for file <VAR>file</VAR> to storage.
+</DL>
+
+</P>
+<P>
+<STRONG>Example:</STRONG> The sec2 driver doesn't cache any data but it also doesn't
+extend the Unix file as agressively as it should. Therefore, when finalizing a
+file it should write a zero to the last byte of the allocated region so that
+when reopening the file later the EOF marker will be at least as large as the
+EOA marker saved in the superblock (otherwise HDF5 will refuse to open the
+file, claiming that the data appears to be truncated).
+
+</P>
+
+<PRE>
+static herr_t
+H5FD_sec2_flush(H5FD_t *_file)
+{
+ H5FD_sec2_t *file = (H5FD_sec2_t*)_file;
+
+ if (file-&#62;eoa&#62;file-&#62;eof) {
+ if (-1==file_seek(file-&#62;fd, file-&#62;eoa-1, SEEK_SET)) return -1;
+ if (write(file-&#62;fd, "", 1)!=1) return -1;
+ file-&#62;eof = file-&#62;eoa;
+ file-&#62;pos = file-&#62;eoa;
+ file-&#62;op = OP_WRITE;
+ }
+
+ return 0;
+}
+</PRE>
+
+
+
+<H2><A NAME="SEC22" HREF="#TOC22">Optimization Functions</A></H2>
+
+<P>
+The library is capable of performing several generic optimizations on I/O, but
+these types of optimizations may not be appropriate for a given VFL driver.
+</P>
+
+<P>
+Each driver may provide a query function to allow the library to query whether
+to enable these optimizations. If a driver lacks a query function, the library
+will disable all types of optimizations which can be queried.
+</P>
+
+<P>
+<DL>
+<DT><U>Function:</U> static herr_t <B>query</B> <I>(const H5FD_t *<VAR>file</VAR>, unsigned long *<VAR>flags</VAR>)</I>
+<DD><A NAME="IDX17"></A>
+</P>
+<P>
+This function is called by the library to query which optimizations to enable
+for I/O to this driver. These are the flags which are currently defined:
+
+<UL>
+<DL>
+<DT>H5FD_FEAT_AGGREGATE_METADATA (0x00000001)
+<DD>Defining the H5FD_FEAT_AGGREGATE_METADATA for a VFL driver means that
+the library will attempt to allocate a larger block for metadata and
+then sub-allocate each metadata request from that larger block.
+<DT>H5FD_FEAT_ACCUMULATE_METADATA (0x00000002)
+<DD>Defining the H5FD_FEAT_ACCUMULATE_METADATA for a VFL driver means that
+the library will attempt to cache metadata as it is written to the file
+and build up a larger block of metadata to eventually pass to the VFL
+'write' routine.
+<DT>H5FD_FEAT_DATA_SIEVE (0x00000004)
+<DD>Defining the H5FD_FEAT_DATA_SIEVE for a VFL driver means that
+the library will attempt to cache raw data as it is read from/written to
+a file in a "data sieve" buffer. See Rajeev Thakur's papers:
+ <UL>
+ <DL>
+ <DT>http://www.mcs.anl.gov/~thakur/papers/romio-coll.ps.gz
+ <DT>http://www.mcs.anl.gov/~thakur/papers/mpio-high-perf.ps.gz
+ </DL>
+ </UL>
+</DL>
+</UL>
+</P>
+
+</DL>
+</P>
+
+<H2><A NAME="SEC23" HREF="#TOC23">Registration of a Driver</A></H2>
+
+<P>
+Before a driver can be used the HDF5 library needs to be told of its
+existence. This is done by registering the driver, which results in a driver
+identification number. Instead of passing many arguments to the registration
+function, the driver information is entered into a structure and the address
+of the structure is passed to the registration function where it is
+copied. This allows the HDF5 API to be extended while providing backward
+compatibility at the source level.
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> hid_t <B>H5FDregister</B> <I>(H5FD_class_t *<VAR>cls</VAR>)</I>
+<DD><A NAME="IDX13"></A>
+
+</P>
+<P>
+The driver described by struct <VAR>cls</VAR> is registered with the library and an
+ID number for the driver is returned.
+</DL>
+
+</P>
+<P>
+The <CODE>H5FD_class_t</CODE> type is a struct with the following fields:
+
+</P>
+<DL COMPACT>
+
+<DT><CODE>const char *name</CODE>
+<DD>
+A pointer to a constant, null-terminated driver name to be used for debugging
+purposes.
+<DT><CODE>size_t fapl_size</CODE>
+<DD>
+The size in bytes of the file access mode structure or zero if the driver
+supplies a copy function or doesn't define the structure.
+<DT><CODE>void *(*fapl_copy)(const void *fapl)</CODE>
+<DD>
+An optional function which copies a driver-defined file access mode structure.
+This field takes precedence over <CODE>fm_size</CODE> when both are defined.
+<DT><CODE>void (*fapl_free)(void *fapl)</CODE>
+<DD>
+An optional function to free the driver-defined file access mode structure. If
+null, then the library calls the C <CODE>free</CODE> function to free the
+structure.
+<DT><CODE>size_t dxpl_size</CODE>
+<DD>
+The size in bytes of the data transfer mode structure or zero if the driver
+supplies a copy function or doesn't define the structure.
+<DT><CODE>void *(*dxpl_copy)(const void *dxpl)</CODE>
+<DD>
+An optional function which copies a driver-defined data transfer mode
+structure. This field takes precedence over <CODE>xm_size</CODE> when both are
+defined.
+<DT><CODE>void (*dxpl_free)(void *dxpl)</CODE>
+<DD>
+An optional function to free the driver-defined data transfer mode
+structure. If null, then the library calls the C <CODE>free</CODE> function to
+free the structure.
+<DT><CODE>H5FD_t *(*open)(const char *name, unsigned flags, hid_t fapl, haddr_t maxaddr)</CODE>
+<DD>
+The function which opens or creates a new file.
+<DT><CODE>herr_t (*close)(H5FD_t *file)</CODE>
+<DD>
+The function which ends access to a file.
+<DT><CODE>int (*cmp)(const H5FD_t *f1, const H5FD_t *f2)</CODE>
+<DD>
+An optional function to determine whether two open files have the same key. If
+this function is not present then the library assumes that two files will
+never be the same.
+<DT><CODE>int (*query)(const H5FD_t *f, unsigned long *flags)</CODE>
+<DD>
+An optional function to determine which library optimizations a driver can
+support.
+<DT><CODE>haddr_t (*alloc)(H5FD_t *file, H5FD_mem_t type, hsize_t size)</CODE>
+<DD>
+An optional function to allocate space in the file.
+<DT><CODE>herr_t (*free)(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size)</CODE>
+<DD>
+An optional function to free space in the file.
+<DT><CODE>haddr_t (*get_eoa)(H5FD_t *file)</CODE>
+<DD>
+A function to query how much of the format address space has been allocated.
+<DT><CODE>herr_t (*set_eoa)(H5FD_t *file, haddr_t)</CODE>
+<DD>
+A function to set the end of address space.
+<DT><CODE>haddr_t (*get_eof)(H5FD_t *file)</CODE>
+<DD>
+A function to return the current end-of-file marker value.
+<DT><CODE>herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, hsize_t size, void *buffer)</CODE>
+<DD>
+A function to read data from a file.
+<DT><CODE>herr_t (*write)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, hsize_t size, const void *buffer)</CODE>
+<DD>
+A function to write data to a file.
+<DT><CODE>herr_t (*flush)(H5FD_t *file)</CODE>
+<DD>
+A function which flushes cached data to the file.
+<DT><CODE>H5FD_mem_t fl_map[H5FD_MEM_NTYPES]</CODE>
+<DD>
+An array which maps a file allocation request type to a free list.
+</DL>
+
+<P>
+<STRONG>Example:</STRONG> The sec2 driver would be registered as:
+
+</P>
+
+<PRE>
+static const H5FD_class_t H5FD_sec2_g = {
+ "sec2", /*name */
+ MAXADDR, /*maxaddr */
+ NULL, /*sb_size */
+ NULL, /*sb_encode */
+ NULL, /*sb_decode */
+ 0, /*fapl_size */
+ NULL, /*fapl_get */
+ NULL, /*fapl_copy */
+ NULL, /*fapl_free */
+ 0, /*dxpl_size */
+ NULL, /*dxpl_copy */
+ NULL, /*dxpl_free */
+ H5FD_sec2_open, /*open */
+ H5FD_sec2_close, /*close */
+ H5FD_sec2_cmp, /*cmp */
+ H5FD_sec2_query, /*query */
+ NULL, /*alloc */
+ NULL, /*free */
+ H5FD_sec2_get_eoa, /*get_eoa */
+ H5FD_sec2_set_eoa, /*set_eoa */
+ H5FD_sec2_get_eof, /*get_eof */
+ H5FD_sec2_read, /*read */
+ H5FD_sec2_write, /*write */
+ H5FD_sec2_flush, /*flush */
+ H5FD_FLMAP_SINGLE, /*fl_map */
+};
+
+hid_t
+H5FD_sec2_init(void)
+{
+ if (!H5FD_SEC2_g) {
+ H5FD_SEC2_g = H5FDregister(&#38;H5FD_sec2_g);
+ }
+ return H5FD_SEC2_g;
+}
+</PRE>
+
+<P>
+A driver can be removed from the library by unregistering it
+
+</P>
+<P>
+<DL>
+<DT><U>Function:</U> herr_t <B>H5Dunregister</B> <I>(hid_t <VAR>driver</VAR>)</I>
+<DD><A NAME="IDX14"></A>
+Where <VAR>driver</VAR> is the ID number returned when the driver was registered.
+</DL>
+
+</P>
+<P>
+Unregistering a driver makes it unusable for creating new file access or data
+transfer property lists but doesn't affect any property lists or files that
+already use that driver.
+
+</P>
+
+
+
+
+<H3><A NAME="SECProgNote" HREF="#TOCProgNote">Programming Note
+for C++ Developers Using C Functions</A></H3>
+
+<p>If a C routine that takes a function pointer as an argument is
+called from within C++ code, the C routine should be returned from
+normally. </p>
+
+<p>Examples of this kind of routine include callbacks such as
+<code>H5Pset_elink_cb</code> and <code>H5Pset_type_conv_cb</code>
+and functions such as <code>H5Tconvert</code> and
+<code>H5Ewalk2</code>.</p>
+
+<p>Exiting the routine in its normal fashion allows the HDF5 C
+Library to clean up its work properly. In other words, if the C++
+application jumps out of the routine back to the C++
+&ldquo;catch&rdquo; statement, the library is not given the
+opportunity to close any temporary data structures that were set
+up when the routine was called. The C++ application should save
+some state as the routine is started so that any problem that
+occurs might be diagnosed.</p>
+
+
+
+
+
+
+
+<H2><A NAME="SEC24" HREF="#TOC24">Querying Driver Information</A></H2>
+
+<P>
+<DL>
+<DT><U>Function:</U> void * <B>H5Pget_driver_data</B> <I>(hid_t <VAR>fapl</VAR>)</I>
+<DD><A NAME="IDX15"></A>
+<DT><U>Function:</U> void * <B>H5Pget_driver_data</B> <I>(hid_t <VAR>fxpl</VAR>)</I>
+<DD><A NAME="IDX16"></A>
+
+</P>
+<P>
+This function is intended to be used by driver functions, not applications.
+It returns a pointer directly into the file access property list
+<CODE><VAR>fapl</VAR></CODE> which is a copy of the driver's file access mode originally
+provided to the <CODE>H5Pset_driver</CODE> function. If its argument is a data
+transfer property list <CODE>fxpl</CODE> then it returns a pointer to the
+driver-specific data transfer information instead.
+</DL>
+
+</P>
+
+
+
+<H1><A NAME="SEC25" HREF="#TOC25">Miscellaneous</A></H1>
+
+<P>
+The various private <CODE>H5F_low_*</CODE> functions will be replaced by public
+<CODE>H5FD*</CODE> functions so they can be called from drivers.
+
+</P>
+<P>
+All private functions <CODE>H5F_addr_*</CODE> which operate on addresses will be
+renamed as public functions by removing the first underscore so they can be
+called by drivers.
+
+</P>
+<P>
+The <CODE>haddr_t</CODE> address data type will be passed by value throughout the
+library. The original intent was that this type would eventually be a union of
+file address types for the various drivers and may become quite large, but
+that was back when drivers were part of HDF5. It will become an alias for an
+unsigned integer type (32 or 64 bits depending on how the library was
+configured).
+
+</P>
+<P>
+The various <CODE>H5F*.c</CODE> driver files will be renamed <CODE>H5FD*.c</CODE> and each
+will have a corresponding header file. All driver functions except the
+initializer and API will be declared static.
+
+</P>
+<P>
+This documentation didn't cover optimization functions which would be useful
+to drivers like MPI-IO. Some drivers may be able to perform data pipeline
+operations more efficiently than HDF5 and need to be given a chance to
+override those parts of the pipeline. The pipeline would be designed to call
+various H5FD optimization functions at various points which return one of
+three values: the operation is not implemented by the driver, the operation is
+implemented but failed in a non-recoverable manner, the operation is
+implemented and succeeded.
+
+</P>
+<P>
+Various parts of HDF5 check the only the top-level file driver and do
+something special if it is the MPI-IO driver. However, we might want to be
+able to put the MPI-IO driver under other drivers such as the raw part of a
+split driver or under a debug driver whose sole purpose is to accumulate
+statistics as it passes all requests through to the MPI-IO driver. Therefore
+we will probably need a function which takes a format address and or object
+type and returns the driver which would have been used at the lowest level to
+process the request.
+
+</P>
+
+<P><HR><P>
+<H1>Footnotes</H1>
+<H3><A NAME="FOOT1" HREF="#DOCF1">(1)</A></H3>
+<P>The driver name is by convention and might
+not apply to drivers which are not distributed with HDF5.
+<H3><A NAME="FOOT2" HREF="#DOCF2">(2)</A></H3>
+<P>The access method also indicates how to translate
+the storage name to a storage server such as a file, network protocol, or
+memory.
+<H3><A NAME="FOOT3" HREF="#DOCF3">(3)</A></H3>
+<P>The term
+"<EM>file</EM> access property list" is a misnomer since storage isn't
+required to be a file.
+<H3><A NAME="FOOT4" HREF="#DOCF4">(4)</A></H3>
+<P>This
+function is overloaded to operate on data transfer property lists also, as
+described below.
+<H3><A NAME="FOOT5" HREF="#DOCF5">(5)</A></H3>
+<P>Read-only access is only appropriate when opening an existing
+file.
+<H3><A NAME="FOOT6" HREF="#DOCF6">(6)</A></H3>
+<P>For instance, writing data to one handle will cause
+the data to be immediately visible on the other handle.
+<H3><A NAME="FOOT7" HREF="#DOCF7">(7)</A></H3>
+<P>The ordering is
+arbitrary as long as it's consistent within a particular file driver.
+<H3><A NAME="FOOT8" HREF="#DOCF8">(8)</A></H3>
+<P>File access modes do not describe data, but rather
+describe how the HDF5 format address space is mapped to the underlying
+file(s). Thus, in general the mapping must be known before the file superblock
+can be read. However, the user usually knows enough about the mapping for the
+superblock to be readable and once the superblock is read the library can fill
+in the missing parts of the mapping.
+<P><HR><P>
+
+<?php include("../ed_libs/Footer2.htm"); ?>
+
+</BODY>
+</HTML>
diff --git a/doxygen/hdf5_footer.html b/doxygen/hdf5_footer.html
new file mode 100644
index 0000000..520f3f5
--- /dev/null
+++ b/doxygen/hdf5_footer.html
@@ -0,0 +1,21 @@
+<!-- start footer part -->
+<!--BEGIN GENERATE_TREEVIEW-->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ $navpath
+ <li class="footer">$generatedby
+ <a href="http://www.doxygen.org/index.html">
+ <img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
+ </ul>
+</div>
+<!--END GENERATE_TREEVIEW-->
+<!--BEGIN !GENERATE_TREEVIEW-->
+<hr class="footer"/><address class="footer"><small>
+$generatedby &#160;<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
+</a> $doxygenversion
+</small></address>
+<!--END !GENERATE_TREEVIEW-->
+
+</body>
+</html>
diff --git a/doxygen/hdf5_header.html b/doxygen/hdf5_header.html
new file mode 100644
index 0000000..23f41f9
--- /dev/null
+++ b/doxygen/hdf5_header.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen $doxygenversion"/>
+<meta name="viewport" content="width=device-width, initial-scale=1"/>
+<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
+<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
+<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath^jquery.js"></script>
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
+$treeview
+$search
+$mathjax
+<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
+<link href="$relpath$hdf5doxy.css" rel="stylesheet" type="text/css">
+<!-- $extrastylesheet -->
+<script type="text/javascript" src="$relpath$hdf5_navtree_hacks.js"></script>
+
+</head>
+<body>
+
+<div style="background:#FFDDDD;font-size:120%;text-align:center;margin:0;padding:5px">Please, help us to better know about our user community by answering the following short survey: <a href="https://www.hdfgroup.org/website-survey/">https://www.hdfgroup.org/website-survey/</a></div>
+
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+
+<!--BEGIN TITLEAREA-->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <!--BEGIN PROJECT_LOGO-->
+ <td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
+ <!--END PROJECT_LOGO-->
+ <!--BEGIN PROJECT_NAME-->
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a href="https://www.hdfgroup.org">$projectname</a>
+ <!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber">$projectnumber</span><!--END PROJECT_NUMBER-->
+ </div>
+ <!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
+ </td>
+ <!--END PROJECT_NAME-->
+ <!--BEGIN !PROJECT_NAME-->
+ <!--BEGIN PROJECT_BRIEF-->
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectbrief">$projectbrief</div>
+ </td>
+ <!--END PROJECT_BRIEF-->
+ <!--END !PROJECT_NAME-->
+ <!--BEGIN DISABLE_INDEX-->
+ <!--BEGIN SEARCHENGINE-->
+ <td>$searchbox</td>
+ <!--END SEARCHENGINE-->
+ <!--END DISABLE_INDEX-->
+ </tr>
+ </tbody>
+</table>
+</div>
+<!--END TITLEAREA-->
+<!-- end header part -->
diff --git a/doxygen/hdf5_navtree_hacks.js b/doxygen/hdf5_navtree_hacks.js
new file mode 100644
index 0000000..942970c
--- /dev/null
+++ b/doxygen/hdf5_navtree_hacks.js
@@ -0,0 +1,246 @@
+
+// generate a table of contents in the side-nav based on the h1/h2 tags of the current page.
+function generate_autotoc() {
+ var headers = $("h1, h2");
+ if(headers.length > 1) {
+ var toc = $("#side-nav").append('<div id="nav-toc" class="toc"><h3>Table of contents</h3></div>');
+ toc = $("#nav-toc");
+ var footer = $("#nav-path");
+ var footerHeight = footer.height();
+ toc = toc.append('<ul></ul>');
+ toc = toc.find('ul');
+ var indices = new Array();
+ indices[0] = 0;
+ indices[1] = 0;
+
+ var h1counts = $("h1").length;
+ headers.each(function(i) {
+ var current = $(this);
+ var levelTag = current[0].tagName.charAt(1);
+ if(h1counts==0)
+ levelTag--;
+ var cur_id = current.attr("id");
+
+ indices[levelTag-1]+=1;
+ var prefix = indices[0];
+ if (levelTag >1) {
+ prefix+="."+indices[1];
+ }
+
+ // Uncomment to add number prefixes
+ // current.html(prefix + " " + current.html());
+ for(var l = levelTag; l < 2; ++l){
+ indices[l] = 0;
+ }
+
+ if(cur_id == undefined) {
+ current.attr('id', 'title' + i);
+ current.addClass('anchor');
+ toc.append("<li class='level" + levelTag + "'><a id='link" + i + "' href='#title" +
+ i + "' title='" + current.prop("tagName") + "'>" + current.text() + "</a></li>");
+ } else {
+ toc.append("<li class='level" + levelTag + "'><a id='" + cur_id + "' href='#title" +
+ i + "' title='" + current.prop("tagName") + "'>" + current.text() + "</a></li>");
+ }
+ });
+ resizeHeight();
+ }
+}
+
+
+var global_navtree_object;
+
+// Overloaded to remove links to sections/subsections
+function getNode(o, po)
+{
+ po.childrenVisited = true;
+ var l = po.childrenData.length-1;
+ for (var i in po.childrenData) {
+ var nodeData = po.childrenData[i];
+ if((!nodeData[1]) || (nodeData[1].indexOf('#')==-1)) // <- we added this line
+ po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2], i==l);
+ }
+}
+
+// Overloaded to adjust the size of the navtree wrt the toc
+function resizeHeight()
+{
+ var header = $("#top");
+ var sidenav = $("#side-nav");
+ var content = $("#doc-content");
+ var navtree = $("#nav-tree");
+ var footer = $("#nav-path");
+ var toc = $("#nav-toc");
+
+ var headerHeight = header.outerHeight();
+ var footerHeight = footer.outerHeight();
+ var tocHeight = toc.height();
+ var windowHeight = $(window).height() - headerHeight - footerHeight;
+ content.css({height:windowHeight + "px"});
+ navtree.css({height:(windowHeight-tocHeight) + "px"});
+ sidenav.css({height:windowHeight + "px"});
+}
+
+// Overloaded to save the root node into global_navtree_object
+function initNavTree(toroot,relpath)
+{
+ var o = new Object();
+ global_navtree_object = o; // <- we added this line
+ o.toroot = toroot;
+ o.node = new Object();
+ o.node.li = document.getElementById("nav-tree-contents");
+ o.node.childrenData = NAVTREE;
+ o.node.children = new Array();
+ o.node.childrenUL = document.createElement("ul");
+ o.node.getChildrenUL = function() { return o.node.childrenUL; };
+ o.node.li.appendChild(o.node.childrenUL);
+ o.node.depth = 0;
+ o.node.relpath = relpath;
+ o.node.expanded = false;
+ o.node.isLast = true;
+ o.node.plus_img = document.createElement("img");
+ o.node.plus_img.src = relpath+"ftv2pnode.png";
+ o.node.plus_img.width = 16;
+ o.node.plus_img.height = 22;
+
+ if (localStorageSupported()) {
+ var navSync = $('#nav-sync');
+ if (cachedLink()) {
+ showSyncOff(navSync,relpath);
+ navSync.removeClass('sync');
+ } else {
+ showSyncOn(navSync,relpath);
+ }
+ navSync.click(function(){ toggleSyncButton(relpath); });
+ }
+
+ navTo(o,toroot,window.location.hash,relpath);
+
+ $(window).bind('hashchange', function(){
+ if (window.location.hash && window.location.hash.length>1){
+ var a;
+ if ($(location).attr('hash')){
+ var clslink=stripPath($(location).attr('pathname'))+':'+
+ $(location).attr('hash').substring(1);
+ a=$('.item a[class$="'+clslink+'"]');
+ }
+ if (a==null || !$(a).parent().parent().hasClass('selected')){
+ $('.item').removeClass('selected');
+ $('.item').removeAttr('id');
+ }
+ var link=stripPath2($(location).attr('pathname'));
+ navTo(o,link,$(location).attr('hash'),relpath);
+ } else if (!animationInProgress) {
+ $('#doc-content').scrollTop(0);
+ $('.item').removeClass('selected');
+ $('.item').removeAttr('id');
+ navTo(o,toroot,window.location.hash,relpath);
+ }
+ })
+
+ $(window).on("load", showRoot);
+}
+
+// return false if the the node has no children at all, or has only section/subsection children
+function checkChildrenData(node) {
+ if (!(typeof(node.childrenData)==='string')) {
+ for (var i in node.childrenData) {
+ var url = node.childrenData[i][1];
+ if(url.indexOf("#")==-1)
+ return true;
+ }
+ return false;
+ }
+ return (node.childrenData);
+}
+
+// Modified to:
+// 1 - remove the root node
+// 2 - remove the section/subsection children
+function createIndent(o,domNode,node,level)
+{
+ var level=-2; // <- we replaced level=-1 by level=-2
+ var n = node;
+ while (n.parentNode) { level++; n=n.parentNode; }
+ if (checkChildrenData(node)) { // <- we modified this line to use checkChildrenData(node) instead of node.childrenData
+ var imgNode = document.createElement("span");
+ imgNode.className = 'arrow';
+ imgNode.style.paddingLeft=(16*level).toString()+'px';
+ imgNode.innerHTML=arrowRight;
+ node.plus_img = imgNode;
+ node.expandToggle = document.createElement("a");
+ node.expandToggle.href = "javascript:void(0)";
+ node.expandToggle.onclick = function() {
+ if (node.expanded) {
+ $(node.getChildrenUL()).slideUp("fast");
+ node.plus_img.innerHTML=arrowRight;
+ node.expanded = false;
+ } else {
+ expandNode(o, node, false, false);
+ }
+ }
+ node.expandToggle.appendChild(imgNode);
+ domNode.appendChild(node.expandToggle);
+ } else {
+ var span = document.createElement("span");
+ span.className = 'arrow';
+ span.style.width = 16*(level+1)+'px';
+ span.innerHTML = '&#160;';
+ domNode.appendChild(span);
+ }
+}
+
+// Overloaded to automatically expand the selected node
+function selectAndHighlight(hash,n)
+{
+ var a;
+ if (hash) {
+ var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1);
+ a=$('.item a[class$="'+link+'"]');
+ }
+ if (a && a.length) {
+ a.parent().parent().addClass('selected');
+ a.parent().parent().attr('id','selected');
+ highlightAnchor();
+ } else if (n) {
+ $(n.itemDiv).addClass('selected');
+ $(n.itemDiv).attr('id','selected');
+ }
+ if ($('#nav-tree-contents .item:first').hasClass('selected')) {
+ $('#nav-sync').css('top','30px');
+ } else {
+ $('#nav-sync').css('top','5px');
+ }
+ expandNode(global_navtree_object, n, true, true); // <- we added this line
+ showRoot();
+}
+
+
+$(document).ready(function() {
+
+ generate_autotoc();
+
+ (function (){ // wait until the first "selected" element has been created
+ try {
+
+ // this line will triger an exception if there is no #selected element, i.e., before the tree structure is complete.
+ document.getElementById("selected").className = "item selected";
+
+ // ok, the default tree has been created, we can keep going...
+
+ // expand the "Chapters" node
+ if(window.location.href.indexOf('unsupported')==-1)
+ expandNode(global_navtree_object, global_navtree_object.node.children[0].children[2], true, true);
+ else
+ expandNode(global_navtree_object, global_navtree_object.node.children[0].children[1], true, true);
+
+ // Hide the root node "HDF5"
+ $(document.getElementsByClassName('index.html')[0]).parent().parent().css({display:"none"});
+
+ } catch (err) {
+ setTimeout(arguments.callee, 10);
+ }
+ })();
+
+ $(window).on("load", resizeHeight);
+});
diff --git a/doxygen/hdf5doxy.css b/doxygen/hdf5doxy.css
new file mode 100644
index 0000000..8c03860
--- /dev/null
+++ b/doxygen/hdf5doxy.css
@@ -0,0 +1,251 @@
+
+/******** HDF5 specific CSS code ************/
+
+/**** Styles removing elements ****/
+
+/* remove the "modules|classes" link for module pages (they are already in the TOC) */
+div.summary {
+ display:none;
+}
+
+/* remove */
+div.contents hr {
+ display:none;
+}
+
+/**** ****/
+
+p, dl.warning, dl.attention, dl.note
+{
+ max-width:60em;
+ text-align:justify;
+}
+
+li {
+ max-width:55em;
+ text-align:justify;
+}
+
+img {
+ border: 0;
+}
+
+div.fragment {
+ display:table; /* this allows the element to be larger than its parent */
+ padding: 0pt;
+}
+pre.fragment {
+ border: 1px solid #cccccc;
+
+ margin: 2px 0px 2px 0px;
+ padding: 3px 5px 3px 5px;
+}
+
+/* Common style for all HDF5's tables */
+
+table.example, table.manual, table.manual-vl, table.manual-hl {
+ max-width:100%;
+ border-collapse: collapse;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #cccccc;
+ font-size: 1em;
+
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -moz-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+table.example th, table.manual th, table.manual-vl th, table.manual-hl th {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ text-align: left;
+ padding-right: 1em;
+ color: #555555;
+ background-color: #F4F4E5;
+
+ background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.3,#FFFFFF), color-stop(0.30,#FFFFFF), color-stop(0.98,#F4F4E5), to(#ECECDE));
+ background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 30%, #F4F4E5 98%, #ECECDE);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#F4F4E5');
+}
+
+table.example td, table.manual td, table.manual-vl td, table.manual-hl td {
+ vertical-align:top;
+ border-width: 1px;
+ border-color: #cccccc;
+}
+
+/* header of headers */
+table th.meta {
+ text-align:center;
+ font-size: 1.2em;
+ background-color:#FFFFFF;
+}
+
+/* intermediate header */
+table th.inter {
+ text-align:left;
+ background-color:#FFFFFF;
+ background-image:none;
+ border-style:solid solid solid solid;
+ border-width: 1px;
+ border-color: #cccccc;
+}
+
+/** class for example / output tables **/
+
+table.example {
+}
+
+table.example th {
+}
+
+table.example td {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ vertical-align:top;
+}
+
+/* standard class for the manual */
+
+table.manual, table.manual-vl, table.manual-hl {
+ padding: 0.2em 0em 0.5em 0em;
+}
+
+table.manual th, table.manual-vl th, table.manual-hl th {
+ margin: 0em 0em 0.3em 0em;
+}
+
+table.manual td, table.manual-vl td, table.manual-hl td {
+ padding: 0.3em 0.5em 0.3em 0.5em;
+ vertical-align:top;
+ border-width: 1px;
+}
+
+table.manual td.alt, table.manual tr.alt, table.manual-vl td.alt, table.manual-vl tr.alt {
+ background-color: #F4F4E5;
+}
+
+table.manual-vl th, table.manual-vl td, table.manual-vl td.alt {
+ border-color: #cccccc;
+ border-width: 1px;
+ border-style: none solid none solid;
+}
+
+table.manual-vl th.inter {
+ border-style: solid solid solid solid;
+}
+
+table.manual-hl td {
+ border-color: #cccccc;
+ border-width: 1px;
+ border-style: solid none solid none;
+}
+
+table td.code {
+ font-family: monospace;
+}
+
+h2 {
+ margin-top:2em;
+ border-style: none none solid none;
+ border-width: 1px;
+ border-color: #cccccc;
+}
+
+/**** Table of content in the side-nav ****/
+
+
+div.toc {
+ margin:0;
+ padding: 0.3em 0 0 0;
+ width:100%;
+ float:none;
+ position:absolute;
+ bottom:0;
+ border-radius:0px;
+ border-style: solid none none none;
+ max-height:50%;
+ overflow-y: scroll;
+}
+
+div.toc h3 {
+ margin-left: 0.5em;
+ margin-bottom: 0.2em;
+}
+
+div.toc ul {
+ margin: 0.2em 0 0.4em 0.5em;
+}
+
+span.cpp11,span.cpp14,span.cpp17 {
+ color: #119911;
+ font-weight: bold;
+}
+
+.newin3x {
+ color: #a37c1a;
+ font-weight: bold;
+}
+
+div.warningbox {
+ max-width:60em;
+ border-style: solid solid solid solid;
+ border-color: red;
+ border-width: 3px;
+}
+
+/**** old HDF5's styles ****/
+
+
+table.tutorial_code td {
+ border-color: transparent; /* required for Firefox */
+ padding: 3pt 5pt 3pt 5pt;
+ vertical-align: top;
+}
+
+
+/* Whenever doxygen meets a '\n' or a '<BR/>', it will put
+ * the text containing the character into a <p class="starttd">.
+ * This little hack together with table.tutorial_code td.note
+ * aims at fixing this issue. */
+table.tutorial_code td.note p.starttd {
+ margin: 0px;
+ border: none;
+ padding: 0px;
+}
+
+div.eimainmenu {
+ text-align: center;
+}
+
+/* center version number on main page */
+h3.version {
+ text-align: center;
+}
+
+
+td.width20em p.endtd {
+ width: 20em;
+}
+
+/* needed for huge screens */
+.ui-resizable-e {
+ background-repeat: repeat-y;
+}
+
+/* Style external links -- nav-tree is different */
+
+#nav-tree .label a {
+ padding:2px 16px 2px 2px;
+}
+
+a {
+ outline: none;
+ text-decoration: none;
+ padding: 2px 1px 0;
+}
+
+a[href*="http"] {
+ background: url('https://mdn.mozillademos.org/files/12982/external-link-52.png') no-repeat 100% 0;
+ background-size: 12px 12px;
+ padding-right: 16px;
+}
diff --git a/doxygen/hdf5doxy_layout.xml b/doxygen/hdf5doxy_layout.xml
new file mode 100644
index 0000000..fc20aa1
--- /dev/null
+++ b/doxygen/hdf5doxy_layout.xml
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<doxygenlayout version="1.0">
+ <!-- Navigation index tabs for HTML output -->
+ <navindex>
+ <tab type="user" url="index.html" title="Overview" />
+ <tab type="user" url="https://portal.hdfgroup.org/display/HDF5/Learning+HDF5" title="Getting started" />
+ <tab type="user" url="@ref Cookbook" title="Cookbook" />
+ <tab type="user" url="https://portal.hdfgroup.org/display/HDF5/HDF5+User+Guides" title="User Guides" />
+ <tab type="user" url="https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide" title="Application Developer's Guide" />
+ <tab type="user" url="https://portal.hdfgroup.org/display/HDF5/HDF5+Glossary" title="Glossary" />
+ <tab type="user" url="@ref RM" title="Reference Manual" />
+ <tab type="user" url="@ref TN" title="Technical Notes" />
+ <tab type="user" url="@ref SPEC" title="Specifications" />
+ <tab type="user" url="@ref RFC" title="RFCs" />
+ <tab type="user" url="@ref About" title="About" />
+ </navindex>
+
+ <!-- Layout definition for a class page -->
+ <class>
+ <briefdescription visible="no"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <detaileddescription title=""/>
+ <inheritancegraph visible="$CLASS_GRAPH"/>
+ <collaborationgraph visible="$COLLABORATION_GRAPH"/>
+ <allmemberslink visible="yes"/>
+ <memberdecl>
+ <nestedclasses visible="yes" title=""/>
+ <publictypes title=""/>
+ <publicslots title=""/>
+ <signals title=""/>
+ <publicmethods title=""/>
+ <publicstaticmethods title=""/>
+ <publicattributes title=""/>
+ <publicstaticattributes title=""/>
+ <protectedtypes title=""/>
+ <protectedslots title=""/>
+ <protectedmethods title=""/>
+ <protectedstaticmethods title=""/>
+ <protectedattributes title=""/>
+ <protectedstaticattributes title=""/>
+ <packagetypes title=""/>
+ <packagemethods title=""/>
+ <packagestaticmethods title=""/>
+ <packageattributes title=""/>
+ <packagestaticattributes title=""/>
+ <properties title=""/>
+ <events title=""/>
+ <privatetypes title=""/>
+ <privateslots title=""/>
+ <privatemethods title=""/>
+ <privatestaticmethods title=""/>
+ <privateattributes title=""/>
+ <privatestaticattributes title=""/>
+ <friends title=""/>
+ <related title="" subtitle=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <constructors title=""/>
+ <functions title=""/>
+ <related title=""/>
+ <variables title=""/>
+ <properties title=""/>
+ <events title=""/>
+ </memberdef>
+ <usedfiles visible="$SHOW_USED_FILES"/>
+ <authorsection visible="yes"/>
+ </class>
+
+ <!-- Layout definition for a namespace page -->
+ <namespace>
+ <briefdescription visible="yes"/>
+ <memberdecl>
+ <nestednamespaces visible="yes" title=""/>
+ <classes visible="yes" title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </namespace>
+
+ <!-- Layout definition for a file page -->
+ <file>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <includegraph visible="$INCLUDE_GRAPH"/>
+ <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
+ <sourcelink visible="yes"/>
+ <memberdecl>
+ <classes visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection/>
+ </file>
+
+ <!-- Layout definition for a group page -->
+ <group>
+ <briefdescription visible="no"/>
+ <detaileddescription title=""/>
+ <groupgraph visible="$GROUP_GRAPHS"/>
+ <memberdecl>
+ <nestedgroups visible="yes" title=""/>
+ <dirs visible="yes" title=""/>
+ <files visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <classes visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+
+ <memberdef>
+ <pagedocs/>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </group>
+
+ <!-- Layout definition for a directory page -->
+ <directory>
+ <briefdescription visible="yes"/>
+ <directorygraph visible="yes"/>
+ <memberdecl>
+ <dirs visible="yes"/>
+ <files visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ </directory>
+</doxygenlayout>
diff --git a/doxygen/img/FF-IH_FileGroup.gif b/doxygen/img/FF-IH_FileGroup.gif
new file mode 100644
index 0000000..b0d76f5
--- /dev/null
+++ b/doxygen/img/FF-IH_FileGroup.gif
Binary files differ
diff --git a/doxygen/img/FF-IH_FileObject.gif b/doxygen/img/FF-IH_FileObject.gif
new file mode 100644
index 0000000..8eba623
--- /dev/null
+++ b/doxygen/img/FF-IH_FileObject.gif
Binary files differ
diff --git a/doxygen/img/FileFormatSpecChunkDiagram.jpg b/doxygen/img/FileFormatSpecChunkDiagram.jpg
new file mode 100644
index 0000000..03fd90a
--- /dev/null
+++ b/doxygen/img/FileFormatSpecChunkDiagram.jpg
Binary files differ
diff --git a/doxygen/img/HDFG-logo.png b/doxygen/img/HDFG-logo.png
index a2d52a9..38300ff 100644
--- a/doxygen/img/HDFG-logo.png
+++ b/doxygen/img/HDFG-logo.png
Binary files differ
diff --git a/doxygen/img/PaletteExample1.gif b/doxygen/img/PaletteExample1.gif
new file mode 100644
index 0000000..8694d9d
--- /dev/null
+++ b/doxygen/img/PaletteExample1.gif
Binary files differ
diff --git a/doxygen/img/Palettes.fm.anc.gif b/doxygen/img/Palettes.fm.anc.gif
new file mode 100644
index 0000000..d344c03
--- /dev/null
+++ b/doxygen/img/Palettes.fm.anc.gif
Binary files differ
diff --git a/doxygen/img/ftv2node.png b/doxygen/img/ftv2node.png
new file mode 100644
index 0000000..63c605b
--- /dev/null
+++ b/doxygen/img/ftv2node.png
Binary files differ
diff --git a/doxygen/img/ftv2pnode.png b/doxygen/img/ftv2pnode.png
new file mode 100644
index 0000000..c6ee22f
--- /dev/null
+++ b/doxygen/img/ftv2pnode.png
Binary files differ
diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake
index b422078..70142c8 100644
--- a/examples/CMakeTests.cmake
+++ b/examples/CMakeTests.cmake
@@ -98,11 +98,14 @@ endif ()
### Windows pops up a modal permission dialog on this test
if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND NOT WIN32)
+ # Ensure that 24 is a multiple of the number of processes.
+ # The number 24 corresponds to SPACE1_DIM1 and SPACE1_DIM2 defined in ph5example.c
+ math(EXPR NUMPROCS "24 / ((24 + ${MPIEXEC_MAX_NUMPROCS} - 1) / ${MPIEXEC_MAX_NUMPROCS})")
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS})
+ add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS})
else ()
add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example>;${MPIEXEC_POSTFLAGS}"
+ -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
-D "TEST_OUTPUT=ph5example.out"
diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c
index 3400151..97be7f5 100644
--- a/examples/h5_attribute.c
+++ b/examples/h5_attribute.c
@@ -235,7 +235,7 @@ attr_info(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *opdata)
float * float_array; /* Pointer to the array attribute. */
/* avoid warnings */
- opdata = opdata;
+ (void)opdata;
/*
* Open the attribute using its name.
diff --git a/examples/h5_group.c b/examples/h5_group.c
index 4b489f0..40acafe 100644
--- a/examples/h5_group.c
+++ b/examples/h5_group.c
@@ -171,9 +171,9 @@ static herr_t
file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata)
{
/* avoid compiler warnings */
- loc_id = loc_id;
- opdata = opdata;
- linfo = linfo;
+ (void)loc_id;
+ (void)opdata;
+ (void)linfo;
/*
* Display group name. The name is passed to the function by
@@ -198,8 +198,8 @@ group_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdat
int rank_chunk;
/* avoid warnings */
- opdata = opdata;
- linfo = linfo;
+ (void)opdata;
+ (void)linfo;
/*
* Open the datasets using their names.
diff --git a/examples/h5_vds.c b/examples/h5_vds.c
index 6bef06f..e036204 100644
--- a/examples/h5_vds.c
+++ b/examples/h5_vds.c
@@ -60,7 +60,7 @@ main(void)
hsize_t start_out[2], stride_out[2], count_out[2], block_out[2];
int wdata[DIM0], /* Write buffer for source dataset */
rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */
- i, j, k, l;
+ i, j, k, l, block_inc;
int fill_value = -1; /* Fill value for VDS */
H5D_layout_t layout; /* Storage layout */
size_t num_map; /* Number of mappings */
@@ -178,13 +178,14 @@ main(void)
buf = (hsize_t *)malloc(sizeof(hsize_t) * 2 * RANK2 * nblocks);
status = H5Sget_select_hyper_blocklist(vspace, (hsize_t)0, nblocks, buf);
for (l = 0; l < nblocks; l++) {
+ block_inc = 2 * RANK2 * l;
printf("(");
for (k = 0; k < RANK2 - 1; k++)
- printf("%d,", (int)buf[k]);
- printf("%d ) - (", (int)buf[k]);
+ printf("%d,", (int)buf[block_inc + k]);
+ printf("%d) - (", (int)buf[block_inc + k]);
for (k = 0; k < RANK2 - 1; k++)
- printf("%d,", (int)buf[RANK2 + k]);
- printf("%d)\n", (int)buf[RANK2 + k]);
+ printf("%d,", (int)buf[block_inc + RANK2 + k]);
+ printf("%d)\n", (int)buf[block_inc + RANK2 + k]);
}
/* We also can use new APIs to get start, stride, count and block */
if (H5Sis_regular_hyperslab(vspace)) {
diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in
index 0c122c7..ba80f2d 100644
--- a/examples/testh5cc.sh.in
+++ b/examples/testh5cc.sh.in
@@ -91,6 +91,8 @@ temp_FILES="a.out $applib"
cat > $appmain <<EOF
#include "hdf5.h"
#define H5FILE_NAME "tmp.h5"
+extern void sub1(void);
+extern void sub2(void);
int
main (void)
{
@@ -115,6 +117,8 @@ EOF
# generate prog1
cat > $prog1 <<EOF
+#include <stdio.h>
+void
sub1(void)
{
printf("in sub1\n");
@@ -123,6 +127,8 @@ EOF
# generate prog2
cat > $prog2 <<EOF
+#include <stdio.h>
+void
sub2(void)
{
printf("in sub2\n");
diff --git a/fortran/COPYING b/fortran/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/fortran/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 37b5157..316d3c7 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -73,38 +73,35 @@ add_executable (H5match_types
)
target_include_directories (H5match_types PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
- ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
+add_custom_command (TARGET H5match_types POST_BUILD
+ BYPRODUCTS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5match_types>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
DEPENDS H5match_types
)
if (NOT ONLY_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
- ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
+ add_custom_command (TARGET H5match_types POST_BUILD
+ BYPRODUCTS ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5f90i_gen.h" "${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h"
+ ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5fortran_types.F90" "${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90"
+ ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
- DEPENDS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
+ DEPENDS H5_buildiface H5match_types ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h PROPERTIES GENERATED TRUE)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
endif ()
if (BUILD_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
- ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
+ add_custom_command (TARGET H5match_types POST_BUILD
+ BYPRODUCTS ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5f90i_gen.h" "${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h"
+ ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5fortran_types.F90" "${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90"
+ ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
- DEPENDS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
+ DEPENDS H5_buildiface H5match_types ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h PROPERTIES GENERATED TRUE)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90 PROPERTIES GENERATED TRUE)
@@ -134,16 +131,33 @@ set (f90CStub_C_SOURCES
set_source_files_properties (${f90CStub_C_SOURCES} PROPERTIES LANGUAGE C)
set (f90CStub_C_HDRS
- # generated files
- ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
-)
-set (f90CStub_C_SHHDRS
- # generated files
- ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h
+ ${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h
)
if (NOT ONLY_SHARED_LIBS)
- add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS})
+ set (f90CStub_CGEN_HDRS
+ # generated files
+ ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
+ )
+ add_custom_target (H5gen_i ALL
+ DEPENDS H5match_types ${f90CStub_CGEN_HDRS}
+ )
+endif ()
+
+if (BUILD_SHARED_LIBS)
+ set (f90CStub_CGEN_SHHDRS
+ # generated files
+ ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
+ )
+ add_custom_target (H5gen_iSH ALL
+ DEPENDS H5match_types ${f90CStub_CGEN_SHHDRS}
+ )
+endif ()
+
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS} ${f90CStub_CGEN_HDRS})
target_include_directories (${HDF5_F90_C_LIB_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
@@ -157,11 +171,12 @@ if (NOT ONLY_SHARED_LIBS)
FOLDER libraries/fortran
LINKER_LANGUAGE C
)
+ add_dependencies (${HDF5_F90_C_LIB_TARGET} H5gen_i)
set (install_targets ${HDF5_F90_C_LIB_TARGET})
endif ()
if (BUILD_SHARED_LIBS)
- add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS})
+ add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS} ${f90CStub_CGEN_SHHDRS})
target_include_directories (${HDF5_F90_C_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
@@ -176,6 +191,7 @@ if (BUILD_SHARED_LIBS)
FOLDER libraries/fortran
LINKER_LANGUAGE C
)
+ add_dependencies (${HDF5_F90_C_LIBSH_TARGET} H5gen_iSH)
set (install_targets ${install_targets} ${HDF5_F90_C_LIBSH_TARGET})
endif ()
@@ -210,39 +226,39 @@ set (f90_F_GEN_SOURCES
${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90
${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.F90
)
-add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+add_custom_command (TARGET H5_buildiface POST_BUILD
+ BYPRODUCTS ${HDF5_F90_BINARY_DIR}/H5_gen.F90
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_buildiface>
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
- DEPENDS ${f90_F_GEN_SOURCES}
+ DEPENDS H5_buildiface ${f90_F_GEN_SOURCES}
COMMENT "Generating the H5_gen.F90 file"
)
if (NOT ONLY_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
+ add_custom_command (TARGET H5_buildiface POST_BUILD
+ BYPRODUCTS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5_gen.F90" "${HDF5_F90_BINARY_DIR}/static/H5_gen.F90"
+ ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5_gen.F90 ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
- DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90
+ DEPENDS H5_buildiface ${HDF5_F90_BINARY_DIR}/H5_gen.F90
COMMENT "Generating the H5_gen.F90 file"
)
add_custom_target (H5gen ALL
- DEPENDS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
+ DEPENDS H5_buildiface ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/static/H5_gen.F90 PROPERTIES GENERATED TRUE)
endif ()
if (BUILD_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
+ add_custom_command (TARGET H5_buildiface POST_BUILD
+ BYPRODUCTS ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_F90_BINARY_DIR}/H5_gen.F90" "${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90"
+ ARGS -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5_gen.F90 ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
DEPENDS ${HDF5_F90_BINARY_DIR}/H5_gen.F90
COMMENT "Generating the H5_gen.F90 shared file"
)
add_custom_target (H5genSH ALL
- DEPENDS ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
+ DEPENDS H5_buildiface ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
)
set_source_files_properties (${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 PROPERTIES GENERATED TRUE)
endif ()
@@ -540,17 +556,21 @@ set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}"
configure_file (
${HDF_CONFIG_DIR}/libhdf5.pc.in
- ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}.pc
@ONLY
)
install (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}.pc
DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
COMPONENT fortlibraries
)
if (NOT WIN32 AND NOT MINGW)
- set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER})
+ if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND)
+ set (_PKG_CONFIG_COMPILER ${MPI_Fortran_COMPILER})
+ else ()
+ set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER})
+ endif ()
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
${HDF5_BINARY_DIR}/CMakeFiles/h5fc
@@ -562,4 +582,17 @@ if (NOT WIN32 AND NOT MINGW)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT fortlibraries
)
+ if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND)
+ configure_file (
+ ${HDF_RESOURCES_DIR}/libh5cc.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/h5pfc
+ @ONLY
+ )
+ install (
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5pfc
+ DESTINATION ${HDF5_INSTALL_BIN_DIR}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ COMPONENT fortlibraries
+ )
+ endif ()
endif ()
diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90
index f772558..a273431 100644
--- a/fortran/src/H5Fff.F90
+++ b/fortran/src/H5Fff.F90
@@ -824,7 +824,7 @@ CONTAINS
SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
- CHARACTER(LEN=*), INTENT(INOUT) :: buf
+ CHARACTER(LEN=*), INTENT(OUT) :: buf
! Buffer to hold file name
INTEGER(SIZE_T), INTENT(OUT) :: size ! Size of the file name
INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success,
@@ -844,7 +844,7 @@ CONTAINS
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf
END FUNCTION h5fget_name_c
END INTERFACE
- buflen = LEN_TRIM(buf)
+ buflen = LEN(buf)
hdferr = h5fget_name_c(obj_id, size, buf, buflen)
END SUBROUTINE h5fget_name_f
!****s* H5F/h5fget_filesize_f
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index 10d873e..017bab4 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -70,8 +70,8 @@ initCfile(void)
* help@hdfgroup.org. *\n\
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\
\n\n\
-#ifndef _H5f90i_gen_H\n\
-#define _H5f90i_gen_H\n\
+#ifndef H5f90i_gen_H\n\
+#define H5f90i_gen_H\n\
\n\
/* This file is automatically generated by H5match_types.c at build time. */\n\
\n\
diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am
index 5168eb6..65ffa0c 100644
--- a/fortran/src/Makefile.am
+++ b/fortran/src/Makefile.am
@@ -155,7 +155,7 @@ H5Pff.lo: $(srcdir)/H5Pff.F90 H5f90global.lo H5fortkit.lo
H5Rff.lo: $(srcdir)/H5Rff.F90 H5f90global.lo
H5Sff.lo: $(srcdir)/H5Sff.F90 H5f90global.lo
H5Tff.lo: $(srcdir)/H5Tff.F90 H5f90global.lo
-H5VLff.lo: $(srcdir)/H5VLff.F90 H5f90global.lo
+H5VLff.lo: $(srcdir)/H5VLff.F90 H5f90global.lo H5fortkit.lo
H5Zff.lo: $(srcdir)/H5Zff.F90 H5f90global.lo
H5_gen.lo: H5_gen.F90 H5f90global.lo H5Aff.lo H5Dff.lo H5Pff.lo
HDF5.lo: $(srcdir)/HDF5.F90 H5f90global.lo H5_ff.lo H5Aff.lo \
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 40aef6d..1e879e7 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -91,27 +91,27 @@ if (HDF5_ENABLE_FORMATTERS)
endif ()
if (NOT BUILD_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
+ add_custom_command (TARGET H5_test_buildiface POST_BUILD
+ BYPRODUCTS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_test_buildiface>
WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static
DEPENDS H5_test_buildiface
- COMMENT "Generating the tf_gen.F90 file"
+ COMMENT "Generating the tf_gen.F90 static file"
)
add_custom_target (H5testgen ALL
- DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
+ DEPENDS H5_test_buildiface ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
)
set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE)
else ()
- add_custom_command (
- OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
+ add_custom_command (TARGET H5_test_buildiface POST_BUILD
+ BYPRODUCTS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_test_buildiface>
WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared
DEPENDS H5_test_buildiface
COMMENT "Generating the tf_gen.F90 shared file"
)
add_custom_target (H5testgenSH ALL
- DEPENDS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
+ DEPENDS H5_test_buildiface ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
)
set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90 PROPERTIES GENERATED TRUE)
endif ()
diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90
index eff4657..1640a8f 100644
--- a/fortran/test/fortranlib_test.F90
+++ b/fortran/test/fortranlib_test.F90
@@ -74,6 +74,10 @@ PROGRAM fortranlibtest
CALL write_test_status(ret_total_error, ' Reopen test', total_error)
ret_total_error = 0
+ CALL get_name_test(cleanup, ret_total_error)
+ CALL write_test_status(ret_total_error, ' Get name test', total_error)
+
+ ret_total_error = 0
CALL file_close(cleanup, ret_total_error)
CALL write_test_status(ret_total_error, ' File open/close test', total_error)
diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90
index f4a3232..06dc6de 100644
--- a/fortran/test/tH5F.F90
+++ b/fortran/test/tH5F.F90
@@ -21,7 +21,8 @@
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
! CONTAINS SUBROUTINES
-! mountingtest, reopentest, plisttest, file_close, file_space
+! mountingtest, reopentest, get_name_test, plisttest,
+! file_close, file_space
!
!*****
!
@@ -580,6 +581,125 @@ CONTAINS
END SUBROUTINE reopentest
+! The following subroutine checks that h5fget_name_f produces
+! correct output for a given obj_id and filename.
+!
+ SUBROUTINE check_get_name(obj_id, fix_filename, total_error)
+ USE HDF5 ! This module contains all necessary modules
+ USE TH5_MISC
+ IMPLICIT NONE
+ INTEGER(HID_T) :: obj_id ! Object identifier
+ CHARACTER(LEN=80), INTENT(IN) :: fix_filename ! Expected filename
+ INTEGER, INTENT(INOUT) :: total_error ! Error count
+
+ CHARACTER(LEN=80):: file_name ! Filename buffer
+ INTEGER:: error ! HDF5 error code
+ INTEGER(SIZE_T):: name_size ! Filename length
+ !
+ !Get file name from the dataset identifier
+ !
+
+ ! Use an uninitialized buffer
+ CALL h5fget_name_f(obj_id, file_name, name_size, error)
+ CALL check("h5fget_name_f",error,total_error)
+ IF(name_size .NE. LEN_TRIM(fix_filename))THEN
+ WRITE(*,*) " file name size obtained from the object id is incorrect"
+ total_error = total_error + 1
+ ENDIF
+ IF(file_name(1:name_size) .NE. TRIM(fix_filename)) THEN
+ WRITE(*,*) " file name obtained from the object id is incorrect"
+ total_error = total_error + 1
+ END IF
+
+ ! Use a buffer initialized with spaces
+ file_name(:) = " "
+ CALL h5fget_name_f(obj_id, file_name, name_size, error)
+ CALL check("h5fget_name_f",error,total_error)
+ IF(name_size .NE. LEN_TRIM(fix_filename))THEN
+ WRITE(*,*) " file name size obtained from the object id is incorrect"
+ total_error = total_error + 1
+ ENDIF
+ IF(file_name(1:name_size) .NE. TRIM(fix_filename)) THEN
+ WRITE(*,*) " file name obtained from the object id is incorrect"
+ total_error = total_error + 1
+ END IF
+
+ ! Use a buffer initialized with non-whitespace characters
+ file_name(:) = "a"
+ CALL h5fget_name_f(obj_id, file_name, name_size, error)
+ CALL check("h5fget_name_f",error,total_error)
+ IF(name_size .NE. LEN_TRIM(fix_filename))THEN
+ WRITE(*,*) " file name size obtained from the object id is incorrect"
+ total_error = total_error + 1
+ ENDIF
+ IF(file_name(1:name_size) .NE. TRIM(fix_filename)) THEN
+ WRITE(*,*) " file name obtained from the object id is incorrect"
+ total_error = total_error + 1
+ END IF
+
+ END SUBROUTINE check_get_name
+
+! The following subroutine tests h5fget_name_f.
+! It creates the file which has name "filename.h5" and
+! tests that h5fget_name_f also returns the name "filename.h5"
+!
+
+ SUBROUTINE get_name_test(cleanup, total_error)
+ USE HDF5 ! This module contains all necessary modules
+ USE TH5_MISC
+ IMPLICIT NONE
+ LOGICAL, INTENT(IN) :: cleanup
+ INTEGER, INTENT(INOUT) :: total_error
+
+ CHARACTER(LEN=*), PARAMETER :: filename = "filename"
+ CHARACTER(LEN=80) :: fix_filename
+
+ INTEGER(HID_T) :: file_id ! File identifier
+ INTEGER(HID_T) :: g_id ! Group identifier
+
+ !
+ ! Flag to check operation success
+ !
+ INTEGER :: error
+
+ !
+ ! Create file "filename.h5" using default properties.
+ !
+ CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error)
+ IF (error .NE. 0) THEN
+ WRITE(*,*) "Cannot modify filename"
+ STOP
+ ENDIF
+ CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error)
+ CALL check("h5fcreate_f",error,total_error)
+
+ !
+ ! Create group.
+ !
+ CALL h5gopen_f(file_id,"/",g_id, error)
+ CALL check("h5gopen_f",error,total_error)
+
+ CALL check_get_name(file_id, fix_filename, total_error)
+ CALL check_get_name(g_id, fix_filename, total_error)
+
+ ! Close the group.
+ !
+ CALL h5gclose_f(g_id, error)
+ CALL check("h5gclose_f",error,total_error)
+
+ !
+ ! Close the file identifiers.
+ !
+ CALL h5fclose_f(file_id, error)
+ CALL check("h5fclose_f",error,total_error)
+
+ IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error)
+ CALL check("h5_cleanup_f", error, total_error)
+ RETURN
+
+ END SUBROUTINE get_name_test
+
+
!
! The following example demonstrates how to get creation property list,
! and access property list.
diff --git a/fortran/test/tH5Z.F90 b/fortran/test/tH5Z.F90
index 0eaa941..8c39fea 100644
--- a/fortran/test/tH5Z.F90
+++ b/fortran/test/tH5Z.F90
@@ -192,7 +192,8 @@ CONTAINS
INTEGER(HSIZE_T), DIMENSION(2) :: chunk_dims = (/NN, MM/)
INTEGER :: rank = 2 ! Dataset rank
- INTEGER, DIMENSION(N,M) :: dset_data, data_out ! Data buffers
+ INTEGER, DIMENSION(N,M) :: dset_data ! Data buffers
+ INTEGER, DIMENSION(:,:), ALLOCATABLE :: data_out ! Data buffers
INTEGER :: error ! Error flag
INTEGER :: num_errors = 0 ! Number of data errors
@@ -363,8 +364,9 @@ CONTAINS
!
! Read the dataset.
!
+ ALLOCATE(data_out(1:N,1:M))
CALL h5dread_f (dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error)
- CALL check("h5dread_f", error, total_error)
+ CALL check("h5dread_f", error, total_error)
!
!Compare the data.
@@ -385,6 +387,7 @@ CONTAINS
100 IF (num_errors .GT. 0) THEN
total_error=total_error + 1
END IF
+ DEALLOCATE(data_out)
!
! End access to the dataset and release resources used by it.
diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt
index 083c60e..5061c6c 100644
--- a/hl/CMakeLists.txt
+++ b/hl/CMakeLists.txt
@@ -7,9 +7,17 @@ project (HDF5_HL C)
add_subdirectory (src)
-#-- Build the High level Tools
+# Build HDF5 Tools
if (HDF5_BUILD_TOOLS)
- add_subdirectory (tools)
+ #-----------------------------------------------------------------------------
+ #-- Option to build the High level Tools
+ #-----------------------------------------------------------------------------
+ if (EXISTS "${HDF5_HL_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_HL_SOURCE_DIR}/tools")
+ option (HDF5_BUILD_HL_TOOLS "Build HDF5 HL Tools" ON)
+ if (HDF5_BUILD_HL_TOOLS)
+ add_subdirectory (tools)
+ endif ()
+ endif ()
endif ()
#-- Add High Level Examples
diff --git a/hl/COPYING b/hl/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/hl/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/hl/Makefile.am b/hl/Makefile.am
index 9bf209e..8c427d3 100644
--- a/hl/Makefile.am
+++ b/hl/Makefile.am
@@ -37,16 +37,19 @@ else
TEST_DIR =
endif
if BUILD_TOOLS_CONDITIONAL
+if BUILD_TOOLS_HL_CONDITIONAL
TOOLS_DIR = tools
else
TOOLS_DIR =
endif
+else
+ TOOLS_DIR =
+endif
## Don't recurse into any subdirectories if HDF5 is not configured to
## use the HL library
if BUILD_HDF5_HL_CONDITIONAL
SUBDIRS=src $(TEST_DIR) $(TOOLS_DIR) $(CXX_DIR) $(FORTRAN_DIR)
-
endif
DIST_SUBDIRS=src test tools c++ fortran examples
diff --git a/hl/c++/COPYING b/hl/c++/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/hl/c++/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index 1eac9fe..c516df1 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -110,17 +110,21 @@ set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSIO
configure_file (
${HDF_CONFIG_DIR}/libhdf5.pc.in
- ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}.pc
@ONLY
)
install (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}.pc
DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
COMPONENT hlcpplibraries
)
if (NOT WIN32 AND NOT MINGW)
- set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
+ if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND)
+ set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER})
+ else ()
+ set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
+ endif ()
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++
diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp
index eca3ed1..086c702 100644
--- a/hl/c++/src/H5PacketTable.cpp
+++ b/hl/c++/src/H5PacketTable.cpp
@@ -28,19 +28,33 @@
/* PacketTable superclass */
/********************************/
+/* Null constructor
+ * Sets table_id to "invalid"
+ */
+PacketTable::PacketTable() : table_id{H5I_INVALID_HID}
+{
+}
+
/* "Open" Constructor
* Opens an existing packet table, which can contain either fixed-length or
* variable-length packets.
*/
-PacketTable::PacketTable(hid_t fileID, const char *name) { table_id = H5PTopen(fileID, name); }
+PacketTable::PacketTable(hid_t fileID, const char *name) : table_id{H5PTopen(fileID, name)}
+{
+}
/* "Open" Constructor - will be deprecated because of char* name */
-PacketTable::PacketTable(hid_t fileID, char *name) { table_id = H5PTopen(fileID, name); }
+PacketTable::PacketTable(hid_t fileID, char *name) : table_id{H5PTopen(fileID, name)}
+{
+}
/* Destructor
* Cleans up the packet table
*/
-PacketTable::~PacketTable() { H5PTclose(table_id); }
+PacketTable::~PacketTable()
+{
+ H5PTclose(table_id);
+}
/* IsValid
* Returns true if this packet table is valid, false otherwise.
@@ -48,12 +62,9 @@ PacketTable::~PacketTable() { H5PTclose(table_id); }
* any trouble making or opening the packet table.
*/
bool
-PacketTable::IsValid()
+PacketTable::IsValid() const
{
- if (H5PTis_valid(table_id) == 0)
- return true;
- else
- return false;
+ return H5PTis_valid(table_id) == 0;
}
/* IsVariableLength
@@ -61,7 +72,7 @@ PacketTable::IsValid()
* and 0, otherwise. Returns -1 if the table is invalid (not open).
*/
int
-PacketTable::IsVariableLength()
+PacketTable::IsVariableLength() const
{
return H5PTis_varlen(table_id);
}
@@ -70,7 +81,7 @@ PacketTable::IsVariableLength()
* Sets the index to point to the first packet in the packet table
*/
void
-PacketTable::ResetIndex()
+PacketTable::ResetIndex() const
{
H5PTcreate_index(table_id);
}
@@ -80,7 +91,7 @@ PacketTable::ResetIndex()
* Returns 0 on success, negative on failure (if index is out of bounds)
*/
int
-PacketTable::SetIndex(hsize_t index)
+PacketTable::SetIndex(hsize_t index) const
{
return H5PTset_index(table_id, index);
}
@@ -90,7 +101,7 @@ PacketTable::SetIndex(hsize_t index)
* Returns 0 on success, negative on failure (if index is out of bounds)
*/
hsize_t
-PacketTable::GetIndex(int &error)
+PacketTable::GetIndex(int &error) const
{
hsize_t index;
@@ -107,7 +118,7 @@ PacketTable::GetIndex(int &error)
* error is set to negative.
*/
hsize_t
-PacketTable::GetPacketCount(int &error)
+PacketTable::GetPacketCount(int &error) const
{
hsize_t npackets;
@@ -119,7 +130,7 @@ PacketTable::GetPacketCount(int &error)
* Returns the identifier of the packet table
*/
hid_t
-PacketTable::GetTableId()
+PacketTable::GetTableId() const
{
return table_id;
}
@@ -131,7 +142,7 @@ PacketTable::GetTableId()
* the desired functionality cannot be performed via the packet table ID.
*/
hid_t
-PacketTable::GetDatatype()
+PacketTable::GetDatatype() const
{
return H5PTget_type(table_id);
}
@@ -143,7 +154,7 @@ PacketTable::GetDatatype()
* the desired functionality cannot be performed via the packet table ID.
*/
hid_t
-PacketTable::GetDataset()
+PacketTable::GetDataset() const
{
return H5PTget_dataset(table_id);
}
@@ -155,7 +166,7 @@ PacketTable::GetDataset()
* Returns 0 on success, negative on error.
*/
int
-PacketTable::FreeBuff(size_t numStructs, hvl_t *buffer)
+PacketTable::FreeBuff(size_t numStructs, hvl_t *buffer) const
{
return H5PTfree_vlen_buff(table_id, numStructs, buffer);
}
@@ -206,10 +217,14 @@ FL_PacketTable::FL_PacketTable(hid_t fileID, char *name, hid_t dtypeID, hsize_t
* Opens an existing fixed-length packet table.
* Fails if the packet table specified is variable-length.
*/
-FL_PacketTable::FL_PacketTable(hid_t fileID, const char *name) : PacketTable(fileID, name) {}
+FL_PacketTable::FL_PacketTable(hid_t fileID, const char *name) : PacketTable(fileID, name)
+{
+}
/* "Open" Constructor - will be deprecated because of char* name */
-FL_PacketTable::FL_PacketTable(hid_t fileID, char *name) : PacketTable(fileID, name) {}
+FL_PacketTable::FL_PacketTable(hid_t fileID, char *name) : PacketTable(fileID, name)
+{
+}
/* AppendPacket
* Adds a single packet to the packet table. Takes a pointer
@@ -258,7 +273,7 @@ FL_PacketTable::GetPackets(hsize_t startIndex, hsize_t endIndex, void *data)
if (startIndex > endIndex)
return -1;
- return H5PTread_packets(table_id, startIndex, (size_t)(endIndex - startIndex + 1), data);
+ return H5PTread_packets(table_id, startIndex, static_cast<size_t>(endIndex - startIndex + 1), data);
}
/* GetNextPacket (single packet)
diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h
index 825caf7..c1f1eb5 100644
--- a/hl/c++/src/H5PacketTable.h
+++ b/hl/c++/src/H5PacketTable.h
@@ -31,9 +31,9 @@
class H5_HLCPPDLL PacketTable {
public:
/* Null constructor
- * Sets table_id to "invalid"
+ * Sets table_id to H5I_INVALID_HID
*/
- PacketTable() { table_id = H5I_BADID; }
+ PacketTable();
/* "Open" Constructor
* Opens an existing packet table, which can contain either fixed-length or
@@ -54,39 +54,39 @@ class H5_HLCPPDLL PacketTable {
* Use this after the constructor to ensure HDF did not have
* any trouble making or opening the packet table.
*/
- bool IsValid();
+ bool IsValid() const;
/* IsVariableLength
* Return 1 if this packet table uses variable-length datatype,
* return 0 if it is Fixed Length. Returns -1 if the table is
* invalid (not open).
*/
- int IsVariableLength();
+ int IsVariableLength() const;
/* ResetIndex
* Sets the "current packet" index to point to the first packet in the
* packet table
*/
- void ResetIndex();
+ void ResetIndex() const;
/* SetIndex
* Sets the current packet to point to the packet specified by index.
* Returns 0 on success, negative on failure (if index is out of bounds)
*/
- int SetIndex(hsize_t index);
+ int SetIndex(hsize_t index) const;
/* GetIndex
* Returns the position of the current packet.
* On failure, returns 0 and error is set to negative.
*/
- hsize_t GetIndex(int &error);
+ hsize_t GetIndex(int &error) const;
/* GetPacketCount
* Returns the number of packets in the packet table. Error
* is set to 0 on success. On failure, returns 0 and
* error is set to negative.
*/
- hsize_t GetPacketCount(int &error);
+ hsize_t GetPacketCount(int &error) const;
hsize_t
GetPacketCount()
@@ -98,7 +98,7 @@ class H5_HLCPPDLL PacketTable {
/* GetTableId
* Returns the identifier of the packet table.
*/
- hid_t GetTableId();
+ hid_t GetTableId() const;
/* GetDatatype
* Returns the datatype identifier used by the packet table, on success,
@@ -106,7 +106,7 @@ class H5_HLCPPDLL PacketTable {
* Note: it is best to avoid using this identifier in applications, unless
* the desired functionality cannot be performed via the packet table ID.
*/
- hid_t GetDatatype();
+ hid_t GetDatatype() const;
/* GetDataset
* Returns the dataset identifier associated with the packet table, on
@@ -114,7 +114,7 @@ class H5_HLCPPDLL PacketTable {
* Note: it is best to avoid using this identifier in applications, unless
* the desired functionality cannot be performed via the packet table ID.
*/
- hid_t GetDataset();
+ hid_t GetDataset() const;
/* FreeBuff
* Frees the buffers created when variable-length packets are read.
@@ -122,7 +122,7 @@ class H5_HLCPPDLL PacketTable {
* location in memory.
* Returns 0 on success, negative on error.
*/
- int FreeBuff(size_t numStructs, hvl_t *buffer);
+ int FreeBuff(size_t numStructs, hvl_t *buffer) const;
protected:
hid_t table_id;
@@ -163,7 +163,9 @@ class H5_HLCPPDLL FL_PacketTable : virtual public PacketTable {
/* Destructor
* Cleans up the packet table
*/
- virtual ~FL_PacketTable() {}
+ virtual ~FL_PacketTable()
+ {
+ }
/* AppendPacket
* Adds a single packet to the packet table. Takes a pointer
diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp
index bf60402..ab49303 100644
--- a/hl/c++/test/ptableTest.cpp
+++ b/hl/c++/test/ptableTest.cpp
@@ -191,7 +191,10 @@ TestCompoundDatatype()
error:
- H5E_BEGIN_TRY { H5Tclose(dtypeID); }
+ H5E_BEGIN_TRY
+ {
+ H5Tclose(dtypeID);
+ }
H5E_END_TRY;
H5_FAILED();
@@ -304,7 +307,7 @@ TestCompress()
if (HDstrncmp(filter_name, "deflate", 7) != 0)
H5_FAILED()
}
- catch (Exception e) {
+ catch (Exception const &) {
H5_FAILED();
return 1;
}
@@ -602,8 +605,8 @@ const int STRING_LENGTH = 19; // including terminating NULL
int
TestHDFFV_9758()
{
- hid_t strtype;
- hid_t compound_type;
+ hid_t strtype = H5I_INVALID_HID;
+ hid_t compound_type = H5I_INVALID_HID;
herr_t err;
struct s1_t {
int a;
@@ -616,11 +619,11 @@ TestHDFFV_9758()
s1_t s1[NUM_PACKETS];
for (hsize_t i = 0; i < NUM_PACKETS; i++) {
- s1[i].a = i;
- s1[i].b = 1.f * static_cast<float>(i * i);
- s1[i].c = 1. / (i + 1);
- HDsprintf(s1[i].d, "string%d", (int)i);
- s1[i].e = 100 + i;
+ s1[i].a = static_cast<int>(i);
+ s1[i].b = 1.0F * static_cast<float>(i * i);
+ s1[i].c = 1.0 / static_cast<double>(i + 1);
+ HDsprintf(s1[i].d, "string%" PRIuHSIZE "", i);
+ s1[i].e = static_cast<int>(100 + i);
}
printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)");
@@ -690,7 +693,7 @@ TestHDFFV_9758()
if (s2.a != s1[i].a || s2.e != s1[i].e)
goto error;
- else if (HDstrcmp(s2.d, s1[i].d))
+ else if (HDstrcmp(s2.d, s1[i].d) != 0)
goto error;
}
} // end of ptable block
diff --git a/hl/examples/ex_table_01.c b/hl/examples/ex_table_01.c
index 8635acf..3294ef4 100644
--- a/hl/examples/ex_table_01.c
+++ b/hl/examples/ex_table_01.c
@@ -50,10 +50,10 @@ main(void)
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};
/* Define an array of Particles */
- Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
diff --git a/hl/examples/ex_table_02.c b/hl/examples/ex_table_02.c
index 9c476b3..fb2cad6 100644
--- a/hl/examples/ex_table_02.c
+++ b/hl/examples/ex_table_02.c
@@ -42,10 +42,10 @@ main(void)
Particle dst_buf[NRECORDS + NRECORDS_ADD];
/* Define an array of Particles */
- Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/* Calculate the size and the offsets of our struct members in memory */
size_t dst_size = sizeof(Particle);
@@ -66,7 +66,7 @@ main(void)
int i;
/* Append particles */
- Particle particle_in[NRECORDS_ADD] = {{"eight", 80, 80, 8.0f, 80.0}, {"nine", 90, 90, 9.0f, 90.0}};
+ Particle particle_in[NRECORDS_ADD] = {{"eight", 80, 80, 8.0F, 80.0}, {"nine", 90, 90, 9.0F, 90.0}};
/* Initialize the field field_type */
string_type = H5Tcopy(H5T_C_S1);
diff --git a/hl/examples/ex_table_03.c b/hl/examples/ex_table_03.c
index 31cf970..3caa45e 100644
--- a/hl/examples/ex_table_03.c
+++ b/hl/examples/ex_table_03.c
@@ -46,14 +46,14 @@ main(void)
size_t dst_offset[NFIELDS] = {HOFFSET(Particle, name), HOFFSET(Particle, lati), HOFFSET(Particle, longi),
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
- Particle p = {"zero", 0, 0, 0.0f, 0.0};
+ Particle p = {"zero", 0, 0, 0.0F, 0.0};
size_t dst_sizes[NFIELDS] = {sizeof(p.name), sizeof(p.lati), sizeof(p.longi), sizeof(p.pressure),
sizeof(p.temperature)};
/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
/* Fill value particle */
- Particle fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}};
+ Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
hid_t field_type[NFIELDS];
hid_t string_type;
hid_t file_id;
@@ -63,7 +63,7 @@ main(void)
int i;
/* Define 2 new particles to write */
- Particle particle_in[NRECORDS_WRITE] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0}};
+ Particle particle_in[NRECORDS_WRITE] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0}};
/* Initialize the field field_type */
string_type = H5Tcopy(H5T_C_S1);
diff --git a/hl/examples/ex_table_04.c b/hl/examples/ex_table_04.c
index 863fe15..9b39ef7 100644
--- a/hl/examples/ex_table_04.c
+++ b/hl/examples/ex_table_04.c
@@ -65,23 +65,23 @@ main(void)
hid_t string_type;
hid_t file_id;
hsize_t chunk_size = 10;
- Particle fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}}; /* Fill value particle */
+ Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
hsize_t start; /* Record to start reading/writing */
hsize_t nrecords; /* Number of records to read/write */
int compress = 0;
int i;
Particle *p_data = NULL; /* Initially no data */
float pressure_in[NRECORDS_ADD] = /* Define new values for the field "Pressure" */
- {0.0f, 1.0f, 2.0f};
+ {0.0F, 1.0F, 2.0F};
Position position_in[NRECORDS_ADD] = {/* Define new values for "Latitude,Longitude" */
{0, 0},
{10, 10},
{20, 20}};
NamePressure namepre_in[NRECORDS_ADD] = /* Define new values for "Name,Pressure" */
{
- {"zero", 0.0f},
- {"one", 1.0f},
- {"two", 2.0f},
+ {"zero", 0.0F},
+ {"one", 1.0F},
+ {"two", 2.0F},
};
size_t field_sizes_pos[2] = {sizeof(position_in[0].longi), sizeof(position_in[0].lati)};
size_t field_sizes_pre[1] = {sizeof(namepre_in[0].pressure)};
diff --git a/hl/examples/ex_table_05.c b/hl/examples/ex_table_05.c
index 337bfb6..cac406b 100644
--- a/hl/examples/ex_table_05.c
+++ b/hl/examples/ex_table_05.c
@@ -64,7 +64,7 @@ main(void)
hid_t string_type;
hid_t file_id;
hsize_t chunk_size = 10;
- Particle fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}}; /* Fill value particle */
+ Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
int compress = 0;
hsize_t nfields;
hsize_t start; /* Record to start reading/writing */
@@ -72,7 +72,7 @@ main(void)
int i;
/* Define new values for the field "Pressure" */
- float pressure_in[NRECORDS_ADD] = {0.0f, 1.0f, 2.0f};
+ float pressure_in[NRECORDS_ADD] = {0.0F, 1.0F, 2.0F};
int field_index_pre[1] = {3};
int field_index_pos[2] = {1, 2};
diff --git a/hl/examples/ex_table_06.c b/hl/examples/ex_table_06.c
index f6b67c8..cc1bc01 100644
--- a/hl/examples/ex_table_06.c
+++ b/hl/examples/ex_table_06.c
@@ -49,7 +49,7 @@ main(void)
hid_t string_type;
hid_t file_id;
hsize_t chunk_size = 10;
- Particle fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}}; /* Fill value particle */
+ Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
int compress = 0;
hsize_t nfields_out;
hsize_t nrecords_out;
diff --git a/hl/examples/ex_table_07.c b/hl/examples/ex_table_07.c
index ab36613..e05a681 100644
--- a/hl/examples/ex_table_07.c
+++ b/hl/examples/ex_table_07.c
@@ -44,10 +44,10 @@ main(void)
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
/* Define an array of Particles */
- Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
const char *field_names[NFIELDS] = /* Define field information */
{"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
@@ -56,7 +56,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
- Particle fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}};
+ Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
hsize_t start; /* Record to start reading */
hsize_t nrecords; /* Number of records to insert/delete */
hsize_t nfields_out;
diff --git a/hl/examples/ex_table_08.c b/hl/examples/ex_table_08.c
index 5d447dd..1063172 100644
--- a/hl/examples/ex_table_08.c
+++ b/hl/examples/ex_table_08.c
@@ -41,10 +41,10 @@ main(void)
Particle dst_buf[NRECORDS + NRECORDS_INS];
/* Define an array of Particles */
- Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/* Calculate the size and the offsets of our struct members in memory */
size_t dst_size = sizeof(Particle);
@@ -54,7 +54,7 @@ main(void)
sizeof(p_data[0].pressure), sizeof(p_data[0].temperature)};
/* Define an array of Particles to insert */
- Particle p_data_insert[NRECORDS_INS] = {{"new", 30, 30, 3.0f, 30.0}, {"new", 40, 40, 4.0f, 40.0}};
+ Particle p_data_insert[NRECORDS_INS] = {{"new", 30, 30, 3.0F, 30.0}, {"new", 40, 40, 4.0F, 40.0}};
/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
diff --git a/hl/examples/ex_table_09.c b/hl/examples/ex_table_09.c
index 381925f..171de2e 100644
--- a/hl/examples/ex_table_09.c
+++ b/hl/examples/ex_table_09.c
@@ -49,10 +49,10 @@ main(void)
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};
/* Define an array of Particles */
- Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
@@ -61,7 +61,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
- Particle fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}}; /* Fill value particle */
+ Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}}; /* Fill value particle */
hsize_t start1; /* Record to start reading from 1st table */
hsize_t nrecords; /* Number of records to insert */
hsize_t start2; /* Record to start writing in 2nd table */
diff --git a/hl/examples/ex_table_10.c b/hl/examples/ex_table_10.c
index 4ba5d64..c974e84 100644
--- a/hl/examples/ex_table_10.c
+++ b/hl/examples/ex_table_10.c
@@ -40,10 +40,10 @@ main(void)
} Particle;
/* Define an array of Particles */
- Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
Particle dst_buf[2 * NRECORDS];
/* Calculate the size and the offsets of our struct members in memory */
diff --git a/hl/examples/ex_table_11.c b/hl/examples/ex_table_11.c
index 9bf3927..6b38b95 100644
--- a/hl/examples/ex_table_11.c
+++ b/hl/examples/ex_table_11.c
@@ -38,10 +38,10 @@ main(void)
} Particle1;
/* Define an array of Particles */
- Particle1 p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle1 p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/* Calculate the size and the offsets of our struct members in memory */
size_t dst_size1 = sizeof(Particle1);
@@ -56,7 +56,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
- Particle1 fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}};
+ Particle1 fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
int fill_data_new[1] = {-100};
hsize_t position;
hsize_t nfields_out;
diff --git a/hl/examples/ex_table_12.c b/hl/examples/ex_table_12.c
index 3e7c27a..a1a2c54 100644
--- a/hl/examples/ex_table_12.c
+++ b/hl/examples/ex_table_12.c
@@ -44,10 +44,10 @@ main(void)
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
/* Define an array of Particles */
- Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0}, {"one", 10, 10, 1.0f, 10.0},
- {"two", 20, 20, 2.0f, 20.0}, {"three", 30, 30, 3.0f, 30.0},
- {"four", 40, 40, 4.0f, 40.0}, {"five", 50, 50, 5.0f, 50.0},
- {"six", 60, 60, 6.0f, 60.0}, {"seven", 70, 70, 7.0f, 70.0}};
+ Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"four", 40, 40, 4.0F, 40.0}, {"five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
@@ -56,7 +56,7 @@ main(void)
hid_t file_id;
hsize_t chunk_size = 10;
int compress = 0;
- Particle fill_data[1] = {{"no data", -1, -1, -99.0f, -99.0}};
+ Particle fill_data[1] = {{"no data", -1, -1, -99.0F, -99.0}};
hsize_t nfields_out;
hsize_t nrecords_out;
diff --git a/hl/fortran/COPYING b/hl/fortran/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/hl/fortran/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 0b7795b..973299f 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -114,15 +114,15 @@ set (HDF5_HL_F90_F_BASE_SOURCES
)
if (NOT ONLY_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
+ add_custom_command (TARGET H5HL_buildiface POST_BUILD
+ BYPRODUCTS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static
DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files"
)
add_custom_target (H5HLgen ALL
- DEPENDS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
+ DEPENDS H5HL_buildiface ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
)
set_source_files_properties (
${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90
@@ -131,15 +131,15 @@ if (NOT ONLY_SHARED_LIBS)
)
endif ()
if (BUILD_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90
+ add_custom_command (TARGET H5HL_buildiface POST_BUILD
+ BYPRODUCTS ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/shared
DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files"
)
add_custom_target (H5HLgenSH ALL
- DEPENDS ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90
+ DEPENDS H5HL_buildiface ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90
)
set_source_files_properties (
${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90
@@ -343,17 +343,21 @@ set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSI
configure_file (
${HDF_CONFIG_DIR}/libhdf5.pc.in
- ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_F90_LIB_CORENAME}.pc
@ONLY
)
install (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_F90_LIB_CORENAME}.pc
DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
COMPONENT hlfortlibraries
)
if (NOT WIN32 AND NOT MINGW)
- set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER})
+ if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND)
+ set (_PKG_CONFIG_COMPILER ${MPI_Fortran_COMPILER})
+ else ()
+ set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER})
+ endif ()
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
${HDF5_BINARY_DIR}/CMakeFiles/h5hlfc
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index 785bdcf..a97d6fa 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -142,17 +142,21 @@ set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}"
configure_file (
${HDF_CONFIG_DIR}/libhdf5.pc.in
- ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}.pc
@ONLY
)
install (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}.pc
DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
COMPONENT hllibraries
)
if (NOT WIN32 AND NOT MINGW)
- set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER})
+ else ()
+ set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
+ endif ()
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
${HDF5_BINARY_DIR}/CMakeFiles/h5hlcc
@@ -165,3 +169,32 @@ if (NOT WIN32 AND NOT MINGW)
COMPONENT hllibraries
)
endif ()
+
+#-----------------------------------------------------------------------------
+# Option to build documentation
+#-----------------------------------------------------------------------------
+if (DOXYGEN_FOUND)
+# This cmake function requires that the non-default doxyfile settings are provided with set (DOXYGEN_xxx) commands
+# In addition the doxyfile aliases @INCLUDE option is not supported and would need to be provided in a set (DOXYGEN_ALIASES) command.
+# doxygen_add_docs (hdf5lib_doc
+## ${HL_SOURCES} ${HL_HEADERS} ${HDF5_DOXYGEN_DIR}/dox
+# ${DOXYGEN_INPUT_DIRECTORY}
+# ALL
+# WORKING_DIRECTORY ${HDF5_HL_SRC_DIR}
+# COMMENT "Generating HDF5 HL library Source Documentation"
+# )
+
+# This custom target and doxygen/configure work together
+ # Replace variables inside @@ with the current values
+ add_custom_target (hdf5hllib_doc ALL
+ COMMAND ${DOXYGEN_EXECUTABLE} ${HDF5_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${HDF5_HL_SRC_DIR}
+ COMMENT "Generating HDF5 HL library Source API documentation with Doxygen"
+ VERBATIM )
+
+ if (NOT TARGET doxygen)
+ add_custom_target (doxygen)
+ endif ()
+
+ add_dependencies (doxygen hdf5hllib_doc)
+endif ()
diff --git a/hl/src/COPYING b/hl/src/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/hl/src/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 00feb4a..2bd4046 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -2215,7 +2215,10 @@ H5DS_get_REFLIST_type(void)
return ntid_t;
out:
- H5E_BEGIN_TRY { H5Tclose(ntid_t); }
+ H5E_BEGIN_TRY
+ {
+ H5Tclose(ntid_t);
+ }
H5E_END_TRY;
return FAIL;
}
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index 310d665..ff10d57 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -169,6 +169,11 @@ find_palette(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const
if (name == NULL)
return -1;
+ /* Shut compiler up */
+ (void)loc_id;
+ (void)ainfo;
+ (void)op_data;
+
/* Define a positive value for return value if the attribute was found. This will
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c
index 1307fda..8bfd0d6 100644
--- a/hl/src/H5LD.c
+++ b/hl/src/H5LD.c
@@ -303,7 +303,10 @@ H5LD_get_dset_dims(hid_t did, hsize_t *cur_dims)
ret_value = SUCCEED;
done:
- H5E_BEGIN_TRY { H5Sclose(sid); }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ }
H5E_END_TRY;
return (ret_value);
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 6478a96..8f2b33f 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -822,7 +822,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
char file_name[64]; /* Filename buffer */
size_t alloc_incr; /* Buffer allocation increment */
size_t min_incr = 65536; /* Minimum buffer increment */
- double buf_prcnt = 0.1f; /* Percentage of buffer size to set
+ double buf_prcnt = 0.1; /* Percentage of buffer size to set
as increment */
static long file_name_counter;
H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy, &image_realloc, &image_free,
@@ -907,7 +907,10 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
return file_id;
out:
- H5E_BEGIN_TRY { H5Pclose(fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
H5E_END_TRY;
return -1;
} /* end H5LTopen_file_image() */
@@ -1309,6 +1312,10 @@ find_dataset(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const
if (name == NULL)
return ret;
+ /* Shut the compiler up */
+ (void)loc_id;
+ (void)linfo;
+
/* Define a positive value for return value if the dataset was found. This will
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
@@ -1345,13 +1352,13 @@ find_dataset(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const
* modify the op_data buffer (i.e.: dset_name) during the traversal, and the
* library never modifies that buffer.
*/
-H5_GCC_DIAG_OFF("cast-qual")
+H5_GCC_CLANG_DIAG_OFF("cast-qual")
herr_t
H5LTfind_dataset(hid_t loc_id, const char *dset_name)
{
return H5Literate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name);
}
-H5_GCC_DIAG_ON("cast-qual")
+H5_GCC_CLANG_DIAG_ON("cast-qual")
/*-------------------------------------------------------------------------
*
@@ -1769,6 +1776,32 @@ H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam
}
/*-------------------------------------------------------------------------
+ * Function: H5LTset_attribute_ullong
+ *
+ * Purpose: Create and write an attribute.
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Alessandro Felder
+ *
+ * Date: August 27, 2021
+ *
+ * Comments:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ const unsigned long long *data, size_t size)
+{
+
+ if (H5LT_set_attribute_numerical(loc_id, obj_name, attr_name, size, H5T_NATIVE_ULLONG, data) < 0)
+ return -1;
+
+ return 0;
+}
+
+/*-------------------------------------------------------------------------
* Function: H5LTset_attribute_float
*
* Purpose: Create and write an attribute.
@@ -1847,6 +1880,10 @@ find_attr(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5
if (name == NULL)
return H5_ITER_CONT;
+ /* Shut compiler up */
+ (void)loc_id;
+ (void)ainfo;
+
/* Define a positive value for return value if the attribute was found. This will
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
@@ -1908,13 +1945,13 @@ H5LTfind_attribute(hid_t loc_id, const char *attr_name)
* modify the op_data buffer (i.e.: attr_name) during the traversal, and the
* library never modifies that buffer.
*/
-H5_GCC_DIAG_OFF("cast-qual")
+H5_GCC_CLANG_DIAG_OFF("cast-qual")
herr_t
H5LT_find_attribute(hid_t loc_id, const char *attr_name)
{
return H5Aiterate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, find_attr, (void *)attr_name);
}
-H5_GCC_DIAG_ON("cast-qual")
+H5_GCC_CLANG_DIAG_ON("cast-qual")
/*-------------------------------------------------------------------------
* Function: H5LTget_attribute_ndims
@@ -2135,19 +2172,28 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str
size_t size_str_to_add, size_str;
if (_no_user_buf) {
+ char *tmp_realloc;
+
+ if (!buf)
+ goto out;
+
/* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */
if (str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) {
*len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT;
- buf = (char *)HDrealloc(buf, *len);
}
else if (!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) {
*len += INCREMENT;
- buf = (char *)HDrealloc(buf, *len);
}
- }
- if (!buf)
- goto out;
+ tmp_realloc = (char *)HDrealloc(buf, *len);
+ if (tmp_realloc == NULL) {
+ HDfree(buf);
+ buf = NULL;
+ goto out;
+ }
+ else
+ buf = tmp_realloc;
+ }
if (str_to_add) {
/* find the size of the buffer to add */
@@ -2160,7 +2206,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str
*/
if (size_str < *len - 1) {
if (size_str + size_str_to_add < *len - 1) {
- HDstrncat(buf, str_to_add, size_str_to_add);
+ HDstrcat(buf, str_to_add);
}
else {
HDstrncat(buf, str_to_add, (*len - 1) - size_str);
@@ -2363,9 +2409,9 @@ out:
herr_t
H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len)
{
- size_t str_len = INCREMENT;
- char * text_str;
- herr_t ret = SUCCEED;
+ size_t str_len = INCREMENT;
+ char * text_str = NULL;
+ herr_t ret = SUCCEED;
if (lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG)
goto out;
@@ -2389,6 +2435,8 @@ H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len)
return ret;
out:
+ HDfree(text_str);
+
return FAIL;
}
@@ -2768,10 +2816,14 @@ next:
if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
stmp = (char *)HDcalloc(super_len, sizeof(char));
- if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
+ if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) {
+ HDfree(stmp);
goto out;
- if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp)))
+ }
+ if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) {
+ HDfree(stmp);
goto out;
+ }
if (stmp)
HDfree(stmp);
@@ -2811,10 +2863,14 @@ next:
if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
stmp = (char *)HDcalloc(super_len, sizeof(char));
- if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
+ if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) {
+ HDfree(stmp);
goto out;
- if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp)))
+ }
+ if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) {
+ HDfree(stmp);
goto out;
+ }
if (stmp)
HDfree(stmp);
@@ -2868,10 +2924,14 @@ next:
if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0)
goto out;
stmp = (char *)HDcalloc(super_len, sizeof(char));
- if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0)
+ if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) {
+ HDfree(stmp);
goto out;
- if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp)))
+ }
+ if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) {
+ HDfree(stmp);
goto out;
+ }
if (stmp)
HDfree(stmp);
stmp = NULL;
@@ -2922,10 +2982,14 @@ next:
if (H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0)
goto out;
mtmp = (char *)HDcalloc(mlen, sizeof(char));
- if (H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0)
+ if (H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) {
+ HDfree(mtmp);
goto out;
- if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp)))
+ }
+ if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp))) {
+ HDfree(mtmp);
goto out;
+ }
if (mtmp)
HDfree(mtmp);
mtmp = NULL;
@@ -3279,6 +3343,33 @@ H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam
}
/*-------------------------------------------------------------------------
+ * Function: H5LTget_attribute_ullong
+ *
+ * Purpose: Reads an attribute named attr_name
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Alessandro Felder
+ *
+ * Date: August 27, 2021
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, unsigned long long *data)
+{
+ /* Get the attribute */
+ if (H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_ULLONG, data) < 0)
+ return -1;
+
+ return 0;
+}
+
+/*-------------------------------------------------------------------------
* Function: H5LTget_attribute_float
*
* Purpose: Reads an attribute named attr_name
diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c
index 6673f5f..875a37a 100644
--- a/hl/src/H5LTanalyze.c
+++ b/hl/src/H5LTanalyze.c
@@ -10,11 +10,11 @@
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wstrict-overflow"
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#if !defined (__clang__)
+#if !defined (__clang__)
#pragma GCC diagnostic ignored "-Wlarger-than="
#pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
-#endif
+#endif
#pragma GCC diagnostic ignored "-Wswitch-default"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-macros"
@@ -28,9 +28,9 @@
#elif defined _MSC_VER
#pragma warning(push, 1)
#endif
-#line 2 "hl/src/H5LTanalyze.c"
+#line 1 "hl/src/H5LTanalyze.c"
-#line 4 "hl/src/H5LTanalyze.c"
+#line 3 "hl/src/H5LTanalyze.c"
#define YY_INT_ALIGNED short int
@@ -38,11 +38,17 @@
#define yy_create_buffer H5LTyy_create_buffer
#define yy_delete_buffer H5LTyy_delete_buffer
-#define yy_flex_debug H5LTyy_flex_debug
+#define yy_scan_buffer H5LTyy_scan_buffer
+#define yy_scan_string H5LTyy_scan_string
+#define yy_scan_bytes H5LTyy_scan_bytes
#define yy_init_buffer H5LTyy_init_buffer
#define yy_flush_buffer H5LTyy_flush_buffer
#define yy_load_buffer_state H5LTyy_load_buffer_state
#define yy_switch_to_buffer H5LTyy_switch_to_buffer
+#define yypush_buffer_state H5LTyypush_buffer_state
+#define yypop_buffer_state H5LTyypop_buffer_state
+#define yyensure_buffer_stack H5LTyyensure_buffer_stack
+#define yy_flex_debug H5LTyy_flex_debug
#define yyin H5LTyyin
#define yyleng H5LTyyleng
#define yylex H5LTyylex
@@ -57,12 +63,246 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define H5LTyy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer H5LTyy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define H5LTyy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer H5LTyy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define H5LTyy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer H5LTyy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define H5LTyy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string H5LTyy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define H5LTyy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes H5LTyy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define H5LTyy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer H5LTyy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define H5LTyy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer H5LTyy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define H5LTyy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state H5LTyy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define H5LTyy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer H5LTyy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define H5LTyypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state H5LTyypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define H5LTyypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state H5LTyypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define H5LTyyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack H5LTyyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define H5LTyylex_ALREADY_DEFINED
+#else
+#define yylex H5LTyylex
+#endif
+
+#ifdef yyrestart
+#define H5LTyyrestart_ALREADY_DEFINED
+#else
+#define yyrestart H5LTyyrestart
+#endif
+
+#ifdef yylex_init
+#define H5LTyylex_init_ALREADY_DEFINED
+#else
+#define yylex_init H5LTyylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define H5LTyylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra H5LTyylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define H5LTyylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy H5LTyylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define H5LTyyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug H5LTyyget_debug
+#endif
+
+#ifdef yyset_debug
+#define H5LTyyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug H5LTyyset_debug
+#endif
+
+#ifdef yyget_extra
+#define H5LTyyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra H5LTyyget_extra
+#endif
+
+#ifdef yyset_extra
+#define H5LTyyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra H5LTyyset_extra
+#endif
+
+#ifdef yyget_in
+#define H5LTyyget_in_ALREADY_DEFINED
+#else
+#define yyget_in H5LTyyget_in
+#endif
+
+#ifdef yyset_in
+#define H5LTyyset_in_ALREADY_DEFINED
+#else
+#define yyset_in H5LTyyset_in
+#endif
+
+#ifdef yyget_out
+#define H5LTyyget_out_ALREADY_DEFINED
+#else
+#define yyget_out H5LTyyget_out
+#endif
+
+#ifdef yyset_out
+#define H5LTyyset_out_ALREADY_DEFINED
+#else
+#define yyset_out H5LTyyset_out
+#endif
+
+#ifdef yyget_leng
+#define H5LTyyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng H5LTyyget_leng
+#endif
+
+#ifdef yyget_text
+#define H5LTyyget_text_ALREADY_DEFINED
+#else
+#define yyget_text H5LTyyget_text
+#endif
+
+#ifdef yyget_lineno
+#define H5LTyyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno H5LTyyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define H5LTyyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno H5LTyyset_lineno
+#endif
+
+#ifdef yywrap
+#define H5LTyywrap_ALREADY_DEFINED
+#else
+#define yywrap H5LTyywrap
+#endif
+
+#ifdef yyalloc
+#define H5LTyyalloc_ALREADY_DEFINED
+#else
+#define yyalloc H5LTyyalloc
+#endif
+
+#ifdef yyrealloc
+#define H5LTyyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc H5LTyyrealloc
+#endif
+
+#ifdef yyfree
+#define H5LTyyfree_ALREADY_DEFINED
+#else
+#define yyfree H5LTyyfree
+#endif
+
+#ifdef yytext
+#define H5LTyytext_ALREADY_DEFINED
+#else
+#define yytext H5LTyytext
+#endif
+
+#ifdef yyleng
+#define H5LTyyleng_ALREADY_DEFINED
+#else
+#define yyleng H5LTyyleng
+#endif
+
+#ifdef yyin
+#define H5LTyyin_ALREADY_DEFINED
+#else
+#define yyin H5LTyyin
+#endif
+
+#ifdef yyout
+#define H5LTyyout_ALREADY_DEFINED
+#else
+#define yyout H5LTyyout
+#endif
+
+#ifdef yy_flex_debug
+#define H5LTyy_flex_debug_ALREADY_DEFINED
+#else
+#define yy_flex_debug H5LTyy_flex_debug
+#endif
+
+#ifdef yylineno
+#define H5LTyylineno_ALREADY_DEFINED
+#else
+#define yylineno H5LTyylineno
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -96,7 +336,6 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@@ -104,7 +343,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -135,63 +373,61 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
+#endif /* ! C99 */
-#define YY_USE_CONST
+#endif /* ! FLEXINT_H */
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+/* begin standard C++ headers. */
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE H5LTyyrestart(H5LTyyin )
-
+#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -208,30 +444,30 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
typedef size_t yy_size_t;
#endif
-extern yy_size_t H5LTyyleng;
+extern int yyleng;
-extern FILE *H5LTyyin, *H5LTyyout;
+extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-
+
#define YY_LESS_LINENO(n)
+ #define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up H5LTyytext. */ \
+ /* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up H5LTyytext again */ \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -246,12 +482,12 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- yy_size_t yy_n_chars;
+ int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -274,7 +510,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -291,8 +527,8 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via H5LTyyrestart()), so that the user can continue scanning by
- * just pointing H5LTyyin at a new input file.
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -302,7 +538,7 @@ struct yy_buffer_state
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
@@ -313,105 +549,100 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-/* yy_hold_char holds the character lost when H5LTyytext is formed. */
+/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
-static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
-yy_size_t H5LTyyleng;
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+int yyleng;
/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
+static char *yy_c_buf_p = NULL;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
-/* Flag which is used to allow H5LTyywrap()'s to do buffer switches
- * instead of setting up a fresh H5LTyyin. A bit of a hack ...
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
-void H5LTyyrestart (FILE *input_file );
-void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE H5LTyy_create_buffer (FILE *file,int size );
-void H5LTyy_delete_buffer (YY_BUFFER_STATE b );
-void H5LTyy_flush_buffer (YY_BUFFER_STATE b );
-void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer );
-void H5LTyypop_buffer_state (void );
-
-static void H5LTyyensure_buffer_stack (void );
-static void H5LTyy_load_buffer_state (void );
-static void H5LTyy_init_buffer (YY_BUFFER_STATE b,FILE *file );
-
-#define YY_FLUSH_BUFFER H5LTyy_flush_buffer(YY_CURRENT_BUFFER )
+void yyrestart ( FILE *input_file );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
+void yy_delete_buffer ( YY_BUFFER_STATE b );
+void yy_flush_buffer ( YY_BUFFER_STATE b );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
+void yypop_buffer_state ( void );
-YY_BUFFER_STATE H5LTyy_scan_buffer (char *base,yy_size_t size );
-YY_BUFFER_STATE H5LTyy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char *bytes,yy_size_t len );
+static void yyensure_buffer_stack ( void );
+static void yy_load_buffer_state ( void );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
-void *H5LTyyalloc (yy_size_t );
-void *H5LTyyrealloc (void *,yy_size_t );
-void H5LTyyfree (void * );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
-#define yy_new_buffer H5LTyy_create_buffer
+void *yyalloc ( yy_size_t );
+void *yyrealloc ( void *, yy_size_t );
+void yyfree ( void * );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- H5LTyyensure_buffer_stack (); \
+ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- H5LTyyensure_buffer_stack (); \
+ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
+typedef flex_uint8_t YY_CHAR;
-typedef unsigned char YY_CHAR;
-
-FILE *H5LTyyin = (FILE *) 0, *H5LTyyout = (FILE *) 0;
+FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
-extern int H5LTyylineno;
+extern int yylineno;
+int yylineno = 1;
-int H5LTyylineno = 1;
-
-extern char *H5LTyytext;
-#define yytext_ptr H5LTyytext
+extern char *yytext;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
+#define yytext_ptr yytext
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[] );
+static yy_state_type yy_get_previous_state ( void );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
+static int yy_get_next_buffer ( void );
+static void yynoreturn yy_fatal_error ( const char* msg );
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up H5LTyytext.
+ * corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
- H5LTyyleng = (yy_size_t) (yy_cp - yy_bp); \
+ yyleng = (int) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 66
-#define YY_END_OF_BUFFER 67
+#define YY_NUM_RULES 64
+#define YY_END_OF_BUFFER 65
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -419,138 +650,56 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_acclist[437] =
- { 0,
- 64, 64, 64, 64, 67, 66, 64, 66, 64, 65,
- 66, 56, 66, 55, 66, 62, 66, 63, 66, 66,
- 66, 66, 66, 60, 66, 61, 66, 58, 66, 59,
- 66, 57, 66, 57, 64, 66, 57, 64, 65, 66,
- 55, 57, 66, 57, 62, 66, 57, 63, 66, 57,
- 66, 57, 66, 57, 66, 57, 66, 57, 60, 66,
- 57, 61, 66, 57, 58, 66, 57, 59, 66, 64,
- 55, 57, 57, 64, 55, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 38, 38, 57, 57,
- 57, 57, 57, 57, 39, 39, 57, 57, 57, 57,
-
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 37, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 37, 57, 57, 54, 36,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 54, 57, 36, 57, 45, 49,
- 51, 53, 57, 57, 57, 45, 57, 49, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 51, 57, 53,
- 57, 50, 50, 57, 57, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 52, 35, 57, 57,
- 57, 57, 57, 57, 52, 57, 57, 57, 57, 57,
-
- 57, 57, 57, 57, 35, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 48,
- 1, 2, 9, 10, 47, 48, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 57, 57, 57, 57, 57, 1, 57, 2, 57, 57,
- 57, 57, 57, 57, 57, 9, 57, 10, 57, 57,
- 57, 47, 57, 44, 3, 4, 5, 6, 7, 8,
- 11, 12, 13, 14, 15, 16, 57, 44, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
-
- 57, 57, 57, 57, 57, 57, 57, 3, 57, 4,
- 57, 5, 57, 6, 57, 7, 57, 8, 57, 11,
- 57, 12, 57, 13, 57, 14, 57, 15, 57, 16,
- 57, 57, 57, 57, 43, 46, 28, 29, 30, 31,
- 22, 43, 57, 46, 57, 28, 57, 29, 57, 30,
- 57, 31, 57, 57, 57, 57, 22, 57, 57, 57,
- 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
- 57, 17, 24, 23, 41, 17, 57, 57, 57, 57,
- 57, 24, 57, 57, 57, 57, 23, 57, 57, 57,
- 57, 41, 57, 57, 57, 32, 26, 18, 20, 19,
-
- 25, 40, 42, 57, 32, 57, 57, 26, 57, 18,
- 57, 20, 57, 19, 57, 57, 25, 57, 57, 40,
- 57, 42, 57, 33, 27, 21, 33, 57, 57, 27,
- 57, 21, 57, 34, 34, 57
- } ;
-
-static yyconst flex_int16_t yy_accept[546] =
+static const flex_int16_t yy_accept[275] =
{ 0,
- 1, 2, 3, 4, 5, 6, 7, 9, 12, 14,
- 16, 18, 20, 21, 22, 23, 24, 26, 28, 30,
- 32, 34, 37, 41, 44, 47, 50, 52, 54, 56,
- 58, 61, 64, 67, 70, 71, 72, 72, 72, 72,
- 72, 72, 73, 75, 77, 78, 79, 80, 81, 82,
- 82, 82, 82, 82, 82, 83, 84, 85, 86, 87,
- 88, 88, 88, 88, 88, 88, 90, 91, 92, 93,
- 94, 95, 96, 96, 96, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 96, 96, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
-
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 112, 112, 113, 114, 115, 116,
- 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
- 128, 129, 129, 129, 129, 129, 129, 129, 129, 129,
- 129, 129, 129, 129, 129, 129, 130, 131, 132, 133,
- 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
- 144, 145, 147, 149, 149, 149, 149, 150, 151, 151,
- 151, 151, 151, 151, 151, 151, 151, 152, 153, 154,
- 155, 156, 158, 160, 161, 162, 163, 164, 165, 166,
- 167, 168, 170, 172, 173, 173, 173, 173, 173, 173,
-
- 173, 173, 173, 173, 173, 173, 173, 175, 176, 177,
- 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
- 187, 187, 187, 187, 187, 187, 188, 188, 188, 188,
- 188, 188, 188, 188, 188, 189, 189, 189, 189, 190,
- 191, 192, 193, 194, 195, 197, 198, 199, 200, 201,
- 202, 203, 204, 205, 207, 208, 209, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 211, 212,
- 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
- 223, 224, 225, 226, 227, 228, 229, 230, 231, 231,
-
- 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
- 231, 231, 231, 231, 231, 231, 231, 232, 233, 233,
- 233, 233, 233, 233, 233, 234, 235, 235, 235, 236,
- 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
- 248, 249, 250, 251, 252, 253, 254, 255, 256, 258,
- 260, 261, 262, 263, 264, 265, 266, 268, 270, 271,
- 272, 274, 274, 275, 275, 275, 275, 275, 275, 275,
- 275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
- 275, 275, 276, 277, 278, 279, 280, 281, 282, 283,
- 284, 285, 286, 287, 287, 287, 287, 288, 290, 291,
-
- 292, 293, 294, 295, 296, 297, 298, 299, 300, 301,
- 302, 303, 304, 305, 306, 307, 308, 310, 312, 314,
- 316, 318, 320, 322, 324, 326, 328, 330, 332, 333,
- 334, 335, 336, 337, 338, 339, 340, 341, 341, 341,
- 341, 342, 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 344, 346, 348, 350, 352,
- 354, 355, 356, 357, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372, 373, 373,
- 373, 373, 373, 374, 374, 374, 374, 375, 375, 375,
- 375, 376, 376, 376, 378, 379, 380, 381, 382, 384,
-
- 385, 386, 387, 389, 390, 391, 392, 394, 395, 396,
- 396, 397, 397, 398, 399, 400, 401, 401, 402, 402,
- 403, 404, 405, 407, 408, 410, 412, 414, 416, 417,
- 419, 420, 422, 424, 425, 425, 426, 427, 429, 430,
- 432, 434, 435, 437, 437
+ 63, 63, 65, 64, 63, 64, 55, 61, 62, 64,
+ 64, 64, 64, 59, 60, 57, 58, 63, 0, 55,
+ 0, 0, 0, 0, 0, 56, 0, 0, 0, 0,
+ 0, 38, 0, 0, 0, 0, 0, 39, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 37, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 36, 0, 0, 0, 45, 49, 0, 0,
+ 0, 0, 0, 0, 0, 0, 51, 53, 50, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 52, 0, 0,
+ 0, 0, 0, 0, 0, 0, 35, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 2, 0, 0, 0, 0, 0, 0, 9, 10, 0,
+ 0, 47, 0, 44, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 3, 4, 5, 6, 7, 8, 11, 12,
+ 13, 14, 15, 16, 0, 0, 0, 43, 46, 28,
+ 29, 30, 31, 0, 0, 0, 22, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 17, 0, 0, 0, 0, 24, 0, 0, 0, 23,
+ 0, 0, 0, 41, 0, 0, 0, 32, 0, 26,
+ 18, 20, 19, 0, 25, 0, 40, 42, 33, 0,
+ 27, 21, 34, 0
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 5, 6, 7,
- 8, 9, 10, 11, 5, 12, 5, 13, 14, 1,
- 1, 1, 1, 1, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 1, 1, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 1, 1, 35, 36,
- 37, 1, 38, 1, 39, 1, 1, 1, 1, 1,
+ 1, 2, 1, 3, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 4, 5, 6,
+ 7, 8, 9, 10, 4, 11, 4, 12, 13, 1,
+ 1, 1, 1, 1, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 1, 1, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 1, 1, 34, 35,
+ 36, 1, 37, 1, 38, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 40, 1, 41, 1, 1, 1, 1, 1,
+ 1, 1, 39, 1, 40, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -567,313 +716,178 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[42] =
+static const YY_CHAR yy_meta[41] =
{ 0,
- 1, 1, 1, 2, 3, 3, 3, 3, 3, 3,
- 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 2, 3, 3, 3, 3, 3, 3, 3,
+ 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
} ;
-static yyconst flex_int16_t yy_base[547] =
+static const flex_int16_t yy_base[277] =
{ 0,
- 0, 0, 41, 0, 610, 611, 81, 83, 611, 0,
- 611, 611, 56, 599, 580, 575, 611, 611, 611, 611,
- 0, 87, 89, 88, 0, 0, 70, 596, 577, 572,
- 0, 0, 0, 0, 101, 0, 584, 567, 569, 571,
- 569, 0, 103, 0, 579, 562, 564, 566, 564, 561,
- 564, 552, 551, 79, 557, 560, 548, 547, 80, 611,
- 566, 97, 87, 569, 560, 0, 563, 117, 90, 566,
- 557, 611, 549, 99, 552, 550, 557, 560, 546, 541,
- 118, 549, 556, 552, 533, 0, 538, 108, 541, 539,
- 546, 549, 535, 530, 126, 538, 545, 541, 522, 527,
-
- 531, 536, 523, 520, 522, 532, 518, 534, 95, 518,
- 528, 510, 524, 611, 525, 513, 517, 522, 509, 506,
- 508, 518, 504, 520, 97, 504, 514, 496, 510, 0,
- 511, 514, 500, 495, 520, 500, 492, 504, 499, 492,
- 481, 106, 496, 492, 498, 611, 611, 501, 487, 482,
- 507, 487, 479, 491, 486, 479, 468, 123, 483, 479,
- 485, 0, 0, 468, 475, 462, 611, 611, 470, 460,
- 464, 464, 126, 470, 126, 480, 611, 611, 459, 466,
- 453, 0, 0, 461, 451, 455, 455, 130, 461, 129,
- 471, 0, 0, 611, 452, 139, 469, 463, 463, 462,
-
- 158, 165, 459, 446, 450, 461, 0, 443, 141, 460,
- 454, 454, 453, 172, 179, 450, 437, 441, 452, 441,
- 435, 433, 438, 150, 424, 611, 451, 454, 451, 151,
- 448, 451, 448, 165, 611, 432, 440, 430, 427, 421,
- 419, 424, 157, 410, 0, 437, 440, 437, 170, 434,
- 437, 434, 172, 0, 418, 426, 416, 421, 421, 417,
- 397, 428, 425, 180, 177, 183, 186, 414, 413, 190,
- 192, 193, 412, 411, 405, 411, 408, 408, 408, 404,
- 384, 415, 412, 201, 196, 199, 206, 401, 400, 211,
- 212, 213, 399, 398, 392, 398, 395, 611, 390, 400,
-
- 380, 215, 217, 388, 382, 384, 381, 220, 223, 225,
- 387, 386, 385, 384, 383, 382, 611, 611, 381, 380,
- 379, 378, 377, 376, 611, 611, 218, 375, 611, 0,
- 370, 380, 360, 227, 236, 368, 362, 364, 361, 235,
- 241, 244, 367, 366, 365, 364, 363, 362, 0, 0,
- 361, 360, 359, 358, 357, 356, 0, 0, 237, 355,
- 0, 350, 611, 366, 352, 351, 350, 349, 352, 333,
- 338, 332, 336, 335, 335, 338, 332, 336, 331, 155,
- 334, 611, 611, 611, 611, 611, 611, 611, 611, 611,
- 611, 611, 611, 340, 335, 325, 329, 0, 345, 331,
-
- 330, 329, 328, 331, 312, 317, 311, 315, 314, 314,
- 317, 311, 315, 310, 168, 313, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 319, 314,
- 304, 611, 611, 611, 611, 611, 611, 301, 314, 314,
- 611, 295, 301, 305, 310, 294, 308, 290, 294, 294,
- 292, 300, 287, 301, 0, 0, 0, 0, 0, 0,
- 285, 298, 298, 0, 279, 285, 289, 294, 278, 292,
- 274, 278, 278, 276, 284, 271, 285, 611, 275, 266,
- 281, 275, 611, 265, 262, 263, 611, 266, 270, 260,
- 611, 264, 270, 0, 263, 254, 269, 263, 0, 253,
-
- 250, 251, 0, 254, 258, 247, 0, 249, 255, 253,
- 611, 247, 611, 611, 611, 611, 249, 611, 234, 611,
- 611, 245, 0, 233, 0, 0, 0, 0, 234, 0,
- 222, 0, 0, 611, 207, 611, 611, 0, 186, 0,
- 0, 611, 0, 611, 106, 275
+ 0, 0, 299, 300, 296, 0, 0, 300, 300, 11,
+ 288, 269, 264, 300, 300, 300, 300, 292, 290, 0,
+ 274, 257, 259, 261, 259, 300, 256, 259, 247, 246,
+ 16, 300, 265, 33, 14, 268, 259, 300, 251, 24,
+ 254, 252, 259, 262, 248, 243, 34, 251, 258, 254,
+ 235, 240, 244, 249, 236, 233, 235, 245, 231, 247,
+ 36, 231, 241, 223, 237, 300, 238, 241, 227, 222,
+ 247, 227, 219, 231, 226, 219, 208, 34, 223, 219,
+ 225, 300, 300, 208, 215, 202, 300, 300, 210, 200,
+ 204, 204, 38, 210, 39, 220, 300, 300, 300, 201,
+
+ 47, 218, 212, 212, 211, 66, 73, 208, 195, 199,
+ 210, 199, 193, 191, 196, 75, 182, 300, 209, 212,
+ 209, 52, 206, 209, 206, 66, 300, 190, 198, 188,
+ 193, 193, 189, 169, 200, 197, 74, 71, 72, 77,
+ 186, 185, 84, 86, 87, 184, 183, 177, 183, 180,
+ 300, 175, 185, 165, 88, 90, 173, 167, 169, 166,
+ 91, 99, 96, 172, 171, 170, 169, 168, 167, 300,
+ 300, 166, 165, 164, 163, 162, 161, 300, 300, 94,
+ 160, 300, 155, 300, 171, 157, 156, 155, 154, 157,
+ 138, 143, 137, 141, 140, 140, 143, 137, 141, 136,
+
+ 101, 139, 300, 300, 300, 300, 300, 300, 300, 300,
+ 300, 300, 300, 300, 145, 140, 130, 300, 300, 300,
+ 300, 300, 300, 127, 140, 140, 300, 121, 127, 131,
+ 136, 120, 134, 116, 120, 120, 118, 126, 113, 127,
+ 300, 117, 108, 123, 117, 300, 107, 104, 105, 300,
+ 108, 112, 102, 300, 105, 106, 104, 300, 93, 300,
+ 300, 300, 300, 78, 300, 57, 300, 300, 300, 56,
+ 300, 300, 300, 300, 127, 65
} ;
-static yyconst flex_int16_t yy_def[547] =
+static const flex_int16_t yy_def[277] =
{ 0,
- 544, 1, 544, 3, 544, 544, 544, 544, 544, 545,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 544, 545, 544, 544, 544, 544,
- 544, 546, 546, 24, 546, 546, 546, 546, 546, 544,
- 544, 544, 544, 544, 546, 546, 546, 546, 546, 544,
- 544, 544, 544, 544, 544, 546, 546, 546, 546, 546,
- 546, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 544,
-
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 544, 544, 544, 544, 544, 544, 544,
-
- 544, 544, 544, 544, 544, 544, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 544, 544, 544,
-
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 546, 546, 546, 546,
-
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 546, 546, 546, 546, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 546, 546, 546, 546, 546, 546, 546,
-
- 546, 546, 546, 546, 546, 546, 546, 546, 546, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 546, 546, 546, 546, 546, 546, 546, 546, 546,
- 546, 546, 546, 544, 544, 544, 544, 546, 546, 546,
- 546, 544, 546, 0, 544, 544
+ 274, 1, 274, 274, 274, 275, 276, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 275, 276,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 0, 274, 274
} ;
-static yyconst flex_int16_t yy_nxt[653] =
+static const flex_int16_t yy_nxt[341] =
{ 0,
- 6, 7, 8, 9, 10, 10, 10, 10, 10, 10,
- 10, 10, 11, 12, 6, 6, 13, 6, 6, 6,
- 6, 14, 6, 6, 6, 6, 15, 6, 6, 6,
- 16, 6, 6, 6, 6, 6, 17, 18, 6, 19,
- 20, 21, 22, 23, 9, 24, 24, 24, 24, 24,
- 24, 24, 24, 25, 26, 21, 21, 27, 21, 21,
- 21, 21, 28, 21, 21, 21, 21, 29, 21, 21,
- 21, 30, 21, 21, 21, 21, 21, 31, 32, 21,
- 33, 34, 35, 35, 35, 35, 37, 38, 43, 43,
- 43, 43, 44, 44, 44, 44, 44, 44, 44, 44,
-
- 45, 46, 35, 35, 43, 43, 64, 70, 36, 65,
- 71, 73, 141, 74, 157, 75, 76, 82, 83, 77,
- 96, 97, 78, 79, 142, 101, 158, 80, 174, 102,
- 81, 87, 110, 88, 117, 89, 90, 103, 118, 91,
- 126, 111, 92, 93, 175, 189, 119, 94, 201, 127,
- 95, 204, 214, 221, 217, 240, 205, 262, 202, 218,
- 263, 190, 215, 227, 282, 228, 268, 283, 229, 230,
- 231, 222, 232, 241, 269, 233, 234, 246, 449, 247,
- 273, 450, 248, 249, 250, 288, 251, 293, 274, 252,
- 253, 472, 311, 289, 473, 294, 304, 305, 313, 306,
-
- 312, 315, 307, 308, 543, 319, 314, 321, 323, 316,
- 309, 343, 310, 320, 345, 322, 324, 336, 337, 344,
- 338, 347, 346, 339, 340, 542, 351, 353, 355, 348,
- 365, 341, 367, 342, 352, 354, 356, 373, 366, 376,
- 368, 378, 400, 374, 377, 394, 375, 379, 380, 395,
- 401, 402, 408, 541, 540, 381, 539, 411, 409, 403,
- 413, 410, 412, 538, 429, 537, 414, 415, 430, 536,
- 535, 534, 533, 532, 416, 42, 531, 42, 530, 529,
- 528, 527, 526, 525, 524, 523, 522, 521, 520, 519,
- 518, 517, 516, 515, 514, 513, 512, 511, 510, 509,
-
- 508, 507, 506, 505, 504, 503, 502, 501, 500, 499,
- 498, 497, 496, 495, 494, 493, 492, 491, 490, 489,
- 488, 487, 486, 485, 484, 483, 482, 481, 480, 479,
- 478, 477, 476, 475, 474, 471, 470, 469, 468, 467,
- 466, 465, 464, 463, 462, 461, 460, 459, 458, 457,
- 456, 455, 454, 453, 452, 451, 448, 447, 446, 445,
- 444, 443, 442, 441, 440, 439, 438, 437, 436, 435,
- 434, 433, 432, 431, 428, 427, 426, 425, 424, 423,
- 422, 421, 420, 419, 418, 417, 407, 406, 405, 404,
- 399, 398, 397, 396, 393, 392, 391, 390, 389, 388,
-
- 387, 386, 385, 384, 383, 382, 372, 371, 370, 369,
- 364, 363, 362, 361, 360, 359, 358, 357, 350, 349,
- 335, 334, 333, 332, 331, 330, 329, 328, 327, 326,
- 325, 318, 317, 303, 302, 301, 300, 299, 298, 297,
- 296, 295, 292, 291, 290, 287, 286, 285, 284, 281,
- 280, 279, 278, 277, 276, 275, 272, 271, 270, 267,
- 266, 265, 264, 261, 260, 259, 258, 257, 256, 255,
- 254, 245, 244, 243, 242, 239, 238, 237, 236, 235,
- 226, 225, 224, 223, 220, 219, 216, 213, 212, 211,
- 210, 209, 208, 207, 206, 203, 200, 199, 198, 197,
-
- 196, 195, 194, 193, 192, 191, 188, 187, 186, 185,
- 184, 183, 182, 181, 180, 179, 178, 177, 176, 173,
- 172, 171, 170, 169, 168, 167, 166, 165, 164, 163,
- 162, 161, 160, 159, 156, 155, 154, 153, 152, 151,
- 150, 149, 148, 147, 146, 145, 144, 143, 140, 139,
- 138, 137, 136, 135, 134, 133, 132, 131, 130, 129,
- 128, 125, 124, 123, 122, 121, 120, 116, 115, 114,
- 113, 112, 109, 108, 107, 106, 105, 104, 100, 99,
- 98, 86, 85, 84, 72, 69, 68, 67, 66, 63,
- 62, 61, 60, 59, 58, 57, 56, 55, 54, 53,
-
- 52, 51, 50, 49, 48, 47, 41, 40, 39, 544,
- 5, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544
+ 4, 5, 6, 7, 7, 7, 7, 7, 7, 7,
+ 7, 8, 9, 4, 4, 10, 4, 4, 4, 4,
+ 11, 4, 4, 4, 4, 12, 4, 4, 4, 13,
+ 4, 4, 4, 4, 4, 14, 15, 4, 16, 17,
+ 21, 22, 36, 48, 49, 37, 39, 62, 40, 53,
+ 41, 42, 77, 54, 43, 94, 63, 44, 45, 106,
+ 113, 55, 46, 109, 78, 47, 141, 20, 110, 107,
+ 119, 95, 120, 273, 142, 121, 122, 123, 114, 124,
+ 146, 135, 125, 126, 136, 164, 166, 272, 147, 157,
+ 158, 168, 159, 165, 167, 160, 161, 271, 172, 169,
+
+ 174, 176, 186, 162, 188, 163, 173, 194, 175, 177,
+ 187, 199, 189, 195, 197, 270, 196, 200, 201, 198,
+ 215, 269, 268, 235, 216, 202, 236, 19, 267, 19,
+ 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
+ 256, 255, 254, 253, 252, 251, 250, 249, 248, 247,
+ 246, 245, 244, 243, 242, 241, 240, 239, 238, 237,
+ 234, 233, 232, 231, 230, 229, 228, 227, 226, 225,
+ 224, 223, 222, 221, 220, 219, 218, 217, 214, 213,
+ 212, 211, 210, 209, 208, 207, 206, 205, 204, 203,
+ 193, 192, 191, 190, 185, 184, 183, 182, 181, 180,
+
+ 179, 178, 171, 170, 156, 155, 154, 153, 152, 151,
+ 150, 149, 148, 145, 144, 143, 140, 139, 138, 137,
+ 134, 133, 132, 131, 130, 129, 128, 127, 118, 117,
+ 116, 115, 112, 111, 108, 105, 104, 103, 102, 101,
+ 100, 99, 98, 97, 96, 93, 92, 91, 90, 89,
+ 88, 87, 86, 85, 84, 83, 82, 81, 80, 79,
+ 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
+ 66, 65, 64, 61, 60, 59, 58, 57, 56, 52,
+ 51, 50, 38, 35, 34, 33, 32, 31, 30, 29,
+ 28, 27, 26, 18, 25, 24, 23, 18, 274, 3,
+
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274
} ;
-static yyconst flex_int16_t yy_chk[653] =
+static const flex_int16_t yy_chk[341] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 7, 7, 8, 8, 13, 13, 22, 22,
- 23, 23, 24, 24, 24, 24, 24, 24, 24, 24,
-
- 27, 27, 35, 35, 43, 43, 54, 59, 545, 54,
- 59, 62, 109, 62, 125, 62, 62, 63, 63, 62,
- 69, 69, 62, 62, 109, 74, 125, 62, 142, 74,
- 62, 68, 81, 68, 88, 68, 68, 74, 88, 68,
- 95, 81, 68, 68, 142, 158, 88, 68, 173, 95,
- 68, 175, 188, 196, 190, 209, 175, 224, 173, 190,
- 224, 158, 188, 201, 243, 201, 230, 243, 201, 201,
- 202, 196, 202, 209, 230, 202, 202, 214, 380, 214,
- 234, 380, 214, 214, 215, 249, 215, 253, 234, 215,
- 215, 415, 265, 249, 415, 253, 264, 264, 266, 264,
-
- 265, 267, 264, 264, 539, 270, 266, 271, 272, 267,
- 264, 285, 264, 270, 286, 271, 272, 284, 284, 285,
- 284, 287, 286, 284, 284, 535, 290, 291, 292, 287,
- 302, 284, 303, 284, 290, 291, 292, 308, 302, 309,
- 303, 310, 334, 308, 309, 327, 308, 310, 310, 327,
- 334, 335, 340, 531, 529, 310, 524, 341, 340, 335,
- 342, 340, 341, 522, 359, 519, 342, 342, 359, 517,
- 512, 510, 509, 508, 342, 546, 506, 546, 505, 504,
- 502, 501, 500, 498, 497, 496, 495, 493, 492, 490,
- 489, 488, 486, 485, 484, 482, 481, 480, 479, 477,
-
- 476, 475, 474, 473, 472, 471, 470, 469, 468, 467,
- 466, 465, 463, 462, 461, 454, 453, 452, 451, 450,
- 449, 448, 447, 446, 445, 444, 443, 442, 440, 439,
- 438, 431, 430, 429, 416, 414, 413, 412, 411, 410,
- 409, 408, 407, 406, 405, 404, 403, 402, 401, 400,
- 399, 397, 396, 395, 394, 381, 379, 378, 377, 376,
- 375, 374, 373, 372, 371, 370, 369, 368, 367, 366,
- 365, 364, 362, 360, 356, 355, 354, 353, 352, 351,
- 348, 347, 346, 345, 344, 343, 339, 338, 337, 336,
- 333, 332, 331, 328, 324, 323, 322, 321, 320, 319,
-
- 316, 315, 314, 313, 312, 311, 307, 306, 305, 304,
- 301, 300, 299, 297, 296, 295, 294, 293, 289, 288,
- 283, 282, 281, 280, 279, 278, 277, 276, 275, 274,
- 273, 269, 268, 263, 262, 261, 260, 259, 258, 257,
- 256, 255, 252, 251, 250, 248, 247, 246, 244, 242,
- 241, 240, 239, 238, 237, 236, 233, 232, 231, 229,
- 228, 227, 225, 223, 222, 221, 220, 219, 218, 217,
- 216, 213, 212, 211, 210, 208, 206, 205, 204, 203,
- 200, 199, 198, 197, 195, 191, 189, 187, 186, 185,
- 184, 181, 180, 179, 176, 174, 172, 171, 170, 169,
-
- 166, 165, 164, 161, 160, 159, 157, 156, 155, 154,
- 153, 152, 151, 150, 149, 148, 145, 144, 143, 141,
- 140, 139, 138, 137, 136, 135, 134, 133, 132, 131,
- 129, 128, 127, 126, 124, 123, 122, 121, 120, 119,
- 118, 117, 116, 115, 113, 112, 111, 110, 108, 107,
- 106, 105, 104, 103, 102, 101, 100, 99, 98, 97,
- 96, 94, 93, 92, 91, 90, 89, 87, 85, 84,
- 83, 82, 80, 79, 78, 77, 76, 75, 73, 71,
- 70, 67, 65, 64, 61, 58, 57, 56, 55, 53,
- 52, 51, 50, 49, 48, 47, 46, 45, 41, 40,
-
- 39, 38, 37, 30, 29, 28, 16, 15, 14, 5,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
- 544, 544
+ 10, 10, 31, 35, 35, 31, 34, 47, 34, 40,
+ 34, 34, 61, 40, 34, 78, 47, 34, 34, 93,
+ 101, 40, 34, 95, 61, 34, 122, 276, 95, 93,
+ 106, 78, 106, 270, 122, 106, 106, 107, 101, 107,
+ 126, 116, 107, 107, 116, 138, 139, 266, 126, 137,
+ 137, 140, 137, 138, 139, 137, 137, 264, 143, 140,
+
+ 144, 145, 155, 137, 156, 137, 143, 161, 144, 145,
+ 155, 163, 156, 161, 162, 259, 161, 163, 163, 162,
+ 180, 257, 256, 201, 180, 163, 201, 275, 255, 275,
+ 253, 252, 251, 249, 248, 247, 245, 244, 243, 242,
+ 240, 239, 238, 237, 236, 235, 234, 233, 232, 231,
+ 230, 229, 228, 226, 225, 224, 217, 216, 215, 202,
+ 200, 199, 198, 197, 196, 195, 194, 193, 192, 191,
+ 190, 189, 188, 187, 186, 185, 183, 181, 177, 176,
+ 175, 174, 173, 172, 169, 168, 167, 166, 165, 164,
+ 160, 159, 158, 157, 154, 153, 152, 150, 149, 148,
+
+ 147, 146, 142, 141, 136, 135, 134, 133, 132, 131,
+ 130, 129, 128, 125, 124, 123, 121, 120, 119, 117,
+ 115, 114, 113, 112, 111, 110, 109, 108, 105, 104,
+ 103, 102, 100, 96, 94, 92, 91, 90, 89, 86,
+ 85, 84, 81, 80, 79, 77, 76, 75, 74, 73,
+ 72, 71, 70, 69, 68, 67, 65, 64, 63, 62,
+ 60, 59, 58, 57, 56, 55, 54, 53, 52, 51,
+ 50, 49, 48, 46, 45, 44, 43, 42, 41, 39,
+ 37, 36, 33, 30, 29, 28, 27, 25, 24, 23,
+ 22, 21, 19, 18, 13, 12, 11, 5, 3, 274,
+
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274
} ;
-extern int H5LTyy_flex_debug;
-int H5LTyy_flex_debug = 0;
-
-static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
-static char *yy_full_match;
-static int yy_lp;
-#define REJECT \
-{ \
-*yy_cp = (yy_hold_char); /* undo effects of setting up H5LTyytext */ \
-yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
-++(yy_lp); \
-goto find_rule; \
-}
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *H5LTyytext;
+char *yytext;
#line 1 "hl/src/H5LTanalyze.l"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
@@ -893,12 +907,16 @@ char *H5LTyytext;
* recreate the output files.
*/
#line 21 "hl/src/H5LTanalyze.l"
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <hdf5.h>
+
+#include "H5private.h"
#include "H5LTparse.h"
-int my_yyinput(char *, int);
+static char *trim_quotes(const char *);
+static int my_yyinput(char *, int);
#undef YY_INPUT
#define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms))
#define token(x) (int)x
@@ -912,79 +930,45 @@ int my_yyinput(char *, int);
extern char *myinput;
extern size_t input_len;
-#define STACK_SIZE 16
-
-/*variables for compound type*/
-struct cmpd_info {
- hid_t id;
- hbool_t is_field;
- hbool_t first_memb;
-};
-extern struct cmpd_info cmpd_stack[STACK_SIZE];
-extern int csindex;
-
-/*variables for array type*/
-struct arr_info {
- hsize_t dims[H5S_MAX_RANK];
- int ndim;
- hbool_t is_dim;
-};
-extern struct arr_info arr_stack[STACK_SIZE];
-extern int asindex;
-
-/*variables for enumerate type*/
-extern hbool_t is_enum;
-extern hbool_t is_enum_memb;
-
-/*variables for string type*/
-extern hbool_t is_str_size;
-
-/*variables for opaque type*/
-extern hbool_t is_opq_size;
-extern hbool_t is_opq_tag;
-
-hbool_t first_quote = 1;
-
-
-#line 920 "hl/src/H5LTanalyze.c"
+#line 903 "hl/src/H5LTanalyze.c"
+#line 904 "hl/src/H5LTanalyze.c"
#define INITIAL 0
-#define TAG_STRING 1
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
-static int yy_init_globals (void );
+static int yy_init_globals ( void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int H5LTyylex_destroy (void );
+int yylex_destroy ( void );
-int H5LTyyget_debug (void );
+int yyget_debug ( void );
-void H5LTyyset_debug (int debug_flag );
+void yyset_debug ( int debug_flag );
-YY_EXTRA_TYPE H5LTyyget_extra (void );
+YY_EXTRA_TYPE yyget_extra ( void );
-void H5LTyyset_extra (YY_EXTRA_TYPE user_defined );
+void yyset_extra ( YY_EXTRA_TYPE user_defined );
-FILE *H5LTyyget_in (void );
+FILE *yyget_in ( void );
-void H5LTyyset_in (FILE * in_str );
+void yyset_in ( FILE * _in_str );
-FILE *H5LTyyget_out (void );
+FILE *yyget_out ( void );
-void H5LTyyset_out (FILE * out_str );
+void yyset_out ( FILE * _out_str );
-yy_size_t H5LTyyget_leng (void );
+ int yyget_leng ( void );
-char *H5LTyyget_text (void );
+char *yyget_text ( void );
-int H5LTyyget_lineno (void );
+int yyget_lineno ( void );
-void H5LTyyset_lineno (int line_number );
+void yyset_lineno ( int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -992,35 +976,43 @@ void H5LTyyset_lineno (int line_number );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int H5LTyywrap (void );
+extern "C" int yywrap ( void );
#else
-extern int H5LTyywrap (void );
+extern int yywrap ( void );
#endif
#endif
- static void yyunput (int c,char *buf_ptr );
+#ifndef YY_NO_UNPUT
+
+ static void yyunput ( int c, char *buf_ptr );
+#endif
+
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
+static void yy_flex_strncpy ( char *, const char *, int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
+static int yy_flex_strlen ( const char * );
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (void );
+static int yyinput ( void );
#else
-static int input (void );
+static int input ( void );
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -1028,7 +1020,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout )
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1039,20 +1031,20 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- yy_size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
- (c = getc( H5LTyyin )) != EOF && c != '\n'; ++n ) \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( H5LTyyin ) ) \
+ if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, H5LTyyin))==0 && ferror(H5LTyyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -1060,7 +1052,7 @@ static int input (void );
break; \
} \
errno=0; \
- clearerr(H5LTyyin); \
+ clearerr(yyin); \
} \
}\
\
@@ -1093,12 +1085,12 @@ static int input (void );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int H5LTyylex (void);
+extern int yylex (void);
-#define YY_DECL int H5LTyylex (void)
+#define YY_DECL int yylex (void)
#endif /* !YY_DECL */
-/* Code executed at the beginning of each rule, after H5LTyytext and H5LTyyleng
+/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
@@ -1107,7 +1099,7 @@ extern int H5LTyylex (void);
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
#define YY_RULE_SETUP \
@@ -1117,15 +1109,10 @@ extern int H5LTyylex (void);
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
-#line 77 "hl/src/H5LTanalyze.l"
-
-
-#line 1098 "hl/src/H5LTanalyze.c"
-
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -1134,35 +1121,35 @@ YY_DECL
YY_USER_INIT;
#endif
- /* Create the reject buffer large enough to save one state per allowed character. */
- if ( ! (yy_state_buf) )
- (yy_state_buf) = (yy_state_type *)H5LTyyalloc(YY_STATE_BUF_SIZE );
- if ( ! (yy_state_buf) )
- YY_FATAL_ERROR( "out of dynamic memory in H5LTyylex()" );
-
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
- if ( ! H5LTyyin )
- H5LTyyin = stdin;
+ if ( ! yyin )
+ yyin = stdin;
- if ( ! H5LTyyout )
- H5LTyyout = stdout;
+ if ( ! yyout )
+ yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- H5LTyyensure_buffer_stack ();
+ yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE );
+ yy_create_buffer( yyin, YY_BUF_SIZE );
}
- H5LTyy_load_buffer_state( );
+ yy_load_buffer_state( );
}
- while ( 1 ) /* loops until end-of-file is reached */
+ {
+#line 46 "hl/src/H5LTanalyze.l"
+
+
+#line 1116 "hl/src/H5LTanalyze.c"
+
+ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
- /* Support of H5LTyytext. */
+ /* Support of yytext. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
@@ -1171,44 +1158,33 @@ YY_DECL
yy_bp = yy_cp;
yy_current_state = (yy_start);
-
- (yy_state_ptr) = (yy_state_buf);
- *(yy_state_ptr)++ = yy_current_state;
-
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 545 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ if ( yy_current_state >= 275 )
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *(yy_state_ptr)++ = yy_current_state;
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 611 );
+ while ( yy_base[yy_current_state] != 300 );
yy_find_action:
- yy_current_state = *--(yy_state_ptr);
- (yy_lp) = yy_accept[yy_current_state];
-goto find_rule; /* Shut up GCC warning -Wall */
-find_rule: /* we branch to this label when backing up */
- for ( ; ; ) /* until we find what rule we matched */
- {
- if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
- {
- yy_act = yy_acclist[(yy_lp)];
- {
- (yy_full_match) = yy_cp;
- break;
- }
- }
- --yy_cp;
- yy_current_state = *--(yy_state_ptr);
- (yy_lp) = yy_accept[yy_current_state];
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
@@ -1217,368 +1193,344 @@ do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
case 1:
YY_RULE_SETUP
-#line 79 "hl/src/H5LTanalyze.l"
+#line 48 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I8BE_TOKEN);}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 80 "hl/src/H5LTanalyze.l"
+#line 49 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I8LE_TOKEN);}
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 81 "hl/src/H5LTanalyze.l"
+#line 50 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I16BE_TOKEN);}
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 82 "hl/src/H5LTanalyze.l"
+#line 51 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I16LE_TOKEN);}
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 83 "hl/src/H5LTanalyze.l"
+#line 52 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I32BE_TOKEN);}
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 84 "hl/src/H5LTanalyze.l"
+#line 53 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I32LE_TOKEN);}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 85 "hl/src/H5LTanalyze.l"
+#line 54 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I64BE_TOKEN);}
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 86 "hl/src/H5LTanalyze.l"
+#line 55 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_I64LE_TOKEN);}
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 88 "hl/src/H5LTanalyze.l"
+#line 57 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U8BE_TOKEN);}
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 89 "hl/src/H5LTanalyze.l"
+#line 58 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U8LE_TOKEN);}
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 90 "hl/src/H5LTanalyze.l"
+#line 59 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U16BE_TOKEN);}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 91 "hl/src/H5LTanalyze.l"
+#line 60 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U16LE_TOKEN);}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 92 "hl/src/H5LTanalyze.l"
+#line 61 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U32BE_TOKEN);}
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 93 "hl/src/H5LTanalyze.l"
+#line 62 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U32LE_TOKEN);}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 94 "hl/src/H5LTanalyze.l"
+#line 63 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U64BE_TOKEN);}
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 95 "hl/src/H5LTanalyze.l"
+#line 64 "hl/src/H5LTanalyze.l"
{return hid(H5T_STD_U64LE_TOKEN);}
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 97 "hl/src/H5LTanalyze.l"
+#line 66 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_CHAR_TOKEN);}
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 98 "hl/src/H5LTanalyze.l"
+#line 67 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_SCHAR_TOKEN);}
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 99 "hl/src/H5LTanalyze.l"
+#line 68 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_UCHAR_TOKEN);}
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 100 "hl/src/H5LTanalyze.l"
+#line 69 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_SHORT_TOKEN);}
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 101 "hl/src/H5LTanalyze.l"
+#line 70 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_USHORT_TOKEN);}
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 102 "hl/src/H5LTanalyze.l"
+#line 71 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_INT_TOKEN);}
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 103 "hl/src/H5LTanalyze.l"
+#line 72 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_UINT_TOKEN);}
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 104 "hl/src/H5LTanalyze.l"
+#line 73 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_LONG_TOKEN);}
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 105 "hl/src/H5LTanalyze.l"
+#line 74 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_ULONG_TOKEN);}
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 106 "hl/src/H5LTanalyze.l"
+#line 75 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_LLONG_TOKEN);}
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 107 "hl/src/H5LTanalyze.l"
+#line 76 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_ULLONG_TOKEN);}
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 109 "hl/src/H5LTanalyze.l"
+#line 78 "hl/src/H5LTanalyze.l"
{return hid(H5T_IEEE_F32BE_TOKEN);}
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 110 "hl/src/H5LTanalyze.l"
+#line 79 "hl/src/H5LTanalyze.l"
{return hid(H5T_IEEE_F32LE_TOKEN);}
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 111 "hl/src/H5LTanalyze.l"
+#line 80 "hl/src/H5LTanalyze.l"
{return hid(H5T_IEEE_F64BE_TOKEN);}
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 112 "hl/src/H5LTanalyze.l"
+#line 81 "hl/src/H5LTanalyze.l"
{return hid(H5T_IEEE_F64LE_TOKEN);}
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 113 "hl/src/H5LTanalyze.l"
+#line 82 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_FLOAT_TOKEN);}
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 114 "hl/src/H5LTanalyze.l"
+#line 83 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_DOUBLE_TOKEN);}
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 115 "hl/src/H5LTanalyze.l"
+#line 84 "hl/src/H5LTanalyze.l"
{return hid(H5T_NATIVE_LDOUBLE_TOKEN);}
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 117 "hl/src/H5LTanalyze.l"
+#line 86 "hl/src/H5LTanalyze.l"
{return token(H5T_STRING_TOKEN);}
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 118 "hl/src/H5LTanalyze.l"
+#line 87 "hl/src/H5LTanalyze.l"
{return token(STRSIZE_TOKEN);}
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 119 "hl/src/H5LTanalyze.l"
+#line 88 "hl/src/H5LTanalyze.l"
{return token(STRPAD_TOKEN);}
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 120 "hl/src/H5LTanalyze.l"
+#line 89 "hl/src/H5LTanalyze.l"
{return token(CSET_TOKEN);}
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 121 "hl/src/H5LTanalyze.l"
+#line 90 "hl/src/H5LTanalyze.l"
{return token(CTYPE_TOKEN);}
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 122 "hl/src/H5LTanalyze.l"
+#line 91 "hl/src/H5LTanalyze.l"
{return token(H5T_STR_NULLTERM_TOKEN);}
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 123 "hl/src/H5LTanalyze.l"
+#line 92 "hl/src/H5LTanalyze.l"
{return token(H5T_STR_NULLPAD_TOKEN);}
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 124 "hl/src/H5LTanalyze.l"
+#line 93 "hl/src/H5LTanalyze.l"
{return token(H5T_STR_SPACEPAD_TOKEN);}
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 125 "hl/src/H5LTanalyze.l"
+#line 94 "hl/src/H5LTanalyze.l"
{return token(H5T_CSET_ASCII_TOKEN);}
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 126 "hl/src/H5LTanalyze.l"
+#line 95 "hl/src/H5LTanalyze.l"
{return token(H5T_CSET_UTF8_TOKEN);}
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 127 "hl/src/H5LTanalyze.l"
+#line 96 "hl/src/H5LTanalyze.l"
{return token(H5T_C_S1_TOKEN);}
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 128 "hl/src/H5LTanalyze.l"
+#line 97 "hl/src/H5LTanalyze.l"
{return token(H5T_FORTRAN_S1_TOKEN);}
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 129 "hl/src/H5LTanalyze.l"
+#line 98 "hl/src/H5LTanalyze.l"
{return token(H5T_VARIABLE_TOKEN);}
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 131 "hl/src/H5LTanalyze.l"
+#line 100 "hl/src/H5LTanalyze.l"
{return token(H5T_COMPOUND_TOKEN);}
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 132 "hl/src/H5LTanalyze.l"
+#line 101 "hl/src/H5LTanalyze.l"
{return token(H5T_ENUM_TOKEN);}
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 133 "hl/src/H5LTanalyze.l"
+#line 102 "hl/src/H5LTanalyze.l"
{return token(H5T_ARRAY_TOKEN);}
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 134 "hl/src/H5LTanalyze.l"
+#line 103 "hl/src/H5LTanalyze.l"
{return token(H5T_VLEN_TOKEN);}
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 136 "hl/src/H5LTanalyze.l"
+#line 105 "hl/src/H5LTanalyze.l"
{return token(H5T_OPAQUE_TOKEN);}
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 137 "hl/src/H5LTanalyze.l"
+#line 106 "hl/src/H5LTanalyze.l"
{return token(OPQ_SIZE_TOKEN);}
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 138 "hl/src/H5LTanalyze.l"
+#line 107 "hl/src/H5LTanalyze.l"
{return token(OPQ_TAG_TOKEN);}
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 140 "hl/src/H5LTanalyze.l"
+#line 109 "hl/src/H5LTanalyze.l"
{
- if( is_str_size || (is_enum && is_enum_memb) ||
- is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) ||
- (csindex>-1 && cmpd_stack[csindex].is_field) ) {
- H5LTyylval.ival = atoi(H5LTyytext);
- return NUMBER;
- } else
- REJECT;
+ H5LTyylval.ival = HDatoi(yytext);
+ return NUMBER;
}
YY_BREAK
case 56:
+/* rule 56 can match eol */
YY_RULE_SETUP
-#line 150 "hl/src/H5LTanalyze.l"
-{
- /*if it's first quote, and is a compound field name or an enum symbol*/
- if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field))
- && first_quote) {
- first_quote = 0;
- BEGIN TAG_STRING;
- } else /*if it's second quote*/
- first_quote = 1;
- return token('"');
- }
- YY_BREAK
-case 57:
-/* rule 57 can match eol */
-YY_RULE_SETUP
-#line 160 "hl/src/H5LTanalyze.l"
+#line 114 "hl/src/H5LTanalyze.l"
{
-#ifdef H5_HAVE_WIN32_API
- H5LTyylval.sval = _strdup(H5LTyytext);
-#else /* H5_HAVE_WIN32_API */
- H5LTyylval.sval = strdup(H5LTyytext);
-#endif /* H5_HAVE_WIN32_API */
- BEGIN INITIAL;
+ H5LTyylval.sval = trim_quotes(yytext);
return STRING;
}
YY_BREAK
-case 58:
+case 57:
YY_RULE_SETUP
-#line 170 "hl/src/H5LTanalyze.l"
+#line 119 "hl/src/H5LTanalyze.l"
{return token('{');}
YY_BREAK
-case 59:
+case 58:
YY_RULE_SETUP
-#line 171 "hl/src/H5LTanalyze.l"
+#line 120 "hl/src/H5LTanalyze.l"
{return token('}');}
YY_BREAK
-case 60:
+case 59:
YY_RULE_SETUP
-#line 172 "hl/src/H5LTanalyze.l"
+#line 121 "hl/src/H5LTanalyze.l"
{return token('[');}
YY_BREAK
-case 61:
+case 60:
YY_RULE_SETUP
-#line 173 "hl/src/H5LTanalyze.l"
+#line 122 "hl/src/H5LTanalyze.l"
{return token(']');}
YY_BREAK
-case 62:
+case 61:
YY_RULE_SETUP
-#line 174 "hl/src/H5LTanalyze.l"
+#line 123 "hl/src/H5LTanalyze.l"
{return token(':');}
YY_BREAK
-case 63:
+case 62:
YY_RULE_SETUP
-#line 175 "hl/src/H5LTanalyze.l"
+#line 124 "hl/src/H5LTanalyze.l"
{return token(';');}
YY_BREAK
-case 64:
-/* rule 64 can match eol */
+case 63:
+/* rule 63 can match eol */
YY_RULE_SETUP
-#line 176 "hl/src/H5LTanalyze.l"
+#line 125 "hl/src/H5LTanalyze.l"
;
YY_BREAK
-case 65:
-/* rule 65 can match eol */
-YY_RULE_SETUP
-#line 177 "hl/src/H5LTanalyze.l"
-{ return 0; }
- YY_BREAK
-case 66:
+case 64:
YY_RULE_SETUP
-#line 179 "hl/src/H5LTanalyze.l"
+#line 127 "hl/src/H5LTanalyze.l"
ECHO;
YY_BREAK
-#line 1549 "hl/src/H5LTanalyze.c"
- case YY_STATE_EOF(INITIAL):
- case YY_STATE_EOF(TAG_STRING):
- yyterminate();
+#line 1501 "hl/src/H5LTanalyze.c"
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
case YY_END_OF_BUFFER:
{
@@ -1593,15 +1545,15 @@ ECHO;
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
- * just pointed H5LTyyin at a new source and called
- * H5LTyylex(). If so, then we have to assure
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = H5LTyyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
@@ -1654,11 +1606,11 @@ ECHO;
{
(yy_did_buffer_switch_on_eof) = 0;
- if ( H5LTyywrap( ) )
+ if ( yywrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
- * H5LTyytext, we can now set up
+ * yytext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
@@ -1707,7 +1659,8 @@ ECHO;
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
-} /* end of H5LTyylex */
+ } /* end of user's declarations */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1718,9 +1671,9 @@ ECHO;
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ int number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
@@ -1749,7 +1702,7 @@ static int yy_get_next_buffer (void)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1762,14 +1715,44 @@ static int yy_get_next_buffer (void)
else
{
- yy_size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = NULL;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
}
@@ -1788,7 +1771,7 @@ static int yy_get_next_buffer (void)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- H5LTyyrestart(H5LTyyin );
+ yyrestart( yyin );
}
else
@@ -1802,12 +1785,15 @@ static int yy_get_next_buffer (void)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) H5LTyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
(yy_n_chars) += number_to_move;
@@ -1823,25 +1809,26 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ yy_state_type yy_current_state;
+ char *yy_cp;
yy_current_state = (yy_start);
- (yy_state_ptr) = (yy_state_buf);
- *(yy_state_ptr)++ = yy_current_state;
-
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 545 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ if ( yy_current_state >= 275 )
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *(yy_state_ptr)++ = yy_current_state;
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -1854,39 +1841,45 @@ static int yy_get_next_buffer (void)
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
-
- register YY_CHAR yy_c = 1;
+ int yy_is_jam;
+ char *yy_cp = (yy_c_buf_p);
+
+ YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 545 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ if ( yy_current_state >= 275 )
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 544);
- if ( ! yy_is_jam )
- *(yy_state_ptr)++ = yy_current_state;
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ yy_is_jam = (yy_current_state == 274);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
- static void yyunput (int c, register char * yy_bp )
+#ifndef YY_NO_UNPUT
+
+ static void yyunput (int c, char * yy_bp )
{
- register char *yy_cp;
+ char *yy_cp;
yy_cp = (yy_c_buf_p);
- /* undo effects of setting up H5LTyytext */
+ /* undo effects of setting up yytext */
*yy_cp = (yy_hold_char);
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- register yy_size_t number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ int number_to_move = (yy_n_chars) + 2;
+ char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
+ char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
@@ -1895,7 +1888,7 @@ static int yy_get_next_buffer (void)
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -1908,6 +1901,8 @@ static int yy_get_next_buffer (void)
(yy_c_buf_p) = yy_cp;
}
+#endif
+
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
@@ -1932,7 +1927,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
- yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+ int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -1949,13 +1944,13 @@ static int yy_get_next_buffer (void)
*/
/* Reset buffer status. */
- H5LTyyrestart(H5LTyyin );
+ yyrestart( yyin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( H5LTyywrap( ) )
+ if ( yywrap( ) )
return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
@@ -1975,7 +1970,7 @@ static int yy_get_next_buffer (void)
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve H5LTyytext */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
(yy_hold_char) = *++(yy_c_buf_p);
return c;
@@ -1987,32 +1982,32 @@ static int yy_get_next_buffer (void)
*
* @note This function does not reset the start condition to @c INITIAL .
*/
- void H5LTyyrestart (FILE * input_file )
+ void yyrestart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
- H5LTyyensure_buffer_stack ();
+ yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE );
+ yy_create_buffer( yyin, YY_BUF_SIZE );
}
- H5LTyy_init_buffer(YY_CURRENT_BUFFER,input_file );
- H5LTyy_load_buffer_state( );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file );
+ yy_load_buffer_state( );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*/
- void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
- * H5LTyypop_buffer_state();
- * H5LTyypush_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- H5LTyyensure_buffer_stack ();
+ yyensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -2025,21 +2020,21 @@ static int yy_get_next_buffer (void)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- H5LTyy_load_buffer_state( );
+ yy_load_buffer_state( );
/* We don't actually know whether we did this switch during
- * EOF (H5LTyywrap()) processing, but the only time this flag
- * is looked at is after H5LTyywrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
(yy_did_buffer_switch_on_eof) = 1;
}
-static void H5LTyy_load_buffer_state (void)
+static void yy_load_buffer_state (void)
{
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- H5LTyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
(yy_hold_char) = *(yy_c_buf_p);
}
@@ -2049,35 +2044,35 @@ static void H5LTyy_load_buffer_state (void)
*
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE H5LTyy_create_buffer (FILE * file, int size )
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) H5LTyyalloc(b->yy_buf_size + 2 );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- H5LTyy_init_buffer(b,file );
+ yy_init_buffer( b, file );
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with H5LTyy_create_buffer()
+ * @param b a buffer created with yy_create_buffer()
*
*/
- void H5LTyy_delete_buffer (YY_BUFFER_STATE b )
+ void yy_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
@@ -2087,31 +2082,27 @@ static void H5LTyy_load_buffer_state (void)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- H5LTyyfree((void *) b->yy_ch_buf );
+ yyfree( (void *) b->yy_ch_buf );
- H5LTyyfree((void *) b );
+ yyfree( (void *) b );
}
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a H5LTyyrestart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void H5LTyy_init_buffer (YY_BUFFER_STATE b, FILE * file )
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
int oerrno = errno;
- H5LTyy_flush_buffer(b );
+ yy_flush_buffer( b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then H5LTyy_init_buffer was _probably_
- * called from H5LTyyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -2128,7 +2119,7 @@ extern int isatty (int );
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*/
- void H5LTyy_flush_buffer (YY_BUFFER_STATE b )
+ void yy_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
@@ -2148,7 +2139,7 @@ extern int isatty (int );
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- H5LTyy_load_buffer_state( );
+ yy_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -2157,14 +2148,14 @@ extern int isatty (int );
* @param new_buffer The new state.
*
*/
-void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer )
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
if (new_buffer == NULL)
return;
- H5LTyyensure_buffer_stack();
+ yyensure_buffer_stack();
- /* This block is copied from H5LTyy_switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -2178,8 +2169,8 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer )
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from H5LTyy_switch_to_buffer. */
- H5LTyy_load_buffer_state( );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
@@ -2187,18 +2178,18 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer )
* The next element becomes the new top.
*
*/
-void H5LTyypop_buffer_state (void)
+void yypop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
- H5LTyy_delete_buffer(YY_CURRENT_BUFFER );
+ yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
- H5LTyy_load_buffer_state( );
+ yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
@@ -2206,7 +2197,7 @@ void H5LTyypop_buffer_state (void)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void H5LTyyensure_buffer_stack (void)
+static void yyensure_buffer_stack (void)
{
yy_size_t num_to_alloc;
@@ -2216,15 +2207,15 @@ static void H5LTyyensure_buffer_stack (void)
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyalloc
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" );
-
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@@ -2233,15 +2224,15 @@ static void H5LTyyensure_buffer_stack (void)
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
+ yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyrealloc
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -2253,9 +2244,9 @@ static void H5LTyyensure_buffer_stack (void)
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size )
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
@@ -2263,68 +2254,69 @@ YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size )
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
- return 0;
+ return NULL;
- b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
+ b->yy_input_file = NULL;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- H5LTyy_switch_to_buffer(b );
+ yy_switch_to_buffer( b );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to H5LTyylex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * H5LTyy_scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr )
+YY_BUFFER_STATE yy_scan_string (const char * yystr )
{
- return H5LTyy_scan_bytes(yystr,strlen(yystr) );
+ return yy_scan_bytes( yystr, (int) strlen(yystr) );
}
-/** Setup the input buffer state to scan the given bytes. The next call to H5LTyylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
- yy_size_t n, i;
+ yy_size_t n;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) H5LTyyalloc(n );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = H5LTyy_scan_buffer(buf,n );
+ b = yy_scan_buffer( buf, n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in H5LTyy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2338,9 +2330,9 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg )
+static void yynoreturn yy_fatal_error (const char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2350,14 +2342,14 @@ static void yy_fatal_error (yyconst char* msg )
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up H5LTyytext. */ \
+ /* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- H5LTyytext[H5LTyyleng] = (yy_hold_char); \
- (yy_c_buf_p) = H5LTyytext + yyless_macro_arg; \
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
- H5LTyyleng = yyless_macro_arg; \
+ yyleng = yyless_macro_arg; \
} \
while ( 0 )
@@ -2366,134 +2358,126 @@ static void yy_fatal_error (yyconst char* msg )
/** Get the current line number.
*
*/
-int H5LTyyget_lineno (void)
+int yyget_lineno (void)
{
-
- return H5LTyylineno;
+
+ return yylineno;
}
/** Get the input stream.
*
*/
-FILE *H5LTyyget_in (void)
+FILE *yyget_in (void)
{
- return H5LTyyin;
+ return yyin;
}
/** Get the output stream.
*
*/
-FILE *H5LTyyget_out (void)
+FILE *yyget_out (void)
{
- return H5LTyyout;
+ return yyout;
}
/** Get the length of the current token.
*
*/
-yy_size_t H5LTyyget_leng (void)
+int yyget_leng (void)
{
- return H5LTyyleng;
+ return yyleng;
}
/** Get the current token.
*
*/
-char *H5LTyyget_text (void)
+char *yyget_text (void)
{
- return H5LTyytext;
+ return yytext;
}
/** Set the current line number.
- * @param line_number
+ * @param _line_number line number
*
*/
-void H5LTyyset_lineno (int line_number )
+void yyset_lineno (int _line_number )
{
- H5LTyylineno = line_number;
+ yylineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
- * @param in_str A readable stream.
+ * @param _in_str A readable stream.
*
- * @see H5LTyy_switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void H5LTyyset_in (FILE * in_str )
+void yyset_in (FILE * _in_str )
{
- H5LTyyin = in_str ;
+ yyin = _in_str ;
}
-void H5LTyyset_out (FILE * out_str )
+void yyset_out (FILE * _out_str )
{
- H5LTyyout = out_str ;
+ yyout = _out_str ;
}
-int H5LTyyget_debug (void)
+int yyget_debug (void)
{
- return H5LTyy_flex_debug;
+ return yy_flex_debug;
}
-void H5LTyyset_debug (int bdebug )
+void yyset_debug (int _bdebug )
{
- H5LTyy_flex_debug = bdebug ;
+ yy_flex_debug = _bdebug ;
}
static int yy_init_globals (void)
{
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from H5LTyylex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
- (yy_buffer_stack) = 0;
+ (yy_buffer_stack) = NULL;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
- (yy_c_buf_p) = (char *) 0;
+ (yy_c_buf_p) = NULL;
(yy_init) = 0;
(yy_start) = 0;
- (yy_state_buf) = 0;
- (yy_state_ptr) = 0;
- (yy_full_match) = 0;
- (yy_lp) = 0;
-
/* Defined in main.c */
#ifdef YY_STDINIT
- H5LTyyin = stdin;
- H5LTyyout = stdout;
+ yyin = stdin;
+ yyout = stdout;
#else
- H5LTyyin = (FILE *) 0;
- H5LTyyout = (FILE *) 0;
+ yyin = NULL;
+ yyout = NULL;
#endif
/* For future reference: Set errno on error, since we are called by
- * H5LTyylex_init()
+ * yylex_init()
*/
return 0;
}
-/* H5LTyylex_destroy is for both reentrant and non-reentrant scanners. */
-int H5LTyylex_destroy (void)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- H5LTyy_delete_buffer(YY_CURRENT_BUFFER );
+ yy_delete_buffer( YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
- H5LTyypop_buffer_state();
+ yypop_buffer_state();
}
/* Destroy the stack itself. */
- H5LTyyfree((yy_buffer_stack) );
+ yyfree((yy_buffer_stack) );
(yy_buffer_stack) = NULL;
- H5LTyyfree ( (yy_state_buf) );
- (yy_state_buf) = NULL;
-
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * H5LTyylex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( );
return 0;
@@ -2504,18 +2488,19 @@ int H5LTyylex_destroy (void)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+static void yy_flex_strncpy (char* s1, const char * s2, int n )
{
- register int i;
+
+ int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
+static int yy_flex_strlen (const char * s )
{
- register int n;
+ int n;
for ( n = 0; s[n]; ++n )
;
@@ -2523,13 +2508,14 @@ static int yy_flex_strlen (yyconst char * s )
}
#endif
-void *H5LTyyalloc (yy_size_t size )
+void *yyalloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return malloc(size);
}
-void *H5LTyyrealloc (void * ptr, yy_size_t size )
+void *yyrealloc (void * ptr, yy_size_t size )
{
+
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -2537,35 +2523,53 @@ void *H5LTyyrealloc (void * ptr, yy_size_t size )
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return (void *) realloc( (char *) ptr, size );
+ return realloc(ptr, size);
}
-void H5LTyyfree (void * ptr )
+void yyfree (void * ptr )
{
- free( (char *) ptr ); /* see H5LTyyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 179 "hl/src/H5LTanalyze.l"
+#line 127 "hl/src/H5LTanalyze.l"
+
+
+/* Allocate a copy of `quoted` with the double quote character at
+ * the beginning and the one at the end both removed. The caller is
+ * responsible for free()ing the copy.
+ */
+static char *
+trim_quotes(const char *quoted)
+{
+ size_t len = HDstrlen(quoted);
+ char *trimmed;
+
+ HDassert(quoted[0] == '"' && quoted[len - 1] == '"');
+ trimmed = HDstrdup(quoted + 1);
+ trimmed[len - 2] = '\0';
+
+ return trimmed;
+}
-int my_yyinput(char *buf, int max_size)
+static int my_yyinput(char *buf, int max_size)
{
int ret;
- memcpy(buf, myinput, input_len);
+ HDmemcpy(buf, myinput, input_len);
ret = (int)input_len;
return ret;
}
int H5LTyyerror(const char *msg)
{
- printf("ERROR: %s before \"%s\".\n", msg, H5LTyytext);
+ HDprintf("ERROR: %s before \"%s\".\n", msg, yytext);
return 0;
}
-int H5LTyywrap()
+int yywrap()
{
return(1);
}
diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l
index 49fc039..5006612 100644
--- a/hl/src/H5LTanalyze.l
+++ b/hl/src/H5LTanalyze.l
@@ -18,12 +18,16 @@
*/
%{
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <hdf5.h>
+
+#include "H5private.h"
#include "H5LTparse.h"
-int my_yyinput(char *, int);
+static char *trim_quotes(const char *);
+static int my_yyinput(char *, int);
#undef YY_INPUT
#define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms))
#define token(x) (int)x
@@ -37,43 +41,8 @@ int my_yyinput(char *, int);
extern char *myinput;
extern size_t input_len;
-#define STACK_SIZE 16
-
-/*variables for compound type*/
-struct cmpd_info {
- hid_t id;
- hbool_t is_field;
- hbool_t first_memb;
-};
-extern struct cmpd_info cmpd_stack[STACK_SIZE];
-extern int csindex;
-
-/*variables for array type*/
-struct arr_info {
- hsize_t dims[H5S_MAX_RANK];
- int ndim;
- hbool_t is_dim;
-};
-extern struct arr_info arr_stack[STACK_SIZE];
-extern int asindex;
-
-/*variables for enumerate type*/
-extern hbool_t is_enum;
-extern hbool_t is_enum_memb;
-
-/*variables for string type*/
-extern hbool_t is_str_size;
-
-/*variables for opaque type*/
-extern hbool_t is_opq_size;
-extern hbool_t is_opq_tag;
-
-hbool_t first_quote = 1;
-
%}
-%s TAG_STRING
-
%%
H5T_STD_I8BE {return hid(H5T_STD_I8BE_TOKEN);}
@@ -138,32 +107,12 @@ OPQ_SIZE {return token(OPQ_SIZE_TOKEN);}
OPQ_TAG {return token(OPQ_TAG_TOKEN);}
[0-9]+ {
- if( is_str_size || (is_enum && is_enum_memb) ||
- is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) ||
- (csindex>-1 && cmpd_stack[csindex].is_field) ) {
- H5LTyylval.ival = atoi(yytext);
- return NUMBER;
- } else
- REJECT;
+ H5LTyylval.ival = HDatoi(yytext);
+ return NUMBER;
}
-"\"" {
- /*if it's first quote, and is a compound field name or an enum symbol*/
- if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field))
- && first_quote) {
- first_quote = 0;
- BEGIN TAG_STRING;
- } else /*if it's second quote*/
- first_quote = 1;
- return token('"');
- }
-<TAG_STRING>[^\"]+ {
-#ifdef H5_HAVE_WIN32_API
- H5LTyylval.sval = _strdup(yytext);
-#else /* H5_HAVE_WIN32_API */
- H5LTyylval.sval = strdup(yytext);
-#endif /* H5_HAVE_WIN32_API */
- BEGIN INITIAL;
+["][^\"]+["] {
+ H5LTyylval.sval = trim_quotes(yytext);
return STRING;
}
@@ -174,21 +123,39 @@ OPQ_TAG {return token(OPQ_TAG_TOKEN);}
":" {return token(':');}
";" {return token(';');}
[ \t\n]* ;
-"\n" { return 0; }
%%
-int my_yyinput(char *buf, int max_size)
+
+/* Allocate a copy of `quoted` with the double quote character at
+ * the beginning and the one at the end both removed. The caller is
+ * responsible for free()ing the copy.
+ */
+static char *
+trim_quotes(const char *quoted)
+{
+ size_t len = HDstrlen(quoted);
+ char *trimmed;
+
+ HDassert(quoted[0] == '"' && quoted[len - 1] == '"');
+
+ trimmed = HDstrdup(quoted + 1);
+ trimmed[len - 2] = '\0';
+
+ return trimmed;
+}
+
+static int my_yyinput(char *buf, int max_size)
{
int ret;
- memcpy(buf, myinput, input_len);
+ HDmemcpy(buf, myinput, input_len);
ret = (int)input_len;
return ret;
}
int H5LTyyerror(const char *msg)
{
- printf("ERROR: %s before \"%s\".\n", msg, yytext);
+ HDprintf("ERROR: %s before \"%s\".\n", msg, yytext);
return 0;
}
diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c
index 2ef133f..7f552d8 100644
--- a/hl/src/H5LTparse.c
+++ b/hl/src/H5LTparse.c
@@ -10,11 +10,11 @@
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wstrict-overflow"
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#if !defined (__clang__)
+#if !defined (__clang__)
#pragma GCC diagnostic ignored "-Wlarger-than="
#pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
-#endif
+#endif
#pragma GCC diagnostic ignored "-Wswitch-default"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-macros"
@@ -28,12 +28,11 @@
#elif defined _MSC_VER
#pragma warning(push, 1)
#endif
-/* A Bison parser, made by GNU Bison 3.7.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
- Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -64,10 +63,6 @@
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
-/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
- especially those whose name start with YY_ or yy_. They are
- private implementation details that can be changed or removed. */
-
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
@@ -79,7 +74,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.7.2"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -100,17 +95,20 @@
#define yyerror H5LTyyerror
#define yydebug H5LTyydebug
#define yynerrs H5LTyynerrs
+
#define yylval H5LTyylval
#define yychar H5LTyychar
-/* First part of user prologue. */
-#line 20 "hl/src/H5LTparse.y"
+/* Copy the first part of user declarations. */
+#line 20 "hl/src/H5LTparse.y" /* yacc.c:339 */
#include <stdio.h>
#include <string.h>
#include <hdf5.h>
-extern int yylex();
+#include "H5private.h"
+
+extern int yylex(void);
extern int yyerror(const char *);
#define STACK_SIZE 16
@@ -123,13 +121,13 @@ struct cmpd_info {
};
/*stack for nested compound type*/
-struct cmpd_info cmpd_stack[STACK_SIZE] = {
+static struct cmpd_info cmpd_stack[STACK_SIZE] = {
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1} };
-int csindex = -1; /*pointer to the top of compound stack*/
+static int csindex = -1; /*pointer to the top of compound stack*/
/*structure for array type information*/
struct arr_info {
@@ -138,244 +136,170 @@ struct arr_info {
hbool_t is_dim; /*flag to lexer for dimension*/
};
/*stack for nested array type*/
-struct arr_info arr_stack[STACK_SIZE];
-int asindex = -1; /*pointer to the top of array stack*/
-
-hbool_t is_str_size = 0; /*flag to lexer for string size*/
-hbool_t is_str_pad = 0; /*flag to lexer for string padding*/
-H5T_str_t str_pad; /*variable for string padding*/
-H5T_cset_t str_cset; /*variable for string character set*/
-hbool_t is_variable = 0; /*variable for variable-length string*/
-size_t str_size; /*variable for string size*/
-
-hid_t enum_id; /*type ID*/
-hbool_t is_enum = 0; /*flag to lexer for enum type*/
-hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/
-char* enum_memb_symbol; /*enum member symbol string*/
+static struct arr_info arr_stack[STACK_SIZE];
+static int asindex = -1; /*pointer to the top of array stack*/
-hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/
-hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/
+static H5T_str_t str_pad; /*variable for string padding*/
+static H5T_cset_t str_cset; /*variable for string character set*/
+static hbool_t is_variable = 0; /*variable for variable-length string*/
+static size_t str_size; /*variable for string size*/
+
+static hid_t enum_id; /*type ID*/
+static hbool_t is_enum = 0; /*flag to lexer for enum type*/
+static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/
+static char* enum_memb_symbol; /*enum member symbol string*/
-#line 131 "hl/src/H5LTparse.c"
+#line 124 "hl/src/H5LTparse.c" /* yacc.c:339 */
-# ifndef YY_CAST
-# ifdef __cplusplus
-# define YY_CAST(Type, Val) static_cast<Type> (Val)
-# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
-# else
-# define YY_CAST(Type, Val) ((Type) (Val))
-# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
-# endif
-# endif
# ifndef YY_NULLPTR
-# if defined __cplusplus
-# if 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
-# else
-# define YY_NULLPTR 0
-# endif
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
# else
-# define YY_NULLPTR ((void*)0)
+# define YY_NULLPTR 0
# endif
# endif
-#include "H5LTparse.h"
-/* Symbol kind. */
-enum yysymbol_kind_t
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* In a future release of Bison, this section will be replaced
+ by #include "H5LTparse.h". */
+#ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED
+# define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int H5LTyydebug;
+#endif
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ enum yytokentype
+ {
+ H5T_STD_I8BE_TOKEN = 258,
+ H5T_STD_I8LE_TOKEN = 259,
+ H5T_STD_I16BE_TOKEN = 260,
+ H5T_STD_I16LE_TOKEN = 261,
+ H5T_STD_I32BE_TOKEN = 262,
+ H5T_STD_I32LE_TOKEN = 263,
+ H5T_STD_I64BE_TOKEN = 264,
+ H5T_STD_I64LE_TOKEN = 265,
+ H5T_STD_U8BE_TOKEN = 266,
+ H5T_STD_U8LE_TOKEN = 267,
+ H5T_STD_U16BE_TOKEN = 268,
+ H5T_STD_U16LE_TOKEN = 269,
+ H5T_STD_U32BE_TOKEN = 270,
+ H5T_STD_U32LE_TOKEN = 271,
+ H5T_STD_U64BE_TOKEN = 272,
+ H5T_STD_U64LE_TOKEN = 273,
+ H5T_NATIVE_CHAR_TOKEN = 274,
+ H5T_NATIVE_SCHAR_TOKEN = 275,
+ H5T_NATIVE_UCHAR_TOKEN = 276,
+ H5T_NATIVE_SHORT_TOKEN = 277,
+ H5T_NATIVE_USHORT_TOKEN = 278,
+ H5T_NATIVE_INT_TOKEN = 279,
+ H5T_NATIVE_UINT_TOKEN = 280,
+ H5T_NATIVE_LONG_TOKEN = 281,
+ H5T_NATIVE_ULONG_TOKEN = 282,
+ H5T_NATIVE_LLONG_TOKEN = 283,
+ H5T_NATIVE_ULLONG_TOKEN = 284,
+ H5T_IEEE_F32BE_TOKEN = 285,
+ H5T_IEEE_F32LE_TOKEN = 286,
+ H5T_IEEE_F64BE_TOKEN = 287,
+ H5T_IEEE_F64LE_TOKEN = 288,
+ H5T_NATIVE_FLOAT_TOKEN = 289,
+ H5T_NATIVE_DOUBLE_TOKEN = 290,
+ H5T_NATIVE_LDOUBLE_TOKEN = 291,
+ H5T_STRING_TOKEN = 292,
+ STRSIZE_TOKEN = 293,
+ STRPAD_TOKEN = 294,
+ CSET_TOKEN = 295,
+ CTYPE_TOKEN = 296,
+ H5T_VARIABLE_TOKEN = 297,
+ H5T_STR_NULLTERM_TOKEN = 298,
+ H5T_STR_NULLPAD_TOKEN = 299,
+ H5T_STR_SPACEPAD_TOKEN = 300,
+ H5T_CSET_ASCII_TOKEN = 301,
+ H5T_CSET_UTF8_TOKEN = 302,
+ H5T_C_S1_TOKEN = 303,
+ H5T_FORTRAN_S1_TOKEN = 304,
+ H5T_OPAQUE_TOKEN = 305,
+ OPQ_SIZE_TOKEN = 306,
+ OPQ_TAG_TOKEN = 307,
+ H5T_COMPOUND_TOKEN = 308,
+ H5T_ENUM_TOKEN = 309,
+ H5T_ARRAY_TOKEN = 310,
+ H5T_VLEN_TOKEN = 311,
+ STRING = 312,
+ NUMBER = 313
+ };
+#endif
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+
+union YYSTYPE
{
- YYSYMBOL_YYEMPTY = -2,
- YYSYMBOL_YYEOF = 0, /* "end of file" */
- YYSYMBOL_YYerror = 1, /* error */
- YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
- YYSYMBOL_H5T_STD_I8BE_TOKEN = 3, /* H5T_STD_I8BE_TOKEN */
- YYSYMBOL_H5T_STD_I8LE_TOKEN = 4, /* H5T_STD_I8LE_TOKEN */
- YYSYMBOL_H5T_STD_I16BE_TOKEN = 5, /* H5T_STD_I16BE_TOKEN */
- YYSYMBOL_H5T_STD_I16LE_TOKEN = 6, /* H5T_STD_I16LE_TOKEN */
- YYSYMBOL_H5T_STD_I32BE_TOKEN = 7, /* H5T_STD_I32BE_TOKEN */
- YYSYMBOL_H5T_STD_I32LE_TOKEN = 8, /* H5T_STD_I32LE_TOKEN */
- YYSYMBOL_H5T_STD_I64BE_TOKEN = 9, /* H5T_STD_I64BE_TOKEN */
- YYSYMBOL_H5T_STD_I64LE_TOKEN = 10, /* H5T_STD_I64LE_TOKEN */
- YYSYMBOL_H5T_STD_U8BE_TOKEN = 11, /* H5T_STD_U8BE_TOKEN */
- YYSYMBOL_H5T_STD_U8LE_TOKEN = 12, /* H5T_STD_U8LE_TOKEN */
- YYSYMBOL_H5T_STD_U16BE_TOKEN = 13, /* H5T_STD_U16BE_TOKEN */
- YYSYMBOL_H5T_STD_U16LE_TOKEN = 14, /* H5T_STD_U16LE_TOKEN */
- YYSYMBOL_H5T_STD_U32BE_TOKEN = 15, /* H5T_STD_U32BE_TOKEN */
- YYSYMBOL_H5T_STD_U32LE_TOKEN = 16, /* H5T_STD_U32LE_TOKEN */
- YYSYMBOL_H5T_STD_U64BE_TOKEN = 17, /* H5T_STD_U64BE_TOKEN */
- YYSYMBOL_H5T_STD_U64LE_TOKEN = 18, /* H5T_STD_U64LE_TOKEN */
- YYSYMBOL_H5T_NATIVE_CHAR_TOKEN = 19, /* H5T_NATIVE_CHAR_TOKEN */
- YYSYMBOL_H5T_NATIVE_SCHAR_TOKEN = 20, /* H5T_NATIVE_SCHAR_TOKEN */
- YYSYMBOL_H5T_NATIVE_UCHAR_TOKEN = 21, /* H5T_NATIVE_UCHAR_TOKEN */
- YYSYMBOL_H5T_NATIVE_SHORT_TOKEN = 22, /* H5T_NATIVE_SHORT_TOKEN */
- YYSYMBOL_H5T_NATIVE_USHORT_TOKEN = 23, /* H5T_NATIVE_USHORT_TOKEN */
- YYSYMBOL_H5T_NATIVE_INT_TOKEN = 24, /* H5T_NATIVE_INT_TOKEN */
- YYSYMBOL_H5T_NATIVE_UINT_TOKEN = 25, /* H5T_NATIVE_UINT_TOKEN */
- YYSYMBOL_H5T_NATIVE_LONG_TOKEN = 26, /* H5T_NATIVE_LONG_TOKEN */
- YYSYMBOL_H5T_NATIVE_ULONG_TOKEN = 27, /* H5T_NATIVE_ULONG_TOKEN */
- YYSYMBOL_H5T_NATIVE_LLONG_TOKEN = 28, /* H5T_NATIVE_LLONG_TOKEN */
- YYSYMBOL_H5T_NATIVE_ULLONG_TOKEN = 29, /* H5T_NATIVE_ULLONG_TOKEN */
- YYSYMBOL_H5T_IEEE_F32BE_TOKEN = 30, /* H5T_IEEE_F32BE_TOKEN */
- YYSYMBOL_H5T_IEEE_F32LE_TOKEN = 31, /* H5T_IEEE_F32LE_TOKEN */
- YYSYMBOL_H5T_IEEE_F64BE_TOKEN = 32, /* H5T_IEEE_F64BE_TOKEN */
- YYSYMBOL_H5T_IEEE_F64LE_TOKEN = 33, /* H5T_IEEE_F64LE_TOKEN */
- YYSYMBOL_H5T_NATIVE_FLOAT_TOKEN = 34, /* H5T_NATIVE_FLOAT_TOKEN */
- YYSYMBOL_H5T_NATIVE_DOUBLE_TOKEN = 35, /* H5T_NATIVE_DOUBLE_TOKEN */
- YYSYMBOL_H5T_NATIVE_LDOUBLE_TOKEN = 36, /* H5T_NATIVE_LDOUBLE_TOKEN */
- YYSYMBOL_H5T_STRING_TOKEN = 37, /* H5T_STRING_TOKEN */
- YYSYMBOL_STRSIZE_TOKEN = 38, /* STRSIZE_TOKEN */
- YYSYMBOL_STRPAD_TOKEN = 39, /* STRPAD_TOKEN */
- YYSYMBOL_CSET_TOKEN = 40, /* CSET_TOKEN */
- YYSYMBOL_CTYPE_TOKEN = 41, /* CTYPE_TOKEN */
- YYSYMBOL_H5T_VARIABLE_TOKEN = 42, /* H5T_VARIABLE_TOKEN */
- YYSYMBOL_H5T_STR_NULLTERM_TOKEN = 43, /* H5T_STR_NULLTERM_TOKEN */
- YYSYMBOL_H5T_STR_NULLPAD_TOKEN = 44, /* H5T_STR_NULLPAD_TOKEN */
- YYSYMBOL_H5T_STR_SPACEPAD_TOKEN = 45, /* H5T_STR_SPACEPAD_TOKEN */
- YYSYMBOL_H5T_CSET_ASCII_TOKEN = 46, /* H5T_CSET_ASCII_TOKEN */
- YYSYMBOL_H5T_CSET_UTF8_TOKEN = 47, /* H5T_CSET_UTF8_TOKEN */
- YYSYMBOL_H5T_C_S1_TOKEN = 48, /* H5T_C_S1_TOKEN */
- YYSYMBOL_H5T_FORTRAN_S1_TOKEN = 49, /* H5T_FORTRAN_S1_TOKEN */
- YYSYMBOL_H5T_OPAQUE_TOKEN = 50, /* H5T_OPAQUE_TOKEN */
- YYSYMBOL_OPQ_SIZE_TOKEN = 51, /* OPQ_SIZE_TOKEN */
- YYSYMBOL_OPQ_TAG_TOKEN = 52, /* OPQ_TAG_TOKEN */
- YYSYMBOL_H5T_COMPOUND_TOKEN = 53, /* H5T_COMPOUND_TOKEN */
- YYSYMBOL_H5T_ENUM_TOKEN = 54, /* H5T_ENUM_TOKEN */
- YYSYMBOL_H5T_ARRAY_TOKEN = 55, /* H5T_ARRAY_TOKEN */
- YYSYMBOL_H5T_VLEN_TOKEN = 56, /* H5T_VLEN_TOKEN */
- YYSYMBOL_STRING = 57, /* STRING */
- YYSYMBOL_NUMBER = 58, /* NUMBER */
- YYSYMBOL_59_ = 59, /* '{' */
- YYSYMBOL_60_ = 60, /* '}' */
- YYSYMBOL_61_ = 61, /* '[' */
- YYSYMBOL_62_ = 62, /* ']' */
- YYSYMBOL_63_ = 63, /* '"' */
- YYSYMBOL_64_ = 64, /* ':' */
- YYSYMBOL_65_ = 65, /* ';' */
- YYSYMBOL_YYACCEPT = 66, /* $accept */
- YYSYMBOL_start = 67, /* start */
- YYSYMBOL_ddl_type = 68, /* ddl_type */
- YYSYMBOL_atomic_type = 69, /* atomic_type */
- YYSYMBOL_integer_type = 70, /* integer_type */
- YYSYMBOL_fp_type = 71, /* fp_type */
- YYSYMBOL_compound_type = 72, /* compound_type */
- YYSYMBOL_73_1 = 73, /* $@1 */
- YYSYMBOL_memb_list = 74, /* memb_list */
- YYSYMBOL_memb_def = 75, /* memb_def */
- YYSYMBOL_76_2 = 76, /* $@2 */
- YYSYMBOL_field_name = 77, /* field_name */
- YYSYMBOL_field_offset = 78, /* field_offset */
- YYSYMBOL_offset = 79, /* offset */
- YYSYMBOL_array_type = 80, /* array_type */
- YYSYMBOL_81_3 = 81, /* $@3 */
- YYSYMBOL_dim_list = 82, /* dim_list */
- YYSYMBOL_dim = 83, /* dim */
- YYSYMBOL_84_4 = 84, /* $@4 */
- YYSYMBOL_85_5 = 85, /* $@5 */
- YYSYMBOL_dimsize = 86, /* dimsize */
- YYSYMBOL_vlen_type = 87, /* vlen_type */
- YYSYMBOL_opaque_type = 88, /* opaque_type */
- YYSYMBOL_89_6 = 89, /* $@6 */
- YYSYMBOL_90_7 = 90, /* @7 */
- YYSYMBOL_91_8 = 91, /* $@8 */
- YYSYMBOL_92_9 = 92, /* $@9 */
- YYSYMBOL_opaque_size = 93, /* opaque_size */
- YYSYMBOL_opaque_tag = 94, /* opaque_tag */
- YYSYMBOL_string_type = 95, /* string_type */
- YYSYMBOL_96_10 = 96, /* $@10 */
- YYSYMBOL_97_11 = 97, /* $@11 */
- YYSYMBOL_98_12 = 98, /* $@12 */
- YYSYMBOL_99_13 = 99, /* $@13 */
- YYSYMBOL_100_14 = 100, /* @14 */
- YYSYMBOL_strsize = 101, /* strsize */
- YYSYMBOL_strpad = 102, /* strpad */
- YYSYMBOL_cset = 103, /* cset */
- YYSYMBOL_ctype = 104, /* ctype */
- YYSYMBOL_enum_type = 105, /* enum_type */
- YYSYMBOL_106_15 = 106, /* $@15 */
- YYSYMBOL_enum_list = 107, /* enum_list */
- YYSYMBOL_enum_def = 108, /* enum_def */
- YYSYMBOL_109_16 = 109, /* $@16 */
- YYSYMBOL_enum_symbol = 110, /* enum_symbol */
- YYSYMBOL_enum_val = 111 /* enum_val */
+#line 69 "hl/src/H5LTparse.y" /* yacc.c:355 */
+
+ int ival; /*for integer token*/
+ char *sval; /*for name string*/
+ hid_t hid; /*for hid_t token*/
+
+#line 229 "hl/src/H5LTparse.c" /* yacc.c:355 */
};
-typedef enum yysymbol_kind_t yysymbol_kind_t;
+typedef union YYSTYPE YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+extern YYSTYPE H5LTyylval;
-#ifdef short
-# undef short
-#endif
+hid_t H5LTyyparse (void);
-/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
- <limits.h> and (if available) <stdint.h> are included
- so that the code can choose integer types of a good width. */
+#endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */
-#ifndef __PTRDIFF_MAX__
-# include <limits.h> /* INFRINGES ON USER NAME SPACE */
-# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
-# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_STDINT_H
-# endif
-#endif
+/* Copy the second part of user declarations. */
-/* Narrow types that promote to a signed type and that can represent a
- signed or unsigned integer of at least N bits. In tables they can
- save space and decrease cache pressure. Promoting to a signed type
- helps avoid bugs in integer arithmetic. */
+#line 246 "hl/src/H5LTparse.c" /* yacc.c:358 */
-#ifdef __INT_LEAST8_MAX__
-typedef __INT_LEAST8_TYPE__ yytype_int8;
-#elif defined YY_STDINT_H
-typedef int_least8_t yytype_int8;
-#else
-typedef signed char yytype_int8;
+#ifdef short
+# undef short
#endif
-#ifdef __INT_LEAST16_MAX__
-typedef __INT_LEAST16_TYPE__ yytype_int16;
-#elif defined YY_STDINT_H
-typedef int_least16_t yytype_int16;
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
#else
-typedef short yytype_int16;
+typedef unsigned char yytype_uint8;
#endif
-#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
-typedef __UINT_LEAST8_TYPE__ yytype_uint8;
-#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
- && UINT_LEAST8_MAX <= INT_MAX)
-typedef uint_least8_t yytype_uint8;
-#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
-typedef unsigned char yytype_uint8;
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
#else
-typedef short yytype_uint8;
+typedef signed char yytype_int8;
#endif
-#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
-typedef __UINT_LEAST16_TYPE__ yytype_uint16;
-#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
- && UINT_LEAST16_MAX <= INT_MAX)
-typedef uint_least16_t yytype_uint16;
-#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
-typedef unsigned short yytype_uint16;
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
#else
-typedef int yytype_uint16;
+typedef unsigned short int yytype_uint16;
#endif
-#ifndef YYPTRDIFF_T
-# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
-# define YYPTRDIFF_T __PTRDIFF_TYPE__
-# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
-# elif defined PTRDIFF_MAX
-# ifndef ptrdiff_t
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# endif
-# define YYPTRDIFF_T ptrdiff_t
-# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
-# else
-# define YYPTRDIFF_T long
-# define YYPTRDIFF_MAXIMUM LONG_MAX
-# endif
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
#endif
#ifndef YYSIZE_T
@@ -383,28 +307,15 @@ typedef int yytype_uint16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# elif ! defined YYSIZE_T
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned
+# define YYSIZE_T unsigned int
# endif
#endif
-#define YYSIZE_MAXIMUM \
- YY_CAST (YYPTRDIFF_T, \
- (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
- ? YYPTRDIFF_MAXIMUM \
- : YY_CAST (YYSIZE_T, -1)))
-
-#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
-
-
-/* Stored state numbers (used for stacks). */
-typedef yytype_uint8 yy_state_t;
-
-/* State numbers in computations. */
-typedef int yy_state_fast_t;
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
@@ -418,20 +329,30 @@ typedef int yy_state_fast_t;
# endif
#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
-# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__ \
+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
# else
-# define YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE(Spec) /* empty */
# endif
#endif
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+#endif
+
#ifndef YY_ATTRIBUTE_UNUSED
-# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
-# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
# else
-# define YY_ATTRIBUTE_UNUSED
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
# endif
#endif
@@ -442,13 +363,13 @@ typedef int yy_state_fast_t;
# define YYUSE(E) /* empty */
#endif
-#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
@@ -461,22 +382,8 @@ typedef int yy_state_fast_t;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
-#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
-# define YY_IGNORE_USELESS_CAST_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
-# define YY_IGNORE_USELESS_CAST_END \
- _Pragma ("GCC diagnostic pop")
-#endif
-#ifndef YY_IGNORE_USELESS_CAST_BEGIN
-# define YY_IGNORE_USELESS_CAST_BEGIN
-# define YY_IGNORE_USELESS_CAST_END
-#endif
-
-
-#define YY_ASSERT(E) ((void) (0 && (E)))
-#if !defined yyoverflow
+#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -541,7 +448,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
-#endif /* !defined yyoverflow */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
#if (! defined yyoverflow \
&& (! defined __cplusplus \
@@ -550,17 +458,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yy_state_t yyss_alloc;
+ yytype_int16 yyss_alloc;
YYSTYPE yyvs_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
@@ -573,11 +481,11 @@ union yyalloc
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
- YYPTRDIFF_T yynewbytes; \
+ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / YYSIZEOF (*yyptr); \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
@@ -589,12 +497,12 @@ union yyalloc
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
- YYPTRDIFF_T yyi; \
+ YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
@@ -606,38 +514,35 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 58
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 203
+#define YYLAST 197
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 66
+#define YYNTOKENS 65
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 46
+#define YYNNTS 43
/* YYNRULES -- Number of rules. */
-#define YYNRULES 95
+#define YYNRULES 92
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 143
+#define YYNSTATES 134
-/* YYMAXUTOK -- Last valid token kind. */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
+#define YYUNDEFTOK 2
#define YYMAXUTOK 313
-
-/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, with out-of-bounds checking. */
-#define YYTRANSLATE(YYX) \
- (0 <= (YYX) && (YYX) <= YYMAXUTOK \
- ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
- : YYSYMBOL_YYUNDEF)
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex. */
-static const yytype_int8 yytranslate[] =
+ as returned by yylex, without out-of-bounds checking. */
+static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 63, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 64, 65,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 63, 64,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -668,34 +573,27 @@ static const yytype_int8 yytranslate[] =
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
-static const yytype_int16 yyrline[] =
+static const yytype_uint16 yyrline[] =
{
- 0, 105, 105, 106, 108, 109, 110, 111, 113, 114,
- 115, 116, 117, 120, 121, 122, 123, 124, 125, 126,
- 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
- 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
- 149, 150, 151, 152, 153, 154, 155, 159, 158, 167,
- 168, 170, 170, 207, 215, 216, 219, 221, 221, 230,
- 231, 233, 234, 233, 241, 244, 250, 251, 256, 257,
- 248, 265, 267, 271, 272, 280, 289, 296, 269, 320,
- 321, 323, 324, 325, 327, 328, 330, 331, 335, 334,
- 339, 340, 342, 342, 396, 398
+ 0, 102, 102, 103, 105, 106, 107, 108, 110, 111,
+ 112, 113, 114, 117, 118, 119, 120, 121, 122, 123,
+ 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
+ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
+ 146, 147, 148, 149, 150, 151, 152, 156, 155, 164,
+ 165, 167, 167, 204, 212, 213, 216, 218, 218, 227,
+ 228, 230, 231, 230, 238, 241, 248, 253, 245, 260,
+ 262, 267, 274, 283, 290, 264, 314, 315, 317, 318,
+ 319, 321, 322, 324, 325, 329, 328, 333, 334, 336,
+ 336, 386, 388
};
#endif
-/** Accessing symbol of state STATE. */
-#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
-
-#if YYDEBUG || 0
-/* The user-facing name of the symbol whose (internal) number is
- YYSYMBOL. No bounds checking. */
-static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
-
+#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "\"end of file\"", "error", "\"invalid token\"", "H5T_STD_I8BE_TOKEN",
+ "$end", "error", "$undefined", "H5T_STD_I8BE_TOKEN",
"H5T_STD_I8LE_TOKEN", "H5T_STD_I16BE_TOKEN", "H5T_STD_I16LE_TOKEN",
"H5T_STD_I32BE_TOKEN", "H5T_STD_I32LE_TOKEN", "H5T_STD_I64BE_TOKEN",
"H5T_STD_I64LE_TOKEN", "H5T_STD_U8BE_TOKEN", "H5T_STD_U8LE_TOKEN",
@@ -716,27 +614,21 @@ static const char *const yytname[] =
"H5T_C_S1_TOKEN", "H5T_FORTRAN_S1_TOKEN", "H5T_OPAQUE_TOKEN",
"OPQ_SIZE_TOKEN", "OPQ_TAG_TOKEN", "H5T_COMPOUND_TOKEN",
"H5T_ENUM_TOKEN", "H5T_ARRAY_TOKEN", "H5T_VLEN_TOKEN", "STRING",
- "NUMBER", "'{'", "'}'", "'['", "']'", "'\"'", "':'", "';'", "$accept",
- "start", "ddl_type", "atomic_type", "integer_type", "fp_type",
- "compound_type", "$@1", "memb_list", "memb_def", "$@2", "field_name",
- "field_offset", "offset", "array_type", "$@3", "dim_list", "dim", "$@4",
- "$@5", "dimsize", "vlen_type", "opaque_type", "$@6", "@7", "$@8", "$@9",
- "opaque_size", "opaque_tag", "string_type", "$@10", "$@11", "$@12",
- "$@13", "@14", "strsize", "strpad", "cset", "ctype", "enum_type", "$@15",
- "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULLPTR
+ "NUMBER", "'{'", "'}'", "'['", "']'", "':'", "';'", "$accept", "start",
+ "ddl_type", "atomic_type", "integer_type", "fp_type", "compound_type",
+ "$@1", "memb_list", "memb_def", "$@2", "field_name", "field_offset",
+ "offset", "array_type", "$@3", "dim_list", "dim", "$@4", "$@5",
+ "dimsize", "vlen_type", "opaque_type", "@6", "$@7", "opaque_size",
+ "opaque_tag", "string_type", "$@8", "$@9", "$@10", "@11", "strsize",
+ "strpad", "cset", "ctype", "enum_type", "$@12", "enum_list", "enum_def",
+ "$@13", "enum_symbol", "enum_val", YY_NULLPTR
};
-
-static const char *
-yysymbol_name (yysymbol_kind_t yysymbol)
-{
- return yytname[yysymbol];
-}
#endif
-#ifdef YYPRINT
+# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
-static const yytype_int16 yytoknum[] =
+static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
@@ -744,18 +636,18 @@ static const yytype_int16 yytoknum[] =
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
305, 306, 307, 308, 309, 310, 311, 312, 313, 123,
- 125, 91, 93, 34, 58, 59
+ 125, 91, 93, 58, 59
};
-#endif
+# endif
-#define YYPACT_NINF (-25)
+#define YYPACT_NINF -25
-#define yypact_value_is_default(Yyn) \
- ((Yyn) == YYPACT_NINF)
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-25)))
-#define YYTABLE_NINF (-1)
+#define YYTABLE_NINF -1
-#define yytable_value_is_error(Yyn) \
+#define yytable_value_is_error(Yytable_value) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -765,60 +657,58 @@ static const yytype_int16 yypact[] =
114, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -24, -20, -25, -15, -25,
- -14, 49, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, 19, 45, 38, 168, 39, 114, -25, -25,
- -25, -25, 34, -25, 40, -4, 43, 56, -25, -3,
- -25, -25, -25, 37, -25, 42, -25, -25, -25, -25,
- -25, 44, -25, -25, -25, 50, -23, 47, -25, 64,
- 62, 51, -25, 58, -25, -25, -25, -2, -25, -25,
- 89, -25, 90, 92, -25, -25, -25, 91, 94, 95,
- -25, -25, -25, 98, 100, 96, 102, 122, -25, 103,
- -25, -25, -25, -25, 133, 9, 134, -25, -25, -25,
- 135, -25, -25, 105, 160, -25, 46, -25, -25, 137,
- -25, 143, -25
+ -25, -25, -25, -25, -25, -24, -22, -25, -13, -25,
+ -11, 49, -25, -25, -25, -25, -25, -25, -25, -25,
+ -25, -25, 18, 45, 38, 168, 39, 114, -25, -4,
+ 41, -25, 36, -25, 42, -25, -25, 37, -25, 40,
+ 56, -25, -3, -25, -25, -25, -25, -25, -25, -25,
+ -25, 43, -25, 66, 55, 51, -21, 57, -25, 0,
+ 95, -25, 50, -25, -25, -25, -25, -25, -25, -25,
+ -25, -25, 89, -25, 90, 97, 92, 99, 52, -25,
+ -25, -25, -25, -25, -25, 94, -25, 119, 100, -25,
+ -6, -25, -25, -25, 98, -25, 120, 46, -25, -25,
+ 101, -25, 103, -25
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
-static const yytype_int8 yydefact[] =
+static const yytype_uint8 yydefact[] =
{
2, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 0, 0, 47, 0, 57,
0, 0, 3, 4, 8, 9, 5, 6, 7, 12,
- 10, 11, 0, 0, 0, 0, 0, 0, 1, 73,
- 66, 49, 0, 59, 0, 0, 0, 0, 88, 0,
- 65, 79, 80, 0, 71, 0, 48, 51, 50, 90,
- 61, 0, 60, 74, 67, 0, 0, 0, 58, 0,
- 0, 0, 89, 0, 91, 64, 62, 0, 68, 53,
- 0, 94, 0, 0, 81, 82, 83, 0, 0, 54,
- 92, 63, 75, 0, 0, 0, 0, 0, 72, 0,
- 56, 55, 52, 95, 0, 0, 0, 93, 84, 85,
- 0, 69, 76, 0, 0, 70, 0, 86, 87, 0,
- 77, 0, 78
+ 10, 11, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 49, 0, 59, 0, 76, 77, 0, 69, 0,
+ 0, 85, 0, 65, 71, 66, 48, 51, 50, 87,
+ 61, 0, 60, 0, 0, 0, 0, 0, 58, 0,
+ 0, 53, 54, 91, 86, 88, 89, 64, 62, 78,
+ 79, 80, 0, 70, 0, 0, 0, 0, 0, 72,
+ 67, 56, 55, 52, 92, 0, 63, 0, 0, 90,
+ 0, 68, 81, 82, 0, 73, 0, 0, 83, 84,
+ 0, 74, 0, 75
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -25, -25, -21, -25, 108, -25, -25, -25, -25, -25,
+ -25, -25, -15, -25, 111, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25
+ -25, -25, -25
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 41, 42, 43, 44, 45, 46, 54, 67, 78,
- 85, 100, 115, 121, 47, 56, 69, 82, 87, 103,
- 96, 48, 49, 66, 90, 108, 133, 75, 119, 50,
- 65, 89, 117, 134, 141, 73, 107, 130, 139, 51,
- 79, 86, 94, 116, 102, 124
+ -1, 41, 42, 43, 44, 45, 46, 54, 70, 78,
+ 85, 92, 106, 112, 47, 56, 72, 82, 87, 108,
+ 98, 48, 49, 84, 118, 69, 104, 50, 83, 117,
+ 126, 132, 67, 102, 124, 130, 51, 79, 86, 95,
+ 107, 96, 115
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -829,107 +719,104 @@ static const yytype_uint8 yytable[] =
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 52, 64, 92, 71, 53,
- 93, 104, 105, 106, 55, 57, 77, 36, 81, 58,
- 37, 38, 39, 40, 72, 128, 129, 59, 80, 1,
+ 31, 32, 33, 34, 35, 52, 93, 53, 65, 94,
+ 122, 123, 64, 99, 100, 101, 55, 36, 57, 58,
+ 37, 38, 39, 40, 66, 77, 59, 81, 80, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 137, 138, 60, 61, 63, 68,
- 70, 74, 83, 97, 88, 95, 36, 84, 99, 37,
- 38, 39, 40, 91, 98, 101, 76, 1, 2, 3,
+ 32, 33, 34, 35, 128, 129, 60, 61, 63, 68,
+ 71, 74, 73, 88, 75, 89, 36, 90, 91, 37,
+ 38, 39, 40, 105, 116, 97, 76, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 35, 109, 110, 111, 118, 112, 113, 120, 114,
- 123, 122, 125, 62, 36, 135, 126, 37, 38, 39,
+ 34, 35, 103, 109, 110, 111, 113, 114, 119, 120,
+ 121, 127, 125, 133, 36, 131, 62, 37, 38, 39,
40, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 127, 131,
- 132, 136, 140, 142
+ 20, 21, 22, 23, 24, 25, 26, 27
};
-static const yytype_int8 yycheck[] =
+static const yytype_uint8 yycheck[] =
{
3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 59, 57, 60, 42, 59,
- 63, 43, 44, 45, 59, 59, 67, 50, 69, 0,
- 53, 54, 55, 56, 58, 46, 47, 38, 61, 3,
+ 33, 34, 35, 36, 37, 59, 57, 59, 42, 60,
+ 46, 47, 57, 43, 44, 45, 59, 50, 59, 0,
+ 53, 54, 55, 56, 58, 70, 38, 72, 61, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 35, 36, 37, 48, 49, 51, 59, 59, 65,
- 60, 58, 65, 39, 60, 58, 50, 65, 57, 53,
- 54, 55, 56, 63, 52, 57, 60, 3, 4, 5,
+ 34, 35, 36, 37, 48, 49, 51, 59, 59, 58,
+ 64, 64, 60, 60, 64, 39, 50, 52, 57, 53,
+ 54, 55, 56, 63, 62, 58, 60, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 63, 63, 62, 57, 65, 63, 58, 64,
- 58, 65, 40, 55, 50, 60, 63, 53, 54, 55,
+ 36, 37, 57, 64, 64, 58, 64, 58, 64, 40,
+ 60, 41, 64, 60, 50, 64, 55, 53, 54, 55,
56, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 65, 65,
- 65, 41, 65, 60
+ 22, 23, 24, 25, 26, 27, 28, 29
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const yytype_int8 yystos[] =
+static const yytype_uint8 yystos[] =
{
0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 50, 53, 54, 55,
- 56, 67, 68, 69, 70, 71, 72, 80, 87, 88,
- 95, 105, 59, 59, 73, 59, 81, 59, 0, 38,
- 51, 59, 70, 59, 68, 96, 89, 74, 65, 82,
- 60, 42, 58, 101, 58, 93, 60, 68, 75, 106,
- 61, 68, 83, 65, 65, 76, 107, 84, 60, 97,
- 90, 63, 60, 63, 108, 58, 86, 39, 52, 57,
- 77, 57, 110, 85, 43, 44, 45, 102, 91, 63,
- 63, 62, 65, 63, 64, 78, 109, 98, 57, 94,
- 58, 79, 65, 58, 111, 40, 63, 65, 46, 47,
- 103, 65, 65, 92, 99, 60, 41, 48, 49, 104,
- 65, 100, 60
+ 56, 66, 67, 68, 69, 70, 71, 79, 86, 87,
+ 92, 101, 59, 59, 72, 59, 80, 59, 0, 38,
+ 51, 59, 69, 59, 67, 42, 58, 97, 58, 90,
+ 73, 64, 81, 60, 64, 64, 60, 67, 74, 102,
+ 61, 67, 82, 93, 88, 75, 103, 83, 60, 39,
+ 52, 57, 76, 57, 60, 104, 106, 58, 85, 43,
+ 44, 45, 98, 57, 91, 63, 77, 105, 84, 64,
+ 64, 58, 78, 64, 58, 107, 62, 94, 89, 64,
+ 40, 60, 46, 47, 99, 64, 95, 41, 48, 49,
+ 100, 64, 96, 60
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_int8 yyr1[] =
+static const yytype_uint8 yyr1[] =
{
- 0, 66, 67, 67, 68, 68, 68, 68, 69, 69,
- 69, 69, 69, 70, 70, 70, 70, 70, 70, 70,
- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
- 71, 71, 71, 71, 71, 71, 71, 73, 72, 74,
- 74, 76, 75, 77, 78, 78, 79, 81, 80, 82,
- 82, 84, 85, 83, 86, 87, 89, 90, 91, 92,
- 88, 93, 94, 96, 97, 98, 99, 100, 95, 101,
- 101, 102, 102, 102, 103, 103, 104, 104, 106, 105,
- 107, 107, 109, 108, 110, 111
+ 0, 65, 66, 66, 67, 67, 67, 67, 68, 68,
+ 68, 68, 68, 69, 69, 69, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
+ 70, 70, 70, 70, 70, 70, 70, 72, 71, 73,
+ 73, 75, 74, 76, 77, 77, 78, 80, 79, 81,
+ 81, 83, 84, 82, 85, 86, 88, 89, 87, 90,
+ 91, 93, 94, 95, 96, 92, 97, 97, 98, 98,
+ 98, 99, 99, 100, 100, 102, 101, 103, 103, 105,
+ 104, 106, 107
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_int8 yyr2[] =
+static const yytype_uint8 yyr2[] =
{
0, 2, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0, 5, 0,
- 2, 0, 7, 1, 0, 2, 1, 0, 6, 0,
- 2, 0, 0, 5, 1, 4, 0, 0, 0, 0,
- 15, 1, 1, 0, 0, 0, 0, 0, 20, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 0, 7,
- 0, 2, 0, 6, 1, 1
+ 2, 0, 5, 1, 0, 2, 1, 0, 6, 0,
+ 2, 0, 0, 5, 1, 4, 0, 0, 11, 1,
+ 1, 0, 0, 0, 0, 19, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 0, 7, 0, 2, 0,
+ 4, 1, 1
};
-enum { YYENOMEM = -2 };
-
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
@@ -938,26 +825,27 @@ enum { YYENOMEM = -2 };
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
- do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
- while (0)
-
-/* Backward compatibility with an undocumented macro.
- Use YYerror or YYUNDEF. */
-#define YYERRCODE YYUNDEF
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+while (0)
+
+/* Error token number */
+#define YYTERROR 1
+#define YYERRCODE 256
+
/* Enable debugging if requested. */
@@ -975,58 +863,54 @@ do { \
} while (0)
/* This macro is provided for backward compatibility. */
-# ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
-# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Kind, Value); \
+ Type, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
-/*-----------------------------------.
-| Print this symbol's value on YYO. |
-`-----------------------------------*/
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
static void
-yy_symbol_value_print (FILE *yyo,
- yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
{
- FILE *yyoutput = yyo;
- YYUSE (yyoutput);
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
if (!yyvaluep)
return;
# ifdef YYPRINT
- if (yykind < YYNTOKENS)
- YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- YYUSE (yykind);
- YY_IGNORE_MAYBE_UNINITIALIZED_END
+ YYUSE (yytype);
}
-/*---------------------------.
-| Print this symbol on YYO. |
-`---------------------------*/
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
static void
-yy_symbol_print (FILE *yyo,
- yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
{
- YYFPRINTF (yyo, "%s %s (",
- yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- yy_symbol_value_print (yyo, yykind, yyvaluep);
- YYFPRINTF (yyo, ")");
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ YYFPRINTF (yyoutput, ")");
}
/*------------------------------------------------------------------.
@@ -1035,7 +919,7 @@ yy_symbol_print (FILE *yyo,
`------------------------------------------------------------------*/
static void
-yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -1058,21 +942,21 @@ do { \
`------------------------------------------------*/
static void
-yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
- int yyrule)
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
{
- int yylno = yyrline[yyrule];
+ unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
- &yyvsp[(yyi + 1) - (yynrhs)]);
+ yystos[yyssp[yyi + 1 - yynrhs]],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
YYFPRINTF (stderr, "\n");
}
}
@@ -1087,8 +971,8 @@ do { \
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
-# define YYDPRINTF(Args) ((void) 0)
-# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
@@ -1111,30 +995,249 @@ int yydebug;
#endif
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+yystrlen (const char *yystr)
+{
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
+ continue;
+ return yylen;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+{
+ char *yyd = yydest;
+ const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+ quotes and backslashes, so that it's suitable for yyerror. The
+ heuristic is that double-quoting is unnecessary unless the string
+ contains an apostrophe, a comma, or backslash (other than
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ if (! yyres)
+ return yystrlen (yystr);
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
+{
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULLPTR;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
+ {
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
+
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
+ }
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
+}
+#endif /* YYERROR_VERBOSE */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
static void
-yydestruct (const char *yymsg,
- yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
{
YYUSE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- YYUSE (yykind);
+ YYUSE (yytype);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/* Lookahead token kind. */
+
+
+/* The lookahead symbol. */
int yychar;
/* The semantic value of the lookahead symbol. */
@@ -1143,8 +1246,6 @@ YYSTYPE yylval;
int yynerrs;
-
-
/*----------.
| yyparse. |
`----------*/
@@ -1152,36 +1253,43 @@ int yynerrs;
hid_t
yyparse (void)
{
- yy_state_fast_t yystate = 0;
+ int yystate;
/* Number of tokens to shift before error messages enabled. */
- int yyerrstatus = 0;
+ int yyerrstatus;
- /* Refer to the stacks through separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
+ /* The stacks and their tools:
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
- /* Their size. */
- YYPTRDIFF_T yystacksize = YYINITDEPTH;
+ Refer to the stacks through separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
- /* The state stack: array, bottom, top. */
- yy_state_t yyssa[YYINITDEPTH];
- yy_state_t *yyss = yyssa;
- yy_state_t *yyssp = yyss;
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
- /* The semantic value stack: array, bottom, top. */
+ /* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp = yyvs;
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
+
+ YYSIZE_T yystacksize;
int yyn;
- /* The return value of yyparse. */
int yyresult;
- /* Lookahead symbol kind. */
- yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken = 0;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
-
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
@@ -1189,60 +1297,58 @@ yyparse (void)
Keep to zero when no symbol should be popped. */
int yylen = 0;
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
+ yystacksize = YYINITDEPTH;
+
YYDPRINTF ((stderr, "Starting parse\n"));
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate;
-
/*------------------------------------------------------------.
-| yynewstate -- push a new state, which is found in yystate. |
+| yynewstate -- Push a new state, which is found in yystate. |
`------------------------------------------------------------*/
-yynewstate:
+ yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
-
-/*--------------------------------------------------------------------.
-| yysetstate -- set current state (the top of the stack) to yystate. |
-`--------------------------------------------------------------------*/
-yysetstate:
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
- YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
- YY_IGNORE_USELESS_CAST_BEGIN
- *yyssp = YY_CAST (yy_state_t, yystate);
- YY_IGNORE_USELESS_CAST_END
- YY_STACK_PRINT (yyss, yyssp);
+ yysetstate:
+ *yyssp = yystate;
if (yyss + yystacksize - 1 <= yyssp)
-#if !defined yyoverflow && !defined YYSTACK_RELOCATE
- goto yyexhaustedlab;
-#else
{
/* Get the current used size of the three stacks, in elements. */
- YYPTRDIFF_T yysize = yyssp - yyss + 1;
+ YYSIZE_T yysize = yyssp - yyss + 1;
-# if defined yyoverflow
+#ifdef yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
- yy_state_t *yyss1 = yyss;
YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * YYSIZEOF (*yyssp),
- &yyvs1, yysize * YYSIZEOF (*yyvsp),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
+
yyss = yyss1;
yyvs = yyvs1;
}
-# else /* defined YYSTACK_RELOCATE */
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
@@ -1251,10 +1357,9 @@ yysetstate:
yystacksize = YYMAXDEPTH;
{
- yy_state_t *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
- YY_CAST (union yyalloc *,
- YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
@@ -1264,30 +1369,30 @@ yysetstate:
YYSTACK_FREE (yyss1);
}
# endif
+#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
- YY_IGNORE_USELESS_CAST_BEGIN
- YYDPRINTF ((stderr, "Stack size increased to %ld\n",
- YY_CAST (long, yystacksize)));
- YY_IGNORE_USELESS_CAST_END
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
-
/*-----------.
| yybackup. |
`-----------*/
yybackup:
+
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -1298,29 +1403,18 @@ yybackup:
/* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token\n"));
+ YYDPRINTF ((stderr, "Reading a token: "));
yychar = yylex ();
}
if (yychar <= YYEOF)
{
- yychar = YYEOF;
- yytoken = YYSYMBOL_YYEOF;
+ yychar = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
- else if (yychar == YYerror)
- {
- /* The scanner already issued an error message, process directly
- to error recovery. But do not keep the error token as
- lookahead, it is too special and may lead us to an endless
- loop in error recovery. */
- yychar = YYUNDEF;
- yytoken = YYSYMBOL_YYerror;
- goto yyerrlab1;
- }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -1348,13 +1442,15 @@ yybackup:
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
+
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
- /* Discard the shifted token. */
- yychar = YYEMPTY;
goto yynewstate;
@@ -1369,7 +1465,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- do a reduction. |
+| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -1389,404 +1485,383 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 2: /* start: %empty */
-#line 105 "hl/src/H5LTparse.y"
- { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ }
-#line 1366 "hl/src/H5LTparse.c"
+ case 2:
+#line 102 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ }
+#line 1462 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 3: /* start: ddl_type */
-#line 106 "hl/src/H5LTparse.y"
- { return (yyval.hid);}
-#line 1372 "hl/src/H5LTparse.c"
+ case 3:
+#line 103 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { return (yyval.hid);}
+#line 1468 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 13: /* integer_type: H5T_STD_I8BE_TOKEN */
-#line 120 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); }
-#line 1378 "hl/src/H5LTparse.c"
+ case 13:
+#line 117 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); }
+#line 1474 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 14: /* integer_type: H5T_STD_I8LE_TOKEN */
-#line 121 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); }
-#line 1384 "hl/src/H5LTparse.c"
+ case 14:
+#line 118 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); }
+#line 1480 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 15: /* integer_type: H5T_STD_I16BE_TOKEN */
-#line 122 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); }
-#line 1390 "hl/src/H5LTparse.c"
+ case 15:
+#line 119 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); }
+#line 1486 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 16: /* integer_type: H5T_STD_I16LE_TOKEN */
-#line 123 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); }
-#line 1396 "hl/src/H5LTparse.c"
+ case 16:
+#line 120 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); }
+#line 1492 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 17: /* integer_type: H5T_STD_I32BE_TOKEN */
-#line 124 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); }
-#line 1402 "hl/src/H5LTparse.c"
+ case 17:
+#line 121 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); }
+#line 1498 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 18: /* integer_type: H5T_STD_I32LE_TOKEN */
-#line 125 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); }
-#line 1408 "hl/src/H5LTparse.c"
+ case 18:
+#line 122 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); }
+#line 1504 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 19: /* integer_type: H5T_STD_I64BE_TOKEN */
-#line 126 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); }
-#line 1414 "hl/src/H5LTparse.c"
+ case 19:
+#line 123 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); }
+#line 1510 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 20: /* integer_type: H5T_STD_I64LE_TOKEN */
-#line 127 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); }
-#line 1420 "hl/src/H5LTparse.c"
+ case 20:
+#line 124 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); }
+#line 1516 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 21: /* integer_type: H5T_STD_U8BE_TOKEN */
-#line 128 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); }
-#line 1426 "hl/src/H5LTparse.c"
+ case 21:
+#line 125 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); }
+#line 1522 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 22: /* integer_type: H5T_STD_U8LE_TOKEN */
-#line 129 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); }
-#line 1432 "hl/src/H5LTparse.c"
+ case 22:
+#line 126 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); }
+#line 1528 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 23: /* integer_type: H5T_STD_U16BE_TOKEN */
-#line 130 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); }
-#line 1438 "hl/src/H5LTparse.c"
+ case 23:
+#line 127 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); }
+#line 1534 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 24: /* integer_type: H5T_STD_U16LE_TOKEN */
-#line 131 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); }
-#line 1444 "hl/src/H5LTparse.c"
+ case 24:
+#line 128 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); }
+#line 1540 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 25: /* integer_type: H5T_STD_U32BE_TOKEN */
-#line 132 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); }
-#line 1450 "hl/src/H5LTparse.c"
+ case 25:
+#line 129 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); }
+#line 1546 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 26: /* integer_type: H5T_STD_U32LE_TOKEN */
-#line 133 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); }
-#line 1456 "hl/src/H5LTparse.c"
+ case 26:
+#line 130 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); }
+#line 1552 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 27: /* integer_type: H5T_STD_U64BE_TOKEN */
-#line 134 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); }
-#line 1462 "hl/src/H5LTparse.c"
+ case 27:
+#line 131 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); }
+#line 1558 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 28: /* integer_type: H5T_STD_U64LE_TOKEN */
-#line 135 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); }
-#line 1468 "hl/src/H5LTparse.c"
+ case 28:
+#line 132 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); }
+#line 1564 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 29: /* integer_type: H5T_NATIVE_CHAR_TOKEN */
-#line 136 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); }
-#line 1474 "hl/src/H5LTparse.c"
+ case 29:
+#line 133 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); }
+#line 1570 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 30: /* integer_type: H5T_NATIVE_SCHAR_TOKEN */
-#line 137 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); }
-#line 1480 "hl/src/H5LTparse.c"
+ case 30:
+#line 134 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); }
+#line 1576 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 31: /* integer_type: H5T_NATIVE_UCHAR_TOKEN */
-#line 138 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); }
-#line 1486 "hl/src/H5LTparse.c"
+ case 31:
+#line 135 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); }
+#line 1582 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 32: /* integer_type: H5T_NATIVE_SHORT_TOKEN */
-#line 139 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); }
-#line 1492 "hl/src/H5LTparse.c"
+ case 32:
+#line 136 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); }
+#line 1588 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 33: /* integer_type: H5T_NATIVE_USHORT_TOKEN */
-#line 140 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); }
-#line 1498 "hl/src/H5LTparse.c"
+ case 33:
+#line 137 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); }
+#line 1594 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 34: /* integer_type: H5T_NATIVE_INT_TOKEN */
-#line 141 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); }
-#line 1504 "hl/src/H5LTparse.c"
+ case 34:
+#line 138 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); }
+#line 1600 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 35: /* integer_type: H5T_NATIVE_UINT_TOKEN */
-#line 142 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); }
-#line 1510 "hl/src/H5LTparse.c"
+ case 35:
+#line 139 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); }
+#line 1606 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 36: /* integer_type: H5T_NATIVE_LONG_TOKEN */
-#line 143 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); }
-#line 1516 "hl/src/H5LTparse.c"
+ case 36:
+#line 140 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); }
+#line 1612 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 37: /* integer_type: H5T_NATIVE_ULONG_TOKEN */
-#line 144 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); }
-#line 1522 "hl/src/H5LTparse.c"
+ case 37:
+#line 141 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); }
+#line 1618 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 38: /* integer_type: H5T_NATIVE_LLONG_TOKEN */
-#line 145 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); }
-#line 1528 "hl/src/H5LTparse.c"
+ case 38:
+#line 142 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); }
+#line 1624 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 39: /* integer_type: H5T_NATIVE_ULLONG_TOKEN */
-#line 146 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); }
-#line 1534 "hl/src/H5LTparse.c"
+ case 39:
+#line 143 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); }
+#line 1630 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 40: /* fp_type: H5T_IEEE_F32BE_TOKEN */
-#line 149 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); }
-#line 1540 "hl/src/H5LTparse.c"
+ case 40:
+#line 146 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); }
+#line 1636 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 41: /* fp_type: H5T_IEEE_F32LE_TOKEN */
-#line 150 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); }
-#line 1546 "hl/src/H5LTparse.c"
+ case 41:
+#line 147 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); }
+#line 1642 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 42: /* fp_type: H5T_IEEE_F64BE_TOKEN */
-#line 151 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); }
-#line 1552 "hl/src/H5LTparse.c"
+ case 42:
+#line 148 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); }
+#line 1648 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 43: /* fp_type: H5T_IEEE_F64LE_TOKEN */
-#line 152 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); }
-#line 1558 "hl/src/H5LTparse.c"
+ case 43:
+#line 149 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); }
+#line 1654 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 44: /* fp_type: H5T_NATIVE_FLOAT_TOKEN */
-#line 153 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); }
-#line 1564 "hl/src/H5LTparse.c"
+ case 44:
+#line 150 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); }
+#line 1660 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 45: /* fp_type: H5T_NATIVE_DOUBLE_TOKEN */
-#line 154 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); }
-#line 1570 "hl/src/H5LTparse.c"
+ case 45:
+#line 151 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); }
+#line 1666 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 46: /* fp_type: H5T_NATIVE_LDOUBLE_TOKEN */
-#line 155 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); }
-#line 1576 "hl/src/H5LTparse.c"
+ case 46:
+#line 152 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); }
+#line 1672 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 47: /* $@1: %empty */
-#line 159 "hl/src/H5LTparse.y"
- { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ }
-#line 1582 "hl/src/H5LTparse.c"
+ case 47:
+#line 156 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ }
+#line 1678 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 48: /* compound_type: H5T_COMPOUND_TOKEN $@1 '{' memb_list '}' */
-#line 161 "hl/src/H5LTparse.y"
- { (yyval.hid) = cmpd_stack[csindex].id;
+ case 48:
+#line 158 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = cmpd_stack[csindex].id;
cmpd_stack[csindex].id = 0;
cmpd_stack[csindex].first_memb = 1;
csindex--;
}
-#line 1592 "hl/src/H5LTparse.c"
+#line 1688 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 51: /* $@2: %empty */
-#line 170 "hl/src/H5LTparse.y"
- { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ }
-#line 1598 "hl/src/H5LTparse.c"
+ case 51:
+#line 167 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ }
+#line 1694 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 52: /* memb_def: ddl_type $@2 '"' field_name '"' field_offset ';' */
-#line 172 "hl/src/H5LTparse.y"
- {
+ case 52:
+#line 169 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
size_t origin_size, new_size;
hid_t dtype_id = cmpd_stack[csindex].id;
/*Adjust size and insert member, consider both member size and offset.*/
if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/
- new_size = H5Tget_size((yyvsp[-6].hid)) + (yyvsp[-1].ival);
+ new_size = H5Tget_size((yyvsp[-4].hid)) + (yyvsp[-1].ival);
H5Tset_size(dtype_id, new_size);
/*member name is saved in yylval.sval by lexer*/
- H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid));
+ H5Tinsert(dtype_id, (yyvsp[-2].sval), (yyvsp[-1].ival), (yyvsp[-4].hid));
cmpd_stack[csindex].first_memb = 0;
} else {
origin_size = H5Tget_size(dtype_id);
if((yyvsp[-1].ival) == 0) {
- new_size = origin_size + H5Tget_size((yyvsp[-6].hid));
+ new_size = origin_size + H5Tget_size((yyvsp[-4].hid));
H5Tset_size(dtype_id, new_size);
- H5Tinsert(dtype_id, (yyvsp[-3].sval), origin_size, (yyvsp[-6].hid));
+ H5Tinsert(dtype_id, (yyvsp[-2].sval), origin_size, (yyvsp[-4].hid));
} else {
- new_size = (yyvsp[-1].ival) + H5Tget_size((yyvsp[-6].hid));
+ new_size = (yyvsp[-1].ival) + H5Tget_size((yyvsp[-4].hid));
H5Tset_size(dtype_id, new_size);
- H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid));
+ H5Tinsert(dtype_id, (yyvsp[-2].sval), (yyvsp[-1].ival), (yyvsp[-4].hid));
}
}
- if((yyvsp[-3].sval)) {
- free((yyvsp[-3].sval));
- (yyvsp[-3].sval) = NULL;
+ if((yyvsp[-2].sval)) {
+ HDfree((yyvsp[-2].sval));
+ (yyvsp[-2].sval) = NULL;
}
cmpd_stack[csindex].is_field = 0;
- H5Tclose((yyvsp[-6].hid));
+ H5Tclose((yyvsp[-4].hid));
new_size = H5Tget_size(dtype_id);
}
-#line 1637 "hl/src/H5LTparse.c"
+#line 1733 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 53: /* field_name: STRING */
-#line 208 "hl/src/H5LTparse.y"
- {
- (yyval.sval) = strdup(yylval.sval);
- free(yylval.sval);
+ case 53:
+#line 205 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
+ (yyval.sval) = HDstrdup(yylval.sval);
+ HDfree(yylval.sval);
yylval.sval = NULL;
}
-#line 1647 "hl/src/H5LTparse.c"
+#line 1743 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 54: /* field_offset: %empty */
-#line 215 "hl/src/H5LTparse.y"
- { (yyval.ival) = 0; }
-#line 1653 "hl/src/H5LTparse.c"
+ case 54:
+#line 212 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.ival) = 0; }
+#line 1749 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 55: /* field_offset: ':' offset */
-#line 217 "hl/src/H5LTparse.y"
- { (yyval.ival) = yylval.ival; }
-#line 1659 "hl/src/H5LTparse.c"
+ case 55:
+#line 214 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.ival) = yylval.ival; }
+#line 1755 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 57: /* $@3: %empty */
-#line 221 "hl/src/H5LTparse.y"
- { asindex++; /*pushd onto the stack*/ }
-#line 1665 "hl/src/H5LTparse.c"
+ case 57:
+#line 218 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { asindex++; /*pushd onto the stack*/ }
+#line 1761 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 58: /* array_type: H5T_ARRAY_TOKEN $@3 '{' dim_list ddl_type '}' */
-#line 223 "hl/src/H5LTparse.y"
- {
+ case 58:
+#line 220 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
(yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims);
arr_stack[asindex].ndims = 0;
asindex--;
H5Tclose((yyvsp[-1].hid));
}
-#line 1676 "hl/src/H5LTparse.c"
+#line 1772 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 61: /* $@4: %empty */
-#line 233 "hl/src/H5LTparse.y"
- { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ }
-#line 1682 "hl/src/H5LTparse.c"
+ case 61:
+#line 230 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ }
+#line 1778 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 62: /* $@5: %empty */
-#line 234 "hl/src/H5LTparse.y"
- { unsigned ndims = arr_stack[asindex].ndims;
+ case 62:
+#line 231 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { unsigned ndims = arr_stack[asindex].ndims;
arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival;
arr_stack[asindex].ndims++;
arr_stack[asindex].is_dim = 0;
}
-#line 1692 "hl/src/H5LTparse.c"
- break;
-
- case 65: /* vlen_type: H5T_VLEN_TOKEN '{' ddl_type '}' */
-#line 245 "hl/src/H5LTparse.y"
- { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); }
-#line 1698 "hl/src/H5LTparse.c"
+#line 1788 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 66: /* $@6: %empty */
-#line 250 "hl/src/H5LTparse.y"
- { is_opq_size = 1; }
-#line 1704 "hl/src/H5LTparse.c"
+ case 65:
+#line 242 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); }
+#line 1794 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 67: /* @7: %empty */
-#line 251 "hl/src/H5LTparse.y"
- {
+ case 66:
+#line 248 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
size_t size = (size_t)yylval.ival;
(yyval.hid) = H5Tcreate(H5T_OPAQUE, size);
- is_opq_size = 0;
}
-#line 1714 "hl/src/H5LTparse.c"
+#line 1803 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 68: /* $@8: %empty */
-#line 256 "hl/src/H5LTparse.y"
- { is_opq_tag = 1; }
-#line 1720 "hl/src/H5LTparse.c"
- break;
-
- case 69: /* $@9: %empty */
-#line 257 "hl/src/H5LTparse.y"
- {
- H5Tset_tag((yyvsp[-6].hid), yylval.sval);
- free(yylval.sval);
+ case 67:
+#line 253 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
+ H5Tset_tag((yyvsp[-3].hid), yylval.sval);
+ HDfree(yylval.sval);
yylval.sval = NULL;
- is_opq_tag = 0;
}
-#line 1731 "hl/src/H5LTparse.c"
+#line 1813 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 70: /* opaque_type: H5T_OPAQUE_TOKEN '{' OPQ_SIZE_TOKEN $@6 opaque_size ';' @7 OPQ_TAG_TOKEN $@8 '"' opaque_tag '"' ';' $@9 '}' */
-#line 263 "hl/src/H5LTparse.y"
- { (yyval.hid) = (yyvsp[-8].hid); }
-#line 1737 "hl/src/H5LTparse.c"
+ case 68:
+#line 258 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { (yyval.hid) = (yyvsp[-5].hid); }
+#line 1819 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 73: /* $@10: %empty */
-#line 271 "hl/src/H5LTparse.y"
- { is_str_size = 1; }
-#line 1743 "hl/src/H5LTparse.c"
- break;
-
- case 74: /* $@11: %empty */
-#line 272 "hl/src/H5LTparse.y"
- {
+ case 71:
+#line 267 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN)
is_variable = 1;
else
str_size = yylval.ival;
- is_str_size = 0;
}
-#line 1755 "hl/src/H5LTparse.c"
+#line 1830 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 75: /* $@12: %empty */
-#line 280 "hl/src/H5LTparse.y"
- {
+ case 72:
+#line 274 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN)
str_pad = H5T_STR_NULLTERM;
else if((yyvsp[-1].ival) == H5T_STR_NULLPAD_TOKEN)
@@ -1794,34 +1869,34 @@ yyreduce:
else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN)
str_pad = H5T_STR_SPACEPAD;
}
-#line 1768 "hl/src/H5LTparse.c"
+#line 1843 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 76: /* $@13: %empty */
-#line 289 "hl/src/H5LTparse.y"
- {
+ case 73:
+#line 283 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN)
str_cset = H5T_CSET_ASCII;
else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN)
str_cset = H5T_CSET_UTF8;
}
-#line 1779 "hl/src/H5LTparse.c"
+#line 1854 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 77: /* @14: %empty */
-#line 296 "hl/src/H5LTparse.y"
- {
+ case 74:
+#line 290 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
if((yyvsp[-1].hid) == H5T_C_S1_TOKEN)
(yyval.hid) = H5Tcopy(H5T_C_S1);
else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN)
(yyval.hid) = H5Tcopy(H5T_FORTRAN_S1);
}
-#line 1790 "hl/src/H5LTparse.c"
+#line 1865 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 78: /* string_type: H5T_STRING_TOKEN '{' STRSIZE_TOKEN $@10 strsize ';' $@11 STRPAD_TOKEN strpad ';' $@12 CSET_TOKEN cset ';' $@13 CTYPE_TOKEN ctype ';' @14 '}' */
-#line 303 "hl/src/H5LTparse.y"
- {
+ case 75:
+#line 297 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
hid_t str_id = (yyvsp[-1].hid);
/*set string size*/
@@ -1837,87 +1912,83 @@ yyreduce:
(yyval.hid) = str_id;
}
-#line 1811 "hl/src/H5LTparse.c"
+#line 1886 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 79: /* strsize: H5T_VARIABLE_TOKEN */
-#line 320 "hl/src/H5LTparse.y"
- {(yyval.ival) = H5T_VARIABLE_TOKEN;}
-#line 1817 "hl/src/H5LTparse.c"
+ case 76:
+#line 314 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.ival) = H5T_VARIABLE_TOKEN;}
+#line 1892 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 81: /* strpad: H5T_STR_NULLTERM_TOKEN */
-#line 323 "hl/src/H5LTparse.y"
- {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;}
-#line 1823 "hl/src/H5LTparse.c"
+ case 78:
+#line 317 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;}
+#line 1898 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 82: /* strpad: H5T_STR_NULLPAD_TOKEN */
-#line 324 "hl/src/H5LTparse.y"
- {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;}
-#line 1829 "hl/src/H5LTparse.c"
+ case 79:
+#line 318 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;}
+#line 1904 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 83: /* strpad: H5T_STR_SPACEPAD_TOKEN */
-#line 325 "hl/src/H5LTparse.y"
- {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;}
-#line 1835 "hl/src/H5LTparse.c"
+ case 80:
+#line 319 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;}
+#line 1910 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 84: /* cset: H5T_CSET_ASCII_TOKEN */
-#line 327 "hl/src/H5LTparse.y"
- {(yyval.ival) = H5T_CSET_ASCII_TOKEN;}
-#line 1841 "hl/src/H5LTparse.c"
+ case 81:
+#line 321 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.ival) = H5T_CSET_ASCII_TOKEN;}
+#line 1916 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 85: /* cset: H5T_CSET_UTF8_TOKEN */
-#line 328 "hl/src/H5LTparse.y"
- {(yyval.ival) = H5T_CSET_UTF8_TOKEN;}
-#line 1847 "hl/src/H5LTparse.c"
+ case 82:
+#line 322 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.ival) = H5T_CSET_UTF8_TOKEN;}
+#line 1922 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 86: /* ctype: H5T_C_S1_TOKEN */
-#line 330 "hl/src/H5LTparse.y"
- {(yyval.hid) = H5T_C_S1_TOKEN;}
-#line 1853 "hl/src/H5LTparse.c"
+ case 83:
+#line 324 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.hid) = H5T_C_S1_TOKEN;}
+#line 1928 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 87: /* ctype: H5T_FORTRAN_S1_TOKEN */
-#line 331 "hl/src/H5LTparse.y"
- {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;}
-#line 1859 "hl/src/H5LTparse.c"
+ case 84:
+#line 325 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;}
+#line 1934 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 88: /* $@15: %empty */
-#line 335 "hl/src/H5LTparse.y"
- { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); }
-#line 1865 "hl/src/H5LTparse.c"
+ case 85:
+#line 329 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); }
+#line 1940 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 89: /* enum_type: H5T_ENUM_TOKEN '{' integer_type ';' $@15 enum_list '}' */
-#line 337 "hl/src/H5LTparse.y"
- { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; }
-#line 1871 "hl/src/H5LTparse.c"
+ case 86:
+#line 331 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; }
+#line 1946 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 92: /* $@16: %empty */
-#line 342 "hl/src/H5LTparse.y"
- {
+ case 89:
+#line 336 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
is_enum_memb = 1; /*indicate member of enum*/
-#ifdef H5_HAVE_WIN32_API
- enum_memb_symbol = _strdup(yylval.sval);
-#else /* H5_HAVE_WIN32_API */
- enum_memb_symbol = strdup(yylval.sval);
-#endif /* H5_HAVE_WIN32_API */
- free(yylval.sval);
+ enum_memb_symbol = HDstrdup(yylval.sval);
+ HDfree(yylval.sval);
yylval.sval = NULL;
}
-#line 1886 "hl/src/H5LTparse.c"
+#line 1957 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
- case 93: /* enum_def: '"' enum_symbol '"' $@16 enum_val ';' */
-#line 353 "hl/src/H5LTparse.y"
- {
+ case 90:
+#line 343 "hl/src/H5LTparse.y" /* yacc.c:1646 */
+ {
char char_val=(char)yylval.ival;
short short_val=(short)yylval.ival;
int int_val=(int)yylval.ival;
@@ -1953,18 +2024,17 @@ yyreduce:
}
is_enum_memb = 0;
- if(enum_memb_symbol) free(enum_memb_symbol);
+ if(enum_memb_symbol) HDfree(enum_memb_symbol);
}
H5Tclose(super);
H5Tclose(native);
}
-#line 1933 "hl/src/H5LTparse.c"
+#line 2004 "hl/src/H5LTparse.c" /* yacc.c:1646 */
break;
-#line 1937 "hl/src/H5LTparse.c"
-
+#line 2008 "hl/src/H5LTparse.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -1978,23 +2048,25 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
- YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
- {
- const int yylhs = yyr1[yyn] - YYNTOKENS;
- const int yyi = yypgoto[yylhs] + *yyssp;
- yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
- ? yytable[yyi]
- : yydefgoto[yylhs]);
- }
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
@@ -2005,14 +2077,50 @@ yyreduce:
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
+#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
+#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
+ {
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
+ }
+# undef YYSYNTAX_ERROR
+#endif
}
+
+
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
@@ -2041,10 +2149,12 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
- /* Pacify compilers when the user code never invokes YYERROR and the
- label yyerrorlab therefore never appears in user code. */
- if (0)
- YYERROR;
+
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
+ goto yyerrorlab;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -2061,14 +2171,13 @@ yyerrorlab:
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
- /* Pop stack until we find a state that shifts the error token. */
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
{
- yyn += YYSYMBOL_YYerror;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
@@ -2082,7 +2191,7 @@ yyerrlab1:
yydestruct ("Error: popping",
- YY_ACCESSING_SYMBOL (yystate), yyvsp);
+ yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -2094,7 +2203,7 @@ yyerrlab1:
/* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
@@ -2107,7 +2216,6 @@ yyacceptlab:
yyresult = 0;
goto yyreturn;
-
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
@@ -2115,21 +2223,16 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-
-#if !defined yyoverflow
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
- goto yyreturn;
+ /* Fall through. */
#endif
-
-/*-------------------------------------------------------.
-| yyreturn -- parsing is finished, clean up and return. |
-`-------------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
{
@@ -2146,14 +2249,16 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
+ yystos[*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
-
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
return yyresult;
}
-
diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h
index abff969..9dd2fba 100644
--- a/hl/src/H5LTparse.h
+++ b/hl/src/H5LTparse.h
@@ -1,9 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.7.2. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
- Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,10 +30,6 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
- especially those whose name start with YY_ or yy_. They are
- private implementation details that can be changed or removed. */
-
#ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED
# define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED
/* Debug traces. */
@@ -45,88 +40,84 @@
extern int H5LTyydebug;
#endif
-/* Token kinds. */
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
- YYEMPTY = -2,
- YYEOF = 0, /* "end of file" */
- YYerror = 256, /* error */
- YYUNDEF = 257, /* "invalid token" */
- H5T_STD_I8BE_TOKEN = 258, /* H5T_STD_I8BE_TOKEN */
- H5T_STD_I8LE_TOKEN = 259, /* H5T_STD_I8LE_TOKEN */
- H5T_STD_I16BE_TOKEN = 260, /* H5T_STD_I16BE_TOKEN */
- H5T_STD_I16LE_TOKEN = 261, /* H5T_STD_I16LE_TOKEN */
- H5T_STD_I32BE_TOKEN = 262, /* H5T_STD_I32BE_TOKEN */
- H5T_STD_I32LE_TOKEN = 263, /* H5T_STD_I32LE_TOKEN */
- H5T_STD_I64BE_TOKEN = 264, /* H5T_STD_I64BE_TOKEN */
- H5T_STD_I64LE_TOKEN = 265, /* H5T_STD_I64LE_TOKEN */
- H5T_STD_U8BE_TOKEN = 266, /* H5T_STD_U8BE_TOKEN */
- H5T_STD_U8LE_TOKEN = 267, /* H5T_STD_U8LE_TOKEN */
- H5T_STD_U16BE_TOKEN = 268, /* H5T_STD_U16BE_TOKEN */
- H5T_STD_U16LE_TOKEN = 269, /* H5T_STD_U16LE_TOKEN */
- H5T_STD_U32BE_TOKEN = 270, /* H5T_STD_U32BE_TOKEN */
- H5T_STD_U32LE_TOKEN = 271, /* H5T_STD_U32LE_TOKEN */
- H5T_STD_U64BE_TOKEN = 272, /* H5T_STD_U64BE_TOKEN */
- H5T_STD_U64LE_TOKEN = 273, /* H5T_STD_U64LE_TOKEN */
- H5T_NATIVE_CHAR_TOKEN = 274, /* H5T_NATIVE_CHAR_TOKEN */
- H5T_NATIVE_SCHAR_TOKEN = 275, /* H5T_NATIVE_SCHAR_TOKEN */
- H5T_NATIVE_UCHAR_TOKEN = 276, /* H5T_NATIVE_UCHAR_TOKEN */
- H5T_NATIVE_SHORT_TOKEN = 277, /* H5T_NATIVE_SHORT_TOKEN */
- H5T_NATIVE_USHORT_TOKEN = 278, /* H5T_NATIVE_USHORT_TOKEN */
- H5T_NATIVE_INT_TOKEN = 279, /* H5T_NATIVE_INT_TOKEN */
- H5T_NATIVE_UINT_TOKEN = 280, /* H5T_NATIVE_UINT_TOKEN */
- H5T_NATIVE_LONG_TOKEN = 281, /* H5T_NATIVE_LONG_TOKEN */
- H5T_NATIVE_ULONG_TOKEN = 282, /* H5T_NATIVE_ULONG_TOKEN */
- H5T_NATIVE_LLONG_TOKEN = 283, /* H5T_NATIVE_LLONG_TOKEN */
- H5T_NATIVE_ULLONG_TOKEN = 284, /* H5T_NATIVE_ULLONG_TOKEN */
- H5T_IEEE_F32BE_TOKEN = 285, /* H5T_IEEE_F32BE_TOKEN */
- H5T_IEEE_F32LE_TOKEN = 286, /* H5T_IEEE_F32LE_TOKEN */
- H5T_IEEE_F64BE_TOKEN = 287, /* H5T_IEEE_F64BE_TOKEN */
- H5T_IEEE_F64LE_TOKEN = 288, /* H5T_IEEE_F64LE_TOKEN */
- H5T_NATIVE_FLOAT_TOKEN = 289, /* H5T_NATIVE_FLOAT_TOKEN */
- H5T_NATIVE_DOUBLE_TOKEN = 290, /* H5T_NATIVE_DOUBLE_TOKEN */
- H5T_NATIVE_LDOUBLE_TOKEN = 291, /* H5T_NATIVE_LDOUBLE_TOKEN */
- H5T_STRING_TOKEN = 292, /* H5T_STRING_TOKEN */
- STRSIZE_TOKEN = 293, /* STRSIZE_TOKEN */
- STRPAD_TOKEN = 294, /* STRPAD_TOKEN */
- CSET_TOKEN = 295, /* CSET_TOKEN */
- CTYPE_TOKEN = 296, /* CTYPE_TOKEN */
- H5T_VARIABLE_TOKEN = 297, /* H5T_VARIABLE_TOKEN */
- H5T_STR_NULLTERM_TOKEN = 298, /* H5T_STR_NULLTERM_TOKEN */
- H5T_STR_NULLPAD_TOKEN = 299, /* H5T_STR_NULLPAD_TOKEN */
- H5T_STR_SPACEPAD_TOKEN = 300, /* H5T_STR_SPACEPAD_TOKEN */
- H5T_CSET_ASCII_TOKEN = 301, /* H5T_CSET_ASCII_TOKEN */
- H5T_CSET_UTF8_TOKEN = 302, /* H5T_CSET_UTF8_TOKEN */
- H5T_C_S1_TOKEN = 303, /* H5T_C_S1_TOKEN */
- H5T_FORTRAN_S1_TOKEN = 304, /* H5T_FORTRAN_S1_TOKEN */
- H5T_OPAQUE_TOKEN = 305, /* H5T_OPAQUE_TOKEN */
- OPQ_SIZE_TOKEN = 306, /* OPQ_SIZE_TOKEN */
- OPQ_TAG_TOKEN = 307, /* OPQ_TAG_TOKEN */
- H5T_COMPOUND_TOKEN = 308, /* H5T_COMPOUND_TOKEN */
- H5T_ENUM_TOKEN = 309, /* H5T_ENUM_TOKEN */
- H5T_ARRAY_TOKEN = 310, /* H5T_ARRAY_TOKEN */
- H5T_VLEN_TOKEN = 311, /* H5T_VLEN_TOKEN */
- STRING = 312, /* STRING */
- NUMBER = 313 /* NUMBER */
+ H5T_STD_I8BE_TOKEN = 258,
+ H5T_STD_I8LE_TOKEN = 259,
+ H5T_STD_I16BE_TOKEN = 260,
+ H5T_STD_I16LE_TOKEN = 261,
+ H5T_STD_I32BE_TOKEN = 262,
+ H5T_STD_I32LE_TOKEN = 263,
+ H5T_STD_I64BE_TOKEN = 264,
+ H5T_STD_I64LE_TOKEN = 265,
+ H5T_STD_U8BE_TOKEN = 266,
+ H5T_STD_U8LE_TOKEN = 267,
+ H5T_STD_U16BE_TOKEN = 268,
+ H5T_STD_U16LE_TOKEN = 269,
+ H5T_STD_U32BE_TOKEN = 270,
+ H5T_STD_U32LE_TOKEN = 271,
+ H5T_STD_U64BE_TOKEN = 272,
+ H5T_STD_U64LE_TOKEN = 273,
+ H5T_NATIVE_CHAR_TOKEN = 274,
+ H5T_NATIVE_SCHAR_TOKEN = 275,
+ H5T_NATIVE_UCHAR_TOKEN = 276,
+ H5T_NATIVE_SHORT_TOKEN = 277,
+ H5T_NATIVE_USHORT_TOKEN = 278,
+ H5T_NATIVE_INT_TOKEN = 279,
+ H5T_NATIVE_UINT_TOKEN = 280,
+ H5T_NATIVE_LONG_TOKEN = 281,
+ H5T_NATIVE_ULONG_TOKEN = 282,
+ H5T_NATIVE_LLONG_TOKEN = 283,
+ H5T_NATIVE_ULLONG_TOKEN = 284,
+ H5T_IEEE_F32BE_TOKEN = 285,
+ H5T_IEEE_F32LE_TOKEN = 286,
+ H5T_IEEE_F64BE_TOKEN = 287,
+ H5T_IEEE_F64LE_TOKEN = 288,
+ H5T_NATIVE_FLOAT_TOKEN = 289,
+ H5T_NATIVE_DOUBLE_TOKEN = 290,
+ H5T_NATIVE_LDOUBLE_TOKEN = 291,
+ H5T_STRING_TOKEN = 292,
+ STRSIZE_TOKEN = 293,
+ STRPAD_TOKEN = 294,
+ CSET_TOKEN = 295,
+ CTYPE_TOKEN = 296,
+ H5T_VARIABLE_TOKEN = 297,
+ H5T_STR_NULLTERM_TOKEN = 298,
+ H5T_STR_NULLPAD_TOKEN = 299,
+ H5T_STR_SPACEPAD_TOKEN = 300,
+ H5T_CSET_ASCII_TOKEN = 301,
+ H5T_CSET_UTF8_TOKEN = 302,
+ H5T_C_S1_TOKEN = 303,
+ H5T_FORTRAN_S1_TOKEN = 304,
+ H5T_OPAQUE_TOKEN = 305,
+ OPQ_SIZE_TOKEN = 306,
+ OPQ_TAG_TOKEN = 307,
+ H5T_COMPOUND_TOKEN = 308,
+ H5T_ENUM_TOKEN = 309,
+ H5T_ARRAY_TOKEN = 310,
+ H5T_VLEN_TOKEN = 311,
+ STRING = 312,
+ NUMBER = 313
};
- typedef enum yytokentype yytoken_kind_t;
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+
union YYSTYPE
{
-#line 72 "hl/src/H5LTparse.y"
+#line 69 "hl/src/H5LTparse.y" /* yacc.c:1909 */
int ival; /*for integer token*/
char *sval; /*for name string*/
hid_t hid; /*for hid_t token*/
-#line 128 "hl/src/H5LTparse.h"
-
+#line 119 "hl/src/H5LTparse.h" /* yacc.c:1909 */
};
+
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y
index 306d8c9..01f6ded 100644
--- a/hl/src/H5LTparse.y
+++ b/hl/src/H5LTparse.y
@@ -22,7 +22,9 @@
#include <string.h>
#include <hdf5.h>
-extern int yylex();
+#include "H5private.h"
+
+extern int yylex(void);
extern int yyerror(const char *);
#define STACK_SIZE 16
@@ -35,13 +37,13 @@ struct cmpd_info {
};
/*stack for nested compound type*/
-struct cmpd_info cmpd_stack[STACK_SIZE] = {
+static struct cmpd_info cmpd_stack[STACK_SIZE] = {
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1},
{0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1} };
-int csindex = -1; /*pointer to the top of compound stack*/
+static int csindex = -1; /*pointer to the top of compound stack*/
/*structure for array type information*/
struct arr_info {
@@ -50,23 +52,18 @@ struct arr_info {
hbool_t is_dim; /*flag to lexer for dimension*/
};
/*stack for nested array type*/
-struct arr_info arr_stack[STACK_SIZE];
-int asindex = -1; /*pointer to the top of array stack*/
+static struct arr_info arr_stack[STACK_SIZE];
+static int asindex = -1; /*pointer to the top of array stack*/
-hbool_t is_str_size = 0; /*flag to lexer for string size*/
-hbool_t is_str_pad = 0; /*flag to lexer for string padding*/
-H5T_str_t str_pad; /*variable for string padding*/
-H5T_cset_t str_cset; /*variable for string character set*/
-hbool_t is_variable = 0; /*variable for variable-length string*/
-size_t str_size; /*variable for string size*/
+static H5T_str_t str_pad; /*variable for string padding*/
+static H5T_cset_t str_cset; /*variable for string character set*/
+static hbool_t is_variable = 0; /*variable for variable-length string*/
+static size_t str_size; /*variable for string size*/
-hid_t enum_id; /*type ID*/
-hbool_t is_enum = 0; /*flag to lexer for enum type*/
-hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/
-char* enum_memb_symbol; /*enum member symbol string*/
-
-hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/
-hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/
+static hid_t enum_id; /*type ID*/
+static hbool_t is_enum = 0; /*flag to lexer for enum type*/
+static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/
+static char* enum_memb_symbol; /*enum member symbol string*/
%}
%union {
@@ -99,7 +96,7 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/
%token <sval> STRING
%token <ival> NUMBER
-%token <ival> '{' '}' '[' ']' '"' ':' ';'
+%token <ival> '{' '}' '[' ']' ':' ';'
%%
start : { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ }
@@ -168,35 +165,35 @@ memb_list :
| memb_list memb_def
;
memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ }
- '"' field_name '"' field_offset ';'
+ field_name field_offset ';'
{
size_t origin_size, new_size;
hid_t dtype_id = cmpd_stack[csindex].id;
/*Adjust size and insert member, consider both member size and offset.*/
if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/
- new_size = H5Tget_size($<hid>1) + $<ival>6;
+ new_size = H5Tget_size($<hid>1) + $<ival>4;
H5Tset_size(dtype_id, new_size);
/*member name is saved in yylval.sval by lexer*/
- H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<hid>1);
+ H5Tinsert(dtype_id, $<sval>3, $<ival>4, $<hid>1);
cmpd_stack[csindex].first_memb = 0;
} else {
origin_size = H5Tget_size(dtype_id);
- if($<ival>6 == 0) {
+ if($<ival>4 == 0) {
new_size = origin_size + H5Tget_size($<hid>1);
H5Tset_size(dtype_id, new_size);
- H5Tinsert(dtype_id, $<sval>4, origin_size, $<hid>1);
+ H5Tinsert(dtype_id, $<sval>3, origin_size, $<hid>1);
} else {
- new_size = $<ival>6 + H5Tget_size($<hid>1);
+ new_size = $<ival>4 + H5Tget_size($<hid>1);
H5Tset_size(dtype_id, new_size);
- H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<hid>1);
+ H5Tinsert(dtype_id, $<sval>3, $<ival>4, $<hid>1);
}
}
- if($<sval>4) {
- free($<sval>4);
- $<sval>4 = NULL;
+ if($<sval>3) {
+ HDfree($<sval>3);
+ $<sval>3 = NULL;
}
cmpd_stack[csindex].is_field = 0;
H5Tclose($<hid>1);
@@ -206,8 +203,8 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le
;
field_name : STRING
{
- $<sval>$ = strdup(yylval.sval);
- free(yylval.sval);
+ $<sval>$ = HDstrdup(yylval.sval);
+ HDfree(yylval.sval);
yylval.sval = NULL;
}
;
@@ -247,20 +244,18 @@ vlen_type : H5T_VLEN_TOKEN '{' ddl_type '}'
opaque_type : H5T_OPAQUE_TOKEN
'{'
- OPQ_SIZE_TOKEN { is_opq_size = 1; } opaque_size ';'
+ OPQ_SIZE_TOKEN opaque_size ';'
{
size_t size = (size_t)yylval.ival;
$<hid>$ = H5Tcreate(H5T_OPAQUE, size);
- is_opq_size = 0;
}
- OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';'
+ OPQ_TAG_TOKEN opaque_tag ';'
{
- H5Tset_tag($<hid>7, yylval.sval);
- free(yylval.sval);
+ H5Tset_tag($<hid>6, yylval.sval);
+ HDfree(yylval.sval);
yylval.sval = NULL;
- is_opq_tag = 0;
}
- '}' { $<hid>$ = $<hid>7; }
+ '}' { $<hid>$ = $<hid>6; }
;
opaque_size : NUMBER
;
@@ -268,40 +263,39 @@ opaque_tag : STRING
;
string_type : H5T_STRING_TOKEN
'{'
- STRSIZE_TOKEN { is_str_size = 1; } strsize ';'
+ STRSIZE_TOKEN strsize ';'
{
- if($<ival>5 == H5T_VARIABLE_TOKEN)
+ if($<ival>4 == H5T_VARIABLE_TOKEN)
is_variable = 1;
else
str_size = yylval.ival;
- is_str_size = 0;
}
STRPAD_TOKEN strpad ';'
{
- if($<ival>9 == H5T_STR_NULLTERM_TOKEN)
+ if($<ival>8 == H5T_STR_NULLTERM_TOKEN)
str_pad = H5T_STR_NULLTERM;
- else if($<ival>9 == H5T_STR_NULLPAD_TOKEN)
+ else if($<ival>8 == H5T_STR_NULLPAD_TOKEN)
str_pad = H5T_STR_NULLPAD;
- else if($<ival>9 == H5T_STR_SPACEPAD_TOKEN)
+ else if($<ival>8 == H5T_STR_SPACEPAD_TOKEN)
str_pad = H5T_STR_SPACEPAD;
}
CSET_TOKEN cset ';'
{
- if($<ival>13 == H5T_CSET_ASCII_TOKEN)
+ if($<ival>12 == H5T_CSET_ASCII_TOKEN)
str_cset = H5T_CSET_ASCII;
- else if($<ival>13 == H5T_CSET_UTF8_TOKEN)
+ else if($<ival>12 == H5T_CSET_UTF8_TOKEN)
str_cset = H5T_CSET_UTF8;
}
CTYPE_TOKEN ctype ';'
{
- if($<hid>17 == H5T_C_S1_TOKEN)
+ if($<hid>16 == H5T_C_S1_TOKEN)
$<hid>$ = H5Tcopy(H5T_C_S1);
- else if($<hid>17 == H5T_FORTRAN_S1_TOKEN)
+ else if($<hid>16 == H5T_FORTRAN_S1_TOKEN)
$<hid>$ = H5Tcopy(H5T_FORTRAN_S1);
}
'}'
{
- hid_t str_id = $<hid>19;
+ hid_t str_id = $<hid>18;
/*set string size*/
if(is_variable) {
@@ -339,14 +333,10 @@ enum_type : H5T_ENUM_TOKEN '{' integer_type ';'
enum_list :
| enum_list enum_def
;
-enum_def : '"' enum_symbol '"' {
+enum_def : enum_symbol {
is_enum_memb = 1; /*indicate member of enum*/
-#ifdef H5_HAVE_WIN32_API
- enum_memb_symbol = _strdup(yylval.sval);
-#else /* H5_HAVE_WIN32_API */
- enum_memb_symbol = strdup(yylval.sval);
-#endif /* H5_HAVE_WIN32_API */
- free(yylval.sval);
+ enum_memb_symbol = HDstrdup(yylval.sval);
+ HDfree(yylval.sval);
yylval.sval = NULL;
}
enum_val ';'
@@ -386,7 +376,7 @@ enum_def : '"' enum_symbol '"' {
}
is_enum_memb = 0;
- if(enum_memb_symbol) free(enum_memb_symbol);
+ if(enum_memb_symbol) HDfree(enum_memb_symbol);
}
H5Tclose(super);
diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h
index 2af9b07..f19d353 100644
--- a/hl/src/H5LTpublic.h
+++ b/hl/src/H5LTpublic.h
@@ -139,6 +139,9 @@ H5_HLDLL herr_t H5LTset_attribute_long_long(hid_t loc_id, const char *obj_name,
H5_HLDLL herr_t H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
const unsigned long *buffer, size_t size);
+H5_HLDLL herr_t H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ const unsigned long long *buffer, size_t size);
+
H5_HLDLL herr_t H5LTset_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
const float *buffer, size_t size);
@@ -182,6 +185,9 @@ H5_HLDLL herr_t H5LTget_attribute_long_long(hid_t loc_id, const char *obj_name,
H5_HLDLL herr_t H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
unsigned long *data);
+H5_HLDLL herr_t H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ unsigned long long *data);
+
H5_HLDLL herr_t H5LTget_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
float *data);
diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c
index d9fdfb0..f5fb99f 100644
--- a/hl/src/H5PT.c
+++ b/hl/src/H5PT.c
@@ -29,7 +29,7 @@ static H5I_type_t H5PT_ptable_id_type = H5I_UNINIT;
#define H5PT_HASH_TABLE_SIZE 64
/* Packet Table private functions */
-static herr_t H5PT_free_id(void *id);
+static herr_t H5PT_free_id(void *id, void **_ctx);
static herr_t H5PT_close(htbl_t *table);
static herr_t H5PT_create_index(htbl_t *table_id);
static herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index);
@@ -402,7 +402,7 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-H5PT_free_id(void *id)
+H5PT_free_id(void *id, void H5_ATTR_UNUSED **_ctx)
{
HDfree(id);
return SUCCEED;
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 1ac162f..efa61a3 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -57,11 +57,11 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi
hsize_t nrecords, size_t type_size, const char *field_names[], const size_t *field_offset,
const hid_t *field_types, hsize_t chunk_size, void *fill_data, int compress, const void *buf)
{
- hid_t did = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
- hid_t plist_id = H5I_BADID;
- hid_t attr_id = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
+ hid_t plist_id = H5I_INVALID_HID;
+ hid_t attr_id = H5I_INVALID_HID;
hsize_t dims[1];
hsize_t dims_chunk[1];
hsize_t maxdims[1] = {H5S_UNLIMITED};
@@ -129,17 +129,17 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi
/* terminate access to the data space. */
if (H5Sclose(sid) < 0)
goto out;
- sid = H5I_BADID;
+ sid = H5I_INVALID_HID;
/* end access to the dataset */
if (H5Dclose(did) < 0)
goto out;
- did = H5I_BADID;
+ did = H5I_INVALID_HID;
/* end access to the property list */
if (H5Pclose(plist_id) < 0)
goto out;
- plist_id = H5I_BADID;
+ plist_id = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* set the conforming table attributes
@@ -196,24 +196,24 @@ H5TBmake_table(const char *table_title, hid_t loc_id, const char *dset_name, hsi
if (H5Aclose(attr_id) < 0)
goto out;
- attr_id = H5I_BADID;
+ attr_id = H5I_INVALID_HID;
} /* end for */
/* terminate access to the data space. */
if (H5Sclose(sid) < 0)
goto out;
- sid = H5I_BADID;
+ sid = H5I_INVALID_HID;
/* end access to the dataset */
if (H5Dclose(did) < 0)
goto out;
- did = H5I_BADID;
+ did = H5I_INVALID_HID;
} /* end if */
/* release the datatype. */
if (H5Tclose(mem_type_id) < 0)
goto out;
- mem_type_id = H5I_BADID;
+ mem_type_id = H5I_INVALID_HID;
ret_val = 0;
@@ -267,9 +267,9 @@ herr_t
H5TBappend_records(hid_t loc_id, const char *dset_name, hsize_t nrecords, size_t type_size,
const size_t *field_offset, const size_t *field_sizes, const void *buf)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
hsize_t nrecords_orig;
hsize_t nfields;
herr_t ret_val = -1;
@@ -332,11 +332,11 @@ herr_t
H5TBwrite_records(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t type_size,
const size_t *field_offset, const size_t *field_sizes, const void *buf)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
hsize_t count[1];
hsize_t offset[1];
hsize_t mem_size[1];
@@ -425,14 +425,14 @@ H5TBwrite_fields_name(hid_t loc_id, const char *dset_name, const char *field_nam
hsize_t nrecords, size_t type_size, const size_t *field_offset,
const size_t *field_sizes, const void *buf)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t write_type_id = H5I_BADID;
- hid_t member_type_id = H5I_BADID;
- hid_t nmtype_id = H5I_BADID;
- hid_t m_sid = H5I_BADID;
- hid_t file_space_id = H5I_BADID;
- hid_t preserve_id = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t write_type_id = H5I_INVALID_HID;
+ hid_t member_type_id = H5I_INVALID_HID;
+ hid_t nmtype_id = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
+ hid_t file_space_id = H5I_INVALID_HID;
+ hid_t preserve_id = H5I_INVALID_HID;
hssize_t nfields;
hssize_t i, j;
hsize_t count[1];
@@ -510,10 +510,10 @@ H5TBwrite_fields_name(hid_t loc_id, const char *dset_name, const char *field_nam
/* close */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
if (H5Tclose(nmtype_id) < 0)
goto out;
- nmtype_id = H5I_BADID;
+ nmtype_id = H5I_INVALID_HID;
} /* end if */
H5free_memory(member_name);
@@ -583,14 +583,14 @@ H5TBwrite_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, con
hsize_t start, hsize_t nrecords, size_t type_size, const size_t *field_offset,
const size_t *field_sizes, const void *buf)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t write_type_id = H5I_BADID;
- hid_t member_type_id = H5I_BADID;
- hid_t nmtype_id = H5I_BADID;
- hid_t m_sid = H5I_BADID;
- hid_t file_space_id = H5I_BADID;
- hid_t preserve_id = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t write_type_id = H5I_INVALID_HID;
+ hid_t member_type_id = H5I_INVALID_HID;
+ hid_t nmtype_id = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
+ hid_t file_space_id = H5I_INVALID_HID;
+ hid_t preserve_id = H5I_INVALID_HID;
hsize_t count[1];
hsize_t offset[1];
hsize_t i;
@@ -663,10 +663,10 @@ H5TBwrite_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, con
/* close */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
if (H5Tclose(nmtype_id) < 0)
goto out;
- nmtype_id = H5I_BADID;
+ nmtype_id = H5I_INVALID_HID;
H5free_memory(member_name);
member_name = NULL;
@@ -747,10 +747,10 @@ herr_t
H5TBread_table(hid_t loc_id, const char *dset_name, size_t type_size, const size_t *field_offset,
const size_t *field_sizes, void *dst_buf)
{
- hid_t did = H5I_BADID;
- hid_t ftype_id = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
- hid_t sid = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t ftype_id = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
hsize_t dims[1];
herr_t ret_val = -1;
@@ -820,9 +820,9 @@ herr_t
H5TBread_records(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t type_size,
const size_t *field_offset, const size_t *field_sizes, void *buf)
{
- hid_t did = H5I_BADID;
- hid_t ftype_id = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t ftype_id = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
hsize_t nrecords_orig;
hsize_t nfields;
herr_t ret_val = -1;
@@ -887,13 +887,13 @@ H5TBread_fields_name(hid_t loc_id, const char *dset_name, const char *field_name
hsize_t nrecords, size_t type_size, const size_t *field_offset,
const size_t *field_sizes, void *buf)
{
- hid_t did = H5I_BADID;
- hid_t ftype_id = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
- hid_t mtype_id = H5I_BADID;
- hid_t nmtype_id = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t ftype_id = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
+ hid_t mtype_id = H5I_INVALID_HID;
+ hid_t nmtype_id = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
hssize_t nfields;
hsize_t count[1];
hsize_t offset[1];
@@ -960,10 +960,10 @@ H5TBread_fields_name(hid_t loc_id, const char *dset_name, const char *field_name
/* close */
if (H5Tclose(mtype_id) < 0)
goto out;
- mtype_id = H5I_BADID;
+ mtype_id = H5I_INVALID_HID;
if (H5Tclose(nmtype_id) < 0)
goto out;
- nmtype_id = H5I_BADID;
+ nmtype_id = H5I_INVALID_HID;
j++;
} /* end if */
@@ -1044,13 +1044,13 @@ H5TBread_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, cons
hsize_t start, hsize_t nrecords, size_t type_size, const size_t *field_offset,
const size_t *field_sizes, void *buf)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t read_type_id = H5I_BADID;
- hid_t member_type_id = H5I_BADID;
- hid_t nmtype_id = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t read_type_id = H5I_INVALID_HID;
+ hid_t member_type_id = H5I_INVALID_HID;
+ hid_t nmtype_id = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
hsize_t count[1];
hsize_t offset[1];
hsize_t mem_size[1];
@@ -1117,10 +1117,10 @@ H5TBread_fields_index(hid_t loc_id, const char *dset_name, hsize_t nfields, cons
/* close the member type */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
if (H5Tclose(nmtype_id) < 0)
goto out;
- nmtype_id = H5I_BADID;
+ nmtype_id = H5I_INVALID_HID;
H5free_memory(member_name);
member_name = NULL;
@@ -1198,11 +1198,11 @@ out:
herr_t
H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
hsize_t nfields;
hsize_t ntotal_records;
hsize_t read_start;
@@ -1294,16 +1294,16 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr
/* close */
if (H5Sclose(m_sid) < 0)
goto out;
- m_sid = H5I_BADID;
+ m_sid = H5I_INVALID_HID;
if (H5Tclose(mem_type_id) < 0)
goto out;
- mem_type_id = H5I_BADID;
+ mem_type_id = H5I_INVALID_HID;
if (H5Sclose(sid) < 0)
goto out;
- sid = H5I_BADID;
+ sid = H5I_INVALID_HID;
if (H5Tclose(tid) < 0)
goto out;
- tid = H5I_BADID;
+ tid = H5I_INVALID_HID;
} /* read_nrecords */
/*-------------------------------------------------------------------------
@@ -1361,11 +1361,11 @@ herr_t
H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t type_size,
const size_t *field_offset, const size_t *field_sizes, void *buf)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t mem_type_id = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t mem_type_id = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
hsize_t nfields;
hsize_t ntotal_records;
hsize_t read_nrecords;
@@ -1442,10 +1442,10 @@ H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr
/* terminate access to the dataspace */
if (H5Sclose(m_sid) < 0)
goto out;
- m_sid = H5I_BADID;
+ m_sid = H5I_INVALID_HID;
if (H5Sclose(sid) < 0)
goto out;
- sid = H5I_BADID;
+ sid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
* write the "pushed down" records
@@ -1513,10 +1513,10 @@ herr_t
H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize_t nrecords,
const char *dset_name2, hsize_t start2)
{
- hid_t did = H5I_BADID;
- hid_t tid = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
hsize_t count[1];
hsize_t offset[1];
hsize_t mem_size[1];
@@ -1643,24 +1643,24 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
const char *dset_name3)
{
/* identifiers for the 1st dataset. */
- hid_t did_1 = H5I_BADID;
- hid_t tid_1 = H5I_BADID;
- hid_t sid_1 = H5I_BADID;
- hid_t pid_1 = H5I_BADID;
+ hid_t did_1 = H5I_INVALID_HID;
+ hid_t tid_1 = H5I_INVALID_HID;
+ hid_t sid_1 = H5I_INVALID_HID;
+ hid_t pid_1 = H5I_INVALID_HID;
/* identifiers for the 2nd dataset. */
- hid_t did_2 = H5I_BADID;
- hid_t tid_2 = H5I_BADID;
- hid_t sid_2 = H5I_BADID;
- hid_t pid_2 = H5I_BADID;
+ hid_t did_2 = H5I_INVALID_HID;
+ hid_t tid_2 = H5I_INVALID_HID;
+ hid_t sid_2 = H5I_INVALID_HID;
+ hid_t pid_2 = H5I_INVALID_HID;
/* identifiers for the 3rd dataset. */
- hid_t did_3 = H5I_BADID;
- hid_t tid_3 = H5I_BADID;
- hid_t sid_3 = H5I_BADID;
- hid_t pid_3 = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
- hid_t member_type_id = H5I_BADID;
- hid_t attr_id = H5I_BADID;
+ hid_t did_3 = H5I_INVALID_HID;
+ hid_t tid_3 = H5I_INVALID_HID;
+ hid_t sid_3 = H5I_INVALID_HID;
+ hid_t pid_3 = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
+ hid_t member_type_id = H5I_INVALID_HID;
+ hid_t attr_id = H5I_INVALID_HID;
hsize_t count[1];
hsize_t offset[1];
hsize_t mem_size[1];
@@ -1807,17 +1807,17 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
if (H5Aclose(attr_id) < 0)
goto out;
- attr_id = H5I_BADID;
+ attr_id = H5I_INVALID_HID;
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
} /* end for */
/* close data space. */
if (H5Sclose(sid) < 0)
goto out;
- sid = H5I_BADID;
+ sid = H5I_INVALID_HID;
} /* end if */
/*-------------------------------------------------------------------------
@@ -1856,7 +1856,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c
*/
if (H5Sclose(m_sid) < 0)
goto out;
- m_sid = H5I_BADID;
+ m_sid = H5I_INVALID_HID;
HDfree(tmp_buf);
tmp_buf = NULL;
@@ -1999,25 +1999,25 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
hsize_t position, const void *fill_data, const void *buf)
{
/* identifiers for the 1st, original dataset */
- hid_t did_1 = H5I_BADID;
- hid_t tid_1 = H5I_BADID;
- hid_t sid_1 = H5I_BADID;
- hid_t pid_1 = H5I_BADID;
- hid_t msid_1 = H5I_BADID;
+ hid_t did_1 = H5I_INVALID_HID;
+ hid_t tid_1 = H5I_INVALID_HID;
+ hid_t sid_1 = H5I_INVALID_HID;
+ hid_t pid_1 = H5I_INVALID_HID;
+ hid_t msid_1 = H5I_INVALID_HID;
/* identifiers for the 2nd, new dataset */
- hid_t did_2 = H5I_BADID;
- hid_t tid_2 = H5I_BADID;
- hid_t sid_2 = H5I_BADID;
- hid_t pid_2 = H5I_BADID;
- hid_t msid_2 = H5I_BADID;
+ hid_t did_2 = H5I_INVALID_HID;
+ hid_t tid_2 = H5I_INVALID_HID;
+ hid_t sid_2 = H5I_INVALID_HID;
+ hid_t pid_2 = H5I_INVALID_HID;
+ hid_t msid_2 = H5I_INVALID_HID;
/* identifiers for the 3rd, final dataset */
- hid_t did_3 = H5I_BADID;
- hid_t tid_3 = H5I_BADID;
- hid_t sid_3 = H5I_BADID;
- hid_t member_type_id = H5I_BADID;
- hid_t write_type_id = H5I_BADID;
- hid_t preserve_id = H5I_BADID;
- hid_t attr_id = H5I_BADID;
+ hid_t did_3 = H5I_INVALID_HID;
+ hid_t tid_3 = H5I_INVALID_HID;
+ hid_t sid_3 = H5I_INVALID_HID;
+ hid_t member_type_id = H5I_INVALID_HID;
+ hid_t write_type_id = H5I_INVALID_HID;
+ hid_t preserve_id = H5I_INVALID_HID;
+ hid_t attr_id = H5I_INVALID_HID;
size_t member_size;
size_t new_member_size = 0;
size_t total_size;
@@ -2157,7 +2157,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
/* close the member type */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
} /* end else */
} /* end for */
@@ -2307,12 +2307,12 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
if (H5Aclose(attr_id) < 0)
goto out;
- attr_id = H5I_BADID;
+ attr_id = H5I_INVALID_HID;
/* close the member type */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
} /* end for */
/*-------------------------------------------------------------------------
@@ -2334,11 +2334,11 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
if (H5Aclose(attr_id) < 0)
goto out;
- attr_id = H5I_BADID;
+ attr_id = H5I_INVALID_HID;
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
} /* end fill_data */
ret_val = 0;
@@ -2415,23 +2415,23 @@ herr_t
H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
{
/* identifiers for the 1st original dataset */
- hid_t did_1 = H5I_BADID;
- hid_t tid_1 = H5I_BADID;
- hid_t sid_1 = H5I_BADID;
- hid_t pid_1 = H5I_BADID;
+ hid_t did_1 = H5I_INVALID_HID;
+ hid_t tid_1 = H5I_INVALID_HID;
+ hid_t sid_1 = H5I_INVALID_HID;
+ hid_t pid_1 = H5I_INVALID_HID;
/* identifiers for the 2nd new dataset */
- hid_t did_2 = H5I_BADID;
- hid_t tid_2 = H5I_BADID;
- hid_t sid_2 = H5I_BADID;
- hid_t pid_2 = H5I_BADID;
+ hid_t did_2 = H5I_INVALID_HID;
+ hid_t tid_2 = H5I_INVALID_HID;
+ hid_t sid_2 = H5I_INVALID_HID;
+ hid_t pid_2 = H5I_INVALID_HID;
/* identifiers for the 3rd final dataset */
- hid_t did_3 = H5I_BADID;
- hid_t tid_3 = H5I_BADID;
- hid_t member_type_id = H5I_BADID;
- hid_t preserve_id = H5I_BADID;
- hid_t read_type_id = H5I_BADID;
- hid_t write_type_id = H5I_BADID;
- hid_t attr_id = H5I_BADID;
+ hid_t did_3 = H5I_INVALID_HID;
+ hid_t tid_3 = H5I_INVALID_HID;
+ hid_t member_type_id = H5I_INVALID_HID;
+ hid_t preserve_id = H5I_INVALID_HID;
+ hid_t read_type_id = H5I_INVALID_HID;
+ hid_t write_type_id = H5I_INVALID_HID;
+ hid_t attr_id = H5I_INVALID_HID;
size_t member_size;
size_t type_size1;
size_t type_size2;
@@ -2515,7 +2515,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
/* close the member type */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
H5free_memory(member_name);
member_name = NULL;
@@ -2598,7 +2598,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
/* close the member type */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
} /* end if */
H5free_memory(member_name);
@@ -2682,22 +2682,22 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
/* end access to the property list */
if (H5Pclose(preserve_id) < 0)
goto out;
- preserve_id = H5I_BADID;
+ preserve_id = H5I_INVALID_HID;
/* close the member type */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
/* close the read type */
if (H5Tclose(read_type_id) < 0)
goto out;
- read_type_id = H5I_BADID;
+ read_type_id = H5I_INVALID_HID;
/* close the write type */
if (H5Tclose(write_type_id) < 0)
goto out;
- write_type_id = H5I_BADID;
+ write_type_id = H5I_INVALID_HID;
HDfree(tmp_buf);
tmp_buf = NULL;
@@ -2769,18 +2769,18 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name)
if (H5Aclose(attr_id) < 0)
goto out;
- attr_id = H5I_BADID;
+ attr_id = H5I_INVALID_HID;
/* close the member type */
if (H5Tclose(member_type_id) < 0)
goto out;
- member_type_id = H5I_BADID;
+ member_type_id = H5I_INVALID_HID;
} /* end for */
/* close data space. */
if (H5Sclose(sid_1) < 0)
goto out;
- sid_1 = H5I_BADID;
+ sid_1 = H5I_INVALID_HID;
} /* end if */
ret_val = 0;
@@ -2962,9 +2962,9 @@ out:
herr_t
H5TBget_table_info(hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_t *nrecords)
{
- hid_t tid = H5I_BADID;
- hid_t sid = H5I_BADID;
- hid_t did = H5I_BADID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
hsize_t dims[1];
int num_members;
herr_t ret_val = -1;
@@ -3008,7 +3008,7 @@ H5TBget_table_info(hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_
/* terminate access to the dataspace */
if (H5Sclose(sid) < 0)
goto out;
- sid = H5I_BADID;
+ sid = H5I_INVALID_HID;
*nrecords = dims[0];
} /* end if */
@@ -3048,11 +3048,11 @@ herr_t
H5TBget_field_info(hid_t loc_id, const char *dset_name, char *field_names[], size_t *field_sizes,
size_t *field_offsets, size_t *type_size)
{
- hid_t did = H5I_BADID; /* dataset ID */
- hid_t tid = H5I_BADID; /* file type ID */
- hid_t n_tid = H5I_BADID; /* native type ID */
- hid_t m_tid = H5I_BADID; /* member type ID */
- hid_t nm_tid = H5I_BADID; /* native member ID */
+ hid_t did = H5I_INVALID_HID; /* dataset ID */
+ hid_t tid = H5I_INVALID_HID; /* file type ID */
+ hid_t n_tid = H5I_INVALID_HID; /* native type ID */
+ hid_t m_tid = H5I_INVALID_HID; /* member type ID */
+ hid_t nm_tid = H5I_INVALID_HID; /* native member ID */
hssize_t nfields;
hssize_t i;
herr_t ret_val = -1;
@@ -3111,10 +3111,10 @@ H5TBget_field_info(hid_t loc_id, const char *dset_name, char *field_names[], siz
/* close the member types */
if (H5Tclose(m_tid) < 0)
goto out;
- m_tid = H5I_BADID;
+ m_tid = H5I_INVALID_HID;
if (H5Tclose(nm_tid) < 0)
goto out;
- nm_tid = H5I_BADID;
+ nm_tid = H5I_INVALID_HID;
} /* end for */
ret_val = 0;
@@ -3267,9 +3267,9 @@ static hid_t
H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_size, const size_t *field_offset,
const size_t *field_sizes, hid_t ftype_id)
{
- hid_t mem_type_id = H5I_BADID;
- hid_t mtype_id = H5I_BADID;
- hid_t nmtype_id = H5I_BADID;
+ hid_t mem_type_id = H5I_INVALID_HID;
+ hid_t mtype_id = H5I_INVALID_HID;
+ hid_t nmtype_id = H5I_INVALID_HID;
size_t size_native;
hsize_t nfields = 0;
char ** fnames = NULL;
@@ -3310,10 +3310,10 @@ H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_size, const si
goto out;
if (H5Tclose(mtype_id) < 0)
goto out;
- mtype_id = H5I_BADID;
+ mtype_id = H5I_INVALID_HID;
if (H5Tclose(nmtype_id) < 0)
goto out;
- nmtype_id = H5I_BADID;
+ nmtype_id = H5I_INVALID_HID;
} /* end for */
ret_val = mem_type_id;
@@ -3364,8 +3364,8 @@ herr_t
H5TB_common_append_records(hid_t dataset_id, hid_t mem_type_id, size_t nrecords, hsize_t orig_table_size,
const void *buf)
{
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
hsize_t count[1];
hsize_t offset[1];
hsize_t dims[1];
@@ -3429,8 +3429,8 @@ herr_t
H5TB_common_read_records(hid_t dataset_id, hid_t mem_type_id, hsize_t start, size_t nrecords,
hsize_t table_size, void *buf)
{
- hid_t sid = H5I_BADID;
- hid_t m_sid = H5I_BADID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t m_sid = H5I_INVALID_HID;
hsize_t count[1];
hsize_t offset[1];
hsize_t mem_size[1];
diff --git a/hl/src/hdf5_hl.h b/hl/src/hdf5_hl.h
index 580c09a..9960b97 100644
--- a/hl/src/hdf5_hl.h
+++ b/hl/src/hdf5_hl.h
@@ -17,8 +17,9 @@
* fill this file with lots of gunk...
*/
-#ifndef _HDF5_HL_H
-#define _HDF5_HL_H
+#ifndef HDF5_HL_H
+#define HDF5_HL_H
+
#include "hdf5.h" /* hdf5 main library */
#include "H5DOpublic.h" /* dataset optimization */
#include "H5DSpublic.h" /* dimension scales */
@@ -28,4 +29,4 @@
#include "H5PTpublic.h" /* packet table */
#include "H5LDpublic.h" /* lite dataset */
-#endif /*H5_INCLUDE_HL*/
+#endif /*HDF5_HL_H*/
diff --git a/hl/test/COPYING b/hl/test/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/hl/test/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index 368c083..a56e6cf 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -75,7 +75,7 @@ main(int argc, char **argv)
int nerrors = 0;
char filename[65];
- if (argc < 2) {
+ if (argc < 2 || !argv[0] || !argv[1]) {
HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 90110a4..964e13f 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -406,10 +406,10 @@ create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
herr_t
create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldims)
{
- int rank = 4;
- int rankds = 1;
- hsize_t dims[4] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE, DIM4_SIZE};
- long * buf;
+ int rank = 4;
+ int rankds = 1;
+ hsize_t dims[4] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE, DIM4_SIZE};
+ long * buf = NULL;
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE};
@@ -431,49 +431,54 @@ create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldi
/* Allocate buffer */
if (NULL == (buf = (long *)HDmalloc(sizeof(long) * DIM1_SIZE * DIM2_SIZE * DIM3_SIZE * DIM4_SIZE)))
- return FAIL;
+ goto error;
/* make a dataset */
if (H5LTmake_dataset_long(fid, dsname, rank, dims, buf) >= 0) {
if (fulldims == 0) {
/* make a DS dataset for the first dimension */
if (create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0)
- return FAIL;
+ goto error;
/* make a DS dataset for the second dimension */
if (create_DS2_long_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, NULL, NULL) < 0)
- return FAIL;
+ goto error;
/* make a DS dataset for the third dimension */
if (create_DS3_long_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, NULL, NULL, NULL) < 0)
- return FAIL;
+ goto error;
/* make a DS dataset for the fourth dimension */
if (create_DS4_long_datasets(fid, dsidx, rankds, s4_dim, s4_wbuf, NULL, NULL, NULL, NULL) < 0)
- return FAIL;
+ goto error;
}
else {
if (create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, s11_wbuf) < 0)
- return FAIL;
+ goto error;
if (create_DS2_long_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, s21_wbuf, s22_wbuf) < 0)
- return FAIL;
+ goto error;
if (create_DS3_long_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, s31_wbuf, s32_wbuf, s33_wbuf) <
0)
- return FAIL;
+ goto error;
if (create_DS4_long_datasets(fid, dsidx, rankds, s4_dim, s4_wbuf, s41_wbuf, s42_wbuf, s43_wbuf,
s44_wbuf) < 0)
- return FAIL;
+ goto error;
}
}
else
- return FAIL;
+ goto error;
HDfree(buf);
return SUCCEED;
+
+error:
+ HDfree(buf);
+
+ return FAIL;
}
herr_t
@@ -3554,9 +3559,9 @@ verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
int ret = 0;
/* unused */
- dset = dset;
- dim = dim;
- visitor_data = visitor_data;
+ (void)dset;
+ (void)dim;
+ (void)visitor_data;
/* define a positive value for return value. This will cause the iterator to
immediately return that positive value, indicating short-circuit success
@@ -3602,8 +3607,8 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
char * data = (char *)visitor_data;
/* unused */
- dset = dset;
- dim = dim;
+ (void)dset;
+ (void)dim;
/* get space */
if ((sid = H5Dget_space(scale_id)) < 0)
@@ -3691,7 +3696,7 @@ match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor_data)
hsize_t storage_size;
/* Stop compiler from whining about "unused parameters" */
- visitor_data = visitor_data;
+ (void)visitor_data;
/*-------------------------------------------------------------------------
* get DID (dataset) space info
@@ -3740,7 +3745,10 @@ match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor_data)
return ret;
out:
- H5E_BEGIN_TRY { H5Sclose(sid); }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ }
H5E_END_TRY;
return FAIL;
}
@@ -3766,9 +3774,9 @@ static herr_t
op_continue(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
{
/* Stop compiler from whining about "unused parameters" */
- dset = dset;
- dim = dim;
- scale_id = scale_id;
+ (void)dset;
+ (void)dim;
+ (void)scale_id;
if (visitor_data != NULL) {
(*(int *)visitor_data)++;
@@ -3799,9 +3807,9 @@ static herr_t
op_stop(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
{
/* Stop compiler from whining about "unused parameters" */
- dset = dset;
- dim = dim;
- scale_id = scale_id;
+ (void)dset;
+ (void)dim;
+ (void)scale_id;
if (visitor_data != NULL) {
(*(int *)visitor_data)++;
@@ -4956,12 +4964,12 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf)
}
for (i = 0, nelms = 1; i < ndims; i++) {
- if (fscanf(f, "%s %u", str, &j) && HDferror(f)) {
+ if (HDfscanf(f, "%s %u", str, &j) && HDferror(f)) {
HDprintf("fscanf error in file %s\n", data_file);
HDfclose(f);
return -1;
} /* end if */
- if (fscanf(f, "%d", &n) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s\n", data_file);
HDfclose(f);
return -1;
@@ -4979,7 +4987,7 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf)
}
for (j = 0; j < nelms; j++) {
- if (fscanf(f, "%f", &val) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%f", &val) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s\n", data_file);
HDfclose(f);
return -1;
@@ -5202,6 +5210,8 @@ test_attach_detach(void)
HL_TESTING2("permutations of attaching and detaching");
+ gid = var1_id = var2_id = var3_id = H5I_INVALID_HID;
+
if ((fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index c20112f..bde8adc 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -51,10 +51,10 @@
*-------------------------------------------------------------------------
*/
static int
-test_file_image(size_t open_images, size_t nflags, unsigned *flags)
+test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
{
- hid_t * file_id, *dset_id, file_space, plist; /* HDF5 ids */
- hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */
+ hid_t * file_id = NULL, *dset_id = NULL, file_space, plist; /* HDF5 ids */
+ hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */
hsize_t max_dims[RANK] = {H5S_UNLIMITED, H5S_UNLIMITED};
int data1[6] = {1, 2, 3, 4, 5, 6}; /* original contents of dataset */
int data2[6] = {7, 8, 9, 10, 11, 12}; /* "wrong" contents of dataset */
@@ -63,10 +63,10 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
hsize_t dims4[RANK] = {3, 5}; /* extended dimensions of datasets */
int data4[15] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
/* extended contents of dataset */
- ssize_t * buf_size; /* pointer to array of buffer sizes */
- void ** buf_ptr; /* pointer to array of pointers to image buffers */
- char ** filename; /* pointer to array of pointers to filenames */
- unsigned * input_flags; /* pointer to array of flag combinations */
+ ssize_t * buf_size = NULL; /* pointer to array of buffer sizes */
+ void ** buf_ptr = NULL; /* pointer to array of pointers to image buffers */
+ char ** filename = NULL; /* pointer to array of pointers to filenames */
+ unsigned * input_flags = NULL; /* pointer to array of flag combinations */
size_t i, j, k, nrow, n_values;
herr_t status1;
void * handle_ptr = NULL; /* pointers to driver buffer */
@@ -85,7 +85,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the name of each of the open images */
- if (NULL == (filename = (char **)HDmalloc(sizeof(char *) * open_images)))
+ if (NULL == (filename = (char **)HDcalloc(1, sizeof(char *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the size of each of the open images */
@@ -110,6 +110,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* allocate name buffer for image i */
filename[i] = (char *)HDmalloc(sizeof(char) * 32);
+ if (!filename[i])
+ FAIL_PUTS_ERROR("HDmalloc() failed");
/* create file name */
HDsprintf(filename[i], "image_file%d.h5", (int)i);
@@ -232,6 +234,9 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW && !(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY)) {
void *tmp_ptr = HDmalloc((size_t)buf_size[i]);
+ if (!tmp_ptr)
+ FAIL_PUTS_ERROR("buffer allocation failed");
+
/* Copy vfd buffer to a temporary buffer */
HDmemcpy(tmp_ptr, (void *)*core_buf_ptr_ptr, (size_t)buf_size[i]);
/* Clear status_flags in the superblock for the vfd buffer: file locking is using status_flags
@@ -335,7 +340,10 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
VERIFY(status1 < 0, "H5Dwrite() should have failed");
/* extend dimensions of dataset */
- H5E_BEGIN_TRY { status1 = H5Dset_extent(dset_id[i], dims4); }
+ H5E_BEGIN_TRY
+ {
+ status1 = H5Dset_extent(dset_id[i], dims4);
+ }
H5E_END_TRY;
VERIFY(status1 < 0, "H5Dset_extent() should have failed");
@@ -522,6 +530,17 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
return 0;
error:
+ if (filename) {
+ for (i = 0; i < open_images; i++)
+ HDfree(filename[i]);
+ HDfree(filename);
+ }
+ HDfree(file_id);
+ HDfree(dset_id);
+ HDfree(buf_ptr);
+ HDfree(buf_size);
+ HDfree(input_flags);
+
H5_FAILED();
return -1;
}
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index b71531e..81340c1 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -301,7 +301,10 @@ out:
HDfree(buf1_out);
if (buf2_out)
HDfree(buf2_out);
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
H5_FAILED();
return FAIL;
@@ -488,7 +491,10 @@ out:
if (image_data)
HDfree(image_data);
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
H5_FAILED();
@@ -574,11 +580,11 @@ test_generate(void)
!
*/
- if (fscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (fscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -609,7 +615,7 @@ test_generate(void)
goto out;
for (i = 0; i < n_elements; i++) {
- if (fscanf(f, "%f ", &value) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%f ", &value) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -644,10 +650,10 @@ test_generate(void)
HL_TESTING2("make indexed image from land data");
for (i = 0; i < n_elements; i++) {
- if (data[i] < 0)
+ if (data[i] < 0.0f)
image_data[i] = 0;
else
- image_data[i] = (unsigned char)((255 * (data[i])) / xmax);
+ image_data[i] = (unsigned char)((255 * data[i]) / xmax);
}
/* make the image */
@@ -665,10 +671,11 @@ test_generate(void)
HL_TESTING2("make indexed image from sea data");
for (i = 0; i < n_elements; i++) {
- if (data[i] > 0)
+ if (data[i] > 0.0f)
image_data[i] = 0;
- else
- image_data[i] = (unsigned char)((255 * (data[i] - xmin)) / xmin);
+ else {
+ image_data[i] = (unsigned char)((255.0f * (data[i] - xmin)) / (xmax - xmin));
+ }
}
/* make the image */
@@ -720,7 +727,10 @@ out:
if (image_data)
HDfree(image_data);
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
if (f)
HDfclose(f);
@@ -769,32 +779,32 @@ read_data(const char *fname, /*IN*/
goto out;
}
- if (fscanf(f, "%s", str) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (fscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (fscanf(f, "%s", str) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (fscanf(f, "%d", &h) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%d", &h) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (fscanf(f, "%s", str) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (fscanf(f, "%d", &w) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%d", &w) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -828,7 +838,7 @@ read_data(const char *fname, /*IN*/
/* Read data elements */
for (i = 0; i < n_elements; i++) {
- if (fscanf(f, "%d", &n) < 0 && HDferror(f)) {
+ if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
HDprintf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -926,7 +936,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
return -1;
}
- if (sscanf(buffer, "%u", &nentries) != 1) {
+ if (HDsscanf(buffer, "%u", &nentries) != 1) {
HDfclose(file);
return -1;
}
@@ -940,7 +950,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
/* read the palette entries */
for (u = 0; u < nentries; u++) {
/* extract the red, green and blue color components. */
- if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
+ if (HDfscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
HDfclose(file);
return -1;
}
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index 06cb600..dc5755c 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -157,7 +157,8 @@ static herr_t test_LD_elmts_invalid(const char *file);
static herr_t test_LD_elmts_one(const char *file, const char *dname, const char *fields);
static herr_t test_LD_elmts_two(const char *file, const char *dname, const char *fields);
-static herr_t verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf);
+static herr_t verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf,
+ void *_buf);
/* data structures for compound data type */
typedef struct sub22_t {
@@ -251,7 +252,10 @@ test_LD_dims_params(const char *file)
/*
* 1. Verify failure with negative dataset id
*/
- H5E_BEGIN_TRY { ret = H5LDget_dset_dims(invalid_id, one_cur_dims); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5LDget_dset_dims(invalid_id, one_cur_dims);
+ }
H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
@@ -260,7 +264,10 @@ test_LD_dims_params(const char *file)
*/
if ((did = H5Dopen2(fid, DSET_ALLOC_EARLY, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { ret = H5LDget_dset_dims(did, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5LDget_dset_dims(did, NULL);
+ }
H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
if (H5Dclose(did) < 0)
@@ -535,7 +542,10 @@ test_LD_size(const char *file)
/*
* Verify failure with an invalid dataset id
*/
- H5E_BEGIN_TRY { dsize = H5LDget_dset_type_size(invalid_id, NULL); }
+ H5E_BEGIN_TRY
+ {
+ dsize = H5LDget_dset_type_size(invalid_id, NULL);
+ }
H5E_END_TRY;
VERIFY_EQUAL(dsize, 0)
@@ -915,7 +925,10 @@ test_LD_elmts_invalid(const char *file)
*/
/* Verify failure from case #1: an invalid dataset id */
- H5E_BEGIN_TRY { ret = H5LDget_dset_elmts(invalid_id, prev_dims, cur_dims, NULL, tbuf); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5LDget_dset_elmts(invalid_id, prev_dims, cur_dims, NULL, tbuf);
+ }
H5E_END_TRY;
VERIFY_EQUAL(ret, FAIL)
@@ -1135,7 +1148,7 @@ error:
**************************************************************************************
*/
static herr_t
-verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf)
+verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf, void *_buf)
{
int k, m; /* Local index variable */
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 52cda54..53f834a 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -43,8 +43,9 @@
#define ATTR7_NAME "attr ushort"
#define ATTR8_NAME "attr uint"
#define ATTR9_NAME "attr ulong"
-#define ATTR10_NAME "attr float"
-#define ATTR11_NAME "attr double"
+#define ATTR10_NAME "attr ullong"
+#define ATTR11_NAME "attr float"
+#define ATTR12_NAME "attr double"
static herr_t make_attributes(hid_t loc_id, const char *obj_name);
@@ -472,28 +473,30 @@ make_attributes(hid_t loc_id, const char *obj_name)
size_t type_size;
int i;
- char attr_str_in[] = {"My attribute"};
- char attr_str_out[20];
- char attr_char_in[5] = {1, 2, 3, 4, 5};
- char attr_char_out[5];
- short attr_short_in[5] = {1, 2, 3, 4, 5};
- short attr_short_out[5];
- int attr_int_in[5] = {1, 2, 3, 4, 5};
- int attr_int_out[5];
- long attr_long_in[5] = {1, 2, 3, 4, 5};
- long attr_long_out[5];
- float attr_float_in[5] = {1, 2, 3, 4, 5};
- float attr_float_out[5];
- double attr_double_in[5] = {1, 2, 3, 4, 5};
- double attr_double_out[5];
- unsigned char attr_uchar_in[5] = {1, 2, 3, 4, 5};
- unsigned char attr_uchar_out[5];
- unsigned short attr_ushort_in[5] = {1, 2, 3, 4, 5};
- unsigned short attr_ushort_out[5];
- unsigned int attr_uint_in[5] = {1, 2, 3, 4, 5};
- unsigned int attr_uint_out[5];
- unsigned long attr_ulong_in[5] = {1, 2, 3, 4, 5};
- unsigned long attr_ulong_out[5];
+ char attr_str_in[] = {"My attribute"};
+ char attr_str_out[20];
+ char attr_char_in[5] = {1, 2, 3, 4, 5};
+ char attr_char_out[5];
+ short attr_short_in[5] = {1, 2, 3, 4, 5};
+ short attr_short_out[5];
+ int attr_int_in[5] = {1, 2, 3, 4, 5};
+ int attr_int_out[5];
+ long attr_long_in[5] = {1, 2, 3, 4, 5};
+ long attr_long_out[5];
+ float attr_float_in[5] = {1, 2, 3, 4, 5};
+ float attr_float_out[5];
+ double attr_double_in[5] = {1, 2, 3, 4, 5};
+ double attr_double_out[5];
+ unsigned char attr_uchar_in[5] = {1, 2, 3, 4, 5};
+ unsigned char attr_uchar_out[5];
+ unsigned short attr_ushort_in[5] = {1, 2, 3, 4, 5};
+ unsigned short attr_ushort_out[5];
+ unsigned int attr_uint_in[5] = {1, 2, 3, 4, 5};
+ unsigned int attr_uint_out[5];
+ unsigned long attr_ulong_in[5] = {1, 2, 3, 4, 5};
+ unsigned long attr_ulong_out[5];
+ unsigned long long attr_ullong_in[5] = {1, 2, 3, 4, 5};
+ unsigned long long attr_ullong_out[5];
/*-------------------------------------------------------------------------
* H5LTset_attribute_string test
@@ -509,7 +512,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
PASSED();
/*-------------------------------------------------------------------------
- * H5LTset_attribute_string test
+ * H5LTget_attribute_string test
*-------------------------------------------------------------------------
*/
@@ -859,7 +862,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
PASSED();
/*-------------------------------------------------------------------------
- * H5LTget_attribute_long test
+ * H5LTget_attribute_ulong test
*-------------------------------------------------------------------------
*/
@@ -888,6 +891,48 @@ make_attributes(hid_t loc_id, const char *obj_name)
PASSED();
/*-------------------------------------------------------------------------
+ * H5LTset_attribute_ullong test
+ *-------------------------------------------------------------------------
+ */
+
+ HL_TESTING2("H5LTset_attribute_ullong");
+
+ /* Set the attribute */
+ if (H5LTset_attribute_ullong(loc_id, obj_name, ATTR10_NAME, attr_ullong_in, (size_t)5) < 0)
+ return -1;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * H5LTget_attribute_ullong test
+ *-------------------------------------------------------------------------
+ */
+
+ HL_TESTING2("H5LTget_attribute_ullong");
+
+ /* Get the attribute */
+ if (H5LTget_attribute_ullong(loc_id, obj_name, ATTR10_NAME, attr_ullong_out) < 0)
+ return -1;
+
+ for (i = 0; i < 5; i++) {
+ if (attr_ullong_in[i] != attr_ullong_out[i]) {
+ return -1;
+ }
+ }
+
+ /* Get the attribute */
+ if (H5LTget_attribute(loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_ULLONG, attr_ullong_out) < 0)
+ return -1;
+
+ for (i = 0; i < 5; i++) {
+ if (attr_ullong_in[i] != attr_ullong_out[i]) {
+ return -1;
+ }
+ }
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
* H5LTset_attribute_float test
*-------------------------------------------------------------------------
*/
@@ -895,7 +940,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
HL_TESTING2("H5LTset_attribute_float");
/* Set the attribute */
- if (H5LTset_attribute_float(loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5) < 0)
+ if (H5LTset_attribute_float(loc_id, obj_name, ATTR11_NAME, attr_float_in, (size_t)5) < 0)
return -1;
PASSED();
@@ -908,7 +953,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
HL_TESTING2("H5LTget_attribute_float");
/* Get the attribute */
- if (H5LTget_attribute_float(loc_id, obj_name, ATTR10_NAME, attr_float_out) < 0)
+ if (H5LTget_attribute_float(loc_id, obj_name, ATTR11_NAME, attr_float_out) < 0)
return -1;
for (i = 0; i < 5; i++) {
@@ -918,7 +963,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
}
/* Get the attribute */
- if (H5LTget_attribute(loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_FLOAT, attr_float_out) < 0)
+ if (H5LTget_attribute(loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_FLOAT, attr_float_out) < 0)
return -1;
for (i = 0; i < 5; i++) {
@@ -937,7 +982,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
HL_TESTING2("H5LTset_attribute_double");
/* Set the attribute */
- if (H5LTset_attribute_double(loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5) < 0)
+ if (H5LTset_attribute_double(loc_id, obj_name, ATTR12_NAME, attr_double_in, (size_t)5) < 0)
return -1;
PASSED();
@@ -950,7 +995,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
HL_TESTING2("H5LTget_attribute_double");
/* Get the attribute */
- if (H5LTget_attribute_double(loc_id, obj_name, ATTR11_NAME, attr_double_out) < 0)
+ if (H5LTget_attribute_double(loc_id, obj_name, ATTR12_NAME, attr_double_out) < 0)
return -1;
for (i = 0; i < 5; i++) {
@@ -960,7 +1005,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
}
/* Get the attribute */
- if (H5LTget_attribute(loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_DOUBLE, attr_double_out) < 0)
+ if (H5LTget_attribute(loc_id, obj_name, ATTR12_NAME, H5T_NATIVE_DOUBLE, attr_double_out) < 0)
return -1;
for (i = 0; i < 5; i++) {
@@ -1054,7 +1099,7 @@ test_integers(void)
HDfree(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_STD_I8BE")) {
+ if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) {
HDfree(dt_str);
goto out;
}
@@ -1112,7 +1157,7 @@ test_fps(void)
HDfree(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_IEEE_F32BE")) {
+ if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) {
HDfree(dt_str);
goto out;
}
@@ -1184,7 +1229,7 @@ test_strings(void)
goto out;
}
if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET "
- "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
+ "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1219,7 +1264,7 @@ test_strings(void)
goto out;
}
if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n "
- "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
+ "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1238,7 +1283,7 @@ test_strings(void)
if (HDstrncmp(dt_str,
"H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
"H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
- str_len - 1)) {
+ str_len - 1) != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1261,7 +1306,7 @@ test_strings(void)
if (HDstrncmp(dt_str,
"H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
"H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
- str_len)) {
+ str_len) != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1322,7 +1367,8 @@ test_opaques(void)
}
if (HDstrcmp(
dt_str,
- "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
+ "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") !=
+ 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1376,7 +1422,7 @@ test_enums(void)
if (H5Tenum_nameof(dtype, &value1, name1, size) < 0)
goto out;
- if (HDstrcmp(name1, "BLUE"))
+ if (HDstrcmp(name1, "BLUE") != 0)
goto out;
if (H5Tenum_valueof(dtype, name2, &value2) < 0)
@@ -1399,8 +1445,9 @@ test_enums(void)
HDfree(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" "
- " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
+ if (HDstrcmp(dt_str,
+ "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" "
+ " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
@@ -1462,7 +1509,7 @@ test_variables(void)
HDfree(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
+ if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1526,7 +1573,7 @@ test_arrays(void)
}
if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n "
" H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE "
- "\"arr_compound_2\" : 1;\n }\n }\n }")) {
+ "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1586,7 +1633,7 @@ test_compounds(void)
goto out;
}
if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE "
- "\"two_field\" : 6;\n }")) {
+ "\"two_field\" : 6;\n }") != 0) {
HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
@@ -1605,7 +1652,7 @@ test_compounds(void)
if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "i16_field")) {
+ if (HDstrcmp(memb_name, "i16_field") != 0) {
H5free_memory(memb_name);
goto out;
}
@@ -1683,7 +1730,7 @@ test_compound_bug(void)
if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "sub")) {
+ if (HDstrcmp(memb_name, "sub") != 0) {
H5free_memory(memb_name);
goto out;
}
@@ -1720,7 +1767,7 @@ test_compound_bug(void)
if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
if (HDstrcmp(memb_name, "desc____________________________________________________________________________"
- "_____________")) {
+ "_____________") != 0) {
H5free_memory(memb_name);
goto out;
}
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 1d3a569..5f30d4b 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -45,10 +45,10 @@ typedef struct particle_t {
* a static array of particles for writing and checking reads
*-------------------------------------------------------------------------
*/
-static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0f, 0.0f}, {"one", 10, 10, 1.0f, 10.0f},
- {"two", 20, 20, 2.0f, 20.0f}, {"three", 30, 30, 3.0f, 30.0f},
- {"four", 40, 40, 4.0f, 40.0f}, {"five", 50, 50, 5.0f, 50.0f},
- {"six", 60, 60, 6.0f, 60.0f}, {"seven", 70, 70, 7.0f, 70.0f}};
+static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
+ {"two", 20, 20, 2.0F, 20.0}, {"three", 30, 30, 3.0F, 30.0},
+ {"Four", 40, 40, 4.0F, 40.0}, {"Five", 50, 50, 5.0F, 50.0},
+ {"six", 60, 60, 6.0F, 60.0}, {"seven", 70, 70, 7.0F, 70.0}};
/*-------------------------------------------------------------------------
* function that compares one particle
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 0d4a72a..6199e27 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -199,7 +199,7 @@ test_table(hid_t fid, int do_write)
hsize_t chunk_size = 10;
int compress = 0;
int * fill = NULL;
- particle_t fill1[1] = {{"no data", -1, -99.0f, -99.0f, -1}};
+ particle_t fill1[1] = {{"no data", -1, -99.0, -99.0, -1}};
int fill1_new[1] = {-100};
hsize_t position;
char tname[20];
@@ -227,25 +227,25 @@ test_table(hid_t fid, int do_write)
particle2_t rbuf2[NRECORDS];
particle3_t rbuf3[NRECORDS];
particle_t rbufc[NRECORDS * 2];
- particle_t abuf[2] = {{"eight", 80, 8.0f, 80.0f, 80}, {"nine", 90, 9.0f, 90.0f, 90}};
- particle_t ibuf[2] = {{"zero", 0, 0.0f, 0.0f, 0}, {"zero", 0, 0.0f, 0.0f, 0}};
+ particle_t abuf[2] = {{"eight", 80, 8.0, 80.0, 80}, {"nine", 90, 9.0, 90.0, 90}};
+ particle_t ibuf[2] = {{"zero", 0, 0.0, 0.0, 0}, {"zero", 0, 0.0, 0.0, 0}};
particle_t wbufd[NRECORDS];
particle_t wbuf[NRECORDS] = {{
"zero",
0,
- 0.0f,
- 0.0f,
+ 0.0,
+ 0.0,
0,
},
- {"one", 10, 1.0f, 10.0f, 10},
- {"two", 20, 2.0f, 20.0f, 20},
- {"three", 30, 3.0f, 30.0f, 30},
- {"four", 40, 4.0f, 40.0f, 40},
- {"five", 50, 5.0f, 50.0f, 50},
- {"six", 60, 6.0f, 60.0f, 60},
- {"seven", 70, 7.0f, 70.0f, 70}};
+ {"one", 10, 1.0, 10.0, 10},
+ {"two", 20, 2.0, 20.0, 20},
+ {"three", 30, 3.0, 30.0, 30},
+ {"four", 40, 4.0, 40.0, 40},
+ {"five", 50, 5.0, 50.0, 50},
+ {"six", 60, 6.0, 60.0, 60},
+ {"seven", 70, 7.0, 70.0, 70}};
/* buffers for the field "Pressure" and "New_field" */
- float pressure_in[NRECORDS] = {0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f};
+ float pressure_in[NRECORDS] = {0.0F, 1.0F, 2.0F, 3.0F, 4.0F, 5.0F, 6.0F, 7.0F};
float pressure_out[NRECORDS];
int buf_new[NRECORDS] = {0, 1, 2, 3, 4, 5, 6, 7};
/* buffers for the fields "Latitude,Longitude" */
@@ -254,8 +254,8 @@ test_table(hid_t fid, int do_write)
/* buffers for the fields "Name,Pressure" */
namepressure_t namepre_out[NRECORDS];
namepressure_t namepre_in[NRECORDS] = {
- {"zero", 0.0f}, {"one", 1.0f}, {"two", 2.0f}, {"three", 3.0f},
- {"four", 4.0f}, {"five", 5.0f}, {"six", 6.0f}, {"seven", 7.0f},
+ {"zero", 0.0F}, {"one", 1.0F}, {"two", 2.0F}, {"three", 3.0F},
+ {"four", 4.0F}, {"five", 5.0F}, {"six", 6.0F}, {"seven", 7.0F},
};
/*-------------------------------------------------------------------------
@@ -332,14 +332,14 @@ test_table(hid_t fid, int do_write)
HOFFSET(particle4_t, aty), HOFFSET(particle4_t, rro)};
/* Define an array of Particles */
- particle4_t p_data[NRECORDS] = {{12112, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}},
- {12113, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}},
- {12114, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}},
- {12115, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}},
- {12116, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}},
- {12117, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}},
- {12118, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}},
- {12119, 1.4f, 2.5f, {1, 2, 3}, {4, 5, 6}, {99, 100}}};
+ particle4_t p_data[NRECORDS] = {{12112, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}},
+ {12113, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}},
+ {12114, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}},
+ {12115, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}},
+ {12116, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}},
+ {12117, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}},
+ {12118, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}},
+ {12119, 1.4, 2.5, {1, 2, 3}, {4, 5, 6}, {99, 100}}};
/*-------------------------------------------------------------------------
* initialize table parameters
diff --git a/hl/tools/COPYING b/hl/tools/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/hl/tools/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h
index 2b4a344..1a8cfe4 100644
--- a/hl/tools/gif2h5/gif.h
+++ b/hl/tools/gif2h5/gif.h
@@ -157,8 +157,8 @@ int ReadGifApplication(GIFAPPLICATION *, GIFBYTE **);
int ReadGifComment(GIFCOMMENT *, GIFBYTE **);
/* HDFGIFWR.C */
-int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, GIFBYTE *rmap, GIFBYTE *gmap, GIFBYTE *bmap,
- GIFBYTE *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel);
+int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, const GIFBYTE *rmap, const GIFBYTE *gmap,
+ const GIFBYTE *bmap, const GIFBYTE *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel);
/* WRITEHDF.C */
int WriteHDF(GIFTOMEM, GIFCHAR *);
@@ -176,7 +176,7 @@ int ReadHDF(GIFBYTE **data, GIFBYTE palette[256][3], hsize_t *image_size, GIFCHA
GIFCHAR *dset_name, GIFCHAR *pal_name);
GIFBYTE *Decompress(GIFIMAGEDESC *, GIFHEAD *);
-GIFBYTE GetByte(GIFBYTE *);
+GIFBYTE GetByte(const GIFBYTE *);
GIFWORD GetWord(GIFBYTE *);
void cleanup(GIFBYTE *);
diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c
index b88264b..dd9e5be 100644
--- a/hl/tools/gif2h5/gifread.c
+++ b/hl/tools/gif2h5/gifread.c
@@ -38,7 +38,10 @@ GetWord(GIFBYTE *MemGif)
}
GIFBYTE
-GetByte(GIFBYTE *MemGif) { return *MemGif; }
+GetByte(const GIFBYTE *MemGif)
+{
+ return *MemGif;
+}
/*
* Read a GIF image GIFBYTE Header.
@@ -62,7 +65,7 @@ ReadGifHeader(GIFHEAD * GifHead, /* Pointer to GIF header structure */
GifHead->HeaderDump[i] = *(*MemGif2)++;
}
- if (strncmp((const char *)GifHead->HeaderDump, "GIF", (size_t)3)) {
+ if (strncmp((const char *)GifHead->HeaderDump, "GIF", (size_t)3) != 0) {
printf("The file does not appear to be a valid GIF file.\n");
exit(EXIT_FAILURE);
}
diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c
index 8068829..21b14d1 100644
--- a/hl/tools/gif2h5/hdfgifwr.c
+++ b/hl/tools/gif2h5/hdfgifwr.c
@@ -135,8 +135,8 @@ static int EOFCode;
/*************************************************************/
int
-hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, byte *gmap, byte *bmap, byte *pc2ncmap,
- int numcols, int colorstyle, int BitsPerPixel)
+hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, const byte *rmap, const byte *gmap,
+ const byte *bmap, const byte *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel)
{
int InitCodeSize;
int i;
diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c
index 8d7f4ec..afbc31d 100644
--- a/hl/tools/h5watch/h5watch.c
+++ b/hl/tools/h5watch/h5watch.c
@@ -43,7 +43,7 @@ static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file
static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */
static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */
-static herr_t doprint(hid_t did, hsize_t *start, hsize_t *block, int rank);
+static herr_t doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank);
static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsize_t *block,
int rank, int subrank);
static herr_t monitor_dataset(hid_t fid, char *dsetname);
@@ -58,27 +58,27 @@ static void parse_command_line(int argc, const char *argv[]);
* The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "?";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'},
- {"dim", no_arg, 'd'}, {"di", no_arg, 'd'},
- {"label", no_arg, 'l'}, {"labe", no_arg, 'l'},
- {"lab", no_arg, 'l'}, {"la", no_arg, 'l'},
- {"simple", no_arg, 'S'}, {"simpl", no_arg, 'S'},
- {"simp", no_arg, 'S'}, {"sim", no_arg, 'S'},
- {"si", no_arg, 'S'}, {"hexdump", no_arg, 'x'},
- {"hexdum", no_arg, 'x'}, {"hexdu", no_arg, 'x'},
- {"hexd", no_arg, 'x'}, {"hex", no_arg, 'x'},
- {"width", require_arg, 'w'}, {"widt", require_arg, 'w'},
- {"wid", require_arg, 'w'}, {"wi", require_arg, 'w'},
- {"polling", require_arg, 'p'}, {"pollin", require_arg, 'p'},
- {"polli", require_arg, 'p'}, {"poll", require_arg, 'p'},
- {"pol", require_arg, 'p'}, {"po", require_arg, 'p'},
- {"fields", require_arg, 'f'}, {"field", require_arg, 'f'},
- {"fiel", require_arg, 'f'}, {"fie", require_arg, 'f'},
- {"fi", require_arg, 'f'}, {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'}, {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'}, {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'}, {NULL, 0, '\0'}};
+static const char * s_opts = "?";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'},
+ {"dim", no_arg, 'd'}, {"di", no_arg, 'd'},
+ {"label", no_arg, 'l'}, {"labe", no_arg, 'l'},
+ {"lab", no_arg, 'l'}, {"la", no_arg, 'l'},
+ {"simple", no_arg, 'S'}, {"simpl", no_arg, 'S'},
+ {"simp", no_arg, 'S'}, {"sim", no_arg, 'S'},
+ {"si", no_arg, 'S'}, {"hexdump", no_arg, 'x'},
+ {"hexdum", no_arg, 'x'}, {"hexdu", no_arg, 'x'},
+ {"hexd", no_arg, 'x'}, {"hex", no_arg, 'x'},
+ {"width", require_arg, 'w'}, {"widt", require_arg, 'w'},
+ {"wid", require_arg, 'w'}, {"wi", require_arg, 'w'},
+ {"polling", require_arg, 'p'}, {"pollin", require_arg, 'p'},
+ {"polli", require_arg, 'p'}, {"poll", require_arg, 'p'},
+ {"pol", require_arg, 'p'}, {"po", require_arg, 'p'},
+ {"fields", require_arg, 'f'}, {"field", require_arg, 'f'},
+ {"fiel", require_arg, 'f'}, {"fie", require_arg, 'f'},
+ {"fi", require_arg, 'f'}, {"version", no_arg, 'V'},
+ {"versio", no_arg, 'V'}, {"versi", no_arg, 'V'},
+ {"vers", no_arg, 'V'}, {"ver", no_arg, 'V'},
+ {"ve", no_arg, 'V'}, {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: doprint()
@@ -95,7 +95,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no
*-------------------------------------------------------------------------
*/
static herr_t
-doprint(hid_t did, hsize_t *start, hsize_t *block, int rank)
+doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank)
{
h5tools_context_t ctx; /* print context */
h5tool_format_t info; /* Format info for the tools library */
@@ -677,7 +677,7 @@ parse_command_line(int argc, const char *argv[])
}
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case '?':
case 'h': /* --help */
@@ -691,7 +691,7 @@ parse_command_line(int argc, const char *argv[])
break;
case 'w': /* --width=N */
- g_display_width = (int)HDstrtol(opt_arg, NULL, 0);
+ g_display_width = (int)HDstrtol(H5_optarg, NULL, 0);
if (g_display_width < 0) {
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
@@ -711,8 +711,8 @@ parse_command_line(int argc, const char *argv[])
break;
case 'p': /* --polling=N */
- /* g_polling_interval = HDstrtod(opt_arg, NULL); */
- if ((tmp = (int)HDstrtol(opt_arg, NULL, 10)) <= 0) {
+ /* g_polling_interval = HDstrtod(H5_optarg, NULL); */
+ if ((tmp = (int)HDstrtol(H5_optarg, NULL, 10)) <= 0) {
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
}
@@ -721,7 +721,7 @@ parse_command_line(int argc, const char *argv[])
case 'f': /* --fields=<list_of_fields> */
if (g_list_of_fields == NULL) {
- if ((g_list_of_fields = HDstrdup(opt_arg)) == NULL) {
+ if ((g_list_of_fields = HDstrdup(H5_optarg)) == NULL) {
error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__);
leave(EXIT_FAILURE);
}
@@ -729,7 +729,7 @@ parse_command_line(int argc, const char *argv[])
else {
char *str;
- if ((str = HDstrdup(opt_arg)) == NULL) {
+ if ((str = HDstrdup(H5_optarg)) == NULL) {
error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__);
leave(EXIT_FAILURE);
}
@@ -751,7 +751,7 @@ parse_command_line(int argc, const char *argv[])
}
/* check for object to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing dataset name\n");
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
@@ -821,7 +821,7 @@ main(int argc, const char *argv[])
/* parse command line options */
parse_command_line(argc, argv);
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing dataset name\n");
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
@@ -845,7 +845,7 @@ main(int argc, const char *argv[])
* then there must have been something wrong with the file (perhaps it
* doesn't exist).
*/
- if ((fname = HDstrdup(argv[opt_ind])) == NULL) {
+ if ((fname = HDstrdup(argv[H5_optind])) == NULL) {
error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__);
h5tools_setstatus(EXIT_FAILURE);
goto done;
diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c
index c83e485..44cb0cb 100644
--- a/hl/tools/h5watch/h5watchgentest.c
+++ b/hl/tools/h5watch/h5watchgentest.c
@@ -224,7 +224,7 @@ main(void)
one_cbuf[i].field2.b.a = 20;
one_cbuf[i].field2.b.b = 40;
one_cbuf[i].field2.b.c = 80;
- one_cbuf[i].field3 = 3.0F;
+ one_cbuf[i].field3 = 3.0;
one_cbuf[i].field4.a = 4;
one_cbuf[i].field4.b = 8;
} /* end for */
@@ -313,7 +313,7 @@ main(void)
two_cbuf[i].field2.b.a = 20;
two_cbuf[i].field2.b.b = 40;
two_cbuf[i].field2.b.c = 80;
- two_cbuf[i].field3 = 3.0F;
+ two_cbuf[i].field3 = 3.0;
two_cbuf[i].field4.a = 4;
two_cbuf[i].field4.b = 8;
} /* end for */
diff --git a/java/COPYING b/java/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/java/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 960c872..63547df 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -512,8 +512,8 @@ public class H5 implements java.io.Serializable {
*
* @param file_export_name
* The file name to export data into.
- * @param file_name
- * The name of the HDF5 file containing the dataset.
+ * @param file_id
+ * The identifier of the HDF5 file containing the dataset.
* @param object_path
* The full path of the dataset to be exported.
* @param binary_order
@@ -525,10 +525,31 @@ public class H5 implements java.io.Serializable {
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native void H5export_dataset(String file_export_name, String file_name,
+ public synchronized static native void H5export_dataset(String file_export_name, long file_id,
String object_path, int binary_order) throws HDF5LibraryException;
/**
+ * H5export_attribute is a utility function to save data in a file.
+ *
+ * @param file_export_name
+ * The file name to export data into.
+ * @param dataset_id
+ * The identifier of the dataset containing the attribute.
+ * @param attribute_name
+ * The attribute to be exported.
+ * @param binary_order
+ * 99 - export data as text.
+ * 1 - export data as binary Native Order.
+ * 2 - export data as binary Little Endian.
+ * 3 - export data as binary Big Endian.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5export_attribute(String file_export_name, long dataset_id,
+ String attribute_name, int binary_order) throws HDF5LibraryException;
+
+ /**
* H5is_library_threadsafe Checks to see if the library was built with thread-safety enabled.
*
* @return true if hdf5 library implements threadsafe
@@ -10705,7 +10726,18 @@ public class H5 implements java.io.Serializable {
* @exception IllegalArgumentException
* - an input array is invalid.
**/
- public synchronized static native long H5Ropen_object(byte[] ref_ptr, long rapl_id, long oapl_id)
+ public static long H5Ropen_object(byte[] ref_ptr, long rapl_id, long oapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException {
+ long id = _H5Ropen_object(ref_ptr, rapl_id, oapl_id);
+ if (id > 0) {
+ log.trace("OPEN_IDS: H5Ropen_object add {}", id);
+ OPEN_IDS.add(id);
+ log.trace("OPEN_IDS: {}", OPEN_IDS.size());
+ }
+ return id;
+ }
+
+ private synchronized static native long _H5Ropen_object(byte[] ref_ptr, long rapl_id, long oapl_id)
throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
/**
@@ -10733,7 +10765,18 @@ public class H5 implements java.io.Serializable {
* @exception IllegalArgumentException
* - an input array is invalid.
**/
- public synchronized static native long H5Ropen_region(byte[] ref_ptr, long rapl_id, long oapl_id)
+ public static long H5Ropen_region(byte[] ref_ptr, long rapl_id, long oapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException {
+ long id = _H5Ropen_region(ref_ptr, rapl_id, oapl_id);
+ if (id > 0) {
+ log.trace("OPEN_IDS: H5Ropen_region add {}", id);
+ OPEN_IDS.add(id);
+ log.trace("OPEN_IDS: {}", OPEN_IDS.size());
+ }
+ return id;
+ }
+
+ private synchronized static native long _H5Ropen_region(byte[] ref_ptr, long rapl_id, long oapl_id)
throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
/**
@@ -10761,7 +10804,18 @@ public class H5 implements java.io.Serializable {
* @exception IllegalArgumentException
* - an input array is invalid.
**/
- public synchronized static native long H5Ropen_attr(byte[] ref_ptr, long rapl_id, long aapl_id)
+ public static long H5Ropen_attr(byte[] ref_ptr, long rapl_id, long aapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException {
+ long id = _H5Ropen_attr(ref_ptr, rapl_id, aapl_id);
+ if (id > 0) {
+ log.trace("OPEN_IDS: H5Ropen_attr add {}", id);
+ OPEN_IDS.add(id);
+ log.trace("OPEN_IDS: {}", OPEN_IDS.size());
+ }
+ return id;
+ }
+
+ private synchronized static native long _H5Ropen_attr(byte[] ref_ptr, long rapl_id, long aapl_id)
throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
// Get type //
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java
index 334abee..4125907 100644
--- a/java/src/hdf/hdf5lib/HDF5Constants.java
+++ b/java/src/hdf/hdf5lib/HDF5Constants.java
@@ -55,15 +55,15 @@ public class HDF5Constants {
public static final int H5_INDEX_CRT_ORDER = H5_INDEX_CRT_ORDER();
/** indices on links, number of indices defined */
public static final int H5_INDEX_N = H5_INDEX_N();
- /** */
+ /** Common iteration orders, Unknown order */
public static final int H5_ITER_UNKNOWN = H5_ITER_UNKNOWN();
- /** */
+ /** Common iteration orders, Increasing order */
public static final int H5_ITER_INC = H5_ITER_INC();
- /** */
+ /** Common iteration orders, Decreasing order */
public static final int H5_ITER_DEC = H5_ITER_DEC();
- /** */
+ /** Common iteration orders, No particular order, whatever is fastest */
public static final int H5_ITER_NATIVE = H5_ITER_NATIVE();
- /** */
+ /** Common iteration orders, Number of iteration orders */
public static final int H5_ITER_N = H5_ITER_N();
/** */
public static final int H5AC_CURR_CACHE_CONFIG_VERSION = H5AC_CURR_CACHE_CONFIG_VERSION();
diff --git a/java/src/hdf/hdf5lib/HDF5GroupInfo.java b/java/src/hdf/hdf5lib/HDF5GroupInfo.java
index e08f991..4c31af7 100644
--- a/java/src/hdf/hdf5lib/HDF5GroupInfo.java
+++ b/java/src/hdf/hdf5lib/HDF5GroupInfo.java
@@ -90,32 +90,44 @@ public class HDF5GroupInfo {
linklen = 0;
}
- /** fileno accessors */
+ /** fileno accessors
+ * @return the file number if successful
+ */
public long[] getFileno() {
return fileno;
}
- /** accessors */
+ /** accessors
+ * @return the object number if successful
+ */
public long[] getObjno() {
return objno;
}
- /** accessors */
+ /** accessors
+ * @return type of group if successful
+ */
public int getType() {
return type;
}
- /** accessors */
+ /** accessors
+ * @return the number of links in the group if successful
+ */
public int getNlink() {
return nlink;
}
- /** accessors */
+ /** accessors
+ * @return the modified time value if successful
+ */
public long getMtime() {
return mtime;
}
- /** accessors */
+ /** accessors
+ * @return a length of link name if successful
+ */
public int getLinklen() {
return linklen;
}
diff --git a/java/src/hdf/hdf5lib/HDFArray.java b/java/src/hdf/hdf5lib/HDFArray.java
index 385d71b..21e2b02 100644
--- a/java/src/hdf/hdf5lib/HDFArray.java
+++ b/java/src/hdf/hdf5lib/HDFArray.java
@@ -46,10 +46,10 @@ public class HDFArray {
*
* @param anArray
* The array object.
- * @exception hdf.hdf5lib.exceptions.HDF5Exception
- * object is not an array.
+ * @exception hdf.hdf5lib.exceptions.HDF5JavaException
+ * object is not an array.
*/
- public HDFArray(Object anArray) throws HDF5Exception
+ public HDFArray(Object anArray) throws HDF5JavaException
{
if (anArray == null) {
HDF5JavaException ex = new HDF5JavaException("HDFArray: array is null?: ");
@@ -76,16 +76,14 @@ public class HDFArray {
* @return A one-D array of bytes, filled with zeroes. The bytes are sufficient to hold the data of the Array passed
* to the constructor.
* @exception hdf.hdf5lib.exceptions.HDF5JavaException
- * Allocation failed.
+ * Allocation failed.
*/
- public byte[] emptyBytes()
- throws HDF5JavaException
+ public byte[] emptyBytes() throws HDF5JavaException
{
byte[] b = null;
- if ((ArrayDescriptor.dims == 1)
- && (ArrayDescriptor.NT == 'B')) {
+ if ((ArrayDescriptor.dims == 1) && (ArrayDescriptor.NT == 'B')) {
b = (byte[]) _theArray;
}
else {
@@ -103,10 +101,9 @@ public class HDFArray {
*
* @return A one-D array of bytes, constructed from the Array passed to the constructor.
* @exception hdf.hdf5lib.exceptions.HDF5JavaException
- * the object not an array or other internal error.
+ * the object not an array or other internal error.
*/
- public byte[] byteify()
- throws HDF5JavaException
+ public byte[] byteify() throws HDF5JavaException
{
if (_barray != null) {
return _barray;
@@ -224,8 +221,6 @@ public class HDFArray {
if (ArrayDescriptor.NT == 'J') {
arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
(long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
- arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else if (ArrayDescriptor.NT == 'I') {
arow = HDFNativeData.intToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
@@ -552,8 +547,7 @@ public class HDFArray {
+ "?"));
}
}
- if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims
- - 1]) {
+ if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims - 1]) {
throw new java.lang.InternalError(
new String("HDFArray::arrayify Panic didn't complete all data: currentindex[" + i + "] = "
+ ArrayDescriptor.currentindex[i] + " (should be " + (ArrayDescriptor.dimlen[i]) + "?"));
@@ -580,7 +574,7 @@ public class HDFArray {
Integer[] out = new Integer[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Integer(in[i]);
+ out[i] = Integer.valueOf(in[i]);
}
return out;
}
@@ -592,7 +586,7 @@ public class HDFArray {
Integer[] out = new Integer[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Integer(in[i]);
+ out[i] = Integer.valueOf(in[i]);
}
return out;
}
@@ -615,7 +609,7 @@ public class HDFArray {
Short[] out = new Short[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Short(in[i]);
+ out[i] = Short.valueOf(in[i]);
}
return out;
}
@@ -627,7 +621,7 @@ public class HDFArray {
Short[] out = new Short[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Short(in[i]);
+ out[i] = Short.valueOf(in[i]);
}
return out;
}
@@ -649,7 +643,7 @@ public class HDFArray {
Byte[] out = new Byte[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Byte(bin[i]);
+ out[i] = Byte.valueOf(bin[i]);
}
return out;
}
@@ -659,7 +653,7 @@ public class HDFArray {
Byte[] out = new Byte[len];
for (int i = 0; i < len; i++) {
- out[i] = new Byte(bin[i]);
+ out[i] = Byte.valueOf(bin[i]);
}
return out;
}
@@ -682,7 +676,7 @@ public class HDFArray {
Float[] out = new Float[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Float(in[i]);
+ out[i] = Float.valueOf(in[i]);
}
return out;
}
@@ -694,7 +688,7 @@ public class HDFArray {
Float[] out = new Float[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Float(in[i]);
+ out[i] = Float.valueOf(in[i]);
}
return out;
}
@@ -717,7 +711,7 @@ public class HDFArray {
Double[] out = new Double[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Double(in[i]);
+ out[i] = Double.valueOf(in[i]);
}
return out;
}
@@ -729,7 +723,7 @@ public class HDFArray {
Double[] out = new Double[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Double(in[i]);
+ out[i] = Double.valueOf(in[i]);
}
return out;
}
@@ -752,7 +746,7 @@ public class HDFArray {
Long[] out = new Long[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Long(in[i]);
+ out[i] = Long.valueOf(in[i]);
}
return out;
}
@@ -764,7 +758,7 @@ public class HDFArray {
Long[] out = new Long[nelems];
for (int i = 0; i < nelems; i++) {
- out[i] = new Long(in[i]);
+ out[i] = Long.valueOf(in[i]);
}
return out;
}
@@ -790,12 +784,12 @@ class ArrayDescriptor {
static int dims = 0;
static String className;
- public ArrayDescriptor(Object anArray) throws HDF5Exception
+ public ArrayDescriptor(Object anArray) throws HDF5JavaException
{
Class tc = anArray.getClass();
if (tc.isArray() == false) {
/* exception: not an array */
- HDF5Exception ex = new HDF5JavaException("ArrayDescriptor: not an array?: ");
+ HDF5JavaException ex = new HDF5JavaException("ArrayDescriptor: not an array?: ");
throw (ex);
}
@@ -827,12 +821,10 @@ class ArrayDescriptor {
else if (NT == 'S') {
NTsize = 2;
}
- else if ((NT == 'I')
- || (NT == 'F')) {
+ else if ((NT == 'I') || (NT == 'F')) {
NTsize = 4;
}
- else if ((NT == 'J')
- || (NT == 'D')) {
+ else if ((NT == 'J') || (NT == 'D')) {
NTsize = 8;
}
else if (css.startsWith("Ljava.lang.Byte")) {
@@ -925,8 +917,8 @@ class ArrayDescriptor {
System.out.println("Type: " + theType);
System.out.println("Class: " + theClass);
System.out.println("NT: " + NT + " NTsize: " + NTsize);
- System.out
- .println("Array has " + dims + " dimensions (" + totalSize + " bytes, " + totalElements + " elements)");
+ System.out.println("Array has " + dims + " dimensions (" + totalSize
+ + " bytes, " + totalElements + " elements)");
int i;
for (i = 0; i <= dims; i++) {
Class tc = objs[i].getClass();
diff --git a/java/src/hdf/hdf5lib/HDFNativeData.java b/java/src/hdf/hdf5lib/HDFNativeData.java
index 5b29050..85378db 100644
--- a/java/src/hdf/hdf5lib/HDFNativeData.java
+++ b/java/src/hdf/hdf5lib/HDFNativeData.java
@@ -153,8 +153,7 @@ public class HDFNativeData {
* The input array of bytes
* @return an array of 'len' float
*/
- public synchronized static native float[] byteToFloat(int start, int len,
- byte[] data);
+ public synchronized static native float[] byteToFloat(int start, int len, byte[] data);
/**
* Convert 4 bytes from an array of bytes into a single float
@@ -437,41 +436,38 @@ public class HDFNativeData {
* - Error unsupported type.
*/
public synchronized static Object byteToNumber(byte[] barray, Object obj)
- throws HDF5Exception {
+ throws HDF5Exception
+ {
Class theClass = obj.getClass();
String type = theClass.getName();
Object retobj = null;
if (type.equals("java.lang.Integer")) {
int[] i = hdf.hdf5lib.HDFNativeData.byteToInt(0, 1, barray);
- retobj = new Integer(i[0]);
+ retobj = Integer.valueOf(i[0]);
}
else if (type.equals("java.lang.Byte")) {
- retobj = new Byte(barray[0]);
+ retobj = Byte.valueOf(barray[0]);
}
else if (type.equals("java.lang.Short")) {
- short[] f = hdf.hdf5lib.HDFNativeData
- .byteToShort(0, 1, barray);
- retobj = new Short(f[0]);
+ short[] f = hdf.hdf5lib.HDFNativeData.byteToShort(0, 1, barray);
+ retobj = Short.valueOf(f[0]);
}
else if (type.equals("java.lang.Float")) {
- float[] f = hdf.hdf5lib.HDFNativeData
- .byteToFloat(0, 1, barray);
- retobj = new Float(f[0]);
+ float[] f = hdf.hdf5lib.HDFNativeData.byteToFloat(0, 1, barray);
+ retobj = Float.valueOf(f[0]);
}
else if (type.equals("java.lang.Long")) {
long[] f = hdf.hdf5lib.HDFNativeData.byteToLong(0, 1, barray);
- retobj = new Long(f[0]);
+ retobj = Long.valueOf(f[0]);
}
else if (type.equals("java.lang.Double")) {
- double[] f = hdf.hdf5lib.HDFNativeData.byteToDouble(0, 1,
- barray);
- retobj = new Double(f[0]);
+ double[] f = hdf.hdf5lib.HDFNativeData.byteToDouble(0, 1, barray);
+ retobj = Double.valueOf(f[0]);
}
else {
/* exception: unsupported type */
- HDF5Exception ex = new HDF5JavaException(
- "byteToNumber: setfield bad type: " + obj + " " + type);
+ HDF5Exception ex = new HDF5JavaException("byteToNumber: setfield bad type: " + obj + " " + type);
throw (ex);
}
return (retobj);
diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
index e3e774c..532355e 100644
--- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
+++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
@@ -30,7 +30,9 @@ import hdf.hdf5lib.HDF5Constants;
@SuppressWarnings("serial")
public class HDF5LibraryException extends HDF5Exception {
+ /** major error number of the first error on the HDF5 library error stack. */
private final long majorErrorNumber;
+ /** minor error number of the first error on the HDF5 library error stack. */
private final long minorErrorNumber;
/**
diff --git a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
index 9f04211..cf84532 100644
--- a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
@@ -20,41 +20,270 @@ import java.io.Serializable;
*/
public class H5AC_cache_config_t implements Serializable{
private static final long serialVersionUID = -6748085696476149972L;
- // general configuration fields:
+ // general configuration fields
+ /**
+ * version: Integer field containing the version number of this version
+ * of the H5AC_cache_config_t structure. Any instance of
+ * H5AC_cache_config_t passed to the cache must have a known
+ * version number, or an error will be flagged.
+ */
public int version;
+ /**
+ * rpt_fcn_enabled: Boolean field used to enable and disable the default
+ * reporting function. This function is invoked every time the
+ * automatic cache resize code is run, and reports on its activities.
+ *
+ * This is a debugging function, and should normally be turned off.
+ */
public boolean rpt_fcn_enabled;
+ /**
+ * open_trace_file: Boolean field indicating whether the trace_file_name
+ * field should be used to open a trace file for the cache.
+ *
+ * *** DEPRECATED *** Use H5Fstart/stop logging functions instead
+ */
public boolean open_trace_file;
+ /**
+ * close_trace_file: Boolean field indicating whether the current trace
+ * file (if any) should be closed.
+ *
+ * *** DEPRECATED *** Use H5Fstart/stop logging functions instead
+ */
public boolean close_trace_file;
+ /**
+ * trace_file_name: Full path of the trace file to be opened if the
+ * open_trace_file field is TRUE.
+ *
+ * *** DEPRECATED *** Use H5Fstart/stop logging functions instead
+ */
public String trace_file_name;
+ /**
+ * evictions_enabled: Boolean field used to either report the current
+ * evictions enabled status of the cache, or to set the cache's
+ * evictions enabled status.
+ */
public boolean evictions_enabled;
+ /**
+ * set_initial_size: Boolean flag indicating whether the size of the
+ * initial size of the cache is to be set to the value given in
+ * the initial_size field. If set_initial_size is FALSE, the
+ * initial_size field is ignored.
+ */
public boolean set_initial_size;
+ /**
+ * initial_size: If enabled, this field contain the size the cache is
+ * to be set to upon receipt of this structure. Needless to say,
+ * initial_size must lie in the closed interval [min_size, max_size].
+ */
public long initial_size;
+ /**
+ * min_clean_fraction: double in the range 0 to 1 indicating the fraction
+ * of the cache that is to be kept clean. This field is only used
+ * in parallel mode. Typical values are 0.1 to 0.5.
+ */
public double min_clean_fraction;
+ /**
+ * max_size: Maximum size to which the cache can be adjusted. The
+ * supplied value must fall in the closed interval
+ * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must
+ * be greater than or equal to min_size.
+ */
public long max_size;
+ /**
+ * min_size: Minimum size to which the cache can be adjusted. The
+ * supplied value must fall in the closed interval
+ * [H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE]. Also, min_size
+ * must be less than or equal to max_size.
+ */
public long min_size;
+ /**
+ * epoch_length: Number of accesses on the cache over which to collect
+ * hit rate stats before running the automatic cache resize code,
+ * if it is enabled.
+ */
public long epoch_length;
- // size increase control fields:
- public int incr_mode; // H5C_cache_incr_mode
+ // size increase control fields
+ /**
+ * incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose
+ * value indicates how we determine whether the cache size should be
+ * increased. At present there are two possible values.
+ */
+ public int incr_mode;
+ /**
+ * lower_hr_threshold: Lower hit rate threshold. If the increment mode
+ * (incr_mode) is H5C_incr__threshold and the hit rate drops below the
+ * value supplied in this field in an epoch, increment the cache size by
+ * size_increment. Note that cache size may not be incremented above
+ * max_size, and that the increment may be further restricted by the
+ * max_increment field if it is enabled.
+ */
public double lower_hr_threshold;
+ /**
+ * increment: Double containing the multiplier used to derive the new
+ * cache size from the old if a cache size increment is triggered.
+ * The increment must be greater than 1.0, and should not exceed 2.0.
+ */
public double increment;
+ /**
+ * apply_max_increment: Boolean flag indicating whether the max_increment
+ * field should be used to limit the maximum cache size increment.
+ */
public boolean apply_max_increment;
+ /**
+ * max_increment: If enabled by the apply_max_increment field described
+ * above, this field contains the maximum number of bytes by which the
+ * cache size can be increased in a single re-size.
+ */
public long max_increment;
- public int flash_incr_mode; // H5C_cache_flash_incr_mode
+ /**
+ * flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
+ * type whose value indicates whether and by which algorithm we should
+ * make flash increases in the size of the cache to accommodate insertion
+ * of large entries and large increases in the size of a single entry.
+ */
+ public int flash_incr_mode;
+ /**
+ * flash_multiple: Double containing the multiple described above in the
+ * H5C_flash_incr__add_space section of the discussion of the
+ * flash_incr_mode section. This field is ignored unless flash_incr_mode
+ * is H5C_flash_incr__add_space.
+ */
public double flash_multiple;
+ /**
+ * flash_threshold: Double containing the factor by which current max cache
+ * size is multiplied to obtain the size threshold for the add_space flash
+ * increment algorithm. The field is ignored unless flash_incr_mode is
+ * H5C_flash_incr__add_space.
+ */
public double flash_threshold;
- // size decrease control fields:
- public int decr_mode; // H5C_cache_decr_mode
+ // size decrease control fields
+ /**
+ * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
+ * value indicates how we determine whether the cache size should be
+ * decreased. At present there are four possibilities.
+ */
+ public int decr_mode;
+ /**
+ * upper_hr_threshold: Upper hit rate threshold. The use of this field
+ * varies according to the current decr_mode.
+ */
public double upper_hr_threshold;
+ /**
+ * decrement: This field is only used when the decr_mode is
+ * H5C_decr__threshold.
+ */
public double decrement;
+ /**
+ * apply_max_decrement: Boolean flag used to determine whether decrements
+ * in cache size are to be limited by the max_decrement field.
+ */
public boolean apply_max_decrement;
+ /**
+ * max_decrement: Maximum number of bytes by which the cache size can be
+ * decreased in a single re-size. Note that decrements may also be
+ * restricted by the min_size of the cache, and (in age out modes) by
+ * the empty_reserve field.
+ */
public long max_decrement;
+ /**
+ * epochs_before_eviction: Integer field used in H5C_decr__age_out and
+ * H5C_decr__age_out_with_threshold decrement modes.
+ */
public int epochs_before_eviction;
+ /**
+ * apply_empty_reserve: Boolean field controlling whether the empty_reserve
+ * field is to be used in computing the new cache size when the
+ * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
+ */
public boolean apply_empty_reserve;
+ /**
+ * empty_reserve: To avoid a constant racheting down of cache size by small
+ * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
+ * modes, this field allows one to require that any cache size
+ * reductions leave the specified fraction of unused space in the cache.
+ */
public double empty_reserve;
- // parallel configuration fields:
+ // parallel configuration fields
+ /**
+ * dirty_bytes_threshold: Threshold of dirty byte creation used to
+ * synchronize updates between caches.
+ */
public long dirty_bytes_threshold;
+ /**
+ * metadata_write_strategy: Integer field containing a code indicating the
+ * desired metadata write strategy.
+ */
public int metadata_write_strategy;
+ /** H5AC_cache_config_t is a public structure intended for use in public APIs.
+ * At least in its initial incarnation, it is basically a copy of struct
+ * H5C_auto_size_ctl_t, minus the report_fcn field, and plus the
+ * dirty_bytes_threshold field.
+ *
+ * @param version: Integer field containing the version number of this version
+ * @param rpt_fcn_enabled: Boolean field used to enable and disable the default reporting function.
+ * @param open_trace_file: Boolean field indicating whether the trace_file_name
+ * field should be used to open a trace file for the cache.
+ * @param close_trace_file: Boolean field indicating whether the current trace
+ * file (if any) should be closed.
+ * @param trace_file_name: Full path of the trace file to be opened if the
+ * open_trace_file field is TRUE.
+ * @param evictions_enabled: Boolean field used to either report or set the current
+ * evictions enabled status of the cache.
+ * @param set_initial_size: Boolean flag indicating whether the size of the
+ * initial size of the cache is to be set to the value given in
+ * the initial_size field.
+ * @param initial_size: If enabled, this field contain the size the cache is
+ * to be set to upon receipt of this structure.
+ * @param min_clean_fraction: double in the range 0 to 1 indicating the fraction
+ * of the cache that is to be kept clean.
+ * @param max_size: Maximum size to which the cache can be adjusted.
+ * @param min_size: Minimum size to which the cache can be adjusted.
+ * @param epoch_length: Number of accesses on the cache over which to collect
+ * hit rate stats before running the automatic cache resize code.
+ * @param incr_mode: Instance of the H5C_cache_incr_mode enumerated type.
+ * @param lower_hr_threshold: Lower hit rate threshold.
+ * @param increment: Double containing the multiplier used to derive the new
+ * cache size from the old if a cache size increment is triggered.
+ * @param apply_max_increment: Boolean flag indicating whether the max_increment
+ * field should be used to limit the maximum cache size increment.
+ * @param max_increment: If enabled by the apply_max_increment field described
+ * above, this field contains the maximum number of bytes by which the
+ * cache size can be increased in a single re-size.
+ * @param flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
+ * type whose value indicates whether and by which algorithm we should
+ * make flash increases in the size of the cache to accommodate insertion
+ * of large entries and large increases in the size of a single entry.
+ * @param flash_multiple: Double containing the multiple described above in the
+ * H5C_flash_incr__add_space section of the discussion of the
+ * flash_incr_mode section.
+ * @param flash_threshold: Double containing the factor by which current max cache
+ * size is multiplied to obtain the size threshold for the add_space flash
+ * increment algorithm.
+ * @param decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
+ * value indicates how we determine whether the cache size should be
+ * decreased.
+ * @param upper_hr_threshold: Upper hit rate threshold. The use of this field
+ * varies according to the current decr_mode.
+ * @param decrement: This field is only used when the decr_mode is
+ * H5C_decr__threshold.
+ * @param apply_max_decrement: Boolean flag used to determine whether decrements
+ * in cache size are to be limited by the max_decrement field.
+ * @param max_decrement: Maximum number of bytes by which the cache size can be
+ * decreased in a single re-size.
+ * @param epochs_before_eviction: Integer field used in H5C_decr__age_out and
+ * H5C_decr__age_out_with_threshold decrement modes.
+ * @param apply_empty_reserve: Boolean field controlling whether the empty_reserve
+ * field is to be used in computing the new cache size when the
+ * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
+ * @param empty_reserve: To avoid a constant racheting down of cache size by small
+ * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
+ * modes.
+ * @param dirty_bytes_threshold: Threshold of dirty byte creation used to
+ * synchronize updates between caches.
+ * @param metadata_write_strategy: Integer field containing a code indicating the
+ * desired metadata write strategy.
+ */
public H5AC_cache_config_t (int version, boolean rpt_fcn_enabled, boolean open_trace_file,
boolean close_trace_file, String trace_file_name, boolean evictions_enabled,
boolean set_initial_size, long initial_size, double min_clean_fraction, long max_size,
diff --git a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
index e074156..5981fc7 100644
--- a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
@@ -20,14 +20,20 @@ import java.io.Serializable;
*/
public class H5E_error2_t implements Serializable{
private static final long serialVersionUID = 279144359041667613L;
-
- public long cls_id; //class ID
- public long maj_num; //major error ID
- public long min_num; //minor error number
- public int line; //line in file where error occurs
- public String func_name; //function in which error occurred
- public String file_name; //file in which error occurred
- public String desc; //optional supplied description
+ /** class ID */
+ public long cls_id;
+ /** major error ID */
+ public long maj_num;
+ /** minor error number */
+ public long min_num;
+ /** line in file where error occurs */
+ public int line;
+ /** function in which error occurred */
+ public String func_name;
+ /** file in which error occurred */
+ public String file_name;
+ /** optional supplied description */
+ public String desc;
H5E_error2_t(long cls_id, long maj_num, long min_num, int line, String func_name, String file_name, String desc) {
this.cls_id = cls_id;
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
index 26690ec..95a9254 100644
--- a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
@@ -1,15 +1,14 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only HDFS Virtual File Driver (VFD) *
- * Copyright (c) 2018, The HDF Group. *
+ * Copyright by The HDF Group. *
* *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.structs;
@@ -26,15 +25,31 @@ import java.io.Serializable;
public class H5FD_hdfs_fapl_t implements Serializable {
private static final long serialVersionUID = 2072473407027648309L;
+ /** Version number of the H5FD_hdfs_fapl_t structure. */
private int version;
+ /** Name of "Name Node" to access as the HDFS server. */
private String namenode_name;
+ /** Port number to use to connect with Name Node. */
private int namenode_port;
+ /** Username to use when accessing file. */
private String user_name;
+ /** Path to the location of the Kerberos authentication cache. */
private String kerberos_ticket_cache;
+ /** Size (in bytes) of the file read stream buffer. */
private int stream_buffer_size;
- /*
+ /**
* Create a fapl_t structure with the specified components.
+ * @param namenode_name
+ * Name of "Name Node" to access as the HDFS server.
+ * @param namenode_port
+ * Port number to use to connect with Name Node.
+ * @param user_name
+ * Username to use when accessing file.
+ * @param kerberos_ticket_cache
+ * Path to the location of the Kerberos authentication cache.
+ * @param stream_buffer_size
+ * Size (in bytes) of the file read stream buffer.
*/
public H5FD_hdfs_fapl_t(
String namenode_name,
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
index 735cc7e..ad02979 100644
--- a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
@@ -1,15 +1,14 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only S3 Virtual File Driver (VFD) *
- * Copyright (c) 2017-2018, The HDF Group. *
+ * Copyright by The HDF Group. *
* *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.structs;
@@ -46,10 +45,15 @@ import java.io.Serializable;
public class H5FD_ros3_fapl_t implements Serializable {
private static final long serialVersionUID = 8985533001471224030L;
+ /** Version number of the H5FD_ros3_fapl_t structure */
private int version;
+ /** Flag TRUE or FALSE whether or not requests are to be authenticated with the AWS4 algorithm. */
private boolean authenticate;
+ /** region "aws region" for authenticating request */
private String aws_region;
+ /** id "secret id" or "access id" for authenticating request */
private String secret_id;
+ /** key "secret key" or "access key" for authenticating request */
private String secret_key;
/**
diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
index bb87201..f951bb4 100644
--- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
@@ -20,16 +20,37 @@ import java.io.Serializable;
*/
public class H5F_info2_t implements Serializable{
private static final long serialVersionUID = 4691681162544054518L;
- public int super_version; // Superblock version #
- public long super_size; // Superblock size
- public long super_ext_size; // Superblock extension size
- public int free_version; // Version # of file free space management
- public long free_meta_size; // Free space manager metadata size
- public long free_tot_space; // Amount of free space in the file
- public int sohm_version; // Version # of shared object header info
- public long sohm_hdr_size; // Shared object header message header size
- public H5_ih_info_t sohm_msgs_info; // Shared object header message index & heap size
+ /** Superblock version number */
+ public int super_version;
+ /** Superblock size */
+ public long super_size;
+ /** Superblock extension size */
+ public long super_ext_size;
+ /** Version number of file free space management */
+ public int free_version;
+ /** Free space manager metadata size */
+ public long free_meta_size;
+ /** Amount of free space in the file */
+ public long free_tot_space;
+ /** Version number of shared object header info */
+ public int sohm_version;
+ /** Shared object header message header size */
+ public long sohm_hdr_size;
+ /** Shared object header message index and heap size */
+ public H5_ih_info_t sohm_msgs_info;
+ /**
+ * Constructor fot current "global" information about file
+ * @param super_version: Superblock version number
+ * @param super_size: Superblock size
+ * @param super_ext_size: Superblock extension size
+ * @param free_version: Version number of file free space management
+ * @param free_meta_size: Free space manager metadata size
+ * @param free_tot_space: Amount of free space in the file
+ * @param sohm_version: Version number of shared object header info
+ * @param sohm_hdr_size: Shared object header message header size
+ * @param sohm_msgs_info: Shared object header message index and heap size
+ */
public H5F_info2_t (int super_version, long super_size, long super_ext_size,
int free_version, long free_meta_size, long free_tot_space,
int sohm_version, long sohm_hdr_size, H5_ih_info_t sohm_msgs_info)
diff --git a/java/src/hdf/hdf5lib/structs/H5G_info_t.java b/java/src/hdf/hdf5lib/structs/H5G_info_t.java
index 6d4f405..e79f859 100644
--- a/java/src/hdf/hdf5lib/structs/H5G_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5G_info_t.java
@@ -20,8 +20,12 @@ import java.io.Serializable;
*/
public class H5G_info_t implements Serializable{
private static final long serialVersionUID = -3746463015312132912L;
- public int storage_type; // Type of storage for links in group
- public long nlinks; // Number of links in group
- public long max_corder; // Current max. creation order value for group
- public boolean mounted; // Whether group has a file mounted on it
+ /** Type of storage for links in group */
+ public int storage_type;
+ /** Number of links in group */
+ public long nlinks;
+ /** Current max. creation order value for group */
+ public long max_corder;
+ /** Whether group has a file mounted on it */
+ public boolean mounted;
}
diff --git a/java/src/hdf/hdf5lib/structs/H5L_info_t.java b/java/src/hdf/hdf5lib/structs/H5L_info_t.java
index eaf0da5..a3011c0 100644
--- a/java/src/hdf/hdf5lib/structs/H5L_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5L_info_t.java
@@ -22,14 +22,20 @@ import hdf.hdf5lib.HDF5Constants;
*/
public class H5L_info_t implements Serializable {
private static final long serialVersionUID = -4754320605310155033L;
+ /** Type of link */
public int type;
+ /** Indicate if creation order is valid */
public boolean corder_valid;
+ /** Creation order */
public long corder;
+ /** Character set of link name */
public int cset;
+ /** Character set of link name */
public H5O_token_t token;
+ /** Size of a soft link or user-defined link value */
public long val_size;
- // Constructor for using object token portion of C union
+ /** Constructor for using object token portion of C union */
H5L_info_t (int type, boolean corder_valid, long corder,
int cset, H5O_token_t token)
{
@@ -41,7 +47,7 @@ public class H5L_info_t implements Serializable {
this.val_size = -1;
}
- // Constructor for using val_size portion of C union
+ /** Constructor for using val_size portion of C union */
H5L_info_t (int type, boolean corder_valid, long corder,
int cset, long val_size)
{
diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
index 9a1749d..2475dd9 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
@@ -20,16 +20,26 @@ import java.io.Serializable;
*/
public class H5O_hdr_info_t implements Serializable {
private static final long serialVersionUID = 7883826382952577189L;
- public int version; /* Version number of header format in file */
- public int nmesgs; /* Number of object header messages */
- public int nchunks; /* Number of object header chunks */
- public int flags; /* Object header status flags */
- public long space_total; /* Total space for storing object header in file */
- public long space_meta; /* Space within header for object header metadata information */
- public long space_mesg; /* Space within header for actual message information */
- public long space_free; /* Free space within object header */
- public long mesg_present; /* Flags to indicate presence of message type in header */
- public long mesg_shared; /* Flags to indicate message type is shared in header */
+ /** Version number of header format in file */
+ public int version;
+ /** Number of object header messages */
+ public int nmesgs;
+ /** Number of object header chunks */
+ public int nchunks;
+ /** Object header status flags */
+ public int flags;
+ /** Total space for storing object header in file */
+ public long space_total;
+ /** Space within header for object header metadata information */
+ public long space_meta;
+ /** Space within header for actual message information */
+ public long space_mesg;
+ /** Free space within object header */
+ public long space_free;
+ /** Flags to indicate presence of message type in header */
+ public long mesg_present;
+ /** Flags to indicate message type is shared in header */
+ public long mesg_shared;
H5O_hdr_info_t (int version, int nmesgs, int nchunks, int flags,
long space_total, long space_meta, long space_mesg, long space_free,
diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
index cc94247..d2208d2 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
@@ -20,16 +20,37 @@ import java.io.Serializable;
*/
public class H5O_info_t implements Serializable {
private static final long serialVersionUID = 4691681163544054518L;
- public long fileno; /* File number that object is located in */
- public H5O_token_t token; /* Object token in file */
- public int type; /* Basic object type (group, dataset, etc.) */
- public int rc; /* Reference count of object */
- public long atime; /* Access time */
- public long mtime; /* Modification time */
- public long ctime; /* Change time */
- public long btime; /* Birth time */
- public long num_attrs; /* # of attributes attached to object */
+ /** File number that object is located in */
+ public long fileno;
+ /** Object token in file */
+ public H5O_token_t token;
+ /** Basic object type (group, dataset, etc.) */
+ public int type;
+ /** Reference count of object */
+ public int rc;
+ /** Access time */
+ public long atime;
+ /** Modification time */
+ public long mtime;
+ /** Change time */
+ public long ctime;
+ /** Birth time */
+ public long btime;
+ /** Number of attributes attached to object */
+ public long num_attrs;
+ /** Constructor for data model information struct for objects
+ *
+ * @param fileno: File number that object is located in
+ * @param token: Object token in file
+ * @param type: Basic object type
+ * @param rc: Reference count of object
+ * @param atime: Access time
+ * @param mtime: Modification time
+ * @param ctime: Change time
+ * @param btime: Birth time
+ * @param num_attrs: Number of attributes attached to object
+ */
public H5O_info_t (long fileno, H5O_token_t token, int type,
int rc, long atime, long mtime, long ctime, long btime, long num_attrs)
{
diff --git a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
index ff801e8..70e5231 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
@@ -20,12 +20,14 @@ import java.io.Serializable;
*/
public class H5O_native_info_t implements Serializable {
private static final long serialVersionUID = 7883826382952577189L;
-
- public H5O_hdr_info_t hdr_info; /* Object header information */
+ /** Object header information */
+ public H5O_hdr_info_t hdr_info;
/* Extra metadata storage for obj & attributes */
- public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
- public H5_ih_info_t attr_info; /* v2 B-tree & heap for attributes */
+ /** v1/v2 B-tree and local/fractal heap for groups, B-tree for chunked datasets */
+ public H5_ih_info_t obj_info;
+ /** v2 B-tree and heap for attributes */
+ public H5_ih_info_t attr_info;
H5O_native_info_t (H5O_hdr_info_t oheader_info, H5_ih_info_t obj_info, H5_ih_info_t attr_info)
{
diff --git a/java/src/hdf/hdf5lib/structs/H5O_token_t.java b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
index c7ac437..f0bb978 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_token_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
@@ -23,12 +23,22 @@ import hdf.hdf5lib.HDF5Constants;
*/
public class H5O_token_t implements Serializable {
private static final long serialVersionUID = -4754320605310155032L;
+ /**
+ * Tokens are unique and permanent identifiers that are
+ * used to reference HDF5 objects in a container.
+ * Use basic byte array to store the dat
+ */
public byte[] data;
H5O_token_t (byte[] data) {
this.data = data;
}
+ /**
+ * Check if token data is undefined
+ *
+ * @return true if token data is undefined
+ */
public boolean isUndefined() {
return this.equals(HDF5Constants.H5O_TOKEN_UNDEF);
}
diff --git a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
index eec50c2..0c6111b 100644
--- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
@@ -20,9 +20,9 @@ import java.io.Serializable;
*/
public class H5_ih_info_t implements Serializable {
private static final long serialVersionUID = -142238015615462707L;
- /** */
- public long index_size; /* btree and/or list */
- /** */
+ /** btree and/or list size of index */
+ public long index_size;
+ /** btree and/or list size of hp */
public long heap_size;
H5_ih_info_t (long index_size, long heap_size)
diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h
index 72edf4c..38469df 100644
--- a/java/src/jni/exceptionImp.h
+++ b/java/src/jni/exceptionImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_exception */
-#ifndef _Included_hdf_hdf5lib_H5_exception
-#define _Included_hdf_hdf5lib_H5_exception
+#ifndef Included_hdf_hdf5lib_H5_exception
+#define Included_hdf_hdf5lib_H5_exception
#ifdef __cplusplus
extern "C" {
@@ -67,4 +67,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMi
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_exception */
+#endif /* Included_hdf_hdf5lib_H5_exception */
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index 7354e95..bdffdbd 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -26,8 +26,8 @@ extern "C" {
#include <stdlib.h>
#include "h5jni.h"
-H5_GCC_DIAG_OFF("missing-prototypes")
-H5_GCC_DIAG_OFF("unused-parameter")
+H5_GCC_CLANG_DIAG_OFF("missing-prototypes")
+H5_GCC_CLANG_DIAG_OFF("unused-parameter")
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls)
@@ -1212,7 +1212,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1FAIL(JNIEnv *env, jclass cls)
}
/* Java does not have unsigned native types */
-H5_GCC_DIAG_OFF("sign-conversion")
+H5_GCC_CLANG_DIAG_OFF("sign-conversion")
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1CREAT(JNIEnv *env, jclass cls)
{
@@ -1253,7 +1253,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1WRITE(JNIEnv *env, jclass cls)
{
return H5F_ACC_SWMR_WRITE;
}
-H5_GCC_DIAG_ON("sign-conversion")
+H5_GCC_CLANG_DIAG_ON("sign-conversion")
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls)
@@ -3724,8 +3724,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ALL(JNIEnv *env, jclass cls)
return H5Z_FILTER_ALL;
}
-H5_GCC_DIAG_ON("missing-prototypes")
-H5_GCC_DIAG_ON("unused-parameter")
+H5_GCC_CLANG_DIAG_ON("missing-prototypes")
+H5_GCC_CLANG_DIAG_ON("unused-parameter")
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/src/jni/h5Imp.h b/java/src/jni/h5Imp.h
index 776f295..8ab7662 100644
--- a/java/src/jni/h5Imp.h
+++ b/java/src/jni/h5Imp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5 */
-#ifndef _Included_hdf_hdf5lib_H5_H5
-#define _Included_hdf_hdf5lib_H5_H5
+#ifndef Included_hdf_hdf5lib_H5_H5
+#define Included_hdf_hdf5lib_H5_H5
#ifdef __cplusplus
extern "C" {
@@ -82,4 +82,4 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5is_1library_1threadsafe(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5 */
+#endif /* Included_hdf_hdf5lib_H5_H5 */
diff --git a/java/src/jni/h5aImp.h b/java/src/jni/h5aImp.h
index 3d9a230..aee0e40 100644
--- a/java/src/jni/h5aImp.h
+++ b/java/src/jni/h5aImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5A */
-#ifndef _Included_hdf_hdf5lib_H5_H5A
-#define _Included_hdf_hdf5lib_H5_H5A
+#ifndef Included_hdf_hdf5lib_H5_H5A
+#define Included_hdf_hdf5lib_H5_H5A
#ifdef __cplusplus
extern "C" {
@@ -375,4 +375,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Aiterate_1by_1name(JNIEnv *, jclass
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5A */
+#endif /* Included_hdf_hdf5lib_H5_H5A */
diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h
index 61dfeaa..e339dad 100644
--- a/java/src/jni/h5dImp.h
+++ b/java/src/jni/h5dImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5D */
-#ifndef _Included_hdf_hdf5lib_H5_H5D
-#define _Included_hdf_hdf5lib_H5_H5D
+#ifndef Included_hdf_hdf5lib_H5_H5D
+#define Included_hdf_hdf5lib_H5_H5D
#ifdef __cplusplus
extern "C" {
@@ -322,4 +322,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Drefresh(JNIEnv *, jclass, jlong);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5D */
+#endif /* Included_hdf_hdf5lib_H5_H5D */
diff --git a/java/src/jni/h5eImp.h b/java/src/jni/h5eImp.h
index 3133ca9..95e43fa 100644
--- a/java/src/jni/h5eImp.h
+++ b/java/src/jni/h5eImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5E */
-#ifndef _Included_hdf_hdf5lib_H5_H5E
-#define _Included_hdf_hdf5lib_H5_H5E
+#ifndef Included_hdf_hdf5lib_H5_H5E
+#define Included_hdf_hdf5lib_H5_H5E
#ifdef __cplusplus
extern "C" {
@@ -144,4 +144,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Ewalk2(JNIEnv *, jclass, jlong, jlo
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5E */
+#endif /* Included_hdf_hdf5lib_H5_H5E */
diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h
index d7e3ded..bf2f199 100644
--- a/java/src/jni/h5fImp.h
+++ b/java/src/jni/h5fImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5F */
-#ifndef _Included_hdf_hdf5lib_H5_H5F
-#define _Included_hdf_hdf5lib_H5_H5F
+#ifndef Included_hdf_hdf5lib_H5_H5F
+#define Included_hdf_hdf5lib_H5_H5F
#ifdef __cplusplus
extern "C" {
@@ -236,4 +236,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fset_1libver_1bounds(JNIEnv *, jcla
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5F */
+#endif /* Included_hdf_hdf5lib_H5_H5F */
diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h
index 4b0cb4d..b7130ed 100644
--- a/java/src/jni/h5gImp.h
+++ b/java/src/jni/h5gImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5G */
-#ifndef _Included_hdf_hdf5lib_H5_H5G
-#define _Included_hdf_hdf5lib_H5_H5G
+#ifndef Included_hdf_hdf5lib_H5_H5G
+#define Included_hdf_hdf5lib_H5_H5G
#ifdef __cplusplus
extern "C" {
@@ -96,4 +96,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Grefresh(JNIEnv *, jclass, jlong);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5G */
+#endif /* Included_hdf_hdf5lib_H5_H5G */
diff --git a/java/src/jni/h5iImp.h b/java/src/jni/h5iImp.h
index ed54303..08d5fa1 100644
--- a/java/src/jni/h5iImp.h
+++ b/java/src/jni/h5iImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5I */
-#ifndef _Included_hdf_hdf5lib_H5_H5I
-#define _Included_hdf_hdf5lib_H5_H5I
+#ifndef Included_hdf_hdf5lib_H5_H5I
+#define Included_hdf_hdf5lib_H5_H5I
#ifdef __cplusplus
extern "C" {
@@ -130,4 +130,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Idestroy_1type(JNIEnv *, jclass, ji
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5I */
+#endif /* Included_hdf_hdf5lib_H5_H5I */
diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h
index 2ec30da..2c93846 100644
--- a/java/src/jni/h5jni.h
+++ b/java/src/jni/h5jni.h
@@ -21,8 +21,8 @@
#include <string.h>
#include "H5private.h"
-#ifndef _Included_h5jni
-#define _Included_h5jni
+#ifndef Included_h5jni
+#define Included_h5jni
#ifdef __cplusplus
#define ENVPTR (env)
@@ -344,4 +344,4 @@ extern jobject create_H5O_token_t(JNIEnv *env, const H5O_token_t *token, hbool_t
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_h5jni */
+#endif /* Included_h5jni */
diff --git a/java/src/jni/h5lImp.h b/java/src/jni/h5lImp.h
index 134ed17..85aff03 100644
--- a/java/src/jni/h5lImp.h
+++ b/java/src/jni/h5lImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5_H5L */
-#ifndef _Included_hdf_hdf5lib_H5_H5L
-#define _Included_hdf_hdf5lib_H5_H5L
+#ifndef Included_hdf_hdf5lib_H5_H5L
+#define Included_hdf_hdf5lib_H5_H5L
#ifdef __cplusplus
extern "C" {
@@ -170,4 +170,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Lunregister(JNIEnv *, jclass, jint)
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5L */
+#endif /* Included_hdf_hdf5lib_H5_H5L */
diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h
index 2abb0d9..a7d7f31 100644
--- a/java/src/jni/h5oImp.h
+++ b/java/src/jni/h5oImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5_H5O */
-#ifndef _Included_hdf_hdf5lib_H5_H5O
-#define _Included_hdf_hdf5lib_H5_H5O
+#ifndef Included_hdf_hdf5lib_H5_H5O
+#define Included_hdf_hdf5lib_H5_H5O
#ifdef __cplusplus
extern "C" {
@@ -217,4 +217,4 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled(JN
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5O */
+#endif /* Included_hdf_hdf5lib_H5_H5O */
diff --git a/java/src/jni/h5pACPLImp.h b/java/src/jni/h5pACPLImp.h
index 8d9bf7d..15fcf33 100644
--- a/java/src/jni/h5pACPLImp.h
+++ b/java/src/jni/h5pACPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PACPL
-#define _Included_hdf_hdf5lib_H5_H5PACPL
+#ifndef Included_hdf_hdf5lib_H5_H5PACPL
+#define Included_hdf_hdf5lib_H5_H5PACPL
#include <jni.h>
@@ -23,4 +23,4 @@ extern "C" {
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PACPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PACPL */
diff --git a/java/src/jni/h5pDAPLImp.h b/java/src/jni/h5pDAPLImp.h
index 353f652..bf11fef 100644
--- a/java/src/jni/h5pDAPLImp.h
+++ b/java/src/jni/h5pDAPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PDAPL
-#define _Included_hdf_hdf5lib_H5_H5PDAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PDAPL
+#define Included_hdf_hdf5lib_H5_H5PDAPL
#include <jni.h>
@@ -93,4 +93,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PDAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PDAPL */
diff --git a/java/src/jni/h5pDCPLImp.h b/java/src/jni/h5pDCPLImp.h
index 302019f..46d1cc3 100644
--- a/java/src/jni/h5pDCPLImp.h
+++ b/java/src/jni/h5pDCPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PDCPL
-#define _Included_hdf_hdf5lib_H5_H5PDCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PDCPL
+#define Included_hdf_hdf5lib_H5_H5PDCPL
#include <jni.h>
@@ -320,4 +320,4 @@ JNIEXPORT jstring JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix(JNIEnv *,
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PDCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PDCPL */
diff --git a/java/src/jni/h5pDXPLImp.h b/java/src/jni/h5pDXPLImp.h
index 250c3f8..21c40c4 100644
--- a/java/src/jni/h5pDXPLImp.h
+++ b/java/src/jni/h5pDXPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PDXPL
-#define _Included_hdf_hdf5lib_H5_H5PDXPL
+#ifndef Included_hdf_hdf5lib_H5_H5PDXPL
+#define Included_hdf_hdf5lib_H5_H5PDXPL
#include <jni.h>
@@ -181,4 +181,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1btree_1ratios(JNIEnv *, jclas
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PDXPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PDXPL */
diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h
index 4bb48e2..3c5988f 100644
--- a/java/src/jni/h5pFAPLImp.h
+++ b/java/src/jni/h5pFAPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PFAPL
-#define _Included_hdf_hdf5lib_H5_H5PFAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PFAPL
+#define Included_hdf_hdf5lib_H5_H5PFAPL
#include <jni.h>
@@ -476,4 +476,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1libver_1bounds(JNIEnv *, jcla
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PFAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PFAPL */
diff --git a/java/src/jni/h5pFCPLImp.h b/java/src/jni/h5pFCPLImp.h
index 0fe3944..94411d6 100644
--- a/java/src/jni/h5pFCPLImp.h
+++ b/java/src/jni/h5pFCPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PFCPL
-#define _Included_hdf_hdf5lib_H5_H5PFCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PFCPL
+#define Included_hdf_hdf5lib_H5_H5PFCPL
#include <jni.h>
@@ -170,4 +170,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1phase_1change(J
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PFCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PFCPL */
diff --git a/java/src/jni/h5pGAPLImp.h b/java/src/jni/h5pGAPLImp.h
index 478402a..9091ff8 100644
--- a/java/src/jni/h5pGAPLImp.h
+++ b/java/src/jni/h5pGAPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PGAPL
-#define _Included_hdf_hdf5lib_H5_H5PGAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PGAPL
+#define Included_hdf_hdf5lib_H5_H5PGAPL
#include <jni.h>
@@ -23,4 +23,4 @@ extern "C" {
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PGAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PGAPL */
diff --git a/java/src/jni/h5pGCPLImp.h b/java/src/jni/h5pGCPLImp.h
index 6a40908..5090c3a 100644
--- a/java/src/jni/h5pGCPLImp.h
+++ b/java/src/jni/h5pGCPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PGCPL
-#define _Included_hdf_hdf5lib_H5_H5PGCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PGCPL
+#define Included_hdf_hdf5lib_H5_H5PGCPL
#include <jni.h>
@@ -79,4 +79,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1link_1phase_1change(JNIEnv *,
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PGCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PGCPL */
diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h
index b80ce46..189e9d7 100644
--- a/java/src/jni/h5pImp.h
+++ b/java/src/jni/h5pImp.h
@@ -12,8 +12,8 @@
/* Header for class hdf_hdf5lib_H5_H5_H5P */
-#ifndef _Included_hdf_hdf5lib_H5_H5P
-#define _Included_hdf_hdf5lib_H5_H5P
+#ifndef Included_hdf_hdf5lib_H5_H5P
+#define Included_hdf_hdf5lib_H5_H5P
#include <jni.h>
@@ -210,4 +210,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5__1H5Pclose_1class(JNIEnv *, jclass, j
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5P */
+#endif /* Included_hdf_hdf5lib_H5_H5P */
diff --git a/java/src/jni/h5pLAPLImp.h b/java/src/jni/h5pLAPLImp.h
index 46adc0c..8ddc8d2 100644
--- a/java/src/jni/h5pLAPLImp.h
+++ b/java/src/jni/h5pLAPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PLAPL
-#define _Included_hdf_hdf5lib_H5_H5PLAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PLAPL
+#define Included_hdf_hdf5lib_H5_H5PLAPL
#include <jni.h>
@@ -87,4 +87,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1elink_1acc_1flags(JNIEnv *, j
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PLAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PLAPL */
diff --git a/java/src/jni/h5pLCPLImp.h b/java/src/jni/h5pLCPLImp.h
index 7601adb..4cdf6cd 100644
--- a/java/src/jni/h5pLCPLImp.h
+++ b/java/src/jni/h5pLCPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PLCPL
-#define _Included_hdf_hdf5lib_H5_H5PLCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PLCPL
+#define Included_hdf_hdf5lib_H5_H5PLCPL
#include <jni.h>
@@ -23,4 +23,4 @@ extern "C" {
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PLCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PLCPL */
diff --git a/java/src/jni/h5pOCPLImp.h b/java/src/jni/h5pOCPLImp.h
index c16f1be..94d397b 100644
--- a/java/src/jni/h5pOCPLImp.h
+++ b/java/src/jni/h5pOCPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5POCPL
-#define _Included_hdf_hdf5lib_H5_H5POCPL
+#ifndef Included_hdf_hdf5lib_H5_H5POCPL
+#define Included_hdf_hdf5lib_H5_H5POCPL
#include <jni.h>
@@ -80,4 +80,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1attr_1creation_1order(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5POCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5POCPL */
diff --git a/java/src/jni/h5pOCpyPLImp.h b/java/src/jni/h5pOCpyPLImp.h
index d8682cb..50ee972 100644
--- a/java/src/jni/h5pOCpyPLImp.h
+++ b/java/src/jni/h5pOCpyPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5POCpyPL
-#define _Included_hdf_hdf5lib_H5_H5POCpyPL
+#ifndef Included_hdf_hdf5lib_H5_H5POCpyPL
+#define Included_hdf_hdf5lib_H5_H5POCpyPL
#include <jni.h>
@@ -53,4 +53,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1copy_1object(JNIEnv *, jclass
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5POCpyPL */
+#endif /* Included_hdf_hdf5lib_H5_H5POCpyPL */
diff --git a/java/src/jni/h5pStrCPLImp.h b/java/src/jni/h5pStrCPLImp.h
index 8a56494..c0a7ec2 100644
--- a/java/src/jni/h5pStrCPLImp.h
+++ b/java/src/jni/h5pStrCPLImp.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PStrCPL
-#define _Included_hdf_hdf5lib_H5_H5PStrCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PStrCPL
+#define Included_hdf_hdf5lib_H5_H5PStrCPL
#include <jni.h>
@@ -37,4 +37,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1char_1encoding(JNIEnv *, jcla
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PStrCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PStrCPL */
diff --git a/java/src/jni/h5plImp.h b/java/src/jni/h5plImp.h
index b809efa..410a34f 100644
--- a/java/src/jni/h5plImp.h
+++ b/java/src/jni/h5plImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5PL */
-#ifndef _Included_hdf_hdf5lib_H5_H5PL
-#define _Included_hdf_hdf5lib_H5_H5PL
+#ifndef Included_hdf_hdf5lib_H5_H5PL
+#define Included_hdf_hdf5lib_H5_H5PL
#ifdef __cplusplus
extern "C" {
@@ -87,4 +87,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5PLsize(JNIEnv *, jclass);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PL */
+#endif /* Included_hdf_hdf5lib_H5_H5PL */
diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c
index c08f5de..9fe0701 100644
--- a/java/src/jni/h5rImp.c
+++ b/java/src/jni/h5rImp.c
@@ -336,7 +336,7 @@ done:
* Signature: ([BJJ)J
*/
JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_H5_H5Ropen_1object(JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong oapl_id)
+Java_hdf_hdf5lib_H5__1H5Ropen_1object(JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong oapl_id)
{
jboolean isCopy;
jbyte * refBuf = NULL;
@@ -371,7 +371,7 @@ done:
* Signature: ([BJJ)J
*/
JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_H5_H5Ropen_1region(JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong oapl_id)
+Java_hdf_hdf5lib_H5__1H5Ropen_1region(JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong oapl_id)
{
jboolean isCopy;
jbyte * refBuf = NULL;
@@ -406,7 +406,7 @@ done:
* Signature: ([BJJ)J
*/
JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_H5_H5Ropen_1attr(JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong aapl_id)
+Java_hdf_hdf5lib_H5__1H5Ropen_1attr(JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong aapl_id)
{
jboolean isCopy;
jbyte * refBuf = NULL;
diff --git a/java/src/jni/h5rImp.h b/java/src/jni/h5rImp.h
index 582b837..ffd7737 100644
--- a/java/src/jni/h5rImp.h
+++ b/java/src/jni/h5rImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5R */
-#ifndef _Included_hdf_hdf5lib_H5_H5R
-#define _Included_hdf_hdf5lib_H5_H5R
+#ifndef Included_hdf_hdf5lib_H5_H5R
+#define Included_hdf_hdf5lib_H5_H5R
#ifdef __cplusplus
extern "C" {
@@ -78,21 +78,21 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_H5_H5Rcopy(JNIEnv *, jclass, jbyte
* Method: H5Ropen_object
* Signature: ([BJJ)J
*/
-JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Ropen_1object(JNIEnv *, jclass, jbyteArray, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5__1H5Ropen_1object(JNIEnv *, jclass, jbyteArray, jlong, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Ropen_region
* Signature: ([BJJ)J
*/
-JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Ropen_1region(JNIEnv *, jclass, jbyteArray, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5__1H5Ropen_1region(JNIEnv *, jclass, jbyteArray, jlong, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Ropen_attr
* Signature: ([BJJ)J
*/
-JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Ropen_1attr(JNIEnv *, jclass, jbyteArray, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5__1H5Ropen_1attr(JNIEnv *, jclass, jbyteArray, jlong, jlong);
/*
* Class: hdf_hdf5lib_H5
@@ -174,4 +174,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Rget_1name(JNIEnv *, jclass, jlong
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5R */
+#endif /* Included_hdf_hdf5lib_H5_H5R */
diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h
index 1ceaf3f..a758d5a 100644
--- a/java/src/jni/h5sImp.h
+++ b/java/src/jni/h5sImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5S */
-#ifndef _Included_hdf_hdf5lib_H5_H5S
-#define _Included_hdf_hdf5lib_H5_H5S
+#ifndef Included_hdf_hdf5lib_H5_H5S
+#define Included_hdf_hdf5lib_H5_H5S
#ifdef __cplusplus
extern "C" {
@@ -321,4 +321,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *, jclass,
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5S */
+#endif /* Included_hdf_hdf5lib_H5_H5S */
diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h
index 3faeb00..e671456 100644
--- a/java/src/jni/h5tImp.h
+++ b/java/src/jni/h5tImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5T */
-#ifndef _Included_hdf_hdf5lib_H5_H5T
-#define _Included_hdf_hdf5lib_H5_H5T
+#ifndef Included_hdf_hdf5lib_H5_H5T
+#define Included_hdf_hdf5lib_H5_H5T
#ifdef __cplusplus
extern "C" {
@@ -505,4 +505,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Trefresh(JNIEnv *, jclass, jlong);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5T */
+#endif /* Included_hdf_hdf5lib_H5_H5T */
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 2e02e4d..4272205 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -52,6 +52,8 @@ void * edata;
/* Local Prototypes */
/********************/
+int h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expand_data);
+
static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj,
int expand_data);
static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj,
@@ -223,7 +225,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(float): {
float tmp_float = 0.0f;
- sscanf(token, "%f", &tmp_float);
+ HDsscanf(token, "%f", &tmp_float);
HDmemcpy(cptr, &tmp_float, sizeof(float));
break;
}
@@ -231,7 +233,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(double): {
double tmp_double = 0.0;
- sscanf(token, "%lf", &tmp_double);
+ HDsscanf(token, "%lf", &tmp_double);
HDmemcpy(cptr, &tmp_double, sizeof(double));
break;
}
@@ -239,7 +241,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(long double): {
long double tmp_ldouble = 0.0;
- sscanf(token, "%Lg", &tmp_ldouble);
+ HDsscanf(token, "%Lg", &tmp_ldouble);
HDmemcpy(cptr, &tmp_ldouble, sizeof(long double));
break;
}
@@ -287,11 +289,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
signed char tmp_char = 0;
if (H5T_SGN_NONE == nsign) {
- sscanf(token, "%hhu", &tmp_uchar);
+ HDsscanf(token, "%hhu", &tmp_uchar);
HDmemcpy(cptr, &tmp_uchar, sizeof(unsigned char));
}
else {
- sscanf(token, "%hhd", &tmp_char);
+ HDsscanf(token, "%hhd", &tmp_char);
HDmemcpy(cptr, &tmp_char, sizeof(char));
}
@@ -303,11 +305,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
short tmp_short = 0;
if (H5T_SGN_NONE == nsign) {
- sscanf(token, "%hu", &tmp_ushort);
+ HDsscanf(token, "%hu", &tmp_ushort);
HDmemcpy(&tmp_ushort, cptr, sizeof(unsigned short));
}
else {
- sscanf(token, "%hd", &tmp_short);
+ HDsscanf(token, "%hd", &tmp_short);
HDmemcpy(&tmp_short, cptr, sizeof(short));
}
@@ -319,11 +321,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
int tmp_int = 0;
if (H5T_SGN_NONE == nsign) {
- sscanf(token, "%u", &tmp_uint);
+ HDsscanf(token, "%u", &tmp_uint);
HDmemcpy(cptr, &tmp_uint, sizeof(unsigned int));
}
else {
- sscanf(token, "%d", &tmp_int);
+ HDsscanf(token, "%d", &tmp_int);
HDmemcpy(cptr, &tmp_int, sizeof(int));
}
@@ -336,11 +338,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
long tmp_long = 0;
if (H5T_SGN_NONE == nsign) {
- sscanf(token, "%lu", &tmp_ulong);
+ HDsscanf(token, "%lu", &tmp_ulong);
HDmemcpy(cptr, &tmp_ulong, sizeof(unsigned long));
}
else {
- sscanf(token, "%ld", &tmp_long);
+ HDsscanf(token, "%ld", &tmp_long);
HDmemcpy(cptr, &tmp_long, sizeof(long));
}
@@ -353,11 +355,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
long long tmp_llong = 0;
if (H5T_SGN_NONE == nsign) {
- sscanf(token, fmt_ullong, &tmp_ullong);
+ HDsscanf(token, fmt_ullong, &tmp_ullong);
HDmemcpy(cptr, &tmp_ullong, sizeof(unsigned long long));
}
else {
- sscanf(token, fmt_llong, &tmp_llong);
+ HDsscanf(token, fmt_llong, &tmp_llong);
HDmemcpy(cptr, &tmp_llong, sizeof(long long));
}
@@ -868,11 +870,8 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
}
else {
if (typeSize > 0) {
- if (NULL == (this_str = (char *)HDmalloc(typeSize + 1)))
+ if (NULL == (this_str = HDstrdup(tmp_str)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
-
- HDstrncpy(this_str, tmp_str, typeSize);
- this_str[typeSize] = '\0';
}
}
@@ -1098,14 +1097,15 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
}
case H5T_REFERENCE: {
- if (H5Tequal(tid, H5T_STD_REF)) {
- hid_t new_obj_id = H5I_INVALID_HID;
- H5O_type_t obj_type = -1; /* Object type */
- H5R_type_t ref_type; /* Reference type */
+ /* H5T_STD_REF */
+ hid_t new_obj_id = H5I_INVALID_HID;
+ H5O_type_t obj_type = -1; /* Object type */
+ H5R_type_t ref_type; /* Reference type */
- H5R_ref_t *ref_vp = (H5R_ref_t *)cptr;
+ H5R_ref_t *ref_vp = (H5R_ref_t *)cptr;
- ref_type = H5Rget_type(ref_vp);
+ ref_type = H5Rget_type(ref_vp);
+ if (!h5str_is_zero(ref_vp, H5Tget_size(H5T_STD_REF))) {
switch (ref_type) {
case H5R_OBJECT1:
if (H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type) >= 0) {
@@ -1209,18 +1209,10 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
default:
break;
} /* end switch */
-
- if (H5Rdestroy(ref_vp) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
}
- else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
- /* (H5R_DSET_REG_REF_BUF_SIZE == typeSize) */
- H5_LIBRARY_ERROR(ENVONLY);
- }
- else if (H5Tequal(tid, H5T_STD_REF_OBJ)) {
- /* (H5R_OBJ_REF_BUF_SIZE == typeSize) */
+
+ if (H5Rdestroy(ref_vp) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- }
break;
}
@@ -1479,7 +1471,10 @@ h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t re
/*
* This function fails if the region does not have blocks.
*/
- H5E_BEGIN_TRY { nblocks = H5Sget_select_hyper_nblocks(region_space); }
+ H5E_BEGIN_TRY
+ {
+ nblocks = H5Sget_select_hyper_nblocks(region_space);
+ }
H5E_END_TRY;
if (nblocks <= 0) {
@@ -1652,7 +1647,10 @@ h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t re
/*
* This function fails if the region does not have points.
*/
- H5E_BEGIN_TRY { npoints = H5Sget_select_elem_npoints(region_space); }
+ H5E_BEGIN_TRY
+ {
+ npoints = H5Sget_select_elem_npoints(region_space);
+ }
H5E_END_TRY;
if (npoints <= 0) {
@@ -2240,39 +2238,31 @@ h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hs
}
case H5T_REFERENCE: {
- if (H5Tequal(tid, H5T_STD_REF)) {
- hid_t region_id = H5I_INVALID_HID;
- hid_t region_space = H5I_INVALID_HID;
- H5S_sel_type region_type;
-
- /* Region data */
- for (block_index = 0; block_index < block_nelmts; block_index++) {
- mem = ((unsigned char *)_mem) + block_index * size;
- if ((region_id = H5Ropen_object((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- continue;
- if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
- if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) {
- region_type = H5Sget_select_type(region_space);
- if (region_type == H5S_SEL_POINTS)
- ret_value = render_bin_output_region_points(stream, region_space, region_id,
- container);
- else if (region_type == H5S_SEL_HYPERSLABS)
- ret_value = render_bin_output_region_blocks(stream, region_space, region_id,
- container);
- }
- H5Sclose(region_space);
- } /* end if (region_space >= 0) */
- H5Dclose(region_id);
+ hid_t region_id = H5I_INVALID_HID;
+ hid_t region_space = H5I_INVALID_HID;
+ H5S_sel_type region_type;
- if (ret_value < 0)
- break;
- }
- }
- else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
- ;
- }
- else if (H5Tequal(tid, H5T_STD_REF_OBJ)) {
- ;
+ /* Region data */
+ for (block_index = 0; block_index < block_nelmts; block_index++) {
+ mem = ((unsigned char *)_mem) + block_index * size;
+ if ((region_id = H5Ropen_object((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ continue;
+ if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) {
+ region_type = H5Sget_select_type(region_space);
+ if (region_type == H5S_SEL_POINTS)
+ ret_value =
+ render_bin_output_region_points(stream, region_space, region_id, container);
+ else if (region_type == H5S_SEL_HYPERSLABS)
+ ret_value =
+ render_bin_output_region_blocks(stream, region_space, region_id, container);
+ }
+ H5Sclose(region_space);
+ } /* end if (region_space >= 0) */
+ H5Dclose(region_id);
+
+ if (ret_value < 0)
+ break;
}
break;
@@ -2762,11 +2752,11 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order)
size_t p_type_nbytes; /* size of memory type */
/* Stripmine info */
- unsigned char *sm_buf = NULL; /* buffer for raw data */
- hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */
- hsize_t sm_nbytes; /* bytes per stripmine */
- hsize_t sm_nelmts; /* elements per stripmine */
- hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */
+ void * sm_buf = NULL; /* buffer for raw data */
+ hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */
+ hsize_t sm_nbytes; /* bytes per stripmine */
+ hsize_t sm_nelmts; /* elements per stripmine */
+ hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */
/* Hyperslab info */
hsize_t hs_offset[H5S_MAX_RANK]; /* starting offset */
@@ -2786,142 +2776,168 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order)
if ((f_type = H5Dget_type(dset)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- switch (binary_order) {
- case 1: {
- if ((p_type = h5str_get_native_type(f_type)) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ if ((f_space = H5Dget_space(dset)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- break;
- }
+ if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- case 2: {
- if ((p_type = h5str_get_little_endian_type(f_type)) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- break;
- }
+ if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) {
+ p_nelmts = H5Sget_simple_extent_npoints(f_space);
+ if (NULL ==
+ (sm_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)p_nelmts)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf");
- case 3: {
- if ((p_type = h5str_get_big_endian_type(f_type)) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ /* Read the data */
+ if (H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- break;
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, dset, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
}
-
- default: {
- if ((p_type = H5Tcopy(f_type)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- break;
+ else {
+ if (h5str_render_bin_output(stream, dset, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
}
}
+ else {
+ switch (binary_order) {
+ case 1: {
+ if ((p_type = h5str_get_native_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if ((f_space = H5Dget_space(dset)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ break;
+ }
- if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ case 2: {
+ if ((p_type = h5str_get_little_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) {
- if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ break;
+ }
- /* Calculate the number of elements we're going to print */
- p_nelmts = 1;
+ case 3: {
+ if ((p_type = h5str_get_big_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if (ndims > 0) {
- for (i = 0; i < (size_t)ndims; i++)
- p_nelmts *= total_size[i];
- } /* end if */
+ break;
+ }
- if (p_nelmts > 0) {
- /* Check if we have VL data in the dataset's datatype */
- if (h5str_detect_vlen(p_type) != 0)
- vl_data = 1;
+ default: {
+ if ((p_type = H5Tcopy(f_type)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- /*
- * Determine the strip mine size and allocate a buffer. The strip mine is
- * a hyperslab whose size is manageable.
- */
- if (!(sm_nbytes = p_type_nbytes = H5Tget_size(p_type)))
+ break;
+ }
+ }
+
+ if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) {
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
H5_LIBRARY_ERROR(ENVONLY);
+ /* Calculate the number of elements we're going to print */
+ p_nelmts = 1;
+
if (ndims > 0) {
- for (i = (size_t)ndims; i > 0; --i) {
- hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes;
- if (size == 0) /* datum size > H5TOOLS_BUFSIZE */
- size = 1;
- sm_size[i - 1] = (((total_size[i - 1]) < (size)) ? (total_size[i - 1]) : (size));
- sm_nbytes *= sm_size[i - 1];
+ for (i = 0; i < (size_t)ndims; i++)
+ p_nelmts *= total_size[i];
+ } /* end if */
+
+ if (p_nelmts > 0) {
+ /* Check if we have VL data in the dataset's datatype */
+ if (h5str_detect_vlen(p_type) != 0)
+ vl_data = 1;
+
+ /*
+ * Determine the strip mine size and allocate a buffer. The strip mine is
+ * a hyperslab whose size is manageable.
+ */
+ if (!(sm_nbytes = p_type_nbytes = H5Tget_size(p_type)))
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (ndims > 0) {
+ for (i = (size_t)ndims; i > 0; --i) {
+ hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes;
+ if (size == 0) /* datum size > H5TOOLS_BUFSIZE */
+ size = 1;
+ sm_size[i - 1] = (((total_size[i - 1]) < (size)) ? (total_size[i - 1]) : (size));
+ sm_nbytes *= sm_size[i - 1];
+ }
}
- }
- if (sm_nbytes > 0) {
- if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf");
+ if (sm_nbytes > 0) {
+ if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf");
- sm_nelmts = sm_nbytes / p_type_nbytes;
+ sm_nelmts = sm_nbytes / p_type_nbytes;
- if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ /* The stripmine loop */
+ HDmemset(hs_offset, 0, sizeof hs_offset);
+ HDmemset(zero, 0, sizeof zero);
+
+ for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) {
+ /* Calculate the hyperslab size */
+ if (ndims > 0) {
+ for (i = 0, hs_nelmts = 1; i < (size_t)ndims; i++) {
+ hs_size[i] = (((total_size[i] - hs_offset[i]) < (sm_size[i]))
+ ? (total_size[i] - hs_offset[i])
+ : (sm_size[i]));
+ hs_nelmts *= hs_size[i];
+ }
+
+ if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) <
+ 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- /* The stripmine loop */
- HDmemset(hs_offset, 0, sizeof hs_offset);
- HDmemset(zero, 0, sizeof zero);
-
- for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) {
- /* Calculate the hyperslab size */
- if (ndims > 0) {
- for (i = 0, hs_nelmts = 1; i < (size_t)ndims; i++) {
- hs_size[i] = (((total_size[i] - hs_offset[i]) < (sm_size[i]))
- ? (total_size[i] - hs_offset[i])
- : (sm_size[i]));
- hs_nelmts *= hs_size[i];
+ if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) <
+ 0)
+ H5_LIBRARY_ERROR(ENVONLY);
}
+ else {
+ if (H5Sselect_all(f_space) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (H5Sselect_all(sm_space) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
- }
- else {
- if (H5Sselect_all(f_space) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ hs_nelmts = 1;
+ }
- if (H5Sselect_all(sm_space) < 0)
+ /* Read the data */
+ if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- hs_nelmts = 1;
- }
-
- /* Read the data */
- if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if (binary_order == 99) {
- if (h5str_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
- else {
- if (h5str_render_bin_output(stream, dset, p_type, sm_buf, hs_nelmts) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else {
+ if (h5str_render_bin_output(stream, dset, p_type, sm_buf, hs_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
- /* Reclaim any VL memory, if necessary */
- if (vl_data) {
- if (H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
- }
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data) {
+ if (H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
- /* Calculate the next hyperslab offset */
- for (i = (size_t)ndims, carry = 1; i > 0 && carry; --i) {
- hs_offset[i - 1] += hs_size[i - 1];
+ /* Calculate the next hyperslab offset */
+ for (i = (size_t)ndims, carry = 1; i > 0 && carry; --i) {
+ hs_offset[i - 1] += hs_size[i - 1];
- if (hs_offset[i - 1] == total_size[i - 1])
- hs_offset[i - 1] = 0;
- else
- carry = 0;
+ if (hs_offset[i - 1] == total_size[i - 1])
+ hs_offset[i - 1] = 0;
+ else
+ carry = 0;
+ }
}
}
}
@@ -2945,6 +2961,148 @@ done:
return ret_value;
} /* end h5str_dump_simple_dset */
+int
+h5str_dump_simple_mem(JNIEnv *env, FILE *stream, hid_t attr_id, int binary_order)
+{
+ hid_t f_space = H5I_INVALID_HID; /* file data space */
+ hsize_t alloc_size;
+ int ndims; /* rank of dataspace */
+ unsigned i; /* counters */
+ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
+ hsize_t p_nelmts; /* total selected elmts */
+
+ void * sm_buf = NULL; /* buffer for raw data */
+ hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */
+
+ int ret_value = 0;
+
+ /* VL data special information */
+ unsigned int vl_data = 0; /* contains VL datatypes */
+ hid_t p_type = H5I_INVALID_HID;
+ hid_t f_type = H5I_INVALID_HID;
+
+ if (attr_id < 0)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "h5str_dump_simple_mem: attr ID < 0");
+
+ if ((f_type = H5Aget_type(attr_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (H5I_INVALID_HID == (f_space = H5Aget_space(attr_id)))
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) {
+ p_nelmts = H5Sget_simple_extent_npoints(f_space);
+ if (NULL ==
+ (sm_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)p_nelmts)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf");
+
+ /* Read the data */
+ if (H5Aread(attr_id, H5T_STD_REF, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, attr_id, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else {
+ if (h5str_render_bin_output(stream, attr_id, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ }
+ else {
+ switch (binary_order) {
+ case 1: {
+ if ((p_type = h5str_get_native_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ break;
+ }
+
+ case 2: {
+ if ((p_type = h5str_get_little_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ break;
+ }
+
+ case 3: {
+ if ((p_type = h5str_get_big_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ break;
+ }
+
+ default: {
+ if ((p_type = H5Tcopy(f_type)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ break;
+ }
+ }
+
+ if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) {
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ /* Calculate the number of elements we're going to print */
+ p_nelmts = 1;
+
+ if (ndims > 0) {
+ for (i = 0; i < (size_t)ndims; i++)
+ p_nelmts *= total_size[i];
+ } /* end if */
+
+ if (p_nelmts > 0) {
+ /* Check if we have VL data in the dataset's datatype */
+ if (h5str_detect_vlen(p_type) != 0)
+ vl_data = 1;
+
+ alloc_size = p_nelmts * H5Tget_size(p_type);
+ if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)alloc_size)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf");
+
+ /* Read the data */
+ if (H5Aread(attr_id, p_type, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, attr_id, p_type, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else {
+ if (h5str_render_bin_output(stream, attr_id, p_type, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data) {
+ if (H5Treclaim(p_type, f_space, H5P_DEFAULT, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ }
+ }
+ }
+
+ ret_value = SUCCEED;
+
+done:
+ if (sm_buf)
+ HDfree(sm_buf);
+ if (f_space >= 0)
+ H5Sclose(f_space);
+ if (p_type >= 0)
+ H5Tclose(p_type);
+ if (f_type >= 0)
+ H5Tclose(f_type);
+
+ return ret_value;
+}
+
htri_t
H5Tdetect_variable_str(hid_t tid)
{
@@ -3007,7 +3165,6 @@ h5str_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, v
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
}
}
-
if (HDfprintf(stream, "%s", buffer.s) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
@@ -3504,19 +3661,14 @@ obj_info_all(hid_t loc_id, const char *name, const H5L_info2_t *info, void *op_d
info_all_t *datainfo = (info_all_t *)op_data;
H5O_info2_t object_info;
htri_t object_exists;
- size_t str_len;
datainfo->otype[datainfo->count] = -1;
datainfo->ltype[datainfo->count] = -1;
datainfo->obj_token[datainfo->count] = H5O_TOKEN_UNDEF;
- str_len = HDstrlen(name);
- if (NULL == (datainfo->objname[datainfo->count] = (char *)HDmalloc(str_len + 1)))
+ if (NULL == (datainfo->objname[datainfo->count] = HDstrdup(name)))
goto done;
- HDstrncpy(datainfo->objname[datainfo->count], name, str_len);
- (datainfo->objname[datainfo->count])[str_len] = '\0';
-
if ((object_exists = H5Oexists_by_name(loc_id, name, H5P_DEFAULT)) < 0)
goto done;
@@ -3542,7 +3694,6 @@ obj_info_max(hid_t loc_id, const char *name, const H5L_info2_t *info, void *op_d
{
info_all_t *datainfo = (info_all_t *)op_data;
H5O_info2_t object_info;
- size_t str_len;
datainfo->otype[datainfo->count] = -1;
datainfo->ltype[datainfo->count] = -1;
@@ -3550,13 +3701,9 @@ obj_info_max(hid_t loc_id, const char *name, const H5L_info2_t *info, void *op_d
datainfo->obj_token[datainfo->count] = H5O_TOKEN_UNDEF;
/* This will be freed by h5str_array_free(oName, n) */
- str_len = HDstrlen(name);
- if (NULL == (datainfo->objname[datainfo->count] = (char *)HDmalloc(str_len + 1)))
+ if (NULL == (datainfo->objname[datainfo->count] = HDstrdup(name)))
goto done;
- HDstrncpy(datainfo->objname[datainfo->count], name, str_len);
- (datainfo->objname[datainfo->count])[str_len] = '\0';
-
if (H5Oget_info3(loc_id, &object_info, H5O_INFO_ALL) < 0)
goto done;
@@ -3577,18 +3724,16 @@ done:
/*
* Class: hdf_hdf5lib_H5
* Method: H5export_dataset
- * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
*/
JNIEXPORT void JNICALL
-Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_export_name, jstring file_name,
+Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_export_name, jlong file_id,
jstring object_path, jint binary_order)
{
const char *file_export = NULL;
const char *object_name = NULL;
- const char *fileName = NULL;
jboolean isCopy;
herr_t ret_val = FAIL;
- hid_t file_id = H5I_INVALID_HID;
hid_t dataset_id = H5I_INVALID_HID;
FILE * stream = NULL;
@@ -3597,17 +3742,9 @@ Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_exp
if (NULL == file_export_name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_export_name is NULL");
- if (NULL == file_name)
- H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_name is NULL");
-
if (NULL == object_path)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: object_path is NULL");
- PIN_JAVA_STRING(ENVONLY, file_name, fileName, NULL, "H5export_dataset: file name not pinned");
-
- if ((file_id = H5Fopen(fileName, (unsigned)H5F_ACC_RDWR, (hid_t)H5P_DEFAULT)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
PIN_JAVA_STRING(ENVONLY, object_path, object_name, &isCopy, "H5export_dataset: object_path not pinned");
if ((dataset_id = H5Dopen2(file_id, object_name, H5P_DEFAULT)) < 0)
@@ -3634,14 +3771,65 @@ done:
UNPIN_JAVA_STRING(ENVONLY, file_export_name, file_export);
if (object_name)
UNPIN_JAVA_STRING(ENVONLY, object_path, object_name);
- if (fileName)
- UNPIN_JAVA_STRING(ENVONLY, file_name, fileName);
if (dataset_id >= 0)
H5Dclose(dataset_id);
- if (file_id >= 0)
- H5Fclose(file_id);
} /* end Java_hdf_hdf5lib_H5_H5export_1dataset */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5export_attribute
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5export_1attribute(JNIEnv *env, jclass clss, jstring file_export_name, jlong dset_id,
+ jstring attribute_name, jint binary_order)
+{
+ const char *file_export = NULL;
+ const char *object_name = NULL;
+ jboolean isCopy;
+ herr_t ret_val = FAIL;
+ hid_t attr_id = H5I_INVALID_HID;
+ FILE * stream = NULL;
+
+ UNUSED(clss);
+
+ if (NULL == file_export_name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_export_name is NULL");
+
+ if (NULL == attribute_name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: object_path is NULL");
+
+ PIN_JAVA_STRING(ENVONLY, attribute_name, object_name, &isCopy,
+ "H5export_dataset: object_path not pinned");
+
+ if ((attr_id = H5Aopen(dset_id, object_name, H5P_DEFAULT)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ PIN_JAVA_STRING(ENVONLY, file_export_name, file_export, NULL,
+ "H5export_dataset: file_export name not pinned");
+
+ if (NULL == (stream = HDfopen(file_export, "w+")))
+ H5_JNI_FATAL_ERROR(ENVONLY, "HDfopen failed");
+
+ if ((ret_val = h5str_dump_simple_mem(ENVONLY, stream, attr_id, binary_order)) < 0)
+ H5_ASSERTION_ERROR(ENVONLY, "h5str_dump_simple_dset failed");
+
+ if (stream) {
+ HDfclose(stream);
+ stream = NULL;
+ }
+
+done:
+ if (stream)
+ HDfclose(stream);
+ if (file_export)
+ UNPIN_JAVA_STRING(ENVONLY, file_export_name, file_export);
+ if (object_name)
+ UNPIN_JAVA_STRING(ENVONLY, attribute_name, object_name);
+ if (attr_id >= 0)
+ H5Aclose(attr_id);
+} /* end Java_hdf_hdf5lib_H5_H5export_1attribute */
+
#ifdef __cplusplus
}
#endif
diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h
index a5e9607..6c568e1 100644
--- a/java/src/jni/h5util.h
+++ b/java/src/jni/h5util.h
@@ -46,6 +46,7 @@ extern size_t h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_
int expand_data);
extern void h5str_array_free(char **strs, size_t len);
extern int h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order);
+extern int h5str_dump_simple_mem(JNIEnv *env, FILE *stream, hid_t attr, int binary_order);
extern htri_t H5Tdetect_variable_str(hid_t tid);
@@ -105,9 +106,16 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Gget_1obj_1info_1max(JNIEnv *, jcla
/*
* Class: hdf_hdf5lib_H5
* Method: H5export_dataset
- * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
*/
-JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *, jclass, jstring, jstring, jstring,
- jint);
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *, jclass, jstring, jlong, jstring, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5export_attribute
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1attribute(JNIEnv *, jclass, jstring, jlong, jstring,
+ jint);
#endif /* H5UTIL_H__ */
diff --git a/java/src/jni/h5vlImp.h b/java/src/jni/h5vlImp.h
index bf467af..a17807f 100644
--- a/java/src/jni/h5vlImp.h
+++ b/java/src/jni/h5vlImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5VL */
-#ifndef _Included_hdf_hdf5lib_H5_H5VL
-#define _Included_hdf_hdf5lib_H5_H5VL
+#ifndef Included_hdf_hdf5lib_H5_H5VL
+#define Included_hdf_hdf5lib_H5_H5VL
#ifdef __cplusplus
extern "C" {
@@ -97,4 +97,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5VLunregister_1connector(JNIEnv *, j
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5VL */
+#endif /* Included_hdf_hdf5lib_H5_H5VL */
diff --git a/java/src/jni/h5zImp.h b/java/src/jni/h5zImp.h
index 4e8982e..3092ae6 100644
--- a/java/src/jni/h5zImp.h
+++ b/java/src/jni/h5zImp.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5Z */
-#ifndef _Included_hdf_hdf5lib_H5_H5Z
-#define _Included_hdf_hdf5lib_H5_H5Z
+#ifndef Included_hdf_hdf5lib_H5_H5Z
+#define Included_hdf_hdf5lib_H5_H5Z
#ifdef __cplusplus
extern "C" {
@@ -46,4 +46,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Zget_1filter_1info(JNIEnv *, jclass
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5Z */
+#endif /* Included_hdf_hdf5lib_H5_H5Z */
diff --git a/java/src/jni/nativeData.h b/java/src/jni/nativeData.h
index 0150c75..9bf313f 100644
--- a/java/src/jni/nativeData.h
+++ b/java/src/jni/nativeData.h
@@ -13,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_HDFNativeData */
-#ifndef _Included_hdf_hdf5lib_HDFNativeData
-#define _Included_hdf_hdf5lib_HDFNativeData
+#ifndef Included_hdf_hdf5lib_HDFNativeData
+#define Included_hdf_hdf5lib_HDFNativeData
#ifdef __cplusplus
extern "C" {
@@ -97,4 +97,4 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToByte__B(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_HDFNativeData */
+#endif /* Included_hdf_hdf5lib_HDFNativeData */
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index c791c79..ffaf5f5 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -23,6 +23,7 @@ set (HDF5_JAVA_TEST_SOURCES
TestH5Dparams
TestH5D
TestH5Dplist
+ TestH5Drw
TestH5Lparams
TestH5Lbasic
TestH5Lcreate
@@ -34,6 +35,7 @@ set (HDF5_JAVA_TEST_SOURCES
TestH5Pvirtual
TestH5Plist
TestH5A
+ TestH5Arw
TestH5Oparams
TestH5Obasic
TestH5Ocreate
@@ -96,6 +98,10 @@ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tdatareg.h5" "${PROJECT_BINARY_DIR}/tdatareg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tattrreg.h5" "${PROJECT_BINARY_DIR}/tattrreg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5" "${PROJECT_BINARY_DIR}/tintsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.h5" "${PROJECT_BINARY_DIR}/tfloatsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list})
@@ -213,6 +219,10 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL)
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tdatareg.h5" "${PROJECT_BINARY_DIR}/${voltest}/tdatareg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tattrreg.h5" "${PROJECT_BINARY_DIR}/${voltest}/tattrreg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5" "${PROJECT_BINARY_DIR}/${voltest}/tintsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.h5" "${PROJECT_BINARY_DIR}/${voltest}/tfloatsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files_list})
diff --git a/java/test/Makefile.am b/java/test/Makefile.am
index 732e1d2..ac3b619 100644
--- a/java/test/Makefile.am
+++ b/java/test/Makefile.am
@@ -52,6 +52,7 @@ noinst_JAVA = \
TestH5T.java \
TestH5Dparams.java \
TestH5D.java \
+ TestH5Drw.java \
TestH5Dplist.java \
TestH5Lparams.java \
TestH5Lbasic.java \
@@ -66,6 +67,7 @@ noinst_JAVA = \
TestH5Pvirtual.java \
TestH5Plist.java \
TestH5A.java \
+ TestH5Arw.java \
TestH5Oparams.java \
TestH5Obasic.java \
TestH5Ocreate.java \
diff --git a/java/test/TestAll.java b/java/test/TestAll.java
index 3950072..16414e4 100644
--- a/java/test/TestAll.java
+++ b/java/test/TestAll.java
@@ -22,12 +22,12 @@ import org.junit.runners.Suite;
TestH5Gbasic.class, TestH5G.class, TestH5Giterate.class,
TestH5Sbasic.class, TestH5S.class,
TestH5Tparams.class, TestH5Tbasic.class, TestH5T.class,
- TestH5Dparams.class, TestH5D.class, TestH5Dplist.class,
+ TestH5Dparams.class, TestH5D.class, TestH5Dplist.class, TestH5Drw.class,
TestH5Lparams.class, TestH5Lbasic.class, TestH5Lcreate.class,
TestH5R.class, TestH5Rref.class,
TestH5P.class, TestH5PData.class, TestH5Pfapl.class, TestH5Pvirtual.class, TestH5Plist.class,
TestH5Pfapls3.class, TestH5Pfaplhdfs.class,
- TestH5A.class,
+ TestH5A.class, TestH5Arw.class,
TestH5Oparams.class, TestH5Obasic.class, TestH5Ocopy.class, TestH5Ocreate.class,
TestH5PL.class, TestH5Z.class
})
diff --git a/java/test/TestH5.java b/java/test/TestH5.java
index c4f298e..1f298f3 100644
--- a/java/test/TestH5.java
+++ b/java/test/TestH5.java
@@ -49,9 +49,13 @@ public class TestH5 {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testData.h5";
private static final String EXPORT_FILE = "testExport.txt";
- private static final String H5_DREG_FILE = "trefer_reg.h5";
- private static final String EXPORT_DREG_FILE = "testExportReg.txt";
- private static final String H5_AREG_FILE = "trefer_attr.h5";
+ private static final String H5_REGION_FILE = "trefer_reg.h5";
+ private static final String EXPORT_REGION_FILE = "testExportReg.txt";
+ private static final String H5_ATTR_FILE = "trefer_attr.h5";
+ private static final String EXPORT_ATTR_FILE = "testExportAttr.txt";
+ private static final String H5_DREG_FILE = "tdatareg.h5";
+ private static final String EXPORT_DREG_FILE = "testExportDReg.txt";
+ private static final String H5_AREG_FILE = "tattrreg.h5";
private static final String EXPORT_AREG_FILE = "testExportAReg.txt";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
@@ -129,7 +133,7 @@ public class TestH5 {
public void _openH5File(String filename, String dsetname) {
try {
H5fid = H5.H5Fopen(filename,
- HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -162,6 +166,7 @@ public class TestH5 {
@After
public void closeH5File() throws HDF5LibraryException {
_closeH5File();
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
System.out.println();
}
@@ -415,8 +420,10 @@ public class TestH5 {
_closeH5File();
+ _openH5File(H5_FILE, "/dset");
+
try {
- H5.H5export_dataset(EXPORT_FILE, H5_FILE, "/dset", 99);
+ H5.H5export_dataset(EXPORT_FILE, H5fid, "/dset", 99);
}
catch (HDF5LibraryException err) {
err.printStackTrace();
@@ -454,6 +461,86 @@ public class TestH5 {
}
@Test
+ public void testH5export_region() {
+ int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108,
+ 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171,
+ 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231,
+ 207, 66, 252, 48, 84, 96, 12, 14, 213, 99};
+ int[] dset_indata = new int[DIM_BLKS+DIM_PNTS];
+ String objName = "/Dataset1";
+
+ _openH5File(H5_REGION_FILE, objName);
+
+ try {
+ H5.H5export_dataset(EXPORT_REGION_FILE, H5fid, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_REGION_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_REGION_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("testH5export_region: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
+
+ @Test
+ public void testH5export_attribute() {
+ int[] dset_data_expect = {0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11};
+ int[] dset_indata = new int[DIM_ATTR];
+ String objName = "/Dataset3";
+
+ _openH5File(H5_ATTR_FILE, objName);
+
+ try {
+ H5.H5export_dataset(EXPORT_ATTR_FILE, H5did, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_ATTR_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_ATTR_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ int jndx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("testH5export_attribute: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
+
+ @Test
public void testH5export_regdataset() {
int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108,
111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171,
@@ -465,7 +552,7 @@ public class TestH5 {
_openH5File(H5_DREG_FILE, objName);
try {
- H5.H5export_dataset(EXPORT_DREG_FILE, H5_DREG_FILE, objName, 99);
+ H5.H5export_dataset(EXPORT_DREG_FILE, H5fid, objName, 99);
}
catch (HDF5LibraryException err) {
err.printStackTrace();
@@ -491,23 +578,27 @@ public class TestH5 {
fail("read file failed: " + err);
}
for(int row = 0; row < DIM_X; row++)
- assertTrue("H5export_dataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ assertTrue("testH5export_regdataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
}
@Test
public void testH5export_attrdataset() {
- int[] dset_data_expect = {0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11};
- int[] dset_indata = new int[DIM_ATTR];
- String objName = "/Dataset3";
+ int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108,
+ 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171,
+ 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231,
+ 207, 66, 252, 48, 84, 96, 12, 14, 213, 99};
+ int[] dset_indata = new int[DIM_BLKS+DIM_PNTS];
+ String dsetName = "/Dataset1";
+ String objName = "Attribute1";
- _openH5File(H5_AREG_FILE, objName);
+ _openH5File(H5_AREG_FILE, dsetName);
try {
- H5.H5export_dataset(EXPORT_AREG_FILE, H5_AREG_FILE, objName, 99);
+ H5.H5export_attribute(EXPORT_AREG_FILE, H5did, objName, 99);
}
catch (HDF5LibraryException err) {
err.printStackTrace();
- fail("H5export_dataset failed: " + err);
+ fail("H5export_attribute failed: " + err);
}
File file = new File(EXPORT_AREG_FILE);
@@ -530,6 +621,6 @@ public class TestH5 {
fail("read file failed: " + err);
}
for(int row = 0; row < DIM_X; row++)
- assertTrue("H5export_dataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ assertTrue("testH5export_attrdataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
}
}
diff --git a/java/test/TestH5Arw.java b/java/test/TestH5Arw.java
new file mode 100644
index 0000000..8ce2fee
--- /dev/null
+++ b/java/test/TestH5Arw.java
@@ -0,0 +1,449 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.HDFNativeData;
+import hdf.hdf5lib.callbacks.H5A_iterate_cb;
+import hdf.hdf5lib.callbacks.H5A_iterate_t;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Arw {
+ @Rule public TestName testname = new TestName();
+ private static final String H5_INTS_FILE = "tintsattrs.h5";
+ private static final String H5_FLTS_FILE = "tfloatsattrs.h5";
+ private static final int DIM_X = 8;
+ private static final int DIM8_Y = 8;
+ private static final int DIM16_Y = 16;
+ private static final int DIM32_Y = 32;
+ private static final int DIM64_Y = 64;
+ private static final int DIM128_Y = 128;
+ private static final String DATASETU08 = "DU08BITS";
+ private static final String DATASETS08 = "DS08BITS";
+ private static final String DATASETU16 = "DU16BITS";
+ private static final String DATASETS16 = "DS16BITS";
+ private static final String DATASETU32 = "DU32BITS";
+ private static final String DATASETS32 = "DS32BITS";
+ private static final String DATASETU64 = "DU64BITS";
+ private static final String DATASETS64 = "DS64BITS";
+ private static final String DATASETF32 = "DS32BITS";
+ private static final String DATASETF64 = "DS64BITS";
+ private static final String DATASETF128 = "DS128BITS";
+ private static final int RANK = 2;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5aid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+
+ private final void _closeH5file() throws HDF5LibraryException {
+ if (H5aid >= 0)
+ try {H5.H5Aclose(H5aid);} catch (Exception ex) {}
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ }
+
+ public void openH5file(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Arw._openH5file: " + err);
+ }
+ assertTrue("TestH5Arw._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Arw._openH5file: " + err);
+ }
+ assertTrue("TestH5Arw._openH5file: H5.H5Dopen: ", H5did >= 0);
+ try {
+ H5aid = H5.H5Aopen(H5did, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Arw._openH5file: " + err);
+ }
+ assertTrue("TestH5Arw._openH5file: H5.H5Aopen: ", H5aid >= 0);
+ }
+
+ @After
+ public void closeH5file() throws HDF5LibraryException {
+ if (H5aid >= 0)
+ try {H5.H5Aclose(H5aid);} catch (Exception ex) {}
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ H5aid = HDF5Constants.H5I_INVALID_HID;
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
+ @Test
+ public void testH5Aread_8bit_ints() {
+ byte[][] attr_data = new byte[DIM_X][DIM8_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU08);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT8, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS08, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS08, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT8, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_16bit_ints() {
+ short[][] attr_data = new short[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU16);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT16, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS16, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS16, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT16, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_32bit_ints() {
+ int[][] attr_data = new int[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT32, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS32, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS32, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT32, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_64bit_ints() {
+ long[][] attr_data = new long[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT64, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS64, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS64, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT64, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_32bit_floats() {
+ float[][] attr_data = new float[DIM_X][DIM32_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_FLOAT, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_floats: H5Aread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Aread_32bit_floats - H5.H5Aread: ", attr_data[i][0] == (32 - i));
+ }
+
+ @Test
+ public void testH5Aread_64bit_floats() {
+ double[][] attr_data = new double[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_DOUBLE, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_floats: H5Aread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Aread_64bit_floats - H5.H5Aread: ", attr_data[i][0] == (64 - i));
+ }
+
+ @Test
+ public void testH5Aread_128bit_floats() {
+ byte[][][] attr_data = new byte[DIM_X][DIM128_Y][8];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF128);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_128bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_LDOUBLE, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_128bit_floats: H5Aread: " + err);
+ }
+ }
+
+}
diff --git a/java/test/TestH5D.java b/java/test/TestH5D.java
index 863ce79..dac3a9c 100644
--- a/java/test/TestH5D.java
+++ b/java/test/TestH5D.java
@@ -197,7 +197,7 @@ public class TestH5D {
private final void _openH5file(String filename, String dsetname, long dapl) {
try {
H5fid = H5.H5Fopen(filename,
- HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/TestH5Drw.java b/java/test/TestH5Drw.java
new file mode 100644
index 0000000..69fb9d7
--- /dev/null
+++ b/java/test/TestH5Drw.java
@@ -0,0 +1,378 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.HDFNativeData;
+import hdf.hdf5lib.callbacks.H5D_iterate_cb;
+import hdf.hdf5lib.callbacks.H5D_iterate_t;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Drw {
+ @Rule public TestName testname = new TestName();
+ private static final String H5_INTS_FILE = "tintsattrs.h5";
+ private static final String H5_FLTS_FILE = "tfloatsattrs.h5";
+ private static final int DIM_X = 8;
+ private static final int DIM8_Y = 8;
+ private static final int DIM16_Y = 16;
+ private static final int DIM32_Y = 32;
+ private static final int DIM64_Y = 64;
+ private static final int DIM128_Y = 128;
+ private static final String DATASETU08 = "DU08BITS";
+ private static final String DATASETS08 = "DS08BITS";
+ private static final String DATASETU16 = "DU16BITS";
+ private static final String DATASETS16 = "DS16BITS";
+ private static final String DATASETU32 = "DU32BITS";
+ private static final String DATASETS32 = "DS32BITS";
+ private static final String DATASETU64 = "DU64BITS";
+ private static final String DATASETS64 = "DS64BITS";
+ private static final String DATASETF32 = "DS32BITS";
+ private static final String DATASETF64 = "DS64BITS";
+ private static final String DATASETF128 = "DS128BITS";
+ private static final int RANK = 2;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+
+ private final void _closeH5file() throws HDF5LibraryException {
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ }
+
+ public void openH5file(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Drw._openH5file: " + err);
+ }
+ assertTrue("TestH5Drw._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Drw._openH5file: " + err);
+ }
+ assertTrue("TestH5Drw._openH5file: H5.H5Dopen: ", H5did >= 0);
+ }
+
+ @After
+ public void closeH5file() throws HDF5LibraryException {
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
+ @Test
+ public void testH5Dread_8bit_ints() {
+ byte[][] dset_data = new byte[DIM_X][DIM8_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU08);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT8, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS08, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT8, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_16bit_ints() {
+ short[][] dset_data = new short[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU16);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT16, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS16, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT16, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_32bit_ints() {
+ int[][] dset_data = new int[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT32, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS32, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT32, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_64bit_ints() {
+ long[][] dset_data = new long[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT64, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS64, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT64, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_32bit_floats() {
+ float[][] dset_data = new float[DIM_X][DIM32_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_FLOAT, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_floats: H5Dread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Dread_32bit_floats - H5.H5Dread: ", dset_data[i][0] == (32 - i));
+ }
+
+ @Test
+ public void testH5Dread_64bit_floats() {
+ double[][] dset_data = new double[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_floats: H5Dread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Dread_64bit_floats - H5.H5Dread: ", dset_data[i][0] == (64 - i));
+ }
+
+ @Test
+ public void testH5Dread_128bit_floats() {
+ byte[][][] dset_data = new byte[DIM_X][DIM128_Y][8];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF128);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_128bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_LDOUBLE, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_128bit_floats: H5Dread: " + err);
+ }
+ }
+
+}
diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java
index cc674e2..a65b52e 100644
--- a/java/test/TestH5Pfapl.java
+++ b/java/test/TestH5Pfapl.java
@@ -102,7 +102,7 @@ public class TestH5Pfapl {
for(int indx = 0; ;indx++) {
java.text.DecimalFormat myFormat = new java.text.DecimalFormat("00000");
try {
- file = new File("test"+myFormat.format(new Integer(indx))+".h5");
+ file = new File("test"+myFormat.format(Integer.valueOf(indx))+".h5");
}
catch (Throwable err) {}
diff --git a/java/test/TestH5Rref.java b/java/test/TestH5Rref.java
index aeec64f..5733aae 100644
--- a/java/test/TestH5Rref.java
+++ b/java/test/TestH5Rref.java
@@ -53,7 +53,7 @@ public class TestH5Rref {
public void openH5file(String filename, String dsetname) {
try {
H5fid = H5.H5Fopen(filename,
- HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -134,7 +134,7 @@ public class TestH5Rref {
try {H5.H5Tclose(f_type);} catch (Exception ex) {}
}
try {
- ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ ndims = (int)H5.H5Sget_simple_extent_npoints(H5dsid);
}
catch (Throwable err) {
err.printStackTrace();
@@ -209,7 +209,7 @@ public class TestH5Rref {
try {H5.H5Tclose(f_type);} catch (Exception ex) {}
}
try {
- ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ ndims = (int)H5.H5Sget_simple_extent_npoints(H5dsid);
}
catch (Throwable err) {
err.printStackTrace();
@@ -286,7 +286,7 @@ public class TestH5Rref {
try {H5.H5Tclose(f_type);} catch (Exception ex) {}
}
try {
- ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ ndims = (int)H5.H5Sget_simple_extent_npoints(H5dsid);
}
catch (Throwable err) {
err.printStackTrace();
@@ -305,80 +305,81 @@ public class TestH5Rref {
}
for (int i = 0; i < ndims; i++) {
try {
- ret_val = H5.H5Rget_type(refbuf[i]);
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: H5Rget_type["+i+"]: " + err);
+ }
assertTrue("testH5Rget_region_dataset: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
try {
loc_id = H5.H5Ropen_object(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
assertTrue(loc_id >= 0);
- boolean regionzero = byteArrayCheck(refbuf[i]);
- if (i > 1)
- assertTrue(regionzero);
- else {
+ try {
+ loc_sid = H5.H5Ropen_region(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ assertTrue(loc_sid >= 0);
+ int region_type = -1;
try {
- loc_sid = H5.H5Ropen_region(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
- assertTrue(loc_sid >= 0);
- int region_type = -1;
- try {
- int reg_ndims = H5.H5Sget_simple_extent_ndims(loc_sid);
- region_type = H5.H5Sget_select_type(loc_sid);
- if (i == 1)
- assertTrue(region_type == HDF5Constants.H5S_SEL_POINTS);
- else
- assertTrue(region_type == HDF5Constants.H5S_SEL_HYPERSLABS);
- if (region_type == HDF5Constants.H5S_SEL_POINTS) {
- long reg_npoints = H5.H5Sget_select_elem_npoints(loc_sid);
- // Coordinates for get point selection
- long getcoord[] = new long[reg_ndims * (int)reg_npoints];
- // Known coordinates for point selection
- long coord[][] = {{6,9},{2,2},{8,4},{1,6},{2,8},{3,2},
- {0,4},{9,0},{7,1},{3,3}};
- try {
- H5.H5Sget_select_elem_pointlist(loc_sid, 0, reg_npoints, getcoord);
- assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][0] == getcoord[0]);
- assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][1] == getcoord[1]);
- assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][0] == getcoord[2]);
- assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][1] == getcoord[3]);
- assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][0] == getcoord[4]);
- assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][1] == getcoord[5]);
- }
- catch (Throwable err3) {
- err3.printStackTrace();
- fail("H5.H5Sget_select_elem_pointlist: " + err3);
- }
+ int reg_ndims = H5.H5Sget_simple_extent_ndims(loc_sid);
+ region_type = H5.H5Sget_select_type(loc_sid);
+ if (i == 1)
+ assertTrue(region_type == HDF5Constants.H5S_SEL_POINTS);
+ else
+ assertTrue(region_type == HDF5Constants.H5S_SEL_HYPERSLABS);
+ if (region_type == HDF5Constants.H5S_SEL_POINTS) {
+ long reg_npoints = H5.H5Sget_select_elem_npoints(loc_sid);
+ // Coordinates for get point selection
+ long getcoord[] = new long[reg_ndims * (int)reg_npoints];
+ // Known coordinates for point selection
+ long coord[][] = {{6,9},{2,2},{8,4},{1,6},{2,8},{3,2},
+ {0,4},{9,0},{7,1},{3,3}};
+ try {
+ H5.H5Sget_select_elem_pointlist(loc_sid, 0, reg_npoints, getcoord);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][0] == getcoord[0]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][1] == getcoord[1]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][0] == getcoord[2]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][1] == getcoord[3]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][0] == getcoord[4]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][1] == getcoord[5]);
}
- else if (region_type == HDF5Constants.H5S_SEL_HYPERSLABS) {
- long reg_nblocks = H5.H5Sget_select_hyper_nblocks(loc_sid);
- assertTrue("H5Sget_select_hyper_nblocks", reg_nblocks == 1);
- // Coordinates for get block selection
- long getblocks[] = new long[reg_ndims * (int)reg_nblocks * 2];
- long start[] = {2,2};
- long block[] = {8,8};
- try {
- H5.H5Sget_select_hyper_blocklist(loc_sid, 0, reg_nblocks, getblocks);
- assertTrue("H5.H5Sget_select_hyper_blocklist", start[0] == getblocks[0]);
- assertTrue("H5.H5Sget_select_hyper_blocklist", start[1] == getblocks[1]);
- assertTrue("H5.H5Sget_select_hyper_blocklist", (block[0]-1) == getblocks[2]);
- assertTrue("H5.H5Sget_select_hyper_blocklist", (block[1]-1) == getblocks[3]);
- }
- catch (Throwable err3) {
- err3.printStackTrace();
- fail("H5.H5Sget_select_hyper_blocklist: " + err3);
- }
+ catch (Throwable err3) {
+ err3.printStackTrace();
+ fail("H5.H5Sget_select_elem_pointlist: " + err3);
}
}
- catch (Throwable err2) {
- err2.printStackTrace();
- fail("testH5Rget_region_dataset: H5Sget_select_type: " + err2);
+ else if (region_type == HDF5Constants.H5S_SEL_HYPERSLABS) {
+ long reg_nblocks = H5.H5Sget_select_hyper_nblocks(loc_sid);
+ assertTrue("H5Sget_select_hyper_nblocks", reg_nblocks == 1);
+ // Coordinates for get block selection
+ long getblocks[] = new long[reg_ndims * (int)reg_nblocks * 2];
+ long start[] = {2,2};
+ long block[] = {8,8};
+ try {
+ H5.H5Sget_select_hyper_blocklist(loc_sid, 0, reg_nblocks, getblocks);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", start[0] == getblocks[0]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", start[1] == getblocks[1]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", (block[0]-1) == getblocks[2]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", (block[1]-1) == getblocks[3]);
+ }
+ catch (Throwable err3) {
+ err3.printStackTrace();
+ fail("H5.H5Sget_select_hyper_blocklist: " + err3);
+ }
}
}
- catch (Throwable err1) {
- err1.printStackTrace();
- fail("testH5Rget_region_dataset: " + err1);
- }
- finally {
- try {H5.H5Sclose(loc_sid);} catch (Exception ex) {}
+ catch (Throwable err2) {
+ err2.printStackTrace();
+ assertTrue("testH5Rget_region_dataset: H5Sget_select_type: " + err2, i > 1);
}
}
+ catch (Throwable err1) {
+ err1.printStackTrace();
+ fail("testH5Rget_region_dataset: " + err1);
+ }
+ finally {
+ try {H5.H5Sclose(loc_sid);} catch (Exception ex) {}
+ }
}
catch (Throwable err0) {
err0.printStackTrace();
@@ -432,7 +433,7 @@ public class TestH5Rref {
try {H5.H5Tclose(f_type);} catch (Exception ex) {}
}
try {
- ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ ndims = (int)H5.H5Sget_simple_extent_npoints(H5dsid);
}
catch (Throwable err) {
err.printStackTrace();
@@ -473,7 +474,8 @@ public class TestH5Rref {
}
catch (Throwable err0) {
err0.printStackTrace();
- fail("testH5Rget_region_attribute: " + err0);
+ // second attribute is null
+ assertTrue("testH5Rget_region_attribute: " + err0, i == 1);
}
finally {
try {H5.H5Aclose(loc_id);} catch (Exception ex) {}
diff --git a/java/test/TestH5T.java b/java/test/TestH5T.java
index c882f8e..ed4e2a9 100644
--- a/java/test/TestH5T.java
+++ b/java/test/TestH5T.java
@@ -206,7 +206,7 @@ public class TestH5T {
@Test
public void testH5Tenum_functions() {
- long filetype_id =HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
String enum_type ="Enum_type";
byte[] enum_val = new byte[1];
String enum_name = null;
@@ -398,7 +398,7 @@ public class TestH5T {
@Test
public void testH5Tcompound_functions() {
- long filetype_id =HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
// Create a compound datatype
try {
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 81ce13b..39db296 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -90,6 +90,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5T.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Dparams.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5D.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Dplist.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Drw.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lparams.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lbasic.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lcreate.txt
@@ -103,6 +104,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5Pfaplhdfs.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Pvirtual.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Plist.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5A.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Arw.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Oparams.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Obasic.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Ocreate.txt
@@ -252,6 +254,10 @@ COPY_DATAFILES_TO_BLDDIR()
$CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateO2.hdf
$CP -f $TOOLS_TESTFILES/trefer_reg.h5 $BLDDIR/trefer_reg.h5
$CP -f $TOOLS_TESTFILES/trefer_attr.h5 $BLDDIR/trefer_attr.h5
+ $CP -f $TOOLS_TESTFILES/tdatareg.h5 $BLDDIR/tdatareg.h5
+ $CP -f $TOOLS_TESTFILES/tattrreg.h5 $BLDDIR/tattrreg.h5
+ $CP -f $TOOLS_TESTFILES/tintsattrs.h5 $BLDDIR/tintsattrs.h5
+ $CP -f $TOOLS_TESTFILES/tfloatsattrs.h5 $BLDDIR/tfloatsattrs.h5
}
CLEAN_DATAFILES_AND_BLDDIR()
@@ -667,6 +673,27 @@ else
test yes = "$verbose" && $DIFF JUnit-TestH5D.txt JUnit-TestH5D.out |sed 's/^/ /'
fi
+echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Drw"
+TESTING JUnit-TestH5Drw
+($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Drw > JUnit-TestH5Drw.ext)
+
+# Extract file name, line number, version and thread IDs because they may be different
+sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
+ -e 's/line [0-9]*/line (number)/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Drw.ext > JUnit-TestH5Drw.out
+
+if diff JUnit-TestH5Drw.out JUnit-TestH5Drw.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Drw"
+else
+ echo "**FAILED** JUnit-TestH5Drw"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Drw.txt JUnit-TestH5Drw.out |sed 's/^/ /'
+fi
+
echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Dplist"
TESTING JUnit-TestH5Dplist
($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Dplist > JUnit-TestH5Dplist.ext)
@@ -919,6 +946,27 @@ else
test yes = "$verbose" && $DIFF JUnit-TestH5A.txt JUnit-TestH5A.out |sed 's/^/ /'
fi
+echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Arw"
+TESTING JUnit-TestH5Arw
+($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Arw > JUnit-TestH5Arw.ext)
+
+# Extract file name, line number, version and thread IDs because they may be different
+sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
+ -e 's/line [0-9]*/line (number)/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Arw.ext > JUnit-TestH5Arw.out
+
+if diff JUnit-TestH5Arw.out JUnit-TestH5Arw.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Arw"
+else
+ echo "**FAILED** JUnit-TestH5Arw"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Arw.txt JUnit-TestH5Arw.out |sed 's/^/ /'
+fi
+
echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Oparams"
TESTING JUnit-TestH5Oparams
($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Oparams > JUnit-TestH5Oparams.ext)
diff --git a/java/test/testfiles/JUnit-TestH5.txt b/java/test/testfiles/JUnit-TestH5.txt
index 59765d9..fb50a57 100644
--- a/java/test/testfiles/JUnit-TestH5.txt
+++ b/java/test/testfiles/JUnit-TestH5.txt
@@ -1,4 +1,5 @@
JUnit version 4.11
+.testH5export_region
.testH5get_libversion_null_param
.testJ2C
.testH5export_dataset
@@ -7,6 +8,7 @@ JUnit version 4.11
.testH5garbage_collect
.testH5error_off
.testH5export_regdataset
+.testH5export_attribute
.serializeToDisk
.testH5open
.testH5check_version
@@ -15,5 +17,5 @@ JUnit version 4.11
Time: XXXX
-OK (13 tests)
+OK (15 tests)
diff --git a/java/test/testfiles/JUnit-TestH5Arw.txt b/java/test/testfiles/JUnit-TestH5Arw.txt
new file mode 100644
index 0000000..49d3b1c
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Arw.txt
@@ -0,0 +1,13 @@
+JUnit version 4.11
+.testH5Aread_128bit_floats
+.testH5Aread_64bit_floats
+.testH5Aread_8bit_ints
+.testH5Aread_32bit_ints
+.testH5Aread_64bit_ints
+.testH5Aread_32bit_floats
+.testH5Aread_16bit_ints
+
+Time: XXXX
+
+OK (7 tests)
+
diff --git a/java/test/testfiles/JUnit-TestH5Drw.txt b/java/test/testfiles/JUnit-TestH5Drw.txt
new file mode 100644
index 0000000..6b854cf
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Drw.txt
@@ -0,0 +1,13 @@
+JUnit version 4.11
+.testH5Dread_32bit_floats
+.testH5Dread_32bit_ints
+.testH5Dread_64bit_ints
+.testH5Dread_64bit_floats
+.testH5Dread_8bit_ints
+.testH5Dread_128bit_floats
+.testH5Dread_16bit_ints
+
+Time: XXXX
+
+OK (7 tests)
+
diff --git a/m4/aclocal_cxx.m4 b/m4/aclocal_cxx.m4
deleted file mode 100644
index 2779066..0000000
--- a/m4/aclocal_cxx.m4
+++ /dev/null
@@ -1,79 +0,0 @@
-dnl -------------------------------------------------------------------------
-dnl -------------------------------------------------------------------------
-dnl
-dnl Copyright by the Board of Trustees of the University of Illinois.
-dnl All rights reserved.
-dnl
-dnl This file is part of HDF5. The full HDF5 copyright notice, including
-dnl terms governing use, modification, and redistribution, is contained in
-dnl the COPYING file, which can be found at the root of the source code
-dnl distribution tree, or in https://www.hdfgroup.org/licenses.
-dnl If you do not have access to either file, you may request a copy from
-dnl help@hdfgroup.org
-dnl
-dnl -------------------------------------------------------------------------
-dnl -------------------------------------------------------------------------
-
-dnl *********************************
-dnl PURPOSE
-dnl Contains Macros for HDF5 C++
-dnl *********************************
-dnl
-dnl Special characteristics that have no autoconf counterpart but that
-dnl we need as part of the C++ support. To distinquish these, they
-dnl have a [PAC] prefix.
-
-dnl Checking if C++ needs old style header files in includes
-AC_DEFUN([PAC_PROG_CXX_HEADERS],[
- AC_MSG_CHECKING([if $CXX needs old style header files in includes])
- TEST_SRC="`(echo \"#define OLD_HEADER_FILENAME 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`"
-
- AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])],
- [AC_MSG_RESULT([no])],
- [AC_MSG_RESULT([yes])
- CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME"
- AM_CXXFLAGS="${AM_CXXFLAGS} -DOLD_HEADER_FILENAME"])
-])
-
-dnl Checking if ++ can handle namespaces
-AC_DEFUN([PAC_PROG_CXX_NAMESPACE],[
- AC_MSG_CHECKING([if $CXX can handle namespaces])
- TEST_SRC="`(echo \"#define HDF_NO_NAMESPACE 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`"
-
- AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- CXXFLAGS="${CXXFLAGS} -DHDF_NO_NAMESPACE"
- AM_CXXFLAGS="${AM_CXXFLAGS} -DHDF_NO_NAMESPACE"])
-])
-
-dnl Checking if C++ supports std
-AC_DEFUN([PAC_PROG_CXX_STD],[
- AC_MSG_CHECKING([if $CXX supports std])
- TEST_SRC="`(echo \"#define HDF_NO_STD 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`"
-
- AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- CXXFLAGS="${CXXFLAGS} -DH5_NO_STD"
- AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_STD"])
-])
-
-dnl Checking if C++ has offsetof extension
-AC_DEFUN([PAC_PROG_CXX_OFFSETOF],[
- AC_MSG_CHECKING([if $CXX has offsetof extension])
- TEST_SRC="`(echo \"#define CXX_HAVE_OFFSETOF 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`"
-
- AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])],[AC_MSG_RESULT([yes])
- AC_DEFINE([CXX_HAVE_OFFSETOF], [1], [Define if C++ compiler recognizes offsetof])],
- AC_MSG_RESULT([no]))
-])
-
-dnl Checking if C++ can handle static cast
-AC_DEFUN([PAC_PROG_CXX_STATIC_CAST],[
- AC_MSG_CHECKING([if $CXX can handle static cast])
- TEST_SRC="`(echo \"#define NO_STATIC_CAST 1\"; cat $srcdir/config/cmake_ext_mod/HDFCXXTests.cpp)`"
-
- AC_LINK_IFELSE([AC_LANG_SOURCE([$TEST_SRC])], [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST"
- AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST"])
-])
diff --git a/release_docs/COPYING b/release_docs/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/release_docs/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/release_docs/INSTALL b/release_docs/INSTALL
index 9546615..c9f7d4c 100644
--- a/release_docs/INSTALL
+++ b/release_docs/INSTALL
@@ -450,6 +450,19 @@ CONTENTS
$ make -j -l6
+4.4. Building doxygen
+ One can optionally build the doxygen files for the HDF5 C library.
+ By default, this option is disabled. To build the html files, specify
+ '--enable-doxygen'.
+
+ $ ./configure --enable-doxygen
+
+ Configuration will halt if the required applications are not available.
+ To build:
+
+ $ make doxygen
+
+
4.5. Testing
HDF5 comes with various test suites, all of which can be run by
specifying:
diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt
index f42f780..91eb593 100644
--- a/release_docs/INSTALL_CMake.txt
+++ b/release_docs/INSTALL_CMake.txt
@@ -734,12 +734,13 @@ BUILD_STATIC_EXECS "Build Static Executables" OFF
BUILD_TESTING "Build HDF5 Unit Testing" ON
---------------- HDF5 Build Options ---------------------
-HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" ON
+HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF
HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON
HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF
HDF5_BUILD_JAVA "Build JAVA support" OFF
HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON
HDF5_BUILD_TOOLS "Build HDF5 Tools" ON
+HDF5_BUILD_HL_TOOLS "Build HIGH Level HDF5 Tools" ON
---------------- HDF5 Advanced Options ---------------------
ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF
@@ -753,7 +754,6 @@ HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages"
HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON
HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" OFF
HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON
-HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON
HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF
HDF5_ENABLE_PREADWRITE "Use pread/pwrite in sec2/log/core VFDs in place of read/write (when available)" ON
HDF5_ENABLE_TRACE "Enable API tracing capability" OFF
@@ -795,6 +795,7 @@ HDF5_BUILD_DOC "Build documentation"
HDF5_ENABLE_ANALYZER_TOOLS "enable the use of Clang tools" OFF
HDF5_ENABLE_SANITIZERS "execute the Clang sanitizer" OFF
HDF5_ENABLE_FORMATTERS "format source files" OFF
+TEST_SHELL_SCRIPTS "Enable shell script tests" ON
---------------- External Library Options ---------------------
HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO"
diff --git a/release_docs/INSTALL_Warnings.txt b/release_docs/INSTALL_Warnings.txt
index 97b3f76..97981be 100644
--- a/release_docs/INSTALL_Warnings.txt
+++ b/release_docs/INSTALL_Warnings.txt
@@ -60,7 +60,6 @@ Autotools UNIX warnings added to H5_CFLAGS
-Wcast-align
-Wcast-qual
-Wconversion
- -Wdeclaration-after-statement
-Wdisabled-optimization
-Wfloat-equal
-Wformat=2
@@ -291,7 +290,6 @@ IF GNU GCC
-Wcast-align
-Wcast-qual
-Wconversion
- -Wdeclaration-after-statement
-Wdisabled-optimization
-Wfloat-equal
-Wformat=2
diff --git a/release_docs/README_HDF5_CMake b/release_docs/README_HDF5_CMake
index cf0ab6f..c575320 100644
--- a/release_docs/README_HDF5_CMake
+++ b/release_docs/README_HDF5_CMake
@@ -1,15 +1,16 @@
This tar file contains
- build-unix.sh script to build HDF5 with CMake on unix machines
- build-unix-hpc.sh script to build HDF5 with CMake on unix machines and run
- tests with batch scripts (sbatch).
+ build-unix.sh script to build HDF5 with CMake on unix machines
+ build-unix-hpc.sh script to build HDF5 with CMake on unix machines and run
+ tests with batch scripts (sbatch).
CTestScript.cmake
- HDF5config.cmake CMake scripts for building HDF5
+ HDF5config.cmake CMake scripts for building HDF5
HDF5options.cmake
- hdf5-1.13.0 HDF5 1.13.0 source
- LIBAEC.tar.gz source for building SZIP replacement
- ZLib.tar.gz source for building ZLIB
- hdf5_plugins.tar.gz source for building compression plugins
+ hdf5-1.13.0 HDF5 1.13.0 source
+ LIBAEC.tar.gz source for building SZIP replacement
+ ZLib.tar.gz source for building ZLIB
+ hdf5_plugins.tar.gz source for building compression plugins
+ HDF5Examples-1.14.4-Source.tar.gz source for building examples
For more information about building HDF5 with CMake, see USING_HDF5_CMake.txt in
hdf5-1.13.0/release_docs, or
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 64faa29..6043145 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -49,12 +49,99 @@ New Features
Configuration:
-------------
+ - Added new option to control the build of High-Level tools
+ that default ON/enabled.
+
+ Add configure options (autotools - CMake):
+ enable-hltools HDF5_BUILD_HL_TOOLS
+
+ (ADB - 2021/09/16, HDFFV-11266)
+
+ - Adds C++ Autotools configuration file for Intel
+
+ * Checks for icpc as the compiler
+ * Sets std=c++11
+ * Copies most non-warning flags from intel-flags
+
+ (DER - 2021/06/02)
+
+ - Adds C++ Autotools configuration file for PGI
+
+ * Checks for pgc++ as the compiler name (was: pgCC)
+ * Sets -std=c++11
+ * Other options basically match new C options (below)
+
+ (DER - 2021/06/02)
+
+ - Updates PGI C options
+
+ * -Minform set to warn (was: inform) to suppress spurious messages
+ * Sets -gopt -O2 as debug options
+ * Sets -O4 as 'high optimization' option
+ * Sets -O0 as 'no optimization' option
+ * Removes specific settings for PGI 9 and 10
+
+ (DER - 2021/06/02)
+
+ - A C++11-compliant compiler is now required to build the C++ wrappers
+
+ CMAKE_CXX_STANDARD is now set to 11 when building with CMake and
+ -std=c++11 is added when building with clang/gcc via the Autotools.
+
+ (DER - 2021/05/27)
+
+ - CMake will now run the shell script tests in test/ by default
+
+ The test directory includes several shell script tests that previously
+ were not run by CMake. These are now run by default. TEST_SHELL_SCRIPTS
+ has been set to ON and SH_PROGRAM has been set to bash (some test
+ scripts use bash-isms). Platforms without bash (e.g., Windows) will
+ ignore the script tests.
+
+ (DER - 2021/05/23)
+
+ - Removed unused HDF5_ENABLE_HSIZET option from CMake
+
+ This has been unused for some time and has no effect.
+
+ (DER - 2021/05/23)
+
+ - CMake no longer builds the C++ library by default
+
+ HDF5_BUILD_CPP_LIB now defaults to OFF, which is in line with the
+ Autotools build defaults.
+
+ (DER - 2021/04/20)
+
+ - Removal of pre-VS2015 work-arounds
+
+ HDF5 now requires Visual Studio 2015 or greater, so old work-around
+ code and definitions have been removed, including:
+
+ * <inttypes.h>
+ * snprintf and vsnprintf
+ * llround, llroundf, lround, lroundf, round, roundf
+ * strtoll and strtoull
+ * va_copy
+ * struct timespec
+
+ (DER - 2021/03/22)
+
+ - Add CMake variable HDF5_LIB_INFIX
+
+ This infix is added to all library names after 'hdf5'.
+ e.g. the infix '_openmpi' results in the library name 'libhdf5_openmpi.so'
+ This name is used in packages on debian based systems.
+ (see https://packages.debian.org/jessie/amd64/libhdf5-openmpi-8/filelist)
+
+ (barcode - 2021/03/22)
+
- On macOS, Universal Binaries can now be built, allowing native execution on
both Intel and Apple Silicon (ARM) based Macs.
To do so, set CMAKE_OSX_ARCHITECTURES="x86_64;arm64"
- (SAM - 2021/02/07, https://github.com/HDFGroup/hdf5/issues/311)
+ (SAM - 2021/02/07, github-311)
- Added a configure-time option to control certain compiler warnings
diagnostics
@@ -259,7 +346,7 @@ New Features
YES NO Default to STATIC
NO YES Default to SHARED
NO NO Default to SHARED
- The defaults can be overriden by setting the config option
+ The defaults can be overridden by setting the config option
HDF5_INSTALL_MOD_FORTRAN to one of NO, SHARED, or STATIC
(ADB - 2020/07/09, HDFFV-11116)
@@ -384,6 +471,159 @@ New Features
Library:
--------
+ - Adds new "ctl" callback to VFD H5FD_class_t structure
+ with the following prototype:
+
+ herr_t (*ctl)(H5FD_t *file, uint64_t op_code,
+ uint64_t flags, const void *input,
+ void **output);
+
+ This newly-added "ctl" callback allows Virtual File
+ Drivers to intercept and handle arbitary operations
+ identified by an operation code. Its parameters are
+ as follows:
+
+ `file` [in] - A pointer to the file to be operated on
+ `op_code` [in] - The operation code identifying the
+ operation to be performed
+ `flags` [in] - Flags governing the behavior of the
+ operation performed (see H5FDpublic.h
+ for a list of valid flags)
+ `input` [in] - A pointer to arguments passed to the
+ VFD performing the operation
+ `output` [out] - A pointer for the receiving VFD to
+ use for output from the operation
+
+ (JRM - 2021/08/16)
+
+ - Change how the release part of version, in major.minor.release is checked
+ for compatibility
+
+ The HDF5 library uses a function, H5check_version, to check that
+ the version defined in the header files, which is used to compile an
+ application is compatible with the version codified in the library, which
+ the application loads at runtime. This previously required an exact match
+ or the library would print a warning, dump the build settings and then
+ abort or continue. An environment variable controlled the logic.
+
+ Now the function first checks that the library release version, in
+ major.minor.release, is not older than the version in the headers.
+ Secondly, if the release version is different, it checks if either
+ the library version or the header version is in the exception list, in
+ which case the release part of version, in major.minor.release, must
+ be exact. An environment variable still controls the logic.
+
+ (ADB - 2021/07/27)
+
+ - gcc warning suppression macros were moved out of H5public.h
+
+ The HDF5 library uses a set of macros to suppress warnings on gcc.
+ These warnings were originally located in H5public.h so that the
+ multi VFD (which only uses public headers) could also make use of them
+ but internal macros should not be publicly exposed like this.
+
+ These macros have now been moved to H5private.h. Pending future multi
+ VFD refactoring, the macros have been duplicated in H5FDmulti.c to
+ suppress the format string warnings there.
+
+ (DER - 2021/06/03)
+
+ - H5Gcreate1() now rejects size_hint parameters larger than UINT32_MAX
+
+ The size_hint value is ultimately stored in a uint32_t struct field,
+ so specifying a value larger than this on a 64-bit machine can cause
+ undefined behavior including crashing the system.
+
+ The documentation for this API call was also incorrect, stating that
+ passing a negative value would cause the library to use a default
+ value. Instead, passing a "negative" value actually passes a very large
+ value, which is probably not what the user intends and can cause
+ crashes on 64-bit systems.
+
+ The Doxygen documentation has been updated and passing values larger
+ than UINT32_MAX for size_hint will now produce a normal HDF5 error.
+
+ (DER - 2021/04/29, HDFFV-11241)
+
+
+ - H5Pset_fapl_log() no longer crashes when passed an invalid fapl ID
+
+ When passed an invalid fapl ID, H5Pset_fapl_log() would usually
+ segfault when attempting to free an uninitialized pointer in the error
+ handling code. This behavior is more common in release builds or
+ when the memory sanitization checks were not selected as a build
+ option.
+
+ The pointer is now correctly initialized and the API call now
+ produces a normal HDF5 error when fed an invalid fapl ID.
+
+ (DER - 2021/04/28, HDFFV-11240)
+
+ - Fixes a segfault when H5Pset_mdc_log_options() is called multiple times
+
+ The call incorrectly attempts to free an internal copy of the previous
+ log location string, which causes a segfault. This only happens
+ when the call is invoked multiple times on the same property list.
+ On the first call to a given fapl, the log location is set to NULL so
+ the segfault does not occur.
+
+ The string is now handled properly and the segfault no longer occurs.
+
+ (DER - 2021/04/27, HDFFV-11239)
+
+ - HSYS_GOTO_ERROR now emits the results of GetLastError() on Windows
+
+ HSYS_GOTO_ERROR is an internal macro that is used to produce error
+ messages when system calls fail. These strings include errno and the
+ the associated strerror() value, which are not particularly useful
+ when a Win32 API call fails.
+
+ On Windows, this macro has been updated to include the result of
+ GetLastError(). When a system call fails on Windows, usually only
+ one of errno and GetLastError() will be useful, however we emit both
+ for the user to parse. The Windows error message is not emitted as
+ it would be awkward to free the FormatMessage() buffer given the
+ existing HDF5 error framework. Users will have to look up the error
+ codes in MSDN.
+
+ The format string on Windows has been changed from:
+
+ "%s, errno = %d, error message = '%s'"
+
+ to:
+
+ "%s, errno = %d, error message = '%s', Win32 GetLastError() = %"PRIu32""
+
+ for those inclined to parse it for error values.
+
+ (DER - 2021/03/21)
+
+ - File locking now works on Windows
+
+ Since version 1.10.0, the HDF5 library has used a file locking scheme
+ to help enforce one reader at a time accessing an HDF5 file, which can
+ be helpful when setting up readers and writers to use the single-
+ writer/multiple-readers (SWMR) access pattern.
+
+ In the past, this was only functional on POSIX systems where flock() or
+ fcntl() were present. Windows used a no-op stub that always succeeded.
+
+ HDF5 now uses LockFileEx() and UnlockFileEx() to lock the file using the
+ same scheme as POSIX systems. We lock the entire file when we set up the
+ locks (by passing DWORDMAX as both size parameters to LockFileEx()).
+
+ (DER - 2021/03/19, HDFFV-10191)
+
+ - H5Epush_ret() now requires a trailing semicolon
+
+ H5Epush_ret() is a function-like macro that has been changed to
+ contain a `do {} while(0)` loop. Consequently, a trailing semicolon
+ is now required to end the `while` statement. Previously, a trailing
+ semi would work, but was not mandatory. This change was made to allow
+ clang-format to correctly format the source code.
+
+ (SAM - 2021/03/03)
+
- Improved performance of H5Sget_select_elem_pointlist
Modified library to cache the point after the last block of points
@@ -403,7 +643,7 @@ New Features
(DER - 2020/11/24, HDFFV-11190)
- - Add new public function H5Ssel_iter_reset
+ - Add a new public function H5Ssel_iter_reset
This function resets a dataspace selection iterator back to an
initial state so that it may be used for iteration once more.
@@ -526,7 +766,7 @@ New Features
This function returns a datatype equivalent to the supplied datatype but
with the location set to be in the file. This datatype can then be used
with H5Tconvert to convert data between file and in-memory representation.
- This funcition is intended for use only by VOL connector developers.
+ This function is intended for use only by VOL connector developers.
(NAF - 2019/11/08, ID-127)
@@ -538,6 +778,11 @@ New Features
Fortran Library:
----------------
+ - H5Fget_name_f fixed to handle correctly trailing whitespaces and
+ newly allocated buffers.
+
+ (MSB - 2021/08/30, github-826,972)
+
- Add wrappers for H5Pset/get_file_locking() API calls
h5pget_file_locking_f()
@@ -598,11 +843,11 @@ New Features
- Added ability to test java library with VOLs.
- Created new CMake script that combines the java and vol test scripts.
+ Created a new CMake script that combines the java and vol test scripts.
(ADB - 2020/02/03, HDFFV-10996)
- - Tests fail for non-English locale.
+ - Tests fail for non-English locales.
In the JUnit tests with a non-English locale, only the part before
the decimal comma is replaced by XXXX and this leads to a comparison
@@ -613,6 +858,26 @@ New Features
Tools:
------
+ - Refactored the perform tools and removed depends on test library.
+
+ Moved the perf and h5perf tools from tools/test/perform to
+ tools/src/h5perf so that they can be installed. This required
+ that the test library dependency be removed by copying the
+ needed functions from h5test.c.
+ The standalone scripts and other perform tools remain in the
+ tools/test/perform folder.
+
+ (ADB - 2021/08/10)
+
+ - Removed partial long exceptions
+
+ Some of the tools accepted shortened versions of the long options
+ (ex: --datas instead of --dataset). These were implemented inconsistently,
+ are difficult to maintian, and occasionally block useful long option
+ names. These partial long options have been removed from all the tools.
+
+ (DER - 2021/08/03)
+
- h5repack added help text for user-defined filters.
Added help text line that states the valid values of the filter flag
@@ -675,7 +940,13 @@ New Features
High-Level APIs:
----------------
- -
+ - added set/get for unsigned long long attributes
+
+ the attribute writing high-level API has been expanded to include
+ public set/get functions for ULL attributes, analogously to the
+ existing set/get for other types.
+
+ (AF - 2021/09/08)
C Packet Table API:
-------------------
@@ -697,6 +968,74 @@ Bug Fixes since HDF5-1.12.0 release
===================================
Library
-------
+ - Detection of simple data transform function "x"
+
+ In the case of the simple data transform function "x" the (parallel)
+ library recognizes this is the same as not applying this data transform
+ function. This improves the I/O performance. In the case of the parallel
+ library, it also avoids breaking to independent I/O, which makes it
+ possible to apply a filter when writing or reading data to or from
+ teh HDF5 file.
+
+ (JWSB - 2021/09/13)
+
+ - Fixed an invalid read and memory leak when parsing corrupt file space
+ info messages
+
+ When the corrupt file from CVE-2020-10810 was parsed by the library,
+ the code that imports the version 0 file space info object header
+ message to the version 1 struct could read past the buffer read from
+ the disk, causing an invalid memory read. Not catching this error would
+ cause downstream errors that eventually resulted in a previously
+ allocated buffer to be unfreed when the library shut down. In builds
+ where the free lists are in use, this could result in an infinite loop
+ and SIGABRT when the library shuts down.
+
+ We now track the buffer size and raise an error on attempts to read
+ past the end of it.
+
+ (DER - 2021/08/12, HDFFV-11053)
+
+
+ - Fixed CVE-2018-14460
+
+ The tool h5repack produced a segfault when the rank in dataspace
+ message was corrupted, causing invalid read while decoding the
+ dimension sizes.
+
+ The problem was fixed by ensuring that decoding the dimension sizes
+ and max values will not go beyong the end of the buffer.
+
+ (BMR - 2021/05/12, HDFFV-11223)
+
+ - Fixed CVE-2018-11206
+
+ The tool h5dump produced a segfault when the size of a fill value
+ message was corrupted and caused a buffer overflow.
+
+ The problem was fixed by verifying the fill value's size
+ against the buffer size before attempting to access the buffer.
+
+ (BMR - 2021/03/15, HDFFV-10480)
+
+ - Fixed CVE-2018-14033 (same issue as CVE-2020-10811)
+
+ The tool h5dump produced a segfault when the storage size message
+ was corrupted and caused a buffer overflow.
+
+ The problem was fixed by verifying the storage size against the
+ buffer size before attempting to access the buffer.
+
+ (BMR - 2021/03/15, HDFFV-11159/HDFFV-11049)
+
+ - Remove underscores on header file guards
+
+ Header file guards used a variety of underscores at the beginning of the define.
+
+ Removed all leading (some trailing) underscores from header file guards.
+
+ (ADB - 2021/03/03, #361)
+
- Fixed issue with MPI communicator and info object not being
copied into new FAPL retrieved from H5F_get_access_plist
@@ -721,7 +1060,7 @@ Bug Fixes since HDF5-1.12.0 release
and the filter is optional, it was supposed to be skipped but it was
not skipped and the creation failed.
- Allowed the creation of the dataset in such situation.
+ Allowed the creation of the dataset in such a situation.
(BMR - 2020/08/13, HDFFV-10933)
@@ -740,8 +1079,8 @@ Bug Fixes since HDF5-1.12.0 release
H5S_NO_CLASS is an internal class value that should not have been
exposed via a public API call.
- In debug builds of the library, this can cause asserts to trip. In
- non-debug builds, it will produce normal library errors.
+ In debug builds of the library, this can cause assert() function to
+ trip. In non-debug builds, it will produce normal library errors.
The new library behavior is for H5Sset_extent_none() to convert
the dataspace into one of type H5S_NULL, which is better handled
@@ -818,11 +1157,11 @@ Bug Fixes since HDF5-1.12.0 release
- Added ability to test java library with VOLs.
- Created new CMake script that combines the java and vol test scripts.
+ Created a new CMake script that combines the java and vol test scripts.
(ADB - 2020/02/03, HDFFV-10996)
- - Tests fail for non-English locale.
+ - Tests fail for non-English locales.
In the JUnit tests with a non-English locale, only the part before
the decimal comma is replaced by XXXX and this leads to a comparison
@@ -833,6 +1172,74 @@ Bug Fixes since HDF5-1.12.0 release
Configuration
-------------
+ - Corrected pkg-config compile script
+
+ It was discovered that the position of the "$@" argument for the command
+ in the compile script may fail on some platforms and configurations. The
+ position of the "$@"command argument was moved before the pkg-config sub command.
+
+ (ADB - 2021/08/30)
+
+ - Fixed CMake C++ compiler flags
+
+ A recent refactoring of the C++ configure files accidently removed the
+ file that executed the enable_language command for C++ needed by the
+ HDFCXXCompilerFlags.cmake file. Also updated the intel warnings files,
+ including adding support for windows platforms.
+
+ (ADB - 2021/08/10)
+
+ - Better support for libaec (open-source Szip library) in CMake
+
+ Implemented better support for libaec 1.0.5 (or later) library. This version
+ of libaec contains improvements for better integration with HDF5. Furthermore,
+ the variable USE_LIBAEC_STATIC has been introduced to allow to make use of
+ static version of libaec library. Use libaec_DIR or libaec_ROOT to set
+ the location in which libaec can be found.
+
+ Be aware, the Szip library of libaec 1.0.4 depends on another library within
+ libaec library. This dependency is not specified in the current CMake
+ configuration which means that one can not use the static Szip library of
+ libaec 1.0.4 when building HDF5. This has been resolved in libaec 1.0.5.
+
+ (JWSB - 2021/06/22)
+
+ - Refactor CMake configure for Fortran
+
+ The Fortran configure tests for KINDs reused a single output file that was
+ read to form the Integer and Real Kinds defines. However, if config was run
+ more then once, the CMake completed variable prevented the tests from executing
+ again and the last value saved in the file was used to create the define.
+ Creating separate files for each KIND solved the issue.
+
+ In addition the test for H5_PAC_C_MAX_REAL_PRECISION was not pulling in
+ defines for proper operation and did not define H5_PAC_C_MAX_REAL_PRECISION
+ correctly for a zero value. This was fixed by supplying the required defines.
+ In addition it was moved from the Fortran specific HDF5UseFortran.camke file
+ to the C centric ConfigureChecks.cmake file.
+
+ (ADB - 2021/06/03)
+
+ - Move emscripten flag to compile flags
+
+ The emscripten flag, -O0, was removed from target_link_libraries command
+ to the correct target_compile_options command.
+
+ (ADB - 2021/04/26 HDFFV-11083)
+
+ - Remove arbitrary warning flag groups from CMake builds
+
+ The arbitrary groups were created to reduce the quantity of warnings being
+ reported that overwhelmed testing report systems. Considerable work has
+ been accomplished to reduce the warning count and these arbitrary groups
+ are no longer needed.
+ Also the default for all warnings, HDF5_ENABLE_ALL_WARNINGS, is now ON.
+
+ Visual Studio warnings C4100, C4706, and C4127 have been moved to
+ developer warnings, HDF5_ENABLE_DEV_WARNINGS, and are disabled for normal builds.
+
+ (ADB - 2021/03/22, HDFFV-11228)
+
- Reclassify CMake messages, to allow new modes and --log-level option
CMake message commands have a mode argument. By default, STATUS mode
@@ -856,14 +1263,33 @@ Bug Fixes since HDF5-1.12.0 release
(DER - 2021/01/07, HDFFV-11201)
+ - Add missing ENV variable line to hdfoptions.cmake file
+
+ Using the build options to use system SZIP/ZLIB libraries need to also
+ specify the library root directory. Setting the {library}_ROOT ENV
+ variable was added to the hdfoptions.cmake file.
+
+ (ADB - 2020/10/19 HDFFV-11108)
+
Tools
-----
+ - Changed how h5dump and h5ls identify long double.
+
+ Long double support is not consistent across platforms. Tools will always
+ identify long double as 128-bit [little/big]-endian float nn-bit precision.
+ New test file created for datasets with attributes for float, double and
+ long double. In addition any unknown integer or float datatype will now
+ also show the number of bits for precision.
+ These files are also used in the java tests.
+
+ (ADB - 2021/03/24, HDFFV-11229,HDFFV-11113)
+
- Fixed tools argument parsing.
Tools parsing used the length of the option from the long array to match
the option from the command line. This incorrectly matched a shorter long
- name option that was happened to be a subset of another long option.
+ name option that happened to be a subset of another long option.
Changed to match whole names.
(ADB - 2021/01/19, HDFFV-11106)
@@ -891,8 +1317,8 @@ Bug Fixes since HDF5-1.12.0 release
- h5diff added a command line option to ignore attributes.
h5diff would ignore all objects with a supplied path if the exclude-path argument is used.
- Adding the exclude-attribute argument will only eclude attributes, with the supplied path,
- from comparision.
+ Adding the exclude-attribute argument will only exclude attributes, with the supplied path,
+ from comparison.
(ADB - 2020/07/20, HDFFV-5935)
@@ -904,7 +1330,7 @@ Bug Fixes since HDF5-1.12.0 release
2 : All level 1 information plus extended attribute status report
3 : All level 2 information plus file names
- (ADB - 2020/07/20, HDFFV-10005)
+ (ADB - 2020/07/20, HDFFV-1005)
- h5repack was fixed to repack the reference attributes properly.
@@ -968,7 +1394,12 @@ Bug Fixes since HDF5-1.12.0 release
C++ APIs
--------
- -
+ - Added DataSet::operator=
+
+ Some compilers complain if the copy constructor is given explicitly
+ but the assignment operator is implicitly set to default.
+
+ (2021/05/19)
Testing
@@ -1107,15 +1538,22 @@ The following platforms are not supported but have been tested for this release.
#1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1
(ostrich) and IBM XL Fortran for Linux, V15.1
- Fedora33 5.10.10-200.fc33.x86_64
- #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)
- GNU Fortran (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)
+ Fedora33 5.11.18-200.fc33.x86_64
+ #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
+ GNU Fortran (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
clang version 11.0.0 (Fedora 11.0.0-2.fc33)
(cmake and autotools)
- Ubuntu20.10 5.8.0-41-generic-x86_64
- #46-Ubuntu SMP x86_64 GNU/Linux GNU gcc (GCC) 10.2.0-13ubuntu1
+ Ubuntu20.04 5.8.0-53-generic-x86_64
+ #60~20.04-Ubuntu SMP x86_64 GNU/Linux GNU gcc (GCC) 9.3.0-17ubuntu1
+ GNU Fortran (GCC) 9.3.0-17ubuntu1
+ clang version 10.0.0-4ubuntu1
+ (cmake and autotools)
+
+ Ubuntu20.10 5.8.0-53-generic-x86_64
+ #60-Ubuntu SMP x86_64 GNU/Linux GNU gcc (GCC) 10.2.0-13ubuntu1
GNU Fortran (GCC) 10.2.0-13ubuntu1
+ Ubuntu clang version 11.0.0-2
(cmake and autotools)
SUSE15sp2 5.3.18-22-default
@@ -1127,6 +1565,10 @@ The following platforms are not supported but have been tested for this release.
Known Problems
==============
+ Setting a variable-length dataset fill value will leak the memory allocated
+ for the p field of the hvl_t struct. A fix is in progress for this.
+ HDFFV-10840
+
CMake files do not behave correctly with paths containing spaces.
Do not use spaces in paths because the required escaping for handling spaces
results in very complex and fragile build files.
@@ -1140,6 +1582,9 @@ Known Problems
CPP ptable test fails on both VS2017 and VS2019 with Intel compiler, JIRA
issue: HDFFV-10628. This test will pass with VS2015 with Intel compiler.
+ The subsetting option in ph5diff currently will fail and should be avoided.
+ The subsetting option works correctly in serial h5diff.
+
Known problems in previous releases can be found in the HISTORY*.txt files
in the HDF5 source. Please report any new problems found to
help@hdfgroup.org.
diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt
index bd089a6..a12a952 100644
--- a/release_docs/USING_CMake_Examples.txt
+++ b/release_docs/USING_CMake_Examples.txt
@@ -83,6 +83,7 @@ III. Defaults in the HDF5_Examples_options.cmake file
#### HDF_BUILD_CXX:BOOL=OFF ###
#### HDF_BUILD_FORTRAN:BOOL=OFF ###
#### HDF_BUILD_JAVA:BOOL=OFF ###
+#### HDF_BUILD_FILTERS:BOOL=OFF ###
#### BUILD_TESTING:BOOL=OFF ###
#### HDF_ENABLE_PARALLEL:BOOL=OFF ###
#### HDF_ENABLE_THREADSAFE:BOOL=OFF ###
diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt
index f2d7754..792c719 100644
--- a/release_docs/USING_HDF5_CMake.txt
+++ b/release_docs/USING_HDF5_CMake.txt
@@ -41,13 +41,30 @@ I. Preconditions
2. You have installed the HDF5 library built with CMake, by executing
the HDF Install Utility (the *.msi file in the binary package for
- Windows). If you are using a Windows platform, you can obtain a
- pre-built Windows binary from The HDF Group's website at
+ Windows). You can obtain pre-built binaries from The HDF Group's website at
www.hdfgroup.org.
3. Set the environment variable HDF5_DIR to the installed location of
- the config files for HDF5. On Windows:
+ the config files for HDF5.
+ On Windows:
HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.13.x/cmake
+ On unix:
+ HDF5_DIR=<install root folder>/HDF_Group/HDF5/1.13.x/cmake
+
+ If you are using shared libraries, you may need to add to the path
+ environment variable. Set the path environment variable to the
+ installed location of the library files for HDF5.
+ On Windows (*.dll):
+ PATH=%PATH%;C:/Program Files/HDF_Group/HDF5/1.13.x/bin
+ On unix (*.so):
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<install root folder>/HDF_Group/HDF5/1.13.x/lib
+
+ If you are using filter plugin libraries, you will need to set the
+ HDF5_PLUGIN_PATH environment variable.
+ On Windows:
+ HDF5_PLUGIN_PATH=C:/Program Files/HDF_Group/HDF5/1.13.x/lib/plugin
+ On unix:
+ HDF5_PLUGIN_PATH=<install root folder>/HDF_Group/HDF5/1.13.x/lib/plugin
(Note there are no quote characters used on Windows and all platforms
use forward slashes)
@@ -99,12 +116,13 @@ These steps are described in more detail below.
* MinGW Makefiles
* NMake Makefiles
* Unix Makefiles
- * Visual Studio 12 2013
- * Visual Studio 12 2013 Win64
* Visual Studio 14 2015
* Visual Studio 14 2015 Win64
* Visual Studio 15 2017
* Visual Studio 15 2017 Win64
+ * Visual Studio 16 2019
+ * ... in addition VS2019 will need to set the "-A" option,
+ * ... [Win32, x64, ARM, ARM64]
<options> is:
* BUILD_TESTING:BOOL=ON
@@ -114,7 +132,7 @@ These steps are described in more detail below.
2.1 Visual CMake users, click the Configure button. If this is the first time you are
running cmake-gui in this directory, you will be prompted for the
- generator you wish to use (for example on Windows, Visual Studio 12 2013).
+ generator you wish to use (for example on Windows, Visual Studio 14 2015 Win64).
CMake will read in the CMakeLists.txt files from the source directory and
display options for the HDF5 project. After the first configure you
can adjust the cache settings and/or specify locations of other programs.
@@ -132,7 +150,7 @@ These steps are described in more detail below.
2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory:
- cmake -G "Visual Studio 12 2013" -DBUILD_TESTING:BOOL=ON ..
+ cmake -G "Visual Studio 14 2015 Win64" -DBUILD_TESTING:BOOL=ON ..
3. Build HDF5 Applications
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 610e905..cde36c9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -180,6 +180,7 @@ set (H5ES_SOURCES
${HDF5_SRC_DIR}/H5ESlist.c
)
set (H5ES_HDRS
+ ${HDF5_SRC_DIR}/H5ESdevelop.h
${HDF5_SRC_DIR}/H5ESpublic.h
)
IDE_GENERATED_PROPERTIES ("H5ES" "${H5ES_HDRS}" "${H5ES_SOURCES}" )
@@ -251,6 +252,7 @@ set (H5FD_SOURCES
set (H5FD_HDRS
${HDF5_SRC_DIR}/H5FDcore.h
+ ${HDF5_SRC_DIR}/H5FDdevelop.h
${HDF5_SRC_DIR}/H5FDdirect.h
${HDF5_SRC_DIR}/H5FDfamily.h
${HDF5_SRC_DIR}/H5FDhdfs.h
@@ -389,6 +391,7 @@ set (H5I_SOURCES
${HDF5_SRC_DIR}/H5Itest.c
)
set (H5I_HDRS
+ ${HDF5_SRC_DIR}/H5Idevelop.h
${HDF5_SRC_DIR}/H5Ipublic.h
)
IDE_GENERATED_PROPERTIES ("H5I" "${H5I_HDRS}" "${H5I_SOURCES}" )
@@ -398,8 +401,10 @@ set (H5L_SOURCES
${HDF5_SRC_DIR}/H5L.c
${HDF5_SRC_DIR}/H5Ldeprec.c
${HDF5_SRC_DIR}/H5Lexternal.c
+ ${HDF5_SRC_DIR}/H5Lint.c
)
set (H5L_HDRS
+ ${HDF5_SRC_DIR}/H5Ldevelop.h
${HDF5_SRC_DIR}/H5Lpublic.h
)
IDE_GENERATED_PROPERTIES ("H5L" "${H5L_HDRS}" "${H5L_SOURCES}" )
@@ -600,14 +605,6 @@ set (H5SM_HDRS
IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SOURCES}" )
-set (H5ST_SOURCES
- ${HDF5_SRC_DIR}/H5ST.c
-)
-set (H5ST_HDRS
-)
-IDE_GENERATED_PROPERTIES ("H5ST" "${H5ST_HDRS}" "${H5ST_SOURCES}" )
-
-
set (H5T_SOURCES
${HDF5_SRC_DIR}/H5T.c
${HDF5_SRC_DIR}/H5Tarray.c
@@ -636,6 +633,7 @@ set (H5T_SOURCES
)
set (H5T_HDRS
+ ${HDF5_SRC_DIR}/H5Tdevelop.h
${HDF5_SRC_DIR}/H5Tpublic.h
)
IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SOURCES}" )
@@ -645,7 +643,7 @@ set (H5TS_SOURCES
${HDF5_SRC_DIR}/H5TS.c
)
set (H5TS_HDRS
- ${HDF5_SRC_DIR}/H5TSpublic.h
+ ${HDF5_SRC_DIR}/H5TSdevelop.h
)
IDE_GENERATED_PROPERTIES ("H5TS" "${H5TS_HDRS}" "${H5TS_SOURCES}" )
@@ -661,6 +659,7 @@ IDE_GENERATED_PROPERTIES ("H5UC" "${H5UC_HDRS}" "${H5UC_SOURCES}" )
set (H5VL_SOURCES
${HDF5_SRC_DIR}/H5VL.c
${HDF5_SRC_DIR}/H5VLcallback.c
+ ${HDF5_SRC_DIR}/H5VLdyn_ops.c
${HDF5_SRC_DIR}/H5VLint.c
${HDF5_SRC_DIR}/H5VLnative.c
${HDF5_SRC_DIR}/H5VLnative_attr.c
@@ -674,6 +673,7 @@ set (H5VL_SOURCES
${HDF5_SRC_DIR}/H5VLnative_object.c
${HDF5_SRC_DIR}/H5VLnative_token.c
${HDF5_SRC_DIR}/H5VLpassthru.c
+ ${HDF5_SRC_DIR}/H5VLtest.c
)
set (H5VL_HDRS
${HDF5_SRC_DIR}/H5VLconnector.h
@@ -717,6 +717,7 @@ endif ()
set (H5Z_HDRS
+ ${HDF5_SRC_DIR}/H5Zdevelop.h
${HDF5_SRC_DIR}/H5Zpublic.h
)
IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SOURCES}" )
@@ -802,7 +803,6 @@ set (common_SRCS
${H5S_SOURCES}
${H5SL_SOURCES}
${H5SM_SOURCES}
- ${H5ST_SOURCES}
${H5T_SOURCES}
${H5TS_SOURCES}
${H5VL_SOURCES}
@@ -961,8 +961,6 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5SMpkg.h
${HDF5_SRC_DIR}/H5SMprivate.h
- ${HDF5_SRC_DIR}/H5STprivate.h
-
${HDF5_SRC_DIR}/H5Tpkg.h
${HDF5_SRC_DIR}/H5Tprivate.h
@@ -982,6 +980,8 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5Zprivate.h
${HDF5_SRC_DIR}/H5win32defs.h
+
+ ${HDF5_SRC_DIR}/uthash.h
)
set (H5_GENERATED_HEADERS
@@ -1002,8 +1002,7 @@ set (H5_PUBLIC_GENERATED_HEADERS
option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON)
if (HDF5_GENERATE_HEADERS)
set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE)
- find_package (Perl)
- if (PERL_FOUND)
+ if (H5_PERL_FOUND)
execute_process (
COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SRC_DIR}/H5err.txt OUTPUT_VARIABLE SCRIPT_OUTPUT
)
@@ -1056,6 +1055,7 @@ if (LOCAL_BATCH_TEST)
endif ()
endif ()
+set (lib_prog_deps)
if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c")
add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
target_include_directories (H5detect PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
@@ -1063,8 +1063,11 @@ if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c")
TARGET_C_PROPERTIES (H5detect STATIC)
target_link_libraries (H5detect
PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
- PRIVATE $<$<PLATFORM_ID:Emscripten>:"-O0">
)
+ target_compile_options(H5detect
+ PRIVATE "$<$<PLATFORM_ID:Emscripten>:-O0>"
+ )
+ set (lib_prog_deps ${lib_prog_deps} H5detect)
if (HDF5_BATCH_H5DETECT)
configure_file (
@@ -1072,77 +1075,68 @@ if (NOT EXISTS "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c")
${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT} ESCAPE_QUOTES @ONLY
)
add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
- ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
- COMMAND ${HDF5_BATCH_CMD}
- ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT}
- COMMAND ${CMAKE_COMMAND}
- ARGS -E echo "Executed batch command to create H5Tinit.c"
+ OUTPUT gen_SRCS.stamp1
+ COMMAND ${HDF5_BATCH_CMD}
+ ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT}
+ BYPRODUCTS H5Tinit.c gen_SRCS.stamp1
COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
+ ARGS -E echo "Executed batch command to create H5Tinit.c"
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E touch gen_SRCS.stamp1
DEPENDS H5detect
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
)
add_custom_target (gen_H5Tinit
COMMAND ${CMAKE_COMMAND} -P ${HDF5_SOURCE_DIR}/config/cmake/wait_H5Tinit.cmake
)
- if (BUILD_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
- ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
- COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
- DEPENDS gen_H5Tinit ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit_created
- WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
- )
- set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
- endif ()
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
else ()
- add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
- ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5detect>
- ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ add_custom_command (TARGET H5detect POST_BUILD
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5detect>
+ ARGS H5Tinit.c
+ BYPRODUCTS H5Tinit.c gen_SRCS.stamp1
COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
+ ARGS -E touch gen_SRCS.stamp1
DEPENDS H5detect
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
+ COMMENT "Create H5Tinit.c"
)
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
- ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
+ add_custom_command (TARGET H5detect POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
+ ARGS -E copy_if_different H5Tinit.c shared/H5Tinit.c
+ BYPRODUCTS shared/H5Tinit.c shared/shared_gen_SRCS.stamp1
COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
- DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ ARGS -E touch shared/shared_gen_SRCS.stamp1
+ DEPENDS H5detect H5Tinit.c
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
+ COMMENT "Copy H5Tinit.c to shared folder"
)
set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
endif ()
endif ()
- set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
else ()
add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
+ OUTPUT gen_SRCS.stamp1
COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
- DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ ARGS -E touch gen_SRCS.stamp1
+ DEPENDS H5Tinit.c
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
+ COMMENT "Touch existing H5Tinit.c"
)
+ set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
- ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
+ OUTPUT shared/shared_gen_SRCS.stamp1
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
+ ARGS -E copy_if_different H5Tinit.c shared/H5Tinit.c
+ BYPRODUCTS shared/H5Tinit.c shared/shared_gen_SRCS.stamp1
COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
- DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
+ ARGS -E touch shared/shared_gen_SRCS.stamp1
+ DEPENDS H5Tinit.c
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
+ COMMENT "Copy existing H5Tinit.c to shared folder"
)
set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
endif ()
@@ -1161,8 +1155,11 @@ target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_
TARGET_C_PROPERTIES (H5make_libsettings STATIC)
target_link_libraries (H5make_libsettings
PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
- PRIVATE $<$<PLATFORM_ID:Emscripten>:"-O0">
)
+target_compile_options(H5make_libsettings
+ PRIVATE "$<$<PLATFORM_ID:Emscripten>:-O0>"
+)
+set (lib_prog_deps ${lib_prog_deps} H5make_libsettings)
#-----------------------------------------------------------------------------
# Add Target to clang-format
@@ -1171,27 +1168,27 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_SRC_LIBSETTINGS_FORMAT H5make_libsettings)
endif ()
-add_custom_command (
- OUTPUT ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c
- ${HDF5_SRC_BINARY_DIR}/gen_SRCS.stamp2
- COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5make_libsettings>
- ARGS ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c
+add_custom_command (TARGET H5make_libsettings POST_BUILD
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5make_libsettings>
+ ARGS H5lib_settings.c
+ BYPRODUCTS H5lib_settings.c gen_SRCS.stamp2
COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2
+ ARGS -E touch gen_SRCS.stamp2
DEPENDS H5make_libsettings
WORKING_DIRECTORY ${HDF5_SRC_BINARY_DIR}
+ COMMENT "Create H5lib_settings.c"
)
set_source_files_properties (${HDF5_SRC_BINARY_DIR}/H5lib_settings.c PROPERTIES GENERATED TRUE)
if (BUILD_SHARED_LIBS)
- add_custom_command (
- OUTPUT ${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c
- ${HDF5_SRC_BINARY_DIR}/shared/shared_gen_SRCS.stamp2
+ add_custom_command (TARGET H5make_libsettings POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_SRC_BINARY_DIR}/H5lib_settings.c" "${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c"
+ ARGS -E copy_if_different H5lib_settings.c shared/H5lib_settings.c
+ BYPRODUCTS shared/H5lib_settings.c shared/shared_gen_SRCS.stamp2
COMMAND ${CMAKE_COMMAND}
- ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2
- DEPENDS ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c
+ ARGS -E touch shared/shared_gen_SRCS.stamp2
+ DEPENDS H5make_libsettings H5lib_settings.c
WORKING_DIRECTORY ${HDF5_SRC_BINARY_DIR}
+ COMMENT "Copy H5lib_settings.c to shared folder"
)
set_source_files_properties (${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c PROPERTIES GENERATED TRUE)
endif ()
@@ -1205,7 +1202,10 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
#-----------------------------------------------------------------------------
if (NOT ONLY_SHARED_LIBS)
set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c)
- add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2)
+ add_custom_target (gen_${HDF5_LIB_TARGET} ALL
+ DEPENDS ${lib_prog_deps} ${gen_SRCS} ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_SRC_BINARY_DIR}/gen_SRCS.stamp2
+ COMMENT "Generation target files"
+ )
add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS})
target_include_directories (${HDF5_LIB_TARGET}
@@ -1219,7 +1219,7 @@ if (NOT ONLY_SHARED_LIBS)
${HDF_EXTRA_FLAGS}
PRIVATE
$<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
- $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
+ $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
)
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_LIB_TARGET}
@@ -1241,7 +1241,10 @@ endif ()
if (BUILD_SHARED_LIBS)
set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/shared/H5lib_settings.c)
- add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2)
+ add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL
+ DEPENDS ${lib_prog_deps} ${shared_gen_SRCS} ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_SRC_BINARY_DIR}/shared/shared_gen_SRCS.stamp2
+ COMMENT "Shared generation target files"
+ )
add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS})
target_include_directories (${HDF5_LIBSH_TARGET}
@@ -1258,7 +1261,7 @@ if (BUILD_SHARED_LIBS)
PRIVATE
$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE>
$<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
- $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
+ $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:H5Z_DEBUG;H5T_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG>
)
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_LIBSH_TARGET}
@@ -1350,17 +1353,21 @@ set (_PKG_CONFIG_REQUIRES_PRIVATE)
configure_file (
${HDF_CONFIG_DIR}/libhdf5.pc.in
- ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}.pc
@ONLY
)
install (
- FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}.pc
DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
COMPONENT libraries
)
if (NOT WIN32)
- set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER})
+ else ()
+ set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
+ endif ()
configure_file (
${HDF_RESOURCES_DIR}/libh5cc.in
${HDF5_BINARY_DIR}/CMakeFiles/h5cc
@@ -1372,42 +1379,49 @@ if (NOT WIN32)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT libraries
)
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ #legacy requires a different name
+ configure_file (
+ ${HDF_RESOURCES_DIR}/libh5cc.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc
+ @ONLY
+ )
+ install (
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc
+ DESTINATION ${HDF5_INSTALL_BIN_DIR}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ COMPONENT libraries
+ )
+ endif ()
endif ()
#-----------------------------------------------------------------------------
# Option to build documentation
#-----------------------------------------------------------------------------
if (DOXYGEN_FOUND)
- set (DOXYGEN_PACKAGE ${HDF5_PACKAGE})
- set (DOXYGEN_VERSION_STRING ${HDF5_VERSION_STRING})
- set (DOXYGEN_INCLUDE_ALIASES ${HDF5_DOXYGEN_DIR}/aliases)
- set (DOXYGEN_PROJECT_LOGO ${HDF5_DOXYGEN_DIR}/img/HDFG-logo.png)
- set (DOXYGEN_PROJECT_BRIEF "C-API Reference")
- set (DOXYGEN_INPUT_DIRECTORY ${HDF5_SRC_DIR} ${HDF5_DOXYGEN_DIR}/dox ${HDF5_GENERATED_SOURCE_DIR}/shared)
- set (DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
- set (DOXYGEN_MACRO_EXPANSION YES)
- set (DOXYGEN_OUTPUT_DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs)
-
+# This cmake function requires that the non-default doxyfile settings are provided with set (DOXYGEN_xxx) commands
+# In addition the doxyfile aliases @INCLUDE option is not supported and would need to be provided in a set (DOXYGEN_ALIASES) command.
+# doxygen_add_docs (hdf5lib_doc
+## ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${HDF5_DOXYGEN_DIR}/dox
+# ${DOXYGEN_INPUT_DIRECTORY}
+# ALL
+# WORKING_DIRECTORY ${HDF5_SRC_DIR}
+# COMMENT "Generating HDF5 library Source Documentation"
+# )
+
+# This custom target and doxygen/configure work together
# Replace variables inside @@ with the current values
- configure_file(${HDF5_DOXYGEN_DIR}/Doxyfile.in Doxyfile @ONLY)
-
- doxygen_add_docs(hdf5lib_doc
-# ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${HDF5_DOXYGEN_DIR}/dox
- ${DOXYGEN_INPUT_DIRECTORY}
- ALL
- WORKING_DIRECTORY ${HDF5_SRC_DIR}
- COMMENT "Generating HDF5 library Source Documentation"
- )
- install(
- DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs/html
- DESTINATION ${HDF5_INSTALL_DATA_DIR}
- COMPONENT Documents
- )
-
- if(NOT TARGET doxygen)
- add_custom_target(doxygen)
- endif()
+ add_custom_target (hdf5lib_doc ALL
+ COMMAND ${DOXYGEN_EXECUTABLE} ${HDF5_BINARY_DIR}/Doxyfile
+ DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c
+ WORKING_DIRECTORY ${HDF5_SRC_DIR}
+ COMMENT "Generating HDF5 library Source API documentation with Doxygen"
+ VERBATIM )
+
+ if (NOT TARGET doxygen)
+ add_custom_target (doxygen)
+ endif ()
- add_dependencies(doxygen hdf5lib_doc)
+ add_dependencies (doxygen hdf5lib_doc)
endif ()
diff --git a/src/COPYING b/src/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/src/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/src/H5.c b/src/H5.c
index f97fe31..d1c46b9 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -70,9 +70,9 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
/* Library Private Variables */
/*****************************/
-/* HDF5 API Entered variable */
-/* (move to H5.c when new FUNC_ENTER macros in actual use -QAK) */
-hbool_t H5_api_entered_g = FALSE;
+/* Library incompatible release versions */
+const unsigned VERS_RELEASE_EXCEPTIONS[] = {0};
+const unsigned VERS_RELEASE_EXCEPTIONS_SIZE = 0;
/* statically initialize block for pthread_once call used in initializing */
/* the first global mutex */
@@ -296,13 +296,13 @@ done:
} /* end H5_init_library() */
/*-------------------------------------------------------------------------
- * Function: H5_term_library
+ * Function: H5_term_library
*
- * Purpose: Terminate interfaces in a well-defined order due to
- * dependencies among the interfaces, then terminate
- * library-specific data.
+ * Purpose: Terminate interfaces in a well-defined order due to
+ * dependencies among the interfaces, then terminate
+ * library-specific data.
*
- * Return: void
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -520,22 +520,22 @@ done:
} /* end H5_term_library() */
/*-------------------------------------------------------------------------
- * Function: H5dont_atexit
+ * Function: H5dont_atexit
*
- * Purpose: Indicates that the library is not to clean up after itself
- * when the application exits by calling exit() or returning
- * from main(). This function must be called before any other
- * HDF5 function or constant is used or it will have no effect.
+ * Purpose: Indicates that the library is not to clean up after itself
+ * when the application exits by calling exit() or returning
+ * from main(). This function must be called before any other
+ * HDF5 function or constant is used or it will have no effect.
*
- * If this function is used then certain memory buffers will not
- * be de-allocated nor will open files be flushed automatically.
- * The application may still call H5close() explicitly to
- * accomplish these things.
+ * If this function is used then certain memory buffers will not
+ * be de-allocated nor will open files be flushed automatically.
+ * The application may still call H5close() explicitly to
+ * accomplish these things.
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative if this function is called more than
- * once or if it is called too late.
+ * Failure: negative if this function is called more than
+ * once or if it is called too late.
*
*-------------------------------------------------------------------------
*/
@@ -556,19 +556,19 @@ H5dont_atexit(void)
} /* end H5dont_atexit() */
/*-------------------------------------------------------------------------
- * Function: H5garbage_collect
+ * Function: H5garbage_collect
*
- * Purpose: Walks through all the garbage collection routines for the
- * library, which are supposed to free any unused memory they have
- * allocated.
+ * Purpose: Walks through all the garbage collection routines for the
+ * library, which are supposed to free any unused memory they have
+ * allocated.
*
* These should probably be registered dynamically in a linked list of
* functions to call, but there aren't that many right now, so we
* hard-wire them...
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
*-------------------------------------------------------------------------
*/
@@ -589,9 +589,9 @@ done:
} /* end H5garbage_collect() */
/*-------------------------------------------------------------------------
- * Function: H5set_free_list_limits
+ * Function: H5set_free_list_limits
*
- * Purpose: Sets limits on the different kinds of free lists. Setting a value
+ * Purpose: Sets limits on the different kinds of free lists. Setting a value
* of -1 for a limit means no limit of that type. These limits are global
* for the entire library. Each "global" limit only applies to free lists
* of that type, so if an application sets a limit of 1 MB on each of the
@@ -609,9 +609,9 @@ done:
* int blk_global_lim; IN: The limit on all "block" free list memory used
* int blk_list_lim; IN: The limit on memory used in each "block" free list
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
*-------------------------------------------------------------------------
*/
@@ -635,11 +635,11 @@ done:
} /* end H5set_free_list_limits() */
/*-------------------------------------------------------------------------
- * Function: H5get_free_list_sizes
+ * Function: H5get_free_list_sizes
*
- * Purpose: Gets the current size of the different kinds of free lists that
- * the library uses to manage memory. The free list sizes can be set with
- * H5set_free_list_limits and garbage collected with H5garbage_collect.
+ * Purpose: Gets the current size of the different kinds of free lists that
+ * the library uses to manage memory. The free list sizes can be set with
+ * H5set_free_list_limits and garbage collected with H5garbage_collect.
* These lists are global for the entire library.
*
* Parameters:
@@ -648,8 +648,8 @@ done:
* size_t *blk_size; OUT: The current size of all "block" free list memory used
* size_t *fac_size; OUT: The current size of all "factory" free list memory used
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
* Programmer: Quincey Koziol
* Friday, March 6, 2020
@@ -674,23 +674,23 @@ done:
} /* end H5get_free_list_sizes() */
/*-------------------------------------------------------------------------
- * Function: H5get_alloc_stats
+ * Function: H5get_alloc_stats
*
- * Purpose: Gets the memory allocation statistics for the library, if the
- * --enable-memory-alloc-sanity-check option was given when building the
+ * Purpose: Gets the memory allocation statistics for the library, if the
+ * --enable-memory-alloc-sanity-check option was given when building the
* library. Applications can check whether this option was enabled by
- * detecting if the 'H5_MEMORY_ALLOC_SANITY_CHECK' macro is defined. This
- * option is enabled by default for debug builds of the library and
- * disabled by default for non-debug builds. If the option is not enabled,
- * all the values returned with be 0. These statistics are global for the
- * entire library, but don't include allocations from chunked dataset I/O
- * filters or non-native VOL connectors.
+ * detecting if the 'H5_MEMORY_ALLOC_SANITY_CHECK' macro is defined. This
+ * option is enabled by default for debug builds of the library and
+ * disabled by default for non-debug builds. If the option is not enabled,
+ * all the values returned with be 0. These statistics are global for the
+ * entire library, but don't include allocations from chunked dataset I/O
+ * filters or non-native VOL connectors.
*
* Parameters:
* H5_alloc_stats_t *stats; OUT: Memory allocation statistics
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
* Programmer: Quincey Koziol
* Saturday, March 7, 2020
@@ -818,20 +818,17 @@ H5__debug_mask(const char *s)
s++;
} /* end if-else */
} /* end while */
-
- return;
-
} /* end H5__debug_mask() */
#ifdef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
- * Function: H5__mpi_delete_cb
+ * Function: H5__mpi_delete_cb
*
- * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5
+ * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5
* library when the communicator is destroyed, i.e. on MPI_Finalize.
*
- * Return: MPI_SUCCESS
+ * Return: MPI_SUCCESS
*
*-------------------------------------------------------------------------
*/
@@ -845,18 +842,18 @@ H5__mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void
#endif /*H5_HAVE_PARALLEL*/
/*-------------------------------------------------------------------------
- * Function: H5get_libversion
+ * Function: H5get_libversion
*
- * Purpose: Returns the library version numbers through arguments. MAJNUM
- * will be the major revision number of the library, MINNUM the
- * minor revision number, and RELNUM the release revision number.
+ * Purpose: Returns the library version numbers through arguments. MAJNUM
+ * will be the major revision number of the library, MINNUM the
+ * minor revision number, and RELNUM the release revision number.
*
- * Note: When printing an HDF5 version number it should be printed as
+ * Note: When printing an HDF5 version number it should be printed as
*
- * printf("%u.%u.%u", maj, min, rel) or
- * printf("version %u.%u release %u", maj, min, rel)
+ * printf("%u.%u.%u", maj, min, rel) or
+ * printf("version %u.%u release %u", maj, min, rel)
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
@@ -881,17 +878,20 @@ done:
} /* end H5get_libversion() */
/*-------------------------------------------------------------------------
- * Function: H5check_version
+ * Function: H5check_version
*
- * Purpose: Verifies that the arguments match the version numbers
- * compiled into the library. This function is intended to be
- * called from user to verify that the versions of header files
- * compiled into the application match the version of the hdf5
- * library.
+ * Purpose: Verifies that the arguments match the version numbers
+ * compiled into the library. This function is intended to be
+ * called from user to verify that the versions of header files
+ * compiled into the application match the version of the hdf5
+ * library.
+ * Within major.minor.release version, the expectation
+ * is that all release versions are compatible, exceptions to
+ * this rule must be added to the VERS_RELEASE_EXCEPTIONS list.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: abort()
+ * Failure: abort()
*
*-------------------------------------------------------------------------
*/
@@ -904,6 +904,15 @@ done:
"linked with a different version of static or shared HDF5 library.\n" \
"You should recompile the application or check your shared library related\n" \
"settings such as 'LD_LIBRARY_PATH'.\n"
+#define RELEASE_MISMATCH_WARNING \
+ "Warning! ***HDF5 library release mismatched error***\n" \
+ "The HDF5 header files used to compile this application are not compatible with\n" \
+ "the version used by the HDF5 library to which this application is linked.\n" \
+ "Data corruption or segmentation faults may occur if the application continues.\n" \
+ "This can happen when an application was compiled by one version of HDF5 but\n" \
+ "linked with an incompatible version of static or shared HDF5 library.\n" \
+ "You should recompile the application or check your shared library related\n" \
+ "settings such as 'LD_LIBRARY_PATH'.\n"
herr_t
H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
@@ -932,7 +941,11 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
disable_version_check = (unsigned int)HDstrtol(s, NULL, 0);
}
- if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE != relnum) {
+ /* H5_VERS_MAJOR and H5_VERS_MINOR must match */
+ /* Cast relnum to int to avoid warning for unsigned < 0 comparison
+ * in first release versions */
+ if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE > (int)relnum) {
+
switch (disable_version_check) {
case 0:
HDfprintf(stderr, "%s%s", version_mismatch_warning,
@@ -967,7 +980,51 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
break;
} /* end switch */
- } /* end if */
+ } /* end if (H5_VERS_MAJOR != majnum || H5_VERS_MINOR != minnum || H5_VERS_RELEASE > relnum) */
+
+ /* H5_VERS_RELEASE should be compatible, we will only add checks for exceptions */
+ if (H5_VERS_RELEASE != relnum) {
+ for (unsigned i = 0; i < VERS_RELEASE_EXCEPTIONS_SIZE; i++) {
+ /* Check for incompatible headers or incompatible library */
+ if (VERS_RELEASE_EXCEPTIONS[i] == relnum || VERS_RELEASE_EXCEPTIONS[i] == H5_VERS_RELEASE) {
+ switch (disable_version_check) {
+ case 0:
+ HDfprintf(
+ stderr, "%s%s", version_mismatch_warning,
+ "You can, at your own risk, disable this warning by setting the environment\n"
+ "variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.\n"
+ "Setting it to 2 or higher will suppress the warning messages totally.\n");
+ /* Mention the versions we are referring to */
+ HDfprintf(stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum,
+ relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR,
+ (unsigned)H5_VERS_RELEASE);
+
+ /* Bail out now. */
+ HDfputs("Bye...\n", stderr);
+ HDabort();
+ case 1:
+ /* continue with a warning */
+ /* Note that the warning message is embedded in the format string.*/
+ HDfprintf(stderr,
+ "%s'HDF5_DISABLE_VERSION_CHECK' "
+ "environment variable is set to %d, application will\n"
+ "continue at your own risk.\n",
+ version_mismatch_warning, disable_version_check);
+ /* Mention the versions we are referring to */
+ HDfprintf(stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum,
+ relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR,
+ (unsigned)H5_VERS_RELEASE);
+ break;
+ default:
+ /* 2 or higher: continue silently */
+ break;
+ } /* end switch */
+
+ } /* end if */
+
+ } /* end for */
+
+ } /* end if (H5_VERS_RELEASE != relnum) */
/* Indicate that the version check has been performed */
checked = 1;
@@ -978,13 +1035,10 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
* Check only the first sizeof(lib_str) char. Assume the information
* will fit within this size or enough significance.
*/
- HDsnprintf(lib_str, sizeof(lib_str), "HDF5 library version: %d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR,
- H5_VERS_RELEASE);
- if (*substr) {
- HDstrncat(lib_str, "-", (size_t)1);
- HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1);
- } /* end if */
- if (HDstrcmp(lib_str, H5_lib_vers_info_g)) {
+ HDsnprintf(lib_str, sizeof(lib_str), "HDF5 library version: %d.%d.%d%s%s", H5_VERS_MAJOR,
+ H5_VERS_MINOR, H5_VERS_RELEASE, (*substr ? "-" : ""), substr);
+
+ if (HDstrcmp(lib_str, H5_lib_vers_info_g) != 0) {
HDfputs("Warning! Library version information error.\n"
"The HDF5 library version information are not "
"consistent in its source code.\nThis is NOT a fatal error "
@@ -1012,7 +1066,7 @@ done:
* is failing inexplicably, then try calling this function
* first.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
@@ -1031,12 +1085,12 @@ done:
} /* end H5open() */
/*-------------------------------------------------------------------------
- * Function: H5atclose
+ * Function: H5atclose
*
- * Purpose: Register a callback for the library to invoke when it's
- * closing. Callbacks are invoked in LIFO order.
+ * Purpose: Register a callback for the library to invoke when it's
+ * closing. Callbacks are invoked in LIFO order.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
@@ -1070,11 +1124,11 @@ done:
} /* end H5atclose() */
/*-------------------------------------------------------------------------
- * Function: H5close
+ * Function: H5close
*
- * Purpose: Terminate the library and release all resources.
+ * Purpose: Terminate the library and release all resources.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
@@ -1095,9 +1149,9 @@ H5close(void)
} /* end H5close() */
/*-------------------------------------------------------------------------
- * Function: H5allocate_memory
+ * Function: H5allocate_memory
*
- * Purpose: Allocate a memory buffer with the semantics of malloc().
+ * Purpose: Allocate a memory buffer with the semantics of malloc().
*
* NOTE: This function is intended for use with filter
* plugins so that all allocation and free operations
@@ -1135,9 +1189,9 @@ H5allocate_memory(size_t size, hbool_t clear)
} /* end H5allocate_memory() */
/*-------------------------------------------------------------------------
- * Function: H5resize_memory
+ * Function: H5resize_memory
*
- * Purpose: Resize a memory buffer with the semantics of realloc().
+ * Purpose: Resize a memory buffer with the semantics of realloc().
*
* NOTE: This function is intended for use with filter
* plugins so that all allocation and free operations
@@ -1172,14 +1226,14 @@ H5resize_memory(void *mem, size_t size)
} /* end H5resize_memory() */
/*-------------------------------------------------------------------------
- * Function: H5free_memory
+ * Function: H5free_memory
*
- * Purpose: Frees memory allocated by the library that it is the user's
+ * Purpose: Frees memory allocated by the library that it is the user's
* responsibility to free. Ensures that the same library
* that was used to allocate the memory frees it. Passing
* NULL pointers is allowed.
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -1196,12 +1250,12 @@ H5free_memory(void *mem)
} /* end H5free_memory() */
/*-------------------------------------------------------------------------
- * Function: H5is_library_threadsafe
+ * Function: H5is_library_threadsafe
*
- * Purpose: Checks to see if the library was built with thread-safety
+ * Purpose: Checks to see if the library was built with thread-safety
* enabled.
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -1227,16 +1281,16 @@ H5is_library_threadsafe(hbool_t *is_ts /*out*/)
} /* end H5is_library_threadsafe() */
/*-------------------------------------------------------------------------
- * Function: H5is_library_terminating
+ * Function: H5is_library_terminating
*
- * Purpose: Checks to see if the library is shutting down.
+ * Purpose: Checks to see if the library is shutting down.
*
- * Note: Useful for plugins to detect when the library is terminating.
- * For example, a VOL connector could check if a "file close"
- * callback was the result of the library shutdown process, or
- * an API action from the application.
+ * Note: Useful for plugins to detect when the library is terminating.
+ * For example, a VOL connector could check if a "file close"
+ * callback was the result of the library shutdown process, or
+ * an API action from the application.
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5A.c b/src/H5A.c
index a6b4350..c986d1f 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -276,7 +276,7 @@ H5Acreate_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, attr_name, type_id, space_id, acpl_id, aapl_id, es_id)) < 0) {
+ H5ARG_TRACE10(__func__, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, attr_name, type_id, space_id, acpl_id, aapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID")
@@ -320,7 +320,7 @@ H5A__create_by_name_api_common(hid_t loc_id, const char *obj_name, const char *a
/* obj_name is verified in H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, obj_name, H5P_CLS_LACC, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, obj_name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
/* Verify access property list and set up collective metadata if appropriate */
@@ -425,7 +425,7 @@ H5Acreate_by_name_async(const char *app_file, const char *app_func, unsigned app
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE12(FUNC, "*s*sIui*s*siiiiii", app_file, app_func, app_line, loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id, es_id)) < 0) {
+ H5ARG_TRACE12(__func__, "*s*sIui*s*siiiiii", app_file, app_func, app_line, loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID")
@@ -588,7 +588,7 @@ H5Aopen_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, attr_name, aapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, attr_name, aapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID")
@@ -630,7 +630,7 @@ H5A__open_by_name_api_common(hid_t loc_id, const char *obj_name, const char *att
/* obj_name is verified in H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, obj_name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, obj_name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
/* Verify access property list and set up collective metadata if appropriate */
@@ -719,7 +719,7 @@ H5Aopen_by_name_async(const char *app_file, const char *app_func, unsigned app_l
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE9(FUNC, "*s*sIui*s*siii", app_file, app_func, app_line, loc_id, obj_name, attr_name, aapl_id, lapl_id, es_id)) < 0) {
+ H5ARG_TRACE9(__func__, "*s*sIui*s*siii", app_file, app_func, app_line, loc_id, obj_name, attr_name, aapl_id, lapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID")
@@ -764,8 +764,8 @@ H5A__open_by_idx_api_common(hid_t loc_id, const char *obj_name, H5_index_t idx_t
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid iteration order specified")
/* Set up object access arguments */
- if (H5VL_setup_idx_args(loc_id, obj_name, idx_type, order, n, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr,
- &loc_params) < 0)
+ if (H5VL_setup_idx_args(loc_id, obj_name, idx_type, order, n, FALSE, lapl_id, vol_obj_ptr, &loc_params) <
+ 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
/* Verify access property list and set up collective metadata if appropriate */
@@ -859,7 +859,7 @@ H5Aopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_li
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE11(FUNC, "*s*sIui*sIiIohiii", app_file, app_func, app_line, loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id, es_id)) < 0) {
+ H5ARG_TRACE11(__func__, "*s*sIui*sIiIohiii", app_file, app_func, app_line, loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID")
@@ -971,7 +971,7 @@ H5Awrite_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0)
+ H5ARG_TRACE7(__func__, "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1057,7 +1057,7 @@ done:
*--------------------------------------------------------------------------*/
herr_t
H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id, hid_t dtype_id,
- void *buf, hid_t es_id)
+ void *buf /*out*/, hid_t es_id)
{
H5VL_object_t *vol_obj = NULL; /* Object for attr_id */
void * token = NULL; /* Request token for async operation */
@@ -1065,7 +1065,7 @@ H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE7("e", "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id);
+ H5TRACE7("e", "*s*sIuiixi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id);
/* Set up request token pointer for asynchronous operation */
if (H5ES_NONE != es_id)
@@ -1079,7 +1079,7 @@ H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0)
+ H5ARG_TRACE7(__func__, "*s*sIuiixi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1106,8 +1106,9 @@ done:
hid_t
H5Aget_space(hid_t attr_id)
{
- H5VL_object_t *vol_obj = NULL; /* Attribute object for ID */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", attr_id);
@@ -1116,11 +1117,17 @@ H5Aget_space(hid_t attr_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an attribute")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_SPACE;
+ vol_cb_args.args.get_space.space_id = H5I_INVALID_HID;
+
/* Get the dataspace */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_SPACE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) <
- 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5I_INVALID_HID, "unable to get dataspace of attribute")
+ /* Set the return value */
+ ret_value = vol_cb_args.args.get_space.space_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5Aget_space() */
@@ -1144,8 +1151,9 @@ done:
hid_t
H5Aget_type(hid_t attr_id)
{
- H5VL_object_t *vol_obj = NULL; /* Attribute object for ID */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", attr_id);
@@ -1154,10 +1162,17 @@ H5Aget_type(hid_t attr_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an attribute")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_TYPE;
+ vol_cb_args.args.get_type.type_id = H5I_INVALID_HID;
+
/* Get the datatype */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5I_INVALID_HID, "unable to get datatype of attribute")
+ /* Set the return value */
+ ret_value = vol_cb_args.args.get_type.type_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5Aget_type() */
@@ -1184,8 +1199,9 @@ done:
hid_t
H5Aget_create_plist(hid_t attr_id)
{
- H5VL_object_t *vol_obj = NULL; /* Attribute object for ID */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", attr_id);
@@ -1196,11 +1212,18 @@ H5Aget_create_plist(hid_t attr_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an attribute")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_ACPL;
+ vol_cb_args.args.get_acpl.acpl_id = H5I_INVALID_HID;
+
/* Get the acpl */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_ACPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5I_INVALID_HID,
"unable to get creation property list for attribute")
+ /* Set the return value */
+ ret_value = vol_cb_args.args.get_acpl.acpl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Aget_create_plist() */
@@ -1229,9 +1252,10 @@ done:
ssize_t
H5Aget_name(hid_t attr_id, size_t buf_size, char *buf /*out*/)
{
- H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
- H5VL_loc_params_t loc_params;
- ssize_t ret_value = -1;
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ size_t attr_name_len = 0; /* Length of attribute name */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE3("Zs", "izx", attr_id, buf_size, buf);
@@ -1242,15 +1266,21 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf /*out*/)
if (!buf && buf_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "buf cannot be NULL if buf_size is non-zero")
- /* Set location struct parameters */
- loc_params.type = H5VL_OBJECT_BY_SELF;
- loc_params.obj_type = H5I_get_type(attr_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_NAME;
+ vol_cb_args.args.get_name.loc_params.type = H5VL_OBJECT_BY_SELF;
+ vol_cb_args.args.get_name.loc_params.obj_type = H5I_get_type(attr_id);
+ vol_cb_args.args.get_name.buf_size = buf_size;
+ vol_cb_args.args.get_name.buf = buf;
+ vol_cb_args.args.get_name.attr_name_len = &attr_name_len;
/* Get the attribute name */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
- buf_size, buf, &ret_value) < 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, (-1), "unable to get attribute name")
+ /* Set the return value */
+ ret_value = (ssize_t)attr_name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5Aget_name() */
@@ -1276,9 +1306,10 @@ 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 /*out*/, size_t size, hid_t lapl_id)
{
- H5VL_object_t * vol_obj;
- H5VL_loc_params_t loc_params;
- ssize_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ size_t attr_name_len = 0; /* Length of attribute name */
+ ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("Zs", "i*sIiIohxzi", loc_id, obj_name, idx_type, order, n, name, size, lapl_id);
@@ -1303,19 +1334,26 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
- loc_params.type = H5VL_OBJECT_BY_IDX;
- loc_params.loc_data.loc_by_idx.name = obj_name;
- loc_params.loc_data.loc_by_idx.idx_type = idx_type;
- loc_params.loc_data.loc_by_idx.order = order;
- loc_params.loc_data.loc_by_idx.n = n;
- loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
- loc_params.obj_type = H5I_get_type(loc_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_NAME;
+ vol_cb_args.args.get_name.loc_params.type = H5VL_OBJECT_BY_IDX;
+ vol_cb_args.args.get_name.loc_params.loc_data.loc_by_idx.name = obj_name;
+ vol_cb_args.args.get_name.loc_params.loc_data.loc_by_idx.idx_type = idx_type;
+ vol_cb_args.args.get_name.loc_params.loc_data.loc_by_idx.order = order;
+ vol_cb_args.args.get_name.loc_params.loc_data.loc_by_idx.n = n;
+ vol_cb_args.args.get_name.loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
+ vol_cb_args.args.get_name.loc_params.obj_type = H5I_get_type(loc_id);
+ vol_cb_args.args.get_name.buf_size = size;
+ vol_cb_args.args.get_name.buf = name;
+ vol_cb_args.args.get_name.attr_name_len = &attr_name_len;
/* Get the name */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
- size, name, &ret_value) < 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get name")
+ /* Set the return value */
+ ret_value = (ssize_t)attr_name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Aget_name_by_idx() */
@@ -1340,8 +1378,10 @@ done:
hsize_t
H5Aget_storage_size(hid_t attr_id)
{
- H5VL_object_t *vol_obj;
- hsize_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hsize_t storage_size = 0; /* Storage size of attribute */
+ hsize_t ret_value; /* Return value */
FUNC_ENTER_API(0)
H5TRACE1("h", "i", attr_id);
@@ -1350,10 +1390,16 @@ H5Aget_storage_size(hid_t attr_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an attribute")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_STORAGE_SIZE;
+ vol_cb_args.args.get_storage_size.data_size = &storage_size;
+
/* Get the storage size */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_STORAGE_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, 0, "unable to get acpl")
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, 0, "unable to get storage size")
+
+ /* Set the return value */
+ ret_value = storage_size;
done:
FUNC_LEAVE_API(ret_value)
@@ -1375,9 +1421,9 @@ done:
herr_t
H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/)
{
- H5VL_object_t * vol_obj;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", attr_id, ainfo);
@@ -1388,12 +1434,15 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/)
if (!ainfo)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "attribute_info parameter cannot be NULL")
- loc_params.type = H5VL_OBJECT_BY_SELF;
- loc_params.obj_type = H5I_get_type(attr_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_INFO;
+ vol_cb_args.args.get_info.loc_params.type = H5VL_OBJECT_BY_SELF;
+ vol_cb_args.args.get_info.loc_params.obj_type = H5I_get_type(attr_id);
+ vol_cb_args.args.get_info.attr_name = NULL;
+ vol_cb_args.args.get_info.ainfo = ainfo;
/* Get the attribute information */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
- ainfo) < 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
done:
@@ -1417,9 +1466,9 @@ herr_t
H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo /*out*/,
hid_t lapl_id)
{
- H5VL_object_t * vol_obj;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*s*sxi", loc_id, obj_name, attr_name, ainfo, lapl_id);
@@ -1438,18 +1487,21 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
- loc_params.type = H5VL_OBJECT_BY_NAME;
- loc_params.loc_data.loc_by_name.name = obj_name;
- loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
- loc_params.obj_type = H5I_get_type(loc_id);
-
/* Get the object */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_INFO;
+ vol_cb_args.args.get_info.loc_params.type = H5VL_OBJECT_BY_NAME;
+ vol_cb_args.args.get_info.loc_params.loc_data.loc_by_name.name = obj_name;
+ vol_cb_args.args.get_info.loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
+ vol_cb_args.args.get_info.loc_params.obj_type = H5I_get_type(loc_id);
+ vol_cb_args.args.get_info.attr_name = attr_name;
+ vol_cb_args.args.get_info.ainfo = ainfo;
+
/* Get the attribute information */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
- ainfo, attr_name) < 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
done:
@@ -1474,9 +1526,9 @@ 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 /*out*/, hid_t lapl_id)
{
- H5VL_object_t * vol_obj;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
+ H5VL_attr_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIohxi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id);
@@ -1497,21 +1549,24 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
- loc_params.type = H5VL_OBJECT_BY_IDX;
- loc_params.loc_data.loc_by_idx.name = obj_name;
- loc_params.loc_data.loc_by_idx.idx_type = idx_type;
- loc_params.loc_data.loc_by_idx.order = order;
- loc_params.loc_data.loc_by_idx.n = n;
- loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
- loc_params.obj_type = H5I_get_type(loc_id);
-
/* Get the object */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_GET_INFO;
+ vol_cb_args.args.get_info.loc_params.type = H5VL_OBJECT_BY_IDX;
+ vol_cb_args.args.get_info.loc_params.loc_data.loc_by_idx.name = obj_name;
+ vol_cb_args.args.get_info.loc_params.loc_data.loc_by_idx.idx_type = idx_type;
+ vol_cb_args.args.get_info.loc_params.loc_data.loc_by_idx.order = order;
+ vol_cb_args.args.get_info.loc_params.loc_data.loc_by_idx.n = n;
+ vol_cb_args.args.get_info.loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
+ vol_cb_args.args.get_info.loc_params.obj_type = H5I_get_type(loc_id);
+ vol_cb_args.args.get_info.attr_name = NULL;
+ vol_cb_args.args.get_info.ainfo = ainfo;
+
/* Get the attribute information */
- if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
- ainfo) < 0)
+ if (H5VL_attr_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
done:
@@ -1541,12 +1596,19 @@ H5A__rename_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const
HDassert(new_name);
/* Avoid thrashing things if the names are the same */
- if (HDstrcmp(old_name, new_name))
+ if (HDstrcmp(old_name, new_name) != 0) {
+ H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_RENAME;
+ vol_cb_args.args.rename.old_name = old_name;
+ vol_cb_args.args.rename.new_name = new_name;
+
/* Rename the attribute */
- if (H5VL_attr_specific(vol_obj, loc_params, H5VL_ATTR_RENAME, H5P_DATASET_XFER_DEFAULT, token_ptr,
- old_name, new_name) < 0)
+ if (H5VL_attr_specific(vol_obj, loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute from '%s' to '%s'", old_name,
new_name)
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1657,7 +1719,7 @@ H5Arename_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*s*si", app_file, app_func, app_line, loc_id, old_name, new_name, es_id)) < 0)
+ H5ARG_TRACE7(__func__, "*s*sIui*s*si", app_file, app_func, app_line, loc_id, old_name, new_name, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1700,7 +1762,7 @@ H5A__rename_by_name_api_common(hid_t loc_id, const char *obj_name, const char *o
/* obj_name is verified in H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, obj_name, H5P_CLS_LACC, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, obj_name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set object access arguments")
/* Rename the attribute */
@@ -1777,7 +1839,7 @@ H5Arename_by_name_async(const char *app_file, const char *app_func, unsigned app
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE9(FUNC, "*s*sIui*s*s*sii", app_file, app_func, app_line, loc_id, obj_name, old_attr_name, new_attr_name, lapl_id, es_id)) < 0)
+ H5ARG_TRACE9(__func__, "*s*sIui*s*s*sii", app_file, app_func, app_line, loc_id, obj_name, old_attr_name, new_attr_name, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1830,14 +1892,15 @@ herr_t
H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx /*in,out */,
H5A_operator2_t op, void *op_data)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "iIiIo*hAO*x", loc_id, idx_type, order, idx, op, op_data);
- /* check arguments */
+ /* Check arguments */
if (H5I_ATTR == H5I_get_type(loc_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
@@ -1845,16 +1908,25 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *i
if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ /* Get the loc object */
+ if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set the location access parameters */
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(loc_id);
- /* get the loc object */
- if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_ITER;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx = idx;
+ vol_cb_args.args.iterate.op = op;
+ vol_cb_args.args.iterate.op_data = op_data;
/* Iterate over attributes */
- if ((ret_value = H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, idx, op, op_data)) < 0)
+ if ((ret_value = H5VL_attr_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes");
done:
@@ -1908,9 +1980,10 @@ 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 /*in,out */, H5A_operator2_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object location */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIo*hAO*xi", loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id);
@@ -1929,18 +2002,27 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* get the loc object */
+ if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set the location access parameters */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.obj_type = H5I_get_type(loc_id);
loc_params.loc_data.loc_by_name.name = obj_name;
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
- /* get the loc object */
- if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_ITER;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx = idx;
+ vol_cb_args.args.iterate.op = op;
+ vol_cb_args.args.iterate.op_data = op_data;
/* Iterate over attributes */
- if ((ret_value = H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, idx, op, op_data)) < 0)
+ if ((ret_value = H5VL_attr_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HERROR(H5E_ATTR, H5E_BADITER, "attribute iteration failed");
done:
@@ -1964,9 +2046,10 @@ done:
herr_t
H5Adelete(hid_t loc_id, const char *name)
{
- H5VL_object_t * vol_obj = NULL;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*s", loc_id, name);
@@ -1983,17 +2066,20 @@ H5Adelete(hid_t loc_id, const char *name)
if (H5CX_set_loc(loc_id) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read")
- /* Fill in location struct fields */
- loc_params.type = H5VL_OBJECT_BY_SELF;
- loc_params.obj_type = H5I_get_type(loc_id);
-
/* Get the object */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set the location access parameters */
+ loc_params.type = H5VL_OBJECT_BY_SELF;
+ loc_params.obj_type = H5I_get_type(loc_id);
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_DELETE;
+ vol_cb_args.args.del.name = name;
+
/* Delete the attribute */
- if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- name) < 0)
+ if (H5VL_attr_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
done:
@@ -2019,9 +2105,10 @@ done:
herr_t
H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id)
{
- H5VL_object_t * vol_obj;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*s*si", loc_id, obj_name, attr_name, lapl_id);
@@ -2038,19 +2125,22 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
- /* Fill in location struct fields */
+ /* Get the object */
+ if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+
+ /* Set the location access parameters */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.loc_data.loc_by_name.name = obj_name;
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
loc_params.obj_type = H5I_get_type(loc_id);
- /* Get the object */
- if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_DELETE;
+ vol_cb_args.args.del.name = attr_name;
/* Delete the attribute */
- if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- attr_name) < 0)
+ if (H5VL_attr_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
done:
@@ -2085,9 +2175,10 @@ 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)
{
- H5VL_object_t * vol_obj;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "i*sIiIohi", loc_id, obj_name, idx_type, order, n, lapl_id);
@@ -2106,21 +2197,24 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_ite
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
- loc_params.type = H5VL_OBJECT_BY_IDX;
- loc_params.loc_data.loc_by_idx.name = obj_name;
- loc_params.loc_data.loc_by_idx.idx_type = idx_type;
- loc_params.loc_data.loc_by_idx.order = order;
- loc_params.loc_data.loc_by_idx.n = n;
- loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
- loc_params.obj_type = H5I_get_type(loc_id);
-
/* get the object */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set the location access parameters */
+ loc_params.type = H5VL_OBJECT_BY_NAME;
+ loc_params.loc_data.loc_by_name.name = obj_name;
+ loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
+ loc_params.obj_type = H5I_get_type(loc_id);
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_DELETE_BY_IDX;
+ vol_cb_args.args.delete_by_idx.idx_type = idx_type;
+ vol_cb_args.args.delete_by_idx.order = order;
+ vol_cb_args.args.delete_by_idx.n = n;
+
/* Delete the attribute */
- if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- NULL) < 0)
+ if (H5VL_attr_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
done:
@@ -2210,7 +2304,7 @@ H5Aclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, attr_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, attr_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -2233,7 +2327,8 @@ static herr_t
H5A__exists_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const char *attr_name,
hbool_t *attr_exists, void **token_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_attr_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -2245,9 +2340,13 @@ H5A__exists_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const
if (!attr_name || !*attr_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_ATTR_EXISTS;
+ vol_cb_args.args.exists.name = attr_name;
+ vol_cb_args.args.exists.exists = attr_exists;
+
/* Check if the attribute exists */
- if (H5VL_attr_specific(vol_obj, loc_params, H5VL_ATTR_EXISTS, H5P_DATASET_XFER_DEFAULT, token_ptr,
- attr_name, attr_exists) < 0)
+ if (H5VL_attr_specific(vol_obj, loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists")
done:
@@ -2361,7 +2460,7 @@ H5Aexists_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*s*bi", app_file, app_func, app_line, obj_id, attr_name, attr_exists, es_id)) < 0)
+ H5ARG_TRACE7(__func__, "*s*sIui*s*bi", app_file, app_func, app_line, obj_id, attr_name, attr_exists, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -2400,7 +2499,7 @@ H5A__exists_by_name_api_common(hid_t loc_id, const char *obj_name, const char *a
/* obj_name is verified in H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, obj_name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, obj_name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set object access arguments")
/* Check if the attribute exists */
@@ -2480,7 +2579,7 @@ H5Aexists_by_name_async(const char *app_file, const char *app_func, unsigned app
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE9(FUNC, "*s*sIui*s*s*bii", app_file, app_func, app_line, loc_id, obj_name, attr_name, attr_exists, lapl_id, es_id)) < 0)
+ H5ARG_TRACE9(__func__, "*s*sIui*s*s*bii", app_file, app_func, app_line, loc_id, obj_name, attr_name, attr_exists, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
diff --git a/src/H5AC.c b/src/H5AC.c
index ffdca78..1c75aff 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -43,7 +43,6 @@
#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* Files */
-#include "H5FDprivate.h" /* File drivers */
#include "H5Iprivate.h" /* IDs */
#include "H5Pprivate.h" /* Property lists */
#include "H5SLprivate.h" /* Skip Lists */
@@ -61,8 +60,8 @@
/********************/
static herr_t H5AC__check_if_write_permitted(const H5F_t *f, hbool_t *write_permitted_ptr);
-static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr,
- H5C_auto_size_ctl_t *int_conf_ptr);
+static herr_t H5AC__ext_config_2_int_config(const H5AC_cache_config_t *ext_conf_ptr,
+ H5C_auto_size_ctl_t * int_conf_ptr);
#if H5AC_DO_TAGGING_SANITY_CHECKS
static herr_t H5AC__verify_tag(const H5AC_class_t *type);
#endif /* H5AC_DO_TAGGING_SANITY_CHECKS */
@@ -350,19 +349,14 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
if (NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list")
- if (aux_ptr != NULL)
- if (aux_ptr->mpi_rank == 0)
- f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE,
- (H5AC_NTYPES - 1), H5AC_class_s, H5AC__check_if_write_permitted,
- TRUE, H5AC__log_flushed_entry, (void *)aux_ptr);
- else
- f->shared->cache =
- H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1),
- H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, (void *)aux_ptr);
+ if (aux_ptr->mpi_rank == 0)
+ f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE,
+ (H5AC_NTYPES - 1), H5AC_class_s, H5AC__check_if_write_permitted,
+ TRUE, H5AC__log_flushed_entry, (void *)aux_ptr);
else
f->shared->cache =
H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, H5AC__DEFAULT_MIN_CLEAN_SIZE, (H5AC_NTYPES - 1),
- H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, NULL);
+ H5AC_class_s, H5AC__check_if_write_permitted, TRUE, NULL, (void *)aux_ptr);
} /* end if */
else {
#endif /* H5_HAVE_PARALLEL */
@@ -1802,14 +1796,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr,
- uint32_t *cur_num_entries_ptr)
+H5AC_get_cache_size(const H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
+ size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if (H5C_get_cache_size((H5C_t *)cache_ptr, max_size_ptr, min_clean_size_ptr, cur_size_ptr,
+ if (H5C_get_cache_size((const H5C_t *)cache_ptr, max_size_ptr, min_clean_size_ptr, cur_size_ptr,
cur_num_entries_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed")
@@ -1856,13 +1850,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr)
+H5AC_get_cache_hit_rate(const H5AC_t *cache_ptr, double *hit_rate_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if (H5C_get_cache_hit_rate((H5C_t *)cache_ptr, hit_rate_ptr) < 0)
+ if (H5C_get_cache_hit_rate((const H5C_t *)cache_ptr, hit_rate_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed")
done:
@@ -1908,7 +1902,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr)
+H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, const H5AC_cache_config_t *config_ptr)
{
H5C_auto_size_ctl_t internal_config;
herr_t ret_value = SUCCEED; /* Return value */
@@ -2009,7 +2003,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_validate_config(H5AC_cache_config_t *config_ptr)
+H5AC_validate_config(const H5AC_cache_config_t *config_ptr)
{
H5C_auto_size_ctl_t internal_config;
herr_t ret_value = SUCCEED; /* Return value */
@@ -2190,7 +2184,7 @@ H5AC__check_if_write_permitted(const H5F_t
*-------------------------------------------------------------------------
*/
static herr_t
-H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, H5C_auto_size_ctl_t *int_conf_ptr)
+H5AC__ext_config_2_int_config(const H5AC_cache_config_t *ext_conf_ptr, H5C_auto_size_ctl_t *int_conf_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2751,13 +2745,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len)
+H5AC_get_mdc_image_info(const H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if (H5C_get_mdc_image_info((H5C_t *)cache_ptr, image_addr, image_len) < 0)
+ if (H5C_get_mdc_image_info((const H5C_t *)cache_ptr, image_addr, image_len) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve cache image info")
done:
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c
index 140fd96..7d2ba25 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -1271,7 +1271,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f)
if (aux_ptr->write_done)
(aux_ptr->write_done)();
- /* to prevent "messages from the past" we must synchronize all
+ /* To prevent "messages from the past" we must synchronize all
* processes again before we go on.
*/
if (MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
@@ -1514,7 +1514,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't receive clean list")
if (num_entries > 0)
- /* mark the indicated entries as clean */
+ /* Mark the indicated entries as clean */
if (H5C_mark_entries_as_clean(f, num_entries, haddr_buf_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.")
@@ -1900,28 +1900,22 @@ H5AC__rsp__p0_only__flush(H5F_t *f)
/* Check for error on the write operation */
if (result < 0)
-
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")
/* this code exists primarily for the test bed -- it allows us to
* enforce POSIX semantics on the server that pretends to be a
* file system in our parallel tests.
*/
- if (aux_ptr->write_done) {
-
+ if (aux_ptr->write_done)
(aux_ptr->write_done)();
- }
} /* end if */
/* Propagate cleaned entries to other ranks. */
if (H5AC__propagate_flushed_and_still_clean_entries_list(f) < 0)
-
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.")
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC__rsp__p0_only__flush() */
/*-------------------------------------------------------------------------
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index 12e5bb2..e9b8a47 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -275,24 +275,24 @@ typedef struct H5AC_proxy_entry_t {
/* size_t min_size = */ ( 1 * 1024 * 1024), \
/* long int epoch_length = */ 50000, \
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \
- /* double lower_hr_threshold = */ 0.9f, \
- /* double increment = */ 2.0f, \
+ /* double lower_hr_threshold = */ 0.9, \
+ /* double increment = */ 2.0, \
/* hbool_t apply_max_increment = */ TRUE, \
/* size_t max_increment = */ (4 * 1024 * 1024), \
/* enum H5C_cache_flash_incr_mode */ \
/* flash_incr_mode = */ H5C_flash_incr__add_space, \
- /* double flash_multiple = */ 1.4f, \
- /* double flash_threshold = */ 0.25f, \
+ /* double flash_multiple = */ 1.4, \
+ /* double flash_threshold = */ 0.25, \
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,\
- /* double upper_hr_threshold = */ 0.999f, \
- /* double decrement = */ 0.9f, \
+ /* double upper_hr_threshold = */ 0.999, \
+ /* double decrement = */ 0.9, \
/* hbool_t apply_max_decrement = */ TRUE, \
/* size_t max_decrement = */ (1 * 1024 * 1024), \
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
- /* double empty_reserve = */ 0.1f, \
+ /* double empty_reserve = */ 0.1, \
/* size_t dirty_bytes_threshold = */ (256 * 1024), \
- /* int metadata_write_strategy = */ \
+ /* int metadata_write_strategy = */ \
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
#endif /* H5_HAVE_PARALLEL */
@@ -404,20 +404,20 @@ H5_DLL herr_t H5AC_evict(H5F_t *f);
H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, unsigned flags);
H5_DLL herr_t H5AC_remove_entry(void *entry);
H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr);
-H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
+H5_DLL herr_t H5AC_get_cache_size(const H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr);
H5_DLL herr_t H5AC_get_cache_flush_in_progress(H5AC_t *cache_ptr, hbool_t *flush_in_progress_ptr);
-H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr);
+H5_DLL herr_t H5AC_get_cache_hit_rate(const H5AC_t *cache_ptr, double *hit_rate_ptr);
H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr);
-H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr);
-H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr);
+H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, const H5AC_cache_config_t *config_ptr);
+H5_DLL herr_t H5AC_validate_config(const H5AC_cache_config_t *config_ptr);
/* Cache image routines */
H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw);
H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr);
H5_DLL hbool_t H5AC_cache_image_pending(const H5F_t *f);
H5_DLL herr_t H5AC_force_cache_image_load(H5F_t *f);
-H5_DLL herr_t H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len);
+H5_DLL herr_t H5AC_get_mdc_image_info(const H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len);
/* Tag & Ring routines */
H5_DLL void H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag);
@@ -458,4 +458,4 @@ H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f);
H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring);
#endif /* NDEBUG */ /* end debugging functions */
-#endif /* !_H5ACprivate_H */
+#endif /* H5ACprivate_H */
diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h
index e6cebff..f8f4f28 100644
--- a/src/H5ACpublic.h
+++ b/src/H5ACpublic.h
@@ -442,124 +442,347 @@ extern "C" {
#define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY 0
#define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED 1
+/**
+ * H5AC_cache_config_t is a public structure intended for use in public APIs.
+ * At least in its initial incarnation, it is basically a copy of \c struct
+ * \c H5C_auto_size_ctl_t, minus the \c report_fcn field, and plus the
+ * \c dirty_bytes_threshold field.
+ *
+ * The \c report_fcn field is omitted, as including it would require us to make
+ * \c H5C_t structure public.
+ *
+ * The \c dirty_bytes_threshold field does not appear in \c H5C_auto_size_ctl_t,
+ * as synchronization between caches on different processes is handled at the \c
+ * H5AC level, not at the level of \c H5C. Note however that there is
+ * considerable interaction between this value and the other fields in this
+ * structure.
+ *
+ * Similarly, the \c open_trace_file, \c close_trace_file, and \c
+ * trace_file_name fields do not appear in \c H5C_auto_size_ctl_t, as most trace
+ * file issues are handled at the \c H5AC level. The one exception is storage
+ * of the pointer to the trace file, which is handled by \c H5C.
+ *
+ * The structure is in H5ACpublic.h as we may wish to allow different
+ * configuration options for metadata and raw data caches.
+ */
+
+//! <!-- [H5AC_cache_config_t_snip] -->
typedef struct H5AC_cache_config_t {
/* general configuration fields: */
+ //! <!-- [H5AC_cache_config_t_general_snip] -->
int version;
+ /**< Integer field indicating the the version of the H5AC_cache_config_t
+ * in use. This field should be set to #H5AC__CURR_CACHE_CONFIG_VERSION
+ * (defined in H5ACpublic.h). */
hbool_t rpt_fcn_enabled;
+ /**< Boolean flag indicating whether the adaptive cache resize report
+ * function is enabled. This field should almost always be set to disabled
+ * (0). Since resize algorithm activity is reported via stdout, it MUST be
+ * set to disabled (0) on Windows machines.\n
+ * The report function is not supported code, and can be expected to change
+ * between versions of the library. Use it at your own risk. */
hbool_t open_trace_file;
+ /**< Boolean field indicating whether the
+ * \ref H5AC_cache_config_t.trace_file_name "trace_file_name"
+ * field should be used to open a trace file for the cache.\n
+ * The trace file is a debugging feature that allows the capture
+ * of top level metadata cache requests for purposes of debugging
+ * and/or optimization. This field should normally be set to 0, as
+ * trace file collection imposes considerable overhead.\n
+ * This field should only be set to 1 when the
+ * \ref H5AC_cache_config_t.trace_file_name "trace_file_name"
+ * contains the full path of the desired trace file, and either
+ * there is no open trace file on the cache, or the
+ * \ref H5AC_cache_config_t.close_trace_file "close_trace_file"
+ * field is also 1.\n
+ * The trace file feature is unsupported unless used at the
+ * direction of The HDF Group. It is intended to allow The HDF
+ * Group to collect a trace of cache activity in cases of occult
+ * failures and/or poor performance seen in the field, so as to aid
+ * in reproduction in the lab. If you use it absent the direction
+ * of The HDF Group, you are on your own. */
+
hbool_t close_trace_file;
- char trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + 1];
+ /**< Boolean field indicating whether the current trace file
+ *(if any) should be closed.\n
+ * See the above comments on the \ref H5AC_cache_config_t.open_trace_file
+ * "open_trace_file" field. This field should be set to 0 unless there is
+ * an open trace file on the cache that you wish to close.\n
+ * The trace file feature is unsupported unless used at the direction of
+ * The HDF Group. It is intended to allow The HDF Group to collect a trace
+ * of cache activity in cases of occult failures and/or poor performance
+ * seen in the field, so as to aid in reproduction in the lab. If you use
+ * it absent the direction of The HDF Group, you are on your own. */
+
+ char trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + 1];
+ /**< Full path of the trace file to be opened if the
+ * \ref H5AC_cache_config_t.open_trace_file "open_trace_file" field is set
+ * to 1.\n
+ * In the parallel case, an ascii representation of the MPI rank of the
+ * process will be appended to the file name to yield a unique trace file
+ * name for each process.\n
+ * The length of the path must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN
+ * characters.\n
+ * The trace file feature is unsupported unless used at the direction of
+ * The HDF Group. It is intended to allow The HDF Group to collect a trace
+ * of cache activity in cases of occult failures and/or poor performance
+ * seen in the field, so as to aid in reproduction in the lab. If you use
+ * it absent the direction of The HDF Group, you are on your own. */
hbool_t evictions_enabled;
+ /**< A boolean flag indicating whether evictions from the metadata cache
+ * are enabled. This flag is initially set to enabled (1).\n
+ * In rare circumstances, the raw data throughput quirements may be so high
+ * that the user wishes to postpone metadata writes so as to reserve I/O
+ * throughput for raw data. The \p evictions_enabled field exists to allow
+ * this. However, this is an extreme step, and you have no business doing
+ * it unless you have read the User Guide section on metadata caching, and
+ * have considered all other options carefully.\n
+ * The \p evictions_enabled field may not be set to disabled (0)
+ * unless all adaptive cache resizing code is disabled via the
+ * \ref H5AC_cache_config_t.incr_mode "incr_mode",
+ * \ref H5AC_cache_config_t.flash_incr_mode "flash_incr_mode",
+ * \ref H5AC_cache_config_t.decr_mode "decr_mode" fields.\n
+ * When this flag is set to disabled (\c 0), the metadata cache will not
+ * attempt to evict entries to make space for new entries, and thus will
+ * grow without bound.\n
+ * Evictions will be re-enabled when this field is set back to \c 1.
+ * This should be done as soon as possible. */
hbool_t set_initial_size;
- size_t initial_size;
+ /**< Boolean flag indicating whether the cache should be created
+ * with a user specified initial size. */
+
+ size_t initial_size;
+ /**< If \ref H5AC_cache_config_t.set_initial_size "set_initial_size"
+ * is set to 1, \p initial_size must contain he desired initial size in
+ * bytes. This value must lie in the closed interval
+ * [ \p min_size, \p max_size ]. (see below) */
double min_clean_fraction;
+ /**< This field specifies the minimum fraction of the cache
+ * that must be kept either clean or empty.\n
+ * The value must lie in the interval [0.0, 1.0]. 0.01 is a good place to
+ * start in the serial case. In the parallel case, a larger value is needed
+ * -- see the overview of the metadata cache in the
+ * “Metadata Caching in HDF5” section of the -- <em>HDF5 User’s Guide</em>
+ * for details. */
size_t max_size;
+ /**< Upper bound (in bytes) on the range of values that the
+ * adaptive cache resize code can select as the maximum cache size. */
+
size_t min_size;
+ /**< Lower bound (in bytes) on the range of values that the
+ * adaptive cache resize code can select as the mininum cache * size. */
long int epoch_length;
+ /**< Number of cache accesses between runs of the adaptive cache resize
+ * code. 50,000 is a good starting number. */
+ //! <!-- [H5AC_cache_config_t_general_snip] -->
/* size increase control fields: */
+ //! <!-- [H5AC_cache_config_t_incr_snip] -->
enum H5C_cache_incr_mode incr_mode;
+ /**< Enumerated value indicating the operational mode of the automatic
+ * cache size increase code. At present, only two values listed in
+ * #H5C_cache_incr_mode are legal. */
double lower_hr_threshold;
+ /**< Hit rate threshold used by the hit rate threshold cache size
+ * increment algorithm.\n
+ * When the hit rate over an epoch is below this threshold and the cache
+ * is full, the maximum size of the cache is multiplied by increment
+ * (below), and then clipped as necessary to stay within \p max_size, and
+ * possibly \p max_increment.\n
+ * This field must lie in the interval [0.0, 1.0]. 0.8 or 0.9 is a good
+ * place to start. */
double increment;
+ /**< Factor by which the hit rate threshold cache size increment
+ * algorithm multiplies the current cache max size to obtain a tentative
+ * new cache size.\n
+ * The actual cache size increase will be clipped to satisfy the \p max_size
+ * specified in the general configuration, and possibly max_increment
+ * below.\n
+ * The parameter must be greater than or equal to 1.0 -- 2.0 is a reasonable
+ * value.\n
+ * If you set it to 1.0, you will effectively disable cache size increases.
+ */
hbool_t apply_max_increment;
- size_t max_increment;
+ /**< Boolean flag indicating whether an upper limit should be applied to
+ * the size of cache size increases. */
+
+ size_t max_increment;
+ /**< Maximum number of bytes by which cache size can be increased in a
+ * single step -- if applicable. */
enum H5C_cache_flash_incr_mode flash_incr_mode;
- double flash_multiple;
- double flash_threshold;
+ /**< Enumerated value indicating the operational mode of the flash cache
+ * size increase code. At present, only two listed values in
+ * #H5C_cache_flash_incr_mode are legal.*/
+
+ double flash_multiple;
+ /**< The factor by which the size of the triggering entry / entry size
+ * increase is multiplied to obtain the initial cache size increment. This
+ * increment may be reduced to reflect existing free space in the cache and
+ * the \p max_size field above.\n
+ * The parameter must lie in the interval [0.0, 1.0]. 0.1 or 0.05 is a good
+ * place to start.\n
+ * At present, this field must lie in the range [0.1, 10.0]. */
+
+ double flash_threshold;
+ /**< The factor by which the current maximum cache size is multiplied to
+ * obtain the minimum size entry / entry size increase which may trigger a
+ * flash cache size increase. \n
+ * At present, this value must lie in the range [0.1, 1.0]. */
+ //! <!-- [H5AC_cache_config_t_incr_snip] -->
/* size decrease control fields: */
+ //! <!-- [H5AC_cache_config_t_decr_snip] -->
enum H5C_cache_decr_mode decr_mode;
+ /**< Enumerated value indicating the operational mode of the tomatic
+ * cache size decrease code. At present, the values listed in
+ * #H5C_cache_decr_mode are legal.*/
double upper_hr_threshold;
+ /**< Hit rate threshold for the hit rate threshold and ageout with hit
+ * rate threshold cache size decrement algorithms.\n
+ * When \p decr_mode is #H5C_decr__threshold, and the hit rate over a given
+ * epoch exceeds the supplied threshold, the current maximum cache
+ * size is multiplied by decrement to obtain a tentative new (and smaller)
+ * maximum cache size.\n
+ * When \p decr_mode is #H5C_decr__age_out_with_threshold, there is
+ * no attempt to find and evict aged out entries unless the hit rate in
+ * the previous epoch exceeded the supplied threshold.\n
+ * This field must lie in the interval [0.0, 1.0].\n
+ * For #H5C_incr__threshold, .9995 or .99995 is a good place to start.\n
+ * For #H5C_decr__age_out_with_threshold, .999 might be more useful.*/
double decrement;
+ /**< In the hit rate threshold cache size decrease algorithm, this
+ * parameter contains the factor by which the current max cache size is
+ * multiplied to produce a tentative new cache size.\n
+ * The actual cache size decrease will be clipped to satisfy the
+ * \ref H5AC_cache_config_t.min_size "min_size" specified in the general
+ * configuration, and possibly \ref H5AC_cache_config_t.max_decrement
+ * "max_decrement".\n
+ * The parameter must be be in the interval [0.0, 1.0].\n
+ * If you set it to 1.0, you will effectively
+ * disable cache size decreases. 0.9 is a reasonable starting point. */
hbool_t apply_max_decrement;
- size_t max_decrement;
+ /**< Boolean flag indicating ether an upper limit should be applied to
+ * the size of cache size decreases. */
+
+ size_t max_decrement;
+ /**< Maximum number of bytes by which the maximum cache size can be
+ * decreased in any single step -- if applicable.*/
int epochs_before_eviction;
+ /**< In the ageout based cache size reduction algorithms, this field
+ * contains the minimum number of epochs an entry must remain unaccessed in
+ * cache before the cache size reduction algorithm tries to evict it. 3 is a
+ * reasonable value. */
hbool_t apply_empty_reserve;
- double empty_reserve;
+ /**< Boolean flag indicating whether the ageout based decrement
+ * algorithms will maintain a empty reserve when decreasing cache size. */
+
+ double empty_reserve;
+ /**< Empty reserve as a fraction maximum cache size if applicable.\n When
+ * so directed, the ageout based algorithms will not decrease the maximum
+ * cache size unless the empty reserve can be met.\n The parameter must lie
+ * in the interval [0.0, 1.0]. 0.1 or 0.05 is a good place to start. */
+ //! <!-- [H5AC_cache_config_t_decr_snip] -->
/* parallel configuration fields: */
+ //! <!-- [H5AC_cache_config_t_parallel_snip] -->
size_t dirty_bytes_threshold;
- int metadata_write_strategy;
-
+ /**< Threshold number of bytes of dirty metadata generation for
+ * triggering synchronizations of the metadata caches serving the target
+ * file in the parallel case.\n Synchronization occurs whenever the number
+ * of bytes of dirty metadata created since the last synchronization exceeds
+ * this limit.\n This field only applies to the parallel case. While it is
+ * ignored elsewhere, it can still draw a value out of bounds error.\n It
+ * must be consistant across all caches on any given file.\n By default,
+ * this field is set to 256 KB. It shouldn't be more than half the current
+ * max cache size times the min clean fraction. */
+
+ int metadata_write_strategy;
+ /**< Desired metadata write strategy. The valid values for this field
+ * are:\n #H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: Specifies tha only
+ * process zero is allowed to write dirty metadata to disk.\n
+ * #H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: Specifies that process zero
+ * still makes the decisions as to what entries should be flushed, but the
+ * actual flushes are distributed across the processes in the computation to
+ * the extent possible.\n The src/H5ACpublic.h include file in the HDF5
+ * library has detailed information on each strategy. */
+ //! <!-- [H5AC_cache_config_t_parallel_snip] -->
} H5AC_cache_config_t;
-
-/****************************************************************************
- *
- * structure H5AC_cache_image_config_t
- *
- * H5AC_cache_image_ctl_t is a public structure intended for use in public
- * APIs. At least in its initial incarnation, it is a copy of struct
- * H5C_cache_image_ctl_t.
- *
- * The fields of the structure are discussed individually below:
- *
- * version: Integer field containing the version number of this version
- * of the H5C_image_ctl_t structure. Any instance of
- * H5C_image_ctl_t passed to the cache must have a known
- * version number, or an error will be flagged.
- *
- * generate_image: Boolean flag indicating whether a cache image should
- * be created on file close.
- *
- * save_resize_status: Boolean flag indicating whether the cache image
- * should include the adaptive cache resize configuration and status.
- * Note that this field is ignored at present.
- *
- * entry_ageout: Integer field indicating the maximum number of
- * times a prefetched entry can appear in subsequent cache images.
- * This field exists to allow the user to avoid the buildup of
- * infrequently used entries in long sequences of cache images.
- *
- * The value of this field must lie in the range
- * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to
- * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100).
- *
- * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit
- * is imposed on number of times a prefeteched entry can appear
- * in subsequent cache images.
- *
- * A value of 0 prevents prefetched entries from being included
- * in cache images.
- *
- * Positive integers restrict prefetched entries to the specified
- * number of appearances.
- *
- * Note that the number of subsequent cache images that a prefetched
- * entry has appeared in is tracked in an 8 bit field. Thus, while
- * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its
- * current value, any value in excess of 255 will be the functional
- * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE.
- *
- ****************************************************************************/
+//! <!-- [H5AC_cache_config_t_snip] -->
#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1
#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1
#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100
+//! <!-- [H5AC_cache_image_config_t_snip] -->
+/**
+ * H5AC_cache_image_config_t is a public structure intended for use in public
+ * APIs. At least in its initial incarnation, it is a copy of \c struct \c
+ * H5C_cache_image_ctl_t.
+ */
+
typedef struct H5AC_cache_image_config_t {
- int version;
+ int version;
+ /**< Integer field containing the version number of this version of the \c
+ * H5C_image_ctl_t structure. Any instance of \c H5C_image_ctl_t passed
+ * to the cache must have a known version number, or an error will be
+ * flagged.
+ */
hbool_t generate_image;
+ /**< Boolean flag indicating whether a cache image should be created on file
+ * close.
+ */
hbool_t save_resize_status;
- int entry_ageout;
+ /**< Boolean flag indicating whether the cache image should include the
+ * adaptive cache resize configuration and status. Note that this field
+ * is ignored at present.
+ */
+ int entry_ageout;
+ /**< Integer field indicating the maximum number of times a
+ * prefetched entry can appear in subsequent cache images. This field
+ * exists to allow the user to avoid the buildup of infrequently used
+ * entries in long sequences of cache images.
+ *
+ * The value of this field must lie in the range \ref
+ * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to \ref
+ * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100).
+ *
+ * \ref H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit is
+ * imposed on number of times a prefeteched entry can appear in subsequent
+ * cache images.
+ *
+ * A value of 0 prevents prefetched entries from being included in cache
+ * images.
+ *
+ * Positive integers restrict prefetched entries to the specified number
+ * of appearances.
+ *
+ * Note that the number of subsequent cache images that a prefetched entry
+ * has appeared in is tracked in an 8 bit field. Thus, while \ref
+ * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its current
+ * value, any value in excess of 255 will be the functional equivalent of
+ * \ref H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE.
+ */
} H5AC_cache_image_config_t;
+//! <!-- [H5AC_cache_image_config_t_snip] -->
+
#ifdef __cplusplus
}
#endif
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index 3d4e391..8ae4e41 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -309,10 +309,11 @@ done:
int
H5Aget_num_attrs(hid_t loc_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5O_info2_t oinfo;
- int ret_value = -1;
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5O_info2_t oinfo;
+ int ret_value = -1;
FUNC_ENTER_API((-1))
H5TRACE1("Is", "i", loc_id);
@@ -324,9 +325,13 @@ H5Aget_num_attrs(hid_t loc_id)
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_INFO;
+ vol_cb_args.args.get_info.oinfo = &oinfo;
+ vol_cb_args.args.get_info.fields = H5O_INFO_NUM_ATTRS;
+
/* Get the number of attributes for the object */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &oinfo, H5O_INFO_NUM_ATTRS) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, (-1), "unable to get attribute count for object")
H5_CHECKED_ASSIGN(ret_value, int, oinfo.num_attrs, hsize_t);
@@ -375,8 +380,10 @@ done:
herr_t
H5Aiterate1(hid_t loc_id, unsigned *attr_num /*in,out*/, H5A_operator1_t op, void *op_data)
{
- H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_attr_optional_args_t attr_opt_args; /* Arguments for optional operation */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(H5_ITER_ERROR)
H5TRACE4("e", "i*IuAo*x", loc_id, attr_num, op, op_data);
@@ -389,9 +396,17 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num /*in,out*/, H5A_operator1_t op, voi
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ATTR, H5E_BADTYPE, H5_ITER_ERROR, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ attr_opt_args.iterate_old.loc_id = loc_id;
+ attr_opt_args.iterate_old.attr_num = attr_num;
+ attr_opt_args.iterate_old.op = op;
+ attr_opt_args.iterate_old.op_data = op_data;
+ vol_cb_args.op_type = H5VL_NATIVE_ATTR_ITERATE_OLD;
+ vol_cb_args.args = &attr_opt_args;
+
/* Call attribute iteration routine */
- if ((ret_value = H5VL_attr_optional(vol_obj, H5VL_NATIVE_ATTR_ITERATE_OLD, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, loc_id, attr_num, op, op_data)) < 0)
+ if ((ret_value = H5VL_attr_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)) <
+ 0)
HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes");
done:
diff --git a/src/H5Aint.c b/src/H5Aint.c
index f6b955e..300d686 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -844,7 +844,6 @@ done:
const void *buf; IN: Buffer of data to write
RETURNS
Non-negative on success/Negative on failure
-
DESCRIPTION
This function writes a complete attribute to disk.
--------------------------------------------------------------------------*/
@@ -949,31 +948,33 @@ done:
NAME
H5A__get_name
PURPOSE
- Private function for H5Aget_name. Gets a copy of the name for an
- attribute
+ Gets a copy of the name for an attribute
RETURNS
- This function returns the length of the attribute's name (which may be
- longer than 'buf_size') on success or negative for failure.
+ Non-negative on success/Negative on failure
DESCRIPTION
This function retrieves the name of an attribute for an attribute ID.
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.
+ This function returns the length of the attribute's name (which may be
+ longer than 'buf_size') in the 'attr_name_len' parameter.
--------------------------------------------------------------------------*/
-ssize_t
-H5A__get_name(H5A_t *attr, size_t buf_size, char *buf)
+herr_t
+H5A__get_name(H5A_t *attr, size_t buf_size, char *buf, size_t *attr_name_len)
{
- size_t copy_len, nbytes;
- ssize_t ret_value = -1; /* Return value */
+ size_t copy_len, nbytes;
FUNC_ENTER_PACKAGE_NOERR
- /* get the real attribute length */
+ /* Sanity checks */
+ HDassert(attr);
+ HDassert(attr_name_len);
+
+ /* Get the real attribute length */
nbytes = HDstrlen(attr->shared->name);
- HDassert((ssize_t)nbytes >= 0); /*overflow, pretty unlikely --rpm*/
- /* compute the string length which will fit into the user's buffer */
+ /* Compute the string length which will fit into the user's buffer */
copy_len = MIN(buf_size - 1, nbytes);
/* Copy all/some of the name */
@@ -984,10 +985,10 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf)
buf[copy_len] = '\0';
} /* end if */
- /* Set return value */
- ret_value = (ssize_t)nbytes;
+ /* Set actual attribute name length */
+ *attr_name_len = nbytes;
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A__get_name() */
/*-------------------------------------------------------------------------
@@ -1091,13 +1092,10 @@ done:
NAME
H5A__get_create_plist
PURPOSE
- private version of H5Aget_create_plist
+ Private version of H5Aget_create_plist
RETURNS
This function returns the ID of a copy of the attribute's creation
property list, or negative on failure.
-
- ERRORS
-
DESCRIPTION
This function returns a copy of the creation property list for
an attribute. The resulting ID must be closed with H5Pclose() or
@@ -1304,7 +1302,7 @@ H5A__close_cb(H5VL_object_t *attr_vol_obj, void **request)
HDassert(attr_vol_obj);
/* Close the attribute */
- if ((ret_value = H5VL_attr_close(attr_vol_obj, H5P_DATASET_XFER_DEFAULT, request)) < 0)
+ if (H5VL_attr_close(attr_vol_obj, H5P_DATASET_XFER_DEFAULT, request) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "problem closing attribute")
/* Free the VOL object */
@@ -2661,7 +2659,7 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na
FUNC_ENTER_PACKAGE
/* Avoid thrashing things if the names are the same */
- if (HDstrcmp(old_attr_name, new_attr_name)) {
+ if (HDstrcmp(old_attr_name, new_attr_name) != 0) {
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
obj_loc.path = &obj_path;
@@ -2768,7 +2766,7 @@ H5A__iterate(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5
/* Call internal attribute iteration routine */
if ((ret_value = H5A__iterate_common(obj_loc_id, idx_type, order, idx, &attr_op, op_data)) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes")
+ HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes");
done:
/* Release resources */
diff --git a/src/H5Amodule.h b/src/H5Amodule.h
index 45172bf..9f86ddd 100644
--- a/src/H5Amodule.h
+++ b/src/H5Amodule.h
@@ -30,19 +30,35 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5A H5A
- * \brief Attribute Interface
*
- * \details The Attribute Interface, H5A, provides a mechanism for attaching
- * additional information to a dataset, group, or named datatype.
+ * Use the functions in this module to manage HDF5 attributes.
*
- * Attributes are accessed by opening the object that they are
- * attached to and are not independent objects. Typically an
- * attribute is small in size and contains user metadata about the
- * object that it is attached to.
+ * Like HDF5 datasets, HDF5 attributes are array variables which have an element
+ * datatype and a shape (dataspace). However, they perform a different function:
+ * Attributes decorate other HDF5 objects, and are typically used to
+ * represent application metadata. Unlike datasets, the HDF5 library does not
+ * support partial I/O operations for attributes and they cannot be compressed
+ * or extended.
*
- * Attributes look similar to HDF5 datasets in that they have a
- * datatype and dataspace. However, they do not support partial
- * I/O operations and cannot be compressed or extended.
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5A_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5A_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5A_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5A_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
*/
diff --git a/src/H5Apkg.h b/src/H5Apkg.h
index a349f9f..b50cbc4 100644
--- a/src/H5Apkg.h
+++ b/src/H5Apkg.h
@@ -200,14 +200,14 @@ H5_DLL herr_t H5A__iterate(const H5G_loc_t *loc, const char *obj_name, H5_index_
#ifndef H5_NO_DEPRECATED_SYMBOLS
H5_DLL herr_t H5A__iterate_old(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-H5_DLL herr_t H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name);
-H5_DLL herr_t H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n);
-H5_DLL herr_t H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name,
- hbool_t *attr_exists);
-H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf);
-H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf);
-H5_DLL ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf);
+H5_DLL herr_t H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name);
+H5_DLL herr_t H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n);
+H5_DLL herr_t H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name,
+ hbool_t *attr_exists);
+H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf);
+H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf);
+H5_DLL herr_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf, size_t *attr_name_len);
/* Attribute "dense" storage routines */
H5_DLL herr_t H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo);
diff --git a/src/H5Apublic.h b/src/H5Apublic.h
index 68d8a8a..b78ae05 100644
--- a/src/H5Apublic.h
+++ b/src/H5Apublic.h
@@ -22,19 +22,40 @@
#include "H5Opublic.h" /* Object Headers */
#include "H5Tpublic.h" /* Datatypes */
-/* Information struct for attribute (for H5Aget_info/H5Aget_info_by_idx) */
-//! [H5A_info_t_snip]
+//! <!-- [H5A_info_t_snip] -->
+/**
+ * Information struct for H5Aget_info() / H5Aget_info_by_idx()
+ */
typedef struct {
- hbool_t corder_valid; /* Indicate if creation order is valid */
- H5O_msg_crt_idx_t corder; /* Creation order */
- H5T_cset_t cset; /* Character set of attribute name */
- hsize_t data_size; /* Size of raw data */
+ hbool_t corder_valid; /**< Indicate if creation order is valid */
+ H5O_msg_crt_idx_t corder; /**< Creation order */
+ H5T_cset_t cset; /**< Character set of attribute name */
+ hsize_t data_size; /**< Size of raw data */
} H5A_info_t;
-//! [H5A_info_t_snip]
+//! <!-- [H5A_info_t_snip] -->
-/* Typedef for H5Aiterate2() callbacks */
+//! <!-- [H5A_operator2_t_snip] -->
+/**
+ * Typedef for H5Aiterate2() / H5Aiterate_by_name() callbacks
+ * \param[in] location_id The identifier for the group, dataset
+ * or named datatype being iterated over
+ * \param[in] attr_name The name of the current object attribute
+ * \param[in] ainfo The attribute’s info struct
+ * \param[in,out] op_data A pointer to the operator data passed in to
+ * H5Aiterate2() or H5Aiterate_by_name()
+ * \returns The return values from an operator are:
+ * \li Zero causes the iterator to continue, returning zero when
+ * all attributes have been processed.
+ * \li Positive causes the iterator to immediately return that
+ * positive value, indicating short-circuit success. The
+ * iterator can be restarted at the next attribute.
+ * \li Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
typedef herr_t (*H5A_operator2_t)(hid_t location_id /*in*/, const char *attr_name /*in*/,
const H5A_info_t *ainfo /*in*/, void *op_data /*in,out*/);
+//! <!-- [H5A_operator2_t_snip] -->
/********************/
/* Public Variables */
@@ -57,17 +78,24 @@ extern "C" {
*
* \return \herr_t
*
- * \details H5Aclose() terminates access to the attribute specified by
- * \p attr_id by releasing the identifier.
+ * \details H5Aclose() terminates access to the attribute through
+ * \p attr_id and releases the identifier.
*
- * \attention Further use of a released attribute identifier is illegal; a
- * function using such an identifier will generate an error.
+ * \par Example
+ * \snippet H5A_examples.c create
*
* \since 1.0.0
*
* \see H5Acreate(), H5Aopen()
*/
H5_DLL herr_t H5Aclose(hid_t attr_id);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Aclose}
+ */
+H5_DLL herr_t H5Aclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
+ hid_t es_id);
/* --------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -89,27 +117,19 @@ H5_DLL herr_t H5Aclose(hid_t attr_id);
* The attribute name, \p attr_name, must be unique for the object.
*
* The attribute is created with the specified datatype and dataspace,
- * \p type_id and \p space_id, which are created with the H5T and
- * H5S interfaces, respectively.
- *
- * If \p type_id is either a fixed-length or variable-length string,
- * it is important to set the string length when defining the
- * datatype. String datatypes are derived from #H5T_C_S1 (or
- * #H5T_FORTRAN_S1 for Fortran), which defaults to 1 character in
- * size. See H5Tset_size() and Creating variable-length string
- * datatypes.
+ * \p type_id and \p space_id.
*
- * The access property list is currently unused, but will be used in
- * the future. This property list should currently be #H5P_DEFAULT.
+ * \plist_unused{acpl}
*
* The attribute identifier returned by this function must be released
* with H5Aclose() resource leaks will develop.
*
- * \note The \p acpl and \p aapl parameters are currently not used; specify
- * #H5P_DEFAULT.
* \note If \p loc_id is a file identifier, the attribute will be attached
* that file’s root group.
*
+ * \par Example
+ * \snippet H5A_examples.c create
+ *
* \since 1.8.0
*
* \see H5Aclose()
@@ -117,6 +137,11 @@ H5_DLL herr_t H5Aclose(hid_t attr_id);
*/
H5_DLL 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);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Acreate}
+ */
H5_DLL hid_t H5Acreate_async(const char *app_file, const char *app_func, unsigned app_line, 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);
@@ -142,33 +167,33 @@ H5_DLL hid_t H5Acreate_async(const char *app_file, const char *app_func, unsigne
* attached to the object specified by \p loc_id and \p obj_name.
*
* \p loc_id is a location identifier; \p obj_name is the object
- * name relative to \p loc_id. If \p loc_id fully specifies the
- * object to which the attribute is to be attached, \p obj_name
- * should be '.' (a dot).
+ * name relative to \p loc_id.
*
* The attribute name, \p attr_name, must be unique for the object.
*
* The attribute is created with the specified datatype and
- * dataspace, \p type_id and \p space_id, which are created with
- * the H5T and H5S interfaces respectively.
+ * dataspace, \p type_id and \p space_id.
*
- * The attribute creation and access property lists are currently
- * unused, but will be used in the future for optional attribute
- * creation and access properties. These property lists should
- * currently be #H5P_DEFAULT.
+ * \plist_unused{aapl}
*
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to access
* the object, \p obj_name.
*
- * The attribute identifier returned by this function must be
- * released with H5close() or resource leaks will develop.
- *
* \since 1.8.0
*
*/
H5_DLL 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);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Acreate_by_name}
+ */
+H5_DLL hid_t H5Acreate_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
+ 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);
/*-------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -182,10 +207,14 @@ H5_DLL hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *a
*
* \details H5Adelete() removes the attribute specified by its name,
* \p attr_name, from a file, dataset, group, or named datatype.
- * This function should not be used when attribute identifiers
- * are open on \p 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.
+ *
+ * \attention This function should not be used when other attribute identifiers
+ * are open on \p loc_id. This may cause the internal indexes of
+ * the attributes to change and future writes to the open
+ * attributes to produce incorrect results.
+ *
+ * \par Example
+ * \snippet H5A_examples.c delete
*
* \since 1.0.0
*
@@ -212,27 +241,16 @@ H5_DLL herr_t H5Adelete(hid_t loc_id, const char *attr_name);
*
* The object from which the attribute is to be removed is
* specified by a location identifier and name, \p loc_id and
- * \p obj_name, respectively. If \p loc_id fully specifies the
- * object from which the attribute is to be removed, \p obj_name
- * should be '.' (a dot).
+ * \p obj_name, respectively.
*
* The attribute to be removed is specified by a position in an
- * index, \p n. The type of index is specified by \p idx_type and
- * may be #H5_INDEX_NAME, for an alpha-numeric index by name, or
- * #H5_INDEX_CRT_ORDER, for an index by creation order. The order
- * in which the index is to be traversed is specified by \p order
- * and may be #H5_ITER_INC (increment) for top-down iteration,
- * #H5_ITER_DEC (decrement) for bottom-up iteration, or
- * #H5_ITER_NATIVE, in which case HDF5 will iterate in the
- * fastest-available order. For example, if \p idx_type, \p order,
+ * index, \p n. The type of index is specified by \p idx_type.
+ * The order in which the index is to be traversed is specified by
+ * \p order. For example, if \p idx_type, \p order,
* and \p n are set to #H5_INDEX_NAME, #H5_ITER_INC, and 5,
- * respectively, the fifth attribute by alpha-numeric order of
+ * respectively, the fifth attribute in lexicographic order of
* attribute names will be removed.
*
- * For a discussion of \p idx_type and \p order, the valid values
- * of those parameters, and the use of \p n, see the description
- * of H5Aiterate2().
- *
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to access
* the object, \p obj_name.
@@ -260,9 +278,6 @@ H5_DLL herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t id
* from an object specified by location and name, \p loc_id and
* \p obj_name, respectively.
*
- * If \p loc_id fully specifies the object from which the
- * attribute is to be removed, \p obj_name should be '.' (a dot).
- *
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to
* access the object, \p obj_name.
@@ -290,6 +305,13 @@ H5_DLL herr_t H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *
*
*/
H5_DLL htri_t H5Aexists(hid_t obj_id, const char *attr_name);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Aexists}
+ */
+H5_DLL herr_t H5Aexists_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id,
+ const char *attr_name, hbool_t *exists, hid_t es_id);
/*-------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -311,9 +333,7 @@ H5_DLL htri_t H5Aexists(hid_t obj_id, const char *attr_name);
* \p loc_id specifies a location in the file containing the object.
* \p obj_name is the name of the object to which the attribute is
* attached and can be a relative name, relative to \p loc_id,
- * or an absolute name, based in the root group of the file. If
- * \p loc_id fully specifies the object, \p obj_name should be '.'
- * (a dot).
+ * or an absolute name, based in the root group of the file.
*
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to access
@@ -323,6 +343,14 @@ H5_DLL htri_t H5Aexists(hid_t obj_id, const char *attr_name);
*
*/
H5_DLL htri_t H5Aexists_by_name(hid_t obj_id, const char *obj_name, const char *attr_name, hid_t lapl_id);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Aexists_by_name}
+ */
+H5_DLL herr_t H5Aexists_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t loc_id, const char *obj_name, const char *attr_name,
+ hbool_t *exists, hid_t lapl_id, hid_t es_id);
/*-------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -337,9 +365,6 @@ H5_DLL htri_t H5Aexists_by_name(hid_t obj_id, const char *obj_name, const char *
* creation property list associated with the attribute specified
* by \p attr_id.
*
- * The creation property list identifier should be released with
- * H5Pclose().
- *
* \since 1.8.0
*
*/
@@ -356,32 +381,9 @@ H5_DLL hid_t H5Aget_create_plist(hid_t attr_id);
* \return \herr_t
*
* \details H5Aget_info() retrieves attribute information, locating the
- * attribute with an attribute identifier, \p attr_id, which is
- * the identifier returned by H5Aopen() or H5Aopen_by_idx(). The
+ * attribute with an attribute identifier, \p attr_id. The
* attribute information is returned in the \p ainfo struct.
*
- * The \p ainfo struct is defined as follows:
- * \snippet this H5A_info_t_snip
- *
- * \p corder_valid indicates whether the creation order data is
- * valid for this attribute. Note that if creation order is not
- * being tracked, no creation order data will be valid. Valid
- * values are \c TRUE and \c FALSE.
- *
- * \p corder is a positive integer containing the creation
- * order of the attribute. This value is 0-based, so, for
- * example, the third attribute created will have a \p corder
- * value of 2.
- *
- * \p cset indicates the character set used for the attribute’s
- * name; valid values are defined in H5Tpublic.h and include
- * the following:
- * \csets
- * This value is set with H5Pset_char_encoding().
- *
- * \p data_size indicates the size, in the number of characters,
- * of the attribute.
- *
* \since 1.8.0
*
*/
@@ -409,16 +411,9 @@ H5_DLL herr_t H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/);
* The attribute is located by its index position and the attribute
* information is returned in the \p ainfo struct.
*
- * If \p loc_id fully specifies the object to which the attribute
- * is attached, \p obj_name should be '.' (a dot).
- *
* The attribute is located by means of an index type, an index
* traversal order, and a position in the index, \p idx_type,
- * \p order and \p n, respectively. These parameters and their
- * valid values are discussed in the description of H5Aiterate2().
- *
- * The \p ainfo struct, which will contain the returned attribute
- * information, is described in H5Aget_info().
+ * \p order and \p n, respectively.
*
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to access
@@ -436,8 +431,7 @@ H5_DLL herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t
* \brief Retrieves attribute information, by attribute name
*
* \fgdt_loc_id
- *
- * \param[in] obj_name Name of object to which attribute is attached,
+ * \param[in] obj_name Name of the object to which an attribute is attached,
* relative to location
* \param[in] attr_name Attribute name
* \param[out] ainfo Struct containing returned attribute information
@@ -450,11 +444,6 @@ H5_DLL herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t
* location and name, \p loc_id and \p obj_name, respectively.
* The attribute information is returned in the \p ainfo struct.
*
- * If \p loc_id fully specifies the object to which the attribute
- * is attached, \p obj_name should be '.' (a dot).
- *
- * The \p ainfo struct is described in H5Aget_info().
- *
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to
* access the object, \p obj_name.
@@ -485,8 +474,8 @@ H5_DLL herr_t H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char
* string terminator is stored in the last position of the buffer
* to properly terminate the string.
*
- * If the user only wants to find out the size of this name, the
- * values 0 and NULL can be passed in for the parameters
+ * If the user only wants to retrieve the name length, the
+ * values 0 and NULL should be passed for the parameters
* \p bufsize and \p buf.
*
* \since 1.0.0
@@ -497,7 +486,7 @@ H5_DLL ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf);
/**
* \ingroup H5A
*
- * \brief Gets an attribute name, by attribute index position
+ * \brief Gets an attribute name by attribute index position
*
* \fgdt_loc_id
* \param[in] obj_name Name of object to which attribute is attached,
@@ -518,13 +507,9 @@ H5_DLL ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf);
* located by its index position, the size of the name is specified
* in \p size, and the attribute name is returned in \p name.
*
- * If \p loc_id fully specifies the object to which the attribute
- * is attached, \p obj_name should be '.' (a dot).
- *
* The attribute is located by means of an index type, an index
* traversal order, and a position in the index, \p idx_type,
- * \p order and \p n, respectively. These parameters and their
- * valid values are discussed in the description of H5Aiterate2().
+ * \p order and \p n, respectively.
*
* If the attribute name’s size is unknown, the values 0 and NULL
* can be passed in for the parameters \p size and \p name. The
@@ -564,7 +549,7 @@ H5_DLL hid_t H5Aget_space(hid_t attr_id);
/**
* \ingroup H5A
*
- * \brief Returns the amount of storage required for an attribute
+ * \brief Returns the amount of storage used to store an attribute
*
* \attr_id
*
@@ -582,17 +567,16 @@ H5_DLL hsize_t H5Aget_storage_size(hid_t attr_id);
/**
* \ingroup H5A
*
- * \brief Gets an attribute datatype
+ * \brief Gets an attribute's datatype
*
* \attr_id
*
* \return \hid_t{datatype}
*
- * \details H5Aget_type() retrieves a copy of the datatype for an attribute.
+ * \details H5Aget_type() retrieves a copy of the attribute's datatype.
* The datatype is reopened if it is a named type before returning
* it to the application. The datatypes returned by this function
- * are always read-only. If an error occurs when atomizing the
- * return datatype, then the datatype is closed.
+ * are always read-only.
*
* The datatype identifier returned from this function must be
* released with H5Tclose() or resource leaks will develop.
@@ -605,7 +589,7 @@ H5_DLL hid_t H5Aget_type(hid_t attr_id);
/**
* \ingroup H5A
*
- * \brief Calls user-defined function for each attribute on an object
+ * \brief Calls a user-defined function for each attribute on an object
*
* \fgdt_loc_id
* \param[in] idx_type Type of index
@@ -632,17 +616,6 @@ H5_DLL hid_t H5Aget_type(hid_t attr_id);
* are specified by three parameters: the index type,
* \p idx_type; the order in which the index is to be traversed,
* \p order; and the attribute’s position in the index, \p idx.
- *
- * The type of index specified by \p idx_type can be one of the
- * following:
- *
- * \indexes
- *
- * The order in which the index is to be traversed, as specified
- * by \p order, can be one of the following:
- *
- * \orders
- *
* The next attribute to be operated on is specified by \p idx,
* a position in the index.
*
@@ -659,30 +632,7 @@ H5_DLL hid_t H5Aget_type(hid_t attr_id);
* the value returned identifies the parameter to be operated on
* in the next step of the iteration.
*
- * The #H5A_operator2_t prototype for the \p op parameter is a
- * user defined function where:
- * The operation receives the location identifier for the group or
- * dataset being iterated over, \p location_id; the name of the
- * current object attribute, \p attr_name; the attribute’s info
- * struct, \p ainfo; and a pointer to the operator data passed
- * into H5Aiterate2(), \p op_data.
- *
- * Valid return values from an operator and the resulting
- * H5Aiterate2() and \p op behavior are as follows:
- *
- * \li Zero causes the iterator to continue, returning zero when
- * all attributes have been processed.
- * \li A positive value causes the iterator to immediately return
- * that positive value, indicating short-circuit success. The
- * iterator can be restarted at the next attribute, as
- * indicated by the return value of \p idx.
- * \li A negative value causes the iterator to immediately return
- * that value, indicating failure. The iterator can be
- * restarted at the next attribute, as indicated by the return
- * value of \p idx.
- *
* \note This function is also available through the H5Aiterate() macro.
- * \todo Add snippet for H5A_operator2_t
*
* \since 1.8.0
*
@@ -717,24 +667,10 @@ H5_DLL herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t ord
* additional information as defined below, is passed to a
* user-defined function, \p op, which operates on that attribute.
*
- * If \p loc_id fully specifies the object to which these
- * attributes are attached, \p obj_name should be '.' (a dot).
- *
* The order of the iteration and the attributes iterated over
* are specified by three parameters: the index type, \p idx_type;
* the order in which the index is to be traversed, \p order;
* and the attribute’s position in the index, \p idx.
- *
- * The type of index specified by \p idx_type can be one of the
- * following:
- *
- * \indexes
- *
- * The order in which the index is to be traversed, as specified
- * by \p order, can be one of the following:
- *
- * \orders
- *
* The next attribute to be operated on is specified by \p idx,
* a position in the index.
*
@@ -751,43 +687,16 @@ H5_DLL herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t ord
* the value returned identifies the parameter to be operated on in
* the next step of the iteration.
*
- * The #H5A_operator2_t prototype for the \p op parameter is a
- * user defined function where:
- * The operation receives the location identifier for the group or
- * dataset being iterated over, \p location_id; the name of the
- * current object attribute, \p attr_name; the attribute’s info
- * struct, \p ainfo; and a pointer to the operator data passed
- * into H5Aiterate_by_name(), \p op_data.
- *
- * Valid return values from an operator and the resulting
- * H5Aiterate_by_name() and \p op behavior are as follows:
- *
- * \li Zero causes the iterator to continue, returning zero when
- * all attributes have been processed.
- * \li A positive value causes the iterator to immediately return
- * that positive value, indicating short-circuit success.
- * The iterator can be restarted at the next attribute, as
- * indicated by the return value of \p idx.
- * \li A negative value causes the iterator to immediately return
- * that value, indicating failure. The iterator can be
- * restarted at the next attribute, as indicated by the return
- * value of \p idx.
- *
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to access
* the object, \p obj_name.
*
- * \todo Add snippet to show H5Aoperator2_t.
* \since 1.8.0
*
*/
H5_DLL 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);
-H5_DLL hid_t H5Acreate_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
- 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);
/*--------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -804,8 +713,7 @@ H5_DLL hid_t H5Acreate_by_name_async(const char *app_file, const char *app_func
* \details H5Aopen() opens an existing attribute, \p attr_name, that is
* attached to object specified by an object identifier, \p obj_id.
*
- * The attribute access property list, \p aapl_id, is currently unused
- * and should be #H5P_DEFAULT.
+ * \plist_unused{aapl_id}
*
* This function, H5Aopen_by_idx() or H5Aopen_by_name() must be called
* before the attribute can be accessed for any further purpose,
@@ -814,11 +722,19 @@ H5_DLL hid_t H5Acreate_by_name_async(const char *app_file, const char *app_func
* The attribute identifier returned by this function must be released
* with H5Aclose() or resource leaks will develop.
*
+ * \par Example
+ * \snippet H5A_examples.c read
+ *
* \since 1.8.0
*
* \see H5Aclose(), H5Acreate()
*/
H5_DLL hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Aopen}
+ */
H5_DLL hid_t H5Aopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id,
const char *attr_name, hid_t aapl_id, hid_t es_id);
/*--------------------------------------------------------------------------*/
@@ -840,17 +756,13 @@ H5_DLL hid_t H5Aopen_async(const char *app_file, const char *app_func, unsigned
*
* \details H5Aopen_by_idx() opens an existing attribute that is attached
* to an object specified by location and name, \p loc_id and
- * \p obj_name, respectively. If \p loc_id fully specifies the
- * object to which the attribute is attached, \p obj_name, should
- * be '.' (a dot).
+ * \p obj_name, respectively.
*
* The attribute is identified by an index type, an index traversal
* order, and a position in the index, \p idx_type, \p order and
- * \p n, respectively. These parameters and their valid values are
- * discussed in the description of H5Aiterate2().
+ * \p n, respectively.
*
- * The attribute access property list, \p aapl_id, is currently
- * unused and should currently be #H5P_DEFAULT.
+ * \plist_unused{aapl_id}
*
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to access
@@ -868,6 +780,11 @@ H5_DLL hid_t H5Aopen_async(const char *app_file, const char *app_func, unsigned
*/
H5_DLL 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);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Aopen_by_idx}
+ */
H5_DLL hid_t H5Aopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_line, 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);
@@ -892,11 +809,9 @@ H5_DLL hid_t H5Aopen_by_idx_async(const char *app_file, const char *app_func, un
*
* \p loc_id specifies a location from which the target object can
* be located and \p obj_name is an object name relative to
- * \p loc_id. If \p loc_id fully specifies the object to which the
- * attribute is attached, \p obj_name should be '.' (a dot).
+ * \p loc_id.
*
- * The attribute access property list, \p aapl_id, is currently
- * unused and should currently be #H5P_DEFAULT.
+ * \plist_unused{aapl_id}
*
* The link access property list, \p lapl_id, may provide
* information regarding the properties of links required to access
@@ -914,6 +829,11 @@ H5_DLL hid_t H5Aopen_by_idx_async(const char *app_file, const char *app_func, un
*/
H5_DLL 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);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Aopen_by_name}
+ */
H5_DLL hid_t H5Aopen_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id,
hid_t lapl_id, hid_t es_id);
@@ -936,6 +856,9 @@ H5_DLL hid_t H5Aopen_by_name_async(const char *app_file, const char *app_func, u
* Datatype conversion takes place at the time of a read or write and
* is automatic.
*
+ * \par Example
+ * \snippet H5A_examples.c read
+ *
* \version 1.8.8 Fortran updated to Fortran2003.
* \version 1.4.2 The \p dims parameter was added to the Fortran API in this
* release.
@@ -945,6 +868,13 @@ H5_DLL hid_t H5Aopen_by_name_async(const char *app_file, const char *app_func, u
*
*/
H5_DLL herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Aread}
+ */
+H5_DLL herr_t H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
+ hid_t dtype_id, void *buf, hid_t es_id);
/*-------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -967,8 +897,21 @@ H5_DLL herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf);
*
*/
H5_DLL herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name);
-H5_DLL herr_t H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
- hid_t dtype_id, void *buf, hid_t es_id);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Arename}
+ */
+H5_DLL herr_t H5Arename_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
+ const char *old_name, const char *new_name, hid_t es_id);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Arename_by_name}
+ */
+H5_DLL herr_t H5Arename_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
+ 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);
/*--------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -985,15 +928,12 @@ H5_DLL herr_t H5Aread_async(const char *app_file, const char *app_func, unsigned
* attribute's in-memory datatype is specified with \p type_id.
* The entire attribute is written from \p buf to the file.
*
- * If \p type_id is either a fixed-length or variable-length string,
- * it is important to set the string length when defining the datatype.
- * String datatypes are derived from #H5T_C_S1 (or #H5T_FORTRAN_S1 for
- * Fortran codes), which defaults to 1 character in size.
- * See H5Tset_size() and Creating variable-length string datatypes.
- *
* Datatype conversion takes place at the time of a read or write and
* is automatic.
*
+ * \par Example
+ * \snippet H5A_examples.c update
+ *
* \version 1.8.8 Fortran updated to Fortran2003.
* \version 1.4.2 Fortran \p dims parameter added in this release
* \since 1.0.0
@@ -1001,18 +941,13 @@ H5_DLL herr_t H5Aread_async(const char *app_file, const char *app_func, unsigned
*
*/
H5_DLL herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf);
+/*--------------------------------------------------------------------------*/
+/**
+ * \ingroup ASYNC
+ * \async_variant_of{H5Awrite}
+ */
H5_DLL herr_t H5Awrite_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
hid_t type_id, const void *buf, hid_t es_id);
-H5_DLL herr_t H5Arename_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
- const char *old_name, const char *new_name, hid_t es_id);
-H5_DLL herr_t H5Arename_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
- 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);
-H5_DLL herr_t H5Aexists_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id,
- const char *attr_name, hbool_t *exists, hid_t es_id);
-H5_DLL herr_t H5Aexists_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
- hid_t loc_id, const char *obj_name, const char *attr_name,
- hbool_t *exists, hid_t lapl_id, hid_t es_id);
/*-------------------------------------------------------------------------*/
/**
* \ingroup H5A
@@ -1038,9 +973,8 @@ H5_DLL herr_t H5Aexists_by_name_async(const char *app_file, const char *app_func
*/
H5_DLL 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);
-H5_DLL herr_t H5Aclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
- hid_t es_id);
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -1074,6 +1008,7 @@ H5_DLL herr_t H5Aclose_async(const char *app_file, const char *app_func, unsigne
#define H5Aexists_by_name_async_wrap H5_NO_EXPAND(H5Aexists_by_name_async)
#define H5Aclose_async_wrap H5_NO_EXPAND(H5Aclose_async)
#endif /* H5A_MODULE */
+/// \endcond
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -1085,9 +1020,28 @@ H5_DLL herr_t H5Aclose_async(const char *app_file, const char *app_func, unsigne
/* Typedefs */
-/* Typedef for H5Aiterate1() callbacks */
+//! <!-- [H5A_operator1_t_snip] -->
+/**
+ * \brief Typedef for H5Aiterate1() callbacks
+ *
+ * \param[in] location_id The identifier for the group, dataset
+ * or named datatype being iterated over
+ * \param[in] attr_name The name of the current object attribute
+ * \param[in,out] operator_data A pointer to the operator data passed in to
+ * H5Aiterate1()
+ * \returns The return values from an operator are:
+ * \li Zero causes the iterator to continue, returning zero when
+ * all attributes have been processed.
+ * \li Positive causes the iterator to immediately return that
+ * positive value, indicating short-circuit success. The
+ * iterator can be restarted at the next attribute.
+ * \li Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_name /*in*/,
void *operator_data /*in,out*/);
+//! <!-- [H5A_operator1_t_snip] -->
/* Function prototypes */
/* --------------------------------------------------------------------------*/
@@ -1104,9 +1058,9 @@ typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_nam
*
* \return \hid_tv{attribute}
*
- * \note The \p acpl parameters is currently not used; specify #H5P_DEFAULT.
+ * \deprecation_note{H5Acreate2()}
*
- * \deprecated Deprecated in favor of H5Acreate2()
+ * \plist_unused{acpl}
*
* \details H5Acreate1() creates an attribute, \p name, which is attached
* to the object specified by the identifier \p loc_id.
@@ -1114,18 +1068,7 @@ typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_nam
* The attribute name, \p name, must be unique for the object.
*
* The attribute is created with the specified datatype and dataspace,
- * \p type_id and \p space_id, which are created with the H5T and
- * H5S interfaces, respectively.
- *
- * If \p type_id is either a fixed-length or variable-length string,
- * it is important to set the string length when defining the
- * datatype. String datatypes are derived from #H5T_C_S1 (or
- * #H5T_FORTRAN_S1 for Fortran), which defaults to 1 character in
- * size. See H5Tset_size() and Creating variable-length string
- * datatypes.
- *
- * The attribute identifier returned by this function must be released
- * with H5Aclose() resource leaks will develop.
+ * \p type_id and \p space_id.
*
* \since 1.8.0
*
@@ -1147,8 +1090,7 @@ H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t spa
* \return Returns the number of attributes if successful; otherwise returns
* a negative value.
*
- * \deprecated This function is deprecated in favor of the functions
- * H5Oget_info(), H5Oget_info_by_name(), and H5Oget_info_by_idx().
+ * \deprecation_note{H5Oget_info(), H5Oget_info_by_name(), and H5Oget_info_by_idx()}
*
* \details H5Aget_num_attrs() returns the number of attributes attached to
* the object specified by its identifier, \p loc_id.
@@ -1163,8 +1105,6 @@ H5_DLL int H5Aget_num_attrs(hid_t loc_id);
*
* \brief Calls a user’s function for each attribute on an object
*
- * \todo make prototype parameter match function (idx vs attr_num)
- *
* \loc_id
* \param[in,out] idx Starting (in) and ending (out) attribute index
* \param[in] op User's function to pass each attribute to
@@ -1173,8 +1113,7 @@ H5_DLL int H5Aget_num_attrs(hid_t loc_id);
*
* \return \herr_t
*
- * \deprecated This function is deprecated in favor of the function
- * H5Aiterate2().
+ * \deprecation_note{H5Aiterate2()}
*
* \details H5Aiterate1() iterates over the attributes of the object
* specified by its identifier, \p loc_id. The object can be a
@@ -1186,29 +1125,8 @@ H5_DLL int H5Aget_num_attrs(hid_t loc_id);
* \p op, is returned in \p idx. If \p idx is the null pointer,
* then all attributes are processed.
*
- * The prototype for #H5A_operator1_t is a user defined function
- * where:
- * The operation receives the identifier for the group, dataset
- * or named datatype being iterated over, \p loc_id, the name of
- * the current object attribute, \p attr_name, and the pointer to
- * the operator data passed in to H5Aiterate1(), \p op_data.
- *
- * The return values from an operator are:
- *
- * \li Zero causes the iterator to continue, returning zero when
- * all attributes have been processed.
- * \li Positive causes the iterator to immediately return that
- * positive value, indicating short-circuit success. The
- * iterator can be restarted at the next attribute.
- * \li Negative causes the iterator to immediately return that value,
- * indicating failure. The iterator can be restarted at the next
- * attribute.
- *
- * \todo Add snippet to show H5A_operator1_t.
- *
* \version 1.8.0 The function \p H5Aiterate was renamed to H5Aiterate1()
* and deprecated in this release.
- *
* \since 1.0.0
*
*/
@@ -1224,8 +1142,7 @@ H5_DLL herr_t H5Aiterate1(hid_t loc_id, unsigned *idx, H5A_operator1_t op, void
*
* \return \hid_tv{attribute}
*
- * \deprecated This function is deprecated in favor of the function
- * H5Aopen_by_idx().
+ * \deprecation_note{H5Aopen_by_idx()}
*
* \details H5Aopen_idx() opens an attribute which is attached to the
* object specified with \p loc_id . The location object may be
@@ -1251,8 +1168,7 @@ H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx);
*
* \return \hid_tv{attribute}
*
- * \deprecated This function is deprecated in favor of the function
- * H5Aopen_by_name().
+ * \deprecation_note{H5Aopen_by_name()}
*
* \details H5Aopen_name() opens an attribute specified by its name,
* \p name, which is attached to the object specified with
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index d70816d..e333d61 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -250,7 +250,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header")
/* Magic number */
- if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree header signature")
image += H5_SIZEOF_MAGIC;
@@ -648,7 +648,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
internal->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
- if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node signature")
image += H5_SIZEOF_MAGIC;
@@ -1064,7 +1064,7 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
leaf->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
- if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index 6ccdc11..ec7457f 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -166,7 +166,7 @@ H5B__cache_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_uda
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate buffer for child addresses")
/* magic number */
- if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h
index ac28ee6..0a79628 100644
--- a/src/H5Bpkg.h
+++ b/src/H5Bpkg.h
@@ -12,12 +12,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol
- * Thursday, May 15, 2003
+ * Programmer: Quincey Koziol
+ * Thursday, May 15, 2003
*
- * Purpose: This file contains declarations which are visible only within
- * the H5B package. Source files outside the H5B package should
- * include H5Bprivate.h instead.
+ * Purpose: This file contains declarations which are visible only within
+ * the H5B package. Source files outside the H5B package should
+ * include H5Bprivate.h instead.
*/
#if !(defined H5B_FRIEND || defined H5B_MODULE)
#error "Do not include this file outside the H5B package!"
@@ -30,7 +30,7 @@
#include "H5Bprivate.h"
/* Other private headers needed by this file */
-#include "H5ACprivate.h" /* Metadata cache */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5FLprivate.h" /* Free Lists */
/**************************/
@@ -49,20 +49,20 @@
typedef struct H5B_t {
H5AC_info_t cache_info; /* Information for H5AC cache functions */
/* _must_ be first field in structure */
- H5UC_t * rc_shared; /*ref-counted shared info */
- unsigned level; /*node level */
- unsigned nchildren; /*number of child pointers */
- haddr_t left; /*address of left sibling */
- haddr_t right; /*address of right sibling */
+ H5UC_t * rc_shared; /*ref-counted shared info */
+ unsigned level; /*node level */
+ unsigned nchildren; /*number of child pointers */
+ haddr_t left; /*address of left sibling */
+ haddr_t right; /*address of right sibling */
uint8_t *native; /*array of keys in native format */
- haddr_t *child; /*2k child pointers */
+ haddr_t *child; /*2k child pointers */
} H5B_t;
/* Callback info for loading a B-tree node into the cache */
typedef struct H5B_cache_ud_t {
H5F_t * f; /* File that B-tree node is within */
- const struct H5B_class_t *type; /* Type of tree */
- H5UC_t * rc_shared; /* Ref-counted shared info */
+ const struct H5B_class_t *type; /* Type of tree */
+ H5UC_t * rc_shared; /* Ref-counted shared info */
} H5B_cache_ud_t;
/*****************************/
@@ -86,4 +86,4 @@ H5_DLL herr_t H5B__node_dest(H5B_t *bt);
herr_t H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata);
#endif
-#endif /*_H5Bpkg_H*/
+#endif /*H5Bpkg_H*/
diff --git a/src/H5C.c b/src/H5C.c
index 9369506..7853933 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -21,14 +21,8 @@
* things which exist on disk, and which may be
* unambiguously referenced by their disk addresses.
*
- * The code in this module was initially written in
- * support of a complete re-write of the metadata cache
- * in H5AC.c However, other uses for the cache code
- * suggested themselves, and thus this file was created
- * in an attempt to support re-use.
- *
- * For a detailed overview of the cache, please see the
- * header comment for H5C_t in H5Cpkg.h.
+ * For a detailed overview of the cache, please see the
+ * header comment for H5C_t in H5Cpkg.h.
*
*-------------------------------------------------------------------------
*/
@@ -39,9 +33,7 @@
*
* Code Changes:
*
- * - Remove extra functionality in H5C__flush_single_entry()?
- *
- * - Change protect/unprotect to lock/unlock.
+ * - Change protect/unprotect to lock/unlock.
*
* - Flush entries in increasing address order in
* H5C__make_space_in_cache().
@@ -53,18 +45,9 @@
* I/O overhead. Can't do this just yet as some entries are not
* contiguous. Do this in parallel only or in serial as well?
*
- * - Create MPI type for dirty objects when flushing in parallel.
- *
- * - Now that TBBT routines aren't used, fix nodes in memory to
- * point directly to the skip list node from the LRU list, eliminating
- * skip list lookups when evicting objects from the cache.
- *
- * Tests:
- *
- * - Trim execution time. (This is no longer a major issue with the
- * shift from the TBBT to a hash table for indexing.)
- *
- * - Add random tests.
+ * - Fix nodes in memory to point directly to the skip list node from
+ * the LRU list, eliminating skip list lookups when evicting objects
+ * from the cache.
*
**************************************************************************/
@@ -462,17 +445,17 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id,
(cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT;
(cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off;
- (cache_ptr->resize_ctl).flash_multiple = (double)1.0f;
- (cache_ptr->resize_ctl).flash_threshold = (double)0.25f;
+ (cache_ptr->resize_ctl).flash_multiple = 1.0;
+ (cache_ptr->resize_ctl).flash_threshold = 0.25;
(cache_ptr->resize_ctl).decr_mode = H5C_decr__off;
- (cache_ptr->resize_ctl).upper_hr_threshold = (double)H5C__DEF_AR_UPPER_THRESHHOLD;
- (cache_ptr->resize_ctl).decrement = (double)H5C__DEF_AR_DECREMENT;
+ (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD;
+ (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT;
(cache_ptr->resize_ctl).apply_max_decrement = TRUE;
(cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT;
(cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT;
(cache_ptr->resize_ctl).apply_empty_reserve = TRUE;
- (cache_ptr->resize_ctl).empty_reserve = (double)H5C__DEF_AR_EMPTY_RESERVE;
+ (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE;
cache_ptr->epoch_markers_active = 0;
@@ -689,9 +672,6 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr,
HDfprintf(stdout, "%sAuto cache resize -- unknown status code.\n", cache_ptr->prefix);
break;
}
-
- return;
-
} /* H5C_def_auto_resize_rpt_fcn() */
/*-------------------------------------------------------------------------
@@ -2725,7 +2705,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p
break;
case H5C_incr__threshold:
- if ((config_ptr->lower_hr_threshold <= (double)0.0f) || (config_ptr->increment <= (double)1.0f) ||
+ if ((config_ptr->lower_hr_threshold <= 0.0) || (config_ptr->increment <= 1.0) ||
((config_ptr->apply_max_increment) && (config_ptr->max_increment <= 0)))
cache_ptr->size_increase_possible = FALSE;
break;
@@ -2745,21 +2725,21 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p
break;
case H5C_decr__threshold:
- if ((config_ptr->upper_hr_threshold >= (double)1.0f) || (config_ptr->decrement >= (double)1.0f) ||
+ if ((config_ptr->upper_hr_threshold >= 1.0) || (config_ptr->decrement >= 1.0) ||
((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)))
cache_ptr->size_decrease_possible = FALSE;
break;
case H5C_decr__age_out:
- if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) ||
+ if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) ||
((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)))
cache_ptr->size_decrease_possible = FALSE;
break;
case H5C_decr__age_out_with_threshold:
- if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) ||
+ if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) ||
((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)) ||
- (config_ptr->upper_hr_threshold >= (double)1.0f))
+ (config_ptr->upper_hr_threshold >= 1.0))
cache_ptr->size_decrease_possible = FALSE;
break;
@@ -3740,8 +3720,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"initial_size must be in the interval [min_size, max_size]")
- if ((config_ptr->min_clean_fraction < (double)0.0f) ||
- (config_ptr->min_clean_fraction > (double)1.0f))
+ if ((config_ptr->min_clean_fraction < 0.0) || (config_ptr->min_clean_fraction > 1.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_clean_fraction must be in the interval [0.0, 1.0]")
if (config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH)
@@ -3756,12 +3735,11 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid incr_mode")
if (config_ptr->incr_mode == H5C_incr__threshold) {
- if ((config_ptr->lower_hr_threshold < (double)0.0f) ||
- (config_ptr->lower_hr_threshold > (double)1.0f))
+ if ((config_ptr->lower_hr_threshold < 0.0) || (config_ptr->lower_hr_threshold > 1.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"lower_hr_threshold must be in the range [0.0, 1.0]")
- if (config_ptr->increment < (double)1.0f)
+ if (config_ptr->increment < 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "increment must be greater than or equal to 1.0")
/* no need to check max_increment, as it is a size_t,
@@ -3775,12 +3753,10 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
break;
case H5C_flash_incr__add_space:
- if ((config_ptr->flash_multiple < (double)0.1f) ||
- (config_ptr->flash_multiple > (double)10.0f))
+ if ((config_ptr->flash_multiple < 0.1) || (config_ptr->flash_multiple > 10.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"flash_multiple must be in the range [0.1, 10.0]")
- if ((config_ptr->flash_threshold < (double)0.1f) ||
- (config_ptr->flash_threshold > (double)1.0f))
+ if ((config_ptr->flash_threshold < 0.1) || (config_ptr->flash_threshold > 1.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"flash_threshold must be in the range [0.1, 1.0]")
break;
@@ -3801,10 +3777,10 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
}
if (config_ptr->decr_mode == H5C_decr__threshold) {
- if (config_ptr->upper_hr_threshold > (double)1.0f)
+ if (config_ptr->upper_hr_threshold > 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be <= 1.0")
- if ((config_ptr->decrement > (double)1.0f) || (config_ptr->decrement < (double)0.0f))
+ if ((config_ptr->decrement > 1.0) || (config_ptr->decrement < 0.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "decrement must be in the interval [0.0, 1.0]")
/* no need to check max_decrement as it is a size_t
@@ -3821,7 +3797,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction too big")
if ((config_ptr->apply_empty_reserve) &&
- ((config_ptr->empty_reserve > (double)1.0f) || (config_ptr->empty_reserve < (double)0.0f)))
+ ((config_ptr->empty_reserve > 1.0) || (config_ptr->empty_reserve < 0.0)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty_reserve must be in the interval [0.0, 1.0]")
/* no need to check max_decrement as it is a size_t
@@ -3830,8 +3806,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
} /* H5C_decr__age_out || H5C_decr__age_out_with_threshold */
if (config_ptr->decr_mode == H5C_decr__age_out_with_threshold) {
- if ((config_ptr->upper_hr_threshold > (double)1.0f) ||
- (config_ptr->upper_hr_threshold < (double)0.0f))
+ if ((config_ptr->upper_hr_threshold > 1.0) || (config_ptr->upper_hr_threshold < 0.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"upper_hr_threshold must be in the interval [0.0, 1.0]")
} /* H5C_decr__age_out_with_threshold */
@@ -4299,8 +4274,8 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted)
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length);
- HDassert((double)0.0f <= (cache_ptr->resize_ctl).min_clean_fraction);
- HDassert((cache_ptr->resize_ctl).min_clean_fraction <= (double)100.0f);
+ HDassert(0.0 <= (cache_ptr->resize_ctl).min_clean_fraction);
+ HDassert((cache_ptr->resize_ctl).min_clean_fraction <= 100.0);
/* check to see if cache_ptr->resize_in_progress is TRUE. If it, this
* is a re-entrant call via a client callback called in the resize
@@ -4323,7 +4298,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted)
if (H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate")
- HDassert(((double)0.0f <= hit_rate) && (hit_rate <= (double)1.0f));
+ HDassert((0.0 <= hit_rate) && (hit_rate <= 1.0));
switch ((cache_ptr->resize_ctl).incr_mode) {
case H5C_incr__off:
@@ -6653,9 +6628,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags)
}
if (H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) < 0)
-
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file")
-
#ifdef H5_HAVE_PARALLEL
}
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5CS.c b/src/H5CS.c
index 6510c25..d7cb6f1 100644
--- a/src/H5CS.c
+++ b/src/H5CS.c
@@ -262,9 +262,9 @@ H5CS_copy_stack(void)
if (NULL == (new_stack->rec = HDcalloc(old_stack->nused, sizeof(const char *))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't allocate function stack records")
- /* Copy old stack to new one, duplicating the strings */
- for (u = 0; u < old_stack->nused; u++)
- new_stack->rec[u] = HDstrdup(old_stack->rec[u]);
+ /* Copy pointers on old stack to new one */
+ /* (Strings don't need to be duplicated, they are statically allocated) */
+ HDmemcpy(new_stack->rec, old_stack->rec, sizeof(char *) * old_stack->nused);
new_stack->nused = new_stack->nalloc = old_stack->nused;
/* Set the return value */
@@ -298,11 +298,9 @@ H5CS_close_stack(H5CS_t *stack)
HDassert(stack);
/* Free stack */
- for (u = 0; u < stack->nused; u++) {
- if (stack->rec[u])
- HDfree((void *)stack->rec[u]);
- stack->rec[u] = NULL;
- } /* end for */
+ /* The function name string are statically allocated (by the compiler)
+ * and are not allocated, so there's no need to free them.
+ */
if (stack->rec) {
HDfree(stack->rec);
stack->rec = NULL;
diff --git a/src/H5CX.c b/src/H5CX.c
index c304548..01bf435 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -761,13 +761,14 @@ H5CX__get_context(void)
static void
H5CX__push_common(H5CX_node_t *cnode)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(cnode);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ HDassert(head);
/* Set non-zero context info */
cnode->ctx.dxpl_id = H5P_DATASET_XFER_DEFAULT;
@@ -834,7 +835,7 @@ done:
void
H5CX_push_special(void)
{
- H5CX_node_t *cnode; /* Context node */
+ H5CX_node_t *cnode = NULL; /* Context node */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -868,13 +869,13 @@ H5CX_push_special(void)
herr_t
H5CX_retrieve_state(H5CX_state_t **api_state)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(api_state);
@@ -975,6 +976,16 @@ H5CX_retrieve_state(H5CX_state_t **api_state)
#endif /* H5_HAVE_PARALLEL */
done:
+ /* Cleanup on error */
+ if (ret_value < 0) {
+ if (*api_state) {
+ /* Release the (possibly partially allocated) API state struct */
+ if (H5CX_free_state(*api_state) < 0)
+ HDONE_ERROR(H5E_CONTEXT, H5E_CANTRELEASE, FAIL, "unable to release API state")
+ *api_state = NULL;
+ } /* end if */
+ } /* end if */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5CX_retrieve_state() */
@@ -998,12 +1009,12 @@ done:
herr_t
H5CX_restore_state(const H5CX_state_t *api_state)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(api_state);
@@ -1066,22 +1077,22 @@ H5CX_free_state(H5CX_state_t *api_state)
HDassert(api_state);
/* Release the DCPL */
- if (api_state->dcpl_id != H5P_DATASET_CREATE_DEFAULT)
+ if (0 != api_state->dcpl_id && H5P_DATASET_CREATE_DEFAULT != api_state->dcpl_id)
if (H5I_dec_ref(api_state->dcpl_id) < 0)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTDEC, FAIL, "can't decrement refcount on DCPL")
/* Release the DXPL */
- if (api_state->dxpl_id != H5P_DATASET_XFER_DEFAULT)
+ if (0 != api_state->dxpl_id && H5P_DATASET_XFER_DEFAULT != api_state->dxpl_id)
if (H5I_dec_ref(api_state->dxpl_id) < 0)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTDEC, FAIL, "can't decrement refcount on DXPL")
/* Release the LAPL */
- if (api_state->lapl_id != H5P_LINK_ACCESS_DEFAULT)
+ if (0 != api_state->lapl_id && H5P_LINK_ACCESS_DEFAULT != api_state->lapl_id)
if (H5I_dec_ref(api_state->lapl_id) < 0)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTDEC, FAIL, "can't decrement refcount on LAPL")
/* Release the LCPL */
- if (api_state->lcpl_id != H5P_LINK_CREATE_DEFAULT)
+ if (0 != api_state->lcpl_id && H5P_LINK_CREATE_DEFAULT != api_state->lcpl_id)
if (H5I_dec_ref(api_state->lcpl_id) < 0)
HGOTO_ERROR(H5E_CONTEXT, H5E_CANTDEC, FAIL, "can't decrement refcount on LCPL")
@@ -1124,15 +1135,19 @@ done:
hbool_t
H5CX_is_def_dxpl(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ hbool_t is_def_dxpl = FALSE; /* Flag to indicate DXPL is default */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT);
+ /* Set return value */
+ is_def_dxpl = ((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT);
+
+ FUNC_LEAVE_NOAPI(is_def_dxpl)
} /* end H5CX_is_def_dxpl() */
/*-------------------------------------------------------------------------
@@ -1150,13 +1165,13 @@ H5CX_is_def_dxpl(void)
void
H5CX_set_dxpl(hid_t dxpl_id)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
- HDassert(*head);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ HDassert(head && *head);
/* Set the API context's DXPL to a new value */
(*head)->ctx.dxpl_id = dxpl_id;
@@ -1179,13 +1194,13 @@ H5CX_set_dxpl(hid_t dxpl_id)
void
H5CX_set_dcpl(hid_t dcpl_id)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
- HDassert(*head);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ HDassert(head && *head);
/* Set the API context's DCPL to a new value */
(*head)->ctx.dcpl_id = dcpl_id;
@@ -1209,13 +1224,13 @@ H5CX_set_dcpl(hid_t dcpl_id)
herr_t
H5CX_set_libver_bounds(H5F_t *f)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context value */
@@ -1245,13 +1260,13 @@ done:
void
H5CX_set_lcpl(hid_t lcpl_id)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
- HDassert(*head);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ HDassert(head && *head);
/* Set the API context's LCPL to a new value */
(*head)->ctx.lcpl_id = lcpl_id;
@@ -1274,12 +1289,12 @@ H5CX_set_lcpl(hid_t lcpl_id)
void
H5CX_set_lapl(hid_t lapl_id)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context's LAPL to a new value */
@@ -1314,15 +1329,15 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass,
#endif /* H5_HAVE_PARALLEL */
is_collective)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(acspl_id);
HDassert(libclass);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set access plist to the default property list of the appropriate class if it's the generic default */
@@ -1437,13 +1452,13 @@ H5CX_set_loc(hid_t
loc_id)
{
#ifdef H5_HAVE_PARALLEL
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set collective metadata read flag */
@@ -1491,13 +1506,13 @@ done:
herr_t
H5CX_set_vol_wrap_ctx(void *vol_wrap_ctx)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context value */
@@ -1525,13 +1540,13 @@ done:
herr_t
H5CX_set_vol_connector_prop(const H5VL_connector_prop_t *vol_connector_prop)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context value */
@@ -1559,15 +1574,19 @@ done:
hid_t
H5CX_get_dxpl(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ hid_t dxpl_id = H5I_INVALID_HID; /* DXPL ID for API operation */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.dxpl_id)
+ /* Set return value */
+ dxpl_id = (*head)->ctx.dxpl_id;
+
+ FUNC_LEAVE_NOAPI(dxpl_id)
} /* end H5CX_get_dxpl() */
/*-------------------------------------------------------------------------
@@ -1585,15 +1604,19 @@ H5CX_get_dxpl(void)
hid_t
H5CX_get_lapl(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ hid_t lapl_id = H5I_INVALID_HID; /* LAPL ID for API operation */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.lapl_id)
+ /* Set return value */
+ lapl_id = (*head)->ctx.lapl_id;
+
+ FUNC_LEAVE_NOAPI(lapl_id)
} /* end H5CX_get_lapl() */
/*-------------------------------------------------------------------------
@@ -1611,14 +1634,14 @@ H5CX_get_lapl(void)
herr_t
H5CX_get_vol_wrap_ctx(void **vol_wrap_ctx)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vol_wrap_ctx);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Check for value that was set */
@@ -1647,14 +1670,14 @@ done:
herr_t
H5CX_get_vol_connector_prop(H5VL_connector_prop_t *vol_connector_prop)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vol_connector_prop);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Check for value that was set */
@@ -1683,15 +1706,19 @@ done:
haddr_t
H5CX_get_tag(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ haddr_t tag = HADDR_UNDEF; /* Current object's tag (ohdr chunk #0 address) */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.tag)
+ /* Set return value */
+ tag = (*head)->ctx.tag;
+
+ FUNC_LEAVE_NOAPI(tag)
} /* end H5CX_get_tag() */
/*-------------------------------------------------------------------------
@@ -1709,15 +1736,19 @@ H5CX_get_tag(void)
H5AC_ring_t
H5CX_get_ring(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ H5AC_ring_t ring = H5AC_RING_INV; /* Current metadata cache ring for entries */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.ring)
+ /* Set return value */
+ ring = (*head)->ctx.ring;
+
+ FUNC_LEAVE_NOAPI(ring)
} /* end H5CX_get_ring() */
#ifdef H5_HAVE_PARALLEL
@@ -1737,15 +1768,19 @@ H5CX_get_ring(void)
hbool_t
H5CX_get_coll_metadata_read(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ hbool_t coll_md_read = FALSE;
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.coll_metadata_read)
+ /* Set return value */
+ coll_md_read = (*head)->ctx.coll_metadata_read;
+
+ FUNC_LEAVE_NOAPI(coll_md_read)
} /* end H5CX_get_coll_metadata_read() */
/*-------------------------------------------------------------------------
@@ -1765,15 +1800,15 @@ H5CX_get_coll_metadata_read(void)
herr_t
H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(btype);
HDassert(ftype);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context values */
@@ -1799,15 +1834,19 @@ done:
hbool_t
H5CX_get_mpi_file_flushing(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ hbool_t flushing = FALSE;
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.mpi_file_flushing)
+ /* Set return value */
+ flushing = (*head)->ctx.mpi_file_flushing;
+
+ FUNC_LEAVE_NOAPI(flushing)
} /* end H5CX_get_mpi_file_flushing() */
/*-------------------------------------------------------------------------
@@ -1826,15 +1865,19 @@ H5CX_get_mpi_file_flushing(void)
hbool_t
H5CX_get_mpio_rank0_bcast(void)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ hbool_t do_rank0_bcast = FALSE;
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
- FUNC_LEAVE_NOAPI((*head)->ctx.rank0_bcast)
+ /* Set return value */
+ do_rank0_bcast = (*head)->ctx.rank0_bcast;
+
+ FUNC_LEAVE_NOAPI(do_rank0_bcast)
} /* end H5CX_get_mpio_rank0_bcast() */
#endif /* H5_HAVE_PARALLEL */
@@ -1853,14 +1896,14 @@ H5CX_get_mpio_rank0_bcast(void)
herr_t
H5CX_get_btree_split_ratios(double split_ratio[3])
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(split_ratio);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -1889,14 +1932,14 @@ done:
herr_t
H5CX_get_max_temp_buf(size_t *max_temp_buf)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(max_temp_buf);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -1924,14 +1967,14 @@ done:
herr_t
H5CX_get_tconv_buf(void **tconv_buf)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(tconv_buf);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -1959,14 +2002,14 @@ done:
herr_t
H5CX_get_bkgr_buf(void **bkgr_buf)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(bkgr_buf);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -1994,14 +2037,14 @@ done:
herr_t
H5CX_get_bkgr_buf_type(H5T_bkg_t *bkgr_buf_type)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(bkgr_buf_type);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2029,14 +2072,14 @@ done:
herr_t
H5CX_get_vec_size(size_t *vec_size)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vec_size);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2066,14 +2109,14 @@ done:
herr_t
H5CX_get_io_xfer_mode(H5FD_mpio_xfer_t *io_xfer_mode)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(io_xfer_mode);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2101,14 +2144,14 @@ done:
herr_t
H5CX_get_mpio_coll_opt(H5FD_mpio_collective_opt_t *mpio_coll_opt)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(mpio_coll_opt);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2136,14 +2179,14 @@ done:
herr_t
H5CX_get_mpio_local_no_coll_cause(uint32_t *mpio_local_no_coll_cause)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(mpio_local_no_coll_cause);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2172,14 +2215,14 @@ done:
herr_t
H5CX_get_mpio_global_no_coll_cause(uint32_t *mpio_global_no_coll_cause)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(mpio_global_no_coll_cause);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2208,14 +2251,14 @@ done:
herr_t
H5CX_get_mpio_chunk_opt_mode(H5FD_mpio_chunk_opt_t *mpio_chunk_opt_mode)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(mpio_chunk_opt_mode);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2244,14 +2287,14 @@ done:
herr_t
H5CX_get_mpio_chunk_opt_num(unsigned *mpio_chunk_opt_num)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(mpio_chunk_opt_num);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2280,14 +2323,14 @@ done:
herr_t
H5CX_get_mpio_chunk_opt_ratio(unsigned *mpio_chunk_opt_ratio)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(mpio_chunk_opt_ratio);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2317,14 +2360,14 @@ done:
herr_t
H5CX_get_err_detect(H5Z_EDC_t *err_detect)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(err_detect);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2352,14 +2395,14 @@ done:
herr_t
H5CX_get_filter_cb(H5Z_cb_t *filter_cb)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(filter_cb);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2387,14 +2430,14 @@ done:
herr_t
H5CX_get_data_transform(H5Z_data_xform_t **data_transform)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(data_transform);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2445,14 +2488,14 @@ done:
herr_t
H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vl_alloc_info);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2510,14 +2553,14 @@ done:
herr_t
H5CX_get_dt_conv_cb(H5T_conv_cb_t *dt_conv_cb)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(dt_conv_cb);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2545,14 +2588,14 @@ done:
herr_t
H5CX_get_encoding(H5T_cset_t *encoding)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(encoding);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.lcpl_id);
@@ -2580,14 +2623,14 @@ done:
herr_t
H5CX_get_intermediate_group(unsigned *crt_intermed_group)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(crt_intermed_group);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.lcpl_id);
@@ -2616,14 +2659,14 @@ done:
herr_t
H5CX_get_nlinks(size_t *nlinks)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(nlinks);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id);
@@ -2651,15 +2694,15 @@ done:
herr_t
H5CX_get_libver_bounds(H5F_libver_t *low_bound, H5F_libver_t *high_bound)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(low_bound);
HDassert(high_bound);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.fapl_id);
@@ -2690,14 +2733,14 @@ done:
herr_t
H5CX_get_dset_min_ohdr_flag(hbool_t *dset_min_ohdr_flag)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(dset_min_ohdr_flag);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dcpl_id);
@@ -2726,14 +2769,14 @@ done:
herr_t
H5CX_get_ext_file_prefix(const char **extfile_prefix)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(extfile_prefix);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dapl_id);
@@ -2784,14 +2827,14 @@ done:
herr_t
H5CX_get_vds_prefix(const char **vds_prefix)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vds_prefix);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dapl_id);
@@ -2842,12 +2885,12 @@ done:
void
H5CX_set_tag(haddr_t tag)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
(*head)->ctx.tag = tag;
@@ -2870,12 +2913,12 @@ H5CX_set_tag(haddr_t tag)
void
H5CX_set_ring(H5AC_ring_t ring)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
(*head)->ctx.ring = ring;
@@ -2900,12 +2943,12 @@ H5CX_set_ring(H5AC_ring_t ring)
void
H5CX_set_coll_metadata_read(hbool_t cmdr)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
(*head)->ctx.coll_metadata_read = cmdr;
@@ -2930,14 +2973,14 @@ H5CX_set_coll_metadata_read(hbool_t cmdr)
herr_t
H5CX_set_mpi_coll_datatypes(MPI_Datatype btype, MPI_Datatype ftype)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context values */
@@ -2963,13 +3006,13 @@ done:
herr_t
H5CX_set_io_xfer_mode(H5FD_mpio_xfer_t io_xfer_mode)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context value */
@@ -2997,13 +3040,13 @@ done:
herr_t
H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context value */
@@ -3031,12 +3074,12 @@ done:
void
H5CX_set_mpi_file_flushing(hbool_t flushing)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
(*head)->ctx.mpi_file_flushing = flushing;
@@ -3060,12 +3103,12 @@ H5CX_set_mpi_file_flushing(hbool_t flushing)
void
H5CX_set_mpio_rank0_bcast(hbool_t rank0_bcast)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
(*head)->ctx.rank0_bcast = rank0_bcast;
@@ -3089,13 +3132,13 @@ H5CX_set_mpio_rank0_bcast(hbool_t rank0_bcast)
herr_t
H5CX_set_vlen_alloc_info(H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context value */
@@ -3126,13 +3169,13 @@ done:
herr_t
H5CX_set_nlinks(size_t nlinks)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Set the API context value */
@@ -3162,12 +3205,12 @@ done:
void
H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chunk_opt)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3193,12 +3236,12 @@ H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chun
void
H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3224,12 +3267,12 @@ H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode)
void
H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT);
@@ -3258,12 +3301,12 @@ H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause)
void
H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT);
@@ -3296,13 +3339,13 @@ H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause)
herr_t
H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3329,13 +3372,13 @@ done:
herr_t
H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3362,13 +3405,13 @@ done:
herr_t
H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3396,13 +3439,13 @@ done:
herr_t
H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3430,13 +3473,13 @@ done:
herr_t
H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3464,13 +3507,13 @@ done:
herr_t
H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3497,13 +3540,13 @@ done:
herr_t
H5CX_test_set_mpio_coll_rank0_bcast(hbool_t mpio_coll_rank0_bcast)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT));
@@ -3530,14 +3573,14 @@ done:
herr_t
H5CX_get_ohdr_flags(uint8_t *ohdr_flags)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(ohdr_flags);
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
HDassert(H5P_DEFAULT != (*head)->ctx.dcpl_id);
@@ -3565,9 +3608,8 @@ done:
static H5CX_node_t *
H5CX__pop_common(hbool_t update_dxpl_props)
{
- H5CX_node_t **head =
- H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
- H5CX_node_t *ret_value = NULL; /* Return value */
+ H5CX_node_t **head = NULL; /* Pointer to head of API context list */
+ H5CX_node_t * ret_value = NULL; /* Return value */
#ifdef H5_HAVE_PARALLEL
FUNC_ENTER_STATIC
@@ -3576,6 +3618,7 @@ H5CX__pop_common(hbool_t update_dxpl_props)
#endif
/* Sanity check */
+ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */
HDassert(head && *head);
/* Check for cached DXPL properties to return to application */
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index 478cc1d..104f1af 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -429,11 +429,11 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
int32_t aggregate_max_pins = 0;
double hit_rate;
double prefetch_use_rate;
- double average_successful_search_depth = 0.0f;
- double average_failed_search_depth = 0.0f;
- double average_entries_skipped_per_calls_to_msic = 0.0f;
- double average_dirty_pf_entries_skipped_per_call_to_msic = 0.0f;
- double average_entries_scanned_per_calls_to_msic = 0.0f;
+ double average_successful_search_depth = 0.0;
+ double average_failed_search_depth = 0.0;
+ double average_entries_skipped_per_calls_to_msic = 0.0;
+ double average_dirty_pf_entries_skipped_per_call_to_msic = 0.0;
+ double average_entries_scanned_per_calls_to_msic = 0.0;
#endif /* H5C_COLLECT_CACHE_STATS */
herr_t ret_value = SUCCEED; /* Return value */
@@ -492,9 +492,9 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
} /* end for */
if ((total_hits > 0) || (total_misses > 0))
- hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses));
+ hit_rate = 100.0 * ((double)(total_hits)) / ((double)(total_hits + total_misses));
else
- hit_rate = 0.0f;
+ hit_rate = 0.0;
if (cache_ptr->successful_ht_searches > 0)
average_successful_search_depth = ((double)(cache_ptr->total_successful_ht_search_depth)) /
@@ -630,10 +630,9 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
(long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID]));
if (cache_ptr->prefetches > 0)
- prefetch_use_rate =
- (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
+ prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
else
- prefetch_use_rate = 0.0f;
+ prefetch_use_rate = 0.0;
HDfprintf(stdout, "%s prefetched entry use rate = %lf\n", cache_ptr->prefix, prefetch_use_rate);
@@ -658,10 +657,10 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
((cache_ptr->class_table_ptr))[i]->name);
if ((cache_ptr->hits[i] > 0) || (cache_ptr->misses[i] > 0))
- hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) /
+ hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) /
((double)(cache_ptr->hits[i] + cache_ptr->misses[i]));
else
- hit_rate = 0.0f;
+ hit_rate = 0.0;
HDfprintf(stdout, "%s hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix,
(long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate);
@@ -832,8 +831,6 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr)
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
#endif /* H5C_COLLECT_CACHE_STATS */
-
- return;
} /* H5C_stats__reset() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Cimage.c b/src/H5Cimage.c
index b366a94..f17ff48 100644
--- a/src/H5Cimage.c
+++ b/src/H5Cimage.c
@@ -933,15 +933,14 @@ H5C_image_stats(H5C_t *cache_ptr, hbool_t H5_ATTR_UNUSED print_header)
} /* end for */
if ((total_hits > 0) || (total_misses > 0))
- hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses));
+ hit_rate = 100.0 * ((double)(total_hits)) / ((double)(total_hits + total_misses));
else
- hit_rate = 0.0f;
+ hit_rate = 0.0;
if (cache_ptr->prefetches > 0)
- prefetch_use_rate =
- (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
+ prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
else
- prefetch_use_rate = 0.0f;
+ prefetch_use_rate = 0.0;
if (print_header) {
HDfprintf(stdout, "\nhit prefetches prefetch image pf hit\n");
@@ -1773,7 +1772,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t *
p = *buf;
/* Check signature */
- if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN))
+ if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN) != 0)
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad metadata cache image header signature")
p += H5C__MDCI_BLOCK_SIGNATURE_LEN;
diff --git a/src/H5Clog.h b/src/H5Clog.h
index bd5c413..790a073 100644
--- a/src/H5Clog.h
+++ b/src/H5Clog.h
@@ -79,10 +79,10 @@ typedef struct H5C_log_class_t {
/* Logging information */
struct H5C_log_info_t {
- hbool_t enabled; /* Was the logging set up? */
- hbool_t logging; /* Are we currently logging? */
- H5C_log_class_t *cls; /* Callbacks for writing log messages */
- void * udata; /* Log-specific data */
+ hbool_t enabled; /* Was the logging set up? */
+ hbool_t logging; /* Are we currently logging? */
+ const H5C_log_class_t *cls; /* Callbacks for writing log messages */
+ void * udata; /* Log-specific data */
};
/*****************************/
diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c
index 731d741..18323ca 100644
--- a/src/H5Clog_json.c
+++ b/src/H5Clog_json.c
@@ -118,32 +118,32 @@ static herr_t H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_
/* Note that there's no cache set up call since that's the
* place where this struct is wired into the cache.
*/
-static H5C_log_class_t H5C_json_log_class_g = {"json",
- H5C__json_tear_down_logging,
- NULL, /* start logging */
- NULL, /* stop logging */
- H5C__json_write_start_log_msg,
- H5C__json_write_stop_log_msg,
- H5C__json_write_create_cache_log_msg,
- H5C__json_write_destroy_cache_log_msg,
- H5C__json_write_evict_cache_log_msg,
- H5C__json_write_expunge_entry_log_msg,
- H5C__json_write_flush_cache_log_msg,
- H5C__json_write_insert_entry_log_msg,
- H5C__json_write_mark_entry_dirty_log_msg,
- H5C__json_write_mark_entry_clean_log_msg,
- H5C__json_write_mark_unserialized_entry_log_msg,
- H5C__json_write_mark_serialized_entry_log_msg,
- H5C__json_write_move_entry_log_msg,
- H5C__json_write_pin_entry_log_msg,
- H5C__json_write_create_fd_log_msg,
- H5C__json_write_protect_entry_log_msg,
- H5C__json_write_resize_entry_log_msg,
- H5C__json_write_unpin_entry_log_msg,
- H5C__json_write_destroy_fd_log_msg,
- H5C__json_write_unprotect_entry_log_msg,
- H5C__json_write_set_cache_config_log_msg,
- H5C__json_write_remove_entry_log_msg};
+static const H5C_log_class_t H5C_json_log_class_g = {"json",
+ H5C__json_tear_down_logging,
+ NULL, /* start logging */
+ NULL, /* stop logging */
+ H5C__json_write_start_log_msg,
+ H5C__json_write_stop_log_msg,
+ H5C__json_write_create_cache_log_msg,
+ H5C__json_write_destroy_cache_log_msg,
+ H5C__json_write_evict_cache_log_msg,
+ H5C__json_write_expunge_entry_log_msg,
+ H5C__json_write_flush_cache_log_msg,
+ H5C__json_write_insert_entry_log_msg,
+ H5C__json_write_mark_entry_dirty_log_msg,
+ H5C__json_write_mark_entry_clean_log_msg,
+ H5C__json_write_mark_unserialized_entry_log_msg,
+ H5C__json_write_mark_serialized_entry_log_msg,
+ H5C__json_write_move_entry_log_msg,
+ H5C__json_write_pin_entry_log_msg,
+ H5C__json_write_create_fd_log_msg,
+ H5C__json_write_protect_entry_log_msg,
+ H5C__json_write_resize_entry_log_msg,
+ H5C__json_write_unpin_entry_log_msg,
+ H5C__json_write_destroy_fd_log_msg,
+ H5C__json_write_unprotect_entry_log_msg,
+ H5C__json_write_set_cache_config_log_msg,
+ H5C__json_write_remove_entry_log_msg};
/*-------------------------------------------------------------------------
* Function: H5C__json_write_log_message
diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c
index c30f79e..d33d1b0 100644
--- a/src/H5Clog_trace.c
+++ b/src/H5Clog_trace.c
@@ -113,32 +113,32 @@ static herr_t H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache
/* Note that there's no cache set up call since that's the
* place where this struct is wired into the cache.
*/
-static H5C_log_class_t H5C_trace_log_class_g = {"trace",
- H5C__trace_tear_down_logging,
- NULL, /* start logging */
- NULL, /* stop logging */
- NULL, /* write start message */
- NULL, /* write stop message */
- NULL, /* write create cache message */
- NULL, /* write destroy cache message */
- NULL, /* write evict cache message */
- H5C__trace_write_expunge_entry_log_msg,
- H5C__trace_write_flush_cache_log_msg,
- H5C__trace_write_insert_entry_log_msg,
- H5C__trace_write_mark_entry_dirty_log_msg,
- H5C__trace_write_mark_entry_clean_log_msg,
- H5C__trace_write_mark_unserialized_entry_log_msg,
- H5C__trace_write_mark_serialized_entry_log_msg,
- H5C__trace_write_move_entry_log_msg,
- H5C__trace_write_pin_entry_log_msg,
- H5C__trace_write_create_fd_log_msg,
- H5C__trace_write_protect_entry_log_msg,
- H5C__trace_write_resize_entry_log_msg,
- H5C__trace_write_unpin_entry_log_msg,
- H5C__trace_write_destroy_fd_log_msg,
- H5C__trace_write_unprotect_entry_log_msg,
- H5C__trace_write_set_cache_config_log_msg,
- H5C__trace_write_remove_entry_log_msg};
+static const H5C_log_class_t H5C_trace_log_class_g = {"trace",
+ H5C__trace_tear_down_logging,
+ NULL, /* start logging */
+ NULL, /* stop logging */
+ NULL, /* write start message */
+ NULL, /* write stop message */
+ NULL, /* write create cache message */
+ NULL, /* write destroy cache message */
+ NULL, /* write evict cache message */
+ H5C__trace_write_expunge_entry_log_msg,
+ H5C__trace_write_flush_cache_log_msg,
+ H5C__trace_write_insert_entry_log_msg,
+ H5C__trace_write_mark_entry_dirty_log_msg,
+ H5C__trace_write_mark_entry_clean_log_msg,
+ H5C__trace_write_mark_unserialized_entry_log_msg,
+ H5C__trace_write_mark_serialized_entry_log_msg,
+ H5C__trace_write_move_entry_log_msg,
+ H5C__trace_write_pin_entry_log_msg,
+ H5C__trace_write_create_fd_log_msg,
+ H5C__trace_write_protect_entry_log_msg,
+ H5C__trace_write_resize_entry_log_msg,
+ H5C__trace_write_unpin_entry_log_msg,
+ H5C__trace_write_destroy_fd_log_msg,
+ H5C__trace_write_unprotect_entry_log_msg,
+ H5C__trace_write_set_cache_config_log_msg,
+ H5C__trace_write_remove_entry_log_msg};
/*-------------------------------------------------------------------------
* Function: H5C__trace_write_log_message
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index 7a5c630..35d8dd0 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -154,19 +154,12 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned
* Programmer: John Mainzer
* 3/17/10
*
- * Changes: Updated sanity checks to allow for the possibility that
- * the slist is disabled.
- * JRM -- 8/3/20
- *
*-------------------------------------------------------------------------
*/
herr_t
H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr,
int mpi_rank, int mpi_size)
{
- int i;
- int m;
- unsigned n;
unsigned first_entry_to_flush;
unsigned last_entry_to_flush;
unsigned total_entries_to_clear = 0;
@@ -176,15 +169,13 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
unsigned entries_to_clear[H5C_RING_NTYPES];
haddr_t addr;
H5C_cache_entry_t *entry_ptr = NULL;
-
#if H5C_DO_SANITY_CHECKS
haddr_t last_addr;
#endif /* H5C_DO_SANITY_CHECKS */
-
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
char tbl_buf[1024];
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
-
+ unsigned m, n;
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -204,7 +195,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
HDmemset(entries_to_clear, 0, sizeof(entries_to_clear));
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", FUNC, mpi_rank);
+ HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", __func__, mpi_rank);
HDmemset(tbl_buf, 0, sizeof(tbl_buf));
@@ -226,9 +217,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
} /* end if */
n = num_candidates / (unsigned)mpi_size;
- if (num_candidates % (unsigned)mpi_size > INT_MAX)
- HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "m overflow")
- m = (int)(num_candidates % (unsigned)mpi_size);
+ m = num_candidates % (unsigned)mpi_size;
if (NULL ==
(candidate_assignment_table = (unsigned *)H5MM_malloc(sizeof(unsigned) * (size_t)(mpi_size + 1))))
@@ -239,31 +228,31 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
candidate_assignment_table[mpi_size] = num_candidates;
if (m == 0) { /* mpi_size is an even divisor of num_candidates */
- for (i = 1; i < mpi_size; i++)
- candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
+ for (u = 1; u < (unsigned)mpi_size; u++)
+ candidate_assignment_table[u] = candidate_assignment_table[u - 1] + n;
} /* end if */
else {
- for (i = 1; i <= m; i++)
- candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1;
+ for (u = 1; u <= m; u++)
+ candidate_assignment_table[u] = candidate_assignment_table[u - 1] + n + 1;
if (num_candidates < (unsigned)mpi_size) {
- for (i = m + 1; i < mpi_size; i++)
- candidate_assignment_table[i] = num_candidates;
+ for (u = m + 1; u < (unsigned)mpi_size; u++)
+ candidate_assignment_table[u] = num_candidates;
} /* end if */
else {
- for (i = m + 1; i < mpi_size; i++)
- candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
+ for (u = m + 1; u < (unsigned)mpi_size; u++)
+ candidate_assignment_table[u] = candidate_assignment_table[u - 1] + n;
} /* end else */
} /* end else */
HDassert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates);
#if H5C_DO_SANITY_CHECKS
/* Verify that the candidate assignment table has the expected form */
- for (i = 1; i < mpi_size - 1; i++) {
+ for (u = 1; u < (unsigned)(mpi_size - 1); u++) {
unsigned a, b;
- a = candidate_assignment_table[i] - candidate_assignment_table[i - 1];
- b = candidate_assignment_table[i + 1] - candidate_assignment_table[i];
+ a = candidate_assignment_table[u] - candidate_assignment_table[u - 1];
+ b = candidate_assignment_table[u + 1] - candidate_assignment_table[u];
HDassert(n + 1 >= a);
HDassert(a >= b);
@@ -275,18 +264,18 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
last_entry_to_flush = candidate_assignment_table[mpi_rank + 1] - 1;
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- for (i = 0; i < 1024; i++)
- tbl_buf[i] = '\0';
+ for (u = 0; u < 1024; u++)
+ tbl_buf[u] = '\0';
HDsprintf(&(tbl_buf[0]), "candidate assignment table = ");
- for (i = 0; i <= mpi_size; i++)
- HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %u", candidate_assignment_table[i]);
+ for (u = 0; u <= (unsigned)mpi_size; u++)
+ HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %u", candidate_assignment_table[u]);
HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
- HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", FUNC, mpi_rank, first_entry_to_flush,
+ HDfprintf(stdout, "%s:%d: flush entries [%u, %u].\n", __func__, mpi_rank, first_entry_to_flush,
last_entry_to_flush);
- HDfprintf(stdout, "%s:%d: marking entries.\n", FUNC, mpi_rank);
+ HDfprintf(stdout, "%s:%d: marking entries.\n", __func__, mpi_rank);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
for (u = 0; u < num_candidates; u++) {
@@ -354,9 +343,9 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
#if H5C_DO_SANITY_CHECKS
m = 0;
n = 0;
- for (i = 0; i < H5C_RING_NTYPES; i++) {
- m += (int)entries_to_flush[i];
- n += entries_to_clear[i];
+ for (u = 0; u < H5C_RING_NTYPES; u++) {
+ m += entries_to_flush[u];
+ n += entries_to_clear[u];
} /* end if */
HDassert((unsigned)m == total_entries_to_flush);
@@ -364,8 +353,8 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
- HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", FUNC, mpi_rank, num_candidates,
- total_entries_to_clear, total_entries_to_flush);
+ HDfprintf(stdout, "%s:%d: num candidates/to clear/to flush = %u/%u/%u.\n", __func__, mpi_rank,
+ num_candidates, total_entries_to_clear, total_entries_to_flush);
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
/* We have now marked all the entries on the candidate list for
@@ -930,7 +919,9 @@ H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial)
entry_ptr = prev_ptr;
} /* end while */
+#ifdef H5C_DO_SANITY_CHECKS
done:
+#endif /* H5C_DO_SANITY_CHECKS */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_clear_coll_entries */
@@ -957,10 +948,8 @@ H5C__collective_write(H5F_t *f)
int * length_array = NULL;
MPI_Aint * buf_array = NULL;
MPI_Aint * offset_array = NULL;
- MPI_Datatype btype;
- hbool_t btype_created = FALSE;
- MPI_Datatype ftype;
- hbool_t ftype_created = FALSE;
+ MPI_Datatype btype = MPI_BYTE;
+ MPI_Datatype ftype = MPI_BYTE;
int mpi_code;
char unused = 0; /* Unused, except for non-NULL pointer value */
size_t buf_count;
@@ -1032,7 +1021,6 @@ H5C__collective_write(H5F_t *f)
if (MPI_SUCCESS !=
(mpi_code = MPI_Type_create_hindexed(count, length_array, buf_array, MPI_BYTE, &btype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
- btype_created = TRUE;
if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&btype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
@@ -1040,7 +1028,6 @@ H5C__collective_write(H5F_t *f)
if (MPI_SUCCESS !=
(mpi_code = MPI_Type_create_hindexed(count, length_array, offset_array, MPI_BYTE, &ftype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
- ftype_created = TRUE;
if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&ftype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
@@ -1048,10 +1035,6 @@ H5C__collective_write(H5F_t *f)
buf_count = 1;
} /* end if */
else {
- /* Pass trivial buf type, file type to the file driver */
- btype = MPI_BYTE;
- ftype = MPI_BYTE;
-
/* Set non-NULL pointer for I/O operation */
base_buf = &unused;
@@ -1074,9 +1057,9 @@ done:
offset_array = (MPI_Aint *)H5MM_xfree(offset_array);
/* Free MPI Types */
- if (btype_created && MPI_SUCCESS != (mpi_code = MPI_Type_free(&btype)))
+ if (MPI_BYTE != btype && MPI_SUCCESS != (mpi_code = MPI_Type_free(&btype)))
HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
- if (ftype_created && MPI_SUCCESS != (mpi_code = MPI_Type_free(&ftype)))
+ if (MPI_BYTE != ftype && MPI_SUCCESS != (mpi_code = MPI_Type_free(&ftype)))
HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
/* Reset transfer mode in API context, if changed */
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 623e52f..78d6f35 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -115,20 +115,20 @@
#define H5C__CURR_CACHE_IMAGE_CTL_VER 1
/* Default configuration settings */
-#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
-#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
+#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999
+#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9
#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
#define H5C__DEF_AR_INIT_SIZE ((size_t)(1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_SIZE ((size_t)(1 * 1024 * 1024))
-#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
-#define H5C__DEF_AR_INCREMENT 2.0f
+#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5
+#define H5C__DEF_AR_INCREMENT 2.0
#define H5C__DEF_AR_MAX_INCREMENT ((size_t)(2 * 1024 * 1024))
-#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
-#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
-#define H5C__DEF_AR_DECREMENT 0.9f
+#define H5C__DEF_AR_FLASH_MULTIPLE 1.0
+#define H5C__DEV_AR_FLASH_THRESHOLD 0.25
+#define H5C__DEF_AR_DECREMENT 0.9
#define H5C__DEF_AR_MAX_DECREMENT ((size_t)(1 * 1024 * 1024))
#define H5C__DEF_AR_EPCHS_B4_EVICT 3
-#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
+#define H5C__DEF_AR_EMPTY_RESERVE 0.05
#define H5C__MIN_AR_EPOCH_LENGTH 100
#define H5C__DEF_AR_EPOCH_LENGTH 50000
#define H5C__MAX_AR_EPOCH_LENGTH 1000000
@@ -2242,10 +2242,10 @@ herr_t H5C_verify_tag(int id, haddr_t tag);
H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f);
H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr);
H5_DLL herr_t H5C_get_cache_image_config(const H5C_t *cache_ptr, H5C_cache_image_ctl_t *config_ptr);
-H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
+H5_DLL herr_t H5C_get_cache_size(const H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr);
-H5_DLL herr_t H5C_get_cache_flush_in_progress(H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr);
-H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr);
+H5_DLL herr_t H5C_get_cache_flush_in_progress(const H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr);
+H5_DLL herr_t H5C_get_cache_hit_rate(const H5C_t *cache_ptr, double *hit_rate_ptr);
H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in_cache_ptr,
hbool_t *is_dirty_ptr, hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr,
hbool_t *is_corked_ptr, hbool_t *is_flush_dep_parent_ptr,
@@ -2290,7 +2290,7 @@ H5_DLL herr_t H5C_unsettle_ring(H5F_t *f, H5C_ring_t ring);
H5_DLL herr_t H5C_remove_entry(void *thing);
H5_DLL herr_t H5C_cache_image_status(H5F_t *f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr);
H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr);
-H5_DLL herr_t H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len);
+H5_DLL herr_t H5C_get_mdc_image_info(const H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len);
/* Logging functions */
H5_DLL herr_t H5C_start_logging(H5C_t *cache);
@@ -2321,4 +2321,4 @@ H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_c
H5_DLL herr_t H5C_validate_index_list(H5C_t *cache_ptr);
#endif /* NDEBUG */
-#endif /* !_H5Cprivate_H */
+#endif /* H5Cprivate_H */
diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h
index 0e6fb84..79ece10 100644
--- a/src/H5Cpublic.h
+++ b/src/H5Cpublic.h
@@ -31,15 +31,34 @@
extern "C" {
#endif
-enum H5C_cache_incr_mode { H5C_incr__off, H5C_incr__threshold };
+enum H5C_cache_incr_mode {
+ H5C_incr__off,
+ /**<Automatic cache size increase is disabled, and the remaining increment fields are ignored.*/
-enum H5C_cache_flash_incr_mode { H5C_flash_incr__off, H5C_flash_incr__add_space };
+ H5C_incr__threshold
+ /**<Automatic cache size increase is enabled using the hit rate threshold algorithm.*/
+};
+
+enum H5C_cache_flash_incr_mode {
+ H5C_flash_incr__off,
+ /**<Flash cache size increase is disabled.*/
+
+ H5C_flash_incr__add_space
+ /**<Flash cache size increase is enabled using the add space algorithm.*/
+};
enum H5C_cache_decr_mode {
H5C_decr__off,
+ /**<Automatic cache size decrease is disabled.*/
+
H5C_decr__threshold,
+ /**<Automatic cache size decrease is enabled using the hit rate threshold algorithm.*/
+
H5C_decr__age_out,
+ /**<Automatic cache size decrease is enabled using the ageout algorithm. */
+
H5C_decr__age_out_with_threshold
+ /**<Automatic cache size decrease is enabled using the ageout with hit rate threshold algorithm.*/
};
#ifdef __cplusplus
diff --git a/src/H5Cquery.c b/src/H5Cquery.c
index d8e2a72..710ce2a 100644
--- a/src/H5Cquery.c
+++ b/src/H5Cquery.c
@@ -114,8 +114,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr,
- uint32_t *cur_num_entries_ptr)
+H5C_get_cache_size(const H5C_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
+ size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -151,7 +151,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_get_cache_flush_in_progress(H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr)
+H5C_get_cache_flush_in_progress(const H5C_t *cache_ptr, hbool_t *flush_in_progress_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -184,7 +184,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr)
+H5C_get_cache_hit_rate(const H5C_t *cache_ptr, double *hit_rate_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -201,7 +201,7 @@ H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr)
if (cache_ptr->cache_accesses > 0)
*hit_rate_ptr = ((double)(cache_ptr->cache_hits)) / ((double)(cache_ptr->cache_accesses));
else
- *hit_rate_ptr = 0.0f;
+ *hit_rate_ptr = 0.0;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -405,7 +405,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len)
+H5C_get_mdc_image_info(const H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5D.c b/src/H5D.c
index 2f0daaf..7153c7d 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -228,7 +228,7 @@ H5Dcreate_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE11(FUNC, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id, es_id)) < 0) {
+ H5ARG_TRACE11(__func__, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on dataset ID")
@@ -437,7 +437,7 @@ H5Dopen_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, dapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, dapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on dataset ID")
@@ -531,7 +531,7 @@ H5Dclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -557,8 +557,9 @@ H5D__get_space_api_common(hid_t dset_id, void **token_ptr, H5VL_object_t **_vol_
{
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
- (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_STATIC
@@ -566,11 +567,17 @@ H5D__get_space_api_common(hid_t dset_id, void **token_ptr, H5VL_object_t **_vol_
if (NULL == (*vol_obj_ptr = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_SPACE;
+ vol_cb_args.args.get_space.space_id = H5I_INVALID_HID;
+
/* Get the dataspace */
- if (H5VL_dataset_get(*vol_obj_ptr, H5VL_DATASET_GET_SPACE, H5P_DATASET_XFER_DEFAULT, token_ptr,
- &ret_value) < 0)
+ if (H5VL_dataset_get(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get dataspace")
+ /* Set return value */
+ ret_value = vol_cb_args.args.get_space.space_id;
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__get_space_api_common() */
@@ -591,7 +598,7 @@ done:
hid_t
H5Dget_space(hid_t dset_id)
{
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", dset_id);
@@ -640,7 +647,7 @@ H5Dget_space_async(const char *app_file, const char *app_func, unsigned app_line
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0) {
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, H5I_INVALID_HID,
@@ -664,8 +671,9 @@ done:
herr_t
H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation /*out*/)
{
- H5VL_object_t *vol_obj = NULL; /* Dataset structure */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", dset_id, allocation);
@@ -674,9 +682,12 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_SPACE_STATUS;
+ vol_cb_args.args.get_space_status.status = allocation;
+
/* Get dataspace status */
- if ((ret_value = H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_SPACE_STATUS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, allocation)) < 0)
+ if (H5VL_dataset_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get space status")
done:
@@ -699,8 +710,9 @@ done:
hid_t
H5Dget_type(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset structure */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", dset_id);
@@ -709,11 +721,17 @@ H5Dget_type(hid_t dset_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_TYPE;
+ vol_cb_args.args.get_type.type_id = H5I_INVALID_HID;
+
/* Get the datatype */
- if (H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value) < 0)
+ if (H5VL_dataset_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get datatype")
+ /* Set return value */
+ ret_value = vol_cb_args.args.get_type.type_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dget_type() */
@@ -737,8 +755,9 @@ done:
hid_t
H5Dget_create_plist(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset structure */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", dset_id);
@@ -747,11 +766,17 @@ H5Dget_create_plist(hid_t dset_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_DCPL;
+ vol_cb_args.args.get_dcpl.dcpl_id = H5I_INVALID_HID;
+
/* Get the dataset creation property list */
- if (H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_DCPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value) < 0)
+ if (H5VL_dataset_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get dataset creation properties")
+ /* Set return value */
+ ret_value = vol_cb_args.args.get_dcpl.dcpl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dget_create_plist() */
@@ -792,8 +817,9 @@ done:
hid_t
H5Dget_access_plist(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset structure */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", dset_id);
@@ -802,11 +828,17 @@ H5Dget_access_plist(hid_t dset_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_DAPL;
+ vol_cb_args.args.get_dapl.dapl_id = H5I_INVALID_HID;
+
/* Get the dataset access property list */
- if (H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_DAPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value) < 0)
+ if (H5VL_dataset_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get dataset access properties")
+ /* Set return value */
+ ret_value = vol_cb_args.args.get_dapl.dapl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dget_access_plist() */
@@ -829,8 +861,10 @@ done:
hsize_t
H5Dget_storage_size(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- hsize_t ret_value = 0; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hsize_t storage_size = 0; /* Storage size of dataset */
+ hsize_t ret_value = 0; /* Return value */
FUNC_ENTER_API(0)
H5TRACE1("h", "i", dset_id);
@@ -839,11 +873,17 @@ H5Dget_storage_size(hid_t dset_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_STORAGE_SIZE;
+ vol_cb_args.args.get_storage_size.storage_size = &storage_size;
+
/* Get the storage size */
- if (H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_STORAGE_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value) < 0)
+ if (H5VL_dataset_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "unable to get storage size")
+ /* Set return value */
+ ret_value = storage_size;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dget_storage_size() */
@@ -862,8 +902,11 @@ done:
haddr_t
H5Dget_offset(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- haddr_t ret_value = HADDR_UNDEF; /* Return value */
+ H5VL_object_t * vol_obj; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ haddr_t dset_offset = HADDR_UNDEF; /* Dataset's offset */
+ haddr_t ret_value = HADDR_UNDEF; /* Return value */
FUNC_ENTER_API(HADDR_UNDEF)
H5TRACE1("a", "i", dset_id);
@@ -872,11 +915,18 @@ H5Dget_offset(hid_t dset_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_offset.offset = &dset_offset;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_OFFSET;
+ vol_cb_args.args = &dset_opt_args;
+
/* Get the offset */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_OFFSET, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &ret_value) < 0)
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, HADDR_UNDEF, "unable to get offset")
+ /* Set return value */
+ ret_value = dset_offset;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dget_offset() */
@@ -941,7 +991,11 @@ done:
*
* The MEM_SPACE_ID can be the constant H5S_ALL in which case
* the memory dataspace is the same as the file dataspace
- * defined when the dataset was created.
+ * defined when the dataset was created. The MEM_SPACE_ID can
+ * also be the constant H5S_BLOCK, which indicates that the
+ * buffer provided is a single contiguous block of memory, with
+ * the same # of elements as specified in the FILE_SPACE_ID
+ * selection.
*
* The number of elements in the memory dataspace must match
* the number of elements in the file dataspace.
@@ -1011,7 +1065,7 @@ H5Dread_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIuiiiiixi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIuiiiiixi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1032,13 +1086,15 @@ done:
*---------------------------------------------------------------------------
*/
herr_t
-H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters, void *buf)
+H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters, void *buf /*out*/)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "ii*h*Iu*x", dset_id, dxpl_id, offset, filters, buf);
+ H5TRACE5("e", "ii*h*Iux", dset_id, dxpl_id, offset, filters, buf);
/* Check arguments */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
@@ -1056,11 +1112,20 @@ H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fil
else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID")
+ /* Set up VOL callback arguments */
+ dset_opt_args.chunk_read.offset = offset;
+ dset_opt_args.chunk_read.filters = 0;
+ dset_opt_args.chunk_read.buf = buf;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_CHUNK_READ;
+ vol_cb_args.args = &dset_opt_args;
+
/* Read the raw chunk */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_CHUNK_READ, dxpl_id, H5_REQUEST_NULL, offset,
- filters, buf) < 0)
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read unprocessed chunk data")
+ /* Set return value */
+ *filters = dset_opt_args.chunk_read.filters;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dread_chunk() */
@@ -1126,7 +1191,11 @@ done:
*
* The MEM_SPACE_ID can be the constant H5S_ALL in which case
* the memory dataspace is the same as the file dataspace
- * defined when the dataset was created.
+ * defined when the dataset was created. The MEM_SPACE_ID can
+ * also be the constant H5S_BLOCK, which indicates that the
+ * buffer provided is a single contiguous block of memory, with
+ * the same # of elements as specified in the FILE_SPACE_ID
+ * selection.
*
* The number of elements in the memory dataspace must match
* the number of elements in the file dataspace.
@@ -1198,7 +1267,7 @@ H5Dwrite_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIuiiiii*xi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIuiiiii*xi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1222,9 +1291,11 @@ herr_t
H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size,
const void *buf)
{
- H5VL_object_t *vol_obj = NULL;
- uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "iiIu*hz*x", dset_id, dxpl_id, filters, offset, data_size, buf);
@@ -1250,9 +1321,16 @@ H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *of
else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID")
+ /* Set up VOL callback arguments */
+ dset_opt_args.chunk_write.offset = offset;
+ dset_opt_args.chunk_write.filters = filters;
+ dset_opt_args.chunk_write.size = data_size_32;
+ dset_opt_args.chunk_write.buf = buf;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_CHUNK_WRITE;
+ vol_cb_args.args = &dset_opt_args;
+
/* Write chunk */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_CHUNK_WRITE, dxpl_id, H5_REQUEST_NULL, filters,
- offset, data_size_32, buf) < 0)
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write unprocessed chunk data")
done:
@@ -1348,7 +1426,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_
done:
/* Release selection iterator */
if (iter_init && H5S_SELECT_ITER_RELEASE(iter) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator")
+ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release selection iterator")
if (iter)
iter = H5FL_FREE(H5S_sel_iter_t, iter);
@@ -1447,7 +1525,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf
done:
/* Release selection iterator */
if (iter_init && H5S_SELECT_ITER_RELEASE(iter) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator")
+ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release selection iterator")
if (iter)
iter = H5FL_FREE(H5S_sel_iter_t, iter);
@@ -1642,9 +1720,18 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *s
&supported) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check for 'get vlen buf size' operation")
if (supported & H5VL_OPT_QUERY_SUPPORTED) {
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_vlen_buf_size.type_id = type_id;
+ dset_opt_args.get_vlen_buf_size.space_id = space_id;
+ dset_opt_args.get_vlen_buf_size.size = size;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE;
+ vol_cb_args.args = &dset_opt_args;
+
/* Make the 'get_vlen_buf_size' callback */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, type_id, space_id, size) < 0)
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get vlen buf size")
} /* end if */
else {
@@ -1673,7 +1760,8 @@ H5D__set_extent_api_common(hid_t dset_id, const hsize_t size[], void **token_ptr
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_dataset_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1687,9 +1775,12 @@ H5D__set_extent_api_common(hid_t dset_id, const hsize_t size[], void **token_ptr
if (H5CX_set_loc(dset_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_SET_EXTENT;
+ vol_cb_args.args.set_extent.size = size;
+
/* Set the extent */
- if ((ret_value = H5VL_dataset_specific(*vol_obj_ptr, H5VL_DATASET_SET_EXTENT, H5P_DATASET_XFER_DEFAULT,
- token_ptr, size)) < 0)
+ if (H5VL_dataset_specific(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set dataset extent")
done:
@@ -1755,7 +1846,7 @@ H5Dset_extent_async(const char *app_file, const char *app_func, unsigned app_lin
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE6(FUNC, "*s*sIui*hi", app_file, app_func, app_line, dset_id, size, es_id)) < 0)
+ H5ARG_TRACE6(__func__, "*s*sIui*hi", app_file, app_func, app_line, dset_id, size, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1775,8 +1866,9 @@ done:
herr_t
H5Dflush(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", dset_id);
@@ -1789,12 +1881,15 @@ H5Dflush(hid_t dset_id)
if (H5CX_set_loc(dset_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_FLUSH;
+ vol_cb_args.args.flush.dset_id = dset_id;
+
/* Flush dataset information cached in memory
* XXX: Note that we need to pass the ID to the VOL since the H5F_flush_cb_t
* callback needs it and that's in the public API.
*/
- if ((ret_value = H5VL_dataset_specific(vol_obj, H5VL_DATASET_FLUSH, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, dset_id)) < 0)
+ if (H5VL_dataset_specific(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush dataset")
done:
@@ -1802,41 +1897,6 @@ done:
} /* H5Dflush */
/*-------------------------------------------------------------------------
- * Function: H5Dwait
- *
- * Purpose: Wait for all operations on a dataset.
- * Tang: added for async
- *
- * Return: Non-negative on success/Negative on failure
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Dwait(hid_t dset_id)
-{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE1("e", "i", dset_id);
-
- /* Check args */
- if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dset_id parameter is not a valid dataset identifier")
-
- /* Set up collective metadata if appropriate */
- if (H5CX_set_loc(dset_id) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info")
-
- if ((ret_value = H5VL_dataset_specific(vol_obj, H5VL_DATASET_WAIT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, dset_id)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "unable to wait dataset")
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* H5Dwait*/
-
-/*-------------------------------------------------------------------------
* Function: H5Drefresh
*
* Purpose: Refreshes all buffers associated with a dataset.
@@ -1848,8 +1908,9 @@ done:
herr_t
H5Drefresh(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", dset_id);
@@ -1862,9 +1923,12 @@ H5Drefresh(hid_t dset_id)
if (H5CX_set_loc(dset_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_REFRESH;
+ vol_cb_args.args.refresh.dset_id = dset_id;
+
/* Refresh the dataset object */
- if ((ret_value = H5VL_dataset_specific(vol_obj, H5VL_DATASET_REFRESH, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, dset_id)) < 0)
+ if (H5VL_dataset_specific(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to refresh dataset")
done:
@@ -1891,8 +1955,9 @@ done:
herr_t
H5Dformat_convert(hid_t dset_id)
{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", dset_id);
@@ -1905,9 +1970,12 @@ H5Dformat_convert(hid_t dset_id)
if (H5CX_set_loc(dset_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_FORMAT_CONVERT;
+ vol_cb_args.args = NULL;
+
/* Convert the dataset */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_FORMAT_CONVERT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_INTERNAL, FAIL, "can't convert dataset format")
done:
@@ -1929,8 +1997,10 @@ done:
herr_t
H5Dget_chunk_index_type(hid_t dset_id, H5D_chunk_index_t *idx_type /*out*/)
{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", dset_id, idx_type);
@@ -1941,9 +2011,13 @@ H5Dget_chunk_index_type(hid_t dset_id, H5D_chunk_index_t *idx_type /*out*/)
if (NULL == idx_type)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "idx_type parameter cannot be NULL")
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_chunk_idx_type.idx_type = idx_type;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE;
+ vol_cb_args.args = &dset_opt_args;
+
/* Get the chunk indexing type */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, idx_type) < 0)
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk index type")
done:
@@ -1968,8 +2042,10 @@ done:
herr_t
H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_nbytes /*out*/)
{
- H5VL_object_t *vol_obj; /* Dataset for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "i*hx", dset_id, offset, chunk_nbytes);
@@ -1982,9 +2058,14 @@ H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_n
if (NULL == chunk_nbytes)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "chunk_nbytes parameter cannot be NULL")
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_chunk_storage_size.offset = offset;
+ dset_opt_args.get_chunk_storage_size.size = chunk_nbytes;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE;
+ vol_cb_args.args = &dset_opt_args;
+
/* Get the dataset creation property list */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, offset, chunk_nbytes) < 0)
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get storage size of chunk")
done:
@@ -2015,8 +2096,10 @@ done:
herr_t
H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks /*out*/)
{
- H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj = NULL; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "iix", dset_id, fspace_id, nchunks);
@@ -2027,10 +2110,15 @@ H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks /*out*/)
if (NULL == nchunks)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument (null)")
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_num_chunks.space_id = fspace_id;
+ dset_opt_args.get_num_chunks.nchunks = nchunks;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_NUM_CHUNKS;
+ vol_cb_args.args = &dset_opt_args;
+
/* Get the number of written chunks */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_NUM_CHUNKS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, fspace_id, nchunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get number of chunks")
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get number of chunks")
done:
FUNC_LEAVE_API(ret_value);
@@ -2062,9 +2150,11 @@ herr_t
H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *offset /*out*/,
unsigned *filter_mask /*out*/, haddr_t *addr /*out*/, hsize_t *size /*out*/)
{
- H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
- hsize_t nchunks = 0;
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj = NULL; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ hsize_t nchunks = 0; /* Number of chunks */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "iihxxxx", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size);
@@ -2076,19 +2166,33 @@ H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *of
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_num_chunks.space_id = fspace_id;
+ dset_opt_args.get_num_chunks.nchunks = &nchunks;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_NUM_CHUNKS;
+ vol_cb_args.args = &dset_opt_args;
+
/* Get the number of written chunks to check range */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_NUM_CHUNKS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, fspace_id, &nchunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get number of chunks")
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get number of chunks")
/* Check range for chunk index */
if (chk_index >= nchunks)
HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk index is out of range")
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_chunk_info_by_idx.space_id = fspace_id;
+ dset_opt_args.get_chunk_info_by_idx.chk_index = chk_index;
+ dset_opt_args.get_chunk_info_by_idx.offset = offset;
+ dset_opt_args.get_chunk_info_by_idx.filter_mask = filter_mask;
+ dset_opt_args.get_chunk_info_by_idx.addr = addr;
+ dset_opt_args.get_chunk_info_by_idx.size = size;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX;
+ vol_cb_args.args = &dset_opt_args;
+
/* Call private function to get the chunk info given the chunk's index */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, fspace_id, chk_index, offset, filter_mask, addr, size) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get chunk info by index")
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info by index")
done:
FUNC_LEAVE_API(ret_value);
@@ -2119,8 +2223,10 @@ herr_t
H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filter_mask /*out*/,
haddr_t *addr /*out*/, hsize_t *size /*out*/)
{
- H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj = NULL; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*hxxx", dset_id, offset, filter_mask, addr, size);
@@ -2134,11 +2240,99 @@ H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filte
if (NULL == offset)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument (null)")
+ /* Set up VOL callback arguments */
+ dset_opt_args.get_chunk_info_by_coord.offset = offset;
+ dset_opt_args.get_chunk_info_by_coord.filter_mask = filter_mask;
+ dset_opt_args.get_chunk_info_by_coord.addr = addr;
+ dset_opt_args.get_chunk_info_by_coord.size = size;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD;
+ vol_cb_args.args = &dset_opt_args;
+
/* Call private function to get the chunk info given the chunk's index */
- if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, offset, filter_mask, addr, size) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get chunk info by its logical coordinates")
+ if (H5VL_dataset_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info by its logical coordinates")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dget_chunk_info_by_coord() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Dchunk_iter
+ *
+ * Purpose: Iterates over all chunks in dataset with given callback and user data.
+ *
+ * Parameters:
+ * hid_t dset_id; IN: Chunked dataset ID
+ * hid_t dxpl_id; IN: Dataset transfer property list ID
+ * H5D_chunk_iter_op_t cb IN: User callback function, called for every chunk.
+ * void *op_data IN/OUT: Optional user data passed on to user callback.
+ *
+ * Callback information:
+ * H5D_chunk_iter_op_t is defined as:
+ *
+ * typedef int (*H5D_chunk_iter_op_t)(
+ * const hsize_t *offset,
+ * uint32_t filter_mask,
+ * haddr_t addr,
+ * uint32_t nbytes,
+ * void *op_data);
+ *
+ * H5D_chunk_iter_op_t parameters:
+ * hsize_t *offset; IN/OUT: Array of starting logical coordinates of chunk.
+ * uint32_t filter_mask; IN: Filter mask of chunk.
+ * haddr_t addr; IN: Offset in file of chunk data.
+ * uint32_t nbytes; IN: Size in number of bytes of chunk data in file.
+ * void *op_data; IN/OUT: Pointer to any user-defined data
+ * associated with the operation.
+ *
+ * The return values from an operator are:
+ * Zero (H5_ITER_CONT) causes the iterator to continue, returning zero when all
+ * elements have been processed.
+ * Positive (H5_ITER_STOP) causes the iterator to immediately return that positive
+ * value, indicating short-circuit success.
+ * Negative (H5_ITER_ERROR) causes the iterator to immediately return that value,
+ * indicating failure.
+ *
+ * Return: Non-negative on success, negative on failure
+ *
+ * Programmer: Gaute Hope
+ * August 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Dchunk_iter(hid_t dset_id, hid_t dxpl_id, H5D_chunk_iter_op_t op, void *op_data)
+{
+ H5VL_object_t * vol_obj = NULL; /* Dataset for this operation */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_dataset_optional_args_t dset_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE4("e", "iix*x", dset_id, dxpl_id, op, op_data);
+
+ /* Check arguments */
+ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier")
+ if (NULL == op)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid callback to chunk iteration")
+
+ /* Get the default dataset transfer property list if the user didn't provide one */
+ if (H5P_DEFAULT == dxpl_id)
+ dxpl_id = H5P_DATASET_XFER_DEFAULT;
+ else if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID")
+
+ /* Set up VOL callback arguments */
+ dset_opt_args.chunk_iter.op = op;
+ dset_opt_args.chunk_iter.op_data = op_data;
+ vol_cb_args.op_type = H5VL_NATIVE_DATASET_CHUNK_ITER;
+ vol_cb_args.args = &dset_opt_args;
+
+ /* Iterate over the chunks */
+ if ((ret_value = H5VL_dataset_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL)) < 0)
+ HERROR(H5E_BADITER, H5E_BADITER, "error iterating over dataset chunks");
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Dchunk_iter() */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 8de023d..0cc1681 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -109,9 +109,9 @@
/*#define H5D_CHUNK_DEBUG */
/* Flags for the "edge_chunk_state" field below */
-#define H5D_RDCC_DISABLE_FILTERS 0x01u /* Disable filters on this chunk */
+#define H5D_RDCC_DISABLE_FILTERS 0x01U /* Disable filters on this chunk */
#define H5D_RDCC_NEWLY_DISABLED_FILTERS \
- 0x02u /* Filters have been disabled since \
+ 0x02U /* Filters have been disabled since \
* the last flush */
/******************/
@@ -247,6 +247,11 @@ typedef struct H5D_chunk_coll_info_t {
} H5D_chunk_coll_info_t;
#endif /* H5_HAVE_PARALLEL */
+typedef struct H5D_chunk_iter_ud_t {
+ H5D_chunk_iter_op_t op; /* User defined callback */
+ void * op_data; /* User data for user defined callback */
+} H5D_chunk_iter_ud_t;
+
/********************/
/* Local Prototypes */
/********************/
@@ -270,6 +275,7 @@ static herr_t H5D__chunk_dest(H5D_t *dset);
static int H5D__get_num_chunks_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
static int H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
static int H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
+static int H5D__chunk_iter_cb(const H5D_chunk_rec_t *chunk_rec, void *udata);
/* "Nonexistent" layout operation callback */
static ssize_t H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t chunk_max_nseq,
@@ -598,8 +604,6 @@ H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage
HDassert(offset);
HDassert(storage_size);
- *storage_size = 0;
-
/* Allocate dataspace and initialize it if it hasn't been. */
if (!(*layout->ops->is_space_alloc)(&layout->storage))
HGOTO_DONE(SUCCEED)
@@ -713,10 +717,8 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize
} /* end for */
/* Get the "down" sizes for each dimension */
- if (H5VM_array_down(ndims, layout->chunks, layout->down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value")
- if (H5VM_array_down(ndims, layout->max_chunks, layout->max_down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value")
+ H5VM_array_down(ndims, layout->chunks, layout->down_chunks);
+ H5VM_array_down(ndims, layout->max_chunks, layout->max_down_chunks);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -4643,7 +4645,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[])
+H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, const hsize_t old_dim[])
{
const H5D_t * dset = io_info->dset; /* the dataset pointer */
H5D_chk_idx_info_t idx_info; /* Chunked index info */
@@ -5372,7 +5374,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
* order of offset in the file.
*/
if (need_addr_sort)
- HDqsort(chunk_disp_array, blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr);
+ HDqsort(chunk_disp_array, (size_t)blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr);
/* MSC - should use this if MPI_type_create_hindexed block is working:
* mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE,
@@ -6407,6 +6409,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
if (udata->chunk_in_cache) {
HDassert(H5F_addr_defined(chunk_rec->chunk_addr));
+ HDassert(ent);
HDassert(H5F_addr_defined(ent->chunk_block.offset));
H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t);
@@ -7838,3 +7841,146 @@ H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *offset, unsigned
done:
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5D__get_chunk_info_by_coord() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5D__chunk_iter_cb
+ *
+ * Purpose: Call the user-defined function with the chunk data. The iterator continues if
+ * the user-defined function returns H5_ITER_CONT, and stops if H5_ITER_STOP is
+ * returned.
+ *
+ * Return: Success: H5_ITER_CONT or H5_ITER_STOP
+ * Failure: Negative (H5_ITER_ERROR)
+ *
+ * Programmer: Gaute Hope
+ * August 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5D__chunk_iter_cb(const H5D_chunk_rec_t *chunk_rec, void *udata)
+{
+ const H5D_chunk_iter_ud_t *data = (H5D_chunk_iter_ud_t *)udata;
+ int ret_value = H5_ITER_CONT;
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Check for callback failure and pass along return value */
+ if ((ret_value = (data->op)(chunk_rec->scaled, chunk_rec->filter_mask, chunk_rec->chunk_addr,
+ chunk_rec->nbytes, data->op_data)) < 0)
+ HERROR(H5E_DATASET, H5E_CANTNEXT, "iteration operator failed");
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D__chunk_iter_cb */
+
+/*-------------------------------------------------------------------------
+ * Function: H5D__chunk_iter
+ *
+ * Purpose: Iterate over all the chunks in the dataset with given callbak.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Gaute Hope
+ * August 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data)
+{
+ const H5O_layout_t *layout = NULL; /* Dataset layout */
+ const H5D_rdcc_t * rdcc = NULL; /* Raw data chunk cache */
+ H5D_rdcc_ent_t * ent; /* Cache entry index */
+ H5D_chk_idx_info_t idx_info; /* Chunked index info */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
+
+ /* Check args */
+ HDassert(dset);
+ HDassert(dset->shared);
+
+ /* Get dataset layout and raw data chunk cache */
+ layout = &(dset->shared->layout);
+ rdcc = &(dset->shared->cache.chunk);
+ HDassert(layout);
+ HDassert(rdcc);
+ HDassert(H5D_CHUNKED == layout->type);
+
+ /* Search for cached chunks that haven't been written out */
+ for (ent = rdcc->head; ent; ent = ent->next)
+ /* Flush the chunk out to disk, to make certain the size is correct later */
+ if (H5D__chunk_flush_entry(dset, ent, FALSE) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "cannot flush indexed storage buffer")
+
+ /* Compose chunked index info struct */
+ idx_info.f = dset->oloc.file;
+ idx_info.pline = &dset->shared->dcpl_cache.pline;
+ idx_info.layout = &dset->shared->layout.u.chunk;
+ idx_info.storage = &dset->shared->layout.storage.u.chunk;
+
+ /* If the dataset is not written, return without errors */
+ if (H5F_addr_defined(idx_info.storage->idx_addr)) {
+ H5D_chunk_iter_ud_t ud;
+
+ /* Set up info for iteration callback */
+ ud.op = op;
+ ud.op_data = op_data;
+
+ /* Iterate over the allocated chunks calling the iterator callback */
+ if ((ret_value =
+ (dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_iter_cb, &ud)) < 0)
+ HERROR(H5E_DATASET, H5E_CANTNEXT, "chunk iteration failed");
+ } /* end if H5F_addr_defined */
+
+done:
+ FUNC_LEAVE_NOAPI_TAG(ret_value)
+} /* end H5D__chunk_iter() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5D__chunk_get_offset_copy
+ *
+ * Purpose: Copies an offset buffer and performs bounds checks on the
+ * values.
+ *
+ * This helper function ensures that the offset buffer given
+ * by the user is suitable for use with the rest of the library.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5D__chunk_get_offset_copy(const H5D_t *dset, const hsize_t *offset, hsize_t *offset_copy)
+{
+ unsigned u;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ HDassert(dset);
+ HDassert(offset);
+ HDassert(offset_copy);
+
+ /* The library's chunking code requires the offset to terminate with a zero.
+ * So transfer the offset array to an internal offset array that we
+ * can properly terminate (handled via the memset call).
+ */
+ HDmemset(offset_copy, 0, H5O_LAYOUT_NDIMS * sizeof(hsize_t));
+
+ for (u = 0; u < dset->shared->ndims; u++) {
+ /* Make sure the offset doesn't exceed the dataset's dimensions */
+ if (offset[u] > dset->shared->curr_dims[u])
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "offset exceeds dimensions of dataset")
+
+ /* Make sure the offset fall right on a chunk's boundary */
+ if (offset[u] % dset->shared->layout.u.chunk.dim[u])
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "offset doesn't fall on chunks's boundary")
+
+ offset_copy[u] = offset[u];
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D__chunk_get_offset_copy() */
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index 1c66f26..61ecab26 100644
--- a/src/H5Ddeprec.c
+++ b/src/H5Ddeprec.c
@@ -233,13 +233,15 @@ done:
herr_t
H5Dextend(hid_t dset_id, const hsize_t size[])
{
- H5VL_object_t *vol_obj = NULL; /* Dataset structure */
- hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
- H5S_t * ds = NULL; /* Dataspace struct */
- int ndims; /* Dataset/space rank */
- hsize_t dset_dims[H5S_MAX_RANK]; /* Current dataset dimensions */
- int i; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_dataset_get_args_t vol_get_cb_args; /* Arguments to VOL callback */
+ H5VL_dataset_specific_args_t vol_spec_cb_args; /* Arguments to VOL callback */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ H5S_t * ds = NULL; /* Dataspace struct */
+ int ndims; /* Dataset/space rank */
+ hsize_t dset_dims[H5S_MAX_RANK]; /* Current dataset dimensions */
+ int i; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*h", dset_id, size);
@@ -250,10 +252,14 @@ H5Dextend(hid_t dset_id, const hsize_t size[])
if (!size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified")
+ /* Set up VOL callback arguments */
+ vol_get_cb_args.op_type = H5VL_DATASET_GET_SPACE;
+ vol_get_cb_args.args.get_space.space_id = H5I_INVALID_HID;
+
/* Get the dataspace pointer for the dataset */
- if (H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_SPACE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &sid) <
- 0)
+ if (H5VL_dataset_get(vol_obj, &vol_get_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get dataspace")
+ sid = vol_get_cb_args.args.get_space.space_id;
if (H5I_INVALID_HID == sid)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "received an invalid dataspace from the dataset")
if (NULL == (ds = (H5S_t *)H5I_object_verify(sid, H5I_DATASPACE)))
@@ -281,9 +287,12 @@ H5Dextend(hid_t dset_id, const hsize_t size[])
if (H5CX_set_loc(dset_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_spec_cb_args.op_type = H5VL_DATASET_SET_EXTENT;
+ vol_spec_cb_args.args.set_extent.size = dset_dims;
+
/* Increase size */
- if ((ret_value = H5VL_dataset_specific(vol_obj, H5VL_DATASET_SET_EXTENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, dset_dims)) < 0)
+ if (H5VL_dataset_specific(vol_obj, &vol_spec_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to extend dataset")
done:
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index 24e8df2..abce233 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -1160,9 +1160,7 @@ done:
static herr_t
H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(layout);
@@ -1182,8 +1180,7 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
H5VM_swizzle_coords(hsize_t, swizzled_chunks, layout->u.earray.unlim_dim);
/* Get the swizzled "down" sizes for each dimension */
- if (H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value")
+ H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks);
/* Get the swizzled max number of chunks in each dimension */
H5MM_memcpy(swizzled_max_chunks, layout->max_chunks,
@@ -1191,13 +1188,10 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
H5VM_swizzle_coords(hsize_t, swizzled_max_chunks, layout->u.earray.unlim_dim);
/* Get the swizzled max "down" sizes for each dimension */
- if (H5VM_array_down((layout->ndims - 1), swizzled_max_chunks,
- layout->u.earray.swizzled_max_down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value")
- } /* end if */
+ H5VM_array_down((layout->ndims - 1), swizzled_max_chunks, layout->u.earray.swizzled_max_down_chunks);
+ }
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_idx_resize() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 207181a..6d3f4a3 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -2853,13 +2853,14 @@ H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id
{
H5D_vlen_bufsize_generic_t vlen_bufsize = {
NULL, H5I_INVALID_HID, NULL, H5I_INVALID_HID, H5I_INVALID_HID, {NULL, NULL, 0, 0}};
- H5P_genplist_t * dxpl = NULL; /* DXPL for operation */
- H5S_t * mspace = NULL; /* Memory dataspace */
- char bogus; /* Bogus value to pass to H5Diterate() */
- H5S_t * space; /* Dataspace for iteration */
- H5T_t * type; /* Datatype */
- H5S_sel_iter_op_t dset_op; /* Operator for iteration */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5P_genplist_t * dxpl = NULL; /* DXPL for operation */
+ H5S_t * mspace = NULL; /* Memory dataspace */
+ char bogus; /* Bogus value to pass to H5Diterate() */
+ H5S_t * space; /* Dataspace for iteration */
+ H5T_t * type; /* Datatype */
+ H5S_sel_iter_op_t dset_op; /* Operator for iteration */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -2874,10 +2875,14 @@ H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id
/* Save the dataset */
vlen_bufsize.dset_vol_obj = vol_obj;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_SPACE;
+ vol_cb_args.args.get_space.space_id = H5I_INVALID_HID;
+
/* Get a copy of the dataset's dataspace */
- if (H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_SPACE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &vlen_bufsize.fspace_id) < 0)
+ if (H5VL_dataset_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataspace")
+ vlen_bufsize.fspace_id = vol_cb_args.args.get_space.space_id;
if (NULL == (vlen_bufsize.fspace = (H5S_t *)H5I_object(vlen_bufsize.fspace_id)))
HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataspace")
@@ -3943,7 +3948,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__refresh(hid_t dset_id, H5D_t *dset)
+H5D__refresh(H5D_t *dset, hid_t dset_id)
{
H5D_virtual_held_file_t *head = NULL; /* Pointer to list of files held open */
hbool_t virt_dsets_held = FALSE; /* Whether virtual datasets' files are held open */
@@ -3968,7 +3973,7 @@ H5D__refresh(hid_t dset_id, H5D_t *dset)
} /* end if */
/* Refresh dataset object */
- if ((H5O_refresh_metadata(dset_id, dset->oloc)) < 0)
+ if ((H5O_refresh_metadata(&dset->oloc, dset_id)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh dataset")
done:
diff --git a/src/H5Dio.c b/src/H5Dio.c
index c7f8a3e..c245a5c 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -69,55 +69,6 @@ H5FL_BLK_DEFINE(type_conv);
H5FL_DEFINE(H5D_chunk_map_t);
/*-------------------------------------------------------------------------
- * Function: H5D__get_offset_copy
- *
- * Purpose: Copies an offset buffer and performs bounds checks on the
- * values.
- *
- * This helper function ensures that the offset buffer given
- * by the user is suitable for use with the rest of the library.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5D__get_offset_copy(const H5D_t *dset, const hsize_t *offset, hsize_t *offset_copy)
-{
- unsigned u;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert(dset);
- HDassert(offset);
- HDassert(offset_copy);
-
- /* The library's chunking code requires the offset to terminate with a zero.
- * So transfer the offset array to an internal offset array that we
- * can properly terminate (handled via the calloc call).
- */
-
- HDmemset(offset_copy, 0, H5O_LAYOUT_NDIMS * sizeof(hsize_t));
-
- for (u = 0; u < dset->shared->ndims; u++) {
- /* Make sure the offset doesn't exceed the dataset's dimensions */
- if (offset[u] > dset->shared->curr_dims[u])
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset")
-
- /* Make sure the offset fall right on a chunk's boundary */
- if (offset[u] % dset->shared->layout.u.chunk.dim[u])
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary")
-
- offset_copy[u] = offset[u];
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5D__get_offset_copy() */
-
-/*-------------------------------------------------------------------------
* Function: H5D__read
*
* Purpose: Reads (part of) a DATASET into application memory BUF. See
@@ -161,12 +112,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t
/* check args */
HDassert(dataset && dataset->oloc.file);
-
- if (!file_space)
- file_space = dataset->shared->space;
- if (!mem_space)
- mem_space = file_space;
- nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
+ HDassert(file_space);
+ HDassert(mem_space);
/* Set up datatype info for operation */
if (H5D__typeinfo_init(dataset, mem_type_id, FALSE, &type_info) < 0)
@@ -189,11 +136,12 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t
#endif /*H5_HAVE_PARALLEL*/
/* Make certain that the number of elements in each selection is the same */
+ nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
if (nelmts != H5S_GET_SELECT_NPOINTS(file_space))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"src and dest dataspaces have different number of elements selected")
- /* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
+ /* Check for a NULL buffer */
if (NULL == buf) {
/* Check for any elements selected (which is invalid) */
if (nelmts > 0)
@@ -225,7 +173,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t
* Note that in general, this requires us to touch up the memory buffer as
* well.
*/
- if (TRUE == H5S_SELECT_SHAPE_SAME(mem_space, file_space) &&
+ if (nelmts > 0 && TRUE == H5S_SELECT_SHAPE_SAME(mem_space, file_space) &&
H5S_GET_EXTENT_NDIMS(mem_space) != H5S_GET_EXTENT_NDIMS(file_space)) {
const void *adj_buf = NULL; /* Pointer to the location in buf corresponding */
/* to the beginning of the projected mem space. */
@@ -377,6 +325,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_
/* check args */
HDassert(dataset && dataset->oloc.file);
+ HDassert(file_space);
+ HDassert(mem_space);
/* All filters in the DCPL must have encoding enabled. */
if (!dataset->shared->checked_filters) {
@@ -418,20 +368,13 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_
} /* end else */
#endif /*H5_HAVE_PARALLEL*/
- /* Initialize dataspace information */
- if (!file_space)
- file_space = dataset->shared->space;
- if (!mem_space)
- mem_space = file_space;
-
- nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
-
/* Make certain that the number of elements in each selection is the same */
+ nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
if (nelmts != H5S_GET_SELECT_NPOINTS(file_space))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"src and dest dataspaces have different number of elements selected")
- /* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
+ /* Check for a NULL buffer */
if (NULL == buf) {
/* Check for any elements selected (which is invalid) */
if (nelmts > 0)
@@ -463,7 +406,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_
* Note that in general, this requires us to touch up the memory buffer
* as well.
*/
- if (TRUE == H5S_SELECT_SHAPE_SAME(mem_space, file_space) &&
+ if (nelmts > 0 && TRUE == H5S_SELECT_SHAPE_SAME(mem_space, file_space) &&
H5S_GET_EXTENT_NDIMS(mem_space) != H5S_GET_EXTENT_NDIMS(file_space)) {
const void *adj_buf = NULL; /* Pointer to the location in buf corresponding */
/* to the beginning of the projected mem space. */
@@ -876,11 +819,19 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_
} /* end if */
} /* end if */
else {
+ int comm_size = 0;
+
+ /* Retrieve size of MPI communicator used for file */
+ if ((comm_size = H5F_shared_mpi_get_size(io_info->f_sh)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator size")
+
/* Check if there are any filters in the pipeline. If there are,
- * we cannot break to independent I/O if this is a write operation;
- * otherwise there will be metadata inconsistencies in the file.
+ * we cannot break to independent I/O if this is a write operation
+ * with multiple ranks involved; otherwise, there will be metadata
+ * inconsistencies in the file.
*/
- if (io_info->op_type == H5D_IO_OP_WRITE && io_info->dset->shared->dcpl_cache.pline.nused > 0) {
+ if (comm_size > 1 && io_info->op_type == H5D_IO_OP_WRITE &&
+ io_info->dset->shared->dcpl_cache.pline.nused > 0) {
H5D_mpio_no_collective_cause_t cause;
uint32_t local_no_collective_cause;
uint32_t global_no_collective_cause;
@@ -914,28 +865,40 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_
for (cause = 1, idx = 0;
(cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE) && (idx < cause_strings_len);
cause <<= 1, idx++) {
- size_t cause_strlen = HDstrlen(cause_strings[idx]);
-
if (cause & local_no_collective_cause) {
+ size_t local_buffer_space = sizeof(local_no_collective_cause_string) -
+ HDstrlen(local_no_collective_cause_string) - 1;
+
/* Check if there were any previous error messages included. If so, prepend a
* semicolon to separate the messages.
*/
- if (local_error_message_previously_written)
- HDstrncat(local_no_collective_cause_string, "; ", 2);
+ if (local_buffer_space && local_error_message_previously_written) {
+ HDstrncat(local_no_collective_cause_string, "; ", local_buffer_space);
+ local_buffer_space -= MIN(local_buffer_space, 2);
+ }
- HDstrncat(local_no_collective_cause_string, cause_strings[idx], cause_strlen);
+ if (local_buffer_space)
+ HDstrncat(local_no_collective_cause_string, cause_strings[idx],
+ local_buffer_space);
local_error_message_previously_written = TRUE;
} /* end if */
if (cause & global_no_collective_cause) {
+ size_t global_buffer_space = sizeof(global_no_collective_cause_string) -
+ HDstrlen(global_no_collective_cause_string) - 1;
+
/* Check if there were any previous error messages included. If so, prepend a
* semicolon to separate the messages.
*/
- if (global_error_message_previously_written)
- HDstrncat(global_no_collective_cause_string, "; ", 2);
-
- HDstrncat(global_no_collective_cause_string, cause_strings[idx], cause_strlen);
+ if (global_buffer_space && global_error_message_previously_written) {
+ HDstrncat(global_no_collective_cause_string, "; ", global_buffer_space);
+ global_buffer_space -= MIN(global_buffer_space, 2);
+ }
+
+ if (global_buffer_space)
+ HDstrncat(global_no_collective_cause_string, cause_strings[idx],
+ global_buffer_space);
global_error_message_previously_written = TRUE;
} /* end if */
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index 86c0bf6..6c4fc12 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -504,6 +504,7 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id)
H5HL_t * heap; /* Pointer to local heap for EFL file names */
size_t heap_size = H5HL_ALIGN(1);
size_t u;
+ size_t name_offset;
/* Determine size of heap needed to stored the file names */
for (u = 0; u < efl->nused; ++u)
@@ -518,24 +519,22 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect EFL file name heap")
/* Insert "empty" name first */
- if (UFAIL == H5HL_insert(file, heap, (size_t)1, "")) {
+ if (H5HL_insert(file, heap, (size_t)1, "", &name_offset) < 0) {
H5HL_unprotect(heap);
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap")
- } /* end if */
+ }
for (u = 0; u < efl->nused; ++u) {
- size_t offset; /* Offset of file name in heap */
-
/* Insert file name into heap */
- if (UFAIL ==
- (offset = H5HL_insert(file, heap, HDstrlen(efl->slot[u].name) + 1, efl->slot[u].name))) {
+ if (H5HL_insert(file, heap, HDstrlen(efl->slot[u].name) + 1, efl->slot[u].name, &name_offset) <
+ 0) {
H5HL_unprotect(heap);
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap")
- } /* end if */
+ }
/* Store EFL file name offset */
- efl->slot[u].name_offset = offset;
- } /* end for */
+ efl->slot[u].name_offset = name_offset;
+ }
/* Release the heap */
if (H5HL_unprotect(heap) < 0)
diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h
index 292b624..596fd48 100644
--- a/src/H5Dmodule.h
+++ b/src/H5Dmodule.h
@@ -29,15 +29,37 @@
#define H5_MY_PKG_ERR H5E_DATASET
#define H5_MY_PKG_INIT YES
-/**
- * \defgroup H5D H5D
- * \brief Group Interface
- * \details The HDF5 Dataset Interface, H5D, provides a mechanism for managing
- * HDF5 datasets, including the transfer of data between memory and
- * disk and the description of dataset properties.
+/**\defgroup H5D H5D
+ *
+ * Use the functions in this module to manage HDF5 datasets, including the
+ * transfer of data between memory and disk and the description of dataset
+ * properties. Datasets are used by other HDF5 APIs and referenced either by
+ * name or by a handle. Such handles can be obtained by either creating or
+ * opening the dataset.
+ *
+ * Typical stages in the HDF5 dataset life cycle are shown below in introductory
+ * examples.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5D_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5D_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5D_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5D_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
- * A Dataset is used by other HDF5 APIs, either by name or by a handle,
- * which is obtained by either creating or opening the dataset.
*/
#endif /* H5Dmodule_H */
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 5f8a586..448e92d 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -413,7 +413,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, co
* collective I/O
*/
if (MPI_SUCCESS !=
- (mpi_code = MPI_Allreduce(&local_cause, &global_cause, 2, MPI_UNSIGNED, MPI_BOR, io_info->comm)))
+ (mpi_code = MPI_Allreduce(local_cause, global_cause, 2, MPI_UNSIGNED, MPI_BOR, io_info->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code)
} /* end else */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 22712ee..e6b6143 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -565,6 +565,7 @@ H5_DLL herr_t H5D__get_chunk_info(const H5D_t *dset, const H5S_t *space, hsize_
unsigned *filter_mask, haddr_t *offset, hsize_t *size);
H5_DLL herr_t H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *coord, unsigned *filter_mask,
haddr_t *addr, hsize_t *size);
+H5_DLL herr_t H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t cb, void *op_data);
H5_DLL haddr_t H5D__get_offset(const H5D_t *dset);
H5_DLL herr_t H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size);
H5_DLL herr_t H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id,
@@ -574,7 +575,7 @@ H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset);
H5_DLL herr_t H5D__flush_real(H5D_t *dataset);
H5_DLL herr_t H5D__flush(H5D_t *dset, hid_t dset_id);
H5_DLL herr_t H5D__mark(const H5D_t *dataset, unsigned flags);
-H5_DLL herr_t H5D__refresh(hid_t dset_id, H5D_t *dataset);
+H5_DLL herr_t H5D__refresh(H5D_t *dataset, hid_t dset_id);
/* To convert a dataset's chunk indexing type to v1 B-tree */
H5_DLL herr_t H5D__format_convert(H5D_t *dataset);
@@ -631,7 +632,8 @@ H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage);
H5_DLL hbool_t H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset);
H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata);
H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes);
-H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]);
+H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite,
+ const hsize_t old_dim[]);
H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk,
H5F_block_t *new_chunk, hbool_t *need_insert, const hsize_t *scaled);
H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]);
@@ -648,7 +650,7 @@ H5_DLL herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5
H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_t *btree_size);
H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, FILE *stream);
H5_DLL herr_t H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *store);
-H5_DLL herr_t H5D__get_offset_copy(const H5D_t *dset, const hsize_t *offset, hsize_t *offset_copy);
+H5_DLL herr_t H5D__chunk_get_offset_copy(const H5D_t *dset, const hsize_t *offset, hsize_t *offset_copy);
H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset,
uint32_t data_size, const void *buf);
H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, void *buf);
@@ -739,4 +741,4 @@ H5_DLL herr_t H5D__layout_type_test(hid_t did, H5D_layout_t *layout_type);
H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused);
#endif /* H5D_TESTING */
-#endif /*_H5Dpkg_H*/
+#endif /*H5Dpkg_H*/
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index f9ef772..ad9794d 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -79,11 +79,12 @@
#define H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME \
"local_no_collective_cause" /* cause of broken collective I/O in each process */
#define H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME \
- "global_no_collective_cause" /* cause of broken collective I/O in all processes */
-#define H5D_XFER_EDC_NAME "err_detect" /* EDC */
-#define H5D_XFER_FILTER_CB_NAME "filter_cb" /* Filter callback function */
-#define H5D_XFER_CONV_CB_NAME "type_conv_cb" /* Type conversion callback function */
-#define H5D_XFER_XFORM_NAME "data_transform" /* Data transform */
+ "global_no_collective_cause" /* cause of broken collective I/O in all processes */
+#define H5D_XFER_EDC_NAME "err_detect" /* EDC */
+#define H5D_XFER_FILTER_CB_NAME "filter_cb" /* Filter callback function */
+#define H5D_XFER_CONV_CB_NAME "type_conv_cb" /* Type conversion callback function */
+#define H5D_XFER_XFORM_NAME "data_transform" /* Data transform */
+#define H5D_XFER_DSET_IO_SEL_NAME "dset_io_selection" /* Dataset I/O selection */
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
/* Collective chunk instrumentation properties */
#define H5D_XFER_COLL_CHUNK_LINK_HARD_NAME "coll_chunk_link_hard"
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index ce4ce84..c496414 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -28,99 +28,220 @@
/*****************/
/* Macros used to "unset" chunk cache configuration parameters */
-#define H5D_CHUNK_CACHE_NSLOTS_DEFAULT ((size_t)-1)
-#define H5D_CHUNK_CACHE_NBYTES_DEFAULT ((size_t)-1)
-#define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0f)
+#define H5D_CHUNK_CACHE_NSLOTS_DEFAULT SIZE_MAX
+#define H5D_CHUNK_CACHE_NBYTES_DEFAULT SIZE_MAX
+#define H5D_CHUNK_CACHE_W0_DEFAULT (-1.0)
-/* Bit flags for the H5Pset_chunk_opts() and H5Pget_chunk_opts() */
+/**
+ * Bit flags for the H5Pset_chunk_opts() and H5Pget_chunk_opts()
+ */
#define H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS (0x0002u)
/*******************/
/* Public Typedefs */
/*******************/
-/* Values for the H5D_LAYOUT property */
+//! <!-- [H5D_layout_t_snip] -->
+/**
+ * Values for the H5D_LAYOUT property
+ */
typedef enum H5D_layout_t {
- H5D_LAYOUT_ERROR = -1,
-
- H5D_COMPACT = 0, /*raw data is very small */
- H5D_CONTIGUOUS = 1, /*the default */
- H5D_CHUNKED = 2, /*slow and fancy */
- H5D_VIRTUAL = 3, /*actual data is stored in other datasets */
- H5D_NLAYOUTS = 4 /*this one must be last! */
+ H5D_LAYOUT_ERROR = -1, /**< error */
+ H5D_COMPACT = 0, /**< raw data is small (< 64KB) */
+ H5D_CONTIGUOUS = 1, /**< contiguous layout */
+ H5D_CHUNKED = 2, /**< chunked or tiled layout */
+ H5D_VIRTUAL = 3, /**< actual data is stored in other datasets */
+ H5D_NLAYOUTS = 4 /**< this one must be last! */
} H5D_layout_t;
+//! <!-- [H5D_layout_t_snip] -->
-/* Types of chunk index data structures */
+//! <!-- [H5D_chunk_index_t_snip] -->
+/**
+ * Types of chunk index data structures
+ */
typedef enum H5D_chunk_index_t {
- H5D_CHUNK_IDX_BTREE = 0, /* v1 B-tree index (default) */
+ H5D_CHUNK_IDX_BTREE = 0, /**< v1 B-tree index (default) */
H5D_CHUNK_IDX_SINGLE =
- 1, /* Single Chunk index (cur dims[]=max dims[]=chunk dims[]; filtered & non-filtered) */
- H5D_CHUNK_IDX_NONE = 2, /* Implicit: No Index (H5D_ALLOC_TIME_EARLY, non-filtered, fixed dims) */
- H5D_CHUNK_IDX_FARRAY = 3, /* Fixed array (for 0 unlimited dims) */
- H5D_CHUNK_IDX_EARRAY = 4, /* Extensible array (for 1 unlimited dim) */
- H5D_CHUNK_IDX_BT2 = 5, /* v2 B-tree index (for >1 unlimited dims) */
- H5D_CHUNK_IDX_NTYPES /* This one must be last! */
+ 1, /**< Single Chunk index (cur dims[]=max dims[]=chunk dims[]; filtered & non-filtered) */
+ H5D_CHUNK_IDX_NONE = 2, /**< Implicit: No Index (#H5D_ALLOC_TIME_EARLY, non-filtered, fixed dims) */
+ H5D_CHUNK_IDX_FARRAY = 3, /**< Fixed array (for 0 unlimited dims) */
+ H5D_CHUNK_IDX_EARRAY = 4, /**< Extensible array (for 1 unlimited dim) */
+ H5D_CHUNK_IDX_BT2 = 5, /**< v2 B-tree index (for >1 unlimited dims) */
+ H5D_CHUNK_IDX_NTYPES /**< This one must be last! */
} H5D_chunk_index_t;
+//! <!-- [H5D_chunk_index_t_snip] -->
-/* Values for the space allocation time property */
+//! <!-- [H5D_alloc_time_t_snip] -->
+/**
+ * Values for the space allocation time property
+ */
typedef enum H5D_alloc_time_t {
- H5D_ALLOC_TIME_ERROR = -1,
- H5D_ALLOC_TIME_DEFAULT = 0,
- H5D_ALLOC_TIME_EARLY = 1,
- H5D_ALLOC_TIME_LATE = 2,
- H5D_ALLOC_TIME_INCR = 3
+ H5D_ALLOC_TIME_ERROR = -1, /**< Error */
+ H5D_ALLOC_TIME_DEFAULT = 0, /**< \todo Define this! */
+ H5D_ALLOC_TIME_EARLY = 1, /**< Allocate on creation */
+ H5D_ALLOC_TIME_LATE = 2, /**< Allocate on first write */
+ H5D_ALLOC_TIME_INCR = 3 /**< Allocate incrementally (by chunk) */
} H5D_alloc_time_t;
+//! <!-- [H5D_alloc_time_t_snip] -->
-/* Values for the status of space allocation */
+//! <!-- [H5D_space_status_t_snip] -->
+/**
+ * Values for the status of space allocation
+ */
typedef enum H5D_space_status_t {
- H5D_SPACE_STATUS_ERROR = -1,
- H5D_SPACE_STATUS_NOT_ALLOCATED = 0,
- H5D_SPACE_STATUS_PART_ALLOCATED = 1,
- H5D_SPACE_STATUS_ALLOCATED = 2
+ H5D_SPACE_STATUS_ERROR = -1, /**< Error */
+ H5D_SPACE_STATUS_NOT_ALLOCATED = 0, /**< Space has not been allocated for this dataset. */
+ H5D_SPACE_STATUS_PART_ALLOCATED = 1, /**< Space has been allocated for this dataset. */
+ H5D_SPACE_STATUS_ALLOCATED = 2 /**< Space has been partially allocated for this dataset. (Used only for
+ datasets with chunked storage.) */
} H5D_space_status_t;
+//! <!-- [H5D_space_status_t_snip] -->
-/* Values for time of writing fill value property */
+//! <!-- [H5D_fill_time_t_snip] -->
+/**
+ * Values for time of writing fill value property
+ */
typedef enum H5D_fill_time_t {
- H5D_FILL_TIME_ERROR = -1,
- H5D_FILL_TIME_ALLOC = 0,
- H5D_FILL_TIME_NEVER = 1,
- H5D_FILL_TIME_IFSET = 2
+ H5D_FILL_TIME_ERROR = -1, /**< Error */
+ H5D_FILL_TIME_ALLOC = 0, /**< Fill on allocation */
+ H5D_FILL_TIME_NEVER = 1, /**< Never write fill values */
+ H5D_FILL_TIME_IFSET = 2 /**< Fill if fill-value was set */
} H5D_fill_time_t;
+//! <!-- [H5D_fill_time_t_snip] -->
-/* Values for fill value status */
+//! <!-- [H5D_fill_value_t_snip] -->
+/**
+ * Values for fill value status
+ */
typedef enum H5D_fill_value_t {
- H5D_FILL_VALUE_ERROR = -1,
- H5D_FILL_VALUE_UNDEFINED = 0,
- H5D_FILL_VALUE_DEFAULT = 1,
- H5D_FILL_VALUE_USER_DEFINED = 2
+ H5D_FILL_VALUE_ERROR = -1, /**< Error */
+ H5D_FILL_VALUE_UNDEFINED = 0, /**< No fill value defined */
+ H5D_FILL_VALUE_DEFAULT = 1, /**< Default fill-value */
+ H5D_FILL_VALUE_USER_DEFINED = 2 /**< User-defined fill-value */
} H5D_fill_value_t;
+//! <!-- [H5D_fill_value_t_snip] -->
-/* Values for VDS bounds option */
+//! <!-- [H5D_vds_view_t_snip] -->
+/**
+ * Values for VDS bounds option
+ */
typedef enum H5D_vds_view_t {
- H5D_VDS_ERROR = -1,
- H5D_VDS_FIRST_MISSING = 0,
- H5D_VDS_LAST_AVAILABLE = 1
+ H5D_VDS_ERROR = -1, /**< Error */
+ H5D_VDS_FIRST_MISSING = 0, /**< \todo Define this! */
+ H5D_VDS_LAST_AVAILABLE = 1 /**< \todo Define this! */
} H5D_vds_view_t;
+//! <!-- [H5D_vds_view_t_snip] -->
-/* Callback for H5Pset_append_flush() in a dataset access property list */
+//! <!-- [H5D_append_cb_t_snip] -->
+/**
+ * \brief Callback for H5Pset_append_flush()
+ *
+ * \dset_id{dataset_id}
+ * \param[in] cur_dims The current extent of the dataset's dimensions
+ * \param[in,out] op_data User context
+ *
+ * \return \herr_t
+ *
+ */
typedef herr_t (*H5D_append_cb_t)(hid_t dataset_id, hsize_t *cur_dims, void *op_data);
+//! <!-- [H5D_append_cb_t_snip] -->
-/** Define the operator function pointer for H5Diterate() */
-//! [H5D_operator_t_snip]
+//! <!-- [H5D_operator_t_snip] -->
+/**
+ * \brief Callback for H5Diterate()
+ *
+ * \param[in,out] elem Pointer to the memory buffer containing the current dataset
+ * element
+ * \param[in] type_id Datatype identifier of the elements stored in \p elem
+ * \param[in] ndim Number of dimensions for the \p point array
+ * \param[in] point Array containing the location of the element within
+ * the original dataspace
+ * \param[in,out] operator_data Pointer to any user-defined data associated with
+ * the operation
+ * \return \herr_t_iter
+ *
+ */
typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point,
void *operator_data);
-//! [H5D_operator_t_snip]
+//! <!-- [H5D_operator_t_snip] -->
-/** Define the operator function pointer for H5Dscatter() */
-//! [H5D_scatter_func_t_snip]
+//! <!-- [H5D_scatter_func_t_snip] -->
+/**
+ * \brief Callback for H5Dscatter()
+ *
+ * \param[out] src_buf Pointer to the buffer holding the next set of elements to
+ * scatter. On entry, the value of where \p src_buf points to
+ * is undefined. The callback function should set \p src_buf
+ * to point to the next set of elements.
+ * \param[out] src_buf_bytes_used Pointer to the number of valid bytes in \p src_buf.
+ * On entry, the value where \p src_buf_bytes_used points
+ * to is undefined. The callback function should set
+ * \p src_buf_bytes_used to the of valid bytes in \p src_buf.
+ * This number must be a multiple of the datatype size.
+ * \param[in,out] op_data User-defined pointer to data required by the callback
+ * function. A pass-through of the \p op_data pointer provided
+ * with the H5Dscatter() function call.
+ * \return herr_t
+ *
+ * \details The callback function should always return at least one
+ * element in \p src_buf, and must not return more elements
+ * than are remaining to be scattered. This function will be
+ * repeatedly called until all elements to be scattered have
+ * been returned. The callback function should return zero (0)
+ * to indicate success, and a negative value to indicate failure.
+ *
+ */
typedef herr_t (*H5D_scatter_func_t)(const void **src_buf /*out*/, size_t *src_buf_bytes_used /*out*/,
void *op_data);
-//! [H5D_scatter_func_t_snip]
+//! <!-- [H5D_scatter_func_t_snip] -->
-/** Define the operator function pointer for H5Dgather() */
-//! [H5D_gather_func_t_snip]
+//! <!-- [H5D_gather_func_t_snip] -->
+/**
+ * \brief Callback for H5Dgather()
+ *
+ * \param[in] dst_buf Pointer to the destination buffer which has been filled
+ * with the next set of elements gathered. This will always
+ * be identical to the \p dst_buf passed to H5Dgather()
+ * \param[in] dst_buf_bytes_used Pointer to the number of valid bytes in
+ * \p dst_buf. This number must be a multiple of
+ * the datatype size.
+ * \param[in,out] op_data User-defined pointer to data required by the callback
+ * function; a pass-through of the \p op_data pointer
+ * provided with the H5Dgather() function call.
+ * \returns \herr_t
+ *
+ * \details The callback function should process, store, or otherwise make use
+ * of the data returned in dst_buf before it returns, because the
+ * buffer will be overwritten unless it is the last call to the
+ * callback. This function will be repeatedly called until all gathered
+ * elements have been passed to the callback in dst_buf. The callback
+ * function should return zero (0) to indicate success, and a negative
+ * value to indicate failure.
+ *
+ */
typedef herr_t (*H5D_gather_func_t)(const void *dst_buf, size_t dst_buf_bytes_used, void *op_data);
-//! [H5D_gather_func_t_snip]
+//! <!-- [H5D_gather_func_t_snip] -->
+
+//! <!-- [H5D_chunk_iter_op_t_snip] -->
+/**
+ * \brief Callback for H5Dchunk_iter()
+ *
+ * \param[in] offset Array of starting logical coordinates of chunk.
+ * \param[in] filter_mask Filter mask of chunk.
+ * \param[in] addr Offset in file of chunk data.
+ * \param[in] nbytes Size in bytes of chunk data in file.
+ * \param[in,out] op_data Pointer to any user-defined data associated with
+ * the operation.
+ * \returns \li Zero (#H5_ITER_CONT) causes the iterator to continue, returning
+ * zero when all elements have been processed.
+ * \li A positive value (#H5_ITER_STOP) causes the iterator to
+ * immediately return that value, indicating short-circuit success.
+ * \li A negative (#H5_ITER_ERROR) causes the iterator to immediately
+ * return that value, indicating failure.
+ */
+typedef int (*H5D_chunk_iter_op_t)(const hsize_t *offset, uint32_t filter_mask, haddr_t addr, uint32_t nbytes,
+ void *op_data);
+//! <!-- [H5D_chunk_iter_op_t_snip] -->
/********************/
/* Public Variables */
@@ -140,7 +261,7 @@ extern "C" {
* \brief Creates a new dataset and links it into the file
*
* \fgdta_loc_id
- * \param[in] name Name of the dataset to create
+ * \param[in] name Name of the dataset to create
* \type_id
* \space_id
* \lcpl_id
@@ -165,13 +286,6 @@ extern "C" {
* \p name may be either an absolute path in the file or a relative
* path from \p loc_id naming the dataset.
*
- * \p dtype_id specifies the datatype of each data element as stored
- * in the file. If \p dtype_id is either a fixed-length or
- * variable-length string, it is important to set the string length
- * when defining the datatype. String datatypes are derived from
- * #H5T_C_S1 (or #H5T_FORTRAN_S1 for Fortran codes), which defaults
- * to 1 character in size.
- *
* If \p dtype_id is a committed datatype, and if the file location
* associated with the committed datatype is different from the
* file location where the dataset will be created, the datatype
@@ -179,7 +293,7 @@ extern "C" {
*
* The link creation property list, \p lcpl_id, governs creation
* of the link(s) by which the new dataset is accessed and the
- * creation of any * intermediate groups that may be missing.
+ * creation of any intermediate groups that may be missing.
*
* The datatype and dataspace properties and the dataset creation
* and access property lists are attached to the dataset, so the
@@ -190,8 +304,8 @@ extern "C" {
* not previously written, the HDF5 library will return default
* or user-defined fill values.
*
- * To conserve and release resources, the dataset should be closed
- * when access is no longer required.
+ * \par Example
+ * \snippet H5D_examples.c create
*
* \since 1.8.0
*
@@ -203,26 +317,8 @@ H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t spa
/**
* --------------------------------------------------------------------------
- * \ingroup H5D
- *
- * \brief Asynchronous version of H5Dcreate2()
- *
- * \app_file
- * \app_func
- * \app_line
- * \fgdta_loc_id
- * \param[in] name Name of the dataset to create
- * \type_id
- * \space_id
- * \lcpl_id
- * \dcpl_id
- * \dapl_id
- * \es_id
- *
- * \return \hid_t{dataset}
- *
- * \see H5Dcreate2()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Dcreate}
*/
H5_DLL hid_t H5Dcreate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id,
@@ -257,34 +353,14 @@ H5_DLL hid_t H5Dcreate_async(const char *app_file, const char *app_func, unsigne
* the file, which may differ from the datatype and dataspace
* in application memory.
*
- * Dataset creation property list and dataset access creation
- * property list are specified by \p dcpl_id and \p dapl_id.
- *
* H5Dcreate_anon() returns a new dataset identifier. Using
* this identifier, the new dataset must be linked into the
* HDF5 file structure with H5Olink() or it will be deleted
- * from the file when the file is closed.
- *
- * See H5Dcreate2() for further details and considerations on
- * the use of H5Dcreate2() and H5Dcreate_anon().
- *
- * The differences between this function and H5Dcreate2() are
- * as follows:
- * \li H5Dcreate_anon() explicitly includes a dataset access property
- * list. H5Dcreate() always uses default dataset access properties.
- *
- * \li H5Dcreate_anon() neither provides the new dataset’s name nor
- * links it into the HDF5 file structure; those actions must be
- * performed separately through a call to H5Olink(), which offers
- * greater control over linking.
- *
- * A dataset created with this function should be closed with
- * H5Dclose() when the dataset is no longer needed so that resource
- * leaks will not develop.
+ * when the file is closed.
*
* \since 1.8.0
*
- * \see H5Olink(), H5Dcreate(), Using Identifiers
+ * \see H5Olink(), H5Dcreate()
*
*/
H5_DLL hid_t H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id);
@@ -310,12 +386,6 @@ H5_DLL hid_t H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t d
* specified then the dataset will be opened at the location
* where the attribute, dataset, or named datatype is attached.
*
- * The dataset access property list, \p dapl_id, provides
- * information regarding access to the dataset.
- *
- * To conserve and release resources, the dataset should be closed
- * when access is no longer required.
- *
* \since 1.8.0
*
* \see H5Dcreate2(), H5Dclose()
@@ -325,22 +395,8 @@ H5_DLL hid_t H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id);
/**
* --------------------------------------------------------------------------
- * \ingroup H5D
- *
- * \brief Asynchronous version of H5Dopen2()
- *
- * \app_file
- * \app_func
- * \app_line
- * \fgdta_loc_id
- * \param[in] name Name of the dataset to open
- * \dapl_id
- * \es_id
- *
- * \return \hid_t{dataset}
- *
- * \see H5Dopen2()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Dopen}
*/
H5_DLL hid_t H5Dopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t dapl_id, hid_t es_id);
@@ -363,6 +419,9 @@ H5_DLL hid_t H5Dopen_async(const char *app_file, const char *app_func, unsigned
* be released with H5Sclose() when the identifier is no longer
* needed so that resource leaks will not occur.
*
+ * \par Example
+ * \snippet H5D_examples.c update
+ *
* \see H5Sclose()
*
*/
@@ -370,24 +429,29 @@ H5_DLL hid_t H5Dget_space(hid_t dset_id);
/**
* --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Dget_space}
+ */
+H5_DLL hid_t H5Dget_space_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
+ hid_t es_id);
+
+/**
+ * --------------------------------------------------------------------------
* \ingroup H5D
*
- * \brief Asynchronous version of H5Dget_space()
+ * \brief Determines whether space has been allocated for a dataset
*
- * \app_file
- * \app_func
- * \app_line
* \dset_id
- * \es_id
+ * \param[out] allocation Space allocation status
*
- * \return \hid_t{dataspace}
+ * \return \herr_t
*
- * \see H5Dget_space()
+ * \details H5Dget_space_status() determines whether space has been allocated
+ * for the dataset \p dset_id.
+ *
+ * \since 1.6.0
*
*/
-H5_DLL hid_t H5Dget_space_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
- hid_t es_id);
-
H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation);
/**
@@ -405,27 +469,7 @@ H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation)
*
* If a dataset has a named datatype, then an identifier to the
* opened datatype is returned. Otherwise, the returned datatype
- * is read-only. If atomization of the datatype fails, then the
- * datatype is closed.
- *
- * A datatype identifier returned from this function should be
- * released with H5Tclose() when the identifier is no longer
- * needed to prevent resource leaks.
- *
- * \note Datatype Identifiers
- *
- * Please note that the datatype identifier is actually an object
- * identifier or a handle returned from opening the datatype. It
- * is not persistent and its value can be different from one HDF5
- * session to the next.
- *
- * H5Tequal() can be used to compare datatypes.
- *
- * HDF5 High Level APIs that may also be of interest are:
- *
- * H5LTdtype_to_text() creates a text description of a
- * datatype. H5LTtext_to_dtype() creates an HDF5 datatype
- * given a text description.
+ * is read-only.
*
*/
H5_DLL hid_t H5Dget_type(hid_t dset_id);
@@ -445,9 +489,6 @@ H5_DLL hid_t H5Dget_type(hid_t dset_id);
* a copy of the dataset creation property list associated with
* the dataset specified by \p dset_id.
*
- * The creation property list identifier should be released
- * with H5Pclose() to prevent resource leaks.
- *
*/
H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
@@ -481,10 +522,6 @@ H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
* All link access properties in the returned list will be set
* to the default values.
*
- * The access property list identifier should be released with
- * H5Pclose() when the identifier is no longer needed so that
- * resource leaks will not develop.
- *
* \since 1.8.3
*
*/
@@ -503,11 +540,8 @@ H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
* \details H5Dget_storage_size() returns the amount of storage,
* in bytes, that is allocated in the file for the raw data of
* the dataset specified by \p dset_id.
- *
- * \note The amount of storage in this case is the storage
- * allocated in the written file, which will typically differ
- * from the space required to hold a dataset in working memory.
- *
+ * H5Dget_storage_size() reports only the space required to store
+ * the dataset elements, excluding any metadata.
* \li For contiguous datasets, the returned size equals the current
* allocated size of the raw data.
* \li For unfiltered chunked datasets, the returned size is the
@@ -517,21 +551,19 @@ H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
* compression filter is in use, H5Dget_storage_size() will return
* the total space required to store the compressed chunks.
*
- * H5Dget_storage_size() reports only the space required to store
- * the data, not including that of any metadata.
+ * \note Note that H5Dget_storage_size() is not generally an
+ * appropriate function to use when determining the amount
+ * of memory required to work with a dataset. In such
+ * circumstances, you must determine the number of data
+ * points in a dataset and the size of an individual dataset
+ * element. H5Sget_simple_extent_npoints() and H5Tget_size()
+ * can be used to calculate that amount.
*
- * \attention H5Dget_storage_size() does not differentiate between 0 (zero),
+ * \warning H5Dget_storage_size() does not differentiate between 0 (zero),
* the value returned for the storage size of a dataset
* with no stored values, and 0 (zero), the value returned to
* indicate an error.
*
- * \note Note that H5Dget_storage_size() is not generally an
- * appropriate function to use when determining the amount
- * of memory required to work with a dataset. In such
- * circumstances, you must determine the number of data
- * points in a dataset and the size of an individual data
- * element. H5Sget_simple_extent_npoints() and H5Tget_size()
- * can be used to get that information.
*
*/
H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id);
@@ -588,7 +620,7 @@ H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hs
* effect. Also, the implementation does not handle the #H5S_ALL
* macro correctly. As a workaround, application can get
* the dataspace for the dataset using H5Dget_space() and pass that
- * in for \p fspace_id. This will be fixed in coming releases.
+ * in for \p fspace_id. This will be fixed in a future release.
*
* \since 1.10.5
*
@@ -614,7 +646,7 @@ H5_DLL herr_t H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks
* using the coordinates specified by \p offset.
*
* If the queried chunk does not exist in the file, \p size will
- * be set to 0, \p addr to #HADDR_UNDEF, and the buffer \p
+ * be set to 0, \p addr to \c HADDR_UNDEF, and the buffer \p
* filter_mask will not be modified.
*
* \p offset is a pointer to a one-dimensional array with a size
@@ -631,6 +663,35 @@ H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, u
* --------------------------------------------------------------------------
* \ingroup H5D
*
+ * \brief Iterate over all chunks of a chunked dataset
+ *
+ * \dset_id
+ * \param[in] dxpl_id Identifier of a transfer property list
+ * \param[in] cb User callback function, called for every chunk.
+ * \param[in] op_data User-defined pointer to data required by op
+ *
+ * \return \herr_t
+ *
+ * \details H5Dget_chunk_iter iterates over all chunks in the dataset, calling the
+ * user supplied callback with the details of the chunk and the supplied
+ * context \p op_data.
+ *
+ * \par Example
+ * For each chunk, print the allocated chunk size (0 for un-allocated chunks).
+ * \snippet H5D_examples.c H5Dchunk_iter_cb
+ * Iterate over all chunked datasets and chunks in a file.
+ * \snippet H5D_examples.c H5Ovisit_cb
+ *
+ * \version 1.?.?
+ * \todo When was this function introduced?
+ *
+ */
+H5_DLL herr_t H5Dchunk_iter(hid_t dset_id, hid_t dxpl_id, H5D_chunk_iter_op_t cb, void *op_data);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
* \brief Retrieves information about a chunk specified by its index
*
* \dset_id
@@ -643,16 +704,16 @@ H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, u
*
* \return \herr_t
*
- * \details H5Dget_chunk_info() retrieves the offset coordinates
- * offset, filter mask filter_mask, size size and address addr for
- * the dataset specified by the identifier dset_id and the chunk
- * specified by the index index. The chunk belongs to a set of
- * chunks in the selection specified by fspace_id. If the queried
+ * \details H5Dget_chunk_info() retrieves the offset coordinates,
+ * \p offset, filter mask, \p filter_mask, size, \p size, and address
+ * \p addr for the dataset specified by the identifier \p dset_id and the chunk
+ * specified by the index \p index. The chunk belongs to a set of
+ * chunks in the selection specified by \p fspace_id. If the queried
* chunk does not exist in the file, the size will be set to 0 and
* address to #HADDR_UNDEF. The value pointed to by filter_mask will
- * not be modified. NULL can be passed in for any \p out parameters.
+ * not be modified. \c NULL can be passed in for any \p out parameters.
*
- * \p chk_idx is the chunk index in the selection. Index value
+ * \p chk_idx is the chunk index in the selection. The index value
* may have a value of 0 up to the number of chunks stored in
* the file that have a nonempty intersection with the file
* dataspace selection
@@ -666,9 +727,9 @@ H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, u
* \note Please be aware that this function currently does not
* support non-trivial selections, thus \p fspace_id has no
* effect. Also, the implementation does not handle the #H5S_ALL
- * macro correctly. As a workaround, application can get
+ * macro correctly. As a workaround, an application can get
* the dataspace for the dataset using H5Dget_space() and pass that
- * in for \p fspace_id. This will be fixed in coming releases.
+ * in for \p fspace_id. This will be fixed in a future release.
*
* \since 1.10.5
*
@@ -733,9 +794,8 @@ H5_DLL haddr_t H5Dget_offset(hid_t dset_id);
* used for the memory dataspace and the selection defined with \p
* file_space_id is used for the selection within that dataspace.
*
- * If raw data storage space has not been allocated for the dataset
- * and a fill value has been defined, the returned buffer \p buf
- * is filled with the fill value.
+ * The number of elements selected in the memory dataspace \Emph{must}
+ * be equal to the number of elements selected in the file dataspace.
*
* The behavior of the library for the various combinations of
* valid dataspace identifiers and #H5S_ALL for the \p mem_space_id
@@ -780,14 +840,12 @@ H5_DLL haddr_t H5Dget_offset(hid_t dset_id);
* </tr>
* </table>
*
- * \details Setting an #H5S_ALL selection indicates that the entire
- * dataspace, as defined by the current dimensions of a dataspace,
- * will be selected. The number of elements selected in the memory
- * dataspace must match the number of elements selected in the
- * file dataspace.
+ * \note If no storage space was allocated for the dataset
+ * and a fill value is defined, the returned buffer \p buf
+ * is filled with the fill value.
*
- * \p dxpl_id can be the constant #H5P_DEFAULT, in which case the
- * default data transfer properties are used.
+ * \par Example
+ * \snippet H5D_examples.c read
*
*/
H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
@@ -795,25 +853,8 @@ H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_
/**
* --------------------------------------------------------------------------
- * \ingroup H5D
- *
- * \brief Asynchronous version of H5Dread()
- *
- * \app_file
- * \app_func
- * \app_line
- * \dset_id Identifier of the dataset to read from
- * \param[in] mem_type_id Identifier of the memory datatype
- * \param[in] mem_space_id Identifier of the memory dataspace
- * \param[in] file_space_id Identifier of the dataset's dataspace in the file
- * \param[in] dxpl_id Identifier of a transfer property list
- * \param[out] buf Buffer to receive data read from file
- * \es_id
- *
- * \return \herr_t
- *
- * \see H5Dread()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Dread}
*/
H5_DLL herr_t H5Dread_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id,
@@ -917,6 +958,8 @@ H5_DLL herr_t H5Dread_async(const char *app_file, const char *app_func, unsigned
* time if the dataset's fill time is set to #H5D_FILL_TIME_IFSET
* or #H5D_FILL_TIME_ALLOC.
*
+ * \par_compr_note
+ *
* \attention If a dataset's storage layout is 'compact', care must be
* taken when writing data to the dataset in parallel. A compact
* dataset's raw data is cached in memory and may be flushed
@@ -924,6 +967,9 @@ H5_DLL herr_t H5Dread_async(const char *app_file, const char *app_func, unsigned
* applications should always attempt to write identical data to
* the dataset from all processes.
*
+ * \par Example
+ * \snippet H5D_examples.c update
+ *
* \see H5Pset_fill_time(), H5Pset_alloc_time()
*
*/
@@ -932,25 +978,8 @@ H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid
/**
* --------------------------------------------------------------------------
- * \ingroup H5D
- *
- * \brief Asynchronous version of H5Dwrite()
- *
- * \app_file
- * \app_func
- * \app_line
- * \param[in] dset_id Identifier of the dataset to read from
- * \param[in] mem_type_id Identifier of the memory datatype
- * \param[in] mem_space_id Identifier of the memory dataspace
- * \param[in] file_space_id Identifier of the dataset's dataspace in the file
- * \dxpl_id
- * \param[out] buf Buffer with data to be written to the file
- * \es_id
- *
- * \return \herr_t
- *
- * \see H5Dwrite()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Dwrite}
*/
H5_DLL herr_t H5Dwrite_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id,
@@ -981,11 +1010,6 @@ H5_DLL herr_t H5Dwrite_async(const char *app_file, const char *app_func, unsigne
* pipeline, including filters, and will be written directly to
* the file. Only one chunk can be written with this function.
*
- * H5Dwrite_chunk() replaces the now deprecated H5DOwrite_chunk()
- * function, which was located in the high level optimization
- * library. The parameters and behavior are identical to the
- * original.
- *
* \p filters is a mask providing a record of which filters are
* used with the the chunk. The default value of the mask is
* zero (0), indicating that all enabled filters are applied. A
@@ -1013,11 +1037,10 @@ H5_DLL herr_t H5Dwrite_async(const char *app_file, const char *app_func, unsigne
* in a file. H5Dwrite_chunk() bypasses hyperslab selection, the
* conversion of data from one datatype to another, and the filter
* pipeline to write the chunk. Developers should have experience
- * with these processes before using this function. Please see
- * Using the Direct Chunk Write Function for more information.
+ * with these processes before using this function.
*
- * \note H5Dread_chunk() and H5Dwrite_chunk() are not supported under
- * parallel and do not support variable length types.
+ * \note H5Dread_chunk() and H5Dwrite_chunk() are currently not supported
+ * with parallel HDF5 and do not support variable-length types.
*
* \since 1.10.2
*
@@ -1055,10 +1078,10 @@ H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, con
* the dimension limits and must specify a point that falls on
* a dataset chunk boundary.
*
- * The mask \p filters indicates which filters are used with the
- * chunk when written. A zero value indicates that all enabled
- * filters are applied on the chunk. A filter is skipped if the
- * bit corresponding to the filter’s position in the pipeline
+ * The mask \p filters indicates which filters were used when the
+ * chunk was written. A zero value (all bits 0) indicates that all
+ * enabled filters are applied on the chunk. A filter is skipped if
+ * the bit corresponding to the filter’s position in the pipeline
* (0 ≤ position < 32) is turned on.
*
* \p buf is the memory buffer containing the chunk read from
@@ -1072,8 +1095,8 @@ H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, con
* with these processes before using this function. Please see
* Using the Direct Chunk Write Function for more information.
*
- * \note H5Dread_chunk() and H5Dwrite_chunk() are not supported under
- * parallel and do not support variable length types.
+ * \note H5Dread_chunk() and H5Dwrite_chunk() are currently not supported
+ * with parallel HDF5 and do not support variable-length datatypes.
*
* \since 1.10.2
*
@@ -1103,52 +1126,9 @@ H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset,
* in the memory buffer \p buf, executing the callback function
* \p op once for each such data element.
*
- * The prototype of the callback function \p op is as follows
- * (as defined in the source code file H5Lpublic.h):
- * \snippet this H5D_operator_t_snip
- * The parameters of this callback function are:
- *
- * <table>
- * <tr><td>\c elem</td>
- * <td><tt>[in,out]</tt></td>
- * <td>Pointer to the memory buffer containing the current
- * data element</td></tr>
- * <tr><td>\c type_id</td>
- * <td><tt>[in]</tt></td>
- * <td>Datatype identifier of the elements stored in elem</td></tr>
- * <tr><td>\c ndim</td>
- * <td><tt>[in]</tt></td>
- * <td>Number of dimensions for the point array</td></tr>
- * <tr><td>\c point</td>
- * <td><tt>[in]</tt></td>
- * <td>Array containing the location of the element within
- * the original dataspace</td></tr>
- * <tr><td>\c operator_data</td>
- * <td><tt>[in,out]</tt></td>
- * <td>Pointer to any user-defined data associated with the
- * operation</td></tr>
- * </table>
- *
- * The possible return values from the callback function, and
- * the effect ofeach,are as follows:
- *
- * \li Zero causes the iterator to continue, returning zero
- * when all data elements have been processed.
- * \li A positive value causes the iterator to immediately
- * return that positive value, indicating short-circuit success.
- * \li A negative value causes the iterator to immediately return
- * that value, indicating failure.
- *
- * The \p operator_data parameter is a user-defined pointer to
- * the data required to process dataset elements in the course
- * of the iteration. If operator needs to pass data back to the
- * application, such data can be returned in this same buffer. This
- * pointer is passed back to each step of the iteration in the
- * operator callback function’s operator_data parameter.
- *
- * Unlike other HDF5 iterators, this iteration operation cannot
- * be restarted at the point of exit; a second H5Diterate()
- * call will always restart at the beginning.
+ * \attention Unlike other HDF5 iterators, this iteration operation cannot
+ * be restarted at the point of exit; a second H5Diterate()
+ * call will always restart at the beginning.
*
*
* \since 1.10.2
@@ -1198,30 +1178,25 @@ H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dset_id, hid_t type_id, hid_t space_id,
*
* \return \herr_t
*
- * \details H5Dfill() fills the dataspace selection in memory, \p space_id,
+ * \details H5Dfill() fills the dataspace selection, \p space_id, in memory
* with the fill value specified in \p fill. If \p fill is NULL,
* a fill value of 0 (zero) is used.
*
* \p fill_type_id specifies the datatype of the fill value.
- * \p buf specifies the buffer in which the dataspace elements
- * will be written.
- * \p buf_type_id specifies the datatype of those data elements.
+ * \p buf specifies the buffer in which the fill elements
+ * will be written. \p buf_type_id specifies the datatype of
+ * those data elements.
*
* \note Note that if the fill value datatype differs from the memory
- * buffer datatype, the fill value will be converted to the memory
- * buffer datatype before filling the selection.
+ * buffer datatype, the fill value will be converted to the memory
+ * buffer datatype before filling the selection.
*
* \note Applications sometimes write data only to portions of an
- * allocated dataset. It is often useful in such cases to fill
- * the unused space with a known fill value. See the following
- * function for more information:
- * - H5Pset_fill_value()
- * - H5Pget_fill_value()
- * - H5Pfill_value_defined()
- * - H5Pset_fill_time()
- * - H5Pget_fill_time()
- * - H5Pcreate()
- * - H5Pcreate_anon()
+ * allocated dataset. It is often useful in such cases to fill
+ * the unused space with a known fill value.
+ *
+ * \see H5Pset_fill_value(), H5Pget_fill_value(), H5Pfill_value_defined(),
+ * H5Pset_fill_time(), H5Pget_fill_time(), H5Pcreate(), H5Dcreate_anon()
*
*/
H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_t space_id);
@@ -1268,22 +1243,21 @@ H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf
* - If the dataset’s fill time is set to #H5D_FILL_TIME_ALLOC
* (see H5Pset_alloc_time())
*
- * \note
- * \li If the sizes specified in \p size array are smaller than
- * the dataset’s current dimension sizes, H5Dset_extent() will reduce
- * the dataset’s dimension sizes to the specified values. It is the
- * user application’s responsibility to ensure that valuable data is
- * not lost as H5Dset_extent() does not check.
+ * \note If the sizes specified in \p size array are smaller than the dataset’s
+ * current dimension sizes, H5Dset_extent() will reduce the dataset’s
+ * dimension sizes to the specified values. It is the user application’s
+ * responsibility to ensure that valuable data is not lost as
+ * H5Dset_extent() does not check.
*
- * \li Except for external datasets, H5Dset_extent() is for use with
- * chunked datasets only, not contiguous datasets.
+ * \note Except for external datasets, H5Dset_extent() is for use with
+ * chunked datasets only, not contiguous datasets.
*
- * \li A call to H5Dset_extent() affects the dataspace of a dataset.
- * If a dataspace handle was opened for a dataset prior to a call to
- * H5Dset_extent() then that dataspace handle will no longer reflect
- * the correct dataspace extent of the dataset. H5Dget_space() must
- * be called (after closing the previous handle) to obtain the current
- * dataspace extent.
+ * \note A call to H5Dset_extent() affects the dataspace of a dataset. If a
+ * dataspace handle was opened for a dataset prior to a call to
+ * H5Dset_extent() then that dataspace handle will no longer reflect the
+ * correct dataspace extent of the dataset. H5Dget_space() must be called
+ * (after closing the previous handle) to obtain the current dataspace
+ * extent.
*
* \since 1.8.0
*
@@ -1292,22 +1266,8 @@ H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]);
/**
* --------------------------------------------------------------------------
- * \ingroup H5D
- *
- * \brief Asynchronous version of H5Dset_extent()
- *
- * \app_file
- * \app_func
- * \app_line
- * \dset_id
- * \param[in] size[] Array containing the new magnitude of each dimension
- * of the dataset
- * \es_id
- *
- * \return \herr_t
- *
- * \see H5Dset_extent()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Dset_extent}
*/
H5_DLL herr_t H5Dset_extent_async(const char *app_file, const char *app_func, unsigned app_line,
hid_t dset_id, const hsize_t size[], hid_t es_id);
@@ -1332,11 +1292,11 @@ H5_DLL herr_t H5Dset_extent_async(const char *app_file, const char *app_func, un
* open files. After that, the OS is responsible for ensuring
* that the data is actually flushed to disk.
*
+ * \since 1.10.0
+ *
*/
H5_DLL herr_t H5Dflush(hid_t dset_id);
-H5_DLL herr_t H5Dwait(hid_t dset_id);
-
/**
* --------------------------------------------------------------------------
* \ingroup H5D
@@ -1392,40 +1352,7 @@ H5_DLL herr_t H5Drefresh(hid_t dset_id);
*
* To retrieve the data to be scattered, H5Dscatter() repeatedly
* calls \p op, which should return a valid source buffer, until
- * enough data to fill the selection has been retrieved. The
- * prototype of the callback function \p op is as follows (as
- * defined in the source code file H5Dpublic.h):
- * \snippet this H5D_scatter_func_t_snip
- * The parameters of this callback function are described below:
- *
- * <table>
- * <tr><td>\c src_buf</td>
- * <td><tt>[out]</tt></td>
- * <td>Pointer to the buffer holding the next set of elements to
- * scatter. On entry, the value of where \c src_buf points to
- * is undefined. The callback function should set \c src_buf
- * to point to the next set of elements.</td></tr>
- * <tr><td>\c src_buf_bytes_used</td>
- * <td><tt>[out]</tt></td>
- * <td>Pointer to the number of valid bytes in \c src_buf. On
- * entry, the value where \c src_buf_bytes_used points to is
- * undefined. The callback function should set
- * \c src_buf_bytes_used to the of valid bytes in \c src_buf.
- * This number must be a multiple of the datatype size.
- * </td></tr>
- * <tr><td>\c op_data</td>
- * <td><tt>[in,out]</tt></td>
- * <td>User-defined pointer to data required by the callback
- * function. A pass-through of the \c op_data pointer provided
- * with the H5Dscatter() function call.</td></tr>
- * </table>
- *
- * The callback function should always return at least one
- * element in \p src_buf, and must not return more elements
- * than are remaining to be scattered. This function will be
- * repeatedly called until all elements to be scattered have
- * been returned. The callback function should return zero (0)
- * to indicate success, and a negative value to indicate failure.
+ * enough data to fill the selection has been retrieved.
*
* \since 1.10.2
*
@@ -1477,27 +1404,9 @@ H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hi
* If no callback function is provided, H5Dgather() simply gathers
* the data into \p dst_buf and returns. If a callback function is
* provided, H5Dgather() repeatedly gathers up to \p dst_buf_size
- * bytes to process the serialized data. The prototype of the
- * callback function \p op is as follows (as defined in the source
- * code file H5Dpublic.h):
- * \snippet this H5D_gather_func_t_snip
- * The parameters of this callback function are described in the
- * table below.
- * <table>
- * <tr><td>\c dst_buf</td>
- * <td>Pointer to the destination buffer which has been filled
- * with the next set of elements gathered. This will always be
- * identical to the \p dst_buf passed to H5Dgather().</td></tr>
- * <tr><td>\c dst_buf_bytes_used</td>
- * <td>Pointer to the number of valid bytes in \p dst_buf.
- * This number must be a multiple of the datatype
- * size.</td></tr>
- * <tr><td>\c op_data</td>
- * <td>User-defined pointer to data required by the callback
- * function; a pass-through of the \p op_data pointer
- * provided with the H5Dgather() function call.</td></tr>
- * </table>
- * The callback function should process, store, or otherwise,
+ * bytes to process the serialized data.
+ *
+ * The callback function \p op should process, store, or otherwise,
* make use of the data returned in \p dst_buf before it returns,
* because the buffer will be overwritten unless it is the last
* call to the callback. This function will be repeatedly called
@@ -1521,11 +1430,11 @@ H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id,
*
* \return \herr_t
*
- * \details H5Dclose() ends access to a dataset specified by \p dset_id
- * and releases resources used by it.
+ * \details H5Dclose() terminates access to a dataset via the identifier
+ * \p dset_id and releases the underlying resources.
*
- * \attention Further use of a released dataset identifier is illegal; a
- * function using such an identifier will generate an error.
+ * \par Example
+ * \snippet H5D_examples.c read
*
* \since 1.8.0
*
@@ -1536,29 +1445,19 @@ H5_DLL herr_t H5Dclose(hid_t dset_id);
/**
* --------------------------------------------------------------------------
- * \ingroup H5D
- *
- * \brief Asynchronous version of H5Dclose()
- *
- * \app_file
- * \app_func
- * \app_line
- * \dset_id
- * \es_id
- *
- * \return \herr_t
- *
- * \see H5Dclose()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Dclose}
*/
H5_DLL herr_t H5Dclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
hid_t es_id);
-
+/// \cond DEV
/* Internal API routines */
H5_DLL herr_t H5Ddebug(hid_t dset_id);
H5_DLL herr_t H5Dformat_convert(hid_t dset_id);
H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type);
+/// \endcond
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -1582,6 +1481,7 @@ H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type);
#define H5Dset_extent_async_wrap H5_NO_EXPAND(H5Dset_extent_async)
#define H5Dclose_async_wrap H5_NO_EXPAND(H5Dclose_async)
#endif /* H5D_MODULE */
+/// \endcond
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -1608,9 +1508,178 @@ H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type);
/* Typedefs */
/* Function prototypes */
-H5_DLL hid_t H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id);
-H5_DLL hid_t H5Dopen1(hid_t loc_id, const char *name);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Creates a dataset at the specified location
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the dataset to create
+ * \type_id
+ * \space_id
+ * \dcpl_id
+ *
+ * \return \hid_t{dataset}
+ *
+ * \deprecation_note{H5Dcreate2() or the macro H5Dcreate()}
+ *
+ * \details H5Dcreate1() creates a data set with a name, \p name, in the
+ * location specified by the identifier \p loc_id. \p loc_id may be a
+ * file, group, dataset, named datatype or attribute. If an attribute,
+ * dataset, or named datatype is specified for \p loc_id then the
+ * dataset will be created at the location where the attribute,
+ * dataset, or named datatype is attached.
+ *
+ * \p name can be a relative path based at \p loc_id or an absolute
+ * path from the root of the file. Use of this function requires that
+ * any intermediate groups specified in the path already exist.
+ *
+ * The dataset’s datatype and dataspace are specified by \p type_id and
+ * \p space_id, respectively. These are the datatype and dataspace of
+ * the dataset as it will exist in the file, which may differ from the
+ * datatype and dataspace in application memory.
+ *
+ * Names within a group are unique: H5Dcreate1() will return an error
+ * if a link with the name specified in name already exists at the
+ * location specified in \p loc_id.
+ *
+ * As is the case for any object in a group, the length of a dataset
+ * name is not limited.
+ *
+ * \p dcpl_id is an #H5P_DATASET_CREATE property list created with \p
+ * H5reate1() and initialized with various property list functions
+ * described in Property List Interface.
+ *
+ * H5Dcreate() and H5Dcreate_anon() return an error if the dataset’s
+ * datatype includes a variable-length (VL) datatype and the fill value
+ * is undefined, i.e., set to \c NULL in the dataset creation property
+ * list. Such a VL datatype may be directly included, indirectly
+ * included as part of a compound or array datatype, or indirectly
+ * included as part of a nested compound or array datatype.
+ *
+ * H5Dcreate() and H5Dcreate_anon() return a dataset identifier for
+ * success or a negative value for failure. The dataset identifier
+ * should eventually be closed by calling H5Dclose() to release
+ * resources it uses.
+ *
+ * See H5Dcreate_anon() for discussion of the differences between
+ * H5Dcreate() and H5Dcreate_anon().
+ *
+ * The HDF5 library provides flexible means of specifying a fill value,
+ * of specifying when space will be allocated for a dataset, and of
+ * specifying when fill values will be written to a dataset.
+ *
+ * \version 1.8.0 Function H5Dcreate() renamed to H5Dcreate1() and deprecated in this release.
+ * \since 1.0.0
+ *
+ * \see H5Dopen2(), H5Dclose(), H5Tset_size()
+ *
+ */
+H5_DLL hid_t H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Opens an existing dataset
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the dataset to access
+ *
+ * \return \hid_t{dataset}
+ *
+ * \deprecation_note{H5Dopen2() or the macro H5Dopen()}
+ *
+ * \details H5Dopen1() opens an existing dataset for access at the location
+ * specified by \p loc_id. \p loc_id may be a file, group, dataset,
+ * named datatype or attribute. If an attribute, dataset, or named
+ * datatype is specified for loc_id then the dataset will be opened at
+ * the location where the attribute, dataset, or named datatype is
+ * attached. name is a dataset name and is used to identify the dataset
+ * in the file.
+ *
+ * A dataset opened with this function should be closed with H5Dclose()
+ * when the dataset is no longer needed so that resource leaks will not
+ * develop.
+ *
+ * \version 1.8.0 Function H5Dopen() renamed to H5Dopen1() and deprecated in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hid_t H5Dopen1(hid_t loc_id, const char *name);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Extends a dataset
+ *
+ * \dset_id
+ * \param[in] size Array containing the new size of each dimension
+ *
+ * \return \herr_t
+ *
+ * \deprecation_note{H5Dset_extent()}
+ *
+ * \details H5Dextend() verifies that the dataset is at least of size \p size,
+ * extending it if necessary. The length of \p size is the same as
+ * that of the dataspace of the dataset being changed.
+ *
+ * This function can be applied to the following datasets:
+ * \li Any dataset with unlimited dimensions
+ * \li A dataset with fixed dimensions if the current dimension sizes
+ * are less than the maximum sizes set with \c maxdims
+ * (see H5Screate_simple())
+ *
+ * Space on disk is immediately allocated for the new dataset extent if
+ * the dataset’s space allocation time is set to
+ * #H5D_ALLOC_TIME_EARLY. Fill values will be written to the dataset if
+ * the dataset’s fill time is set to #H5D_FILL_TIME_IFSET or
+ * #H5D_FILL_TIME_ALLOC. (See H5Pset_fill_time() and
+ * H5Pset_alloc_time().)
+ *
+ * This function ensures that the dataset dimensions are of at least
+ * the sizes specified in size. The function H5Dset_extent() must be
+ * used if the dataset dimension sizes are are to be reduced.
+ *
+ * \version 1.8.0 Function deprecated in this release. Parameter size
+ * syntax changed to \Code{const hsize_t size[]} in this release.
+ *
+ */
H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Reclaims variable-length (VL) datatype memory buffers
+ *
+ * \type_id
+ * \space_id
+ * \dxpl_id
+ * \param[in] buf Pointer to the buffer to be reclaimed
+ *
+ * \return \herr_t
+ *
+ * \deprecation_note{H5Treclaim()}
+ *
+ * \details H5Dvlen_reclaim() reclaims memory buffers created to store VL
+ * datatypes.
+ *
+ * The \p type_id must be the datatype stored in the buffer. The \p
+ * space_id describes the selection for the memory buffer to free the
+ * VL datatypes within. The \p dxpl_id is the dataset transfer property
+ * list which was used for the I/O transfer to create the buffer. And
+ * \p buf is the pointer to the buffer to be reclaimed.
+ *
+ * The VL structures (\ref hvl_t) in the user's buffer are modified to
+ * zero out the VL information after the memory has been reclaimed.
+ *
+ * If nested VL datatypes were used to create the buffer, this routine
+ * frees them from the bottom up, releasing all the memory without
+ * creating memory leaks.
+ *
+ * \version 1.12.0 Function was deprecated
+ *
+ */
H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index ea38e0a..4012188 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -895,7 +895,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *vir
HDassert(source_dset->dset_name);
/* Check if we need to open the source file */
- if (HDstrcmp(source_dset->file_name, ".")) {
+ if (HDstrcmp(source_dset->file_name, ".") != 0) {
unsigned intent; /* File access permissions */
/* Get the virtual dataset's file open flags ("intent") */
@@ -3151,7 +3151,7 @@ H5D__virtual_refresh_source_dset(H5D_t **dset)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register (temporary) source dataset ID")
/* Refresh source dataset */
- if (H5D__refresh(temp_id, *dset) < 0)
+ if (H5D__refresh(*dset, temp_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset")
/* Discard the identifier & replace the dataset */
diff --git a/src/H5E.c b/src/H5E.c
index 6d6dfd3..a5a9a2e 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -85,6 +85,7 @@ static H5E_t * H5E__get_current_stack(void);
static herr_t H5E__set_current_stack(H5E_t *estack);
static herr_t H5E__close_stack(H5E_t *err_stack, void **request);
static ssize_t H5E__get_num(const H5E_t *err_stack);
+static herr_t H5E__print2(hid_t err_stack, FILE *stream);
static herr_t H5E__append_stack(H5E_t *dst_estack, const H5E_t *src_stack);
/*********************/
@@ -245,6 +246,20 @@ H5E_term_package(void)
nstk = H5I_nmembers(H5I_ERROR_STACK);
if ((ncls + nmsg + nstk) > 0) {
+ /* Clear the default error stack. Note that
+ * the following H5I_clear_type calls do not
+ * force the clears and will not be able to
+ * clear any error message IDs that are still
+ * in use by the default error stack unless we
+ * clear that stack manually.
+ *
+ * Error message IDs will typically still be
+ * in use by the default error stack when the
+ * application does H5E_BEGIN/END_TRY cleanup
+ * at the very end.
+ */
+ H5E_clear_stack(NULL);
+
/* Clear any outstanding error stacks */
if (nstk > 0)
(void)H5I_clear_type(H5I_ERROR_STACK, FALSE, FALSE);
@@ -312,10 +327,10 @@ H5E__set_default_auto(H5E_t *stk)
#endif /* H5_USE_16_API_DEFAULT */
stk->auto_op.func1 = stk->auto_op.func1_default = (H5E_auto1_t)H5Eprint1;
- stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5Eprint2;
+ stk->auto_op.func2 = stk->auto_op.func2_default = (H5E_auto2_t)H5E__print2;
stk->auto_op.is_default = TRUE;
#else /* H5_NO_DEPRECATED_SYMBOLS */
- stk->auto_op.func2 = (H5E_auto2_t)H5Eprint2;
+ stk->auto_op.func2 = (H5E_auto2_t)H5E__print2;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
stk->auto_data = NULL;
@@ -624,7 +639,7 @@ H5E__get_class_name(const H5E_cls_t *cls, char *name, size_t size)
/* Set the user's buffer, if provided */
if (name) {
- HDstrncpy(name, cls->cls_name, MIN((size_t)(len + 1), size));
+ HDstrncpy(name, cls->cls_name, size);
if ((size_t)len >= size)
name[size - 1] = '\0';
} /* end if */
@@ -981,11 +996,12 @@ H5E__get_current_stack(void)
if (H5I_inc_ref(current_error->min_num, FALSE) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message")
new_error->min_num = current_error->min_num;
- if (NULL == (new_error->func_name = H5MM_xstrdup(current_error->func_name)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- if (NULL == (new_error->file_name = H5MM_xstrdup(current_error->file_name)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- new_error->line = current_error->line;
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ new_error->func_name = current_error->func_name;
+ new_error->file_name = current_error->file_name;
+ new_error->line = current_error->line;
if (NULL == (new_error->desc = H5MM_xstrdup(current_error->desc)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
} /* end for */
@@ -1101,11 +1117,12 @@ H5E__set_current_stack(H5E_t *estack)
if (H5I_inc_ref(new_error->min_num, FALSE) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class")
current_error->min_num = new_error->min_num;
- if (NULL == (current_error->func_name = H5MM_xstrdup(new_error->func_name)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- if (NULL == (current_error->file_name = H5MM_xstrdup(new_error->file_name)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- current_error->line = new_error->line;
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ current_error->func_name = new_error->func_name;
+ current_error->file_name = new_error->file_name;
+ current_error->line = new_error->line;
if (NULL == (current_error->desc = H5MM_xstrdup(new_error->desc)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
} /* end for */
@@ -1433,13 +1450,37 @@ done:
herr_t
H5Eprint2(hid_t err_stack, FILE *stream)
{
- H5E_t *estack; /* Error stack to operate on */
herr_t ret_value = SUCCEED; /* Return value */
/* Don't clear the error stack! :-) */
FUNC_ENTER_API_NOCLEAR(FAIL)
/*NO TRACE*/
+ /* Print error stack */
+ if ((ret_value = H5E__print2(err_stack, stream)) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Eprint2() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5E__print2
+ *
+ * Purpose: Internal helper routine for H5Eprint2.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5E__print2(hid_t err_stack, FILE *stream)
+{
+ H5E_t *estack; /* Error stack to operate on */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
/* Need to check for errors */
if (err_stack == H5E_DEFAULT) {
if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in
@@ -1459,8 +1500,8 @@ H5Eprint2(hid_t err_stack, FILE *stream)
HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack")
done:
- FUNC_LEAVE_API(ret_value)
-} /* end H5Eprint2() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5E__print2() */
/*-------------------------------------------------------------------------
* Function: H5Ewalk2
@@ -1532,7 +1573,8 @@ H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func /*out*/, void **client_data /*ou
H5E_auto_op_t op; /* Error stack function */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(FAIL)
+ /* Don't clear the error stack! :-) */
+ FUNC_ENTER_API_NOCLEAR(FAIL)
H5TRACE3("e", "ixx", estack_id, func, client_data);
if (estack_id == H5E_DEFAULT) {
@@ -1540,8 +1582,13 @@ H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func /*out*/, void **client_data /*ou
non-threaded case */
HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack")
} /* end if */
- else if (NULL == (estack = (H5E_t *)H5I_object_verify(estack_id, H5I_ERROR_STACK)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID")
+ else {
+ /* Only clear the error stack if it's not the default stack */
+ H5E_clear_stack(NULL);
+
+ if (NULL == (estack = (H5E_t *)H5I_object_verify(estack_id, H5I_ERROR_STACK)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID")
+ } /* end else */
/* Get the automatic error reporting information */
if (H5E__get_auto(estack, &op, client_data) < 0)
@@ -1598,8 +1645,13 @@ H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data)
non-threaded case */
HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack")
} /* end if */
- else if (NULL == (estack = (H5E_t *)H5I_object_verify(estack_id, H5I_ERROR_STACK)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID")
+ else {
+ /* Only clear the error stack if it's not the default stack */
+ H5E_clear_stack(NULL);
+
+ if (NULL == (estack = (H5E_t *)H5I_object_verify(estack_id, H5I_ERROR_STACK)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID")
+ } /* end else */
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Get the automatic error reporting information */
@@ -1646,7 +1698,8 @@ H5Eauto_is_v2(hid_t estack_id, unsigned *is_stack)
H5E_t *estack; /* Error stack to operate on */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(FAIL)
+ /* Don't clear the error stack! :-) */
+ FUNC_ENTER_API_NOCLEAR(FAIL)
H5TRACE2("e", "i*Iu", estack_id, is_stack);
if (estack_id == H5E_DEFAULT) {
@@ -1654,8 +1707,13 @@ H5Eauto_is_v2(hid_t estack_id, unsigned *is_stack)
non-threaded case */
HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack")
} /* end if */
- else if (NULL == (estack = (H5E_t *)H5I_object_verify(estack_id, H5I_ERROR_STACK)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID")
+ else {
+ /* Only clear the error stack if it's not the default stack */
+ H5E_clear_stack(NULL);
+
+ if (NULL == (estack = (H5E_t *)H5I_object_verify(estack_id, H5I_ERROR_STACK)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID")
+ } /* end else */
/* Check if the error stack reporting function is the "newer" stack type */
if (is_stack)
@@ -1757,11 +1815,12 @@ H5E__append_stack(H5E_t *dst_stack, const H5E_t *src_stack)
if (H5I_inc_ref(src_error->min_num, FALSE) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error message")
dst_error->min_num = src_error->min_num;
- if (NULL == (dst_error->func_name = H5MM_xstrdup(src_error->func_name)))
- HGOTO_ERROR(H5E_ERROR, H5E_CANTALLOC, FAIL, "memory allocation failed")
- if (NULL == (dst_error->file_name = H5MM_xstrdup(src_error->file_name)))
- HGOTO_ERROR(H5E_ERROR, H5E_CANTALLOC, FAIL, "memory allocation failed")
- dst_error->line = src_error->line;
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ dst_error->func_name = src_error->func_name;
+ dst_error->file_name = src_error->file_name;
+ dst_error->line = src_error->line;
if (NULL == (dst_error->desc = H5MM_xstrdup(src_error->desc)))
HGOTO_ERROR(H5E_ERROR, H5E_CANTALLOC, FAIL, "memory allocation failed")
diff --git a/src/H5EA.c b/src/H5EA.c
index 4d6b7c1..8f9a4b6 100644
--- a/src/H5EA.c
+++ b/src/H5EA.c
@@ -116,39 +116,40 @@ H5FL_BLK_DEFINE(ea_native_elmt);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, H5EA_t *, NULL, NULL,
- H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, void *ctx_udata))
+static H5EA_t *
+H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, void *ctx_udata)
+{
+ H5EA_t * ea = NULL; /* Pointer to new extensible array */
+ H5EA_hdr_t *hdr = NULL; /* The extensible array header information */
+ H5EA_t * ret_value = NULL;
- /* Local variables */
- H5EA_t * ea = NULL; /* Pointer to new extensible array */
- H5EA_hdr_t *hdr = NULL; /* The extensible array header information */
+ FUNC_ENTER_STATIC
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(ea_addr));
/* Allocate extensible array wrapper */
if (NULL == (ea = H5FL_CALLOC(H5EA_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array info")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for extensible array info")
/* Lock the array header into memory */
if (NULL == (hdr = H5EA__hdr_protect(f, ea_addr, ctx_udata, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, NULL, "unable to load extensible array header")
/* Check for pending array deletion */
if (from_open && hdr->pending_delete)
- H5E_THROW(H5E_CANTOPENOBJ, "can't open extensible array pending deletion")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTOPENOBJ, NULL, "can't open extensible array pending deletion")
/* Point extensible array wrapper at header and bump it's ref count */
ea->hdr = hdr;
if (H5EA__hdr_incr(ea->hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
/* Increment # of files using this array header */
if (H5EA__hdr_fuse_incr(ea->hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment file reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINC, NULL,
+ "can't increment file reference count on shared array header")
/* Set file pointer for this array open context */
ea->f = f;
@@ -156,15 +157,16 @@ BEGIN_FUNC(STATIC, ERR, H5EA_t *, NULL, NULL,
/* Set the return value */
ret_value = ea;
- CATCH
+done:
if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, NULL, "unable to release extensible array header")
if (!ret_value)
if (ea && H5EA_close(ea) < 0)
- H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array")
+ HDONE_ERROR(H5E_EARRAY, H5E_CLOSEERROR, NULL, "unable to close extensible array")
-END_FUNC(STATIC) /* end H5EA__new() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__new() */
/*-------------------------------------------------------------------------
* Function: H5EA_create
@@ -179,16 +181,16 @@ END_FUNC(STATIC) /* end H5EA__new() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL,
- H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata))
-
- /* Local variables */
+H5EA_t *
+H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata)
+{
H5EA_t *ea = NULL; /* Pointer to new extensible array */
haddr_t ea_addr; /* Array header address */
+ H5EA_t *ret_value = NULL;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(NULL)
+
+ /* Check arguments */
HDassert(f);
HDassert(cparam);
@@ -197,22 +199,23 @@ BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL,
/* Create extensible array header */
if (HADDR_UNDEF == (ea_addr = H5EA__hdr_create(f, cparam, ctx_udata)))
- H5E_THROW(H5E_CANTINIT, "can't create extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "can't create extensible array header")
/* Allocate and initialize new extensible array wrapper */
if (NULL == (ea = H5EA__new(f, ea_addr, FALSE, ctx_udata)))
- H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for extensible array wrapper")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL,
+ "allocation and/or initialization failed for extensible array wrapper")
/* Set the return value */
ret_value = ea;
- CATCH
-
+done:
if (!ret_value)
if (ea && H5EA_close(ea) < 0)
- H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array")
+ HDONE_ERROR(H5E_EARRAY, H5E_CLOSEERROR, NULL, "unable to close extensible array")
-END_FUNC(PRIV) /* end H5EA_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_create() */
/*-------------------------------------------------------------------------
* Function: H5EA_open
@@ -227,31 +230,33 @@ END_FUNC(PRIV) /* end H5EA_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL, H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata))
+H5EA_t *
+H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata)
+{
+ H5EA_t *ea = NULL; /* Pointer to new extensible array wrapper */
+ H5EA_t *ret_value = NULL;
- /* Local variables */
- H5EA_t *ea = NULL; /* Pointer to new extensible array wrapper */
+ FUNC_ENTER_NOAPI(NULL)
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(ea_addr));
/* Allocate and initialize new extensible array wrapper */
if (NULL == (ea = H5EA__new(f, ea_addr, TRUE, ctx_udata)))
- H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for extensible array wrapper")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL,
+ "allocation and/or initialization failed for extensible array wrapper")
/* Set the return value */
ret_value = ea;
- CATCH
-
+done:
if (!ret_value)
if (ea && H5EA_close(ea) < 0)
- H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array")
+ HDONE_ERROR(H5E_EARRAY, H5E_CLOSEERROR, NULL, "unable to close extensible array")
-END_FUNC(PRIV) /* end H5EA_open() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_open() */
/*-------------------------------------------------------------------------
* Function: H5EA_get_nelmts
@@ -265,20 +270,20 @@ END_FUNC(PRIV) /* end H5EA_open() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts))
-
- /* Local variables */
+herr_t
+H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts)
+{
+ FUNC_ENTER_NOAPI_NOERR
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(ea);
HDassert(nelmts);
/* Retrieve the max. index set */
*nelmts = ea->hdr->stats.stored.max_idx_set;
-END_FUNC(PRIV) /* end H5EA_get_nelmts() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA_get_nelmts() */
/*-------------------------------------------------------------------------
* Function: H5EA_get_addr
@@ -292,13 +297,12 @@ END_FUNC(PRIV) /* end H5EA_get_nelmts() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5EA_get_addr(const H5EA_t *ea, haddr_t *addr))
-
- /* Local variables */
+herr_t
+H5EA_get_addr(const H5EA_t *ea, haddr_t *addr)
+{
+ FUNC_ENTER_NOAPI_NOERR
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(ea);
HDassert(ea->hdr);
HDassert(addr);
@@ -306,7 +310,8 @@ BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5EA_get_addr(const H5EA_t *ea, hadd
/* Retrieve the address of the extensible array's header */
*addr = ea->hdr->addr;
-END_FUNC(PRIV) /* end H5EA_get_addr() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA_get_addr() */
/*-------------------------------------------------------------------------
* Function: H5EA__lookup_elmt
@@ -321,12 +326,11 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc,
- void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx,
- H5EA__unprotect_func_t *thing_unprot_func))
-
- /* Local variables */
+static herr_t
+H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc, void **thing,
+ uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx,
+ H5EA__unprotect_func_t *thing_unprot_func)
+{
H5EA_hdr_t * hdr = ea->hdr; /* Header for EA */
H5EA_iblock_t * iblock = NULL; /* Pointer to index block for EA */
H5EA_sblock_t * sblock = NULL; /* Pointer to super block for EA */
@@ -336,10 +340,11 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
unsigned sblock_cache_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting super block */
hbool_t stats_changed = FALSE; /* Whether array statistics changed */
hbool_t hdr_dirty = FALSE; /* Whether the array header changed */
+ herr_t ret_value = SUCCEED;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_STATIC
+
+ /* Check arguments */
HDassert(ea);
HDassert(hdr);
HDassert(thing);
@@ -365,17 +370,18 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Create the index block */
hdr->idx_blk_addr = H5EA__iblock_create(hdr, &stats_changed);
if (!H5F_addr_defined(hdr->idx_blk_addr))
- H5E_THROW(H5E_CANTCREATE, "unable to create index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL, "unable to create index block")
hdr_dirty = TRUE;
} /* end if */
else
- H5_LEAVE(SUCCEED)
+ HGOTO_DONE(SUCCEED)
} /* end if */
/* Protect index block */
if (NULL == (iblock = H5EA__iblock_protect(hdr, thing_acc)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu",
- (unsigned long long)hdr->idx_blk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array index block, address = %llu",
+ (unsigned long long)hdr->idx_blk_addr)
/* Check if element is in index block */
if (idx < hdr->cparam.idx_blk_elmts) {
@@ -416,21 +422,23 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
dblk_addr = H5EA__dblock_create(hdr, iblock, &stats_changed, dblk_off,
hdr->sblk_info[sblk_idx].dblk_nelmts);
if (!H5F_addr_defined(dblk_addr))
- H5E_THROW(H5E_CANTCREATE, "unable to create extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL,
+ "unable to create extensible array data block")
/* Set data block address in index block */
iblock->dblk_addrs[dblk_idx] = dblk_addr;
iblock_cache_flags |= H5AC__DIRTIED_FLAG;
} /* end if */
else
- H5_LEAVE(SUCCEED)
+ HGOTO_DONE(SUCCEED)
} /* end if */
/* Protect data block */
if (NULL == (dblock = H5EA__dblock_protect(hdr, iblock, iblock->dblk_addrs[dblk_idx],
hdr->sblk_info[sblk_idx].dblk_nelmts, thing_acc)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu",
- (unsigned long long)iblock->dblk_addrs[dblk_idx])
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array data block, address = %llu",
+ (unsigned long long)iblock->dblk_addrs[dblk_idx])
/* Adjust index to offset in data block */
elmt_idx %= hdr->sblk_info[sblk_idx].dblk_nelmts;
@@ -438,9 +446,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Check if there is already a dependency on the header */
if (will_extend && !dblock->has_hdr_depend) {
if (H5EA__create_flush_depend((H5AC_info_t *)hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(H5E_CANTDEPEND,
- "unable to create flush dependency between data block and header, index = %llu",
- (unsigned long long)idx)
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
+ "unable to create flush dependency between data block and header, index = %llu",
+ (unsigned long long)idx)
dblock->has_hdr_depend = TRUE;
} /* end if */
@@ -465,21 +474,23 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Create super block */
sblk_addr = H5EA__sblock_create(hdr, iblock, &stats_changed, sblk_idx);
if (!H5F_addr_defined(sblk_addr))
- H5E_THROW(H5E_CANTCREATE, "unable to create extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL,
+ "unable to create extensible array super block")
/* Set super block address in index block */
iblock->sblk_addrs[sblk_off] = sblk_addr;
iblock_cache_flags |= H5AC__DIRTIED_FLAG;
} /* end if */
else
- H5_LEAVE(SUCCEED)
+ HGOTO_DONE(SUCCEED)
} /* end if */
/* Protect super block */
if (NULL == (sblock = H5EA__sblock_protect(hdr, iblock, iblock->sblk_addrs[sblk_off], sblk_idx,
thing_acc)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu",
- (unsigned long long)iblock->sblk_addrs[sblk_off])
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array super block, address = %llu",
+ (unsigned long long)iblock->sblk_addrs[sblk_off])
/* Compute the data block index in super block */
dblk_idx = (size_t)(elmt_idx / sblock->dblk_nelmts);
@@ -498,7 +509,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
dblk_addr =
H5EA__dblock_create(hdr, sblock, &stats_changed, dblk_off, sblock->dblk_nelmts);
if (!H5F_addr_defined(dblk_addr))
- H5E_THROW(H5E_CANTCREATE, "unable to create extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL,
+ "unable to create extensible array data block")
/* Set data block address in index block */
sblock->dblk_addrs[dblk_idx] = dblk_addr;
@@ -508,8 +520,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
*/
if (will_extend && !sblock->has_hdr_depend) {
if (H5EA__create_flush_depend((H5AC_info_t *)sblock->hdr, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between super block and header, address "
"= %llu",
(unsigned long long)sblock->addr)
@@ -517,7 +529,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
} /* end if */
} /* end if */
else
- H5_LEAVE(SUCCEED)
+ HGOTO_DONE(SUCCEED)
} /* end if */
/* Adjust index to offset in data block */
@@ -548,29 +560,29 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
if (0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */
/* Create the data block page */
if (H5EA__dblk_page_create(hdr, sblock, dblk_page_addr) < 0)
- H5E_THROW(H5E_CANTCREATE, "unable to create data block page")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL, "unable to create data block page")
/* Mark data block page as initialized in super block */
H5VM_bit_set(sblock->page_init, page_init_idx, TRUE);
sblock_cache_flags |= H5AC__DIRTIED_FLAG;
} /* end if */
else
- H5_LEAVE(SUCCEED)
+ HGOTO_DONE(SUCCEED)
} /* end if */
/* Protect data block page */
if (NULL == (dblk_page = H5EA__dblk_page_protect(hdr, sblock, dblk_page_addr, thing_acc)))
- H5E_THROW(H5E_CANTPROTECT,
- "unable to protect extensible array data block page, address = %llu",
- (unsigned long long)dblk_page_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array data block page, address = %llu",
+ (unsigned long long)dblk_page_addr)
/* Check if there is already a dependency on the header */
if (will_extend && !dblk_page->has_hdr_depend) {
if (H5EA__create_flush_depend((H5AC_info_t *)hdr, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(H5E_CANTDEPEND,
- "unable to create flush dependency between data block page and header, "
- "index = %llu",
- (unsigned long long)idx)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEPEND, FAIL,
+ "unable to create flush dependency between data block page and header, "
+ "index = %llu",
+ (unsigned long long)idx)
dblk_page->has_hdr_depend = TRUE;
} /* end if */
@@ -584,15 +596,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Protect data block */
if (NULL == (dblock = H5EA__dblock_protect(hdr, sblock, sblock->dblk_addrs[dblk_idx],
sblock->dblk_nelmts, thing_acc)))
- H5E_THROW(H5E_CANTPROTECT,
- "unable to protect extensible array data block, address = %llu",
- (unsigned long long)sblock->dblk_addrs[dblk_idx])
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array data block, address = %llu",
+ (unsigned long long)sblock->dblk_addrs[dblk_idx])
/* Check if there is already a dependency on the header */
if (will_extend && !dblock->has_hdr_depend) {
if (H5EA__create_flush_depend((H5AC_info_t *)hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between data block and header, index = %llu",
(unsigned long long)idx)
dblock->has_hdr_depend = TRUE;
@@ -611,7 +623,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
HDassert(*thing != NULL);
HDassert(*thing_unprot_func != NULL);
- CATCH
+done:
/* Reset 'thing' info on error */
if (ret_value < 0) {
*thing = NULL;
@@ -627,20 +639,22 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Check for header modified */
if (hdr_dirty)
if (H5EA__hdr_modified(hdr) < 0)
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark extensible array header as modified")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTMARKDIRTY, FAIL,
+ "unable to mark extensible array header as modified")
/* Release resources */
if (iblock && *thing != iblock && H5EA__iblock_unprotect(iblock, iblock_cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array index block")
/* (Note: super blocks don't contain elements, so don't have a '*thing != sblock' check) */
if (sblock && H5EA__sblock_unprotect(sblock, sblock_cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array super block")
if (dblock && *thing != dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array data block")
if (dblk_page && *thing != dblk_page && H5EA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block page")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array data block page")
-END_FUNC(STATIC) /* end H5EA__lookup_elmt() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__lookup_elmt() */
/*-------------------------------------------------------------------------
* Function: H5EA_set
@@ -654,9 +668,9 @@ END_FUNC(STATIC) /* end H5EA__lookup_elmt() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt))
-
- /* Local variables */
+herr_t
+H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt)
+{
H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */
void * thing = NULL; /* Pointer to the array metadata containing the array index we are interested in */
uint8_t *thing_elmt_buf; /* Pointer to the element buffer for the array metadata */
@@ -664,10 +678,11 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_set(const H5EA_t *ea, hsize_t
H5EA__unprotect_func_t thing_unprot_func; /* Function pointer for unprotecting the array metadata */
hbool_t will_extend; /* Flag indicating if setting the element will extend the array */
unsigned thing_cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting array metadata */
+ herr_t ret_value = SUCCEED;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(ea);
HDassert(hdr);
@@ -678,7 +693,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_set(const H5EA_t *ea, hsize_t
will_extend = (idx >= hdr->stats.stored.max_idx_set);
if (H5EA__lookup_elmt(ea, idx, will_extend, H5AC__NO_FLAGS_SET, &thing, &thing_elmt_buf, &thing_elmt_idx,
&thing_unprot_func) < 0)
- H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to protect array metadata")
/* Sanity check */
HDassert(thing);
@@ -695,15 +710,17 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_set(const H5EA_t *ea, hsize_t
/* Update the max index for the array */
hdr->stats.stored.max_idx_set = idx + 1;
if (H5EA__hdr_modified(hdr) < 0)
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark extensible array header as modified")
- } /* end if */
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTMARKDIRTY, FAIL,
+ "unable to mark extensible array header as modified")
+ }
- CATCH
+done:
/* Release resources */
if (thing && (thing_unprot_func)(thing, thing_cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array metadata")
-END_FUNC(PRIV) /* end H5EA_set() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_set() */
/*-------------------------------------------------------------------------
* Function: H5EA_get
@@ -717,17 +734,18 @@ END_FUNC(PRIV) /* end H5EA_set() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt))
-
- /* Local variables */
+herr_t
+H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt)
+{
H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */
void *thing = NULL; /* Pointer to the array metadata containing the array index we are interested in */
H5EA__unprotect_func_t thing_unprot_func =
NULL; /* Function pointer for unprotecting the array metadata */
+ herr_t ret_value = SUCCEED;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(ea);
HDassert(hdr);
@@ -735,7 +753,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_get(const H5EA_t *ea, hsize_t
if (idx >= hdr->stats.stored.max_idx_set) {
/* Call the class's 'fill' callback */
if ((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0)
- H5E_THROW(H5E_CANTSET, "can't set element to class's fill value")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, FAIL, "can't set element to class's fill value")
} /* end if */
else {
uint8_t *thing_elmt_buf; /* Pointer to the element buffer for the array metadata */
@@ -747,13 +765,13 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_get(const H5EA_t *ea, hsize_t
/* Look up the array metadata containing the element we want to set */
if (H5EA__lookup_elmt(ea, idx, FALSE, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx,
&thing_unprot_func) < 0)
- H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to protect array metadata")
/* Check if the thing holding the element has been created yet */
if (NULL == thing) {
/* Call the class's 'fill' callback */
if ((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0)
- H5E_THROW(H5E_CANTSET, "can't set element to class's fill value")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, FAIL, "can't set element to class's fill value")
} /* end if */
else
/* Get element from thing's element buffer */
@@ -761,12 +779,13 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_get(const H5EA_t *ea, hsize_t
hdr->cparam.cls->nat_elmt_size);
} /* end else */
- CATCH
+done:
/* Release thing */
if (thing && (thing_unprot_func)(thing, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array metadata")
-END_FUNC(PRIV) /* end H5EA_get() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_get() */
/*-------------------------------------------------------------------------
* Function: H5EA_depend
@@ -781,14 +800,15 @@ END_FUNC(PRIV) /* end H5EA_get() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent))
+herr_t
+H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent)
+{
+ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */
+ FUNC_ENTER_NOAPI(FAIL)
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(ea);
HDassert(hdr);
HDassert(parent);
@@ -807,13 +827,13 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_depend(H5EA_t *ea, H5AC_proxy_
/* Add the extensible array as a child of the parent (proxy) */
if (H5AC_proxy_entry_add_child(parent, hdr->f, hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array as child of proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, FAIL, "unable to add extensible array as child of proxy")
hdr->parent = parent;
- } /* end if */
-
- CATCH
+ }
-END_FUNC(PRIV) /* end H5EA_depend() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_depend() */
/*-------------------------------------------------------------------------
* Function: H5EA_close
@@ -827,15 +847,16 @@ END_FUNC(PRIV) /* end H5EA_depend() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_close(H5EA_t *ea))
-
- /* Local variables */
+herr_t
+H5EA_close(H5EA_t *ea)
+{
hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */
haddr_t ea_addr = HADDR_UNDEF; /* Address of array (for deletion) */
+ herr_t ret_value = SUCCEED;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(ea);
/* Close the header, if it was set */
@@ -868,8 +889,8 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_close(H5EA_t *ea))
/* Check the header's status in the metadata cache */
if (H5AC_get_entry_status(ea->f, ea_addr, &hdr_status) < 0)
- H5E_THROW(H5E_CANTGET,
- "unable to check metadata cache status for extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL,
+ "unable to check metadata cache status for extensible array header")
/* Sanity checks on header */
HDassert(hdr_status & H5AC_ES__IN_CACHE);
@@ -881,7 +902,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_close(H5EA_t *ea))
/* Lock the array header into memory */
/* (OK to pass in NULL for callback context, since we know the header must be in the cache) */
if (NULL == (hdr = H5EA__hdr_protect(ea->f, ea_addr, NULL, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTLOAD, "unable to load extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTLOAD, FAIL, "unable to load extensible array header")
/* Set the shared array header's file context for this operation */
hdr->f = ea->f;
@@ -891,11 +912,12 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_close(H5EA_t *ea))
* immediately -QAK)
*/
if (H5EA__hdr_decr(ea->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
/* Delete array, starting with header (unprotects header) */
if (H5EA__hdr_delete(hdr) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDELETE, FAIL, "unable to delete extensible array")
} /* end if */
else {
/* Decrement the reference count on the array header */
@@ -903,16 +925,17 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_close(H5EA_t *ea))
* immediately -QAK)
*/
if (H5EA__hdr_decr(ea->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
} /* end else */
} /* end if */
/* Release the extensible array wrapper */
ea = (H5EA_t *)H5FL_FREE(H5EA_t, ea);
- CATCH
-
-END_FUNC(PRIV) /* end H5EA_close() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_close() */
/*-------------------------------------------------------------------------
* Function: H5EA_delete
@@ -926,21 +949,22 @@ END_FUNC(PRIV) /* end H5EA_close() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata))
+herr_t
+H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata)
+{
+ H5EA_hdr_t *hdr = NULL; /* The fractal heap header information */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_hdr_t *hdr = NULL; /* The fractal heap header information */
+ FUNC_ENTER_NOAPI(FAIL)
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(ea_addr));
/* Lock the array header into memory */
if (NULL == (hdr = H5EA__hdr_protect(f, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu",
- (unsigned long long)ea_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr)
/* Check for files using shared array header */
if (hdr->file_rc)
@@ -951,17 +975,17 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_delete(H5F_t *f, haddr_t ea_ad
/* Delete array now, starting with header (unprotects header) */
if (H5EA__hdr_delete(hdr) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDELETE, FAIL, "unable to delete extensible array")
hdr = NULL;
- } /* end if */
+ }
- CATCH
-
- /* Unprotect the header, if an error occurred */
+done:
+ /* Unprotect the header if an error occurred */
if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array header")
-END_FUNC(PRIV) /* end H5EA_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_delete() */
/*-------------------------------------------------------------------------
* Function: H5EA_iterate
@@ -975,13 +999,14 @@ END_FUNC(PRIV) /* end H5EA_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, int, H5_ITER_CONT, H5_ITER_ERROR,
- H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata))
-
- /* Local variables */
+int
+H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata)
+{
uint8_t *elmt = NULL;
hsize_t u;
- int cb_ret = H5_ITER_CONT; /* Return value from callback */
+ int ret_value = H5_ITER_CONT;
+
+ FUNC_ENTER_NOAPI(H5_ITER_ERROR)
/* Check arguments */
HDassert(ea);
@@ -990,27 +1015,28 @@ BEGIN_FUNC(PRIV, ERR, int, H5_ITER_CONT, H5_ITER_ERROR,
/* Allocate space for a native array element */
if (NULL == (elmt = H5FL_BLK_MALLOC(ea_native_elmt, ea->hdr->cparam.cls->nat_elmt_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array element")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, H5_ITER_ERROR,
+ "memory allocation failed for extensible array element")
/* Iterate over all elements in array */
- for (u = 0; u < ea->hdr->stats.stored.max_idx_set && cb_ret == H5_ITER_CONT; u++) {
+ for (u = 0; u < ea->hdr->stats.stored.max_idx_set && ret_value == H5_ITER_CONT; u++) {
/* Get array element */
if (H5EA_get(ea, u, elmt) < 0)
- H5E_THROW(H5E_CANTGET, "unable to delete fixed array")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, H5_ITER_ERROR, "unable to delete fixed array")
/* Make callback */
- if ((cb_ret = (*op)(u, elmt, udata)) < 0) {
- H5E_PRINTF(H5E_BADITER, "iterator function failed");
- H5_LEAVE(cb_ret)
- } /* end if */
- } /* end for */
-
- CATCH
+ if ((ret_value = (*op)(u, elmt, udata)) < 0) {
+ HERROR(H5E_EARRAY, H5E_BADITER, "iteration callback error");
+ break;
+ }
+ }
+done:
if (elmt)
elmt = H5FL_BLK_FREE(ea_native_elmt, elmt);
-END_FUNC(PRIV) /* end H5EA_iterate() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA_iterate() */
/*-------------------------------------------------------------------------
* Function: H5EA_patch_file
@@ -1024,17 +1050,17 @@ END_FUNC(PRIV) /* end H5EA_iterate() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5EA_patch_file(H5EA_t *ea, H5F_t *f))
-
- /* Local variables */
+herr_t
+H5EA_patch_file(H5EA_t *ea, H5F_t *f)
+{
+ FUNC_ENTER_NOAPI_NOERR
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(ea);
HDassert(f);
if (ea->f != f || ea->hdr->f != f)
ea->f = ea->hdr->f = f;
-END_FUNC(PRIV) /* end H5EA_patch_file() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA_patch_file() */
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index 550627e..eeac1a2 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -221,12 +221,13 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_hdr_cache_ud_t *udata = (H5EA_hdr_cache_ud_t *)_udata; /* User data for callback */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->f);
@@ -235,7 +236,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_HEADER_SIZE_FILE(udata->f);
-END_FUNC(STATIC) /* end H5EA__cache_hdr_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_hdr_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_verify_chksum
@@ -250,13 +252,15 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -267,7 +271,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5EA__cache_hdr_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_deserialize
@@ -282,16 +287,17 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_cls_id_t id; /* ID of extensible array class, as found in file */
H5EA_hdr_t * hdr = NULL; /* Extensible array info */
H5EA_hdr_cache_ud_t *udata = (H5EA_hdr_cache_ud_t *)_udata;
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(image);
@@ -301,24 +307,25 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate space for the extensible array data structure */
if (NULL == (hdr = H5EA__hdr_alloc(udata->f)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array shared header")
/* Set the extensible array header's address */
hdr->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header signature")
+ if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_HDR_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array header version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array header version")
/* Extensible array class */
id = (H5EA_cls_id_t)*image++;
if (id >= H5EA_NUM_CLS_ID)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
hdr->cparam.cls = H5EA_client_class_g[id];
/* General array creation/configuration information */
@@ -379,20 +386,20 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Finish initializing extensible array header */
if (H5EA__hdr_init(hdr, udata->ctx_udata) < 0)
- H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "initialization failed for extensible array header")
HDassert(hdr->size == len);
/* Set return value */
ret_value = hdr;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (hdr && H5EA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array header")
-END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_hdr_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_image_len
@@ -406,12 +413,13 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_hdr_t *hdr = (const H5EA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(hdr);
HDassert(image_len);
@@ -419,7 +427,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = hdr->size;
-END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_hdr_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_serialize
@@ -433,14 +442,15 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_hdr_t *hdr = (H5EA_hdr_t *)_thing; /* Pointer to the extensible array header */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ FUNC_ENTER_STATIC_NOERR
+
/* check arguments */
HDassert(f);
HDassert(image);
@@ -488,7 +498,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
-END_FUNC(STATIC) /* end H5EA__cache_hdr_serialize() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_hdr_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_notify
@@ -502,11 +513,13 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_hdr_t *hdr = (H5EA_hdr_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_hdr_t *hdr = (H5EA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(hdr);
@@ -538,23 +551,24 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on object header proxy */
if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent,
(void *)hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between extensible array and proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between extensible array and proxy")
hdr->parent = NULL;
} /* end if */
/* Detach from 'top' proxy for extensible array */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_remove_child(hdr->top_proxy, hdr) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between header and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between header and "
+ "extensible array 'top' proxy")
/* Don't reset hdr->top_proxy here, it's destroyed when the header is freed -QAK */
} /* end if */
break;
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
@@ -563,9 +577,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
else
HDassert(NULL == hdr->parent);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_hdr_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_free_icr
@@ -580,18 +594,23 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_hdr_free_icr(void *thing))
+static herr_t
+H5EA__cache_hdr_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array header */
if (H5EA__hdr_dest((H5EA_hdr_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array header")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_hdr_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_get_initial_load_size
@@ -605,13 +624,14 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_hdr_t * hdr = (H5EA_hdr_t *)_udata; /* User data for callback */
H5EA_iblock_t iblock; /* Fake index block for computing size */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(hdr);
HDassert(image_len);
@@ -626,7 +646,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_IBLOCK_SIZE(&iblock);
-END_FUNC(STATIC) /* end H5EA__cache_iblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_iblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_verify_chksum
@@ -641,13 +662,15 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -658,7 +681,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_deserialize
@@ -673,17 +697,18 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_iblock_t *iblock = NULL; /* Index block info */
H5EA_hdr_t * hdr = (H5EA_hdr_t *)_udata; /* User data for callback */
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
size_t u; /* Local index variable */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(image);
@@ -691,28 +716,29 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array index block */
if (NULL == (iblock = H5EA__iblock_alloc(hdr)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array index block")
/* Set the extensible array index block's address */
iblock->addr = hdr->idx_blk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array index block signature")
+ if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array index block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_IBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array index block version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array index block version")
/* Extensible array type */
if (*image++ != (uint8_t)hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header address")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header address")
/* Internal information */
@@ -721,7 +747,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Convert from raw elements on disk into native elements in memory */
if ((hdr->cparam.cls->decode)(image, iblock->elmts, (size_t)hdr->cparam.idx_blk_elmts, hdr->cb_ctx) <
0)
- H5E_THROW(H5E_CANTDECODE, "can't decode extensible array index elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDECODE, NULL, "can't decode extensible array index elements")
image += (hdr->cparam.idx_blk_elmts * hdr->cparam.raw_elmt_size);
} /* end if */
@@ -757,14 +783,14 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = iblock;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (iblock && H5EA__iblock_dest(iblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array index block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array index block")
-END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_image_len
@@ -778,12 +804,13 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_iblock_t *iblock = (const H5EA_iblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(iblock);
HDassert(image_len);
@@ -791,7 +818,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = iblock->size;
-END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_iblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_serialize
@@ -805,14 +833,15 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* check arguments */
HDassert(f);
@@ -843,7 +872,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((iblock->hdr->cparam.cls->encode)(image, iblock->elmts, (size_t)iblock->hdr->cparam.idx_blk_elmts,
iblock->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode extensible array index elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTENCODE, FAIL, "can't encode extensible array index elements")
image += (iblock->hdr->cparam.idx_blk_elmts * iblock->hdr->cparam.raw_elmt_size);
} /* end if */
@@ -874,9 +903,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_notify
@@ -890,11 +919,13 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(iblock);
@@ -905,9 +936,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on extensible array header */
if (H5EA__create_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0)
- H5E_THROW(H5E_CANTDEPEND,
- "unable to create flush dependency between index block and header, address = %llu",
- (unsigned long long)iblock->addr)
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
+ "unable to create flush dependency between index block and header, address = %llu",
+ (unsigned long long)iblock->addr)
break;
case H5AC_NOTIFY_ACTION_AFTER_FLUSH:
@@ -923,30 +955,32 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on extensible array header */
if (H5EA__destroy_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between index block and header, address = %llu",
- (unsigned long long)iblock->addr)
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between index block and header, address = %llu",
+ (unsigned long long)iblock->addr)
/* Detach from 'top' proxy for extensible array */
if (iblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(iblock->top_proxy, iblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between index block and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between index block and "
+ "extensible array 'top' proxy")
iblock->top_proxy = NULL;
} /* end if */
break;
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_free_icr
@@ -961,18 +995,23 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_iblock_free_icr(void *thing))
+static herr_t
+H5EA__cache_iblock_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array index block */
if (H5EA__iblock_dest((H5EA_iblock_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array index block")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_get_initial_load_size
@@ -986,13 +1025,14 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_sblock_cache_ud_t *udata = (H5EA_sblock_cache_ud_t *)_udata; /* User data */
H5EA_sblock_t sblock; /* Fake super block for computing size */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -1026,7 +1066,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_SBLOCK_SIZE(&sblock);
-END_FUNC(STATIC) /* end H5EA__cache_sblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_sblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_verify_chksum
@@ -1041,13 +1082,15 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1058,7 +1101,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_deserialize
@@ -1073,17 +1117,18 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_sblock_t * sblock = NULL; /* Super block info */
H5EA_sblock_cache_ud_t *udata = (H5EA_sblock_cache_ud_t *)_udata; /* User data */
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
size_t u; /* Local index variable */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(udata);
@@ -1094,28 +1139,29 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array super block */
if (NULL == (sblock = H5EA__sblock_alloc(udata->hdr, udata->parent, udata->sblk_idx)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array super block")
/* Set the extensible array super block's address */
sblock->addr = udata->sblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array super block signature")
+ if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array super block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_SBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array super block version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array super block version")
/* Extensible array type */
if (*image++ != (uint8_t)udata->hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(udata->hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, udata->hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header address")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header address")
/* Offset of block within the array's address space */
UINT64DECODE_VAR(image, sblock->block_off, udata->hdr->arr_off_size);
@@ -1154,14 +1200,14 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = sblock;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (sblock && H5EA__sblock_dest(sblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array super block")
-END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_image_len
@@ -1175,12 +1221,13 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_sblock_t *sblock = (const H5EA_sblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(sblock);
HDassert(image_len);
@@ -1188,7 +1235,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = sblock->size;
-END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_sblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_serialize
@@ -1202,16 +1250,16 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
size_t u; /* Local index variable */
+ FUNC_ENTER_STATIC_NOERR
+
/* check arguments */
HDassert(f);
HDassert(image);
@@ -1260,7 +1308,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
-END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_sblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_notify
@@ -1274,11 +1323,13 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(sblock);
@@ -1289,8 +1340,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on index block */
if (H5EA__create_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between super block and index block, address = %llu",
(unsigned long long)sblock->addr)
break;
@@ -1299,8 +1350,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on extensible array header, if set */
if (sblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)sblock->hdr, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between super block and header, address = %llu",
(unsigned long long)sblock->addr)
sblock->has_hdr_depend = FALSE;
@@ -1310,16 +1361,16 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on index block */
if (H5EA__destroy_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between super block and index block, address = %llu",
(unsigned long long)sblock->addr)
/* Destroy flush dependency on extensible array header, if set */
if (sblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)sblock->hdr, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between super block and header, address = %llu",
(unsigned long long)sblock->addr)
sblock->has_hdr_depend = FALSE;
@@ -1328,8 +1379,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Detach from 'top' proxy for extensible array */
if (sblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(sblock->top_proxy, sblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between super block and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between super block and "
+ "extensible array 'top' proxy")
sblock->top_proxy = NULL;
} /* end if */
break;
@@ -1345,15 +1397,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_free_icr
@@ -1368,18 +1420,23 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_sblock_free_icr(void *thing))
+static herr_t
+H5EA__cache_sblock_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array super block */
if (H5EA__sblock_dest((H5EA_sblock_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array super block")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_get_initial_load_size
@@ -1393,13 +1450,14 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_dblock_cache_ud_t *udata = (H5EA_dblock_cache_ud_t *)_udata; /* User data */
H5EA_dblock_t dblock; /* Fake data block for computing size */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -1434,7 +1492,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = H5EA_DBLOCK_PREFIX_SIZE(&dblock);
-END_FUNC(STATIC) /* end H5EA__cache_dblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_verify_chksum
@@ -1449,13 +1508,15 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1466,7 +1527,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_deserialize
@@ -1481,16 +1543,18 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
+ hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_dblock_t * dblock = NULL; /* Data block info */
H5EA_dblock_cache_ud_t *udata = (H5EA_dblock_cache_ud_t *)_udata; /* User data */
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(udata);
@@ -1501,7 +1565,8 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array data block */
if (NULL == (dblock = H5EA__dblock_alloc(udata->hdr, udata->parent, udata->nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array data block")
HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) ||
(len == H5EA_DBLOCK_PREFIX_SIZE(dblock)));
@@ -1510,22 +1575,22 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
dblock->addr = udata->dblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array data block signature")
+ if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array data block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_DBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array data block version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array data block version")
/* Extensible array type */
if (*image++ != (uint8_t)udata->hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(udata->hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, udata->hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header address")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header address")
/* Offset of block within the array's address space */
UINT64DECODE_VAR(image, dblock->block_off, udata->hdr->arr_off_size);
@@ -1537,7 +1602,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Decode elements in data block */
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblock->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDECODE, NULL, "can't decode extensible array data elements")
image += (udata->nelmts * udata->hdr->cparam.raw_elmt_size);
} /* end if */
@@ -1560,14 +1625,15 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblock;
- CATCH
+done:
/* Release resources */
if (!ret_value)
if (dblock && H5EA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array data block")
-END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5EA__cache_dblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_image_len
@@ -1581,12 +1647,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(image_len);
@@ -1597,7 +1664,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = (size_t)H5EA_DBLOCK_PREFIX_SIZE(dblock);
-END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_serialize
@@ -1611,14 +1679,15 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* check arguments */
HDassert(f);
@@ -1651,7 +1720,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((dblock->hdr->cparam.cls->encode)(image, dblock->elmts, dblock->nelmts, dblock->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTENCODE, FAIL, "can't encode extensible array data elements")
image += (dblock->nelmts * dblock->hdr->cparam.raw_elmt_size);
} /* end if */
@@ -1664,9 +1733,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_notify
@@ -1680,11 +1749,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(dblock);
@@ -1695,17 +1766,17 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on parent */
if (H5EA__create_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(H5E_CANTDEPEND,
- "unable to create flush dependency between data block and parent, address = %llu",
- (unsigned long long)dblock->addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEPEND, FAIL,
+ "unable to create flush dependency between data block and parent, address = %llu",
+ (unsigned long long)dblock->addr)
break;
case H5AC_NOTIFY_ACTION_AFTER_FLUSH:
/* Destroy flush dependency on extensible array header, if set */
if (dblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between direct block and header, address = %llu",
(unsigned long long)dblock->addr)
dblock->has_hdr_depend = FALSE;
@@ -1715,15 +1786,16 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on parent */
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block and parent, address = %llu",
- (unsigned long long)dblock->addr)
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block and parent, address = %llu",
+ (unsigned long long)dblock->addr)
/* Destroy flush dependency on extensible array header, if set */
if (dblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between data block and header, address = %llu",
(unsigned long long)dblock->addr)
dblock->has_hdr_depend = FALSE;
@@ -1732,8 +1804,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Detach from 'top' proxy for extensible array */
if (dblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblock->top_proxy, dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block and "
+ "extensible array 'top' proxy")
dblock->top_proxy = NULL;
} /* end if */
break;
@@ -1749,15 +1822,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_free_icr
@@ -1772,18 +1845,23 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_dblock_free_icr(void *thing))
+static herr_t
+H5EA__cache_dblock_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array data block */
if (H5EA__dblock_dest((H5EA_dblock_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array data block")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_fsf_size
@@ -1814,12 +1892,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)
+{
const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
@@ -1828,7 +1907,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
*fsf_size = dblock->size;
-END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblock_fsf_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_get_initial_load_size
@@ -1842,12 +1922,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_dblk_page_cache_ud_t *udata = (H5EA_dblk_page_cache_ud_t *)_udata; /* User data */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -1856,7 +1937,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_DBLK_PAGE_SIZE(udata->hdr);
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblk_page_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_verify_chksum
@@ -1871,13 +1953,15 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1888,7 +1972,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_deserialize
@@ -1903,16 +1988,17 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_dblk_page_t * dblk_page = NULL; /* Data block page info */
H5EA_dblk_page_cache_ud_t *udata =
(H5EA_dblk_page_cache_ud_t *)_udata; /* User data for loading data block page */
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(udata);
@@ -1922,7 +2008,8 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array data block page */
if (NULL == (dblk_page = H5EA__dblk_page_alloc(udata->hdr, udata->parent)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block page")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array data block page")
/* Set the extensible array data block page's information */
dblk_page->addr = udata->dblk_page_addr;
@@ -1933,7 +2020,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblk_page->elmts, udata->hdr->dblk_page_nelmts,
udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDECODE, NULL, "can't decode extensible array data elements")
image += (udata->hdr->dblk_page_nelmts * udata->hdr->cparam.raw_elmt_size);
/* Sanity check */
@@ -1954,14 +2041,13 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblk_page;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (dblk_page && H5EA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block page")
-
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array data block page")
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_image_len
@@ -1975,12 +2061,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_dblk_page_t *dblk_page = (const H5EA_dblk_page_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblk_page);
HDassert(image_len);
@@ -1988,7 +2075,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = dblk_page->size;
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblk_page_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_serialize
@@ -2002,14 +2090,16 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image,
- size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len,
+ void *_thing)
+{
H5EA_dblk_page_t *dblk_page = (H5EA_dblk_page_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(f);
@@ -2024,7 +2114,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((dblk_page->hdr->cparam.cls->encode)(image, dblk_page->elmts, dblk_page->hdr->dblk_page_nelmts,
dblk_page->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTENCODE, FAIL, "can't encode extensible array data elements")
image += (dblk_page->hdr->dblk_page_nelmts * dblk_page->hdr->cparam.raw_elmt_size);
/* Compute metadata checksum */
@@ -2036,9 +2126,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_notify
@@ -2052,11 +2142,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing)
+{
H5EA_dblk_page_t *dblk_page = (H5EA_dblk_page_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(dblk_page);
@@ -2067,8 +2159,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on parent */
if (H5EA__create_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between data block page and parent, address = %llu",
(unsigned long long)dblk_page->addr)
break;
@@ -2077,10 +2169,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on extensible array header, if set */
if (dblk_page->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->hdr, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block page and header, "
- "address = %llu",
- (unsigned long long)dblk_page->addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page and header, "
+ "address = %llu",
+ (unsigned long long)dblk_page->addr)
dblk_page->has_hdr_depend = FALSE;
} /* end if */
break;
@@ -2088,27 +2180,27 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on parent */
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between data block page and parent, address = %llu",
(unsigned long long)dblk_page->addr)
/* Destroy flush dependency on extensible array header, if set */
if (dblk_page->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->hdr, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block page and header, "
- "address = %llu",
- (unsigned long long)dblk_page->addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page and header, "
+ "address = %llu",
+ (unsigned long long)dblk_page->addr)
dblk_page->has_hdr_depend = FALSE;
} /* end if */
/* Detach from 'top' proxy for extensible array */
if (dblk_page->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblk_page->top_proxy, dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block page and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page and "
+ "extensible array 'top' proxy")
dblk_page->top_proxy = NULL;
} /* end if */
break;
@@ -2124,15 +2216,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_free_icr
@@ -2147,15 +2239,20 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_dblk_page_free_icr(void *thing))
+static herr_t
+H5EA__cache_dblk_page_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array data block page */
if (H5EA__dblk_page_dest((H5EA_dblk_page_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array data block page")
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array data block page")
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_free_icr() */
diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c
index 72d2f38..b0e564c 100644
--- a/src/H5EAdbg.c
+++ b/src/H5EAdbg.c
@@ -79,13 +79,16 @@
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5EA_class_t *cls, haddr_t obj_addr))
-
+herr_t
+H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls,
+ haddr_t obj_addr)
+{
/* Local variables */
- H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
- void * dbg_ctx = NULL; /* Extensible array debugging context */
+ H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
+ void * dbg_ctx = NULL; /* Extensible array debugging context */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -100,11 +103,11 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (cls->crt_dbg_ctx)
/* Create debugging context */
if (NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "unable to create fixed array debugging context")
/* Load the extensible array header */
if (NULL == (hdr = H5EA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to load extensible array header")
/* Print opening message */
HDfprintf(stream, "%*sExtensible Array Header...\n", indent, "");
@@ -137,13 +140,14 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Index Block Address:", hdr->idx_blk_addr);
- CATCH
+done:
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context")
if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array header")
-END_FUNC(PKG) /* end H5EA__hdr_debug() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_debug() */
/*-------------------------------------------------------------------------
* Function: H5EA__iblock_debug
@@ -157,14 +161,17 @@ END_FUNC(PKG) /* end H5EA__hdr_debug() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth,
- const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr))
-
+herr_t
+H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth,
+ const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr)
+{
/* Local variables */
- H5EA_hdr_t * hdr = NULL; /* Shared extensible array header */
- H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
- void * dbg_ctx = NULL; /* Extensible array context */
+ H5EA_hdr_t * hdr = NULL; /* Shared extensible array header */
+ H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
+ void * dbg_ctx = NULL; /* Extensible array context */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -180,19 +187,20 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (cls->crt_dbg_ctx)
/* Create debugging context */
if (NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "unable to create extensible array debugging context")
/* Load the extensible array header */
if (NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to load extensible array header")
/* Sanity check */
HDassert(H5F_addr_eq(hdr->idx_blk_addr, addr));
/* Protect index block */
if (NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu",
- (unsigned long long)hdr->idx_blk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array index block, address = %llu",
+ (unsigned long long)hdr->idx_blk_addr)
/* Print opening message */
HDfprintf(stream, "%*sExtensible Array Index Block...\n", indent, "");
@@ -216,7 +224,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if ((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u,
((uint8_t *)iblock->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) <
0)
- H5E_THROW(H5E_CANTGET, "can't get element for debugging")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "can't get element for debugging")
} /* end for */
} /* end if */
@@ -250,15 +258,16 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
} /* end for */
} /* end if */
- CATCH
+done:
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context")
if (iblock && H5EA__iblock_unprotect(iblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array index block")
if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array header")
-END_FUNC(PKG) /* end H5EA__iblock_debug() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__iblock_debug() */
/*-------------------------------------------------------------------------
* Function: H5EA__sblock_debug
@@ -272,14 +281,17 @@ END_FUNC(PKG) /* end H5EA__iblock_debug() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5EA_class_t *cls, haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr))
-
+herr_t
+H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls,
+ haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr)
+{
/* Local variables */
- H5EA_hdr_t * hdr = NULL; /* Shared extensible array header */
- H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
- void * dbg_ctx = NULL; /* Extensible array context */
+ H5EA_hdr_t * hdr = NULL; /* Shared extensible array header */
+ H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
+ void * dbg_ctx = NULL; /* Extensible array context */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -295,18 +307,19 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (cls->crt_dbg_ctx)
/* Create debugging context */
if (NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "unable to create extensible array debugging context")
/* Load the extensible array header */
if (NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to load extensible array header")
/* Protect super block */
/* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */
if (NULL ==
(sblock = H5EA__sblock_protect(hdr, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu",
- (unsigned long long)addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array super block, address = %llu",
+ (unsigned long long)addr)
/* Print opening message */
HDfprintf(stream, "%*sExtensible Array Super Block...\n", indent, "");
@@ -334,15 +347,16 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
} /* end for */
} /* end if */
- CATCH
+done:
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context")
if (sblock && H5EA__sblock_unprotect(sblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array super block")
if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array header")
-END_FUNC(PKG) /* end H5EA__sblock_debug() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__sblock_debug() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblock_debug
@@ -356,16 +370,18 @@ END_FUNC(PKG) /* end H5EA__sblock_debug() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5EA_class_t *cls, haddr_t hdr_addr, size_t dblk_nelmts,
- haddr_t obj_addr))
-
+herr_t
+H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls,
+ haddr_t hdr_addr, size_t dblk_nelmts, haddr_t obj_addr)
+{
/* Local variables */
- H5EA_hdr_t * hdr = NULL; /* Shared extensible array header */
- H5EA_dblock_t *dblock = NULL; /* Extensible array data block */
- void * dbg_ctx = NULL; /* Extensible array context */
- size_t u; /* Local index variable */
+ H5EA_hdr_t * hdr = NULL; /* Shared extensible array header */
+ H5EA_dblock_t *dblock = NULL; /* Extensible array data block */
+ void * dbg_ctx = NULL; /* Extensible array context */
+ size_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -382,17 +398,17 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (cls->crt_dbg_ctx)
/* Create debugging context */
if (NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "unable to create extensible array debugging context")
/* Load the extensible array header */
if (NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to load extensible array header")
/* Protect data block */
/* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */
if (NULL == (dblock = H5EA__dblock_protect(hdr, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %" PRIuHADDR,
- addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array data block, address = %" PRIuHADDR, addr)
/* Print opening message */
HDfprintf(stream, "%*sExtensible Array data Block...\n", indent, "");
@@ -407,15 +423,16 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Call the class's 'debug' callback */
if ((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u,
((uint8_t *)dblock->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0)
- H5E_THROW(H5E_CANTGET, "can't get element for debugging")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "can't get element for debugging")
} /* end for */
- CATCH
+done:
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context")
if (dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array data block")
if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array header")
-END_FUNC(PKG) /* end H5EA__dblock_debug() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblock_debug() */
diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c
index b42599c..c0a92f0 100644
--- a/src/H5EAdblkpage.c
+++ b/src/H5EAdblkpage.c
@@ -84,22 +84,25 @@ H5FL_DEFINE_STATIC(H5EA_dblk_page_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_dblk_page_t *, NULL, NULL,
- H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *parent))
-
- /* Local variables */
+H5EA_dblk_page_t *
+H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *parent)
+{
H5EA_dblk_page_t *dblk_page = NULL; /* Extensible array data block page */
+ H5EA_dblk_page_t *ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
/* Allocate memory for the data block */
if (NULL == (dblk_page = H5FL_CALLOC(H5EA_dblk_page_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block page")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array data block page")
/* Share common array information */
if (H5EA__hdr_incr(hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
dblk_page->hdr = hdr;
/* Set non-zero internal fields */
@@ -107,17 +110,19 @@ BEGIN_FUNC(PKG, ERR, H5EA_dblk_page_t *, NULL, NULL,
/* Allocate buffer for elements in data block page */
if (NULL == (dblk_page->elmts = H5EA__hdr_alloc_elmts(hdr, hdr->dblk_page_nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for data block page element buffer")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for data block page element buffer")
/* Set the return value */
ret_value = dblk_page;
- CATCH
+done:
if (!ret_value)
if (dblk_page && H5EA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block page")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array data block page")
-END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblk_page_alloc() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblk_page_create
@@ -131,19 +136,22 @@ END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr))
-
- /* Local variables */
+herr_t
+H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr)
+{
H5EA_dblk_page_t *dblk_page = NULL; /* Extensible array data block page */
hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
/* Allocate the data block page */
if (NULL == (dblk_page = H5EA__dblk_page_alloc(hdr, parent)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block page")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, FAIL,
+ "memory allocation failed for extensible array data block page")
/* Set info about data block page on disk */
dblk_page->addr = addr;
@@ -151,34 +159,39 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Clear any elements in data block page to fill value */
if ((hdr->cparam.cls->fill)(dblk_page->elmts, (size_t)hdr->dblk_page_nelmts) < 0)
- H5E_THROW(H5E_CANTSET, "can't set extensible array data block page elements to class's fill value")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, FAIL,
+ "can't set extensible array data block page elements to class's fill value")
/* Cache the new extensible array data block page */
if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add extensible array data block page to cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, FAIL, "can't add extensible array data block page to cache")
inserted = TRUE;
/* Add data block page as child of 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, FAIL,
+ "unable to add extensible array entry as child of array proxy")
dblk_page->top_proxy = hdr->top_proxy;
} /* end if */
- CATCH
+done:
if (ret_value < 0)
if (dblk_page) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(dblk_page) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array data block page from cache")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTREMOVE, FAIL,
+ "unable to remove extensible array data block page from cache")
/* Destroy data block page */
if (H5EA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block page")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL,
+ "unable to destroy extensible array data block page")
} /* end if */
-END_FUNC(PKG) /* end H5EA__dblk_page_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblk_page_create() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblk_page_protect
@@ -193,13 +206,14 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_dblk_page_t *, NULL, NULL,
- H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr,
- unsigned flags))
-
- /* Local variables */
+H5EA_dblk_page_t *
+H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags)
+{
H5EA_dblk_page_t * dblk_page = NULL; /* Extensible array data block page */
H5EA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */
+ H5EA_dblk_page_t * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -216,32 +230,34 @@ BEGIN_FUNC(PKG, ERR, H5EA_dblk_page_t *, NULL, NULL,
/* Protect the data block page */
if (NULL == (dblk_page = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr,
&udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu",
- (unsigned long long)dblk_page_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, NULL,
+ "unable to protect extensible array data block page, address = %llu",
+ (unsigned long long)dblk_page_addr)
/* Create top proxy, if it doesn't exist */
if (hdr->top_proxy && NULL == dblk_page->top_proxy) {
/* Add data block page as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, NULL,
+ "unable to add extensible array entry as child of array proxy")
dblk_page->top_proxy = hdr->top_proxy;
} /* end if */
/* Set return value */
ret_value = dblk_page;
- CATCH
+done:
/* Clean up on error */
if (!ret_value) {
/* Release the data block page, if it was protected */
if (dblk_page &&
H5AC_unprotect(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT,
- "unable to unprotect extensible array data block page, address = %llu",
- (unsigned long long)dblk_page->addr)
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, NULL,
+ "unable to unprotect extensible array data block page, address = %llu",
+ (unsigned long long)dblk_page->addr)
} /* end if */
-
-END_FUNC(PKG) /* end H5EA__dblk_page_protect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblk_page_protect() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblk_page_unprotect
@@ -256,22 +272,25 @@ END_FUNC(PKG) /* end H5EA__dblk_page_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, unsigned cache_flags))
+herr_t
+H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(dblk_page);
/* Unprotect the data block page */
if (H5AC_unprotect(dblk_page->hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block page, address = %llu",
- (unsigned long long)dblk_page->addr)
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect extensible array data block page, address = %llu",
+ (unsigned long long)dblk_page->addr)
-END_FUNC(PKG) /* end H5EA__dblk_page_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblk_page_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblk_page_dest
@@ -285,7 +304,12 @@ END_FUNC(PKG) /* end H5EA__dblk_page_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__dblk_page_dest(H5EA_dblk_page_t *dblk_page))
+herr_t
+H5EA__dblk_page_dest(H5EA_dblk_page_t *dblk_page)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(dblk_page);
@@ -297,13 +321,15 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__dblk_page_dest(H5EA_dblk_page_
if (dblk_page->elmts) {
/* Free buffer for data block page elements */
if (H5EA__hdr_free_elmts(dblk_page->hdr, dblk_page->hdr->dblk_page_nelmts, dblk_page->elmts) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to free extensible array data block element buffer")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL,
+ "unable to free extensible array data block element buffer")
dblk_page->elmts = NULL;
} /* end if */
/* Decrement reference count on shared info */
if (H5EA__hdr_decr(dblk_page->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
dblk_page->hdr = NULL;
} /* end if */
@@ -313,6 +339,6 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__dblk_page_dest(H5EA_dblk_page_
/* Free the data block page itself */
dblk_page = H5FL_FREE(H5EA_dblk_page_t, dblk_page);
- CATCH
-
-END_FUNC(PKG) /* end H5EA__dblk_page_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblk_page_dest() */
diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c
index 45696c7..f17aae3 100644
--- a/src/H5EAdblock.c
+++ b/src/H5EAdblock.c
@@ -85,11 +85,13 @@ H5FL_DEFINE_STATIC(H5EA_dblock_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL,
- H5EA__dblock_alloc(H5EA_hdr_t *hdr, void *parent, size_t nelmts))
+H5EA_dblock_t *
+H5EA__dblock_alloc(H5EA_hdr_t *hdr, void *parent, size_t nelmts)
+{
+ H5EA_dblock_t *dblock = NULL; /* Extensible array data block */
+ H5EA_dblock_t *ret_value = NULL;
- /* Local variables */
- H5EA_dblock_t *dblock = NULL; /* Extensible array data block */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
@@ -98,11 +100,12 @@ BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL,
/* Allocate memory for the data block */
if (NULL == (dblock = H5FL_CALLOC(H5EA_dblock_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array data block")
/* Share common array information */
if (H5EA__hdr_incr(hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
dblock->hdr = hdr;
/* Set non-zero internal fields */
@@ -118,18 +121,20 @@ BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL,
else {
/* Allocate buffer for elements in data block */
if (NULL == (dblock->elmts = H5EA__hdr_alloc_elmts(hdr, nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for data block element buffer")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for data block element buffer")
} /* end else */
/* Set the return value */
ret_value = dblock;
- CATCH
+done:
if (!ret_value)
if (dblock && H5EA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array data block")
-END_FUNC(PKG) /* end H5EA__dblock_alloc() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblock_alloc() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblock_create
@@ -143,14 +148,15 @@ END_FUNC(PKG) /* end H5EA__dblock_alloc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
- H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize_t dblk_off,
- size_t nelmts))
+haddr_t
+H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize_t dblk_off, size_t nelmts)
+{
+ H5EA_dblock_t *dblock = NULL; /* Extensible array data block */
+ haddr_t dblock_addr; /* Extensible array data block address */
+ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ haddr_t ret_value = HADDR_UNDEF;
- /* Local variables */
- H5EA_dblock_t *dblock = NULL; /* Extensible array data block */
- haddr_t dblock_addr; /* Extensible array data block address */
- hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -159,7 +165,8 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Allocate the data block */
if (NULL == (dblock = H5EA__dblock_alloc(hdr, parent, nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "memory allocation failed for extensible array data block")
/* Set size of data block on disk */
dblock->size = H5EA_DBLOCK_SIZE(dblock);
@@ -169,24 +176,27 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Allocate space for the data block on disk */
if (HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_DBLOCK, (hsize_t)dblock->size)))
- H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "file allocation failed for extensible array data block")
dblock->addr = dblock_addr;
/* Don't initialize elements if paged */
if (!dblock->npages)
/* Clear any elements in data block to fill value */
if ((hdr->cparam.cls->fill)(dblock->elmts, (size_t)dblock->nelmts) < 0)
- H5E_THROW(H5E_CANTSET, "can't set extensible array data block elements to class's fill value")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "can't set extensible array data block elements to class's fill value")
/* Cache the new extensible array data block */
if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add extensible array data block to cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add extensible array data block to cache")
inserted = TRUE;
/* Add data block as child of 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "unable to add extensible array entry as child of array proxy")
dblock->top_proxy = hdr->top_proxy;
} /* end if */
@@ -203,25 +213,29 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Set address of data block to return */
ret_value = dblock_addr;
- CATCH
+done:
if (!H5F_addr_defined(ret_value))
if (dblock) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(dblock) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array data block from cache")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTREMOVE, HADDR_UNDEF,
+ "unable to remove extensible array data block from cache")
/* Release data block's disk space */
if (H5F_addr_defined(dblock->addr) &&
H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_DBLOCK, dblock->addr, (hsize_t)dblock->size) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to release extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF,
+ "unable to release extensible array data block")
/* Destroy data block */
if (H5EA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF,
+ "unable to destroy extensible array data block")
} /* end if */
-END_FUNC(PKG) /* end H5EA__dblock_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblock_create() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblock_sblk_idx
@@ -236,10 +250,12 @@ END_FUNC(PKG) /* end H5EA__dblock_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, unsigned, 0, -, H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx))
+unsigned
+H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx)
+{
+ unsigned sblk_idx = 0; /* Which superblock does this index fall in? */
- /* Local variables */
- unsigned sblk_idx; /* Which superblock does this index fall in? */
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(hdr);
@@ -252,10 +268,8 @@ BEGIN_FUNC(PKG, NOERR, unsigned, 0, -, H5EA__dblock_sblk_idx(const H5EA_hdr_t *h
H5_CHECK_OVERFLOW(idx, /*From:*/ hsize_t, /*To:*/ uint64_t);
sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1));
- /* Set return value */
- ret_value = sblk_idx;
-
-END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */
+ FUNC_LEAVE_NOAPI(sblk_idx)
+} /* end H5EA__dblock_sblk_idx() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblock_protect
@@ -269,13 +283,14 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL,
- H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t dblk_nelmts,
- unsigned flags))
-
- /* Local variables */
+H5EA_dblock_t *
+H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags)
+{
H5EA_dblock_t * dblock; /* Extensible array data block */
H5EA_dblock_cache_ud_t udata; /* Information needed for loading data block */
+ H5EA_dblock_t * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -294,32 +309,36 @@ BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL,
/* Protect the data block */
if (NULL ==
(dblock = (H5EA_dblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_DBLOCK, dblk_addr, &udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu",
- (unsigned long long)dblk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, NULL,
+ "unable to protect extensible array data block, address = %llu",
+ (unsigned long long)dblk_addr)
/* Create top proxy, if it doesn't exist */
if (hdr->top_proxy && NULL == dblock->top_proxy) {
/* Add data block as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, NULL,
+ "unable to add extensible array entry as child of array proxy")
dblock->top_proxy = hdr->top_proxy;
- } /* end if */
+ }
/* Set return value */
ret_value = dblock;
- CATCH
+done:
/* Clean up on error */
if (!ret_value) {
/* Release the data block, if it was protected */
if (dblock &&
H5AC_unprotect(hdr->f, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu",
- (unsigned long long)dblock->addr)
- } /* end if */
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, NULL,
+ "unable to unprotect extensible array data block, address = %llu",
+ (unsigned long long)dblock->addr)
+ }
-END_FUNC(PKG) /* end H5EA__dblock_protect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblock_protect() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblock_unprotect
@@ -333,22 +352,26 @@ END_FUNC(PKG) /* end H5EA__dblock_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__dblock_unprotect(H5EA_dblock_t *dblock, unsigned cache_flags))
+herr_t
+H5EA__dblock_unprotect(H5EA_dblock_t *dblock, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(dblock);
/* Unprotect the data block */
if (H5AC_unprotect(dblock->hdr->f, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu",
- (unsigned long long)dblock->addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect extensible array data block, address = %llu",
+ (unsigned long long)dblock->addr)
- CATCH
+done:
-END_FUNC(PKG) /* end H5EA__dblock_unprotect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblock_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblock_delete
@@ -362,11 +385,13 @@ END_FUNC(PKG) /* end H5EA__dblock_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__dblock_delete(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t dblk_nelmts))
+herr_t
+H5EA__dblock_delete(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t dblk_nelmts)
+{
+ H5EA_dblock_t *dblock = NULL; /* Pointer to data block */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_dblock_t *dblock = NULL; /* Pointer to data block */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -376,8 +401,9 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Protect data block */
if (NULL == (dblock = H5EA__dblock_protect(hdr, parent, dblk_addr, dblk_nelmts, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu",
- (unsigned long long)dblk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array data block, address = %llu",
+ (unsigned long long)dblk_addr)
/* Check if this is a paged data block */
if (dblk_nelmts > hdr->dblk_page_nelmts) {
@@ -395,20 +421,22 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Evict the data block page from the metadata cache */
/* (OK to call if it doesn't exist in the cache) */
if (H5AC_expunge_entry(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTEXPUNGE, "unable to remove array data block page from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTEXPUNGE, FAIL,
+ "unable to remove array data block page from metadata cache")
/* Advance to next page address */
dblk_page_addr += dblk_page_size;
} /* end for */
} /* end if */
- CATCH
+done:
/* Finished deleting data block in metadata cache */
if (dblock && H5EA__dblock_unprotect(dblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG |
H5AC__FREE_FILE_SPACE_FLAG) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array data block")
-END_FUNC(PKG) /* end H5EA__dblock_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblock_delete() */
/*-------------------------------------------------------------------------
* Function: H5EA__dblock_dest
@@ -422,7 +450,12 @@ END_FUNC(PKG) /* end H5EA__dblock_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__dblock_dest(H5EA_dblock_t *dblock))
+herr_t
+H5EA__dblock_dest(H5EA_dblock_t *dblock)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(dblock);
@@ -435,14 +468,16 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__dblock_dest(H5EA_dblock_t *dbl
/* Free buffer for data block elements */
HDassert(dblock->nelmts > 0);
if (H5EA__hdr_free_elmts(dblock->hdr, dblock->nelmts, dblock->elmts) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to free extensible array data block element buffer")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL,
+ "unable to free extensible array data block element buffer")
dblock->elmts = NULL;
dblock->nelmts = 0;
} /* end if */
/* Decrement reference count on shared info */
if (H5EA__hdr_decr(dblock->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
dblock->hdr = NULL;
} /* end if */
@@ -452,6 +487,6 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__dblock_dest(H5EA_dblock_t *dbl
/* Free the data block itself */
dblock = H5FL_FREE(H5EA_dblock_t, dblock);
- CATCH
-
-END_FUNC(PKG) /* end H5EA__dblock_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__dblock_dest() */
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index 7f142af..2c68949 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -102,17 +102,21 @@ H5FL_SEQ_DEFINE_STATIC(H5EA_sblk_info_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL, H5EA__hdr_alloc(H5F_t *f))
+H5EA_hdr_t *
+H5EA__hdr_alloc(H5F_t *f)
+{
+ H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
+ H5EA_hdr_t *ret_value = NULL;
- /* Local variables */
- H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
/* Allocate space for the shared information */
if (NULL == (hdr = H5FL_CALLOC(H5EA_hdr_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array shared header")
/* Set non-zero internal fields */
hdr->addr = HADDR_UNDEF;
@@ -126,12 +130,13 @@ BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL, H5EA__hdr_alloc(H5F_t *f))
/* Set the return value */
ret_value = hdr;
- CATCH
+done:
if (!ret_value)
if (hdr && H5EA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array header")
-END_FUNC(PKG) /* end H5EA__hdr_alloc() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_alloc() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_init
@@ -168,12 +173,15 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata))
-
- /* Local variables */
+herr_t
+H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata)
+{
hsize_t start_idx; /* First element index for each super block */
hsize_t start_dblk; /* First data block index for each super block */
size_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -188,7 +196,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_init(H5EA_hdr_t *hdr, void
/* Allocate information for each super block */
if (NULL == (hdr->sblk_info = H5FL_SEQ_MALLOC(H5EA_sblk_info_t, hdr->nsblks)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for super block info array")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, FAIL, "memory allocation failed for super block info array")
/* Compute information about each super block */
start_idx = 0;
@@ -202,7 +210,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_init(H5EA_hdr_t *hdr, void
/* Advance starting indices for next super block */
start_idx += (hsize_t)hdr->sblk_info[u].ndblks * (hsize_t)hdr->sblk_info[u].dblk_nelmts;
start_dblk += (hsize_t)hdr->sblk_info[u].ndblks;
- } /* end for */
+ }
/* Set size of header on disk (locally and in statistics) */
hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE_HDR(hdr);
@@ -210,12 +218,13 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_init(H5EA_hdr_t *hdr, void
/* Create the callback context, if there's one */
if (hdr->cparam.cls->crt_context) {
if (NULL == (hdr->cb_ctx = (*hdr->cparam.cls->crt_context)(ctx_udata)))
- H5E_THROW(H5E_CANTCREATE, "unable to create extensible array client callback context")
- } /* end if */
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, FAIL,
+ "unable to create extensible array client callback context")
+ }
-END_FUNC(PKG) /* end H5EA__hdr_init() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_init() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_alloc_elmts
@@ -229,11 +238,14 @@ END_FUNC(PKG) /* end H5EA__hdr_init() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, void *, NULL, NULL, H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts))
-
- /* Local variables */
+void *
+H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)
+{
void * elmts = NULL; /* Element buffer allocated */
unsigned idx; /* Index of element buffer factory in header */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
@@ -251,8 +263,8 @@ BEGIN_FUNC(PKG, ERR, void *, NULL, NULL, H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr,
/* Re-allocate array of element factories */
if (NULL == (new_fac = H5FL_SEQ_REALLOC(H5FL_fac_head_ptr_t, hdr->elmt_fac.fac, new_nalloc)))
- H5E_THROW(H5E_CANTALLOC,
- "memory allocation failed for data block data element buffer factory array")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for data block data element buffer factory array")
/* Zero out new elements allocated */
HDmemset(new_fac + hdr->elmt_fac.nalloc, 0,
@@ -266,22 +278,24 @@ BEGIN_FUNC(PKG, ERR, void *, NULL, NULL, H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr,
/* Check for un-initialized factory at index */
if (NULL == hdr->elmt_fac.fac[idx]) {
if (NULL == (hdr->elmt_fac.fac[idx] = H5FL_fac_init(nelmts * (size_t)hdr->cparam.cls->nat_elmt_size)))
- H5E_THROW(H5E_CANTINIT, "can't create data block data element buffer factory")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "can't create data block data element buffer factory")
} /* end if */
/* Allocate buffer for elements in index block */
if (NULL == (elmts = H5FL_FAC_MALLOC(hdr->elmt_fac.fac[idx])))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for data block data element buffer")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for data block data element buffer")
/* Set the return value */
ret_value = elmts;
- CATCH
+done:
if (!ret_value)
if (elmts)
elmts = H5FL_FAC_FREE(hdr->elmt_fac.fac[idx], elmts);
-END_FUNC(PKG) /* end H5EA__hdr_alloc_elmts() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_alloc_elmts() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_free_elmts
@@ -295,11 +309,13 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc_elmts() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts))
-
- /* Local variables */
+herr_t
+H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts)
+{
unsigned idx; /* Index of element buffer factory in header */
+ FUNC_ENTER_PACKAGE_NOERR
+
/* Check arguments */
HDassert(hdr);
HDassert(nelmts > 0);
@@ -314,26 +330,30 @@ BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5EA__hdr_free_elmts(H5EA_hdr_t *hdr,
HDassert(hdr->elmt_fac.fac[idx]);
elmts = H5FL_FAC_FREE(hdr->elmt_fac.fac[idx], elmts);
-END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__hdr_free_elmts() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_create
*
* Purpose: Creates a new extensible array header in the file
*
- * Return: SUCCEED/FAIL
+ * Return: Success: Address of new header in the file
+ * Failure: HADDR_UNDEF
*
* Programmer: Quincey Koziol
* Jun 17 2008
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
- H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata))
+haddr_t
+H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata)
+{
+ H5EA_hdr_t *hdr = NULL; /* Extensible array header */
+ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ haddr_t ret_value = HADDR_UNDEF;
- /* Local variables */
- H5EA_hdr_t *hdr = NULL; /* Extensible array header */
- hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -347,39 +367,45 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Check for valid parameters */
if (cparam->raw_elmt_size == 0)
- H5E_THROW(H5E_BADVALUE, "element size must be greater than zero")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF, "element size must be greater than zero")
if (cparam->max_nelmts_bits == 0)
- H5E_THROW(H5E_BADVALUE, "max. # of elements bits must be greater than zero")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "max. # of elements bits must be greater than zero")
if (cparam->max_nelmts_bits > H5EA_MAX_NELMTS_IDX_MAX)
- H5E_THROW(H5E_BADVALUE, "max. # of elements bits must be <= %u",
- (unsigned)H5EA_MAX_NELMTS_IDX_MAX)
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF, "max. # of elements bits must be <= %u",
+ (unsigned)H5EA_MAX_NELMTS_IDX_MAX)
if (cparam->sup_blk_min_data_ptrs < 2)
- H5E_THROW(H5E_BADVALUE, "min # of data block pointers in super block must be >= two")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "min # of data block pointers in super block must be >= two")
if (!POWER_OF_TWO(cparam->sup_blk_min_data_ptrs))
- H5E_THROW(H5E_BADVALUE, "min # of data block pointers in super block must be power of two")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "min # of data block pointers in super block must be power of two")
if (!POWER_OF_TWO(cparam->data_blk_min_elmts))
- H5E_THROW(H5E_BADVALUE, "min # of elements per data block must be power of two")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "min # of elements per data block must be power of two")
dblk_page_nelmts = (size_t)1 << cparam->max_dblk_page_nelmts_bits;
if (dblk_page_nelmts < cparam->idx_blk_elmts)
- H5E_THROW(H5E_BADVALUE,
- "# of elements per data block page must be greater than # of elements in index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "# of elements per data block page must be greater than # of elements in index block")
/* Compute the number of elements in data blocks for first actual super block */
sblk_idx = H5EA_SBLK_FIRST_IDX(cparam->sup_blk_min_data_ptrs);
dblk_nelmts = H5EA_SBLK_DBLK_NELMTS(sblk_idx, cparam->data_blk_min_elmts);
if (dblk_page_nelmts < dblk_nelmts)
- H5E_THROW(H5E_BADVALUE, "max. # of elements per data block page bits must be > # of elements in "
- "first data block from super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "max. # of elements per data block page bits must be > # of elements in "
+ "first data block from super block")
if (cparam->max_dblk_page_nelmts_bits > cparam->max_nelmts_bits)
- H5E_THROW(H5E_BADVALUE,
- "max. # of elements per data block page bits must be <= max. # of elements bits")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "max. # of elements per data block page bits must be <= max. # of elements bits")
}
#endif /* NDEBUG */
/* Allocate space for the shared information */
if (NULL == (hdr = H5EA__hdr_alloc(f)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "memory allocation failed for extensible array shared header")
/* Set the internal parameters for the array */
hdr->idx_blk_addr = HADDR_UNDEF;
@@ -389,49 +415,55 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Finish initializing extensible array header */
if (H5EA__hdr_init(hdr, ctx_udata) < 0)
- H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, HADDR_UNDEF,
+ "initialization failed for extensible array header")
/* Allocate space for the header on disk */
if (HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, (hsize_t)hdr->size)))
- H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "file allocation failed for extensible array header")
/* Create 'top' proxy for extensible array entries */
if (hdr->swmr_write)
if (NULL == (hdr->top_proxy = H5AC_proxy_entry_create()))
- H5E_THROW(H5E_CANTCREATE, "can't create extensible array entry proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, HADDR_UNDEF, "can't create extensible array entry proxy")
/* Cache the new extensible array header */
if (H5AC_insert_entry(f, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add extensible array header to cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add extensible array header to cache")
inserted = TRUE;
/* Add header as child of 'top' proxy */
if (hdr->top_proxy)
if (H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "unable to add extensible array entry as child of array proxy")
/* Set address of array header to return */
ret_value = hdr->addr;
- CATCH
+done:
if (!H5F_addr_defined(ret_value))
if (hdr) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(hdr) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array header from cache")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTREMOVE, HADDR_UNDEF,
+ "unable to remove extensible array header from cache")
/* Release header's disk space */
if (H5F_addr_defined(hdr->addr) &&
H5MF_xfree(f, H5FD_MEM_EARRAY_HDR, hdr->addr, (hsize_t)hdr->size) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to free extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF, "unable to free extensible array header")
/* Destroy header */
if (H5EA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF,
+ "unable to destroy extensible array header")
} /* end if */
-END_FUNC(PKG) /* end H5EA__hdr_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_create() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_incr
@@ -445,7 +477,12 @@ END_FUNC(PKG) /* end H5EA__hdr_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_incr(H5EA_hdr_t *hdr))
+herr_t
+H5EA__hdr_incr(H5EA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -453,14 +490,14 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_incr(H5EA_hdr_t *hdr))
/* Mark header as un-evictable when something is depending on it */
if (hdr->rc == 0)
if (H5AC_pin_protected_entry(hdr) < 0)
- H5E_THROW(H5E_CANTPIN, "unable to pin extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPIN, FAIL, "unable to pin extensible array header")
/* Increment reference count on shared header */
hdr->rc++;
- CATCH
-
-END_FUNC(PKG) /* end H5EA__hdr_incr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_incr() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_decr
@@ -474,7 +511,12 @@ END_FUNC(PKG) /* end H5EA__hdr_incr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_decr(H5EA_hdr_t *hdr))
+herr_t
+H5EA__hdr_decr(H5EA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -487,12 +529,12 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_decr(H5EA_hdr_t *hdr))
if (hdr->rc == 0) {
HDassert(hdr->file_rc == 0);
if (H5AC_unpin_entry(hdr) < 0)
- H5E_THROW(H5E_CANTUNPIN, "unable to unpin extensible array header")
- } /* end if */
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPIN, FAIL, "unable to unpin extensible array header")
+ }
-END_FUNC(PKG) /* end H5EA__hdr_decr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_decr() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_fuse_incr
@@ -506,7 +548,10 @@ END_FUNC(PKG) /* end H5EA__hdr_decr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr))
+herr_t
+H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr)
+{
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(hdr);
@@ -514,21 +559,28 @@ BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr))
/* Increment file reference count on shared header */
hdr->file_rc++;
-END_FUNC(PKG) /* end H5EA__hdr_fuse_incr() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__hdr_fuse_incr() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_fuse_decr
*
* Purpose: Decrement file reference count on shared array header
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Success: The reference count of the header
+ * Failure: Can't fail
*
* Programmer: Quincey Koziol
* Aug 26 2008
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, size_t, 0, -, H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr))
+size_t
+H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr)
+{
+ size_t ret_value = 0;
+
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(hdr);
@@ -540,7 +592,8 @@ BEGIN_FUNC(PKG, NOERR, size_t, 0, -, H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr))
/* Set return value */
ret_value = hdr->file_rc;
-END_FUNC(PKG) /* end H5EA__hdr_fuse_decr() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_fuse_decr() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_modified
@@ -554,7 +607,12 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_decr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_modified(H5EA_hdr_t *hdr))
+herr_t
+H5EA__hdr_modified(H5EA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -562,11 +620,11 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_modified(H5EA_hdr_t *hdr))
/* Mark header as dirty in cache */
if (H5AC_mark_entry_dirty(hdr) < 0)
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark extensible array header as dirty")
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTMARKDIRTY, FAIL, "unable to mark extensible array header as dirty")
-END_FUNC(PKG) /* end H5EA__hdr_modified() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_modified() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_protect
@@ -580,12 +638,14 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL,
- H5EA__hdr_protect(H5F_t *f, haddr_t ea_addr, void *ctx_udata, unsigned flags))
-
- /* Local variables */
+H5EA_hdr_t *
+H5EA__hdr_protect(H5F_t *f, haddr_t ea_addr, void *ctx_udata, unsigned flags)
+{
H5EA_hdr_t * hdr; /* Extensible array header */
H5EA_hdr_cache_ud_t udata; /* User data for cache callbacks */
+ H5EA_hdr_t * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(f);
@@ -601,27 +661,28 @@ BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL,
/* Protect the header */
if (NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, H5AC_EARRAY_HDR, ea_addr, &udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu",
- (unsigned long long)ea_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, NULL,
+ "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr)
hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */
/* Create top proxy, if it doesn't exist */
if (hdr->swmr_write && NULL == hdr->top_proxy) {
/* Create 'top' proxy for extensible array entries */
if (NULL == (hdr->top_proxy = H5AC_proxy_entry_create()))
- H5E_THROW(H5E_CANTCREATE, "can't create extensible array entry proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTCREATE, NULL, "can't create extensible array entry proxy")
/* Add header as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, NULL,
+ "unable to add extensible array entry as child of array proxy")
} /* end if */
/* Set return value */
ret_value = hdr;
- CATCH
-
-END_FUNC(PKG) /* end H5EA__hdr_protect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_protect() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_unprotect
@@ -635,21 +696,24 @@ END_FUNC(PKG) /* end H5EA__hdr_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_unprotect(H5EA_hdr_t *hdr, unsigned cache_flags))
+herr_t
+H5EA__hdr_unprotect(H5EA_hdr_t *hdr, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
/* Unprotect the header */
if (H5AC_unprotect(hdr->f, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array hdr, address = %llu",
- (unsigned long long)hdr->addr)
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect extensible array hdr, address = %llu", (unsigned long long)hdr->addr)
-END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_delete
@@ -663,46 +727,48 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_delete(H5EA_hdr_t *hdr))
-
- /* Local variables */
+herr_t
+H5EA__hdr_delete(H5EA_hdr_t *hdr)
+{
unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
HDassert(!hdr->file_rc);
#ifndef NDEBUG
- {
- unsigned hdr_status = 0; /* Array header's status in the metadata cache */
+ unsigned hdr_status = 0; /* Array header's status in the metadata cache */
- /* Check the array header's status in the metadata cache */
- if (H5AC_get_entry_status(hdr->f, hdr->addr, &hdr_status) < 0)
- H5E_THROW(H5E_CANTGET, "unable to check metadata cache status for array header")
+ /* Check the array header's status in the metadata cache */
+ if (H5AC_get_entry_status(hdr->f, hdr->addr, &hdr_status) < 0)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "unable to check metadata cache status for array header")
- /* Sanity checks on array header */
- HDassert(hdr_status & H5AC_ES__IN_CACHE);
- HDassert(hdr_status & H5AC_ES__IS_PROTECTED);
- } /* end block */
+ /* Sanity checks on array header */
+ HDassert(hdr_status & H5AC_ES__IN_CACHE);
+ HDassert(hdr_status & H5AC_ES__IS_PROTECTED);
#endif /* NDEBUG */
/* Check for index block */
if (H5F_addr_defined(hdr->idx_blk_addr)) {
/* Delete index block */
if (H5EA__iblock_delete(hdr) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDELETE, FAIL, "unable to delete extensible array index block")
} /* end if */
/* Set flags to finish deleting header on unprotect */
cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;
- CATCH
+done:
/* Unprotect the header, deleting it if an error hasn't occurred */
if (H5EA__hdr_unprotect(hdr, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array header")
-END_FUNC(PKG) /* end H5EA__hdr_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_delete() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_dest
@@ -716,7 +782,12 @@ END_FUNC(PKG) /* end H5EA__hdr_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_dest(H5EA_hdr_t *hdr))
+herr_t
+H5EA__hdr_dest(H5EA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
@@ -725,7 +796,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_dest(H5EA_hdr_t *hdr))
/* Destroy the callback context */
if (hdr->cb_ctx) {
if ((*hdr->cparam.cls->dst_context)(hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to destroy extensible array client callback context")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL,
+ "unable to destroy extensible array client callback context")
} /* end if */
hdr->cb_ctx = NULL;
@@ -741,7 +813,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_dest(H5EA_hdr_t *hdr))
/* Check if this factory has been initialized */
if (hdr->elmt_fac.fac[u]) {
if (H5FL_fac_term(hdr->elmt_fac.fac[u]) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to destroy extensible array header factory")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL,
+ "unable to destroy extensible array header factory")
hdr->elmt_fac.fac[u] = NULL;
} /* end if */
} /* end for */
@@ -757,13 +830,13 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__hdr_dest(H5EA_hdr_t *hdr))
/* Destroy the 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_dest(hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to destroy extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to destroy extensible array 'top' proxy")
hdr->top_proxy = NULL;
} /* end if */
/* Free the shared info itself */
hdr = H5FL_FREE(H5EA_hdr_t, hdr);
- CATCH
-
-END_FUNC(PKG) /* end H5EA__hdr_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__hdr_dest() */
diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c
index 1ef7980..5afb28a 100644
--- a/src/H5EAiblock.c
+++ b/src/H5EAiblock.c
@@ -91,21 +91,25 @@ H5FL_SEQ_DEFINE_STATIC(haddr_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, H5EA__iblock_alloc(H5EA_hdr_t *hdr))
+H5EA_iblock_t *
+H5EA__iblock_alloc(H5EA_hdr_t *hdr)
+{
+ H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
+ H5EA_iblock_t *ret_value = NULL;
- /* Local variables */
- H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
/* Allocate memory for the index block */
if (NULL == (iblock = H5FL_CALLOC(H5EA_iblock_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array index block")
/* Share common array information */
if (H5EA__hdr_incr(hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
iblock->hdr = hdr;
/* Set non-zero internal fields */
@@ -121,27 +125,30 @@ BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, H5EA__iblock_alloc(H5EA_hdr_t
if (NULL ==
(iblock->elmts = H5FL_BLK_MALLOC(
idx_blk_elmt_buf, (size_t)(hdr->cparam.idx_blk_elmts * hdr->cparam.cls->nat_elmt_size))))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for index block data element buffer")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for index block data element buffer")
/* Allocate buffer for data block addresses in index block */
if (iblock->ndblk_addrs > 0)
if (NULL == (iblock->dblk_addrs = H5FL_SEQ_MALLOC(haddr_t, iblock->ndblk_addrs)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for index block data block addresses")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for index block data block addresses")
/* Allocate buffer for super block addresses in index block */
if (iblock->nsblk_addrs > 0)
if (NULL == (iblock->sblk_addrs = H5FL_SEQ_MALLOC(haddr_t, iblock->nsblk_addrs)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for index block super block addresses")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for index block super block addresses")
/* Set the return value */
ret_value = iblock;
- CATCH
+done:
if (!ret_value)
if (iblock && H5EA__iblock_dest(iblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array index block")
-
-END_FUNC(PKG) /* end H5EA__iblock_alloc() */
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array index block")
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__iblock_alloc() */
/*-------------------------------------------------------------------------
* Function: H5EA__iblock_create
@@ -155,13 +162,15 @@ END_FUNC(PKG) /* end H5EA__iblock_alloc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
- H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed))
+haddr_t
+H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed)
+{
+ H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
+ haddr_t iblock_addr; /* Extensible array index block address */
+ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ haddr_t ret_value = HADDR_UNDEF;
- /* Local variables */
- H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
- haddr_t iblock_addr; /* Extensible array index block address */
- hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -169,21 +178,24 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Allocate the index block */
if (NULL == (iblock = H5EA__iblock_alloc(hdr)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "memory allocation failed for extensible array index block")
/* Set size of index block on disk */
iblock->size = H5EA_IBLOCK_SIZE(iblock);
/* Allocate space for the index block on disk */
if (HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, (hsize_t)iblock->size)))
- H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "file allocation failed for extensible array index block")
iblock->addr = iblock_addr;
/* Clear any elements in index block to fill value */
if (hdr->cparam.idx_blk_elmts > 0) {
/* Call the class's 'fill' callback */
if ((hdr->cparam.cls->fill)(iblock->elmts, (size_t)hdr->cparam.idx_blk_elmts) < 0)
- H5E_THROW(H5E_CANTSET, "can't set extensible array index block elements to class's fill value")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "can't set extensible array index block elements to class's fill value")
} /* end if */
/* Reset any data block addresses in the index block */
@@ -204,13 +216,15 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Cache the new extensible array index block */
if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_IBLOCK, iblock_addr, iblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add extensible array index block to cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF,
+ "can't add extensible array index block to cache")
inserted = TRUE;
/* Add index block as child of 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, iblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "unable to add extensible array entry as child of array proxy")
iblock->top_proxy = hdr->top_proxy;
} /* end if */
@@ -229,25 +243,29 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Set address of index block to return */
ret_value = iblock_addr;
- CATCH
+done:
if (!H5F_addr_defined(ret_value))
if (iblock) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(iblock) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array index block from cache")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTREMOVE, HADDR_UNDEF,
+ "unable to remove extensible array index block from cache")
/* Release index block's disk space */
if (H5F_addr_defined(iblock->addr) &&
H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_IBLOCK, iblock->addr, (hsize_t)iblock->size) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to release file space for extensible array index block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF,
+ "unable to release file space for extensible array index block")
/* Destroy index block */
if (H5EA__iblock_dest(iblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array index block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF,
+ "unable to destroy extensible array index block")
} /* end if */
-END_FUNC(PKG) /* end H5EA__iblock_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__iblock_create() */
/*-------------------------------------------------------------------------
* Function: H5EA__iblock_protect
@@ -261,10 +279,13 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags))
+H5EA_iblock_t *
+H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags)
+{
+ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
+ H5EA_iblock_t *ret_value = NULL;
- /* Local variables */
- H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -275,31 +296,35 @@ BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, H5EA__iblock_protect(H5EA_hdr_
/* Protect the index block */
if (NULL ==
(iblock = (H5EA_iblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, hdr, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu",
- (unsigned long long)hdr->idx_blk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, NULL,
+ "unable to protect extensible array index block, address = %llu",
+ (unsigned long long)hdr->idx_blk_addr)
/* Create top proxy, if it doesn't exist */
if (hdr->top_proxy && NULL == iblock->top_proxy) {
/* Add index block as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, iblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, NULL,
+ "unable to add extensible array entry as child of array proxy")
iblock->top_proxy = hdr->top_proxy;
} /* end if */
/* Set return value */
ret_value = iblock;
- CATCH
+done:
/* Clean up on error */
if (!ret_value) {
/* Release the index block, if it was protected */
if (iblock &&
H5AC_unprotect(hdr->f, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu",
- (unsigned long long)iblock->addr)
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, NULL,
+ "unable to unprotect extensible array index block, address = %llu",
+ (unsigned long long)iblock->addr)
} /* end if */
-END_FUNC(PKG) /* end H5EA__iblock_protect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__iblock_protect() */
/*-------------------------------------------------------------------------
* Function: H5EA__iblock_unprotect
@@ -313,22 +338,25 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags))
+herr_t
+H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(iblock);
/* Unprotect the index block */
if (H5AC_unprotect(iblock->hdr->f, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu",
- (unsigned long long)iblock->addr)
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect extensible array index block, address = %llu",
+ (unsigned long long)iblock->addr)
-END_FUNC(PKG) /* end H5EA__iblock_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__iblock_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5EA__iblock_delete
@@ -342,10 +370,13 @@ END_FUNC(PKG) /* end H5EA__iblock_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_delete(H5EA_hdr_t *hdr))
+herr_t
+H5EA__iblock_delete(H5EA_hdr_t *hdr)
+{
+ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -353,8 +384,9 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_delete(H5EA_hdr_t *hdr)
/* Protect index block */
if (NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu",
- (unsigned long long)hdr->idx_blk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array index block, address = %llu",
+ (unsigned long long)hdr->idx_blk_addr)
/* Check for index block having data block pointers */
if (iblock->ndblk_addrs > 0) {
@@ -370,7 +402,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_delete(H5EA_hdr_t *hdr)
/* Delete data block */
if (H5EA__dblock_delete(hdr, iblock, iblock->dblk_addrs[u],
hdr->sblk_info[sblk_idx].dblk_nelmts) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDELETE, FAIL,
+ "unable to delete extensible array data block")
iblock->dblk_addrs[u] = HADDR_UNDEF;
} /* end if */
@@ -396,19 +429,21 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_delete(H5EA_hdr_t *hdr)
/* Delete super block */
if (H5EA__sblock_delete(hdr, iblock, iblock->sblk_addrs[u], (unsigned)(u + iblock->nsblks)) <
0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDELETE, FAIL,
+ "unable to delete extensible array super block")
iblock->sblk_addrs[u] = HADDR_UNDEF;
- } /* end if */
- } /* end for */
- } /* end if */
+ }
+ }
+ }
- CATCH
+done:
/* Finished deleting index block in metadata cache */
if (iblock && H5EA__iblock_unprotect(iblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG |
H5AC__FREE_FILE_SPACE_FLAG) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array index block")
-END_FUNC(PKG) /* end H5EA__iblock_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__iblock_delete() */
/*-------------------------------------------------------------------------
* Function: H5EA__iblock_dest
@@ -422,7 +457,12 @@ END_FUNC(PKG) /* end H5EA__iblock_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_dest(H5EA_iblock_t *iblock))
+herr_t
+H5EA__iblock_dest(H5EA_iblock_t *iblock)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(iblock);
@@ -454,7 +494,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_dest(H5EA_iblock_t *ibl
/* Decrement reference count on shared info */
if (H5EA__hdr_decr(iblock->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
iblock->hdr = NULL;
} /* end if */
@@ -464,6 +505,6 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_dest(H5EA_iblock_t *ibl
/* Free the index block itself */
iblock = H5FL_FREE(H5EA_iblock_t, iblock);
- CATCH
-
-END_FUNC(PKG) /* end H5EA__iblock_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__iblock_dest() */
diff --git a/src/H5EAint.c b/src/H5EAint.c
index 472cfb4..af7ff4c 100644
--- a/src/H5EAint.c
+++ b/src/H5EAint.c
@@ -79,8 +79,12 @@
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry))
+herr_t
+H5EA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(parent_entry);
@@ -88,11 +92,11 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Create a flush dependency between parent and child entry */
if (H5AC_create_flush_dependency(parent_entry, child_entry) < 0)
- H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency")
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
-END_FUNC(PKG) /* end H5EA__create_flush_depend() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__create_flush_depend() */
/*-------------------------------------------------------------------------
* Function: H5EA__destroy_flush_depend
@@ -106,8 +110,12 @@ END_FUNC(PKG) /* end H5EA__create_flush_depend() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry))
+herr_t
+H5EA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(parent_entry);
@@ -115,8 +123,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Destroy a flush dependency between parent and child entry */
if (H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency")
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
-END_FUNC(PKG) /* end H5EA__destroy_flush_depend() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__destroy_flush_depend() */
diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c
index 8639217..30cb220 100644
--- a/src/H5EAsblock.c
+++ b/src/H5EAsblock.c
@@ -91,22 +91,25 @@ H5FL_BLK_DEFINE(page_init);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL,
- H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx))
+H5EA_sblock_t *
+H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx)
+{
+ H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
+ H5EA_sblock_t *ret_value = NULL;
- /* Local variables */
- H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
/* Allocate memory for the index block */
if (NULL == (sblock = H5FL_CALLOC(H5EA_sblock_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array super block")
/* Share common array information */
if (H5EA__hdr_incr(hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
sblock->hdr = hdr;
/* Set non-zero internal fields */
@@ -121,7 +124,8 @@ BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL,
/* Allocate buffer for data block addresses in super block */
if (NULL == (sblock->dblk_addrs = H5FL_SEQ_MALLOC(haddr_t, sblock->ndblks)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for super block data block addresses")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for super block data block addresses")
/* Check if # of elements in data blocks requires paging */
if (sblock->dblk_nelmts > hdr->dblk_page_nelmts) {
@@ -141,7 +145,8 @@ BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL,
/* Allocate buffer for all 'page init' bitmasks in super block */
if (NULL ==
(sblock->page_init = H5FL_BLK_CALLOC(page_init, sblock->ndblks * sblock->dblk_page_init_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for super block page init bitmask")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for super block page init bitmask")
/* Compute data block page size */
sblock->dblk_page_size = (hdr->dblk_page_nelmts * hdr->cparam.raw_elmt_size) + H5EA_SIZEOF_CHKSUM;
@@ -150,12 +155,13 @@ BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL,
/* Set the return value */
ret_value = sblock;
- CATCH
+done:
if (!ret_value)
if (sblock && H5EA__sblock_dest(sblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array super block")
-END_FUNC(PKG) /* end H5EA__sblock_alloc() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__sblock_alloc() */
/*-------------------------------------------------------------------------
* Function: H5EA__sblock_create
@@ -169,15 +175,16 @@ END_FUNC(PKG) /* end H5EA__sblock_alloc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
- H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_changed,
- unsigned sblk_idx))
+haddr_t
+H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_changed, unsigned sblk_idx)
+{
+ H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
+ haddr_t sblock_addr; /* Extensible array super block address */
+ haddr_t tmp_addr = HADDR_UNDEF; /* Address value to fill data block addresses with */
+ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ haddr_t ret_value = HADDR_UNDEF;
- /* Local variables */
- H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
- haddr_t sblock_addr; /* Extensible array super block address */
- haddr_t tmp_addr = HADDR_UNDEF; /* Address value to fill data block addresses with */
- hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -185,7 +192,8 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Allocate the super block */
if (NULL == (sblock = H5EA__sblock_alloc(hdr, parent, sblk_idx)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "memory allocation failed for extensible array super block")
/* Set size of super block on disk */
sblock->size = H5EA_SBLOCK_SIZE(sblock);
@@ -195,7 +203,8 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Allocate space for the super block on disk */
if (HADDR_UNDEF == (sblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_SBLOCK, (hsize_t)sblock->size)))
- H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "file allocation failed for extensible array super block")
sblock->addr = sblock_addr;
/* Reset data block addresses to "undefined" address value */
@@ -203,13 +212,15 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Cache the new extensible array super block */
if (H5AC_insert_entry(hdr->f, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add extensible array super block to cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINSERT, HADDR_UNDEF,
+ "can't add extensible array super block to cache")
inserted = TRUE;
/* Add super block as child of 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, sblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "unable to add extensible array entry as child of array proxy")
sblock->top_proxy = hdr->top_proxy;
} /* end if */
@@ -223,25 +234,29 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Set address of super block to return */
ret_value = sblock_addr;
- CATCH
+done:
if (!H5F_addr_defined(ret_value))
if (sblock) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(sblock) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array super block from cache")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTREMOVE, HADDR_UNDEF,
+ "unable to remove extensible array super block from cache")
/* Release super block's disk space */
if (H5F_addr_defined(sblock->addr) &&
H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_SBLOCK, sblock->addr, (hsize_t)sblock->size) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to release extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF,
+ "unable to release extensible array super block")
/* Destroy super block */
if (H5EA__sblock_dest(sblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, HADDR_UNDEF,
+ "unable to destroy extensible array super block")
} /* end if */
-END_FUNC(PKG) /* end H5EA__sblock_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__sblock_create() */
/*-------------------------------------------------------------------------
* Function: H5EA__sblock_protect
@@ -255,13 +270,15 @@ END_FUNC(PKG) /* end H5EA__sblock_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL,
- H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx,
- unsigned flags))
-
- /* Local variables */
+H5EA_sblock_t *
+H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx,
+ unsigned flags)
+{
H5EA_sblock_t * sblock = NULL; /* Pointer to super block */
H5EA_sblock_cache_ud_t udata; /* Information needed for loading super block */
+ H5EA_sblock_t * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -279,31 +296,35 @@ BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL,
/* Protect the super block */
if (NULL ==
(sblock = (H5EA_sblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_SBLOCK, sblk_addr, &udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu",
- (unsigned long long)sblk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, NULL,
+ "unable to protect extensible array super block, address = %llu",
+ (unsigned long long)sblk_addr)
/* Create top proxy, if it doesn't exist */
if (hdr->top_proxy && NULL == sblock->top_proxy) {
/* Add super block as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, sblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTSET, NULL,
+ "unable to add extensible array entry as child of array proxy")
sblock->top_proxy = hdr->top_proxy;
- } /* end if */
+ }
/* Set return value */
ret_value = sblock;
- CATCH
+done:
/* Clean up on error */
if (!ret_value) {
/* Release the super block, if it was protected */
if (sblock &&
H5AC_unprotect(hdr->f, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu",
- (unsigned long long)sblock->addr)
- } /* end if */
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, NULL,
+ "unable to unprotect extensible array super block, address = %llu",
+ (unsigned long long)sblock->addr)
+ }
-END_FUNC(PKG) /* end H5EA__sblock_protect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__sblock_protect() */
/*-------------------------------------------------------------------------
* Function: H5EA__sblock_unprotect
@@ -317,22 +338,25 @@ END_FUNC(PKG) /* end H5EA__sblock_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__sblock_unprotect(H5EA_sblock_t *sblock, unsigned cache_flags))
+herr_t
+H5EA__sblock_unprotect(H5EA_sblock_t *sblock, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(sblock);
/* Unprotect the super block */
if (H5AC_unprotect(sblock->hdr->f, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu",
- (unsigned long long)sblock->addr)
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect extensible array super block, address = %llu",
+ (unsigned long long)sblock->addr)
-END_FUNC(PKG) /* end H5EA__sblock_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__sblock_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5EA__sblock_delete
@@ -346,12 +370,14 @@ END_FUNC(PKG) /* end H5EA__sblock_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5EA__sblock_delete(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx))
-
- /* Local variables */
+herr_t
+H5EA__sblock_delete(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx)
+{
H5EA_sblock_t *sblock = NULL; /* Pointer to super block */
size_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -359,8 +385,9 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Protect super block */
if (NULL == (sblock = H5EA__sblock_protect(hdr, parent, sblk_addr, sblk_idx, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu",
- (unsigned long long)sblk_addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect extensible array super block, address = %llu",
+ (unsigned long long)sblk_addr)
/* Iterate over data blocks */
for (u = 0; u < sblock->ndblks; u++) {
@@ -368,18 +395,19 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (H5F_addr_defined(sblock->dblk_addrs[u])) {
/* Delete data block */
if (H5EA__dblock_delete(hdr, sblock, sblock->dblk_addrs[u], sblock->dblk_nelmts) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDELETE, FAIL, "unable to delete extensible array data block")
sblock->dblk_addrs[u] = HADDR_UNDEF;
} /* end if */
} /* end for */
- CATCH
+done:
/* Finished deleting super block in metadata cache */
if (sblock && H5EA__sblock_unprotect(sblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG |
H5AC__FREE_FILE_SPACE_FLAG) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array super block")
-END_FUNC(PKG) /* end H5EA__sblock_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__sblock_delete() */
/*-------------------------------------------------------------------------
* Function: H5EA__sblock_dest
@@ -393,7 +421,12 @@ END_FUNC(PKG) /* end H5EA__sblock_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__sblock_dest(H5EA_sblock_t *sblock))
+herr_t
+H5EA__sblock_dest(H5EA_sblock_t *sblock)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(sblock);
@@ -413,7 +446,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__sblock_dest(H5EA_sblock_t *sbl
/* Decrement reference count on shared info */
if (H5EA__hdr_decr(sblock->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
sblock->hdr = NULL;
} /* end if */
@@ -423,6 +457,6 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__sblock_dest(H5EA_sblock_t *sbl
/* Free the super block itself */
sblock = H5FL_FREE(H5EA_sblock_t, sblock);
- CATCH
-
-END_FUNC(PKG) /* end H5EA__sblock_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__sblock_dest() */
diff --git a/src/H5EAstat.c b/src/H5EAstat.c
index 47b9a86..5705cb8 100644
--- a/src/H5EAstat.c
+++ b/src/H5EAstat.c
@@ -80,17 +80,17 @@
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats))
+herr_t
+H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats)
+{
+ FUNC_ENTER_NOAPI_NOERR
- /* Local variables */
-
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(ea);
HDassert(stats);
/* Copy extensible array statistics */
H5MM_memcpy(stats, &ea->hdr->stats, sizeof(ea->hdr->stats));
-END_FUNC(PRIV) /* end H5EA_get_stats() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA_get_stats() */
diff --git a/src/H5EAtest.c b/src/H5EAtest.c
index dd669fc..7924eaa 100644
--- a/src/H5EAtest.c
+++ b/src/H5EAtest.c
@@ -119,17 +119,19 @@ H5FL_DEFINE_STATIC(H5EA__ctx_cb_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, H5EA__test_crt_context(void *_udata))
+static void *
+H5EA__test_crt_context(void *_udata)
+{
+ H5EA__test_ctx_t *ctx; /* Context for callbacks */
+ H5EA__ctx_cb_t * udata = (H5EA__ctx_cb_t *)_udata; /* User data for context */
+ void * ret_value = NULL;
- /* Local variables */
- H5EA__test_ctx_t *ctx; /* Context for callbacks */
- H5EA__ctx_cb_t * udata = (H5EA__ctx_cb_t *)_udata; /* User data for context */
-
- /* Sanity checks */
+ FUNC_ENTER_STATIC
/* Allocate new context structure */
if (NULL == (ctx = H5FL_MALLOC(H5EA__test_ctx_t)))
- H5E_THROW(H5E_CANTALLOC, "can't allocate extensible array client callback context")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "can't allocate extensible array client callback context")
/* Initialize the context */
ctx->bogus = H5EA__TEST_BOGUS_VAL;
@@ -138,9 +140,9 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, H5EA__test_crt_context(void *_udata)
/* Set return value */
ret_value = ctx;
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__test_crt_context() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__test_crt_context() */
/*-------------------------------------------------------------------------
* Function: H5EA__test_dst_context
@@ -155,18 +157,21 @@ END_FUNC(STATIC) /* end H5EA__test_crt_context() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, H5EA__test_dst_context(void *_ctx))
-
- /* Local variables */
+static herr_t
+H5EA__test_dst_context(void *_ctx)
+{
H5EA__test_ctx_t *ctx = (H5EA__test_ctx_t *)_ctx; /* Callback context to destroy */
+ FUNC_ENTER_STATIC_NOERR
+
/* Sanity checks */
HDassert(H5EA__TEST_BOGUS_VAL == ctx->bogus);
/* Release context structure */
ctx = H5FL_FREE(H5EA__test_ctx_t, ctx);
-END_FUNC(STATIC) /* end H5EA__test_dst_context() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__test_dst_context() */
/*-------------------------------------------------------------------------
* Function: H5EA__test_fill
@@ -181,18 +186,21 @@ END_FUNC(STATIC) /* end H5EA__test_dst_context() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, H5EA__test_fill(void *nat_blk, size_t nelmts))
-
- /* Local variables */
+static herr_t
+H5EA__test_fill(void *nat_blk, size_t nelmts)
+{
uint64_t fill_val = H5EA_TEST_FILL; /* Value to fill elements with */
+ FUNC_ENTER_STATIC_NOERR
+
/* Sanity checks */
HDassert(nat_blk);
HDassert(nelmts);
H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts);
-END_FUNC(STATIC) /* end H5EA__test_fill() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__test_fill() */
/*-------------------------------------------------------------------------
* Function: H5EA__test_encode
@@ -207,12 +215,14 @@ END_FUNC(STATIC) /* end H5EA__test_fill() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx))
+static herr_t
+H5EA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx)
+{
+ H5EA__test_ctx_t *ctx = (H5EA__test_ctx_t *)_ctx; /* Callback context to destroy */
+ const uint64_t * elmt = (const uint64_t *)_elmt; /* Convenience pointer to native elements */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA__test_ctx_t *ctx = (H5EA__test_ctx_t *)_ctx; /* Callback context to destroy */
- const uint64_t * elmt = (const uint64_t *)_elmt; /* Convenience pointer to native elements */
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(raw);
@@ -223,13 +233,12 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Check for callback action */
if (ctx->cb) {
if ((*ctx->cb->encode)(elmt, nelmts, ctx->cb->udata) < 0)
- H5E_THROW(H5E_BADVALUE, "extensible array testing callback action failed")
- } /* end if */
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "extensible array testing callback action failed")
+ }
/* Encode native elements into raw elements */
while (nelmts) {
- /* Encode element */
- /* (advances 'raw' pointer) */
+ /* Encode element - advances 'raw' pointer */
UINT64ENCODE(raw, *elmt);
/* Advance native element pointer */
@@ -237,11 +246,11 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Decrement # of elements to encode */
nelmts--;
- } /* end while */
+ }
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__test_encode() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__test_encode() */
/*-------------------------------------------------------------------------
* Function: H5EA__test_decode
@@ -256,16 +265,17 @@ END_FUNC(STATIC) /* end H5EA__test_encode() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_NDEBUG_UNUSED *_ctx))
-
-/* Local variables */
+static herr_t
+H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_NDEBUG_UNUSED *_ctx)
+{
#ifndef NDEBUG
H5EA__test_ctx_t *ctx = (H5EA__test_ctx_t *)_ctx; /* Callback context to destroy */
#endif /* NDEBUG */
uint64_t * elmt = (uint64_t *)_elmt; /* Convenience pointer to native elements */
const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */
+ FUNC_ENTER_STATIC_NOERR
+
/* Sanity checks */
HDassert(raw);
HDassert(elmt);
@@ -274,8 +284,7 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Decode raw elements into native elements */
while (nelmts) {
- /* Decode element */
- /* (advances 'raw' pointer) */
+ /* Decode element - advances 'raw' pointer */
UINT64DECODE(raw, *elmt);
/* Advance native element pointer */
@@ -283,9 +292,10 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Decrement # of elements to decode */
nelmts--;
- } /* end while */
+ }
-END_FUNC(STATIC) /* end H5EA__test_decode() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__test_decode() */
/*-------------------------------------------------------------------------
* Function: H5EA__test_debug
@@ -300,12 +310,13 @@ END_FUNC(STATIC) /* end H5EA__test_decode() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt))
-
- /* Local variables */
+static herr_t
+H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt)
+{
char temp_str[128]; /* Temporary string, for formatting */
+ FUNC_ENTER_STATIC_NOERR
+
/* Sanity checks */
HDassert(stream);
HDassert(elmt);
@@ -315,7 +326,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
HDfprintf(stream, "%*s%-*s %llu\n", indent, "", fwidth, temp_str,
(unsigned long long)*(const uint64_t *)elmt);
-END_FUNC(STATIC) /* end H5EA__test_debug() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__test_debug() */
/*-------------------------------------------------------------------------
* Function: H5EA__test_crt_dbg_context
@@ -329,22 +341,25 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr))
-
- /* Local variables */
+static void *
+H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)
+{
H5EA__ctx_cb_t *ctx; /* Context for callbacks */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Allocate new context structure */
if (NULL == (ctx = H5FL_MALLOC(H5EA__ctx_cb_t)))
- H5E_THROW(H5E_CANTALLOC, "can't allocate extensible array client callback context")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "can't allocate extensible array client callback context")
/* Set return value */
ret_value = ctx;
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__test_crt_dbg_context() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__test_crt_dbg_context() */
/*-------------------------------------------------------------------------
* Function: H5EA__test_dst_dbg_context
@@ -358,17 +373,20 @@ END_FUNC(STATIC) /* end H5EA__test_crt_dbg_context() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, H5EA__test_dst_dbg_context(void *_ctx))
-
- /* Local variables */
+static herr_t
+H5EA__test_dst_dbg_context(void *_ctx)
+{
H5EA__ctx_cb_t *ctx = (H5EA__ctx_cb_t *)_ctx; /* Callback context to destroy */
+ FUNC_ENTER_STATIC_NOERR
+
HDassert(_ctx);
/* Release context structure */
ctx = H5FL_FREE(H5EA__ctx_cb_t, ctx);
-END_FUNC(STATIC) /* end H5EA__test_dst_dbg_context() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__test_dst_dbg_context() */
/*-------------------------------------------------------------------------
* Function: H5EA__get_cparam_test
@@ -383,7 +401,10 @@ END_FUNC(STATIC) /* end H5EA__test_dst_dbg_context() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5EA__get_cparam_test(const H5EA_t *ea, H5EA_create_t *cparam))
+herr_t
+H5EA__get_cparam_test(const H5EA_t *ea, H5EA_create_t *cparam)
+{
+ FUNC_ENTER_PACKAGE_NOERR
/* Check arguments. */
HDassert(ea);
@@ -397,7 +418,8 @@ BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5EA__get_cparam_test(const H5EA_t *e
cparam->data_blk_min_elmts = ea->hdr->cparam.data_blk_min_elmts;
cparam->max_dblk_page_nelmts_bits = ea->hdr->cparam.max_dblk_page_nelmts_bits;
-END_FUNC(PKG) /* end H5EA__get_cparam_test() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__get_cparam_test() */
/*-------------------------------------------------------------------------
* Function: H5EA__cmp_cparam_test
@@ -412,39 +434,48 @@ END_FUNC(PKG) /* end H5EA__get_cparam_test() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERRCATCH, int, 0, -,
- H5EA__cmp_cparam_test(const H5EA_create_t *cparam1, const H5EA_create_t *cparam2))
+int
+H5EA__cmp_cparam_test(const H5EA_create_t *cparam1, const H5EA_create_t *cparam2)
+{
+ int ret_value = 0;
- /* Check arguments. */
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Check arguments */
HDassert(cparam1);
HDassert(cparam2);
/* Compare creation parameters for array */
if (cparam1->raw_elmt_size < cparam2->raw_elmt_size)
- H5_LEAVE(-1)
+ HGOTO_DONE(-1)
else if (cparam1->raw_elmt_size > cparam2->raw_elmt_size)
- H5_LEAVE(1)
+ HGOTO_DONE(1)
+
if (cparam1->max_nelmts_bits < cparam2->max_nelmts_bits)
- H5_LEAVE(-1)
+ HGOTO_DONE(-1)
else if (cparam1->max_nelmts_bits > cparam2->max_nelmts_bits)
- H5_LEAVE(1)
+ HGOTO_DONE(1)
+
if (cparam1->idx_blk_elmts < cparam2->idx_blk_elmts)
- H5_LEAVE(-1)
+ HGOTO_DONE(-1)
else if (cparam1->idx_blk_elmts > cparam2->idx_blk_elmts)
- H5_LEAVE(1)
+ HGOTO_DONE(1)
+
if (cparam1->sup_blk_min_data_ptrs < cparam2->sup_blk_min_data_ptrs)
- H5_LEAVE(-1)
+ HGOTO_DONE(-1)
else if (cparam1->sup_blk_min_data_ptrs > cparam2->sup_blk_min_data_ptrs)
- H5_LEAVE(1)
+ HGOTO_DONE(1)
+
if (cparam1->data_blk_min_elmts < cparam2->data_blk_min_elmts)
- H5_LEAVE(-1)
+ HGOTO_DONE(-1)
else if (cparam1->data_blk_min_elmts > cparam2->data_blk_min_elmts)
- H5_LEAVE(1)
+ HGOTO_DONE(1)
+
if (cparam1->max_dblk_page_nelmts_bits < cparam2->max_dblk_page_nelmts_bits)
- H5_LEAVE(-1)
+ HGOTO_DONE(-1)
else if (cparam1->max_dblk_page_nelmts_bits > cparam2->max_dblk_page_nelmts_bits)
- H5_LEAVE(1)
-
- CATCH
+ HGOTO_DONE(1)
-END_FUNC(PKG) /* end H5EA__cmp_cparam_test() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cmp_cparam_test() */
diff --git a/src/H5ES.c b/src/H5ES.c
index 2ba8a72..ccc0dd8 100644
--- a/src/H5ES.c
+++ b/src/H5ES.c
@@ -34,11 +34,12 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
#include "H5ESpkg.h" /* Event Sets */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
/****************/
/* Local Macros */
@@ -103,10 +104,61 @@ done:
} /* end H5EScreate() */
/*-------------------------------------------------------------------------
+ * Function: H5ESinsert_request
+ *
+ * Purpose: Insert a request from a VOL connector into an event set.
+ *
+ * Note: This function is primarily targeted at VOL connector
+ * authors and is _not_ designed for general-purpose application use.
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, December 11, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5ESinsert_request(hid_t es_id, hid_t connector_id, void *request)
+{
+ H5ES_t *es; /* Event set */
+ H5VL_t *connector = NULL; /* VOL connector */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "ii*x", es_id, connector_id, request);
+
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ if (NULL == request)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL request pointer")
+
+ /* Create new VOL connector object, using the connector ID */
+ if (NULL == (connector = H5VL_new_connector(connector_id)))
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTCREATE, FAIL, "can't create VOL connector object")
+
+ /* Insert request into event set */
+ if (H5ES__insert_request(es, connector, request) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTINSERT, FAIL, "can't insert request into event set")
+
+done:
+ /* Clean up on error */
+ if (ret_value < 0)
+ /* Release newly created connector */
+ if (connector && H5VL_conn_dec_rc(connector) < 0)
+ HDONE_ERROR(H5E_EVENTSET, H5E_CANTDEC, FAIL, "unable to decrement ref count on VOL connector")
+
+ FUNC_LEAVE_API(ret_value)
+} /* end H5ESinsert_request() */
+
+/*-------------------------------------------------------------------------
* Function: H5ESget_count
*
* Purpose: Retrieve the # of events in an event set
*
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
* Return: SUCCEED / FAIL
*
* Programmer: Quincey Koziol
@@ -117,19 +169,23 @@ done:
herr_t
H5ESget_count(hid_t es_id, size_t *count /*out*/)
{
- H5ES_t *es; /* Event set */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", es_id, count);
- /* Check arguments */
- if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
+
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
- /* Retrieve the count, if non-NULL */
- if (count)
- *count = H5ES__list_count(&es->active);
+ /* Retrieve the count, if non-NULL */
+ if (count)
+ *count = H5ES__list_count(&es->active);
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)
@@ -145,6 +201,8 @@ done:
* mechanism for matching operations inserted into the event
* set with [possible] errors that occur.
*
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
* Return: SUCCEED / FAIL
*
* Programmer: Quincey Koziol
@@ -155,19 +213,23 @@ done:
herr_t
H5ESget_op_counter(hid_t es_id, uint64_t *op_counter /*out*/)
{
- H5ES_t *es; /* Event set */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", es_id, op_counter);
- /* Check arguments */
- if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
- /* Retrieve the operation counter, if non-NULL */
- if (op_counter)
- *op_counter = es->op_counter;
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+
+ /* Retrieve the operation counter, if non-NULL */
+ if (op_counter)
+ *op_counter = es->op_counter;
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)
@@ -192,6 +254,8 @@ done:
* value returned for the # of operations in progress may be
* inaccurate.
*
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
* Return: SUCCEED / FAIL
*
* Programmer: Quincey Koziol
@@ -202,33 +266,82 @@ done:
herr_t
H5ESwait(hid_t es_id, uint64_t timeout, size_t *num_in_progress /*out*/, hbool_t *op_failed /*out*/)
{
- H5ES_t *es; /* Event set */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "iULxx", es_id, timeout, num_in_progress, op_failed);
- /* Check arguments */
- if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
- if (NULL == num_in_progress)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL num_in_progress pointer")
- if (NULL == op_failed)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL op_failed pointer")
-
- /* Wait for operations */
- if (H5ES__wait(es, timeout, num_in_progress, op_failed) < 0)
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTWAIT, FAIL, "can't wait on operations")
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
+
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ if (NULL == num_in_progress)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL num_in_progress pointer")
+ if (NULL == op_failed)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL op_failed pointer")
+
+ /* Wait for operations */
+ if (H5ES__wait(es, timeout, num_in_progress, op_failed) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTWAIT, FAIL, "can't wait on operations")
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)
} /* end H5ESwait() */
/*-------------------------------------------------------------------------
+ * Function: H5EScancel
+ *
+ * Purpose: Attempt to cancel operations in an event set
+ *
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, December 10, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5EScancel(hid_t es_id, size_t *num_not_canceled /*out*/, hbool_t *op_failed /*out*/)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "ixx", es_id, num_not_canceled, op_failed);
+
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
+
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ if (NULL == num_not_canceled)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL num_not_canceled pointer")
+ if (NULL == op_failed)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL op_failed pointer")
+
+ /* Cancel operations */
+ if (H5ES__cancel(es, num_not_canceled, op_failed) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTCANCEL, FAIL, "can't cancel operations")
+ } /* end if */
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5EScancel() */
+
+/*-------------------------------------------------------------------------
* Function: H5ESget_err_status
*
* Purpose: Check if event set has failed operations
*
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
* Return: SUCCEED / FAIL
*
* Programmer: Quincey Koziol
@@ -239,19 +352,23 @@ done:
herr_t
H5ESget_err_status(hid_t es_id, hbool_t *err_status /*out*/)
{
- H5ES_t *es; /* Event set */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", es_id, err_status);
- /* Check arguments */
- if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
- /* Retrieve the error flag, if non-NULL */
- if (err_status)
- *err_status = es->err_occurred;
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+
+ /* Retrieve the error flag, if non-NULL */
+ if (err_status)
+ *err_status = es->err_occurred;
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)
@@ -265,6 +382,8 @@ done:
* Note: Does not wait for active operations to complete, so count may
* not include all failures.
*
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
* Return: SUCCEED / FAIL
*
* Programmer: Quincey Koziol
@@ -275,23 +394,27 @@ done:
herr_t
H5ESget_err_count(hid_t es_id, size_t *num_errs /*out*/)
{
- H5ES_t *es; /* Event set */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", es_id, num_errs);
- /* Check arguments */
- if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
- /* Retrieve the error flag, if non-NULL */
- if (num_errs) {
- if (es->err_occurred)
- *num_errs = H5ES__list_count(&es->failed);
- else
- *num_errs = 0;
- } /* end if */
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+
+ /* Retrieve the error flag, if non-NULL */
+ if (num_errs) {
+ if (es->err_occurred)
+ *num_errs = H5ES__list_count(&es->failed);
+ else
+ *num_errs = 0;
+ } /* end if */
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)
@@ -305,6 +428,8 @@ done:
* Note: The strings retrieved for each error info must be released
* by calling H5free_memory().
*
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
* Return: SUCCEED / FAIL
*
* Programmer: Quincey Koziol
@@ -316,29 +441,164 @@ herr_t
H5ESget_err_info(hid_t es_id, size_t num_err_info, H5ES_err_info_t err_info[] /*out*/,
size_t *num_cleared /*out*/)
{
- H5ES_t *es; /* Event set */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "izxx", es_id, num_err_info, err_info, num_cleared);
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
+
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ if (0 == num_err_info)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "err_info array size is 0")
+ if (NULL == err_info)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL err_info array pointer")
+ if (NULL == num_cleared)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL errors cleared pointer")
+
+ /* Retrieve the error information */
+ if (H5ES__get_err_info(es, num_err_info, err_info, num_cleared) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL, "can't retrieve error info for failed operation(s)")
+ } /* end if */
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5ESget_err_info() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5ESfree_err_info
+ *
+ * Purpose: Convenience routine to free 1+ H5ES_err_info_t structs.
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, March 5, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5ESfree_err_info(size_t num_err_info, H5ES_err_info_t err_info[])
+{
+ size_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "z*#", num_err_info, err_info);
+
/* Check arguments */
- if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
if (0 == num_err_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "err_info array size is 0")
if (NULL == err_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL err_info array pointer")
- if (NULL == num_cleared)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL errors cleared pointer")
- /* Retrieve the error information */
- if (H5ES__get_err_info(es, num_err_info, err_info, num_cleared) < 0)
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL, "can't retrieve error info for failed operation(s)")
+ /* Iterate over array, releasing error information */
+ for (u = 0; u < num_err_info; u++) {
+ H5MM_xfree(err_info[u].api_name);
+ H5MM_xfree(err_info[u].api_args);
+ H5MM_xfree(err_info[u].app_file_name);
+ H5MM_xfree(err_info[u].app_func_name);
+ if (H5I_dec_app_ref(err_info[u].err_stack_id) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTDEC, FAIL, "can't close error stack for err_info #%zu", u)
+ } /* end for */
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5ESget_err_info() */
+} /* end H5ESfree_err_info() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5ESregister_insert_func
+ *
+ * Purpose: Registers a callback to invoke when a new operation is inserted
+ * into an event set.
+ *
+ * Note: Only one insert callback can be registered for each event set.
+ * Registering a new callback will replace the existing one.
+ *
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, December 11, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5ESregister_insert_func(hid_t es_id, H5ES_event_insert_func_t func, void *ctx)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "iEI*x", es_id, func, ctx);
+
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
+
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ if (NULL == func)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL function callback pointer")
+
+ /* Set the event set's insert callback */
+ es->ins_func = func;
+ es->ins_ctx = ctx;
+ } /* end if */
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5ESregister_insert_func() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5ESregister_complete_func
+ *
+ * Purpose: Registers a callback to invoke when an operation completes
+ * within an event set.
+ *
+ * Note: Only one complete callback can be registered for each event set.
+ * Registering a new callback will replace the existing one.
+ *
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, December 11, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5ESregister_complete_func(hid_t es_id, H5ES_event_complete_func_t func, void *ctx)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "iEC*x", es_id, func, ctx);
+
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ H5ES_t *es; /* Event set */
+
+ /* Check arguments */
+ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid event set identifier")
+ if (NULL == func)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL function callback pointer")
+
+ /* Set the event set's completion callback */
+ es->comp_func = func;
+ es->comp_ctx = ctx;
+ } /* end if */
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5ESregister_complete_func() */
/*-------------------------------------------------------------------------
* Function: H5ESclose
@@ -347,6 +607,8 @@ done:
*
* Note: Fails if active operations are present.
*
+ * Note: H5ES_NONE is a valid value for 'es_id', but functions as a no-op
+ *
* Return: SUCCEED / FAIL
*
* Programmer: Quincey Koziol
@@ -362,16 +624,19 @@ H5ESclose(hid_t es_id)
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", es_id);
- /* Check arguments */
- if (H5I_EVENTSET != H5I_get_type(es_id))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an event set")
-
- /*
- * Decrement the counter on the object. It will be freed if the count
- * reaches zero.
- */
- if (H5I_dec_app_ref(es_id) < 0)
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTDEC, FAIL, "unable to decrement ref count on event set")
+ /* Passing H5ES_NONE is valid, but a no-op */
+ if (H5ES_NONE != es_id) {
+ /* Check arguments */
+ if (H5I_EVENTSET != H5I_get_type(es_id))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an event set")
+
+ /*
+ * Decrement the counter on the object. It will be freed if the count
+ * reaches zero.
+ */
+ if (H5I_dec_app_ref(es_id) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTDEC, FAIL, "unable to decrement ref count on event set")
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5ESdevelop.h b/src/H5ESdevelop.h
new file mode 100644
index 0000000..5a0f2b4
--- /dev/null
+++ b/src/H5ESdevelop.h
@@ -0,0 +1,50 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * This file contains public declarations for the H5ES (event set) developer
+ * support routines.
+ */
+
+#ifndef _H5ESdevelop_H
+#define _H5ESdevelop_H
+
+/* Include package's public header */
+#include "H5ESpublic.h"
+
+/*****************/
+/* Public Macros */
+/*****************/
+
+/*******************/
+/* Public Typedefs */
+/*******************/
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+H5_DLL herr_t H5ESinsert_request(hid_t es_id, hid_t connector_id, void *request);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _H5ESdevelop_H */
diff --git a/src/H5ESevent.c b/src/H5ESevent.c
index b0c3578..aafc785 100644
--- a/src/H5ESevent.c
+++ b/src/H5ESevent.c
@@ -139,14 +139,14 @@ H5ES__event_free(H5ES_event_t *ev)
/* Sanity check */
HDassert(ev);
- if (ev->api_name)
- H5MM_xfree_const(ev->api_name);
- if (ev->api_args)
- H5MM_xfree_const(ev->api_args);
- if (ev->app_file)
- H5MM_xfree_const(ev->app_file);
- if (ev->app_func)
- H5MM_xfree_const(ev->app_func);
+ /* The 'app_func_name', 'app_file_name', and 'api_name' strings are statically allocated (by the compiler)
+ * and are not allocated, so there's no need to free them.
+ */
+ ev->op_info.api_name = NULL;
+ if (ev->op_info.api_args)
+ H5MM_xfree_const(ev->op_info.api_args);
+ ev->op_info.app_file_name = NULL;
+ ev->op_info.app_func_name = NULL;
if (ev->request) {
/* Free the request */
if (H5VL_request_free(ev->request) < 0)
diff --git a/src/H5ESint.c b/src/H5ESint.c
index da3f779..6f9efe9 100644
--- a/src/H5ESint.c
+++ b/src/H5ESint.c
@@ -53,11 +53,18 @@
/* Callback context for wait operations */
typedef struct H5ES_wait_ctx_t {
H5ES_t * es; /* Event set being operated on */
- uint64_t timeout; /* Timeout for wait operation */
+ uint64_t timeout; /* Timeout for wait operation (in ns) */
size_t * num_in_progress; /* Count of # of operations that have not completed */
hbool_t *op_failed; /* Flag to indicate an operation failed */
} H5ES_wait_ctx_t;
+/* Callback context for cancel operations */
+typedef struct H5ES_cancel_ctx_t {
+ H5ES_t * es; /* Event set being operated on */
+ size_t * num_not_canceled; /* Count of # of operations were not canceled */
+ hbool_t *op_failed; /* Flag to indicate an operation failed */
+} H5ES_cancel_ctx_t;
+
/* Callback context for get error info (gei) operations */
typedef struct H5ES_gei_ctx_t {
H5ES_t * es; /* Event set being operated on */
@@ -73,9 +80,14 @@ typedef struct H5ES_gei_ctx_t {
/********************/
/* Local Prototypes */
/********************/
+static herr_t H5ES__close(H5ES_t *es);
static herr_t H5ES__close_cb(void *es, void **request_token);
+static herr_t H5ES__insert(H5ES_t *es, H5VL_t *connector, void *request_token, const char *app_file,
+ const char *app_func, unsigned app_line, const char *caller, const char *api_args);
static herr_t H5ES__handle_fail(H5ES_t *es, H5ES_event_t *ev);
+static herr_t H5ES__op_complete(H5ES_t *es, H5ES_event_t *ev, H5VL_request_status_t ev_status);
static int H5ES__wait_cb(H5ES_event_t *ev, void *_ctx);
+static int H5ES__cancel_cb(H5ES_event_t *ev, void *_ctx);
static int H5ES__get_err_info_cb(H5ES_event_t *ev, void *_ctx);
static int H5ES__close_failed_cb(H5ES_event_t *ev, void *_ctx);
@@ -233,6 +245,81 @@ done:
} /* end H5ES__create() */
/*-------------------------------------------------------------------------
+ * Function: H5ES__insert
+ *
+ * Purpose: Insert a request token into an event set
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, December 11, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5ES__insert(H5ES_t *es, H5VL_t *connector, void *request_token, const char *app_file, const char *app_func,
+ unsigned app_line, const char *caller, const char *api_args)
+{
+ H5ES_event_t *ev = NULL; /* Event for request */
+ hbool_t ev_inserted = FALSE; /* Flag to indicate that event is in active list */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(es);
+
+ /* Create new event */
+ if (NULL == (ev = H5ES__event_new(connector, request_token)))
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTCREATE, FAIL, "can't create event object")
+
+ /* Copy the app source information */
+ /* The 'app_func' & 'app_file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ ev->op_info.app_file_name = app_file;
+ ev->op_info.app_func_name = app_func;
+ ev->op_info.app_line_num = app_line;
+
+ /* Set the event's operation counter */
+ ev->op_info.op_ins_count = es->op_counter++;
+
+ /* Set the event's timestamp & execution time */
+ ev->op_info.op_ins_ts = H5_now_usec();
+ ev->op_info.op_exec_ts = UINT64_MAX;
+ ev->op_info.op_exec_time = UINT64_MAX;
+
+ /* Copy the API routine's name & arguments */
+ /* The 'caller' string is also statically allocated (by the compiler)
+ * there's no need to duplicate it.
+ */
+ ev->op_info.api_name = caller;
+ if (NULL == (ev->op_info.api_args = H5MM_xstrdup(api_args)))
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, FAIL, "can't copy API routine arguments")
+
+ /* Append fully initialized event onto the event set's 'active' list */
+ H5ES__list_append(&es->active, ev);
+ ev_inserted = TRUE;
+
+ /* Invoke the event set's 'insert' callback, if present */
+ if (es->ins_func)
+ if ((es->ins_func)(&ev->op_info, es->ins_ctx) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CALLBACK, FAIL, "'insert' callback for event set failed")
+
+done:
+ /* Release resources on error */
+ if (ret_value < 0)
+ if (ev) {
+ if (ev_inserted)
+ H5ES__list_remove(&es->active, ev);
+ if (H5ES__event_free(ev) < 0)
+ HDONE_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, FAIL, "unable to release event")
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5ES__insert() */
+
+/*-------------------------------------------------------------------------
* Function: H5ES_insert
*
* Purpose: Insert a request token into an event set
@@ -247,15 +334,15 @@ done:
herr_t
H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, const char *caller_args, ...)
{
- H5ES_t * es = NULL; /* Event set for the operation */
- H5ES_event_t *ev = NULL; /* Event for request */
- H5RS_str_t * rs = NULL; /* Ref-counted string to compose formatted argument string in */
- const char * app_file; /* Application source file name */
- const char * app_func; /* Application source function name */
- const char * s; /* Pointer to internal string from ref-counted string */
- va_list ap; /* Varargs for caller */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5ES_t * es = NULL; /* Event set for the operation */
+ const char *app_file; /* Application source file name */
+ const char *app_func; /* Application source function name */
+ unsigned app_line; /* Application source line number */
+ H5RS_str_t *rs = NULL; /* Ref-counted string to compose formatted argument string in */
+ const char *api_args; /* Pointer to api_args string from ref-counted string */
+ va_list ap; /* Varargs for caller */
+ hbool_t arg_started = FALSE; /* Whether the va_list has been started */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -273,10 +360,6 @@ H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, con
if (es->err_occurred)
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTINSERT, FAIL, "event set has failed operations")
- /* Create new event */
- if (NULL == (ev = H5ES__event_new(connector, token)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTCREATE, FAIL, "can't create event object")
-
/* Start working on the API routines arguments */
HDva_start(ap, caller_args);
arg_started = TRUE;
@@ -284,24 +367,10 @@ H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, con
/* Copy the app source information */
(void)HDva_arg(ap, char *); /* Toss the 'app_file' parameter name */
app_file = HDva_arg(ap, char *);
- if (NULL == (ev->app_file = H5MM_strdup(app_file)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, FAIL, "can't copy app source file name")
(void)HDva_arg(ap, char *); /* Toss the 'app_func' parameter name */
app_func = HDva_arg(ap, char *);
- if (NULL == (ev->app_func = H5MM_strdup(app_func)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, FAIL, "can't copy app source function name")
(void)HDva_arg(ap, char *); /* Toss the 'app_line' parameter name */
- ev->app_line = HDva_arg(ap, unsigned);
-
- /* Set the event's operation counter */
- ev->ev_count = es->op_counter++;
-
- /* Set the event's timestamp */
- ev->ev_time = H5_now_usec();
-
- /* Copy the API routine's name */
- if (NULL == (ev->api_name = H5MM_strdup(caller)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, FAIL, "can't copy API routine name")
+ app_line = HDva_arg(ap, unsigned);
/* Create the string for the API routine's arguments */
if (NULL == (rs = H5RS_create(NULL)))
@@ -312,13 +381,12 @@ H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, con
HDassert(0 == HDstrncmp(caller_args, "*s*sIu", 6));
if (H5_trace_args(rs, caller_args + 6, ap) < 0)
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTSET, FAIL, "can't create formatted API arguments")
- if (NULL == (s = H5RS_get_str(rs)))
+ if (NULL == (api_args = H5RS_get_str(rs)))
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL, "can't get pointer to formatted API arguments")
- if (NULL == (ev->api_args = H5MM_strdup(s)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, FAIL, "can't copy API routine arguments")
- /* Append fully initialized event onto the event set's 'active' list */
- H5ES__list_append(&es->active, ev);
+ /* Insert the operation into the event set */
+ if (H5ES__insert(es, connector, token, app_file, app_func, app_line, caller, api_args) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTINSERT, FAIL, "event set has failed operations")
done:
/* Clean up */
@@ -327,15 +395,42 @@ done:
if (rs)
H5RS_decr(rs);
- /* Release resources on error */
- if (ret_value < 0)
- if (ev && H5ES__event_free(ev) < 0)
- HDONE_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, FAIL, "unable to release event")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ES_insert() */
/*-------------------------------------------------------------------------
+ * Function: H5ES__insert_request
+ *
+ * Purpose: Directly insert a request token into an event set
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, December 11, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5ES__insert_request(H5ES_t *es, H5VL_t *connector, void *token)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check */
+ HDassert(es);
+ HDassert(connector);
+ HDassert(token);
+
+ /* Insert an 'anonymous' operation into the event set */
+ if (H5ES__insert(es, connector, token, NULL, NULL, 0, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTINSERT, FAIL, "event set has failed operations")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5ES__insert_request() */
+
+/*-------------------------------------------------------------------------
* Function: H5ES__handle_fail
*
* Purpose: Handle a failed event
@@ -370,6 +465,101 @@ H5ES__handle_fail(H5ES_t *es, H5ES_event_t *ev)
} /* end H5ES__handle_fail() */
/*-------------------------------------------------------------------------
+ * Function: H5ES__op_complete
+ *
+ * Purpose: Handle an operation completing
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, December 11, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5ES__op_complete(H5ES_t *es, H5ES_event_t *ev, H5VL_request_status_t ev_status)
+{
+ H5VL_request_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t err_stack_id = H5I_INVALID_HID; /* Error stack for failed operation */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(es);
+ HDassert(ev);
+ HDassert(H5VL_REQUEST_STATUS_SUCCEED == ev_status || H5VL_REQUEST_STATUS_FAIL == ev_status ||
+ H5VL_REQUEST_STATUS_CANCELED == ev_status);
+
+ /* Handle each form of event completion */
+ if (H5VL_REQUEST_STATUS_SUCCEED == ev_status || H5VL_REQUEST_STATUS_CANCELED == ev_status) {
+ /* Invoke the event set's 'complete' callback, if present */
+ if (es->comp_func) {
+ H5ES_status_t op_status; /* Status for complete callback */
+
+ /* Set appropriate info for callback */
+ if (H5VL_REQUEST_STATUS_SUCCEED == ev_status) {
+ /* Translate status */
+ op_status = H5ES_STATUS_SUCCEED;
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_REQUEST_GET_EXEC_TIME;
+ vol_cb_args.args.get_exec_time.exec_ts = &ev->op_info.op_exec_ts;
+ vol_cb_args.args.get_exec_time.exec_time = &ev->op_info.op_exec_time;
+
+ /* Retrieve the execution time info */
+ if (H5VL_request_specific(ev->request, &vol_cb_args) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL,
+ "unable to retrieve execution time info for operation")
+ }
+ else
+ /* Translate status */
+ op_status = H5ES_STATUS_CANCELED;
+
+ if ((es->comp_func)(&ev->op_info, op_status, H5I_INVALID_HID, es->comp_ctx) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CALLBACK, FAIL, "'complete' callback for event set failed")
+ } /* end if */
+
+ /* Event success or cancellation */
+ if (H5ES__event_completed(ev, &es->active) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, FAIL, "unable to release completed event")
+ } /* end if */
+ else if (H5VL_REQUEST_STATUS_FAIL == ev_status) {
+ /* Invoke the event set's 'complete' callback, if present */
+ if (es->comp_func) {
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_REQUEST_GET_ERR_STACK;
+ vol_cb_args.args.get_err_stack.err_stack_id = H5I_INVALID_HID;
+
+ /* Retrieve the error stack for the operation */
+ if (H5VL_request_specific(ev->request, &vol_cb_args) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL, "unable to retrieve error stack for operation")
+
+ /* Set values */
+ err_stack_id = vol_cb_args.args.get_err_stack.err_stack_id;
+
+ if ((es->comp_func)(&ev->op_info, H5ES_STATUS_FAIL, err_stack_id, es->comp_ctx) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CALLBACK, FAIL, "'complete' callback for event set failed")
+ } /* end if */
+
+ /* Handle failure */
+ if (H5ES__handle_fail(es, ev) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTSET, FAIL, "unable to handle failed event")
+ } /* end else-if */
+ else
+ HGOTO_ERROR(H5E_EVENTSET, H5E_BADVALUE, FAIL, "unknown event status?!?")
+
+done:
+ /* Clean up */
+ if (H5I_INVALID_HID != err_stack_id)
+ if (H5I_dec_ref(err_stack_id) < 0)
+ HDONE_ERROR(H5E_EVENTSET, H5E_CANTDEC, FAIL,
+ "unable to decrement ref count on error stack for failed operation")
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5ES__op_complete() */
+
+/*-------------------------------------------------------------------------
* Function: H5ES__wait_cb
*
* Purpose: Common routine for testing / waiting on an operation
@@ -405,9 +595,9 @@ H5ES__wait_cb(H5ES_event_t *ev, void *_ctx)
/* Check for status values that indicate we should break out of the loop */
if (ev_status == H5VL_REQUEST_STATUS_FAIL) {
- /* Handle failure */
- if (H5ES__handle_fail(ctx->es, ev) < 0)
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTSET, H5_ITER_ERROR, "unable to handle failed event")
+ /* Handle event completion */
+ if (H5ES__op_complete(ctx->es, ev, ev_status) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, H5_ITER_ERROR, "unable to release completed event")
/* Record the error */
*ctx->op_failed = TRUE;
@@ -415,13 +605,15 @@ H5ES__wait_cb(H5ES_event_t *ev, void *_ctx)
/* Exit from the iteration */
ret_value = H5_ITER_STOP;
} /* end if */
- else if (ev_status == H5VL_REQUEST_STATUS_SUCCEED) {
- if (H5ES__event_completed(ev, &ctx->es->active) < 0)
+ else if (ev_status == H5VL_REQUEST_STATUS_SUCCEED || ev_status == H5VL_REQUEST_STATUS_CANCELED) {
+ /* Handle event completion */
+ if (H5ES__op_complete(ctx->es, ev, ev_status) < 0)
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, H5_ITER_ERROR, "unable to release completed event")
} /* end else-if */
- else if (ev_status == H5VL_REQUEST_STATUS_CANCELED)
- /* Should never get a status of 'cancel' back from test / wait operation */
- HGOTO_ERROR(H5E_EVENTSET, H5E_BADVALUE, H5_ITER_ERROR, "received 'cancel' status for operation")
+ else if (ev_status == H5VL_REQUEST_STATUS_CANT_CANCEL)
+ /* Should never get a status of 'can't cancel' back from test / wait operation */
+ HGOTO_ERROR(H5E_EVENTSET, H5E_BADVALUE, H5_ITER_ERROR,
+ "received \"can't cancel\" status for operation")
else {
/* Sanity check */
HDassert(ev_status == H5VL_REQUEST_STATUS_IN_PROGRESS);
@@ -489,6 +681,114 @@ done:
} /* end H5ES__wait() */
/*-------------------------------------------------------------------------
+ * Function: H5ES__cancel_cb
+ *
+ * Purpose: Callback for canceling operations
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, December 10, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5ES__cancel_cb(H5ES_event_t *ev, void *_ctx)
+{
+ H5ES_cancel_ctx_t * ctx = (H5ES_cancel_ctx_t *)_ctx; /* Callback context */
+ H5VL_request_status_t ev_status = H5VL_REQUEST_STATUS_SUCCEED; /* Status from event's operation */
+ int ret_value = H5_ITER_CONT; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(ev);
+ HDassert(ctx);
+
+ /* Attempt to cancel the request */
+ if (H5VL_request_cancel(ev->request, &ev_status) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTCANCEL, H5_ITER_ERROR, "unable to cancel operation")
+
+ /* Check for status values that indicate we should break out of the loop */
+ if (ev_status == H5VL_REQUEST_STATUS_FAIL) {
+ /* Handle event completion */
+ if (H5ES__op_complete(ctx->es, ev, ev_status) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTSET, H5_ITER_ERROR, "unable to handle failed event")
+
+ /* Record the error */
+ *ctx->op_failed = TRUE;
+
+ /* Exit from the iteration */
+ ret_value = H5_ITER_STOP;
+ } /* end if */
+ else if (ev_status == H5VL_REQUEST_STATUS_SUCCEED) {
+ /* Increment "not canceled" counter */
+ (*ctx->num_not_canceled)++;
+
+ /* Handle event completion */
+ if (H5ES__op_complete(ctx->es, ev, ev_status) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, H5_ITER_ERROR, "unable to release completed event")
+ } /* end else-if */
+ else if (ev_status == H5VL_REQUEST_STATUS_CANT_CANCEL || ev_status == H5VL_REQUEST_STATUS_IN_PROGRESS) {
+ /* Increment "not canceled" counter */
+ (*ctx->num_not_canceled)++;
+ } /* end else-if */
+ else {
+ /* Sanity check */
+ HDassert(ev_status == H5VL_REQUEST_STATUS_CANCELED);
+
+ /* Handle event completion */
+ if (H5ES__op_complete(ctx->es, ev, ev_status) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTRELEASE, H5_ITER_ERROR, "unable to release completed event")
+ } /* end else */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5ES__cancel_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5ES__cancel
+ *
+ * Purpose: Cancel operations in event set
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, December 10, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, hbool_t *op_failed)
+{
+ H5ES_cancel_ctx_t ctx; /* Iterator callback context info */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check */
+ HDassert(es);
+ HDassert(num_not_canceled);
+ HDassert(op_failed);
+
+ /* Set user's parameters to known values */
+ *num_not_canceled = 0;
+ *op_failed = FALSE;
+
+ /* Set up context for iterator callbacks */
+ ctx.es = es;
+ ctx.num_not_canceled = num_not_canceled;
+ ctx.op_failed = op_failed;
+
+ /* Iterate over the events in the set, attempting to cancel them */
+ if (H5ES__list_iterate(&es->active, H5ES__cancel_cb, &ctx) < 0)
+ HGOTO_ERROR(H5E_EVENTSET, H5E_BADITER, FAIL, "iteration failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5ES__cancel() */
+
+/*-------------------------------------------------------------------------
* Function: H5ES__get_err_info_cb
*
* Purpose: Retrieve information about a failed operation
@@ -503,8 +803,9 @@ done:
static int
H5ES__get_err_info_cb(H5ES_event_t *ev, void *_ctx)
{
- H5ES_gei_ctx_t *ctx = (H5ES_gei_ctx_t *)_ctx; /* Callback context */
- int ret_value = H5_ITER_CONT; /* Return value */
+ H5VL_request_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5ES_gei_ctx_t * ctx = (H5ES_gei_ctx_t *)_ctx; /* Callback context */
+ int ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_STATIC
@@ -513,22 +814,35 @@ H5ES__get_err_info_cb(H5ES_event_t *ev, void *_ctx)
HDassert(ctx);
/* Copy operation info for event */
- if (NULL == (ctx->curr_err_info->api_name = H5MM_strdup(ev->api_name)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, H5_ITER_ERROR, "can't copy HDF5 API name")
- if (NULL == (ctx->curr_err_info->api_args = H5MM_strdup(ev->api_args)))
+ /* The 'app_func_name', 'app_file_name', and 'api_name' strings are statically allocated (by the compiler)
+ * so there's no need to duplicate them internally, but they are duplicated
+ * here, when they are given back to the user.
+ */
+ if (NULL == (ctx->curr_err_info->api_name = H5MM_strdup(ev->op_info.api_name)))
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, H5_ITER_ERROR, "can't copy HDF5 API routine name")
+ if (NULL == (ctx->curr_err_info->api_args = H5MM_strdup(ev->op_info.api_args)))
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, H5_ITER_ERROR, "can't copy HDF5 API routine arguments")
- if (NULL == (ctx->curr_err_info->app_file_name = H5MM_strdup(ev->app_file)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, H5_ITER_ERROR, "can't copy app source file name")
- if (NULL == (ctx->curr_err_info->app_func_name = H5MM_strdup(ev->app_func)))
- HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, H5_ITER_ERROR, "can't copy app function name")
- ctx->curr_err_info->app_line_num = ev->app_line;
- ctx->curr_err_info->op_ins_count = ev->ev_count;
- ctx->curr_err_info->op_ins_ts = ev->ev_time;
+ if (NULL == (ctx->curr_err_info->app_file_name = H5MM_strdup(ev->op_info.app_file_name)))
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, H5_ITER_ERROR, "can't copy HDF5 application file name")
+ if (NULL == (ctx->curr_err_info->app_func_name = H5MM_strdup(ev->op_info.app_func_name)))
+ HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, H5_ITER_ERROR, "can't copy HDF5 application function name")
+ ctx->curr_err_info->app_line_num = ev->op_info.app_line_num;
+ ctx->curr_err_info->op_ins_count = ev->op_info.op_ins_count;
+ ctx->curr_err_info->op_ins_ts = ev->op_info.op_ins_ts;
+ ctx->curr_err_info->op_exec_ts = ev->op_info.op_exec_ts;
+ ctx->curr_err_info->op_exec_time = ev->op_info.op_exec_time;
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_REQUEST_GET_ERR_STACK;
+ vol_cb_args.args.get_err_stack.err_stack_id = H5I_INVALID_HID;
/* Get error stack for event */
- if (H5VL_request_specific(ev->request, H5VL_REQUEST_GET_ERR_STACK, &ctx->curr_err_info->err_stack_id) < 0)
+ if (H5VL_request_specific(ev->request, &vol_cb_args) < 0)
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, H5_ITER_ERROR, "unable to retrieve error stack for operation")
+ /* Set value */
+ ctx->curr_err_info->err_stack_id = vol_cb_args.args.get_err_stack.err_stack_id;
+
/* Remove event from event set's failed list */
H5ES__list_remove(&ctx->es->failed, ev);
diff --git a/src/H5ESmodule.h b/src/H5ESmodule.h
index ea9fd7a..5169b52 100644
--- a/src/H5ESmodule.h
+++ b/src/H5ESmodule.h
@@ -29,4 +29,39 @@
#define H5_MY_PKG_ERR H5E_EVENTSET
#define H5_MY_PKG_INIT YES
+/**\defgroup H5ES H5ES
+ *
+ * \todo Add the event set life cycle.
+ *
+ * \brief Event Set Interface
+ *
+ * \details \Bold{This interface can be only used with the HDF5 VOL connectors that
+ * enable the asynchronous feature in HDF5.} The native HDF5 library has
+ * only synchronous operations.
+ *
+ * HDF5 VOL connectors with support for asynchronous operations:
+ * - ASYNC
+ * - DAOS
+ *
+ * \par Example:
+ * \code
+ * fid = H5Fopen(..);
+ * gid = H5Gopen(fid, ..); //Starts when H5Fopen completes
+ * did = H5Dopen(gid, ..); //Starts when H5Gopen completes
+ *
+ * es_id = H5EScreate(); // Create event set for tracking async operations
+ * status = H5Dwrite_async(did, .., es_id); //Asynchronous, starts when H5Dopen completes,
+ * // may run concurrently with other H5Dwrite_async
+ * // in event set.
+ * status = H5Dwrite_async(did, .., es_id); //Asynchronous, starts when H5Dopen completes,
+ * // may run concurrently with other H5Dwrite_async
+ * // in event set....
+ * <other user code>
+ * ...
+ * H5ESwait(es_id); // Wait for operations in event set to complete, buffers
+ * // used for H5Dwrite_async must only be changed after wait
+ * // returns.
+ * \endcode
+ */
+
#endif /* H5ESmodule_H */
diff --git a/src/H5ESpkg.h b/src/H5ESpkg.h
index 339ce1d..a7a8e20 100644
--- a/src/H5ESpkg.h
+++ b/src/H5ESpkg.h
@@ -43,14 +43,7 @@ typedef struct H5ES_event_t {
H5VL_object_t * request; /* Request token for event */
struct H5ES_event_t *prev, *next; /* Previous and next event nodes */
- /* Useful info for debugging and error reporting */
- const char *api_name; /* Name of API routine for event */
- const char *api_args; /* Arguments to API routine */
- const char *app_file; /* Name of source file from application */
- const char *app_func; /* Name of source function from application */
- unsigned app_line; /* Line # of source file from application */
- uint64_t ev_count; /* This event is the n'th operation in the event set */
- uint64_t ev_time; /* Timestamp for this event (in ms from UNIX epoch) */
+ H5ES_op_info_t op_info; /* Useful info about operation */
} H5ES_event_t;
/* Typedef for lists of event set operations */
@@ -61,7 +54,11 @@ typedef struct H5ES_event_list_t {
/* Typedef for event set objects */
struct H5ES_t {
- uint64_t op_counter; /* Count of operations inserted into this set */
+ uint64_t op_counter; /* Count of operations inserted into this set */
+ H5ES_event_insert_func_t ins_func; /* Callback to invoke for operation inserts */
+ void * ins_ctx; /* Context for callback to invoke for operation inserts */
+ H5ES_event_complete_func_t comp_func; /* Callback to invoke for operation completions */
+ void * comp_ctx; /* Context for callback to invoke for operation inserts */
/* Active events */
H5ES_event_list_t active; /* List of active events in set */
@@ -82,10 +79,11 @@ typedef int (*H5ES_list_iter_func_t)(H5ES_event_t *ev, void *ctx);
/* Package Private Prototypes */
/******************************/
H5_DLL H5ES_t *H5ES__create(void);
+H5_DLL herr_t H5ES__insert_request(H5ES_t *es, H5VL_t *connector, void *token);
H5_DLL herr_t H5ES__wait(H5ES_t *es, uint64_t timeout, size_t *num_in_progress, hbool_t *op_failed);
+H5_DLL herr_t H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, hbool_t *op_failed);
H5_DLL herr_t H5ES__get_err_info(H5ES_t *es, size_t num_err_info, H5ES_err_info_t err_info[],
size_t *num_cleared);
-H5_DLL herr_t H5ES__close(H5ES_t *es);
/* Event list operations */
H5_DLL void H5ES__list_append(H5ES_event_list_t *el, H5ES_event_t *ev);
diff --git a/src/H5ESprivate.h b/src/H5ESprivate.h
index 4f843ba..3d9ce9f 100644
--- a/src/H5ESprivate.h
+++ b/src/H5ESprivate.h
@@ -24,8 +24,9 @@
#ifndef H5ESprivate_H
#define H5ESprivate_H
-/* Include package's public header */
-#include "H5ESpublic.h" /* Event Sets */
+/* Include package's public headers */
+#include "H5ESpublic.h"
+#include "H5ESdevelop.h"
/* Private headers needed by this file */
#include "H5VLprivate.h" /* Virtual Object Layer */
diff --git a/src/H5ESpublic.h b/src/H5ESpublic.h
index 752218b..4cf71c5 100644
--- a/src/H5ESpublic.h
+++ b/src/H5ESpublic.h
@@ -25,7 +25,7 @@
/*****************/
/* Default value for "no event set" / synchronous execution */
-#define H5ES_NONE (hid_t)0
+#define H5ES_NONE 0 /* (hid_t) */
/* Special "wait" timeout values */
#define H5ES_WAIT_FOREVER (UINT64_MAX) /* Wait until all operations complete */
@@ -42,46 +42,61 @@
/* Asynchronous operation status */
typedef enum H5ES_status_t {
- H5ES_STATUS_IN_PROGRESS, /* Operation(s) have not yet completed */
- H5ES_STATUS_SUCCEED, /* Operation(s) have completed, successfully */
- H5ES_STATUS_FAIL /* An operation has completed, but failed */
+ H5ES_STATUS_IN_PROGRESS, /* Operation(s) have not yet completed */
+ H5ES_STATUS_SUCCEED, /* Operation(s) have completed, successfully */
+ H5ES_STATUS_CANCELED, /* Operation(s) has been canceled */
+ H5ES_STATUS_FAIL /* An operation has completed, but failed */
} H5ES_status_t;
-/* Information about failed operations in event set */
-typedef struct H5ES_err_info_t {
- /* Operation info */
- char * api_name; /* Name of HDF5 API routine called */
- char * api_args; /* "Argument string" for arguments to HDF5 API routine called */
+/* Information about operations in an event set */
+typedef struct H5ES_op_info_t {
+ /* API call info */
+ char *api_name; /* Name of HDF5 API routine called */
+ char *api_args; /* "Argument string" for arguments to HDF5 API routine called */
+
+ /* Application info */
char * app_file_name; /* Name of source file where the HDF5 API routine was called */
char * app_func_name; /* Name of function where the HDF5 API routine was called */
unsigned app_line_num; /* Line # of source file where the HDF5 API routine was called */
- uint64_t op_ins_count; /* Counter of operation's insertion into event set */
- uint64_t op_ins_ts; /* Timestamp for when the operation was inserted into the event set */
+
+ /* Operation info */
+ uint64_t op_ins_count; /* Counter of operation's insertion into event set */
+ uint64_t op_ins_ts; /* Timestamp for when the operation was inserted into the event set */
+ uint64_t op_exec_ts; /* Timestamp for when the operation began execution */
+ uint64_t op_exec_time; /* Execution time for operation (in ns) */
+} H5ES_op_info_t;
+
+//! <!-- [H5ES_err_info_t_snip] -->
+/**
+ * Information about failed operations in event set
+ */
+typedef struct H5ES_err_info_t {
+ /* API call info */
+ char *api_name; /**< Name of HDF5 API routine called */
+ char *api_args; /**< "Argument string" for arguments to HDF5 API routine called */
+
+ /* Application info */
+ char * app_file_name; /**< Name of source file where the HDF5 API routine was called */
+ char * app_func_name; /**< Name of function where the HDF5 API routine was called */
+ unsigned app_line_num; /**< Line # of source file where the HDF5 API routine was called */
+
+ /* Operation info */
+ uint64_t op_ins_count; /**< Counter of operation's insertion into event set */
+ uint64_t op_ins_ts; /**< Timestamp for when the operation was inserted into the event set */
+ uint64_t op_exec_ts; /**< Timestamp for when the operation began execution */
+ uint64_t op_exec_time; /**< Execution time for operation (in ns) */
/* Error info */
- hid_t err_stack_id; /* ID for error stack from failed operation */
+ hid_t err_stack_id; /**< ID for error stack from failed operation */
} H5ES_err_info_t;
+//! <!-- [H5ES_err_info_t_snip] -->
/*
-H5ES_op_info_t:
- const char *: API name (H5Dwrite_async, ...)
- const char *: Arg string
- const char *: Appl. source file name
- const char *: Appl. source function
- unsigned: Appl. source file line
- uint64_t: Insert Time Timestamp
- uint64_t: "event count" - n'th event inserted into event set
- uint64_t: Execution Time timestamp (*)
-
More Possible Info for H5ES_op_info_t:
Parent Operation's request token (*) -> "parent event count"? -- Could be
used to "prune" child operations from reported errors, with flag
to H5ESget_err_info?
-H5ES_err_info_t:
- H5ES_op_info_t: (above)
- hid_t: Error stack (*)
-
Possible debugging routines: (Should also be configured from Env Var)
H5ESdebug_signal(hid_t es_id, signal_t sig, uint64_t <event count>);
H5ESdebug_err_trace_log(hid_t es_id, const char *filename);
@@ -98,15 +113,12 @@ Possible debugging routines: (Should also be configured from Env Var)
How to Trace Async Operations?
<Example of stacking Logging VOL Connector w/Async VOL Connector>
-"Library / wrapper developer" version of API routines: (Auto-generated)
- H5Dwrite_async_wrap(const char *app_file, const char *app_func,
- unsigned app_line_num, dset_id, mem_type_id, mem_space_id, ..., es_id);
-
- vs.
-
- H5Dwrite_async(dset_id, mem_type_id, mem_space_id, ..., es_id);
*/
+typedef int (*H5ES_event_insert_func_t)(const H5ES_op_info_t *op_info, void *ctx);
+typedef int (*H5ES_event_complete_func_t)(const H5ES_op_info_t *op_info, H5ES_status_t status,
+ hid_t err_stack, void *ctx);
+
/********************/
/* Public Variables */
/********************/
@@ -119,14 +131,161 @@ How to Trace Async Operations?
extern "C" {
#endif
-H5_DLL hid_t H5EScreate(void);
+/**
+ * \ingroup H5ES
+ *
+ * \brief Creates an event set
+ *
+ * \returns \hid_ti{event set}
+ *
+ * \details H5EScreate() creates a new event set and returns a corresponding
+ * event set identifier.
+ *
+ * \since 1.13.0
+ *
+ */
+H5_DLL hid_t H5EScreate(void);
+
+/**
+ * \ingroup H5ES
+ *
+ * \brief Waits for operations in event set to complete
+ *
+ * \es_id
+ * \param[in] timeout Total time in nanoseconds to wait for all operations in
+ * the event set to complete
+ * \param[out] num_in_progress The number of operations still in progress
+ * \param[out] err_occurred Flag if an operation in the event set failed
+ * \returns \herr_t
+ *
+ * \details H5ESwait() waits for operations in an event set \p es_id to wait
+ * with \p timeout.
+ *
+ * Timeout value is in nanoseconds, and is for the H5ESwait() call and
+ * not for each individual operation in the event set. For example, if
+ * "10" is passed as a timeout value and the event set waited 4
+ * nanoseconds for the first operation to complete, the remaining
+ * operations would be allowed to wait for at most 6 nanoseconds more,
+ * i.e., the timeout value used across all operations in the event set
+ * until it reaches 0, then any remaining operations are only checked
+ * for completion, not waited on.
+ *
+ * This call will stop waiting on operations and will return
+ * immediately if an operation fails. If a failure occurs, the value
+ * returned for the number of operations in progress may be inaccurate.
+ *
+ * \since 1.13.0
+ *
+ */
H5_DLL herr_t H5ESwait(hid_t es_id, uint64_t timeout, size_t *num_in_progress, hbool_t *err_occurred);
+H5_DLL herr_t H5EScancel(hid_t es_id, size_t *num_not_canceled, hbool_t *err_occurred);
+
+/**
+ * \ingroup H5ES
+ *
+ * \brief Retrieves number of events in an event set
+ *
+ * \es_id
+ * \param[out] count The number of events in the event set
+ * \returns \herr_t
+ *
+ * \details H5ESget_count() retrieves number of events in an event set specified
+ * by \p es_id.
+ *
+ * \since 1.13.0
+ *
+ */
H5_DLL herr_t H5ESget_count(hid_t es_id, size_t *count);
+
+/**
+ * \ingroup H5ES
+ *
+ * \todo Fill in the blanks!
+ *
+ * \since 1.13.0
+ *
+ */
H5_DLL herr_t H5ESget_op_counter(hid_t es_id, uint64_t *counter);
+
+/**
+ * \ingroup H5ES
+ *
+ * \brief Checks for failed operations
+ *
+ * \es_id
+ * \param[out] err_occurred Status indicating if error is present in the event
+ * set
+ * \returns \herr_t
+ *
+ * \details H5ESget_err_status() checks if event set specified by es_id has
+ * failed operations.
+ *
+ * \since 1.13.0
+ *
+ */
H5_DLL herr_t H5ESget_err_status(hid_t es_id, hbool_t *err_occurred);
+
+/**
+ * \ingroup H5ES
+ *
+ * \brief Retrieves the number of failed operations
+ *
+ * \es_id
+ * \param[out] num_errs Number of errors
+ * \returns \herr_t
+ *
+ * \details H5ESget_err_count() retrieves the number of failed operations in an
+ * event set specified by \p es_id.
+ *
+ * The function does not wait for active operations to complete, so
+ * count may not include all failures.
+ *
+ * \since 1.13.0
+ *
+ */
H5_DLL herr_t H5ESget_err_count(hid_t es_id, size_t *num_errs);
+
+/**
+ * \ingroup H5ES
+ *
+ * \brief Retrieves information about failed operations
+ *
+ * \es_id
+ * \param[in] num_err_info The number of elements in \p err_info array
+ * \param[out] err_info Array of structures
+ * \param[out] err_cleared Number of cleared errors
+ * \returns \herr_t
+ *
+ * \details H5ESget_err_info() retrieves information about failed operations in
+ * an event set specified by \p es_id. The strings retrieved for each
+ * error info must be released by calling H5free_memory().
+ *
+ * Below is the description of the \ref H5ES_err_info_t structure:
+ * \snippet this H5ES_err_info_t_snip
+ * \click4more
+ *
+ * \since 1.13.0
+ *
+ */
H5_DLL herr_t H5ESget_err_info(hid_t es_id, size_t num_err_info, H5ES_err_info_t err_info[],
size_t *err_cleared);
+H5_DLL herr_t H5ESfree_err_info(size_t num_err_info, H5ES_err_info_t err_info[]);
+H5_DLL herr_t H5ESregister_insert_func(hid_t es_id, H5ES_event_insert_func_t func, void *ctx);
+H5_DLL herr_t H5ESregister_complete_func(hid_t es_id, H5ES_event_complete_func_t func, void *ctx);
+
+/**
+ * \ingroup H5ES
+ *
+ * \brief Terminates access to an event set
+ *
+ * \es_id
+ * \returns \herr_t
+ *
+ * \details H5ESclose() terminates access to an event set specified by \p es_id.
+ *
+ * \since 1.13.0
+ *
+ */
H5_DLL herr_t H5ESclose(hid_t es_id);
#ifdef __cplusplus
diff --git a/src/H5Eint.c b/src/H5Eint.c
index 7e46beb..6438cd9 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -129,7 +129,7 @@ H5E__get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size)
/* Copy the message into the user's buffer, if given */
if (msg_str) {
- HDstrncpy(msg_str, msg->msg, MIN((size_t)(len + 1), size));
+ HDstrncpy(msg_str, msg->msg, size);
if ((size_t)len >= size)
msg_str[size - 1] = '\0';
} /* end if */
@@ -218,7 +218,7 @@ H5E__walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
cls_ptr = maj_ptr->cls;
/* Print error class header if new class */
- if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) {
+ if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) {
/* update to the new class information */
if (cls_ptr->cls_name)
eprint->cls.cls_name = cls_ptr->cls_name;
@@ -346,7 +346,7 @@ H5E__walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
HGOTO_DONE(FAIL)
/* Print error class header if new class */
- if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) {
+ if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) {
/* update to the new class information */
if (cls_ptr->cls_name)
eprint->cls.cls_name = cls_ptr->cls_name;
@@ -772,11 +772,12 @@ H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line
if (H5I_inc_ref(min_id, FALSE) < 0)
HGOTO_DONE(FAIL)
estack->slot[estack->nused].min_num = min_id;
- if (NULL == (estack->slot[estack->nused].func_name = H5MM_xstrdup(func)))
- HGOTO_DONE(FAIL)
- if (NULL == (estack->slot[estack->nused].file_name = H5MM_xstrdup(file)))
- HGOTO_DONE(FAIL)
- estack->slot[estack->nused].line = line;
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ estack->slot[estack->nused].func_name = func;
+ estack->slot[estack->nused].file_name = file;
+ estack->slot[estack->nused].line = line;
if (NULL == (estack->slot[estack->nused].desc = H5MM_xstrdup(desc)))
HGOTO_DONE(FAIL)
estack->nused++;
@@ -826,10 +827,11 @@ H5E__clear_entries(H5E_t *estack, size_t nentries)
HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error class")
/* Release strings */
- if (error->func_name)
- error->func_name = (const char *)H5MM_xfree_const(error->func_name);
- if (error->file_name)
- error->file_name = (const char *)H5MM_xfree_const(error->file_name);
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * and are not allocated, so there's no need to free them.
+ */
+ error->func_name = NULL;
+ error->file_name = NULL;
if (error->desc)
error->desc = (const char *)H5MM_xfree_const(error->desc);
}
diff --git a/src/H5Emodule.h b/src/H5Emodule.h
index 1670c03..58a3517 100644
--- a/src/H5Emodule.h
+++ b/src/H5Emodule.h
@@ -29,4 +29,54 @@
#define H5_MY_PKG_ERR H5E_ERROR
#define H5_MY_PKG_INIT YES
+/**\defgroup H5E H5E
+ *
+ * Use the functions in this module to manage HDF5 error stacks and error
+ * messages.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5E_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5E_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5E_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5E_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \internal The \c FUNC_ENTER macro clears the error stack whenever an
+ * interface function is entered. When an error is detected, an entry
+ * is pushed onto the stack. As the functions unwind, additional
+ * entries are pushed onto the stack. The API function will return
+ * some indication that an error occurred and the application can
+ * print the error stack.
+ *
+ * \internal Certain API functions in the \ref H5E package, such as H5Eprint(),
+ * do not clear the error stack. Otherwise, any function which does
+ * not have an underscore immediately after the package name will
+ * clear the error stack. For instance, H5Fopen() clears the error
+ * stack while \Code{H5F_open} does not.
+ *
+ * \internal An error stack has a fixed maximum size. If this size is exceeded
+ * then the stack will be truncated and only the inner-most functions
+ * will have entries on the stack. This is expected to be a rare
+ * condition.
+ *
+ * \internal Each thread has its own error stack, but since multi-threading has
+ * not been added to the library yet, this package maintains a single
+ * error stack. The error stack is statically allocated to reduce the
+ * complexity of handling errors within the \ref H5E package.
+ *
+ */
+
#endif /* H5Emodule_H */
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index 58010a3..a30cb6a 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -31,7 +31,7 @@ typedef struct H5E_t H5E_t;
* error number, the minor error number, and a description of the error.
*/
#define HERROR(maj_id, min_id, ...) \
- H5E_printf_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__)
+ H5E_printf_stack(NULL, __FILE__, __func__, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__)
/*
* HCOMMON_ERROR macro, used by HDONE_ERROR and HGOTO_ERROR
@@ -111,6 +111,7 @@ typedef struct H5E_t H5E_t;
/* Retrieve the error code description string and push it onto the error
* stack.
*/
+#ifndef H5_HAVE_WIN32_API
#define HSYS_DONE_ERROR(majorcode, minorcode, retcode, str) \
{ \
int myerrno = errno; \
@@ -129,6 +130,35 @@ typedef struct H5E_t H5E_t;
HGOTO_ERROR(majorcode, minorcode, retcode, "%s, errno = %d, error message = '%s'", str, myerrno, \
HDstrerror(myerrno)); \
}
+#else /* H5_HAVE_WIN32_API */
+/* On Windows we also emit the result of GetLastError(). This call returns a DWORD, which is always a
+ * 32-bit unsigned type. Note that on Windows, either errno or GetLastError() (but probably not both) will
+ * be useful depending on whether a C/POSIX or Win32 call failed. The other value will likely be zero,
+ * though I wouldn't count on that.
+ */
+#define HSYS_DONE_ERROR(majorcode, minorcode, retcode, str) \
+ { \
+ int myerrno = errno; \
+ DWORD win_error = GetLastError(); \
+ /* Other projects may rely on the description format to get the errno and any changes should be \
+ * considered as an API change \
+ */ \
+ HDONE_ERROR(majorcode, minorcode, retcode, \
+ "%s, errno = %d, error message = '%s', Win32 GetLastError() = %" PRIu32 "", str, \
+ myerrno, HDstrerror(myerrno), win_error); \
+ }
+#define HSYS_GOTO_ERROR(majorcode, minorcode, retcode, str) \
+ { \
+ int myerrno = errno; \
+ DWORD win_error = GetLastError(); \
+ /* Other projects may rely on the description format to get the errno and any changes should be \
+ * considered as an API change \
+ */ \
+ HGOTO_ERROR(majorcode, minorcode, retcode, \
+ "%s, errno = %d, error message = '%s', Win32 GetLastError() = %" PRIu32 "", str, \
+ myerrno, HDstrerror(myerrno), win_error); \
+ }
+#endif /* H5_HAVE_WIN32_API */
#ifdef H5_HAVE_PARALLEL
/*
@@ -138,70 +168,18 @@ typedef struct H5E_t H5E_t;
extern char H5E_mpi_error_str[MPI_MAX_ERROR_STRING];
extern int H5E_mpi_error_str_len;
-#define HMPI_ERROR(mpierr) \
- { \
- MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \
- HERROR(H5E_INTERNAL, H5E_MPIERRSTR, "%s", H5E_mpi_error_str); \
- }
#define HMPI_DONE_ERROR(retcode, str, mpierr) \
{ \
- HMPI_ERROR(mpierr); \
- HDONE_ERROR(H5E_INTERNAL, H5E_MPI, retcode, str); \
+ MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \
+ HDONE_ERROR(H5E_INTERNAL, H5E_MPI, retcode, "%s: MPI error string is '%s'", str, H5E_mpi_error_str); \
}
#define HMPI_GOTO_ERROR(retcode, str, mpierr) \
{ \
- HMPI_ERROR(mpierr); \
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, retcode, str); \
+ MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, retcode, "%s: MPI error string is '%s'", str, H5E_mpi_error_str); \
}
#endif /* H5_HAVE_PARALLEL */
-/******************************************************************************/
-/* Revisions to Error Macros, to go with Revisions to FUNC_ENTER/LEAVE Macros */
-/******************************************************************************/
-
-/*
- * H5E_PRINTF macro, used to facilitate error reporting between a BEGIN_FUNC()
- * and an END_FUNC() within a function body. The arguments are the minor
- * error number, a description of the error (as a printf-like format string),
- * and an optional set of arguments for the printf format arguments.
- */
-#define H5E_PRINTF(...) \
- H5E_printf_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, H5_MY_PKG_ERR, __VA_ARGS__)
-
-/*
- * H5_LEAVE macro, used to facilitate control flow between a
- * BEGIN_FUNC() and an END_FUNC() within a function body. The argument is
- * the return value.
- * The return value is assigned to a variable `ret_value' and control branches
- * to the `catch_except' label, if we're not already past it.
- */
-#define H5_LEAVE(v) \
- { \
- ret_value = v; \
- if (!past_catch) \
- goto catch_except; \
- }
-
-/*
- * H5E_THROW macro, used to facilitate error reporting between a
- * FUNC_ENTER() and a FUNC_LEAVE() within a function body. The arguments are
- * the minor error number, and an error string.
- * The return value is assigned to a variable `ret_value' and control branches
- * to the `catch_except' label, if we're not already past it.
- */
-#define H5E_THROW(...) \
- { \
- H5E_PRINTF(__VA_ARGS__); \
- H5_LEAVE(fail_value) \
- }
-
-/* Macro for "catching" flow of control when an error occurs. Note that the
- * H5_LEAVE macro won't jump back here once it's past this point.
- */
-#define CATCH \
-catch_except:; \
- past_catch = TRUE;
-
/* Library-private functions defined in H5E package */
H5_DLL herr_t H5E_init(void);
H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id,
diff --git a/src/H5Epublic.h b/src/H5Epublic.h
index 1deef04..9dfd1fc 100644
--- a/src/H5Epublic.h
+++ b/src/H5Epublic.h
@@ -24,20 +24,31 @@
#include "H5Ipublic.h"
/* Value for the default error stack */
-#define H5E_DEFAULT (hid_t)0
+#define H5E_DEFAULT 0 /* (hid_t) */
-/* Different kinds of error information */
+/**
+ * Different kinds of error information
+ */
typedef enum H5E_type_t { H5E_MAJOR, H5E_MINOR } H5E_type_t;
-/* Information about an error; element of error stack */
+/**
+ * Information about an error; element of error stack
+ */
typedef struct H5E_error2_t {
- hid_t cls_id; /*class ID */
- hid_t maj_num; /*major error ID */
- hid_t min_num; /*minor error number */
- unsigned line; /*line in file where error occurs */
- const char *func_name; /*function in which error occurred */
- const char *file_name; /*file in which error occurred */
- const char *desc; /*optional supplied description */
+ hid_t cls_id;
+ /**< Class ID */
+ hid_t maj_num;
+ /**< Major error ID */
+ hid_t min_num;
+ /**< Minor error number */
+ unsigned line;
+ /**< Line in file where error occurs */
+ const char *func_name;
+ /**< Function in which error occurred */
+ const char *file_name;
+ /**< File in which error occurred */
+ const char *desc;
+ /**< Optional supplied description */
} H5E_error2_t;
/* When this header is included from a private header, don't make calls to H5open() */
@@ -61,12 +72,12 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g;
* trying something that's likely or expected to fail. The code to try can
* be nested between calls to H5Eget_auto() and H5Eset_auto(), but it's
* easier just to use this macro like:
- * H5E_BEGIN_TRY {
- * ...stuff here that's likely to fail...
+ * H5E_BEGIN_TRY {
+ * ...stuff here that's likely to fail...
* } H5E_END_TRY;
*
* Warning: don't break, return, or longjmp() from the body of the loop or
- * the error reporting won't be properly restored!
+ * the error reporting won't be properly restored!
*
* These two macros still use the old API functions for backward compatibility
* purpose.
@@ -124,10 +135,10 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g;
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */
/* And return after pushing error onto stack */
#define H5Epush_ret(func, cls, maj, min, str, ret) \
- { \
+ do { \
H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, cls, maj, min, str); \
return (ret); \
- }
+ } while (0)
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in
* And goto a label after pushing error onto stack.
@@ -138,10 +149,12 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g;
goto label; \
}
-/* Error stack traversal direction */
+/**
+ * Error stack traversal direction
+ */
typedef enum H5E_direction_t {
- H5E_WALK_UPWARD = 0, /*begin deep, end at API function */
- H5E_WALK_DOWNWARD = 1 /*begin at API function, end deep */
+ H5E_WALK_UPWARD = 0, /**< begin w/ most specific error, end at API function */
+ H5E_WALK_DOWNWARD = 1 /**< begin at API function, end w/ most specific error */
} H5E_direction_t;
#ifdef __cplusplus
@@ -149,30 +162,498 @@ extern "C" {
#endif
/* Error stack traversal callback function pointers */
+//! <!-- [H5E_walk2_t_snip] -->
+/**
+ * \brief Callback function for H5Ewalk2()
+ *
+ * \param[in] n Indexed error position in the stack
+ * \param[in] err_desc Pointer to a data structure describing the error
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data);
+//! <!-- [H5E_walk2_t_snip] -->
+
+//! <!-- [H5E_auto2_t_snip] -->
+/**
+ * \brief Callback function for H5Eset_auto2()
+ *
+ * \estack_id{estack}
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_auto2_t)(hid_t estack, void *client_data);
+//! <!-- [H5E_auto2_t_snip] -->
/* Public API functions */
-H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version);
-H5_DLL herr_t H5Eunregister_class(hid_t class_id);
-H5_DLL herr_t H5Eclose_msg(hid_t err_id);
-H5_DLL hid_t H5Ecreate_msg(hid_t cls, H5E_type_t msg_type, const char *msg);
-H5_DLL hid_t H5Ecreate_stack(void);
-H5_DLL hid_t H5Eget_current_stack(void);
-H5_DLL herr_t H5Eappend_stack(hid_t dst_stack_id, hid_t src_stack_id, hbool_t close_source_stack);
-H5_DLL herr_t H5Eclose_stack(hid_t stack_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Registers a client library or application program to the HDF5 error API
+ *
+ * \param[in] cls_name Name of the error class
+ * \param[in] lib_name Name of the client library or application to which the error class belongs
+ * \param[in] version Version of the client library or application to which the
+ error class belongs. Can be \c NULL.
+ * \return Returns a class identifier on success; otherwise returns H5I_INVALID_ID.
+ *
+ * \details H5Eregister_class() registers a client library or application
+ * program to the HDF5 error API so that the client library or
+ * application program can report errors together with the HDF5
+ * library. It receives an identifier for this error class for further
+ * error operations. The library name and version number will be
+ * printed out in the error message as a preamble.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Removes an error class
+ *
+ * \param[in] class_id Error class identifier.
+ * \return \herr_t
+ *
+ * \details H5Eunregister_class() removes the error class specified by \p
+ * class_id. All the major and minor errors in this class will also be
+ * closed.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eunregister_class(hid_t class_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Closes an error message
+ *
+ * \param[in] err_id An error message identifier
+ * \return \herr_t
+ *
+ * \details H5Eclose_msg() closes an error message identifier, which can be
+ * either a major or minor message.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eclose_msg(hid_t err_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Adds a major error message to an error class
+ *
+ * \param[in] cls An error class identifier
+ * \param[in] msg_type The type of the error message
+ * \param[in] msg Major error message
+ * \return \herr_t
+ *
+ * \details H5Ecreate_msg() adds an error message to an error class defined by
+ * client library or application program. The error message can be
+ * either major or minor as indicated by the parameter \p msg_type.
+ *
+ * Use H5Eclose_msg() to close the message identifier returned by this
+ * function.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Ecreate_msg(hid_t cls, H5E_type_t msg_type, const char *msg);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Creates a new, empty error stack
+ *
+ * \return \hid_ti{error stack}
+ *
+ * \details H5Ecreate_stack() creates a new empty error stack and returns the
+ * new stack’s identifier. Use H5Eclose_stack() to close the error stack
+ * identifier returned by this function.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Ecreate_stack(void);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns a copy of the current error stack
+ *
+ * \return \hid_ti{error stack}
+ *
+ * \details H5Eget_current_stack() copies the current error stack and returns an
+ * error stack identifier for the new copy.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Eget_current_stack(void);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Appends one error stack to another, optionally closing the source
+ * stack.
+ *
+ * \estack_id{dst_stack_id}
+ * \estack_id{src_stack_id}
+ * \param[in] close_source_stack Flag to indicate whether to close the source stack
+ * \return \herr_t
+ *
+ * \details H5Eappend_stack() appends the messages from error stack
+ * \p src_stack_id to the error stack \p dst_stack_id.
+ * If \p close_source_stack is \c TRUE, the source error stack
+ * will be closed.
+ *
+ * \since 1.13.0
+ */
+H5_DLL herr_t H5Eappend_stack(hid_t dst_stack_id, hid_t src_stack_id, hbool_t close_source_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Closes an error stack handle
+ *
+ * \estack_id{stack_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Eclose_stack() closes the error stack handle \p stack_id
+ * and releases its resources. #H5E_DEFAULT cannot be closed.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eclose_stack(hid_t stack_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Retrieves error class name
+ *
+ * \param[in] class_id Error class identifier
+ * \param[out] name Buffer for the error class name
+ * \param[in] size The maximum number of characters the class name to be returned
+ * by this function in\p name.
+ * \return Returns non-negative value as on success; otherwise returns negative value.
+ *
+ * \details H5Eget_class_name() retrieves the name of the error class specified
+ * by the class identifier. If non-NULL pointer is passed in for \p
+ * name and \p size is greater than zero, the class name of \p size
+ * long is returned. The length of the error class name is also
+ * returned. If NULL is passed in as \p name, only the length of class
+ * name is returned. If zero is returned, it means no name. The user is
+ * responsible for allocating sufficient buffer space for the name.
+ *
+ * \since 1.8.0
+ */
H5_DLL ssize_t H5Eget_class_name(hid_t class_id, char *name, size_t size);
-H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id);
-H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id,
- hid_t maj_id, hid_t min_id, const char *msg, ...);
-H5_DLL herr_t H5Epop(hid_t err_stack, size_t count);
-H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream);
-H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func, void *client_data);
-H5_DLL herr_t H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data);
-H5_DLL herr_t H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data);
-H5_DLL herr_t H5Eclear2(hid_t err_stack);
-H5_DLL herr_t H5Eauto_is_v2(hid_t err_stack, unsigned *is_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Replaces the current error stack
+ *
+ * \estack_id{err_stack_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Eset_current_stack() replaces the content of the current error
+ * stack with a copy of the content of the error stack specified by
+ * \p err_stack_id, and it closes the error stack specified by
+ * \p err_stack_id.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Pushes a new error record onto an error stack
+ *
+ * \estack_id{err_stack}. If the identifier is #H5E_DEFAULT, the error record
+ * will be pushed to the current stack.
+ * \param[in] file Name of the file in which the error was detected
+ * \param[in] func Name of the function in which the error was detected
+ * \param[in] line Line number in the file where the error was detected
+ * \param[in] cls_id Error class identifier
+ * \param[in] maj_id Major error identifier
+ * \param[in] min_id Minor error identifier
+ * \param[in] msg Error description string
+ * \return \herr_t
+ *
+ * \details H5Epush2() pushes a new error record onto the error stack specified
+ * by \p err_stack.\n
+ * The error record contains the error class identifier \p cls_id, the
+ * major and minor message identifiers \p maj_id and \p min_id, the
+ * function name \p func where the error was detected, the file name \p
+ * file and line number \p line in the file where the error was
+ * detected, and an error description \p msg.\n
+ * The major and minor errors must be in the same error class.\n
+ * The function name, filename, and error description strings must be
+ * statically allocated.\n
+ * \p msg can be a format control string with additional
+ * arguments. This design of appending additional arguments is similar
+ * to the system and C functions printf() and fprintf().
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id,
+ hid_t maj_id, hid_t min_id, const char *msg, ...);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Deletes specified number of error messages from the error stack
+ *
+ * \estack_id{err_stack}
+ * \param[in] count The number of error messages to be deleted from the top
+ * of error stack
+ * \return \herr_t
+ *
+ * \details H5Epop() deletes the number of error records specified in \p count
+ * from the top of the error stack specified by \p err_stack (including
+ * major, minor messages and description). The number of error messages
+ * to be deleted is specified by \p count.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Epop(hid_t err_stack, size_t count);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Prints the specified error stack in a default manner
+ *
+ * \estack_id{err_stack}
+ * \param[in] stream File pointer, or \c NULL for \c stderr
+ * \return \herr_t
+ *
+ * \details H5Eprint2() prints the error stack specified by \p err_stack on the
+ * specified stream, \p stream. Even if the error stack is empty, a
+ * one-line message of the following form will be printed:
+ * \code{.unparsed}
+ * HDF5-DIAG: Error detected in HDF5 library version: 1.5.62 thread 0.
+ * \endcode
+ *
+ * A similar line will appear before the error messages of each error
+ * class stating the library name, library version number, and thread
+ * identifier.
+ *
+ * If \p err_stack is #H5E_DEFAULT, the current error stack will be
+ * printed.
+ *
+ * H5Eprint2() is a convenience function for H5Ewalk2() with a function
+ * that prints error messages. Users are encouraged to write their own
+ * more specific error handlers.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Walks the specified error stack, calling the specified function
+ *
+ * \estack_id{err_stack}
+ * \param[in] direction Direction in which the error stack is to be walked
+ * \param[in] func Function to be called for each error encountered
+ * \param[in] client_data Data to be passed to \p func
+ * \return \herr_t
+ *
+ * \details H5Ewalk2() walks the error stack specified by err_stack for the
+ * current thread and calls the function specified in \p func for each
+ * error along the way.
+ *
+ * If the value of \p err_stack is #H5E_DEFAULT, then H5Ewalk2() walks
+ * the current error stack.
+ *
+ * \p direction specifies whether the stack is walked from the inside
+ * out or the outside in. A value of #H5E_WALK_UPWARD means to begin
+ * with the most specific error and end at the API; a value of
+ * #H5E_WALK_DOWNWARD means to start at the API and end at the
+ * innermost function where the error was first detected.
+ *
+ * \p func, a function conforming to the #H5E_walk2_t prototype, will
+ * be called for each error in the error stack. Its arguments will
+ * include an index number \c n (beginning at zero regardless of stack
+ * traversal direction), an error stack entry \c err_desc, and the \c
+ * client_data pointer passed to H5Eprint(). The #H5E_walk2_t prototype
+ * is as follows:
+ * \snippet this H5E_walk2_t_snip
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func, void *client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns the settings for the automatic error stack traversal
+ * function and its data
+ *
+ * \estack_id
+ * \param[out] func The function currently set to be called upon an error condition
+ * \param[out] client_data Data currently set to be passed to the error function
+ * \return \herr_t
+ *
+ * \details H5Eget_auto2() returns the settings for the automatic error stack
+ * traversal function, \p func, and its data, \p client_data, that are
+ * associated with the error stack specified by \p estack_id.
+ *
+ * Either or both of the \p func and \p client_data arguments may be
+ * \c NULL, in which case the value is not returned.
+ *
+ * The library initializes its default error stack traversal functions
+ * to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns
+ * H5Eprint2() or the user-defined function passed in through
+ * H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the
+ * user-defined function passed in through H5Eset_auto1(). However, if
+ * the application passes in a user-defined function through
+ * H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal
+ * function. If the application passes in a user-defined function
+ * through H5Eset_auto2(), it should call H5Eget_auto2() to query the
+ * traversal function.
+ *
+ * Mixing the new style and the old style functions will cause a
+ * failure. For example, if the application sets a user-defined
+ * old-style traversal function through H5Eset_auto1(), a call to
+ * H5Eget_auto2() will fail and will indicate that the application has
+ * mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing
+ * H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if
+ * the traversal functions are the library’s default H5Eprint1() or
+ * H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing
+ * H5Eset_auto2() and H5Eget_auto1() does not fail.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Turns automatic error printing on or off
+ *
+ * \estack_id
+ * \param[in] func Function to be called upon an error condition
+ * \param[in] client_data Data passed to the error function
+ * \return \herr_t
+ *
+ * \details H5Eset_auto2() turns on or off automatic printing of errors for the
+ * error stack specified with \p estack_id. An \p estack_id value of
+ * #H5E_DEFAULT indicates the current stack.
+ *
+ * When automatic printing is turned on, by the use of a non-null \p func
+ * pointer, any API function which returns an error indication will
+ * first call \p func, passing it \p client_data as an argument.
+ *
+ * \p func, a function compliant with the #H5E_auto2_t prototype, is
+ * defined in the H5Epublic.h source code file as:
+ * \snippet this H5E_auto2_t_snip
+ *
+ * When the library is first initialized, the auto printing function is
+ * set to H5Eprint2() (cast appropriately) and \p client_data is the
+ * standard error stream pointer, \c stderr.
+ *
+ * Automatic stack traversal is always in the #H5E_WALK_DOWNWARD
+ * direction.
+ *
+ * Automatic error printing is turned off with a H5Eset_auto2() call
+ * with a \c NULL \p func pointer.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Clears the specified error stack or the error stack for the current thread
+ *
+ * \estack_id{err_stack}
+ * \return \herr_t
+ *
+ * \details H5Eclear2() clears the error stack specified by \p err_stack, or, if
+ * \p err_stack is set to #H5E_DEFAULT, the error stack for the current
+ * thread.
+ *
+ * \p err_stack is an error stack identifier, such as that returned by
+ * H5Eget_current_stack().
+ *
+ * The current error stack is also cleared whenever an API function is
+ * called, with certain exceptions (for instance, H5Eprint1() or
+ * H5Eprint2()).
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eclear2(hid_t err_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Determines the type of error stack
+ *
+ * \estack_id{err_stack}
+ * \param[out] is_stack A flag indicating which error stack \c typedef the
+ * specified error stack conforms to
+ *
+ * \return \herr_t
+ *
+ * \details H5Eauto_is_v2() determines whether the error auto reporting function
+ * for an error stack conforms to the #H5E_auto2_t \c typedef or the
+ * #H5E_auto1_t \c typedef.
+ *
+ * The \p is_stack parameter is set to 1 if the error stack conforms to
+ * #H5E_auto2_t and 0 if it conforms to #H5E_auto1_t.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eauto_is_v2(hid_t err_stack, unsigned *is_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Retrieves an error message
+ *
+ * \param[in] msg_id Error message identifier
+ * \param[out] type The type of the error message Valid values are #H5E_MAJOR
+ * and #H5E_MINOR.
+ * \param[out] msg Error message buffer
+ * \param[in] size The length of error message to be returned by this function
+ * \return Returns the size of the error message in bytes on success; otherwise
+ * returns a negative value.
+ *
+ * \details H5Eget_msg() retrieves the error message including its length and
+ * type. The error message is specified by \p msg_id. The user is
+ * responsible for passing in sufficient buffer space for the
+ * message. If \p msg is not NULL and \p size is greater than zero, the
+ * error message of \p size long is returned. The length of the message
+ * is also returned. If NULL is passed in as \p msg, only the length
+ * and type of the message is returned. If the return value is zero, it
+ * means there is no message.
+ *
+ * \since 1.8.0
+ */
H5_DLL ssize_t H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg, size_t size);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Retrieves the number of error messages in an error stack
+ *
+ * \estack_id{error_stack_id}
+ * \return Returns a non-negative value on success; otherwise returns a negative value.
+ *
+ * \details H5Eget_num() retrieves the number of error records in the error
+ * stack specified by \p error_stack_id (including major, minor
+ * messages and description).
+ *
+ * \since 1.8.0
+ */
H5_DLL ssize_t H5Eget_num(hid_t error_stack_id);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
@@ -189,30 +670,267 @@ H5_DLL ssize_t H5Eget_num(hid_t error_stack_id);
typedef hid_t H5E_major_t;
typedef hid_t H5E_minor_t;
-/* Information about an error element of error stack. */
+/**
+ * Information about an error element of error stack.
+ */
typedef struct H5E_error1_t {
- H5E_major_t maj_num; /*major error number */
- H5E_minor_t min_num; /*minor error number */
- const char *func_name; /*function in which error occurred */
- const char *file_name; /*file in which error occurred */
- unsigned line; /*line in file where error occurs */
- const char *desc; /*optional supplied description */
+ H5E_major_t maj_num; /**< major error number */
+ H5E_minor_t min_num; /**< minor error number */
+ const char *func_name; /**< function in which error occurred */
+ const char *file_name; /**< file in which error occurred */
+ unsigned line; /**< line in file where error occurs */
+ const char *desc; /**< optional supplied description */
} H5E_error1_t;
/* Error stack traversal callback function pointers */
+//! <!-- [H5E_walk1_t_snip] -->
+/**
+ * \brief Callback function for H5Ewalk1()
+ *
+ * \param[in] n Indexed error position in the stack
+ * \param[in] err_desc Pointer to a data structure describing the error
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data);
+//! <!-- [H5E_walk1_t_snip] -->
+
+//! <!-- [H5E_auto1_t_snip] -->
+/**
+ * \brief Callback function for H5Eset_auto1()
+ *
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_auto1_t)(void *client_data);
+//! <!-- [H5E_auto1_t_snip] -->
/* Function prototypes */
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Clears the error stack for the current thread
+ *
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function H5Eclear() renamed to H5Eclear1() and deprecated
+ * in this release.
+ *
+ * \details H5Eclear1() clears the error stack for the current thread.\n
+ * The stack is also cleared whenever an API function is called, with
+ * certain exceptions (for instance, H5Eprint1()).
+ *
+ */
H5_DLL herr_t H5Eclear1(void);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns the current settings for the automatic error stack traversal
+ * function and its data
+ *
+ * \param[out] func Current setting for the function to be called upon an error
+ * condition
+ * \param[out] client_data Current setting for the data passed to the error
+ * function
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function H5Eget_auto() renamed to H5Eget_auto1() and
+ * deprecated in this release.
+ *
+ * \details H5Eget_auto1() returns the current settings for the automatic error
+ * stack traversal function, \p func, and its data,
+ * \p client_data. Either or both arguments may be \c NULL, in which case the
+ * value is not returned.
+ *
+ * The library initializes its default error stack traversal functions
+ * to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns
+ * H5Eprint2() or the user-defined function passed in through
+ * H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the
+ * user-defined function passed in through H5Eset_auto1(). However, if
+ * the application passes in a user-defined function through
+ * H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal
+ * function. If the application passes in a user-defined function
+ * through H5Eset_auto2(), it should call H5Eget_auto2() to query the
+ * traversal function.
+ *
+ * Mixing the new style and the old style functions will cause a
+ * failure. For example, if the application sets a user-defined
+ * old-style traversal function through H5Eset_auto1(), a call to
+ * H5Eget_auto2() will fail and will indicate that the application has
+ * mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing
+ * H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if
+ * the traversal functions are the library’s default H5Eprint1() or
+ * H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing
+ * H5Eset_auto2() and H5Eget_auto1() does not fail.
+ *
+ */
H5_DLL herr_t H5Eget_auto1(H5E_auto1_t *func, void **client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Pushes a new error record onto the error stack
+ *
+ * \param[in] file Name of the file in which the error was detected
+ * \param[in] func Name of the function in which the error was detected
+ * \param[in] line Line number in the file where the error was detected
+ * \param[in] maj Major error identifier
+ * \param[in] min Minor error identifier
+ * \param[in] str Error description string
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function H5Epush() renamed to H5Epush1() and
+ * deprecated in this release.
+ *
+ * \details H5Epush1() pushes a new error record onto the error stack for the
+ * current thread.\n
+ * The error has major and minor numbers \p maj_num
+ * and \p min_num, the function \p func where the error was detected, the
+ * name of the file \p file where the error was detected, the line \p line
+ * within that file, and an error description string \p str.\n
+ * The function name, filename, and error description strings must be statically
+ * allocated.
+ *
+ * \since 1.4.0
+ */
H5_DLL herr_t H5Epush1(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min,
const char *str);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Prints the current error stack in a default manner
+ *
+ * \param[in] stream File pointer, or \c NULL for \c stderr
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function H5Eprint() renamed to H5Eprint1() and
+ * deprecated in this release.
+ *
+ * \details H5Eprint1() prints prints the error stack for the current thread
+ * on the specified stream, \p stream. Even if the error stack is empty, a
+ * one-line message of the following form will be printed:
+ * \code{.unparsed}
+ * HDF5-DIAG: Error detected in thread 0.
+ * \endcode
+ * H5Eprint1() is a convenience function for H5Ewalk1() with a function
+ * that prints error messages. Users are encouraged to write their own
+ * more specific error handlers.
+ *
+ */
H5_DLL herr_t H5Eprint1(FILE *stream);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Turns automatic error printing on or off
+ *
+ * \param[in] func Function to be called upon an error condition
+ * \param[in] client_data Data passed to the error function
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function H5Eset_auto() renamed to H5Eset_auto1() and
+ * deprecated in this release.
+ *
+ * \details H5Eset_auto1() turns on or off automatic printing of errors. When
+ * turned on (non-null \p func pointer), any API function which returns
+ * an error indication will first call \p func, passing it \p
+ * client_data as an argument.
+ *
+ * \p func, a function conforming to the #H5E_auto1_t prototype, is
+ * defined in the H5Epublic.h source code file as:
+ * \snippet this H5E_auto1_t_snip
+ *
+ * When the library is first initialized, the auto printing function is
+ * set to H5Eprint1() (cast appropriately) and \p client_data is the
+ * standard error stream pointer, \c stderr.
+ *
+ * Automatic stack traversal is always in the #H5E_WALK_DOWNWARD
+ * direction.
+ *
+ */
H5_DLL herr_t H5Eset_auto1(H5E_auto1_t func, void *client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Walks the current error stack, calling the specified function
+ *
+ * \param[in] direction Direction in which the error stack is to be walked
+ * \param[in] func Function to be called for each error encountered
+ * \param[in] client_data Data to be passed to \p func
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function H5Ewalk() renamed to H5Ewalk1() and
+ * deprecated in this release.
+ *
+ * \details H5Ewalk1() walks the error stack for the current thread and calls
+ * the function specified in \p func for each error along the way.
+ *
+ * \p direction specifies whether the stack is walked from the inside
+ * out or the outside in. A value of #H5E_WALK_UPWARD means to begin
+ * with the most specific error and end at the API; a value of
+ * #H5E_WALK_DOWNWARD means to start at the API and end at the
+ * innermost function where the error was first detected.
+ *
+ * \p func, a function conforming to the #H5E_walk1_t prototype, will
+ * be called for each error in the error stack. Its arguments will
+ * include an index number \c n (beginning at zero regardless of stack
+ * traversal direction), an error stack entry \c err_desc, and the \c
+ * client_data pointer passed to H5Eprint(). The #H5E_walk1_t prototype
+ * is as follows:
+ * \snippet this H5E_walk1_t_snip
+ *
+ */
H5_DLL herr_t H5Ewalk1(H5E_direction_t direction, H5E_walk1_t func, void *client_data);
-H5_DLL char * H5Eget_major(H5E_major_t maj);
-H5_DLL char * H5Eget_minor(H5E_minor_t min);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns a character string describing an error specified by a major
+ * error number
+ *
+ * \param[in] maj Major error number
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function deprecated in this release.
+ *
+ * \details Given a major error number, H5Eget_major() returns a constant
+ * character string that describes the error.
+ *
+ * \attention This function returns a dynamically allocated string (\c char
+ * array). An application calling this function must free the memory
+ * associated with the return value to prevent a memory leak.
+ *
+ */
+H5_DLL char *H5Eget_major(H5E_major_t maj);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns a character string describing an error specified by a minor
+ * error number
+ *
+ * \param[in] min Minor error number
+ * \return \herr_t
+ *
+ * \deprecated 1.8.0 Function deprecated and return type changed in this release.
+ *
+ * \details Given a minor error number, H5Eget_minor() returns a constant
+ * character string that describes the error.
+ *
+ * \attention In the Release 1.8.x series, H5Eget_minor() returns a string of
+ * dynamic allocated \c char array. An application calling this
+ * function from an HDF5 library of Release 1.8.0 or later must free
+ * the memory associated with the return value to prevent a memory
+ * leak. This is a change from the 1.6.x release series.
+ *
+ */
+H5_DLL char *H5Eget_minor(H5E_minor_t min);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
diff --git a/src/H5F.c b/src/H5F.c
index 8618851..8a28b00 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -112,8 +112,9 @@ H5FL_EXTERN(H5VL_object_t);
hid_t
H5Fget_create_plist(hid_t file_id)
{
- H5VL_object_t *vol_obj; /* File info */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* File for file_id */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", file_id);
@@ -122,10 +123,17 @@ H5Fget_create_plist(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_FCPL;
+ vol_cb_args.args.get_fcpl.fcpl_id = H5I_INVALID_HID;
+
/* Retrieve the file creation property list */
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_FCPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0)
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, H5I_INVALID_HID, "unable to retrieve file creation properties")
+ /* Set return value */
+ ret_value = vol_cb_args.args.get_fcpl.fcpl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_create_plist() */
@@ -151,8 +159,9 @@ done:
hid_t
H5Fget_access_plist(hid_t file_id)
{
- H5VL_object_t *vol_obj; /* File info */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* File for file_id */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", file_id);
@@ -161,10 +170,17 @@ H5Fget_access_plist(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_FAPL;
+ vol_cb_args.args.get_fapl.fapl_id = H5I_INVALID_HID;
+
/* Retrieve the file's access property list */
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_FAPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0)
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't get file access property list")
+ /* Set return value */
+ ret_value = vol_cb_args.args.get_fapl.fapl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_access_plist() */
@@ -222,16 +238,25 @@ H5Fget_obj_count(hid_t file_id, unsigned types)
* count the IDs in the file.
*/
if (file_id != (hid_t)H5F_OBJ_ALL) {
- H5VL_object_t *vol_obj;
+ H5VL_object_t * vol_obj; /* File for file_id */
+ size_t count = 0; /* Object count */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
/* Get the file object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a file id")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_OBJ_COUNT;
+ vol_cb_args.args.get_obj_count.types = types;
+ vol_cb_args.args.get_obj_count.count = &count;
+
/* Get the count */
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_OBJ_COUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, types,
- &ret_value) < 0)
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get object count in file(s)")
+
+ /* Set return value */
+ ret_value = (ssize_t)count;
}
/* If we passed in the 'special' ID, get the count for everything open in the
* library, iterating over all open files and getting the object count for each.
@@ -333,16 +358,27 @@ H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list /
* get the IDs from the file.
*/
if (file_id != (hid_t)H5F_OBJ_ALL) {
- H5VL_object_t *vol_obj;
+ H5VL_object_t * vol_obj; /* File for file_id */
+ size_t count = 0; /* Object count */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
/* get the file object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_OBJ_IDS;
+ vol_cb_args.args.get_obj_ids.types = types;
+ vol_cb_args.args.get_obj_ids.max_objs = max_objs;
+ vol_cb_args.args.get_obj_ids.oid_list = oid_list;
+ vol_cb_args.args.get_obj_ids.count = &count;
+
/* Get the IDs */
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_OBJ_IDS, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, types,
- max_objs, oid_list, &ret_value) < 0)
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get object ids in file(s)")
+
+ /* Set return value */
+ ret_value = (ssize_t)count;
} /* end if */
/* If we passed in the 'special' ID, get the count for everything open in the
* library, iterating over all open files and getting the object count for each.
@@ -396,8 +432,10 @@ done:
herr_t
H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle /*out*/)
{
- H5VL_object_t *vol_obj; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "iix", file_id, fapl_id, file_handle);
@@ -410,9 +448,14 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_vfd_handle.fapl_id = fapl_id;
+ file_opt_args.get_vfd_handle.file_handle = file_handle;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_VFD_HANDLE;
+ vol_cb_args.args = &file_opt_args;
+
/* Retrieve the VFD handle for the file */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_VFD_HANDLE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, file_handle, fapl_id) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get VFD handle")
done:
@@ -432,7 +475,9 @@ done:
htri_t
H5Fis_accessible(const char *filename, hid_t fapl_id)
{
- htri_t ret_value; /* Return value */
+ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ hbool_t is_accessible = FALSE; /* Whether file is accessible */
+ htri_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("t", "*si", filename, fapl_id);
@@ -447,11 +492,19 @@ H5Fis_accessible(const char *filename, hid_t fapl_id)
else if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file access property list")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_IS_ACCESSIBLE;
+ vol_cb_args.args.is_accessible.filename = filename;
+ vol_cb_args.args.is_accessible.fapl_id = fapl_id;
+ vol_cb_args.args.is_accessible.accessible = &is_accessible;
+
/* Check if file is accessible */
- if (H5VL_file_specific(NULL, H5VL_FILE_IS_ACCESSIBLE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fapl_id,
- filename, &ret_value) < 0)
+ if (H5VL_file_specific(NULL, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to determine if file is accessible as HDF5")
+ /* Set return value */
+ ret_value = (htri_t)is_accessible;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fis_accessible() */
@@ -477,10 +530,17 @@ H5F__post_open_api_common(H5VL_object_t *vol_obj, void **token_ptr)
supported = 0;
if (H5VL_introspect_opt_query(vol_obj, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't check for 'post open' operation")
- if (supported & H5VL_OPT_QUERY_SUPPORTED)
+ if (supported & H5VL_OPT_QUERY_SUPPORTED) {
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
+ vol_cb_args.args = NULL;
+
/* Make the 'post open' callback */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to make file 'post open' callback")
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -651,7 +711,7 @@ H5Fcreate_async(const char *app_file, const char *app_func, unsigned app_line, c
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE8(FUNC, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0) {
+ H5ARG_TRACE8(__func__, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on file ID")
@@ -670,7 +730,7 @@ H5Fcreate_async(const char *app_file, const char *app_func, unsigned app_line, c
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE8(FUNC, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0)
+ H5ARG_TRACE8(__func__, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set")
@@ -828,7 +888,7 @@ H5Fopen_async(const char *app_file, const char *app_func, unsigned app_line, con
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on file ID")
@@ -847,7 +907,7 @@ H5Fopen_async(const char *app_file, const char *app_func, unsigned app_line, con
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0)
+ H5ARG_TRACE7(__func__, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set")
@@ -870,8 +930,9 @@ H5F__flush_api_common(hid_t object_id, H5F_scope_t scope, void **token_ptr, H5VL
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5I_type_t obj_type; /* Type of object to use */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5I_type_t obj_type; /* Type of object to use */
+ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -885,9 +946,13 @@ H5F__flush_api_common(hid_t object_id, H5F_scope_t scope, void **token_ptr, H5VL
if (NULL == (*vol_obj_ptr = H5VL_vol_object(object_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_FLUSH;
+ vol_cb_args.args.flush.obj_type = obj_type;
+ vol_cb_args.args.flush.scope = scope;
+
/* Flush the object */
- if (H5VL_file_specific(*vol_obj_ptr, H5VL_FILE_FLUSH, H5P_DATASET_XFER_DEFAULT, token_ptr, (int)obj_type,
- (int)scope) < 0)
+ if (H5VL_file_specific(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file")
done:
@@ -955,7 +1020,7 @@ H5Fflush_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE6(FUNC, "*s*sIuiFsi", app_file, app_func, app_line, object_id, scope, es_id)) < 0)
+ H5ARG_TRACE6(__func__, "*s*sIuiFsi", app_file, app_func, app_line, object_id, scope, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1049,7 +1114,7 @@ H5Fclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1072,10 +1137,11 @@ done:
herr_t
H5Fdelete(const char *filename, hid_t fapl_id)
{
- H5P_genplist_t * plist; /* Property list pointer */
- H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
- htri_t is_hdf5 = FAIL;
- herr_t ret_value = SUCCEED;
+ H5P_genplist_t * plist; /* Property list pointer */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ hbool_t is_accessible = FALSE; /* Whether file is accessible */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "*si", filename, fapl_id);
@@ -1100,16 +1166,25 @@ H5Fdelete(const char *filename, hid_t fapl_id)
if (H5CX_set_vol_connector_prop(&connector_prop) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set VOL connector info in API context")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_IS_ACCESSIBLE;
+ vol_cb_args.args.is_accessible.filename = filename;
+ vol_cb_args.args.is_accessible.fapl_id = fapl_id;
+ vol_cb_args.args.is_accessible.accessible = &is_accessible;
+
/* Make sure this is HDF5 storage for this VOL connector */
- if (H5VL_file_specific(NULL, H5VL_FILE_IS_ACCESSIBLE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fapl_id,
- filename, &is_hdf5) < 0)
+ if (H5VL_file_specific(NULL, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to determine if file is accessible as HDF5")
- if (!is_hdf5)
+ if (!is_accessible)
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "not an HDF5 file")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_DELETE;
+ vol_cb_args.args.del.filename = filename;
+ vol_cb_args.args.del.fapl_id = fapl_id;
+
/* Delete the file */
- if (H5VL_file_specific(NULL, H5VL_FILE_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fapl_id,
- filename, &ret_value) < 0)
+ if (H5VL_file_specific(NULL, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTDELETEFILE, FAIL, "unable to delete the file")
done:
@@ -1129,11 +1204,13 @@ done:
herr_t
H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
{
- H5VL_object_t *loc_vol_obj = NULL; /* Parent object */
- H5VL_object_t *child_vol_obj = NULL; /* Child object */
- H5I_type_t loc_type; /* ID type of location */
- H5I_type_t child_type; /* ID type of child */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * loc_vol_obj = NULL; /* Parent object */
+ H5VL_object_t * child_vol_obj = NULL; /* Child object */
+ H5VL_group_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ void * grp = NULL; /* Root group opened */
+ H5I_type_t loc_type; /* ID type of location */
+ int same_connector = 0; /* Whether parent and child files use the same connector */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sii", loc_id, name, child_id, plist_id);
@@ -1146,8 +1223,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
if (!*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string")
- child_type = H5I_get_type(child_id);
- if (H5I_FILE != child_type)
+ if (H5I_FILE != H5I_get_type(child_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "child_id parameter not a file ID")
if (H5P_DEFAULT == plist_id)
plist_id = H5P_FILE_MOUNT_DEFAULT;
@@ -1159,23 +1235,71 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
/* Get the location object */
- if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
+ /* Need to open the root group of a file, if a file ID was given as the
+ * 'loc_id', because the 'mount' operation is a group specific operation.
+ */
+ if (H5I_FILE == loc_type) {
+ H5VL_object_t * vol_obj; /* Object for loc_id (file) */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+
+ /* Get the location object */
+ if (NULL == (vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set location parameters */
+ loc_params.type = H5VL_OBJECT_BY_SELF;
+ loc_params.obj_type = loc_type;
+
+ /* Open the root group object */
+ if (NULL == (grp = H5VL_group_open(vol_obj, &loc_params, "/", H5P_GROUP_ACCESS_DEFAULT,
+ H5P_DATASET_XFER_DEFAULT, NULL)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open group")
+
+ /* Create a VOL object for the root group */
+ if (NULL == (loc_vol_obj = H5VL_create_object(grp, vol_obj->connector)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "can't create VOL object for root group")
+ } /* end if */
+ else {
+ HDassert(H5I_GROUP == loc_type);
+ if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
+ } /* end else */
/* Get the child object */
if (NULL == (child_vol_obj = (H5VL_object_t *)H5I_object(child_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get child object")
/* Check if both objects are associated with the same VOL connector */
- if (loc_vol_obj->connector->cls->value != child_vol_obj->connector->cls->value)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL connector")
+ if (H5VL_cmp_connector_cls(&same_connector, loc_vol_obj->connector->cls, child_vol_obj->connector->cls) <
+ 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCOMPARE, FAIL, "can't compare connector classes")
+ if (same_connector)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't mount file onto object from different VOL connector")
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_GROUP_MOUNT;
+ vol_cb_args.args.mount.name = name;
+ vol_cb_args.args.mount.child_file =
+ child_vol_obj->data; /* Don't unwrap fully, so each connector can see its object */
+ vol_cb_args.args.mount.fmpl_id = plist_id;
/* Perform the mount operation */
- if (H5VL_file_specific(loc_vol_obj, H5VL_FILE_MOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- (int)loc_type, name, child_vol_obj->data, plist_id) < 0)
+ /* (This is on a group, so that the VOL framework always sees groups for
+ * the 'mount' operation, instead of mixing files and groups)
+ */
+ if (H5VL_group_specific(loc_vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file")
done:
+ /* Clean up if we temporarily opened the root group for a file */
+ if (grp) {
+ HDassert(loc_vol_obj);
+ if (H5VL_group_close(loc_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "unable to release group")
+ if (H5VL_free_object(loc_vol_obj) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object")
+ } /* end if */
+
FUNC_LEAVE_API(ret_value)
} /* end H5Fmount() */
@@ -1198,9 +1322,11 @@ done:
herr_t
H5Funmount(hid_t loc_id, const char *name)
{
- H5VL_object_t *vol_obj = NULL; /* Parent object */
- H5I_type_t loc_type; /* ID type of location */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * loc_vol_obj = NULL; /* Parent object */
+ H5VL_group_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ void * grp = NULL; /* Root group opened */
+ H5I_type_t loc_type; /* ID type of location */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*s", loc_id, name);
@@ -1219,15 +1345,57 @@ H5Funmount(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
/* Get the location object */
- if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
+ /* Need to open the root group of a file, if a file ID was given as the
+ * 'loc_id', because the 'mount' operation is a group specific operation.
+ */
+ if (H5I_FILE == loc_type) {
+ H5VL_object_t * vol_obj; /* Object for loc_id (file) */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+
+ /* Get the location object */
+ if (NULL == (vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set location parameters */
+ loc_params.type = H5VL_OBJECT_BY_SELF;
+ loc_params.obj_type = loc_type;
+
+ /* Open the root group object */
+ if (NULL == (grp = H5VL_group_open(vol_obj, &loc_params, "/", H5P_GROUP_ACCESS_DEFAULT,
+ H5P_DATASET_XFER_DEFAULT, NULL)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open group")
+
+ /* Create a VOL object for the root group */
+ if (NULL == (loc_vol_obj = H5VL_create_object(grp, vol_obj->connector)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "can't create VOL object for root group")
+ } /* end if */
+ else {
+ HDassert(H5I_GROUP == loc_type);
+ if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
+ } /* end else */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_GROUP_UNMOUNT;
+ vol_cb_args.args.unmount.name = name;
/* Perform the unmount operation */
- if (H5VL_file_specific(vol_obj, H5VL_FILE_UNMOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- (int)loc_type, name) < 0)
+ /* (This is on a group, so that the VOL framework always sees groups for
+ * the 'unmount' operation, instead of mixing files and groups)
+ */
+ if (H5VL_group_specific(loc_vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file")
done:
+ /* Clean up if we temporarily opened the root group for a file */
+ if (grp) {
+ HDassert(loc_vol_obj);
+ if (H5VL_group_close(loc_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "unable to release group")
+ if (H5VL_free_object(loc_vol_obj) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object")
+ } /* end if */
+
FUNC_LEAVE_API(ret_value)
} /* end H5Funmount() */
@@ -1245,9 +1413,10 @@ done:
static hid_t
H5F__reopen_api_common(hid_t file_id, void **token_ptr)
{
- void * file = NULL; /* File struct for new file */
- H5VL_object_t *vol_obj = NULL; /* Object for loc_id */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ void * reopen_file = NULL; /* Pointer to the re-opened file object */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_STATIC
@@ -1255,16 +1424,20 @@ H5F__reopen_api_common(hid_t file_id, void **token_ptr)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_REOPEN;
+ vol_cb_args.args.reopen.file = &reopen_file;
+
/* Reopen the file */
- if (H5VL_file_specific(vol_obj, H5VL_FILE_REOPEN, H5P_DATASET_XFER_DEFAULT, token_ptr, &file) < 0)
+ if (H5VL_file_specific(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to reopen file via the VOL connector")
/* Make sure that worked */
- if (NULL == file)
+ if (NULL == reopen_file)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to reopen file")
/* Get an ID for the file */
- if ((ret_value = H5VL_register(H5I_FILE, file, vol_obj->connector, TRUE)) < 0)
+ if ((ret_value = H5VL_register(H5I_FILE, reopen_file, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle")
done:
@@ -1351,7 +1524,7 @@ H5Freopen_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) {
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref(ret_value) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on file ID")
@@ -1370,7 +1543,7 @@ H5Freopen_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set")
@@ -1398,15 +1571,19 @@ H5Fget_intent(hid_t file_id, unsigned *intent_flags /*out*/)
/* If no intent flags were passed in, exit quietly */
if (intent_flags) {
- H5VL_object_t *vol_obj; /* File info */
+ H5VL_object_t * vol_obj; /* File for file_id */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
/* Get the internal file structure */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_INTENT;
+ vol_cb_args.args.get_intent.flags = intent_flags;
+
/* Get the flags */
- if ((ret_value = H5VL_file_get(vol_obj, H5VL_FILE_GET_INTENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, intent_flags)) < 0)
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file's intent flags")
} /* end if */
@@ -1434,15 +1611,19 @@ H5Fget_fileno(hid_t file_id, unsigned long *fnumber /*out*/)
/* If no fnumber pointer was passed in, exit quietly */
if (fnumber) {
- H5VL_object_t *vol_obj; /* File info */
+ H5VL_object_t * vol_obj; /* File for file_id */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
/* Get the internal file structure */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
- /* Get the flags */
- if ((ret_value = H5VL_file_get(vol_obj, H5VL_FILE_GET_FILENO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, fnumber)) < 0)
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_FILENO;
+ vol_cb_args.args.get_fileno.fileno = fnumber;
+
+ /* Get the 'file number' */
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file's 'file number'")
} /* end if */
@@ -1462,8 +1643,11 @@ done:
hssize_t
H5Fget_freespace(hid_t file_id)
{
- H5VL_object_t *vol_obj = NULL;
- hssize_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ hsize_t file_freespace = 0; /* Size of freespace in the file */
+ hssize_t ret_value; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE1("Hs", "i", file_id);
@@ -1472,11 +1656,18 @@ H5Fget_freespace(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid file identifier")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_freespace.size = &file_freespace;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_FREE_SPACE;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the amount of free space in the file */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_FREE_SPACE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &ret_value) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file free space")
+ /* Set return value */
+ ret_value = (hssize_t)file_freespace;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_freespace() */
@@ -1495,8 +1686,10 @@ done:
herr_t
H5Fget_filesize(hid_t file_id, hsize_t *size /*out*/)
{
- H5VL_object_t *vol_obj; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", file_id, size);
@@ -1507,9 +1700,13 @@ H5Fget_filesize(hid_t file_id, hsize_t *size /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_size.size = size;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_SIZE;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the file size */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- size) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size")
done:
@@ -1556,8 +1753,11 @@ done:
ssize_t
H5Fget_file_image(hid_t file_id, void *buf /*out*/, size_t buf_len)
{
- H5VL_object_t *vol_obj; /* File object for file ID */
- ssize_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* File object for file ID */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ size_t image_len = 0; /* Size of image buffer */
+ ssize_t ret_value; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE3("Zs", "ixz", file_id, buf, buf_len);
@@ -1566,11 +1766,20 @@ H5Fget_file_image(hid_t file_id, void *buf /*out*/, size_t buf_len)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_file_image.buf_size = buf_len;
+ file_opt_args.get_file_image.buf = buf;
+ file_opt_args.get_file_image.image_len = &image_len;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_FILE_IMAGE;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the file image */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_FILE_IMAGE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, buf, &ret_value, buf_len) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file image")
+ /* Set return value */
+ ret_value = (ssize_t)image_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5Fget_file_image() */
@@ -1592,8 +1801,10 @@ done:
herr_t
H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config /*out*/)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", file_id, config);
@@ -1606,9 +1817,13 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_mdc_config.config = config;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_MDC_CONF;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the metadata cache configuration */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_CONF, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- config) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache configuration")
done:
@@ -1627,10 +1842,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr)
+H5Fset_mdc_config(hid_t file_id, const H5AC_cache_config_t *config_ptr)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*Cc", file_id, config_ptr);
@@ -1639,9 +1856,13 @@ H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ file_opt_args.set_mdc_config.config = config_ptr;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_SET_MDC_CONFIG;
+ vol_cb_args.args = &file_opt_args;
+
/* Set the metadata cache configuration */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_SET_MDC_CONFIG, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, config_ptr) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set metadata cache configuration")
done:
@@ -1663,8 +1884,10 @@ done:
herr_t
H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate /*out*/)
{
- H5VL_object_t *vol_obj;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", file_id, hit_rate);
@@ -1675,9 +1898,13 @@ H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_mdc_hit_rate.hit_rate = hit_rate;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_MDC_HR;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the current hit rate */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_HR, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- hit_rate) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC hit rate")
done:
@@ -1701,8 +1928,11 @@ herr_t
H5Fget_mdc_size(hid_t file_id, size_t *max_size /*out*/, size_t *min_clean_size /*out*/,
size_t *cur_size /*out*/, int *cur_num_entries /*out*/)
{
- H5VL_object_t *vol_obj;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ uint32_t index_len = 0; /* Size of cache index */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "ixxxx", file_id, max_size, min_clean_size, cur_size, cur_num_entries);
@@ -1711,11 +1941,22 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size /*out*/, size_t *min_clean_size
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_mdc_size.max_size = max_size;
+ file_opt_args.get_mdc_size.min_clean_size = min_clean_size;
+ file_opt_args.get_mdc_size.cur_size = cur_size;
+ file_opt_args.get_mdc_size.cur_num_entries = &index_len;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_MDC_SIZE;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the size data */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- max_size, min_clean_size, cur_size, cur_num_entries) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC size")
+ /* Set mis-matched return value */
+ if (cur_num_entries)
+ *cur_num_entries = (int)index_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5Fget_mdc_size() */
@@ -1739,8 +1980,9 @@ done:
herr_t
H5Freset_mdc_hit_rate_stats(hid_t file_id)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -1749,9 +1991,12 @@ H5Freset_mdc_hit_rate_stats(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE;
+ vol_cb_args.args = NULL;
+
/* Reset the hit rate statistic */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't reset cache hit rate")
done:
@@ -1780,9 +2025,11 @@ done:
ssize_t
H5Fget_name(hid_t obj_id, char *name /*out*/, size_t size)
{
- H5VL_object_t *vol_obj = NULL;
- H5I_type_t type;
- ssize_t ret_value = -1; /* Return value */
+ H5VL_object_t * vol_obj; /* File for file_id */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5I_type_t type;
+ size_t file_name_len = 0; /* Length of file name */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE3("Zs", "ixz", obj_id, name, size);
@@ -1797,11 +2044,20 @@ H5Fget_name(hid_t obj_id, char *name /*out*/, size_t size)
if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_NAME;
+ vol_cb_args.args.get_name.type = type;
+ vol_cb_args.args.get_name.buf_size = size;
+ vol_cb_args.args.get_name.buf = name;
+ vol_cb_args.args.get_name.file_name_len = &file_name_len;
+
/* Get the filename via the VOL */
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (int)type, size,
- name, &ret_value) < 0)
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file name")
+ /* Set the return value */
+ ret_value = (ssize_t)file_name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_name() */
@@ -1822,9 +2078,11 @@ done:
herr_t
H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo /*out*/)
{
- H5VL_object_t *vol_obj = NULL;
- H5I_type_t type;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5I_type_t type;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", obj_id, finfo);
@@ -1843,9 +2101,14 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo /*out*/)
if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_info.type = type;
+ file_opt_args.get_info.finfo = finfo;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_INFO;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the file information */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- (int)type, finfo) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info")
done:
@@ -1865,8 +2128,10 @@ done:
herr_t
H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info /*out*/)
{
- H5VL_object_t *vol_obj = NULL; /* File object for file ID */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* File object for file ID */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", file_id, info);
@@ -1879,10 +2144,14 @@ H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_metadata_read_retry_info.info = info;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the retry info */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, info) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't get metadata read retry info")
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get metadata read retry info")
done:
FUNC_LEAVE_API(ret_value)
@@ -1903,8 +2172,11 @@ done:
ssize_t
H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info /*out*/)
{
- H5VL_object_t *vol_obj = NULL;
- ssize_t ret_value = -1; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ size_t sect_count = 0; /* Number of sections */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE4("Zs", "iFmzx", file_id, type, nsects, sect_info);
@@ -1915,11 +2187,21 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info
if (sect_info && nsects == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "nsects must be > 0")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_free_sections.type = type;
+ file_opt_args.get_free_sections.sect_info = sect_info;
+ file_opt_args.get_free_sections.nsects = nsects;
+ file_opt_args.get_free_sections.sect_count = &sect_count;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_FREE_SECTIONS;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the free-space section information in the file */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_FREE_SECTIONS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, sect_info, &ret_value, (int)type, nsects) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file free sections")
+ /* Set return value */
+ ret_value = (ssize_t)sect_count;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_free_sections() */
@@ -1938,8 +2220,9 @@ done:
herr_t
H5Fclear_elink_file_cache(hid_t file_id)
{
- H5VL_object_t *vol_obj; /* File */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -1948,9 +2231,12 @@ H5Fclear_elink_file_cache(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE;
+ vol_cb_args.args = NULL;
+
/* Release the EFC */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache")
done:
@@ -1994,8 +2280,9 @@ done:
herr_t
H5Fstart_swmr_write(hid_t file_id)
{
- H5VL_object_t *vol_obj = NULL; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -2008,9 +2295,12 @@ H5Fstart_swmr_write(hid_t file_id)
if (H5CX_set_loc(file_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_START_SWMR_WRITE;
+ vol_cb_args.args = NULL;
+
/* Start SWMR writing */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_START_SWMR_WRITE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, "unable to start SWMR writing")
done:
@@ -2030,8 +2320,9 @@ done:
herr_t
H5Fstart_mdc_logging(hid_t file_id)
{
- H5VL_object_t *vol_obj; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -2040,9 +2331,12 @@ H5Fstart_mdc_logging(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_START_MDC_LOGGING;
+ vol_cb_args.args = NULL;
+
/* Call mdc logging function */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_START_MDC_LOGGING, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_LOGGING, FAIL, "unable to start mdc logging")
done:
@@ -2063,8 +2357,9 @@ done:
herr_t
H5Fstop_mdc_logging(hid_t file_id)
{
- H5VL_object_t *vol_obj; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -2073,9 +2368,12 @@ H5Fstop_mdc_logging(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_STOP_MDC_LOGGING;
+ vol_cb_args.args = NULL;
+
/* Call mdc logging function */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_STOP_MDC_LOGGING, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_LOGGING, FAIL, "unable to stop mdc logging")
done:
@@ -2096,8 +2394,10 @@ done:
herr_t
H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled /*out*/, hbool_t *is_currently_logging /*out*/)
{
- H5VL_object_t *vol_obj; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", file_id, is_enabled, is_currently_logging);
@@ -2106,9 +2406,14 @@ H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled /*out*/, hbool_t *i
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_mdc_logging_status.is_enabled = is_enabled;
+ file_opt_args.get_mdc_logging_status.is_currently_logging = is_currently_logging;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS;
+ vol_cb_args.args = &file_opt_args;
+
/* Call mdc logging function */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, is_enabled, is_currently_logging) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_LOGGING, FAIL, "unable to get logging status")
done:
@@ -2130,8 +2435,10 @@ done:
herr_t
H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high)
{
- H5VL_object_t *vol_obj; /* File as VOL object */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File as VOL object */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "iFvFv", file_id, low, high);
@@ -2144,9 +2451,14 @@ H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high)
if (H5CX_set_loc(file_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ file_opt_args.set_libver_bounds.low = low;
+ file_opt_args.set_libver_bounds.high = high;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS;
+ vol_cb_args.args = &file_opt_args;
+
/* Set the library's version bounds */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, low, high) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set library version bounds")
done:
@@ -2167,8 +2479,9 @@ done:
herr_t
H5Fformat_convert(hid_t file_id)
{
- H5VL_object_t *vol_obj = NULL; /* File */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* File */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -2181,9 +2494,12 @@ H5Fformat_convert(hid_t file_id)
if (H5CX_set_loc(file_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_FORMAT_CONVERT;
+ vol_cb_args.args = NULL;
+
/* Convert the format */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_FORMAT_CONVERT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "can't convert file format")
done:
@@ -2202,8 +2518,9 @@ done:
herr_t
H5Freset_page_buffering_stats(hid_t file_id)
{
- H5VL_object_t *vol_obj; /* File to reset stats on */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File to reset stats on */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -2212,9 +2529,12 @@ H5Freset_page_buffering_stats(hid_t file_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS;
+ vol_cb_args.args = NULL;
+
/* Reset the statistics */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't reset stats for page buffering")
done:
@@ -2235,8 +2555,10 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2] /*out*/, unsigne
unsigned misses[2] /*out*/, unsigned evictions[2] /*out*/,
unsigned bypasses[2] /*out*/)
{
- H5VL_object_t *vol_obj; /* File object */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File object */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "ixxxxx", file_id, accesses, hits, misses, evictions, bypasses);
@@ -2247,9 +2569,17 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2] /*out*/, unsigne
if (NULL == accesses || NULL == hits || NULL == misses || NULL == evictions || NULL == bypasses)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL input parameters for stats")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_page_buffering_stats.accesses = accesses;
+ file_opt_args.get_page_buffering_stats.hits = hits;
+ file_opt_args.get_page_buffering_stats.misses = misses;
+ file_opt_args.get_page_buffering_stats.evictions = evictions;
+ file_opt_args.get_page_buffering_stats.bypasses = bypasses;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the statistics */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, accesses, hits, misses, evictions, bypasses) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve stats for page buffering")
done:
@@ -2272,8 +2602,10 @@ done:
herr_t
H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr /*out*/, hsize_t *image_len /*out*/)
{
- H5VL_object_t *vol_obj; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", file_id, image_addr, image_len);
@@ -2282,9 +2614,14 @@ H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr /*out*/, hsize_t *image
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_mdc_image_info.addr = image_addr;
+ file_opt_args.get_mdc_image_info.len = image_len;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO;
+ vol_cb_args.args = &file_opt_args;
+
/* Go get the address and size of the cache image */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, image_addr, image_len) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve cache image info")
done:
@@ -2317,9 +2654,16 @@ H5Fget_eoa(hid_t file_id, haddr_t *eoa /*out*/)
/* Only do work if valid pointer to fill in */
if (eoa) {
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+
+ /* Set up VOL callback arguments */
+ file_opt_args.get_eoa.eoa = eoa;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_EOA;
+ vol_cb_args.args = &file_opt_args;
+
/* Retrieve the EOA for the file */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_EOA, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- eoa) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get EOA")
} /* end if */
@@ -2339,8 +2683,10 @@ done:
herr_t
H5Fincrement_filesize(hid_t file_id, hsize_t increment)
{
- H5VL_object_t *vol_obj; /* File info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ih", file_id, increment);
@@ -2349,9 +2695,13 @@ H5Fincrement_filesize(hid_t file_id, hsize_t increment)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hid_t identifier is not a file ID")
+ /* Set up VOL callback arguments */
+ file_opt_args.increment_filesize.increment = increment;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_INCR_FILESIZE;
+ vol_cb_args.args = &file_opt_args;
+
/* Increment the file size */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_INCR_FILESIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- increment) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to increment file size")
done:
@@ -2371,21 +2721,27 @@ done:
herr_t
H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize /*out*/)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", file_id, minimize);
+ /* Check args */
if (NULL == minimize)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "out pointer 'minimize' cannot be NULL")
-
- vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE);
- if (NULL == vol_obj)
+ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, minimize) < 0)
+ /* Set up VOL callback arguments */
+ file_opt_args.get_min_dset_ohdr_flag.minimize = minimize;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG;
+ vol_cb_args.args = &file_opt_args;
+
+ /* Get the dataset object header minimum size flag */
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file's dataset header minimization flag")
done:
@@ -2405,57 +2761,27 @@ done:
herr_t
H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ib", file_id, minimize);
- vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE);
- if (NULL == vol_obj)
+ /* Check args */
+ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, minimize) < 0)
+ /* Set up VOL callback arguments */
+ file_opt_args.set_min_dset_ohdr_flag.minimize = minimize;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG;
+ vol_cb_args.args = &file_opt_args;
+
+ /* Set the 'minimize dataset object headers flag' */
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file's dataset header minimization flag")
done:
FUNC_LEAVE_API(ret_value)
} /* H5Fset_dset_no_attrs_hint */
-
-/*-------------------------------------------------------------------------
- * Function: H5Fwait
- *
- * Purpose: Wait for all operations on a dataset.
- * Tang: added for async
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Fwait(hid_t file_id)
-{
- H5VL_object_t *vol_obj; /* File for this operation */
- H5I_type_t obj_type; /* Type of object */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE1("e", "i", file_id);
-
- /* Get the type of object we're flushing + sanity check */
- obj_type = H5I_get_type(file_id);
- if (H5I_FILE != obj_type && H5I_GROUP != obj_type && H5I_DATATYPE != obj_type &&
- H5I_DATASET != obj_type && H5I_ATTR != obj_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
-
- if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "file_id parameter is not a valid file identifier")
-
- if ((ret_value = H5VL_file_specific(vol_obj, H5VL_FILE_WAIT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- file_id)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPERATE, FAIL, "unable to wait file")
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* H5Fwait() */
diff --git a/src/H5FA.c b/src/H5FA.c
index 05b0bd8..ad69ee2 100644
--- a/src/H5FA.c
+++ b/src/H5FA.c
@@ -105,39 +105,40 @@ H5FL_BLK_DEFINE(fa_native_elmt);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, H5FA_t *, NULL, NULL,
- H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, void *ctx_udata))
+static H5FA_t *
+H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, void *ctx_udata)
+{
+ H5FA_t * fa = NULL; /* Pointer to new fixed array */
+ H5FA_hdr_t *hdr = NULL; /* The fixed array header information */
+ H5FA_t * ret_value = NULL;
- /* Local variables */
- H5FA_t * fa = NULL; /* Pointer to new fixed array */
- H5FA_hdr_t *hdr = NULL; /* The fixed array header information */
+ FUNC_ENTER_STATIC
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(fa_addr));
/* Allocate fixed array wrapper */
if (NULL == (fa = H5FL_CALLOC(H5FA_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array info")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array info")
/* Lock the array header into memory */
if (NULL == (hdr = H5FA__hdr_protect(f, fa_addr, ctx_udata, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, NULL, "unable to load fixed array header")
/* Check for pending array deletion */
if (from_open && hdr->pending_delete)
- H5E_THROW(H5E_CANTOPENOBJ, "can't open fixed array pending deletion")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTOPENOBJ, NULL, "can't open fixed array pending deletion")
/* Point fixed array wrapper at header and bump it's ref count */
fa->hdr = hdr;
if (H5FA__hdr_incr(fa->hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
/* Increment # of files using this array header */
if (H5FA__hdr_fuse_incr(fa->hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment file reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINC, NULL,
+ "can't increment file reference count on shared array header")
/* Set file pointer for this array open context */
fa->f = f;
@@ -145,15 +146,15 @@ BEGIN_FUNC(STATIC, ERR, H5FA_t *, NULL, NULL,
/* Set the return value */
ret_value = fa;
- CATCH
-
+done:
if (hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, NULL, "unable to release fixed array header")
if (!ret_value)
if (fa && H5FA_close(fa) < 0)
- H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array")
+ HDONE_ERROR(H5E_FARRAY, H5E_CLOSEERROR, NULL, "unable to close fixed array")
-END_FUNC(STATIC) /* end H5FA__new() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__new() */
/*-------------------------------------------------------------------------
* Function: H5FA_create
@@ -168,16 +169,16 @@ END_FUNC(STATIC) /* end H5FA__new() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, H5FA_t *, NULL, NULL,
- H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata))
-
- /* Local variables */
+H5FA_t *
+H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata)
+{
H5FA_t *fa = NULL; /* Pointer to new fixed array */
haddr_t fa_addr; /* Fixed array header address */
+ H5FA_t *ret_value = NULL;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(NULL)
+
+ /* Check arguments */
HDassert(f);
HDassert(cparam);
@@ -186,22 +187,23 @@ BEGIN_FUNC(PRIV, ERR, H5FA_t *, NULL, NULL,
/* Create fixed array header */
if (HADDR_UNDEF == (fa_addr = H5FA__hdr_create(f, cparam, ctx_udata)))
- H5E_THROW(H5E_CANTINIT, "can't create fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "can't create fixed array header")
/* Allocate and initialize new fixed array wrapper */
if (NULL == (fa = H5FA__new(f, fa_addr, FALSE, ctx_udata)))
- H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for fixed array wrapper")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL,
+ "allocation and/or initialization failed for fixed array wrapper")
/* Set the return value */
ret_value = fa;
- CATCH
-
+done:
if (!ret_value)
if (fa && H5FA_close(fa) < 0)
- H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array")
+ HDONE_ERROR(H5E_FARRAY, H5E_CLOSEERROR, NULL, "unable to close fixed array")
-END_FUNC(PRIV) /* end H5FA_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_create() */
/*-------------------------------------------------------------------------
* Function: H5FA_open
@@ -216,31 +218,33 @@ END_FUNC(PRIV) /* end H5FA_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, H5FA_t *, NULL, NULL, H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata))
+H5FA_t *
+H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata)
+{
+ H5FA_t *fa = NULL; /* Pointer to new fixed array wrapper */
+ H5FA_t *ret_value = NULL;
- /* Local variables */
- H5FA_t *fa = NULL; /* Pointer to new fixed array wrapper */
+ FUNC_ENTER_NOAPI(NULL)
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(fa_addr));
/* Allocate and initialize new fixed array wrapper */
if (NULL == (fa = H5FA__new(f, fa_addr, TRUE, ctx_udata)))
- H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for fixed array wrapper")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL,
+ "allocation and/or initialization failed for fixed array wrapper")
/* Set the return value */
ret_value = fa;
- CATCH
-
+done:
if (!ret_value)
if (fa && H5FA_close(fa) < 0)
- H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array")
+ HDONE_ERROR(H5E_FARRAY, H5E_CLOSEERROR, NULL, "unable to close fixed array")
-END_FUNC(PRIV) /* end H5FA_open() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_open() */
/*-------------------------------------------------------------------------
* Function: H5FA_get_nelmts
@@ -254,20 +258,20 @@ END_FUNC(PRIV) /* end H5FA_open() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5FA_get_nelmts(const H5FA_t *fa, hsize_t *nelmts))
-
- /* Local variables */
+herr_t
+H5FA_get_nelmts(const H5FA_t *fa, hsize_t *nelmts)
+{
+ FUNC_ENTER_NOAPI_NOERR
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(fa);
HDassert(nelmts);
/* Retrieve the current number of elements in the fixed array */
*nelmts = fa->hdr->stats.nelmts;
-END_FUNC(PRIV) /* end H5FA_get_nelmts() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA_get_nelmts() */
/*-------------------------------------------------------------------------
* Function: H5FA_get_addr
@@ -281,13 +285,12 @@ END_FUNC(PRIV) /* end H5FA_get_nelmts() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5FA_get_addr(const H5FA_t *fa, haddr_t *addr))
-
- /* Local variables */
+herr_t
+H5FA_get_addr(const H5FA_t *fa, haddr_t *addr)
+{
+ FUNC_ENTER_NOAPI_NOERR
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(fa);
HDassert(fa->hdr);
HDassert(addr);
@@ -295,7 +298,8 @@ BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5FA_get_addr(const H5FA_t *fa, hadd
/* Retrieve the address of the fixed array's header */
*addr = fa->hdr->addr;
-END_FUNC(PRIV) /* end H5FA_get_addr() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA_get_addr() */
/*-------------------------------------------------------------------------
* Function: H5FA_set
@@ -309,9 +313,9 @@ END_FUNC(PRIV) /* end H5FA_get_addr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt))
-
- /* Local variables */
+herr_t
+H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)
+{
H5FA_hdr_t * hdr = fa->hdr; /* Header for fixed array */
H5FA_dblock_t * dblock = NULL; /* Pointer to fixed array Data block */
H5FA_dblk_page_t *dblk_page = NULL; /* Pointer to fixed array Data block page */
@@ -319,10 +323,11 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_set(const H5FA_t *fa, hsize_t
unsigned dblk_page_cache_flags =
H5AC__NO_FLAGS_SET; /* Flags to unprotecting FIxed Array Data block page */
hbool_t hdr_dirty = FALSE; /* Whether header information changed */
+ herr_t ret_value = SUCCEED;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(fa);
HDassert(fa->hdr);
@@ -334,15 +339,16 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_set(const H5FA_t *fa, hsize_t
/* Create the data block */
hdr->dblk_addr = H5FA__dblock_create(hdr, &hdr_dirty);
if (!H5F_addr_defined(hdr->dblk_addr))
- H5E_THROW(H5E_CANTCREATE, "unable to create fixed array data block")
- } /* end if */
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTCREATE, FAIL, "unable to create fixed array data block")
+ }
HDassert(idx < hdr->cparam.nelmts);
/* Protect data block */
if (NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu",
- (unsigned long long)hdr->dblk_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect fixed array data block, address = %llu",
+ (unsigned long long)hdr->dblk_addr)
/* Check for paging data block */
if (!dblock->npages) {
@@ -375,7 +381,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_set(const H5FA_t *fa, hsize_t
if (!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
/* Create the data block page */
if (H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0)
- H5E_THROW(H5E_CANTCREATE, "unable to create data block page")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTCREATE, FAIL, "unable to create data block page")
/* Mark data block page as initialized in data block */
H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE);
@@ -385,8 +391,9 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_set(const H5FA_t *fa, hsize_t
/* Protect the data block page */
if (NULL ==
(dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu",
- (unsigned long long)dblk_page_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect fixed array data block page, address = %llu",
+ (unsigned long long)dblk_page_addr)
/* Set the element in the data block page */
H5MM_memcpy(((uint8_t *)dblk_page->elmts) + (hdr->cparam.cls->nat_elmt_size * elmt_idx), elmt,
@@ -394,19 +401,20 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_set(const H5FA_t *fa, hsize_t
dblk_page_cache_flags |= H5AC__DIRTIED_FLAG;
} /* end else */
- CATCH
+done:
/* Check for header modified */
if (hdr_dirty)
if (H5FA__hdr_modified(hdr) < 0)
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark fixed array header as modified")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTMARKDIRTY, FAIL, "unable to mark fixed array header as modified")
/* Release resources */
if (dblock && H5FA__dblock_unprotect(dblock, dblock_cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array data block")
if (dblk_page && H5FA__dblk_page_unprotect(dblk_page, dblk_page_cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array data block page")
-END_FUNC(PRIV) /* end H5FA_set() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_set() */
/*-------------------------------------------------------------------------
* Function: H5FA_get
@@ -420,16 +428,17 @@ END_FUNC(PRIV) /* end H5FA_set() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt))
-
- /* Local variables */
+herr_t
+H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)
+{
H5FA_hdr_t * hdr = fa->hdr; /* Header for FA */
H5FA_dblock_t * dblock = NULL; /* Pointer to data block for FA */
H5FA_dblk_page_t *dblk_page = NULL; /* Pointer to data block page for FA */
+ herr_t ret_value = SUCCEED;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(fa);
HDassert(fa->hdr);
@@ -440,14 +449,15 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_get(const H5FA_t *fa, hsize_t
if (!H5F_addr_defined(hdr->dblk_addr)) {
/* Call the class's 'fill' callback */
if ((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0)
- H5E_THROW(H5E_CANTSET, "can't set element to class's fill value")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, FAIL, "can't set element to class's fill value")
} /* end if */
else {
/* Get the data block */
HDassert(H5F_addr_defined(hdr->dblk_addr));
if (NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu",
- (unsigned long long)hdr->dblk_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect fixed array data block, address = %llu",
+ (unsigned long long)hdr->dblk_addr)
/* Check for paged data block */
if (!dblock->npages)
@@ -464,10 +474,10 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_get(const H5FA_t *fa, hsize_t
if (!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
/* Call the class's 'fill' callback */
if ((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0)
- H5E_THROW(H5E_CANTSET, "can't set element to class's fill value")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, FAIL, "can't set element to class's fill value")
/* We've retrieved the value, leave now */
- H5_LEAVE(SUCCEED)
+ HGOTO_DONE(SUCCEED)
} /* end if */
else { /* get the page */
size_t dblk_page_nelmts; /* # of elements in a data block page */
@@ -490,9 +500,9 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_get(const H5FA_t *fa, hsize_t
/* Protect the data block page */
if (NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts,
H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT,
- "unable to protect fixed array data block page, address = %llu",
- (unsigned long long)dblk_page_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect fixed array data block page, address = %llu",
+ (unsigned long long)dblk_page_addr)
/* Retrieve element from data block */
H5MM_memcpy(elmt, ((uint8_t *)dblk_page->elmts) + (hdr->cparam.cls->nat_elmt_size * elmt_idx),
@@ -501,13 +511,14 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_get(const H5FA_t *fa, hsize_t
} /* end else */
} /* end else */
- CATCH
+done:
if (dblock && H5FA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array data block")
if (dblk_page && H5FA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array data block page")
-END_FUNC(PRIV) /* end H5FA_get() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_get() */
/*-------------------------------------------------------------------------
* Function: H5FA_close
@@ -521,18 +532,19 @@ END_FUNC(PRIV) /* end H5FA_get() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_close(H5FA_t *fa))
-
- /* Local variables */
+herr_t
+H5FA_close(H5FA_t *fa)
+{
hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */
haddr_t fa_addr = HADDR_UNDEF; /* Address of array (for deletion) */
+ herr_t ret_value = SUCCEED;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(fa);
- /* Close the header, if it was set */
+ /* Close the header if it was set */
if (fa->hdr) {
/* Decrement file reference & check if this is the last open fixed array using the shared array header
*/
@@ -562,7 +574,8 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_close(H5FA_t *fa))
/* Check the header's status in the metadata cache */
if (H5AC_get_entry_status(fa->f, fa_addr, &hdr_status) < 0)
- H5E_THROW(H5E_CANTGET, "unable to check metadata cache status for fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, FAIL,
+ "unable to check metadata cache status for fixed array header")
/* Sanity checks on header */
HDassert(hdr_status & H5AC_ES__IN_CACHE);
@@ -574,7 +587,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_close(H5FA_t *fa))
/* Lock the array header into memory */
/* (OK to pass in NULL for callback context, since we know the header must be in the cache) */
if (NULL == (hdr = H5FA__hdr_protect(fa->f, fa_addr, NULL, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTLOAD, "unable to load fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTLOAD, FAIL, "unable to load fixed array header")
/* Set the shared array header's file context for this operation */
hdr->f = fa->f;
@@ -584,11 +597,12 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_close(H5FA_t *fa))
* immediately -QAK)
*/
if (H5FA__hdr_decr(fa->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
/* Delete array, starting with header (unprotects header) */
if (H5FA__hdr_delete(hdr) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDELETE, FAIL, "unable to delete fixed array")
} /* end if */
else {
/* Decrement the reference count on the array header */
@@ -596,16 +610,17 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_close(H5FA_t *fa))
* immediately -QAK)
*/
if (H5FA__hdr_decr(fa->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
} /* end else */
} /* end if */
/* Release the fixed array wrapper */
fa = H5FL_FREE(H5FA_t, fa);
- CATCH
-
-END_FUNC(PRIV) /* end H5FA_close() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_close() */
/*-------------------------------------------------------------------------
* Function: H5FA_delete
@@ -619,21 +634,22 @@ END_FUNC(PRIV) /* end H5FA_close() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata))
+herr_t
+H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata)
+{
+ H5FA_hdr_t *hdr = NULL; /* The fixed array header information */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5FA_hdr_t *hdr = NULL; /* The fixed array header information */
+ FUNC_ENTER_NOAPI(FAIL)
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(fa_addr));
/* Lock the array header into memory */
if (NULL == (hdr = H5FA__hdr_protect(f, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu",
- (unsigned long long)fa_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL, "unable to protect fixed array header, address = %llu",
+ (unsigned long long)fa_addr)
/* Check for files using shared array header */
if (hdr->file_rc)
@@ -644,17 +660,17 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_delete(H5F_t *f, haddr_t fa_ad
/* Delete array now, starting with header (unprotects header) */
if (H5FA__hdr_delete(hdr) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDELETE, FAIL, "unable to delete fixed array")
hdr = NULL;
- } /* end if */
-
- CATCH
+ }
- /* Unprotect the header, if an error occurred */
+done:
+ /* Unprotect the header if an error occurred */
if (hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array header")
-END_FUNC(PRIV) /* end H5FA_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_delete() */
/*-------------------------------------------------------------------------
* Function: H5FA_iterate
@@ -671,44 +687,44 @@ END_FUNC(PRIV) /* end H5FA_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, int, H5_ITER_CONT, H5_ITER_ERROR,
- H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata))
-
- /* Local variables */
+int
+H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata)
+{
uint8_t *elmt = NULL;
hsize_t u;
- int cb_ret = H5_ITER_CONT; /* Return value from callback */
+ int ret_value = H5_ITER_CONT;
- /*
- * Check arguments.
- */
+ FUNC_ENTER_NOAPI(H5_ITER_ERROR)
+
+ /* Check arguments */
HDassert(fa);
HDassert(op);
HDassert(udata);
/* Allocate space for a native array element */
if (NULL == (elmt = H5FL_BLK_MALLOC(fa_native_elmt, fa->hdr->cparam.cls->nat_elmt_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array element")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, H5_ITER_ERROR,
+ "memory allocation failed for fixed array element")
/* Iterate over all elements in array */
- for (u = 0; u < fa->hdr->stats.nelmts && cb_ret == H5_ITER_CONT; u++) {
+ for (u = 0; u < fa->hdr->stats.nelmts && ret_value == H5_ITER_CONT; u++) {
/* Get array element */
if (H5FA_get(fa, u, elmt) < 0)
- H5E_THROW(H5E_CANTGET, "unable to delete fixed array")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, H5_ITER_ERROR, "unable to delete fixed array")
- /* Make callback */
- if ((cb_ret = (*op)(u, elmt, udata)) < 0) {
- H5E_PRINTF(H5E_BADITER, "iterator function failed");
- H5_LEAVE(cb_ret)
- } /* end if */
- } /* end for */
-
- CATCH
+ /* Invoke callback */
+ if ((ret_value = (*op)(u, elmt, udata)) < 0) {
+ HERROR(H5E_FARRAY, H5E_BADITER, "iteration callback error");
+ break;
+ }
+ }
+done:
if (elmt)
elmt = H5FL_BLK_FREE(fa_native_elmt, elmt);
-END_FUNC(PRIV) /* end H5FA_iterate() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_iterate() */
/*-------------------------------------------------------------------------
* Function: H5FA_depend
@@ -723,14 +739,15 @@ END_FUNC(PRIV) /* end H5FA_iterate() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent))
+herr_t
+H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent)
+{
+ H5FA_hdr_t *hdr = fa->hdr; /* Header for FA */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5FA_hdr_t *hdr = fa->hdr; /* Header for FA */
+ FUNC_ENTER_NOAPI(FAIL)
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(fa);
HDassert(hdr);
HDassert(parent);
@@ -749,13 +766,13 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5FA_depend(H5FA_t *fa, H5AC_proxy_
/* Add the fixed array as a child of the parent (proxy) */
if (H5AC_proxy_entry_add_child(parent, hdr->f, hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add fixed array as child of proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, FAIL, "unable to add fixed array as child of proxy")
hdr->parent = parent;
- } /* end if */
-
- CATCH
+ }
-END_FUNC(PRIV) /* end H5FA_depend() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA_depend() */
/*-------------------------------------------------------------------------
* Function: H5FA_patch_file
@@ -769,17 +786,17 @@ END_FUNC(PRIV) /* end H5FA_depend() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5FA_patch_file(H5FA_t *fa, H5F_t *f))
+herr_t
+H5FA_patch_file(H5FA_t *fa, H5F_t *f)
+{
+ FUNC_ENTER_NOAPI_NOERR
- /* Local variables */
-
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(fa);
HDassert(f);
if (fa->f != f || fa->hdr->f != f)
fa->f = fa->hdr->f = f;
-END_FUNC(PRIV) /* end H5FA_patch_file() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA_patch_file() */
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 4e6c57d..367b4b0 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -167,12 +167,13 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5FA_hdr_cache_ud_t *udata = (H5FA_hdr_cache_ud_t *)_udata; /* User data for callback */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->f);
@@ -181,7 +182,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5FA_HEADER_SIZE_FILE(udata->f);
-END_FUNC(STATIC) /* end H5FA__cache_hdr_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_hdr_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_verify_chksum
@@ -196,13 +198,15 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -213,7 +217,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_deserialize
@@ -228,16 +233,18 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
+ hbool_t H5_ATTR_UNUSED *dirty)
+{
H5FA_cls_id_t id; /* ID of fixed array class, as found in file */
H5FA_hdr_t * hdr = NULL; /* Fixed array info */
H5FA_hdr_cache_ud_t *udata = (H5FA_hdr_cache_ud_t *)_udata;
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(udata);
@@ -246,24 +253,24 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate space for the fixed array data structure */
if (NULL == (hdr = H5FA__hdr_alloc(udata->f)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array shared header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array shared header")
/* Set the fixed array header's address */
hdr->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- H5E_THROW(H5E_BADVALUE, "wrong fixed array header signature")
+ if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array header signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5FA_HDR_VERSION)
- H5E_THROW(H5E_VERSION, "wrong fixed array header version")
+ HGOTO_ERROR(H5E_FARRAY, H5E_VERSION, NULL, "wrong fixed array header version")
/* Fixed array class */
id = (H5FA_cls_id_t)*image++;
if (id >= H5FA_NUM_CLS_ID)
- H5E_THROW(H5E_BADTYPE, "incorrect fixed array class")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADTYPE, NULL, "incorrect fixed array class")
hdr->cparam.cls = H5FA_client_class_g[id];
/* General array creation/configuration information */
@@ -311,20 +318,20 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Finish initializing fixed array header */
if (H5FA__hdr_init(hdr, udata->ctx_udata) < 0)
- H5E_THROW(H5E_CANTINIT, "initialization failed for fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "initialization failed for fixed array header")
HDassert(hdr->size == len);
/* Set return value */
ret_value = hdr;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (hdr && H5FA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array header")
-END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_image_len
@@ -338,12 +345,13 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len)
+{
const H5FA_hdr_t *hdr = (const H5FA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(hdr);
HDassert(image_len);
@@ -351,7 +359,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = hdr->size;
-END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_hdr_image_len() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_serialize
@@ -365,15 +374,16 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5FA_hdr_t *hdr = (H5FA_hdr_t *)_thing; /* Pointer to the fixed array header */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
- /* check arguments */
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Check arguments */
HDassert(f);
HDassert(image);
HDassert(hdr);
@@ -410,7 +420,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
-END_FUNC(STATIC) /* end H5FA__cache_hdr_serialize() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_hdr_serialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_notify
@@ -424,11 +435,13 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5FA_hdr_t *hdr = (H5FA_hdr_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5FA_hdr_t *hdr = (H5FA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(hdr);
@@ -460,16 +473,16 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on object header proxy */
if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent,
(void *)hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between fixed array and proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between fixed array and proxy")
hdr->parent = NULL;
} /* end if */
/* Detach from 'top' proxy for fixed array */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_remove_child(hdr->top_proxy, hdr) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between header and fixed array 'top' proxy")
/* Don't reset hdr->top_proxy here, it's destroyed when the header is freed -QAK */
} /* end if */
@@ -477,7 +490,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
@@ -486,9 +499,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
else
HDassert(NULL == hdr->parent);
- CATCH
+done:
-END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_notify() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_hdr_free_icr
@@ -503,18 +517,23 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_hdr_free_icr(void *thing))
+static herr_t
+H5FA__cache_hdr_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array header */
if (H5FA__hdr_dest((H5FA_hdr_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free fixed array header")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTFREE, FAIL, "can't free fixed array header")
-END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_hdr_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_get_initial_load_size
@@ -528,14 +547,15 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5FA_dblock_cache_ud_t *udata = (H5FA_dblock_cache_ud_t *)_udata; /* User data */
H5FA_dblock_t dblock; /* Fake data block for computing size */
size_t dblk_page_nelmts; /* # of elements per data block page */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -564,7 +584,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = (size_t)H5FA_DBLOCK_PREFIX_SIZE(&dblock);
-END_FUNC(STATIC) /* end H5FA__cache_dblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_verify_chksum
@@ -579,13 +600,15 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -596,7 +619,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_deserialize
@@ -611,16 +635,18 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
+ hbool_t H5_ATTR_UNUSED *dirty)
+{
H5FA_dblock_t * dblock = NULL; /* Data block info */
H5FA_dblock_cache_ud_t *udata = (H5FA_dblock_cache_ud_t *)_udata; /* User data for loading data block */
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(udata);
@@ -628,7 +654,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the fixed array data block */
if (NULL == (dblock = H5FA__dblock_alloc(udata->hdr)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array data block")
HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) ||
(len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock)));
@@ -637,28 +663,28 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
dblock->addr = udata->dblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- H5E_THROW(H5E_BADVALUE, "wrong fixed array data block signature")
+ if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array data block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5FA_DBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong fixed array data block version")
+ HGOTO_ERROR(H5E_FARRAY, H5E_VERSION, NULL, "wrong fixed array data block version")
/* Fixed array type */
if (*image++ != (uint8_t)udata->hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect fixed array class")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADTYPE, NULL, "incorrect fixed array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(udata->hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, udata->hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong fixed array header address")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, NULL, "wrong fixed array header address")
/* Page initialization flags */
if (dblock->npages > 0) {
H5MM_memcpy(dblock->dblk_page_init, image, dblock->dblk_page_init_size);
image += dblock->dblk_page_init_size;
- } /* end if */
+ }
/* Only decode elements if the data block is not paged */
if (!dblock->npages) {
@@ -666,9 +692,9 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblock->elmts, (size_t)udata->hdr->cparam.nelmts,
udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDECODE, NULL, "can't decode fixed array data elements")
image += (udata->hdr->cparam.nelmts * udata->hdr->cparam.raw_elmt_size);
- } /* end if */
+ }
/* Sanity check */
/* (allow for checksum not decoded yet) */
@@ -688,14 +714,14 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblock;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (dblock && H5FA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array data block")
-END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_image_len
@@ -709,12 +735,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len)
+{
const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(image_len);
@@ -725,7 +752,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = H5FA_DBLOCK_PREFIX_SIZE(dblock);
-END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_serialize
@@ -739,14 +767,15 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(f);
@@ -773,7 +802,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Store the 'page init' bitmasks */
H5MM_memcpy(image, dblock->dblk_page_init, dblock->dblk_page_init_size);
image += dblock->dblk_page_init_size;
- } /* end if */
+ }
/* Only encode elements if the data block is not paged */
if (!dblock->npages) {
@@ -783,9 +812,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
H5_CHECK_OVERFLOW(dblock->hdr->cparam.nelmts, /* From: */ hsize_t, /* To: */ size_t);
if ((dblock->hdr->cparam.cls->encode)(image, dblock->elmts, (size_t)dblock->hdr->cparam.nelmts,
dblock->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTENCODE, FAIL, "can't encode fixed array data elements")
image += (dblock->hdr->cparam.nelmts * dblock->hdr->cparam.raw_elmt_size);
- } /* end if */
+ }
/* Compute metadata checksum */
metadata_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0);
@@ -796,9 +825,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblock_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_notify
@@ -812,11 +841,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing;
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing;
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(dblock);
@@ -829,8 +860,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on parent */
if (H5FA__create_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_FARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between data block and header, address = %llu",
(unsigned long long)dblock->addr)
break;
@@ -842,35 +873,35 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_CHILD_CLEANED:
case H5AC_NOTIFY_ACTION_CHILD_UNSERIALIZED:
case H5AC_NOTIFY_ACTION_CHILD_SERIALIZED:
- /* do nothing */
break;
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on parent */
if (H5FA__destroy_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
/* Detach from 'top' proxy for fixed array */
if (dblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblock->top_proxy, dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block "
- "and fixed array 'top' proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block "
+ "and fixed array 'top' proxy")
dblock->top_proxy = NULL;
- } /* end if */
+ }
break;
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
-#else /* NDEBUG */
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
+#else
HDassert(0 && "Unknown action?!?");
-#endif /* NDEBUG */
+#endif
} /* end switch */
} /* end if */
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_free_icr
@@ -885,20 +916,24 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_dblock_free_icr(void *_thing))
+static herr_t
+H5FA__cache_dblock_free_icr(void *_thing)
+{
+ H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- H5FA_dblock_t *dblock = (H5FA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(dblock);
/* Release the fixed array data block */
if (H5FA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free fixed array data block")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTFREE, FAIL, "can't free fixed array data block")
-END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblock_fsf_size
@@ -929,11 +964,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size))
-
+static herr_t
+H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)
+{
const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
@@ -942,7 +979,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
*fsf_size = dblock->size;
-END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblock_fsf_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_get_initial_load_size
@@ -956,12 +994,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5FA_dblk_page_cache_ud_t *udata = (H5FA_dblk_page_cache_ud_t *)_udata; /* User data */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -971,7 +1010,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts);
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblk_page_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_verify_chksum
@@ -986,13 +1026,15 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1003,7 +1045,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_deserialize
@@ -1018,18 +1061,19 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5FA_dblk_page_t * dblk_page = NULL; /* Data block page info */
H5FA_dblk_page_cache_ud_t *udata =
(H5FA_dblk_page_cache_ud_t *)_udata; /* User data for loading data block page */
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
/* Sanity check */
+ FUNC_ENTER_STATIC
+
HDassert(udata);
HDassert(udata->hdr);
HDassert(udata->nelmts > 0);
@@ -1037,7 +1081,8 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the fixed array data block page */
if (NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block page")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for fixed array data block page")
/* Set the fixed array data block's information */
dblk_page->addr = udata->dblk_page_addr;
@@ -1047,7 +1092,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Decode elements in data block page */
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblk_page->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDECODE, NULL, "can't decode fixed array data elements")
image += (udata->nelmts * udata->hdr->cparam.raw_elmt_size);
/* Sanity check */
@@ -1068,14 +1113,15 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblk_page;
- CATCH
+done:
/* Release resources */
if (!ret_value)
if (dblk_page && H5FA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block page")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array data block page")
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_image_len
@@ -1089,12 +1135,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len)
+{
const H5FA_dblk_page_t *dblk_page = (const H5FA_dblk_page_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblk_page);
HDassert(image_len);
@@ -1102,7 +1149,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = dblk_page->size;
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__cache_dblk_page_image_len() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_serialize
@@ -1116,14 +1164,16 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image,
- size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len,
+ void *_thing)
+{
H5FA_dblk_page_t *dblk_page = (H5FA_dblk_page_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -1138,7 +1188,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((dblk_page->hdr->cparam.cls->encode)(image, dblk_page->elmts, dblk_page->nelmts,
dblk_page->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode fixed array data elements")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTENCODE, FAIL, "can't encode fixed array data elements")
image += (dblk_page->nelmts * dblk_page->hdr->cparam.raw_elmt_size);
/* Compute metadata checksum */
@@ -1150,9 +1200,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_serialize() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_notify
@@ -1166,11 +1216,13 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing))
-
- /* Local variables */
+static herr_t
+H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing)
+{
H5FA_dblk_page_t *dblk_page = (H5FA_dblk_page_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(dblk_page);
@@ -1187,8 +1239,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Detach from 'top' proxy for fixed array */
if (dblk_page->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblk_page->top_proxy, dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block page "
- "and fixed array 'top' proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page "
+ "and fixed array 'top' proxy")
dblk_page->top_proxy = NULL;
} /* end if */
break;
@@ -1204,15 +1257,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_notify() */
/*-------------------------------------------------------------------------
* Function: H5FA__cache_dblk_page_free_icr
@@ -1227,15 +1280,20 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5FA__cache_dblk_page_free_icr(void *thing))
+static herr_t
+H5FA__cache_dblk_page_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the fixed array data block page */
if (H5FA__dblk_page_dest((H5FA_dblk_page_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free fixed array data block page")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTFREE, FAIL, "can't free fixed array data block page")
-END_FUNC(STATIC) /* end H5FA__cache_dblk_page_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__cache_dblk_page_free_icr() */
diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c
index 8c2c9a8..a69c078 100644
--- a/src/H5FAdbg.c
+++ b/src/H5FAdbg.c
@@ -79,13 +79,16 @@
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5FA_class_t *cls, haddr_t obj_addr))
-
+herr_t
+H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5FA_class_t *cls,
+ haddr_t obj_addr)
+{
/* Local variables */
- H5FA_hdr_t *hdr = NULL; /* Shared fixed array header */
- void * dbg_ctx = NULL; /* Fixed array debugging context */
+ H5FA_hdr_t *hdr = NULL; /* Shared fixed array header */
+ void * dbg_ctx = NULL; /* Fixed array debugging context */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -100,11 +103,11 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (cls->crt_dbg_ctx)
/* Create debugging context */
if (NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, FAIL, "unable to create fixed array debugging context")
/* Load the fixed array header */
if (NULL == (hdr = H5FA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL, "unable to load fixed array header")
/* Print opening message */
HDfprintf(stream, "%*sFixed Array Header...\n", indent, "");
@@ -126,13 +129,14 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Fixed Array Data Block Address:", hdr->dblk_addr);
- CATCH
+done:
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTRELEASE, FAIL, "unable to release fixed array debugging context")
if (hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array header")
-END_FUNC(PKG) /* end H5FA__hdr_debug() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_debug() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblock_debug
@@ -146,15 +150,18 @@ END_FUNC(PKG) /* end H5FA__hdr_debug() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5FA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr))
-
+herr_t
+H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5FA_class_t *cls,
+ haddr_t hdr_addr, haddr_t obj_addr)
+{
/* Local variables */
- H5FA_hdr_t * hdr = NULL; /* Shared fixed array header */
- H5FA_dblock_t *dblock = NULL; /* Fixed array data block */
- void * dbg_ctx = NULL; /* Fixed array context */
- size_t u; /* Local index variable */
+ H5FA_hdr_t * hdr = NULL; /* Shared fixed array header */
+ H5FA_dblock_t *dblock = NULL; /* Fixed array data block */
+ void * dbg_ctx = NULL; /* Fixed array context */
+ size_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -170,16 +177,16 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (cls->crt_dbg_ctx)
/* Create debugging context */
if (NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, FAIL, "unable to create fixed array debugging context")
/* Load the fixed array header */
if (NULL == (hdr = H5FA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL, "unable to load fixed array header")
/* Protect data block */
if (NULL == (dblock = H5FA__dblock_protect(hdr, addr, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu",
- (unsigned long long)addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect fixed array data block, address = %llu", (unsigned long long)addr)
/* Print opening message */
HDfprintf(stream, "%*sFixed Array data Block...\n", indent, "");
@@ -222,9 +229,9 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if (NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts,
H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT,
- "unable to protect fixed array data block page, address = %llu",
- (unsigned long long)dblk_page_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect fixed array data block page, address = %llu",
+ (unsigned long long)dblk_page_addr)
HDfprintf(stream, "%*sElements in page %zu:\n", indent, "", page_idx);
for (u = 0; u < dblk_page_nelmts; u++) {
@@ -232,10 +239,11 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if ((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u,
((uint8_t *)dblk_page->elmts) +
(hdr->cparam.cls->nat_elmt_size * u)) < 0)
- H5E_THROW(H5E_CANTGET, "can't get element for debugging")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, FAIL, "can't get element for debugging")
} /* end for */
if (H5FA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to release fixed array data block page")
/* Advance to next page address */
dblk_page_addr += dblock->dblk_page_size;
@@ -250,16 +258,17 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
if ((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u,
((uint8_t *)dblock->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) <
0)
- H5E_THROW(H5E_CANTGET, "can't get element for debugging")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, FAIL, "can't get element for debugging")
} /* end for */
} /* end else */
- CATCH
+done:
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTRELEASE, FAIL, "unable to release fixed array debugging context")
if (dblock && H5FA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array data block")
if (hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array header")
-END_FUNC(PKG) /* end H5FA__dblock_debug() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblock_debug() */
diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c
index 0f5ee29..713bd67 100644
--- a/src/H5FAdblkpage.c
+++ b/src/H5FAdblkpage.c
@@ -84,21 +84,25 @@ H5FL_BLK_DEFINE(page_elmts);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5FA_dblk_page_t *, NULL, NULL, H5FA__dblk_page_alloc(H5FA_hdr_t *hdr, size_t nelmts))
-
- /* Local variables */
+H5FA_dblk_page_t *
+H5FA__dblk_page_alloc(H5FA_hdr_t *hdr, size_t nelmts)
+{
H5FA_dblk_page_t *dblk_page = NULL; /* Fixed array data block page */
+ H5FA_dblk_page_t *ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
/* Allocate memory for the data block */
if (NULL == (dblk_page = H5FL_CALLOC(H5FA_dblk_page_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block page")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for fixed array data block page")
/* Share common array information */
if (H5FA__hdr_incr(hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
dblk_page->hdr = hdr;
/* Set non-zero internal fields */
@@ -106,40 +110,44 @@ BEGIN_FUNC(PKG, ERR, H5FA_dblk_page_t *, NULL, NULL, H5FA__dblk_page_alloc(H5FA_
/* Allocate buffer for elements in data block page */
if (NULL == (dblk_page->elmts = H5FL_BLK_MALLOC(page_elmts, nelmts * hdr->cparam.cls->nat_elmt_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for data block page element buffer")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for data block page element buffer")
/* Set the return value */
ret_value = dblk_page;
- CATCH
+done:
if (!ret_value)
if (dblk_page && H5FA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block page")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array data block page")
-END_FUNC(PKG) /* end H5FA__dblk_page_alloc() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblk_page_alloc() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblk_page_create
*
* Purpose: Creates a new fixed array data block page in the file
*
- * Return: Valid file address on success/HADDR_UNDEF on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts))
-
- /* Local variables */
+herr_t
+H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts)
+{
H5FA_dblk_page_t *dblk_page = NULL; /* Fixed array data block page */
hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
#ifdef H5FA_DEBUG
- HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr);
+ HDfprintf(stderr, "%s: Called, addr = %a\n", __func__, addr);
#endif /* H5FA_DEBUG */
/* Sanity check */
@@ -147,45 +155,50 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Allocate the data block page */
if (NULL == (dblk_page = H5FA__dblk_page_alloc(hdr, nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block page")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, FAIL,
+ "memory allocation failed for fixed array data block page")
/* Set info about data block page on disk */
dblk_page->addr = addr;
dblk_page->size = H5FA_DBLK_PAGE_SIZE(hdr, nelmts);
#ifdef H5FA_DEBUG
- HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size);
+ HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", __func__, dblk_page->size);
#endif /* H5FA_DEBUG */
/* Clear any elements in data block page to fill value */
if ((hdr->cparam.cls->fill)(dblk_page->elmts, nelmts) < 0)
- H5E_THROW(H5E_CANTSET, "can't set fixed array data block page elements to class's fill value")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, FAIL,
+ "can't set fixed array data block page elements to class's fill value")
/* Cache the new fixed array data block page */
if (H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add fixed array data block page to cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINSERT, FAIL, "can't add fixed array data block page to cache")
inserted = TRUE;
/* Add data block page as child of 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, FAIL,
+ "unable to add fixed array entry as child of array proxy")
dblk_page->top_proxy = hdr->top_proxy;
} /* end if */
- CATCH
+done:
if (ret_value < 0)
if (dblk_page) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(dblk_page) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove fixed array data block page from cache")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTREMOVE, FAIL,
+ "unable to remove fixed array data block page from cache")
/* Destroy data block page */
if (H5FA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block page")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, FAIL, "unable to destroy fixed array data block page")
} /* end if */
-END_FUNC(PKG) /* end H5FA__dblk_page_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblk_page_create() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblk_page_protect
@@ -200,16 +213,17 @@ END_FUNC(PKG) /* end H5FA__dblk_page_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5FA_dblk_page_t *, NULL, NULL,
- H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, size_t dblk_page_nelmts,
- unsigned flags))
-
- /* Local variables */
+H5FA_dblk_page_t *
+H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, size_t dblk_page_nelmts, unsigned flags)
+{
H5FA_dblk_page_t * dblk_page = NULL; /* Fixed array data block page */
H5FA_dblk_page_cache_ud_t udata; /* Information needed for loading data block page */
+ H5FA_dblk_page_t * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
#ifdef H5FA_DEBUG
- HDfprintf(stderr, "%s: Called\n", FUNC);
+ HDfprintf(stderr, "%s: Called\n", __func__);
#endif /* H5FA_DEBUG */
/* Sanity check */
@@ -227,32 +241,36 @@ BEGIN_FUNC(PKG, ERR, H5FA_dblk_page_t *, NULL, NULL,
/* Protect the data block page */
if (NULL == (dblk_page = (H5FA_dblk_page_t *)H5AC_protect(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr,
&udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu",
- (unsigned long long)dblk_page_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, NULL,
+ "unable to protect fixed array data block page, address = %llu",
+ (unsigned long long)dblk_page_addr)
/* Create top proxy, if it doesn't exist */
if (hdr->top_proxy && NULL == dblk_page->top_proxy) {
/* Add data block page as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, NULL,
+ "unable to add fixed array entry as child of array proxy")
dblk_page->top_proxy = hdr->top_proxy;
} /* end if */
/* Set return value */
ret_value = dblk_page;
- CATCH
+done:
/* Clean up on error */
if (!ret_value) {
/* Release the data block page, if it was protected */
if (dblk_page &&
H5AC_unprotect(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block page, address = %llu",
- (unsigned long long)dblk_page->addr)
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, NULL,
+ "unable to unprotect fixed array data block page, address = %llu",
+ (unsigned long long)dblk_page->addr)
} /* end if */
-END_FUNC(PKG) /* end H5FA__dblk_page_protect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblk_page_protect() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblk_page_unprotect
@@ -267,13 +285,15 @@ END_FUNC(PKG) /* end H5FA__dblk_page_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags))
+herr_t
+H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
-/* Local variables */
+ FUNC_ENTER_PACKAGE
#ifdef H5FA_DEBUG
- HDfprintf(stderr, "%s: Called\n", FUNC);
+ HDfprintf(stderr, "%s: Called\n", __func__);
#endif /* H5FA_DEBUG */
/* Sanity check */
@@ -281,12 +301,13 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Unprotect the data block page */
if (H5AC_unprotect(dblk_page->hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block page, address = %llu",
- (unsigned long long)dblk_page->addr)
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect fixed array data block page, address = %llu",
+ (unsigned long long)dblk_page->addr)
-END_FUNC(PKG) /* end H5FA__dblk_page_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblk_page_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblk_page_dest
@@ -300,7 +321,12 @@ END_FUNC(PKG) /* end H5FA__dblk_page_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblk_page_dest(H5FA_dblk_page_t *dblk_page))
+herr_t
+H5FA__dblk_page_dest(H5FA_dblk_page_t *dblk_page)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(dblk_page);
@@ -315,7 +341,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblk_page_dest(H5FA_dblk_page_
/* Decrement reference count on shared info */
if (H5FA__hdr_decr(dblk_page->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
dblk_page->hdr = NULL;
} /* end if */
@@ -325,6 +352,6 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblk_page_dest(H5FA_dblk_page_
/* Free the data block page itself */
dblk_page = H5FL_FREE(H5FA_dblk_page_t, dblk_page);
- CATCH
-
-END_FUNC(PKG) /* end H5FA__dblk_page_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblk_page_dest() */
diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c
index 21e2e03..1ccc97d 100644
--- a/src/H5FAdblock.c
+++ b/src/H5FAdblock.c
@@ -88,10 +88,13 @@ H5FL_BLK_DEFINE(fa_page_init);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, H5FA__dblock_alloc(H5FA_hdr_t *hdr))
+H5FA_dblock_t *
+H5FA__dblock_alloc(H5FA_hdr_t *hdr)
+{
+ H5FA_dblock_t *dblock = NULL; /* fixed array data block */
+ H5FA_dblock_t *ret_value = NULL;
- /* Local variables */
- H5FA_dblock_t *dblock = NULL; /* fixed array data block */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
@@ -99,11 +102,11 @@ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, H5FA__dblock_alloc(H5FA_hdr_t
/* Allocate memory for the data block */
if (NULL == (dblock = H5FL_CALLOC(H5FA_dblock_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array data block")
/* Share common array information */
if (H5FA__hdr_incr(hdr) < 0)
- H5E_THROW(H5E_CANTINC, "can't increment reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINC, NULL, "can't increment reference count on shared array header")
dblock->hdr = hdr;
/* Set non-zero internal fields */
@@ -126,7 +129,7 @@ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, H5FA__dblock_alloc(H5FA_hdr_t
/* Allocate space for 'page init' flags */
if (NULL == (dblock->dblk_page_init = H5FL_BLK_CALLOC(fa_page_init, dblock->dblk_page_init_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for page init bitmask")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for page init bitmask")
/* Compute data block page size */
dblock->dblk_page_size = (dblock->dblk_page_nelmts * hdr->cparam.raw_elmt_size) + H5FA_SIZEOF_CHKSUM;
@@ -143,19 +146,20 @@ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, H5FA__dblock_alloc(H5FA_hdr_t
/* Allocate buffer for elements in data block */
H5_CHECK_OVERFLOW(dblk_size, /* From: */ hsize_t, /* To: */ size_t);
if (NULL == (dblock->elmts = H5FL_BLK_MALLOC(chunk_elmts, (size_t)dblk_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for data block element buffer")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for data block element buffer")
} /* end else */
/* Set the return value */
ret_value = dblock;
- CATCH
-
+done:
if (!ret_value)
if (dblock && H5FA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array data block")
-END_FUNC(PKG) /* end H5FA__dblock_alloc() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblock_alloc() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblock_create
@@ -169,13 +173,15 @@ END_FUNC(PKG) /* end H5FA__dblock_alloc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
- H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty))
+haddr_t
+H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty)
+{
+ H5FA_dblock_t *dblock = NULL; /* Fixed array data block */
+ haddr_t dblock_addr; /* Fixed array data block address */
+ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ haddr_t ret_value = HADDR_UNDEF;
- /* Local variables */
- H5FA_dblock_t *dblock = NULL; /* Fixed array data block */
- haddr_t dblock_addr; /* Fixed array data block address */
- hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -183,31 +189,35 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Allocate the data block */
if (NULL == (dblock = H5FA__dblock_alloc(hdr)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "memory allocation failed for fixed array data block")
/* Set size of data block on disk */
hdr->stats.dblk_size = dblock->size = H5FA_DBLOCK_SIZE(dblock);
/* Allocate space for the data block on disk */
if (HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FARRAY_DBLOCK, (hsize_t)dblock->size)))
- H5E_THROW(H5E_CANTALLOC, "file allocation failed for fixed array data block")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "file allocation failed for fixed array data block")
dblock->addr = dblock_addr;
/* Don't initialize elements if paged */
if (!dblock->npages)
/* Clear any elements in data block to fill value */
if ((hdr->cparam.cls->fill)(dblock->elmts, (size_t)hdr->cparam.nelmts) < 0)
- H5E_THROW(H5E_CANTSET, "can't set fixed array data block elements to class's fill value")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "can't set fixed array data block elements to class's fill value")
/* Cache the new fixed array data block */
if (H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add fixed array data block to cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add fixed array data block to cache")
inserted = TRUE;
/* Add data block as child of 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "unable to add fixed array entry as child of array proxy")
dblock->top_proxy = hdr->top_proxy;
} /* end if */
@@ -217,26 +227,28 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Set address of data block to return */
ret_value = dblock_addr;
- CATCH
+done:
if (!H5F_addr_defined(ret_value))
if (dblock) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(dblock) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove fixed array data block from cache")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTREMOVE, HADDR_UNDEF,
+ "unable to remove fixed array data block from cache")
/* Release data block's disk space */
if (H5F_addr_defined(dblock->addr) &&
H5MF_xfree(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dblock->addr, (hsize_t)dblock->size) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to release fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, "unable to release fixed array data block")
/* Destroy data block */
if (H5FA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, "unable to destroy fixed array data block")
} /* end if */
-END_FUNC(PKG) /* end H5FA__dblock_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblock_create() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblock_protect
@@ -250,12 +262,14 @@ END_FUNC(PKG) /* end H5FA__dblock_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL,
- H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, unsigned flags))
+H5FA_dblock_t *
+H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, unsigned flags)
+{
+ H5FA_dblock_t * dblock = NULL; /* Fixed array data block */
+ H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */
+ H5FA_dblock_t * ret_value = NULL;
- /* Local variables */
- H5FA_dblock_t * dblock; /* Fixed array data block */
- H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -271,31 +285,33 @@ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL,
/* Protect the data block */
if (NULL ==
(dblock = (H5FA_dblock_t *)H5AC_protect(hdr->f, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu",
- (unsigned long long)dblk_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, NULL,
+ "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr)
/* Create top proxy, if it doesn't exist */
if (hdr->top_proxy && NULL == dblock->top_proxy) {
/* Add data block as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, NULL,
+ "unable to add fixed array entry as child of array proxy")
dblock->top_proxy = hdr->top_proxy;
} /* end if */
/* Set return value */
ret_value = dblock;
- CATCH
-
+done:
/* Clean up on error */
if (!ret_value)
/* Release the data block, if it was protected */
if (dblock &&
H5AC_unprotect(hdr->f, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block, address = %llu",
- (unsigned long long)dblock->addr)
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, NULL,
+ "unable to unprotect fixed array data block, address = %llu",
+ (unsigned long long)dblock->addr)
-END_FUNC(PKG) /* end H5FA__dblock_protect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblock_protect() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblock_unprotect
@@ -309,22 +325,25 @@ END_FUNC(PKG) /* end H5FA__dblock_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags))
+herr_t
+H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(dblock);
/* Unprotect the data block */
if (H5AC_unprotect(dblock->hdr->f, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block, address = %llu",
- (unsigned long long)dblock->addr)
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect fixed array data block, address = %llu",
+ (unsigned long long)dblock->addr)
-END_FUNC(PKG) /* end H5FA__dblock_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblock_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblock_delete
@@ -338,10 +357,13 @@ END_FUNC(PKG) /* end H5FA__dblock_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblock_delete(H5FA_hdr_t *hdr, haddr_t dblk_addr))
+herr_t
+H5FA__dblock_delete(H5FA_hdr_t *hdr, haddr_t dblk_addr)
+{
+ H5FA_dblock_t *dblock = NULL; /* Pointer to data block */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5FA_dblock_t *dblock = NULL; /* Pointer to data block */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -349,8 +371,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblock_delete(H5FA_hdr_t *hdr,
/* Protect data block */
if (NULL == (dblock = H5FA__dblock_protect(hdr, dblk_addr, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu",
- (unsigned long long)dblk_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL,
+ "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr)
/* Check if data block is paged */
if (dblock->npages) {
@@ -365,21 +387,22 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblock_delete(H5FA_hdr_t *hdr,
/* Evict the data block page from the metadata cache */
/* (OK to call if it doesn't exist in the cache) */
if (H5AC_expunge_entry(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTEXPUNGE, "unable to remove array data block page from metadata cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTEXPUNGE, FAIL,
+ "unable to remove array data block page from metadata cache")
/* Advance to next page address */
dblk_page_addr += dblock->dblk_page_size;
} /* end for */
} /* end if */
- CATCH
-
+done:
/* Finished deleting data block in metadata cache */
if (dblock && H5FA__dblock_unprotect(dblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG |
H5AC__FREE_FILE_SPACE_FLAG) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array data block")
-END_FUNC(PKG) /* end H5FA__dblock_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblock_delete() */
/*-------------------------------------------------------------------------
* Function: H5FA__dblock_dest
@@ -393,7 +416,12 @@ END_FUNC(PKG) /* end H5FA__dblock_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblock_dest(H5FA_dblock_t *dblock))
+herr_t
+H5FA__dblock_dest(H5FA_dblock_t *dblock)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(dblock);
@@ -417,7 +445,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblock_dest(H5FA_dblock_t *dbl
/* Decrement reference count on shared info */
if (H5FA__hdr_decr(dblock->hdr) < 0)
- H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDEC, FAIL,
+ "can't decrement reference count on shared array header")
dblock->hdr = NULL;
} /* end if */
@@ -427,6 +456,6 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__dblock_dest(H5FA_dblock_t *dbl
/* Free the data block itself */
dblock = H5FL_FREE(H5FA_dblock_t, dblock);
- CATCH
-
-END_FUNC(PKG) /* end H5FA__dblock_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__dblock_dest() */
diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c
index 867160f..aeb3fb1 100644
--- a/src/H5FAhdr.c
+++ b/src/H5FAhdr.c
@@ -82,17 +82,20 @@ H5FL_DEFINE_STATIC(H5FA_hdr_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5FA_hdr_t *, NULL, NULL, H5FA__hdr_alloc(H5F_t *f))
+H5FA_hdr_t *
+H5FA__hdr_alloc(H5F_t *f)
+{
+ H5FA_hdr_t *hdr = NULL; /* Shared Fixed Array header */
+ H5FA_hdr_t *ret_value = NULL;
- /* Local variables */
- H5FA_hdr_t *hdr = NULL; /* Shared Fixed Array header */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
/* Allocate space for the shared information */
if (NULL == (hdr = H5FL_CALLOC(H5FA_hdr_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for Fixed Array shared header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for Fixed Array shared header")
/* Set non-zero internal fields */
hdr->addr = HADDR_UNDEF;
@@ -106,13 +109,12 @@ BEGIN_FUNC(PKG, ERR, H5FA_hdr_t *, NULL, NULL, H5FA__hdr_alloc(H5F_t *f))
/* Set the return value */
ret_value = hdr;
- CATCH
-
+done:
if (!ret_value)
if (hdr && H5FA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy fixed array header")
-
-END_FUNC(PKG) /* end H5FA__hdr_alloc() */
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, NULL, "unable to destroy fixed array header")
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_alloc() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_init
@@ -126,9 +128,12 @@ END_FUNC(PKG) /* end H5FA__hdr_alloc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata))
+herr_t
+H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
@@ -140,33 +145,36 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_init(H5FA_hdr_t *hdr, void
hdr->stats.nelmts = hdr->cparam.nelmts;
/* Create the callback context, if there's one */
- if (hdr->cparam.cls->crt_context) {
+ if (hdr->cparam.cls->crt_context)
if (NULL == (hdr->cb_ctx = (*hdr->cparam.cls->crt_context)(ctx_udata)))
- H5E_THROW(H5E_CANTCREATE, "unable to create fixed array client callback context")
- } /* end if */
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTCREATE, FAIL,
+ "unable to create fixed array client callback context")
- CATCH
-
-END_FUNC(PKG) /* end H5FA__hdr_init() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_init() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_create
*
* Purpose: Creates a new Fixed Array header in the file
*
- * Return: SUCCEED/FAIL
+ * Return: Success: Address of new header in the file
+ * Failure: HADDR_UNDEF
*
* Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
- H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata))
+haddr_t
+H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata)
+{
+ H5FA_hdr_t *hdr = NULL; /* Fixed array header */
+ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ haddr_t ret_value = HADDR_UNDEF;
- /* Local variables */
- H5FA_hdr_t *hdr = NULL; /* Fixed array header */
- hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(f);
@@ -176,17 +184,19 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
{
/* Check for valid parameters */
if (cparam->raw_elmt_size == 0)
- H5E_THROW(H5E_BADVALUE, "element size must be greater than zero")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, HADDR_UNDEF, "element size must be greater than zero")
if (cparam->max_dblk_page_nelmts_bits == 0)
- H5E_THROW(H5E_BADVALUE, "max. # of elements bits must be greater than zero")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, HADDR_UNDEF,
+ "max. # of elements bits must be greater than zero")
if (cparam->nelmts == 0)
- H5E_THROW(H5E_BADVALUE, "# of elements must be greater than zero")
+ HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, HADDR_UNDEF, "# of elements must be greater than zero")
}
#endif /* NDEBUG */
/* Allocate space for the shared information */
if (NULL == (hdr = H5FA__hdr_alloc(f)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for Fixed Array shared header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, HADDR_UNDEF,
+ "memory allocation failed for Fixed Array shared header")
hdr->dblk_addr = HADDR_UNDEF;
@@ -195,50 +205,52 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Finish initializing fixed array header */
if (H5FA__hdr_init(hdr, ctx_udata) < 0)
- H5E_THROW(H5E_CANTINIT, "initialization failed for fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, HADDR_UNDEF, "initialization failed for fixed array header")
/* Allocate space for the header on disk */
if (HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_FARRAY_HDR, (hsize_t)hdr->size)))
- H5E_THROW(H5E_CANTALLOC, "file allocation failed for Fixed Array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, HADDR_UNDEF, "file allocation failed for Fixed Array header")
/* Create 'top' proxy for extensible array entries */
if (hdr->swmr_write)
if (NULL == (hdr->top_proxy = H5AC_proxy_entry_create()))
- H5E_THROW(H5E_CANTCREATE, "can't create fixed array entry proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTCREATE, HADDR_UNDEF, "can't create fixed array entry proxy")
/* Cache the new Fixed Array header */
if (H5AC_insert_entry(f, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add fixed array header to cache")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTINSERT, HADDR_UNDEF, "can't add fixed array header to cache")
inserted = TRUE;
/* Add header as child of 'top' proxy */
if (hdr->top_proxy)
if (H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, HADDR_UNDEF,
+ "unable to add fixed array entry as child of array proxy")
/* Set address of array header to return */
ret_value = hdr->addr;
- CATCH
-
+done:
if (!H5F_addr_defined(ret_value))
if (hdr) {
/* Remove from cache, if inserted */
if (inserted)
if (H5AC_remove_entry(hdr) < 0)
- H5E_THROW(H5E_CANTREMOVE, "unable to remove fixed array header from cache")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTREMOVE, HADDR_UNDEF,
+ "unable to remove fixed array header from cache")
/* Release header's disk space */
if (H5F_addr_defined(hdr->addr) &&
H5MF_xfree(f, H5FD_MEM_FARRAY_HDR, hdr->addr, (hsize_t)hdr->size) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to free Fixed Array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, "unable to free Fixed Array header")
/* Destroy header */
if (H5FA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy Fixed Array header")
- } /* end if */
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, "unable to destroy Fixed Array header")
+ }
-END_FUNC(PKG) /* end H5FA__hdr_create() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_create() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_incr
@@ -252,7 +264,12 @@ END_FUNC(PKG) /* end H5FA__hdr_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_incr(H5FA_hdr_t *hdr))
+herr_t
+H5FA__hdr_incr(H5FA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -260,14 +277,14 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_incr(H5FA_hdr_t *hdr))
/* Mark header as un-evictable when something is depending on it */
if (hdr->rc == 0)
if (H5AC_pin_protected_entry(hdr) < 0)
- H5E_THROW(H5E_CANTPIN, "unable to pin fixed array header")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPIN, FAIL, "unable to pin fixed array header")
/* Increment reference count on shared header */
hdr->rc++;
- CATCH
-
-END_FUNC(PKG) /* end H5FA__hdr_incr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_incr() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_decr
@@ -281,7 +298,12 @@ END_FUNC(PKG) /* end H5FA__hdr_incr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_decr(H5FA_hdr_t *hdr))
+herr_t
+H5FA__hdr_decr(H5FA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -294,12 +316,12 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_decr(H5FA_hdr_t *hdr))
if (hdr->rc == 0) {
HDassert(hdr->file_rc == 0);
if (H5AC_unpin_entry(hdr) < 0)
- H5E_THROW(H5E_CANTUNPIN, "unable to unpin fixed array header")
- } /* end if */
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNPIN, FAIL, "unable to unpin fixed array header")
+ }
-END_FUNC(PKG) /* end H5FA__hdr_decr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_decr() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_fuse_incr
@@ -313,7 +335,10 @@ END_FUNC(PKG) /* end H5FA__hdr_decr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr))
+herr_t
+H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr)
+{
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(hdr);
@@ -321,21 +346,28 @@ BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr))
/* Increment file reference count on shared header */
hdr->file_rc++;
-END_FUNC(PKG) /* end H5FA__hdr_fuse_incr() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__hdr_fuse_incr() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_fuse_decr
*
* Purpose: Decrement file reference count on shared array header
*
- * Return: SUCCEED/FAIL
+ * Return: Success: The reference count of the header
+ * Failure: Can't fail
*
* Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, size_t, 0, -, H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr))
+size_t
+H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr)
+{
+ size_t ret_value = 0;
+
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(hdr);
@@ -347,7 +379,8 @@ BEGIN_FUNC(PKG, NOERR, size_t, 0, -, H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr))
/* Set return value */
ret_value = hdr->file_rc;
-END_FUNC(PKG) /* end H5FA__hdr_fuse_decr() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_fuse_decr() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_modified
@@ -361,18 +394,23 @@ END_FUNC(PKG) /* end H5FA__hdr_fuse_decr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_modified(H5FA_hdr_t *hdr))
+herr_t
+H5FA__hdr_modified(H5FA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
/* Mark header as dirty in cache */
if (H5AC_mark_entry_dirty(hdr) < 0)
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark fixed array header as dirty")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTMARKDIRTY, FAIL, "unable to mark fixed array header as dirty")
-END_FUNC(PKG) /* end H5FA__hdr_modified() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_modified() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_protect
@@ -386,12 +424,14 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5FA_hdr_t *, NULL, NULL,
- H5FA__hdr_protect(H5F_t *f, haddr_t fa_addr, void *ctx_udata, unsigned flags))
-
- /* Local variables */
+H5FA_hdr_t *
+H5FA__hdr_protect(H5F_t *f, haddr_t fa_addr, void *ctx_udata, unsigned flags)
+{
H5FA_hdr_t * hdr; /* Fixed array header */
H5FA_hdr_cache_ud_t udata; /* User data for cache callbacks */
+ H5FA_hdr_t * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(f);
@@ -407,27 +447,28 @@ BEGIN_FUNC(PKG, ERR, H5FA_hdr_t *, NULL, NULL,
/* Protect the header */
if (NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, H5AC_FARRAY_HDR, fa_addr, &udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu",
- (unsigned long long)fa_addr)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, NULL, "unable to protect fixed array header, address = %llu",
+ (unsigned long long)fa_addr)
hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */
/* Create top proxy, if it doesn't exist */
if (hdr->swmr_write && NULL == hdr->top_proxy) {
/* Create 'top' proxy for fixed array entries */
if (NULL == (hdr->top_proxy = H5AC_proxy_entry_create()))
- H5E_THROW(H5E_CANTCREATE, "can't create fixed array entry proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTCREATE, NULL, "can't create fixed array entry proxy")
/* Add header as child of 'top' proxy */
if (H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0)
- H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy")
- } /* end if */
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTSET, NULL,
+ "unable to add fixed array entry as child of array proxy")
+ }
/* Set return value */
ret_value = hdr;
- CATCH
-
-END_FUNC(PKG) /* end H5FA__hdr_protect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_protect() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_unprotect
@@ -441,21 +482,24 @@ END_FUNC(PKG) /* end H5FA__hdr_protect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags))
+herr_t
+H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags)
+{
+ herr_t ret_value = SUCCEED;
- /* Local variables */
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
/* Unprotect the header */
if (H5AC_unprotect(hdr->f, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array hdr, address = %llu",
- (unsigned long long)hdr->addr)
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL,
+ "unable to unprotect fixed array hdr, address = %llu", (unsigned long long)hdr->addr)
-END_FUNC(PKG) /* end H5FA__hdr_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_delete
@@ -469,46 +513,49 @@ END_FUNC(PKG) /* end H5FA__hdr_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_delete(H5FA_hdr_t *hdr))
-
- /* Local variables */
+herr_t
+H5FA__hdr_delete(H5FA_hdr_t *hdr)
+{
unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
HDassert(!hdr->file_rc);
#ifndef NDEBUG
- {
- unsigned hdr_status = 0; /* Array header's status in the metadata cache */
- /* Check the array header's status in the metadata cache */
- if (H5AC_get_entry_status(hdr->f, hdr->addr, &hdr_status) < 0)
- H5E_THROW(H5E_CANTGET, "unable to check metadata cache status for array header")
+ unsigned hdr_status = 0; /* Array header's status in the metadata cache */
+
+ /* Check the array header's status in the metadata cache */
+ if (H5AC_get_entry_status(hdr->f, hdr->addr, &hdr_status) < 0)
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, FAIL, "unable to check metadata cache status for array header")
+
+ /* Sanity checks on array header */
+ HDassert(hdr_status & H5AC_ES__IN_CACHE);
+ HDassert(hdr_status & H5AC_ES__IS_PROTECTED);
- /* Sanity checks on array header */
- HDassert(hdr_status & H5AC_ES__IN_CACHE);
- HDassert(hdr_status & H5AC_ES__IS_PROTECTED);
- } /* end block */
#endif /* NDEBUG */
/* Check for Fixed Array Data block */
if (H5F_addr_defined(hdr->dblk_addr)) {
/* Delete Fixed Array Data block */
if (H5FA__dblock_delete(hdr, hdr->dblk_addr) < 0)
- H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block")
- } /* end if */
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDELETE, FAIL, "unable to delete fixed array data block")
+ }
/* Set flags to finish deleting header on unprotect */
cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;
- CATCH
-
+done:
/* Unprotect the header, deleting it if an error hasn't occurred */
if (H5AC_unprotect(hdr->f, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ HDONE_ERROR(H5E_FARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release fixed array header")
-END_FUNC(PKG) /* end H5FA__hdr_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_delete() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_dest
@@ -522,7 +569,12 @@ END_FUNC(PKG) /* end H5FA__hdr_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_dest(H5FA_hdr_t *hdr))
+herr_t
+H5FA__hdr_dest(H5FA_hdr_t *hdr)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(hdr);
@@ -531,20 +583,21 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_dest(H5FA_hdr_t *hdr))
/* Destroy the callback context */
if (hdr->cb_ctx) {
if ((*hdr->cparam.cls->dst_context)(hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to destroy fixed array client callback context")
- } /* end if */
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTRELEASE, FAIL,
+ "unable to destroy fixed array client callback context")
+ }
hdr->cb_ctx = NULL;
/* Destroy the 'top' proxy */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_dest(hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to destroy fixed array 'top' proxy")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTRELEASE, FAIL, "unable to destroy fixed array 'top' proxy")
hdr->top_proxy = NULL;
- } /* end if */
+ }
/* Free the shared info itself */
hdr = H5FL_FREE(H5FA_hdr_t, hdr);
- CATCH
-
-END_FUNC(PKG) /* end H5FA__hdr_dest() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__hdr_dest() */
diff --git a/src/H5FAint.c b/src/H5FAint.c
index 864c7ee..2206901 100644
--- a/src/H5FAint.c
+++ b/src/H5FAint.c
@@ -79,8 +79,12 @@
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5FA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry))
+herr_t
+H5FA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(parent_entry);
@@ -88,11 +92,11 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Create a flush dependency between parent and child entry */
if (H5AC_create_flush_dependency(parent_entry, child_entry) < 0)
- H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
-END_FUNC(PKG) /* end H5FA__create_flush_depend() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__create_flush_depend() */
/*-------------------------------------------------------------------------
* Function: H5FA__destroy_flush_depend
@@ -106,8 +110,12 @@ END_FUNC(PKG) /* end H5FA__create_flush_depend() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
- H5FA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry))
+herr_t
+H5FA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(parent_entry);
@@ -115,8 +123,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Destroy a flush dependency between parent and child entry */
if (H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency")
-
- CATCH
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
-END_FUNC(PKG) /* end H5FA__destroy_flush_depend() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__destroy_flush_depend() */
diff --git a/src/H5FAstat.c b/src/H5FAstat.c
index 1fdf47f..f7d1b90 100644
--- a/src/H5FAstat.c
+++ b/src/H5FAstat.c
@@ -78,21 +78,21 @@
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5FA_get_stats(const H5FA_t *fa, H5FA_stat_t *stats))
-
-/* Local variables */
+herr_t
+H5FA_get_stats(const H5FA_t *fa, H5FA_stat_t *stats)
+{
+ FUNC_ENTER_NOAPI_NOERR
#ifdef H5FA_DEBUG
- HDfprintf(stderr, "%s: Called\n", FUNC);
+ HDfprintf(stderr, "%s: Called\n", __func__);
#endif /* H5FA_DEBUG */
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(fa);
HDassert(stats);
/* Copy fixed array statistics */
H5MM_memcpy(stats, &fa->hdr->stats, sizeof(fa->hdr->stats));
-END_FUNC(PRIV) /* end H5FA_get_stats() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA_get_stats() */
diff --git a/src/H5FAtest.c b/src/H5FAtest.c
index 6dd6e00..384a657 100644
--- a/src/H5FAtest.c
+++ b/src/H5FAtest.c
@@ -112,14 +112,17 @@ H5FL_DEFINE_STATIC(H5FA__test_ctx_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, H5FA__test_crt_context(void H5_ATTR_UNUSED *udata))
-
- /* Local variables */
+static void *
+H5FA__test_crt_context(void H5_ATTR_UNUSED *udata)
+{
H5FA__test_ctx_t *ctx; /* Context for callbacks */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Allocate new context structure */
if (NULL == (ctx = H5FL_MALLOC(H5FA__test_ctx_t)))
- H5E_THROW(H5E_CANTALLOC, "can't allocate fixed array client callback context")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "can't allocate fixed array client callback context")
/* Initialize the context */
ctx->bogus = H5FA__TEST_BOGUS_VAL;
@@ -127,9 +130,9 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, H5FA__test_crt_context(void H5_ATTR_
/* Set return value */
ret_value = ctx;
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__test_crt_context() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FA__test_crt_context() */
/*-------------------------------------------------------------------------
* Function: H5FA__test_dst_context
@@ -143,18 +146,21 @@ END_FUNC(STATIC) /* end H5FA__test_crt_context() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, H5FA__test_dst_context(void *_ctx))
-
- /* Local variables */
+static herr_t
+H5FA__test_dst_context(void *_ctx)
+{
H5FA__test_ctx_t *ctx = (H5FA__test_ctx_t *)_ctx; /* Callback context to destroy */
+ FUNC_ENTER_STATIC_NOERR
+
/* Sanity checks */
HDassert(H5FA__TEST_BOGUS_VAL == ctx->bogus);
/* Release context structure */
ctx = H5FL_FREE(H5FA__test_ctx_t, ctx);
-END_FUNC(STATIC) /* end H5FA__test_dst_context() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__test_dst_context() */
/*-------------------------------------------------------------------------
* Function: H5FA__test_fill
@@ -168,18 +174,21 @@ END_FUNC(STATIC) /* end H5FA__test_dst_context() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, H5FA__test_fill(void *nat_blk, size_t nelmts))
-
- /* Local variables */
+static herr_t
+H5FA__test_fill(void *nat_blk, size_t nelmts)
+{
uint64_t fill_val = H5FA_TEST_FILL; /* Value to fill elements with */
+ FUNC_ENTER_STATIC_NOERR
+
/* Sanity checks */
HDassert(nat_blk);
HDassert(nelmts);
H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts);
-END_FUNC(STATIC) /* end H5FA__test_fill() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__test_fill() */
/*-------------------------------------------------------------------------
* Function: H5FA__test_encode
@@ -193,14 +202,15 @@ END_FUNC(STATIC) /* end H5FA__test_fill() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx))
-
-/* Local variables */
+static herr_t
+H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx)
+{
#ifndef NDEBUG
H5FA__test_ctx_t *ctx = (H5FA__test_ctx_t *)_ctx; /* Callback context to destroy */
-#endif /* NDEBUG */
- const uint64_t *elmt = (const uint64_t *)_elmt; /* Convenience pointer to native elements */
+#endif
+ const uint64_t *elmt = (const uint64_t *)_elmt; /* Convenience pointer to native elements */
+
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(raw);
@@ -221,7 +231,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
nelmts--;
} /* end while */
-END_FUNC(STATIC) /* end H5FA__test_encode() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__test_encode() */
/*-------------------------------------------------------------------------
* Function: H5FA__test_decode
@@ -235,15 +246,16 @@ END_FUNC(STATIC) /* end H5FA__test_encode() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx))
-
-/* Local variables */
+static herr_t
+H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx)
+{
#ifndef NDEBUG
H5FA__test_ctx_t *ctx = (H5FA__test_ctx_t *)_ctx; /* Callback context to destroy */
-#endif /* NDEBUG */
- uint64_t * elmt = (uint64_t *)_elmt; /* Convenience pointer to native elements */
- const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */
+#endif
+ uint64_t * elmt = (uint64_t *)_elmt; /* Convenience pointer to native elements */
+ const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */
+
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(raw);
@@ -264,7 +276,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
nelmts--;
} /* end while */
-END_FUNC(STATIC) /* end H5FA__test_decode() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__test_decode() */
/*-------------------------------------------------------------------------
* Function: H5FA__test_debug
@@ -278,12 +291,13 @@ END_FUNC(STATIC) /* end H5FA__test_decode() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5FA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt))
-
- /* Local variables */
+static herr_t
+H5FA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt)
+{
char temp_str[128]; /* Temporary string, for formatting */
+ FUNC_ENTER_STATIC_NOERR
+
/* Sanity checks */
HDassert(stream);
HDassert(elmt);
@@ -293,7 +307,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
HDfprintf(stream, "%*s%-*s %llu\n", indent, "", fwidth, temp_str,
(unsigned long long)*(const uint64_t *)elmt);
-END_FUNC(STATIC) /* end H5FA__test_debug() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FA__test_debug() */
/*-------------------------------------------------------------------------
* Function: H5FA__test_crt_dbg_context
@@ -308,15 +323,17 @@ END_FUNC(STATIC) /* end H5FA__test_debug() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5FA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr))
-
- /* Local variables */
+static void *
+H5FA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)
+{
H5FA__test_ctx_t *ctx; /* Context for callbacks */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Allocate new context structure */
if (NULL == (ctx = H5FL_MALLOC(H5FA__test_ctx_t)))
- H5E_THROW(H5E_CANTALLOC, "can't allocate fixed array client callback context")
+ HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "can't allocate fixed array client callback context")
/* Initialize the context */
ctx->bogus = H5FA__TEST_BOGUS_VAL;
@@ -324,9 +341,9 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = ctx;
- CATCH
-
-END_FUNC(STATIC) /* end H5FA__test_crt_dbg_context() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5FA__test_crt_dbg_context() */
/*-------------------------------------------------------------------------
* Function: H5FA__get_cparam_test
@@ -340,7 +357,10 @@ END_FUNC(STATIC) /* end H5FA__test_crt_dbg_context() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5FA__get_cparam_test(const H5FA_t *fa, H5FA_create_t *cparam))
+herr_t
+H5FA__get_cparam_test(const H5FA_t *fa, H5FA_create_t *cparam)
+{
+ FUNC_ENTER_PACKAGE_NOERR
/* Check arguments. */
HDassert(fa);
@@ -350,22 +370,27 @@ BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5FA__get_cparam_test(const H5FA_t *f
cparam->raw_elmt_size = fa->hdr->cparam.raw_elmt_size;
cparam->nelmts = fa->hdr->cparam.nelmts;
-END_FUNC(PKG) /* end H5FA__get_cparam_test() */
+ FUNC_LEAVE_NOAPI(SUCCEED);
+} /* end H5FA__get_cparam_test() */
/*-------------------------------------------------------------------------
* Function: H5FA__cmp_cparam_test
*
* Purpose: Compare the parameters used to create the fixed array
*
- * Return: SUCCEED/FAIL
+ * Return: An integer value like strcmp
*
* Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERRCATCH, int, 0, -,
- H5FA__cmp_cparam_test(const H5FA_create_t *cparam1, const H5FA_create_t *cparam2))
+int
+H5FA__cmp_cparam_test(const H5FA_create_t *cparam1, const H5FA_create_t *cparam2)
+{
+ int ret_value = 0;
+
+ FUNC_ENTER_PACKAGE_NOERR
/* Check arguments. */
HDassert(cparam1);
@@ -373,10 +398,10 @@ BEGIN_FUNC(PKG, ERRCATCH, int, 0, -,
/* Compare creation parameters for array */
if (cparam1->raw_elmt_size < cparam2->raw_elmt_size)
- H5_LEAVE(-1)
+ ret_value = -1;
else if (cparam1->raw_elmt_size > cparam2->raw_elmt_size)
- H5_LEAVE(1)
+ ret_value = 1;
- CATCH
+ FUNC_LEAVE_NOAPI(ret_value)
-END_FUNC(PKG) /* end H5FA__cmp_cparam_test() */
+} /* end H5FA__cmp_cparam_test() */
diff --git a/src/H5FD.c b/src/H5FD.c
index 3cc5e82..11071d1 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -496,9 +496,9 @@ H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf)
/* Check if driver matches driver information saved. Unfortunately, we can't push this
* function to each specific driver because we're checking if the driver is correct.
*/
- if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family"))
+ if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family") != 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "family driver should be used")
- if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi"))
+ if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi") != 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "multi driver should be used")
/* Decode driver information */
@@ -2147,7 +2147,7 @@ H5FD_ctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void
}
else if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG) {
- HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "VFD ctl request failed (no ctl and fail if unknown)")
+ HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "VFD ctl request failed (no ctl and fail if unknown flag is set)")
}
done:
@@ -2355,3 +2355,37 @@ H5FDdriver_query(hid_t driver_id, unsigned long *flags /*out*/)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5FDdriver_query() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FDdelete
+ *
+ * Purpose: Deletes a file
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FDdelete(const char *filename, hid_t fapl_id)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "*si", filename, fapl_id);
+
+ /* Check arguments */
+ if (!filename || !*filename)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no file name specified")
+
+ if (H5P_DEFAULT == fapl_id)
+ fapl_id = H5P_FILE_ACCESS_DEFAULT;
+ else if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+
+ /* Call private function */
+ if (H5FD_delete(filename, fapl_id) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5FDdelete() */
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 5fe845c..9bf49ce 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -148,6 +148,7 @@ static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__core_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__core_unlock(H5FD_t *_file);
+static herr_t H5FD__core_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_core_g = {
"core", /* name */
@@ -185,6 +186,7 @@ static const H5FD_class_t H5FD_core_g = {
H5FD__core_truncate, /* truncate */
H5FD__core_lock, /* lock */
H5FD__core_unlock, /* unlock */
+ H5FD__core_delete, /* del */
NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -1713,3 +1715,36 @@ H5FD__core_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__core_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__core_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__core_delete(const char *filename, hid_t fapl_id)
+{
+ const H5FD_core_fapl_t *fa = NULL;
+ H5P_genplist_t * plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ if (NULL == (fa = (const H5FD_core_fapl_t *)H5P_peek_driver_info(plist)))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
+
+ if (fa->backing_store)
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__core_delete() */
diff --git a/src/H5FDcore.h b/src/H5FDcore.h
index f8a516a..d456c3e 100644
--- a/src/H5FDcore.h
+++ b/src/H5FDcore.h
@@ -25,8 +25,70 @@
#ifdef __cplusplus
extern "C" {
#endif
-H5_DLL hid_t H5FD_core_init(void);
+H5_DLL hid_t H5FD_core_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Modifies the file access property list to use the #H5FD_CORE driver
+ *
+ * \fapl_id
+ * \param[in] increment Size, in bytes, of memory increments
+ * \param[in] backing_store Boolean flag indicating whether to write the file
+ * contents to disk when the file is closed
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_core() modifies the file access property list to use the
+ * #H5FD_CORE driver.
+ *
+ * The #H5FD_CORE driver enables an application to work with a file in
+ * memory, speeding reads and writes as no disk access is made. File
+ * contents are stored only in memory until the file is closed. The \p
+ * backing_store parameter determines whether file contents are ever
+ * written to disk.
+ *
+ * \p increment specifies the increment by which allocated memory is to
+ * be increased each time more memory is required.
+ *
+ * While using H5Fcreate() to create a core file, if the \p
+ * backing_store is set to 1 (TRUE), the file contents are flushed to a
+ * file with the same name as this core file when the file is closed or
+ * access to the file is terminated in memory.
+ *
+ * The application is allowed to open an existing file with #H5FD_CORE
+ * driver. While using H5Fopen() to open an existing file, if the \p
+ * backing_store is set to 1 (TRUE) and the \c flags for H5Fopen() is set to
+ * #H5F_ACC_RDWR, any change to the file contents are saved to the file
+ * when the file is closed. If \p backing_store is set to 0 (FALSE) and the \c
+ * flags for H5Fopen() is set to #H5F_ACC_RDWR, any change to the file
+ * contents will be lost when the file is closed. If the flags for
+ * H5Fopen() is set to #H5F_ACC_RDONLY, no change to the file is
+ * allowed either in memory or on file.
+ *
+ * \note Currently this driver cannot create or open family or multi files.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Queries core file driver properties
+ *
+ * \fapl_id
+ * \param[out] increment Size, in bytes, of memory increments
+ * \param[out] backing_store Boolean flag indicating whether to write the file
+ * contents to disk when the file is closed
+ * \returns \herr_t
+ *
+ * \details H5Pget_fapl_core() queries the #H5FD_CORE driver properties as set
+ * by H5Pset_fapl_core().
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_store /*out*/);
#ifdef __cplusplus
}
diff --git a/src/H5FDdevelop.h b/src/H5FDdevelop.h
new file mode 100644
index 0000000..bbfb8af
--- /dev/null
+++ b/src/H5FDdevelop.h
@@ -0,0 +1,284 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * This file contains public declarations for the H5FD (file drivers) developer
+ * support routines.
+ */
+
+#ifndef _H5FDdevelop_H
+#define _H5FDdevelop_H
+
+/* Include package's public header */
+#include "H5FDpublic.h"
+
+/*****************/
+/* Public Macros */
+/*****************/
+
+/* Map "fractal heap" header blocks to 'ohdr' type file memory, since its
+ * a fair amount of work to add a new kind of file memory and they are similar
+ * enough to object headers and probably too minor to deserve their own type.
+ *
+ * Map "fractal heap" indirect blocks to 'ohdr' type file memory, since they
+ * are similar to fractal heap header blocks.
+ *
+ * Map "fractal heap" direct blocks to 'lheap' type file memory, since they
+ * will be replacing local heaps.
+ *
+ * Map "fractal heap" 'huge' objects to 'draw' type file memory, since they
+ * represent large objects that are directly stored in the file.
+ *
+ * -QAK
+ */
+#define H5FD_MEM_FHEAP_HDR H5FD_MEM_OHDR
+#define H5FD_MEM_FHEAP_IBLOCK H5FD_MEM_OHDR
+#define H5FD_MEM_FHEAP_DBLOCK H5FD_MEM_LHEAP
+#define H5FD_MEM_FHEAP_HUGE_OBJ H5FD_MEM_DRAW
+
+/* Map "free space" header blocks to 'ohdr' type file memory, since its
+ * a fair amount of work to add a new kind of file memory and they are similar
+ * enough to object headers and probably too minor to deserve their own type.
+ *
+ * Map "free space" serialized sections to 'lheap' type file memory, since they
+ * are similar enough to local heap info.
+ *
+ * -QAK
+ */
+#define H5FD_MEM_FSPACE_HDR H5FD_MEM_OHDR
+#define H5FD_MEM_FSPACE_SINFO H5FD_MEM_LHEAP
+
+/* Map "shared object header message" master table to 'ohdr' type file memory,
+ * since its a fair amount of work to add a new kind of file memory and they are
+ * similar enough to object headers and probably too minor to deserve their own
+ * type.
+ *
+ * Map "shared object header message" indices to 'btree' type file memory,
+ * since they are similar enough to B-tree nodes.
+ *
+ * -QAK
+ */
+#define H5FD_MEM_SOHM_TABLE H5FD_MEM_OHDR
+#define H5FD_MEM_SOHM_INDEX H5FD_MEM_BTREE
+
+/* Map "extensible array" header blocks to 'ohdr' type file memory, since its
+ * a fair amount of work to add a new kind of file memory and they are similar
+ * enough to object headers and probably too minor to deserve their own type.
+ *
+ * Map "extensible array" index blocks to 'ohdr' type file memory, since they
+ * are similar to extensible array header blocks.
+ *
+ * Map "extensible array" super blocks to 'btree' type file memory, since they
+ * are similar enough to B-tree nodes.
+ *
+ * Map "extensible array" data blocks & pages to 'lheap' type file memory, since
+ * they are similar enough to local heap info.
+ *
+ * -QAK
+ */
+#define H5FD_MEM_EARRAY_HDR H5FD_MEM_OHDR
+#define H5FD_MEM_EARRAY_IBLOCK H5FD_MEM_OHDR
+#define H5FD_MEM_EARRAY_SBLOCK H5FD_MEM_BTREE
+#define H5FD_MEM_EARRAY_DBLOCK H5FD_MEM_LHEAP
+#define H5FD_MEM_EARRAY_DBLK_PAGE H5FD_MEM_LHEAP
+
+/* Map "fixed array" header blocks to 'ohdr' type file memory, since its
+ * a fair amount of work to add a new kind of file memory and they are similar
+ * enough to object headers and probably too minor to deserve their own type.
+ *
+ * Map "fixed array" data blocks & pages to 'lheap' type file memory, since
+ * they are similar enough to local heap info.
+ *
+ */
+#define H5FD_MEM_FARRAY_HDR H5FD_MEM_OHDR
+#define H5FD_MEM_FARRAY_DBLOCK H5FD_MEM_LHEAP
+#define H5FD_MEM_FARRAY_DBLK_PAGE H5FD_MEM_LHEAP
+
+/*
+ * A free-list map which maps all types of allocation requests to a single
+ * free list. This is useful for drivers that don't really care about
+ * keeping different requests segregated in the underlying file and which
+ * want to make most efficient reuse of freed memory. The use of the
+ * H5FD_MEM_SUPER free list is arbitrary.
+ */
+#define H5FD_FLMAP_SINGLE \
+ { \
+ H5FD_MEM_SUPER, /*default*/ \
+ H5FD_MEM_SUPER, /*super*/ \
+ H5FD_MEM_SUPER, /*btree*/ \
+ H5FD_MEM_SUPER, /*draw*/ \
+ H5FD_MEM_SUPER, /*gheap*/ \
+ H5FD_MEM_SUPER, /*lheap*/ \
+ H5FD_MEM_SUPER /*ohdr*/ \
+ }
+
+/*
+ * A free-list map which segregates requests into `raw' or `meta' data
+ * pools.
+ */
+#define H5FD_FLMAP_DICHOTOMY \
+ { \
+ H5FD_MEM_SUPER, /*default*/ \
+ H5FD_MEM_SUPER, /*super*/ \
+ H5FD_MEM_SUPER, /*btree*/ \
+ H5FD_MEM_DRAW, /*draw*/ \
+ H5FD_MEM_DRAW, /*gheap*/ \
+ H5FD_MEM_SUPER, /*lheap*/ \
+ H5FD_MEM_SUPER /*ohdr*/ \
+ }
+
+/*
+ * The default free list map which causes each request type to use it's own
+ * free-list.
+ */
+#define H5FD_FLMAP_DEFAULT \
+ { \
+ H5FD_MEM_DEFAULT, /*default*/ \
+ H5FD_MEM_DEFAULT, /*super*/ \
+ H5FD_MEM_DEFAULT, /*btree*/ \
+ H5FD_MEM_DEFAULT, /*draw*/ \
+ H5FD_MEM_DEFAULT, /*gheap*/ \
+ H5FD_MEM_DEFAULT, /*lheap*/ \
+ H5FD_MEM_DEFAULT /*ohdr*/ \
+ }
+
+/*******************/
+/* Public Typedefs */
+/*******************/
+
+/* Forward declaration */
+typedef struct H5FD_t H5FD_t;
+
+/* Class information for each file driver */
+typedef struct H5FD_class_t {
+ const char * name;
+ haddr_t maxaddr;
+ H5F_close_degree_t fc_degree;
+ herr_t (*terminate)(void);
+ hsize_t (*sb_size)(H5FD_t *file);
+ herr_t (*sb_encode)(H5FD_t *file, char *name /*out*/, unsigned char *p /*out*/);
+ herr_t (*sb_decode)(H5FD_t *f, const char *name, const unsigned char *p);
+ size_t fapl_size;
+ void *(*fapl_get)(H5FD_t *file);
+ void *(*fapl_copy)(const void *fapl);
+ herr_t (*fapl_free)(void *fapl);
+ size_t dxpl_size;
+ void *(*dxpl_copy)(const void *dxpl);
+ herr_t (*dxpl_free)(void *dxpl);
+ H5FD_t *(*open)(const char *name, unsigned flags, hid_t fapl, haddr_t maxaddr);
+ herr_t (*close)(H5FD_t *file);
+ int (*cmp)(const H5FD_t *f1, const H5FD_t *f2);
+ herr_t (*query)(const H5FD_t *f1, unsigned long *flags);
+ herr_t (*get_type_map)(const H5FD_t *file, H5FD_mem_t *type_map);
+ haddr_t (*alloc)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
+ herr_t (*free)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
+ haddr_t (*get_eoa)(const H5FD_t *file, H5FD_mem_t type);
+ herr_t (*set_eoa)(H5FD_t *file, H5FD_mem_t type, haddr_t addr);
+ haddr_t (*get_eof)(const H5FD_t *file, H5FD_mem_t type);
+ herr_t (*get_handle)(H5FD_t *file, hid_t fapl, void **file_handle);
+ herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, void *buffer);
+ herr_t (*write)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, const void *buffer);
+ herr_t (*read_vector)(H5FD_t *file, hid_t dxpl, uint32_t count, H5FD_mem_t types[], haddr_t addrs[],
+ size_t sizes[], void *bufs[]);
+ herr_t (*write_vector)(H5FD_t *file, hid_t dxpl, uint32_t count, H5FD_mem_t types[], haddr_t addrs[],
+ size_t sizes[], const void *bufs[]);
+ herr_t (*read_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, size_t count, hid_t mem_spaces[],
+ hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[],
+ void *bufs[] /*out*/);
+ herr_t (*write_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, size_t count, hid_t mem_spaces[],
+ hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[],
+ const void *bufs[] /*in*/);
+ herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
+ herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
+ herr_t (*lock)(H5FD_t *file, hbool_t rw);
+ herr_t (*unlock)(H5FD_t *file);
+ herr_t (*del)(const char *name, hid_t fapl);
+ herr_t (*ctl)(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void **output);
+ H5FD_mem_t fl_map[H5FD_MEM_NTYPES];
+} H5FD_class_t;
+
+/* A free list is a singly-linked list of address/size pairs. */
+typedef struct H5FD_free_t {
+ haddr_t addr;
+ hsize_t size;
+ struct H5FD_free_t *next;
+} H5FD_free_t;
+
+/*
+ * The main datatype for each driver. Public fields common to all drivers
+ * are declared here and the driver appends private fields in memory.
+ */
+struct H5FD_t {
+ hid_t driver_id; /*driver ID for this file */
+ const H5FD_class_t *cls; /*constant class info */
+ unsigned long fileno; /* File 'serial' number */
+ unsigned access_flags; /* File access flags (from create or open) */
+ unsigned long feature_flags; /* VFL Driver feature Flags */
+ haddr_t maxaddr; /* For this file, overrides class */
+ haddr_t base_addr; /* Base address for HDF5 data w/in file */
+
+ /* Space allocation management fields */
+ hsize_t threshold; /* Threshold for alignment */
+ hsize_t alignment; /* Allocation alignment */
+ hbool_t paged_aggr; /* Paged aggregation for file space is enabled or not */
+};
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+H5_DLL hid_t H5FDregister(const H5FD_class_t *cls);
+H5_DLL herr_t H5FDunregister(hid_t driver_id);
+H5_DLL H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+H5_DLL herr_t H5FDclose(H5FD_t *file);
+H5_DLL int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2);
+H5_DLL int H5FDquery(const H5FD_t *f, unsigned long *flags);
+H5_DLL haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
+H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
+H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type);
+H5_DLL herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa);
+H5_DLL haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type);
+H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle);
+H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ void *buf /*out*/);
+H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ const void *buf);
+H5_DLL herr_t H5FDread_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[],
+ haddr_t addrs[], size_t sizes[], void *bufs[] /* out */);
+H5_DLL herr_t H5FDwrite_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[],
+ haddr_t addrs[], size_t sizes[], const void *bufs[] /* in */);
+H5_DLL herr_t H5FDread_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
+ hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
+ size_t element_sizes[], void *bufs[] /* out */);
+H5_DLL herr_t H5FDwrite_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
+ hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
+ size_t element_sizes[], const void *bufs[]);
+H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
+H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
+H5_DLL herr_t H5FDlock(H5FD_t *file, hbool_t rw);
+H5_DLL herr_t H5FDunlock(H5FD_t *file);
+H5_DLL herr_t H5FDdelete(const char *name, hid_t fapl_id);
+H5_DLL herr_t H5FDctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void **output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _H5FDdevelop_H */
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 21a46da..869dc37 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -137,6 +137,7 @@ static herr_t H5FD__direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__direct_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__direct_unlock(H5FD_t *_file);
+static herr_t H5FD__direct_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_direct_g = {
"direct", /* name */
@@ -174,6 +175,7 @@ static const H5FD_class_t H5FD_direct_g = {
H5FD__direct_truncate, /* truncate */
H5FD__direct_lock, /* lock */
H5FD__direct_unlock, /* unlock */
+ H5FD__direct_delete, /* del */
NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -1385,4 +1387,29 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__direct_unlock() */
+/*-------------------------------------------------------------------------
+ * Function: H5FD__direct_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__direct_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__direct_delete() */
+
#endif /* H5_HAVE_DIRECT */
diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h
index eec10de..f06de7f 100644
--- a/src/H5FDdirect.h
+++ b/src/H5FDdirect.h
@@ -37,8 +37,69 @@ extern "C" {
#define FBSIZE_DEF 4096
#define CBSIZE_DEF 16 * 1024 * 1024
-H5_DLL hid_t H5FD_direct_init(void);
+H5_DLL hid_t H5FD_direct_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets up use of the direct I/O driver
+ *
+ * \fapl_id
+ * \param[in] alignment Required memory alignment boundary
+ * \param[in] block_size File system block size
+ * \param[in] cbuf_size Copy buffer size
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_direct() sets the file access property list, \p fapl_id,
+ * to use the direct I/O driver, #H5FD_DIRECT. With this driver, data
+ * is written to or read from the file synchronously without being
+ * cached by the system.
+ *
+ * File systems usually require the data address in memory, the file
+ * address, and the size of the data to be aligned. The HDF5 library’s
+ * direct I/O driver is able to handle unaligned data, though that will
+ * consume some additional memory resources and may slow
+ * performance. To get better performance, use the system function \p
+ * posix_memalign to align the data buffer in memory and the HDF5
+ * function H5Pset_alignment() to align the data in the file. Be aware,
+ * however, that aligned data I/O may cause the HDF5 file to be bigger
+ * than the actual data size would otherwise require because the
+ * alignment may leave some holes in the file.
+ *
+ * \p alignment specifies the required alignment boundary in memory.
+ *
+ * \p block_size specifies the file system block size. A value of 0
+ * (zero) means to use HDF5 library’s default value of 4KB.
+ *
+ * \p cbuf_size specifies the copy buffer size.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_direct(hid_t fapl_id, size_t alignment, size_t block_size, size_t cbuf_size);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves direct I/O driver settings
+ *
+ * \fapl_id
+ * \param[out] boundary Required memory alignment boundary
+ * \param[out] block_size File system block size
+ * \param[out] cbuf_size Copy buffer size
+ * \returns \herr_t
+ *
+ * \details H5Pget_fapl_direct() retrieves the required memory alignment (\p
+ * alignment), file system block size (\p block_size), and copy buffer
+ * size (\p cbuf_size) settings for the direct I/O driver, #H5FD_DIRECT,
+ * from the file access property list \p fapl_id.
+ *
+ * See H5Pset_fapl_direct() for discussion of these values,
+ * requirements, and important considerations.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary /*out*/, size_t *block_size /*out*/,
size_t *cbuf_size /*out*/);
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index ac3f54d..e45b52e 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -101,44 +101,46 @@ static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__family_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__family_unlock(H5FD_t *_file);
+static herr_t H5FD__family_delete(const char *filename, hid_t fapl_id);
/* The class struct */
static const H5FD_class_t H5FD_family_g = {
- "family", /* name */
- HADDR_MAX, /* maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
+ "family", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
H5FD__family_term, /* terminate */
- H5FD__family_sb_size, /* sb_size */
- H5FD__family_sb_encode, /* sb_encode */
- H5FD__family_sb_decode, /* sb_decode */
- sizeof(H5FD_family_fapl_t), /* fapl_size */
- H5FD__family_fapl_get, /* fapl_get */
- H5FD__family_fapl_copy, /* fapl_copy */
- H5FD__family_fapl_free, /* fapl_free */
- 0, /* dxpl_size */
- NULL, /* dxpl_copy */
- NULL, /* dxpl_free */
- H5FD__family_open, /* open */
- H5FD__family_close, /* close */
- H5FD__family_cmp, /* cmp */
- H5FD__family_query, /* query */
- NULL, /* get_type_map */
- NULL, /* alloc */
- NULL, /* free */
- H5FD__family_get_eoa, /* get_eoa */
- H5FD__family_set_eoa, /* set_eoa */
- H5FD__family_get_eof, /* get_eof */
+ H5FD__family_sb_size, /* sb_size */
+ H5FD__family_sb_encode, /* sb_encode */
+ H5FD__family_sb_decode, /* sb_decode */
+ sizeof(H5FD_family_fapl_t), /* fapl_size */
+ H5FD__family_fapl_get, /* fapl_get */
+ H5FD__family_fapl_copy, /* fapl_copy */
+ H5FD__family_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__family_open, /* open */
+ H5FD__family_close, /* close */
+ H5FD__family_cmp, /* cmp */
+ H5FD__family_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__family_get_eoa, /* get_eoa */
+ H5FD__family_set_eoa, /* set_eoa */
+ H5FD__family_get_eof, /* get_eof */
H5FD__family_get_handle, /* get_handle */
- H5FD__family_read, /* read */
- H5FD__family_write, /* write */
+ H5FD__family_read, /* read */
+ H5FD__family_write, /* write */
NULL, /* read_vector */
NULL, /* write_vector */
NULL, /* read_selection */
NULL, /* write_selection */
- H5FD__family_flush, /* flush */
- H5FD__family_truncate, /* truncate */
+ H5FD__family_flush, /* flush */
+ H5FD__family_truncate, /* truncate */
H5FD__family_lock, /* lock */
H5FD__family_unlock, /* unlock */
+ H5FD__family_delete, /* del */
NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -585,7 +587,7 @@ done:
* memb_name & temp in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static H5FD_t *
H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
@@ -738,7 +740,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__family_open() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: H5FD__family_close
@@ -908,7 +910,7 @@ H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
* memb_name in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static herr_t
H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
{
@@ -977,7 +979,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: H5FD__family_get_eof
@@ -1348,3 +1350,94 @@ H5FD__family_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__family_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__family_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__family_delete(const char *filename, hid_t fapl_id)
+{
+ H5P_genplist_t * plist;
+ const H5FD_family_fapl_t *fa;
+ hid_t memb_fapl_id = H5I_INVALID_HID;
+ unsigned current_member;
+ char * member_name = NULL;
+ char * temp = NULL;
+ herr_t delete_error = FAIL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ /* Get the driver info (for the member fapl)
+ * The family_open call accepts H5P_DEFAULT, so we'll accept that here, too.
+ */
+ if (H5P_FILE_ACCESS_DEFAULT == fapl_id)
+ memb_fapl_id = H5P_FILE_ACCESS_DEFAULT;
+ else {
+ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ if (NULL == (fa = (const H5FD_family_fapl_t *)H5P_peek_driver_info(plist)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad family VFD driver info")
+ memb_fapl_id = fa->memb_fapl_id;
+ }
+
+ /* Allocate space for the string buffers */
+ if (NULL == (member_name = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate member name")
+ if (NULL == (temp = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate temporary member name")
+
+ /* Sanity check to make sure that generated names are unique */
+ HDsnprintf(member_name, H5FD_FAM_MEMB_NAME_BUF_SIZE, filename, 0);
+ HDsnprintf(temp, H5FD_FAM_MEMB_NAME_BUF_SIZE, filename, 1);
+ if (!HDstrcmp(member_name, temp))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "provided file name cannot generate unique sub-files")
+
+ /* Delete all the family members */
+ current_member = 0;
+ while (1) {
+ /* Fix up the filename with the current member's number */
+ HDsnprintf(member_name, H5FD_FAM_MEMB_NAME_BUF_SIZE, filename, current_member);
+
+ /* Attempt to delete the member files. If the first file throws an error
+ * we always consider this an error. With subsequent member files, however,
+ * errors usually mean that we hit the last member file so we ignore them.
+ *
+ * Note that this means that any missing files in the family will leave
+ * undeleted members behind.
+ */
+ H5E_BEGIN_TRY
+ {
+ delete_error = H5FD_delete(member_name, memb_fapl_id);
+ }
+ H5E_END_TRY;
+ if (FAIL == delete_error) {
+ if (0 == current_member)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete member file")
+ else
+ H5E_clear_stack(NULL);
+ break;
+ }
+ current_member++;
+ } /* end while */
+
+done:
+ if (member_name)
+ H5MM_xfree(member_name);
+ if (temp)
+ H5MM_xfree(temp);
+
+ /* Don't close memb_fapl_id - We didn't bump its reference count since we're
+ * only using it in this call.
+ */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__family_delete() */
diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h
index f00836f..20ef532 100644
--- a/src/H5FDfamily.h
+++ b/src/H5FDfamily.h
@@ -26,8 +26,58 @@
extern "C" {
#endif
-H5_DLL hid_t H5FD_family_init(void);
+H5_DLL hid_t H5FD_family_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the file access property list to use the family driver
+ *
+ * \fapl_id
+ * \param[in] memb_size Size in bytes of each file member
+ * \param[in] memb_fapl_id Identifier of file access property list for
+ * each family member
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_family() sets the file access property list identifier,
+ * \p fapl_id, to use the family driver.
+ *
+ * \p memb_size is the size in bytes of each file member. This size
+ * will be saved in file when the property list \p fapl_id is used to
+ * create a new file. If \p fapl_id is used to open an existing file,
+ * \p memb_size has to be equal to the original size saved in file. A
+ * failure with an error message indicating the correct member size
+ * will be returned if \p memb_size does not match the size saved. If
+ * any user does not know the original size, #H5F_FAMILY_DEFAULT can be
+ * passed in. The library will retrieve the saved size.
+ *
+ * \p memb_fapl_id is the identifier of the file access property list
+ * to be used for each family member.
+ *
+ * \version 1.8.0 Behavior of the \p memb_size parameter was changed.
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_family(hid_t fapl_id, hsize_t memb_size, hid_t memb_fapl_id);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Returns file access property list information
+ *
+ * \fapl_id
+ * \param[out] memb_size Size in bytes of each file member
+ * \param[out] memb_fapl_id Identifier of file access property list for
+ * each family member
+ * \returns \herr_t
+ *
+ * \details H5Pget_fapl_family() returns file access property list for use with
+ * the family driver. This information is returned through the output
+ * parameters.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size /*out*/, hid_t *memb_fapl_id /*out*/);
#ifdef __cplusplus
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index e48d62e..a1b9a39 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -1,15 +1,13 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only HDFS Virtual File Driver (VFD) *
- * Copyright (c) 2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
@@ -20,8 +18,10 @@
* File System (HDFS).
*/
+#ifdef H5_HAVE_LIBHDFS
/* This source code file is part of the H5FD driver module */
#include "H5FDdrvr_module.h"
+#endif
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
@@ -313,6 +313,7 @@ static const H5FD_class_t H5FD_hdfs_g = {
H5FD__hdfs_truncate, /* truncate */
NULL, /* lock */
NULL, /* unlock */
+ NULL, /* del */
NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -367,7 +368,7 @@ H5FD_hdfs_init(void)
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
if (H5I_VFL != H5I_get_type(H5FD_HDFS_g))
@@ -408,7 +409,7 @@ H5FD__hdfs_term(void)
FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
/* Reset VFL ID */
@@ -442,7 +443,7 @@ H5FD__hdfs_handle_open(const char *path, const char *namenode_name, const int32_
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
if (path == NULL || path[0] == '\0')
@@ -527,7 +528,7 @@ H5FD__hdfs_handle_close(hdfs_t *handle)
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
if (handle == NULL)
@@ -618,7 +619,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa)
HDassert(fa != NULL);
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
@@ -659,7 +660,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_dst /*out*/)
H5TRACE2("e", "ix", fapl_id, fa_dst);
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
if (fa_dst == NULL)
@@ -816,7 +817,7 @@ hdfs__reset_stats(H5FD_hdfs_t *file)
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
if (file == NULL)
@@ -874,7 +875,7 @@ H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */
/* Sanity check on file offsets */
@@ -1212,7 +1213,7 @@ H5FD__hdfs_close(H5FD_t *_file)
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
/* Sanity checks */
@@ -1268,7 +1269,7 @@ H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */
HDassert(f1->hdfs_handle != NULL);
@@ -1341,7 +1342,7 @@ H5FD__hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
if (flags) {
@@ -1379,7 +1380,7 @@ H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
FUNC_LEAVE_NOAPI(file->eoa)
@@ -1410,7 +1411,7 @@ H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
file->eoa = addr;
@@ -1444,7 +1445,7 @@ H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
HDassert(file->hdfs_handle != NULL);
@@ -1479,7 +1480,7 @@ H5FD__hdfs_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_hand
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */
if (!file_handle)
@@ -1529,7 +1530,7 @@ H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif /* HDFS_DEBUG */
HDassert(file != NULL);
@@ -1601,7 +1602,7 @@ H5FD__hdfs_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, h
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file")
@@ -1639,7 +1640,7 @@ H5FD__hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id,
FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "called %s.\n", FUNC);
+ HDfprintf(stdout, "called %s.\n", __func__);
#endif
HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file")
diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h
index abe7682..7c871a4 100644
--- a/src/H5FDhdfs.h
+++ b/src/H5FDhdfs.h
@@ -1,15 +1,14 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only HDFS Virtual File Driver (VFD) *
- * Copyright (c) 2018, The HDF Group. *
+ * Copyright by The HDF Group. *
* *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
@@ -112,8 +111,20 @@ typedef struct H5FD_hdfs_fapl_t {
int32_t stream_buffer_size;
} H5FD_hdfs_fapl_t;
-H5_DLL hid_t H5FD_hdfs_init(void);
+H5_DLL hid_t H5FD_hdfs_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa);
#ifdef __cplusplus
diff --git a/src/H5FDint.c b/src/H5FDint.c
index b23b918..0ed49b0 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -2122,6 +2122,7 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t count, H5FD_mem_t t
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
+
HDassert(vector_was_sorted);
HDassert((types) || (count == 0));
@@ -2307,3 +2308,48 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_sort_vector_io_req() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_delete
+ *
+ * Purpose: Private version of H5FDdelete()
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FD_delete(const char *filename, hid_t fapl_id)
+{
+ H5FD_class_t * driver; /* VFD for file */
+ H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */
+ H5P_genplist_t * plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity checks */
+
+ HDassert(filename);
+
+ /* Get file access property list */
+ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+
+ /* Get the VFD to open the file with */
+ if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info")
+
+ /* Get driver info */
+ if (NULL == (driver = (H5FD_class_t *)H5I_object(driver_prop.driver_id)))
+ HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list")
+ if (NULL == driver->del)
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "file driver has no 'del' method")
+
+ /* Dispatch to file driver */
+ if ((driver->del)(filename, fapl_id))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "delete failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_delete() */
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index ea18b02..0364305 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -177,45 +177,47 @@ static herr_t H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha
static herr_t H5FD__log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__log_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__log_unlock(H5FD_t *_file);
+static herr_t H5FD__log_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_log_g = {
- "log", /* name */
- MAXADDR, /* maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD__log_term, /* terminate */
- NULL, /* sb_size */
- NULL, /* sb_encode */
- NULL, /* sb_decode */
- sizeof(H5FD_log_fapl_t), /* fapl_size */
- H5FD__log_fapl_get, /* fapl_get */
- H5FD__log_fapl_copy, /* fapl_copy */
- H5FD__log_fapl_free, /* fapl_free */
- 0, /* dxpl_size */
- NULL, /* dxpl_copy */
- NULL, /* dxpl_free */
- H5FD__log_open, /* open */
- H5FD__log_close, /* close */
- H5FD__log_cmp, /* cmp */
- H5FD__log_query, /* query */
- NULL, /* get_type_map */
- H5FD__log_alloc, /* alloc */
- H5FD__log_free, /* free */
- H5FD__log_get_eoa, /* get_eoa */
- H5FD__log_set_eoa, /* set_eoa */
- H5FD__log_get_eof, /* get_eof */
- H5FD__log_get_handle, /* get_handle */
- H5FD__log_read, /* read */
- H5FD__log_write, /* write */
- NULL, /* read vector */
- NULL, /* write vector */
- NULL, /* read_selection */
- NULL, /* write_selection */
- NULL, /* flush */
- H5FD__log_truncate, /* truncate */
- H5FD__log_lock, /* lock */
- H5FD__log_unlock, /* unlock */
- NULL, /* ctl */
- H5FD_FLMAP_DICHOTOMY /* fl_map */
+ "log", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__log_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ sizeof(H5FD_log_fapl_t), /* fapl_size */
+ H5FD__log_fapl_get, /* fapl_get */
+ H5FD__log_fapl_copy, /* fapl_copy */
+ H5FD__log_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__log_open, /* open */
+ H5FD__log_close, /* close */
+ H5FD__log_cmp, /* cmp */
+ H5FD__log_query, /* query */
+ NULL, /* get_type_map */
+ H5FD__log_alloc, /* alloc */
+ H5FD__log_free, /* free */
+ H5FD__log_get_eoa, /* get_eoa */
+ H5FD__log_set_eoa, /* set_eoa */
+ H5FD__log_get_eof, /* get_eof */
+ H5FD__log_get_handle, /* get_handle */
+ H5FD__log_read, /* read */
+ H5FD__log_write, /* write */
+ NULL, /* read vector */
+ NULL, /* write vector */
+ NULL, /* read_selection */
+ NULL, /* write_selection */
+ NULL, /* flush */
+ H5FD__log_truncate, /* truncate */
+ H5FD__log_lock, /* lock */
+ H5FD__log_unlock, /* unlock */
+ H5FD__log_delete, /* del */
+ NULL, /* ctl */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/* Declare a free list to manage the H5FD_log_t struct */
@@ -331,12 +333,15 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sULz", fapl_id, logfile, flags, buf_size);
+ /* Do this first, so that we don't try to free a wild pointer if
+ * H5P_object_verify() fails.
+ */
+ HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t));
+
/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t));
-
/* Duplicate the log file string
* A little wasteful, since this string will just be copied later, but
* passing it in as a pointer sets off a chain of impossible-to-resolve
@@ -431,7 +436,7 @@ done:
if (new_fa->logfile)
new_fa->logfile = (char *)H5MM_xfree(new_fa->logfile);
H5MM_free(new_fa);
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__log_fapl_copy() */
@@ -489,8 +494,8 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
#ifdef H5_HAVE_WIN32_API
struct _BY_HANDLE_FILE_INFORMATION fileinfo;
#endif
- H5_timer_t open_timer = {{0}, {0}, {0}, FALSE}; /* Timer for open() call */
- H5_timer_t stat_timer = {{0}, {0}, {0}, FALSE}; /* Timer for stat() call */
+ H5_timer_t open_timer; /* Timer for open() call */
+ H5_timer_t stat_timer; /* Timer for stat() call */
h5_stat_t sb;
H5FD_t * ret_value = NULL; /* Return value */
@@ -507,6 +512,10 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
+ /* Initialize timers */
+ H5_timer_init(&open_timer);
+ H5_timer_init(&stat_timer);
+
/* Build the open flags */
o_flags = (H5F_ACC_RDWR & flags) ? O_RDWR : O_RDONLY;
if (H5F_ACC_TRUNC & flags)
@@ -523,10 +532,8 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
/* Start timer for open() call */
- if (fa->flags & H5FD_LOG_TIME_OPEN) {
- H5_timer_init(&open_timer);
+ if (fa->flags & H5FD_LOG_TIME_OPEN)
H5_timer_start(&open_timer);
- } /* end if */
/* Open the file */
if ((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) {
@@ -536,17 +543,15 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5E_FILE, H5E_CANTOPENFILE, NULL,
"unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x",
name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags);
- } /* end if */
+ }
/* Stop timer for open() call */
if (fa->flags & H5FD_LOG_TIME_OPEN)
H5_timer_stop(&open_timer);
/* Start timer for stat() call */
- if (fa->flags & H5FD_LOG_TIME_STAT) {
- H5_timer_init(&stat_timer);
+ if (fa->flags & H5FD_LOG_TIME_STAT)
H5_timer_start(&stat_timer);
- } /* end if */
/* Get the file stats */
if (HDfstat(fd, &sb) < 0)
@@ -599,15 +604,15 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (file->fa.flags & H5FD_LOG_FILE_READ) {
file->nread = (unsigned char *)H5MM_calloc(file->iosize);
HDassert(file->nread);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_FILE_WRITE) {
file->nwrite = (unsigned char *)H5MM_calloc(file->iosize);
HDassert(file->nwrite);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_FLAVOR) {
file->flavor = (unsigned char *)H5MM_calloc(file->iosize);
HDassert(file->flavor);
- } /* end if */
+ }
/* Set the log file pointer */
if (fa->logfile)
@@ -621,14 +626,14 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5_timer_get_times(open_timer, &open_times);
HDfprintf(file->logfp, "Open took: (%f s)\n", open_times.elapsed);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_TIME_STAT) {
H5_timevals_t stat_times; /* Elapsed time for stat() call */
H5_timer_get_times(stat_timer, &stat_times);
HDfprintf(file->logfp, "Stat took: (%f s)\n", stat_times.elapsed);
- } /* end if */
- } /* end if */
+ }
+ }
/* Check the file locking flags in the fapl */
if (ignore_disabled_file_locks_s != FAIL)
@@ -650,7 +655,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME) > 0)
if (H5P_get(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME, &file->fam_to_single) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to single")
- } /* end if */
+ }
/* Set return value */
ret_value = (H5FD_t *)file;
@@ -661,7 +666,7 @@ done:
HDclose(fd);
if (file)
file = H5FL_FREE(H5FD_log_t, file);
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__log_open() */
@@ -682,20 +687,21 @@ done:
static herr_t
H5FD__log_close(H5FD_t *_file)
{
- H5FD_log_t *file = (H5FD_log_t *)_file;
- H5_timer_t close_timer = {{0}, {0}, {0}, FALSE}; /* Timer for close() call */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FD_log_t *file = (H5FD_log_t *)_file;
+ H5_timer_t close_timer; /* Timer for close() call */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(file);
+ /* Initialize timer */
+ H5_timer_init(&close_timer);
+
/* Start timer for close() call */
- if (file->fa.flags & H5FD_LOG_TIME_CLOSE) {
- H5_timer_init(&close_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_CLOSE)
H5_timer_start(&close_timer);
- } /* end if */
/* Close the underlying file */
if (HDclose(file->fd) < 0)
@@ -716,7 +722,7 @@ H5FD__log_close(H5FD_t *_file)
H5_timer_get_times(close_timer, &close_times);
HDfprintf(file->logfp, "Close took: (%f s)\n", close_times.elapsed);
- } /* end if */
+ }
/* Dump the total number of seek/read/write operations */
if (file->fa.flags & H5FD_LOG_NUM_READ)
@@ -751,13 +757,13 @@ H5FD__log_close(H5FD_t *_file)
last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
last_val = file->nwrite[addr];
last_addr = addr;
- } /* end if */
+ }
addr++;
- } /* end while */
+ }
HDfprintf(file->logfp,
"\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) written to %3d times\n",
last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
- } /* end if */
+ }
/* Dump the read I/O information */
if (file->fa.flags & H5FD_LOG_FILE_READ) {
@@ -772,13 +778,13 @@ H5FD__log_close(H5FD_t *_file)
last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
last_val = file->nread[addr];
last_addr = addr;
- } /* end if */
+ }
addr++;
- } /* end while */
+ }
HDfprintf(file->logfp,
"\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) read from %3d times\n",
last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
- } /* end if */
+ }
/* Dump the I/O flavor information */
if (file->fa.flags & H5FD_LOG_FLAVOR) {
@@ -793,12 +799,12 @@ H5FD__log_close(H5FD_t *_file)
last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]);
last_val = file->flavor[addr];
last_addr = addr;
- } /* end if */
+ }
addr++;
- } /* end while */
+ }
HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) flavor is %s\n",
last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]);
- } /* end if */
+ }
/* Free the logging information */
if (file->fa.flags & H5FD_LOG_FILE_WRITE)
@@ -925,7 +931,7 @@ H5FD__log_query(const H5FD_t *_file, unsigned long *flags /* out */)
if (file && file->fam_to_single)
*flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which
eliminates it) */
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD__log_query() */
@@ -964,13 +970,13 @@ H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hs
HDassert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], (int)type, (size_t)size);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_ALLOC)
HDfprintf(file->logfp,
"%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Allocated\n", addr,
(haddr_t)((addr + size) - 1), size, flavors[type]);
- } /* end if */
+ }
/* Set return value */
ret_value = addr;
@@ -1003,13 +1009,13 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDassert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
- } /* end if */
+ }
/* Log the file memory freed */
if (file->fa.flags & H5FD_LOG_FREE)
HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Freed\n",
addr, (haddr_t)((addr + size) - 1), size, flavors[type]);
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD__log_free() */
@@ -1070,14 +1076,14 @@ H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
HDassert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[file->eoa], (int)type, (size_t)size);
- } /* end if */
+ }
/* Log the extension like an allocation */
if (file->fa.flags & H5FD_LOG_ALLOC)
HDfprintf(file->logfp,
"%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Allocated\n",
file->eoa, addr, size, flavors[type]);
- } /* end if */
+ }
/* Check for decreasing file size */
if (H5F_addr_lt(addr, file->eoa) && H5F_addr_gt(addr, 0)) {
@@ -1088,15 +1094,15 @@ H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
HDassert((addr + size) < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
- } /* end if */
+ }
/* Log the shrink like a free */
if (file->fa.flags & H5FD_LOG_FREE)
HDfprintf(file->logfp,
"%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Freed\n",
file->eoa, addr, size, flavors[type]);
- } /* end if */
- } /* end if */
+ }
+ }
file->eoa = addr;
@@ -1179,23 +1185,22 @@ static herr_t
H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
void *buf /*out*/)
{
- H5FD_log_t * file = (H5FD_log_t *)_file;
- size_t orig_size = size; /* Save the original size for later */
- haddr_t orig_addr = addr;
- H5_timer_t read_timer = {{0}, {0}, {0}, FALSE}; /* Timer for read operation */
- H5_timevals_t read_times; /* Elapsed time for read operation */
-#ifndef H5_HAVE_PREADWRITE
- H5_timer_t seek_timer; /* Timer for seek operation */
- H5_timevals_t seek_times; /* Elapsed time for seek operation */
-#endif /* H5_HAVE_PREADWRITE */
- HDoff_t offset = (HDoff_t)addr;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FD_log_t * file = (H5FD_log_t *)_file;
+ size_t orig_size = size; /* Save the original size for later */
+ haddr_t orig_addr = addr;
+ H5_timer_t read_timer; /* Timer for read operation */
+ H5_timevals_t read_times; /* Elapsed time for read operation */
+ HDoff_t offset = (HDoff_t)addr;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
+ /* Initialize timer */
+ H5_timer_init(&read_timer);
+
/* Check for overflow conditions */
if (!H5F_addr_defined(addr))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %llu", (unsigned long long)addr)
@@ -1212,17 +1217,21 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDassert((addr + size) < file->iosize);
while (tmp_size-- > 0)
file->nread[tmp_addr++]++;
- } /* end if */
- } /* end if */
+ }
+ }
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pread) */
if (addr != file->pos || OP_READ != file->op) {
+ H5_timer_t seek_timer; /* Timer for seek operation */
+ H5_timevals_t seek_times; /* Elapsed time for seek operation */
+
+ /* Initialize timer */
+ H5_timer_init(&seek_timer);
+
/* Start timer for seek() call */
- if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
- H5_timer_init(&seek_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_SEEK)
H5_timer_start(&seek_timer);
- } /* end if */
if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
@@ -1239,7 +1248,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
H5_timer_get_times(seek_timer, &seek_times);
file->total_seek_time += seek_times.elapsed;
- } /* end if */
+ }
/* Emit log string if we're tracking individual seek events. */
if (file->fa.flags & H5FD_LOG_LOC_SEEK) {
@@ -1253,15 +1262,13 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDfprintf(file->logfp, " (%fs @ %f)\n", seek_times.elapsed, seek_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
- } /* end if */
-#endif /* H5_HAVE_PREADWRITE */
+ }
+ }
+#endif /* H5_HAVE_PREADWRITE */
/* Start timer for read operation */
- if (file->fa.flags & H5FD_LOG_TIME_READ) {
- H5_timer_init(&read_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_READ)
H5_timer_start(&read_timer);
- } /* end if */
/*
* Read data, being careful of interrupted system calls, partial results,
@@ -1306,13 +1313,13 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf,
(unsigned long long)size, (unsigned long long)bytes_in,
(unsigned long long)bytes_read, (unsigned long long)offset);
- } /* end if */
+ }
if (0 == bytes_read) {
- /* end of file but not end of format address space */
+ /* End of file but not end of format address space */
HDmemset(buf, 0, size);
break;
- } /* end if */
+ }
HDassert(bytes_read >= 0);
HDassert((size_t)bytes_read <= size);
@@ -1320,8 +1327,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
size -= (size_t)bytes_read;
addr += (haddr_t)bytes_read;
buf = (char *)buf + bytes_read;
-
- } /* end while */
+ }
/* Stop timer for read operation */
if (file->fa.flags & H5FD_LOG_TIME_READ)
@@ -1335,7 +1341,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
if (file->fa.flags & H5FD_LOG_TIME_READ) {
H5_timer_get_times(read_timer, &read_times);
file->total_read_time += read_times.elapsed;
- } /* end if */
+ }
/* Log information about the read */
if (file->fa.flags & H5FD_LOG_LOC_READ) {
@@ -1349,7 +1355,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDassert(type == H5FD_MEM_DEFAULT ||
type == (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] ||
(H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] == H5FD_MEM_DEFAULT);
- } /* end if */
+ }
/* Add the read time, if we're tracking that.
* Note that the read time is NOT emitted for when just H5FD_LOG_TIME_READ
@@ -1359,7 +1365,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDfprintf(file->logfp, " (%fs @ %f)\n", read_times.elapsed, read_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
+ }
/* Update current position */
file->pos = addr;
@@ -1370,7 +1376,7 @@ done:
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__log_read() */
@@ -1393,17 +1399,13 @@ static herr_t
H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
const void *buf)
{
- H5FD_log_t * file = (H5FD_log_t *)_file;
- size_t orig_size = size; /* Save the original size for later */
- haddr_t orig_addr = addr;
- H5_timer_t write_timer = {{0}, {0}, {0}, FALSE}; /* Timer for write operation */
- H5_timevals_t write_times; /* Elapsed time for write operation */
-#ifndef H5_HAVE_PREADWRITE
- H5_timer_t seek_timer; /* Timer for seek operation */
- H5_timevals_t seek_times; /* Elapsed time for seek operation */
-#endif /* H5_HAVE_PREADWRITE */
- HDoff_t offset = (HDoff_t)addr;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FD_log_t * file = (H5FD_log_t *)_file;
+ size_t orig_size = size; /* Save the original size for later */
+ haddr_t orig_addr = addr;
+ H5_timer_t write_timer; /* Timer for write operation */
+ H5_timevals_t write_times; /* Elapsed time for write operation */
+ HDoff_t offset = (HDoff_t)addr;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1411,13 +1413,16 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
HDassert(size > 0);
HDassert(buf);
+ /* Initialize timer */
+ H5_timer_init(&write_timer);
+
/* Verify that we are writing out the type of data we allocated in this location */
if (file->flavor) {
HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[addr] ||
(H5FD_mem_t)file->flavor[addr] == H5FD_MEM_DEFAULT);
HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[(addr + size) - 1] ||
(H5FD_mem_t)file->flavor[(addr + size) - 1] == H5FD_MEM_DEFAULT);
- } /* end if */
+ }
/* Check for overflow conditions */
if (!H5F_addr_defined(addr))
@@ -1435,16 +1440,20 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
HDassert((addr + size) < file->iosize);
while (tmp_size-- > 0)
file->nwrite[tmp_addr++]++;
- } /* end if */
+ }
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pwrite) */
if (addr != file->pos || OP_WRITE != file->op) {
+ H5_timer_t seek_timer; /* Timer for seek operation */
+ H5_timevals_t seek_times; /* Elapsed time for seek operation */
+
+ /* Initialize timer */
+ H5_timer_init(&seek_timer);
+
/* Start timer for seek() call */
- if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
- H5_timer_init(&seek_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_SEEK)
H5_timer_start(&seek_timer);
- } /* end if */
if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
@@ -1461,7 +1470,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
H5_timer_get_times(seek_timer, &seek_times);
file->total_seek_time += seek_times.elapsed;
- } /* end if */
+ }
/* Emit log string if we're tracking individual seek events. */
if (file->fa.flags & H5FD_LOG_LOC_SEEK) {
@@ -1475,15 +1484,13 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
HDfprintf(file->logfp, " (%fs @ %f)\n", seek_times.elapsed, seek_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
- } /* end if */
-#endif /* H5_HAVE_PREADWRITE */
+ }
+ }
+#endif /* H5_HAVE_PREADWRITE */
/* Start timer for write operation */
- if (file->fa.flags & H5FD_LOG_TIME_WRITE) {
- H5_timer_init(&write_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_WRITE)
H5_timer_start(&write_timer);
- } /* end if */
/*
* Write the data, being careful of interrupted system calls and partial
@@ -1550,7 +1557,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
if (file->fa.flags & H5FD_LOG_TIME_WRITE) {
H5_timer_get_times(write_timer, &write_times);
file->total_write_time += write_times.elapsed;
- } /* end if */
+ }
/* Log information about the write */
if (file->fa.flags & H5FD_LOG_LOC_WRITE) {
@@ -1563,8 +1570,8 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
if ((H5FD_mem_t)file->flavor[orig_addr] == H5FD_MEM_DEFAULT) {
HDmemset(&file->flavor[orig_addr], (int)type, orig_size);
HDfprintf(file->logfp, " (fresh)");
- } /* end if */
- } /* end if */
+ }
+ }
/* Add the write time, if we're tracking that.
* Note that the write time is NOT emitted for when just H5FD_LOG_TIME_WRITE
@@ -1574,7 +1581,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
HDfprintf(file->logfp, " (%fs @ %f)\n", write_times.elapsed, write_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
+ }
/* Update current position and eof */
file->pos = addr;
@@ -1587,7 +1594,7 @@ done:
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__log_write() */
@@ -1617,14 +1624,15 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
/* Extend the file to make sure it's large enough */
if (!H5F_addr_eq(file->eoa, file->eof)) {
- H5_timer_t trunc_timer = {{0}, {0}, {0}, FALSE}; /* Timer for truncate operation */
- H5_timevals_t trunc_times; /* Elapsed time for truncate operation */
+ H5_timer_t trunc_timer; /* Timer for truncate operation */
+ H5_timevals_t trunc_times; /* Elapsed time for truncate operation */
+
+ /* Initialize timer */
+ H5_timer_init(&trunc_timer);
/* Start timer for truncate operation */
- if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE) {
- H5_timer_init(&trunc_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE)
H5_timer_start(&trunc_timer);
- } /* end if */
#ifdef H5_HAVE_WIN32_API
{
@@ -1648,7 +1656,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
dwError = GetLastError();
if (dwError != NO_ERROR)
HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer")
- } /* end if */
+ }
if (0 == SetEndOfFile(file->hFile))
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
@@ -1671,7 +1679,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE) {
H5_timer_get_times(trunc_timer, &trunc_times);
file->total_truncate_time += trunc_times.elapsed;
- } /* end if */
+ }
/* Emit log string if we're tracking individual truncate events. */
if (file->fa.flags & H5FD_LOG_TRUNCATE) {
@@ -1685,7 +1693,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
HDfprintf(file->logfp, " (%fs @ %f)\n", trunc_times.elapsed, trunc_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
+ }
/* Update the eof value */
file->eof = file->eoa;
@@ -1777,3 +1785,28 @@ H5FD__log_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__log_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__log_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__log_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__log_delete() */
diff --git a/src/H5FDlog.h b/src/H5FDlog.h
index aa1f3cb..969c091 100644
--- a/src/H5FDlog.h
+++ b/src/H5FDlog.h
@@ -65,7 +65,410 @@
extern "C" {
#endif
-H5_DLL hid_t H5FD_log_init(void);
+H5_DLL hid_t H5FD_log_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets up the logging virtual file driver (#H5FD_LOG) for use
+ *
+ * \fapl_id
+ * \param[in] logfile Name of the log file
+ * \param[in] flags Flags specifying the types of logging activity
+ * \param[in] buf_size The size of the logging buffers, in bytes (see description)
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_log() modifies the file access property list to use the
+ * logging driver, #H5FD_LOG. The logging virtual file driver (VFD) is
+ * a clone of the standard SEC2 (#H5FD_SEC2) driver with additional
+ * facilities for logging VFD metrics and activity to a file.
+ *
+ * \p logfile is the name of the file in which the logging entries are
+ * to be recorded.
+ *
+ * The actions to be logged are specified in the parameter \p flags
+ * using the pre-defined constants described in the following
+ * table. Multiple flags can be set through the use of a logical \c OR
+ * contained in parentheses. For example, logging read and write
+ * locations would be specified as
+ * \Code{(H5FD_LOG_LOC_READ|H5FD_LOG_LOC_WRITE)}.
+ *
+ * <table>
+ * <caption>Table1: Logging Flags</caption>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_LOC_READ
+ * </td>
+ * <td rowspan="3">
+ * Track the location and length of every read, write, or seek operation.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_LOC_WRITE</td></tr>
+ * <tr><td>#H5FD_LOG_LOC_SEEK</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_LOC_IO
+ * </td>
+ * <td>
+ * Track all I/O locations and lengths. The logical equivalent of the following:
+ * \Code{(#H5FD_LOG_LOC_READ | #H5FD_LOG_LOC_WRITE | #H5FD_LOG_LOC_SEEK)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_FILE_READ
+ * </td>
+ * <td rowspan="2">
+ * Track the number of times each byte is read or written.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_FILE_WRITE</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_FILE_IO
+ * </td>
+ * <td>
+ * Track the number of times each byte is read and written. The logical
+ * equivalent of the following:
+ * \Code{(#H5FD_LOG_FILE_READ | #H5FD_LOG_FILE_WRITE)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_FLAVOR
+ * </td>
+ * <td>
+ * Track the type, or flavor, of information stored at each byte.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_NUM_READ
+ * </td>
+ * <td rowspan="4">
+ * Track the total number of read, write, seek, or truncate operations that occur.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_NUM_WRITE</td></tr>
+ * <tr><td>#H5FD_LOG_NUM_SEEK</td></tr>
+ * <tr><td>#H5FD_LOG_NUM_TRUNCATE</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_NUM_IO
+ * </td>
+ * <td>
+ * Track the total number of all types of I/O operations. The logical equivalent
+ * of the following:
+ * \Code{(#H5FD_LOG_NUM_READ | #H5FD_LOG_NUM_WRITE | #H5FD_LOG_NUM_SEEK | #H5FD_LOG_NUM_TRUNCATE)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_TIME_OPEN
+ * </td>
+ * <td rowspan="6">
+ * Track the time spent in open, stat, read, write, seek, or close operations.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_TIME_STAT</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_READ</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_WRITE</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_SEEK</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_CLOSE</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_TIME_IO
+ * </td>
+ * <td>
+ * Track the time spent in each of the above operations. The logical equivalent
+ * of the following:
+ * \Code{(#H5FD_LOG_TIME_OPEN | #H5FD_LOG_TIME_STAT | #H5FD_LOG_TIME_READ | #H5FD_LOG_TIME_WRITE |
+ * #H5FD_LOG_TIME_SEEK | #H5FD_LOG_TIME_CLOSE)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_ALLOC
+ * </td>
+ * <td>
+ * Track the allocation of space in the file.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_ALL
+ * </td>
+ * <td>
+ * Track everything. The logical equivalent of the following:
+ * \Code{(#H5FD_LOG_ALLOC | #H5FD_LOG_TIME_IO | #H5FD_LOG_NUM_IO | #H5FD_LOG_FLAVOR | #H5FD_LOG_FILE_IO |
+ * #H5FD_LOG_LOC_IO)}
+ * </td>
+ * </tr>
+ * </table>
+ * The logging driver can track the number of times each byte in the file is
+ * read from or written to (using #H5FD_LOG_FILE_READ and #H5FD_LOG_FILE_WRITE)
+ * and what kind of data is at that location (e.g., metadata, raw data; using
+ * #H5FD_LOG_FLAVOR). This information is tracked in internal buffers of size
+ * buf_size, which must be at least the maximum size in bytes of the file to be
+ * logged while the log driver is in use.\n
+ * One buffer of size buf_size will be created for each of #H5FD_LOG_FILE_READ,
+ * #H5FD_LOG_FILE_WRITE and #H5FD_LOG_FLAVOR when those flags are set; these
+ * buffers will not grow as the file increases in size.
+ *
+ * \par Output:
+ * This section describes the logging driver (LOG VFD) output.\n
+ * The table, immediately below, describes output of the various logging driver
+ * flags and function calls. A list of valid flavor values, describing the type
+ * of data stored, follows the table.
+ * <table>
+ * <caption>Table2: Logging Output</caption>
+ * <tr>
+ * <th>Flag</th><th>VFD Call</th><th>Output and Comments</th>
+ * </th>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_READ</td>
+ * <td>Read</td>
+ * <td>
+ * \Code{%10a-%10a (%10Zu bytes) (%s) Read}\n\n
+ * Start position\n
+ * End position\n
+ * Number of bytes\n
+ * Flavor of read\n\n
+ * Adds \Code{(\%f s)} and seek time if #H5FD_LOG_TIME_SEEK is also set.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_READ</td>
+ * <td>Read Error</td>
+ * <td>
+ * \Code{Error! Reading: %10a-%10a (%10Zu bytes)}\n\n
+ * Same parameters as non-error entry.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_WRITE</td>
+ * <td>Write</td>
+ * <td>
+ * \Code{%10a-%10a (%10Zu bytes) (%s) Written}\n\n
+ * Start position\n
+ * End position\n
+ * Number of bytes\n
+ * Flavor of write\n\n
+ * Adds \Code{(\%f s)} and seek time if #H5FD_LOG_TIME_SEEK is also set.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_WRITE</td>
+ * <td>Write Error</td>
+ * <td>
+ * \Code{Error! Writing: %10a-%10a (%10Zu bytes)}\n\n
+ * Same parameters as non-error entry.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_SEEK</td>
+ * <td>Read, Write</td>
+ * <td>
+ * \Code{Seek: From %10a-%10a}\n\n
+ * Start position\n
+ * End position\n\n
+ * Adds \Code{(\%f s)} and seek time if #H5FD_LOG_TIME_SEEK is also set.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_FILE_READ</td>
+ * <td>Close</td>
+ * <td>
+ * Begins with:\n
+ * Dumping read I/O information\n\n
+ * Then, for each range of identical values, there is this line:\n
+ * \Code{Addr %10-%10 (%10lu bytes) read from %3d times}\n\n
+ * Start address\n
+ * End address\n
+ * Number of bytes\n
+ * Number of times read\n\n
+ * Note: The data buffer is scanned and each range of identical values
+ * gets one entry in the log file to save space and make it easier to read.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_FILE_WRITE</td>
+ * <td>Close</td>
+ * <td>
+ * Begins with:\n
+ * Dumping read I/O information\n\n
+ * Then, for each range of identical values, there is this line:\n
+ * \Code{Addr %10-%10 (%10lu bytes) written to %3d times}\n\n
+ * Start address\n
+ * End address\n
+ * Number of bytes\n
+ * Number of times written\n\n
+ * Note: The data buffer is scanned and each range of identical values
+ * gets one entry in the log file to save space and make it easier to read.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_FLAVOR</td>
+ * <td>Close</td>
+ * <td>
+ * Begins with:\n
+ * Dumping I/O flavor information\n\n
+ * Then, for each range of identical values, there is this line:\n
+ * \Code{Addr %10-%10 (%10lu bytes) flavor is %s}\n\n
+ * Start address\n
+ * End address\n
+ * Number of bytes\n
+ * Flavor\n\n
+ * Note: The data buffer is scanned and each range of identical values
+ * gets one entry in the log file to save space and make it easier to read.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_READ</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of read operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_WRITE</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of write operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_SEEK</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of seek operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_TRUNCATE</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of truncate operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_OPEN</td>
+ * <td>Open</td>
+ * <td>
+ * Open took: \Code{(\%f s)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_READ</td>
+ * <td>Close, Read</td>
+ * <td>
+ * Total time in read operations: \Code{\%f s}\n\n
+ * See also: #H5FD_LOG_LOC_READ
+ * </td>
+ * </tr>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_WRITE</td>
+ * <td>Close, Write</td>
+ * <td>
+ * Total time in write operations: \Code{\%f s}\n\n
+ * See also: #H5FD_LOG_LOC_WRITE
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_SEEK</td>
+ * <td>Close, Read, Write</td>
+ * <td>
+ * Total time in write operations: \Code{\%f s}\n\n
+ * See also: #H5FD_LOG_LOC_SEEK or #H5FD_LOG_LOC_WRITE
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_CLOSE</td>
+ * <td>Close</td>
+ * <td>
+ * Close took: \Code{(\%f s)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_STAT</td>
+ * <td>Open</td>
+ * <td>
+ * Stat took: \Code{(\%f s)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_ALLOC</td>
+ * <td>Alloc</td>
+ * <td>
+ * \Code{%10-%10 (%10Hu bytes) (\%s) Allocated}\n\n
+ * Start of address space\n
+ * End of address space\n
+ * Total size allocation\n
+ * Flavor of allocation
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \par Flavors:
+ * The \Emph{flavor} describes the type of stored information. The following
+ * table lists the flavors that appear in log output and briefly describes each.
+ * These terms are provided here to aid in the construction of log message
+ * parsers; a full description is beyond the scope of this document.
+ * <table>
+ * <caption>Table3: Flavors of logged data</caption>
+ * <tr>
+ * <th>Flavor</th><th>Description</th>
+ * </th>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_NOLIST</td>
+ * <td>Error value</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_DEFAULT</td>
+ * <td>Value not yet set.\n
+ * May also be a datatype set in a larger allocation that will be
+ * suballocated by the library.</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_SUPER</td>
+ * <td>Superblock data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_BTREE</td>
+ * <td>B-tree data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_DRAW</td>
+ * <td>Raw data (for example, contents of a dataset)</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_GHEAP</td>
+ * <td>Global heap data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_LHEAP</td>
+ * <td>Local heap data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_OHDR</td>
+ * <td>Object header data</td>
+ * </tr>
+ * </table>
+ *
+ * \version 1.8.7 The flags parameter has been changed from \Code{unsigned int}
+ * to \Code{unsigned long long}.
+ * The implementation of the #H5FD_LOG_TIME_OPEN, #H5FD_LOG_TIME_READ,
+ * #H5FD_LOG_TIME_WRITE, and #H5FD_LOG_TIME_SEEK flags has been finished.
+ * New flags were added: #H5FD_LOG_NUM_TRUNCATE and #H5FD_LOG_TIME_STAT.
+ * \version 1.6.0 The \c verbosity parameter has been removed.
+ * Two new parameters have been added: \p flags of type \Code{unsigned} and
+ * \p buf_size of type \Code{size_t}.
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, size_t buf_size);
#ifdef __cplusplus
diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c
index 4b7cb38..cf3d9ca 100644
--- a/src/H5FDmirror.c
+++ b/src/H5FDmirror.c
@@ -15,12 +15,12 @@
* a remote host.
*/
-#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */
-
#include "H5private.h" /* Generic Functions */
#ifdef H5_HAVE_MIRROR_VFD
+#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */
+
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
@@ -195,6 +195,7 @@ static const H5FD_class_t H5FD_mirror_g = {
H5FD__mirror_truncate, /* truncate */
H5FD__mirror_lock, /* lock */
H5FD__mirror_unlock, /* unlock */
+ NULL, /* del */
NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -223,7 +224,7 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
if (H5FD_mirror_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize mirror VFD");
@@ -249,7 +250,7 @@ H5FD_mirror_init(void)
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
if (H5I_VFL != H5I_get_type(H5FD_MIRROR_g))
H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), FALSE);
@@ -276,7 +277,7 @@ H5FD__mirror_term(void)
/* Reset VFL ID */
H5FD_MIRROR_g = 0;
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD__mirror_term() */
@@ -1132,7 +1133,7 @@ H5FD__mirror_verify_reply(H5FD_mirror_t *file)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
HDassert(file && file->sock_fd);
@@ -1187,7 +1188,7 @@ H5FD__mirror_fapl_get(H5FD_t *_file)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
fa = (H5FD_mirror_fapl_t *)H5MM_calloc(sizeof(H5FD_mirror_fapl_t));
if (NULL == fa)
@@ -1223,7 +1224,7 @@ H5FD__mirror_fapl_copy(const void *_old_fa)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
new_fa = (H5FD_mirror_fapl_t *)H5MM_malloc(sizeof(H5FD_mirror_fapl_t));
if (new_fa == NULL)
@@ -1255,7 +1256,7 @@ H5FD__mirror_fapl_free(void *_fa)
FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
/* sanity check */
HDassert(fa != NULL);
@@ -1286,7 +1287,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", fapl_id, fa_dst);
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
if (NULL == fa_dst)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL");
@@ -1327,7 +1328,7 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*#", fapl_id, fa);
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
if (NULL == plist)
@@ -1373,7 +1374,7 @@ H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
/* --------------- */
/* Check arguments */
@@ -1498,7 +1499,7 @@ H5FD__mirror_close(H5FD_t *_file)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
/* Sanity check */
HDassert(file);
@@ -1570,7 +1571,7 @@ H5FD__mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
{
FUNC_ENTER_STATIC_NOERR;
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
/* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as
* the underying driver -- as such, the Mirror VFD implementation copies
@@ -1607,7 +1608,7 @@ H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
HDassert(file);
@@ -1634,7 +1635,7 @@ H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
HDassert(file);
@@ -1689,7 +1690,7 @@ H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
HDassert(file);
@@ -1710,7 +1711,7 @@ H5FD__mirror_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type,
{
FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
FUNC_LEAVE_NOAPI(FAIL)
} /* end H5FD__mirror_read() */
@@ -1743,7 +1744,7 @@ H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
HDassert(file);
HDassert(buf);
@@ -1806,7 +1807,7 @@ H5FD__mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_AT
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_TRUNCATE;
@@ -1854,7 +1855,7 @@ H5FD__mirror_lock(H5FD_t *_file, hbool_t rw)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_LOCK;
@@ -1901,7 +1902,7 @@ H5FD__mirror_unlock(H5FD_t *_file)
FUNC_ENTER_STATIC
- LOG_OP_CALL(FUNC);
+ LOG_OP_CALL(__func__);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_UNLOCK;
diff --git a/src/H5FDmirror.h b/src/H5FDmirror.h
index 8aef934..49e24c1 100644
--- a/src/H5FDmirror.h
+++ b/src/H5FDmirror.h
@@ -61,8 +61,20 @@ typedef struct H5FD_mirror_fapl_t {
char remote_ip[H5FD_MIRROR_MAX_IP_LEN + 1];
} H5FD_mirror_fapl_t;
-H5_DLL hid_t H5FD_mirror_init(void);
+H5_DLL hid_t H5FD_mirror_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa);
#ifdef __cplusplus
diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h
index 3af5e41..cf49301 100644
--- a/src/H5FDmpi.h
+++ b/src/H5FDmpi.h
@@ -34,10 +34,12 @@
*/
#define H5D_MULTI_CHUNK_IO_COL_THRESHOLD 60
-/* Type of I/O for data transfer properties */
+/**
+ * Type of I/O for data transfer properties
+ */
typedef enum H5FD_mpio_xfer_t {
- H5FD_MPIO_INDEPENDENT = 0, /*zero is the default*/
- H5FD_MPIO_COLLECTIVE
+ H5FD_MPIO_INDEPENDENT = 0, /**< Use independent I/O access */
+ H5FD_MPIO_COLLECTIVE /**< Use collective I/O access */
} H5FD_mpio_xfer_t;
/* Type of chunked dataset I/O */
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 707715d..445cc65 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -42,7 +42,7 @@
static hid_t H5FD_MPIO_g = 0;
/* Whether to allow collective I/O operations */
-/* (Value can be set from environment variable also) */
+/* (Can be changed by setting "HDF5_MPI_OPT_TYPES" environment variable to '0' or '1') */
hbool_t H5FD_mpi_opt_types_g = TRUE;
/*
@@ -91,68 +91,73 @@ static herr_t H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_
const void *bufs[]);
static herr_t H5FD__mpio_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD__mpio_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags,
- const void H5_ATTR_UNUSED *input, void **output);
+static herr_t H5FD__mpio_delete(const char *filename, hid_t fapl_id);
+static herr_t H5FD__mpio_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input,
+ void **output);
/* The MPIO file driver information */
static const H5FD_class_t H5FD_mpio_g = {
- "mpio", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_SEMI, /*fc_degree */
- H5FD__mpio_term, /*terminate */
- NULL, /*sb_size */
- NULL, /*sb_encode */
- NULL, /*sb_decode */
- 0, /*fapl_size */
- NULL, /*fapl_get */
- NULL, /*fapl_copy */
- NULL, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD__mpio_open, /*open */
- H5FD__mpio_close, /*close */
- NULL, /*cmp */
- H5FD__mpio_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD__mpio_get_eoa, /*get_eoa */
- H5FD__mpio_set_eoa, /*set_eoa */
- H5FD__mpio_get_eof, /*get_eof */
- H5FD__mpio_get_handle, /*get_handle */
- H5FD__mpio_read, /*read */
- H5FD__mpio_write, /*write */
+ "mpio", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_SEMI, /* fc_degree */
+ H5FD__mpio_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ 0, /* fapl_size */
+ NULL, /* fapl_get */
+ NULL, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__mpio_open, /* open */
+ H5FD__mpio_close, /* close */
+ NULL, /* cmp */
+ H5FD__mpio_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__mpio_get_eoa, /* get_eoa */
+ H5FD__mpio_set_eoa, /* set_eoa */
+ H5FD__mpio_get_eof, /* get_eof */
+ H5FD__mpio_get_handle, /* get_handle */
+ H5FD__mpio_read, /* read */
+ H5FD__mpio_write, /* write */
H5FD__mpio_read_vector, /*read_vector */
H5FD__mpio_write_vector, /*write_vector */
NULL, /*read_selection */
NULL, /*write_selection */
- H5FD__mpio_flush, /*flush */
- H5FD__mpio_truncate, /*truncate */
- NULL, /*lock */
- NULL, /*unlock */
- H5FD__mpio_ctl, /*ctl */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ H5FD__mpio_flush, /* flush */
+ H5FD__mpio_truncate, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ H5FD__mpio_delete, /* del */
+ H5FD__mpio_ctl, /* ctl */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
#ifdef H5FDmpio_DEBUG
-/* Flags to control debug actions in H5Fmpio.
- * Meant to be indexed by characters.
- *
- * 'c' show result of MPI_Get_count after read
- * 'r' show read offset and size
- * 't' trace function entry and exit
- * 'w' show write offset and size
+/* Flags to control debug actions in the MPI-IO VFD.
+ * (Meant to be indexed by characters)
+ *
+ * These flags can be set with either (or both) the environment variable
+ * "H5FD_mpio_Debug" set to a string containing one or more characters
+ * (flags) or by setting them as a string value for the
+ * "H5F_mpio_debug_key" MPI Info key.
+ *
+ * Supported characters in 'H5FD_mpio_Debug' string:
+ * 't' trace function entry and exit
+ * 'r' show read offset and size
+ * 'w' show write offset and size
+ * '0'-'9' only show output from a single MPI rank (ranks 0-9 supported)
*/
-static int H5FD_mpio_Debug[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+static int H5FD_mpio_debug_flags_s[256];
+static int H5FD_mpio_debug_rank_s = -1;
+
+/* Indicate if this rank should output tracing info */
+#define H5FD_MPIO_TRACE_THIS_RANK(file) \
+ (H5FD_mpio_debug_rank_s < 0 || H5FD_mpio_debug_rank_s == (file)->mpi_rank)
#endif
/*--------------------------------------------------------------------------
@@ -184,6 +189,41 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD__init_package() */
+#ifdef H5FDmpio_DEBUG
+
+/*---------------------------------------------------------------------------
+ * Function: H5FD__mpio_parse_debug_str
+ *
+ * Purpose: Parse a string for debugging flags
+ *
+ * Returns: N/A
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, Aug 12, 2020
+ *
+ *---------------------------------------------------------------------------
+ */
+static void
+H5FD__mpio_parse_debug_str(const char *s)
+{
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity check */
+ HDassert(s);
+
+ /* Set debug mask */
+ while (*s) {
+ if ((int)(*s) >= (int)'0' && (int)(*s) <= (int)'9')
+ H5FD_mpio_debug_rank_s = ((int)*s) - (int)'0';
+ else
+ H5FD_mpio_debug_flags_s[(int)*s]++;
+ s++;
+ } /* end while */
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5FD__mpio_parse_debug_str() */
+#endif /* H5FDmpio_DEBUG */
+
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_init
*
@@ -201,11 +241,8 @@ done:
hid_t
H5FD_mpio_init(void)
{
-#ifdef H5FDmpio_DEBUG
static int H5FD_mpio_Debug_inited = 0;
-#endif /* H5FDmpio_DEBUG */
- const char *s; /* String for environment variables */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
@@ -213,28 +250,27 @@ H5FD_mpio_init(void)
if (H5I_VFL != H5I_get_type(H5FD_MPIO_g))
H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g, sizeof(H5FD_class_t), FALSE);
- /* Allow MPI buf-and-file-type optimizations? */
- s = HDgetenv("HDF5_MPI_OPT_TYPES");
- if (s && HDisdigit(*s)) {
- long env_val = HDstrtol(s, NULL, 0);
- H5FD_mpi_opt_types_g = (0 == env_val) ? FALSE : TRUE;
- }
+ if (!H5FD_mpio_Debug_inited) {
+ const char *s; /* String for environment variables */
+
+ /* Allow MPI buf-and-file-type optimizations? */
+ s = HDgetenv("HDF5_MPI_OPT_TYPES");
+ if (s && HDisdigit(*s))
+ H5FD_mpi_opt_types_g = (0 == HDstrtol(s, NULL, 0)) ? FALSE : TRUE;
#ifdef H5FDmpio_DEBUG
- if (!H5FD_mpio_Debug_inited) {
+ /* Clear the flag buffer */
+ HDmemset(H5FD_mpio_debug_flags_s, 0, sizeof(H5FD_mpio_debug_flags_s));
+
/* Retrieve MPI-IO debugging environment variable */
s = HDgetenv("H5FD_mpio_Debug");
- if (s) {
- /* Set debug mask */
- while (*s) {
- H5FD_mpio_Debug[(int)*s]++;
- s++;
- } /* end while */
- } /* end if */
- H5FD_mpio_Debug_inited++;
- } /* end if */
+ if (s)
+ H5FD__mpio_parse_debug_str(s);
#endif /* H5FDmpio_DEBUG */
+ H5FD_mpio_Debug_inited++;
+ } /* end if */
+
/* Set return value */
ret_value = H5FD_MPIO_g;
@@ -658,30 +694,27 @@ herr_t
H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag)
{
H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
- int mpi_code; /* MPI return code */
- int temp_flag;
- herr_t ret_value = SUCCEED;
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
- if (FALSE == flag)
- temp_flag = 0;
- else
- temp_flag = 1;
-
/* set atomicity value */
- if (MPI_SUCCESS != (mpi_code = MPI_File_set_atomicity(file->f, temp_flag)))
+ if (MPI_SUCCESS != (mpi_code = MPI_File_set_atomicity(file->f, (int)(flag != FALSE))))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_atomicity", mpi_code)
done:
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -703,15 +736,18 @@ herr_t
H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag)
{
H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
- int mpi_code; /* MPI return code */
int temp_flag;
- herr_t ret_value = SUCCEED;
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Get atomicity value */
@@ -725,8 +761,8 @@ H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag)
done:
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -753,26 +789,23 @@ done:
static H5FD_t *
H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR_UNUSED maxaddr)
{
- H5FD_mpio_t * file = NULL;
- MPI_File fh;
- hbool_t file_opened = FALSE; /* Flag to indicate that the file was successfully opened */
- int mpi_amode;
- int mpi_rank; /* MPI rank of this process */
- int mpi_size; /* Total number of MPI processes */
- int mpi_code; /* MPI return code */
- MPI_Offset size;
- H5P_genplist_t *plist; /* Property list pointer */
- MPI_Comm comm = MPI_COMM_NULL;
- MPI_Info info = MPI_INFO_NULL;
- H5FD_t * ret_value = NULL; /* Return value */
-
- FUNC_ENTER_STATIC
-
+ H5FD_mpio_t * file = NULL; /* VFD File struct for new file */
+ H5P_genplist_t *plist; /* Property list pointer */
+ MPI_Comm comm = MPI_COMM_NULL; /* MPI Communicator, from plist */
+ MPI_Info info = MPI_INFO_NULL; /* MPI Info, from plist */
+ MPI_File fh; /* MPI file handle */
+ hbool_t file_opened = FALSE; /* Flag to indicate that the file was successfully opened */
+ int mpi_amode; /* MPI file access flags */
+ int mpi_rank = INT_MAX; /* MPI rank of this process */
+ int mpi_size; /* Total number of MPI processes */
+ MPI_Offset file_size; /* File size (of existing files) */
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering - name = \"%s\", flags = 0x%x, fapl_id = %d, maxaddr = %lu\n", FUNC,
- name, flags, (int)fapl_id, (unsigned long)maxaddr);
+ hbool_t H5FD_mpio_debug_t_flag = FALSE;
#endif
+ int mpi_code; /* MPI return code */
+ H5FD_t *ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_STATIC
/* Get a pointer to the fapl */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
@@ -784,6 +817,20 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR
if (H5P_get(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &info) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get MPI info object")
+ /* Get the MPI rank of this process and the total number of processes */
+ if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank)))
+ HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mpi_code)
+ if (MPI_SUCCESS != (mpi_code = MPI_Comm_size(comm, &mpi_size)))
+ HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mpi_code)
+
+#ifdef H5FDmpio_DEBUG
+ H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] &&
+ (H5FD_mpio_debug_rank_s < 0 || H5FD_mpio_debug_rank_s == mpi_rank));
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering - name = \"%s\", flags = 0x%x, fapl_id = %d, maxaddr = %lu\n",
+ __func__, mpi_rank, name, flags, (int)fapl_id, (unsigned long)maxaddr);
+#endif
+
/* Convert HDF5 flags to MPI-IO flags */
/* Some combinations are illegal; let MPI-IO figure it out */
mpi_amode = (flags & H5F_ACC_RDWR) ? MPI_MODE_RDWR : MPI_MODE_RDONLY;
@@ -799,26 +846,15 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR
int flag;
MPI_Info_get(info, H5F_MPIO_DEBUG_KEY, sizeof(debug_str) - 1, debug_str, &flag);
- if (flag) {
- int i;
-
- HDfprintf(stdout, "H5FD_mpio debug flags = '%s'\n", debug_str);
- for (i = 0; debug_str[i] /*end of string*/ && i < 128 /*just in case*/; ++i)
- H5FD_mpio_Debug[(int)debug_str[i]] = 1;
- } /* end if */
- } /* end if */
+ if (flag)
+ H5FD__mpio_parse_debug_str(debug_str);
+ } /* end if */
#endif
if (MPI_SUCCESS != (mpi_code = MPI_File_open(comm, name, mpi_amode, info, &fh)))
HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mpi_code)
file_opened = TRUE;
- /* Get the MPI rank of this process and the total number of processes */
- if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank)))
- HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mpi_code)
- if (MPI_SUCCESS != (mpi_code = MPI_Comm_size(comm, &mpi_size)))
- HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mpi_code)
-
/* Build the return value and initialize it */
if (NULL == (file = (H5FD_mpio_t *)H5MM_calloc(sizeof(H5FD_mpio_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -829,17 +865,17 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR
file->mpi_size = mpi_size;
/* Only processor p0 will get the filesize and broadcast it. */
- if (mpi_rank == 0) {
- if (MPI_SUCCESS != (mpi_code = MPI_File_get_size(fh, &size)))
+ if (mpi_rank == 0)
+ if (MPI_SUCCESS != (mpi_code = MPI_File_get_size(fh, &file_size)))
HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mpi_code)
- } /* end if */
/* Broadcast file size */
- if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, comm)))
+ if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&file_size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, comm)))
HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code)
/* Determine if the file should be truncated */
- if (size && (flags & H5F_ACC_TRUNC)) {
+ if (file_size && (flags & H5F_ACC_TRUNC)) {
+ /* Truncate the file */
if (MPI_SUCCESS != (mpi_code = MPI_File_set_size(fh, (MPI_Offset)0)))
HMPI_GOTO_ERROR(NULL, "MPI_File_set_size failed", mpi_code)
@@ -848,11 +884,11 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR
HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mpi_code)
/* File is zero size now */
- size = 0;
+ file_size = 0;
} /* end if */
/* Set the size of the file (from library's perspective) */
- file->eof = H5FD_mpi_MPIOff_to_haddr(size);
+ file->eof = H5FD_mpi_MPIOff_to_haddr(file_size);
file->local_eof = file->eof;
/* Set return value */
@@ -871,8 +907,8 @@ done:
} /* end if */
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, mpi_rank);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -894,14 +930,18 @@ static herr_t
H5FD__mpio_close(H5FD_t *_file)
{
H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
- int mpi_code; /* MPI return code */
- herr_t ret_value = SUCCEED; /* Return value */
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+ int mpi_rank = file->mpi_rank;
+#endif
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Sanity checks */
@@ -909,7 +949,7 @@ H5FD__mpio_close(H5FD_t *_file)
HDassert(H5FD_MPIO == file->pub.driver_id);
/* MPI_File_close sets argument to MPI_FILE_NULL */
- if (MPI_SUCCESS != (mpi_code = MPI_File_close(&(file->f) /*in,out*/)))
+ if (MPI_SUCCESS != (mpi_code = MPI_File_close(&(file->f))))
HMPI_GOTO_ERROR(FAIL, "MPI_File_close failed", mpi_code)
/* Clean up other stuff */
@@ -919,8 +959,8 @@ H5FD__mpio_close(H5FD_t *_file)
done:
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, mpi_rank);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -952,7 +992,7 @@ H5FD__mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out
*flags |= H5FD_FEAT_HAS_MPI; /* This driver uses MPI */
*flags |= H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */
*flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default
- VFD */
+ VFD */
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -1114,7 +1154,6 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
MPI_Offset mpi_off;
MPI_Status mpi_stat; /* Status from I/O operation */
- int mpi_code; /* mpi return code */
MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */
int size_i; /* Integer copy of 'size' to read */
#if MPI_VERSION >= 3
@@ -1130,13 +1169,18 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
#endif
hbool_t use_view_this_time = FALSE;
hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */
- herr_t ret_value = SUCCEED;
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+ hbool_t H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Sanity checks */
@@ -1154,11 +1198,6 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if ((hsize_t)size_i != size)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i")
-#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", FUNC, (long)mpi_off, size_i);
-#endif
-
/* Only look for MPI views for raw data transfers */
if (type == H5FD_MEM_DRAW) {
H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */
@@ -1202,8 +1241,8 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
H5FD_mpio_collective_opt_t coll_opt_mode;
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: using MPIO collective mode\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", __func__, file->mpi_rank);
#endif
/* Get the collective_opt property to check whether the application wants to do IO individually. */
if (H5CX_get_mpio_coll_opt(&coll_opt_mode) < 0)
@@ -1211,14 +1250,14 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: doing MPI collective IO\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", __func__, file->mpi_rank);
#endif
/* Check whether we should read from rank 0 and broadcast to other ranks */
if (H5CX_get_mpio_rank0_bcast()) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: doing read-rank0-and-MPI_Bcast\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stderr, "%s: (%d) doing read-rank0-and-MPI_Bcast\n", __func__, file->mpi_rank);
#endif
/* Indicate path we've taken */
rank0_bcast = TRUE;
@@ -1231,16 +1270,19 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if (MPI_SUCCESS != (mpi_code = MPI_Bcast(buf, size_i, buf_type, 0, file->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code)
} /* end if */
- else if (MPI_SUCCESS !=
- (mpi_code = MPI_File_read_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
+ else
+ /* Perform collective read operation */
+ if (MPI_SUCCESS !=
+ (mpi_code = MPI_File_read_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mpi_code)
} /* end if */
else {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
#endif
+ /* Perform independent read operation */
if (MPI_SUCCESS !=
(mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code)
@@ -1253,8 +1295,16 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
H5FD_mpi_native_g, file->info)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code)
} /* end if */
- else if (MPI_SUCCESS != (mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
- HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code)
+ else {
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
+#endif
+
+ /* Perform independent read operation */
+ if (MPI_SUCCESS != (mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code)
+ } /* end else */
/* Only retrieve bytes read if this rank _actually_ participated in I/O */
if (!rank0_bcast || (rank0_bcast && file->mpi_rank == 0)) {
@@ -1296,6 +1346,12 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if (bytes_read < 0 || bytes_read > io_size)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed")
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_read = %lld\n", __func__, file->mpi_rank,
+ (long)mpi_off, bytes_read);
+#endif
+
/*
* This gives us zeroes beyond end of physical MPI file.
*/
@@ -1304,8 +1360,8 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
done:
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -1340,7 +1396,6 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
MPI_Offset mpi_off;
MPI_Status mpi_stat; /* Status from I/O operation */
MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */
- int mpi_code; /* MPI return code */
#if MPI_VERSION >= 3
MPI_Count bytes_written;
MPI_Count type_size; /* MPI datatype used for I/O's size */
@@ -1354,13 +1409,18 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
hbool_t use_view_this_time = FALSE;
hbool_t derived_type = FALSE;
H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */
- herr_t ret_value = SUCCEED;
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+ hbool_t H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Sanity checks */
@@ -1379,11 +1439,6 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off")
size_i = (int)size;
-#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", FUNC, (long)mpi_off, size_i);
-#endif
-
/* Get the transfer mode from the API context */
if (H5CX_get_io_xfer_mode(&xfer_mode) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode")
@@ -1436,8 +1491,8 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
H5FD_mpio_collective_opt_t coll_opt_mode;
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: using MPIO collective mode\n", FUNC);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stderr, "%s: (%d) using MPIO collective mode\n", __func__, file->mpi_rank);
#endif
/* Get the collective_opt property to check whether the application wants to do IO individually. */
@@ -1446,9 +1501,10 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: doing MPI collective IO\n", FUNC);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stderr, "%s: (%d) doing MPI collective IO\n", __func__, file->mpi_rank);
#endif
+ /* Perform collective write operation */
if (MPI_SUCCESS !=
(mpi_code = MPI_File_write_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code)
@@ -1457,10 +1513,12 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
if (type != H5FD_MEM_DRAW)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL,
"Metadata Coll opt property should be collective at this point")
+
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
#endif
+ /* Perform independent write operation */
if (MPI_SUCCESS !=
(mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code)
@@ -1471,11 +1529,18 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
H5FD_mpi_native_g, file->info)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code)
} /* end if */
- else if (MPI_SUCCESS !=
- (mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
- HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code)
+ else {
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stderr, "%s: (%d) doing MPI independent IO\n", __func__, file->mpi_rank);
+#endif
- /* How many bytes were actually written? */
+ /* Perform independent write operation */
+ if (MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code)
+ } /* end else */
+
+ /* How many bytes were actually written? */
#if MPI_VERSION >= 3
if (MPI_SUCCESS != (mpi_code = MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_written)))
#else
@@ -1498,6 +1563,12 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
if (bytes_written != io_size || bytes_written < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_written = %lld\n", __func__, file->mpi_rank,
+ (long)mpi_off, bytes_written);
+#endif
+
/* Each process will keep track of its perceived EOF value locally, and
* ultimately we will reduce this value to the maximum amongst all
* processes, but until then keep the actual eof at HADDR_UNDEF just in
@@ -1510,12 +1581,12 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
file->local_eof = addr + (haddr_t)bytes_written;
done:
- if (derived_type) {
+ if (derived_type)
MPI_Type_free(&buf_type);
- }
+
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving, proc %d: ret_value = %d\n", FUNC, file->mpi_rank, ret_value);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving: ret_value = %d\n", __func__, file->mpi_rank, ret_value);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -1573,7 +1644,6 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
H5FD_mem_t * s_types = NULL;
haddr_t * s_addrs = NULL;
size_t * s_sizes = NULL;
- size_t s_size;
void ** s_bufs = NULL;
int * mpi_block_lengths = NULL;
char unused = 0; /* Unused, except for non-NULL pointer value */
@@ -1605,13 +1675,17 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
int n;
#endif
hbool_t rank0_bcast = FALSE; /* If read-with-rank0-and-bcast flag was used */
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+ hbool_t H5FD_mpio_debug_r_flag = (H5FD_mpio_debug_flags_s[(int)'r'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Sanity checks */
@@ -1795,8 +1869,8 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
HDmemset(&mpi_stat, 0, sizeof(mpi_stat));
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", FUNC, (long)mpi_off, size_i);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", __func__, (long)mpi_off, size_i);
#endif
/* Setup the file view. */
@@ -1816,19 +1890,19 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
/* Read the data. */
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: using MPIO collective mode\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stdout, "%s: using MPIO collective mode\n", __func__);
#endif
if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: doing MPI collective IO\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stdout, "%s: doing MPI collective IO\n", __func__);
#endif
/* Check whether we should read from rank 0 and broadcast to other ranks */
if (H5CX_get_mpio_rank0_bcast()) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: doing read-rank0-and-MPI_Bcast\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stdout, "%s: doing read-rank0-and-MPI_Bcast\n", __func__);
#endif
/* Indicate path we've taken */
rank0_bcast = TRUE;
@@ -1847,8 +1921,8 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
} /* end if */
else if (size_i > 0) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stdout, "%s: doing MPI independent IO\n", __func__);
#endif
if (MPI_SUCCESS !=
@@ -1948,8 +2022,8 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou
fixed_size = FALSE;
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'r'])
- HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC);
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stdout, "%s: doing MPI independent IO\n", __func__);
#endif
for (i = 0; i < (int)count; i++) {
@@ -2069,8 +2143,8 @@ done:
}
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving, proc %d: ret_value = %d\n", FUNC, file->mpi_rank, ret_value);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stdout, "%s: Leaving, proc %d: ret_value = %d\n", __func__, file->mpi_rank, ret_value);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -2148,13 +2222,17 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co
H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */
H5FD_mpio_collective_opt_t coll_opt_mode; /* whether we are doing collective or independent I/O */
int size_i;
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+ hbool_t H5FD_mpio_debug_w_flag = (H5FD_mpio_debug_flags_s[(int)'w'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Sanity checks */
@@ -2322,8 +2400,8 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't set MPI off to 0")
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", FUNC, (long)mpi_off, size_i);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stdout, "%s: mpi_off = %ld size_i = %d\n", __func__, (long)mpi_off, size_i);
#endif
/* Setup the file view. */
@@ -2339,14 +2417,14 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co
/* Write the data. */
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: using MPIO collective mode\n", FUNC);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stdout, "%s: using MPIO collective mode\n", __func__);
#endif
if (coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: doing MPI collective IO\n", FUNC);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stdout, "%s: doing MPI collective IO\n", __func__);
#endif
if (MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(file->f, mpi_off, mpi_bufs_base, size_i,
@@ -2355,8 +2433,8 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co
} /* end if */
else if (size_i > 0) {
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stdout, "%s: doing MPI independent IO\n", __func__);
#endif
if (MPI_SUCCESS !=
@@ -2384,8 +2462,8 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co
fixed_size = FALSE;
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w'])
- HDfprintf(stdout, "%s: doing MPI independent IO\n", FUNC);
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stdout, "%s: doing MPI independent IO\n", __func__);
#endif
for (i = 0; i < (int)count; i++) {
@@ -2490,8 +2568,8 @@ done:
}
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving, proc %d: ret_value = %d\n", FUNC, file->mpi_rank, ret_value);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stdout, "%s: Leaving, proc %d: ret_value = %d\n", __func__, file->mpi_rank, ret_value);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -2513,14 +2591,17 @@ static herr_t
H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
- int mpi_code; /* mpi return code */
- herr_t ret_value = SUCCEED;
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
+ int mpi_code; /* mpi return code */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Sanity checks */
@@ -2534,8 +2615,8 @@ H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
done:
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -2548,13 +2629,14 @@ done:
*
* This is a little sticky in the mpio case, as it is not
* easy for us to track the current EOF by extracting it from
- * write calls.
+ * write calls, since other ranks could have written to the
+ * file beyond the local EOF.
*
- * Instead, we first check to see if the eoa has changed since
+ * Instead, we first check to see if the EOA has changed since
* the last call to this function. If it has, we call
* MPI_File_get_size() to determine the current EOF, and
* only call MPI_File_set_size() if this value disagrees
- * with the current eoa.
+ * with the current EOA.
*
* Return: SUCCEED/FAIL
*
@@ -2566,14 +2648,17 @@ done:
static herr_t
H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
- H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
- herr_t ret_value = SUCCEED;
+ H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
+#ifdef H5FDmpio_DEBUG
+ hbool_t H5FD_mpio_debug_t_flag = (H5FD_mpio_debug_flags_s[(int)'t'] && H5FD_MPIO_TRACE_THIS_RANK(file));
+#endif
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Entering\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Entering\n", __func__, file->mpi_rank);
#endif
/* Sanity checks */
@@ -2616,7 +2701,7 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR
if (H5FD_mpi_haddr_to_MPIOff(file->eoa, &needed_eof) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset")
- /* eoa != eof. Set eof to eoa */
+ /* EOA != EOF. Set EOF to EOA */
if (size != needed_eof) {
/* Extend the file's size */
if (MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, needed_eof)))
@@ -2641,14 +2726,68 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR
done:
#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'t'])
- HDfprintf(stdout, "%s: Leaving\n", FUNC);
+ if (H5FD_mpio_debug_t_flag)
+ HDfprintf(stderr, "%s: (%d) Leaving\n", __func__, file->mpi_rank);
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__mpio_truncate() */
/*-------------------------------------------------------------------------
+ * Function: H5FD__mpio_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__mpio_delete(const char *filename, hid_t fapl_id)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ MPI_Comm comm = MPI_COMM_NULL;
+ MPI_Info info = MPI_INFO_NULL;
+ int mpi_rank = INT_MAX;
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ HDassert(H5FD_MPIO == H5P_peek_driver(plist));
+
+ /* Get the MPI communicator and info from the fapl */
+ if (H5P_get(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &info) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI info object")
+ if (H5P_get(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &comm) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator")
+
+ /* Get the MPI rank of this process */
+ if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code)
+
+ /* Set up a barrier */
+ if (MPI_SUCCESS != (mpi_code = MPI_Barrier(comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
+
+ /* Delete the file */
+ if (mpi_rank == 0)
+ if (MPI_SUCCESS != (mpi_code = MPI_File_delete(filename, info)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_delete failed", mpi_code)
+
+ /* Set up a barrier (don't want processes to run ahead of the delete) */
+ if (MPI_SUCCESS != (mpi_code = MPI_Barrier(comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__mpio_delete() */
+
+/*-------------------------------------------------------------------------
* Function: H5FD__mpio_ctl
*
* Purpose: MPIO version of the ctl callback.
@@ -2723,5 +2862,4 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__mpio_ctl() */
-
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h
index 79b52c7..8caf11c 100644
--- a/src/H5FDmpio.h
+++ b/src/H5FDmpio.h
@@ -44,14 +44,237 @@ H5_DLLVAR hbool_t H5FD_mpi_opt_types_g;
#ifdef __cplusplus
extern "C" {
#endif
-H5_DLL hid_t H5FD_mpio_init(void);
+H5_DLL hid_t H5FD_mpio_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Stores MPI IO communicator information to the file access property list
+ *
+ * \fapl_id
+ * \param[in] comm MPI-2 communicator
+ * \param[in] info MPI-2 info object
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_mpio() stores the user-supplied MPI IO parameters \p
+ * comm, for communicator, and \p info, for information, in the file
+ * access property list \p fapl_id. That property list can then be used
+ * to create and/or open a file.
+ *
+ * H5Pset_fapl_mpio() is available only in the parallel HDF5 library
+ * and is not a collective function.
+ *
+ * \p comm is the MPI communicator to be used for file open, as defined
+ * in \c MPI_File_open of MPI-2. This function makes a duplicate of the
+ * communicator, so modifications to \p comm after this function call
+ * returns have no effect on the file access property list.
+ *
+ * \p info is the MPI Info object to be used for file open, as defined
+ * in MPI_File_open() of MPI-2. This function makes a duplicate copy of
+ * the Info object, so modifications to the Info object after this
+ * function call returns will have no effect on the file access
+ * property list.
+ *
+ * If the file access property list already contains previously-set
+ * communicator and Info values, those values will be replaced and the
+ * old communicator and Info object will be freed.
+ *
+ * \note Raw dataset chunk caching is not currently supported when using this
+ * file driver in read/write mode. All calls to H5Dread() and H5Dwrite()
+ * will access the disk directly, and H5Pset_cache() and
+ * H5Pset_chunk_cache() will have no effect on performance.\n
+ * Raw dataset chunk caching is supported when this driver is used in
+ * read-only mode.
+ *
+ * \version 1.4.5 Handling of the MPI Communicator and Info object changed at
+ * this release. A duplicate of each of these is now stored in the property
+ * list instead of pointers to each.
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Returns MPI IO communicator information
+ *
+ * \fapl_id
+ * \param[out] comm MPI-2 communicator
+ * \param[out] info MPI-2 info object
+ * \returns \herr_t
+ *
+ * \details If the file access property list is set to the #H5FD_MPIO driver,
+ * H5Pget_fapl_mpio() returns duplicates of the stored MPI communicator
+ * and Info object through the \p comm and \p info pointers, if those
+ * values are non-null.
+ *
+ * Since the MPI communicator and Info object are duplicates of the
+ * stored information, future modifications to the access property list
+ * will not affect them. It is the responsibility of the application to
+ * free these objects.
+ *
+ * \version 1.4.5 Handling of the MPI Communicator and Info object changed at
+ * this release. A duplicate of each of these is now stored in the
+ * property list instead of pointers to each.
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets data transfer mode
+ *
+ * \dxpl_id
+ * \param[in] xfer_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio() sets the data transfer property list \p dxpl_id
+ * to use transfer mode \p xfer_mode. The property list can then be
+ * used to control the I/O transfer mode during data I/O operations.
+ *
+ * Valid transfer modes are #H5FD_MPIO_INDEPENDENT (default) and
+ * #H5FD_MPIO_COLLECTIVE.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Returns the data transfer mode
+ *
+ * \dxpl_id
+ * \param[out] xfer_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pget_dxpl_mpio() queries the data transfer mode currently set in
+ * the data transfer property list \p dxpl_id.
+ *
+ * Upon return, \p xfer_mode contains the data transfer mode, if it is
+ * non-null.
+ *
+ * H5Pget_dxpl_mpio() is not a collective function.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode /*out*/);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets data transfer mode
+ *
+ * \dxpl_id
+ * \param[in] opt_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio() sets the data transfer property list \p dxpl_id
+ * to use transfer mode xfer_mode. The property list can then be used
+ * to control the I/O transfer mode during data I/O operations.
+ *
+ * Valid transfer modes are #H5FD_MPIO_INDEPENDENT (default) and
+ * #H5FD_MPIO_COLLECTIVE.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mode);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets a flag specifying linked-chunk I/O or multi-chunk I/O
+ *
+ * \dxpl_id
+ * \param[in] opt_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio_chunk_opt() specifies whether I/O is to be
+ * performed as linked-chunk I/O or as multi-chunk I/O. This function
+ * overrides the HDF5 library's internal algorithm for determining
+ * which mechanism to use.
+ *
+ * When an application uses collective I/O with chunked storage, the
+ * HDF5 library normally uses an internal algorithm to determine
+ * whether that I/O activity should be conducted as one linked-chunk
+ * I/O or as multi-chunk I/O. H5Pset_dxpl_mpio_chunk_opt() is provided
+ * so that an application can override the library's algorithm in
+ * circumstances where the library might lack the information needed to
+ * make an optimal decision.
+ *
+ * H5Pset_dxpl_mpio_chunk_opt() works by setting one of the following
+ * flags in the parameter \p opt_mode:
+ * - #H5FD_MPIO_CHUNK_ONE_IO - Do one-link chunked I/O
+ * - #H5FD_MPIO_CHUNK_MULTI_IO - Do multi-chunked I/O
+ *
+ * This function works by setting a corresponding property in the
+ * dataset transfer property list \p dxpl_id.
+ *
+ * The library performs I/O in the specified manner unless it
+ * determines that the low-level MPI IO package does not support the
+ * requested behavior; in such cases, the HDF5 library will internally
+ * use independent I/O.
+ *
+ * Use of this function is optional.
+ *
+ * \todo Add missing version information
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets a numeric threshold for linked-chunk I/O
+ *
+ * \dxpl_id
+ * \param[in] num_chunk_per_proc
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio_chunk_opt_num() sets a numeric threshold for the
+ * use of linked-chunk I/O.
+ *
+ * The library will calculate the average number of chunks selected by
+ * each process when doing collective access with chunked storage. If
+ * the number is greater than the threshold set in \p
+ * num_chunk_per_proc, the library will use linked-chunk I/O;
+ * otherwise, a separate I/O process will be invoked for each chunk
+ * (multi-chunk I/O).
+ *
+ * \todo Add missing version information
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets a ratio threshold for collective I/O
+ *
+ * \dxpl_id
+ * \param[in] percent_num_proc_per_chunk
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio_chunk_opt_ratio() sets a threshold for the use of
+ * collective I/O based on the ratio of processes with collective
+ * access to a dataset with chunked storage. The decision whether to
+ * use collective I/O is made on a per-chunk basis.
+ *
+ * The library will calculate the percentage of the total number of
+ * processes, the ratio, that hold selections in each chunk. If that
+ * percentage is greater than the threshold set in \p
+ * percent_proc_per_chunk, the library will do collective I/O for this
+ * chunk; otherwise, independent I/O will be done for the chunk.
+ *
+ * \todo Add missing version information
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_chunk);
#ifdef __cplusplus
}
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 8527c60..e51d101 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -35,6 +35,38 @@
#define TRUE 1
#endif
+/* Windows doesn't like some POSIX names and redefines them with an
+ * underscore
+ */
+#ifdef _WIN32
+#define my_strdup _strdup
+#else
+#define my_strdup strdup
+#endif
+
+/* Macros for enabling/disabling particular GCC / clang warnings
+ *
+ * These are (renamed) duplicates of macros in H5private.h. If you make changes
+ * here, be sure to update those as well.
+ *
+ * (see the following web-sites for more info:
+ * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
+ * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
+ */
+/* These pragmas are only implemented usefully in gcc 4.6+ */
+#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
+#define H5_MULTI_GCC_DIAG_JOINSTR(x, y) x y
+#define H5_MULTI_GCC_DIAG_DO_PRAGMA(x) _Pragma(#x)
+#define H5_MULTI_GCC_DIAG_PRAGMA(x) H5_MULTI_GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
+
+#define H5_MULTI_GCC_DIAG_OFF(x) \
+ H5_MULTI_GCC_DIAG_PRAGMA(push) H5_MULTI_GCC_DIAG_PRAGMA(ignored H5_MULTI_GCC_DIAG_JOINSTR("-W", x))
+#define H5_MULTI_GCC_DIAG_ON(x) H5_MULTI_GCC_DIAG_PRAGMA(pop)
+#else
+#define H5_MULTI_GCC_DIAG_OFF(x)
+#define H5_MULTI_GCC_DIAG_ON(x)
+#endif
+
/* Loop through all mapped files */
#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) \
{ \
@@ -103,9 +135,8 @@ typedef struct H5FD_multi_dxpl_t {
} H5FD_multi_dxpl_t;
/* Private functions */
-static char *my_strdup(const char *s);
-static int compute_next(H5FD_multi_t *file);
-static int open_members(H5FD_multi_t *file);
+static int compute_next(H5FD_multi_t *file);
+static int open_members(H5FD_multi_t *file);
/* Callback prototypes */
static herr_t H5FD_multi_term(void);
@@ -134,79 +165,53 @@ static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_multi_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD_multi_unlock(H5FD_t *_file);
+static herr_t H5FD_multi_delete(const char *filename, hid_t fapl_id);
+static herr_t H5FD_multi_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input,
+ void **output);
/* The class struct */
static const H5FD_class_t H5FD_multi_g = {
- "multi", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_multi_term, /*terminate */
- H5FD_multi_sb_size, /*sb_size */
- H5FD_multi_sb_encode, /*sb_encode */
- H5FD_multi_sb_decode, /*sb_decode */
- sizeof(H5FD_multi_fapl_t), /*fapl_size */
- H5FD_multi_fapl_get, /*fapl_get */
- H5FD_multi_fapl_copy, /*fapl_copy */
- H5FD_multi_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_multi_open, /*open */
- H5FD_multi_close, /*close */
- H5FD_multi_cmp, /*cmp */
- H5FD_multi_query, /*query */
- H5FD_multi_get_type_map, /*get_type_map */
- H5FD_multi_alloc, /*alloc */
- H5FD_multi_free, /*free */
- H5FD_multi_get_eoa, /*get_eoa */
- H5FD_multi_set_eoa, /*set_eoa */
- H5FD_multi_get_eof, /*get_eof */
- H5FD_multi_get_handle, /*get_handle */
- H5FD_multi_read, /*read */
- H5FD_multi_write, /*write */
- NULL, /*read_vector */
- NULL, /*write_vector */
- NULL, /* read_selection */
- NULL, /* write_selection */
- H5FD_multi_flush, /*flush */
- H5FD_multi_truncate, /*truncate */
- H5FD_multi_lock, /*lock */
- H5FD_multi_unlock, /*unlock */
- NULL, /*ctl */
- H5FD_FLMAP_DEFAULT /*fl_map */
+ "multi", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_multi_term, /* terminate */
+ H5FD_multi_sb_size, /* sb_size */
+ H5FD_multi_sb_encode, /* sb_encode */
+ H5FD_multi_sb_decode, /* sb_decode */
+ sizeof(H5FD_multi_fapl_t), /* fapl_size */
+ H5FD_multi_fapl_get, /* fapl_get */
+ H5FD_multi_fapl_copy, /* fapl_copy */
+ H5FD_multi_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD_multi_open, /* open */
+ H5FD_multi_close, /* close */
+ H5FD_multi_cmp, /* cmp */
+ H5FD_multi_query, /* query */
+ H5FD_multi_get_type_map, /* get_type_map */
+ H5FD_multi_alloc, /* alloc */
+ H5FD_multi_free, /* free */
+ H5FD_multi_get_eoa, /* get_eoa */
+ H5FD_multi_set_eoa, /* set_eoa */
+ H5FD_multi_get_eof, /* get_eof */
+ H5FD_multi_get_handle, /* get_handle */
+ H5FD_multi_read, /* read */
+ H5FD_multi_write, /* write */
+ NULL, /*read_vector */
+ NULL, /*write_vector */
+ NULL, /* read_selection */
+ NULL, /* write_selection */
+ H5FD_multi_flush, /* flush */
+ H5FD_multi_truncate, /* truncate */
+ H5FD_multi_lock, /* lock */
+ H5FD_multi_unlock, /* unlock */
+ H5FD_multi_delete, /* del */
+ H5FD_multi_ctl, /* ctl */
+ H5FD_FLMAP_DEFAULT /* fl_map */
};
/*-------------------------------------------------------------------------
- * Function: my_strdup
- *
- * Purpose: Private version of strdup()
- *
- * Return: Success: Ptr to new copy of string
- *
- * Failure: NULL
- *
- * Programmer: Robb Matzke
- * Friday, August 13, 1999
- *
- *-------------------------------------------------------------------------
- */
-static char *
-my_strdup(const char *s)
-{
- char * x;
- size_t str_len;
-
- if (!s)
- return NULL;
- str_len = strlen(s) + 1;
- if (NULL == (x = (char *)malloc(str_len)))
- return NULL;
- memcpy(x, s, str_len);
-
- return x;
-}
-
-/*-------------------------------------------------------------------------
* Function: H5FD_multi_init
*
* Purpose: Initialize this driver by registering the driver with the
@@ -286,8 +291,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const c
H5Eclear2(H5E_DEFAULT);
/* Initialize */
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
/* Treat global heap as raw data, not metadata */
memb_map[mt] = ((mt == H5FD_MEM_DRAW || mt == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : H5FD_MEM_SUPER);
memb_fapl[mt] = -1;
@@ -441,12 +445,12 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_f
/* Check arguments and supply default values */
if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1) if (!memb_map)
- {
- for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1))
- _memb_map[mt] = H5FD_MEM_DEFAULT;
- memb_map = _memb_map;
- }
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1);
+ if (!memb_map) {
+ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1))
+ _memb_map[mt] = H5FD_MEM_DEFAULT;
+ memb_map = _memb_map;
+ }
if (!memb_fapl) {
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1))
_memb_fapl[mt] = H5Pcreate(H5P_FILE_ACCESS);
@@ -470,19 +474,20 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_f
/* Map usage type */
mmt = memb_map[mt];
if (mmt < 0 || mmt >= H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range",
- -1) if (H5FD_MEM_DEFAULT == mmt) mmt = mt;
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1);
+ if (H5FD_MEM_DEFAULT == mmt)
+ mmt = mt;
/*
* All members of MEMB_FAPL must be either defaults or actual file
* access property lists.
*/
if (H5P_DEFAULT != memb_fapl[mmt] && TRUE != H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1);
- /* All names must be defined */
- if (!memb_name[mmt] || !memb_name[mmt][0]) H5Epush_ret(
- func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1)
+ /* All names must be defined */
+ if (!memb_name[mmt] || !memb_name[mmt][0])
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1);
}
/*
@@ -534,13 +539,14 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl
H5Eclear2(H5E_DEFAULT);
if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not an access list",
- -1) if (H5FD_MULTI != H5Pget_driver(fapl_id))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver",
- -1) if (NULL == (fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id)))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1)
-
- if (memb_map) memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES * sizeof(H5FD_mem_t));
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not an access list", -1);
+ if (H5FD_MULTI != H5Pget_driver(fapl_id))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
+ if (NULL == (fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id)))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
+
+ if (memb_map)
+ memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES * sizeof(H5FD_mem_t));
if (memb_fapl) {
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
if (fa->memb_fapl[mt] >= 0)
@@ -591,15 +597,16 @@ H5FD_multi_sb_size(H5FD_t *_file)
H5Eclear2(H5E_DEFAULT);
/* How many unique files? */
- UNIQUE_MEMBERS(file->fa.memb_map, mt) { nseen++; }
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
+ nseen++;
+ }
END_MEMBERS;
/* Addresses and EOA markers */
nbytes += nseen * 2 * 8;
/* Name templates */
- UNIQUE_MEMBERS(file->fa.memb_map, mt)
- {
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
size_t n = strlen(file->fa.memb_name[mt]) + 1;
nbytes += (n + 7) & ~((size_t)0x0007);
}
@@ -646,7 +653,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out
H5Eclear2(H5E_DEFAULT);
/* Name and version number */
- strncpy(name, "NCSAmulti", (size_t)8);
+ strncpy(name, "NCSAmult", (size_t)9);
name[8] = '\0';
assert(7 == H5FD_MEM_NTYPES);
@@ -666,8 +673,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out
nseen = 0;
p = buf + 8;
assert(sizeof(haddr_t) <= 8);
- UNIQUE_MEMBERS(file->fa.memb_map, mt)
- {
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
memcpy(p, &(file->fa.memb_addr[mt]), sizeof(haddr_t));
p += sizeof(haddr_t);
memb_eoa = H5FDget_eoa(file->memb[mt], mt);
@@ -677,14 +683,13 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out
}
END_MEMBERS;
if (H5Tconvert(H5T_NATIVE_HADDR, H5T_STD_U64LE, nseen * 2, buf + 8, NULL, H5P_DEFAULT) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
- /* Encode all name templates */
- p = buf + 8 + nseen * 2 * 8;
- UNIQUE_MEMBERS(file->fa.memb_map, mt)
- {
+ /* Encode all name templates */
+ p = buf + 8 + nseen * 2 * 8;
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
size_t n = strlen(file->fa.memb_name[mt]) + 1;
- strncpy((char *)p, file->fa.memb_name[mt], n);
+ strcpy((char *)p, file->fa.memb_name[mt]);
p += n;
for (i = n; i % 8; i++)
*p++ = '\0';
@@ -734,16 +739,15 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
H5Eclear2(H5E_DEFAULT);
/* Make sure the name/version number is correct */
- if (strcmp(name, "NCSAmult"))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1)
+ if (strcmp(name, "NCSAmult") != 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1);
- /* Set default values */
- ALL_MEMBERS(mt)
- {
- memb_addr[mt] = HADDR_UNDEF;
- memb_eoa[mt] = HADDR_UNDEF;
- memb_name[mt] = NULL;
- }
+ /* Set default values */
+ ALL_MEMBERS (mt) {
+ memb_addr[mt] = HADDR_UNDEF;
+ memb_eoa[mt] = HADDR_UNDEF;
+ memb_name[mt] = NULL;
+ }
END_MEMBERS;
/*
@@ -757,7 +761,9 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
map_changed = TRUE;
}
- UNIQUE_MEMBERS(map, mt) { nseen++; }
+ UNIQUE_MEMBERS (map, mt) {
+ nseen++;
+ }
END_MEMBERS;
buf += 8;
@@ -766,19 +772,17 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
memcpy(x, buf, (nseen * 2 * 8));
buf += nseen * 2 * 8;
if (H5Tconvert(H5T_STD_U64LE, H5T_NATIVE_HADDR, nseen * 2, x, NULL, H5P_DEFAULT) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1)
- ap = (haddr_t *)((void *)x); /* Extra (void *) cast to quiet "cast to create alignment" warning -
- 2019/07/05, QAK */
- UNIQUE_MEMBERS(map, mt)
- {
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
+ ap = (haddr_t *)((void *)x); /* Extra (void *) cast to quiet "cast to create alignment" warning -
+ 2019/07/05, QAK */
+ UNIQUE_MEMBERS (map, mt) {
memb_addr[_unmapped] = *ap++;
memb_eoa[_unmapped] = *ap++;
}
END_MEMBERS;
/* Decode name templates */
- UNIQUE_MEMBERS(map, mt)
- {
+ UNIQUE_MEMBERS (map, mt) {
size_t n = strlen((const char *)buf) + 1;
memb_name[_unmapped] = (const char *)buf;
buf += (n + 7) & ~((unsigned)0x0007);
@@ -793,15 +797,18 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
*/
if (map_changed) {
/* Commit map */
- ALL_MEMBERS(mt) { file->fa.memb_map[mt] = map[mt]; }
+ ALL_MEMBERS (mt) {
+ file->fa.memb_map[mt] = map[mt];
+ }
END_MEMBERS;
/* Close files which are unused now */
memset(in_use, 0, sizeof in_use);
- UNIQUE_MEMBERS(map, mt) { in_use[mt] = TRUE; }
+ UNIQUE_MEMBERS (map, mt) {
+ in_use[mt] = TRUE;
+ }
END_MEMBERS;
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (!in_use[mt] && file->memb[mt]) {
(void)H5FDclose(file->memb[mt]);
file->memb[mt] = NULL;
@@ -812,8 +819,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
}
/* Commit member starting addresses and name templates */
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
file->fa.memb_addr[mt] = memb_addr[mt];
if (memb_name[mt]) {
if (file->fa.memb_name[mt])
@@ -823,23 +829,22 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
}
END_MEMBERS;
if (compute_next(file) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1);
- /* Open all necessary files */
- if (open_members(file) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1)
+ /* Open all necessary files */
+ if (open_members(file) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1);
- /* Set the EOA marker for all open files */
- UNIQUE_MEMBERS(file->fa.memb_map, mt)
- {
- if (file->memb[mt])
- if (H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt]) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1)
+ /* Set the EOA marker for all open files */
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
+ if (file->memb[mt])
+ if (H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1);
- /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa)
- */
- file->memb_eoa[mt] = memb_eoa[mt];
- }
+ /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa)
+ */
+ file->memb_eoa[mt] = memb_eoa[mt];
+ }
END_MEMBERS;
return 0;
@@ -901,8 +906,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
H5Eclear2(H5E_DEFAULT);
memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t));
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (old_fa->memb_fapl[mt] >= 0) {
if (H5Iinc_ref(old_fa->memb_fapl[mt]) < 0) {
nerrors++;
@@ -921,8 +925,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
END_MEMBERS;
if (nerrors) {
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (new_fa->memb_fapl[mt] >= 0)
(void)H5Idec_ref(new_fa->memb_fapl[mt]);
if (new_fa->memb_name[mt])
@@ -930,7 +933,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
}
END_MEMBERS;
free(new_fa);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't release object on error", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't release object on error", NULL);
}
return new_fa;
}
@@ -958,12 +961,12 @@ H5FD_multi_fapl_free(void *_fa)
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (fa->memb_fapl[mt] >= 0)
if (H5Idec_ref(fa->memb_fapl[mt]) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list",
- -1) if (fa->memb_name[mt]) free(fa->memb_name[mt]);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1);
+ if (fa->memb_name[mt])
+ free(fa->memb_name[mt]);
}
END_MEMBERS;
free(fa);
@@ -1001,28 +1004,26 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
/* Check arguments */
if (!name || !*name)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name",
- NULL) if (0 == maxaddr || HADDR_UNDEF == maxaddr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
- /*
- * Initialize the file from the file access properties, using default
- * values if necessary. Make sure to use CALLOC here because the code
- * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa
- * in H5FD_multi_t.
- */
- if (NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t)))) H5Epush_ret(
- func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed",
- NULL) if (H5P_FILE_ACCESS_DEFAULT == fapl_id || H5FD_MULTI != H5Pget_driver(fapl_id))
- {
- close_fapl = fapl_id = H5Pcreate(H5P_FILE_ACCESS);
- if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0)
- H5Epush_goto(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTSET, "can't set property value", error)
- }
+ /*
+ * Initialize the file from the file access properties, using default
+ * values if necessary. Make sure to use CALLOC here because the code
+ * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa
+ * in H5FD_multi_t.
+ */
+ if (NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t))))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
+ if (H5P_FILE_ACCESS_DEFAULT == fapl_id || H5FD_MULTI != H5Pget_driver(fapl_id)) {
+ close_fapl = fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0)
+ H5Epush_goto(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTSET, "can't set property value", error)
+ }
fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
assert(fa);
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
file->fa.memb_map[mt] = fa->memb_map[mt];
file->fa.memb_addr[mt] = fa->memb_addr[mt];
if (fa->memb_fapl[mt] >= 0)
@@ -1058,8 +1059,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
error:
/* Cleanup and fail */
if (file) {
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (file->memb[mt])
(void)H5FDclose(file->memb[mt]);
if (file->fa.memb_fapl[mt] >= 0)
@@ -1102,8 +1102,7 @@ H5FD_multi_close(H5FD_t *_file)
H5Eclear2(H5E_DEFAULT);
/* Close as many members as possible */
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (file->memb[mt]) {
if (H5FDclose(file->memb[mt]) < 0) {
nerrors++;
@@ -1115,16 +1114,15 @@ H5FD_multi_close(H5FD_t *_file)
}
END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1)
-
- /* Clean up other stuff */
- ALL_MEMBERS(mt)
- {
- if (file->fa.memb_fapl[mt] >= 0)
- (void)H5Idec_ref(file->fa.memb_fapl[mt]);
- if (file->fa.memb_name[mt])
- free(file->fa.memb_name[mt]);
- }
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1);
+
+ /* Clean up other stuff */
+ ALL_MEMBERS (mt) {
+ if (file->fa.memb_fapl[mt] >= 0)
+ (void)H5Idec_ref(file->fa.memb_fapl[mt]);
+ if (file->fa.memb_name[mt])
+ free(file->fa.memb_name[mt]);
+ }
END_MEMBERS;
free(file->name);
@@ -1161,8 +1159,7 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
out_mt = mt;
if (f1->memb[mt] && f2->memb[mt])
break;
@@ -1271,18 +1268,22 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
* the query is for TYPE == H5FD_MEM_DEFAULT.
*/
if (H5FD_MEM_DEFAULT == type) {
- UNIQUE_MEMBERS(file->fa.memb_map, mt)
- {
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
haddr_t memb_eoa;
if (file->memb[mt]) {
/* Retrieve EOA */
- H5E_BEGIN_TRY { memb_eoa = H5FDget_eoa(file->memb[mt], mt); }
+ H5E_BEGIN_TRY
+ {
+ memb_eoa = H5FDget_eoa(file->memb[mt], mt);
+ }
H5E_END_TRY;
if (HADDR_UNDEF == memb_eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa",
- HADDR_UNDEF) if (memb_eoa > 0) memb_eoa += file->fa.memb_addr[mt];
+ HADDR_UNDEF);
+ if (memb_eoa > 0)
+ memb_eoa += file->fa.memb_addr[mt];
}
else if (file->fa.relax) {
/*
@@ -1293,7 +1294,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != memb_eoa);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF);
}
if (memb_eoa > eoa)
@@ -1308,12 +1309,17 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
mmt = type;
if (file->memb[mmt]) {
- H5E_BEGIN_TRY { eoa = H5FDget_eoa(file->memb[mmt], mmt); }
+ H5E_BEGIN_TRY
+ {
+ eoa = H5FDget_eoa(file->memb[mmt], mmt);
+ }
H5E_END_TRY;
if (HADDR_UNDEF == eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa",
- HADDR_UNDEF) if (eoa > 0) eoa += file->fa.memb_addr[mmt];
+ HADDR_UNDEF);
+ if (eoa > 0)
+ eoa += file->fa.memb_addr[mmt];
}
else if (file->fa.relax) {
/*
@@ -1324,7 +1330,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != eoa);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF);
}
}
@@ -1384,12 +1390,15 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa)
assert(eoa >= file->fa.memb_addr[mmt]);
assert(eoa < file->memb_next[mmt]);
- H5E_BEGIN_TRY { status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); }
+ H5E_BEGIN_TRY
+ {
+ status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt]));
+ }
H5E_END_TRY;
if (status < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1);
- return 0;
+ return 0;
} /* end H5FD_multi_set_eoa() */
/*-------------------------------------------------------------------------
@@ -1420,18 +1429,22 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
H5Eclear2(H5E_DEFAULT);
if (H5FD_MEM_DEFAULT == type) {
- UNIQUE_MEMBERS(file->fa.memb_map, mt)
- {
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
haddr_t tmp_eof;
if (file->memb[mt]) {
/* Retrieve EOF */
- H5E_BEGIN_TRY { tmp_eof = H5FDget_eof(file->memb[mt], type); }
+ H5E_BEGIN_TRY
+ {
+ tmp_eof = H5FDget_eof(file->memb[mt], type);
+ }
H5E_END_TRY;
if (HADDR_UNDEF == tmp_eof)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof",
- HADDR_UNDEF) if (tmp_eof > 0) tmp_eof += file->fa.memb_addr[mt];
+ HADDR_UNDEF);
+ if (tmp_eof > 0)
+ tmp_eof += file->fa.memb_addr[mt];
}
else if (file->fa.relax) {
/*
@@ -1442,7 +1455,7 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != tmp_eof);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF);
}
if (tmp_eof > eof)
eof = tmp_eof;
@@ -1457,12 +1470,17 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
if (file->memb[mmt]) {
/* Retrieve EOF */
- H5E_BEGIN_TRY { eof = H5FDget_eof(file->memb[mmt], mmt); }
+ H5E_BEGIN_TRY
+ {
+ eof = H5FDget_eof(file->memb[mmt], mmt);
+ }
H5E_END_TRY;
if (HADDR_UNDEF == eof)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof",
- HADDR_UNDEF) if (eof > 0) eof += file->fa.memb_addr[mmt];
+ HADDR_UNDEF);
+ if (eof > 0)
+ eof += file->fa.memb_addr[mmt];
}
else if (file->fa.relax) {
/*
@@ -1473,7 +1491,7 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != eof);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF);
}
}
return eof;
@@ -1501,9 +1519,10 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
/* Get data type for multi driver */
if (H5Pget_multi_type(fapl, &type) < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't get data type for multi driver",
- -1) if (type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1) mmt =
- file->fa.memb_map[type];
+ -1);
+ if (type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1);
+ mmt = file->fa.memb_map[type];
if (H5FD_MEM_DEFAULT == mmt)
mmt = type;
@@ -1538,8 +1557,7 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/* XXX: NEED to work on this again */
if (file->pub.paged_aggr) {
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (file->memb[mt])
file->memb[mt]->paged_aggr = file->pub.paged_aggr;
}
@@ -1547,8 +1565,8 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
}
if (HADDR_UNDEF == (addr = H5FDalloc(file->memb[mmt], mmt, dxpl_id, size)))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF)
- addr += file->fa.memb_addr[mmt];
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF);
+ addr += file->fa.memb_addr[mmt];
/*#ifdef TMP
if ( addr + size > file->eoa ) {
@@ -1556,7 +1574,7 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) {
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, \
- "can't set eoa", HADDR_UNDEF)
+ "can't set eoa", HADDR_UNDEF);
}
}
#else
@@ -1761,9 +1779,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
}
}
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1);
- return 0;
+ return 0;
}
/*-------------------------------------------------------------------------
@@ -1802,9 +1820,9 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
}
}
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1);
- return 0;
+ return 0;
} /* end H5FD_multi_truncate() */
/*-------------------------------------------------------------------------
@@ -1834,8 +1852,7 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw)
H5Eclear2(H5E_DEFAULT);
/* Lock all member files */
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
out_mt = mt;
if (file->memb[mt]) {
H5E_BEGIN_TRY
@@ -1865,7 +1882,8 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw)
} /* end if */
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "error locking member files", -1) return 0;
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "error locking member files", -1);
+ return 0;
} /* H5FD_multi_lock() */
@@ -1893,8 +1911,7 @@ H5FD_multi_unlock(H5FD_t *_file)
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- ALL_MEMBERS(mt)
- {
+ ALL_MEMBERS (mt) {
if (file->memb[mt])
if (H5FDunlock(file->memb[mt]) < 0)
nerrors++;
@@ -1902,9 +1919,9 @@ H5FD_multi_unlock(H5FD_t *_file)
END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "error unlocking member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "error unlocking member files", -1);
- return 0;
+ return 0;
} /* H5FD_multi_unlock() */
/*-------------------------------------------------------------------------
@@ -1928,11 +1945,12 @@ compute_next(H5FD_multi_t *file)
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- ALL_MEMBERS(mt) { file->memb_next[mt] = HADDR_UNDEF; }
+ ALL_MEMBERS (mt) {
+ file->memb_next[mt] = HADDR_UNDEF;
+ }
END_MEMBERS;
- UNIQUE_MEMBERS(file->fa.memb_map, mt1)
- {
+ UNIQUE_MEMBERS (file->fa.memb_map, mt1) {
UNIQUE_MEMBERS2(file->fa.memb_map, mt2)
{
if (file->fa.memb_addr[mt1] < file->fa.memb_addr[mt2] &&
@@ -1964,35 +1982,38 @@ compute_next(H5FD_multi_t *file)
*
*-------------------------------------------------------------------------
*/
-/* Disable warning for "format not a string literal" here -QAK */
-/*
+/* Disable warning for "format not a string literal" here
+ *
* This pragma only needs to surround the snprintf() call with
* tmp in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_MULTI_GCC_DIAG_OFF("format-nonliteral")
static int
open_members(H5FD_multi_t *file)
{
char tmp[H5FD_MULT_MAX_FILE_NAME_LEN];
int nerrors = 0;
- static const char *func = "(H5FD_multi)open_members"; /* Function Name for error reporting */
+ int nchars;
+ static const char *func = "(H5FD_multi)open_members"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- UNIQUE_MEMBERS(file->fa.memb_map, mt)
- {
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
if (file->memb[mt])
continue; /*already open*/
assert(file->fa.memb_name[mt]);
- /* Note: This truncates the user's filename down to only sizeof(tmp)
- * characters. -QK & JK, 2013/01/17
- */
- sprintf(tmp, file->fa.memb_name[mt], file->name);
- tmp[sizeof(tmp) - 1] = '\0';
- H5E_BEGIN_TRY { file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF); }
+ nchars = snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name);
+ if (nchars < 0 || nchars >= (int)sizeof(tmp))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_BADVALUE,
+ "filename is too long and would be truncated", -1);
+
+ H5E_BEGIN_TRY
+ {
+ file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF);
+ }
H5E_END_TRY;
if (!file->memb[mt]) {
if (!file->fa.relax || (file->flags & H5F_ACC_RDWR))
@@ -2001,13 +2022,110 @@ open_members(H5FD_multi_t *file)
}
END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1);
- return 0;
+ return 0;
}
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_MULTI_GCC_DIAG_ON("format-nonliteral")
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+H5_MULTI_GCC_DIAG_OFF("format-nonliteral")
+static herr_t
+H5FD_multi_delete(const char *filename, hid_t fapl_id)
+{
+ char full_filename[H5FD_MULT_MAX_FILE_NAME_LEN];
+ int nchars;
+ const H5FD_multi_fapl_t *fa;
+ static const char * func = "H5FD_multi_delete"; /* Function Name for error reporting */
+
+ /* Clear the error stack */
+ H5Eclear2(H5E_DEFAULT);
+
+ assert(filename);
+
+ /* Quiet compiler */
+ (void)fapl_id;
+
+ /* Get the driver info */
+ fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
+ assert(fa);
+
+ /* Delete each member file using the underlying fapl */
+ UNIQUE_MEMBERS (fa->memb_map, mt) {
+ assert(fa->memb_name[mt]);
+ assert(fa->memb_fapl[mt] >= 0);
+
+ nchars = snprintf(full_filename, sizeof(full_filename), fa->memb_name[mt], filename);
+ if (nchars < 0 || nchars >= (int)sizeof(full_filename))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_BADVALUE,
+ "filename is too long and would be truncated", -1);
+
+ if (H5FDdelete(full_filename, fa->memb_fapl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_BADVALUE, "error deleting member files", -1);
+ }
+ END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_delete() */
+H5_MULTI_GCC_DIAG_ON("format-nonliteral")
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_ctl
+ *
+ * Purpose: Multi VFD version of the ctl callback.
+ *
+ * The desired operation is specified by the op_code
+ * parameter.
+ *
+ * The flags parameter controls management of op_codes that
+ * are unknown to the callback
+ *
+ * The input and output parameters allow op_code specific
+ * input and output
+ *
+ * At present, this VFD supports no op codes of its own.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_multi_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input, void **output)
+{
+ H5FD_multi_t * file = (H5FD_multi_t *)_file;
+ static const char *func = "H5FD_multi_ctl"; /* Function Name for error reporting */
+ herr_t ret_value = 0;
+
+ /* Silence compiler */
+ (void)file;
+ (void)input;
+ (void)output;
+
+ /* Clear the error stack */
+ H5Eclear2(H5E_DEFAULT);
+
+ switch (op_code) {
+ /* Unknown op code */
+ default:
+ if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_FCNTL,
+ "VFD ctl request failed (unknown op code and fail if unknown flag is set)", -1);
+
+ break;
+ }
+
+ return ret_value;
+} /* end H5FD_multi_ctl() */
-#ifdef _H5private_H
+#ifdef H5private_H
/*
* This is not related to the functionality of the driver code.
* It is added here to trigger warning if HDF5 private definitions are included
diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h
index 9e04d8d..62cc9c8 100644
--- a/src/H5FDmulti.h
+++ b/src/H5FDmulti.h
@@ -25,11 +25,228 @@
#ifdef __cplusplus
extern "C" {
#endif
-H5_DLL hid_t H5FD_multi_init(void);
+H5_DLL hid_t H5FD_multi_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets up use of the multi-file driver
+ *
+ * \fapl_id
+ * \param[in] memb_map Maps memory usage types to other memory usage types
+ * \param[in] memb_fapl Property list for each memory usage type
+ * \param[in] memb_name Name generator for names of member files
+ * \param[in] memb_addr The offsets within the virtual address space, from 0
+ * (zero) to #HADDR_MAX, at which each type of data storage begins
+ * \param[in] relax Allows read-only access to incomplete file sets when \c TRUE
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_multi() sets the file access property list \p fapl_id to
+ * use the multi-file driver.
+ *
+ * The multi-file driver enables different types of HDF5 data and
+ * metadata to be written to separate files. These files are viewed by
+ * the HDF5 library and the application as a single virtual HDF5 file
+ * with a single HDF5 file address space. The types of data that can be
+ * broken out into separate files include raw data, the superblock,
+ * B-tree data, global heap data, local heap data, and object
+ * headers. At the programmer's discretion, two or more types of data
+ * can be written to the same file while other types of data are
+ * written to separate files.
+ *
+ * The array \p memb_map maps memory usage types to other memory usage
+ * types and is the mechanism that allows the caller to specify how
+ * many files are created. The array contains #H5FD_MEM_NTYPES entries,
+ * which are either the value #H5FD_MEM_DEFAULT or a memory usage
+ * type. The number of unique values determines the number of files
+ * that are opened.
+ *
+ * The array \p memb_fapl contains a property list for each memory
+ * usage type that will be associated with a file.
+ *
+ * The array \p memb_name should be a name generator (a
+ * \Code{printf}-style format with a \Code{%s} which will be replaced
+ * with the name passed to H5FDopen(), usually from H5Fcreate() or
+ * H5Fopen()).
+ *
+ * The array \p memb_addr specifies the offsets within the virtual
+ * address space, from 0 (zero) to #HADDR_MAX, at which each type of
+ * data storage begins.
+ *
+ * If \p relax is set to 1 (TRUE), then opening an existing file for
+ * read-only access will not fail if some file members are
+ * missing. This allows a file to be accessed in a limited sense if
+ * just the meta data is available.
+ *
+ * Default values for each of the optional arguments are as follows:
+ * <table>
+ * <tr>
+ * <td>\p memb_map</td>
+ * <td>The default member map contains the value #H5FD_MEM_DEFAULT for each element.</td>
+ * </tr>
+ * <tr>
+ * <td>
+ * \p memb_fapl
+ * </td>
+ * <td>
+ * The default value is #H5P_DEFAULT for each element.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * \p memb_name
+ * </td>
+ * <td>
+ * The default string is \Code{%s-X.h5} where \c X is one of the following letters:
+ * - \c s for #H5FD_MEM_SUPER
+ * - \c b for #H5FD_MEM_BTREE
+ * - \c r for #H5FD_MEM_DRAW
+ * - \c g for #H5FD_MEM_GHEAP
+ * - \c l for #H5FD_MEM_LHEAP
+ * - \c o for #H5FD_MEM_OHDR
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * \p memb_addr
+ * </td>
+ * <td>
+ * The default setting is that the address space is equally divided
+ * among all of the elements:
+ * - #H5FD_MEM_SUPER \Code{-> 0 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_BTREE \Code{-> 1 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_DRAW \Code{-> 2 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_GHEAP \Code{-> 3 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_LHEAP \Code{-> 4 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_OHDR \Code{-> 5 * (HADDR_MAX/6)}
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \par Example:
+ * The following code sample sets up a multi-file access property list that
+ * partitions data into meta and raw files, each being one-half of the address:\n
+ * \code
+ * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
+ * hid_t memb_fapl[H5FD_MEM_NTYPES];
+ * const char *memb[H5FD_MEM_NTYPES];
+ * haddr_t memb_addr[H5FD_MEM_NTYPES];
+ *
+ * // The mapping...
+ * for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ * memb_map[mt] = H5FD_MEM_SUPER;
+ * }
+ * memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
+ *
+ * // Member information
+ * memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_SUPER] = "%s.meta";
+ * memb_addr[H5FD_MEM_SUPER] = 0;
+ *
+ * memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_DRAW] = "%s.raw";
+ * memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
+ *
+ * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_multi(fapl, memb_map, memb_fapl,
+ * memb_name, memb_addr, TRUE);
+ * \endcode
+ *
+ * \version 1.6.3 \p memb_name parameter type changed to \Code{const char* const*}.
+ * \since 1.4.0
+ */
H5_DLL herr_t H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_fapl,
const char *const *memb_name, const haddr_t *memb_addr, hbool_t relax);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Returns information about the multi-file access property list
+ *
+ * \fapl_id
+ * \param[out] memb_map Maps memory usage types to other memory usage types
+ * \param[out] memb_fapl Property list for each memory usage type
+ * \param[out] memb_name Name generator for names of member files
+ * \param[out] memb_addr The offsets within the virtual address space, from 0
+ * (zero) to #HADDR_MAX, at which each type of data storage begins
+ * \param[out] relax Allows read-only access to incomplete file sets when \c TRUE
+ * \returns \herr_t
+ *
+ * \details H5Pget_fapl_multi() returns information about the multi-file access
+ * property list.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl /*out*/,
char **memb_name /*out*/, haddr_t *memb_addr /*out*/, hbool_t *relax /*out*/);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Emulates the old split file driver
+ *
+ * \fapl_id{fapl}
+ * \param[in] meta_ext Metadata filename extension
+ * \param[in] meta_plist_id File access property list identifier for the metadata file
+ * \param[in] raw_ext Raw data filename extension
+ * \param[in] raw_plist_id
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_split() is a compatibility function that enables the
+ * multi-file driver to emulate the split driver from HDF5 Releases 1.0
+ * and 1.2. The split file driver stored metadata and raw data in
+ * separate files but provided no mechanism for separating types of
+ * metadata.
+ *
+ * \p fapl is a file access property list identifier.
+ *
+ * \p meta_ext is the filename extension for the metadata file. The
+ * extension is appended to the name passed to H5FDopen(), usually from
+ * H5Fcreate() or H5Fopen(), to form the name of the metadata file. If
+ * the string \Code{%s} is used in the extension, it works like the
+ * name generator as in H5Pset_fapl_multi().
+ *
+ * \p meta_plist_id is the file access property list identifier for the
+ * metadata file.
+ *
+ * \p raw_ext is the filename extension for the raw data file. The
+ * extension is appended to the name passed to H5FDopen(), usually from
+ * H5Fcreate() or H5Fopen(), to form the name of the raw data file. If
+ * the string \Code{%s} is used in the extension, it works like the
+ * name generator as in H5Pset_fapl_multi().
+ *
+ * \p raw_plist_id is the file access property list identifier for the
+ * raw data file.
+ *
+ * If a user wishes to check to see whether this driver is in use, the
+ * user must call H5Pget_driver() and compare the returned value to the
+ * string #H5FD_MULTI. A positive match will confirm that the multi
+ * driver is in use; HDF5 provides no mechanism to determine whether it
+ * was called as the special case invoked by H5Pset_fapl_split().
+ *
+ * \par Example:
+ * \code
+ * // Example 1: Both metadata and rawdata files are in the same
+ * // directory. Use Station1-m.h5 and Station1-r.h5 as
+ * // the metadata and rawdata files.
+ * hid_t fapl, fid;
+ * fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT);
+ * fid=H5Fcreate("Station1",H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ *
+ * // Example 2: metadata and rawdata files are in different
+ * // directories. Use PointA-m.h5 and /pfs/PointA-r.h5 as
+ * // the metadata and rawdata files.
+ * hid_t fapl, fid;
+ * fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "/pfs/%s-r.h5", H5P_DEFAULT);
+ * fid=H5Fcreate("PointA",H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ * \endcode
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const char *raw_ext,
hid_t raw_plist_id);
#ifdef __cplusplus
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 60784f4..a13e7af 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -18,8 +18,9 @@
#ifndef H5FDprivate_H
#define H5FDprivate_H
-/* Include package's public header */
+/* Include package's public headers */
#include "H5FDpublic.h"
+#include "H5FDdevelop.h"
/* Private headers needed by this file */
#include "H5Pprivate.h" /* Property lists */
@@ -145,6 +146,7 @@ H5_DLL herr_t H5FD_flush(H5FD_t *file, hbool_t closing);
H5_DLL herr_t H5FD_truncate(H5FD_t *file, hbool_t closing);
H5_DLL herr_t H5FD_lock(H5FD_t *file, hbool_t rw);
H5_DLL herr_t H5FD_unlock(H5FD_t *file);
+H5_DLL herr_t H5FD_delete(const char *name, hid_t fapl_id);
H5_DLL herr_t H5FD_ctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void **output);
H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum);
H5_DLL herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle);
@@ -175,4 +177,4 @@ H5_DLL int H5FD_mpi_get_size(H5FD_t *file);
H5_DLL MPI_Comm H5FD_mpi_get_comm(H5FD_t *file);
#endif /* H5_HAVE_PARALLEL */
-#endif /* !_H5FDprivate_H */
+#endif /* H5FDprivate_H */
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index eed41c2..b8f4f12 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -18,140 +18,15 @@
#ifndef H5FDpublic_H
#define H5FDpublic_H
-#include "H5public.h"
-#include "H5Fpublic.h" /*for H5F_close_degree_t */
+/* Public headers needed by this file */
+#include "H5public.h" /* Generic Functions */
+#include "H5Fpublic.h" /* Files */
-#define H5_HAVE_VFL 1 /*define a convenient app feature test*/
-#define H5FD_VFD_DEFAULT 0 /* Default VFL driver value */
-
-/* Types of allocation requests: see H5Fpublic.h */
-typedef enum H5F_mem_t H5FD_mem_t;
-
-/* Map "fractal heap" header blocks to 'ohdr' type file memory, since its
- * a fair amount of work to add a new kind of file memory and they are similar
- * enough to object headers and probably too minor to deserve their own type.
- *
- * Map "fractal heap" indirect blocks to 'ohdr' type file memory, since they
- * are similar to fractal heap header blocks.
- *
- * Map "fractal heap" direct blocks to 'lheap' type file memory, since they
- * will be replacing local heaps.
- *
- * Map "fractal heap" 'huge' objects to 'draw' type file memory, since they
- * represent large objects that are directly stored in the file.
- *
- * -QAK
- */
-#define H5FD_MEM_FHEAP_HDR H5FD_MEM_OHDR
-#define H5FD_MEM_FHEAP_IBLOCK H5FD_MEM_OHDR
-#define H5FD_MEM_FHEAP_DBLOCK H5FD_MEM_LHEAP
-#define H5FD_MEM_FHEAP_HUGE_OBJ H5FD_MEM_DRAW
-
-/* Map "free space" header blocks to 'ohdr' type file memory, since its
- * a fair amount of work to add a new kind of file memory and they are similar
- * enough to object headers and probably too minor to deserve their own type.
- *
- * Map "free space" serialized sections to 'lheap' type file memory, since they
- * are similar enough to local heap info.
- *
- * -QAK
- */
-#define H5FD_MEM_FSPACE_HDR H5FD_MEM_OHDR
-#define H5FD_MEM_FSPACE_SINFO H5FD_MEM_LHEAP
-
-/* Map "shared object header message" master table to 'ohdr' type file memory,
- * since its a fair amount of work to add a new kind of file memory and they are
- * similar enough to object headers and probably too minor to deserve their own
- * type.
- *
- * Map "shared object header message" indices to 'btree' type file memory,
- * since they are similar enough to B-tree nodes.
- *
- * -QAK
- */
-#define H5FD_MEM_SOHM_TABLE H5FD_MEM_OHDR
-#define H5FD_MEM_SOHM_INDEX H5FD_MEM_BTREE
-
-/* Map "extensible array" header blocks to 'ohdr' type file memory, since its
- * a fair amount of work to add a new kind of file memory and they are similar
- * enough to object headers and probably too minor to deserve their own type.
- *
- * Map "extensible array" index blocks to 'ohdr' type file memory, since they
- * are similar to extensible array header blocks.
- *
- * Map "extensible array" super blocks to 'btree' type file memory, since they
- * are similar enough to B-tree nodes.
- *
- * Map "extensible array" data blocks & pages to 'lheap' type file memory, since
- * they are similar enough to local heap info.
- *
- * -QAK
- */
-#define H5FD_MEM_EARRAY_HDR H5FD_MEM_OHDR
-#define H5FD_MEM_EARRAY_IBLOCK H5FD_MEM_OHDR
-#define H5FD_MEM_EARRAY_SBLOCK H5FD_MEM_BTREE
-#define H5FD_MEM_EARRAY_DBLOCK H5FD_MEM_LHEAP
-#define H5FD_MEM_EARRAY_DBLK_PAGE H5FD_MEM_LHEAP
+/*****************/
+/* Public Macros */
+/*****************/
-/* Map "fixed array" header blocks to 'ohdr' type file memory, since its
- * a fair amount of work to add a new kind of file memory and they are similar
- * enough to object headers and probably too minor to deserve their own type.
- *
- * Map "fixed array" data blocks & pages to 'lheap' type file memory, since
- * they are similar enough to local heap info.
- *
- */
-#define H5FD_MEM_FARRAY_HDR H5FD_MEM_OHDR
-#define H5FD_MEM_FARRAY_DBLOCK H5FD_MEM_LHEAP
-#define H5FD_MEM_FARRAY_DBLK_PAGE H5FD_MEM_LHEAP
-
-/*
- * A free-list map which maps all types of allocation requests to a single
- * free list. This is useful for drivers that don't really care about
- * keeping different requests segregated in the underlying file and which
- * want to make most efficient reuse of freed memory. The use of the
- * H5FD_MEM_SUPER free list is arbitrary.
- */
-#define H5FD_FLMAP_SINGLE \
- { \
- H5FD_MEM_SUPER, /*default*/ \
- H5FD_MEM_SUPER, /*super*/ \
- H5FD_MEM_SUPER, /*btree*/ \
- H5FD_MEM_SUPER, /*draw*/ \
- H5FD_MEM_SUPER, /*gheap*/ \
- H5FD_MEM_SUPER, /*lheap*/ \
- H5FD_MEM_SUPER /*ohdr*/ \
- }
-
-/*
- * A free-list map which segregates requests into `raw' or `meta' data
- * pools.
- */
-#define H5FD_FLMAP_DICHOTOMY \
- { \
- H5FD_MEM_SUPER, /*default*/ \
- H5FD_MEM_SUPER, /*super*/ \
- H5FD_MEM_SUPER, /*btree*/ \
- H5FD_MEM_DRAW, /*draw*/ \
- H5FD_MEM_DRAW, /*gheap*/ \
- H5FD_MEM_SUPER, /*lheap*/ \
- H5FD_MEM_SUPER /*ohdr*/ \
- }
-
-/*
- * The default free list map which causes each request type to use it's own
- * free-list.
- */
-#define H5FD_FLMAP_DEFAULT \
- { \
- H5FD_MEM_DEFAULT, /*default*/ \
- H5FD_MEM_DEFAULT, /*super*/ \
- H5FD_MEM_DEFAULT, /*btree*/ \
- H5FD_MEM_DEFAULT, /*draw*/ \
- H5FD_MEM_DEFAULT, /*gheap*/ \
- H5FD_MEM_DEFAULT, /*lheap*/ \
- H5FD_MEM_DEFAULT /*ohdr*/ \
- }
+#define H5FD_VFD_DEFAULT 0 /* Default VFL driver value */
/* Define VFL driver features that can be enabled on a per-driver basis */
/* These are returned with the 'query' function pointer in H5FD_class_t */
@@ -263,12 +138,20 @@ typedef enum H5F_mem_t H5FD_mem_t;
*/
#define H5FD_FEAT_DEFAULT_VFD_COMPATIBLE 0x00008000
+/* ctl function definitions: */
+#define H5FD_CTL_OPC_RESERVED 512 /* Opcodes below this value are reserved for library use */
+#define H5FD_CTL_OPC_EXPER_MIN \
+ H5FD_CTL_OPC_RESERVED /* Minimum opcode value available for experimental use \
+ */
+#define H5FD_CTL_OPC_EXPER_MAX \
+ (H5FD_CTL_OPC_RESERVED + 511) /* Maximum opcode value available for experimental use */
+
/* ctl function op codes: */
#define H5FD_CTL__INVALID_OPCODE 0
-#define H5FD_CTL__GET_MPI_COMMUNICATOR_OPCODE 1
-#define H5FD_CTL__GET_MPI_RANK_OPCODE 2
-#define H5FD_CTL__GET_MPI_SIZE_OPCODE 3
-#define H5FD_CTL__NUM_OPCODES 4 /* must be last */
+#define H5FD_CTL__TEST_OPCODE 1
+#define H5FD_CTL__GET_MPI_COMMUNICATOR_OPCODE 2
+#define H5FD_CTL__GET_MPI_RANK_OPCODE 3
+#define H5FD_CTL__GET_MPI_SIZE_OPCODE 4
/* ctl function flags: */
@@ -326,143 +209,134 @@ typedef enum H5F_mem_t H5FD_mem_t;
*/
#define H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG 0x0002
-/* Forward declaration */
-typedef struct H5FD_t H5FD_t;
-
-/* Class information for each file driver */
-typedef struct H5FD_class_t {
- const char * name;
- haddr_t maxaddr;
- H5F_close_degree_t fc_degree;
- herr_t (*terminate)(void);
- hsize_t (*sb_size)(H5FD_t *file);
- herr_t (*sb_encode)(H5FD_t *file, char *name /*out*/, unsigned char *p /*out*/);
- herr_t (*sb_decode)(H5FD_t *f, const char *name, const unsigned char *p);
- size_t fapl_size;
- void *(*fapl_get)(H5FD_t *file);
- void *(*fapl_copy)(const void *fapl);
- herr_t (*fapl_free)(void *fapl);
- size_t dxpl_size;
- void *(*dxpl_copy)(const void *dxpl);
- herr_t (*dxpl_free)(void *dxpl);
- H5FD_t *(*open)(const char *name, unsigned flags, hid_t fapl, haddr_t maxaddr);
- herr_t (*close)(H5FD_t *file);
- int (*cmp)(const H5FD_t *f1, const H5FD_t *f2);
- herr_t (*query)(const H5FD_t *f1, unsigned long *flags);
- herr_t (*get_type_map)(const H5FD_t *file, H5FD_mem_t *type_map);
- haddr_t (*alloc)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
- herr_t (*free)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
- haddr_t (*get_eoa)(const H5FD_t *file, H5FD_mem_t type);
- herr_t (*set_eoa)(H5FD_t *file, H5FD_mem_t type, haddr_t addr);
- haddr_t (*get_eof)(const H5FD_t *file, H5FD_mem_t type);
- herr_t (*get_handle)(H5FD_t *file, hid_t fapl, void **file_handle);
- herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, void *buffer);
- herr_t (*write)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, const void *buffer);
- herr_t (*read_vector)(H5FD_t *file, hid_t dxpl, uint32_t count, H5FD_mem_t types[], haddr_t addrs[],
- size_t sizes[], void *bufs[]);
- herr_t (*write_vector)(H5FD_t *file, hid_t dxpl, uint32_t count, H5FD_mem_t types[], haddr_t addrs[],
- size_t sizes[], const void *bufs[]);
- herr_t (*read_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, size_t count, hid_t mem_spaces[],
- hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[],
- void *bufs[] /*out*/);
- herr_t (*write_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, size_t count, hid_t mem_spaces[],
- hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[],
- const void *bufs[] /*in*/);
- herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
- herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
- herr_t (*lock)(H5FD_t *file, hbool_t rw);
- herr_t (*unlock)(H5FD_t *file);
- herr_t (*ctl)(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void **output);
- H5FD_mem_t fl_map[H5FD_MEM_NTYPES];
-} H5FD_class_t;
+/*******************/
+/* Public Typedefs */
+/*******************/
-/* A free list is a singly-linked list of address/size pairs. */
-typedef struct H5FD_free_t {
- haddr_t addr;
- hsize_t size;
- struct H5FD_free_t *next;
-} H5FD_free_t;
+/* Types of allocation requests: see H5Fpublic.h */
+typedef enum H5F_mem_t H5FD_mem_t;
-/*
- * The main datatype for each driver. Public fields common to all drivers
- * are declared here and the driver appends private fields in memory.
+/**
+ * Define enum for the source of file image callbacks
*/
-struct H5FD_t {
- hid_t driver_id; /*driver ID for this file */
- const H5FD_class_t *cls; /*constant class info */
- unsigned long fileno; /* File 'serial' number */
- unsigned access_flags; /* File access flags (from create or open) */
- unsigned long feature_flags; /* VFL Driver feature Flags */
- haddr_t maxaddr; /* For this file, overrides class */
- haddr_t base_addr; /* Base address for HDF5 data w/in file */
-
- /* Space allocation management fields */
- hsize_t threshold; /* Threshold for alignment */
- hsize_t alignment; /* Allocation alignment */
- hbool_t paged_aggr; /* Paged aggregation for file space is enabled or not */
-};
-
-/* Define enum for the source of file image callbacks */
+//! <!-- [H5FD_file_image_op_t_snip] -->
typedef enum {
H5FD_FILE_IMAGE_OP_NO_OP,
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET,
+ /**< Passed to the \p image_malloc and \p image_memcpy callbacks when a
+ * file image buffer is to be copied while being set in a file access
+ * property list (FAPL)*/
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY,
+ /**< Passed to the \p image_malloc and \p image_memcpy callbacks
+ * when a file image buffer is to be copied when a FAPL is copied*/
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET,
+ /**<Passed to the \p image_malloc and \p image_memcpy callbacks when
+ * a file image buffer is to be copied while being retrieved from a FAPL*/
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE,
+ /**<Passed to the \p image_free callback when a file image
+ * buffer is to be released during a FAPL close operation*/
H5FD_FILE_IMAGE_OP_FILE_OPEN,
+ /**<Passed to the \p image_malloc and
+ * \p image_memcpy callbackswhen a
+ * file image buffer is to be copied during a file open operation \n
+ * While the file image being opened will typically be copied from a
+ * FAPL, this need not always be the case. For example, the core file
+ * driver, also known as the memory file driver, takes its initial
+ * image from a file.*/
H5FD_FILE_IMAGE_OP_FILE_RESIZE,
+ /**<Passed to the \p image_realloc callback when a file driver needs
+ * to resize an image buffer*/
H5FD_FILE_IMAGE_OP_FILE_CLOSE
+ /**<Passed to the \p image_free callback when an image buffer is to
+ * be released during a file close operation*/
} H5FD_file_image_op_t;
+//! <!-- [H5FD_file_image_op_t_snip] -->
-/* Define structure to hold file image callbacks */
+/**
+ * Define structure to hold file image callbacks
+ */
+//! <!-- [H5FD_file_image_callbacks_t_snip] -->
typedef struct {
+ /**
+ * \param[in] size Size in bytes of the file image buffer to allocate
+ * \param[in] file_image_op A value from H5FD_file_image_op_t indicating
+ * the operation being performed on the file image
+ * when this callback is invoked
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_malloc_snip] -->
void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, void *udata);
+ //! <!-- [image_malloc_snip] -->
+ /**
+ * \param[in] dest Address of the destination buffer
+ * \param[in] src Address of the source buffer
+ * \param[in] file_image_op A value from #H5FD_file_image_op_t indicating
+ * the operation being performed on the file image
+ * when this callback is invoked
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_memcpy_snip] -->
void *(*image_memcpy)(void *dest, const void *src, size_t size, H5FD_file_image_op_t file_image_op,
void *udata);
+ //! <!-- [image_memcpy_snip] -->
+ /**
+ * \param[in] ptr Pointer to the buffer being reallocated
+ * \param[in] file_image_op A value from #H5FD_file_image_op_t indicating
+ * the operation being performed on the file image
+ * when this callback is invoked
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_realloc_snip] -->
void *(*image_realloc)(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *udata);
+ //! <!-- [image_realloc_snip] -->
+ /**
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_free_snip] -->
herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, void *udata);
+ //! <!-- [image_free_snip] -->
+ /**
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [udata_copy_snip] -->
void *(*udata_copy)(void *udata);
+ //! <!-- [udata_copy_snip] -->
+ /**
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [udata_free_snip] -->
herr_t (*udata_free)(void *udata);
+ //! <!-- [udata_free_snip] -->
+ /**
+ * \brief The final field in the #H5FD_file_image_callbacks_t struct,
+ * provides a pointer to user-defined data. This pointer will be
+ * passed to the image_malloc, image_memcpy, image_realloc, and
+ * image_free callbacks. Define udata as NULL if no user-defined
+ * data is provided.
+ */
void *udata;
} H5FD_file_image_callbacks_t;
+//! <!-- [H5FD_file_image_callbacks_t_snip] -->
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
#ifdef __cplusplus
extern "C" {
#endif
/* Function prototypes */
-H5_DLL hid_t H5FDregister(const H5FD_class_t *cls);
-H5_DLL herr_t H5FDunregister(hid_t driver_id);
-H5_DLL H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-H5_DLL herr_t H5FDclose(H5FD_t *file);
-H5_DLL int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2);
-H5_DLL int H5FDquery(const H5FD_t *f, unsigned long *flags);
-H5_DLL haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
-H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
-H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type);
-H5_DLL herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa);
-H5_DLL haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type);
-H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle);
-H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- void *buf /*out*/);
-H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- const void *buf);
-H5_DLL herr_t H5FDread_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[],
- haddr_t addrs[], size_t sizes[], void *bufs[] /* out */);
-H5_DLL herr_t H5FDwrite_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[],
- haddr_t addrs[], size_t sizes[], const void *bufs[] /* in */);
-H5_DLL herr_t H5FDread_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
- hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
- size_t element_sizes[], void *bufs[] /* out */);
-H5_DLL herr_t H5FDwrite_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
- hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
- size_t element_sizes[], const void *bufs[]);
-H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
-H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
-H5_DLL herr_t H5FDlock(H5FD_t *file, hbool_t rw);
-H5_DLL herr_t H5FDunlock(H5FD_t *file);
-H5_DLL herr_t H5FDctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void **output);
-
/* Allows querying a VFD ID for features before the file is opened */
H5_DLL herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags /*out*/);
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index 165667c..0dd8cc3 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -22,8 +22,10 @@
* Relies on "s3comms" utility layer to implement the AWS REST API.
*/
+#ifdef H5_HAVE_ROS3_VFD
/* This source code file is part of the H5FD driver module */
#include "H5FDdrvr_module.h"
+#endif
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
@@ -270,6 +272,7 @@ static const H5FD_class_t H5FD_ros3_g = {
H5FD__ros3_truncate, /* truncate */
NULL, /* lock */
NULL, /* unlock */
+ NULL, /* del */
NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
diff --git a/src/H5FDros3.h b/src/H5FDros3.h
index 3ef6b8a..8e42ca2 100644
--- a/src/H5FDros3.h
+++ b/src/H5FDros3.h
@@ -89,8 +89,20 @@ typedef struct H5FD_ros3_fapl_t {
extern "C" {
#endif
-H5_DLL hid_t H5FD_ros3_init(void);
+H5_DLL hid_t H5FD_ros3_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa);
#ifdef __cplusplus
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 95a5414..be59102 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -138,6 +138,9 @@ static herr_t H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, h
static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__sec2_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__sec2_unlock(H5FD_t *_file);
+static herr_t H5FD__sec2_delete(const char *filename, hid_t fapl_id);
+static herr_t H5FD__sec2_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input,
+ void **output);
static const H5FD_class_t H5FD_sec2_g = {
"sec2", /* name */
@@ -175,7 +178,8 @@ static const H5FD_class_t H5FD_sec2_g = {
H5FD__sec2_truncate, /* truncate */
H5FD__sec2_lock, /* lock */
H5FD__sec2_unlock, /* unlock */
- NULL, /* ctl */
+ H5FD__sec2_delete, /* del */
+ H5FD__sec2_ctl, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -1046,3 +1050,73 @@ H5FD__sec2_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__sec2_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__sec2_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__sec2_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__sec2_delete() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__sec2_ctl
+ *
+ * Purpose: Sec2 VFD version of the ctl callback.
+ *
+ * The desired operation is specified by the op_code
+ * parameter.
+ *
+ * The flags parameter controls management of op_codes that
+ * are unknown to the callback
+ *
+ * The input and output parameters allow op_code specific
+ * input and output
+ *
+ * At present, no op codes are supported by this VFD.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__sec2_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_ATTR_UNUSED *input,
+ void H5_ATTR_UNUSED **output)
+{
+ H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity checks */
+ HDassert(file);
+ HDassert(H5FD_SEC2 == file->pub.driver_id);
+
+ switch (op_code) {
+ /* Unknown op code */
+ default:
+ if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "unknown op_code and fail if unknown flag is set")
+ break;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__sec2_ctl() */
diff --git a/src/H5FDspace.c b/src/H5FDspace.c
index 339c413..de52dc3 100644
--- a/src/H5FDspace.c
+++ b/src/H5FDspace.c
@@ -148,7 +148,7 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr
FUNC_ENTER_PACKAGE
#ifdef H5FD_ALLOC_DEBUG
- HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
+ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", __func__, (unsigned)type, size);
#endif /* H5FD_ALLOC_DEBUG */
/* check args */
@@ -211,7 +211,7 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr
done:
#ifdef H5FD_ALLOC_DEBUG
- HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: ret_value = %a\n", __func__, ret_value);
#endif /* H5FD_ALLOC_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__alloc_real() */
@@ -287,7 +287,7 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size)
HDassert(size > 0);
#ifdef H5FD_ALLOC_DEBUG
- HDfprintf(stderr, "%s: type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)type, addr, size);
+ HDfprintf(stderr, "%s: type = %u, addr = %a, size = %Hu\n", __func__, (unsigned)type, addr, size);
#endif /* H5FD_ALLOC_DEBUG */
/* Sanity checking */
@@ -304,7 +304,7 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size)
/* Check for file driver 'free' callback and call it if available */
if (file->cls->free) {
#ifdef H5FD_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Letting VFD free space\n", FUNC);
+ HDfprintf(stderr, "%s: Letting VFD free space\n", __func__);
#endif /* H5FD_ALLOC_DEBUG */
if ((file->cls->free)(file, type, H5CX_get_dxpl(), addr, size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed")
@@ -317,11 +317,11 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size)
eoa = file->cls->get_eoa(file, type);
#ifdef H5FD_ALLOC_DEBUG
- HDfprintf(stderr, "%s: eoa = %a\n", FUNC, eoa);
+ HDfprintf(stderr, "%s: eoa = %a\n", __func__, eoa);
#endif /* H5FD_ALLOC_DEBUG */
if (eoa == (addr + size)) {
#ifdef H5FD_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Reducing file size to = %a\n", FUNC, addr);
+ HDfprintf(stderr, "%s: Reducing file size to = %a\n", __func__, addr);
#endif /* H5FD_ALLOC_DEBUG */
if (file->cls->set_eoa(file, type, addr) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "set end of space allocation request failed")
@@ -330,7 +330,7 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size)
else {
/* leak memory */
#ifdef H5FD_ALLOC_DEBUG
- HDfprintf(stderr, "%s: LEAKED MEMORY!!! type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)type,
+ HDfprintf(stderr, "%s: LEAKED MEMORY!!! type = %u, addr = %a, size = %Hu\n", __func__, (unsigned)type,
addr, size);
#endif /* H5FD_ALLOC_DEBUG */
} /* end else */
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 045277e..b178b5b 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -129,6 +129,8 @@ static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closin
static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__splitter_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__splitter_unlock(H5FD_t *_file);
+static herr_t H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input,
+ void **output);
static const H5FD_class_t H5FD_splitter_g = {
"splitter", /* name */
@@ -166,7 +168,8 @@ static const H5FD_class_t H5FD_splitter_g = {
H5FD__splitter_truncate, /* truncate */
H5FD__splitter_lock, /* lock */
H5FD__splitter_unlock, /* unlock */
- NULL, /* ctl */
+ NULL, /* del */
+ H5FD__splitter_ctl, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -191,7 +194,7 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
if (H5FD_splitter_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize splitter VFD")
@@ -217,7 +220,7 @@ H5FD_splitter_init(void)
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
if (H5I_VFL != H5I_get_type(H5FD_SPLITTER_g))
H5FD_SPLITTER_g = H5FDregister(&H5FD_splitter_g);
@@ -241,7 +244,7 @@ H5FD__splitter_term(void)
{
FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Reset VFL ID */
H5FD_SPLITTER_g = 0;
@@ -266,7 +269,7 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
HDassert(id_out_ptr != NULL);
@@ -304,7 +307,7 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*#", fapl_id, vfd_config);
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
if (H5FD_SPLITTER_MAGIC != vfd_config->magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)")
@@ -344,10 +347,12 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate file access property list struct")
info->ignore_wo_errs = vfd_config->ignore_wo_errs;
- HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX);
- HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX);
- info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
- info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
+ HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX + 1);
+ info->wo_path[H5FD_SPLITTER_PATH_MAX] = '\0';
+ HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX + 1);
+ info->log_file_path[H5FD_SPLITTER_PATH_MAX] = '\0';
+ info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
+ info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
/* Set non-default channel FAPL IDs in splitter configuration info */
if (H5P_DEFAULT != vfd_config->rw_fapl_id) {
@@ -392,7 +397,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", fapl_id, config);
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
@@ -416,8 +421,8 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/)
if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr)))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info")
- HDstrncpy(config->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
- HDstrncpy(config->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(config->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX + 1);
+ HDstrncpy(config->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX + 1);
config->ignore_wo_errs = fapl_ptr->ignore_wo_errs;
/* Copy R/W and W/O FAPLs */
@@ -446,13 +451,13 @@ H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closin
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Public API for dxpl "context" */
if (H5FDflush(file->rw_file, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush R/W file")
if (H5FDflush(file->wo_file, dxpl_id, closing) < 0)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -481,7 +486,7 @@ H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -521,7 +526,7 @@ H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
@@ -531,7 +536,7 @@ H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr
if (H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "R/W file write failed")
if (H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -557,7 +562,7 @@ H5FD__splitter_fapl_get(H5FD_t *_file)
FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
ret_value = H5FD__splitter_fapl_copy(&(file->fa));
@@ -582,7 +587,7 @@ H5FD__splitter_fapl_copy(const void *_old_fa)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
HDassert(old_fa_ptr);
@@ -591,8 +596,8 @@ H5FD__splitter_fapl_copy(const void *_old_fa)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL")
H5MM_memcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t));
- HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
- HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX + 1);
+ HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX + 1);
/* Copy R/W and W/O FAPLs */
if (H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0)
@@ -626,7 +631,7 @@ H5FD__splitter_fapl_free(void *_fapl)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
HDassert(fapl);
@@ -664,7 +669,7 @@ H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, ha
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
if (!name || !*name)
@@ -692,8 +697,8 @@ H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, ha
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get VFL driver info")
/* Copy simpler info */
- HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
- HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX + 1);
+ HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX + 1);
file_ptr->fa.ignore_wo_errs = fapl_ptr->ignore_wo_errs;
/* Copy R/W and W/O channel FAPLs. */
@@ -720,7 +725,7 @@ H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, ha
file_ptr->wo_file = H5FD_open(fapl_ptr->wo_path, flags, fapl_ptr->wo_fapl_id, HADDR_UNDEF);
if (!file_ptr->wo_file)
- H5FD_SPLITTER_WO_ERROR(file_ptr, FUNC, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file")
+ H5FD_SPLITTER_WO_ERROR(file_ptr, __func__, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file")
ret_value = (H5FD_t *)file_ptr;
@@ -761,7 +766,7 @@ H5FD__splitter_close(H5FD_t *_file)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Sanity check */
HDassert(file);
@@ -776,7 +781,8 @@ H5FD__splitter_close(H5FD_t *_file)
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close R/W file")
if (file->wo_file)
if (H5FD_close(file->wo_file) == FAIL)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
+ "unable to close W/O file")
if (file->logfp) {
HDfclose(file->logfp);
@@ -811,7 +817,7 @@ H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Sanity check */
HDassert(file);
@@ -842,7 +848,7 @@ H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t ad
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC)
+ H5FD_SPLITTER_LOG_CALL(__func__)
/* Sanity check */
HDassert(file);
@@ -853,7 +859,7 @@ H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t ad
HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "H5FDset_eoa failed for R/W file")
if (H5FD_set_eoa(file->wo_file, type, addr) < 0)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -879,7 +885,7 @@ H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Sanity check */
HDassert(file);
@@ -908,7 +914,7 @@ H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
HDassert(file);
HDassert(file->rw_file);
@@ -918,7 +924,7 @@ H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate R/W file")
if (H5FDtruncate(file->wo_file, dxpl_id, closing) < 0)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -946,7 +952,7 @@ H5FD__splitter_sb_size(H5FD_t *_file)
FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Sanity check */
HDassert(file);
@@ -974,7 +980,7 @@ H5FD__splitter_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Sanity check */
HDassert(file);
@@ -1005,7 +1011,7 @@ H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *b
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Sanity check */
HDassert(file);
@@ -1036,7 +1042,7 @@ H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
HDassert(f1);
HDassert(f2);
@@ -1063,7 +1069,7 @@ H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
HDassert(file);
@@ -1094,7 +1100,7 @@ H5FD__splitter_lock(H5FD_t *_file, hbool_t rw)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
HDassert(file);
HDassert(file->rw_file);
@@ -1105,7 +1111,7 @@ H5FD__splitter_lock(H5FD_t *_file, hbool_t rw)
if (file->wo_file != NULL)
if (H5FD_lock(file->wo_file, rw) < 0)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1127,7 +1133,7 @@ H5FD__splitter_unlock(H5FD_t *_file)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
HDassert(file);
@@ -1146,6 +1152,63 @@ done:
} /* end H5FD__splitter_unlock */
/*-------------------------------------------------------------------------
+ * Function: H5FD__splitter_ctl
+ *
+ * Purpose: Splitter VFD version of the ctl callback.
+ *
+ * The desired operation is specified by the op_code
+ * parameter.
+ *
+ * The flags parameter controls management of op_codes that
+ * are unknown to the callback
+ *
+ * The input and output parameters allow op_code specific
+ * input and output
+ *
+ * At present, this VFD supports no op codes of its own and
+ * simply passes ctl calls on to the R/W channel VFD.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input, void **output)
+{
+ H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity checks */
+ HDassert(file);
+ HDassert(H5FD_SPLITTER == file->pub.driver_id);
+
+ switch (op_code) {
+ /* Unknown op code */
+ default:
+ if (flags & H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG) {
+ /* Pass ctl call down to R/W channel VFD */
+ if (H5FDctl(file->rw_file, op_code, flags, input, output) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "VFD ctl request failed")
+ }
+ else {
+ /* If no valid VFD routing flag is specified, fail for unknown op code
+ * if H5FD_CTL__FAIL_IF_UNKNOWN_FLAG flag is set.
+ */
+ if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL,
+ "VFD ctl request failed (unknown op code and fail if unknown flag is set)")
+ }
+
+ break;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__splitter_ctl() */
+
+/*-------------------------------------------------------------------------
* Function: H5FD__splitter_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
@@ -1162,7 +1225,7 @@ H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
if (file) {
HDassert(file);
@@ -1199,7 +1262,7 @@ H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
HDassert(file);
@@ -1210,7 +1273,8 @@ H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate for R/W file")
if (H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to alloc for W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF,
+ "unable to alloc for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1232,7 +1296,7 @@ H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
HDassert(file);
@@ -1262,7 +1326,7 @@ H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
HDassert(file);
@@ -1272,7 +1336,7 @@ H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free for R/W file")
if (H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0)
- H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file")
+ H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1293,7 +1357,7 @@ H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const
FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL(FUNC);
+ H5FD_SPLITTER_LOG_CALL(__func__);
/* Check arguments */
HDassert(file);
diff --git a/src/H5FDsplitter.h b/src/H5FDsplitter.h
index a201116..ee6e7c5 100644
--- a/src/H5FDsplitter.h
+++ b/src/H5FDsplitter.h
@@ -87,8 +87,20 @@ typedef struct H5FD_splitter_vfd_config_t {
#ifdef __cplusplus
extern "C" {
#endif
-H5_DLL hid_t H5FD_splitter_init(void);
+H5_DLL hid_t H5FD_splitter_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_ptr);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_ptr);
#ifdef __cplusplus
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index bb287b5..f9cf350 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -180,6 +180,7 @@ static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_stdio_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD_stdio_unlock(H5FD_t *_file);
+static herr_t H5FD_stdio_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_stdio_g = {
"stdio", /* name */
@@ -217,6 +218,7 @@ static const H5FD_class_t H5FD_stdio_g = {
H5FD_stdio_truncate, /* truncate */
H5FD_stdio_lock, /* lock */
H5FD_stdio_unlock, /* unlock */
+ H5FD_stdio_delete, /* del */
NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -305,9 +307,9 @@ H5Pset_fapl_stdio(hid_t fapl_id)
H5Eclear2(H5E_DEFAULT);
if (0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1);
- return H5Pset_driver(fapl_id, H5FD_STDIO, NULL);
+ return H5Pset_driver(fapl_id, H5FD_STDIO, NULL);
} /* end H5Pset_fapl_stdio() */
/*-------------------------------------------------------------------------
@@ -358,14 +360,15 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
/* Check arguments */
if (!name || !*name)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name",
- NULL) if (0 == maxaddr || HADDR_UNDEF == maxaddr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr",
- NULL) if (ADDR_OVERFLOW(maxaddr))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL)
-
- /* Tentatively open file in read-only mode, to check for existence */
- if (flags & H5F_ACC_RDWR) f = fopen(name, "rb+");
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
+ if (ADDR_OVERFLOW(maxaddr))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL);
+
+ /* Tentatively open file in read-only mode, to check for existence */
+ if (flags & H5F_ACC_RDWR)
+ f = fopen(name, "rb+");
else
f = fopen(name, "rb");
@@ -378,14 +381,14 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
}
else
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE,
- "file doesn't exist and CREAT wasn't specified", NULL)
+ "file doesn't exist and CREAT wasn't specified", NULL);
}
else if (flags & H5F_ACC_EXCL) {
/* File exists, but EXCL is passed. Fail. */
assert(flags & H5F_ACC_CREAT);
fclose(f);
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FILEEXISTS,
- "file exists but CREAT and EXCL were specified", NULL)
+ "file exists but CREAT and EXCL were specified", NULL);
}
else if (flags & H5F_ACC_RDWR) {
if (flags & H5F_ACC_TRUNC)
@@ -396,14 +399,13 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
* as the tentative open will work */
if (!f)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL);
- /* Build the return value */
- if (NULL == (file = (H5FD_stdio_t *)calloc((size_t)1, sizeof(H5FD_stdio_t))))
- {
- fclose(f);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL)
- } /* end if */
+ /* Build the return value */
+ if (NULL == (file = (H5FD_stdio_t *)calloc((size_t)1, sizeof(H5FD_stdio_t)))) {
+ fclose(f);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
+ } /* end if */
file->fp = f;
file->op = H5FD_STDIO_OP_SEEK;
file->pos = HADDR_UNDEF;
@@ -467,7 +469,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
if (fstat(file->fd, &sb) < 0) {
free(file);
fclose(f);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL);
} /* end if */
file->device = sb.st_dev;
file->inode = sb.st_ino;
@@ -501,9 +503,9 @@ H5FD_stdio_close(H5FD_t *_file)
H5Eclear2(H5E_DEFAULT);
if (fclose(file->fp) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CLOSEERROR, "fclose failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CLOSEERROR, "fclose failed", -1);
- free(file);
+ free(file);
return 0;
} /* end H5FD_stdio_close() */
@@ -774,9 +776,9 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t /*UNUSED*/ fapl, void **file_handle)
*file_handle = &(file->fp);
if (*file_handle == NULL)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1);
- return 0;
+ return 0;
} /* end H5FD_stdio_get_handle() */
/*-------------------------------------------------------------------------
@@ -813,12 +815,13 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
/* Check for overflow */
if (HADDR_UNDEF == addr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed",
- -1) if (REGION_OVERFLOW(addr, size))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ if (REGION_OVERFLOW(addr, size))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
- /* Check easy cases */
- if (0 == size) return 0;
+ /* Check easy cases */
+ if (0 == size)
+ return 0;
if ((haddr_t)addr >= file->eof) {
memset(buf, 0, size);
return 0;
@@ -829,7 +832,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) {
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
}
file->pos = addr;
}
@@ -861,7 +864,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
if (0 == bytes_read && ferror(file->fp)) { /* error */
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1);
} /* end if */
if (0 == bytes_read && feof(file->fp)) {
@@ -915,20 +918,19 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
/* Check for overflow conditions */
if (HADDR_UNDEF == addr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed",
- -1) if (REGION_OVERFLOW(addr, size))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
-
- /* Seek to the correct file position. */
- if ((file->op != H5FD_STDIO_OP_WRITE && file->op != H5FD_STDIO_OP_SEEK) || file->pos != addr)
- {
- if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) {
- file->op = H5FD_STDIO_OP_UNKNOWN;
- file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
- }
- file->pos = addr;
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ if (REGION_OVERFLOW(addr, size))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+
+ /* Seek to the correct file position. */
+ if ((file->op != H5FD_STDIO_OP_WRITE && file->op != H5FD_STDIO_OP_SEEK) || file->pos != addr) {
+ if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) {
+ file->op = H5FD_STDIO_OP_UNKNOWN;
+ file->pos = HADDR_UNDEF;
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
}
+ file->pos = addr;
+ }
/* Write the buffer. On successful return, the file position will be
* advanced by the number of bytes read. On failure, the file position is
@@ -950,7 +952,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
if (bytes_wrote != bytes_in || (0 == bytes_wrote && ferror(file->fp))) { /* error */
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1);
} /* end if */
assert(bytes_wrote > 0);
@@ -1004,11 +1006,11 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t closing)
if (file->write_access) {
if (!closing) {
if (fflush(file->fp) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1);
- /* Reset last file I/O information */
- file->pos = HADDR_UNDEF;
- file->op = H5FD_STDIO_OP_UNKNOWN;
+ /* Reset last file I/O information */
+ file->pos = HADDR_UNDEF;
+ file->op = H5FD_STDIO_OP_UNKNOWN;
} /* end if */
} /* end if */
@@ -1073,13 +1075,13 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/
if (INVALID_SET_FILE_POINTER == dwPtrLow) {
dwError = GetLastError();
if (dwError != NO_ERROR)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_FILEOPEN, "unable to set file pointer", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_FILEOPEN, "unable to set file pointer", -1);
}
bError = SetEndOfFile(file->hFile);
if (0 == bError)
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR,
- "unable to truncate/extend file properly", -1)
+ "unable to truncate/extend file properly", -1);
#else /* H5_HAVE_WIN32_API */
/* Reset seek offset to beginning of file, so that file isn't re-extended later */
rewind(file->fp);
@@ -1087,11 +1089,11 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/
/* Truncate file to proper length */
if (-1 == file_ftruncate(file->fd, (file_offset_t)file->eoa))
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR,
- "unable to truncate/extend file properly", -1)
+ "unable to truncate/extend file properly", -1);
#endif /* H5_HAVE_WIN32_API */
- /* Update the eof value */
- file->eof = file->eoa;
+ /* Update the eof value */
+ file->eof = file->eoa;
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
@@ -1101,7 +1103,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/
else {
/* Double-check for problems */
if (file->eoa > file->eof)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_TRUNCATED, "eoa > eof!", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_TRUNCATED, "eoa > eof!", -1);
} /* end else */
return 0;
@@ -1146,16 +1148,16 @@ H5FD_stdio_lock(H5FD_t *_file, hbool_t rw)
*/
errno = 0;
else
- H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "file lock failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "file lock failed", -1);
} /* end if */
/* Flush the stream */
if (fflush(file->fp) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1);
#endif /* H5_HAVE_FLOCK */
- return 0;
+ return 0;
} /* end H5FD_stdio_lock() */
/*-------------------------------------------------------------------------
@@ -1187,26 +1189,53 @@ H5FD_stdio_unlock(H5FD_t *_file)
/* Flush the stream */
if (fflush(file->fp) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1)
-
- /* Place a non-blocking lock on the file */
- if (flock(file->fd, LOCK_UN) < 0)
- {
- if (file->ignore_disabled_file_locks && ENOSYS == errno)
- /* When errno is set to ENOSYS, the file system does not support
- * locking, so ignore it.
- */
- errno = 0;
- else
- H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "file unlock failed", -1)
- } /* end if */
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1);
+
+ /* Place a non-blocking lock on the file */
+ if (flock(file->fd, LOCK_UN) < 0) {
+ if (file->ignore_disabled_file_locks && ENOSYS == errno)
+ /* When errno is set to ENOSYS, the file system does not support
+ * locking, so ignore it.
+ */
+ errno = 0;
+ else
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "file unlock failed", -1);
+ } /* end if */
#endif /* H5_HAVE_FLOCK */
return 0;
} /* end H5FD_stdio_unlock() */
-#ifdef _H5private_H
+/*-------------------------------------------------------------------------
+ * Function: H5FD_stdio_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_stdio_delete(const char *filename, hid_t /*UNUSED*/ fapl_id)
+{
+ static const char *func = "H5FD_stdio_delete"; /* Function Name for error reporting */
+
+ /* Clear the error stack */
+ H5Eclear2(H5E_DEFAULT);
+
+ assert(filename);
+
+ /* Quiet compiler */
+ (void)fapl_id;
+
+ if (remove(filename) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTDELETEFILE, "can't delete file)", -1);
+
+ return 0;
+} /* end H5FD_stdio_delete() */
+
+#ifdef H5private_H
/*
* This is not related to the functionality of the driver code.
* It is added here to trigger warning if HDF5 private definitions are included
diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h
index b3e06bb..9db92ed 100644
--- a/src/H5FDstdio.h
+++ b/src/H5FDstdio.h
@@ -28,7 +28,21 @@
extern "C" {
#endif
-H5_DLL hid_t H5FD_stdio_init(void);
+H5_DLL hid_t H5FD_stdio_init(void);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the standard I/O driver
+ *
+ * \fapl_id
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_stdio() modifies the file access property list to use
+ * the standard I/O driver, H5FDstdio().
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_stdio(hid_t fapl_id);
#ifdef __cplusplus
diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h
index c1c4654..79e73b6 100644
--- a/src/H5FDwindows.h
+++ b/src/H5FDwindows.h
@@ -27,6 +27,36 @@
extern "C" {
#endif /* __cplusplus */
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the Windows I/O driver
+ *
+ * \fapl_id
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_windows() sets the default HDF5 Windows I/O driver on
+ * Windows systems.
+ *
+ * Since the HDF5 library uses this driver, #H5FD_WINDOWS, by default
+ * on Windows systems, it is not normally necessary for a user
+ * application to call H5Pset_fapl_windows(). While it is not
+ * recommended, there may be times when a user chooses to set a
+ * different HDF5 driver, such as the standard I/O driver (#H5FD_STDIO)
+ * or the sec2 driver (#H5FD_SEC2), in a Windows
+ * application. H5Pset_fapl_windows() is provided so that the
+ * application can return to the Windows I/O driver when the time
+ * comes.
+ *
+ * Only the Windows driver is tested on Windows systems; other drivers
+ * are used at the application’s and the user’s risk.
+ *
+ * Furthermore, the Windows driver is tested and available only on
+ * Windows systems; it is not available on non-Windows systems.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_windows(hid_t fapl_id);
#ifdef __cplusplus
diff --git a/src/H5FL.c b/src/H5FL.c
index 95188d5..cb58868 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -207,7 +207,7 @@ H5FL_term_package(void)
/* Dump information about all the outstanding allocations */
while (trk != NULL) {
/* Print information about the outstanding block */
- HDfprintf(stderr, "%s: Outstanding allocation:\n", FUNC);
+ HDfprintf(stderr, "%s: Outstanding allocation:\n", __func__);
HDfprintf(stderr, "\tPtr: %p, File: %s, Function: %s, Line: %d\n",
(((unsigned char *)trk) + sizeof(H5FL_track_t)), trk->file, trk->func, trk->line);
H5CS_print_stack(trk->stack, stderr);
@@ -337,8 +337,11 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj)
/* Free tracking information about the allocation location */
H5CS_close_stack(trk->stack);
- trk->file = H5MM_xfree(trk->file);
- trk->func = H5MM_xfree(trk->func);
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * and are not allocated, so there's no need to free them.
+ */
+ trk->file = NULL;
+ trk->func = NULL;
/* Remove from "outstanding allocations" list */
if (trk == H5FL_out_head_g) {
@@ -443,8 +446,11 @@ H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS)
/* Copy allocation location information */
((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack();
HDassert(((H5FL_track_t *)ret_value)->stack);
- ((H5FL_track_t *)ret_value)->file = H5MM_strdup(call_file);
- ((H5FL_track_t *)ret_value)->func = H5MM_strdup(call_func);
+ /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ ((H5FL_track_t *)ret_value)->file = call_file;
+ ((H5FL_track_t *)ret_value)->func = call_func;
((H5FL_track_t *)ret_value)->line = call_line;
/* Add to "outstanding allocations" list */
@@ -625,7 +631,7 @@ H5FL__reg_term(void)
tmp = H5FL_reg_gc_head.first->next;
#ifdef H5FL_DEBUG
- HDprintf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_reg_gc_head.first->list->name,
+ HDprintf("%s: head->name = %s, head->allocated = %d\n", __func__, H5FL_reg_gc_head.first->list->name,
(int)H5FL_reg_gc_head.first->list->allocated);
#endif /* H5FL_DEBUG */
/* Check if the list has allocations outstanding */
@@ -908,8 +914,11 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS)
/* Copy allocation location information */
((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack();
HDassert(((H5FL_track_t *)ret_value)->stack);
- ((H5FL_track_t *)ret_value)->file = H5MM_strdup(call_file);
- ((H5FL_track_t *)ret_value)->func = H5MM_strdup(call_func);
+ /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ ((H5FL_track_t *)ret_value)->file = call_file;
+ ((H5FL_track_t *)ret_value)->func = call_func;
((H5FL_track_t *)ret_value)->line = call_line;
/* Add to "outstanding allocations" list */
@@ -1004,8 +1013,11 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block)
/* Free tracking information about the allocation location */
H5CS_close_stack(trk->stack);
- trk->file = H5MM_xfree(trk->file);
- trk->func = H5MM_xfree(trk->func);
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * and are not allocated, so there's no need to free them.
+ */
+ trk->file = NULL;
+ trk->func = NULL;
/* Remove from "outstanding allocations" list */
if (trk == H5FL_out_head_g) {
@@ -1120,14 +1132,20 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_
/* Release previous tracking information */
H5CS_close_stack(trk->stack);
- trk->file = H5MM_xfree(trk->file);
- trk->func = H5MM_xfree(trk->func);
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * and are not allocated, so there's no need to free them.
+ */
+ trk->file = NULL;
+ trk->func = NULL;
/* Store new tracking information */
trk->stack = H5CS_copy_stack();
HDassert(trk->stack);
- trk->file = H5MM_strdup(call_file);
- trk->func = H5MM_strdup(call_func);
+ /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ trk->file = call_file;
+ trk->func = call_func;
trk->line = call_line;
}
#endif /* H5FL_TRACK */
@@ -1303,7 +1321,7 @@ H5FL__blk_term(void)
tmp = H5FL_blk_gc_head.first->next;
#ifdef H5FL_DEBUG
- HDprintf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_blk_gc_head.first->pq->name,
+ HDprintf("%s: head->name = %s, head->allocated = %d\n", __func__, H5FL_blk_gc_head.first->pq->name,
(int)H5FL_blk_gc_head.first->pq->allocated);
#endif /* H5FL_DEBUG */
@@ -1763,7 +1781,7 @@ H5FL__arr_term(void)
/* Check if the list has allocations outstanding */
#ifdef H5FL_DEBUG
- HDprintf("%s: head->name = %s, head->allocated = %d\n", FUNC, H5FL_arr_gc_head.first->list->name,
+ HDprintf("%s: head->name = %s, head->allocated = %d\n", __func__, H5FL_arr_gc_head.first->list->name,
(int)H5FL_arr_gc_head.first->list->allocated);
#endif /* H5FL_DEBUG */
if (H5FL_arr_gc_head.first->list->allocated > 0) {
@@ -2017,8 +2035,11 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj)
/* Free tracking information about the allocation location */
H5CS_close_stack(trk->stack);
- trk->file = H5MM_xfree(trk->file);
- trk->func = H5MM_xfree(trk->func);
+ /* The 'func' & 'file' strings are statically allocated (by the compiler)
+ * and are not allocated, so there's no need to free them.
+ */
+ trk->file = NULL;
+ trk->func = NULL;
/* Remove from "outstanding allocations" list */
if (trk == H5FL_out_head_g) {
@@ -2120,8 +2141,11 @@ H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS)
/* Copy allocation location information */
((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack();
HDassert(((H5FL_track_t *)ret_value)->stack);
- ((H5FL_track_t *)ret_value)->file = H5MM_strdup(call_file);
- ((H5FL_track_t *)ret_value)->func = H5MM_strdup(call_func);
+ /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler)
+ * there's no need to duplicate them.
+ */
+ ((H5FL_track_t *)ret_value)->file = call_file;
+ ((H5FL_track_t *)ret_value)->func = call_func;
((H5FL_track_t *)ret_value)->line = call_line;
/* Add to "outstanding allocations" list */
@@ -2348,8 +2372,8 @@ H5FL__fac_term_all(void)
tmp = H5FL_fac_gc_head.first->next;
#ifdef H5FL_DEBUG
- HDprintf("%s: head->size = %d, head->allocated = %d\n", FUNC, (int)H5FL_fac_gc_head.first->list->size,
- (int)H5FL_fac_gc_head.first->list->allocated);
+ HDprintf("%s: head->size = %d, head->allocated = %d\n", __func__,
+ (int)H5FL_fac_gc_head.first->list->size, (int)H5FL_fac_gc_head.first->list->allocated);
#endif /* H5FL_DEBUG */
/* The list cannot have any allocations outstanding */
diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h
index 42581ac..381f977 100644
--- a/src/H5FLprivate.h
+++ b/src/H5FLprivate.h
@@ -51,7 +51,7 @@
/* #define H5FL_TRACK */
#ifdef H5FL_TRACK
/* Macro for inclusion in the free list allocation calls */
-#define H5FL_TRACK_INFO , __FILE__, FUNC, __LINE__
+#define H5FL_TRACK_INFO , __FILE__, __func__, __LINE__
/* Macro for inclusion in internal free list allocation calls */
#define H5FL_TRACK_INFO_INT , call_file, call_func, call_line
diff --git a/src/H5FS.c b/src/H5FS.c
index c85790c..cb18ab3 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -100,7 +100,7 @@ H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t
FUNC_ENTER_NOAPI(NULL)
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, nclasses);
+ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", __func__, nclasses);
#endif /* H5FS_DEBUG */
/* Check arguments. */
@@ -146,7 +146,7 @@ H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t
/* Set the return value */
ret_value = fspace;
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: fspace = %p, fspace->addr = %a\n", FUNC, fspace, fspace->addr);
+ HDfprintf(stderr, "%s: fspace = %p, fspace->addr = %a\n", __func__, fspace, fspace->addr);
#endif /* H5FS_DEBUG */
done:
@@ -155,7 +155,7 @@ done:
HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space header")
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value);
#endif /* H5FS_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS_create() */
@@ -183,7 +183,7 @@ H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class
FUNC_ENTER_NOAPI(NULL)
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Opening free space manager, fs_addr = %a, nclasses = %Zu\n", FUNC, fs_addr,
+ HDfprintf(stderr, "%s: Opening free space manager, fs_addr = %a, nclasses = %Zu\n", __func__, fs_addr,
nclasses);
#endif /* H5FS_DEBUG */
@@ -204,11 +204,11 @@ H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class
(fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, NULL, "unable to load free space header")
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: fspace->sect_addr = %a\n", FUNC, fspace->sect_addr);
- HDfprintf(stderr, "%s: fspace->sect_size = %Hu\n", FUNC, fspace->sect_size);
- HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", FUNC, fspace->alloc_sect_size);
- HDfprintf(stderr, "%s: fspace->sinfo = %p\n", FUNC, fspace->sinfo);
- HDfprintf(stderr, "%s: fspace->rc = %u\n", FUNC, fspace->rc);
+ HDfprintf(stderr, "%s: fspace->sect_addr = %a\n", __func__, fspace->sect_addr);
+ HDfprintf(stderr, "%s: fspace->sect_size = %Hu\n", __func__, fspace->sect_size);
+ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", __func__, fspace->alloc_sect_size);
+ HDfprintf(stderr, "%s: fspace->sinfo = %p\n", __func__, fspace->sinfo);
+ HDfprintf(stderr, "%s: fspace->rc = %u\n", __func__, fspace->rc);
#endif /* H5FS_DEBUG */
/* Increment the reference count on the free space manager header */
@@ -251,7 +251,7 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr)
FUNC_ENTER_NOAPI(FAIL)
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = %a\n", FUNC, fs_addr);
+ HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = %a\n", __func__, fs_addr);
#endif /* H5FS_DEBUG */
/* Check arguments. */
@@ -278,7 +278,7 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL,
"unable to check metadata cache status for free space section info")
- HDfprintf(stderr, "%s: fspace_status = %0x: ", FUNC, fspace_status);
+ HDfprintf(stderr, "%s: fspace_status = %0x: ", __func__, fspace_status);
if (fspace_status) {
hbool_t printed = FALSE;
@@ -321,7 +321,7 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr)
/* Delete serialized section storage, if there are any */
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: fspace->sect_addr = %a\n", FUNC, fspace->sect_addr);
+ HDfprintf(stderr, "%s: fspace->sect_addr = %a\n", __func__, fspace->sect_addr);
#endif /* H5FS_DEBUG */
if (fspace->serial_sect_count > 0) {
unsigned sinfo_status = 0; /* Free space section info's status in the metadata cache */
@@ -342,7 +342,7 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr)
HDassert(!(sinfo_status & H5AC_ES__IS_PROTECTED));
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Expunging free space section info from cache\n", FUNC);
+ HDfprintf(stderr, "%s: Expunging free space section info from cache\n", __func__);
#endif /* H5FS_DEBUG */
/* Evict the free space section info from the metadata cache */
/* (Free file space) */
@@ -361,12 +361,12 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr)
} /* end block */
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Done expunging free space section info from cache\n", FUNC);
+ HDfprintf(stderr, "%s: Done expunging free space section info from cache\n", __func__);
#endif /* H5FS_DEBUG */
} /* end if */
else {
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Deleting free space section info from file\n", FUNC);
+ HDfprintf(stderr, "%s: Deleting free space section info from file\n", __func__);
#endif /* H5FS_DEBUG */
/* Release the space in the file */
if (!H5F_IS_TMP_ADDR(f, fspace->sect_addr))
@@ -407,7 +407,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
HDassert(f);
HDassert(fspace);
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Entering, fspace = %p, fspace->addr = %a, fspace->sinfo = %p\n", FUNC, fspace,
+ HDfprintf(stderr, "%s: Entering, fspace = %p, fspace->addr = %a, fspace->sinfo = %p\n", __func__, fspace,
fspace->addr, fspace->sinfo);
#endif /* H5FS_DEBUG */
@@ -418,15 +418,15 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
HDfprintf(stderr,
"%s: fspace->tot_sect_count = %Hu, fspace->serial_sect_count = %Hu, fspace->sect_addr = "
"%a, fspace->rc = %u\n",
- FUNC, fspace->tot_sect_count, fspace->serial_sect_count, fspace->sect_addr, fspace->rc);
- HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", FUNC,
+ __func__, fspace->tot_sect_count, fspace->serial_sect_count, fspace->sect_addr, fspace->rc);
+ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_DEBUG */
/* If there are sections to serialize, update them */
/* (if the free space manager is persistent) */
if (fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) {
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC);
+ HDfprintf(stderr, "%s: Real sections to store in file\n", __func__);
#endif /* H5FS_DEBUG */
if (fspace->sinfo->dirty) {
/* Check if the section info is "floating" */
@@ -465,7 +465,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
} /* end if */
else {
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: NOT storing section info in file\n", FUNC);
+ HDfprintf(stderr, "%s: NOT storing section info in file\n", __func__);
#endif /* H5FS_DEBUG */
/* Check if space for the section info is allocated */
if (H5F_addr_defined(fspace->sect_addr)) {
@@ -474,7 +474,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
HDassert(H5F_addr_defined(fspace->addr));
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Section info allocated though\n", FUNC);
+ HDfprintf(stderr, "%s: Section info allocated though\n", __func__);
#endif /* H5FS_DEBUG */
/* Check if the section info is for the free space in the file */
/* (NOTE: This is the "bootstrapping" special case for the
@@ -486,12 +486,13 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
htri_t status; /* "can absorb" status for section into */
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Section info is for file free space\n", FUNC);
+ HDfprintf(stderr, "%s: Section info is for file free space\n", __func__);
#endif /* H5FS_DEBUG */
/* Try to shrink the file or absorb the section info into a block aggregator */
if (H5F_IS_TMP_ADDR(f, fspace->sect_addr)) {
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Section info in temp. address space went 'go away'\n", FUNC);
+ HDfprintf(stderr, "%s: Section info in temp. address space went 'go away'\n",
+ __func__);
#endif /* H5FS_DEBUG */
/* Reset section info in header */
fspace->sect_addr = HADDR_UNDEF;
@@ -512,12 +513,13 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
* header to record it
*/
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Section info can't 'go away', header will own it\n", FUNC);
+ HDfprintf(stderr, "%s: Section info can't 'go away', header will own it\n",
+ __func__);
#endif /* H5FS_DEBUG */
} /* end if */
else {
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Section info went 'go away'\n", FUNC);
+ HDfprintf(stderr, "%s: Section info went 'go away'\n", __func__);
#endif /* H5FS_DEBUG */
/* Reset section info in header */
fspace->sect_addr = HADDR_UNDEF;
@@ -536,7 +538,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
fspace->alloc_sect_size; /* Previous size of section info in file */
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Section info is NOT for file free space\n", FUNC);
+ HDfprintf(stderr, "%s: Section info is NOT for file free space\n", __func__);
#endif /* H5FS_DEBUG */
/* Reset section info in header */
fspace->sect_addr = HADDR_UNDEF;
@@ -576,7 +578,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace)
done:
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_value, fspace->rc);
+ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", __func__, ret_value, fspace->rc);
#endif /* H5FS_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS_close() */
@@ -709,7 +711,8 @@ H5FS__incr(H5FS_t *fspace)
FUNC_ENTER_PACKAGE
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fspace->addr, fspace->rc);
+ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", __func__, fspace->addr,
+ fspace->rc);
#endif /* H5FS_DEBUG */
/*
@@ -748,7 +751,8 @@ H5FS__decr(H5FS_t *fspace)
FUNC_ENTER_PACKAGE
#ifdef H5FS_DEBUG
- HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fspace->addr, fspace->rc);
+ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", __func__, fspace->addr,
+ fspace->rc);
#endif /* H5FS_DEBUG */
/*
diff --git a/src/H5FScache.c b/src/H5FScache.c
index 4212794..39f0333 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -248,7 +248,7 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len
fspace->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header signature")
image += H5_SIZEOF_MAGIC;
@@ -988,7 +988,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l
H5_CHECKED_ASSIGN(old_sect_size, size_t, fspace->sect_size, hsize_t);
/* Magic number */
- if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 6ba1bc3..c764932 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -123,7 +123,7 @@ H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace)
HDassert(f);
HDassert(fspace);
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr);
+ HDfprintf(stderr, "%s: fspace->addr = %a\n", __func__, fspace->addr);
#endif /* H5FS_SINFO_DEBUG */
/* Allocate the free space header */
@@ -136,10 +136,10 @@ H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace)
sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8;
sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size);
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size);
- HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr);
- HDfprintf(stderr, "%s: sinfo->nbins = %u\n", FUNC, sinfo->nbins);
- HDfprintf(stderr, "%s: sinfo->sect_off_size = %u, sinfo->sect_len_size = %u\n", FUNC,
+ HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", __func__, fspace->max_sect_size);
+ HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", __func__, fspace->max_sect_addr);
+ HDfprintf(stderr, "%s: sinfo->nbins = %u\n", __func__, sinfo->nbins);
+ HDfprintf(stderr, "%s: sinfo->sect_off_size = %u, sinfo->sect_len_size = %u\n", __func__,
sinfo->sect_off_size, sinfo->sect_len_size);
#endif /* H5FS_SINFO_DEBUG */
@@ -200,9 +200,9 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
FUNC_ENTER_STATIC
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Called, fspace->addr = %a, fspace->sinfo = %p, fspace->sect_addr = %a\n", FUNC,
+ HDfprintf(stderr, "%s: Called, fspace->addr = %a, fspace->sinfo = %p, fspace->sect_addr = %a\n", __func__,
fspace->addr, fspace->sinfo, fspace->sect_addr);
- HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", FUNC,
+ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_SINFO_DEBUG */
@@ -251,7 +251,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
HDassert(H5F_addr_defined(fspace->addr));
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", FUNC,
+ HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", __func__,
fspace->sect_addr);
#endif /* H5FS_SINFO_DEBUG */
/* Protect the free space sections */
@@ -267,7 +267,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
} /* end if */
else {
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Creating new section info\n", FUNC);
+ HDfprintf(stderr, "%s: Creating new section info\n", __func__);
#endif /* H5FS_SINFO_DEBUG */
/* Sanity check */
HDassert(fspace->tot_sect_count == 0);
@@ -289,9 +289,9 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode)
done:
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Leaving, fspace->addr = %a, fspace->sinfo = %p, fspace->sect_addr = %a\n", FUNC,
- fspace->addr, fspace->sinfo, fspace->sect_addr);
- HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", FUNC,
+ HDfprintf(stderr, "%s: Leaving, fspace->addr = %a, fspace->sinfo = %p, fspace->sect_addr = %a\n",
+ __func__, fspace->addr, fspace->sinfo, fspace->sect_addr);
+ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_SINFO_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
@@ -331,13 +331,13 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
FUNC_ENTER_STATIC
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Called, modified = %t, fspace->addr = %a, fspace->sect_addr = %a\n", FUNC,
+ HDfprintf(stderr, "%s: Called, modified = %t, fspace->addr = %a, fspace->sect_addr = %a\n", __func__,
modified, fspace->addr, fspace->sect_addr);
HDfprintf(
stderr,
"%s: fspace->sinfo_lock_count = %u, fspace->sinfo_modified = %t, fspace->sinfo_protected = %t\n",
- FUNC, fspace->sinfo_lock_count, fspace->sinfo_modified, fspace->sinfo_protected);
- HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", FUNC,
+ __func__, fspace->sinfo_lock_count, fspace->sinfo_modified, fspace->sinfo_protected);
+ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", __func__,
fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_SINFO_DEBUG */
@@ -413,7 +413,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
/* (Possibly dirty) */
/* (Possibly taking ownership from the cache) */
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Unprotecting section info, cache_flags = %u\n", FUNC, cache_flags);
+ HDfprintf(stderr, "%s: Unprotecting section info, cache_flags = %u\n", __func__, cache_flags);
#endif /* H5FS_SINFO_DEBUG */
if (H5AC_unprotect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info")
@@ -424,14 +424,14 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
/* Check if header is taking ownership of section info */
if ((cache_flags & H5AC__TAKE_OWNERSHIP_FLAG)) {
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Taking ownership of section info\n", FUNC);
+ HDfprintf(stderr, "%s: Taking ownership of section info\n", __func__);
#endif /* H5FS_SINFO_DEBUG */
/* Set flag to release section info space in file */
release_sinfo_space = TRUE;
} /* end if */
else {
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Relinquishing section info ownership\n", FUNC);
+ HDfprintf(stderr, "%s: Relinquishing section info ownership\n", __func__);
#endif /* H5FS_SINFO_DEBUG */
/* Free space header relinquished ownership of section info */
fspace->sinfo = NULL;
@@ -491,7 +491,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr,
"%s: Freeing section info on disk, old_sect_addr = %a, old_alloc_sect_size = %Hu\n",
- FUNC, old_sect_addr, old_alloc_sect_size);
+ __func__, old_sect_addr, old_alloc_sect_size);
#endif /* H5FS_SINFO_DEBUG */
/* Release space for section info in file */
if (!H5F_IS_TMP_ADDR(f, old_sect_addr))
@@ -502,7 +502,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified)
done:
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value);
#endif /* H5FS_SINFO_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS__sinfo_unlock() */
@@ -1343,7 +1343,7 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag
FUNC_ENTER_NOAPI(FAIL)
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: *sect = {%a, %Hu, %u, %s}\n", FUNC, sect->addr, sect->size, sect->type,
+ HDfprintf(stderr, "%s: *sect = {%a, %Hu, %u, %s}\n", __func__, sect->addr, sect->size, sect->type,
(sect->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
#endif /* H5FS_SINFO_DEBUG */
@@ -1367,7 +1367,7 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag
/* Check for merging returned space with existing section node */
if (flags & H5FS_ADD_RETURNED_SPACE) {
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Returning space\n", FUNC);
+ HDfprintf(stderr, "%s: Returning space\n", __func__);
#endif /* H5FS_SINFO_DEBUG */
/* Attempt to merge returned section with existing sections */
@@ -1384,7 +1384,7 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list")
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
+ HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", __func__, fspace->tot_space);
#endif /* H5FS_SINFO_DEBUG */
/* Mark free space sections as changed */
/* (if adding sections while deserializing sections, don't set the flag) */
@@ -1401,7 +1401,7 @@ done:
H5FS__assert(fspace);
#endif /* H5FS_DEBUG_ASSERT */
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value);
#endif /* H5FS_SINFO_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS_sect_add() */
@@ -1429,7 +1429,7 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize
FUNC_ENTER_NOAPI(FAIL)
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: addr = %a, size = %Hu, extra_requested = %hu\n", FUNC, addr, size,
+ HDfprintf(stderr, "%s: addr = %a, size = %Hu, extra_requested = %hu\n", __func__, addr, size,
extra_requested);
#endif /* H5FS_SINFO_DEBUG */
@@ -1442,9 +1442,9 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize
/* Check for any sections on free space list */
#ifdef H5FS_SINFO_DEBUG
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count);
- HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count);
- HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_sect_count);
+ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", __func__, fspace->tot_sect_count);
+ HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", __func__, fspace->serial_sect_count);
+ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", __func__, fspace->ghost_sect_count);
#endif /* H5FS_SINFO_DEBUG */
if (fspace->tot_sect_count > 0) {
H5FS_section_info_t *sect; /* Temporary free space section */
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index aed5812..4821272 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -36,7 +36,7 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
+#include "H5FDprivate.h" /* File drivers */
#include "H5MMprivate.h" /* Memory management */
#include "H5VMprivate.h" /* Vectors and arrays */
diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c
index b482961..ff6b4a0 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -89,10 +89,12 @@
herr_t
H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo /*out*/)
{
- H5VL_object_t *vol_obj = NULL;
- H5I_type_t type;
- H5F_info2_t finfo2; /* Current file info struct */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5I_type_t type;
+ H5F_info2_t finfo2; /* Current file info struct */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", obj_id, finfo);
@@ -111,9 +113,14 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo /*out*/)
if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set up VOL callback arguments */
+ file_opt_args.get_info.type = type;
+ file_opt_args.get_info.finfo = &finfo2;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_INFO;
+ vol_cb_args.args = &file_opt_args;
+
/* Get the file information */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- type, &finfo2) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info")
/* Copy the compatible fields into the older struct */
@@ -141,7 +148,9 @@ done:
htri_t
H5Fis_hdf5(const char *name)
{
- htri_t ret_value; /* Return value */
+ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ hbool_t is_accessible = FALSE; /* Whether file is accessible */
+ htri_t ret_value; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE1("t", "*s", name);
@@ -150,11 +159,19 @@ H5Fis_hdf5(const char *name)
if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, (-1), "no file name specified")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_IS_ACCESSIBLE;
+ vol_cb_args.args.is_accessible.filename = name;
+ vol_cb_args.args.is_accessible.fapl_id = H5P_FILE_ACCESS_DEFAULT;
+ vol_cb_args.args.is_accessible.accessible = &is_accessible;
+
/* Check if file is accessible */
- if (H5VL_file_specific(NULL, H5VL_FILE_IS_ACCESSIBLE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- H5P_FILE_ACCESS_DEFAULT, name, &ret_value) < 0)
+ if (H5VL_file_specific(NULL, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, (-1), "unable to determine if file is accessible as HDF5")
+ /* Set return value */
+ ret_value = (htri_t)is_accessible;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fis_hdf5() */
@@ -196,10 +213,11 @@ done:
herr_t
H5Fset_latest_format(hid_t file_id, hbool_t latest_format)
{
- H5VL_object_t *vol_obj; /* File as VOL object */
- H5F_libver_t low = H5F_LIBVER_LATEST; /* Low bound */
- H5F_libver_t high = H5F_LIBVER_LATEST; /* High bound */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* File as VOL object */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ H5F_libver_t low = H5F_LIBVER_LATEST; /* Low bound */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ib", file_id, latest_format);
@@ -218,9 +236,14 @@ H5Fset_latest_format(hid_t file_id, hbool_t latest_format)
if (!latest_format)
low = H5F_LIBVER_EARLIEST;
+ /* Set up VOL callback arguments */
+ file_opt_args.set_libver_bounds.low = low;
+ file_opt_args.set_libver_bounds.high = H5F_LIBVER_LATEST;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS;
+ vol_cb_args.args = &file_opt_args;
+
/* Set the library's version bounds */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)low, (int)high) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set library version bounds")
done:
diff --git a/src/H5Fefc.c b/src/H5Fefc.c
index 3f9a22f..2d4eff2 100644
--- a/src/H5Fefc.c
+++ b/src/H5Fefc.c
@@ -36,10 +36,10 @@
#include "H5Pprivate.h" /* Property lists */
/* Special values for the "tag" field below */
-#define H5F_EFC_TAG_DEFAULT -1
-#define H5F_EFC_TAG_LOCK -2
-#define H5F_EFC_TAG_CLOSE -3
-#define H5F_EFC_TAG_DONTCLOSE -4
+#define H5F_EFC_TAG_DEFAULT (-1)
+#define H5F_EFC_TAG_LOCK (-2)
+#define H5F_EFC_TAG_CLOSE (-3)
+#define H5F_EFC_TAG_DONTCLOSE (-4)
/* Structure for each entry in a file's external file cache */
typedef struct H5F_efc_ent_t {
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 920bf51..c2d3e77 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -81,6 +81,7 @@ static herr_t H5F__build_name(const char *prefix, const char *file_name, char **
static char * H5F__getenv_prefix_name(char **env_prefix /*in,out*/);
static H5F_t *H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf);
static herr_t H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking);
+static herr_t H5F__dest(H5F_t *f, hbool_t flush);
static herr_t H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name,
char ** /*out*/ actual_name);
static herr_t H5F__flush_phase1(H5F_t *f);
@@ -1056,9 +1057,10 @@ done:
htri_t
H5F__is_hdf5(const char *name, hid_t fapl_id)
{
- H5FD_t *file = NULL; /* Low-level file struct */
- haddr_t sig_addr = HADDR_UNDEF; /* Addess of hdf5 file signature */
- htri_t ret_value = FAIL; /* Return value */
+ H5FD_t * file = NULL; /* Low-level file struct */
+ H5F_shared_t *shared = NULL; /* Shared part of file */
+ haddr_t sig_addr = HADDR_UNDEF; /* Addess of hdf5 file signature */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -1069,10 +1071,20 @@ H5F__is_hdf5(const char *name, hid_t fapl_id)
if (NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, fapl_id, HADDR_UNDEF)))
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to open file")
- /* The file is an hdf5 file if the hdf5 file signature can be found */
- if (H5FD_locate_signature(file, &sig_addr) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "error while trying to locate file signature")
- ret_value = (HADDR_UNDEF != sig_addr);
+ /* If the file is already open, it's an HDF5 file
+ *
+ * If the file is open with an exclusive lock on an operating system that enforces
+ * mandatory file locks (like Windows), creating a new file handle and attempting
+ * to read through it will fail so we have to try this first.
+ */
+ if ((shared = H5F__sfile_search(file)) != NULL)
+ ret_value = TRUE;
+ else {
+ /* The file is an HDF5 file if the HDF5 file signature can be found */
+ if (H5FD_locate_signature(file, &sig_addr) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "error while trying to locate file signature")
+ ret_value = (HADDR_UNDEF != sig_addr);
+ }
done:
/* Close the file */
@@ -1368,12 +1380,12 @@ done:
* Return: SUCCEED/FAIL
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5F__dest(H5F_t *f, hbool_t flush)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -1782,7 +1794,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
FUNC_ENTER_NOAPI(NULL)
/*
- * If the driver has a `cmp' method then the driver is capable of
+ * If the driver has a 'cmp' method then the driver is capable of
* determining when two file handles refer to the same file and the
* library can insure that when the application opens a file twice
* that the two handles coordinate their operations appropriately.
@@ -2340,6 +2352,31 @@ done:
} /* end H5F__close() */
/*-------------------------------------------------------------------------
+ * Function: H5F_delete
+ *
+ * Purpose: Deletes a file.
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F__delete(const char *filename, hid_t fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ HDassert(filename);
+
+ /* Delete the file */
+ if (H5FD_delete(filename, fapl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F__delete() */
+
+/*-------------------------------------------------------------------------
* Function: H5F_try_close
*
* Purpose: Attempts to close a file due to one of several actions:
@@ -2501,11 +2538,6 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/)
if (H5F__efc_try_close(f) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't attempt to close EFC")
- /* Delay flush until the shared file struct is closed, in H5F__dest. If the
- * application called H5Fclose, it would have been flushed in that function
- * (unless it will have been flushed in H5F__dest anyways).
- */
-
/* Destroy the H5F_t struct and decrement the reference count for the
* shared H5F_shared_t struct. If the reference count for the H5F_shared_t
* struct reaches zero then destroy it also.
@@ -3077,27 +3109,28 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F__get_file_image
*
- * Purpose: Private version of H5Fget_file_image
+ * Purpose: Private version of H5Fget_file_image, returns bytes copied/
+ * number of bytes needed in *image_len.
+ *
+ * Return: SUCCEED/FAIL
*
- * Return: Success: Bytes copied / number of bytes needed.
- * Failure: -1
*-------------------------------------------------------------------------
*/
-ssize_t
-H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
+herr_t
+H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, size_t *image_len)
{
- H5FD_t *fd_ptr; /* file driver */
- haddr_t eoa; /* End of file address */
- ssize_t ret_value = -1; /* Return value */
+ H5FD_t *fd_ptr; /* file driver */
+ haddr_t eoa; /* End of file address */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
/* Check args */
if (!file || !file->shared || !file->shared->lf)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, (-1), "file_id yields invalid file pointer")
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file_id yields invalid file pointer")
fd_ptr = file->shared->lf;
if (!fd_ptr->cls)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, (-1), "fd_ptr yields invalid class pointer")
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "fd_ptr yields invalid class pointer")
/* the address space used by the split and multi file drivers is not
* a good fit for this call. Since the plan is to depreciate these
@@ -3118,7 +3151,7 @@ H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
* JRM -- 11/11/22
*/
if (HDstrcmp(fd_ptr->cls->name, "multi") == 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "Not supported for multi file driver.")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not supported for multi file driver.")
/* While the family file driver is conceptually fully compatible
* with the get file image operation, it sets a file driver message
@@ -3126,7 +3159,7 @@ H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
* driver other than the family file driver. Needless to say, this
* rather defeats the purpose of the get file image operation.
*
- * While this problem is quire solvable, the required time and
+ * While this problem is quite solvable, the required time and
* resources are lacking at present. Hence, for now, we don't
* allow the get file image operation to be perfomed on files
* opened with the family file driver.
@@ -3140,30 +3173,24 @@ H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
* JRM -- 12/21/11
*/
if (HDstrcmp(fd_ptr->cls->name, "family") == 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, (-1), "Not supported for family file driver.")
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "Not supported for family file driver.")
/* Go get the actual file size */
if (HADDR_UNDEF == (eoa = H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file size")
-
- /* set ret_value = to eoa -- will overwrite this if appropriate */
- ret_value = (ssize_t)eoa;
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size")
- /* test to see if a buffer was provided -- if not, we are done */
+ /* Test to see if a buffer was provided */
if (buf_ptr != NULL) {
- size_t space_needed; /* size of file image */
unsigned tmp, tmp_size;
/* Check for buffer too small */
if ((haddr_t)buf_len < eoa)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, (-1), "supplied buffer too small")
-
- space_needed = (size_t)eoa;
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "supplied buffer too small")
- /* read in the file image */
+ /* Read in the file image */
/* (Note compensation for base address addition in internal routine) */
- if (H5FD_read(fd_ptr, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_READERROR, (-1), "file image read request failed")
+ if (H5FD_read(fd_ptr, H5FD_MEM_DEFAULT, 0, (size_t)eoa, buf_ptr) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_READERROR, FAIL, "file image read request failed")
/* Offset to "status_flags" in the superblock */
tmp = H5F_SUPER_STATUS_FLAGS_OFF(file->shared->sblock->super_vers);
@@ -3175,6 +3202,9 @@ H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
HDmemset((uint8_t *)buf_ptr + tmp, 0, tmp_size);
} /* end if */
+ /* Set *image_len = to EOA */
+ *image_len = (size_t)eoa;
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F__get_file_image() */
@@ -3718,10 +3748,17 @@ H5F__start_swmr_write(H5F_t *f)
setup = TRUE;
/* Place an advisory lock on the file */
- if (H5F_USE_FILE_LOCKING(f))
+ if (H5F_USE_FILE_LOCKING(f)) {
+ /* Have to unlock on Windows as Win32 doesn't support changing the lock
+ * type (exclusive vs shared) with a second call.
+ */
+ if (H5FD_unlock(f->shared->lf) < 0) {
+ HGOTO_ERROR(H5E_FILE, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock the file")
+ }
if (H5FD_lock(f->shared->lf, TRUE) < 0) {
HGOTO_ERROR(H5E_FILE, H5E_CANTLOCKFILE, FAIL, "unable to lock the file")
}
+ }
/* Mark superblock as dirty */
if (H5F_super_dirty(f) < 0)
@@ -3863,11 +3900,12 @@ done:
hid_t
H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref)
{
- void * vol_obj_file = NULL; /* File object pointer */
- H5VL_loc_params_t loc_params; /* Location parameters */
- hid_t file_id = H5I_INVALID_HID; /* File ID for object */
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ void * vol_obj_file = NULL; /* File object pointer */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ hid_t file_id = H5I_INVALID_HID; /* File ID for object */
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
@@ -3875,9 +3913,12 @@ H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref)
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = obj_type;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_FILE;
+ vol_cb_args.args.get_file.file = &vol_obj_file;
+
/* Retrieve VOL file from object */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_FILE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &vol_obj_file) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file from object")
/* Check if the file's ID already exists */
diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h
index 33c302a..81c1ede 100644
--- a/src/H5Fmodule.h
+++ b/src/H5Fmodule.h
@@ -29,10 +29,43 @@
#define H5_MY_PKG_ERR H5E_FILE
#define H5_MY_PKG_INIT YES
-/**
- * \defgroup H5F H5F
- * \brief File Interface
- * \todo Describe concisely what the functions in this module are about.
+/**\defgroup H5F H5F
+ *
+ * Use the functions in this module to manage HDF5 files.
+ *
+ * In the code snippets below, we show the skeletal life cycle of an HDF5 file,
+ * when creating a new file (left) or when opening an existing file (right).
+ * File creation is essentially controlled through \ref FCPL, and file access to
+ * new and existing files is controlled through \ref FAPL. The file \c name and
+ * creation or access \c mode control the interaction with the underlying
+ * storage such as file systems.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5F_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5F_examples.c read
+ * </td>
+ * </tr>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5F_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5F_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * In addition to general file management functions, there are three categories
+ * of functions that deal with advanced file management tasks and use cases:
+ * 1. The control of the HDF5 \ref MDC
+ * 2. The use of (MPI-) \ref PH5F HDF5
+ * 3. The \ref SWMR pattern
*
* \defgroup MDC Metadata Cache
* \ingroup H5F
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index f107c98..4b90ea3 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -83,7 +83,7 @@ done:
} /* end H5F__close_mounts() */
/*-------------------------------------------------------------------------
- * Function: H5F__mount
+ * Function: H5F_mount
*
* Purpose: Mount file CHILD onto the group specified by LOC and NAME,
* using mount properties in PLIST. CHILD must not already be
@@ -97,7 +97,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED plist_id)
+H5F_mount(const H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED plist_id)
{
H5G_t * mount_point = NULL; /*mount point group */
H5F_t * ancestor = NULL; /*ancestor files */
@@ -110,7 +110,7 @@ H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED
H5G_loc_t root_loc; /* Group location of root of file to mount */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(loc);
HDassert(name && *name);
@@ -157,10 +157,9 @@ H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED
HDassert(mp_loc.oloc);
mp_loc.path = H5G_nameof(mount_point);
HDassert(mp_loc.path);
- for (ancestor = parent; ancestor; ancestor = ancestor->parent) {
+ for (ancestor = parent; ancestor; ancestor = ancestor->parent)
if (ancestor->shared == child->shared)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount would introduce a cycle")
- }
/* Make certain that the parent & child files have the same "file close degree" */
if (parent->shared->fc_degree != child->shared->fc_degree)
@@ -240,10 +239,10 @@ done:
}
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F__mount() */
+} /* end H5F_mount() */
/*-------------------------------------------------------------------------
- * Function: H5F__unmount
+ * Function: H5F_unmount
*
* Purpose: Unmount the child which is mounted at the group specified by
* LOC and NAME or fail if nothing is mounted there. Neither
@@ -261,7 +260,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__unmount(H5G_loc_t *loc, const char *name)
+H5F_unmount(const H5G_loc_t *loc, const char *name)
{
H5G_t * child_group = NULL; /* Child's group in parent mtab */
H5F_t * child = NULL; /*mounted file */
@@ -275,7 +274,7 @@ H5F__unmount(H5G_loc_t *loc, const char *name)
int child_idx; /* Index of child in parent's mtab */
herr_t ret_value = SUCCEED; /*return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(loc);
HDassert(name && *name);
@@ -291,7 +290,7 @@ H5F__unmount(H5G_loc_t *loc, const char *name)
* then we must have found the mount point.
*/
if (H5G_loc_find(loc, name, &mp_loc /*out*/) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found")
+ HGOTO_ERROR(H5E_FILE, H5E_NOTFOUND, FAIL, "group not found")
mp_loc_setup = TRUE;
child = mp_loc.oloc->file;
mnt_oloc = H5G_oloc(child->shared->root_grp);
@@ -364,7 +363,7 @@ H5F__unmount(H5G_loc_t *loc, const char *name)
/* Search the open IDs replace names to reflect unmount operation */
if (H5G_name_replace(NULL, H5G_NAME_UNMOUNT, mp_loc.oloc->file, mp_loc.path->full_path_r,
root_loc.oloc->file, root_loc.path->full_path_r) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to replace name")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to replace name")
/* Eliminate the mount point from the table */
HDmemmove(parent->shared->mtab.child + (unsigned)child_idx,
@@ -376,7 +375,7 @@ H5F__unmount(H5G_loc_t *loc, const char *name)
/* Unmount the child file from the parent file */
if (H5G_unmount(child_group) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to reset group mounted flag")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to reset group mounted flag")
if (H5G_close(child_group) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close unmounted group")
@@ -391,7 +390,7 @@ done:
H5G_loc_free(&mp_loc);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F__unmount() */
+} /* end H5F_unmount() */
/*-------------------------------------------------------------------------
* Function: H5F_is_mount
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index 3336d4f..53d2d78 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -68,35 +68,6 @@
/*******************/
#ifdef H5_HAVE_PARALLEL
-
-/*-------------------------------------------------------------------------
- * Function: H5F_get_mpi_handle
- *
- * Purpose: Retrieves MPI File handle.
- *
- * Return: Success: The size (positive)
- * Failure: Negative
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5F_get_mpi_handle(const H5F_t *f, MPI_File **f_handle)
-{
- herr_t ret_value = SUCCEED;
- hid_t fapl_id = H5I_INVALID_HID;
-
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert(f && f->shared);
-
- /* Dispatch to driver */
- if ((ret_value = H5FD_get_vfd_handle(f->shared->lf, fapl_id, (void **)f_handle)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file handle")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_get_mpi_handle() */
-
/*-------------------------------------------------------------------------
* Function: H5F_mpi_get_rank
*
@@ -222,7 +193,7 @@ done:
} /* end H5F_mpi_get_size() */
/*-------------------------------------------------------------------------
- * Function: H5F_set_mpi_atomicity
+ * Function: H5F__set_mpi_atomicity
*
* Purpose: Private call to set the atomicity mode
*
@@ -231,11 +202,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_set_mpi_atomicity(H5F_t *file, hbool_t flag)
+H5F__set_mpi_atomicity(H5F_t *file, hbool_t flag)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL);
+ FUNC_ENTER_PACKAGE
/* Check args */
HDassert(file);
@@ -251,7 +222,7 @@ H5F_set_mpi_atomicity(H5F_t *file, hbool_t flag)
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5F_set_mpi_atomicity() */
+} /* end H5F__set_mpi_atomicity() */
/*-------------------------------------------------------------------------
* Function: H5Fset_mpi_atomicity
@@ -269,9 +240,10 @@ done:
herr_t
H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag)
{
- H5VL_object_t *vol_obj = NULL;
- int va_flag = (int)flag; /* C is grumpy about passing hbool_t via va_arg */
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL);
H5TRACE2("e", "ib", file_id, flag);
@@ -280,9 +252,13 @@ H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier");
+ /* Set up VOL callback arguments */
+ file_opt_args.set_mpi_atomicity.flag = flag;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_SET_MPI_ATOMICITY;
+ vol_cb_args.args = &file_opt_args;
+
/* Set atomicity value */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_SET_MPI_ATOMICITY, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, va_flag) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set MPI atomicity");
done:
@@ -290,7 +266,7 @@ done:
} /* end H5Fset_mpi_atomicity() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_mpi_atomicity
+ * Function: H5F__get_mpi_atomicity
*
* Purpose: Private call to get the atomicity mode
*
@@ -299,11 +275,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_get_mpi_atomicity(H5F_t *file, hbool_t *flag)
+H5F__get_mpi_atomicity(const H5F_t *file, hbool_t *flag)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL);
+ FUNC_ENTER_PACKAGE
/* Check args */
HDassert(file);
@@ -320,7 +296,7 @@ H5F_get_mpi_atomicity(H5F_t *file, hbool_t *flag)
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5F_get_mpi_atomicity() */
+} /* end H5F__get_mpi_atomicity() */
/*-------------------------------------------------------------------------
* Function: H5Fget_mpi_atomicity
@@ -338,8 +314,10 @@ done:
herr_t
H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag /*out*/)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj; /* File info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_file_optional_args_t file_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL);
H5TRACE2("e", "ix", file_id, flag);
@@ -348,9 +326,13 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier");
+ /* Set up VOL callback arguments */
+ file_opt_args.get_mpi_atomicity.flag = flag;
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_GET_MPI_ATOMICITY;
+ vol_cb_args.args = &file_opt_args;
+
/* Get atomicity value */
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MPI_ATOMICITY, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, flag) < 0)
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MPI atomicity");
done:
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 371260d..b016696 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -33,6 +33,7 @@
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Bprivate.h" /* B-trees */
+#include "H5FDprivate.h" /* File drivers */
#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
#include "H5FSprivate.h" /* File free space */
@@ -404,22 +405,20 @@ H5_DLLVAR htri_t use_locks_env_g;
/* General routines */
H5_DLL herr_t H5F__post_open(H5F_t *f);
-H5_DLL H5F_t * H5F__reopen(H5F_t *f);
-H5_DLL herr_t H5F__dest(H5F_t *f, hbool_t flush);
-H5_DLL herr_t H5F__flush(H5F_t *f);
-H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t fapl_id);
-H5_DLL ssize_t H5F__get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len);
-H5_DLL herr_t H5F__get_info(H5F_t *f, H5F_info2_t *finfo);
-H5_DLL herr_t H5F__format_convert(H5F_t *f);
-H5_DLL herr_t H5F__start_swmr_write(H5F_t *f);
-H5_DLL herr_t H5F__close(H5F_t *f);
-H5_DLL herr_t H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high);
-H5_DLL herr_t H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info);
-H5_DLL herr_t H5F__parse_file_lock_env_var(htri_t *use_locks);
+H5_DLL H5F_t *H5F__reopen(H5F_t *f);
+H5_DLL herr_t H5F__flush(H5F_t *f);
+H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t fapl_id);
+H5_DLL herr_t H5F__get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, size_t *image_len);
+H5_DLL herr_t H5F__get_info(H5F_t *f, H5F_info2_t *finfo);
+H5_DLL herr_t H5F__format_convert(H5F_t *f);
+H5_DLL herr_t H5F__start_swmr_write(H5F_t *f);
+H5_DLL herr_t H5F__close(H5F_t *f);
+H5_DLL herr_t H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high);
+H5_DLL herr_t H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info);
+H5_DLL herr_t H5F__parse_file_lock_env_var(htri_t *use_locks);
+H5_DLL herr_t H5F__delete(const char *filename, hid_t fapl_id);
/* File mount related routines */
-H5_DLL herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id);
-H5_DLL herr_t H5F__unmount(H5G_loc_t *loc, const char *name);
H5_DLL herr_t H5F__close_mounts(H5F_t *f);
H5_DLL herr_t H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs);
@@ -449,6 +448,12 @@ H5_DLL herr_t H5F__sfile_add(H5F_shared_t *shared);
H5_DLL H5F_shared_t *H5F__sfile_search(H5FD_t *lf);
H5_DLL herr_t H5F__sfile_remove(H5F_shared_t *shared);
+/* Parallel I/O (i.e. MPI) related routines */
+#ifdef H5_HAVE_PARALLEL
+H5_DLL herr_t H5F__get_mpi_atomicity(const H5F_t *file, hbool_t *flag);
+H5_DLL herr_t H5F__set_mpi_atomicity(H5F_t *file, hbool_t flag);
+#endif /* H5_HAVE_PARALLEL */
+
/* External file cache routines */
H5_DLL H5F_efc_t *H5F__efc_create(unsigned max_nfiles);
H5_DLL H5F_t * H5F__efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id);
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 2779a2b..a6c2f8a 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -755,6 +755,7 @@ typedef struct H5F_t H5F_t;
/* Forward declarations (for prototypes & type definitions) */
struct H5B_class_t;
struct H5UC_t;
+struct H5G_loc_t;
struct H5O_loc_t;
struct H5HG_heap_t;
struct H5VL_class_t;
@@ -908,7 +909,9 @@ H5_DLL haddr_t H5F_shared_get_eoa(const H5F_shared_t *f_sh, H5FD_mem_t type);
H5_DLL haddr_t H5F_get_eoa(const H5F_t *f, H5FD_mem_t type);
H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_handle);
-/* Functions that check file mounting information */
+/* File mounting routines */
+H5_DLL herr_t H5F_mount(const struct H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id);
+H5_DLL herr_t H5F_unmount(const struct H5G_loc_t *loc, const char *name);
H5_DLL hbool_t H5F_is_mount(const H5F_t *file);
H5_DLL hbool_t H5F_has_mount(const H5F_t *file);
H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc /*in,out*/);
@@ -966,14 +969,11 @@ H5_DLL herr_t H5F_eoa_dirty(H5F_t *f);
/* Parallel I/O (i.e. MPI) related routines */
#ifdef H5_HAVE_PARALLEL
-H5_DLL herr_t H5F_get_mpi_handle(const H5F_t *f, MPI_File **f_handle);
H5_DLL int H5F_mpi_get_rank(const H5F_t *f);
H5_DLL MPI_Comm H5F_mpi_get_comm(const H5F_t *f);
H5_DLL int H5F_shared_mpi_get_size(const H5F_shared_t *f_sh);
H5_DLL int H5F_mpi_get_size(const H5F_t *f);
H5_DLL herr_t H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm);
-H5_DLL herr_t H5F_get_mpi_atomicity(H5F_t *file, hbool_t *flag);
-H5_DLL herr_t H5F_set_mpi_atomicity(H5F_t *file, hbool_t flag);
#endif /* H5_HAVE_PARALLEL */
/* External file cache routines */
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index 24fe350..c3230e1 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -47,27 +47,23 @@
* We're assuming that these constants are used rather early in the hdf5
* session.
*/
-#define H5F_ACC_RDONLY (H5CHECK H5OPEN 0x0000u) /**< absence of rdwr => rd-only */
-#define H5F_ACC_RDWR (H5CHECK H5OPEN 0x0001u) /**< open for read and write */
-#define H5F_ACC_TRUNC (H5CHECK H5OPEN 0x0002u) /**< overwrite existing files */
-#define H5F_ACC_EXCL (H5CHECK H5OPEN 0x0004u) /**< fail if file already exists*/
+#define H5F_ACC_RDONLY (H5CHECK H5OPEN 0x0000u) /**< Absence of RDWR: read-only */
+#define H5F_ACC_RDWR (H5CHECK H5OPEN 0x0001u) /**< Open for read and write */
+#define H5F_ACC_TRUNC (H5CHECK H5OPEN 0x0002u) /**< Overwrite existing files */
+#define H5F_ACC_EXCL (H5CHECK H5OPEN 0x0004u) /**< Fail if file already exists*/
/* NOTE: 0x0008u was H5F_ACC_DEBUG, now deprecated */
-#define H5F_ACC_CREAT (H5CHECK H5OPEN 0x0010u) /**< create non-existing files */
+#define H5F_ACC_CREAT (H5CHECK H5OPEN 0x0010u) /**< Create non-existing files */
#define H5F_ACC_SWMR_WRITE \
- (H5CHECK 0x0020u) /**< indicate that this file is open for writing in a \
- single-writer/multi-reader (SWMR) scenario. \
- Note that the process(es) opening the file for reading must \
- open the file with RDONLY access, and use the special "SWMR_READ" \
- access flag. */
+ (H5CHECK 0x0020u) /**< Indicate that this file is open for writing in a \
+ * single-writer/multi-reader (SWMR) scenario. \
+ * Note that the process(es) opening the file for reading \
+ * must open the file with #H5F_ACC_RDONLY and use the \
+ * #H5F_ACC_SWMR_READ access flag. */
#define H5F_ACC_SWMR_READ \
- (H5CHECK 0x0040u) /**< indicate that this file is \
- * open for reading in a \
- * single-writer/multi-reader (SWMR) \
- * scenario. Note that the \
- * process(es) opening the file \
- * for SWMR reading must also \
- * open the file with the RDONLY \
- * flag. */
+ (H5CHECK 0x0040u) /**< Indicate that this file is open for reading in a \
+ * single-writer/multi-reader (SWMR) scenario. Note that \
+ * the process(es) opening the file for SWMR reading must \
+ * also open the file with the #H5F_ACC_RDONLY flag. */
/**
* Default property list identifier
@@ -88,10 +84,10 @@
(0x0020u) /**< Restrict search to objects opened through current file ID \
(as opposed to objects opened through any file ID accessing this file) */
-#define H5F_FAMILY_DEFAULT (hsize_t)0
+#define H5F_FAMILY_DEFAULT 0 /* (hsize_t) */
#ifdef H5_HAVE_PARALLEL
-/*
+/**
* Use this constant string as the MPI_Info key to set H5Fmpio debug flags.
* To turn on H5Fmpio debug flags, set the MPI_Info value with this key to
* have the value of a string consisting of the characters that turn on the
@@ -101,32 +97,33 @@
#endif /* H5_HAVE_PARALLEL */
/**
- * The difference between a single file and a set of mounted files
+ * The scope of an operation such as H5Fflush(), e.g.,
+ * a single file vs. a set of mounted files
*/
typedef enum H5F_scope_t {
- H5F_SCOPE_LOCAL = 0, /**< specified file handle only */
- H5F_SCOPE_GLOBAL = 1 /**< entire virtual file */
+ H5F_SCOPE_LOCAL = 0, /**< The specified file handle only */
+ H5F_SCOPE_GLOBAL = 1 /**< The entire virtual file */
} H5F_scope_t;
/**
* Unlimited file size for H5Pset_external()
*/
-#define H5F_UNLIMITED ((hsize_t)(-1L))
+#define H5F_UNLIMITED HSIZE_UNDEF
/**
* How does file close behave?
*/
typedef enum H5F_close_degree_t {
- H5F_CLOSE_DEFAULT = 0, /**< Use the degree pre-defined by underlining VFL */
+ H5F_CLOSE_DEFAULT = 0, /**< Use the degree pre-defined by underlying VFD */
H5F_CLOSE_WEAK = 1, /**< File closes only after all opened objects are closed */
- H5F_CLOSE_SEMI = 2, /**< If no opened objects, file is close; otherwise, file close fails */
+ H5F_CLOSE_SEMI = 2, /**< If no opened objects, file is closed; otherwise, file close fails */
H5F_CLOSE_STRONG = 3 /**< If there are opened objects, close them first, then close file */
} H5F_close_degree_t;
/**
* Current "global" information about file
*/
-//! [H5F_info2_t_snip]
+//! <!-- [H5F_info2_t_snip] -->
typedef struct H5F_info2_t {
struct {
unsigned version; /**< Superblock version # */
@@ -144,7 +141,7 @@ typedef struct H5F_info2_t {
H5_ih_info_t msgs_info; /**< Shared object header message index & heap size */
} sohm;
} H5F_info2_t;
-//! [H5F_info2_t_snip]
+//! <!-- [H5F_info2_t_snip] -->
/**
* Types of allocation requests. The values larger than #H5FD_MEM_DEFAULT
@@ -176,12 +173,12 @@ typedef enum H5F_mem_t {
/**
* Free space section information
*/
-//! [H5F_sect_info_t_snip]
+//! <!-- [H5F_sect_info_t_snip] -->
typedef struct H5F_sect_info_t {
haddr_t addr; /**< Address of free space section */
hsize_t size; /**< Size of free space section */
} H5F_sect_info_t;
-//! [H5F_sect_info_t_snip]
+//! <!-- [H5F_sect_info_t_snip] -->
/**
* Library's format versions
@@ -193,7 +190,7 @@ typedef enum H5F_libver_t {
H5F_LIBVER_V110 = 2, /**< Use the latest v110 format for storing objects */
H5F_LIBVER_V112 = 3, /**< Use the latest v112 format for storing objects */
H5F_LIBVER_V114 = 4, /**< Use the latest v114 format for storing objects */
- H5F_LIBVER_NBOUNDS
+ H5F_LIBVER_NBOUNDS /**< Sentinel */
} H5F_libver_t;
#define H5F_LIBVER_LATEST H5F_LIBVER_V114
@@ -201,7 +198,7 @@ typedef enum H5F_libver_t {
/**
* File space handling strategy
*/
-//! [H5F_fspace_strategy_t_snip]
+//! <!-- [H5F_fspace_strategy_t_snip] -->
typedef enum H5F_fspace_strategy_t {
H5F_FSPACE_STRATEGY_FSM_AGGR = 0, /**< Mechanisms: free-space managers, aggregators, and virtual file
drivers This is the library default when not set */
@@ -211,7 +208,7 @@ typedef enum H5F_fspace_strategy_t {
H5F_FSPACE_STRATEGY_NONE = 3, /**< Mechanisms: virtual file drivers */
H5F_FSPACE_STRATEGY_NTYPES /**< Sentinel */
} H5F_fspace_strategy_t;
-//! [H5F_fspace_strategy_t_snip]
+//! <!-- [H5F_fspace_strategy_t_snip] -->
/**
* File space handling strategy for release 1.10.0
@@ -228,7 +225,7 @@ typedef enum H5F_file_space_type_t {
H5F_FILE_SPACE_NTYPES /**< Sentinel */
} H5F_file_space_type_t;
-//! [H5F_retry_info_t_snip]
+//! <!-- [H5F_retry_info_t_snip] -->
#define H5F_NUM_METADATA_READ_RETRY_TYPES 21
/**
@@ -239,7 +236,7 @@ typedef struct H5F_retry_info_t {
unsigned nbins;
uint32_t *retries[H5F_NUM_METADATA_READ_RETRY_TYPES];
} H5F_retry_info_t;
-//! [H5F_retry_info_t_snip]
+//! <!-- [H5F_retry_info_t_snip] -->
/**
* Callback for H5Pset_object_flush_cb() in a file access property list
@@ -277,11 +274,6 @@ extern "C" {
*/
H5_DLL htri_t H5Fis_accessible(const char *container_name, hid_t fapl_id);
/**
- * \example H5Fcreate.c
- * After creating an HDF5 file with H5Fcreate(), we close it with
- * H5Fclose().
- */
-/**
* \ingroup H5F
*
* \brief Creates an HDF5 file
@@ -321,7 +313,8 @@ H5_DLL htri_t H5Fis_accessible(const char *container_name, hid_t fapl_id);
* this file identifier should be closed by calling H5Fclose() when
* it is no longer needed.
*
- * \include H5Fcreate.c
+ * \par Example
+ * \snippet H5F_examples.c minimal
*
* \note #H5F_ACC_TRUNC and #H5F_ACC_EXCL are mutually exclusive; use
* exactly one.
@@ -359,6 +352,11 @@ H5_DLL htri_t H5Fis_accessible(const char *container_name, hid_t fapl_id);
*
*/
H5_DLL hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Fcreate}
+ */
H5_DLL hid_t H5Fcreate_async(const char *app_file, const char *app_func, unsigned app_line,
const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t es_id);
/**
@@ -408,6 +406,9 @@ H5_DLL hid_t H5Fcreate_async(const char *app_file, const char *app_func, unsigne
* identifier should be closed by calling H5Fclose() when it is no
* longer needed.
*
+ * \par Example
+ * \snippet H5F_examples.c open
+ *
* \note #H5F_ACC_RDWR and #H5F_ACC_RDONLY are mutually exclusive; use
* exactly one.
*
@@ -451,6 +452,11 @@ H5_DLL hid_t H5Fcreate_async(const char *app_file, const char *app_func, unsigne
*
*/
H5_DLL hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Fopen}
+ */
H5_DLL hid_t H5Fopen_async(const char *app_file, const char *app_func, unsigned app_line,
const char *filename, unsigned flags, hid_t access_plist, hid_t es_id);
/**
@@ -479,6 +485,11 @@ H5_DLL hid_t H5Fopen_async(const char *app_file, const char *app_func, unsigned
*
*/
H5_DLL hid_t H5Freopen(hid_t file_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Freopen}
+ */
H5_DLL hid_t H5Freopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t file_id,
hid_t es_id);
/**
@@ -503,6 +514,9 @@ H5_DLL hid_t H5Freopen_async(const char *app_file, const char *app_func, unsigne
* global or local. Valid values are as follows:
* \scopes
*
+ * \par Example
+ * \snippet H5F_examples.c flush
+ *
* \attention HDF5 does not possess full control over buffering. H5Fflush()
* flushes the internal HDF5 buffers then asks the operating system
* (the OS) to flush the system buffers for the open files. After
@@ -511,13 +525,13 @@ H5_DLL hid_t H5Freopen_async(const char *app_file, const char *app_func, unsigne
*
*/
H5_DLL herr_t H5Fflush(hid_t object_id, H5F_scope_t scope);
-H5_DLL herr_t H5Fflush_async(const char *app_file, const char *app_func, unsigned app_line, hid_t object_id,
- H5F_scope_t scope, hid_t es_id);
/**
- * \example H5Fclose.c
- * After creating an HDF5 file with H5Fcreate(), we close it with
- * H5Fclose().
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Fflush}
*/
+H5_DLL herr_t H5Fflush_async(const char *app_file, const char *app_func, unsigned app_line, hid_t object_id,
+ H5F_scope_t scope, hid_t es_id);
/**
* \ingroup H5F
*
@@ -534,8 +548,8 @@ H5_DLL herr_t H5Fflush_async(const char *app_file, const char *app_func, unsigne
* identifier, or shared datatype identifier), the file will be fully
* closed and access will end.
*
- * Use H5Fclose() as shown in the following example:
- * \include H5Fclose.c
+ * \par Example
+ * \snippet H5F_examples.c minimal
*
* \note \Bold{Delayed close:} Note the following deviation from the
* above-described behavior. If H5Fclose() is called for a file but one
@@ -562,6 +576,11 @@ H5_DLL herr_t H5Fflush_async(const char *app_file, const char *app_func, unsigne
*
*/
H5_DLL herr_t H5Fclose(hid_t file_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Fclose}
+ */
H5_DLL herr_t H5Fclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t file_id,
hid_t es_id);
/**
@@ -655,7 +674,7 @@ H5_DLL hid_t H5Fget_access_plist(hid_t file_id);
* \note The function will not return an error if intent is NULL; it will
* simply do nothing.
*
- * \version 1.10.0 C function enhanced to work with SWMR functionality.
+ * \version 1.10.0 Function enhanced to work with SWMR functionality.
*
* \since 1.8.0
*
@@ -707,7 +726,7 @@ H5_DLL herr_t H5Fget_fileno(hid_t file_id, unsigned long *fileno);
* \c (#H5F_OBJ_DATASET|#H5F_OBJ_GROUP) would call for datasets and
* groups.
*
- * \version 1.6.8, 1.8.2 C function return type changed to \c ssize_t.
+ * \version 1.6.8, 1.8.2 Function return type changed to \c ssize_t.
* \version 1.6.5 #H5F_OBJ_LOCAL has been added as a qualifier on the types
* of objects to be counted. #H5F_OBJ_LOCAL restricts the
* search to objects opened through current file identifier.
@@ -745,9 +764,9 @@ H5_DLL ssize_t H5Fget_obj_count(hid_t file_id, unsigned types);
* To retrieve a count of open objects, use the H5Fget_obj_count()
* function. This count can be used to set the \p max_objs parameter.
*
- * \version 1.8.2 C function return type changed to \c ssize_t and \p
+ * \version 1.8.2 Function return type changed to \c ssize_t and \p
* max_objs parameter datatype changed to \c size_t.
- * \version 1.6.8 C function return type changed to \c ssize_t and \p
+ * \version 1.6.8 Function return type changed to \c ssize_t and \p
* max_objs parameter datatype changed to \c size_t.
* \since 1.6.0
*
@@ -798,6 +817,9 @@ H5_DLL herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle);
* attribute, then the file will be mounted at the location where the
* attribute, dataset, or named datatype is attached.
*
+ * \par Example
+ * \snippet H5F_examples.c mount
+ *
* \note To date, no file mount properties have been defined in HDF5. The
* proper value to pass for \p plist is #H5P_DEFAULT, indicating the
* default file mount property list.
@@ -868,8 +890,6 @@ H5_DLL hssize_t H5Fget_freespace(hid_t file_id);
* if any, the HDF5 portion of the file, and any data that may have
* been appended beyond the data written through the HDF5 library.
*
- * \version 1.6.3 Fortran subroutine introduced in this release.
- *
* \since 1.6.3
*
*/
@@ -948,9 +968,7 @@ H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment);
*
* \note \Bold{Recommended Reading:} This function is part of the file image
* operations feature set. It is highly recommended to study the guide
- * "HDF5 File Image Operations" before using this feature set.\n See the
- * "See Also" section below for links to other elements of HDF5 file
- * image operations. \todo Fix the references.
+ * \ref_file_image_ops before using this feature set.
*
* \attention H5Pget_file_image() will fail, returning a negative value, if the
* file is too large for the supplied buffer.
@@ -958,8 +976,6 @@ H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment);
* \see H5LTopen_file_image(), H5Pset_file_image(), H5Pget_file_image(),
* H5Pset_file_image_callbacks(), H5Pget_file_image_callbacks()
*
- * \version 1.8.13 Fortran subroutine added in this release.
- *
* \since 1.8.0
*
*/
@@ -976,197 +992,18 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len);
* \ref H5AC-cache-config-t "here".
* \return \herr_t
*
+ * \note The \c in direction applies only to the H5AC_cache_config_t::version
+ * field. All other fields are out parameters.
+ *
* \details H5Fget_mdc_config() loads the current metadata cache configuration
* into the instance of H5AC_cache_config_t pointed to by the \p config_ptr
- * parameter.
- *
- * Note that the \c version field of \p config_ptr must be initialized
- * --this allows the library to support old versions of the H5AC_cache_config_t
- * structure.
- *
- * \par General configuration section
- * <table>
- * <tr>
- * <td><em>int</em> <code>version</code> </td>
- * <td>IN: Integer field indicating the the version of the H5AC_cache_config_t in use. This field should
- * be set to #H5AC__CURR_CACHE_CONFIG_VERSION (defined in H5ACpublic.h).</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>rpt_fcn_enabled</code> </td>
- * <td><p>OUT: Boolean flag indicating whether the adaptive cache resize report function is enabled. This
- * field should almost always be set to disabled (<code>0</code>). Since resize algorithm activity is
- * reported via stdout, it MUST be set to disabled (<code>0</code>) on Windows machines.</p><p>The
- * report function is not supported code, and can be expected to change between versions of the
- * library. Use it at your own risk.</p></td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>open_trace_file</code> </td>
- * <td>OUT: Boolean field indicating whether the <code>trace_file_name</code> field should be used to
- * open a trace file for the cache. This field will always be set to <code>0</code> in this
- * context.</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>close_trace_file</code> </td>
- * <td>OUT: Boolean field indicating whether the current trace file (if any) should be closed. This field
- * will always be set to <code>0</code> in this context.</td></tr>
- * <tr>
- * <td><em>char*</em><code>trace_file_name</code> </td>
- * <td>OUT: Full path name of the trace file to be opened if the <code>open_trace_file</code> field is
- * set to <code>1</code>. This field will always be set to the empty string in this context.</td></tr>
- * <tr>
- * <td><em>hbool_t</em> <code>evictions_enabled</code> </td>
- * <td>OUT: Boolean flag indicating whether metadata cache entry evictions are
- * enabled.</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>set_initial_size</code> </td>
- * <td>OUT: Boolean flag indicating whether the cache should be created with a user specified initial
- * maximum size.<p>If the configuration is loaded from the cache, this flag will always be set
- * to <code>0</code>.</p></td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>initial_size</code> </td>
- * <td>OUT: Initial maximum size of the cache in bytes, if applicable.<p>If the configuration is loaded
- * from the cache, this field will contain the cache maximum size as of the time of the
- * call.</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>min_clean_fraction</code> </td>
- * <td>OUT: Float value specifying the minimum fraction of the cache that must be kept either clean or
- * empty when possible.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>max_size</code> </td>
- * <td>OUT: Upper bound (in bytes) on the range of values that the adaptive cache resize code can select
- * as the maximum cache size.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>min_size</code> </td>
- * <td>OUT: Lower bound (in bytes) on the range of values that the adaptive cache resize code can select
- * as the maximum cache size.</td>
- * </tr>
- * <tr>
- * <td><em>long int</em> <code>epoch_length</code> </td>
- * <td>OUT: Number of cache accesses between runs of the adaptive cache resize
- * code.</td>
- * </tr>
- * </table>
- *
- * \par Increment configuration section
- * <table>
- * <tr>
- * <td><em>enum H5C_cache_incr_mode</em> <code>incr_mode</code> </td>
- * <td>OUT: Enumerated value indicating the operational mode of the automatic cache size increase code.
- * At present, only the following values are legal:<p>\c H5C_incr__off: Automatic cache size increase
- * is disabled.</p><p>\c H5C_incr__threshold: Automatic cache size increase is enabled using the hit
- * rate threshold algorithm.</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>lower_hr_threshold</code> </td>
- * <td>OUT: Hit rate threshold used in the hit rate threshold cache size increase algorithm.</td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>increment</code> </td>
- * <td>OUT: The factor by which the current maximum cache size is multiplied to obtain an initial new
- * maximum cache size if a size increase is triggered in the hit rate threshold cache size increase
- * algorithm.</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>apply_max_increment</code> </td>
- * <td>OUT: Boolean flag indicating whether an upper limit will be applied to the size of cache size
- * increases.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>max_increment</code> </td>
- * <td>OUT: The maximum number of bytes by which the maximum cache size can be increased in a single step
- * -- if applicable.</td>
- * </tr>
- * <tr>
- * <td><em>enum H5C_cache_flash_incr_mode</em> <code>flash_incr_mode</code> </td>
- * <td>OUT: Enumerated value indicating the operational mode of the flash cache size increase code. At
- * present, only the following values are legal:<p>\c H5C_flash_incr__off: Flash cache size increase is
- * disabled.</p><p>\c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add
- * space algorithm.</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>flash_threshold</code> </td>
- * <td>OUT: The factor by which the current maximum cache size is multiplied to obtain the minimum size
- * entry / entry size increase which may trigger a flash cache size
- * increase.</td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>flash_multiple</code> </td>
- * <td>OUT: The factor by which the size of the triggering entry / entry size increase is multiplied to
- * obtain the initial cache size increment. This increment may be reduced to reflect existing free
- * space in the cache and the <code>max_size</code> field above.</td>
- * </tr>
- * </table>
- *
- * \par Decrement configuration section
- * <table>
- * <tr><td colspan="2"><strong>Decrement configuration
- * section:</strong></td>
- * </tr>
- * <tr>
- * <td><em>enum H5C_cache_decr_mode</em> <code>decr_mode</code> </td>
- * <td>OUT: Enumerated value indicating the operational mode of the automatic cache size decrease code.
- * At present, the following values are legal:<p>H5C_decr__off: Automatic cache size decrease is
- * disabled, and the remaining decrement fields are ignored.</p><p>H5C_decr__threshold: Automatic
- * cache size decrease is enabled using the hit rate threshold algorithm.</p><p>H5C_decr__age_out:
- * Automatic cache size decrease is enabled using the ageout algorithm.</p>
- * <p>H5C_decr__age_out_with_threshold: Automatic cache size decrease is enabled using the ageout
- * with hit rate threshold algorithm</p></td>
- * </tr>
- * <tr><td><em>double</em> <code>upper_hr_threshold</code> </td>
- * <td>OUT: Upper hit rate threshold. This value is only used if the decr_mode is either
- * H5C_decr__threshold or H5C_decr__age_out_with_threshold.</td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>decrement</code> </td>
- * <td>OUT: Factor by which the current max cache size is multiplied to obtain an initial value for the
- * new cache size when cache size reduction is triggered in the hit rate threshold cache size reduction
- * algorithm.</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>apply_max_decrement</code> </td>
- * <td>OUT: Boolean flag indicating whether an upper limit should be applied to the size of cache size
- * decreases.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>max_decrement</code> </td>
- * <td>OUT: The maximum number of bytes by which cache size can be decreased if any single step, if
- * applicable.</td>
- * </tr>
- * <tr>
- * <td><em>int</em> <code>epochs_before_eviction</code> </td>
- * <td>OUT: The minimum number of epochs that an entry must reside unaccessed in cache before being
- * evicted under either of the ageout cache size reduction algorithms.</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>apply_empty_reserve</code> </td>
- * <td>OUT: Boolean flag indicating whether an empty reserve should be maintained under either of the
- * ageout cache size reduction algorithms.</td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>empty_reserve</code> </td>
- * <td>OUT: Empty reserve for use with the ageout cache size reduction algorithms, if applicable.</td>
- * </tr>
- * </table>
- *
- * \par Parallel configuration section
- * <table>
- * <tr><td><em>int</em> <code>dirty_bytes_threshold</code> </td>
- * <td>OUT: Threshold number of bytes of dirty metadata generation for triggering synchronizations of the
- * metadata caches serving the target file in the parallel case.<p>Synchronization occurs whenever the
- * number of bytes of dirty metadata created since the last synchronization exceeds this
- * limit.</p></td>
- * </tr>
- * </table>
+ * parameter.\n
+ * The fields of the H5AC_cache_config_t structure are shown below:
+ * \snippet H5ACpublic.h H5AC_cache_config_t_snip
+ * \click4more
*
* \since 1.8.0
*
- * \todo Fix the reference!
- *
*/
H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
/**
@@ -1183,242 +1020,13 @@ H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
*
* \details H5Fset_mdc_config() attempts to configure the file's metadata cache
* according configuration supplied in \p config_ptr.
- *
- * \par General configuration fields
- * <table>
- * <tr>
- * <td><em>int</em> <code>version</code></td>
- * <td>IN: Integer field indicating the the version of the H5AC_cache_config_t in use. This
- * field should be set to #H5AC__CURR_CACHE_CONFIG_VERSION (defined
- * in H5ACpublic.h).</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>rpt_fcn_enabled</code></td>
- * <td>IN: Boolean flag indicating whether the adaptive cache resize report function is enabled. This
- * field should almost always be set to disabled (<code>0</code>). Since resize algorithm activity is
- * reported via stdout, it MUST be set to disabled (<code>0</code>) on Windows machines.<p>The report
- * function is not supported code, and can be expected to change between versions of the library. Use
- * it at your own risk.</p></td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>open_trace_File</code></td>
- * <td>IN: Boolean field indicating whether the <code>trace_file_name</code> field should be used to open
- * a trace file for the cache.<p>The trace file is a debuging feature that allows the capture of top
- * level metadata cache requests for purposes of debugging and/or optimization. This field should
- * <p>This field should only normally be set to <code>0</code>, as trace file collection imposes
- * considerable overhead.</p> be set to <code>1</code> when the <code>trace_file_name</code> contains
- * the full path of the desired trace file, and either there is no open trace file on the cache, or the
- * <code>close_trace_file</code> field is also <code>1</code>.</p><p>The trace file feature is
- * unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to
- * collect a trace of cache activity in cases of occult failures and/or poor performance seen in the
- * field, so as to aid in reproduction in the lab. If you use it absent the direction of The HDF Group,
- * you are on your own.</p></td>
- * </tr>
- * <tr><td><em>hbool_t</em> <code>close_trace_file</code></td>
- * <td>IN: Boolean field indicating whether the current trace file (if any) should be closed.<p>See the
- * above comments on the <code>open_trace_file</code> field. This field should be set to
- * <code>0</code> unless there is an open trace file on the cache that you wish to close.</p><p>The
- * trace file feature is unsupported unless used at the direction of The HDF Group. It is intended to
- * allow The HDF Group to collect a trace of cache activity in cases of occult failures and/or poor
- * performance seen in the field, so as to aid in reproduction in the lab. If you use it absent the
- * direction of The HDF Group, you are on your own.</p></td>
- * </tr>
- * <tr>
- * <td><em>char</em> <code>trace_file_name[]</code></td>
- * <td>IN: Full path of the trace file to be opened if the <code>open_trace_file</code> field is set
- * to <code>1</code>.<p>In the parallel case, an ascii representation of the mpi rank of the process
- * will be appended to the file name to yield a unique trace file name for each process.</p><p>The
- * length of the path must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN characters.</p><p>The trace file
- * feature is unsupported unless used at the direction of The HDF Group. It is intended to allow The
- * HDF Group to collect a trace of cache activity in cases of occult failures and/or poor performance
- * seen in the field, so as to aid in reproduction in the lab. If you use it absent the direction of
- * The HDF Group, you are on your own.</p></td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>evictions_enabled</code></td>
- * <td>IN: A boolean flag indicating whether evictions from the metadata cache are enabled. This flag is
- * initially set to enabled (<code>1</code>).<p>In rare circumstances, the raw data throughput
- * requirements may be so high that the user wishes to postpone metadata writes so as to reserve I/O
- * throughput for raw data. The <code>evictions_enabled</code> field exists to allow this. However,
- * this is an extreme step, and you have no business doing it unless you have read the User Guide
- * section on metadata caching, and have considered all other options carefully.</p><p>The
- * <code>evictions_enabled</code> field may not be set to disabled (<code>0</code>) unless all adaptive
- * cache resizing code is disabled via the <code>incr_mode</code>, <code>flash_incr_mode</code>, and
- * <code>decr_mode</code> fields.</p><p>When this flag is set to disabled (<code>0</code>), the
- * metadata cache will not attempt to evict entries to make space for new entries, and thus will grow
- * without bound.</p><p>Evictions will be re-enabled when this field is set back to <code>1</code>.
- * This should be done as soon as possible.</p></td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>set_initial_size</code></td>
- * <td>IN: Boolean flag indicating whether the cache should be forced to the user specified initial
- * size.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>initial_size</code></td>
- * <td>IN: If <code>set_initial_size</code> is set to <code>1</code>, then <code>initial_size</code> must
- * contain the desired initial size in bytes. This value must lie in the closed interval
- * <code>[min_size, max_size]</code>. (see below)</td>
- * </tr>
- * <tr><td><em>double</em> <code>min_clean_fraction</code></td>
- * <td>IN: This field specifies the minimum fraction of the cache that must be kept either clean or
- * empty.<p>The value must lie in the interval [0.0, 1.0]. 0.01 is a good place to start in the serial
- * case. In the parallel case, a larger value is needed -- see <a
- * href="/display/HDF5/Metadata+Caching+in+HDF5">Metadata Caching in HDF5</a> in the collection
- * "Advanced Topics in HDF5."</p></td>
- * </tr>
- * <tr><td><em>size_t</em> <code>max_size</code></td>
- * <td>IN: Upper bound (in bytes) on the range of values that the adaptive cache resize code can select
- * as the maximum cache size.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>min_size</code></td>
- * <td>IN: Lower bound (in bytes) on the range of values that the adaptive cache resize code can select
- * as the maximum cache size.</td>
- * </tr>
- * <tr><td><em>long int</em> <code>epoch_length</code></td>
- * <td>IN: Number of cache accesses between runs of the adaptive cache resize code. 50,000 is a good
- * starting number.</td>
- * </tr>
- * </table>
- *
- * \par Increment configuration fields
- * <table>
- * <tr>
- * <td><em>enum H5C_cache_incr_mode</em> <code>incr_mode</code></td>
- * <td>IN: Enumerated value indicating the operational mode of the automatic cache size increase code. At
- * present, only two values are legal:<p>\c H5C_incr__off: Automatic cache size increase is disabled,
- * and the remaining increment fields are ignored.</p><p>\c H5C_incr__threshold: Automatic cache size
- * increase is enabled using the hit rate threshold algorithm.</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>lower_hr_threshold</code></td>
- * <td>IN: Hit rate threshold used by the hit rate threshold cache size increment algorithm.<p>When the
- * hit rate over an epoch is below this threshold and the cache is full, the maximum size of the
- * cache is multiplied by increment (below), and then clipped as necessary to stay within max_size, and
- * possibly max_increment.</p><p>This field must lie in the interval [0.0, 1.0]. 0.8 or 0.9 is a good
- * starting point.</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>increment</code></td>
- * <td>IN: Factor by which the hit rate threshold cache size increment algorithm multiplies the current
- * maximum cache size to obtain a tentative new cache size.<p>The actual cache size increase will be
- * clipped to satisfy the max_size specified in the general configuration, and possibly max_increment
- * below.</p><p>The parameter must be greater than or equal to 1.0 -- 2.0 is a reasonable
- * value.</p><p>If you set it to 1.0, you will effectively disable cache size increases.</p></td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>apply_max_increment</code></td>
- * <td>IN: Boolean flag indicating whether an upper limit should be applied to the size of cache size
- * increases.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>max_increment</code></td>
- * <td>IN: Maximum number of bytes by which cache size can be increased in a single step -- if
- * applicable.</td>
- * </tr>
- * <tr>
- * <td><em>enum H5C_cache_flash_incr_mode</em> <code>flash_incr_mode</code></td>
- * <td>IN: Enumerated value indicating the operational mode of the flash cache size increase code. At
- * present, only the following values are legal:<p>\c H5C_flash_incr__off: Flash cache size increase is
- * disabled.</p><p>\c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add
- * space algorithm.</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>flash_threshold</code></td>
- * <td>IN: The factor by which the current maximum cache size is multiplied to obtain the minimum size
- * entry / entry size increase which may trigger a flash cache size increase.<p>At present, this value
- * must lie in the range [0.1, 1.0].</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>flash_multiple</code></td>
- * <td>IN: The factor by which the size of the triggering entry / entry size increase is multiplied to
- * obtain the initial cache size increment. This increment may be reduced to reflect existing free
- * space in the cache and the <code>max_size</code> field above.<p>At present, this field must lie in
- * the range [0.1, 10.0].</p></td>
- * </tr>
- * </table>
- *
- * \par Decrement configuration fields
- * <table>
- * <tr>
- * <td><em>enum H5C_cache_decr_mode</em> <code>decr_mode</code></td>
- * <td>IN: Enumerated value indicating the operational mode of the automatic cache size decrease code. At
- * present, the following values are legal:<p>\c H5C_decr__off: Automatic cache size decrease is
- * disabled.</p><p>\c H5C_decr__threshold: Automatic cache size decrease is enabled using the hit
- * rate threshold algorithm.</p><p>\c H5C_decr__age_out: Automatic cache size decrease is enabled using
- * the ageout algorithm.</p><p>\c H5C_decr__age_out_with_threshold: Automatic cache size decrease is
- * enabled using the ageout with hit rate threshold algorithm</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>upper_hr_threshold</code></td>
- * <td>IN: Hit rate threshold for the hit rate threshold and ageout with hit rate threshold cache size
- * decrement algorithms.<p>When \c decr_mode is \c H5C_decr__threshold, and the hit rate over a given
- * epoch exceeds the supplied threshold, the current maximum cache size is multiplied by decrement to
- * obtain a tentative new (and smaller) maximum cache size.</p><p>When \c decr_mode is \c
- * H5C_decr__age_out_with_threshold, there is no attempt to find and evict aged out entries unless the
- * hit rate in the previous epoch exceeded the supplied threshold.</p><p>This field must lie in the
- * interval [0.0, 1.0].</p><p>For \c H5C_incr__threshold, .9995 or .99995 is a good place to
- * start.</p><p>For \c H5C_decr__age_out_with_threshold, .999 might be more useful.</p></td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>decrement</code></td>
- * <td>IN: In the hit rate threshold cache size decrease algorithm, this parameter contains the factor by
- * which the current max cache size is multiplied to produce a tentative new cache size.<p>The actual
- * cache size decrease will be clipped to satisfy the min_size specified in the general configuration,
- * and possibly max_decrement below.</p><p>The parameter must be be in the interval
- * [0.0, 1.0].</p><p>If you set it to 1.0, you will effectively disable cache size decreases. 0.9 is a
- * reasonable starting point.</p></td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>apply_max_decrement</code></td>
- * <td>IN: Boolean flag indicating whether an upper limit should be applied to the size of cache size
- * decreases.</td>
- * </tr>
- * <tr>
- * <td><em>size_t</em> <code>max_decrement</code></td>
- * <td>IN: Maximum number of bytes by which the maximum cache size can be decreased in any single step --
- * if applicable.</td>
- * </tr>
- * <tr>
- * <td><em>int</em> <code>epochs_before_eviction</code></td>
- * <td>IN: In the ageout based cache size reduction algorithms, this field contains the minimum number of
- * epochs an entry must remain unaccessed in cache before the cache size reduction algorithm tries to
- * evict it. 3 is a reasonable value.</td>
- * </tr>
- * <tr>
- * <td><em>hbool_t</em> <code>apply_empty_reserve</code></td>
- * <td>IN: Boolean flag indicating whether the ageout based decrement algorithms will maintain a empty
- * reserve when decreasing cache size.</td>
- * </tr>
- * <tr>
- * <td><em>double</em> <code>empty_reserve</code></td>
- * <td>IN: Empty reserve as a fraction of maximum cache size if applicable.<p>When so directed, the
- * ageout based algorithms will not decrease the maximum cache size unless the empty reserve can be
- * met.</p><p>The parameter must lie in the interval [0.0, 1.0]. 0.1 or 0.05 is a good place to
- * start.</p></td>
- * </tr>
- * </table>
- *
- * \par Parallel configuration fields
- * <table>
- * <tr>
- * <td><em>int</em> <code>dirty_bytes_threshold</code></td>
- * <td>IN: Threshold number of bytes of dirty metadata generation for triggering synchronizations of the
- * metadata caches serving the target file in the parallel case.<p>Synchronization occurs whenever the
- * number of bytes of dirty metadata created since the last synchronization exceeds this
- * limit.</p><p>This field only applies to the parallel case. While it is ignored elsewhere, it can
- * still draw a value out of bounds error.</p><p>It must be consistant across all caches on any given
- * file.</p><p>By default, this field is set to 256 KB. It shouldn't be more than half the current
- * maximum cache size times the minimum clean fraction.</p></td>
- * </tr>
- * </table>
+ * \snippet H5ACpublic.h H5AC_cache_config_t_snip
+ * \click4more
*
* \since 1.8.0
*
- * \todo Fix the MDC document reference!
*/
-H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
+H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, const H5AC_cache_config_t *config_ptr);
/**
* \ingroup MDC
*
@@ -1495,13 +1103,12 @@ H5_DLL herr_t H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_c
* is enabled. However, the call should be useful if you choose to control metadata cache size from your
* program.
*
- * See "Metadata Caching in HDF5" for details about the metadata cache and the adaptive cache resizing
+ * See \ref_mdc_in_hdf5 for details about the metadata cache and the adaptive cache resizing
* algorithms. If you have not read, understood, and thought about the material covered in that
* documentation,
* you should not be using this API call.
* \endparblock
*
- * \todo Fix the MDC document reference!
*/
H5_DLL herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id);
/**
@@ -1797,6 +1404,9 @@ H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id);
* For the parameters \p low and \p high, see the description for
* H5Pset_libver_bounds().
*
+ * \par Example
+ * \snippet H5F_examples.c libver_bounds
+ *
* \since 1.10.2
*
*/
@@ -1835,7 +1445,7 @@ H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t
* list, and H5Fget_mdc_logging_status() will return the current state of
* the logging flags.
*
- * The log format is described in the \Emph{Metadata Cache Logging} document.
+ * The log format is described in the \ref_mdc_logging document.
*
* \note Logging can only be started or stopped if metadata cache logging was enabled
* via H5Pset_mdc_log_options().\n
@@ -1849,8 +1459,6 @@ H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t
*
* \since 1.10.0
*
- * \todo Fix the document reference!
- *
*/
H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id);
/**
@@ -1887,7 +1495,7 @@ H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id);
* list, and H5Fget_mdc_logging_status() will return the current state of
* the logging flags.
*
- * The log format is described in the \Emph{Metadata Cache Logging} document.
+ * The log format is described in the \ref_mdc_logging document.
*
* \note Logging can only be started or stopped if metadata cache logging was enabled
* via H5Pset_mdc_log_options().\n
@@ -1933,7 +1541,7 @@ H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id);
* list, and H5Fget_mdc_logging_status() will return the current state of
* the logging flags.
*
- * The log format is described in the \Emph{Metadata Cache Logging} document.
+ * The log format is described in the \ref_mdc_logging document.
*
* \note Unlike H5Fstart_mdc_logging() and H5Fstop_mdc_logging(), this function can
* be called on any open file identifier.
@@ -1944,7 +1552,7 @@ H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, hboo
/**
* \ingroup SWMR
*
- * \todo Finish this!
+ * \todo UFO?
*/
H5_DLL herr_t H5Fformat_convert(hid_t fid);
/**
@@ -1998,7 +1606,7 @@ H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], u
* \brief Obtains information about a cache image if it exists
*
* \file_id
- * \param[out] image_addr Offset of the cache image if it exists, or #HADDR_UNDEF if it does not
+ * \param[out] image_addr Offset of the cache image if it exists, or \c HADDR_UNDEF if it does not
* \param[out] image_size Length of the cache image if it exists, or 0 if it does not
* \returns \herr_t
*
@@ -2077,7 +1685,6 @@ H5_DLL herr_t H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize);
*
*/
H5_DLL herr_t H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize);
-H5_DLL herr_t H5Fwait(hid_t file_id);
#ifdef H5_HAVE_PARALLEL
/**
@@ -2139,11 +1746,10 @@ H5_DLL herr_t H5Fwait(hid_t file_id);
* the desired behavior.
* \endparblock
*
- * \see Enabling a Strict Consistency Semantics Model in Parallel HDF5
+ * \see \ref_cons_semantics
*
* \since 1.8.9
*
- * \todo Fix the reference!
*/
H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag);
/**
@@ -2163,15 +1769,15 @@ H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag);
* Upon successful return, \p flag will be set to \c 1 if file access is set
* to atomic mode and \c 0 if file access is set to nonatomic mode.
*
- * \see Enabling a Strict Consistency Semantics Model in Parallel HDF5
+ * \see \ref_cons_semantics
*
* \since 1.8.9
*
- * \todo Fix the reference!
*/
H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag);
#endif /* H5_HAVE_PARALLEL */
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -2191,6 +1797,7 @@ H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag);
#define H5Fflush_async_wrap H5_NO_EXPAND(H5Fflush_async)
#define H5Fclose_async_wrap H5_NO_EXPAND(H5Fclose_async)
#endif /* H5F_MODULE */
+/// \endcond
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -2199,14 +1806,14 @@ H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag);
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Macros */
-#define H5F_ACC_DEBUG (H5CHECK H5OPEN 0x0000u) /*print debug info (deprecated)*/
+#define H5F_ACC_DEBUG (H5CHECK H5OPEN 0x0000u) /**< Print debug info \deprecated In which version? */
/* Typedefs */
/**
* Current "global" information about file
*/
-//! [H5F_info1_t_snip]
+//! <!-- [H5F_info1_t_snip] -->
typedef struct H5F_info1_t {
hsize_t super_ext_size; /**< Superblock extension size */
struct {
@@ -2214,7 +1821,7 @@ typedef struct H5F_info1_t {
H5_ih_info_t msgs_info; /**< Shared object header message index & heap size */
} sohm;
} H5F_info1_t;
-//! [H5F_info1_t_snip]
+//! <!-- [H5F_info1_t_snip] -->
/* Function prototypes */
/**
@@ -2252,7 +1859,7 @@ typedef struct H5F_info1_t {
* header indexes. Each index might be either a B-tree or
* a list.
*
- * \version 1.10.0 C function H5Fget_info() renamed to H5Fget_info1() and
+ * \version 1.10.0 Function H5Fget_info() renamed to H5Fget_info1() and
* deprecated in this release.
*
* \since 1.8.0
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 3001644..4df0064 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -377,7 +377,10 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
/* Try detecting file's siganture */
/* (Don't leave before Bcast, to avoid hang on error) */
- H5E_BEGIN_TRY { status = H5FD_locate_signature(file, &super_addr); }
+ H5E_BEGIN_TRY
+ {
+ status = H5FD_locate_signature(file, &super_addr);
+ }
H5E_END_TRY;
/* Set superblock address to undefined on error */
@@ -1040,7 +1043,7 @@ done:
HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin driver info")
/* Evict the driver info block from the cache */
- if (H5AC_expunge_entry(f, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0)
+ if (sblock && H5AC_expunge_entry(f, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block")
} /* end if */
diff --git a/src/H5G.c b/src/H5G.c
index 0163d65..deaf792 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -271,7 +271,7 @@ H5Gcreate_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE9(FUNC, "*s*sIui*siiii", app_file, app_func, app_line, loc_id, name, lcpl_id, gcpl_id, gapl_id, es_id)) < 0) {
+ H5ARG_TRACE9(__func__, "*s*sIui*siiii", app_file, app_func, app_line, loc_id, name, lcpl_id, gcpl_id, gapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on group ID")
@@ -475,7 +475,7 @@ H5Gopen_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, gapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, gapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on group ID")
@@ -502,8 +502,9 @@ done:
hid_t
H5Gget_create_plist(hid_t group_id)
{
- H5VL_object_t *vol_obj = NULL;
- hid_t ret_value = H5I_INVALID_HID;
+ H5VL_object_t * vol_obj; /* Object for loc_id */
+ H5VL_group_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ hid_t ret_value = H5I_INVALID_HID;
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", group_id);
@@ -512,11 +513,17 @@ H5Gget_create_plist(hid_t group_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(group_id, H5I_GROUP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a group ID")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_GROUP_GET_GCPL;
+ vol_cb_args.args.get_gcpl.gcpl_id = H5I_INVALID_HID;
+
/* Get the group creation property list for the group */
- if (H5VL_group_get(vol_obj, H5VL_GROUP_GET_GCPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) <
- 0)
+ if (H5VL_group_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get group's creation property list")
+ /* Set the return value */
+ ret_value = vol_cb_args.args.get_gcpl.gcpl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Gget_create_plist() */
@@ -538,9 +545,9 @@ H5G__get_info_api_common(hid_t loc_id, H5G_info_t *group_info /*out*/, void **to
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- H5I_type_t id_type; /* Type of ID */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_group_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5I_type_t id_type; /* Type of ID */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -551,13 +558,14 @@ H5G__get_info_api_common(hid_t loc_id, H5G_info_t *group_info /*out*/, void **to
if (!group_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "group_info parameter cannot be NULL")
- /* Set up object access arguments */
- if (H5VL_setup_self_args(loc_id, vol_obj_ptr, &loc_params) < 0)
+ /* Set up VOL callback & object access arguments */
+ vol_cb_args.op_type = H5VL_GROUP_GET_INFO;
+ if (H5VL_setup_self_args(loc_id, vol_obj_ptr, &vol_cb_args.args.get_info.loc_params) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set object access arguments")
+ vol_cb_args.args.get_info.ginfo = group_info;
/* Retrieve group information */
- if (H5VL_group_get(*vol_obj_ptr, H5VL_GROUP_GET_INFO, H5P_DATASET_XFER_DEFAULT, token_ptr, &loc_params,
- group_info) < 0)
+ if (H5VL_group_get(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get group info")
done:
@@ -622,7 +630,7 @@ H5Gget_info_async(const char *app_file, const char *app_func, unsigned app_line,
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE6(FUNC, "*s*sIuixi", app_file, app_func, app_line, loc_id, group_info, es_id)) < 0)
+ H5ARG_TRACE6(__func__, "*s*sIuixi", app_file, app_func, app_line, loc_id, group_info, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -647,8 +655,8 @@ H5G__get_info_by_name_api_common(hid_t loc_id, const char *name, H5G_info_t *gro
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_group_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -656,13 +664,15 @@ H5G__get_info_by_name_api_common(hid_t loc_id, const char *name, H5G_info_t *gro
if (!group_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "group_info parameter cannot be NULL")
- /* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ /* Set up VOL callback & object access arguments */
+ vol_cb_args.op_type = H5VL_GROUP_GET_INFO;
+ if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr,
+ &vol_cb_args.args.get_info.loc_params) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set object access arguments")
+ vol_cb_args.args.get_info.ginfo = group_info;
/* Retrieve group information */
- if (H5VL_group_get(*vol_obj_ptr, H5VL_GROUP_GET_INFO, H5P_DATASET_XFER_DEFAULT, token_ptr, &loc_params,
- group_info) < 0)
+ if (H5VL_group_get(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get group info")
done:
@@ -728,7 +738,7 @@ H5Gget_info_by_name_async(const char *app_file, const char *app_func, unsigned a
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE8(FUNC, "*s*sIui*sxii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id)) < 0)
+ H5ARG_TRACE8(__func__, "*s*sIui*sxii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -754,8 +764,8 @@ H5G__get_info_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_group_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -763,14 +773,15 @@ H5G__get_info_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t
if (!group_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "group_info parameter cannot be NULL")
- /* Set up object access arguments */
- if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr,
- &loc_params) < 0)
+ /* Set up VOL callback & object access arguments */
+ vol_cb_args.op_type = H5VL_GROUP_GET_INFO;
+ if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, FALSE, lapl_id, vol_obj_ptr,
+ &vol_cb_args.args.get_info.loc_params) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set object access arguments")
+ vol_cb_args.args.get_info.ginfo = group_info;
/* Retrieve group information */
- if (H5VL_group_get(*vol_obj_ptr, H5VL_GROUP_GET_INFO, H5P_DATASET_XFER_DEFAULT, token_ptr, &loc_params,
- group_info) < 0)
+ if (H5VL_group_get(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get group info")
done:
@@ -841,7 +852,7 @@ H5Gget_info_by_idx_async(const char *app_file, const char *app_func, unsigned ap
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE11(FUNC, "*s*sIui*sIiIohxii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, group_info, lapl_id, es_id)) < 0)
+ H5ARG_TRACE11(__func__, "*s*sIui*sIiIohxii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, group_info, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -931,7 +942,7 @@ H5Gclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, group_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, group_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -957,8 +968,9 @@ done:
herr_t
H5Gflush(hid_t group_id)
{
- H5VL_object_t *vol_obj; /* Group for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_group_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", group_id);
@@ -971,9 +983,12 @@ H5Gflush(hid_t group_id)
if (H5CX_set_loc(group_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_GROUP_FLUSH;
+ vol_cb_args.args.flush.grp_id = group_id;
+
/* Flush group's metadata to file */
- if (H5VL_group_specific(vol_obj, H5VL_GROUP_FLUSH, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, group_id) <
- 0)
+ if (H5VL_group_specific(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group")
done:
@@ -995,8 +1010,9 @@ done:
herr_t
H5Grefresh(hid_t group_id)
{
- H5VL_object_t *vol_obj; /* Group for this operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_group_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", group_id);
@@ -1009,9 +1025,12 @@ H5Grefresh(hid_t group_id)
if (H5CX_set_loc(group_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_GROUP_REFRESH;
+ vol_cb_args.args.refresh.grp_id = group_id;
+
/* Refresh group's metadata */
- if (H5VL_group_specific(vol_obj, H5VL_GROUP_REFRESH, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- group_id) < 0)
+ if (H5VL_group_specific(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group")
done:
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index eac7545..4713193 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -176,7 +176,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, hbool_
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* magic */
- if (HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, NULL, "bad symbol table node signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c
index a621f6e..0c0b5db 100644
--- a/src/H5Gcompact.c
+++ b/src/H5Gcompact.c
@@ -200,20 +200,20 @@ done:
*
* Purpose: Returns the name of objects in the group by giving index.
*
- * Return: Success: Non-negative, length of name
- * Failure: Negative
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Sep 6, 2005
*
*-------------------------------------------------------------------------
*/
-ssize_t
+herr_t
H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t idx, char *name, size_t size)
+ H5_iter_order_t order, hsize_t idx, char *name, size_t name_size,
+ size_t *name_len)
{
H5G_link_table_t ltable = {0, NULL}; /* Link table */
- ssize_t ret_value = -1; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -229,13 +229,13 @@ H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound")
/* Get the length of the name */
- ret_value = (ssize_t)HDstrlen(ltable.lnks[idx].name);
+ *name_len = HDstrlen(ltable.lnks[idx].name);
/* Copy the name into the user's buffer, if given */
if (name) {
- HDstrncpy(name, ltable.lnks[idx].name, MIN((size_t)(ret_value + 1), size));
- if ((size_t)ret_value >= size)
- name[size - 1] = '\0';
+ HDstrncpy(name, ltable.lnks[idx].name, MIN((*name_len + 1), name_size));
+ if (*name_len >= name_size)
+ name[name_size - 1] = '\0';
} /* end if */
done:
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index ec5cb71..753936b 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -169,7 +169,7 @@ typedef struct {
size_t name_size; /* Size of name buffer to fill */
/* upward */
- ssize_t name_len; /* Full length of name */
+ size_t name_len; /* Full length of name */
} H5G_bt2_ud_gnbi_t;
/*
@@ -185,7 +185,7 @@ typedef struct {
size_t name_size; /* Size of name buffer to fill */
/* upward */
- ssize_t name_len; /* Full length of name */
+ size_t name_len; /* Full length of name */
} H5G_fh_ud_gnbi_t;
/*
@@ -1046,12 +1046,12 @@ H5G__dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link")
/* Get the length of the name */
- udata->name_len = (ssize_t)HDstrlen(lnk->name);
+ udata->name_len = HDstrlen(lnk->name);
/* Copy the name into the user's buffer, if given */
if (udata->name) {
- HDstrncpy(udata->name, lnk->name, MIN((size_t)(udata->name_len + 1), udata->name_size));
- if ((size_t)udata->name_len >= udata->name_size)
+ HDstrncpy(udata->name, lnk->name, MIN((udata->name_len + 1), udata->name_size));
+ if (udata->name_len >= udata->name_size)
udata->name[udata->name_size - 1] = '\0';
} /* end if */
@@ -1106,23 +1106,22 @@ done:
*
* Purpose: Returns the name of objects in the group by giving index.
*
- * Return: Success: Non-negative, length of name
- * Failure: Negative
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Sep 19 2006
*
*-------------------------------------------------------------------------
*/
-ssize_t
+herr_t
H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n, char *name, size_t size)
+ hsize_t n, char *name, size_t name_size, size_t *name_len)
{
- H5HF_t * fheap = NULL; /* Fractal heap handle */
- H5G_link_table_t ltable = {0, NULL}; /* Table of links */
- H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */
- haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */
- ssize_t ret_value = -1; /* Return value */
+ H5HF_t * fheap = NULL; /* Fractal heap handle */
+ H5G_link_table_t ltable = {0, NULL}; /* Table of links */
+ H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */
+ haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -1176,14 +1175,14 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5
udata.f = f;
udata.fheap = fheap;
udata.name = name;
- udata.name_size = size;
+ udata.name_size = name_size;
/* Retrieve the name according to the v2 B-tree's index order */
if (H5B2_index(bt2, order, n, H5G__dense_get_name_by_idx_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree")
/* Set return value */
- ret_value = udata.name_len;
+ *name_len = udata.name_len;
} /* end if */
else { /* Otherwise, we need to build a table of the links and sort it */
/* Build the table of links for this group */
@@ -1195,13 +1194,13 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound")
/* Get the length of the name */
- ret_value = (ssize_t)HDstrlen(ltable.lnks[n].name);
+ *name_len = HDstrlen(ltable.lnks[n].name);
/* Copy the name into the user's buffer, if given */
if (name) {
- HDstrncpy(name, ltable.lnks[n].name, MIN((size_t)(ret_value + 1), size));
- if ((size_t)ret_value >= size)
- name[size - 1] = '\0';
+ HDstrncpy(name, ltable.lnks[n].name, MIN((*name_len + 1), name_size));
+ if (*name_len >= name_size)
+ name[name_size - 1] = '\0';
} /* end if */
} /* end else */
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index c73bfd7..7c0404f 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -141,10 +141,10 @@ H5G_map_obj_type(H5O_type_t obj_type)
* specified NAME. The group is opened for write access
* and it's object ID is returned.
*
- * The optional SIZE_HINT specifies how much file space to
- * reserve to store the names that will appear in this
- * group. If a non-positive value is supplied for the SIZE_HINT
- * then a default size is chosen.
+ * The SIZE_HINT parameter specifies how much file space to reserve
+ * to store the names that will appear in this group. This number
+ * must be less than or equal to UINT32_MAX. If zero is supplied
+ * for the SIZE_HINT then a default size is chosen.
*
* Note: Deprecated in favor of H5Gcreate2
*
@@ -174,6 +174,8 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
/* Check arguments */
if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name given")
+ if (size_hint > UINT32_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "size_hint cannot be larger than UINT32_MAX")
/* Check if we need to create a non-standard GCPL */
if (size_hint > 0) {
@@ -306,7 +308,8 @@ done:
herr_t
H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "iLl*s*s", cur_loc_id, type, cur_name, new_name);
@@ -324,20 +327,15 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new
/* Create link */
if (type == H5L_TYPE_HARD) {
H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params1;
- H5VL_loc_params_t loc_params2;
+ H5VL_loc_params_t new_loc_params;
H5VL_object_t tmp_vol_obj; /* Temporary object */
- loc_params1.type = H5VL_OBJECT_BY_NAME;
- loc_params1.obj_type = H5I_get_type(cur_loc_id);
- loc_params1.loc_data.loc_by_name.name = cur_name;
- loc_params1.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+ /* Set up new location struct */
+ new_loc_params.type = H5VL_OBJECT_BY_NAME;
+ new_loc_params.loc_data.loc_by_name.name = new_name;
+ new_loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
- loc_params2.type = H5VL_OBJECT_BY_NAME;
- loc_params2.loc_data.loc_by_name.name = new_name;
- loc_params2.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
-
- /* get the location object */
+ /* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(cur_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
@@ -345,16 +343,24 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new
tmp_vol_obj.data = NULL;
tmp_vol_obj.connector = vol_obj->connector;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_HARD;
+ vol_cb_args.args.hard.curr_obj = vol_obj->data;
+ vol_cb_args.args.hard.curr_loc_params.type = H5VL_OBJECT_BY_NAME;
+ vol_cb_args.args.hard.curr_loc_params.obj_type = H5I_get_type(cur_loc_id);
+ vol_cb_args.args.hard.curr_loc_params.loc_data.loc_by_name.name = cur_name;
+ vol_cb_args.args.hard.curr_loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+
/* Create the link through the VOL */
- if (H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, &loc_params2, H5P_LINK_CREATE_DEFAULT,
- H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- vol_obj->data, &loc_params1) < 0)
+ if (H5VL_link_create(&vol_cb_args, &tmp_vol_obj, &new_loc_params, H5P_LINK_CREATE_DEFAULT,
+ H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link")
} /* end if */
else if (type == H5L_TYPE_SOFT) {
H5VL_object_t * vol_obj; /* Object of loc_id */
H5VL_loc_params_t loc_params;
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.loc_data.loc_by_name.name = new_name;
loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
@@ -364,10 +370,13 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(cur_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_SOFT;
+ vol_cb_args.args.soft.target = cur_name;
+
/* Create the link through the VOL */
- if (H5VL_link_create(H5VL_LINK_CREATE_SOFT, vol_obj, &loc_params, H5P_LINK_CREATE_DEFAULT,
- H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- cur_name) < 0)
+ if (H5VL_link_create(&vol_cb_args, vol_obj, &loc_params, H5P_LINK_CREATE_DEFAULT,
+ H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link")
} /* end else-if */
else
@@ -388,7 +397,8 @@ done:
herr_t
H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*sLli*s", cur_loc_id, cur_name, type, new_loc_id, new_name);
@@ -407,29 +417,31 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_
if (type == H5L_TYPE_HARD) {
H5VL_object_t * vol_obj1; /* Object of loc_id */
H5VL_object_t * vol_obj2; /* Object of loc_id */
- H5VL_loc_params_t loc_params1;
- H5VL_loc_params_t loc_params2;
+ H5VL_loc_params_t new_loc_params;
- loc_params1.type = H5VL_OBJECT_BY_NAME;
- loc_params1.obj_type = H5I_get_type(cur_loc_id);
- loc_params1.loc_data.loc_by_name.name = cur_name;
- loc_params1.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+ /* Set up new location struct */
+ new_loc_params.type = H5VL_OBJECT_BY_NAME;
+ new_loc_params.obj_type = H5I_get_type(new_loc_id);
+ new_loc_params.loc_data.loc_by_name.name = new_name;
+ new_loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
- loc_params2.type = H5VL_OBJECT_BY_NAME;
- loc_params2.obj_type = H5I_get_type(new_loc_id);
- loc_params2.loc_data.loc_by_name.name = new_name;
- loc_params2.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
-
- /* get the location object */
+ /* Get the location objects */
if (NULL == (vol_obj1 = (H5VL_object_t *)H5I_object(cur_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
if (NULL == (vol_obj2 = (H5VL_object_t *)H5I_object(new_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_HARD;
+ vol_cb_args.args.hard.curr_obj = vol_obj1->data;
+ vol_cb_args.args.hard.curr_loc_params.type = H5VL_OBJECT_BY_NAME;
+ vol_cb_args.args.hard.curr_loc_params.obj_type = H5I_get_type(cur_loc_id);
+ vol_cb_args.args.hard.curr_loc_params.loc_data.loc_by_name.name = cur_name;
+ vol_cb_args.args.hard.curr_loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+
/* Create the link through the VOL */
- if (H5VL_link_create(H5VL_LINK_CREATE_HARD, vol_obj2, &loc_params2, H5P_LINK_CREATE_DEFAULT,
- H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- vol_obj1->data, &loc_params1) < 0)
+ if (H5VL_link_create(&vol_cb_args, vol_obj2, &new_loc_params, H5P_LINK_CREATE_DEFAULT,
+ H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link")
} /* end if */
else if (type == H5L_TYPE_SOFT) {
@@ -441,6 +453,7 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_
if (new_loc_id == H5L_SAME_LOC)
new_loc_id = cur_loc_id;
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.loc_data.loc_by_name.name = new_name;
loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
@@ -450,10 +463,13 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(new_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_SOFT;
+ vol_cb_args.args.soft.target = cur_name;
+
/* Create the link through the VOL */
- if (H5VL_link_create(H5VL_LINK_CREATE_SOFT, vol_obj, &loc_params, H5P_LINK_CREATE_DEFAULT,
- H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- cur_name) < 0)
+ if (H5VL_link_create(&vol_cb_args, vol_obj, &loc_params, H5P_LINK_CREATE_DEFAULT,
+ H5P_LINK_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link")
} /* end else-if */
else
@@ -570,9 +586,10 @@ done:
herr_t
H5Gunlink(hid_t loc_id, const char *name)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*s", loc_id, name);
@@ -594,9 +611,11 @@ H5Gunlink(hid_t loc_id, const char *name)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_DELETE;
+
/* Delete the link */
- if (H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_DELETE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link")
done:
@@ -614,9 +633,10 @@ done:
herr_t
H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf /*out*/)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*szx", loc_id, name, size, buf);
@@ -629,6 +649,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf /*out*/)
if (H5CX_set_loc(loc_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.obj_type = H5I_get_type(loc_id);
loc_params.loc_data.loc_by_name.name = name;
@@ -638,9 +659,13 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf /*out*/)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_VAL;
+ vol_cb_args.args.get_val.buf = buf;
+ vol_cb_args.args.get_val.buf_size = size;
+
/* Get the link value */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_VAL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, buf,
- size) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get link value")
done:
@@ -667,9 +692,11 @@ done:
herr_t
H5Gset_comment(hid_t loc_id, const char *name, const char *comment)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "i*s*s", loc_id, name, comment);
@@ -691,9 +718,14 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment)
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ obj_opt_args.set_comment.comment = comment;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_SET_COMMENT;
+ vol_cb_args.args = &obj_opt_args;
+
/* Set the comment */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_SET_COMMENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, comment) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "unable to set comment value")
done:
@@ -726,10 +758,12 @@ done:
int
H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf /*out*/)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- ssize_t op_ret; /* Return value from operation */
- int ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ size_t comment_len = 0; /* Length of comment */
+ int ret_value; /* Return value */
FUNC_ENTER_API(-1)
H5TRACE4("Is", "i*szx", loc_id, name, bufsize, buf);
@@ -753,13 +787,20 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf /*out*/
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_comment.buf = buf;
+ obj_opt_args.get_comment.buf_size = bufsize;
+ obj_opt_args.get_comment.comment_len = &comment_len;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_COMMENT;
+ vol_cb_args.args = &obj_opt_args;
+
/* Get the comment */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_COMMENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, buf, bufsize, &op_ret) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, -1, "unable to get comment value")
/* Set return value */
- ret_value = (int)op_ret;
+ ret_value = (int)comment_len;
done:
FUNC_LEAVE_API(ret_value)
@@ -792,12 +833,11 @@ done:
herr_t
H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, void *op_data)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5G_link_iterate_t lnk_op; /* Link operator */
- hsize_t last_obj; /* Index of last object looked at */
- hsize_t idx; /* Internal location to hold index */
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_group_optional_args_t grp_opt_args; /* Arguments for optional operation */
+ hsize_t last_obj = 0; /* Pointer to index value */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*s*IsGi*x", loc_id, name, idx_p, op, op_data);
@@ -810,30 +850,28 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, void *o
if (!op)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified")
- /* Set number of objects looked at to zero */
- last_obj = 0;
- idx = (hsize_t)(idx_p == NULL ? 0 : *idx_p);
-
- /* Build link operator info */
- lnk_op.op_type = H5G_LINK_OP_OLD;
- lnk_op.op_func.op_old = op;
-
- /* Fill out location struct */
- loc_params.type = H5VL_OBJECT_BY_NAME;
- loc_params.loc_data.loc_by_name.name = name;
- loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
- loc_params.obj_type = H5I_get_type(loc_id);
-
/* Get the object pointer */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ID, H5E_BADTYPE, (-1), "invalid identifier")
+ /* Set up VOL callback arguments */
+ grp_opt_args.iterate_old.loc_params.type = H5VL_OBJECT_BY_NAME;
+ grp_opt_args.iterate_old.loc_params.loc_data.loc_by_name.name = name;
+ grp_opt_args.iterate_old.loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+ grp_opt_args.iterate_old.loc_params.obj_type = H5I_get_type(loc_id);
+ grp_opt_args.iterate_old.idx = (hsize_t)(idx_p == NULL ? 0 : *idx_p);
+ grp_opt_args.iterate_old.last_obj = &last_obj;
+ grp_opt_args.iterate_old.op = op;
+ grp_opt_args.iterate_old.op_data = op_data;
+ vol_cb_args.op_type = H5VL_NATIVE_GROUP_ITERATE_OLD;
+ vol_cb_args.args = &grp_opt_args;
+
/* Call private iteration function, through VOL callback */
- if ((ret_value = H5VL_group_optional(vol_obj, H5VL_NATIVE_GROUP_ITERATE_OLD, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, idx, &last_obj, &lnk_op, op_data)) < 0)
+ if ((ret_value = H5VL_group_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)) <
+ 0)
HERROR(H5E_SYM, H5E_BADITER, "error iterating over group's links");
- /* Set the index we stopped at */
+ /* Set value to return */
if (idx_p)
*idx_p = (int)last_obj;
@@ -860,11 +898,11 @@ done:
herr_t
H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs /*out*/)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5I_type_t id_type; /* Type of ID */
- H5VL_loc_params_t loc_params;
- H5G_info_t grp_info; /* Group information */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_group_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5I_type_t id_type; /* Type of ID */
+ H5G_info_t grp_info; /* Group information */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", loc_id, num_objs);
@@ -876,17 +914,14 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs /*out*/)
if (!num_objs)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad pointer to # of objects")
- /* Fill in location struct fields */
- loc_params.type = H5VL_OBJECT_BY_SELF;
- loc_params.obj_type = id_type;
-
- /* Get group location */
- if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback & object access arguments */
+ vol_cb_args.op_type = H5VL_GROUP_GET_INFO;
+ if (H5VL_setup_self_args(loc_id, &vol_obj, &vol_cb_args.args.get_info.loc_params) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set object access arguments")
+ vol_cb_args.args.get_info.ginfo = &grp_info;
/* Retrieve the group's information */
- if (H5VL_group_get(vol_obj, H5VL_GROUP_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
- &grp_info) < 0)
+ if (H5VL_group_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get group info")
/* Set the number of objects [i.e. links] in the group */
@@ -916,9 +951,10 @@ done:
herr_t
H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf /*out*/)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_group_optional_args_t grp_opt_args; /* Arguments for optional operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL);
H5TRACE4("e", "i*sbx", loc_id, name, follow_link, statbuf);
@@ -931,20 +967,22 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *
if (H5CX_set_loc(loc_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info");
- /* Retrieve object info */
- /* Fill out location struct */
- loc_params.type = H5VL_OBJECT_BY_NAME;
- loc_params.loc_data.loc_by_name.name = name;
- loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
- loc_params.obj_type = H5I_get_type(loc_id);
-
/* Get the location object */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
+ /* Set up VOL callback arguments */
+ grp_opt_args.get_objinfo.loc_params.type = H5VL_OBJECT_BY_NAME;
+ grp_opt_args.get_objinfo.loc_params.loc_data.loc_by_name.name = name;
+ grp_opt_args.get_objinfo.loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+ grp_opt_args.get_objinfo.loc_params.obj_type = H5I_get_type(loc_id);
+ grp_opt_args.get_objinfo.follow_link = follow_link;
+ grp_opt_args.get_objinfo.statbuf = statbuf;
+ vol_cb_args.op_type = H5VL_NATIVE_GROUP_GET_OBJINFO;
+ vol_cb_args.args = &grp_opt_args;
+
/* Retrieve the object's information */
- if (H5VL_group_optional(vol_obj, H5VL_NATIVE_GROUP_GET_OBJINFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &loc_params, (unsigned)follow_link, statbuf) < 0)
+ if (H5VL_group_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name);
done:
@@ -1087,7 +1125,10 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, H5
/* Get information about link to the object. If this fails, e.g.
* because the object is ".", just treat the object as a hard link. */
- H5E_BEGIN_TRY { ret = H5L_get_info(loc, name, &linfo); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5L_get_info(loc, name, &linfo);
+ }
H5E_END_TRY;
if (ret >= 0 && linfo.type != H5L_TYPE_HARD) {
@@ -1133,9 +1174,11 @@ done:
ssize_t
H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name /*out*/, size_t size)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- ssize_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ size_t name_len = 0; /* Length of object name */
+ ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("Zs", "ihxz", loc_id, idx, name, size);
@@ -1144,7 +1187,7 @@ H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name /*out*/, size_t size
if (H5CX_set_loc(loc_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTSET, (-1), "can't set collective metadata read info")
- /* Fill in location struct fields */
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_IDX;
loc_params.loc_data.loc_by_idx.name = ".";
loc_params.loc_data.loc_by_idx.idx_type = H5_INDEX_NAME;
@@ -1157,11 +1200,19 @@ H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name /*out*/, size_t size
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_NAME;
+ vol_cb_args.args.get_name.name_size = size;
+ vol_cb_args.args.get_name.name = name;
+ vol_cb_args.args.get_name.name_len = &name_len;
+
/* Call internal function */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- name, size, &ret_value) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, (-1), "can't get object name")
+ /* Set the return value */
+ ret_value = (ssize_t)name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Gget_objname_by_idx() */
@@ -1184,10 +1235,11 @@ done:
H5G_obj_t
H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5O_info2_t oinfo; /* Object info (contains object type) */
- H5G_obj_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5O_info2_t oinfo; /* Object info (contains object type) */
+ H5G_obj_t ret_value; /* Return value */
FUNC_ENTER_API(H5G_UNKNOWN)
H5TRACE2("Go", "ih", loc_id, idx);
@@ -1205,9 +1257,13 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx)
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_INFO;
+ vol_cb_args.args.get_info.oinfo = &oinfo;
+ vol_cb_args.args.get_info.fields = H5O_INFO_BASIC;
+
/* Retrieve the object's basic information (which includes its type) */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &oinfo, H5O_INFO_BASIC) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't get object info")
/* Map to group object type */
diff --git a/src/H5Gent.c b/src/H5Gent.c
index b26e308..2f1a2b4 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -384,11 +384,8 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk
/* Reset the new entry */
H5G__ent_reset(ent);
- /*
- * Add the new name to the heap.
- */
- name_offset = H5HL_insert(f, heap, HDstrlen(name) + 1, name);
- if (0 == name_offset || UFAIL == name_offset)
+ /* Add the new name to the heap */
+ if (H5HL_insert(f, heap, HDstrlen(name) + 1, name, &name_offset) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert symbol name into heap")
ent->name_off = name_offset;
@@ -476,14 +473,12 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk
size_t lnk_offset; /* Offset to sym-link value */
/* Insert link value into local heap */
- if (UFAIL ==
- (lnk_offset = H5HL_insert(f, heap, HDstrlen(lnk->u.soft.name) + 1, lnk->u.soft.name)))
+ if (H5HL_insert(f, heap, HDstrlen(lnk->u.soft.name) + 1, lnk->u.soft.name, &lnk_offset) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write link value to local heap")
ent->type = H5G_CACHED_SLINK;
ent->cache.slink.lval_offset = lnk_offset;
- } /* end case */
- break;
+ } break;
case H5L_TYPE_ERROR:
case H5L_TYPE_EXTERNAL:
diff --git a/src/H5Gint.c b/src/H5Gint.c
index dab7a54..90a2c6b 100644
--- a/src/H5Gint.c
+++ b/src/H5Gint.c
@@ -38,6 +38,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
#include "H5MMprivate.h" /* Memory management */
+#include "H5SLprivate.h" /* Skip lists */
/****************/
/* Local Macros */
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index 7d08b54..2844c66 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -53,12 +53,6 @@ typedef struct {
H5G_loc_t *loc; /* Group location to set */
} H5G_loc_fnd_t;
-/* User data for checking if an object exists */
-typedef struct {
- /* upward */
- htri_t exists; /* Whether the object exists */
-} H5G_loc_exists_t;
-
/* User data for looking up an object in a group by index */
typedef struct {
/* downward */
@@ -103,7 +97,7 @@ typedef struct {
size_t bufsize; /* Size of object comment buffer */
/* upward */
- ssize_t comment_size; /* Actual size of object comment */
+ size_t comment_size; /* Actual size of object comment */
} H5G_loc_gc_t;
/********************/
@@ -616,24 +610,26 @@ H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_
const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
H5G_own_loc_t *own_loc /*out*/)
{
- H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */
+ hbool_t *exists = (hbool_t *)_udata; /* User data passed in */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_STATIC_NOERR
+ FUNC_ENTER_STATIC
/* Check if the name in this group resolved to a valid object */
if (obj_loc == NULL)
if (lnk)
- udata->exists = FALSE;
+ *exists = FALSE;
else
- udata->exists = FAIL;
+ HGOTO_ERROR(H5E_SYM, H5E_INTERNAL, FAIL, "no object or link info?")
else
- udata->exists = TRUE;
+ *exists = TRUE;
/* Indicate that this callback didn't take ownership of the group *
* location for the object */
*own_loc = H5G_OWN_NONE;
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G__loc_exists_cb() */
/*-------------------------------------------------------------------------
@@ -649,28 +645,22 @@ H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_
*
*-------------------------------------------------------------------------
*/
-htri_t
-H5G_loc_exists(const H5G_loc_t *loc, const char *name)
+herr_t
+H5G_loc_exists(const H5G_loc_t *loc, const char *name, hbool_t *exists)
{
- H5G_loc_exists_t udata; /* User data for traversal callback */
- htri_t ret_value = FAIL; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Check args. */
HDassert(loc);
HDassert(name && *name);
-
- /* Set up user data for locating object */
- udata.exists = FALSE;
+ HDassert(exists);
/* Traverse group hierarchy to locate object */
- if (H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, &udata) < 0)
+ if (H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, exists) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists")
- /* Set return value */
- ret_value = udata.exists;
-
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_loc_exists() */
@@ -1024,7 +1014,7 @@ H5G__loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_
else {
if (udata->comment && udata->bufsize)
HDstrncpy(udata->comment, comment.s, udata->bufsize);
- udata->comment_size = (ssize_t)HDstrlen(comment.s);
+ udata->comment_size = HDstrlen(comment.s);
H5O_msg_reset(H5O_NAME_ID, &comment);
}
@@ -1043,22 +1033,19 @@ done:
* Purpose: Retrieve the information for an object from a group location
* and path to that object
*
- * Return: Success: Number of bytes in the comment excluding the
- * null terminator. Zero if the object has no
- * comment.
- *
- * Failure: Negative
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Thursday, August 30, 2007
*
*-------------------------------------------------------------------------
*/
-ssize_t
-H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment /*out*/, size_t bufsize)
+herr_t
+H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment /*out*/, size_t bufsize,
+ size_t *comment_len)
{
- H5G_loc_gc_t udata; /* User data for traversal callback */
- ssize_t ret_value = -1; /* Return value */
+ H5G_loc_gc_t udata; /* User data for traversal callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1069,14 +1056,15 @@ H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment /*out*
/* Set up user data for locating object */
udata.comment = comment;
udata.bufsize = bufsize;
- udata.comment_size = (-1);
+ udata.comment_size = 0;
/* Traverse group hierarchy to locate object */
if (H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_get_comment_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object")
- /* Set the return value */
- ret_value = udata.comment_size;
+ /* Set value to return */
+ if (comment_len)
+ *comment_len = udata.comment_size;
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h
index 219342d..a0e121d 100644
--- a/src/H5Gmodule.h
+++ b/src/H5Gmodule.h
@@ -29,11 +29,117 @@
#define H5_MY_PKG_ERR H5E_SYM
#define H5_MY_PKG_INIT YES
-/**
- * \defgroup H5G H5G
- * \brief Group Interface
- * \details The HDF5 Group Interface, H5G, provides a mechanism for managing
- * HDF5 groups and their members, which are other HDF5 objects.
+/** \defgroup H5G H5G
+ *
+ * Use the functions in this module to manage HDF5 groups.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5G_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5G_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5G_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5G_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \details \Bold{Groups in HDF5:} A group associates names with objects and
+ * provides a mechanism for mapping a name to an object. Since all
+ * objects appear in at least one group (with the possible exception of
+ * the root object) and since objects can have names in more than one
+ * group, the set of all objects in an HDF5 file is a directed
+ * graph. The internal nodes (nodes with out-degree greater than zero)
+ * must be groups while the leaf nodes (nodes with out-degree zero) are
+ * either empty groups or objects of some other type. Exactly one
+ * object in every non-empty file is the root object. The root object
+ * always has a positive in-degree because it is pointed to by the file
+ * super block.
+ *
+ * \Bold{Locating objects in the HDF5 file hierarchy:} An object name
+ * consists of one or more components separated from one another by
+ * slashes. An absolute name begins with a slash and the object is
+ * located by looking for the first component in the root object, then
+ * looking for the second component in the first object, etc., until
+ * the entire name is traversed. A relative name does not begin with a
+ * slash and the traversal begins at the location specified by the
+ * create or access function.
+ *
+ * \Bold{Group implementations in HDF5:} The original HDF5 group
+ * implementation provided a single indexed structure for link
+ * storage. A new group implementation, in HDF5 Release 1.8.0, enables
+ * more efficient compact storage for very small groups, improved link
+ * indexing for large groups, and other advanced features.
+ *
+ * \li The \Emph{original indexed} format remains the default. Links
+ * are stored in a B-tree in the group’s local heap.
+ * \li Groups created in the new \Emph{compact-or-indexed} format, the
+ * implementation introduced with Release 1.8.0, can be tuned for
+ * performance, switching between the compact and indexed formats
+ * at thresholds set in the user application.
+ * - The \Emph{compact} format will conserve file space and processing
+ * overhead when working with small groups and is particularly
+ * valuable when a group contains no links. Links are stored
+ * as a list of messages in the group’s header.
+ * - The \Emph{indexed} format will yield improved
+ * performance when working with large groups, e.g., groups
+ * containing thousands to millions of members. Links are stored in
+ * a fractal heap and indexed with an improved B-tree.
+ * \li The new implementation also enables the use of link names consisting of
+ * non-ASCII character sets (see H5Pset_char_encoding()) and is
+ * required for all link types other than hard or soft links, e.g.,
+ * external and user-defined links (see the \ref H5L APIs).
+ *
+ * The original group structure and the newer structures are not
+ * directly interoperable. By default, a group will be created in the
+ * original indexed format. An existing group can be changed to a
+ * compact-or-indexed format if the need arises; there is no capability
+ * to change back. As stated above, once in the compact-or-indexed
+ * format, a group can switch between compact and indexed as needed.
+ *
+ * Groups will be initially created in the compact-or-indexed format
+ * only when one or more of the following conditions is met:
+ * \li The low version bound value of the library version bounds property
+ * has been set to Release 1.8.0 or later in the file access property
+ * list (see H5Pset_libver_bounds()). Currently, that would require an
+ * H5Pset_libver_bounds() call with the low parameter set to
+ * #H5F_LIBVER_LATEST.\n When this property is set for an HDF5 file,
+ * all objects in the file will be created using the latest available
+ * format; no effort will be made to create a file that can be read by
+ * older libraries.
+ * \li The creation order tracking property, #H5P_CRT_ORDER_TRACKED, has been
+ * set in the group creation property list (see H5Pset_link_creation_order()).
+ *
+ * An existing group, currently in the original indexed format, will be
+ * converted to the compact-or-indexed format upon the occurrence of
+ * any of the following events:
+ * \li An external or user-defined link is inserted into the group.
+ * \li A link named with a string composed of non-ASCII characters is
+ * inserted into the group.
+ *
+ * The compact-or-indexed format offers performance improvements that
+ * will be most notable at the extremes, i.e., in groups with zero
+ * members and in groups with tens of thousands of members. But
+ * measurable differences may sometimes appear at a threshold as low as
+ * eight group members. Since these performance thresholds and criteria
+ * differ from application to application, tunable settings are
+ * provided to govern the switch between the compact and indexed
+ * formats (see H5Pset_link_phase_change()). Optimal thresholds will
+ * depend on the application and the operating environment.
+ *
+ * Future versions of HDF5 will retain the ability to create, read,
+ * write, and manipulate all groups stored in either the original
+ * indexed format or the compact-or-indexed format.
+ *
*/
#endif /* H5Gmodule_H */
diff --git a/src/H5Gname.c b/src/H5Gname.c
index 2465f01..c139a4e 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -468,11 +468,10 @@ H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth)
*
*-------------------------------------------------------------------------
*/
-ssize_t
-H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, hbool_t *cached)
+herr_t
+H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name_len, hbool_t *cached)
{
- ssize_t len = 0; /* Length of object's name */
- ssize_t ret_value = -1; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -481,14 +480,20 @@ H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, hbool_t *cac
/* If the user path is available and it's not "hidden", use it */
if (loc->path->user_path_r != NULL && loc->path->obj_hidden == 0) {
+ size_t len; /* Length of object's name */
+
len = H5RS_len(loc->path->user_path_r);
if (name) {
- HDstrncpy(name, H5RS_get_str(loc->path->user_path_r), MIN((size_t)(len + 1), size));
- if ((size_t)len >= size)
+ HDstrncpy(name, H5RS_get_str(loc->path->user_path_r), MIN((len + 1), size));
+ if (len >= size)
name[size - 1] = '\0';
} /* end if */
+ /* Set name length, if requested */
+ if (name_len)
+ *name_len = len;
+
/* Indicate that the name is cached, if requested */
/* (Currently only used for testing - QAK, 2010/07/26) */
if (cached)
@@ -496,7 +501,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, hbool_t *cac
} /* end if */
else if (!loc->path->obj_hidden) {
/* Search for name of object */
- if ((len = H5G_get_name_by_addr(loc->oloc->file, loc->oloc, name, size)) < 0)
+ if (H5G_get_name_by_addr(loc->oloc->file, loc->oloc, name, size, name_len) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine name")
/* Indicate that the name is _not_ cached, if requested */
@@ -505,9 +510,6 @@ H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, hbool_t *cac
*cached = FALSE;
} /* end else */
- /* Set return value */
- ret_value = len;
-
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_get_name() */
@@ -1152,28 +1154,29 @@ done:
*
*-------------------------------------------------------------------------
*/
-ssize_t
-H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size)
+herr_t
+H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size, size_t *name_len)
{
- H5G_gnba_iter_t udata; /* User data for iteration */
- H5G_loc_t root_loc; /* Root group's location */
- hbool_t found_obj = FALSE; /* If we found the object */
- herr_t status; /* Status from iteration */
- ssize_t ret_value = -1; /* Return value */
+ H5G_gnba_iter_t udata; /* User data for iteration */
+ size_t len; /* Length of path name */
+ H5G_loc_t root_loc; /* Root group's location */
+ hbool_t found_obj = FALSE; /* If we found the object */
+ herr_t status; /* Status from iteration */
+ herr_t ret_value = SUCCEED; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
- FUNC_ENTER_NOAPI((-1))
+ FUNC_ENTER_NOAPI(FAIL)
/* Construct a group location for root group of the file */
if (H5G_root_loc(f, &root_loc) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, (-1), "can't get root group's location")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get root group's location")
/* Check for root group being the object looked for */
if (root_loc.oloc->addr == loc->addr && root_loc.oloc->file == loc->file) {
if (NULL == (udata.path = H5MM_strdup("")))
- HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, (-1), "can't duplicate path string")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "can't duplicate path string")
found_obj = TRUE;
} /* end if */
else {
@@ -1184,7 +1187,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size)
/* Visit all the links in the file */
if ((status = H5G_visit(&root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G__get_name_by_addr_cb,
&udata)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_BADITER, (-1), "group traversal failed while looking for object name")
+ HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group traversal failed while looking for object name")
else if (status > 0)
found_obj = TRUE;
} /* end else */
@@ -1192,7 +1195,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size)
/* Check for finding the object */
if (found_obj) {
/* Set the length of the full path */
- ret_value = (ssize_t)(HDstrlen(udata.path) + 1); /* Length of path + 1 (for "/") */
+ len = HDstrlen(udata.path) + 1; /* Length of path + 1 (for "/") */
/* If there's a buffer provided, copy into it, up to the limit of its size */
if (name) {
@@ -1202,12 +1205,16 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size)
/* Append the rest of the path */
/* (less one character, for the initial path separator) */
HDstrncat(name, udata.path, (size - 2));
- if ((size_t)ret_value >= size)
+ if (len >= size)
name[size - 1] = '\0';
} /* end if */
} /* end if */
else
- ret_value = 0;
+ len = 0;
+
+ /* Set path name length, if given */
+ if (name_len)
+ *name_len = len;
done:
/* Release resources */
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index 1ca6b14..66917c2 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -767,13 +767,13 @@ done:
*
*-------------------------------------------------------------------------
*/
-ssize_t
+herr_t
H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
- char *name, size_t size)
+ char *name, size_t name_size, size_t *name_len)
{
- H5O_linfo_t linfo; /* Link info message */
- htri_t linfo_exists; /* Whether the link info message exists */
- ssize_t ret_value = -1; /* Return value */
+ H5O_linfo_t linfo; /* Link info message */
+ htri_t linfo_exists; /* Whether the link info message exists */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL)
@@ -785,22 +785,21 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, H5_iter_orde
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message")
if (linfo_exists) {
/* Check for creation order tracking, if creation order index lookup requested */
- if (idx_type == H5_INDEX_CRT_ORDER) {
+ if (idx_type == H5_INDEX_CRT_ORDER)
/* Check if creation order is tracked */
if (!linfo.track_corder)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "creation order not tracked for links in group")
- } /* end if */
/* Check for dense link storage */
if (H5F_addr_defined(linfo.fheap_addr)) {
/* Get the object's name from the dense link storage */
- if ((ret_value = H5G__dense_get_name_by_idx(oloc->file, &linfo, idx_type, order, n, name, size)) <
- 0)
+ if (H5G__dense_get_name_by_idx(oloc->file, &linfo, idx_type, order, n, name, name_size,
+ name_len) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name")
} /* end if */
else {
/* Get the object's name from the link messages */
- if ((ret_value = H5G__compact_get_name_by_idx(oloc, &linfo, idx_type, order, n, name, size)) < 0)
+ if (H5G__compact_get_name_by_idx(oloc, &linfo, idx_type, order, n, name, name_size, name_len) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name")
} /* end else */
} /* end if */
@@ -810,7 +809,7 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, H5_iter_orde
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query")
/* Get the object's name from the symbol table */
- if ((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size)) < 0)
+ if (H5G__stab_get_name_by_idx(oloc, order, n, name, name_size, name_len) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name")
} /* end else */
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index bebbfe6..d108b03 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -30,12 +30,11 @@
#include "H5Gprivate.h"
/* Other private headers needed by this file */
-#include "H5B2private.h" /* v2 B-trees */
+#include "H5B2private.h" /* v2 B-trees */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5HFprivate.h" /* Fractal heaps */
-#include "H5HLprivate.h" /* Local Heaps */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5SLprivate.h" /* Skip lists */
+#include "H5HFprivate.h" /* Fractal heaps */
+#include "H5HLprivate.h" /* Local Heaps */
+#include "H5Oprivate.h" /* Object headers */
/**************************/
/* Package Private Macros */
@@ -66,10 +65,10 @@
* symbol table entry.
*/
typedef enum H5G_cache_type_t {
- H5G_CACHED_ERROR = -1, /*force enum to be signed */
+ H5G_CACHED_ERROR = -1, /*force enum to be signed */
H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */
H5G_CACHED_STAB = 1, /*symbol table, `stab' */
- H5G_CACHED_SLINK = 2, /*symbolic link */
+ H5G_CACHED_SLINK = 2, /*symbolic link */
H5G_NCACHED /*THIS MUST BE LAST */
} H5G_cache_type_t;
@@ -88,7 +87,7 @@ typedef union H5G_cache_t {
} stab;
struct {
- size_t lval_offset; /*link value offset */
+ size_t lval_offset; /*link value offset */
} slink;
} H5G_cache_t;
@@ -157,7 +156,7 @@ typedef struct {
typedef struct H5G_bt_common_t {
/* downward */
const char *name; /*points to temporary memory */
- H5HL_t * heap; /*symbol table heap */
+ H5HL_t * heap; /*symbol table heap */
} H5G_bt_common_t;
/*
@@ -204,10 +203,10 @@ typedef struct H5G_bt_lkp_t {
*/
typedef struct H5G_bt_it_it_t {
/* downward */
- H5HL_t * heap; /*symbol table heap */
- hsize_t skip; /*initial entries to skip */
- H5G_lib_iterate_t op; /*iteration operator */
- void * op_data; /*user-defined operator data */
+ H5HL_t * heap; /*symbol table heap */
+ hsize_t skip; /*initial entries to skip */
+ H5G_lib_iterate_t op; /*iteration operator */
+ void * op_data; /*user-defined operator data */
/* upward */
hsize_t *final_ent; /*final entry looked at */
@@ -359,14 +358,14 @@ H5_DLL herr_t H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, hs
H5G_lib_iterate_t op, void *op_data);
H5_DLL herr_t H5G__stab_count(const struct H5O_loc_t *oloc, hsize_t *num_objs);
H5_DLL herr_t H5G__stab_bh_size(H5F_t *f, const H5O_stab_t *stab, H5_ih_info_t *bh_info);
-H5_DLL ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, char *name,
- size_t size);
-H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name);
-H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r,
- H5_iter_order_t order, hsize_t n);
-H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5O_link_t *lnk);
-H5_DLL herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n,
- H5O_link_t *lnk);
+H5_DLL herr_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, char *name,
+ size_t name_size, size_t *name_len);
+H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name);
+H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r,
+ H5_iter_order_t order, hsize_t n);
+H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5O_link_t *lnk);
+H5_DLL herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n,
+ H5O_link_t *lnk);
#ifndef H5_STRICT_FORMAT_CHECKS
H5_DLL herr_t H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab);
#endif /* H5_STRICT_FORMAT_CHECKS */
@@ -406,41 +405,42 @@ H5_DLL herr_t H5G__link_release_table(H5G_link_table_t *ltable);
H5_DLL herr_t H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk);
/* Functions that understand "compact" link storage */
-H5_DLL herr_t H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk);
-H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo,
- H5_index_t idx_type, H5_iter_order_t order, hsize_t idx,
- char *name, size_t size);
-H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name);
-H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo,
- H5RS_str_t *grp_full_path_r, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n);
-H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk,
- H5G_lib_iterate_t op, void *op_data);
-H5_DLL herr_t H5G__compact_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found,
- H5O_link_t *lnk);
+H5_DLL herr_t H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk);
+H5_DLL herr_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo,
+ H5_index_t idx_type, H5_iter_order_t order, hsize_t idx,
+ char *name, size_t name_size, size_t *name_len);
+H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name);
+H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo,
+ H5RS_str_t *grp_full_path_r, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n);
+H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk,
+ H5G_lib_iterate_t op, void *op_data);
+H5_DLL herr_t H5G__compact_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found,
+ H5O_link_t *lnk);
H5_DLL herr_t H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, H5O_link_t *lnk);
/* Functions that understand "dense" link storage */
-H5_DLL herr_t H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, H5G_link_table_t *ltable);
-H5_DLL herr_t H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline);
-H5_DLL herr_t H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk);
-H5_DLL herr_t H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, hbool_t *found,
- H5O_link_t *lnk);
-H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, H5O_link_t *lnk);
-H5_DLL herr_t H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op,
- void *op_data);
-H5_DLL ssize_t H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, char *name, size_t size);
-H5_DLL herr_t H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r,
- const char *name);
-H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r,
- H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
-H5_DLL herr_t H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link);
+H5_DLL herr_t H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
+ H5_iter_order_t order, H5G_link_table_t *ltable);
+H5_DLL herr_t H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline);
+H5_DLL herr_t H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk);
+H5_DLL herr_t H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, hbool_t *found,
+ H5O_link_t *lnk);
+H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, H5O_link_t *lnk);
+H5_DLL herr_t H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op,
+ void *op_data);
+H5_DLL herr_t H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, char *name, size_t name_size,
+ size_t *name_len);
+H5_DLL herr_t H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r,
+ const char *name);
+H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r,
+ H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
+H5_DLL herr_t H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link);
/* Functions that understand group objects */
H5_DLL herr_t H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc /*out*/);
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index b9f83c4..4cf4623 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -29,9 +29,9 @@
#include "H5Gpublic.h"
/* Private headers needed by this file */
-#include "H5private.h" /* Generic Functions */
-#include "H5Bprivate.h" /* B-trees */
-#include "H5Fprivate.h" /* File access */
+#include "H5private.h" /* Generic Functions */
+#include "H5Bprivate.h" /* B-trees */
+#include "H5Fprivate.h" /* File access */
#include "H5RSprivate.h" /* Reference-counted strings */
/*
@@ -42,7 +42,7 @@
((sizeof_size) + /*offset of name into heap */ \
(sizeof_addr) + /*address of object header */ \
4 + /*entry type */ \
- 4 + /*reserved */ \
+ 4 + /*reserved */ \
H5G_SIZEOF_SCRATCH) /*scratch pad space */
#define H5G_SIZEOF_ENTRY_FILE(F) H5G_SIZEOF_ENTRY(H5F_SIZEOF_ADDR(F), H5F_SIZEOF_SIZE(F))
@@ -144,7 +144,7 @@ struct H5O_link_t;
* The "location" of an object in a group hierarchy. This points to an object
* location and a group hierarchy path for the object.
*/
-typedef struct {
+typedef struct H5G_loc_t {
struct H5O_loc_t *oloc; /* Object header location */
H5G_name_t * path; /* Group hierarchy path */
} H5G_loc_t;
@@ -227,16 +227,17 @@ H5_DLL herr_t H5G_link_to_info(const struct H5O_loc_t *link_loc, const struct H5
/*
* Functions that understand group objects
*/
-H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, const char *name, struct H5O_link_t *obj_lnk,
- hbool_t adj_link, H5O_type_t obj_type, const void *crt_info);
-H5_DLL ssize_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, char *name, size_t size);
-H5_DLL herr_t H5G_obj_remove(const struct H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name);
-H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r,
- H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
-H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk);
-H5_DLL hid_t H5G_get_create_plist(const H5G_t *grp);
+H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, const char *name, struct H5O_link_t *obj_lnk,
+ hbool_t adj_link, H5O_type_t obj_type, const void *crt_info);
+H5_DLL herr_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, char *name, size_t name_size,
+ size_t *name_len);
+H5_DLL herr_t H5G_obj_remove(const struct H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name);
+H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r,
+ H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
+H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk);
+H5_DLL hid_t H5G_get_create_plist(const H5G_t *grp);
/*
* These functions operate on symbol table nodes.
@@ -253,35 +254,37 @@ H5_DLL herr_t H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *en
/*
* These functions operate on group hierarchy names.
*/
-H5_DLL herr_t H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name);
-H5_DLL herr_t H5G_name_replace(const struct H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file,
- H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r);
-H5_DLL herr_t H5G_name_reset(H5G_name_t *name);
-H5_DLL herr_t H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth);
-H5_DLL herr_t H5G_name_free(H5G_name_t *name);
-H5_DLL ssize_t H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, hbool_t *cached);
-H5_DLL ssize_t H5G_get_name_by_addr(H5F_t *f, const struct H5O_loc_t *loc, char *name, size_t size);
+H5_DLL herr_t H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name);
+H5_DLL herr_t H5G_name_replace(const struct H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file,
+ H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r);
+H5_DLL herr_t H5G_name_reset(H5G_name_t *name);
+H5_DLL herr_t H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth);
+H5_DLL herr_t H5G_name_free(H5G_name_t *name);
+H5_DLL herr_t H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name_len,
+ hbool_t *cached);
+H5_DLL herr_t H5G_get_name_by_addr(H5F_t *f, const struct H5O_loc_t *loc, char *name, size_t size,
+ size_t *name_len);
H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name);
/*
* These functions operate on group "locations"
*/
-H5_DLL herr_t H5G_loc_real(void *obj, H5I_type_t type, H5G_loc_t *loc);
-H5_DLL herr_t H5G_loc(hid_t loc_id, H5G_loc_t *loc);
-H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth);
-H5_DLL herr_t H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc /*out*/);
-H5_DLL herr_t H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, H5G_loc_t *obj_loc /*out*/);
-H5_DLL htri_t H5G_loc_exists(const H5G_loc_t *loc, const char *name);
-H5_DLL herr_t H5G_loc_info(const H5G_loc_t *loc, const char *name, H5O_info2_t *oinfo /*out*/,
- unsigned fields);
-H5_DLL herr_t H5G_loc_native_info(const H5G_loc_t *loc, const char *name, H5O_native_info_t *oinfo /*out*/,
- unsigned fields);
-H5_DLL herr_t H5G_loc_set_comment(const H5G_loc_t *loc, const char *name, const char *comment);
-H5_DLL ssize_t H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment /*out*/,
- size_t bufsize);
-H5_DLL herr_t H5G_loc_reset(H5G_loc_t *loc);
-H5_DLL herr_t H5G_loc_free(H5G_loc_t *loc);
+H5_DLL herr_t H5G_loc_real(void *obj, H5I_type_t type, H5G_loc_t *loc);
+H5_DLL herr_t H5G_loc(hid_t loc_id, H5G_loc_t *loc);
+H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth);
+H5_DLL herr_t H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc /*out*/);
+H5_DLL herr_t H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, H5G_loc_t *obj_loc /*out*/);
+H5_DLL herr_t H5G_loc_exists(const H5G_loc_t *loc, const char *name, hbool_t *exists);
+H5_DLL herr_t H5G_loc_info(const H5G_loc_t *loc, const char *name, H5O_info2_t *oinfo /*out*/,
+ unsigned fields);
+H5_DLL herr_t H5G_loc_native_info(const H5G_loc_t *loc, const char *name, H5O_native_info_t *oinfo /*out*/,
+ unsigned fields);
+H5_DLL herr_t H5G_loc_set_comment(const H5G_loc_t *loc, const char *name, const char *comment);
+H5_DLL herr_t H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment /*out*/,
+ size_t bufsize, size_t *comment_len);
+H5_DLL herr_t H5G_loc_reset(H5G_loc_t *loc);
+H5_DLL herr_t H5G_loc_free(H5G_loc_t *loc);
/*
* These functions operate on the root group
diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h
index 68786dc..d9c29f6 100644
--- a/src/H5Gpublic.h
+++ b/src/H5Gpublic.h
@@ -41,24 +41,31 @@
/* Public Typedefs */
/*******************/
-/* Types of link storage for groups */
+//! <!-- [H5G_storage_t_snip] -->
+/**
+ * Types of link storage for groups
+ */
typedef enum H5G_storage_type_t {
- H5G_STORAGE_TYPE_UNKNOWN = -1, /* Unknown link storage type */
- H5G_STORAGE_TYPE_SYMBOL_TABLE, /* Links in group are stored with a "symbol table" */
- /* (this is sometimes called "old-style" groups) */
- H5G_STORAGE_TYPE_COMPACT, /* Links are stored in object header */
- H5G_STORAGE_TYPE_DENSE /* Links are stored in fractal heap & indexed with v2 B-tree */
+ H5G_STORAGE_TYPE_UNKNOWN = -1, /**< Unknown link storage type */
+ H5G_STORAGE_TYPE_SYMBOL_TABLE, /**< Links in group are stored with a "symbol table" */
+ /**< (this is sometimes called "old-style" groups) */
+ H5G_STORAGE_TYPE_COMPACT, /**< Links are stored in object header */
+ H5G_STORAGE_TYPE_DENSE /**< Links are stored in fractal heap & indexed with v2 B-tree */
} H5G_storage_type_t;
+//! <!-- [H5G_storage_t_snip] -->
-/* Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) */
-//! [H5G_info_t_snip]
+//! <!-- [H5G_info_t_snip] -->
+/**
+ * Information struct for group for
+ * H5Gget_info(), H5Gget_info_by_name(), and H5Gget_info_by_idx()
+ */
typedef struct H5G_info_t {
- H5G_storage_type_t storage_type; /* Type of storage for links in group */
- hsize_t nlinks; /* Number of links in group */
- int64_t max_corder; /* Current max. creation order value for group */
- hbool_t mounted; /* Whether group has a file mounted on it */
+ H5G_storage_type_t storage_type; /**< Type of storage for links in group */
+ hsize_t nlinks; /**< Number of links in group */
+ int64_t max_corder; /**< Current max. creation order value for group */
+ hbool_t mounted; /**< Whether group has a file mounted on it */
} H5G_info_t;
-//! [H5G_info_t_snip]
+//! <!-- [H5G_info_t_snip] -->
/********************/
/* Public Variables */
@@ -120,24 +127,8 @@ H5_DLL hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcp
/**
* --------------------------------------------------------------------------
- * \ingroup H5G
- *
- * \brief Asynchronous version of H5Gcreate2()
- *
- * \app_file
- * \app_func
- * \app_line
- * \fgdta_loc_id
- * \param[in] name Name of the group to create
- * \lcpl_id
- * \gcpl_id
- * \gapl_id
- * \es_id
- *
- * \return \hid_t{group}
- *
- * \see H5Gcreate2()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Gcreate}
*/
H5_DLL hid_t H5Gcreate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t es_id);
@@ -223,22 +214,8 @@ H5_DLL hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id);
/**
* --------------------------------------------------------------------------
- * \ingroup H5G
- *
- * \brief Asynchronous version of H5Gopen2()
- *
- * \app_file
- * \app_func
- * \app_line
- * \fgdta_loc_id
- * \param[in] name Name of the group to open
- * \gapl_id
- * \es_id
- *
- * \return \hid_t{group}
- *
- * \see H5Gopen2()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Gopen}
*/
H5_DLL hid_t H5Gopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t gapl_id, hid_t es_id);
@@ -296,21 +273,8 @@ H5_DLL herr_t H5Gget_info(hid_t loc_id, H5G_info_t *ginfo);
/**
* --------------------------------------------------------------------------
- * \ingroup H5G
- *
- * \brief Asynchronous version of H5Gget_info()
- *
- * \app_file
- * \app_func
- * \app_line
- * \fgdta_loc_id
- * \param[out] ginfo Struct in which group information is returned
- * \es_id
- *
- * \return \hid_t{group}
- *
- * \see H5Gget_info()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Gget_info}
*/
H5_DLL herr_t H5Gget_info_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
H5G_info_t *ginfo /*out*/, hid_t es_id);
@@ -351,23 +315,8 @@ H5_DLL herr_t H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *gi
/**
* --------------------------------------------------------------------------
- * \ingroup H5G
- *
- * \brief Asynchronous version of H5Gget_info_by_name()
- *
- * \app_file
- * \app_func
- * \app_line
- * \fgdta_loc_id
- * \param[in] name Name of the group to query
- * \param[out] ginfo Struct in which group information is returned
- * \lapl_id
- * \es_id
- *
- * \return \herr_t
- *
- * \see H5Gget_info_by_name()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Gget_info_by_name}
*/
H5_DLL herr_t H5Gget_info_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
hid_t loc_id, const char *name, H5G_info_t *ginfo /*out*/,
@@ -423,29 +372,8 @@ H5_DLL herr_t H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_
/**
* --------------------------------------------------------------------------
- * \ingroup H5G
- *
- * \brief Asynchronous version of H5Gcreate2()
- *
- * \app_file
- * \app_func
- * \app_line
- * \fgdta_loc_id
- * \param[in] group_name Name of the group to query
- * \param[in] idx_type Transient index identifying object
- * \param[in] order Transient index identifying object
- * \param[in] n Position in the index of the group to query
- * \param[out] ginfo Struct in which group information is returned
- * \lapl_id
- * \es_id
- *
- * \return Returns
- * \li The size of the object name if successful, or
- * \li 0 if no name is associated with the group identifier, or
- * \li negative value, if failure occurred
- *
- * \see H5Gcreate2()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Gget_info_by_idx}
*/
H5_DLL herr_t H5Gget_info_by_idx_async(const char *app_file, const char *app_func, unsigned app_line,
hid_t loc_id, const char *group_name, H5_index_t idx_type,
@@ -523,33 +451,23 @@ H5_DLL herr_t H5Grefresh(hid_t group_id);
* Failure to release a group with this call will result in
* resource leaks.
*
- * \since 1.0.0
+ * \par Example
+ * \snippet H5F_examples.c mount
*
- * \version 1.4.0 Fortran function introduced in this release
+ * \since 1.0.0
*
*/
H5_DLL herr_t H5Gclose(hid_t group_id);
/**
* --------------------------------------------------------------------------
- * \ingroup H5G
- *
- * \brief Asynchronous version of H5Gcreate2()
- *
- * \app_file
- * \app_func
- * \app_line
- * \group_id
- * \es_id
- *
- * \return \herr_t
- *
- * \see H5Gcreate2()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Gclose}
*/
H5_DLL herr_t H5Gclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t group_id,
hid_t es_id);
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -571,6 +489,7 @@ H5_DLL herr_t H5Gclose_async(const char *app_file, const char *app_func, unsigne
#define H5Gget_info_by_idx_async_wrap H5_NO_EXPAND(H5Gget_info_by_idx_async)
#define H5Gclose_async_wrap H5_NO_EXPAND(H5Gclose_async)
#endif /* H5G_MODULE */
+/// \endcond
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -595,60 +514,647 @@ H5_DLL herr_t H5Gclose_async(const char *app_file, const char *app_func, unsigne
/* Typedefs */
-/*
+//! <!-- [H5G_obj_t_snip] -->
+/**
* An object has a certain type. The first few numbers are reserved for use
* internally by HDF5. Users may add their own types with higher values. The
- * values are never stored in the file -- they only exist while an
- * application is running. An object may satisfy the `isa' function for more
- * than one type.
+ * values are never stored in the file -- they only exist while an application
+ * is running. An object may satisfy the `isa' function for more than one type.
+ *
+ * \deprecated
*/
typedef enum H5G_obj_t {
- H5G_UNKNOWN = -1, /* Unknown object type */
- H5G_GROUP, /* Object is a group */
- H5G_DATASET, /* Object is a dataset */
- H5G_TYPE, /* Object is a named data type */
- H5G_LINK, /* Object is a symbolic link */
- H5G_UDLINK, /* Object is a user-defined link */
- H5G_RESERVED_5, /* Reserved for future use */
- H5G_RESERVED_6, /* Reserved for future use */
- H5G_RESERVED_7 /* Reserved for future use */
+ H5G_UNKNOWN = -1, /**< Unknown object type */
+ H5G_GROUP, /**< Object is a group */
+ H5G_DATASET, /**< Object is a dataset */
+ H5G_TYPE, /**< Object is a named data type */
+ H5G_LINK, /**< Object is a symbolic link */
+ H5G_UDLINK, /**< Object is a user-defined link */
+ H5G_RESERVED_5, /**< Reserved for future use */
+ H5G_RESERVED_6, /**< Reserved for future use */
+ H5G_RESERVED_7 /**< Reserved for future use */
} H5G_obj_t;
+//! <!-- [H5G_obj_t_snip] -->
-/** Define the operator function pointer for for H5Giterate() */
-//! [H5G_iterate_t_snip]
+//! <!-- [H5G_iterate_t_snip] -->
+/**
+ * Callback for H5Giterate()
+ *
+ * \deprecated
+ */
typedef herr_t (*H5G_iterate_t)(hid_t group, const char *name, void *op_data);
-//! [H5G_iterate_t_snip]
+//! <!-- [H5G_iterate_t_snip] -->
-/** Information about an object */
-//! [H5G_stat_t_snip]
+//! <!-- [H5G_stat_t_snip] -->
+/**
+ * Information about an object
+ *
+ * \deprecated
+ */
typedef struct H5G_stat_t {
- unsigned long fileno[2]; /*file number */
- unsigned long objno[2]; /*object number */
- unsigned nlink; /*number of hard links to object*/
- H5G_obj_t type; /*basic object type */
- time_t mtime; /*modification time */
- size_t linklen; /*symbolic link value length */
- H5O_stat_t ohdr; /* Object header information */
+ unsigned long fileno[2]; /**< file number */
+ unsigned long objno[2]; /**< object number */
+ unsigned nlink; /**< number of hard links to object*/
+ H5G_obj_t type; /**< basic object type */
+ time_t mtime; /**< modification time */
+ size_t linklen; /**< symbolic link value length */
+ H5O_stat_t ohdr; /**< Object header information */
} H5G_stat_t;
-//! [H5G_stat_t_snip]
+//! <!-- [H5G_stat_t_snip] -->
/* Function prototypes */
-H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint);
-H5_DLL hid_t H5Gopen1(hid_t loc_id, const char *name);
-H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name);
-H5_DLL herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id,
- const char *new_name);
-H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name);
-H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name);
-H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name);
-H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf /*out*/);
-H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment);
-H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf);
-H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5G_iterate_t op, void *op_data);
-H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs);
-H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link,
- H5G_stat_t *statbuf /*out*/);
-H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Creates a new group and links it into the file
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the group to create
+ * \param[in] size_hint The number of bytes to reserve for the names
+ * that will appear in the group
+ *
+ * \return \hid_t{group}
+ *
+ * \deprecated This function is deprecated in favor of H5Gcreate2().
+ *
+ * \details H5Gcreate1() creates a new group with the specified name at the
+ * specified location, \p loc_id. \p loc_id may be a file, group,
+ * dataset, named datatype or attribute. If an attribute, dataset, or
+ * named datatype is specified for \p loc_id then the group will be
+ * created at the location where the attribute, dataset, or named
+ * datatype is attached. The name, name, must not already be taken by
+ * some other object and all parent groups must already exist.
+ *
+ * \p name can be a relative path based at \p loc_id or an absolute
+ * path from the root of the file. Use of this function requires that
+ * any intermediate groups specified in the path already exist.
+ *
+ * The length of a group name, or of the name of any object within a
+ * group, is not limited.
+ *
+ * \p size_hint is a hint for the number of bytes to reserve to store
+ * the names which will be eventually added to the new group. This
+ * value must be between 0 and UINT32_MAX (inclusive). If this
+ * parameter is zero, a default value will be used.
+ *
+ * The return value is a group identifier for the open group. This
+ * group identifier should be closed by calling H5Gclose() when it is
+ * no longer needed.
+ *
+ * See H5Gcreate_anon() for a discussion of the differences between
+ * H5Gcreate1() and H5Gcreate_anon().
+ *
+ * \par Example
+ * \snippet H5F_examples.c mount
+ *
+ * \version 1.8.0 Function H5Gcreate() renamed to H5Gcreate1() and deprecated
+ * in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Opens an existing group for modification and returns a group
+ * identifier for that group
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the group to open
+ *
+ * \return \hid_t{group}
+ *
+ * \deprecated This function is deprecated in favor of H5Gopen2().
+ *
+ * \details H5Gopen1() opens an existing group, \p name, at the location
+ * specified by \p loc_id.
+ *
+ * H5Gopen1() returns a group identifier for the group that was
+ * opened. This group identifier should be released by calling
+ * H5Gclose() when it is no longer needed.
+ *
+ * \version 1.8.0 The function H5Gopen() was renamed to H5Gopen1()
+ * and deprecated in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hid_t H5Gopen1(hid_t loc_id, const char *name);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Creates a link of the specified type from \p new_name to \p
+ * cur_name
+ *
+ * \fg_loc_id{cur_loc_id}
+ * \param[in] type Link type
+ * \param[in] cur_name Name of the existing object
+ * \param[in] new_name New name for the object
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated.
+ *
+ * \details H5Glink() creates a new name for an object that has some current
+ * name, possibly one of many names it currently has.
+ *
+ * If \p link_type is #H5G_LINK_HARD, then \p cur_name must specify
+ * the name of an existing object and both names are interpreted
+ * relative to \p cur_loc_id, which is either a file identifier or a
+ * group identifier.
+ *
+ * If \p link_type is #H5G_LINK_SOFT, then \p cur_name can be anything
+ * and is interpreted at lookup time relative to the group which
+ * contains the final component of \p new_name. For instance, if \p
+ * cur_name is \Code{./foo}, \p new_name is \Code{./x/y/bar}, and a
+ * request is made for \Code{./x/y/bar}, then the actual object looked
+ * up is \Code{./x/y/./foo}.
+
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Creates a link of the specified type from \p cur_name to \p
+ * new_name
+ *
+ * \fg_loc_id{cur_loc_id}
+ * \param[in] cur_name Name of the existing object
+ * \param[in] type Link type
+ * \fg_loc_id{new_loc_id}
+ * \param[in] new_name New name for the object
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated.
+ *
+ * \details H5Glink2() creates a new name for an object that has some current
+ * name, possibly one of many names it currently has.
+ *
+ * If \p link_type is #H5G_LINK_HARD, then \p cur_name must specify the
+ * name of an existing object and both names are interpreted relative
+ * to \p cur_loc_id and \p new_loc_id, respectively, which are either
+ * file identifiers or group identifiers.
+ *
+ * If \p link_type is #H5G_LINK_SOFT, then \p cur_name can be anything
+ * and is interpreted at lookup time relative to the group which
+ * contains the final component of \p new_name. For instance, if \p
+ * current_name is \Code{./foo}, \p new_name is \Code{./x/y/bar}, and a
+ * request is made for \Code{./x/y/bar}, then the actual object looked
+ * up is \Code{./x/y/./foo}.
+
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id,
+ const char *new_name);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Renames an object within an HDF5 file
+ *
+ * \fg_loc_id{src_loc_id}
+ * \param[in] src_name Object's original name
+ * \param[in] dst_name Object's new name
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated.
+ *
+ * \details H5Gmove() renames an object within an HDF5 file. The original name,
+ * \p src_name, is unlinked from the group graph and the new name, \p
+ * dst_name, is inserted as an atomic operation. Both names are
+ * interpreted relative to \p loc_id, which is either a file or a group
+ * identifier.
+ *
+ * \attention Exercise care in moving groups as it is possible to render data in
+ * a file inaccessible with H5Gmove(). See The Group Interface in the
+ * HDF5 User's Guide.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Renames an object within an HDF5 file
+ *
+ * \fg_loc_id{src_loc_id}
+ * \param[in] src_name Object's original name
+ * \fg_loc_id{dst_loc_id}
+ * \param[in] dst_name Object's new name
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated.
+ *
+ * \details H5Gmove2() renames an object within an HDF5 file. The original name,
+ * \p src_name, is unlinked from the group graph and the new name, \p
+ * dst_name, is inserted as an atomic operation.
+ *
+ * \p src_name and \p dst_name are interpreted relative to \p
+ * src_loc_id and \p dst_loc_id, respectively, which are either file or
+ * group identifiers.
+ *
+ * \attention Exercise care in moving groups as it is possible to render data in
+ * a file inaccessible with H5Gmove2(). See The Group Interface in the
+ * HDF5 User's Guide.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Removes the link to an object from a group
+ *
+ * \fg_loc_id{loc_id}
+ * \param[in] name Name of the object to unlink
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated in favor of the function H5Ldelete().
+ *
+ * \details H5Gunlink() removes the object specified by \p name from the group
+ * graph and decrements the link count for the object to which \p name
+ * points. This action eliminates any association between name and the
+ * object to which name pointed.
+ *
+ * Object headers keep track of how many hard links refer to an object;
+ * when the link count reaches zero, the object can be removed from the
+ * file. Objects which are open are not removed until all identifiers
+ * to the object are closed.
+ *
+ * If the link count reaches zero, all file space associated with the
+ * object will be released, i.e., identified in memory as freespace. If
+ * any object identifier is open for the object, the space will not be
+ * released until after the object identifier is closed.
+ *
+ * Note that space identified as freespace is available for re-use only
+ * as long as the file remains open; once a file has been closed, the
+ * HDF5 library loses track of freespace. See “Freespace Management” in
+ * the HDF5 User's Guide for further details.
+ *
+ * \attention Exercise care in moving groups as it is possible to render data in
+ * a file inaccessible with H5Gunlink(). See The Group Interface in the
+ * HDF5 User's Guide.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Returns the name of the object that the symbolic link points to
+ *
+ * \fg_loc_id{loc_id}
+ * \param[in] name Symbolic link to the object whose name is to be returned
+ * \param[in] size Maximum number of characters of value to be returned
+ * \param[out] buf A buffer to hold the name of the object being sought
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated in favor of the function H5Lget_val().
+ *
+ * \details H5Gget_linkval() returns up to size characters of the name of the
+ * object that the symbolic link name points to.
+ *
+ * The parameter \p loc_id is a file or group identifier.
+ *
+ * The parameter \p name must be a symbolic link pointing to the
+ * desired object and must be defined relative to \p loc_id.
+ *
+ * If size is smaller than the size of the returned object name, then
+ * the name stored in the buffer value will not be \c NULL terminated.
+ *
+ * This function fails if \p name is not a symbolic link. The presence
+ * of a symbolic link can be tested by passing zero for \p size and \p
+ * NULL for value.
+ *
+ * This function should be used only after H5Lget_info1() (or the
+ * deprecated function H5Gget_objinfo()) has been called to verify that
+ * name is a symbolic link.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf /*out*/);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Sets comment for specified object
+ *
+ * \fgdt_loc_id
+ * \param[in] name Name of the object whose comment is to be set or reset
+ * name must be \Code{'.'} (dot) if \p loc_id fully specifies
+ * the object for which the comment is to be set.
+ * \param[in] comment The new comment
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated in favor of the function
+ * H5Oset_comment().
+ *
+ * \details H5Gset_comment() sets the comment for the object specified by \p
+ * loc_id and name to comment. Any previously existing comment is
+ * overwritten.
+ *
+ * \p loc_id can specify any object in the file. name can be one of the
+ * following:
+ * \li The name of the object relative to \p loc_id
+ * \li An absolute name of the object, starting from \c /, the file’s
+ * root group
+ * \li A dot (\c .), if \p loc_id fully specifies the object
+ *
+ * If \p comment is the empty string or a null pointer, the comment
+ * message is removed from the object.
+ *
+ * Comments should be relatively short, null-terminated, ASCII strings.
+ *
+ * Comments can be attached to any object that has an object header,
+ * e.g., datasets, groups, and named datatypes, but not symbolic links.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Retrieves comment for specified object
+ *
+ * \fgdt_loc_id
+ * \param[in] name Name of the object whose comment is to be set or reset
+ * name must be \Code{'.'} (dot) if \p loc_id fully specifies
+ * the object for which the comment is to be set.
+ * \param[in] bufsize Maximum number of comment characters to be returned in \p buf.
+ * \param[in] buf The comment
+ *
+ * \return Returns the number of characters in the comment, counting the \c NULL
+ * terminator, if successful; the value returned may be larger than
+ * \p bufsize. Otherwise returns a negative value.
+ *
+ * \deprecated This function is deprecated in favor of the function
+ * H5Oget_comment().
+ *
+ * \details H5Gget_comment() retrieves the comment for the the object specified
+ * by \p loc_id and \p name. The comment is returned in the buffer \p
+ * buf.
+ *
+ * \p loc_id can specify any object in the file. name can be one of the
+ * following:
+ * \li The name of the object relative to \p loc_id
+ * \li An absolute name of the object, starting from \c /, the file’s
+ * root group
+ * \li A dot (\c .), if \p loc_id fully specifies the object
+ *
+ * At most bufsize characters, including a null-terminator, are
+ * returned in \p buf. The returned value is not null-terminated if the
+ * comment is longer than the supplied buffer. If the size of the
+ * comment is unknown, a preliminary \p H5Gget_comment() call will
+ * return the size of the comment, including space for the
+ * null-terminator.
+ *
+ * If an object does not have a comment, the empty string is returned
+ * in comment.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Iterates over the entries of a group invoking a callback for each
+ * entry encountered
+ *
+ * \fg_loc_id
+ * \param[in] name Group over which the iteration is performed
+ * \param[in,out] idx Location at which to begin the iteration
+ * \param[in] op Operation to be performed on an object at each step of the
+ * iteration
+ * \param[in,out] op_data Data associated with the operation
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated in favor of the function
+ * H5Literate1().
+ *
+ * \details H5Giterate() iterates over the members of name in the file or group
+ * specified with \p loc_id. For each object in the group, the \p
+ * op_data and some additional information, specified below, are passed
+ * to the operator function. The iteration begins with the \p idx
+ * object in the group and the next element to be processed by the
+ * operator is returned in \p idx. If \p idx is NULL, then the iterator
+ * starts at the first group member; since no stopping point is
+ * returned in this case, the iterator cannot be restarted if one of
+ * the calls to its operator returns non-zero. H5Giterate() does not
+ * recursively follow links into subgroups of the specified group.
+ *
+ * The prototype for \ref H5G_iterate_t is:
+ * \snippet this H5G_iterate_t_snip
+ *
+ * The operation receives the group identifier for the group being
+ * iterated over, \p group, the name of the current object within
+ * the group, \p name, and the pointer to the operator data
+ * passed in to H5Giterate(), \p op_data.
+ *
+ * The return values from an operator are:
+ * \li Zero causes the iterator to continue, returning zero when all
+ * group members have been processed.
+ * \li Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next group member.
+ * \li Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * group member.
+ *
+ * H5Giterate() assumes that the membership of the group identified by
+ * \p name remains unchanged through the iteration. If the membership
+ * changes during the iteration, the function's behavior is undefined.
+ *
+ * H5Giterate() is not recursive. In particular, if a member of \p name
+ * is found to be a group, call it \c subgroup_a, H5Giterate() does not
+ * examine the members of \c subgroup_a. When recursive iteration is
+ * required, the application must handle the recursion, explicitly
+ * calling H5Giterate() on discovered subgroups.
+
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5G_iterate_t op, void *op_data);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Returns number of objects in the group specified by its identifier
+ *
+ * \fg_loc_id
+ * \param[out] num_objs Number of objects in the group
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated in favor of the function H5Gget_info().
+ *
+ * \details H5Gget_num_objs() returns number of objects in a group. Group is
+ * specified by its identifier \p loc_id. If a file identifier is
+ * passed in, then the number of objects in the root group is returned.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ *
+ */
+H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Returns information about an object.
+ *
+ * \fgdt_loc_id
+ * \param[in] name Name of the object for which status is being sought
+ * \param[in] follow_link Link flag
+ * \param[out] statbuf Buffer in which to return information about the object
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated in favor of the functions H5Oget_info()
+ * and H5Lget_info1().
+ *
+ * \details H5Gget_objinfo() returns information about the specified object
+ * through the \p statbuf argument.
+ *
+ * A file or group identifier, \p loc_id, and an object name, \p name,
+ * relative to \p loc_id, are commonly used to specify the
+ * object. However, if the object identifier is already known to the
+ * application, an alternative approach is to use that identifier, \c
+ * obj_id, in place of \p loc_id, and a dot (\c .) in place of \p
+ * name. Thus, the alternative versions of the first portion of an
+ * H5Gget_objinfo() call would be as follows:
+ * \code
+ * H5Gget_objinfo (loc_id name ...)
+ * H5Gget_objinfo (obj_id . ...)
+ * \endcode
+ *
+ * If the object is a symbolic link and follow_link is zero (0), then
+ * the information returned describes the link itself; otherwise the
+ * link is followed and the information returned describes the object
+ * to which the link points. If \p follow_link is non-zero but the
+ * final symbolic link is dangling (does not point to anything), then
+ * an error is returned. The \p statbuf fields are undefined for an
+ * error. The existence of an object can be tested by calling this
+ * function with a \c NULL \p statbuf.
+ *
+ * H5Gget_objinfo() fills in the following data structure (defined in
+ * H5Gpublic.h):
+ * \snippet this H5G_stat_t_snip
+ *
+ * where \ref H5O_stat_t (defined in H5Opublic.h) is:
+ * \snippet H5Opublic.h H5O_stat_t_snip
+ *
+ * \attention Some systems will be able to record the time accurately but unable
+ * to retrieve the correct time; such systems (e.g., Irix64) will
+ * report an \c mtime value of 0 (zero).
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ * \version 1.6.1 Two new fields were added to the \ref H5G_stat_t struct in
+ * this release.
+ *
+ */
+H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link,
+ H5G_stat_t *statbuf /*out*/);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Returns a name of an object specified by an index
+ *
+ * \fg_loc_id
+ * \param[in] idx Transient index identifying object
+ * \param[in,out] name Pointer to user-provided buffer the object name
+ * \param[in] size Name length
+ *
+ * \return Returns the size of the object name if successful, or 0 if no name is
+ * associated with the group identifier. Otherwise returns a negative
+ * value.
+ *
+ * \deprecated This function is deprecated in favor of the function H5Lget_name_by_idx().
+ *
+ * \details H5Gget_objname_by_idx() returns a name of the object specified by
+ * the index \p idx in the group \p loc_id.
+ *
+ * The group is specified by a group identifier \p loc_id. If
+ * preferred, a file identifier may be passed in \p loc_id; that file's
+ * root group will be assumed.
+ *
+ * \p idx is the transient index used to iterate through the objects in
+ * the group. The value of \p idx is any nonnegative number less than
+ * the total number of objects in the group, which is returned by the
+ * function H5Gget_num_objs(). Note that this is a transient index; an
+ * object may have a different index each time a group is opened.
+ *
+ * The object name is returned in the user-specified buffer \p name.
+ *
+ * If the size of the provided buffer \p name is less or equal the
+ * actual object name length, the object name is truncated to
+ * \Code{max_size - 1} characters.
+ *
+ * Note that if the size of the object's name is unkown, a preliminary
+ * call to H5Gget_objname_by_idx() with \p name set to \c NULL will
+ * return the length of the object's name. A second call to
+ * H5Gget_objname_by_idx() can then be used to retrieve the actual
+ * name.
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ * \since 1.6.0
+ *
+ */
+H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size);
+/**
+ *-------------------------------------------------------------------------
+ * \ingroup H5G
+ *
+ * \brief Returns the type of an object specified by an index
+ *
+ * \fg_loc_id
+ * \param[in] idx Transient index identifying object
+ *
+ * \return Returns the type of the object if successful. Otherwise returns a
+ * negative value.
+ *
+ * \deprecated This function is deprecated in favor of the function H5Oget_info().
+ *
+ * \details H5Gget_objtype_by_idx() returns the type of the object specified by
+ * the index \p idx in the group \p loc_id.
+ *
+ * The group is specified by a group identifier \p loc_id. If
+ * preferred, a file identifier may be passed in \p loc_id; that file's
+ * root group will be assumed.
+ *
+ * \p idx is the transient index used to iterate through the objects in
+ * the group. This parameter is described in more detail in the
+ * discussion of H5Gget_objname_by_idx().
+ *
+ * \version 1.8.0 Function deprecated in this release.
+ * \version 1.6.0 The function return type changed from \c int to the enumerated
+ * type \ref H5G_obj_t.
+ * \since 1.6.0
+ *
+ */
H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 34f9610..ca74aa5 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -150,11 +150,10 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint)
HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap")
/* Insert name into the heap */
- if (UFAIL == (name_offset = H5HL_insert(f, heap, (size_t)1, "")))
+ if (H5HL_insert(f, heap, (size_t)1, "", &name_offset) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert name into heap")
- /*
- * B-tree's won't work if the first name isn't at the beginning
+ /* B-trees won't work if the first name isn't at the beginning
* of the heap.
*/
HDassert(0 == name_offset);
@@ -706,22 +705,22 @@ done:
*
* Purpose: Returns the name of objects in the group by giving index.
*
- * Return: Success: Non-negative, length of name
- * Failure: Negative
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Nov 20, 2002
*
*-------------------------------------------------------------------------
*/
-ssize_t
-H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, char *name, size_t size)
+herr_t
+H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, char *name,
+ size_t name_size, size_t *name_len)
{
- H5HL_t * heap = NULL; /* Pointer to local heap */
- H5O_stab_t stab; /* Info about local heap & B-tree */
- H5G_bt_it_gnbi_t udata; /* Iteration information */
- hbool_t udata_valid = FALSE; /* Whether iteration information is valid */
- ssize_t ret_value = -1; /* Return value */
+ H5HL_t * heap = NULL; /* Pointer to local heap */
+ H5O_stab_t stab; /* Info about local heap & B-tree */
+ H5G_bt_it_gnbi_t udata; /* Iteration information */
+ hbool_t udata_valid = FALSE; /* Whether iteration information is valid */
+ herr_t ret_value = SUCCEED; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
@@ -768,13 +767,13 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound")
/* Get the length of the name */
- ret_value = (ssize_t)HDstrlen(udata.name);
+ *name_len = HDstrlen(udata.name);
/* Copy the name into the user's buffer, if given */
if (name) {
- HDstrncpy(name, udata.name, MIN((size_t)(ret_value + 1), size));
- if ((size_t)ret_value >= size)
- name[size - 1] = '\0';
+ HDstrncpy(name, udata.name, MIN((*name_len + 1), name_size));
+ if (*name_len >= name_size)
+ name[name_size - 1] = '\0';
} /* end if */
done:
diff --git a/src/H5Gtest.c b/src/H5Gtest.c
index 9f0dca2..7ae41ed 100644
--- a/src/H5Gtest.c
+++ b/src/H5Gtest.c
@@ -616,14 +616,14 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign
/* Retrieve a copy of the user path and put it into the buffer */
if (obj_path->user_path_r) {
- ssize_t len = H5RS_len(obj_path->user_path_r);
+ size_t len = H5RS_len(obj_path->user_path_r);
/* Set the user path, if given */
if (user_path)
- HDstrncpy(user_path, H5RS_get_str(obj_path->user_path_r), (size_t)(len + 1));
+ HDstrncpy(user_path, H5RS_get_str(obj_path->user_path_r), (len + 1));
/* Set the length of the path */
- *user_path_len = (size_t)len;
+ *user_path_len = len;
/* Set the user path hidden flag */
*obj_hidden = obj_path->obj_hidden;
diff --git a/src/H5HF.c b/src/H5HF.c
index 73281a4..1f4cc26 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -429,7 +429,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length")
} /* end if */
else {
- HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+ HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
} /* end else */
@@ -489,7 +489,7 @@ H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p)
*obj_off_p = (hsize_t)0;
} /* end if */
else {
- HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+ HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
} /* end else */
@@ -552,7 +552,7 @@ H5HF_read(H5HF_t *fh, const void *_id, void *obj /*out*/)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'tiny' object from fractal heap")
} /* end if */
else {
- HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+ HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
} /* end else */
@@ -628,7 +628,7 @@ H5HF_write(H5HF_t *fh, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, const void
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "modifying 'tiny' object not supported yet")
} /* end if */
else {
- HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+ HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
} /* end else */
@@ -696,7 +696,7 @@ H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data)
HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'tiny' object from fractal heap")
} /* end if */
else {
- HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+ HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
} /* end else */
@@ -759,7 +759,7 @@ H5HF_remove(H5HF_t *fh, const void *_id)
HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'tiny' object from fractal heap")
} /* end if */
else {
- HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+ HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
} /* end else */
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 7d29ede..fde5a4f 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -209,7 +209,7 @@ H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref)
HDassert(image);
/* Magic number */
- if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "wrong fractal heap header signature")
image += H5_SIZEOF_MAGIC;
@@ -992,7 +992,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
HDassert(iblock->size == len);
/* Magic number */
- if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap indirect block signature")
image += H5_SIZEOF_MAGIC;
@@ -1831,7 +1831,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo
image = dblock->blk;
/* Magic number */
- if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap direct block signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index cc61aa1..8dbb3f4 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -140,7 +140,7 @@ H5HF_id_print(H5HF_t *fh, const void *_id, FILE *stream, int indent, int fwidth)
id_type = 'T';
} /* end if */
else {
- HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC);
+ HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet")
} /* end else */
@@ -543,7 +543,7 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
amount_free = 0;
HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of available space for data used:",
- ((double)100.0f * (double)((dblock->size - blk_prefix_size) - amount_free) /
+ (100.0 * (double)((dblock->size - blk_prefix_size) - amount_free) /
(double)(dblock->size - blk_prefix_size)));
/*
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index 628dcc4..4adb47a 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -397,7 +397,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_
HDfprintf(
stderr,
"%s: Skipping direct block sizes not supported, min_dblock_size = %zu, next_size = %zu\n",
- FUNC, min_dblock_size, next_size);
+ __func__, min_dblock_size, next_size);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not supported yet")
} /* end if */
diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h
index 893a65d..8d189e8 100644
--- a/src/H5HFpkg.h
+++ b/src/H5HFpkg.h
@@ -34,7 +34,6 @@
#include "H5B2private.h" /* v2 B-trees */
#include "H5FLprivate.h" /* Free Lists */
#include "H5FSprivate.h" /* Free space manager */
-#include "H5SLprivate.h" /* Skip lists */
/**************************/
/* Package Private Macros */
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index e0e1f2e..379e6f6 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -122,7 +122,7 @@ H5HG__hdr_deserialize(H5HG_heap_t *heap, const uint8_t *image, const H5F_t *f)
HDassert(f);
/* Magic number */
- if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad global heap collection signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5HL.c b/src/H5HL.c
index 50d24c3..1f2369a 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -98,11 +98,15 @@ H5FL_BLK_DEFINE(lheap_chunk);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr_p /*out*/))
-
+herr_t
+H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr_p /*out*/)
+{
H5HL_t * heap = NULL; /* Heap created */
H5HL_prfx_t *prfx = NULL; /* Heap prefix */
hsize_t total_size = 0; /* Total heap size on disk */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(FAIL)
/* check arguments */
HDassert(f);
@@ -115,12 +119,12 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_create(H5F_t *f, size_t size_h
/* Allocate new heap structure */
if (NULL == (heap = H5HL__new(H5F_SIZEOF_SIZE(f), H5F_SIZEOF_ADDR(f), H5HL_SIZEOF_HDR(f))))
- H5E_THROW(H5E_CANTALLOC, "can't allocate new heap struct");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate new heap struct");
/* Allocate file space */
total_size = heap->prfx_size + size_hint;
if (HADDR_UNDEF == (heap->prfx_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, total_size)))
- H5E_THROW(H5E_CANTALLOC, "unable to allocate file memory");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "unable to allocate file memory");
/* Initialize info */
heap->single_cache_obj = TRUE;
@@ -128,52 +132,52 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_create(H5F_t *f, size_t size_h
heap->dblk_size = size_hint;
if (size_hint)
if (NULL == (heap->dblk_image = H5FL_BLK_CALLOC(lheap_chunk, size_hint)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed");
/* free list */
if (size_hint) {
if (NULL == (heap->freelist = H5FL_MALLOC(H5HL_free_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed");
heap->freelist->offset = 0;
heap->freelist->size = size_hint;
heap->freelist->prev = heap->freelist->next = NULL;
heap->free_block = 0;
- } /* end if */
+ }
else {
heap->freelist = NULL;
heap->free_block = H5HL_FREE_NULL;
- } /* end else */
+ }
/* Allocate the heap prefix */
if (NULL == (prfx = H5HL__prfx_new(heap)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed");
/* Add to cache */
if (FAIL == H5AC_insert_entry(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET))
- H5E_THROW(H5E_CANTINIT, "unable to cache local heap prefix");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to cache local heap prefix");
/* Set address to return */
*addr_p = heap->prfx_addr;
- CATCH
+done:
if (ret_value < 0) {
*addr_p = HADDR_UNDEF;
if (prfx) {
if (FAIL == H5HL__prfx_dest(prfx))
- H5E_THROW(H5E_CANTFREE, "unable to destroy local heap prefix");
- } /* end if */
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap prefix");
+ }
else {
if (heap) {
if (H5F_addr_defined(heap->prfx_addr))
if (FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, heap->prfx_addr, total_size))
- H5E_THROW(H5E_CANTFREE, "can't release heap data?");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "can't release heap data?");
if (FAIL == H5HL__dest(heap))
- H5E_THROW(H5E_CANTFREE, "unable to destroy local heap");
- } /* end if */
- } /* end else */
- } /* end if */
-
-END_FUNC(PRIV) /* end H5HL_create() */
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap");
+ }
+ }
+ }
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_create() */
/*-------------------------------------------------------------------------
* Function: H5HL__minimize_heap_space
@@ -188,16 +192,19 @@ END_FUNC(PRIV) /* end H5HL_create() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap))
-
+static herr_t
+H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap)
+{
size_t new_heap_size = heap->dblk_size; /* New size of heap */
+ herr_t ret_value = SUCCEED;
- /* check args */
+ FUNC_ENTER_STATIC
+
+ /* Check args */
HDassert(f);
HDassert(heap);
- /*
- * Check to see if we can reduce the size of the heap in memory by
+ /* Check to see if we can reduce the size of the heap in memory by
* eliminating free blocks at the tail of the buffer before flushing the
* buffer out.
*/
@@ -211,29 +218,25 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5HL__minimize_heap_space(H5F_t *
if (tmp_fl->offset + tmp_fl->size == heap->dblk_size) {
last_fl = tmp_fl;
break;
- } /* end if */
+ }
- /*
- * Found free block at the end of the buffer, decide what to do
+ /* Found free block at the end of the buffer, decide what to do
* about it
*/
if (last_fl) {
- /*
- * If the last free block's size is more than half the memory
+ /* If the last free block's size is more than half the memory
* buffer size (and the memory buffer is larger than the
* minimum size), reduce or eliminate it.
*/
if (last_fl->size >= (heap->dblk_size / 2) && heap->dblk_size > H5HL_MIN_HEAP) {
- /*
- * Reduce size of buffer until it's too small or would
+ /* Reduce size of buffer until it's too small or would
* eliminate the free block
*/
while (new_heap_size > H5HL_MIN_HEAP &&
new_heap_size >= (last_fl->offset + H5HL_SIZEOF_FREE(f)))
new_heap_size /= 2;
- /*
- * Check if reducing the memory buffer size would
+ /* Check if reducing the memory buffer size would
* eliminate the free block
*/
if (new_heap_size < (last_fl->offset + H5HL_SIZEOF_FREE(f))) {
@@ -246,31 +249,29 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5HL__minimize_heap_space(H5F_t *
last_fl->size = H5HL_ALIGN(new_heap_size - last_fl->offset);
new_heap_size = last_fl->offset + last_fl->size;
HDassert(last_fl->size >= H5HL_SIZEOF_FREE(f));
- } /* end if */
+ }
else {
- /*
- * Set the size of the memory buffer to the start
+ /* Set the size of the memory buffer to the start
* of the free list
*/
new_heap_size = last_fl->offset;
/* Eliminate the free block from the list */
last_fl = H5HL__remove_free(heap, last_fl);
- } /* end else */
- } /* end if */
+ }
+ }
else {
/* Truncate the free block */
last_fl->size = H5HL_ALIGN(new_heap_size - last_fl->offset);
new_heap_size = last_fl->offset + last_fl->size;
HDassert(last_fl->size >= H5HL_SIZEOF_FREE(f));
HDassert(last_fl->size == H5HL_ALIGN(last_fl->size));
- } /* end else */
- } /* end if */
- } /* end if */
- } /* end if */
+ }
+ }
+ }
+ }
- /*
- * If the heap grew smaller than disk storage then move the
+ /* If the heap grew smaller than disk storage then move the
* data segment of the heap to another contiguous block of disk
* storage.
*/
@@ -279,17 +280,16 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5HL__minimize_heap_space(H5F_t *
/* Resize the memory buffer */
if (NULL == (heap->dblk_image = H5FL_BLK_REALLOC(lheap_chunk, heap->dblk_image, new_heap_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed");
/* Reallocate data block in file */
if (FAIL == H5HL__dblk_realloc(f, heap, new_heap_size))
- H5E_THROW(H5E_CANTRESIZE, "reallocating data block failed");
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "reallocating data block failed");
+ }
- CATCH
- /* No special processing on errors */
-
-END_FUNC(STATIC) /* H5HL__minimize_heap_space() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5HL__minimize_heap_space() */
/*-------------------------------------------------------------------------
* Function: H5HL_protect
@@ -304,20 +304,24 @@ END_FUNC(STATIC) /* H5HL__minimize_heap_space() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, H5HL_t *, NULL, NULL, H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags))
-
+H5HL_t *
+H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags)
+{
H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
H5HL_dblk_t * dblk = NULL; /* Local heap data block */
H5HL_t * heap = NULL; /* Heap data structure */
unsigned prfx_cache_flags = H5AC__NO_FLAGS_SET; /* Cache flags for unprotecting prefix entry */
unsigned dblk_cache_flags = H5AC__NO_FLAGS_SET; /* Cache flags for unprotecting data block entry */
+ H5HL_t * ret_value = NULL;
- /* check arguments */
+ FUNC_ENTER_NOAPI(NULL)
+
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
- /* only the H5AC__READ_ONLY_FLAG may appear in flags */
+ /* Only the H5AC__READ_ONLY_FLAG may appear in flags */
HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
/* Construct the user data for protect callback */
@@ -328,7 +332,7 @@ BEGIN_FUNC(PRIV, ERR, H5HL_t *, NULL, NULL, H5HL_protect(H5F_t *f, haddr_t addr,
/* Protect the local heap prefix */
if (NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load heap prefix");
/* Get the pointer to the heap */
heap = prfx->heap;
@@ -344,12 +348,12 @@ BEGIN_FUNC(PRIV, ERR, H5HL_t *, NULL, NULL, H5HL_protect(H5F_t *f, haddr_t addr,
/* Protect the local heap data block */
if (NULL ==
(dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, flags)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load heap data block");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load heap data block");
/* Set the flag for pinning the data block when unprotecting it */
dblk_cache_flags |= H5AC__PIN_ENTRY_FLAG;
- } /* end if */
- } /* end if */
+ }
+ }
/* Increment # of times heap is protected */
heap->prots++;
@@ -357,16 +361,17 @@ BEGIN_FUNC(PRIV, ERR, H5HL_t *, NULL, NULL, H5HL_protect(H5F_t *f, haddr_t addr,
/* Set return value */
ret_value = heap;
- CATCH
+done:
/* Release the prefix from the cache, now pinned */
if (prfx && heap && H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, prfx_cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release local heap prefix");
/* Release the data block from the cache, now pinned */
if (dblk && heap && H5AC_unprotect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, dblk_cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap data block");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release local heap data block");
-END_FUNC(PRIV) /* end H5HL_protect() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_protect() */
/*-------------------------------------------------------------------------
* Function: H5HL_offset_into
@@ -374,26 +379,31 @@ END_FUNC(PRIV) /* end H5HL_protect() */
* Purpose: Called directly after the call to H5HL_protect so that
* a pointer to the object in the heap can be obtained.
*
- * Return: Success: Valid pointer.
- * Failure: Can't fail
+ * Return: Success: Valid pointer
+ * Failure: NULL
*
* Programmer: Bill Wendling
* Sept. 17, 2003
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, void *, NULL, NULL, H5HL_offset_into(const H5HL_t *heap, size_t offset))
+void *
+H5HL_offset_into(const H5HL_t *heap, size_t offset)
+{
+ void *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI(NULL)
/* Sanity check */
HDassert(heap);
if (offset >= heap->dblk_size)
- H5E_THROW(H5E_CANTGET, "unable to offset into local heap data block");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, NULL, "unable to offset into local heap data block");
ret_value = heap->dblk_image + offset;
- CATCH
-/* No special processing on errors */
-END_FUNC(PRIV) /* end H5HL_offset_into() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_offset_into() */
/*-------------------------------------------------------------------------
* Function: H5HL_unprotect
@@ -407,9 +417,14 @@ END_FUNC(PRIV) /* end H5HL_offset_into() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_unprotect(H5HL_t *heap))
+herr_t
+H5HL_unprotect(H5HL_t *heap)
+{
+ herr_t ret_value = SUCCEED;
- /* check arguments */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(heap);
/* Decrement # of times heap is protected */
@@ -421,8 +436,8 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_unprotect(H5HL_t *heap))
if (heap->single_cache_obj) {
/* Mark local heap prefix as evictable again */
if (FAIL == H5AC_unpin_entry(heap->prfx))
- H5E_THROW(H5E_CANTUNPIN, "unable to unpin local heap data block");
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin local heap data block");
+ }
else {
/* Sanity check */
HDassert(heap->dblk);
@@ -430,14 +445,13 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_unprotect(H5HL_t *heap))
/* Mark local heap data block as evictable again */
/* (data block still pins prefix) */
if (FAIL == H5AC_unpin_entry(heap->dblk))
- H5E_THROW(H5E_CANTUNPIN, "unable to unpin local heap data block");
- } /* end else */
- } /* end if */
-
- CATCH
- /* No special processing on errors */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin local heap data block");
+ }
+ }
-END_FUNC(PRIV) /* end H5HL_unprotect() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5HL__remove_free
@@ -452,7 +466,12 @@ END_FUNC(PRIV) /* end H5HL_unprotect() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, H5HL_free_t *, NULL, -, H5HL__remove_free(H5HL_t *heap, H5HL_free_t *fl))
+static H5HL_free_t *
+H5HL__remove_free(H5HL_t *heap, H5HL_free_t *fl)
+{
+ H5HL_free_t *ret_value = NULL;
+
+ FUNC_ENTER_STATIC_NOERR
if (fl->prev)
fl->prev->next = fl->next;
@@ -465,7 +484,8 @@ BEGIN_FUNC(STATIC, NOERR, H5HL_free_t *, NULL, -, H5HL__remove_free(H5HL_t *heap
/* H5FL_FREE always returns NULL so we can't check for errors */
ret_value = (H5HL_free_t *)H5FL_FREE(H5HL_free_t, fl);
-END_FUNC(STATIC) /* end H5HL__remove_free() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__remove_free() */
/*-------------------------------------------------------------------------
* Function: H5HL__dirty
@@ -479,9 +499,14 @@ END_FUNC(STATIC) /* end H5HL__remove_free() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5HL__dirty(H5HL_t *heap))
+static herr_t
+H5HL__dirty(H5HL_t *heap)
+{
+ herr_t ret_value = SUCCEED;
- /* check arguments */
+ FUNC_ENTER_STATIC
+
+ /* Check arguments */
HDassert(heap);
HDassert(heap->prfx);
@@ -491,44 +516,50 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5HL__dirty(H5HL_t *heap))
HDassert(heap->dblk);
if (FAIL == H5AC_mark_entry_dirty(heap->dblk))
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark heap data block as dirty");
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap data block as dirty");
+ }
/* Mark heap prefix as dirty */
if (FAIL == H5AC_mark_entry_dirty(heap->prfx))
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark heap prefix as dirty");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap prefix as dirty");
- CATCH
- /* No special processing on errors */
-
-END_FUNC(STATIC) /* end H5HL__dirty() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__dirty() */
/*-------------------------------------------------------------------------
* Function: H5HL_insert
*
* Purpose: Inserts a new item into the heap.
*
- * Return: Success: Offset of new item within heap.
- * Failure: UFAIL
+ * Return: Success: SUCCEED
+ * Offset set to location of new item within heap
+ *
+ * Failure: FAIL
+ * Offset set to SIZE_MAX
*
* Programmer: Robb Matzke
* Jul 17 1997
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
- H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf))
-
+herr_t
+H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *offset_out)
+{
H5HL_free_t *fl = NULL, *last_fl = NULL;
- size_t offset = 0;
size_t need_size;
+ size_t offset = 0;
hbool_t found;
+ herr_t ret_value = SUCCEED;
- /* check arguments */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(f);
HDassert(heap);
HDassert(buf_size > 0);
HDassert(buf);
+ HDassert(offset_out);
/* Mark heap as dirty in cache */
/* (A bit early in the process, but it's difficult to determine in the
@@ -537,22 +568,20 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
* if an error occurs -QAK)
*/
if (FAIL == H5HL__dirty(heap))
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark heap as dirty");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap as dirty");
- /*
- * In order to keep the free list descriptors aligned on word boundaries,
+ /* In order to keep the free list descriptors aligned on word boundaries,
* whatever that might mean, we round the size up to the next multiple of
* a word.
*/
need_size = H5HL_ALIGN(buf_size);
- /*
- * Look for a free slot large enough for this object and which would
+ /* Look for a free slot large enough for this object and which would
* leave zero or at least H5G_SIZEOF_FREE bytes left over.
*/
for (fl = heap->freelist, found = FALSE; fl; fl = fl->next) {
if (fl->size > need_size && fl->size - need_size >= H5HL_SIZEOF_FREE(f)) {
- /* a big enough free block was found */
+ /* A big enough free block was found */
offset = fl->offset;
fl->offset += need_size;
fl->size -= need_size;
@@ -562,20 +591,19 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
break;
}
else if (fl->size == need_size) {
- /* free block of exact size found */
+ /* Free block of exact size found */
offset = fl->offset;
fl = H5HL__remove_free(heap, fl);
found = TRUE;
break;
}
else if (!last_fl || last_fl->offset < fl->offset) {
- /* track free space that's closest to end of heap */
+ /* Track free space that's closest to end of heap */
last_fl = fl;
}
- } /* end for */
+ }
- /*
- * If no free chunk was large enough, then allocate more space and
+ /* If no free chunk was large enough, then allocate more space and
* add it to the free list. If the heap ends with a free chunk, we
* can extend that free chunk. Otherwise we'll have to make another
* free chunk. If the heap must expand, we double its size.
@@ -587,7 +615,8 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
htri_t was_extended; /* Whether the local heap's data segment on disk was extended */
/* At least double the heap's size, making certain there's enough room
- * for the new object */
+ * for the new object
+ */
need_more = MAX(need_size, heap->dblk_size);
/* If there is no last free block or it's not at the end of the heap,
@@ -610,7 +639,7 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
was_extended = H5MF_try_extend(f, H5FD_MEM_LHEAP, heap->dblk_addr, (hsize_t)(heap->dblk_size),
(hsize_t)need_more);
if (FAIL == was_extended)
- H5E_THROW(H5E_CANTEXTEND, "error trying to extend heap");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap");
/* Check if we extended the heap data block in file */
if (was_extended == TRUE) {
@@ -618,22 +647,22 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
if (heap->single_cache_obj) {
/* Resize prefix+data block */
if (FAIL == H5AC_resize_entry(heap->prfx, (size_t)(heap->prfx_size + new_dblk_size)))
- H5E_THROW(H5E_CANTRESIZE, "unable to resize heap prefix in cache");
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap prefix in cache");
+ }
else {
/* Resize 'standalone' data block */
if (FAIL == H5AC_resize_entry(heap->dblk, (size_t)new_dblk_size))
- H5E_THROW(H5E_CANTRESIZE, "unable to resize heap data block in cache");
- } /* end else */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap data block in cache");
+ }
/* Note new size */
heap->dblk_size = new_dblk_size;
- } /* end if */
+ }
else { /* ...if we can't, allocate a new chunk & release the old */
/* Reallocate data block in file */
if (FAIL == H5HL__dblk_realloc(f, heap, new_dblk_size))
- H5E_THROW(H5E_CANTRESIZE, "reallocating data block failed");
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "reallocating data block failed");
+ }
/* If the last free list in the heap is at the end of the heap, extend it */
if (last_fl && last_fl->offset + last_fl->size == old_dblk_size) {
@@ -655,16 +684,15 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
#endif
last_fl = H5HL__remove_free(heap, last_fl);
}
- } /* end if */
+ }
else {
- /*
- * Create a new free list element large enough that we can
+ /* Create a new free list element large enough that we can
* take some space out of it right away.
*/
offset = old_dblk_size;
if (need_more - need_size >= H5HL_SIZEOF_FREE(f)) {
if (NULL == (fl = H5FL_MALLOC(H5HL_free_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed");
fl->offset = old_dblk_size + need_size;
fl->size = need_more - need_size;
HDassert(fl->offset == H5HL_ALIGN(fl->offset));
@@ -681,7 +709,7 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
(unsigned long)(need_more - need_size), __LINE__);
#endif
}
- } /* end else */
+ }
#ifdef H5HL_DEBUG
if (H5DEBUG(HL)) {
@@ -690,23 +718,21 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
}
#endif
if (NULL == (heap->dblk_image = H5FL_BLK_REALLOC(lheap_chunk, heap->dblk_image, heap->dblk_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed");
/* Clear new section so junk doesn't appear in the file */
/* (Avoid clearing section which will be overwritten with newly inserted data) */
HDmemset(heap->dblk_image + offset + buf_size, 0, (new_dblk_size - (offset + buf_size)));
- } /* end if */
+ }
/* Copy the data into the heap */
H5MM_memcpy(heap->dblk_image + offset, buf, buf_size);
- /* Set return value */
- ret_value = offset;
-
- CATCH
- /* No special processing on errors */
+ *offset_out = offset;
-END_FUNC(PRIV) /* H5HL_insert() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5HL_insert() */
/*-------------------------------------------------------------------------
* Function: H5HL_remove
@@ -731,11 +757,15 @@ END_FUNC(PRIV) /* H5HL_insert() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size))
+herr_t
+H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size)
+{
+ H5HL_free_t *fl = NULL;
+ herr_t ret_value = SUCCEED;
- H5HL_free_t *fl = NULL;
+ FUNC_ENTER_NOAPI(FAIL)
- /* check arguments */
+ /* Check arguments */
HDassert(f);
HDassert(heap);
HDassert(size > 0);
@@ -746,17 +776,17 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_remove(H5F_t *f, H5HL_t *heap,
HDassert(offset < heap->dblk_size);
HDassert(offset + size <= heap->dblk_size);
- /* Mark heap as dirty in cache */
- /* (A bit early in the process, but it's difficult to determine in the
+ /* Mark heap as dirty in cache
+ *
+ * (A bit early in the process, but it's difficult to determine in the
* code below where to mark the heap as dirty, especially in error cases,
* so we just accept that an extra flush of the heap info could occur
* if an error occurs -QAK)
*/
if (FAIL == H5HL__dirty(heap))
- H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark heap as dirty");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap as dirty");
- /*
- * Check if this chunk can be prepended or appended to an already
+ /* Check if this chunk can be prepended or appended to an already
* free chunk. It might also fall between two chunks in such a way
* that all three chunks can be combined into one.
*/
@@ -779,17 +809,17 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_remove(H5F_t *f, H5HL_t *heap,
fl2 = H5HL__remove_free(heap, fl2);
if (((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) {
if (FAIL == H5HL__minimize_heap_space(f, heap))
- H5E_THROW(H5E_CANTFREE, "heap size minimization failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "heap size minimization failed");
}
- H5_LEAVE(SUCCEED);
+ HGOTO_DONE(SUCCEED)
}
fl2 = fl2->next;
}
if (((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) {
if (FAIL == H5HL__minimize_heap_space(f, heap))
- H5E_THROW(H5E_CANTFREE, "heap size minimization failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "heap size minimization failed");
}
- H5_LEAVE(SUCCEED);
+ HGOTO_DONE(SUCCEED)
}
else if (fl->offset + fl->size == offset) {
fl->size += size;
@@ -802,20 +832,20 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_remove(H5F_t *f, H5HL_t *heap,
fl2 = H5HL__remove_free(heap, fl2);
if (((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) {
if (FAIL == H5HL__minimize_heap_space(f, heap))
- H5E_THROW(H5E_CANTFREE, "heap size minimization failed");
- } /* end if */
- H5_LEAVE(SUCCEED);
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "heap size minimization failed");
+ }
+ HGOTO_DONE(SUCCEED)
+ }
fl2 = fl2->next;
- } /* end while */
+ }
if (((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) {
if (FAIL == H5HL__minimize_heap_space(f, heap))
- H5E_THROW(H5E_CANTFREE, "heap size minimization failed");
- } /* end if */
- H5_LEAVE(SUCCEED);
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "heap size minimization failed");
+ }
+ HGOTO_DONE(SUCCEED)
+ }
fl = fl->next;
- } /* end while */
+ }
/*
* The amount which is being removed must be large enough to
@@ -828,14 +858,12 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_remove(H5F_t *f, H5HL_t *heap,
HDfprintf(H5DEBUG(HL), "H5HL: lost %lu bytes\n", (unsigned long)size);
}
#endif
- H5_LEAVE(SUCCEED);
- } /* end if */
+ HGOTO_DONE(SUCCEED)
+ }
- /*
- * Add an entry to the free list.
- */
+ /* Add an entry to the free list */
if (NULL == (fl = H5FL_MALLOC(H5HL_free_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed");
fl->offset = offset;
fl->size = size;
HDassert(fl->offset == H5HL_ALIGN(fl->offset));
@@ -848,12 +876,11 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_remove(H5F_t *f, H5HL_t *heap,
if (((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size))
if (FAIL == H5HL__minimize_heap_space(f, heap))
- H5E_THROW(H5E_CANTFREE, "heap size minimization failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "heap size minimization failed");
- CATCH
- /* No special processing on exit */
-
-END_FUNC(PRIV) /* end H5HL_remove() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_remove() */
/*-------------------------------------------------------------------------
* Function: H5HL_delete
@@ -867,15 +894,19 @@ END_FUNC(PRIV) /* end H5HL_remove() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_delete(H5F_t *f, haddr_t addr))
-
+herr_t
+H5HL_delete(H5F_t *f, haddr_t addr)
+{
H5HL_t * heap = NULL; /* Local heap to delete */
H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
H5HL_dblk_t * dblk = NULL; /* Local heap data block */
unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting heap */
+ herr_t ret_value = SUCCEED;
- /* check arguments */
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
@@ -888,7 +919,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_delete(H5F_t *f, haddr_t addr)
/* Protect the local heap prefix */
if (NULL ==
(prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap prefix");
/* Get the pointer to the heap */
heap = prfx->heap;
@@ -898,21 +929,22 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_delete(H5F_t *f, haddr_t addr)
/* Protect the local heap data block */
if (NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap,
H5AC__NO_FLAGS_SET)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load heap data block");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap data block");
/* Set the flags for releasing the prefix and data block */
cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;
- CATCH
+done:
/* Release the data block from the cache, now deleted */
if (dblk && heap && H5AC_unprotect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap data block");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap data block");
/* Release the prefix from the cache, now deleted */
if (prfx && heap && H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, cache_flags) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap prefix");
-END_FUNC(PRIV) /* end H5HL_delete() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_delete() */
/*-------------------------------------------------------------------------
* Function: H5HL_get_size
@@ -926,13 +958,17 @@ END_FUNC(PRIV) /* end H5HL_delete() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size))
+herr_t
+H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size)
+{
+ H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
+ H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
+ H5HL_t * heap = NULL; /* Heap data structure */
+ herr_t ret_value = SUCCEED;
- H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
- H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
- H5HL_t * heap = NULL; /* Heap data structure */
+ FUNC_ENTER_NOAPI(FAIL)
- /* check arguments */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(size);
@@ -946,7 +982,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_get_size(H5F_t *f, haddr_t add
/* Protect the local heap prefix */
if (NULL ==
(prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap prefix");
/* Get the pointer to the heap */
heap = prfx->heap;
@@ -954,11 +990,12 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_get_size(H5F_t *f, haddr_t add
/* Set the size to return */
*size = heap->dblk_size;
- CATCH
+done:
if (prfx && FAIL == H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET))
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap prefix");
-END_FUNC(PRIV) /* end H5HL_get_size() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_get_size() */
/*-------------------------------------------------------------------------
* Function: H5HL_heapsize
@@ -973,13 +1010,17 @@ END_FUNC(PRIV) /* end H5HL_get_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size))
+herr_t
+H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size)
+{
+ H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
+ H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
+ H5HL_t * heap = NULL; /* Heap data structure */
+ herr_t ret_value = SUCCEED;
- H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
- H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
- H5HL_t * heap = NULL; /* Heap data structure */
+ FUNC_ENTER_NOAPI(FAIL)
- /* check arguments */
+ /* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(heap_size);
@@ -993,7 +1034,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_heapsize(H5F_t *f, haddr_t add
/* Protect the local heap prefix */
if (NULL ==
(prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load heap prefix");
/* Get the pointer to the heap */
heap = prfx->heap;
@@ -1001,8 +1042,9 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_heapsize(H5F_t *f, haddr_t add
/* Accumulate the size of the local heap */
*heap_size += (hsize_t)(heap->prfx_size + heap->dblk_size);
- CATCH
+done:
if (prfx && FAIL == H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET))
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release local heap prefix");
-END_FUNC(PRIV) /* end H5HL_heapsize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_heapsize() */
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 05a45f1..9eb390b 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -161,7 +161,7 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, H5HL_cache_prfx_ud_t *
HDassert(udata);
/* Check magic number */
- if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad local heap signature")
image += H5_SIZEOF_MAGIC;
@@ -250,7 +250,7 @@ H5HL__fl_deserialize(H5HL_t *heap)
heap->freelist = fl;
tail = fl;
fl = NULL;
- } /* end while */
+ }
done:
if (ret_value < 0)
@@ -296,7 +296,7 @@ H5HL__fl_serialize(const H5HL_t *heap)
H5F_ENCODE_LENGTH_LEN(image, H5HL_FREE_NULL, heap->sizeof_size)
H5F_ENCODE_LENGTH_LEN(image, fl->size, heap->sizeof_size)
- } /* end for */
+ }
FUNC_LEAVE_NOAPI_VOID
@@ -450,13 +450,13 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
/* Build free list */
if (H5HL__fl_deserialize(heap) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list")
- } /* end if */
+ }
else
/* Note that the heap should _NOT_ be a single
* object in the cache
*/
heap->single_cache_obj = FALSE;
- } /* end if */
+ }
/* Set return value */
ret_value = prfx;
@@ -467,12 +467,12 @@ done:
if (prfx) {
if (FAIL == H5HL__prfx_dest(prfx))
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap prefix");
- } /* end if */
+ }
else {
if (heap && FAIL == H5HL__dest(heap))
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap");
- } /* end else */
- } /* end if */
+ }
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HL__cache_prefix_deserialize() */
@@ -588,7 +588,7 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image,
gap = heap->prfx_size - (size_t)(image - (uint8_t *)_image);
HDmemset(image, 0, gap);
image += gap;
- } /* end if */
+ }
/* Serialize the free list into the heap data's image */
H5HL__fl_serialize(heap);
@@ -598,14 +598,14 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) + heap->dblk_size == len);
- } /* end if */
+ }
else {
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) <= len);
/* Clear rest of local heap */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
- } /* end else */
+ }
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HL__cache_prefix_serialize() */
@@ -736,7 +736,7 @@ H5HL__cache_datablock_deserialize(const void *image, size_t len, void *_udata, h
/* Build free list */
if (FAIL == H5HL__fl_deserialize(heap))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list");
- } /* end if */
+ }
/* Set return value */
ret_value = dblk;
@@ -892,7 +892,7 @@ H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing)
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
break;
- } /* end switch */
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index d0cfa96..305014b 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -44,14 +44,17 @@
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
- H5HL_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth))
-
+herr_t
+H5HL_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth)
+{
H5HL_t * h = NULL;
int free_block;
H5HL_free_t *freelist;
uint8_t * marker = NULL;
size_t amount_free = 0;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
/* check arguments */
HDassert(f);
@@ -61,7 +64,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
HDassert(fwidth >= 0);
if (NULL == (h = (H5HL_t *)H5HL_protect(f, addr, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load/protect local heap");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load/protect local heap")
HDfprintf(stream, "%*sLocal Heap...\n", indent, "");
HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Header size (in bytes):", h->prfx_size);
@@ -73,7 +76,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
* the heap.
*/
if (NULL == (marker = (uint8_t *)H5MM_calloc(h->dblk_size)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed")
HDfprintf(stream, "%*sFree Blocks (offset, size):\n", indent, "");
for (free_block = 0, freelist = h->freelist; freelist; freelist = freelist->next, free_block++) {
@@ -92,26 +95,27 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
if (marker[freelist->offset + i])
overlap++;
marker[freelist->offset + i] = 1;
- } /* end for */
+ }
if (overlap)
HDfprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n");
else
amount_free += freelist->size;
- } /* end else */
- } /* end for */
+ }
+ }
if (h->dblk_size)
HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of heap used:",
- ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
+ (100.0 * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
/* Print the data in a VMS-style octal dump */
H5_buffer_dump(stream, indent, h->dblk_image, marker, (size_t)0, h->dblk_size);
- CATCH
+done:
if (h && FAIL == H5HL_unprotect(h))
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release/unprotect local heap");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release/unprotect local heap")
if (marker && NULL != (marker = (uint8_t *)H5MM_xfree(marker)))
- H5E_THROW(H5E_CANTFREE, "can't free marker buffer");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "can't free marker buffer")
-END_FUNC(PRIV) /* end H5HL_debug() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL_debug() */
diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c
index f771de5..9e6fc4a 100644
--- a/src/H5HLdblk.c
+++ b/src/H5HLdblk.c
@@ -81,20 +81,24 @@ H5FL_DEFINE_STATIC(H5HL_dblk_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5HL_dblk_t *, NULL, NULL, H5HL__dblk_new(H5HL_t *heap))
+H5HL_dblk_t *
+H5HL__dblk_new(H5HL_t *heap)
+{
+ H5HL_dblk_t *dblk = NULL; /* New local heap data block */
+ H5HL_dblk_t *ret_value = NULL;
- H5HL_dblk_t *dblk = NULL; /* New local heap data block */
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(heap);
/* Allocate new local heap data block */
if (NULL == (dblk = H5FL_CALLOC(H5HL_dblk_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for local heap data block")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed for local heap data block")
/* Increment ref. count on heap data structure */
if (FAIL == H5HL__inc_rc(heap))
- H5E_THROW(H5E_CANTINC, "can't increment heap ref. count")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment heap ref. count")
/* Link the heap & the data block */
dblk->heap = heap;
@@ -103,13 +107,14 @@ BEGIN_FUNC(PKG, ERR, H5HL_dblk_t *, NULL, NULL, H5HL__dblk_new(H5HL_t *heap))
/* Set the return value */
ret_value = dblk;
- CATCH
+done:
/* Ensure that the data block memory is deallocated on errors */
if (!ret_value && dblk != NULL)
/* H5FL_FREE always returns NULL so we can't check for errors */
dblk = H5FL_FREE(H5HL_dblk_t, dblk);
-END_FUNC(PKG) /* end H5HL__dblk_new() */
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5HL__dblk_new() */
/*-------------------------------------------------------------------------
* Function: H5HL__dblk_dest
@@ -123,7 +128,12 @@ END_FUNC(PKG) /* end H5HL__dblk_new() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dblk_dest(H5HL_dblk_t *dblk))
+herr_t
+H5HL__dblk_dest(H5HL_dblk_t *dblk)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(dblk);
@@ -135,18 +145,19 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dblk_dest(H5HL_dblk_t *dblk))
/* Decrement ref. count on heap data structure */
if (FAIL == H5HL__dec_rc(dblk->heap))
- H5E_THROW(H5E_CANTDEC, "can't decrement heap ref. count")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement heap ref. count")
/* Unlink heap from data block */
dblk->heap = NULL;
- } /* end if */
+ }
- CATCH
+done:
/* Free local heap data block */
/* H5FL_FREE always returns NULL so we can't check for errors */
dblk = H5FL_FREE(H5HL_dblk_t, dblk);
-END_FUNC(PKG) /* end H5HL__dblk_dest() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__dblk_dest() */
/*-------------------------------------------------------------------------
* Function: H5HL__dblk_realloc
@@ -160,14 +171,18 @@ END_FUNC(PKG) /* end H5HL__dblk_dest() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size))
-
+herr_t
+H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size)
+{
H5HL_dblk_t *dblk; /* Local heap data block */
haddr_t old_addr; /* Old location of heap data block */
haddr_t new_addr; /* New location of heap data block */
size_t old_heap_size; /* Old size of heap data block */
+ herr_t ret_value = SUCCEED;
- /* check arguments */
+ FUNC_ENTER_PACKAGE
+
+ /* Check arguments */
HDassert(heap);
HDassert(new_heap_size > 0);
@@ -176,12 +191,12 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dblk_realloc(H5F_t *f, H5HL_t
old_heap_size = heap->dblk_size;
H5_CHECK_OVERFLOW(old_heap_size, size_t, hsize_t);
if (FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, old_addr, (hsize_t)old_heap_size))
- H5E_THROW(H5E_CANTFREE, "can't free old local heap data");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "can't free old local heap data");
/* Allocate new space on disk */
H5_CHECK_OVERFLOW(new_heap_size, size_t, hsize_t);
if (HADDR_UNDEF == (new_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, (hsize_t)new_heap_size)))
- H5E_THROW(H5E_CANTALLOC, "unable to allocate file space for local heap");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "unable to allocate file space for local heap");
/* Update heap info*/
heap->dblk_addr = new_addr;
@@ -197,8 +212,8 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dblk_realloc(H5F_t *f, H5HL_t
/* Resize the heap prefix in the cache */
if (FAIL == H5AC_resize_entry(heap->prfx, (size_t)(heap->prfx_size + new_heap_size)))
- H5E_THROW(H5E_CANTRESIZE, "unable to resize heap in cache");
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap in cache");
+ }
else {
/* Sanity check */
HDassert(H5F_addr_ne(heap->prfx_addr + heap->prfx_size, old_addr));
@@ -206,50 +221,49 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dblk_realloc(H5F_t *f, H5HL_t
/* Resize the heap data block in the cache */
if (H5AC_resize_entry(heap->dblk, (size_t)new_heap_size) < 0)
- H5E_THROW(H5E_CANTRESIZE, "unable to resize heap (data block) in cache");
- } /* end else */
- } /* end if */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap (data block) in cache");
+ }
+ }
else {
/* Check if heap data block was contiguous w/prefix previously */
if (heap->single_cache_obj) {
/* Create new heap data block */
if (NULL == (dblk = H5HL__dblk_new(heap)))
- H5E_THROW(H5E_CANTALLOC, "unable to allocate local heap data block");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "unable to allocate local heap data block");
/* Resize current heap prefix */
heap->prfx_size = H5HL_SIZEOF_HDR(f);
if (FAIL == H5AC_resize_entry(heap->prfx, (size_t)heap->prfx_size))
- H5E_THROW(H5E_CANTRESIZE, "unable to resize heap prefix in cache");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap prefix in cache");
/* Insert data block into cache (pinned) */
if (FAIL == H5AC_insert_entry(f, H5AC_LHEAP_DBLK, new_addr, dblk, H5AC__PIN_ENTRY_FLAG))
- H5E_THROW(H5E_CANTINIT, "unable to cache local heap data block");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to cache local heap data block");
dblk = NULL;
/* Reset 'single cache object' flag */
heap->single_cache_obj = FALSE;
- } /* end if */
+ }
else {
/* Resize the heap data block in the cache */
/* (ignore [unlikely] case where heap data block ends up
* contiguous w/heap prefix again.
*/
if (FAIL == H5AC_resize_entry(heap->dblk, (size_t)new_heap_size))
- H5E_THROW(H5E_CANTRESIZE, "unable to resize heap data block in cache");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize heap data block in cache");
/* Relocate the heap data block in the cache */
if (FAIL == H5AC_move_entry(f, H5AC_LHEAP_DBLK, old_addr, new_addr))
- H5E_THROW(H5E_CANTMOVE, "unable to move heap data block in cache");
-
- } /* end else */
- } /* end else */
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move heap data block in cache");
+ }
+ }
- CATCH
+done:
/* Restore old heap address & size on errors */
if (FAIL == ret_value) {
heap->dblk_addr = old_addr;
heap->dblk_size = old_heap_size;
- } /* end if */
-
-END_FUNC(PKG) /* end H5HL__dblk_realloc() */
+ }
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__dblk_realloc() */
diff --git a/src/H5HLint.c b/src/H5HLint.c
index 069bad8..42d6744 100644
--- a/src/H5HLint.c
+++ b/src/H5HLint.c
@@ -80,10 +80,13 @@ H5FL_DEFINE_STATIC(H5HL_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5HL_t *, NULL, NULL,
- H5HL__new(size_t sizeof_size, size_t sizeof_addr, size_t prfx_size))
+H5HL_t *
+H5HL__new(size_t sizeof_size, size_t sizeof_addr, size_t prfx_size)
+{
+ H5HL_t *heap = NULL; /* New local heap */
+ H5HL_t *ret_value = NULL;
- H5HL_t *heap = NULL; /* New local heap */
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(sizeof_size > 0);
@@ -92,7 +95,7 @@ BEGIN_FUNC(PKG, ERR, H5HL_t *, NULL, NULL,
/* Allocate new local heap structure */
if (NULL == (heap = H5FL_CALLOC(H5HL_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed")
/* Initialize non-zero fields */
heap->sizeof_size = sizeof_size;
@@ -102,12 +105,13 @@ BEGIN_FUNC(PKG, ERR, H5HL_t *, NULL, NULL,
/* Set the return value */
ret_value = heap;
- CATCH
+done:
if (!ret_value && heap != NULL)
if (NULL == (heap = H5FL_FREE(H5HL_t, heap)))
- H5E_THROW(H5E_CANTFREE, "can't free heap memory");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "can't free heap memory")
-END_FUNC(PKG) /* end H5HL__new() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__new() */
/*-------------------------------------------------------------------------
* Function: H5HL__inc_rc
@@ -121,7 +125,10 @@ END_FUNC(PKG) /* end H5HL__new() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5HL__inc_rc(H5HL_t *heap))
+herr_t
+H5HL__inc_rc(H5HL_t *heap)
+{
+ FUNC_ENTER_PACKAGE_NOERR
/* check arguments */
HDassert(heap);
@@ -129,7 +136,8 @@ BEGIN_FUNC(PKG, NOERR, herr_t, SUCCEED, -, H5HL__inc_rc(H5HL_t *heap))
/* Increment heap's ref. count */
heap->rc++;
-END_FUNC(PKG) /* end H5HL__inc_rc() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5HL__inc_rc() */
/*-------------------------------------------------------------------------
* Function: H5HL__dec_rc
@@ -143,7 +151,12 @@ END_FUNC(PKG) /* end H5HL__inc_rc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dec_rc(H5HL_t *heap))
+herr_t
+H5HL__dec_rc(H5HL_t *heap)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(heap);
@@ -151,12 +164,13 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dec_rc(H5HL_t *heap))
/* Decrement heap's ref. count */
heap->rc--;
- CATCH
/* Check if we should destroy the heap */
if (heap->rc == 0 && FAIL == H5HL__dest(heap))
- H5E_THROW(H5E_CANTFREE, "unable to destroy local heap");
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap");
-END_FUNC(PKG) /* end H5HL__dec_rc() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__dec_rc() */
/*-------------------------------------------------------------------------
* Function: H5HL__dest
@@ -170,7 +184,12 @@ END_FUNC(PKG) /* end H5HL__dec_rc() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dest(H5HL_t *heap))
+herr_t
+H5HL__dest(H5HL_t *heap)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(heap);
@@ -181,20 +200,21 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__dest(H5HL_t *heap))
HDassert(heap->prfx == NULL);
HDassert(heap->dblk == NULL);
- CATCH
+ /* Use DONE errors here to try to free as much as possible */
if (heap->dblk_image)
if (NULL != (heap->dblk_image = H5FL_BLK_FREE(lheap_chunk, heap->dblk_image)))
- H5E_THROW(H5E_CANTFREE, "unable to free local heap data block image");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free local heap data block image");
while (heap->freelist) {
H5HL_free_t *fl;
fl = heap->freelist;
heap->freelist = fl->next;
if (NULL != (fl = H5FL_FREE(H5HL_free_t, fl)))
- H5E_THROW(H5E_CANTFREE, "unable to free local heap free list");
- } /* end while */
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free local heap free list");
+ }
if (NULL != (heap = H5FL_FREE(H5HL_t, heap)))
- H5E_THROW(H5E_CANTFREE, "unable to free local heap");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free local heap");
-END_FUNC(PKG) /* end H5HL__dest() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__dest() */
diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h
index dbac1b9..0ba3b1c 100644
--- a/src/H5HLpkg.h
+++ b/src/H5HLpkg.h
@@ -54,7 +54,7 @@ H5FL_BLK_EXTERN(lheap_chunk);
#define H5_MY_PKG H5HL
#define H5_MY_PKG_ERR H5E_HEAP
#define H5_MY_PKG_INIT NO
-#endif /* H5HL_PACKAGE */
+#endif
#define H5HL_SIZEOF_HDR(F) \
H5HL_ALIGN(H5_SIZEOF_MAGIC + /* heap signature */ \
diff --git a/src/H5HLprfx.c b/src/H5HLprfx.c
index 90f6c74..03e3999 100644
--- a/src/H5HLprfx.c
+++ b/src/H5HLprfx.c
@@ -80,20 +80,24 @@ H5FL_DEFINE_STATIC(H5HL_prfx_t);
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, H5HL_prfx_t *, NULL, NULL, H5HL__prfx_new(H5HL_t *heap))
+H5HL_prfx_t *
+H5HL__prfx_new(H5HL_t *heap)
+{
+ H5HL_prfx_t *prfx = NULL; /* New local heap prefix */
+ H5HL_prfx_t *ret_value = NULL;
- H5HL_prfx_t *prfx = NULL; /* New local heap prefix */
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(heap);
/* Allocate new local heap prefix */
if (NULL == (prfx = H5FL_CALLOC(H5HL_prfx_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for local heap prefix")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed for local heap prefix")
/* Increment ref. count on heap data structure */
if (FAIL == H5HL__inc_rc(heap))
- H5E_THROW(H5E_CANTINC, "can't increment heap ref. count")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment heap ref. count")
/* Link the heap & the prefix */
prfx->heap = heap;
@@ -102,13 +106,14 @@ BEGIN_FUNC(PKG, ERR, H5HL_prfx_t *, NULL, NULL, H5HL__prfx_new(H5HL_t *heap))
/* Set the return value */
ret_value = prfx;
- CATCH
+done:
/* Ensure that the prefix memory is deallocated on errors */
if (!ret_value && prfx != NULL)
/* H5FL_FREE always returns NULL so we can't check for errors */
prfx = H5FL_FREE(H5HL_prfx_t, prfx);
-END_FUNC(PKG) /* end H5HL__prfx_new() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__prfx_new() */
/*-------------------------------------------------------------------------
* Function: H5HL__prfx_dest
@@ -122,7 +127,12 @@ END_FUNC(PKG) /* end H5HL__prfx_new() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__prfx_dest(H5HL_prfx_t *prfx))
+herr_t
+H5HL__prfx_dest(H5HL_prfx_t *prfx)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(prfx);
@@ -134,15 +144,16 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5HL__prfx_dest(H5HL_prfx_t *prfx))
/* Decrement ref. count on heap data structure */
if (FAIL == H5HL__dec_rc(prfx->heap))
- H5E_THROW(H5E_CANTDEC, "can't decrement heap ref. count")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement heap ref. count")
/* Unlink heap from prefix */
prfx->heap = NULL;
- } /* end if */
+ }
- CATCH
+done:
/* Free prefix memory */
/* H5FL_FREE always returns NULL so we can't check for errors */
prfx = H5FL_FREE(H5HL_prfx_t, prfx);
-END_FUNC(PKG) /* end H5HL__prfx_dest() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HL__prfx_dest() */
diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h
index 739e761..02e07eb 100644
--- a/src/H5HLprivate.h
+++ b/src/H5HLprivate.h
@@ -57,7 +57,7 @@ H5_DLL herr_t H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr /*out*/);
H5_DLL herr_t H5HL_delete(H5F_t *f, haddr_t addr);
H5_DLL herr_t H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size);
H5_DLL herr_t H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size);
-H5_DLL size_t H5HL_insert(H5F_t *f, H5HL_t *heap, size_t size, const void *buf);
+H5_DLL herr_t H5HL_insert(H5F_t *f, H5HL_t *heap, size_t size, const void *buf, size_t *offset);
H5_DLL void * H5HL_offset_into(const H5HL_t *heap, size_t offset);
H5_DLL H5HL_t *H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags);
H5_DLL herr_t H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size);
@@ -66,4 +66,4 @@ H5_DLL herr_t H5HL_unprotect(H5HL_t *heap);
/* Debugging routines for dumping file structures */
H5_DLL herr_t H5HL_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth);
-#endif
+#endif /* H5HLprivate_H */
diff --git a/src/H5I.c b/src/H5I.c
index 1973354..954a86b 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -925,9 +925,11 @@ done:
ssize_t
H5Iget_name(hid_t id, char *name /*out*/, size_t size)
{
- H5VL_object_t * vol_obj = NULL; /* Object stored in ID */
- H5VL_loc_params_t loc_params;
- ssize_t ret_value = -1; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object stored in ID */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ size_t obj_name_len = 0; /* Length of object's name */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE3("Zs", "ixz", id, name, size);
@@ -940,11 +942,19 @@ H5Iget_name(hid_t id, char *name /*out*/, size_t size)
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_NAME;
+ vol_cb_args.args.get_name.buf_size = size;
+ vol_cb_args.args.get_name.buf = name;
+ vol_cb_args.args.get_name.name_len = &obj_name_len;
+
/* Retrieve object's name */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value, name, size) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object name")
+ /* Set return value */
+ ret_value = (ssize_t)obj_name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_name() */
diff --git a/src/H5Idbg.c b/src/H5Idbg.c
index 8894230..8bf8ecb 100644
--- a/src/H5Idbg.c
+++ b/src/H5Idbg.c
@@ -30,7 +30,6 @@
#include "H5Gprivate.h" /* Groups */
#include "H5Ipkg.h" /* IDs */
#include "H5RSprivate.h" /* Reference-counted strings */
-#include "H5SLprivate.h" /* Skip Lists */
#include "H5Tprivate.h" /* Datatypes */
#include "H5VLprivate.h" /* Virtual Object Layer */
@@ -86,6 +85,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
HDfprintf(stderr, " id = %" PRIdHID "\n", info->id);
HDfprintf(stderr, " count = %u\n", info->count);
HDfprintf(stderr, " obj = 0x%8p\n", info->object);
+ HDfprintf(stderr, " marked = %d\n", info->marked);
/* Get the group location, so we get get the name */
switch (type) {
@@ -110,9 +110,9 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
case H5I_DATATYPE: {
const H5T_t *dt = (const H5T_t *)info->object;
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
object = (void *)H5T_get_actual_type((H5T_t *)dt); /* Casting away const OK - QAK */
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
path = H5T_nameof((const H5T_t *)object);
break;
@@ -173,6 +173,9 @@ H5I_dump_ids_for_type(H5I_type_t type)
if (type_info) {
+ H5I_id_info_t *item = NULL;
+ H5I_id_info_t *tmp = NULL;
+
/* Header */
HDfprintf(stderr, " init_count = %u\n", type_info->init_count);
HDfprintf(stderr, " reserved = %u\n", type_info->cls->reserved);
@@ -182,7 +185,17 @@ H5I_dump_ids_for_type(H5I_type_t type)
/* List */
if (type_info->id_count > 0) {
HDfprintf(stderr, " List:\n");
- H5SL_iterate(type_info->ids, H5I__id_dump_cb, &type);
+ /* Normally we care about the callback's return value
+ * (H5I_ITER_CONT, etc.), but this is an iteration over all
+ * the IDs so we don't care.
+ *
+ * XXX: Update this to emit an error message on errors?
+ */
+ HDfprintf(stderr, " (HASH TABLE)\n");
+ HASH_ITER(hh, type_info->hash_table, item, tmp)
+ {
+ H5I__id_dump_cb((void *)item, NULL, (void *)&type);
+ }
}
}
else
diff --git a/src/H5Idevelop.h b/src/H5Idevelop.h
new file mode 100644
index 0000000..3cd951e
--- /dev/null
+++ b/src/H5Idevelop.h
@@ -0,0 +1,139 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * This file contains public declarations for the H5I (ID management) developer
+ * support routines.
+ */
+
+#ifndef _H5Idevelop_H
+#define _H5Idevelop_H
+
+/* Include package's public header */
+#include "H5Ipublic.h" /* ID management */
+
+/*****************/
+/* Public Macros */
+/*****************/
+
+/*******************/
+/* Public Typedefs */
+/*******************/
+
+/**
+ * The type of the realize_cb callback for H5Iregister_future
+ */
+//! <!-- [H5I_future_realize_func_t_snip] -->
+typedef herr_t (*H5I_future_realize_func_t)(void *future_object, hid_t *actual_object_id);
+//! <!-- [H5I_future_realize_func_t_snip] -->
+
+/**
+ * The type of the discard_cb callback for H5Iregister_future
+ */
+//! <!-- [H5I_future_discard_func_t_snip] -->
+typedef herr_t (*H5I_future_discard_func_t)(void *future_object);
+//! <!-- [H5I_future_discard_func_t_snip] -->
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \ingroup H5I
+ *
+ * \brief Registers a "future" object under a type and returns an ID for it
+ *
+ * \param[in] type The identifier of the type of the new ID
+ * \param[in] object Pointer to "future" object for which a new ID is created
+ * \param[in] realize_cb Function pointer to realize a future object
+ * \param[in] discard_cb Function pointer to destroy a future object
+ *
+ * \return \hid_t{object}
+ *
+ * \details H5Iregister_future() creates and returns a new ID for a "future" object.
+ * Future objects are a special kind of object and represent a
+ * placeholder for an object that has not yet been created or opened.
+ * The \p realize_cb will be invoked by the HDF5 library to 'realize'
+ * the future object as an actual object. A call to H5Iobject_verify()
+ * will invoke the \p realize_cb callback and if it successfully
+ * returns, will return the actual object, not the future object.
+ *
+ * \details The \p type parameter is the identifier for the ID type to which
+ * this new future ID will belong. This identifier may have been created
+ * by a call to H5Iregister_type() or may be one of the HDF5 pre-defined
+ * ID classes (e.g. H5I_FILE, H5I_GROUP, H5I_DATASPACE, etc).
+ *
+ * \details The \p object parameter is a pointer to the memory which the new ID
+ * will be a reference to. This pointer will be stored by the library,
+ * but will not be returned to a call to H5Iobject_verify() until the
+ * \p realize_cb callback has returned the actual pointer for the object.
+ *
+ * A NULL value for \p object is allowed.
+ *
+ * \details The \p realize_cb parameter is a function pointer that will be
+ * invoked by the HDF5 library to convert a future object into an
+ * actual object. The \p realize_cb function may be invoked by
+ * H5Iobject_verify() to return the actual object for a user-defined
+ * ID class (i.e. an ID class registered with H5Iregister_type()) or
+ * internally by the HDF5 library in order to use or get information
+ * from an HDF5 pre-defined ID type. For example, the \p realize_cb
+ * for a future dataspace object will be called during the process
+ * of returning information from H5Sget_simple_extent_dims().
+ *
+ * Note that although the \p realize_cb routine returns
+ * an ID (as a parameter) for the actual object, the HDF5 library
+ * will swap the actual object in that ID for the future object in
+ * the future ID. This ensures that the ID value for the object
+ * doesn't change for the user when the object is realized.
+ *
+ * Note that the \p realize_cb callback could receive a NULL value
+ * for a future object pointer, if one was used when H5Iregister_future()
+ * was initially called. This is permitted as a means of allowing
+ * the \p realize_cb to act as a generator of new objects, without
+ * requiring creation of unnecessary future objects.
+ *
+ * It is an error to pass NULL for \p realize_cb.
+ *
+ * \details The \p discard_cb parameter is a function pointer that will be
+ * invoked by the HDF5 library to destroy a future object. This
+ * callback will always be invoked for _every_ future object, whether
+ * the \p realize_cb is invoked on it or not. It's possible that
+ * the \p discard_cb is invoked on a future object without the
+ * \p realize_cb being invoked, e.g. when a future ID is closed without
+ * requiring the future object to be realized into an actual one.
+ *
+ * Note that the \p discard_cb callback could receive a NULL value
+ * for a future object pointer, if one was used when H5Iregister_future()
+ * was initially called.
+ *
+ * It is an error to pass NULL for \p discard_cb.
+ *
+ * \note The H5Iregister_future() function is primarily targeted at VOL connector
+ * authors and is _not_ designed for general-purpose application use.
+ *
+ */
+H5_DLL hid_t H5Iregister_future(H5I_type_t type, const void *object, H5I_future_realize_func_t realize_cb,
+ H5I_future_discard_func_t discard_cb);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _H5Idevelop_H */
diff --git a/src/H5Iint.c b/src/H5Iint.c
index a025331..86a2810 100644
--- a/src/H5Iint.c
+++ b/src/H5Iint.c
@@ -29,7 +29,6 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Ipkg.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5SLprivate.h" /* Skip Lists */
#include "H5Tprivate.h" /* Datatypes */
#include "H5VLprivate.h" /* Virtual Object Layer */
@@ -75,7 +74,7 @@ typedef struct {
/********************/
static void * H5I__unwrap(void *object, H5I_type_t type);
-static htri_t H5I__clear_type_cb(void *_id, void *key, void *udata);
+static herr_t H5I__mark_node(void *_id, void *key, void *udata);
static void * H5I__remove_common(H5I_type_info_t *type_info, hid_t id);
static int H5I__dec_ref(hid_t id, void **request);
static int H5I__dec_app_ref(hid_t id, void **request);
@@ -96,6 +95,9 @@ int H5I_next_type_g = (int)H5I_NTYPES;
/* Declare a free list to manage the H5I_id_info_t struct */
H5FL_DEFINE_STATIC(H5I_id_info_t);
+/* Whether deletes are actually marks (for mark-and-sweep) */
+hbool_t H5I_marking_g = FALSE;
+
/*****************************/
/* Library Private Variables */
/*****************************/
@@ -131,7 +133,7 @@ H5I_term_package(void)
/* Count the number of types still in use */
for (i = 0; i < H5I_next_type_g; i++)
- if ((type_info = H5I_type_info_array_g[i]) && type_info->ids)
+ if ((type_info = H5I_type_info_array_g[i]) && type_info->hash_table)
in_use++;
/* If no types are still being used then clean up */
@@ -139,7 +141,7 @@ H5I_term_package(void)
for (i = 0; i < H5I_next_type_g; i++) {
type_info = H5I_type_info_array_g[i];
if (type_info) {
- HDassert(NULL == type_info->ids);
+ HDassert(NULL == type_info->hash_table);
type_info = H5MM_xfree(type_info);
H5I_type_info_array_g[i] = NULL;
in_use++;
@@ -196,8 +198,7 @@ H5I_register_type(const H5I_class_t *cls)
type_info->id_count = 0;
type_info->nextid = cls->reserved;
type_info->last_id_info = NULL;
- if (NULL == (type_info->ids = H5SL_create(H5SL_TYPE_HID, NULL)))
- HGOTO_ERROR(H5E_ID, H5E_CANTCREATE, FAIL, "skip list creation failed")
+ type_info->hash_table = NULL;
}
/* Increment the count of the times this type has been initialized */
@@ -205,13 +206,9 @@ H5I_register_type(const H5I_class_t *cls)
done:
/* Clean up on error */
- if (ret_value < 0) {
- if (type_info) {
- if (type_info->ids)
- H5SL_close(type_info->ids);
+ if (ret_value < 0)
+ if (type_info)
H5MM_free(type_info);
- }
- }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_register_type() */
@@ -311,7 +308,9 @@ H5I__unwrap(void *object, H5I_type_t type)
herr_t
H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref)
{
- H5I_clear_type_ud_t udata; /* udata struct for callback */
+ H5I_clear_type_ud_t udata; /* udata struct for callback */
+ H5I_id_info_t * item = NULL;
+ H5I_id_info_t * tmp = NULL;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -328,33 +327,57 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref)
udata.force = force;
udata.app_ref = app_ref;
- /* Attempt to free all ids in the type */
- if (H5SL_try_free_safe(udata.type_info->ids, H5I__clear_type_cb, &udata) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTDELETE, FAIL, "can't free ids in type")
+ /* Clearing a type is done in two phases (mark-and-sweep). This is because
+ * the type's free callback can free other IDs, potentially corrupting
+ * the data structure during the traversal.
+ */
+
+ /* Set marking flag */
+ H5I_marking_g = TRUE;
+
+ /* Mark nodes for deletion */
+ HASH_ITER(hh, udata.type_info->hash_table, item, tmp)
+ {
+ if (!item->marked)
+ if (H5I__mark_node((void *)item, NULL, (void *)&udata) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed while clearing the ID type")
+ }
+
+ /* Unset marking flag */
+ H5I_marking_g = FALSE;
+
+ /* Perform sweep */
+ HASH_ITER(hh, udata.type_info->hash_table, item, tmp)
+ {
+ if (item->marked) {
+ HASH_DELETE(hh, udata.type_info->hash_table, item);
+ item = H5FL_FREE(H5I_id_info_t, item);
+ }
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_clear_type() */
/*-------------------------------------------------------------------------
- * Function: H5I__clear_type_cb
+ * Function: H5I__mark_node
*
- * Purpose: Attempts to free the specified ID, calling the free
- * function for the object.
+ * Purpose: Attempts to mark the node for freeing and calls the free
+ * function for the object, if any
*
- * Return: TRUE/FALSE/FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Neil Fortner
* Friday, July 10, 2015
*
*-------------------------------------------------------------------------
*/
-static htri_t
-H5I__clear_type_cb(void *_info, void H5_ATTR_UNUSED *key, void *_udata)
+static herr_t
+H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata)
{
- H5I_id_info_t * info = (H5I_id_info_t *)_info; /* Current ID info being worked with */
- H5I_clear_type_ud_t *udata = (H5I_clear_type_ud_t *)_udata; /* udata struct */
- htri_t ret_value = FALSE; /* Return value */
+ H5I_id_info_t * info = (H5I_id_info_t *)_info; /* Current ID info being worked with */
+ H5I_clear_type_ud_t *udata = (H5I_clear_type_ud_t *)_udata; /* udata struct */
+ hbool_t mark = FALSE;
FUNC_ENTER_STATIC_NOERR
@@ -368,7 +391,7 @@ H5I__clear_type_cb(void *_info, void H5_ATTR_UNUSED *key, void *_udata)
*/
if (udata->force || (info->count - (!udata->app_ref * info->app_count)) <= 1) {
/* Check if this is an un-realized future object */
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
if (info->is_future) {
/* Discard the future object */
if ((info->discard_cb)((void *)info->object) < 0) {
@@ -383,12 +406,12 @@ H5I__clear_type_cb(void *_info, void H5_ATTR_UNUSED *key, void *_udata)
#endif /* H5I_DEBUG */
/* Indicate node should be removed from list */
- ret_value = TRUE;
+ mark = TRUE;
}
}
else {
/* Indicate node should be removed from list */
- ret_value = TRUE;
+ mark = TRUE;
}
}
else {
@@ -406,28 +429,28 @@ H5I__clear_type_cb(void *_info, void H5_ATTR_UNUSED *key, void *_udata)
#endif /* H5I_DEBUG */
/* Indicate node should be removed from list */
- ret_value = TRUE;
+ mark = TRUE;
}
}
else {
/* Indicate node should be removed from list */
- ret_value = TRUE;
+ mark = TRUE;
}
}
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
/* Remove ID if requested */
- if (ret_value) {
- /* Free ID info */
- info = H5FL_FREE(H5I_id_info_t, info);
+ if (mark) {
+ /* Mark ID for deletion */
+ info->marked = TRUE;
/* Decrement the number of IDs in the type */
udata->type_info->id_count--;
}
}
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__clear_type_cb() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5I__mark_node() */
/*-------------------------------------------------------------------------
* Function: H5I__destroy_type
@@ -461,16 +484,18 @@ H5I__destroy_type(H5I_type_t type)
HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "invalid type")
/* Close/clear/destroy all IDs for this type */
- H5E_BEGIN_TRY { H5I_clear_type(type, TRUE, FALSE); }
+ H5E_BEGIN_TRY
+ {
+ H5I_clear_type(type, TRUE, FALSE);
+ }
H5E_END_TRY /* don't care about errors */
/* Check if we should release the ID class */
if (type_info->cls->flags & H5I_CLASS_IS_APPLICATION)
type_info->cls = H5MM_xfree_const(type_info->cls);
- if (H5SL_close(type_info->ids) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list")
- type_info->ids = NULL;
+ HASH_CLEAR(hh, type_info->hash_table);
+ type_info->hash_table = NULL;
type_info = H5MM_xfree(type_info);
@@ -528,10 +553,10 @@ H5I__register(H5I_type_t type, const void *object, hbool_t app_ref, H5I_future_r
info->is_future = (NULL != realize_cb);
info->realize_cb = realize_cb;
info->discard_cb = discard_cb;
+ info->marked = FALSE;
/* Insert into the type */
- if (H5SL_insert(type_info->ids, info, &info->id) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert ID node into skip list")
+ HASH_ADD(hh, type_info->hash_table, id, sizeof(hid_t), info);
type_info->id_count++;
type_info->nextid++;
@@ -640,10 +665,10 @@ H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, h
info->is_future = FALSE;
info->realize_cb = NULL;
info->discard_cb = NULL;
+ info->marked = FALSE;
/* Insert into the type */
- if (H5SL_insert(type_info->ids, info, &info->id) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list")
+ HASH_ADD(hh, type_info->hash_table, id, sizeof(hid_t), info);
type_info->id_count++;
/* Set the most recent ID to this object */
@@ -680,9 +705,9 @@ H5I_subst(hid_t id, const void *new_object)
HGOTO_ERROR(H5E_ID, H5E_NOTFOUND, NULL, "can't get ID ref count")
/* Get the old object pointer to return */
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
/* Set the new object pointer for the ID */
info->object = new_object;
@@ -714,9 +739,9 @@ H5I_object(hid_t id)
/* General lookup of the ID */
if (NULL != (info = H5I__find_id(id))) {
/* Get the object pointer to return */
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
}
FUNC_LEAVE_NOAPI(ret_value)
@@ -750,9 +775,9 @@ H5I_object_verify(hid_t id, H5I_type_t type)
/* Verify that the type of the ID is correct & lookup the ID */
if (type == H5I_TYPE(id) && NULL != (info = H5I__find_id(id))) {
/* Get the object pointer to return */
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
}
FUNC_LEAVE_NOAPI(ret_value)
@@ -897,19 +922,28 @@ H5I__remove_common(H5I_type_info_t *type_info, hid_t id)
/* Sanity check */
HDassert(type_info);
- /* Get the ID node for the ID */
- if (NULL == (info = (H5I_id_info_t *)H5SL_remove(type_info->ids, &id)))
- HGOTO_ERROR(H5E_ID, H5E_CANTDELETE, NULL, "can't remove ID node from skip list")
+ /* Delete or mark the node */
+ HASH_FIND(hh, type_info->hash_table, &id, sizeof(hid_t), info);
+ if (info) {
+ HDassert(!info->marked);
+ if (!H5I_marking_g)
+ HASH_DELETE(hh, type_info->hash_table, info);
+ else
+ info->marked = TRUE;
+ }
+ else
+ HGOTO_ERROR(H5E_ID, H5E_CANTDELETE, NULL, "can't remove ID node from hash table")
/* Check if this ID was the last one accessed */
if (type_info->last_id_info == info)
type_info->last_id_info = NULL;
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
- info = H5FL_FREE(H5I_id_info_t, info);
+ if (!H5I_marking_g)
+ info = H5FL_FREE(H5I_id_info_t, info);
/* Decrement the number of IDs in the type */
(type_info->id_count)--;
@@ -1006,7 +1040,7 @@ H5I__dec_ref(hid_t id, void **request)
/* Get the ID's type */
type_info = H5I_type_info_array_g[H5I_TYPE(id)];
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
/* (Casting away const OK -QAK) */
if (!type_info->cls->free_func || (type_info->cls->free_func)((void *)info->object, request) >= 0) {
/* Remove the node from the type */
@@ -1016,7 +1050,7 @@ H5I__dec_ref(hid_t id, void **request)
} /* end if */
else
ret_value = -1;
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
} /* end if */
else {
--(info->count);
@@ -1495,9 +1529,9 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
/* The stored object pointer might be an H5VL_object_t, in which
* case we'll need to get the wrapped object struct (H5F_t *, etc.).
*/
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
object = H5I__unwrap((void *)info->object, type); /* Casting away const OK */
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
/* Invoke callback function */
cb_ret_val = (*udata->user_func)((void *)object, info->id, udata->user_udata);
@@ -1552,8 +1586,9 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re
/* Only iterate through ID list if it is initialized and there are IDs in type */
if (type_info && type_info->init_count > 0 && type_info->id_count > 0) {
- H5I_iterate_ud_t iter_udata; /* User data for iteration callback */
- herr_t iter_status; /* Iteration status */
+ H5I_iterate_ud_t iter_udata; /* User data for iteration callback */
+ H5I_id_info_t * item = NULL;
+ H5I_id_info_t * tmp = NULL;
/* Set up iterator user data */
iter_udata.user_func = func;
@@ -1562,8 +1597,16 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re
iter_udata.obj_type = type;
/* Iterate over IDs */
- if ((iter_status = H5SL_iterate(type_info->ids, H5I__iterate_cb, &iter_udata)) < 0)
- HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed")
+ HASH_ITER(hh, type_info->hash_table, item, tmp)
+ {
+ if (!item->marked) {
+ int ret = H5I__iterate_cb((void *)item, NULL, (void *)&iter_udata);
+ if (H5_ITER_ERROR == ret)
+ HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed")
+ if (H5_ITER_STOP == ret)
+ break;
+ }
+ }
}
done:
@@ -1604,15 +1647,14 @@ H5I__find_id(hid_t id)
if (type_info->last_id_info && type_info->last_id_info->id == id)
id_info = type_info->last_id_info;
else {
- /* Locate the ID node for the ID */
- id_info = (H5I_id_info_t *)H5SL_search(type_info->ids, &id);
+ HASH_FIND(hh, type_info->hash_table, &id, sizeof(hid_t), id_info);
/* Remember this ID */
type_info->last_id_info = id_info;
}
/* Check if this is a future ID */
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
if (id_info && id_info->is_future) {
hid_t actual_id = H5I_INVALID_HID; /* ID for actual object */
void *future_object; /* Pointer to the future object */
@@ -1644,7 +1686,7 @@ H5I__find_id(hid_t id)
id_info->realize_cb = NULL;
id_info->discard_cb = NULL;
}
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
/* Set return value */
ret_value = id_info;
@@ -1679,9 +1721,9 @@ H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
HDassert(udata);
/* Get a pointer to the VOL connector's data */
- H5_GCC_DIAG_OFF("cast-qual")
+ H5_GCC_CLANG_DIAG_OFF("cast-qual")
object = H5I__unwrap((void *)info->object, type); /* Casting away const OK */
- H5_GCC_DIAG_ON("cast-qual")
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
/* Check for a match */
if (object == udata->object) {
@@ -1721,8 +1763,9 @@ H5I_find_id(const void *object, H5I_type_t type, hid_t *id)
/* Only iterate through ID list if it is initialized and there are IDs in type */
if (type_info->init_count > 0 && type_info->id_count > 0) {
- H5I_get_id_ud_t udata; /* User data */
- herr_t iter_status; /* Iteration status */
+ H5I_get_id_ud_t udata; /* User data */
+ H5I_id_info_t * item = NULL;
+ H5I_id_info_t * tmp = NULL;
/* Set up iterator user data */
udata.object = object;
@@ -1730,8 +1773,14 @@ H5I_find_id(const void *object, H5I_type_t type, hid_t *id)
udata.ret_id = H5I_INVALID_HID;
/* Iterate over IDs for the ID type */
- if ((iter_status = H5SL_iterate(type_info->ids, H5I__find_id_cb, &udata)) < 0)
- HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed")
+ HASH_ITER(hh, type_info->hash_table, item, tmp)
+ {
+ int ret = H5I__find_id_cb((void *)item, NULL, (void *)&udata);
+ if (H5_ITER_ERROR == ret)
+ HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed")
+ if (H5_ITER_STOP == ret)
+ break;
+ }
*id = udata.ret_id;
}
diff --git a/src/H5Imodule.h b/src/H5Imodule.h
index 8db31c8..08f8bb0 100644
--- a/src/H5Imodule.h
+++ b/src/H5Imodule.h
@@ -30,8 +30,85 @@
#define H5_MY_PKG_INIT NO
/**\defgroup H5I H5I
- * \brief Identifier Interface
- * \todo Describe concisely what the functions in this module are about.
+ *
+ * Use the functions in this module to manage identifiers defined by the HDF5
+ * library. See \ref H5IUD for user-defined identifiers and identifier
+ * types.
+ *
+ * HDF5 identifiers are usually created as a side-effect of creating HDF5
+ * entities such as groups, datasets, attributes, or property lists.
+ *
+ * Identifiers defined by the HDF5 library can be used to retrieve information
+ * such as path names and reference counts, and their validity can be checked.
+ *
+ * Identifiers can be updated by manipulating their reference counts.
+ *
+ * Unused identifiers should be reclaimed by closing the associated item, e.g.,
+ * HDF5 object, or decrementing the reference count to 0.
+ *
+ * \note Identifiers (of type \ref hid_t) are run-time auxiliaries and
+ * not persisted in the file.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5I_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5I_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5I_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5I_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \defgroup H5IUD User-defined ID Types
+ * \ingroup H5I
+ *
+ * The \ref H5I module contains functions to define new identifier types.
+ * For convenience, handles of type \ref hid_t can then be associated with the
+ * new identifier types and user objects.
+ *
+ * New identifier types can be created by registering a new identifier type
+ * with the HDF5 library. Once a new identifier type has bee registered,
+ * it can be used to generate identifiers for user objects.
+ *
+ * User-defined identifier types can be searched and iterated.
+ *
+ * Like library-defined identifiers, user-defined identifiers \Emph{and}
+ * identifier types are reference counted, and the reference counts can be
+ * manipulated accordingly.
+ *
+ * User-defined identifiers no longer in use should be deleted or reclaimed,
+ * and identifier types should be destroyed if they are no longer required.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5I_examples.c create_ud
+ * </td>
+ * <td>
+ * \snippet{lineno} H5I_examples.c read_ud
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5I_examples.c update_ud
+ * </td>
+ * <td>
+ * \snippet{lineno} H5I_examples.c delete_ud
+ * </td>
+ * </tr>
+ * </table>
+ *
*/
#endif /* H5Imodule_H */
diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h
index 4cec8c6..e93ec74 100644
--- a/src/H5Ipkg.h
+++ b/src/H5Ipkg.h
@@ -29,8 +29,14 @@
/* Get package's private header */
#include "H5Iprivate.h"
-/* Other private headers needed by this file */
-#include "H5SLprivate.h" /* Skip Lists */
+/* uthash is an external, header-only hash table implementation.
+ *
+ * We include the file directly in src/ and #define a few functions
+ * to use our internal memory calls.
+ */
+#define uthash_malloc(sz) H5MM_malloc(sz)
+#define uthash_free(ptr, sz) H5MM_free(ptr) /* Ignoring sz is intentional */
+#include "uthash.h"
/**************************/
/* Package Private Macros */
@@ -72,6 +78,10 @@ typedef struct H5I_id_info_t {
hbool_t is_future; /* Whether this ID represents a future object */
H5I_future_realize_func_t realize_cb; /* 'realize' callback for future object */
H5I_future_discard_func_t discard_cb; /* 'discard' callback for future object */
+
+ /* Hash table ID fields */
+ hbool_t marked; /* Marked for deletion */
+ UT_hash_handle hh; /* Hash table handle (must be LAST) */
} H5I_id_info_t;
/* Type information structure used */
@@ -81,7 +91,7 @@ typedef struct H5I_type_info_t {
uint64_t id_count; /* Current number of IDs held */
uint64_t nextid; /* ID to use for the next object */
H5I_id_info_t * last_id_info; /* Info for most recent ID looked up */
- H5SL_t * ids; /* Pointer to skip list that stores IDs */
+ H5I_id_info_t * hash_table; /* Hash table pointer for this ID type */
} H5I_type_info_t;
/*****************************/
@@ -91,12 +101,13 @@ typedef struct H5I_type_info_t {
/* Array of pointers to ID types */
H5_DLLVAR H5I_type_info_t *H5I_type_info_array_g[H5I_MAX_NUM_TYPES];
-/* Variable to keep track of the number of types allocated. Its value is the */
-/* next type ID to be handed out, so it is always one greater than the number */
-/* of types. */
-/* Starts at 1 instead of 0 because it makes trace output look nicer. If more */
-/* types (or IDs within a type) are needed, adjust TYPE_BITS in H5Ipkg.h */
-/* and/or increase size of hid_t */
+/* Variable to keep track of the number of types allocated. Its value is the
+ * next type ID to be handed out, so it is always one greater than the number
+ * of types.
+ * Starts at 1 instead of 0 because it makes trace output look nicer. If more
+ * types (or IDs within a type) are needed, adjust TYPE_BITS in H5Ipkg.h
+ * and/or increase size of hid_t
+ */
H5_DLLVAR int H5I_next_type_g;
/******************************/
@@ -116,4 +127,4 @@ H5_DLL H5I_id_info_t *H5I__find_id(hid_t id);
H5_DLL ssize_t H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached);
#endif /* H5I_TESTING */
-#endif /*_H5Ipkg_H*/
+#endif /*H5Ipkg_H*/
diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h
index d1b6248..831ff76 100644
--- a/src/H5Iprivate.h
+++ b/src/H5Iprivate.h
@@ -20,8 +20,9 @@
#ifndef H5Iprivate_H
#define H5Iprivate_H
-/* Include package's public header */
+/* Include package's public headers */
#include "H5Ipublic.h"
+#include "H5Idevelop.h"
/* Private headers needed by this file */
#include "H5private.h"
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index be347e4..8d4dbf8 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -32,6 +32,7 @@
* test/tmisc.c to verify that the H5I{inc|dec|get}_ref() routines
* work correctly with it. \endinternal
*/
+//! <!-- [H5I_type_t_snip] -->
typedef enum H5I_type_t {
H5I_UNINIT = (-2), /**< uninitialized type */
H5I_BADID = (-1), /**< invalid Type */
@@ -53,6 +54,7 @@ typedef enum H5I_type_t {
H5I_EVENTSET, /**< type ID for event sets */
H5I_NTYPES /**< number of library types, MUST BE LAST! */
} H5I_type_t;
+//! <!-- [H5I_type_t_snip] -->
/**
* Type of IDs to return to users
@@ -86,30 +88,16 @@ typedef herr_t (*H5I_free_t)(void *, void **);
/**
* The type of a function to compare objects & keys
*/
-//! [H5I_search_func_t_snip]
+//! <!-- [H5I_search_func_t_snip] -->
typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key);
-//! [H5I_search_func_t_snip]
+//! <!-- [H5I_search_func_t_snip] -->
/**
* The type of H5Iiterate() callback functions
*/
-//! [H5I_iterate_func_t_snip]
+//! <!-- [H5I_iterate_func_t_snip] -->
typedef herr_t (*H5I_iterate_func_t)(hid_t id, void *udata);
-//! [H5I_iterate_func_t_snip]
-
-/**
- * The type of the realize_cb callback for H5Iregister_future
- */
-//! [H5I_future_realize_func_t_snip]
-typedef herr_t (*H5I_future_realize_func_t)(void *future_object, hid_t *actual_object_id);
-//! [H5I_future_realize_func_t_snip]
-
-/**
- * The type of the discard_cb callback for H5Iregister_future
- */
-//! [H5I_future_discard_func_t_snip]
-typedef herr_t (*H5I_future_discard_func_t)(void *future_object);
-//! [H5I_future_discard_func_t_snip]
+//! <!-- [H5I_iterate_func_t_snip] -->
#ifdef __cplusplus
extern "C" {
@@ -118,7 +106,7 @@ extern "C" {
/* Public API functions */
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Registers an object under a type and returns an ID for it
*
@@ -140,83 +128,7 @@ extern "C" {
*/
H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object);
/**
- * \ingroup H5I
- *
- * \brief Registers a "future" object under a type and returns an ID for it
- *
- * \param[in] type The identifier of the type of the new ID
- * \param[in] object Pointer to "future" object for which a new ID is created
- * \param[in] realize_cb Function pointer to realize a future object
- * \param[in] discard_cb Function pointer to destroy a future object
- *
- * \return \hid_t{object}
- *
- * \details H5Iregister_future() creates and returns a new ID for a "future" object.
- * Future objects are a special kind of object and represent a
- * placeholder for an object that has not yet been created or opened.
- * The \p realize_cb will be invoked by the HDF5 library to 'realize'
- * the future object as an actual object. A call to H5Iobject_verify()
- * will invoke the \p realize_cb callback and if it successfully
- * returns, will return the actual object, not the future object.
- *
- * \details The \p type parameter is the identifier for the ID type to which
- * this new future ID will belong. This identifier may have been created
- * by a call to H5Iregister_type() or may be one of the HDF5 pre-defined
- * ID classes (e.g. H5I_FILE, H5I_GROUP, H5I_DATASPACE, etc).
- *
- * \details The \p object parameter is a pointer to the memory which the new ID
- * will be a reference to. This pointer will be stored by the library,
- * but will not be returned to a call to H5Iobject_verify() until the
- * \p realize_cb callback has returned the actual pointer for the object.
- *
- * A NULL value for \p object is allowed.
- *
- * \details The \p realize_cb parameter is a function pointer that will be
- * invoked by the HDF5 library to convert a future object into an
- * actual object. The \realize_cb function may be invoked by
- * H5Iobject_verify() to return the actual object for a user-defined
- * ID class (i.e. an ID class registered with H5Iregister_type()) or
- * internally by the HDF5 library in order to use or get information
- * from an HDF5 pre-defined ID type. For example, the \p realize_cb
- * for a future dataspace object will be called during the process
- * of returning information from H5Sget_simple_extent_dims().
- *
- * Note that although the \p realize_cb routine returns
- * an ID (as a parameter) for the actual object, the HDF5 library
- * will swap the actual object in that ID for the future object in
- * the future ID. This ensures that the ID value for the object
- * doesn't change for the user when the object is realized.
- *
- * Note that the \p realize_cb callback could receive a NULL value
- * for a future object pointer, if one was used when H5Iregister_future()
- * was initially called. This is permitted as a means of allowing
- * the \p realize_cb to act as a generator of new objects, without
- * requiring creation of unnecessary future objects.
- *
- * It is an error to pass NULL for \p realize_cb.
- *
- * \details The \p discard_cb parameter is a function pointer that will be
- * invoked by the HDF5 library to destroy a future object. This
- * callback will always be invoked for _every_ future object, whether
- * the \p realize_cb is invoked on it or not. It's possible that
- * the \p discard_cb is invoked on a future object without the
- * \p realize_cb being invoked, e.g. when a future ID is closed without
- * requiring the future object to be realized into an actual one.
- *
- * Note that the \p discard_cb callback could receive a NULL value
- * for a future object pointer, if one was used when H5Iregister_future()
- * was initially called.
- *
- * It is an error to pass NULL for \p discard_cb.
- *
- * \note The H5Iregister_future() function is primarily targeted at VOL connector
- * authors and is _not_ designed for general-purpose application use.
- *
- */
-H5_DLL hid_t H5Iregister_future(H5I_type_t type, const void *object, H5I_future_realize_func_t realize_cb,
- H5I_future_discard_func_t discard_cb);
-/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Returns the object referenced by an ID
*
@@ -239,7 +151,7 @@ H5_DLL hid_t H5Iregister_future(H5I_type_t type, const void *object, H5I_future_
*/
H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t type);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Removes an ID from its type
*
@@ -278,12 +190,7 @@ H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t type);
* \return Returns the object type if successful; otherwise #H5I_BADID.
*
* \details H5Iget_type() retrieves the type of the object identified by
- * \p id.
- *
- * Valid types returned by the function are:
- * \types
- *
- * If no valid type can be determined or the identifier submitted is
+ * \p id. If no valid type can be determined or the identifier submitted is
* invalid, the function returns #H5I_BADID.
*
* This function is of particular use in determining the type of
@@ -479,7 +386,7 @@ H5_DLL int H5Idec_ref(hid_t id);
*/
H5_DLL int H5Iget_ref(hid_t id);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Creates and returns a new ID type
*
@@ -511,7 +418,7 @@ H5_DLL int H5Iget_ref(hid_t id);
*/
H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Deletes all identifiers of the given type
*
@@ -535,7 +442,7 @@ H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free
*/
H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Removes an identifier type and all identifiers within that type
*
@@ -558,7 +465,7 @@ H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force);
*/
H5_DLL herr_t H5Idestroy_type(H5I_type_t type);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Increments the reference count on an ID type
*
@@ -577,7 +484,7 @@ H5_DLL herr_t H5Idestroy_type(H5I_type_t type);
*/
H5_DLL int H5Iinc_type_ref(H5I_type_t type);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Decrements the reference count on an identifier type
*
@@ -597,7 +504,7 @@ H5_DLL int H5Iinc_type_ref(H5I_type_t type);
*/
H5_DLL int H5Idec_type_ref(H5I_type_t type);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Retrieves the reference count on an ID type
*
@@ -616,7 +523,7 @@ H5_DLL int H5Idec_type_ref(H5I_type_t type);
*/
H5_DLL int H5Iget_type_ref(H5I_type_t type);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Finds the memory referred to by an ID within the given ID type such
* that some criterion is satisfied
@@ -657,7 +564,7 @@ H5_DLL int H5Iget_type_ref(H5I_type_t type);
*/
H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Calls a callback for each member of the identifier type specified
*
@@ -686,7 +593,7 @@ H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
*/
H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Returns the number of identifiers in a given identifier type
*
@@ -706,7 +613,7 @@ H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data);
*/
H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members);
/**
- * \ingroup H5I
+ * \ingroup H5IUD
*
* \brief Determines whether an identifier type is registered
*
diff --git a/src/H5Itest.c b/src/H5Itest.c
index 71ef3f8..80738a9 100644
--- a/src/H5Itest.c
+++ b/src/H5Itest.c
@@ -71,6 +71,7 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached)
H5G_loc_t loc; /* Object location */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
+ size_t name_len = 0; /* Length of name */
ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_PACKAGE
@@ -86,7 +87,7 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached)
/* Set wrapper info in API context */
if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_ID, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
+ HGOTO_ERROR(H5E_ID, H5E_CANTSET, (-1), "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
/* Get object location */
@@ -94,13 +95,16 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached)
HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object location")
/* Call internal group routine to retrieve object's name */
- if ((ret_value = H5G_get_name(&loc, name, size, cached)) < 0)
+ if (H5G_get_name(&loc, name, size, &name_len, cached) < 0)
HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object name")
+ /* Set return value */
+ ret_value = (ssize_t)name_len;
+
done:
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_ID, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
+ HDONE_ERROR(H5E_ID, H5E_CANTRESET, (-1), "can't reset VOL wrapper info")
if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context")
diff --git a/src/H5L.c b/src/H5L.c
index 171c128..065cc5c 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -21,17 +21,13 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5ESprivate.h" /* Event Sets */
-#include "H5Fprivate.h" /* File access */
#include "H5Gprivate.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5Lpkg.h" /* Links */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Oprivate.h" /* File objects */
#include "H5Pprivate.h" /* Property lists */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL */
@@ -40,96 +36,14 @@
/* Local Macros */
/****************/
-#define H5L_MIN_TABLE_SIZE 32 /* Minimum size of the user-defined link type table if it is allocated */
-
/******************/
/* Local Typedefs */
/******************/
-/* User data for path traversal routine for getting link info by name */
-typedef struct {
- H5L_info2_t *linfo; /* Buffer to return to user */
-} H5L_trav_gi_t;
-
-/* User data for path traversal callback to creating a link */
-typedef struct {
- H5F_t * file; /* Pointer to the file */
- H5P_genplist_t * lc_plist; /* Link creation property list */
- H5G_name_t * path; /* Path to object being linked */
- H5O_obj_create_t *ocrt_info; /* Pointer to object creation info */
- H5O_link_t * lnk; /* Pointer to link information to insert */
-} H5L_trav_cr_t;
-
-/* User data for path traversal routine for moving and renaming a link */
-typedef struct {
- const char * dst_name; /* Destination name for moving object */
- H5T_cset_t cset; /* Char set for new name */
- const H5G_loc_t *dst_loc; /* Destination location for moving object */
- unsigned dst_target_flags; /* Target flags for destination object */
- hbool_t copy; /* TRUE if this is a copy operation */
- size_t orig_nlinks; /* The original value for the # of soft / UD links that can be traversed */
-} H5L_trav_mv_t;
-
-/* User data for path traversal routine for moving and renaming an object */
-typedef struct {
- H5F_t * file; /* Pointer to the file */
- H5O_link_t *lnk; /* Pointer to link information to insert */
- hbool_t copy; /* TRUE if this is a copy operation */
-} H5L_trav_mv2_t;
-
-/* User data for path traversal routine for checking if a link exists */
-typedef struct {
- /* Down */
- char *sep; /* Pointer to next separator in the string */
-
- /* Up */
- hbool_t *exists; /* Whether the link exists or not */
-} H5L_trav_le_t;
-
-/* User data for path traversal routine for getting link value */
-typedef struct {
- size_t size; /* Size of user buffer */
- void * buf; /* User buffer */
-} H5L_trav_gv_t;
-
/********************/
/* Local Prototypes */
/********************/
-static int H5L__find_class_idx(H5L_type_t id);
-static herr_t H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path,
- H5F_t *obj_file, H5O_link_t *lnk, H5O_obj_create_t *ocrt_info, hid_t lcpl_id);
-static herr_t H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size);
-static herr_t H5L__get_val_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__get_val_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__delete_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__delete_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__exists_final_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__exists_inter_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__get_info_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__get_info_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/);
-static herr_t H5L__get_name_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/);
static herr_t H5L__create_soft_api_common(const char *link_target, hid_t link_loc_id, const char *link_name,
hid_t lcpl_id, hid_t lapl_id, void **token_ptr,
H5VL_object_t **_vol_obj_ptr);
@@ -151,9 +65,6 @@ static herr_t H5L__iterate_api_common(hid_t group_id, H5_index_t idx_type, H5_it
/* Package Variables */
/*********************/
-/* Package initialization variable */
-hbool_t H5_PKG_INIT_VAR = FALSE;
-
/*****************************/
/* Library Private Variables */
/*****************************/
@@ -162,99 +73,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
/* Local Variables */
/*******************/
-/* Information about user-defined links */
-static size_t H5L_table_alloc_g = 0;
-static size_t H5L_table_used_g = 0;
-static H5L_class_t *H5L_table_g = NULL;
-
-/*-------------------------------------------------------------------------
- * Function: H5L_init
- *
- * Purpose: Initialize the interface from some other package.
- *
- * Return: Success: non-negative
- *
- * Failure: negative
- *
- * Programmer: James Laird
- * Thursday, July 13, 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_init(void)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
- /* FUNC_ENTER() does all the work */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_init() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__init_package
- *
- * Purpose: Initialize information specific to H5L interface.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Tuesday, January 24, 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__init_package(void)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Initialize user-defined link classes */
- if (H5L_register_external() < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "unable to register external link class")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_init_package() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_term_package
- *
- * Purpose: Terminate any resources allocated in H5L__init_package.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Tuesday, January 24, 2006
- *
- *-------------------------------------------------------------------------
- */
-int
-H5L_term_package(void)
-{
- int n = 0;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- if (H5_PKG_INIT_VAR) {
- /* Free the table of link types */
- if (H5L_table_g) {
- H5L_table_g = (H5L_class_t *)H5MM_xfree(H5L_table_g);
- H5L_table_used_g = H5L_table_alloc_g = 0;
- n++;
- } /* end if */
-
- /* Mark the interface as uninitialized */
- if (0 == n)
- H5_PKG_INIT_VAR = FALSE;
- } /* end if */
-
- FUNC_LEAVE_NOAPI(n)
-} /* H5L_term_package() */
-
/*-------------------------------------------------------------------------
* Function: H5Lmove
*
@@ -330,14 +148,28 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Make sure that the VOL connectors are the same */
- if (vol_obj1 && vol_obj2)
- if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
+ if (vol_obj1 && vol_obj2) {
+ int same_connector = 0;
+
+ /* Check if both objects are associated with the same VOL connector */
+ if (H5VL_cmp_connector_cls(&same_connector, vol_obj1->connector->cls, vol_obj2->connector->cls) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCOMPARE, FAIL, "can't compare connector classes")
+ if (same_connector)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"Objects are accessed through different VOL connectors and can't be linked")
+ } /* end if */
/* Construct a temporary source VOL object */
- tmp_vol_obj.data = (vol_obj1 ? vol_obj1->data : NULL);
- tmp_vol_obj.connector = (vol_obj1 ? vol_obj1->connector : vol_obj2->connector);
+ if (vol_obj1) {
+ tmp_vol_obj.connector = vol_obj1->connector;
+ tmp_vol_obj.data = vol_obj1->data;
+ } /* end if */
+ else {
+ HDassert(vol_obj2);
+
+ tmp_vol_obj.connector = vol_obj2->connector;
+ tmp_vol_obj.data = NULL;
+ } /* end else */
/* Move the link */
if (H5VL_link_move(&tmp_vol_obj, &loc_params1, vol_obj2, &loc_params2, lcpl_id, lapl_id,
@@ -420,14 +252,28 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *ds
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Make sure that the VOL connectors are the same */
- if (vol_obj1 && vol_obj2)
- if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
+ if (vol_obj1 && vol_obj2) {
+ int same_connector = 0;
+
+ /* Check if both objects are associated with the same VOL connector */
+ if (H5VL_cmp_connector_cls(&same_connector, vol_obj1->connector->cls, vol_obj2->connector->cls) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCOMPARE, FAIL, "can't compare connector classes")
+ if (same_connector)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"Objects are accessed through different VOL connectors and can't be linked")
+ } /* end if */
/* Construct a temporary source VOL object */
- tmp_vol_obj.data = (vol_obj1 ? vol_obj1->data : NULL);
- tmp_vol_obj.connector = (vol_obj1 ? vol_obj1->connector : vol_obj2->connector);
+ if (vol_obj1) {
+ tmp_vol_obj.connector = vol_obj1->connector;
+ tmp_vol_obj.data = vol_obj1->data;
+ } /* end if */
+ else {
+ HDassert(vol_obj2);
+
+ tmp_vol_obj.connector = vol_obj2->connector;
+ tmp_vol_obj.data = NULL;
+ } /* end else */
/* Copy the link */
if (H5VL_link_copy(&tmp_vol_obj, &loc_params1, vol_obj2, &loc_params2, lcpl_id, lapl_id,
@@ -454,8 +300,9 @@ H5L__create_soft_api_common(const char *link_target, hid_t link_loc_id, const ch
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -468,6 +315,7 @@ H5L__create_soft_api_common(const char *link_target, hid_t link_loc_id, const ch
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "link_target parameter cannot be an empty string")
if (lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
+ /* link_name is verified in H5VL_setup_name_args() */
/* Get the link creation property list */
if (H5P_DEFAULT == lcpl_id)
@@ -480,15 +328,17 @@ H5L__create_soft_api_common(const char *link_target, hid_t link_loc_id, const ch
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
- /* link_name is verified in H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(link_loc_id, link_name, H5P_CLS_LACC, TRUE, lapl_id, vol_obj_ptr, &loc_params) <
- 0)
+ if (H5VL_setup_name_args(link_loc_id, link_name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_SOFT;
+ vol_cb_args.args.soft.target = link_target;
+
/* Create the link */
- if (H5VL_link_create(H5VL_LINK_CREATE_SOFT, *vol_obj_ptr, &loc_params, lcpl_id, lapl_id,
- H5P_DATASET_XFER_DEFAULT, token_ptr, link_target) < 0)
+ if (H5VL_link_create(&vol_cb_args, *vol_obj_ptr, &loc_params, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT,
+ token_ptr) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create soft link")
done:
@@ -565,7 +415,7 @@ H5Lcreate_soft_async(const char *app_file, const char *app_func, unsigned app_li
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE9(FUNC, "*s*sIu*si*siii", app_file, app_func, app_line, link_target, link_loc_id, link_name, lcpl_id, lapl_id, es_id)) < 0)
+ H5ARG_TRACE9(__func__, "*s*sIu*si*siii", app_file, app_func, app_line, link_target, link_loc_id, link_name, lcpl_id, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -583,31 +433,31 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5L__create_hard_api_common(hid_t cur_loc_id, const char *cur_name, hid_t new_loc_id, const char *new_name,
+H5L__create_hard_api_common(hid_t cur_loc_id, const char *cur_name, hid_t link_loc_id, const char *link_name,
hid_t lcpl_id, hid_t lapl_id, void **token_ptr, H5VL_object_t **_vol_obj_ptr)
{
- H5VL_object_t * vol_obj1 = NULL; /* Object of cur_loc_id */
- H5VL_object_t * vol_obj2 = NULL; /* Object of new_loc_id */
+ H5VL_object_t * curr_vol_obj = NULL; /* Object of cur_loc_id */
+ H5VL_object_t * link_vol_obj = NULL; /* Object of link_loc_id */
H5VL_object_t tmp_vol_obj; /* Temporary object */
H5VL_object_t * tmp_vol_obj_ptr = &tmp_vol_obj; /* Ptr to temporary object */
H5VL_object_t **tmp_vol_obj_ptr_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj_ptr); /* Ptr to ptr to temporary object */
- H5VL_loc_params_t loc_params1; /* Location parameters for cur_loc_id object access */
- H5VL_loc_params_t loc_params2; /* Location parameters for new_loc_id object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t link_loc_params; /* Location parameters for link_loc_id object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Check arguments */
- if (cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC)
+ if (cur_loc_id == H5L_SAME_LOC && link_loc_id == H5L_SAME_LOC)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should not be both H5L_SAME_LOC")
if (!cur_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cur_name parameter cannot be NULL")
if (!*cur_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cur_name parameter cannot be an empty string")
- if (!new_name)
+ if (!link_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new_name parameter cannot be NULL")
- if (!*new_name)
+ if (!*link_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new_name parameter cannot be an empty string")
if (lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
@@ -623,40 +473,59 @@ H5L__create_hard_api_common(hid_t cur_loc_id, const char *cur_name, hid_t new_lo
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
- /* Set up current & new location structs */
- loc_params1.type = H5VL_OBJECT_BY_NAME;
- loc_params1.obj_type = H5I_get_type(cur_loc_id);
- loc_params1.loc_data.loc_by_name.name = cur_name;
- loc_params1.loc_data.loc_by_name.lapl_id = lapl_id;
-
- loc_params2.type = H5VL_OBJECT_BY_NAME;
- loc_params2.obj_type = H5I_get_type(new_loc_id);
- loc_params2.loc_data.loc_by_name.name = new_name;
- loc_params2.loc_data.loc_by_name.lapl_id = lapl_id;
+ /* Set up new location struct */
+ link_loc_params.type = H5VL_OBJECT_BY_NAME;
+ link_loc_params.obj_type = H5I_get_type(link_loc_id);
+ link_loc_params.loc_data.loc_by_name.name = link_name;
+ link_loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
if (H5L_SAME_LOC != cur_loc_id)
/* Get the current location object */
- if (NULL == (vol_obj1 = (H5VL_object_t *)H5VL_vol_object(cur_loc_id)))
+ if (NULL == (curr_vol_obj = (H5VL_object_t *)H5VL_vol_object(cur_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
- if (H5L_SAME_LOC != new_loc_id)
+ if (H5L_SAME_LOC != link_loc_id)
/* Get the new location object */
- if (NULL == (vol_obj2 = (H5VL_object_t *)H5VL_vol_object(new_loc_id)))
+ if (NULL == (link_vol_obj = (H5VL_object_t *)H5VL_vol_object(link_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Make sure that the VOL connectors are the same */
- if (vol_obj1 && vol_obj2)
- if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
+ if (curr_vol_obj && link_vol_obj) {
+ int same_connector = 0;
+
+ /* Check if both objects are associated with the same VOL connector */
+ if (H5VL_cmp_connector_cls(&same_connector, curr_vol_obj->connector->cls,
+ link_vol_obj->connector->cls) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCOMPARE, FAIL, "can't compare connector classes")
+ if (same_connector)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"Objects are accessed through different VOL connectors and can't be linked")
+ } /* end if */
/* Construct a temporary VOL object */
- (*tmp_vol_obj_ptr_ptr)->data = (vol_obj2 ? (vol_obj2->data) : NULL);
- (*tmp_vol_obj_ptr_ptr)->connector = (vol_obj1 != NULL ? vol_obj1->connector : vol_obj2->connector);
+ if (curr_vol_obj)
+ (*tmp_vol_obj_ptr_ptr)->connector = curr_vol_obj->connector;
+ else {
+ HDassert(link_vol_obj);
+
+ (*tmp_vol_obj_ptr_ptr)->connector = link_vol_obj->connector;
+ } /* end else */
+ if (link_vol_obj)
+ (*tmp_vol_obj_ptr_ptr)->data = link_vol_obj->data;
+ else
+ (*tmp_vol_obj_ptr_ptr)->data = NULL;
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_HARD;
+ vol_cb_args.args.hard.curr_obj = (curr_vol_obj ? curr_vol_obj->data : NULL);
+ vol_cb_args.args.hard.curr_loc_params.type = H5VL_OBJECT_BY_NAME;
+ vol_cb_args.args.hard.curr_loc_params.obj_type =
+ (H5L_SAME_LOC != cur_loc_id ? H5I_get_type(cur_loc_id) : H5I_BADID);
+ vol_cb_args.args.hard.curr_loc_params.loc_data.loc_by_name.name = cur_name;
+ vol_cb_args.args.hard.curr_loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
/* Create the link */
- if (H5VL_link_create(H5VL_LINK_CREATE_HARD, *tmp_vol_obj_ptr_ptr, &loc_params2, lcpl_id, lapl_id,
- H5P_DATASET_XFER_DEFAULT, token_ptr, (vol_obj1 ? vol_obj1->data : NULL),
- &loc_params1) < 0)
+ if (H5VL_link_create(&vol_cb_args, *tmp_vol_obj_ptr_ptr, &link_loc_params, lcpl_id, lapl_id,
+ H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create hard link")
done:
@@ -716,12 +585,11 @@ H5Lcreate_hard_async(const char *app_file, const char *app_func, unsigned app_li
const char *cur_name, hid_t new_loc_id, const char *new_name, hid_t lcpl_id,
hid_t lapl_id, hid_t es_id)
{
- H5VL_object_t vol_obj; /* Object for loc_id */
- H5VL_object_t * vol_obj_ptr = &vol_obj; /* Pointer to object for loc_id */
- H5VL_object_t **vol_obj_ptr_ptr = &vol_obj_ptr; /* Pointer to object pointer */
- void * token = NULL; /* Request token for async operation */
- void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t vol_obj; /* Object for loc_id */
+ H5VL_object_t *vol_obj_ptr = &vol_obj; /* Pointer to object for loc_id */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE10("e", "*s*sIui*si*siii", app_file, app_func, app_line, cur_loc_id, cur_name, new_loc_id,
@@ -733,14 +601,14 @@ H5Lcreate_hard_async(const char *app_file, const char *app_func, unsigned app_li
/* Creates a hard link asynchronously */
if (H5L__create_hard_api_common(cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, lapl_id, token_ptr,
- vol_obj_ptr_ptr) < 0)
+ &vol_obj_ptr) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to asynchronously create hard link")
/* If a token was created, add the token to the event set */
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj_ptr->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIui*si*siii", app_file, app_func, app_line, cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, lapl_id, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIui*si*siii", app_file, app_func, app_line, cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -772,16 +640,16 @@ herr_t
H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id, const char *link_name,
hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- char * norm_obj_name = NULL; /* Pointer to normalized current name */
- void * ext_link_buf = NULL; /* Buffer to contain external link */
- size_t buf_size; /* Size of buffer to hold external link */
- size_t file_name_len; /* Length of file name string */
- size_t norm_obj_name_len; /* Length of normalized object name string */
- uint8_t * p; /* Pointer into external link buffer */
- H5L_type_t link_type = H5L_TYPE_EXTERNAL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ char * norm_obj_name = NULL; /* Pointer to normalized current name */
+ void * ext_link_buf = NULL; /* Buffer to contain external link */
+ size_t buf_size; /* Size of buffer to hold external link */
+ size_t file_name_len; /* Length of file name string */
+ size_t norm_obj_name_len; /* Length of normalized object name string */
+ uint8_t * p; /* Pointer into external link buffer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "*s*si*sii", file_name, obj_name, link_loc_id, link_name, lcpl_id, lapl_id);
@@ -832,10 +700,15 @@ H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_i
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(link_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_UD;
+ vol_cb_args.args.ud.type = H5L_TYPE_EXTERNAL;
+ vol_cb_args.args.ud.buf = ext_link_buf;
+ vol_cb_args.args.ud.buf_size = buf_size;
+
/* Create an external link */
- if (H5VL_link_create(H5VL_LINK_CREATE_UD, vol_obj, &loc_params, lcpl_id, lapl_id,
- H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (int)link_type, ext_link_buf,
- buf_size) < 0)
+ if (H5VL_link_create(&vol_cb_args, vol_obj, &loc_params, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create external link")
done:
@@ -873,9 +746,10 @@ herr_t
H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, const void *udata,
size_t udata_size, hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sLl*xzii", link_loc_id, link_name, link_type, udata, udata_size, lcpl_id, lapl_id);
@@ -908,9 +782,15 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, con
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(link_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
- /* Create external link */
- if (H5VL_link_create(H5VL_LINK_CREATE_UD, vol_obj, &loc_params, lcpl_id, lapl_id,
- H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (int)link_type, udata, udata_size) < 0)
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_UD;
+ vol_cb_args.args.ud.type = link_type;
+ vol_cb_args.args.ud.buf = udata;
+ vol_cb_args.args.ud.buf_size = udata_size;
+
+ /* Create user-defined link */
+ if (H5VL_link_create(&vol_cb_args, vol_obj, &loc_params, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
done:
@@ -933,8 +813,9 @@ H5L__delete_api_common(hid_t loc_id, const char *name, hid_t lapl_id, void **tok
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -942,12 +823,14 @@ H5L__delete_api_common(hid_t loc_id, const char *name, hid_t lapl_id, void **tok
/* name is verified in H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, name, H5P_CLS_LACC, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, name, TRUE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments")
- /* Unlink */
- if (H5VL_link_specific(*vol_obj_ptr, &loc_params, H5VL_LINK_DELETE, H5P_DATASET_XFER_DEFAULT, token_ptr) <
- 0)
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_DELETE;
+
+ /* Delete link */
+ if (H5VL_link_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link")
done:
@@ -1020,7 +903,7 @@ H5Ldelete_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0)
+ H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1046,8 +929,9 @@ H5L__delete_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t i
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1060,13 +944,15 @@ H5L__delete_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t i
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
/* Set up object access arguments */
- if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, H5P_CLS_LACC, TRUE, lapl_id, vol_obj_ptr,
- &loc_params) < 0)
+ if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, TRUE, lapl_id, vol_obj_ptr, &loc_params) <
+ 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_DELETE;
+
/* Delete the link */
- if (H5VL_link_specific(*vol_obj_ptr, &loc_params, H5VL_LINK_DELETE, H5P_DATASET_XFER_DEFAULT, token_ptr) <
- 0)
+ if (H5VL_link_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link")
done:
@@ -1145,7 +1031,7 @@ H5Ldelete_by_idx_async(const char *app_file, const char *app_func, unsigned app_
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1175,9 +1061,10 @@ done:
herr_t
H5Lget_val(hid_t loc_id, const char *name, void *buf /*out*/, size_t size, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*sxzi", loc_id, name, buf, size, lapl_id);
@@ -1190,18 +1077,23 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf /*out*/, size_t size, hid_t
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.obj_type = H5I_get_type(loc_id);
loc_params.loc_data.loc_by_name.name = name;
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
- /* Get the location object */
+ /* Get the VOL object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_VAL;
+ vol_cb_args.args.get_val.buf = buf;
+ vol_cb_args.args.get_val.buf_size = size;
+
/* Get the link value */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_VAL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, buf,
- size) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name)
done:
@@ -1230,9 +1122,10 @@ herr_t
H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
void *buf /*out*/, size_t size, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, buf, size, lapl_id);
@@ -1249,6 +1142,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_IDX;
loc_params.loc_data.loc_by_idx.name = group_name;
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
@@ -1257,13 +1151,17 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
loc_params.obj_type = H5I_get_type(loc_id);
- /* get the location object */
+ /* Get the VOL object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_VAL;
+ vol_cb_args.args.get_val.buf = buf;
+ vol_cb_args.args.get_val.buf_size = size;
+
/* Get the link value */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_VAL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, buf,
- size) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value")
done:
@@ -1286,8 +1184,9 @@ H5L__exists_api_common(hid_t loc_id, const char *name, hbool_t *exists, hid_t la
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1297,12 +1196,15 @@ H5L__exists_api_common(hid_t loc_id, const char *name, hbool_t *exists, hid_t la
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer for link existence")
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_EXISTS;
+ vol_cb_args.args.exists.exists = exists;
+
/* Check for the existence of the link */
- if (H5VL_link_specific(*vol_obj_ptr, &loc_params, H5VL_LINK_EXISTS, H5P_DATASET_XFER_DEFAULT, token_ptr,
- exists) < 0)
+ if (H5VL_link_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info")
done:
@@ -1374,7 +1276,7 @@ H5Lexists_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
if (H5ES_insert(es_id, vol_obj->connector, token,
/* clang-format off */
- H5ARG_TRACE8(FUNC, "*s*sIui*s*bii", app_file, app_func, app_line, loc_id, name, exists, lapl_id, es_id)) < 0)
+ H5ARG_TRACE8(__func__, "*s*sIui*s*bii", app_file, app_func, app_line, loc_id, name, exists, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1398,9 +1300,10 @@ done:
herr_t
H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo /*out*/, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id);
@@ -1413,18 +1316,22 @@ H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo /*out*/, hid_t l
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.obj_type = H5I_get_type(loc_id);
loc_params.loc_data.loc_by_name.name = name;
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
- /* get the location object */
+ /* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_INFO;
+ vol_cb_args.args.get_info.linfo = linfo;
+
/* Get the link information */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- linfo) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info")
done:
@@ -1449,9 +1356,10 @@ herr_t
H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t n, H5L_info2_t *linfo /*out*/, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, lapl_id);
@@ -1468,6 +1376,7 @@ H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_IDX;
loc_params.loc_data.loc_by_idx.name = group_name;
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
@@ -1476,13 +1385,16 @@ H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
loc_params.obj_type = H5I_get_type(loc_id);
- /* get the location object */
+ /* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_INFO;
+ vol_cb_args.args.get_info.linfo = linfo;
+
/* Get the link information */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- linfo) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info")
done:
@@ -1603,8 +1515,8 @@ done:
htri_t
H5Lis_registered(H5L_type_t id)
{
- size_t i; /* Local index variable */
- htri_t ret_value = FALSE; /* Return value */
+ hbool_t is_registered = FALSE;
+ htri_t ret_value = FALSE; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("t", "Ll", id);
@@ -1614,11 +1526,10 @@ H5Lis_registered(H5L_type_t id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link type id number")
/* Is the link class already registered? */
- for (i = 0; i < H5L_table_used_g; i++)
- if (H5L_table_g[i].id == id) {
- ret_value = TRUE;
- break;
- } /* end if */
+ if (H5L_is_registered(id, &is_registered) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_BADTYPE, FAIL, "could not determine registration status of UD link type")
+
+ ret_value = is_registered ? TRUE : FALSE;
done:
FUNC_LEAVE_API(ret_value)
@@ -1646,9 +1557,11 @@ ssize_t
H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t n, char *name /*out*/, size_t size, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- ssize_t ret_value = -1; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ size_t link_name_len = 0; /* Length of the link name string */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE8("Zs", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, name, size, lapl_id);
@@ -1665,7 +1578,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, (-1), "can't set access property list info")
- /* Fill in location struct fields */
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_IDX;
loc_params.loc_data.loc_by_idx.name = group_name;
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
@@ -1674,15 +1587,23 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
loc_params.obj_type = H5I_get_type(loc_id);
- /* Get the location object */
+ /* Get the VOL object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_NAME;
+ vol_cb_args.args.get_name.name_size = size;
+ vol_cb_args.args.get_name.name = name;
+ vol_cb_args.args.get_name.name_len = &link_name_len;
+
/* Get the link information */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- name, size, &ret_value) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, (-1), "unable to get link name")
+ /* Set the return value */
+ ret_value = (ssize_t)link_name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Lget_name_by_idx() */
@@ -1702,10 +1623,11 @@ H5L__iterate_api_common(hid_t group_id, H5_index_t idx_type, H5_iter_order_t ord
{
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
- (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- H5I_type_t id_type; /* Type of ID */
- herr_t ret_value = H5_ITER_CONT; /* Return value */
+ (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5I_type_t id_type; /* Type of ID */
+ herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_STATIC
@@ -1724,10 +1646,18 @@ H5L__iterate_api_common(hid_t group_id, H5_index_t idx_type, H5_iter_order_t ord
if (H5VL_setup_self_args(group_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set object access arguments")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = FALSE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = idx_p;
+ vol_cb_args.args.iterate.op = op;
+ vol_cb_args.args.iterate.op_data = op_data;
+
/* Iterate over the links */
- if ((ret_value = H5VL_link_specific(*vol_obj_ptr, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- token_ptr, (unsigned)FALSE, (int)idx_type, (int)order, idx_p, op,
- op_data)) < 0)
+ if ((ret_value = H5VL_link_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ token_ptr)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
done:
@@ -1763,7 +1693,7 @@ H5Literate2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t
/* Iterate over links synchronously */
if ((ret_value = H5L__iterate_api_common(group_id, idx_type, order, idx_p, op, op_data, NULL, NULL)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "asynchronous link iteration failed")
+ HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "synchronous link iteration failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -1812,7 +1742,7 @@ H5Literate_async(const char *app_file, const char *app_func, unsigned app_line,
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIuiIiIo*hLI*xi", app_file, app_func, app_line, group_id, idx_type, order, idx_p, op, op_data, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIuiIiIo*hLI*xi", app_file, app_func, app_line, group_id, idx_type, order, idx_p, op, op_data, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1846,9 +1776,10 @@ herr_t
H5Literate_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t *idx_p, H5L_iterate2_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIo*hLI*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id);
@@ -1879,9 +1810,18 @@ H5Literate_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
loc_params.loc_data.loc_by_name.name = group_name;
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = FALSE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = idx_p;
+ vol_cb_args.args.iterate.op = op;
+ vol_cb_args.args.iterate.op_data = op_data;
+
/* Iterate over the links */
- if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, FALSE, idx_type, order, idx_p, op, op_data)) < 0)
+ if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
done:
@@ -1919,10 +1859,11 @@ done:
herr_t
H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, void *op_data)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5I_type_t id_type; /* Type of ID */
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5I_type_t id_type; /* Type of ID */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "iIiIoLI*x", group_id, idx_type, order, op, op_data);
@@ -1946,9 +1887,18 @@ H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(group_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = TRUE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = NULL;
+ vol_cb_args.args.iterate.op = op;
+ vol_cb_args.args.iterate.op_data = op_data;
+
/* Iterate over the links */
- if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0)
+ if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
done:
@@ -1987,9 +1937,10 @@ herr_t
H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
H5L_iterate2_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIoLI*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id);
@@ -2020,9 +1971,18 @@ H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_
loc_params.loc_data.loc_by_name.name = group_name;
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = TRUE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = NULL;
+ vol_cb_args.args.iterate.op = op;
+ vol_cb_args.args.iterate.op_data = op_data;
+
/* Visit the links */
- if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0)
+ if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
done:
@@ -2110,1984 +2070,3 @@ H5Lunpack_elink_val(const void *_ext_linkval, size_t link_size, unsigned *flags,
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Lunpack_elink_val() */
-
-/*
- *-------------------------------------------------------------------------
- *-------------------------------------------------------------------------
- * N O A P I F U N C T I O N S B E Y O N D T H I S P O I N T
- *-------------------------------------------------------------------------
- *-------------------------------------------------------------------------
- */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__find_class_idx
- *
- * Purpose: Given a link class ID, return the offset in the global array
- * that holds all the registered link classes.
- *
- * Return: Success: Non-negative index of entry in global
- * link class table.
- * Failure: Negative
- *
- * Programmer: James Laird
- * Monday, July 10, 2006
- *
- *-------------------------------------------------------------------------
- */
-static int
-H5L__find_class_idx(H5L_type_t id)
-{
- size_t i; /* Local index variable */
- int ret_value = FAIL; /* Return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- for (i = 0; i < H5L_table_used_g; i++)
- if (H5L_table_g[i].id == id)
- HGOTO_DONE((int)i)
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__find_class_idx */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_find_class
- *
- * Purpose: Given a link class ID return a pointer to a global struct that
- * defines the link class.
- *
- * Return: Success: Ptr to entry in global link class table.
- * Failure: NULL
- *
- * Programmer: James Laird
- * Monday, July 10, 2006
- *
- *-------------------------------------------------------------------------
- */
-const H5L_class_t *
-H5L_find_class(H5L_type_t id)
-{
- int idx; /* Filter index in global table */
- H5L_class_t *ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Get the index in the global table */
- if ((idx = H5L__find_class_idx(id)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, NULL, "unable to find link class")
-
- /* Set return value */
- ret_value = H5L_table_g + idx;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_find_class */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_register
- *
- * Purpose: Registers a class of user-defined links, or changes the
- * behavior of an existing class.
- *
- * See H5Lregister for full documentation.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Monday, July 10, 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_register(const H5L_class_t *cls)
-{
- size_t i; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert(cls);
- HDassert(cls->id >= 0 && cls->id <= H5L_TYPE_MAX);
-
- /* Is the link type already registered? */
- for (i = 0; i < H5L_table_used_g; i++)
- if (H5L_table_g[i].id == cls->id)
- break;
-
- /* Filter not already registered */
- if (i >= H5L_table_used_g) {
- if (H5L_table_used_g >= H5L_table_alloc_g) {
- size_t n = MAX(H5L_MIN_TABLE_SIZE, (2 * H5L_table_alloc_g));
- H5L_class_t *table = (H5L_class_t *)H5MM_realloc(H5L_table_g, (n * sizeof(H5L_class_t)));
- if (!table)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend link type table")
- H5L_table_g = table;
- H5L_table_alloc_g = n;
- } /* end if */
-
- /* Initialize */
- i = H5L_table_used_g++;
- } /* end if */
-
- /* Copy link class info into table */
- H5MM_memcpy(H5L_table_g + i, cls, sizeof(H5L_class_t));
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_register */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_unregister
- *
- * Purpose: Unregisters a class of user-defined links.
- *
- * See H5Lunregister for full documentation.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Monday, July 10, 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_unregister(H5L_type_t id)
-{
- size_t i; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert(id >= 0 && id <= H5L_TYPE_MAX);
-
- /* Is the filter already registered? */
- for (i = 0; i < H5L_table_used_g; i++)
- if (H5L_table_g[i].id == id)
- break;
-
- /* Fail if filter not found */
- if (i >= H5L_table_used_g)
- HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "link class is not registered")
-
- /* Remove filter from table */
- /* Don't worry about shrinking table size (for now) */
- HDmemmove(&H5L_table_g[i], &H5L_table_g[i + 1], sizeof(H5L_class_t) * ((H5L_table_used_g - 1) - i));
- H5L_table_used_g--;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_unregister() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_link
- *
- * Purpose: Creates a link from OBJ_ID to CUR_NAME. See H5Olink() for
- * full documentation.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Tuesday, December 13, 2005
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid_t lcpl_id)
-{
- H5O_link_t lnk; /* Link to insert */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check args */
- HDassert(new_loc);
- HDassert(obj_loc);
- HDassert(new_name && *new_name);
-
- /* The link callback will check that the object isn't being hard linked
- * into a different file, so we don't need to do it here (there could be
- * external links along the path).
- */
-
- /* Construct link information for eventual insertion */
- lnk.type = H5L_TYPE_HARD;
- lnk.u.hard.addr = obj_loc->oloc->addr;
-
- /* Create the link */
- if (H5L__create_real(new_loc, new_name, obj_loc->path, obj_loc->oloc->file, &lnk, NULL, lcpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_link() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_link_object
- *
- * Purpose: Creates a new object and a link to it.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, April 9, 2007
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_obj_create_t *ocrt_info, hid_t lcpl_id)
-{
- H5O_link_t lnk; /* Link to insert */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check args */
- HDassert(new_loc);
- HDassert(new_name && *new_name);
- HDassert(ocrt_info);
-
- /* The link callback will check that the object isn't being hard linked
- * into a different file, so we don't need to do it here (there could be
- * external links along the path).
- */
-
- /* Construct link information for eventual insertion */
- lnk.type = H5L_TYPE_HARD;
-
- /* Create the link */
- if (H5L__create_real(new_loc, new_name, NULL, NULL, &lnk, ocrt_info, lcpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_link_object() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__link_cb
- *
- * Purpose: Callback for creating a link to an object.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, September 19, 2005
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_cr_t *udata = (H5L_trav_cr_t *)_udata; /* User data passed in */
- H5G_t * grp = NULL; /* H5G_t for this group, opened to pass to user callback */
- hid_t grp_id = FAIL; /* Id for this group (passed to user callback */
- H5G_loc_t temp_loc; /* For UD callback */
- hbool_t temp_loc_init = FALSE; /* Temporary location for UD callback (temp_loc) has been initialized */
- hbool_t obj_created = FALSE; /* Whether an object was created (through a hard link) */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name in this group resolved to a valid location */
- /* (which is not what we want) */
- if (obj_loc != NULL)
- HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name already exists")
-
- /* Check for crossing file boundaries with a new hard link */
- if (udata->lnk->type == H5L_TYPE_HARD) {
- /* Check for creating an object */
- /* (only for hard links) */
- if (udata->ocrt_info) {
- H5G_loc_t new_loc; /* Group location for new object */
-
- /* Create new object at this location */
- if (NULL ==
- (udata->ocrt_info->new_obj = H5O_obj_create(grp_loc->oloc->file, udata->ocrt_info->obj_type,
- udata->ocrt_info->crt_info, &new_loc)))
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create object")
-
- /* Set address for hard link */
- udata->lnk->u.hard.addr = new_loc.oloc->addr;
-
- /* Set object path to use for setting object name (below) */
- udata->path = new_loc.path;
-
- /* Indicate that an object was created */
- obj_created = TRUE;
- } /* end if */
- else {
- /* Check that both objects are in same file */
- if (!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file))
- HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "interfile hard links are not allowed")
- } /* end else */
- } /* end if */
-
- /* Set 'standard' aspects of link */
- udata->lnk->corder =
- 0; /* Will be re-written during group insertion, if the group is tracking creation order */
- udata->lnk->corder_valid = FALSE; /* Creation order not valid (yet) */
-
- /* Check for non-default link creation properties */
- if (udata->lc_plist) {
- /* Get character encoding property */
- if (H5CX_get_encoding(&udata->lnk->cset) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get 'character set' property")
- } /* end if */
- else
- udata->lnk->cset = H5F_DEFAULT_CSET; /* Default character encoding for link */
-
- /* Set the link's name correctly */
- /* Casting away const OK -QAK */
- udata->lnk->name = (char *)name;
-
- /* Insert link into group */
- if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE,
- udata->ocrt_info ? udata->ocrt_info->obj_type : H5O_TYPE_UNKNOWN,
- udata->ocrt_info ? udata->ocrt_info->crt_info : NULL) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link for object")
-
- /* Set object's path if it has been passed in and is not set */
- if (udata->path != NULL && udata->path->user_path_r == NULL)
- if (H5G_name_set(grp_loc->path, udata->path, name) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "cannot set name")
-
- /* If link is a user-defined link, trigger its creation callback if it has one */
- if (udata->lnk->type >= H5L_TYPE_UD_MIN) {
- const H5L_class_t *link_class; /* User-defined link class */
-
- /* Get the link class for this type of link. */
- if (NULL == (link_class = H5L_find_class(udata->lnk->type)))
- HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "unable to get class of UD link")
-
- if (link_class->create_func != NULL) {
- H5O_loc_t temp_oloc;
- H5G_name_t temp_path;
-
- /* Create a temporary location (or else H5G_open will do a shallow
- * copy and wipe out grp_loc)
- */
- H5G_name_reset(&temp_path);
- if (H5O_loc_copy_deep(&temp_oloc, grp_loc->oloc) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location")
-
- temp_loc.oloc = &temp_oloc;
- temp_loc.path = &temp_path;
- temp_loc_init = TRUE;
-
- /* Set up location for user-defined callback */
- if (NULL == (grp = H5G_open(&temp_loc)))
- HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group")
- if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register ID for group")
-
- /* Make callback */
- if ((link_class->create_func)(name, grp_id, udata->lnk->u.ud.udata, udata->lnk->u.ud.size,
- H5P_DEFAULT) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "link creation callback failed")
- } /* end if */
- } /* end if */
-
-done:
- /* Check if an object was created */
- if (obj_created) {
- H5O_loc_t oloc; /* Object location for created object */
-
- /* Set up object location */
- HDmemset(&oloc, 0, sizeof(oloc));
- oloc.file = grp_loc->oloc->file;
- oloc.addr = udata->lnk->u.hard.addr;
-
- /* Decrement refcount on new object's object header in memory */
- if (H5O_dec_rc_by_loc(&oloc) < 0)
- HDONE_ERROR(H5E_LINK, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object")
- } /* end if */
-
- /* Close the location given to the user callback if it was created */
- if (grp_id >= 0) {
- if (H5I_dec_app_ref(grp_id) < 0)
- HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close ID from UD callback")
- } /* end if */
- else if (grp != NULL) {
- if (H5G_close(grp) < 0)
- HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback")
- } /* end if */
- else if (temp_loc_init)
- H5G_loc_free(&temp_loc);
-
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__link_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__create_real
- *
- * Purpose: Creates a link at a path location
- *
- * lnk should have linkclass-specific information already
- * set, but this function will take care of setting name.
- *
- * obj_path can be NULL if the object's path doesn't need to
- * be set, and obj_file can be NULL if the object is not a
- * hard link.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, December 5, 2005
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path, H5F_t *obj_file,
- H5O_link_t *lnk, H5O_obj_create_t *ocrt_info, hid_t lcpl_id)
-{
- char * norm_link_name = NULL; /* Pointer to normalized link name */
- unsigned target_flags = H5G_TARGET_NORMAL; /* Flags to pass to group traversal function */
- H5P_genplist_t *lc_plist = NULL; /* Link creation property list */
- H5L_trav_cr_t udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check args */
- HDassert(link_loc);
- HDassert(link_name && *link_name);
- HDassert(lnk);
- HDassert(lnk->type >= H5L_TYPE_HARD && lnk->type <= H5L_TYPE_MAX);
-
- /* Get normalized link name */
- if ((norm_link_name = H5G_normalize(link_name)) == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
-
- /* Check for flags present in creation property list */
- if (lcpl_id != H5P_DEFAULT) {
- unsigned crt_intmd_group;
-
- /* Get link creation property list */
- if (NULL == (lc_plist = (H5P_genplist_t *)H5I_object(lcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
-
- /* Get intermediate group creation property */
- if (H5CX_get_intermediate_group(&crt_intmd_group) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get 'create intermediate group' property")
-
- if (crt_intmd_group > 0)
- target_flags |= H5G_CRT_INTMD_GROUP;
- } /* end if */
-
- /* Set up user data
- * FILE is used to make sure that hard links don't cross files, and
- * should be NULL for other link types.
- * LC_PLIST is a pointer to the link creation property list.
- * PATH is a pointer to the path of the object being inserted if this is
- * a hard link; this is used to set the paths to objects when they are
- * created. For other link types, this is NULL.
- * OCRT_INFO is a pointer to the structure for object creation.
- * LNK is the link struct passed into this function. At this point all
- * of its fields should be populated except for name, which is set when
- * inserting it in the callback.
- */
- udata.file = obj_file;
- udata.lc_plist = lc_plist;
- udata.path = obj_path;
- udata.ocrt_info = ocrt_info;
- udata.lnk = lnk;
-
- /* Traverse the destination path & create new link */
- if (H5G_traverse(link_loc, link_name, target_flags, H5L__link_cb, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert link")
-
-done:
- /* Free the normalized path name */
- if (norm_link_name)
- H5MM_xfree(norm_link_name);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__create_real() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__create_hard
- *
- * Purpose: Creates a hard link from NEW_NAME to CUR_NAME.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Monday, April 6, 1998
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link_loc, const char *link_name,
- hid_t lcpl_id)
-{
- char * norm_cur_name = NULL; /* Pointer to normalized current name */
- H5F_t * link_file = NULL; /* Pointer to file to link to */
- H5O_link_t lnk; /* Link to insert */
- H5G_loc_t obj_loc; /* Location of object to link to */
- H5G_name_t path; /* obj_loc's path*/
- H5O_loc_t oloc; /* obj_loc's oloc */
- hbool_t loc_valid = FALSE;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Check args */
- HDassert(cur_loc);
- HDassert(cur_name && *cur_name);
- HDassert(link_loc);
- HDassert(link_name && *link_name);
-
- /* Get normalized copy of the current name */
- if ((norm_cur_name = H5G_normalize(cur_name)) == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
-
- /* Set up link data specific to hard links */
- lnk.type = H5L_TYPE_HARD;
-
- /* Get object location for object pointed to */
- obj_loc.path = &path;
- obj_loc.oloc = &oloc;
- H5G_loc_reset(&obj_loc);
- if (H5G_loc_find(cur_loc, norm_cur_name, &obj_loc) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "source object not found")
- loc_valid = TRUE;
-
- /* Construct link information for eventual insertion */
- lnk.u.hard.addr = obj_loc.oloc->addr;
-
- /* Set destination's file information */
- link_file = obj_loc.oloc->file;
-
- /* Create actual link to the object. Pass in NULL for the path, since this
- * function shouldn't change an object's user path. */
- if (H5L__create_real(link_loc, link_name, NULL, link_file, &lnk, NULL, lcpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
-
-done:
- /* Free the object header location */
- if (loc_valid)
- if (H5G_loc_free(&obj_loc) < 0)
- HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to free location")
-
- /* Free the normalized path name */
- if (norm_cur_name)
- H5MM_xfree(norm_cur_name);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__create_hard() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__create_soft
- *
- * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Robb Matzke
- * Monday, April 6, 1998
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id)
-{
- char * norm_target = NULL; /* Pointer to normalized current name */
- H5O_link_t lnk; /* Link to insert */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Check args */
- HDassert(link_loc);
- HDassert(target_path && *target_path);
- HDassert(link_name && *link_name);
-
- /* Get normalized copy of the link target */
- if ((norm_target = H5G_normalize(target_path)) == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
-
- /* Set up link data specific to soft links */
- lnk.type = H5L_TYPE_SOFT;
- lnk.u.soft.name = norm_target;
-
- /* Create actual link to the object */
- if (H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
-
-done:
- /* Free the normalized target name */
- if (norm_target)
- H5MM_xfree(norm_target);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__create_soft() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__create_ud
- *
- * Purpose: Creates a user-defined link. See H5Lcreate_ud for
- * full documentation.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Friday, May 19, 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void *ud_data, size_t ud_data_size,
- H5L_type_t type, hid_t lcpl_id)
-{
- H5O_link_t lnk; /* Link to insert */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Check args */
- HDassert(type >= H5L_TYPE_UD_MIN && type <= H5L_TYPE_MAX);
- HDassert(link_loc);
- HDassert(link_name && *link_name);
- HDassert(ud_data_size == 0 || ud_data);
-
- /* Initialize the link struct's pointer to its udata buffer */
- lnk.u.ud.udata = NULL;
-
- /* Make sure that this link class is registered */
- if (H5L__find_class_idx(type) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "link class has not been registered with library")
-
- /* Fill in UD link-specific information in the link struct*/
- if (ud_data_size > 0) {
- lnk.u.ud.udata = H5MM_malloc((size_t)ud_data_size);
- H5MM_memcpy(lnk.u.ud.udata, ud_data, (size_t)ud_data_size);
- } /* end if */
- else
- lnk.u.ud.udata = NULL;
-
- lnk.u.ud.size = ud_data_size;
- lnk.type = type;
-
- /* Create actual link to the object */
- if (H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to register new name for object")
-
-done:
- /* Free the link's udata buffer if it's been allocated */
- H5MM_xfree(lnk.u.ud.udata);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__create_ud() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_val_real
- *
- * Purpose: Retrieve link value from a link object
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, November 13 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Sanity check */
- HDassert(lnk);
-
- /* Check for soft link */
- if (H5L_TYPE_SOFT == lnk->type) {
- /* Copy to output buffer */
- if (size > 0 && buf) {
- HDstrncpy((char *)buf, lnk->u.soft.name, size);
- if (HDstrlen(lnk->u.soft.name) >= size)
- ((char *)buf)[size - 1] = '\0';
- } /* end if */
- } /* end if */
- /* Check for user-defined link */
- else if (lnk->type >= H5L_TYPE_UD_MIN) {
- const H5L_class_t *link_class; /* User-defined link class */
-
- /* Get the link class for this type of link. It's okay if the class
- * isn't registered, though--we just can't give any more information
- * about it
- */
- link_class = H5L_find_class(lnk->type);
-
- if (link_class != NULL && link_class->query_func != NULL) {
- if ((link_class->query_func)(lnk->name, lnk->u.ud.udata, lnk->u.ud.size, buf, size) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "query callback returned failure")
- } /* end if */
- else if (buf && size > 0)
- ((char *)buf)[0] = '\0';
- } /* end if */
- else
- HGOTO_ERROR(H5E_LINK, H5E_BADTYPE, FAIL, "object is not a symbolic or user-defined link")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_val_real() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_val_cb
- *
- * Purpose: Callback for retrieving link value or udata.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Tuesday, September 20, 2005
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__get_val_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_gv_t *udata = (H5L_trav_gv_t *)_udata; /* User data passed in */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name in this group resolved to a valid link */
- if (lnk == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "'%s' doesn't exist", name)
-
- /* Retrieve the value for the link */
- if (H5L__get_val_real(lnk, udata->buf, udata->size) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value")
-
-done:
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_val_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_val
- *
- * Purpose: Returns the value of a symbolic link or the udata for a
- * user-defined link.
- *
- * Return: Success: Non-negative, with at most SIZE bytes of the
- * link value copied into the BUF buffer. If the
- * link value is larger than SIZE characters
- * counting the null terminator then the BUF
- * result will not be null terminated.
- *
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Monday, April 13, 1998
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf /*out*/, size_t size)
-{
- H5L_trav_gv_t udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Sanity check */
- HDassert(loc);
- HDassert(name && *name);
-
- /* Set up user data for retrieving information */
- udata.size = size;
- udata.buf = buf;
-
- /* Traverse the group hierarchy to locate the object to get info about */
- if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_cb, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5L__get_val() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_val_by_idx_cb
- *
- * Purpose: Callback for retrieving a link's value according to an
- * index's order.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, November 13 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
- const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */
- H5O_link_t fnd_lnk; /* Link within group */
- hbool_t lnk_copied = FALSE; /* Whether the link was copied */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name of the group resolved to a valid object */
- if (obj_loc == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
-
- /* Query link */
- if (H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
- lnk_copied = TRUE;
-
- /* Retrieve the value for the link */
- if (H5L__get_val_real(&fnd_lnk, udata->buf, udata->size) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value")
-
-done:
- /* Reset the link information, if we have a copy */
- if (lnk_copied)
- H5O_msg_reset(H5O_LINK_ID, &fnd_lnk);
-
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_val_by_idx_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_val_by_idx
- *
- * Purpose: Internal routine to query a link value according to the
- * index within a group
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Quincey Koziol
- * December 27, 2017
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n, void *buf /*out*/, size_t size)
-{
- H5L_trav_gvbi_t udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Check arguments */
- HDassert(loc);
- HDassert(name && *name);
-
- /* Set up user data for retrieving information */
- udata.idx_type = idx_type;
- udata.order = order;
- udata.n = n;
- udata.buf = buf;
- udata.size = size;
-
- /* Traverse the group hierarchy to locate the object to get info about */
- if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_by_idx_cb, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info for index: %llu", (unsigned long long)n)
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_val_by_idx() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__delete_cb
- *
- * Purpose: Callback for deleting a link. This routine
- * actually deletes the link
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, September 19, 2005
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__delete_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
- H5G_loc_t H5_ATTR_UNUSED *obj_loc, void H5_ATTR_UNUSED *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_STATIC
-
- /* Check if the group resolved to a valid link */
- if (grp_loc == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
-
- /* Check if the name in this group resolved to a valid link */
- if (name == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
-
- /* Check for non-existent (NULL) link.
- * Note that this can also occur when attempting to remove '.'
- */
- if (lnk == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL,
- "callback link pointer is NULL (specified link may be '.' or not exist)")
-
- /* Remove the link from the group */
- if (H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to remove link from group")
-
-done:
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__delete_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__delete
- *
- * Purpose: Delete a link from a group.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Thursday, September 17, 1998
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__delete(const H5G_loc_t *loc, const char *name)
-{
- char * norm_name = NULL; /* Pointer to normalized name */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Sanity check */
- HDassert(loc);
- HDassert(name && *name);
-
- /* Get normalized copy of the name */
- if ((norm_name = H5G_normalize(name)) == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
-
- /* Set up user data for unlink operation */
- if (H5G_traverse(loc, norm_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT, H5L__delete_cb,
- NULL) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTREMOVE, FAIL, "can't unlink object")
-
-done:
- /* Free the normalized path name */
- if (norm_name)
- H5MM_xfree(norm_name);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__delete() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__delete_by_idx_cb
- *
- * Purpose: Callback for removing a link according to an index's order.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, November 13 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__delete_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
- const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC_TAG((obj_loc) ? (obj_loc->oloc->addr) : HADDR_UNDEF)
-
- /* Check if the name of the group resolved to a valid object */
- if (obj_loc == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
-
- /* Delete link */
- if (H5G_obj_remove_by_idx(obj_loc->oloc, obj_loc->path->full_path_r, udata->idx_type, udata->order,
- udata->n) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
-
-done:
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI_TAG(ret_value)
-} /* end H5L__delete_by_idx_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__delete_by_idx
- *
- * Purpose: Internal routine to delete a link according to its index
- * within a group.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Quincey Koziol
- * December 27, 2017
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n)
-{
- H5L_trav_rmbi_t udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Sanity check */
- HDassert(loc);
- HDassert(name && *name);
-
- /* Set up user data for unlink operation */
- udata.idx_type = idx_type;
- udata.order = order;
- udata.n = n;
-
- /* Traverse the group hierarchy to remove the link */
- if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT,
- H5L__delete_by_idx_cb, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "link doesn't exist")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__delete_by_idx() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__move_dest_cb
- *
- * Purpose: Second callback for moving and renaming an object. This routine
- * inserts a new link into the group returned by the traversal.
- * It is called by H5L__move_cb.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Monday, April 3, 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk,
- H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_mv2_t *udata = (H5L_trav_mv2_t *)_udata; /* User data passed in */
- H5G_t * grp = NULL; /* H5G_t for this group, opened to pass to user callback */
- hid_t grp_id = FAIL; /* ID for this group (passed to user callback */
- H5G_loc_t temp_loc; /* For UD callback */
- hbool_t temp_loc_init = FALSE;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Make sure an object with this name doesn't already exist */
- if (obj_loc != NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "an object with that name already exists")
-
- /* Check for crossing file boundaries with a new hard link */
- if (udata->lnk->type == H5L_TYPE_HARD)
- /* Check that both objects are in same file */
- if (!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file))
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "moving a link across files is not allowed")
-
- /* Give the object its new name */
- /* Casting away const okay -JML */
- HDassert(udata->lnk->name == NULL);
- udata->lnk->name = (char *)name;
-
- /* Insert the link into the group */
- if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, NULL) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
-
- /* If the link was a user-defined link, call its move callback if it has one */
- if (udata->lnk->type >= H5L_TYPE_UD_MIN) {
- const H5L_class_t *link_class; /* User-defined link class */
-
- /* Get the link class for this type of link. */
- if (NULL == (link_class = H5L_find_class(udata->lnk->type)))
- HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "link class is not registered")
-
- if ((!udata->copy && link_class->move_func) || (udata->copy && link_class->copy_func)) {
- H5O_loc_t temp_oloc;
- H5G_name_t temp_path;
-
- /* Create a temporary location (or else H5G_open will do a shallow
- * copy and wipe out grp_loc)
- */
- H5G_name_reset(&temp_path);
- if (H5O_loc_copy_deep(&temp_oloc, grp_loc->oloc) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location")
-
- temp_loc.oloc = &temp_oloc;
- temp_loc.path = &temp_path;
- temp_loc_init = TRUE;
-
- /* Set up location for user-defined callback */
- if (NULL == (grp = H5G_open(&temp_loc)))
- HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group")
- if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register group ID")
-
- if (udata->copy) {
- if ((link_class->copy_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata,
- udata->lnk->u.ud.size) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "UD copy callback returned error")
- } /* end if */
- else {
- if ((link_class->move_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata,
- udata->lnk->u.ud.size) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "UD move callback returned error")
- } /* end else */
- } /* end if */
- } /* end if */
-
-done:
- /* Close the location given to the user callback if it was created */
- if (grp_id >= 0) {
- if (H5I_dec_app_ref(grp_id) < 0)
- HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close ID from UD callback")
- } /* end if */
- else if (grp != NULL) {
- if (H5G_close(grp) < 0)
- HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback")
- } /* end if */
- else if (temp_loc_init)
- H5G_loc_free(&temp_loc);
-
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- /* Reset the "name" field in udata->lnk because it is owned by traverse()
- * and must not be manipulated after traverse closes */
- udata->lnk->name = NULL;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__move_dest_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__move_cb
- *
- * Purpose: Callback for moving and renaming an object. This routine
- * replaces the names of open objects with the moved object
- * in the path
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Friday, April 3, 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc,
- void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_mv_t *udata = (H5L_trav_mv_t *)_udata; /* User data passed in */
- H5L_trav_mv2_t udata_out; /* User data for H5L__move_dest_cb traversal */
- char * orig_name = NULL; /* The name of the link in this group */
- hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name in this group resolved to a valid link */
- if (obj_loc == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
-
- /* Check for operations on '.' */
- if (lnk == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "the name of a link must be supplied to move or copy")
-
- /* Set up user data for move_dest_cb */
- if (NULL == (udata_out.lnk = (H5O_link_t *)H5O_msg_copy(H5O_LINK_ID, lnk, NULL)))
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link to be moved")
-
- /* In this special case, the link's name is going to be replaced at its
- * destination, so we should free it here.
- */
- udata_out.lnk->name = (char *)H5MM_xfree(udata_out.lnk->name);
- link_copied = TRUE;
-
- udata_out.lnk->cset = udata->cset;
- udata_out.file = grp_loc->oloc->file;
- udata_out.copy = udata->copy;
-
- /* Keep a copy of link's name (it's "owned" by the H5G_traverse() routine) */
- orig_name = H5MM_xstrdup(name);
-
- /* Reset the # of soft / UD links that can be traversed, so that the second
- * (destination) traversal has the correct value
- */
- if (H5CX_set_nlinks(udata->orig_nlinks) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't reset # of soft / UD links to traverse")
-
- /* Insert the link into its new location */
- if (H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags, H5L__move_dest_cb,
- &udata_out) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to follow symbolic link")
-
- /* If this is a move and not a copy operation, change the object's name and remove the old link */
- if (!udata->copy) {
- H5RS_str_t *dst_name_r; /* Ref-counted version of dest name */
-
- /* Make certain that the destination name is a full (not relative) path */
- if (*(udata->dst_name) != '/') {
- HDassert(udata->dst_loc->path->full_path_r);
-
- /* Create reference counted string for full dst path */
- if ((dst_name_r = H5G_build_fullpath_refstr_str(udata->dst_loc->path->full_path_r,
- udata->dst_name)) == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_PATH, FAIL, "can't build destination path name")
- } /* end if */
- else
- dst_name_r = H5RS_wrap(udata->dst_name);
- HDassert(dst_name_r);
-
- /* Fix names up */
- if (H5G_name_replace(lnk, H5G_NAME_MOVE, obj_loc->oloc->file, obj_loc->path->full_path_r,
- udata->dst_loc->oloc->file, dst_name_r) < 0) {
- H5RS_decr(dst_name_r);
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to replace name")
- } /* end if */
-
- /* Remove the old link */
- if (H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, orig_name) < 0) {
- H5RS_decr(dst_name_r);
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to remove old name")
- } /* end if */
-
- H5RS_decr(dst_name_r);
- } /* end if */
-
-done:
- /* Cleanup */
- if (orig_name)
- H5MM_xfree(orig_name);
-
- /* If udata_out.lnk was copied, free any memory allocated
- * In this special case, the H5L__move_dest_cb callback resets the name
- * so H5O_msg_free shouldn't try to free it
- */
- if (link_copied)
- H5O_msg_free(H5O_LINK_ID, udata_out.lnk);
-
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__move_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__move
- *
- * Purpose: Atomically move or copy a link.
- *
- * Creates a copy of a link in a new destination with a new name.
- * SRC_LOC and SRC_NAME together define the link's original
- * location, while DST_LOC and DST_NAME together define its
- * final location.
- *
- * If copy_flag is FALSE, the original link is removed
- * (effectively moving the link).
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Monday, May 1, 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, const char *dst_name,
- hbool_t copy_flag, hid_t lcpl_id)
-{
- unsigned dst_target_flags = H5G_TARGET_NORMAL;
- H5T_cset_t char_encoding = H5F_DEFAULT_CSET; /* Character encoding for link */
- H5P_genplist_t *lc_plist; /* Link creation property list */
- H5L_trav_mv_t udata; /* User data for traversal */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Sanity check */
- HDassert(src_loc);
- HDassert(dst_loc);
- HDassert(src_name && *src_name);
- HDassert(dst_name && *dst_name);
-
- /* Check for flags present in creation property list */
- if (lcpl_id != H5P_DEFAULT) {
- unsigned crt_intmd_group;
-
- if (NULL == (lc_plist = (H5P_genplist_t *)H5I_object(lcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
-
- /* Get intermediate group creation property */
- if (H5CX_get_intermediate_group(&crt_intmd_group) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for creating missing groups")
-
- /* Set target flags for source and destination */
- if (crt_intmd_group > 0)
- dst_target_flags |= H5G_CRT_INTMD_GROUP;
-
- /* Get character encoding property */
- if (H5CX_get_encoding(&char_encoding) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding")
- } /* end if */
-
- /* Set up user data */
- udata.dst_loc = dst_loc;
- udata.dst_name = dst_name;
- udata.dst_target_flags = dst_target_flags;
- udata.cset = char_encoding;
- udata.copy = copy_flag;
-
- /* Retrieve the original # of soft / UD links that can be traversed, so
- * that the countdown can be reset after the first path is traversed.
- */
- if (H5CX_get_nlinks(&udata.orig_nlinks) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse")
-
- /* Do the move */
- if (H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__move_cb,
- &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to find link")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__move() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__exists_final_cb
- *
- * Purpose: Callback for checking whether a link exists, as the final
- * component of a path
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Friday, March 16 2007
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__exists_final_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
- const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_le_t *udata = (H5L_trav_le_t *)_udata; /* User data passed in */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Check if the name in this group resolved to a valid link */
- *udata->exists = (hbool_t)(lnk != NULL);
-
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5L__exists_final_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__exists_inter_cb
- *
- * Purpose: Callback for checking whether a link exists, as an intermediate
- * component of a path
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Thursday, December 31 2015
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__exists_inter_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
- const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_le_t *udata = (H5L_trav_le_t *)_udata; /* User data passed in */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name in this group resolved to a valid link */
- if (lnk != NULL) {
- /* Check for more components to the path */
- if (udata->sep) {
- H5G_traverse_t cb_func; /* Callback function for tranversal */
- char * next; /* Pointer to next component name */
-
- /* Look for another separator */
- next = udata->sep;
- if (NULL == (udata->sep = HDstrchr(udata->sep, '/')))
- cb_func = H5L__exists_final_cb;
- else {
- /* Chew through adjacent separators, if present */
- do {
- *udata->sep = '\0';
- udata->sep++;
- } while ('/' == *udata->sep);
- cb_func = H5L__exists_inter_cb;
- } /* end else */
- if (H5G_traverse(obj_loc, next, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists")
- } /* end if */
- else
- *udata->exists = TRUE;
- } /* end if */
- else
- *udata->exists = FALSE;
-
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__exists_inter_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_exists_tolerant
- *
- * Purpose: Returns whether a link exists in a group
- *
- * Note: Same as H5L__exists, except that missing links are reported
- * as 'FALSE' instead of causing failures
- *
- * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Thursday, December 31 2015
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hbool_t *exists)
-{
- H5L_trav_le_t udata; /* User data for traversal */
- H5G_traverse_t cb_func; /* Callback function for tranversal */
- char * name_copy = NULL; /* Duplicate of name */
- char * name_trav; /* Name to traverse */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Sanity checks */
- HDassert(loc);
- HDassert(name);
- HDassert(exists);
-
- /* Copy the name and skip leading '/'s */
- name_trav = name_copy = H5MM_strdup(name);
- while ('/' == *name_trav)
- name_trav++;
-
- /* A path of "/" will always exist in a file */
- if ('\0' == *name_trav)
- *exists = TRUE;
- else {
- /* Set up user data & correct callback */
- udata.exists = exists;
- if (NULL == (udata.sep = HDstrchr(name_trav, '/')))
- cb_func = H5L__exists_final_cb;
- else {
- /* Chew through adjacent separators, if present */
- do {
- *udata.sep = '\0';
- udata.sep++;
- } while ('/' == *udata.sep);
- cb_func = H5L__exists_inter_cb;
- } /* end else */
-
- /* Traverse the group hierarchy to locate the link to check */
- if (H5G_traverse(loc, name_trav, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists")
- }
-
-done:
- /* Release duplicated string */
- H5MM_xfree(name_copy);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5L_exists_tolerant() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__exists
- *
- * Purpose: Returns whether a link exists in a group
- *
- * Note: Same as H5L_exists_tolerant, except that missing links are reported
- * as failures
- *
- * Return: Non-negative on success, with *exists set/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Friday, March 16 2007
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists)
-{
- H5L_trav_le_t udata; /* User data for traversal */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Sanity checks */
- HDassert(loc);
- HDassert(name);
- HDassert(exists);
-
- /* A path of "/" will always exist in a file */
- if (0 == HDstrcmp(name, "/"))
- *exists = TRUE;
- else {
- /* Traverse the group hierarchy to locate the object to get info about */
- udata.exists = exists;
- if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__exists_final_cb, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "link doesn't exist")
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5L__exists() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_info_cb
- *
- * Purpose: Callback for retrieving a link's metadata
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: James Laird
- * Monday, April 17 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__get_info_cb(H5G_loc_t *grp_loc /*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t *lnk,
- H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_gi_t *udata = (H5L_trav_gi_t *)_udata; /* User data passed in */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name in this group resolved to a valid link */
- if (lnk == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
-
- /* Get information from the link */
- if (H5G_link_to_info(grp_loc->oloc, lnk, udata->linfo) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info")
-
-done:
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_info_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_get_info
- *
- * Purpose: Returns metadata about a link.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: James Laird
- * Monday, April 17 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info2_t *linfo /*out*/)
-{
- H5L_trav_gi_t udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- udata.linfo = linfo;
-
- /* Traverse the group hierarchy to locate the object to get info about */
- if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_cb, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name doesn't exist")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5L_get_info() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_info_by_idx_cb
- *
- * Purpose: Callback for retrieving a link's metadata according to an
- * index's order.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Monday, November 6 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
- const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_gibi_t *udata = (H5L_trav_gibi_t *)_udata; /* User data passed in */
- H5O_link_t fnd_lnk; /* Link within group */
- hbool_t lnk_copied = FALSE; /* Whether the link was copied */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name of the group resolved to a valid object */
- if (obj_loc == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
-
- /* Query link */
- if (H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
- lnk_copied = TRUE;
-
- /* Get information from the link */
- if (H5G_link_to_info(obj_loc->oloc, &fnd_lnk, udata->linfo) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info")
-
-done:
- /* Reset the link information, if we have a copy */
- if (lnk_copied)
- H5O_msg_reset(H5O_LINK_ID, &fnd_lnk);
-
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_info_by_idx_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_info_by_idx
- *
- * Purpose: Internal routine to retrieve link info according to an
- * index's order.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n, H5L_info2_t *linfo /*out*/)
-{
- H5L_trav_gibi_t udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Check arguments */
- HDassert(loc);
- HDassert(name && *name);
- HDassert(linfo);
-
- /* Set up user data for callback */
- udata.idx_type = idx_type;
- udata.order = order;
- udata.n = n;
- udata.linfo = linfo;
-
- /* Traverse the group hierarchy to locate the object to get info about */
- if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_by_idx_cb, &udata) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_info_by_idx() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_name_by_idx_cb
- *
- * Purpose: Callback for retrieving a link's name according to an
- * index's order.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Saturday, November 11 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5L__get_name_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
- const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
-{
- H5L_trav_gnbi_t *udata = (H5L_trav_gnbi_t *)_udata; /* User data passed in */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Check if the name of the group resolved to a valid object */
- if (obj_loc == NULL)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
-
- /* Query link */
- if ((udata->name_len = H5G_obj_get_name_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n,
- udata->name, udata->size)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
-
-done:
- /* Indicate that this callback didn't take ownership of the group *
- * location for the object */
- *own_loc = H5G_OWN_NONE;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_name_by_idx_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__get_name_by_idx
- *
- * Purpose: Internal routine to retrieve link name according to an
- * index's order.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-ssize_t
-H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n, char *name /*out*/, size_t size)
-{
- H5L_trav_gnbi_t udata; /* User data for callback */
- ssize_t ret_value = FAIL; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* Check arguments */
- HDassert(loc);
- HDassert(group_name && *group_name);
-
- /* Set up user data for callback */
- udata.idx_type = idx_type;
- udata.order = order;
- udata.n = n;
- udata.name = name;
- udata.size = size;
- udata.name_len = -1;
-
- /* Traverse the group hierarchy to locate the link to get name of */
- if (H5G_traverse(loc, group_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_name_by_idx_cb, &udata) <
- 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get name")
-
- /* Set the return value */
- ret_value = udata.name_len;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__get_name_by_idx() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L__link_copy_file
- *
- * Purpose: Copy a link and the object it points to from one file to
- * another.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Sep 29 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc,
- H5O_link_t *dst_lnk, H5O_copy_t *cpy_info)
-{
- H5O_link_t tmp_src_lnk; /* Temporary copy of src link, when needed */
- const H5O_link_t *src_lnk = _src_lnk; /* Source link */
- hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */
- hbool_t expanded_link_open = FALSE; /* Whether the target location has been opened */
- H5G_loc_t tmp_src_loc; /* Group location holding target object */
- H5G_name_t tmp_src_path; /* Path for target object */
- H5O_loc_t tmp_src_oloc; /* Object location for target object */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE
-
- /* check arguments */
- HDassert(dst_file);
- HDassert(src_lnk);
- HDassert(dst_lnk);
- HDassert(cpy_info);
-
- /* Expand soft or external link, if requested */
- if ((H5L_TYPE_SOFT == src_lnk->type && cpy_info->expand_soft_link) ||
- (H5L_TYPE_EXTERNAL == src_lnk->type && cpy_info->expand_ext_link)) {
- H5G_loc_t lnk_grp_loc; /* Group location holding link */
- H5G_name_t lnk_grp_path; /* Path for link */
- htri_t tar_exists; /* Whether the target object exists */
-
- /* Set up group location for link */
- H5G_name_reset(&lnk_grp_path);
- lnk_grp_loc.path = &lnk_grp_path;
- lnk_grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Casting away const OK -QAK */
-
- /* Check if the target object exists */
- if ((tar_exists = H5G_loc_exists(&lnk_grp_loc, src_lnk->name)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to check if target object exists")
-
- if (tar_exists) {
- /* Make a temporary copy of the link, so that it will not change the
- * info in the cache when we change it to a hard link */
- if (NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, &tmp_src_lnk))
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message")
-
- /* Set up group location for target object. Let H5G_traverse expand
- * the link. */
- tmp_src_loc.path = &tmp_src_path;
- tmp_src_loc.oloc = &tmp_src_oloc;
- if (H5G_loc_reset(&tmp_src_loc) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to reset location")
-
- /* Find the target object */
- if (H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to find target object")
- expanded_link_open = TRUE;
-
- /* Convert symbolic link to hard link */
- if (tmp_src_lnk.type == H5L_TYPE_SOFT)
- tmp_src_lnk.u.soft.name = (char *)H5MM_xfree(tmp_src_lnk.u.soft.name);
- else if (tmp_src_lnk.u.ud.size > 0)
- tmp_src_lnk.u.ud.udata = H5MM_xfree(tmp_src_lnk.u.ud.udata);
- tmp_src_lnk.type = H5L_TYPE_HARD;
- tmp_src_lnk.u.hard.addr = tmp_src_oloc.addr;
- src_lnk = &tmp_src_lnk;
- } /* end if */
- } /* end if */
-
- /* Copy src link information to dst link information */
- if (NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, dst_lnk))
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message")
- dst_lnk_init = TRUE;
-
- /* Check if object in source group is a hard link & copy it */
- if (H5L_TYPE_HARD == src_lnk->type) {
- H5O_loc_t new_dst_oloc; /* Copied object location in destination */
-
- /* Set up copied object location to fill in */
- H5O_loc_reset(&new_dst_oloc);
- new_dst_oloc.file = dst_file;
-
- if (!expanded_link_open) {
- /* Build temporary object location for source */
- H5O_loc_reset(&tmp_src_oloc);
- tmp_src_oloc.file = src_oloc->file;
- tmp_src_oloc.addr = src_lnk->u.hard.addr;
- } /* end if */
- HDassert(H5F_addr_defined(tmp_src_oloc.addr));
-
- /* Copy the shared object from source to destination */
- /* Don't care about obj_type or udata because those are only important
- * for old style groups */
- if (H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object")
-
- /* Copy new destination object's information for eventual insertion */
- dst_lnk->u.hard.addr = new_dst_oloc.addr;
- } /* end if */
-
-done:
- /* Check if we used a temporary src link */
- if (src_lnk != _src_lnk) {
- HDassert(src_lnk == &tmp_src_lnk);
- H5O_msg_reset(H5O_LINK_ID, &tmp_src_lnk);
- } /* end if */
- if (ret_value < 0)
- if (dst_lnk_init)
- H5O_msg_reset(H5O_LINK_ID, dst_lnk);
- /* Check if we need to free the temp source oloc */
- if (expanded_link_open)
- if (H5G_loc_free(&tmp_src_loc) < 0)
- HDONE_ERROR(H5E_LINK, H5E_CANTFREE, FAIL, "unable to free object")
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L__link_copy_file() */
-
-/*-------------------------------------------------------------------------
- * Function: H5L_iterate
- *
- * Purpose: Iterates through links in a group
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t *idx_p, H5L_iterate2_t op, void *op_data)
-{
- H5G_link_iterate_t lnk_op; /* Link operator */
- hsize_t last_lnk; /* Index of last object looked at */
- hsize_t idx; /* Internal location to hold index */
- herr_t ret_value = FAIL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Sanity checks */
- HDassert(loc);
- HDassert(group_name);
- HDassert(op);
-
- /* Set up iteration beginning/end info */
- idx = (idx_p == NULL ? 0 : *idx_p);
- last_lnk = 0;
-
- /* Build link operator info */
- lnk_op.op_type = H5G_LINK_OP_NEW;
- lnk_op.op_func.op_new = op;
-
- /* Iterate over the links */
- if ((ret_value = H5G_iterate(loc, group_name, idx_type, order, idx, &last_lnk, &lnk_op, op_data)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
-
- /* Set the index we stopped at */
- if (idx_p)
- *idx_p = last_lnk;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_iterate() */
diff --git a/src/H5Ldeprec.c b/src/H5Ldeprec.c
index df4c384..01e77f9 100644
--- a/src/H5Ldeprec.c
+++ b/src/H5Ldeprec.c
@@ -141,12 +141,13 @@ herr_t
H5Literate1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate1_t op,
void *op_data)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5I_type_t id_type; /* Type of ID */
- H5L_shim_data_t shim_data;
- hbool_t is_native_vol_obj;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5I_type_t id_type; /* Type of ID */
+ H5L_shim_data_t shim_data;
+ hbool_t is_native_vol_obj;
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "iIiIo*hLi*x", group_id, idx_type, order, idx_p, op, op_data);
@@ -181,10 +182,18 @@ H5Literate1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t
shim_data.real_op = op;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = FALSE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = idx_p;
+ vol_cb_args.args.iterate.op = H5L__iterate2_shim;
+ vol_cb_args.args.iterate.op_data = &shim_data;
+
/* Iterate over the links */
- if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (unsigned)FALSE, (int)idx_type, (int)order, idx_p,
- H5L__iterate2_shim, (void *)&shim_data)) < 0)
+ if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
done:
@@ -219,11 +228,12 @@ herr_t
H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t *idx_p, H5L_iterate1_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5L_shim_data_t shim_data;
- hbool_t is_native_vol_obj;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5L_shim_data_t shim_data;
+ hbool_t is_native_vol_obj;
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIo*hLi*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id);
@@ -265,10 +275,18 @@ H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
shim_data.real_op = op;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = FALSE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = idx_p;
+ vol_cb_args.args.iterate.op = H5L__iterate2_shim;
+ vol_cb_args.args.iterate.op_data = &shim_data;
+
/* Iterate over the links */
- if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, FALSE, idx_type, order, idx_p, H5L__iterate2_shim,
- (void *)&shim_data)) < 0)
+ if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
done:
@@ -293,11 +311,12 @@ done:
herr_t
H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- H5L_info2_t linfo2; /* New-style link info */
- hbool_t is_native_vol_obj;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5L_info2_t linfo2; /* New-style link info */
+ hbool_t is_native_vol_obj;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id);
@@ -310,12 +329,13 @@ H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t l
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.obj_type = H5I_get_type(loc_id);
loc_params.loc_data.loc_by_name.name = name;
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
- /* get the location object */
+ /* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
@@ -326,9 +346,12 @@ H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t l
HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL,
"H5Lget_info1 is only meant to be used with the native VOL connector")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_INFO;
+ vol_cb_args.args.get_info.linfo = &linfo2;
+
/* Get the link information */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &linfo2) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info")
/* Copy the new-style members into the old-style struct */
@@ -376,11 +399,12 @@ herr_t
H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t n, H5L_info1_t *linfo /*out*/, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- H5L_info2_t linfo2; /* New-style link info */
- hbool_t is_native_vol_obj;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_link_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5L_info2_t linfo2; /* New-style link info */
+ hbool_t is_native_vol_obj;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, lapl_id);
@@ -397,6 +421,7 @@ H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up location struct */
loc_params.type = H5VL_OBJECT_BY_IDX;
loc_params.loc_data.loc_by_idx.name = group_name;
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
@@ -405,7 +430,7 @@ H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
loc_params.obj_type = H5I_get_type(loc_id);
- /* get the location object */
+ /* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
@@ -416,9 +441,12 @@ H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL,
"H5Lget_info_by_idx1 is only meant to be used with the native VOL connector")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_GET_INFO;
+ vol_cb_args.args.get_info.linfo = &linfo2;
+
/* Get the link information */
- if (H5VL_link_get(vol_obj, &loc_params, H5VL_LINK_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &linfo2) < 0)
+ if (H5VL_link_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info")
/* Copy the new-style members into the old-style struct */
@@ -479,12 +507,13 @@ done:
herr_t
H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate1_t op, void *op_data)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5I_type_t id_type; /* Type of ID */
- H5L_shim_data_t shim_data;
- hbool_t is_native_vol_obj;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5I_type_t id_type; /* Type of ID */
+ H5L_shim_data_t shim_data;
+ hbool_t is_native_vol_obj;
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "iIiIoLi*x", group_id, idx_type, order, op, op_data);
@@ -519,10 +548,18 @@ H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat
shim_data.real_op = op;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = TRUE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = NULL;
+ vol_cb_args.args.iterate.op = H5L__iterate2_shim;
+ vol_cb_args.args.iterate.op_data = &shim_data;
+
/* Iterate over the links */
- if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, TRUE, idx_type, order, NULL, H5L__iterate2_shim,
- (void *)&shim_data)) < 0)
+ if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
done:
@@ -563,11 +600,12 @@ herr_t
H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
H5L_iterate1_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5L_shim_data_t shim_data;
- hbool_t is_native_vol_obj;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_link_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ H5L_shim_data_t shim_data;
+ hbool_t is_native_vol_obj;
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIoLi*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id);
@@ -609,10 +647,18 @@ H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_
shim_data.real_op = op;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_ITER;
+ vol_cb_args.args.iterate.recursive = TRUE;
+ vol_cb_args.args.iterate.idx_type = idx_type;
+ vol_cb_args.args.iterate.order = order;
+ vol_cb_args.args.iterate.idx_p = NULL;
+ vol_cb_args.args.iterate.op = H5L__iterate2_shim;
+ vol_cb_args.args.iterate.op_data = &shim_data;
+
/* Visit the links */
- if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, TRUE, idx_type, order, NULL, H5L__iterate2_shim,
- (void *)&shim_data)) < 0)
+ if ((ret_value = H5VL_link_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
done:
diff --git a/src/H5Ldevelop.h b/src/H5Ldevelop.h
new file mode 100644
index 0000000..43ed7de
--- /dev/null
+++ b/src/H5Ldevelop.h
@@ -0,0 +1,314 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * This file contains public declarations for the H5L (link) developer
+ * support routines.
+ */
+
+#ifndef _H5Ldevelop_H
+#define _H5Ldevelop_H
+
+/* Include package's public header */
+#include "H5Lpublic.h"
+
+/*****************/
+/* Public Macros */
+/*****************/
+
+/**
+ * \brief Current version of the H5L_class_t struct
+ */
+#define H5L_LINK_CLASS_T_VERS 1
+
+/*******************/
+/* Public Typedefs */
+/*******************/
+
+/* The H5L_class_t struct can be used to override the behavior of a
+ * "user-defined" link class. Users should populate the struct with callback
+ * functions defined below.
+ */
+/* Callback prototypes for user-defined links */
+/**
+ * \brief Link creation callback
+ */
+typedef herr_t (*H5L_create_func_t)(const char *link_name, hid_t loc_group, const void *lnkdata,
+ size_t lnkdata_size, hid_t lcpl_id);
+/**
+ * \brief Callback for link move
+ */
+typedef herr_t (*H5L_move_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata,
+ size_t lnkdata_size);
+/**
+ * \brief Callback for link copy
+ */
+typedef herr_t (*H5L_copy_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata,
+ size_t lnkdata_size);
+/**
+ * \brief Callback during link traversal
+ */
+typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata,
+ size_t lnkdata_size, hid_t lapl_id, hid_t dxpl_id);
+/**
+ * \brief Callback for link deletion
+ */
+typedef herr_t (*H5L_delete_func_t)(const char *link_name, hid_t file, const void *lnkdata,
+ size_t lnkdata_size);
+/**
+ * \brief Callback for querying the link.
+ *
+ * Returns the size of the buffer needed.
+ */
+typedef ssize_t (*H5L_query_func_t)(const char *link_name, const void *lnkdata, size_t lnkdata_size,
+ void *buf /*out*/, size_t buf_size);
+
+/**
+ * \brief Link prototype
+ *
+ * The H5L_class_t struct can be used to override the behavior of a
+ * "user-defined" link class. Users should populate the struct with callback
+ * functions defined elsewhere.
+ */
+//! <!-- [H5L_class_t_snip] -->
+typedef struct {
+ int version; /**< Version number of this struct */
+ H5L_type_t id; /**< Link type ID */
+ const char * comment; /**< Comment for debugging */
+ H5L_create_func_t create_func; /**< Callback during link creation */
+ H5L_move_func_t move_func; /**< Callback after moving link */
+ H5L_copy_func_t copy_func; /**< Callback after copying link */
+ H5L_traverse_func_t trav_func; /**< Callback during link traversal */
+ H5L_delete_func_t del_func; /**< Callback for link deletion */
+ H5L_query_func_t query_func; /**< Callback for queries */
+} H5L_class_t;
+//! <!-- [H5L_class_t_snip] -->
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \ingroup H5LA
+ *
+ * \brief Registers a user-defined link class or changes behavior of an
+ * existing class
+ *
+ * \param[in] cls Pointer to a buffer containing the struct describing the
+ * user-defined link class
+ *
+ * \return \herr_t
+ *
+ * \details H5Lregister() registers a class of user-defined links, or changes
+ * the behavior of an existing class.
+ *
+ * \p cls is a pointer to a buffer containing a copy of the
+ * H5L_class_t struct. This struct is defined in H5Lpublic.h as
+ * follows:
+ * \snippet this H5L_class_t_snip
+ *
+ * The class definition passed with \p cls must include at least the
+ * following:
+ * \li An H5L_class_t version (which should be #H5L_LINK_CLASS_T_VERS)
+ * \li A link class identifier, \c class_id
+ * \li A traversal function, \c trav_func
+ *
+ * Remaining \c struct members are optional and may be passed as NULL.
+ *
+ * The link class passed in \c class_id must be in the user-definable
+ * range between #H5L_TYPE_UD_MIN and #H5L_TYPE_UD_MAX
+ * (see the table below) and will override
+ * any existing link class with that identifier.
+ *
+ * As distributed, valid values of \c class_id used in HDF5 include
+ * the following (defined in H5Lpublic.h):
+ * \link_types
+ *
+ * The hard and soft link class identifiers cannot be modified or
+ * reassigned, but the external link class is implemented as an
+ * example in the user-definable link class identifier range.
+ * H5Lregister() is used to register additional link classes. It could
+ * also be used to modify the behavior of the external link class,
+ * though that is not recommended.
+ *
+ * The following table summarizes existing link types and values and
+ * the reserved and user-definable link class identifier value ranges.
+ * <table>
+ * <tr>
+ * <th>Link class identifier or Value range</th>
+ * <th>Description</th>
+ * <th>Link class or label</th>
+ * </tr>
+ * <tr>
+ * <td>0 to 63</td>
+ * <td>Reserved range</td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>64 to 255</td>
+ * <td>User-definable range</td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>64</td>
+ * <td>Minimum user-defined value</td>
+ * <td>#H5L_TYPE_UD_MIN</td>
+ * </tr>
+ * <tr>
+ * <td>64</td>
+ * <td>External link</td>
+ * <td>#H5L_TYPE_EXTERNAL</td>
+ * </tr>
+ * <tr>
+ * <td>255</td>
+ * <td>Maximum user-defined value</td>
+ * <td>#H5L_TYPE_UD_MAX</td>
+ * </tr>
+ * <tr>
+ * <td>255</td>
+ * <td>Maximum value</td>
+ * <td>#H5L_TYPE_MAX</td>
+ * </tr>
+ * <tr>
+ * <td>-1</td>
+ * <td>Error</td>
+ * <td>#H5L_TYPE_ERROR</td>
+ * </tr>
+ * </table>
+ *
+ * Note that HDF5 internally registers user-defined link classes only
+ * by the numeric value of the link class identifier. An application,
+ * on the other hand, will generally use a name for a user-defined
+ * class, if for no other purpose than as a variable name. Assume,
+ * for example, that a complex link type is registered with the link
+ * class identifier 73 and that the code includes the following
+ * assignment:
+ * \code
+ * H5L_TYPE_COMPLEX_A = 73
+ * \endcode
+ * The application can refer to the link class with a term,
+ * \c H5L_TYPE_COMPLEX_A, that conveys meaning to a human reviewing
+ * the code, while HDF5 recognizes it by the more cryptic numeric
+ * identifier, 73.
+ *
+ * \attention Important details and considerations include the following:
+ * \li If you plan to distribute files or software with a
+ * user-defined link class, please contact the Help Desk at
+ * The HDF Group to help prevent collisions between \c class_id
+ * values. See below.
+ * \li As distributed with HDF5, the external link class is
+ * implemented as an example of a user-defined link class with
+ * #H5L_TYPE_EXTERNAL equal to #H5L_TYPE_UD_MIN. \c class_id in
+ * the H5L_class_t \c struct must not equal #H5L_TYPE_UD_MIN
+ * unless you intend to overwrite or modify the behavior of
+ * external links.
+ * \li H5Lregister() can be used only with link class identifiers
+ * in the user-definable range (see table above).
+ * \li The hard and soft links defined by the HDF5 library,
+ * #H5L_TYPE_HARD and #H5L_TYPE_SOFT, reside in the reserved
+ * range below #H5L_TYPE_UD_MIN and cannot be redefined or
+ * modified.
+ * \li H5Lis_registered() can be used to determine whether a desired
+ * link class identifier is available. \Emph{Note that this
+ * function will tell you only whether the link class identifier
+ * has been registered with the installed copy of HDF5; it
+ * cannot tell you whether the link class has been registered
+ * with The HDF Group.}
+ * \li #H5L_TYPE_MAX is the maximum allowed value for a link type
+ * identifier.
+ * \li #H5L_TYPE_UD_MIN equals #H5L_TYPE_EXTERNAL.
+ * \li #H5L_TYPE_UD_MAX equals #H5L_TYPE_MAX.
+ * \li #H5L_TYPE_ERROR indicates that an error has occurred.
+ *
+ * \note \Bold{Registration with The HDF Group:}\n
+ * There are sometimes reasons to take a broader approach to registering
+ * a user-defined link class than just invoking H5Lregister(). For
+ * example:
+ * \li A user-defined link class is intended for use across an
+ * organization, among collaborators, or across a community of users.
+ * \li An application or library overlying HDF5 invokes a user-defined
+ * link class that must be shipped with the software.
+ * \li Files are distributed that make use of a user-defined link class.
+ * \li Or simply, a specific user-defined link class is thought to be
+ * widely useful.
+ *
+ * In such cases, you are encouraged to register that link class with
+ * The HDF Group's Helpdesk. The HDF Group maintains a registry of known
+ * user-defined link classes and tracks the selected link class
+ * identifiers. This registry is intended to reduce the risk of
+ * collisions between \c class_id values and to help coordinate the use
+ * of specialized link classes.
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL herr_t H5Lregister(const H5L_class_t *cls);
+/**
+ * \ingroup H5LA
+ *
+ * \brief Unregisters a class of user-defined links
+ *
+ * \param[in] id User-defined link class identifier
+ *
+ * \return \herr_t
+ *
+ * \details H5Lunregister() unregisters a class of user-defined links,
+ * preventing them from being traversed, queried, moved, etc.
+ *
+ * \note A link class can be re-registered using H5Lregister().
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL herr_t H5Lunregister(H5L_type_t id);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Symbols defined for compatibility with previous versions of the HDF5 API.
+ *
+ * Use of these symbols is deprecated.
+ */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/* Previous versions of the H5L_class_t struct */
+#define H5L_LINK_CLASS_T_VERS_0 0
+
+/** Callback during link traversal */
+typedef hid_t (*H5L_traverse_0_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata,
+ size_t lnkdata_size, hid_t lapl_id);
+
+/** User-defined link types */
+typedef struct {
+ int version; /**< Version number of this struct */
+ H5L_type_t id; /**< Link type ID */
+ const char * comment; /**< Comment for debugging */
+ H5L_create_func_t create_func; /**< Callback during link creation */
+ H5L_move_func_t move_func; /**< Callback after moving link */
+ H5L_copy_func_t copy_func; /**< Callback after copying link */
+ H5L_traverse_0_func_t trav_func; /**< Callback during link traversal */
+ H5L_delete_func_t del_func; /**< Callback for link deletion */
+ H5L_query_func_t query_func; /**< Callback for queries */
+} H5L_class_0_t;
+
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+#endif /* _H5Ldevelop_H */
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index eccd2c6..2f7c7eb 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -173,30 +173,30 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons
/* Make callback if it exists */
if (cb_info.func) {
- const char *parent_file_name; /* Parent file name */
- ssize_t group_name_len; /* Length of parent group name */
+ const char *parent_file_name; /* Parent file name */
+ size_t group_name_len = 0; /* Length of parent group name */
/* Get parent file name */
parent_file_name = H5F_OPEN_NAME(loc.oloc->file);
/* Query length of parent group name */
- if ((group_name_len = H5G_get_name(&loc, NULL, (size_t)0, NULL)) < 0)
+ if (H5G_get_name(&loc, NULL, (size_t)0, &group_name_len, NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve length of group name")
/* Account for null terminator */
group_name_len++;
/* Check if we need to allocate larger buffer */
- if ((size_t)group_name_len > sizeof(local_group_name)) {
- if (NULL == (parent_group_name = (char *)H5MM_malloc((size_t)group_name_len)))
+ if (group_name_len > sizeof(local_group_name)) {
+ if (NULL == (parent_group_name = (char *)H5MM_malloc(group_name_len)))
HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, H5I_INVALID_HID,
- "can't allocate buffer to hold group name, group_name_len = %zd", group_name_len)
+ "can't allocate buffer to hold group name, group_name_len = %zu", group_name_len)
} /* end if */
else
parent_group_name = local_group_name;
/* Get parent group name */
- if (H5G_get_name(&loc, parent_group_name, (size_t)group_name_len, NULL) < 0)
+ if (H5G_get_name(&loc, parent_group_name, group_name_len, NULL, NULL) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve group name")
/* Make callback */
diff --git a/src/H5Lint.c b/src/H5Lint.c
new file mode 100644
index 0000000..346c37d
--- /dev/null
+++ b/src/H5Lint.c
@@ -0,0 +1,2285 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#include "H5Lmodule.h" /* This source code file is part of the H5L module */
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Lpkg.h" /* Links */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Oprivate.h" /* File objects */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5VLprivate.h" /* Virtual Object Layer */
+
+/****************/
+/* Local Macros */
+/****************/
+
+#define H5L_MIN_TABLE_SIZE 32 /* Minimum size of the user-defined link type table if it is allocated */
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/* User data for path traversal routine for getting link info by name */
+typedef struct {
+ H5L_info2_t *linfo; /* Buffer to return to user */
+} H5L_trav_gi_t;
+
+/* User data for path traversal routine for getting link value by index */
+typedef struct {
+ /* In */
+ H5_index_t idx_type; /* Index to use */
+ H5_iter_order_t order; /* Order to iterate in index */
+ hsize_t n; /* Offset of link within index */
+ size_t size; /* Size of user buffer */
+
+ /* Out */
+ void *buf; /* User buffer */
+} H5L_trav_gvbi_t;
+
+/* User data for path traversal routine for getting link info by index */
+typedef struct {
+ /* In */
+ H5_index_t idx_type; /* Index to use */
+ H5_iter_order_t order; /* Order to iterate in index */
+ hsize_t n; /* Offset of link within index */
+
+ /* Out */
+ H5L_info2_t *linfo; /* Buffer to return to user */
+} H5L_trav_gibi_t;
+
+/* User data for path traversal routine for removing link by index */
+typedef struct {
+ /* In */
+ H5_index_t idx_type; /* Index to use */
+ H5_iter_order_t order; /* Order to iterate in index */
+ hsize_t n; /* Offset of link within index */
+} H5L_trav_rmbi_t;
+
+/* User data for path traversal routine for getting name by index */
+typedef struct {
+ /* In */
+ H5_index_t idx_type; /* Index to use */
+ H5_iter_order_t order; /* Order to iterate in index */
+ hsize_t n; /* Offset of link within index */
+ size_t size; /* Size of name buffer */
+
+ /* Out */
+ char * name; /* Buffer to return name to user */
+ size_t name_len; /* Length of full name */
+} H5L_trav_gnbi_t;
+
+/* User data for path traversal callback to creating a link */
+typedef struct {
+ H5F_t * file; /* Pointer to the file */
+ H5P_genplist_t * lc_plist; /* Link creation property list */
+ H5G_name_t * path; /* Path to object being linked */
+ H5O_obj_create_t *ocrt_info; /* Pointer to object creation info */
+ H5O_link_t * lnk; /* Pointer to link information to insert */
+} H5L_trav_cr_t;
+
+/* User data for path traversal routine for moving and renaming a link */
+typedef struct {
+ const char * dst_name; /* Destination name for moving object */
+ H5T_cset_t cset; /* Char set for new name */
+ const H5G_loc_t *dst_loc; /* Destination location for moving object */
+ unsigned dst_target_flags; /* Target flags for destination object */
+ hbool_t copy; /* TRUE if this is a copy operation */
+ size_t orig_nlinks; /* The original value for the # of soft / UD links that can be traversed */
+} H5L_trav_mv_t;
+
+/* User data for path traversal routine for moving and renaming an object */
+typedef struct {
+ H5F_t * file; /* Pointer to the file */
+ H5O_link_t *lnk; /* Pointer to link information to insert */
+ hbool_t copy; /* TRUE if this is a copy operation */
+} H5L_trav_mv2_t;
+
+/* User data for path traversal routine for checking if a link exists */
+typedef struct {
+ /* Down */
+ char *sep; /* Pointer to next separator in the string */
+
+ /* Up */
+ hbool_t *exists; /* Whether the link exists or not */
+} H5L_trav_le_t;
+
+/* User data for path traversal routine for getting link value */
+typedef struct {
+ size_t size; /* Size of user buffer */
+ void * buf; /* User buffer */
+} H5L_trav_gv_t;
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+static int H5L__find_class_idx(H5L_type_t id);
+static herr_t H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path,
+ H5F_t *obj_file, H5O_link_t *lnk, H5O_obj_create_t *ocrt_info, hid_t lcpl_id);
+static herr_t H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size);
+static herr_t H5L__get_val_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__get_val_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__delete_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__delete_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__exists_final_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__exists_inter_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__get_info_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__get_info_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/);
+static herr_t H5L__get_name_by_idx_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/* Package initialization variable */
+hbool_t H5_PKG_INIT_VAR = FALSE;
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/* Information about user-defined links */
+static size_t H5L_table_alloc_g = 0;
+static size_t H5L_table_used_g = 0;
+static H5L_class_t *H5L_table_g = NULL;
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_init
+ *
+ * Purpose: Initialize the interface from some other package.
+ *
+ * Return: Success: non-negative
+ *
+ * Failure: negative
+ *
+ * Programmer: James Laird
+ * Thursday, July 13, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_init(void)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+ /* FUNC_ENTER() does all the work */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_init() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__init_package
+ *
+ * Purpose: Initialize information specific to H5L interface.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Tuesday, January 24, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__init_package(void)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Initialize user-defined link classes */
+ if (H5L_register_external() < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "unable to register external link class")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_init_package() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_term_package
+ *
+ * Purpose: Terminate any resources allocated in H5L__init_package.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Tuesday, January 24, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5L_term_package(void)
+{
+ int n = 0;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ if (H5_PKG_INIT_VAR) {
+ /* Free the table of link types */
+ if (H5L_table_g) {
+ H5L_table_g = (H5L_class_t *)H5MM_xfree(H5L_table_g);
+ H5L_table_used_g = H5L_table_alloc_g = 0;
+ n++;
+ } /* end if */
+
+ /* Mark the interface as uninitialized */
+ if (0 == n)
+ H5_PKG_INIT_VAR = FALSE;
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(n)
+} /* H5L_term_package() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__find_class_idx
+ *
+ * Purpose: Given a link class ID, return the offset in the global array
+ * that holds all the registered link classes.
+ *
+ * Return: Success: Non-negative index of entry in global
+ * link class table.
+ * Failure: Negative
+ *
+ * Programmer: James Laird
+ * Monday, July 10, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5L__find_class_idx(H5L_type_t id)
+{
+ size_t i; /* Local index variable */
+ int ret_value = FAIL; /* Return value */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ for (i = 0; i < H5L_table_used_g; i++)
+ if (H5L_table_g[i].id == id)
+ HGOTO_DONE((int)i)
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__find_class_idx */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_find_class
+ *
+ * Purpose: Given a link class ID return a pointer to a global struct that
+ * defines the link class.
+ *
+ * Return: Success: Ptr to entry in global link class table.
+ * Failure: NULL
+ *
+ * Programmer: James Laird
+ * Monday, July 10, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+const H5L_class_t *
+H5L_find_class(H5L_type_t id)
+{
+ int idx; /* Filter index in global table */
+ H5L_class_t *ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_NOAPI(NULL)
+
+ /* Get the index in the global table */
+ if ((idx = H5L__find_class_idx(id)) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, NULL, "unable to find link class")
+
+ /* Set return value */
+ ret_value = H5L_table_g + idx;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_find_class */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_register
+ *
+ * Purpose: Registers a class of user-defined links, or changes the
+ * behavior of an existing class.
+ *
+ * See H5Lregister for full documentation.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Monday, July 10, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_register(const H5L_class_t *cls)
+{
+ size_t i; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ HDassert(cls);
+ HDassert(cls->id >= 0 && cls->id <= H5L_TYPE_MAX);
+
+ /* Is the link type already registered? */
+ for (i = 0; i < H5L_table_used_g; i++)
+ if (H5L_table_g[i].id == cls->id)
+ break;
+
+ /* Filter not already registered */
+ if (i >= H5L_table_used_g) {
+ if (H5L_table_used_g >= H5L_table_alloc_g) {
+ size_t n = MAX(H5L_MIN_TABLE_SIZE, (2 * H5L_table_alloc_g));
+ H5L_class_t *table = (H5L_class_t *)H5MM_realloc(H5L_table_g, (n * sizeof(H5L_class_t)));
+ if (!table)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend link type table")
+ H5L_table_g = table;
+ H5L_table_alloc_g = n;
+ } /* end if */
+
+ /* Initialize */
+ i = H5L_table_used_g++;
+ } /* end if */
+
+ /* Copy link class info into table */
+ H5MM_memcpy(H5L_table_g + i, cls, sizeof(H5L_class_t));
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_register */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_unregister
+ *
+ * Purpose: Unregisters a class of user-defined links.
+ *
+ * See H5Lunregister for full documentation.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Monday, July 10, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_unregister(H5L_type_t id)
+{
+ size_t i; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ HDassert(id >= 0 && id <= H5L_TYPE_MAX);
+
+ /* Is the filter already registered? */
+ for (i = 0; i < H5L_table_used_g; i++)
+ if (H5L_table_g[i].id == id)
+ break;
+
+ /* Fail if filter not found */
+ if (i >= H5L_table_used_g)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "link class is not registered")
+
+ /* Remove filter from table */
+ /* Don't worry about shrinking table size (for now) */
+ HDmemmove(&H5L_table_g[i], &H5L_table_g[i + 1], sizeof(H5L_class_t) * ((H5L_table_used_g - 1) - i));
+ H5L_table_used_g--;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_unregister() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_is_registered
+ *
+ * Purpose: Tests whether a user-defined link class has been registered
+ * or not.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_is_registered(H5L_type_t id, hbool_t *is_registered)
+{
+ size_t i; /* Local index variable */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ /* Check args */
+ HDassert(is_registered);
+
+ /* Is the link class already registered? */
+ *is_registered = FALSE;
+ for (i = 0; i < H5L_table_used_g; i++)
+ if (H5L_table_g[i].id == id) {
+ *is_registered = TRUE;
+ break;
+ }
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5L_is_registered() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_link
+ *
+ * Purpose: Creates a link from OBJ_ID to CUR_NAME. See H5Olink() for
+ * full documentation.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Tuesday, December 13, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid_t lcpl_id)
+{
+ H5O_link_t lnk; /* Link to insert */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Check args */
+ HDassert(new_loc);
+ HDassert(obj_loc);
+ HDassert(new_name && *new_name);
+
+ /* The link callback will check that the object isn't being hard linked
+ * into a different file, so we don't need to do it here (there could be
+ * external links along the path).
+ */
+
+ /* Construct link information for eventual insertion */
+ lnk.type = H5L_TYPE_HARD;
+ lnk.u.hard.addr = obj_loc->oloc->addr;
+
+ /* Create the link */
+ if (H5L__create_real(new_loc, new_name, obj_loc->path, obj_loc->oloc->file, &lnk, NULL, lcpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_link() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_link_object
+ *
+ * Purpose: Creates a new object and a link to it.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, April 9, 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_obj_create_t *ocrt_info, hid_t lcpl_id)
+{
+ H5O_link_t lnk; /* Link to insert */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Check args */
+ HDassert(new_loc);
+ HDassert(new_name && *new_name);
+ HDassert(ocrt_info);
+
+ /* The link callback will check that the object isn't being hard linked
+ * into a different file, so we don't need to do it here (there could be
+ * external links along the path).
+ */
+
+ /* Construct link information for eventual insertion */
+ lnk.type = H5L_TYPE_HARD;
+
+ /* Create the link */
+ if (H5L__create_real(new_loc, new_name, NULL, NULL, &lnk, ocrt_info, lcpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_link_object() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__link_cb
+ *
+ * Purpose: Callback for creating a link to an object.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, September 19, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__link_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_cr_t *udata = (H5L_trav_cr_t *)_udata; /* User data passed in */
+ H5G_t * grp = NULL; /* H5G_t for this group, opened to pass to user callback */
+ hid_t grp_id = FAIL; /* Id for this group (passed to user callback */
+ H5G_loc_t temp_loc; /* For UD callback */
+ hbool_t temp_loc_init = FALSE; /* Temporary location for UD callback (temp_loc) has been initialized */
+ hbool_t obj_created = FALSE; /* Whether an object was created (through a hard link) */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name in this group resolved to a valid location */
+ /* (which is not what we want) */
+ if (obj_loc != NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name already exists")
+
+ /* Check for crossing file boundaries with a new hard link */
+ if (udata->lnk->type == H5L_TYPE_HARD) {
+ /* Check for creating an object */
+ /* (only for hard links) */
+ if (udata->ocrt_info) {
+ H5G_loc_t new_loc; /* Group location for new object */
+
+ /* Create new object at this location */
+ if (NULL ==
+ (udata->ocrt_info->new_obj = H5O_obj_create(grp_loc->oloc->file, udata->ocrt_info->obj_type,
+ udata->ocrt_info->crt_info, &new_loc)))
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create object")
+
+ /* Set address for hard link */
+ udata->lnk->u.hard.addr = new_loc.oloc->addr;
+
+ /* Set object path to use for setting object name (below) */
+ udata->path = new_loc.path;
+
+ /* Indicate that an object was created */
+ obj_created = TRUE;
+ } /* end if */
+ else {
+ /* Check that both objects are in same file */
+ if (!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file))
+ HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "interfile hard links are not allowed")
+ } /* end else */
+ } /* end if */
+
+ /* Set 'standard' aspects of link */
+ udata->lnk->corder =
+ 0; /* Will be re-written during group insertion, if the group is tracking creation order */
+ udata->lnk->corder_valid = FALSE; /* Creation order not valid (yet) */
+
+ /* Check for non-default link creation properties */
+ if (udata->lc_plist) {
+ /* Get character encoding property */
+ if (H5CX_get_encoding(&udata->lnk->cset) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get 'character set' property")
+ } /* end if */
+ else
+ udata->lnk->cset = H5F_DEFAULT_CSET; /* Default character encoding for link */
+
+ /* Set the link's name correctly */
+ /* Casting away const OK -QAK */
+ udata->lnk->name = (char *)name;
+
+ /* Insert link into group */
+ if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE,
+ udata->ocrt_info ? udata->ocrt_info->obj_type : H5O_TYPE_UNKNOWN,
+ udata->ocrt_info ? udata->ocrt_info->crt_info : NULL) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link for object")
+
+ /* Set object's path if it has been passed in and is not set */
+ if (udata->path != NULL && udata->path->user_path_r == NULL)
+ if (H5G_name_set(grp_loc->path, udata->path, name) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "cannot set name")
+
+ /* If link is a user-defined link, trigger its creation callback if it has one */
+ if (udata->lnk->type >= H5L_TYPE_UD_MIN) {
+ const H5L_class_t *link_class; /* User-defined link class */
+
+ /* Get the link class for this type of link. */
+ if (NULL == (link_class = H5L_find_class(udata->lnk->type)))
+ HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "unable to get class of UD link")
+
+ if (link_class->create_func != NULL) {
+ H5O_loc_t temp_oloc;
+ H5G_name_t temp_path;
+
+ /* Create a temporary location (or else H5G_open will do a shallow
+ * copy and wipe out grp_loc)
+ */
+ H5G_name_reset(&temp_path);
+ if (H5O_loc_copy_deep(&temp_oloc, grp_loc->oloc) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location")
+
+ temp_loc.oloc = &temp_oloc;
+ temp_loc.path = &temp_path;
+ temp_loc_init = TRUE;
+
+ /* Set up location for user-defined callback */
+ if (NULL == (grp = H5G_open(&temp_loc)))
+ HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group")
+ if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register ID for group")
+
+ /* Make callback */
+ if ((link_class->create_func)(name, grp_id, udata->lnk->u.ud.udata, udata->lnk->u.ud.size,
+ H5P_DEFAULT) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "link creation callback failed")
+ } /* end if */
+ } /* end if */
+
+done:
+ /* Check if an object was created */
+ if (obj_created) {
+ H5O_loc_t oloc; /* Object location for created object */
+
+ /* Set up object location */
+ HDmemset(&oloc, 0, sizeof(oloc));
+ oloc.file = grp_loc->oloc->file;
+ oloc.addr = udata->lnk->u.hard.addr;
+
+ /* Decrement refcount on new object's object header in memory */
+ if (H5O_dec_rc_by_loc(&oloc) < 0)
+ HDONE_ERROR(H5E_LINK, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object")
+ } /* end if */
+
+ /* Close the location given to the user callback if it was created */
+ if (grp_id >= 0) {
+ if (H5I_dec_app_ref(grp_id) < 0)
+ HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close ID from UD callback")
+ } /* end if */
+ else if (grp != NULL) {
+ if (H5G_close(grp) < 0)
+ HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback")
+ } /* end if */
+ else if (temp_loc_init)
+ H5G_loc_free(&temp_loc);
+
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__link_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__create_real
+ *
+ * Purpose: Creates a link at a path location
+ *
+ * lnk should have linkclass-specific information already
+ * set, but this function will take care of setting name.
+ *
+ * obj_path can be NULL if the object's path doesn't need to
+ * be set, and obj_file can be NULL if the object is not a
+ * hard link.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, December 5, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path, H5F_t *obj_file,
+ H5O_link_t *lnk, H5O_obj_create_t *ocrt_info, hid_t lcpl_id)
+{
+ char * norm_link_name = NULL; /* Pointer to normalized link name */
+ unsigned target_flags = H5G_TARGET_NORMAL; /* Flags to pass to group traversal function */
+ H5P_genplist_t *lc_plist = NULL; /* Link creation property list */
+ H5L_trav_cr_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check args */
+ HDassert(link_loc);
+ HDassert(link_name && *link_name);
+ HDassert(lnk);
+ HDassert(lnk->type >= H5L_TYPE_HARD && lnk->type <= H5L_TYPE_MAX);
+
+ /* Get normalized link name */
+ if ((norm_link_name = H5G_normalize(link_name)) == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
+
+ /* Check for flags present in creation property list */
+ if (lcpl_id != H5P_DEFAULT) {
+ unsigned crt_intmd_group;
+
+ /* Get link creation property list */
+ if (NULL == (lc_plist = (H5P_genplist_t *)H5I_object(lcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+
+ /* Get intermediate group creation property */
+ if (H5CX_get_intermediate_group(&crt_intmd_group) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get 'create intermediate group' property")
+
+ if (crt_intmd_group > 0)
+ target_flags |= H5G_CRT_INTMD_GROUP;
+ } /* end if */
+
+ /* Set up user data
+ * FILE is used to make sure that hard links don't cross files, and
+ * should be NULL for other link types.
+ * LC_PLIST is a pointer to the link creation property list.
+ * PATH is a pointer to the path of the object being inserted if this is
+ * a hard link; this is used to set the paths to objects when they are
+ * created. For other link types, this is NULL.
+ * OCRT_INFO is a pointer to the structure for object creation.
+ * LNK is the link struct passed into this function. At this point all
+ * of its fields should be populated except for name, which is set when
+ * inserting it in the callback.
+ */
+ udata.file = obj_file;
+ udata.lc_plist = lc_plist;
+ udata.path = obj_path;
+ udata.ocrt_info = ocrt_info;
+ udata.lnk = lnk;
+
+ /* Traverse the destination path & create new link */
+ if (H5G_traverse(link_loc, link_name, target_flags, H5L__link_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert link")
+
+done:
+ /* Free the normalized path name */
+ if (norm_link_name)
+ H5MM_xfree(norm_link_name);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__create_real() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__create_hard
+ *
+ * Purpose: Creates a hard link from NEW_NAME to CUR_NAME.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 6, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link_loc, const char *link_name,
+ hid_t lcpl_id)
+{
+ char * norm_cur_name = NULL; /* Pointer to normalized current name */
+ H5F_t * link_file = NULL; /* Pointer to file to link to */
+ H5O_link_t lnk; /* Link to insert */
+ H5G_loc_t obj_loc; /* Location of object to link to */
+ H5G_name_t path; /* obj_loc's path*/
+ H5O_loc_t oloc; /* obj_loc's oloc */
+ hbool_t loc_valid = FALSE;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check args */
+ HDassert(cur_loc);
+ HDassert(cur_name && *cur_name);
+ HDassert(link_loc);
+ HDassert(link_name && *link_name);
+
+ /* Get normalized copy of the current name */
+ if ((norm_cur_name = H5G_normalize(cur_name)) == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
+
+ /* Set up link data specific to hard links */
+ lnk.type = H5L_TYPE_HARD;
+
+ /* Get object location for object pointed to */
+ obj_loc.path = &path;
+ obj_loc.oloc = &oloc;
+ H5G_loc_reset(&obj_loc);
+ if (H5G_loc_find(cur_loc, norm_cur_name, &obj_loc) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "source object not found")
+ loc_valid = TRUE;
+
+ /* Construct link information for eventual insertion */
+ lnk.u.hard.addr = obj_loc.oloc->addr;
+
+ /* Set destination's file information */
+ link_file = obj_loc.oloc->file;
+
+ /* Create actual link to the object. Pass in NULL for the path, since this
+ * function shouldn't change an object's user path. */
+ if (H5L__create_real(link_loc, link_name, NULL, link_file, &lnk, NULL, lcpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
+
+done:
+ /* Free the object header location */
+ if (loc_valid)
+ if (H5G_loc_free(&obj_loc) < 0)
+ HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to free location")
+
+ /* Free the normalized path name */
+ if (norm_cur_name)
+ H5MM_xfree(norm_cur_name);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__create_hard() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__create_soft
+ *
+ * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 6, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id)
+{
+ char * norm_target = NULL; /* Pointer to normalized current name */
+ H5O_link_t lnk; /* Link to insert */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check args */
+ HDassert(link_loc);
+ HDassert(target_path && *target_path);
+ HDassert(link_name && *link_name);
+
+ /* Get normalized copy of the link target */
+ if ((norm_target = H5G_normalize(target_path)) == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
+
+ /* Set up link data specific to soft links */
+ lnk.type = H5L_TYPE_SOFT;
+ lnk.u.soft.name = norm_target;
+
+ /* Create actual link to the object */
+ if (H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
+
+done:
+ /* Free the normalized target name */
+ if (norm_target)
+ H5MM_xfree(norm_target);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__create_soft() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__create_ud
+ *
+ * Purpose: Creates a user-defined link. See H5Lcreate_ud for
+ * full documentation.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Friday, May 19, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void *ud_data, size_t ud_data_size,
+ H5L_type_t type, hid_t lcpl_id)
+{
+ H5O_link_t lnk; /* Link to insert */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check args */
+ HDassert(type >= H5L_TYPE_UD_MIN && type <= H5L_TYPE_MAX);
+ HDassert(link_loc);
+ HDassert(link_name && *link_name);
+ HDassert(ud_data_size == 0 || ud_data);
+
+ /* Initialize the link struct's pointer to its udata buffer */
+ lnk.u.ud.udata = NULL;
+
+ /* Make sure that this link class is registered */
+ if (H5L__find_class_idx(type) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "link class has not been registered with library")
+
+ /* Fill in UD link-specific information in the link struct*/
+ if (ud_data_size > 0) {
+ lnk.u.ud.udata = H5MM_malloc((size_t)ud_data_size);
+ H5MM_memcpy(lnk.u.ud.udata, ud_data, (size_t)ud_data_size);
+ } /* end if */
+ else
+ lnk.u.ud.udata = NULL;
+
+ lnk.u.ud.size = ud_data_size;
+ lnk.type = type;
+
+ /* Create actual link to the object */
+ if (H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to register new name for object")
+
+done:
+ /* Free the link's udata buffer if it's been allocated */
+ H5MM_xfree(lnk.u.ud.udata);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__create_ud() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_val_real
+ *
+ * Purpose: Retrieve link value from a link object
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, November 13 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(lnk);
+
+ /* Check for soft link */
+ if (H5L_TYPE_SOFT == lnk->type) {
+ /* Copy to output buffer */
+ if (size > 0 && buf) {
+ HDstrncpy((char *)buf, lnk->u.soft.name, size);
+ if (HDstrlen(lnk->u.soft.name) >= size)
+ ((char *)buf)[size - 1] = '\0';
+ } /* end if */
+ } /* end if */
+ /* Check for user-defined link */
+ else if (lnk->type >= H5L_TYPE_UD_MIN) {
+ const H5L_class_t *link_class; /* User-defined link class */
+
+ /* Get the link class for this type of link. It's okay if the class
+ * isn't registered, though--we just can't give any more information
+ * about it
+ */
+ link_class = H5L_find_class(lnk->type);
+
+ if (link_class != NULL && link_class->query_func != NULL) {
+ if ((link_class->query_func)(lnk->name, lnk->u.ud.udata, lnk->u.ud.size, buf, size) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "query callback returned failure")
+ } /* end if */
+ else if (buf && size > 0)
+ ((char *)buf)[0] = '\0';
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_LINK, H5E_BADTYPE, FAIL, "object is not a symbolic or user-defined link")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_val_real() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_val_cb
+ *
+ * Purpose: Callback for retrieving link value or udata.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Tuesday, September 20, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__get_val_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_gv_t *udata = (H5L_trav_gv_t *)_udata; /* User data passed in */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name in this group resolved to a valid link */
+ if (lnk == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "'%s' doesn't exist", name)
+
+ /* Retrieve the value for the link */
+ if (H5L__get_val_real(lnk, udata->buf, udata->size) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value")
+
+done:
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_val_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_val
+ *
+ * Purpose: Returns the value of a symbolic link or the udata for a
+ * user-defined link.
+ *
+ * Return: Success: Non-negative, with at most SIZE bytes of the
+ * link value copied into the BUF buffer. If the
+ * link value is larger than SIZE characters
+ * counting the null terminator then the BUF
+ * result will not be null terminated.
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Monday, April 13, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf /*out*/, size_t size)
+{
+ H5L_trav_gv_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check */
+ HDassert(loc);
+ HDassert(name && *name);
+
+ /* Set up user data for retrieving information */
+ udata.size = size;
+ udata.buf = buf;
+
+ /* Traverse the group hierarchy to locate the object to get info about */
+ if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5L__get_val() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_val_by_idx_cb
+ *
+ * Purpose: Callback for retrieving a link's value according to an
+ * index's order.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, November 13 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */
+ H5O_link_t fnd_lnk; /* Link within group */
+ hbool_t lnk_copied = FALSE; /* Whether the link was copied */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name of the group resolved to a valid object */
+ if (obj_loc == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
+
+ /* Query link */
+ if (H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
+ lnk_copied = TRUE;
+
+ /* Retrieve the value for the link */
+ if (H5L__get_val_real(&fnd_lnk, udata->buf, udata->size) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value")
+
+done:
+ /* Reset the link information, if we have a copy */
+ if (lnk_copied)
+ H5O_msg_reset(H5O_LINK_ID, &fnd_lnk);
+
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_val_by_idx_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_val_by_idx
+ *
+ * Purpose: Internal routine to query a link value according to the
+ * index within a group
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Quincey Koziol
+ * December 27, 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t n, void *buf /*out*/, size_t size)
+{
+ H5L_trav_gvbi_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check arguments */
+ HDassert(loc);
+ HDassert(name && *name);
+
+ /* Set up user data for retrieving information */
+ udata.idx_type = idx_type;
+ udata.order = order;
+ udata.n = n;
+ udata.buf = buf;
+ udata.size = size;
+
+ /* Traverse the group hierarchy to locate the object to get info about */
+ if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_by_idx_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info for index: %llu", (unsigned long long)n)
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_val_by_idx() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__delete_cb
+ *
+ * Purpose: Callback for deleting a link. This routine
+ * actually deletes the link
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, September 19, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__delete_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk,
+ H5G_loc_t H5_ATTR_UNUSED *obj_loc, void H5_ATTR_UNUSED *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the group resolved to a valid link */
+ if (grp_loc == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
+
+ /* Check if the name in this group resolved to a valid link */
+ if (name == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
+
+ /* Check for non-existent (NULL) link.
+ * Note that this can also occur when attempting to remove '.'
+ */
+ if (lnk == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL,
+ "callback link pointer is NULL (specified link may be '.' or not exist)")
+
+ /* Remove the link from the group */
+ if (H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to remove link from group")
+
+done:
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__delete_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__delete
+ *
+ * Purpose: Delete a link from a group.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Thursday, September 17, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__delete(const H5G_loc_t *loc, const char *name)
+{
+ char * norm_name = NULL; /* Pointer to normalized name */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check */
+ HDassert(loc);
+ HDassert(name && *name);
+
+ /* Get normalized copy of the name */
+ if ((norm_name = H5G_normalize(name)) == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name")
+
+ /* Set up user data for unlink operation */
+ if (H5G_traverse(loc, norm_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT, H5L__delete_cb,
+ NULL) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTREMOVE, FAIL, "can't unlink object")
+
+done:
+ /* Free the normalized path name */
+ if (norm_name)
+ H5MM_xfree(norm_name);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__delete() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__delete_by_idx_cb
+ *
+ * Purpose: Callback for removing a link according to an index's order.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, November 13 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__delete_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC_TAG((obj_loc) ? (obj_loc->oloc->addr) : HADDR_UNDEF)
+
+ /* Check if the name of the group resolved to a valid object */
+ if (obj_loc == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
+
+ /* Delete link */
+ if (H5G_obj_remove_by_idx(obj_loc->oloc, obj_loc->path->full_path_r, udata->idx_type, udata->order,
+ udata->n) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
+
+done:
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI_TAG(ret_value)
+} /* end H5L__delete_by_idx_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__delete_by_idx
+ *
+ * Purpose: Internal routine to delete a link according to its index
+ * within a group.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Quincey Koziol
+ * December 27, 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t n)
+{
+ H5L_trav_rmbi_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check */
+ HDassert(loc);
+ HDassert(name && *name);
+
+ /* Set up user data for unlink operation */
+ udata.idx_type = idx_type;
+ udata.order = order;
+ udata.n = n;
+
+ /* Traverse the group hierarchy to remove the link */
+ if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT,
+ H5L__delete_by_idx_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "link doesn't exist")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__delete_by_idx() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__move_dest_cb
+ *
+ * Purpose: Second callback for moving and renaming an object. This routine
+ * inserts a new link into the group returned by the traversal.
+ * It is called by H5L__move_cb.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Monday, April 3, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk,
+ H5G_loc_t *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_mv2_t *udata = (H5L_trav_mv2_t *)_udata; /* User data passed in */
+ H5G_t * grp = NULL; /* H5G_t for this group, opened to pass to user callback */
+ hid_t grp_id = FAIL; /* ID for this group (passed to user callback */
+ H5G_loc_t temp_loc; /* For UD callback */
+ hbool_t temp_loc_init = FALSE;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Make sure an object with this name doesn't already exist */
+ if (obj_loc != NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "an object with that name already exists")
+
+ /* Check for crossing file boundaries with a new hard link */
+ if (udata->lnk->type == H5L_TYPE_HARD)
+ /* Check that both objects are in same file */
+ if (!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file))
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "moving a link across files is not allowed")
+
+ /* Give the object its new name */
+ /* Casting away const okay -JML */
+ HDassert(udata->lnk->name == NULL);
+ udata->lnk->name = (char *)name;
+
+ /* Insert the link into the group */
+ if (H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, NULL) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object")
+
+ /* If the link was a user-defined link, call its move callback if it has one */
+ if (udata->lnk->type >= H5L_TYPE_UD_MIN) {
+ const H5L_class_t *link_class; /* User-defined link class */
+
+ /* Get the link class for this type of link. */
+ if (NULL == (link_class = H5L_find_class(udata->lnk->type)))
+ HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "link class is not registered")
+
+ if ((!udata->copy && link_class->move_func) || (udata->copy && link_class->copy_func)) {
+ H5O_loc_t temp_oloc;
+ H5G_name_t temp_path;
+
+ /* Create a temporary location (or else H5G_open will do a shallow
+ * copy and wipe out grp_loc)
+ */
+ H5G_name_reset(&temp_path);
+ if (H5O_loc_copy_deep(&temp_oloc, grp_loc->oloc) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location")
+
+ temp_loc.oloc = &temp_oloc;
+ temp_loc.path = &temp_path;
+ temp_loc_init = TRUE;
+
+ /* Set up location for user-defined callback */
+ if (NULL == (grp = H5G_open(&temp_loc)))
+ HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group")
+ if ((grp_id = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register group ID")
+
+ if (udata->copy) {
+ if ((link_class->copy_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata,
+ udata->lnk->u.ud.size) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "UD copy callback returned error")
+ } /* end if */
+ else {
+ if ((link_class->move_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata,
+ udata->lnk->u.ud.size) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "UD move callback returned error")
+ } /* end else */
+ } /* end if */
+ } /* end if */
+
+done:
+ /* Close the location given to the user callback if it was created */
+ if (grp_id >= 0) {
+ if (H5I_dec_app_ref(grp_id) < 0)
+ HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close ID from UD callback")
+ } /* end if */
+ else if (grp != NULL) {
+ if (H5G_close(grp) < 0)
+ HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback")
+ } /* end if */
+ else if (temp_loc_init)
+ H5G_loc_free(&temp_loc);
+
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ /* Reset the "name" field in udata->lnk because it is owned by traverse()
+ * and must not be manipulated after traverse closes */
+ udata->lnk->name = NULL;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__move_dest_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__move_cb
+ *
+ * Purpose: Callback for moving and renaming an object. This routine
+ * replaces the names of open objects with the moved object
+ * in the path
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Friday, April 3, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc,
+ void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_mv_t *udata = (H5L_trav_mv_t *)_udata; /* User data passed in */
+ H5L_trav_mv2_t udata_out; /* User data for H5L__move_dest_cb traversal */
+ char * orig_name = NULL; /* The name of the link in this group */
+ hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name in this group resolved to a valid link */
+ if (obj_loc == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
+
+ /* Check for operations on '.' */
+ if (lnk == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "the name of a link must be supplied to move or copy")
+
+ /* Set up user data for move_dest_cb */
+ if (NULL == (udata_out.lnk = (H5O_link_t *)H5O_msg_copy(H5O_LINK_ID, lnk, NULL)))
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link to be moved")
+
+ /* In this special case, the link's name is going to be replaced at its
+ * destination, so we should free it here.
+ */
+ udata_out.lnk->name = (char *)H5MM_xfree(udata_out.lnk->name);
+ link_copied = TRUE;
+
+ udata_out.lnk->cset = udata->cset;
+ udata_out.file = grp_loc->oloc->file;
+ udata_out.copy = udata->copy;
+
+ /* Keep a copy of link's name (it's "owned" by the H5G_traverse() routine) */
+ orig_name = H5MM_xstrdup(name);
+
+ /* Reset the # of soft / UD links that can be traversed, so that the second
+ * (destination) traversal has the correct value
+ */
+ if (H5CX_set_nlinks(udata->orig_nlinks) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't reset # of soft / UD links to traverse")
+
+ /* Insert the link into its new location */
+ if (H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags, H5L__move_dest_cb,
+ &udata_out) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to follow symbolic link")
+
+ /* If this is a move and not a copy operation, change the object's name and remove the old link */
+ if (!udata->copy) {
+ H5RS_str_t *dst_name_r; /* Ref-counted version of dest name */
+
+ /* Make certain that the destination name is a full (not relative) path */
+ if (*(udata->dst_name) != '/') {
+ HDassert(udata->dst_loc->path->full_path_r);
+
+ /* Create reference counted string for full dst path */
+ if ((dst_name_r = H5G_build_fullpath_refstr_str(udata->dst_loc->path->full_path_r,
+ udata->dst_name)) == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_PATH, FAIL, "can't build destination path name")
+ } /* end if */
+ else
+ dst_name_r = H5RS_wrap(udata->dst_name);
+ HDassert(dst_name_r);
+
+ /* Fix names up */
+ if (H5G_name_replace(lnk, H5G_NAME_MOVE, obj_loc->oloc->file, obj_loc->path->full_path_r,
+ udata->dst_loc->oloc->file, dst_name_r) < 0) {
+ H5RS_decr(dst_name_r);
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to replace name")
+ } /* end if */
+
+ /* Remove the old link */
+ if (H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, orig_name) < 0) {
+ H5RS_decr(dst_name_r);
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to remove old name")
+ } /* end if */
+
+ H5RS_decr(dst_name_r);
+ } /* end if */
+
+done:
+ /* Cleanup */
+ if (orig_name)
+ H5MM_xfree(orig_name);
+
+ /* If udata_out.lnk was copied, free any memory allocated
+ * In this special case, the H5L__move_dest_cb callback resets the name
+ * so H5O_msg_free shouldn't try to free it
+ */
+ if (link_copied)
+ H5O_msg_free(H5O_LINK_ID, udata_out.lnk);
+
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__move_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__move
+ *
+ * Purpose: Atomically move or copy a link.
+ *
+ * Creates a copy of a link in a new destination with a new name.
+ * SRC_LOC and SRC_NAME together define the link's original
+ * location, while DST_LOC and DST_NAME together define its
+ * final location.
+ *
+ * If copy_flag is FALSE, the original link is removed
+ * (effectively moving the link).
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Monday, May 1, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, const char *dst_name,
+ hbool_t copy_flag, hid_t lcpl_id)
+{
+ unsigned dst_target_flags = H5G_TARGET_NORMAL;
+ H5T_cset_t char_encoding = H5F_DEFAULT_CSET; /* Character encoding for link */
+ H5P_genplist_t *lc_plist; /* Link creation property list */
+ H5L_trav_mv_t udata; /* User data for traversal */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check */
+ HDassert(src_loc);
+ HDassert(dst_loc);
+ HDassert(src_name && *src_name);
+ HDassert(dst_name && *dst_name);
+
+ /* Check for flags present in creation property list */
+ if (lcpl_id != H5P_DEFAULT) {
+ unsigned crt_intmd_group;
+
+ if (NULL == (lc_plist = (H5P_genplist_t *)H5I_object(lcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+
+ /* Get intermediate group creation property */
+ if (H5CX_get_intermediate_group(&crt_intmd_group) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for creating missing groups")
+
+ /* Set target flags for source and destination */
+ if (crt_intmd_group > 0)
+ dst_target_flags |= H5G_CRT_INTMD_GROUP;
+
+ /* Get character encoding property */
+ if (H5CX_get_encoding(&char_encoding) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding")
+ } /* end if */
+
+ /* Set up user data */
+ udata.dst_loc = dst_loc;
+ udata.dst_name = dst_name;
+ udata.dst_target_flags = dst_target_flags;
+ udata.cset = char_encoding;
+ udata.copy = copy_flag;
+
+ /* Retrieve the original # of soft / UD links that can be traversed, so
+ * that the countdown can be reset after the first path is traversed.
+ */
+ if (H5CX_get_nlinks(&udata.orig_nlinks) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse")
+
+ /* Do the move */
+ if (H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__move_cb,
+ &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to find link")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__move() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__exists_final_cb
+ *
+ * Purpose: Callback for checking whether a link exists, as the final
+ * component of a path
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Friday, March 16 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__exists_final_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_le_t *udata = (H5L_trav_le_t *)_udata; /* User data passed in */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Check if the name in this group resolved to a valid link */
+ *udata->exists = (hbool_t)(lnk != NULL);
+
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5L__exists_final_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__exists_inter_cb
+ *
+ * Purpose: Callback for checking whether a link exists, as an intermediate
+ * component of a path
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, December 31 2015
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__exists_inter_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_le_t *udata = (H5L_trav_le_t *)_udata; /* User data passed in */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name in this group resolved to a valid link */
+ if (lnk != NULL) {
+ /* Check for more components to the path */
+ if (udata->sep) {
+ H5G_traverse_t cb_func; /* Callback function for tranversal */
+ char * next; /* Pointer to next component name */
+
+ /* Look for another separator */
+ next = udata->sep;
+ if (NULL == (udata->sep = HDstrchr(udata->sep, '/')))
+ cb_func = H5L__exists_final_cb;
+ else {
+ /* Chew through adjacent separators, if present */
+ do {
+ *udata->sep = '\0';
+ udata->sep++;
+ } while ('/' == *udata->sep);
+ cb_func = H5L__exists_inter_cb;
+ } /* end else */
+ if (H5G_traverse(obj_loc, next, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists")
+ } /* end if */
+ else
+ *udata->exists = TRUE;
+ } /* end if */
+ else
+ *udata->exists = FALSE;
+
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__exists_inter_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_exists_tolerant
+ *
+ * Purpose: Returns whether a link exists in a group
+ *
+ * Note: Same as H5L__exists, except that missing links are reported
+ * as 'FALSE' instead of causing failures
+ *
+ * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, December 31 2015
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hbool_t *exists)
+{
+ H5L_trav_le_t udata; /* User data for traversal */
+ H5G_traverse_t cb_func; /* Callback function for tranversal */
+ char * name_copy = NULL; /* Duplicate of name */
+ char * name_trav; /* Name to traverse */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity checks */
+ HDassert(loc);
+ HDassert(name);
+ HDassert(exists);
+
+ /* Copy the name and skip leading '/'s */
+ name_trav = name_copy = H5MM_strdup(name);
+ while ('/' == *name_trav)
+ name_trav++;
+
+ /* A path of "/" will always exist in a file */
+ if ('\0' == *name_trav)
+ *exists = TRUE;
+ else {
+ /* Set up user data & correct callback */
+ udata.exists = exists;
+ if (NULL == (udata.sep = HDstrchr(name_trav, '/')))
+ cb_func = H5L__exists_final_cb;
+ else {
+ /* Chew through adjacent separators, if present */
+ do {
+ *udata.sep = '\0';
+ udata.sep++;
+ } while ('/' == *udata.sep);
+ cb_func = H5L__exists_inter_cb;
+ } /* end else */
+
+ /* Traverse the group hierarchy to locate the link to check */
+ if (H5G_traverse(loc, name_trav, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists")
+ }
+
+done:
+ /* Release duplicated string */
+ H5MM_xfree(name_copy);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5L_exists_tolerant() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__exists
+ *
+ * Purpose: Returns whether a link exists in a group
+ *
+ * Note: Same as H5L_exists_tolerant, except that missing links are reported
+ * as failures
+ *
+ * Return: Non-negative on success, with *exists set/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Friday, March 16 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists)
+{
+ H5L_trav_le_t udata; /* User data for traversal */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity checks */
+ HDassert(loc);
+ HDassert(name);
+ HDassert(exists);
+
+ /* A path of "/" will always exist in a file */
+ if (0 == HDstrcmp(name, "/"))
+ *exists = TRUE;
+ else {
+ /* Traverse the group hierarchy to locate the object to get info about */
+ udata.exists = exists;
+ if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__exists_final_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "link doesn't exist")
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5L__exists() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_info_cb
+ *
+ * Purpose: Callback for retrieving a link's metadata
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Monday, April 17 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__get_info_cb(H5G_loc_t *grp_loc /*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t *lnk,
+ H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata /*in,out*/, H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_gi_t *udata = (H5L_trav_gi_t *)_udata; /* User data passed in */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name in this group resolved to a valid link */
+ if (lnk == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
+
+ /* Get information from the link */
+ if (H5G_link_to_info(grp_loc->oloc, lnk, udata->linfo) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info")
+
+done:
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_info_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_get_info
+ *
+ * Purpose: Returns metadata about a link.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: James Laird
+ * Monday, April 17 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info2_t *linfo /*out*/)
+{
+ H5L_trav_gi_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ udata.linfo = linfo;
+
+ /* Traverse the group hierarchy to locate the object to get info about */
+ if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name doesn't exist")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5L_get_info() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_info_by_idx_cb
+ *
+ * Purpose: Callback for retrieving a link's metadata according to an
+ * index's order.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Monday, November 6 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_gibi_t *udata = (H5L_trav_gibi_t *)_udata; /* User data passed in */
+ H5O_link_t fnd_lnk; /* Link within group */
+ hbool_t lnk_copied = FALSE; /* Whether the link was copied */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name of the group resolved to a valid object */
+ if (obj_loc == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
+
+ /* Query link */
+ if (H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
+ lnk_copied = TRUE;
+
+ /* Get information from the link */
+ if (H5G_link_to_info(obj_loc->oloc, &fnd_lnk, udata->linfo) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info")
+
+done:
+ /* Reset the link information, if we have a copy */
+ if (lnk_copied)
+ H5O_msg_reset(H5O_LINK_ID, &fnd_lnk);
+
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_info_by_idx_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_info_by_idx
+ *
+ * Purpose: Internal routine to retrieve link info according to an
+ * index's order.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t n, H5L_info2_t *linfo /*out*/)
+{
+ H5L_trav_gibi_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check arguments */
+ HDassert(loc);
+ HDassert(name && *name);
+ HDassert(linfo);
+
+ /* Set up user data for callback */
+ udata.idx_type = idx_type;
+ udata.order = order;
+ udata.n = n;
+ udata.linfo = linfo;
+
+ /* Traverse the group hierarchy to locate the object to get info about */
+ if (H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_by_idx_cb, &udata) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_info_by_idx() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_name_by_idx_cb
+ *
+ * Purpose: Callback for retrieving a link's name according to an
+ * index's order.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, November 11 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5L__get_name_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
+{
+ H5L_trav_gnbi_t *udata = (H5L_trav_gnbi_t *)_udata; /* User data passed in */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check if the name of the group resolved to a valid object */
+ if (obj_loc == NULL)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist")
+
+ /* Query link */
+ if (H5G_obj_get_name_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, udata->name,
+ udata->size, &udata->name_len) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found")
+
+done:
+ /* Indicate that this callback didn't take ownership of the group *
+ * location for the object */
+ *own_loc = H5G_OWN_NONE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_name_by_idx_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__get_name_by_idx
+ *
+ * Purpose: Internal routine to retrieve link name according to an
+ * index's order.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t n, char *name /*out*/, size_t size, size_t *link_name_len)
+{
+ H5L_trav_gnbi_t udata; /* User data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check arguments */
+ HDassert(loc);
+ HDassert(group_name && *group_name);
+ HDassert(link_name_len);
+
+ /* Set up user data for callback */
+ udata.idx_type = idx_type;
+ udata.order = order;
+ udata.n = n;
+ udata.name = name;
+ udata.size = size;
+ udata.name_len = 0;
+
+ /* Traverse the group hierarchy to locate the link to get name of */
+ if (H5G_traverse(loc, group_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_name_by_idx_cb, &udata) <
+ 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get name")
+
+ /* Set the return value */
+ *link_name_len = udata.name_len;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__get_name_by_idx() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L__link_copy_file
+ *
+ * Purpose: Copy a link and the object it points to from one file to
+ * another.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Sep 29 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc,
+ H5O_link_t *dst_lnk, H5O_copy_t *cpy_info)
+{
+ H5O_link_t tmp_src_lnk; /* Temporary copy of src link, when needed */
+ const H5O_link_t *src_lnk = _src_lnk; /* Source link */
+ hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */
+ hbool_t expanded_link_open = FALSE; /* Whether the target location has been opened */
+ H5G_loc_t tmp_src_loc; /* Group location holding target object */
+ H5G_name_t tmp_src_path; /* Path for target object */
+ H5O_loc_t tmp_src_oloc; /* Object location for target object */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* check arguments */
+ HDassert(dst_file);
+ HDassert(src_lnk);
+ HDassert(dst_lnk);
+ HDassert(cpy_info);
+
+ /* Expand soft or external link, if requested */
+ if ((H5L_TYPE_SOFT == src_lnk->type && cpy_info->expand_soft_link) ||
+ (H5L_TYPE_EXTERNAL == src_lnk->type && cpy_info->expand_ext_link)) {
+ H5G_loc_t lnk_grp_loc; /* Group location holding link */
+ H5G_name_t lnk_grp_path; /* Path for link */
+ hbool_t tar_exists = FALSE; /* Whether the target object exists */
+
+ /* Set up group location for link */
+ H5G_name_reset(&lnk_grp_path);
+ lnk_grp_loc.path = &lnk_grp_path;
+ lnk_grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Casting away const OK -QAK */
+
+ /* Check if the target object exists */
+ if (H5G_loc_exists(&lnk_grp_loc, src_lnk->name, &tar_exists) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to check if target object exists")
+
+ if (tar_exists) {
+ /* Make a temporary copy of the link, so that it will not change the
+ * info in the cache when we change it to a hard link */
+ if (NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, &tmp_src_lnk))
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message")
+
+ /* Set up group location for target object. Let H5G_traverse expand
+ * the link. */
+ tmp_src_loc.path = &tmp_src_path;
+ tmp_src_loc.oloc = &tmp_src_oloc;
+ if (H5G_loc_reset(&tmp_src_loc) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to reset location")
+
+ /* Find the target object */
+ if (H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to find target object")
+ expanded_link_open = TRUE;
+
+ /* Convert symbolic link to hard link */
+ if (tmp_src_lnk.type == H5L_TYPE_SOFT)
+ tmp_src_lnk.u.soft.name = (char *)H5MM_xfree(tmp_src_lnk.u.soft.name);
+ else if (tmp_src_lnk.u.ud.size > 0)
+ tmp_src_lnk.u.ud.udata = H5MM_xfree(tmp_src_lnk.u.ud.udata);
+ tmp_src_lnk.type = H5L_TYPE_HARD;
+ tmp_src_lnk.u.hard.addr = tmp_src_oloc.addr;
+ src_lnk = &tmp_src_lnk;
+ } /* end if */
+ } /* end if */
+
+ /* Copy src link information to dst link information */
+ if (NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, dst_lnk))
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message")
+ dst_lnk_init = TRUE;
+
+ /* Check if object in source group is a hard link & copy it */
+ if (H5L_TYPE_HARD == src_lnk->type) {
+ H5O_loc_t new_dst_oloc; /* Copied object location in destination */
+
+ /* Set up copied object location to fill in */
+ H5O_loc_reset(&new_dst_oloc);
+ new_dst_oloc.file = dst_file;
+
+ if (!expanded_link_open) {
+ /* Build temporary object location for source */
+ H5O_loc_reset(&tmp_src_oloc);
+ tmp_src_oloc.file = src_oloc->file;
+ tmp_src_oloc.addr = src_lnk->u.hard.addr;
+ } /* end if */
+ HDassert(H5F_addr_defined(tmp_src_oloc.addr));
+
+ /* Copy the shared object from source to destination */
+ /* Don't care about obj_type or udata because those are only important
+ * for old style groups */
+ if (H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object")
+
+ /* Copy new destination object's information for eventual insertion */
+ dst_lnk->u.hard.addr = new_dst_oloc.addr;
+ } /* end if */
+
+done:
+ /* Check if we used a temporary src link */
+ if (src_lnk != _src_lnk) {
+ HDassert(src_lnk == &tmp_src_lnk);
+ H5O_msg_reset(H5O_LINK_ID, &tmp_src_lnk);
+ } /* end if */
+ if (ret_value < 0)
+ if (dst_lnk_init)
+ H5O_msg_reset(H5O_LINK_ID, dst_lnk);
+ /* Check if we need to free the temp source oloc */
+ if (expanded_link_open)
+ if (H5G_loc_free(&tmp_src_loc) < 0)
+ HDONE_ERROR(H5E_LINK, H5E_CANTFREE, FAIL, "unable to free object")
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L__link_copy_file() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5L_iterate
+ *
+ * Purpose: Iterates through links in a group
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t *idx_p, H5L_iterate2_t op, void *op_data)
+{
+ H5G_link_iterate_t lnk_op; /* Link operator */
+ hsize_t last_lnk; /* Index of last object looked at */
+ hsize_t idx; /* Internal location to hold index */
+ herr_t ret_value = FAIL; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Sanity checks */
+ HDassert(loc);
+ HDassert(group_name);
+ HDassert(op);
+
+ /* Set up iteration beginning/end info */
+ idx = (idx_p == NULL ? 0 : *idx_p);
+ last_lnk = 0;
+
+ /* Build link operator info */
+ lnk_op.op_type = H5G_LINK_OP_NEW;
+ lnk_op.op_func.op_new = op;
+
+ /* Iterate over the links */
+ if ((ret_value = H5G_iterate(loc, group_name, idx_type, order, idx, &last_lnk, &lnk_op, op_data)) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
+
+ /* Set the index we stopped at */
+ if (idx_p)
+ *idx_p = last_lnk;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5L_iterate() */
diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h
index 54b94a4..cffd25c 100644
--- a/src/H5Lmodule.h
+++ b/src/H5Lmodule.h
@@ -30,11 +30,34 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5L H5L
- * \brief Link Interface
- * \todo Describe concisely what the functions in this module are about.
+ *
+ * Use the functions in this module to manage HDF5 links and link types.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5L_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5L_examples.c iter_cb
+ * \snippet{lineno} H5L_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5L_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5L_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
* \defgroup TRAV Link Traversal
* \ingroup H5L
+ * \defgroup H5LA Advanced Link Functions
+ * \ingroup H5L
*/
#endif /* H5Lmodule_H */
diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h
index 7057e30..36a4d12 100644
--- a/src/H5Lpkg.h
+++ b/src/H5Lpkg.h
@@ -53,26 +53,27 @@
/* Package Private Prototypes */
/******************************/
-H5_DLL herr_t H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link_loc,
- const char *link_name, hid_t lcpl_id);
-H5_DLL herr_t H5L__create_soft(const char *target_path, const H5G_loc_t *cur_loc, const char *cur_name,
- hid_t lcpl_id);
-H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void *ud_data,
- size_t ud_data_size, H5L_type_t type, hid_t lcpl_id);
-H5_DLL herr_t H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists);
-H5_DLL herr_t H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo /*out*/);
-H5_DLL ssize_t H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size);
-H5_DLL herr_t H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf /*out*/, size_t size);
-H5_DLL herr_t H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, void *buf /*out*/, size_t size);
-H5_DLL herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc,
- const char *dst_name, hbool_t copy_flag, hid_t lcpl_id);
-H5_DLL herr_t H5L__delete(const H5G_loc_t *loc, const char *name);
-H5_DLL herr_t H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n);
-H5_DLL herr_t H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc,
- H5O_link_t *dst_lnk, H5O_copy_t *cpy_info);
+H5_DLL herr_t H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link_loc,
+ const char *link_name, hid_t lcpl_id);
+H5_DLL herr_t H5L__create_soft(const char *target_path, const H5G_loc_t *cur_loc, const char *cur_name,
+ hid_t lcpl_id);
+H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void *ud_data,
+ size_t ud_data_size, H5L_type_t type, hid_t lcpl_id);
+H5_DLL herr_t H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists);
+H5_DLL herr_t H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo /*out*/);
+H5_DLL herr_t H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size,
+ size_t *name_len);
+H5_DLL herr_t H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf /*out*/, size_t size);
+H5_DLL herr_t H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, void *buf /*out*/, size_t size);
+H5_DLL herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc,
+ const char *dst_name, hbool_t copy_flag, hid_t lcpl_id);
+H5_DLL herr_t H5L__delete(const H5G_loc_t *loc, const char *name);
+H5_DLL herr_t H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n);
+H5_DLL herr_t H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc,
+ H5O_link_t *dst_lnk, H5O_copy_t *cpy_info);
#endif /* H5Lpkg_H */
diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h
index 740fc1e..98e3051 100644
--- a/src/H5Lprivate.h
+++ b/src/H5Lprivate.h
@@ -18,8 +18,9 @@
#ifndef H5Lprivate_H
#define H5Lprivate_H
-/* Include package's public header */
+/* Include package's public headers */
#include "H5Lpublic.h"
+#include "H5Ldevelop.h"
/* Private headers needed by this file */
#include "H5Gprivate.h" /* Groups */
@@ -51,50 +52,6 @@
/* Library Private Typedefs */
/****************************/
-/* User data for path traversal routine for getting link value by index */
-typedef struct {
- /* In */
- H5_index_t idx_type; /* Index to use */
- H5_iter_order_t order; /* Order to iterate in index */
- hsize_t n; /* Offset of link within index */
- size_t size; /* Size of user buffer */
-
- /* Out */
- void *buf; /* User buffer */
-} H5L_trav_gvbi_t;
-
-/* User data for path traversal routine for getting link info by index */
-typedef struct {
- /* In */
- H5_index_t idx_type; /* Index to use */
- H5_iter_order_t order; /* Order to iterate in index */
- hsize_t n; /* Offset of link within index */
-
- /* Out */
- H5L_info2_t *linfo; /* Buffer to return to user */
-} H5L_trav_gibi_t;
-
-/* User data for path traversal routine for getting name by index */
-typedef struct {
- /* In */
- H5_index_t idx_type; /* Index to use */
- H5_iter_order_t order; /* Order to iterate in index */
- hsize_t n; /* Offset of link within index */
- size_t size; /* Size of name buffer */
-
- /* Out */
- char * name; /* Buffer to return name to user */
- ssize_t name_len; /* Length of full name */
-} H5L_trav_gnbi_t;
-
-/* User data for path traversal routine for removing link by index */
-typedef struct {
- /* In */
- H5_index_t idx_type; /* Index to use */
- H5_iter_order_t order; /* Order to iterate in index */
- hsize_t n; /* Offset of link within index */
-} H5L_trav_rmbi_t;
-
/* Structure for external link traversal callback property */
typedef struct H5L_elink_cb_t {
H5L_elink_traverse_t func;
@@ -123,6 +80,7 @@ H5_DLL herr_t H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx
/* User-defined link functions */
H5_DLL herr_t H5L_register(const H5L_class_t *cls);
H5_DLL herr_t H5L_unregister(H5L_type_t id);
+H5_DLL herr_t H5L_is_registered(H5L_type_t id, hbool_t *is_registered);
H5_DLL const H5L_class_t *H5L_find_class(H5L_type_t id);
#endif /* H5Lprivate_H */
diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h
index d5ec346..72b0182 100644
--- a/src/H5Lpublic.h
+++ b/src/H5Lpublic.h
@@ -39,17 +39,12 @@
*
* The maximum length of a link's name is encoded in a 32-bit unsigned integer.
*/
-#define H5L_MAX_LINK_NAME_LEN ((uint32_t)(-1)) /* (4GB - 1) */
+#define H5L_MAX_LINK_NAME_LEN UINT32_MAX
/**
* \brief Macro to indicate operation occurs on same location
*/
-#define H5L_SAME_LOC (hid_t)0
-
-/**
- * \brief Current version of the H5L_class_t struct
- */
-#define H5L_LINK_CLASS_T_VERS 1
+#define H5L_SAME_LOC 0 /* (hid_t) */
#ifdef __cplusplus
extern "C" {
@@ -92,7 +87,7 @@ typedef enum {
/**
* \brief Information struct for links
*/
-//! [H5L_info2_t_snip]
+//! <!-- [H5L_info2_t_snip] -->
typedef struct {
H5L_type_t type; /**< Type of link */
hbool_t corder_valid; /**< Indicate if creation order is valid */
@@ -103,75 +98,16 @@ typedef struct {
size_t val_size; /**< Size of a soft link or user-defined link value */
} u;
} H5L_info2_t;
-//! [H5L_info2_t_snip]
-
-/* The H5L_class_t struct can be used to override the behavior of a
- * "user-defined" link class. Users should populate the struct with callback
- * functions defined below.
- */
-/* Callback prototypes for user-defined links */
-/**
- * \brief Link creation callback
- */
-typedef herr_t (*H5L_create_func_t)(const char *link_name, hid_t loc_group, const void *lnkdata,
- size_t lnkdata_size, hid_t lcpl_id);
-/**
- * \brief Callback for link move
- */
-typedef herr_t (*H5L_move_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata,
- size_t lnkdata_size);
-/**
- * \brief Callback for link copy
- */
-typedef herr_t (*H5L_copy_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata,
- size_t lnkdata_size);
-/**
- * \brief Callback during link traversal
- */
-typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata,
- size_t lnkdata_size, hid_t lapl_id, hid_t dxpl_id);
-/**
- * \brief Callback for link deletion
- */
-typedef herr_t (*H5L_delete_func_t)(const char *link_name, hid_t file, const void *lnkdata,
- size_t lnkdata_size);
-/**
- * \brief Callback for querying the link.
- *
- * Returns the size of the buffer needed.
- */
-typedef ssize_t (*H5L_query_func_t)(const char *link_name, const void *lnkdata, size_t lnkdata_size,
- void *buf /*out*/, size_t buf_size);
-
-/**
- * \brief Link prototype
- *
- * The H5L_class_t struct can be used to override the behavior of a
- * "user-defined" link class. Users should populate the struct with callback
- * functions defined elsewhere.
- */
-//! [H5L_class_t_snip]
-typedef struct {
- int version; /**< Version number of this struct */
- H5L_type_t id; /**< Link type ID */
- const char * comment; /**< Comment for debugging */
- H5L_create_func_t create_func; /**< Callback during link creation */
- H5L_move_func_t move_func; /**< Callback after moving link */
- H5L_copy_func_t copy_func; /**< Callback after copying link */
- H5L_traverse_func_t trav_func; /**< Callback during link traversal */
- H5L_delete_func_t del_func; /**< Callback for link deletion */
- H5L_query_func_t query_func; /**< Callback for queries */
-} H5L_class_t;
-//! [H5L_class_t_snip]
+//! <!-- [H5L_info2_t_snip] -->
/**
* \brief Prototype for H5Literate2(), H5Literate_by_name2() operator
*
* The H5O_token_t version is used in the VOL layer and future public API calls.
*/
-//! [H5L_iterate2_t_snip]
+//! <!-- [H5L_iterate2_t_snip] -->
typedef herr_t (*H5L_iterate2_t)(hid_t group, const char *name, const H5L_info2_t *info, void *op_data);
-//! [H5L_iterate2_t_snip]
+//! <!-- [H5L_iterate2_t_snip] -->
/**
* \brief Callback for external link traversal
@@ -201,8 +137,6 @@ typedef herr_t (*H5L_elink_traverse_t)(const char *parent_file_name, const char
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lmove() moves a link within an HDF5 file. The original link,
* \p src_name, is removed from \p src_loc and the new link,
* \p dst_name, is inserted at dst_loc. This change is
@@ -321,8 +255,6 @@ H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lcreate_hard() creates a new hard link to a pre-existing object
* in an HDF5 file.
*
@@ -357,6 +289,11 @@ H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const
*/
H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name, hid_t dst_loc, const char *dst_name,
hid_t lcpl_id, hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Lcreate_hard}
+ */
H5_DLL herr_t H5Lcreate_hard_async(const char *app_file, const char *app_func, unsigned app_line,
hid_t cur_loc_id, const char *cur_name, hid_t new_loc_id,
const char *new_name, hid_t lcpl_id, hid_t lapl_id, hid_t es_id);
@@ -373,8 +310,6 @@ H5_DLL herr_t H5Lcreate_hard_async(const char *app_file, const char *app_func, u
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lcreate_soft() creates a new soft link to an object in an HDF5
* file.
*
@@ -426,6 +361,11 @@ H5_DLL herr_t H5Lcreate_hard_async(const char *app_file, const char *app_func, u
*/
H5_DLL herr_t H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name, hid_t lcpl_id,
hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Lcreate_soft}
+ */
H5_DLL herr_t H5Lcreate_soft_async(const char *app_file, const char *app_func, unsigned app_line,
const char *link_target, hid_t link_loc_id, const char *link_name,
hid_t lcpl_id, hid_t lapl_id, hid_t es_id);
@@ -440,8 +380,6 @@ H5_DLL herr_t H5Lcreate_soft_async(const char *app_file, const char *app_func, u
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Ldelete() removes the link specified by \p name from the location
* \p loc_id.
*
@@ -468,6 +406,11 @@ H5_DLL herr_t H5Lcreate_soft_async(const char *app_file, const char *app_func, u
*
*/
H5_DLL herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Ldelete}
+ */
H5_DLL herr_t H5Ldelete_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t lapl_id, hid_t es_id);
/**
@@ -484,8 +427,6 @@ H5_DLL herr_t H5Ldelete_async(const char *app_file, const char *app_func, unsign
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Ldelete_by_idx() removes the \Emph{n}-th link in a group
* according to the specified order, \p order, in the specified index,
* \p index.
@@ -500,6 +441,11 @@ H5_DLL herr_t H5Ldelete_async(const char *app_file, const char *app_func, unsign
*/
H5_DLL herr_t H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Ldelete_by_idx}
+ */
H5_DLL herr_t H5Ldelete_by_idx_async(const char *app_file, const char *app_func, unsigned app_line,
hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t es_id);
@@ -516,8 +462,6 @@ H5_DLL herr_t H5Ldelete_by_idx_async(const char *app_file, const char *app_func,
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lget_val() returns tha value of link \p name. For smbolic links,
* this is the path to which the link points, including the null
* terminator. For external and user-defined links, it is the link
@@ -575,8 +519,6 @@ H5_DLL herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf /*out*/, size
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lget_val_by_idx() retrieves the value of the \Emph{n}-th link in
* a group, according to the specified order, \p order, within an
* index, \p index.
@@ -630,8 +572,6 @@ H5_DLL herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lexists() allows an application to determine whether the link \p
* name exists in the location specified by \p loc_id. The link may be
* of any type; only the presence of a link with that name is checked.
@@ -707,6 +647,11 @@ H5_DLL herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t
*
*/
H5_DLL htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Lexists}
+ */
H5_DLL herr_t H5Lexists_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hbool_t *exists, hid_t lapl_id, hid_t es_id);
/**
@@ -721,8 +666,6 @@ H5_DLL herr_t H5Lexists_async(const char *app_file, const char *app_func, unsign
*
* \return \herr_t
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lget_info2() returns information about the specified link through
* the \p linfo argument.
*
@@ -830,8 +773,6 @@ H5_DLL herr_t H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo, h
*
* \see H5Lget_info2()
*
- * \todo Document H5Lget_info_by_idx()
- *
*/
H5_DLL herr_t H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo, hid_t lapl_id);
@@ -957,6 +898,11 @@ H5_DLL ssize_t H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index
*/
H5_DLL herr_t H5Literate2(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx,
H5L_iterate2_t op, void *op_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Literate}
+ */
H5_DLL herr_t H5Literate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t group_id,
H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate2_t op,
void *op_data, hid_t es_id);
@@ -1240,179 +1186,6 @@ H5_DLL herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t
/**
* \ingroup H5LA
*
- * \brief Registers a user-defined link class or changes behavior of an
- * existing class
- *
- * \param[in] cls Pointer to a buffer containing the struct describing the
- * user-defined link class
- *
- * \return \herr_t
- *
- * \details H5Lregister() registers a class of user-defined links, or changes
- * the behavior of an existing class.
- *
- * \p cls is a pointer to a buffer containing a copy of the
- * H5L_class_t struct. This struct is defined in H5Lpublic.h as
- * follows:
- * \snippet this H5L_class_t_snip
- *
- * The class definition passed with \p cls must include at least the
- * following:
- * \li An H5L_class_t version (which should be #H5L_LINK_CLASS_T_VERS)
- * \li A link class identifier, \c class_id
- * \li A traversal function, \c trav_func
- *
- * Remaining \c struct members are optional and may be passed as NULL.
- *
- * The link class passed in \c class_id must be in the user-definable
- * range between #H5L_TYPE_UD_MIN and #H5L_TYPE_UD_MAX
- * (see the table below) and will override
- * any existing link class with that identifier.
- *
- * As distributed, valid values of \c class_id used in HDF5 include
- * the following (defined in H5Lpublic.h):
- * \link_types
- *
- * The hard and soft link class identifiers cannot be modified or
- * reassigned, but the external link class is implemented as an
- * example in the user-definable link class identifier range.
- * H5Lregister() is used to register additional link classes. It could
- * also be used to modify the behavior of the external link class,
- * though that is not recommended.
- *
- * The following table summarizes existing link types and values and
- * the reserved and user-definable link class identifier value ranges.
- * <table>
- * <tr>
- * <th>Link class identifier or Value range</th>
- * <th>Description</th>
- * <th>Link class or label</th>
- * </tr>
- * <tr>
- * <td>0 to 63</td>
- * <td>Reserved range</td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>64 to 255</td>
- * <td>User-definable range</td>
- * <td></td>
- * </tr>
- * <tr>
- * <td>64</td>
- * <td>Minimum user-defined value</td>
- * <td>#H5L_TYPE_UD_MIN</td>
- * </tr>
- * <tr>
- * <td>64</td>
- * <td>External link</td>
- * <td>#H5L_TYPE_EXTERNAL</td>
- * </tr>
- * <tr>
- * <td>255</td>
- * <td>Maximum user-defined value</td>
- * <td>#H5L_TYPE_UD_MAX</td>
- * </tr>
- * <tr>
- * <td>255</td>
- * <td>Maximum value</td>
- * <td>#H5L_TYPE_MAX</td>
- * </tr>
- * <tr>
- * <td>-1</td>
- * <td>Error</td>
- * <td>#H5L_TYPE_ERROR</td>
- * </tr>
- * </table>
- *
- * Note that HDF5 internally registers user-defined link classes only
- * by the numeric value of the link class identifier. An application,
- * on the other hand, will generally use a name for a user-defined
- * class, if for no other purpose than as a variable name. Assume,
- * for example, that a complex link type is registered with the link
- * class identifier 73 and that the code includes the following
- * assignment:
- * \code
- * H5L_TYPE_COMPLEX_A = 73
- * \endcode
- * The application can refer to the link class with a term,
- * \c H5L_TYPE_COMPLEX_A, that conveys meaning to a human reviewing
- * the code, while HDF5 recognizes it by the more cryptic numeric
- * identifier, 73.
- *
- * \attention Important details and considerations include the following:
- * \li If you plan to distribute files or software with a
- * user-defined link class, please contact the Help Desk at
- * The HDF Group to help prevent collisions between \c class_id
- * values. See below.
- * \li As distributed with HDF5, the external link class is
- * implemented as an example of a user-defined link class with
- * #H5L_TYPE_EXTERNAL equal to #H5L_TYPE_UD_MIN. \c class_id in
- * the H5L_class_t \c struct must not equal #H5L_TYPE_UD_MIN
- * unless you intend to overwrite or modify the behavior of
- * external links.
- * \li H5Lregister() can be used only with link class identifiers
- * in the user-definable range (see table above).
- * \li The hard and soft links defined by the HDF5 library,
- * #H5L_TYPE_HARD and #H5L_TYPE_SOFT, reside in the reserved
- * range below #H5L_TYPE_UD_MIN and cannot be redefined or
- * modified.
- * \li H5Lis_registered() can be used to determine whether a desired
- * link class identifier is available. \Emph{Note that this
- * function will tell you only whether the link class identifier
- * has been registered with the installed copy of HDF5; it
- * cannot tell you whether the link class has been registered
- * with The HDF Group.}
- * \li #H5L_TYPE_MAX is the maximum allowed value for a link type
- * identifier.
- * \li #H5L_TYPE_UD_MIN equals #H5L_TYPE_EXTERNAL.
- * \li #H5L_TYPE_UD_MAX equals #H5L_TYPE_MAX.
- * \li #H5L_TYPE_ERROR indicates that an error has occurred.
- *
- * \note \Bold{Registration with The HDF Group:}\n
- * There are sometimes reasons to take a broader approach to registering
- * a user-defined link class than just invoking H5Lregister(). For
- * example:
- * \li A user-defined link class is intended for use across an
- * organization, among collaborators, or across a community of users.
- * \li An application or library overlying HDF5 invokes a user-defined
- * link class that must be shipped with the software.
- * \li Files are distributed that make use of a user-defined link class.
- * \li Or simply, a specific user-defined link class is thought to be
- * widely useful.
- *
- * In such cases, you are encouraged to register that link class with
- * The HDF Group's Helpdesk. The HDF Group maintains a registry of known
- * user-defined link classes and tracks the selected link class
- * identifiers. This registry is intended to reduce the risk of
- * collisions between \c class_id values and to help coordinate the use
- * of specialized link classes.
- *
- * \since 1.8.0
- *
- */
-H5_DLL herr_t H5Lregister(const H5L_class_t *cls);
-/**
- * \ingroup H5LA
- *
- * \brief Unregisters a class of user-defined links
- *
- * \param[in] id User-defined link class identifier
- *
- * \return \herr_t
- *
- * \details H5Lunregister() unregisters a class of user-defined links,
- * preventing them from being traversed, queried, moved, etc.
- *
- * \note A link class can be re-registered using H5Lregister().
- *
- * \since 1.8.0
- *
- */
-H5_DLL herr_t H5Lunregister(H5L_type_t id);
-/**
- * \ingroup H5LA
- *
* \brief Determines whether a class of user-defined links is registered
*
* \param[in] id User-defined link class identifier
@@ -1607,6 +1380,7 @@ H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval /*in*/, size_t link_si
H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id,
const char *link_name, hid_t lcpl_id, hid_t lapl_id);
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -1628,6 +1402,7 @@ H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hi
#define H5Lexists_async_wrap H5_NO_EXPAND(H5Lexists_async)
#define H5Literate_async_wrap H5_NO_EXPAND(H5Literate_async)
#endif /* H5L_MODULE */
+/// \endcond
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -1637,13 +1412,12 @@ H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hi
/* Macros */
-/* Previous versions of the H5L_class_t struct */
-#define H5L_LINK_CLASS_T_VERS_0 0
-
/* Typedefs */
-/* Information struct for link (for H5Lget_info1/H5Lget_info_by_idx1) */
-//! [H5L_info1_t_snip]
+//! <!-- [H5L_info1_t_snip] -->
+/**
+ * Information struct for link (for H5Lget_info1() and H5Lget_info_by_idx1())
+ */
typedef struct {
H5L_type_t type; /**< Type of link */
hbool_t corder_valid; /**< Indicate if creation order is valid */
@@ -1654,29 +1428,12 @@ typedef struct {
size_t val_size; /**< Size of a soft link or UD link value */
} u;
} H5L_info1_t;
-//! [H5L_info1_t_snip]
-
-/** Callback during link traversal */
-typedef hid_t (*H5L_traverse_0_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata,
- size_t lnkdata_size, hid_t lapl_id);
-
-/** User-defined link types */
-typedef struct {
- int version; /**< Version number of this struct */
- H5L_type_t id; /**< Link type ID */
- const char * comment; /**< Comment for debugging */
- H5L_create_func_t create_func; /**< Callback during link creation */
- H5L_move_func_t move_func; /**< Callback after moving link */
- H5L_copy_func_t copy_func; /**< Callback after copying link */
- H5L_traverse_0_func_t trav_func; /**< Callback during link traversal */
- H5L_delete_func_t del_func; /**< Callback for link deletion */
- H5L_query_func_t query_func; /**< Callback for queries */
-} H5L_class_0_t;
+//! <!-- [H5L_info1_t_snip] -->
/** Prototype for H5Literate1() / H5Literate_by_name1() operator */
-//! [H5L_iterate1_t_snip]
+//! <!-- [H5L_iterate1_t_snip] -->
typedef herr_t (*H5L_iterate1_t)(hid_t group, const char *name, const H5L_info1_t *info, void *op_data);
-//! [H5L_iterate1_t_snip]
+//! <!-- [H5L_iterate1_t_snip] -->
/* Function prototypes */
/**
@@ -1694,8 +1451,6 @@ typedef herr_t (*H5L_iterate1_t)(hid_t group, const char *name, const H5L_info1_
* \deprecated As of HDF5-1.12 this function has been deprecated in favor of
* the function H5Lget_info2() or the macro H5Lget_info().
*
- * \todo We need to get the location ID story straight!
- *
* \details H5Lget_info1() returns information about the specified link through
* the \p linfo argument.
*
diff --git a/src/H5M.c b/src/H5M.c
index 552d3fc..b890a5c 100644
--- a/src/H5M.c
+++ b/src/H5M.c
@@ -211,15 +211,20 @@ H5M_term_package(void)
static herr_t
H5M__close_cb(H5VL_object_t *map_vol_obj, void **request)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(map_vol_obj);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_MAP_CLOSE;
+ vol_cb_args.args = NULL;
+
/* Close the map */
- if (H5VL_optional(map_vol_obj, H5VL_MAP_CLOSE, H5P_DATASET_XFER_DEFAULT, request) < 0)
+ if (H5VL_optional(map_vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, request) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CLOSEERROR, FAIL, "unable to close map");
/* Free the VOL object */
@@ -251,8 +256,9 @@ H5M__create_api_common(hid_t loc_id, const char *name, hid_t key_type_id, hid_t
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_STATIC
@@ -274,14 +280,24 @@ H5M__create_api_common(hid_t loc_id, const char *name, hid_t key_type_id, hid_t
else if (TRUE != H5P_isa_class(mcpl_id, H5P_MAP_CREATE))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "mcpl_id is not a map create property list ID")
- /* Set up object access arguments */
- if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, TRUE, &mapl_id, vol_obj_ptr, &loc_params) < 0)
+ /* Set up VOL callback arguments */
+ if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, TRUE, &mapl_id, vol_obj_ptr, &map_args.create.loc_params) <
+ 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
+ map_args.create.name = name;
+ map_args.create.lcpl_id = lcpl_id;
+ map_args.create.key_type_id = key_type_id;
+ map_args.create.val_type_id = val_type_id;
+ map_args.create.mcpl_id = mcpl_id;
+ map_args.create.mapl_id = mapl_id;
+ map_args.create.map = NULL;
+ vol_cb_args.op_type = H5VL_MAP_CREATE;
+ vol_cb_args.args = &map_args;
/* Create the map */
- if (H5VL_optional(*vol_obj_ptr, H5VL_MAP_CREATE, H5P_DATASET_XFER_DEFAULT, token_ptr, &loc_params, name,
- lcpl_id, key_type_id, val_type_id, mcpl_id, mapl_id, &map) < 0)
+ if (H5VL_optional(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTINIT, H5I_INVALID_HID, "unable to create map")
+ map = map_args.create.map;
/* Get an ID for the map */
if ((ret_value = H5VL_register(H5I_MAP, map, (*vol_obj_ptr)->connector, TRUE)) < 0)
@@ -289,9 +305,14 @@ H5M__create_api_common(hid_t loc_id, const char *name, hid_t key_type_id, hid_t
done:
/* Cleanup on failure */
- if (H5I_INVALID_HID == ret_value)
- if (map && H5VL_optional(*vol_obj_ptr, H5VL_MAP_CLOSE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ if (H5I_INVALID_HID == ret_value) {
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_MAP_CLOSE;
+ vol_cb_args.args = NULL;
+
+ if (map && H5VL_optional(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release map")
+ } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5M__create_api_common() */
@@ -369,7 +390,7 @@ H5Mcreate_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE11(FUNC, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, key_type_id, val_type_id, lcpl_id, mcpl_id, mapl_id, es_id)) < 0) {
+ H5ARG_TRACE11(__func__, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, key_type_id, val_type_id, lcpl_id, mcpl_id, mapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_MAP, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on map ID")
@@ -407,10 +428,11 @@ done:
hid_t
H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id, hid_t mapl_id)
{
- void * map = NULL; /* map object from VOL connector */
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ void * map = NULL; /* map object from VOL connector */
+ H5VL_object_t * vol_obj = NULL; /* object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE5("i", "iiiii", loc_id, key_type_id, val_type_id, mcpl_id, mapl_id);
@@ -430,13 +452,24 @@ H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
/* Set location parameters */
- loc_params.type = H5VL_OBJECT_BY_SELF;
- loc_params.obj_type = H5I_get_type(loc_id);
+
+ /* Set up VOL callback arguments */
+ map_args.create.loc_params.type = H5VL_OBJECT_BY_SELF;
+ map_args.create.loc_params.obj_type = H5I_get_type(loc_id);
+ map_args.create.name = NULL;
+ map_args.create.lcpl_id = H5P_LINK_CREATE_DEFAULT;
+ map_args.create.key_type_id = key_type_id;
+ map_args.create.val_type_id = val_type_id;
+ map_args.create.mcpl_id = mcpl_id;
+ map_args.create.mapl_id = mapl_id;
+ map_args.create.map = NULL;
+ vol_cb_args.op_type = H5VL_MAP_CREATE;
+ vol_cb_args.args = &map_args;
/* Create the map */
- if (H5VL_optional(vol_obj, H5VL_MAP_CREATE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params, NULL,
- H5P_LINK_CREATE_DEFAULT, key_type_id, val_type_id, mcpl_id, mapl_id, &map) < 0)
+ if (H5VL_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTINIT, H5I_INVALID_HID, "unable to create map")
+ map = map_args.create.map;
/* Get an ID for the map */
if ((ret_value = H5VL_register(H5I_MAP, map, vol_obj->connector, TRUE)) < 0)
@@ -444,9 +477,14 @@ H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id
done:
/* Cleanup on failure */
- if (H5I_INVALID_HID == ret_value)
- if (map && H5VL_optional(vol_obj, H5VL_MAP_CLOSE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ if (H5I_INVALID_HID == ret_value) {
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_MAP_CLOSE;
+ vol_cb_args.args = NULL;
+
+ if (map && H5VL_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release map")
+ } /* end if */
FUNC_LEAVE_API(ret_value)
} /* end H5Mcreate_anon() */
@@ -470,8 +508,9 @@ H5M__open_api_common(hid_t loc_id, const char *name, hid_t mapl_id, void **token
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_STATIC
@@ -481,14 +520,20 @@ H5M__open_api_common(hid_t loc_id, const char *name, hid_t mapl_id, void **token
if (!*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string")
- /* Set up object access arguments */
- if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, FALSE, &mapl_id, vol_obj_ptr, &loc_params) < 0)
+ /* Set up VOL callback arguments */
+ if (H5VL_setup_acc_args(loc_id, H5P_CLS_MACC, FALSE, &mapl_id, vol_obj_ptr, &map_args.open.loc_params) <
+ 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
+ map_args.open.name = name;
+ map_args.open.mapl_id = mapl_id;
+ map_args.open.map = NULL;
+ vol_cb_args.op_type = H5VL_MAP_OPEN;
+ vol_cb_args.args = &map_args;
/* Open the map */
- if (H5VL_optional(*vol_obj_ptr, H5VL_MAP_OPEN, H5P_DATASET_XFER_DEFAULT, token_ptr, &loc_params, name,
- mapl_id, &map) < 0)
+ if (H5VL_optional(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open map")
+ map = map_args.create.map;
/* Register an ID for the map */
if ((ret_value = H5VL_register(H5I_MAP, map, (*vol_obj_ptr)->connector, TRUE)) < 0)
@@ -496,9 +541,14 @@ H5M__open_api_common(hid_t loc_id, const char *name, hid_t mapl_id, void **token
done:
/* Cleanup on failure */
- if (H5I_INVALID_HID == ret_value)
- if (map && H5VL_optional(*vol_obj_ptr, H5VL_MAP_CLOSE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ if (H5I_INVALID_HID == ret_value) {
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_MAP_CLOSE;
+ vol_cb_args.args = NULL;
+
+ if (map && H5VL_optional(*vol_obj_ptr, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release map")
+ } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5M__open_api_common() */
@@ -521,9 +571,7 @@ done:
hid_t
H5Mopen(hid_t loc_id, const char *name, hid_t mapl_id)
{
- void * map = NULL; /* map object from VOL connector */
- H5VL_object_t *vol_obj = NULL; /* object of loc_id */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE3("i", "i*si", loc_id, name, mapl_id);
@@ -533,11 +581,6 @@ H5Mopen(hid_t loc_id, const char *name, hid_t mapl_id)
HGOTO_ERROR(H5E_MAP, H5E_CANTCREATE, H5I_INVALID_HID, "unable to open map synchronously")
done:
- /* Cleanup on failure */
- if (H5I_INVALID_HID == ret_value)
- if (map && H5VL_optional(vol_obj, H5VL_MAP_CLOSE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release map")
-
FUNC_LEAVE_API(ret_value)
} /* end H5Mopen() */
@@ -576,7 +619,7 @@ H5Mopen_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, mapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, mapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_MAP, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on map ID")
@@ -670,7 +713,7 @@ H5Mclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, map_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, map_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_MAP, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -697,8 +740,10 @@ done:
hid_t
H5Mget_key_type(hid_t map_id)
{
- H5VL_object_t *vol_obj; /* Map structure */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* Map structure */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", map_id);
@@ -707,10 +752,18 @@ H5Mget_key_type(hid_t map_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier")
- /* get the datatype */
- if (H5VL_optional(vol_obj, H5VL_MAP_GET, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_MAP_GET_KEY_TYPE,
- &ret_value) < 0)
- HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get datatype")
+ /* Set up VOL callback arguments */
+ map_args.get.get_type = H5VL_MAP_GET_KEY_TYPE;
+ map_args.get.args.get_key_type.type_id = H5I_INVALID_HID;
+ vol_cb_args.op_type = H5VL_MAP_GET;
+ vol_cb_args.args = &map_args;
+
+ /* Get the key datatype */
+ if (H5VL_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get key datatype")
+
+ /* Set return value */
+ ret_value = map_args.get.args.get_key_type.type_id;
done:
FUNC_LEAVE_API(ret_value)
@@ -732,8 +785,10 @@ done:
hid_t
H5Mget_val_type(hid_t map_id)
{
- H5VL_object_t *vol_obj; /* Map structure */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* Map structure */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", map_id);
@@ -742,10 +797,18 @@ H5Mget_val_type(hid_t map_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier")
- /* get the datatype */
- if (H5VL_optional(vol_obj, H5VL_MAP_GET, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_MAP_GET_VAL_TYPE,
- &ret_value) < 0)
- HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get datatype")
+ /* Set up VOL callback arguments */
+ map_args.get.get_type = H5VL_MAP_GET_VAL_TYPE;
+ map_args.get.args.get_val_type.type_id = H5I_INVALID_HID;
+ vol_cb_args.op_type = H5VL_MAP_GET;
+ vol_cb_args.args = &map_args;
+
+ /* Get the value datatype */
+ if (H5VL_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get value datatype")
+
+ /* Set return value */
+ ret_value = map_args.get.args.get_val_type.type_id;
done:
FUNC_LEAVE_API(ret_value)
@@ -767,8 +830,10 @@ done:
hid_t
H5Mget_create_plist(hid_t map_id)
{
- H5VL_object_t *vol_obj; /* Map structure */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* Map structure */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", map_id);
@@ -777,11 +842,19 @@ H5Mget_create_plist(hid_t map_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier")
+ /* Set up VOL callback arguments */
+ map_args.get.get_type = H5VL_MAP_GET_MCPL;
+ map_args.get.args.get_mcpl.mcpl_id = H5I_INVALID_HID;
+ vol_cb_args.op_type = H5VL_MAP_GET;
+ vol_cb_args.args = &map_args;
+
/* Get the map creation property list */
- if (H5VL_optional(vol_obj, H5VL_MAP_GET, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_MAP_GET_MCPL,
- &ret_value) < 0)
+ if (H5VL_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get map creation properties")
+ /* Set return value */
+ ret_value = map_args.get.args.get_mcpl.mcpl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Mget_create_plist() */
@@ -805,8 +878,10 @@ done:
hid_t
H5Mget_access_plist(hid_t map_id)
{
- H5VL_object_t *vol_obj; /* Map structure */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_object_t * vol_obj; /* Map structure */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", map_id);
@@ -815,11 +890,19 @@ H5Mget_access_plist(hid_t map_id)
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid map identifier")
+ /* Set up VOL callback arguments */
+ map_args.get.get_type = H5VL_MAP_GET_MAPL;
+ map_args.get.args.get_mapl.mapl_id = H5I_INVALID_HID;
+ vol_cb_args.op_type = H5VL_MAP_GET;
+ vol_cb_args.args = &map_args;
+
/* Get the map access property list */
- if (H5VL_optional(vol_obj, H5VL_MAP_GET, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_MAP_GET_MAPL,
- &ret_value) < 0)
+ if (H5VL_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get map access properties")
+ /* Set return value */
+ ret_value = map_args.get.args.get_mapl.mapl_id;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Mget_access_plist() */
@@ -839,8 +922,10 @@ done:
herr_t
H5Mget_count(hid_t map_id, hsize_t *count /*out*/, hid_t dxpl_id)
{
- H5VL_object_t *vol_obj; /* Map structure */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Map structure */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE3("e", "ixi", map_id, count, dxpl_id);
@@ -858,9 +943,19 @@ H5Mget_count(hid_t map_id, hsize_t *count /*out*/, hid_t dxpl_id)
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
+ /* Set up VOL callback arguments */
+ map_args.get.get_type = H5VL_MAP_GET_COUNT;
+ map_args.get.args.get_count.count = 0;
+ vol_cb_args.op_type = H5VL_MAP_GET;
+ vol_cb_args.args = &map_args;
+
/* Get the number of key-value pairs stored in the map */
- if (H5VL_optional(vol_obj, H5VL_MAP_GET, dxpl_id, H5_REQUEST_NULL, H5VL_MAP_GET_COUNT, count) < 0)
- HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get map access properties")
+ if (H5VL_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_MAP, H5E_CANTGET, H5I_INVALID_HID, "unable to get KV pair count for map")
+
+ /* Set value to return */
+ if (count)
+ *count = map_args.get.args.get_count.count;
done:
FUNC_LEAVE_API(ret_value)
@@ -882,7 +977,9 @@ H5M__put_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -905,9 +1002,16 @@ H5M__put_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
+ /* Set up VOL callback arguments */
+ map_args.put.key_mem_type_id = key_mem_type_id;
+ map_args.put.key = key;
+ map_args.put.value_mem_type_id = val_mem_type_id;
+ map_args.put.value = value;
+ vol_cb_args.op_type = H5VL_MAP_PUT;
+ vol_cb_args.args = &map_args;
+
/* Set the key/value pair */
- if (H5VL_optional(*vol_obj_ptr, H5VL_MAP_PUT, dxpl_id, token_ptr, key_mem_type_id, key, val_mem_type_id,
- value) < 0)
+ if (H5VL_optional(*vol_obj_ptr, &vol_cb_args, dxpl_id, token_ptr) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTSET, FAIL, "unable to put key/value pair")
done:
@@ -984,7 +1088,7 @@ H5Mput_async(const char *app_file, const char *app_func, unsigned app_line, hid_
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_MAP, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1008,7 +1112,9 @@ H5M__get_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1031,9 +1137,16 @@ H5M__get_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
+ /* Set up VOL callback arguments */
+ map_args.get_val.key_mem_type_id = key_mem_type_id;
+ map_args.get_val.key = key;
+ map_args.get_val.value_mem_type_id = val_mem_type_id;
+ map_args.get_val.value = value;
+ vol_cb_args.op_type = H5VL_MAP_GET_VAL;
+ vol_cb_args.args = &map_args;
+
/* Get the value for the key */
- if (H5VL_optional(*vol_obj_ptr, H5VL_MAP_GET_VAL, dxpl_id, token_ptr, key_mem_type_id, key,
- val_mem_type_id, value) < 0)
+ if (H5VL_optional(*vol_obj_ptr, &vol_cb_args, dxpl_id, token_ptr) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTGET, FAIL, "unable to get value from map")
done:
@@ -1113,7 +1226,7 @@ H5Mget_async(const char *app_file, const char *app_func, unsigned app_line, hid_
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_MAP, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1137,8 +1250,10 @@ done:
herr_t
H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists, hid_t dxpl_id)
{
- H5VL_object_t *vol_obj = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "ii*x*bi", map_id, key_mem_type_id, key, exists, dxpl_id);
@@ -1160,11 +1275,21 @@ H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists,
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
+ /* Set up VOL callback arguments */
+ map_args.exists.key_mem_type_id = key_mem_type_id;
+ map_args.exists.key = key;
+ map_args.exists.exists = FALSE;
+ vol_cb_args.op_type = H5VL_MAP_EXISTS;
+ vol_cb_args.args = &map_args;
+
/* Check if key exists */
- if ((ret_value = H5VL_optional(vol_obj, H5VL_MAP_EXISTS, dxpl_id, H5_REQUEST_NULL, key_mem_type_id, key,
- exists)) < 0)
+ if (H5VL_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTGET, ret_value, "unable to check if key exists")
+ /* Set value to return */
+ if (exists)
+ *exists = map_args.exists.exists;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Mexists() */
@@ -1203,9 +1328,10 @@ done:
herr_t
H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, void *op_data, hid_t dxpl_id)
{
- H5VL_object_t * vol_obj = NULL;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "i*hiMI*xi", map_id, idx, key_mem_type_id, op, op_data, dxpl_id);
@@ -1229,14 +1355,23 @@ H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op,
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
- /* Set location struct fields */
- loc_params.type = H5VL_OBJECT_BY_SELF;
- loc_params.obj_type = H5I_get_type(map_id);
+ /* Set up VOL callback arguments */
+ map_args.specific.specific_type = H5VL_MAP_ITER;
+ map_args.specific.args.iterate.loc_params.type = H5VL_OBJECT_BY_SELF;
+ map_args.specific.args.iterate.loc_params.obj_type = H5I_get_type(map_id);
+ map_args.specific.args.iterate.idx = (idx ? *idx : 0);
+ map_args.specific.args.iterate.op = op;
+ map_args.specific.args.iterate.op_data = op_data;
+ vol_cb_args.op_type = H5VL_MAP_SPECIFIC;
+ vol_cb_args.args = &map_args;
/* Iterate over keys */
- if ((ret_value = H5VL_optional(vol_obj, H5VL_MAP_SPECIFIC, dxpl_id, H5_REQUEST_NULL, &loc_params,
- H5VL_MAP_ITER, idx, key_mem_type_id, op, op_data)) < 0)
- HGOTO_ERROR(H5E_MAP, H5E_BADITER, ret_value, "unable to iterate over keys")
+ if ((ret_value = H5VL_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL)) < 0)
+ HERROR(H5E_MAP, H5E_BADITER, "unable to iterate over keys");
+
+ /* Set value to return */
+ if (idx)
+ *idx = map_args.specific.args.iterate.idx;
done:
FUNC_LEAVE_API(ret_value)
@@ -1277,9 +1412,10 @@ herr_t
H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op,
void *op_data, hid_t dxpl_id, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*s*hiMI*xii", loc_id, map_name, idx, key_mem_type_id, op, op_data, dxpl_id, lapl_id);
@@ -1307,16 +1443,25 @@ H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_m
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
- /* Set location struct fields */
- loc_params.type = H5VL_OBJECT_BY_NAME;
- loc_params.obj_type = H5I_get_type(loc_id);
- loc_params.loc_data.loc_by_name.name = map_name;
- loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
+ /* Set up VOL callback arguments */
+ map_args.specific.specific_type = H5VL_MAP_ITER;
+ map_args.specific.args.iterate.loc_params.type = H5VL_OBJECT_BY_NAME;
+ map_args.specific.args.iterate.loc_params.obj_type = H5I_get_type(loc_id);
+ map_args.specific.args.iterate.loc_params.loc_data.loc_by_name.name = map_name;
+ map_args.specific.args.iterate.loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
+ map_args.specific.args.iterate.idx = (idx ? *idx : 0);
+ map_args.specific.args.iterate.op = op;
+ map_args.specific.args.iterate.op_data = op_data;
+ vol_cb_args.op_type = H5VL_MAP_SPECIFIC;
+ vol_cb_args.args = &map_args;
/* Iterate over keys */
- if ((ret_value = H5VL_optional(vol_obj, H5VL_MAP_SPECIFIC, dxpl_id, H5_REQUEST_NULL, &loc_params,
- H5VL_MAP_ITER, idx, key_mem_type_id, op, op_data)) < 0)
- HGOTO_ERROR(H5E_MAP, H5E_BADITER, ret_value, "unable to ierate over keys")
+ if ((ret_value = H5VL_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL)) < 0)
+ HERROR(H5E_MAP, H5E_BADITER, "unable to ierate over keys");
+
+ /* Set value to return */
+ if (idx)
+ *idx = map_args.specific.args.iterate.idx;
done:
FUNC_LEAVE_API(ret_value)
@@ -1340,9 +1485,10 @@ done:
herr_t
H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t dxpl_id)
{
- H5VL_object_t * vol_obj = NULL;
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL;
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_map_args_t map_args; /* Arguments for map operations */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "ii*xi", map_id, key_mem_type_id, key, dxpl_id);
@@ -1364,13 +1510,17 @@ H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t dxpl_id)
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
- /* Set location struct fields */
- loc_params.type = H5VL_OBJECT_BY_SELF;
- loc_params.obj_type = H5I_get_type(map_id);
+ /* Set up VOL callback arguments */
+ map_args.specific.specific_type = H5VL_MAP_DELETE;
+ map_args.specific.args.del.loc_params.type = H5VL_OBJECT_BY_SELF;
+ map_args.specific.args.del.loc_params.obj_type = H5I_get_type(map_id);
+ map_args.specific.args.del.key_mem_type_id = key_mem_type_id;
+ map_args.specific.args.del.key = key;
+ vol_cb_args.op_type = H5VL_MAP_SPECIFIC;
+ vol_cb_args.args = &map_args;
/* Delete the key/value pair */
- if (H5VL_optional(vol_obj, H5VL_MAP_SPECIFIC, dxpl_id, H5_REQUEST_NULL, &loc_params, H5VL_MAP_DELETE,
- key_mem_type_id, key) < 0)
+ if (H5VL_optional(vol_obj, &vol_cb_args, dxpl_id, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTSET, FAIL, "unable to delete key/value pair")
done:
diff --git a/src/H5MF.c b/src/H5MF.c
index 16da9e6..66bf823 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -542,7 +542,7 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type)
H5AC_set_ring(fsm_ring, &orig_ring);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC);
+ HDfprintf(stderr, "%s: Before deleting free space manager\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Delete free space manager for this type */
@@ -597,7 +597,7 @@ H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type)
HDassert(f->shared->fs_state[type] != H5F_FS_STATE_CLOSED);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Before closing free space manager\n", FUNC);
+ HDfprintf(stderr, "%s: Before closing free space manager\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Close an existing free space structure for the file */
@@ -653,7 +653,7 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio
H5AC_set_ring(fsm_ring, &orig_ring);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: adding node, node->sect_info.addr = %a, node->sect_info.size = %Hu\n", FUNC,
+ HDfprintf(stderr, "%s: adding node, node->sect_info.addr = %a, node->sect_info.size = %Hu\n", __func__,
node->sect_info.addr, node->sect_info.size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Add the section */
@@ -706,7 +706,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "error locating free space in file")
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: section found = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: section found = %t\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Check for actually finding section */
@@ -721,7 +721,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h
/* Check for eliminating the section */
if (node->sect_info.size == size) {
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: freeing node\n", FUNC);
+ HDfprintf(stderr, "%s: freeing node\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Free section node */
@@ -734,7 +734,8 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h
node->sect_info.size -= size;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: re-adding node, node->sect_info.size = %Hu\n", FUNC, node->sect_info.size);
+ HDfprintf(stderr, "%s: re-adding node, node->sect_info.size = %Hu\n", __func__,
+ node->sect_info.size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Re-add the section to the free-space manager */
@@ -777,7 +778,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, HADDR_UNDEF)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size);
+ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", __func__, (unsigned)alloc_type, size);
#endif /* H5MF_ALLOC_DEBUG */
/* check arguments */
@@ -789,7 +790,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Check 1.0\n", FUNC);
+ HDfprintf(stderr, "%s: Check 1.0\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Set the ring type in the API context */
@@ -826,7 +827,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
/* If no space is found from the free-space manager, continue further action */
if (!H5F_addr_defined(ret_value)) {
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Check 2.0\n", FUNC);
+ HDfprintf(stderr, "%s: Check 2.0\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
if (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) {
HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN);
@@ -841,7 +842,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
} /* end if */
HDassert(H5F_addr_defined(ret_value));
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Check 3.0\n", FUNC);
+ HDfprintf(stderr, "%s: Check 3.0\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
done:
@@ -850,7 +851,7 @@ done:
H5AC_set_ring(orig_ring, NULL);
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size);
+ HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", __func__, ret_value, size);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
H5MF__sects_dump(f, stderr);
@@ -890,7 +891,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
FUNC_ENTER_STATIC
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size);
+ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", __func__, (unsigned)alloc_type, size);
#endif /* H5MF_ALLOC_DEBUG */
H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &ptype);
@@ -987,7 +988,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
done:
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size);
+ HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", __func__, ret_value, size);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
H5MF__sects_dump(f, stderr);
@@ -1033,7 +1034,7 @@ H5MF_alloc_tmp(H5F_t *f, hsize_t size)
FUNC_ENTER_NOAPI(HADDR_UNDEF)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: size = %Hu\n", FUNC, size);
+ HDfprintf(stderr, "%s: size = %Hu\n", __func__, size);
#endif /* H5MF_ALLOC_DEBUG */
/* check args */
@@ -1085,8 +1086,8 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type,
- addr, size);
+ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", __func__,
+ (unsigned)alloc_type, addr, size);
#endif /* H5MF_ALLOC_DEBUG */
/* check arguments */
@@ -1135,13 +1136,13 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
* space is at the end of the file
*/
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: fs_addr = %a\n", FUNC, f->shared->fs_addr[fs_type]);
+ HDfprintf(stderr, "%s: fs_addr = %a\n", __func__, f->shared->fs_addr[fs_type]);
#endif /* H5MF_ALLOC_DEBUG_MORE */
if (!H5F_addr_defined(f->shared->fs_addr[fs_type])) {
htri_t status; /* "can absorb" status for section into */
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Trying to avoid starting up free space manager\n", FUNC);
+ HDfprintf(stderr, "%s: Trying to avoid starting up free space manager\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Try to shrink the file or absorb the block into a block aggregator */
if ((status = H5MF_try_shrink(f, alloc_type, addr, size)) < 0)
@@ -1151,7 +1152,8 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
HGOTO_DONE(SUCCEED)
else if (size < f->shared->fs_threshold) {
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", FUNC, addr, size);
+ HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", __func__, addr,
+ size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
HGOTO_DONE(SUCCEED)
} /* end else-if */
@@ -1168,7 +1170,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
*/
if (f->shared->fs_state[fs_type] == H5F_FS_STATE_DELETING || !H5F_HAVE_FREE_SPACE_MANAGER(f)) {
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", FUNC, addr, size);
+ HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", __func__, addr, size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
HGOTO_DONE(SUCCEED)
} /* end if */
@@ -1191,7 +1193,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
HDassert(f->shared->fs_man[fs_type]);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", FUNC);
+ HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Add to the free space for the file */
@@ -1200,7 +1202,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
node = NULL;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC);
+ HDfprintf(stderr, "%s: After H5FS_sect_add()\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
} /* end if */
else {
@@ -1233,7 +1235,7 @@ done:
HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
H5MF__sects_dump(f, stderr);
@@ -1277,8 +1279,8 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_requested = %Hu\n", FUNC,
- (unsigned)alloc_type, addr, size, extra_requested);
+ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_requested = %Hu\n",
+ __func__, (unsigned)alloc_type, addr, size, extra_requested);
#endif /* H5MF_ALLOC_DEBUG */
/* Sanity check */
@@ -1330,7 +1332,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi
if ((ret_value = H5F__try_extend(f, map_type, end, extra_requested + frag_size)) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file")
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: extended = %t\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* If extending at EOA succeeds: */
@@ -1368,7 +1370,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending aggregation block")
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: H5MF__aggr_try_extend = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: H5MF__aggr_try_extend = %t\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
} /* end if */
@@ -1394,7 +1396,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL,
"error extending block in free space manager")
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Try to H5FS_sect_try_extend = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Try to H5FS_sect_try_extend = %t\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
} /* end if */
@@ -1405,7 +1407,8 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi
if (frag_size <= H5F_PGEND_META_THRES(f) && extra_requested <= frag_size)
ret_value = TRUE;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Try to extend into the page end threshold = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Try to extend into the page end threshold = %t\n", __func__,
+ ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
} /* end if */
} /* end if */
@@ -1417,7 +1420,7 @@ done:
H5AC_set_ring(orig_ring, NULL);
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
H5MF__sects_dump(f, stderr);
@@ -1442,18 +1445,18 @@ done:
htri_t
H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
{
- H5MF_free_section_t * node = NULL; /* Free space section pointer */
- H5MF_sect_ud_t udata; /* User data for callback */
- H5FS_section_class_t *sect_cls; /* Section class */
- H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
- H5F_mem_page_t fs_type; /* Free space type */
- htri_t ret_value = FALSE; /* Return value */
+ H5MF_free_section_t * node = NULL; /* Free space section pointer */
+ H5MF_sect_ud_t udata; /* User data for callback */
+ const H5FS_section_class_t *sect_cls; /* Section class */
+ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
+ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
+ H5F_mem_page_t fs_type; /* Free space type */
+ htri_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type,
- addr, size);
+ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", __func__,
+ (unsigned)alloc_type, addr, size);
#endif /* H5MF_ALLOC_DEBUG */
/* check arguments */
@@ -1509,7 +1512,7 @@ done:
HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG */
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5MF_try_shrink() */
@@ -1533,7 +1536,7 @@ H5MF_close(H5F_t *f)
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering\n", FUNC);
+ HDfprintf(stderr, "%s: Entering\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
/* check args */
@@ -1551,7 +1554,7 @@ H5MF_close(H5F_t *f)
done:
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving\n", FUNC);
+ HDfprintf(stderr, "%s: Leaving\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5MF_close() */
@@ -1577,7 +1580,7 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type)
FUNC_ENTER_STATIC
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering\n", FUNC);
+ HDfprintf(stderr, "%s: Entering\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
/* check args */
@@ -1589,7 +1592,7 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type)
HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %a\n", FUNC,
+ HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %a\n", __func__,
(unsigned)type, f->shared->fs_man[type], (unsigned)type, f->shared->fs_addr[type]);
#endif /* H5MF_ALLOC_DEBUG_MORE */
@@ -1599,7 +1602,7 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager")
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Check 2.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %a\n", FUNC,
+ HDfprintf(stderr, "%s: Check 2.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %a\n", __func__,
(unsigned)type, f->shared->fs_man[type], (unsigned)type, f->shared->fs_addr[type]);
#endif /* H5MF_ALLOC_DEBUG_MORE */
@@ -1610,7 +1613,7 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type)
done:
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving\n", FUNC);
+ HDfprintf(stderr, "%s: Leaving\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5MF__close_delete() */
@@ -1639,7 +1642,7 @@ H5MF_try_close(H5F_t *f)
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering\n", FUNC);
+ HDfprintf(stderr, "%s: Entering\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
/* check args */
@@ -1718,7 +1721,7 @@ done:
H5AC_set_ring(orig_ring, NULL);
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving\n", FUNC);
+ HDfprintf(stderr, "%s: Leaving\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* H5MF_try_close() */
@@ -1746,7 +1749,7 @@ H5MF__close_aggrfs(H5F_t *f)
FUNC_ENTER_STATIC
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering\n", FUNC);
+ HDfprintf(stderr, "%s: Entering\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
/* check args */
@@ -1884,7 +1887,7 @@ done:
H5AC_set_ring(orig_ring, NULL);
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving\n", FUNC);
+ HDfprintf(stderr, "%s: Leaving\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5MF__close_aggrfs() */
@@ -1912,7 +1915,7 @@ H5MF__close_pagefs(H5F_t *f)
FUNC_ENTER_STATIC
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Entering\n", FUNC);
+ HDfprintf(stderr, "%s: Entering\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
/* check args */
@@ -2059,7 +2062,7 @@ done:
H5AC_set_ring(orig_ring, NULL);
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Leaving\n", FUNC);
+ HDfprintf(stderr, "%s: Leaving\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5MF__close_pagefs() */
@@ -2323,15 +2326,15 @@ done:
* Purpose: To retrieve free-space section information for
* paged or non-paged aggregation
*
- * Return: Success: Number of free sections
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Vailin Choi; Dec 2012
*
*-------------------------------------------------------------------------
*/
-ssize_t
-H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info)
+herr_t
+H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info,
+ size_t *sect_count)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
@@ -2340,9 +2343,9 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t
H5MF_sect_iter_ud_t sect_udata; /* User data for callback */
H5F_mem_page_t start_type, end_type; /* Memory types to iterate over */
H5F_mem_page_t ty; /* Memory type for iteration */
- ssize_t ret_value = -1; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, (-1))
+ FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
/* check args */
HDassert(f);
@@ -2404,7 +2407,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t
if (!f->shared->fs_man[ty] && H5F_addr_defined(f->shared->fs_addr[ty])) {
if (H5MF__open_fstype(f, ty) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, (-1), "can't open the free space manager")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager")
HDassert(f->shared->fs_man[ty]);
fs_started = TRUE;
} /* end if */
@@ -2412,7 +2415,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t
/* Check if there's free space sections of this type */
if (f->shared->fs_man[ty])
if (H5MF__get_free_sects(f, f->shared->fs_man[ty], &sect_udata, &nums) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, (-1),
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL,
"can't get section info for the free space manager")
/* Increment total # of sections */
@@ -2421,13 +2424,13 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t
/* Close the free space manager of this type, if we started it here */
if (fs_started)
if (H5MF__close_fstype(f, ty) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, (-1), "can't close file free space")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, FAIL, "can't close file free space")
if ((H5F_PAGED_AGGR(f)) && (type != H5FD_MEM_DEFAULT))
ty = (H5F_mem_page_t)(ty + H5FD_MEM_NTYPES - 2);
} /* end for */
- /* Set return value */
- ret_value = (ssize_t)total_sects;
+ /* Set value to return */
+ *sect_count = total_sects;
done:
/* Reset the ring in the API context */
diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c
index 68cd263..77345c9 100644
--- a/src/H5MFaggr.c
+++ b/src/H5MFaggr.c
@@ -92,7 +92,7 @@ H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
FUNC_ENTER_NOAPI(HADDR_UNDEF)
#ifdef H5MF_AGGR_DEBUG
- HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size);
+ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", __func__, (unsigned)alloc_type, size);
#endif /* H5MF_AGGR_DEBUG */
/* check arguments */
@@ -120,7 +120,7 @@ H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
done:
#ifdef H5MF_AGGR_DEBUG
- HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size);
+ HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", __func__, ret_value, size);
#endif /* H5MF_AGGR_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
@@ -150,7 +150,7 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F
FUNC_ENTER_STATIC
#ifdef H5MF_AGGR_DEBUG
- HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
+ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", __func__, (unsigned)type, size);
#endif /* H5MF_AGGR_DEBUG */
/* check args */
@@ -199,7 +199,8 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F
H5FD_mem_t alloc_type, other_alloc_type; /* Current aggregator & 'other' aggregator types */
#ifdef H5MF_AGGR_DEBUG
- HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_size, aggr->size);
+ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", __func__, aggr->addr, aggr->tot_size,
+ aggr->size);
#endif /* H5MF_AGGR_DEBUG */
/* Turn off alignment if allocation < threshold */
@@ -267,7 +268,7 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F
/* Allocate another block */
#ifdef H5MF_AGGR_DEBUG
- HDfprintf(stderr, "%s: Allocating block\n", FUNC);
+ HDfprintf(stderr, "%s: Allocating block\n", __func__);
#endif /* H5MF_AGGR_DEBUG */
if (aggr_frag_size > (ext_size - size))
@@ -387,7 +388,7 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F
done:
#ifdef H5MF_AGGR_DEBUG
- HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: ret_value = %a\n", __func__, ret_value);
#endif /* H5MF_AGGR_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5MF__aggr_alloc() */
@@ -722,7 +723,7 @@ done:
tmp_addr = aggr->addr;
tmp_size = aggr->size;
#ifdef H5MF_AGGR_DEBUG
- HDfprintf(stderr, "%s: tmp_addr = %a, tmp_size = %Hu\n", FUNC, tmp_addr, tmp_size);
+ HDfprintf(stderr, "%s: tmp_addr = %a, tmp_size = %Hu\n", __func__, tmp_addr, tmp_size);
#endif /* H5MF_AGGR_DEBUG */
/* Reset aggregator block information */
diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c
index 7b89fd8..6ccbe78 100644
--- a/src/H5MFdbg.c
+++ b/src/H5MFdbg.c
@@ -210,7 +210,7 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG)
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC);
+ HDfprintf(stderr, "%s: Dumping file free space sections\n", __func__);
#endif /* H5MF_ALLOC_DEBUG */
/*
@@ -223,7 +223,7 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %" PRIuHADDR "\n", FUNC, eoa);
+ HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %" PRIuHADDR "\n", __func__, eoa);
#endif /* H5MF_ALLOC_DEBUG */
if (H5F_PAGED_AGGR(f)) { /* File space paging */
@@ -267,7 +267,7 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr,
"%s: ma_addr = %" PRIuHADDR ", ma_size = %" PRIuHSIZE ", end of ma = %" PRIuHADDR "\n",
- FUNC, ma_addr, ma_size, (haddr_t)((ma_addr + ma_size) - 1));
+ __func__, ma_addr, ma_size, (haddr_t)((ma_addr + ma_size) - 1));
#endif /* H5MF_ALLOC_DEBUG */
/* Retrieve 'small data' aggregator info, if available */
@@ -275,7 +275,7 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr,
"%s: sda_addr = %" PRIuHADDR ", sda_size = %" PRIuHSIZE ", end of sda = %" PRIuHADDR "\n",
- FUNC, sda_addr, sda_size, (haddr_t)((sda_addr + sda_size) - 1));
+ __func__, sda_addr, sda_size, (haddr_t)((sda_addr + sda_size) - 1));
#endif /* H5MF_ALLOC_DEBUG */
/* Iterate over all the free space types that have managers and dump each free list's space */
@@ -318,7 +318,7 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
} /* end else */
done:
- HDfprintf(stderr, "%s: Done dumping file free space sections\n", FUNC);
+ HDfprintf(stderr, "%s: Done dumping file free space sections\n", __func__);
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5MF__sects_dump() */
#endif /* H5MF_ALLOC_DEBUG_DUMP */
diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h
index 4e7717d..f34c73e 100644
--- a/src/H5MFpkg.h
+++ b/src/H5MFpkg.h
@@ -168,9 +168,9 @@ typedef struct H5MF_fs_t {
/*****************************/
/* H5MF single section inherits serializable properties from H5FS_section_class_t */
-H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1];
-H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1];
-H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1];
+H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1];
+H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1];
+H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1];
/******************************/
/* Package Private Prototypes */
diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h
index 292e85c..65e6e94 100644
--- a/src/H5MFprivate.h
+++ b/src/H5MFprivate.h
@@ -56,7 +56,8 @@ H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hsize_t size);
H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size);
H5_DLL herr_t H5MF_try_extend(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size, hsize_t extra_requested);
H5_DLL htri_t H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size);
-H5_DLL ssize_t H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info);
+H5_DLL herr_t H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info,
+ size_t *sect_count);
/* File 'temporary' space allocation routines */
H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size);
diff --git a/src/H5MFsection.c b/src/H5MFsection.c
index 8d4704e..69b2ca0 100644
--- a/src/H5MFsection.c
+++ b/src/H5MFsection.c
@@ -81,7 +81,7 @@ static herr_t H5MF__sect_large_shrink(H5FS_section_info_t **_sect, void *udata);
/*********************/
/* Class info for "simple" free space sections */
-H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{
+const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{
/* Class variables */
H5MF_FSPACE_SECT_SIMPLE, /* Section type */
0, /* Extra serialized size */
@@ -107,7 +107,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{
}};
/* Class info for "small" free space sections */
-H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{
+const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{
/* Class variables */
H5MF_FSPACE_SECT_SMALL, /* Section type */
0, /* Extra serialized size */
@@ -133,7 +133,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{
}};
/* Class info for "large" free space sections */
-H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{
+const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{
/* Class variables */
H5MF_FSPACE_SECT_LARGE, /* Section type */
0, /* Extra serialized size */
@@ -472,7 +472,7 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* Set the shrinking type */
udata->shrink = H5MF_SHRINK_EOA;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", FUNC, sect->sect_info.addr,
+ HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", __func__, sect->sect_info.addr,
sect->sect_info.size, eoa);
#endif /* H5MF_ALLOC_DEBUG_MORE */
@@ -496,7 +496,7 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* Set the aggregator to operate on */
udata->aggr = &(udata->f->shared->meta_aggr);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: section {%a, %Hu}, adjoins metadata aggregator\n", FUNC,
+ HDfprintf(stderr, "%s: section {%a, %Hu}, adjoins metadata aggregator\n", __func__,
sect->sect_info.addr, sect->sect_info.size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
@@ -517,7 +517,7 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* Set the aggregator to operate on */
udata->aggr = &(udata->f->shared->sdata_aggr);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: section {%a, %Hu}, adjoins small data aggregator\n", FUNC,
+ HDfprintf(stderr, "%s: section {%a, %Hu}, adjoins small data aggregator\n", __func__,
sect->sect_info.addr, sect->sect_info.size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
@@ -625,7 +625,7 @@ H5MF__sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata)
FUNC_ENTER_STATIC
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Entering, section {%a, %Hu}\n", FUNC, (*sect)->sect_info.addr,
+ HDfprintf(stderr, "%s: Entering, section {%a, %Hu}\n", __func__, (*sect)->sect_info.addr,
(*sect)->sect_info.size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
@@ -646,14 +646,14 @@ H5MF__sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata)
*flags &= (unsigned)~H5FS_ADD_RETURNED_SPACE;
*flags |= H5FS_PAGE_END_NO_ADD;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: section is dropped\n", FUNC);
+ HDfprintf(stderr, "%s: section is dropped\n", __func__);
#endif /* H5MF_ALLOC_DEBUG_MORE */
} /* end if */
/* Adjust the section if it is not at page end but its size + prem is at page end */
else if (prem <= H5F_PGEND_META_THRES(udata->f)) {
(*sect)->sect_info.size += prem;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: section is adjusted {%a, %Hu}\n", FUNC, (*sect)->sect_info.addr,
+ HDfprintf(stderr, "%s: section is adjusted {%a, %Hu}\n", __func__, (*sect)->sect_info.addr,
(*sect)->sect_info.size);
#endif /* H5MF_ALLOC_DEBUG_MORE */
} /* end if */
@@ -702,7 +702,7 @@ H5MF__sect_small_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section
ret_value = FALSE;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
FUNC_LEAVE_NOAPI(ret_value)
@@ -806,7 +806,7 @@ H5MF__sect_large_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section
ret_value = H5F_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr);
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
+ HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", __func__, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
FUNC_LEAVE_NOAPI(ret_value)
@@ -894,7 +894,7 @@ H5MF__sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* Set the shrinking type */
udata->shrink = H5MF_SHRINK_EOA;
#ifdef H5MF_ALLOC_DEBUG_MORE
- HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", FUNC, sect->sect_info.addr,
+ HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", __func__, sect->sect_info.addr,
sect->sect_info.size, eoa);
#endif /* H5MF_ALLOC_DEBUG_MORE */
diff --git a/src/H5MM.c b/src/H5MM.c
index d17db16..b4447f6 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -449,11 +449,17 @@ H5MM_xstrdup(const char *s)
FUNC_ENTER_NOAPI(NULL)
+#if defined H5_MEMORY_ALLOC_SANITY_CHECK
if (s) {
if (NULL == (ret_value = (char *)H5MM_malloc(HDstrlen(s) + 1)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDstrcpy(ret_value, s);
- } /* end if */
+ }
+#else
+ if (s)
+ if (NULL == (ret_value = HDstrdup(s)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "string duplication failed")
+#endif
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -483,10 +489,15 @@ H5MM_strdup(const char *s)
FUNC_ENTER_NOAPI(NULL)
if (!s)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "null string")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "NULL string not allowed")
+#if defined H5_MEMORY_ALLOC_SANITY_CHECK
if (NULL == (ret_value = (char *)H5MM_malloc(HDstrlen(s) + 1)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDstrcpy(ret_value, s);
+#else
+ if (NULL == (ret_value = HDstrdup(s)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "string duplication failed")
+#endif
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h
index ebfb377..70ac644 100644
--- a/src/H5MMpublic.h
+++ b/src/H5MMpublic.h
@@ -29,8 +29,13 @@
#include "H5public.h"
/* These typedefs are currently used for VL datatype allocation/freeing */
+//! <!-- [H5MM_allocate_t_snip] -->
typedef void *(*H5MM_allocate_t)(size_t size, void *alloc_info);
+//! <!-- [H5MM_allocate_t_snip] -->
+
+//! <!-- [H5MM_free_t_snip] -->
typedef void (*H5MM_free_t)(void *mem, void *free_info);
+//! <!-- [H5MM_free_t_snip] -->
#ifdef __cplusplus
extern "C" {
diff --git a/src/H5Mmodule.h b/src/H5Mmodule.h
index 8b4f11f..848f63f 100644
--- a/src/H5Mmodule.h
+++ b/src/H5Mmodule.h
@@ -26,4 +26,49 @@
#define H5_MY_PKG_ERR H5E_MAP
#define H5_MY_PKG_INIT YES
+/**\defgroup H5M H5M
+ *
+ * \todo Describe the map life cycle.
+ *
+ * \details \Bold{The interface can only be used with the HDF5 VOL connectors that
+ * implement map objects.} The native HDF5 library does not support this
+ * feature.
+ *
+ * While the HDF5 data model is a flexible way to store data, some
+ * applications require a more general way to index information. HDF5
+ * effectively uses key-value stores internally for a variety of
+ * purposes, but it does not expose a generic key-value store to the
+ * API. The Map APIs provide this capability to the HDF5 applications
+ * in the form of HDF5 map objects. These Map objects contain
+ * application-defined key-value stores, to which key-value pairs can
+ * be added, and from which values can be retrieved by key.
+ *
+ * HDF5 VOL connectors with support for map objects:
+ * - DAOS
+ *
+ * \par Example:
+ * \code
+ * hid_t file_id, fapl_id, map_id, vls_type_id;
+ * const char *names[2] = ["Alice", "Bob"];
+ * uint64_t IDs[2] = [25385486, 34873275];
+ * uint64_t val_out;
+ *
+ * <HDF5 VOL setup code ....>
+ *
+ * vls_type_id = H5Tcopy(H5T_C_S1);
+ * H5Tset_size(vls_type_id, H5T_VARIABLE);
+ * file_id = H5Fcreate("file.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ * map_id = H5Mcreate(file_id, "map", vls_type_id, H5T_NATIVE_UINT64, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ * H5Mput(map_id, vls_type_id, &names[0], H5T_NATIVE_UINT64, &IDs[0], H5P_DEFAULT);
+ * H5Mput(map_id, vls_type_id, &names[1], H5T_NATIVE_UINT64, &IDs[1], H5P_DEFAULT);
+ * H5Mget(map_id, vls_type_id, &names[0], H5T_NATIVE_UINT64, &val_out, H5P_DEFAULT);
+ * if(val_out != IDs[0])
+ * ERROR;
+ * H5Mclose(map_id);
+ * H5Tclose(vls_type_id);
+ * H5Fclose(file_id);
+ * \endcode
+ *
+ */
+
#endif /* H5Dmodule_H */
diff --git a/src/H5Mpkg.h b/src/H5Mpkg.h
index b31beeb..be6749b 100644
--- a/src/H5Mpkg.h
+++ b/src/H5Mpkg.h
@@ -44,4 +44,4 @@
/* Package Private Prototypes */
/******************************/
-#endif /*_H5Dpkg_H*/
+#endif /*H5Dpkg_H*/
diff --git a/src/H5Mprivate.h b/src/H5Mprivate.h
index 1a2524e..e62434a 100644
--- a/src/H5Mprivate.h
+++ b/src/H5Mprivate.h
@@ -21,10 +21,9 @@
#include "H5Mpublic.h"
/* Private headers needed by this file */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Sprivate.h" /* Dataspaces */
-#include "H5Zprivate.h" /* Data filters */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Sprivate.h" /* Dataspaces */
+#include "H5Zprivate.h" /* Data filters */
/**************************/
/* Library Private Macros */
diff --git a/src/H5Mpublic.h b/src/H5Mpublic.h
index 4d8bef4..3f94edb 100644
--- a/src/H5Mpublic.h
+++ b/src/H5Mpublic.h
@@ -25,6 +25,7 @@
/* Public headers needed by this file */
#include "H5public.h"
#include "H5Ipublic.h"
+#include "H5VLconnector.h"
/*****************/
/* Public Macros */
@@ -61,8 +62,121 @@ typedef enum H5VL_map_specific_t {
H5VL_MAP_DELETE /* H5Mdelete */
} H5VL_map_specific_t;
-/* Callback for H5Miterate() */
+//! <!-- [H5M_iterate_t_snip] -->
+/**
+ * Callback for H5Miterate()
+ */
typedef herr_t (*H5M_iterate_t)(hid_t map_id, const void *key, void *op_data);
+//! <!-- [H5M_iterate_t_snip] -->
+
+/* Parameters for map operations */
+typedef union H5VL_map_args_t {
+ /* H5VL_MAP_CREATE */
+ struct {
+ H5VL_loc_params_t loc_params; /* Location parameters for object */
+ const char * name; /* Name of new map object */
+ hid_t lcpl_id; /* Link creation property list for map */
+ hid_t key_type_id; /* Datatype for map keys */
+ hid_t val_type_id; /* Datatype for map values */
+ hid_t mcpl_id; /* Map creation property list */
+ hid_t mapl_id; /* Map access property list */
+ void * map; /* Pointer to newly created map object (OUT) */
+ } create;
+
+ /* H5VL_MAP_OPEN */
+ struct {
+ H5VL_loc_params_t loc_params; /* Location parameters for object */
+ const char * name; /* Name of new map object */
+ hid_t mapl_id; /* Map access property list */
+ void * map; /* Pointer to newly created map object (OUT) */
+ } open;
+
+ /* H5VL_MAP_GET_VAL */
+ struct {
+ hid_t key_mem_type_id; /* Memory datatype for key */
+ const void *key; /* Pointer to key */
+ hid_t value_mem_type_id; /* Memory datatype for value */
+ void * value; /* Buffer for value (OUT) */
+ } get_val;
+
+ /* H5VL_MAP_EXISTS */
+ struct {
+ hid_t key_mem_type_id; /* Memory datatype for key */
+ const void *key; /* Pointer to key */
+ hbool_t exists; /* Flag indicating whether key exists in map (OUT) */
+ } exists;
+
+ /* H5VL_MAP_PUT */
+ struct {
+ hid_t key_mem_type_id; /* Memory datatype for key */
+ const void *key; /* Pointer to key */
+ hid_t value_mem_type_id; /* Memory datatype for value */
+ const void *value; /* Pointer to value */
+ } put;
+
+ /* H5VL_MAP_GET */
+ struct {
+ H5VL_map_get_t get_type; /* 'get' operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_MAP_GET_MAPL */
+ struct {
+ hid_t mapl_id; /* Map access property list ID (OUT) */
+ } get_mapl;
+
+ /* H5VL_MAP_GET_MCPL */
+ struct {
+ hid_t mcpl_id; /* Map creation property list ID (OUT) */
+ } get_mcpl;
+
+ /* H5VL_MAP_GET_KEY_TYPE */
+ struct {
+ hid_t type_id; /* Datatype ID for map's keys (OUT) */
+ } get_key_type;
+
+ /* H5VL_MAP_GET_VAL_TYPE */
+ struct {
+ hid_t type_id; /* Datatype ID for map's values (OUT) */
+ } get_val_type;
+
+ /* H5VL_MAP_GET_COUNT */
+ struct {
+ hsize_t count; /* # of KV pairs in map (OUT) */
+ } get_count;
+ } args;
+ } get;
+
+ /* H5VL_MAP_SPECIFIC */
+ struct {
+ H5VL_map_specific_t specific_type; /* 'specific' operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_MAP_ITER */
+ struct {
+ H5VL_loc_params_t loc_params; /* Location parameters for object */
+ hsize_t idx; /* Start/end iteration index (IN/OUT) */
+ hid_t key_mem_type_id; /* Memory datatype for key */
+ H5M_iterate_t op; /* Iteration callback routine */
+ void * op_data; /* Pointer to callback context */
+ } iterate;
+
+ /* H5VL_MAP_DELETE */
+ struct {
+ H5VL_loc_params_t loc_params; /* Location parameters for object */
+ hid_t key_mem_type_id; /* Memory datatype for key */
+ const void * key; /* Pointer to key */
+ } del;
+ } args;
+ } specific;
+
+ /* H5VL_MAP_OPTIONAL */
+ /* Unused */
+
+ /* H5VL_MAP_CLOSE */
+ /* No args */
+} H5VL_map_args_t;
/********************/
/* Public Variables */
@@ -81,40 +195,400 @@ extern "C" {
*/
#ifdef H5_HAVE_MAP_API
+/**
+ * \ingroup H5M
+ *
+ * \brief Creates a map object
+ *
+ * \fgdta_loc_id
+ * \param[in] name Map object name
+ * \type_id{key_type_id}
+ * \type_id{val_type_id}
+ * \lcpl_id
+ * \mcpl_id
+ * \mapl_id
+ * \returns \hid_t{map object}
+ *
+ * \details H5Mcreate() creates a new map object for storing key-value
+ * pairs. The in-file datatype for keys is defined by \p key_type_id
+ * and the in-file datatype for values is defined by \p val_type_id. \p
+ * loc_id specifies the location to create the the map object and \p
+ * name specifies the name of the link to the map object relative to
+ * \p loc_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL hid_t H5Mcreate(hid_t loc_id, const char *name, hid_t key_type_id, hid_t val_type_id, hid_t lcpl_id,
hid_t mcpl_id, hid_t mapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Mcreate}
+ */
H5_DLL hid_t H5Mcreate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t key_type_id, hid_t val_type_id, hid_t lcpl_id,
hid_t mcpl_id, hid_t mapl_id, hid_t es_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief
+ *
+ * \details
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL hid_t H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id, hid_t mapl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Opens a map object
+ *
+ * \fgdta_loc_id{loc_id}
+ * \param[in] name Map object name relative to \p loc_id
+ * \mapl_id
+ * \returns \hid_t{map object}
+ *
+ * \details H5Mopen() finds a map object specified by \p name under the location
+ * specified by \p loc_id. The map object should be close with
+ * H5Mclose() when the application is not longer interested in
+ * accessing it.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL hid_t H5Mopen(hid_t loc_id, const char *name, hid_t mapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Mopen}
+ */
H5_DLL hid_t H5Mopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t mapl_id, hid_t es_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Terminates access to a map object
+ *
+ * \map_id
+ * \returns \herr_t
+ *
+ * \details H5Mclose() closes access to a map object specified by \p map_id and
+ * releases resources used by it.
+ *
+ * It is illegal to subsequently use that same map identifier in calls
+ * to other map functions.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mclose(hid_t map_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Mclose}
+ */
H5_DLL herr_t H5Mclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t map_id,
hid_t es_id);
-H5_DLL hid_t H5Mget_key_type(hid_t map_id);
-H5_DLL hid_t H5Mget_val_type(hid_t map_id);
-H5_DLL hid_t H5Mget_create_plist(hid_t map_id);
-H5_DLL hid_t H5Mget_access_plist(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets key datatype for a map object
+ *
+ * \map_id
+ * \returns \hid_t{datatype}
+ *
+ * \details H5Mget_key_type() retrieves key datatype as stored in the file for a
+ * map object specified by \p map_id and returns identifier for the
+ * datatype.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_key_type(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets value datatype for a map object
+ *
+ * \map_id
+ * \returns \hid_t{datatype}
+ *
+ * \details H5Mget_val_type() retrieves value datatype as stored in the file for
+ * a map object specified by \p map_id and returns identifier for the
+ * datatype .
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_val_type(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets creation property list for a map object
+ *
+ * \map_id
+ * \returns \hid_t{map creation property list}
+ *
+ * \details H5Mget_create_plist() returns an identifier for a copy of the
+ * creation property list for a map object specified by \p map_id.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_create_plist(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets access property list for a map object
+ *
+ * \map_id
+ * \returns \hid_t{map access property list}
+ *
+ * \details H5Mget_access_plist() returns an identifier for a copy of the access
+ * property list for a map object specified by \p map_id.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_access_plist(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Retrieves the number of key-value pairs in a map object
+ *
+ * \map_id
+ * \param[out] count The number of key-value pairs stored in the map object
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mget_count() retrieves the number of key-value pairs stored in a
+ * map specified by map_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mget_count(hid_t map_id, hsize_t *count, hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Adds a key-value pair to a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \type_id{val_mem_type_id}
+ * \param[in] value Pointer to value buffer
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mput() adds a key-value pair to a map object specified by \p
+ * map_id, or updates the value for the specified key if one was set
+ * previously.
+ *
+ * \p key_mem_type_id and \p val_mem_type_id specify the datatypes for
+ * the provided key and value buffers, and if different from those used
+ * to create the map object, the key and value will be internally
+ * converted to the datatypes for the map object.
+ *
+ * Any further options can be specified through the property list
+ * \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mput(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id,
const void *value, hid_t dxpl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Mput}
+ */
H5_DLL herr_t H5Mput_async(const char *app_file, const char *app_func, unsigned app_line, hid_t map_id,
hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, const void *value,
hid_t dxpl_id, hid_t es_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Retrieves a key-value pair from a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \type_id{val_mem_type_id}
+ * \param[out] value Pointer to value buffer
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mget() retrieves from a map object specified by \p map_id, the
+ * value associated with the provided key \p key. \p key_mem_type_id
+ * and \p val_mem_type_id specify the datatypes for the provided key
+ * and value buffers. If if the datatype specified by \p
+ * key_mem_type_id is different from that used to create the map object
+ * the key will be internally converted to the datatype for the map
+ * object for the query, and if the datatype specified by \p
+ * val_mem_type_id is different from that used to create the map object
+ * the returned value will be converted to have a datatype as specified
+ * by \p val_mem_type_id before the function returns.
+ *
+ * Any further options can be specified through the property list
+ * \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mget(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, void *value,
hid_t dxpl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Mget}
+ */
H5_DLL herr_t H5Mget_async(const char *app_file, const char *app_func, unsigned app_line, hid_t map_id,
hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, void *value,
hid_t dxpl_id, hid_t es_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Checks if provided key exists in a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \param[out] exists Pointer to a buffer to return the existence status
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mexists() checks if the provided key is stored in the map object
+ * specified by \p map_id. If \p key_mem_type_id is different from that
+ * used to create the map object the key will be internally converted
+ * to the datatype for the map object for the query.
+ *
+ * Any further options can be specified through the property list
+ * \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists, hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Iterates over all key-value pairs in a map object
+ *
+ * \map_id
+ * \param[in,out] idx iteration index
+ * \type_id{key_mem_type_id}
+ * \param[in] op User-defined iterator function
+ * \op_data
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Miterate() iterates over all key-value pairs stored in the map
+ * object specified by \p map_id, making the callback specified by \p
+ * op for each. The \p idx parameter is an in/out parameter that may be
+ * used to restart a previously interrupted iteration. At the start of
+ * iteration \p idx should be set to 0, and to restart iteration at the
+ * same location on a subsequent call to H5Miterate(), \p idx should be
+ * the same value as returned by the previous call. Iterate callback is
+ * defined as:
+ * \snippet this H5M_iterate_t_snip
+ * The \p key parameter is the buffer for the key for this iteration,
+ * converted to the datatype specified by \p key_mem_type_id. The \p
+ * op_data parameter is a simple pass through of the value passed to
+ * H5Miterate(), which can be used to store application-defined data for
+ * iteration. A negative return value from this function will cause
+ * H5Miterate() to issue an error, while a positive return value will
+ * cause H5Miterate() to stop iterating and return this value without
+ * issuing an error. A return value of zero allows iteration to continue.
+ *
+ * Any further options can be specified through the property list \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, void *op_data,
hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Iterates over all key-value pairs in a map object
+ *
+ * \loc_id
+ * \param[in] map_name Map object name relative to the location specified by \p loc_id
+ * \param[in,out] idx Iteration index
+ * \type_id{key_mem_type_id}
+ * \param[in] op User-defined iterator function
+ * \op_data
+ * \dxpl_id
+ * \lapl_id
+ * \returns \herr_t
+ *
+ * \details H5Miterate_by_name() iterates over all key-value pairs stored in the
+ * map object specified by \p map_id, making the callback specified by
+ * \p op for each. The \p idx parameter is an in/out parameter that may
+ * be used to restart a previously interrupted iteration. At the start
+ * of iteration \p idx should be set to 0, and to restart iteration at
+ * the same location on a subsequent call to H5Miterate(), \p idx
+ * should be the same value as returned by the previous call. Iterate
+ * callback is defined as:
+ * \snippet this H5M_iterate_t_snip
+ * The\p key parameter is the buffer for the key for this iteration,
+ * converted to the datatype specified by \p key_mem_type_id. The \p
+ * op_data parameter is a simple pass through of the value passed to
+ * H5Miterate(), which can be used to store application-defined data
+ * for iteration. A negative return value from this function will cause
+ * H5Miterate() to issue an error, while a positive return value will cause
+ * H5Miterate() to stop iterating and return this value without issuing an
+ * error. A return value of zero allows iteration to continue.
+ *
+ * Any further options can be specified through the property list \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_mem_type_id,
H5M_iterate_t op, void *op_data, hid_t dxpl_id, hid_t lapl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Deletes a key-value pair from a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mdelete() deletes a key-value pair from the map object specified
+ * by \p map_id. \p key_mem_type_id specifies the datatype for the
+ * provided key buffer key, and if different from that used to create
+ * the map object, the key will be internally converted to the datatype
+ * for the map object.
+ *
+ * Any further options can be specified through the property list \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t dxpl_id);
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -133,6 +607,7 @@ H5_DLL herr_t H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hi
#define H5Mput_async_wrap H5_NO_EXPAND(H5Mput_async)
#define H5Mget_async_wrap H5_NO_EXPAND(H5Mget_async)
#endif /* H5M_MODULE */
+/// \endcond
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
diff --git a/src/H5O.c b/src/H5O.c
index ab39ec0..db3ff31 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -70,7 +70,7 @@ static herr_t H5O__copy_api_common(hid_t src_loc_id, const char *src_name, hid_t
H5VL_object_t **_vol_obj_ptr);
static herr_t H5O__flush_api_common(hid_t obj_id, void **token_ptr, H5VL_object_t **_vol_obj_ptr);
static herr_t H5O__refresh_api_common(hid_t oid, void **token_ptr, H5VL_object_t **_vol_obj_ptr);
-static htri_t H5O__close_check_common(hid_t object_id);
+static htri_t H5O__close_check_type(hid_t object_id);
/*********************/
/* Package Variables */
@@ -112,7 +112,7 @@ H5O__open_api_common(hid_t loc_id, const char *name, hid_t lapl_id, void **token
/* name is checked in this H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
/* Open the object */
@@ -201,7 +201,7 @@ H5Oopen_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on object ID")
@@ -239,7 +239,7 @@ H5O__open_by_idx_api_common(hid_t loc_id, const char *group_name, H5_index_t idx
/* Check args */
/* group_name, idx_type, order are checked in H5VL_setup_idx-args() */
/* Set up object access arguments */
- if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr,
+ if (H5VL_setup_idx_args(loc_id, group_name, idx_type, order, n, FALSE, lapl_id, vol_obj_ptr,
&loc_params) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTSET, H5I_INVALID_HID, "can't set object access arguments")
@@ -334,7 +334,7 @@ H5Oopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_li
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0) {
+ H5ARG_TRACE10(__func__, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HDONE_ERROR(H5E_OHDR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on object ID")
@@ -448,6 +448,7 @@ H5O__copy_api_common(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, c
/* Set the LCPL for the API context */
H5CX_set_lcpl(lcpl_id);
+ /* Setup and check args */
if (H5VL_setup_loc_args(src_loc_id, &vol_obj1, &loc_params1) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments")
@@ -593,7 +594,7 @@ H5Ocopy_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIui*si*siii", app_file, app_func, app_line, src_loc_id, src_name, dst_loc_id, dst_name, ocpypl_id, lcpl_id, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIui*si*siii", app_file, app_func, app_line, src_loc_id, src_name, dst_loc_id, dst_name, ocpypl_id, lcpl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -616,19 +617,23 @@ H5O__flush_api_common(hid_t obj_id, void **token_ptr, H5VL_object_t **_vol_obj_p
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
- /* Check args */
-
+ /* Setup and check args */
if (H5VL_setup_loc_args(obj_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_FLUSH;
+ vol_cb_args.args.flush.obj_id = obj_id;
+
/* Flush the object */
- if (H5VL_object_specific(*vol_obj_ptr, &loc_params, H5VL_OBJECT_FLUSH, H5P_DATASET_XFER_DEFAULT,
- token_ptr, obj_id) < 0)
+ if (H5VL_object_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object")
done:
@@ -695,7 +700,7 @@ H5Oflush_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, obj_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, obj_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -718,19 +723,23 @@ H5O__refresh_api_common(hid_t oid, void **token_ptr, H5VL_object_t **_vol_obj_pt
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
- /* Check args */
-
+ /* Setup and check args */
if (H5VL_setup_loc_args(oid, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_REFRESH;
+ vol_cb_args.args.refresh.obj_id = oid;
+
/* Refresh the object */
- if (H5VL_object_specific(*vol_obj_ptr, &loc_params, H5VL_OBJECT_REFRESH, H5P_DATASET_XFER_DEFAULT,
- token_ptr, oid) < 0)
+ if (H5VL_object_specific(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object")
done:
@@ -797,7 +806,7 @@ H5Orefresh_async(const char *app_file, const char *app_func, unsigned app_line,
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, oid, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, oid, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -829,12 +838,12 @@ done:
herr_t
H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t * vol_obj1 = NULL; /* object of obj_id */
- H5VL_object_t * vol_obj2 = NULL; /* object of new_loc_id */
- H5VL_object_t tmp_vol_obj; /* Temporary object */
- H5VL_loc_params_t loc_params1;
- H5VL_loc_params_t loc_params2;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj1 = NULL; /* object of obj_id */
+ H5VL_object_t * vol_obj2 = NULL; /* object of new_loc_id */
+ H5VL_object_t tmp_vol_obj; /* Temporary object */
+ H5VL_link_create_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t new_loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "ii*sii", obj_id, new_loc_id, new_name, lcpl_id, lapl_id);
@@ -864,36 +873,45 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
- loc_params1.type = H5VL_OBJECT_BY_SELF;
- loc_params1.obj_type = H5I_get_type(obj_id);
-
- loc_params2.type = H5VL_OBJECT_BY_NAME;
- loc_params2.obj_type = H5I_get_type(new_loc_id);
- loc_params2.loc_data.loc_by_name.name = new_name;
- loc_params2.loc_data.loc_by_name.lapl_id = lapl_id;
+ /* Set up new location struct */
+ new_loc_params.type = H5VL_OBJECT_BY_NAME;
+ new_loc_params.obj_type = H5I_get_type(new_loc_id);
+ new_loc_params.loc_data.loc_by_name.name = new_name;
+ new_loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
- if (H5L_SAME_LOC != obj_id)
- /* get the location object */
- if (NULL == (vol_obj1 = H5VL_vol_object(obj_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Get the first location object */
+ if (NULL == (vol_obj1 = H5VL_vol_object(obj_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
if (H5L_SAME_LOC != new_loc_id)
/* get the location object */
if (NULL == (vol_obj2 = H5VL_vol_object(new_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Make sure that the VOL connectors are the same */
- if (vol_obj1 && vol_obj2)
- if (vol_obj1->connector->cls->value != vol_obj2->connector->cls->value)
+ if (vol_obj1 && vol_obj2) {
+ int same_connector = 0;
+
+ /* Check if both objects are associated with the same VOL connector */
+ if (H5VL_cmp_connector_cls(&same_connector, vol_obj1->connector->cls, vol_obj2->connector->cls) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCOMPARE, FAIL, "can't compare connector classes")
+ if (same_connector)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"Objects are accessed through different VOL connectors and can't be linked")
+ } /* end if */
/* Construct a temporary VOL object */
tmp_vol_obj.data = vol_obj2->data;
- tmp_vol_obj.connector = (vol_obj1 != NULL ? vol_obj1->connector : vol_obj2->connector);
+ tmp_vol_obj.connector = vol_obj1->connector;
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_LINK_CREATE_HARD;
+ vol_cb_args.args.hard.curr_obj = vol_obj1->data;
+ vol_cb_args.args.hard.curr_loc_params.type = H5VL_OBJECT_BY_SELF;
+ vol_cb_args.args.hard.curr_loc_params.obj_type = H5I_get_type(obj_id);
/* Create a link to the object */
- if (H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, &loc_params2, lcpl_id, lapl_id,
- H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, vol_obj1->data, &loc_params1) < 0)
+ if (H5VL_link_create(&vol_cb_args, &tmp_vol_obj, &new_loc_params, lcpl_id, lapl_id,
+ H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create link")
done:
@@ -923,9 +941,10 @@ done:
herr_t
H5Oincr_refcount(hid_t object_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED;
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", object_id);
@@ -941,9 +960,13 @@ H5Oincr_refcount(hid_t object_id)
if (H5CX_set_loc(object_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_CHANGE_REF_COUNT;
+ vol_cb_args.args.change_rc.delta = 1;
+
/* Change the object's reference count */
- if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_CHANGE_REF_COUNT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, 1) < 0)
+ if (H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed")
done:
@@ -973,9 +996,10 @@ done:
herr_t
H5Odecr_refcount(hid_t object_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", object_id);
@@ -991,9 +1015,13 @@ H5Odecr_refcount(hid_t object_id)
if (H5CX_set_loc(object_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_CHANGE_REF_COUNT;
+ vol_cb_args.args.change_rc.delta = -1;
+
/* Change the object's reference count */
- if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_CHANGE_REF_COUNT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, -1) < 0)
+ if (H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed")
done:
@@ -1016,9 +1044,11 @@ done:
htri_t
H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- htri_t ret_value = FAIL; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ hbool_t obj_exists = FALSE; /* Whether object exists */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("t", "i*si", loc_id, name, lapl_id);
@@ -1043,11 +1073,18 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id)
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
loc_params.obj_type = H5I_get_type(loc_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_EXISTS;
+ vol_cb_args.args.exists.exists = &obj_exists;
+
/* Check if the object exists */
- if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_EXISTS, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &ret_value) < 0)
+ if (H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name)
+ /* Set return value */
+ ret_value = (htri_t)obj_exists;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Oexists_by_name() */
@@ -1067,9 +1104,10 @@ done:
herr_t
H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo /*out*/, unsigned fields)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixIu", loc_id, oinfo, fields);
@@ -1088,9 +1126,13 @@ H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo /*out*/, unsigned fields)
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_INFO;
+ vol_cb_args.args.get_info.oinfo = oinfo;
+ vol_cb_args.args.get_info.fields = fields;
+
/* Retrieve the object's information */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- oinfo, fields) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get data model info for object")
done:
@@ -1114,8 +1156,9 @@ H5O__get_info_by_name_api_common(hid_t loc_id, const char *name, H5O_info2_t *oi
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
(_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters for object access */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1127,12 +1170,16 @@ H5O__get_info_by_name_api_common(hid_t loc_id, const char *name, H5O_info2_t *oi
/* "name" is checked in H5VL_setup_name_args() */
/* Set up object access arguments */
- if (H5VL_setup_name_args(loc_id, name, H5P_CLS_LACC, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
+ if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, vol_obj_ptr, &loc_params) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_INFO;
+ vol_cb_args.args.get_info.oinfo = oinfo;
+ vol_cb_args.args.get_info.fields = fields;
+
/* Retrieve the object's information */
- if (H5VL_object_get(*vol_obj_ptr, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, token_ptr,
- oinfo, fields) < 0)
+ if (H5VL_object_get(*vol_obj_ptr, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, token_ptr) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get data model info for object")
done:
@@ -1183,14 +1230,13 @@ H5Oget_info_by_name_async(const char *app_file, const char *app_func, unsigned a
hid_t es_id)
{
H5VL_object_t *vol_obj = NULL; /* Object for loc_id */
- void * token = NULL; /* Request token for async operation */
- void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- /* clang-format off */
- H5TRACE9("e", "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id);
- /* clang-format on */
+ H5TRACE9("e", "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id,
+ es_id);
/* Set up request token pointer for asynchronous operation */
if (H5ES_NONE != es_id)
@@ -1204,7 +1250,7 @@ H5Oget_info_by_name_async(const char *app_file, const char *app_func, unsigned a
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE9(FUNC, "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id)) < 0)
+ H5ARG_TRACE9(__func__, "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1230,9 +1276,10 @@ herr_t
H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t n, H5O_info2_t *oinfo /*out*/, unsigned fields, hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id);
@@ -1253,6 +1300,7 @@ H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set location struct fields */
loc_params.type = H5VL_OBJECT_BY_IDX;
loc_params.loc_data.loc_by_idx.name = group_name;
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
@@ -1265,9 +1313,13 @@ H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_INFO;
+ vol_cb_args.args.get_info.oinfo = oinfo;
+ vol_cb_args.args.get_info.fields = fields;
+
/* Retrieve the object's information */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- oinfo, fields) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get data model info for object")
done:
@@ -1289,9 +1341,11 @@ done:
herr_t
H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo /*out*/, unsigned fields)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixIu", loc_id, oinfo, fields);
@@ -1310,9 +1364,15 @@ H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo /*out*/, unsigned fiel
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_native_info.fields = fields;
+ obj_opt_args.get_native_info.ninfo = oinfo;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO;
+ vol_cb_args.args = &obj_opt_args;
+
/* Retrieve the object's information */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, oinfo, fields) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native file format info for object")
done:
@@ -1335,9 +1395,11 @@ herr_t
H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oinfo /*out*/, unsigned fields,
hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id);
@@ -1366,9 +1428,15 @@ H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oi
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_native_info.fields = fields;
+ obj_opt_args.get_native_info.ninfo = oinfo;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO;
+ vol_cb_args.args = &obj_opt_args;
+
/* Retrieve the object's information */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, oinfo, fields) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native file format info for object: '%s'", name)
done:
@@ -1393,9 +1461,11 @@ herr_t
H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t n, H5O_native_info_t *oinfo /*out*/, unsigned fields, hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id);
@@ -1416,6 +1486,7 @@ H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_t
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
+ /* Set location struct fields */
loc_params.type = H5VL_OBJECT_BY_IDX;
loc_params.loc_data.loc_by_idx.name = group_name;
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
@@ -1428,9 +1499,15 @@ H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_t
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_native_info.fields = fields;
+ obj_opt_args.get_native_info.ninfo = oinfo;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO;
+ vol_cb_args.args = &obj_opt_args;
+
/* Retrieve the object's information */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, oinfo, fields) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native file format info for object")
done:
@@ -1457,9 +1534,11 @@ done:
herr_t
H5Oset_comment(hid_t obj_id, const char *comment)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*s", obj_id, comment);
@@ -1476,9 +1555,14 @@ H5Oset_comment(hid_t obj_id, const char *comment)
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(obj_id);
+ /* Set up VOL callback arguments */
+ obj_opt_args.set_comment.comment = comment;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_SET_COMMENT;
+ vol_cb_args.args = &obj_opt_args;
+
/* (Re)set the object's comment */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_SET_COMMENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, comment) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object")
done:
@@ -1505,9 +1589,11 @@ done:
herr_t
H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*s*si", loc_id, name, comment, lapl_id);
@@ -1530,9 +1616,14 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ obj_opt_args.set_comment.comment = comment;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_SET_COMMENT;
+ vol_cb_args.args = &obj_opt_args;
+
/* (Re)set the object's comment */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_SET_COMMENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, comment) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object: '%s'", name)
done:
@@ -1558,9 +1649,12 @@ done:
ssize_t
H5Oget_comment(hid_t obj_id, char *comment /*out*/, size_t bufsize)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- ssize_t ret_value = -1; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ size_t comment_len = 0; /* Length of comment string */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE3("Zs", "ixz", obj_id, comment, bufsize);
@@ -1573,11 +1667,21 @@ H5Oget_comment(hid_t obj_id, char *comment /*out*/, size_t bufsize)
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(obj_id);
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_comment.buf = comment;
+ obj_opt_args.get_comment.buf_size = bufsize;
+ obj_opt_args.get_comment.comment_len = &comment_len;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_COMMENT;
+ vol_cb_args.args = &obj_opt_args;
+
/* Retrieve the object's comment */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_COMMENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, comment, bufsize, &ret_value) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, (-1), "can't get comment for object")
+ /* Set return value */
+ ret_value = (ssize_t)comment_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Oget_comment() */
@@ -1601,9 +1705,12 @@ done:
ssize_t
H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment /*out*/, size_t bufsize, hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- ssize_t ret_value = -1; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params;
+ size_t comment_len = 0; /* Length of comment string */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE5("Zs", "i*sxzi", loc_id, name, comment, bufsize, lapl_id);
@@ -1626,11 +1733,21 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment /*out*/, si
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid location identifier")
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_comment.buf = comment;
+ obj_opt_args.get_comment.buf_size = bufsize;
+ obj_opt_args.get_comment.comment_len = &comment_len;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_COMMENT;
+ vol_cb_args.args = &obj_opt_args;
+
/* Retrieve the object's comment */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_COMMENT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, comment, bufsize, &ret_value) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, (-1), "can't get comment for object: '%s'", name)
+ /* Set return value */
+ ret_value = (ssize_t)comment_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Oget_comment_by_name() */
@@ -1674,9 +1791,10 @@ herr_t
H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2_t op, void *op_data,
unsigned fields)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "iIiIoOI*xIu", obj_id, idx_type, order, op, op_data, fields);
@@ -1699,10 +1817,17 @@ H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(obj_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_VISIT;
+ vol_cb_args.args.visit.idx_type = idx_type;
+ vol_cb_args.args.visit.order = order;
+ vol_cb_args.args.visit.op = op;
+ vol_cb_args.args.visit.op_data = op_data;
+ vol_cb_args.args.visit.fields = fields;
+
/* Visit the objects */
- if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, op, op_data, fields)) <
- 0)
+ if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object iteration failed")
done:
@@ -1748,9 +1873,10 @@ herr_t
H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order,
H5O_iterate2_t op, void *op_data, unsigned fields, hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIoOI*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id);
@@ -1783,10 +1909,17 @@ H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
loc_params.obj_type = H5I_get_type(loc_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_VISIT;
+ vol_cb_args.args.visit.idx_type = idx_type;
+ vol_cb_args.args.visit.order = order;
+ vol_cb_args.args.visit.op = op;
+ vol_cb_args.args.visit.op_data = op_data;
+ vol_cb_args.args.visit.fields = fields;
+
/* Visit the objects */
- if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, op, op_data, fields)) <
- 0)
+ if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object iteration failed")
done:
@@ -1794,23 +1927,23 @@ done:
} /* end H5Ovisit_by_name3() */
/*-------------------------------------------------------------------------
- * Function: H5O__close_check_common
+ * Function: H5O__close_check_type
*
* Purpose: This is the common function to validate an object
- * when closing it.
+ * before closing it.
*
* Return: TRUE/FALSE/FAIL
*
*-------------------------------------------------------------------------
*/
static htri_t
-H5O__close_check_common(hid_t object_id)
+H5O__close_check_type(hid_t object_id)
{
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_STATIC
- /* Get the type of the object and close it in the correct way */
+ /* Check for closeable object */
switch (H5I_get_type(object_id)) {
case H5I_GROUP:
case H5I_DATATYPE:
@@ -1836,14 +1969,13 @@ H5O__close_check_common(hid_t object_id)
case H5I_EVENTSET:
case H5I_NTYPES:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_CANTRELEASE, FALSE,
- "not a valid file object ID (dataset, group, or datatype)")
+ HGOTO_DONE(FALSE);
break;
} /* end switch */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5O__close_api_common() */
+} /* H5O__close_check_type() */
/*-------------------------------------------------------------------------
* Function: H5Oclose
@@ -1871,7 +2003,7 @@ H5Oclose(hid_t object_id)
H5TRACE1("e", "i", object_id);
/* Validate the object type before closing */
- if (H5O__close_check_common(object_id) <= 0)
+ if (H5O__close_check_type(object_id) <= 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "not a valid object")
if (H5I_dec_app_ref(object_id) < 0)
@@ -1903,7 +2035,7 @@ H5Oclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
H5TRACE5("e", "*s*sIuii", app_file, app_func, app_line, object_id, es_id);
/* Validate the object type before closing */
- if (H5O__close_check_common(object_id) <= 0)
+ if (H5O__close_check_type(object_id) <= 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "not a valid object")
/* Prepare for possible asynchronous operation */
@@ -1931,7 +2063,7 @@ H5Oclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, object_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, object_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -1943,7 +2075,7 @@ done:
} /* end H5Oclose_async() */
/*-------------------------------------------------------------------------
- * Function: H5O_disable_mdc_flushes
+ * Function: H5O__disable_mdc_flushes
*
* Purpose: Private version of the metadata cache cork function.
*
@@ -1952,18 +2084,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_disable_mdc_flushes(H5O_loc_t *oloc)
+H5O__disable_mdc_flushes(H5O_loc_t *oloc)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL);
+ FUNC_ENTER_PACKAGE
if (H5AC_cork(oloc->file, oloc->addr, H5AC__SET_CORK, NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCORK, FAIL, "unable to cork object");
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* H5O_disable_mdc_flushes() */
+} /* H5O__disable_mdc_flushes() */
/*-------------------------------------------------------------------------
* Function: H5Odisable_mdc_flushes
@@ -1982,9 +2114,10 @@ done:
herr_t
H5Odisable_mdc_flushes(hid_t object_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL);
H5TRACE1("e", "i", object_id);
@@ -2001,9 +2134,13 @@ H5Odisable_mdc_flushes(hid_t object_id)
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(object_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES;
+ vol_cb_args.args = NULL;
+
/* Cork the object */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCORK, FAIL, "unable to cork object");
done:
@@ -2011,7 +2148,7 @@ done:
} /* H5Odisable_mdc_flushes() */
/*-------------------------------------------------------------------------
- * Function: H5O_enable_mdc_flushes
+ * Function: H5O__enable_mdc_flushes
*
* Purpose: Private version of the metadata cache uncork function.
*
@@ -2020,18 +2157,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_enable_mdc_flushes(H5O_loc_t *oloc)
+H5O__enable_mdc_flushes(H5O_loc_t *oloc)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL);
+ FUNC_ENTER_PACKAGE
if (H5AC_cork(oloc->file, oloc->addr, H5AC__UNCORK, NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTUNCORK, FAIL, "unable to uncork object");
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* H5O_enable_mdc_flushes() */
+} /* H5O__enable_mdc_flushes() */
/*-------------------------------------------------------------------------
* Function: H5Oenable_mdc_flushes
@@ -2050,9 +2187,10 @@ done:
herr_t
H5Oenable_mdc_flushes(hid_t object_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL);
H5TRACE1("e", "i", object_id);
@@ -2069,9 +2207,13 @@ H5Oenable_mdc_flushes(hid_t object_id)
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(object_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES;
+ vol_cb_args.args = NULL;
+
/* Uncork the object */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTUNCORK, FAIL, "unable to uncork object");
done:
@@ -2079,7 +2221,7 @@ done:
} /* H5Oenable_mdc_flushes() */
/*-------------------------------------------------------------------------
- * Function: H5O_are_mdc_flushes_disabled
+ * Function: H5O__are_mdc_flushes_disabled
*
* Purpose: Private version of cork status getter.
*
@@ -2088,11 +2230,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_are_mdc_flushes_disabled(H5O_loc_t *oloc, hbool_t *are_disabled)
+H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, hbool_t *are_disabled)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL);
+ FUNC_ENTER_PACKAGE
HDassert(are_disabled);
@@ -2101,7 +2243,7 @@ H5O_are_mdc_flushes_disabled(H5O_loc_t *oloc, hbool_t *are_disabled)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5O_are_mdc_flushes_disabled() */
+} /* H5O__are_mdc_flushes_disabled() */
/*-------------------------------------------------------------------------
* Function: H5Oare_mdc_flushes_disabled
@@ -2123,9 +2265,11 @@ done:
herr_t
H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL);
H5TRACE2("e", "i*b", object_id, are_disabled);
@@ -2146,9 +2290,14 @@ H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled)
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(object_id);
+ /* Set up VOL callback arguments */
+ obj_opt_args.are_mdc_flushes_disabled.flag = are_disabled;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED;
+ vol_cb_args.args = &obj_opt_args;
+
/* Get the cork status */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, are_disabled) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) <
+ 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to retrieve object's cork status");
done:
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 98bbf0b..bad89ae 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -1234,10 +1234,10 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx)
/* Keep first one found */
if (found_null < 0)
found_null = (ssize_t)idx;
- else
- /* Check for better fit */
- if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size)
+ /* Check for better fit */
+ else if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size) {
found_null = (ssize_t)idx;
+ }
else {
/* If they are the same size, choose the one in the earliest chunk */
if (oh->mesg[idx].raw_size == oh->mesg[found_null].raw_size) {
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index a903cc1..3aae0cb 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -78,8 +78,8 @@ static herr_t H5O__cache_chk_free_icr(void *thing);
static herr_t H5O__prefix_deserialize(const uint8_t *image, H5O_cache_ud_t *udata);
/* Chunk routines */
-static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image,
- H5O_common_cache_ud_t *udata, hbool_t *dirty);
+static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t *image,
+ size_t len, H5O_common_cache_ud_t *udata, hbool_t *dirty);
static herr_t H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno);
/* Misc. routines */
@@ -287,7 +287,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata)
*-------------------------------------------------------------------------
*/
static void *
-H5O__cache_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t *dirty)
+H5O__cache_deserialize(const void *image, size_t len, void *_udata, hbool_t *dirty)
{
H5O_t * oh = NULL; /* Object header read in */
H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */
@@ -333,7 +333,7 @@ H5O__cache_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void
oh->proxy = NULL;
/* Parse the first chunk */
- if (H5O__chunk_deserialize(oh, udata->common.addr, udata->chunk0_size, (const uint8_t *)image,
+ if (H5O__chunk_deserialize(oh, udata->common.addr, udata->chunk0_size, (const uint8_t *)image, len,
&(udata->common), dirty) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk")
@@ -736,7 +736,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata)
*-------------------------------------------------------------------------
*/
static void *
-H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t *dirty)
+H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t *dirty)
{
H5O_chunk_proxy_t * chk_proxy = NULL; /* Chunk proxy object */
H5O_chk_cache_ud_t *udata = (H5O_chk_cache_ud_t *)_udata; /* User data for callback */
@@ -763,7 +763,7 @@ H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len,
HDassert(udata->common.cont_msg_info);
/* Parse the chunk */
- if (H5O__chunk_deserialize(udata->oh, udata->common.addr, udata->size, (const uint8_t *)image,
+ if (H5O__chunk_deserialize(udata->oh, udata->common.addr, udata->size, (const uint8_t *)image, len,
&(udata->common), dirty) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize object header chunk")
@@ -1275,7 +1275,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image,
+H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t *image, size_t len,
H5O_common_cache_ud_t *udata, hbool_t *dirty)
{
const uint8_t *chunk_image; /* Pointer into buffer to decode */
@@ -1295,6 +1295,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image
HDassert(oh);
HDassert(H5F_addr_defined(addr));
HDassert(image);
+ HDassert(len);
HDassert(udata->f);
HDassert(udata->cont_msg_info);
@@ -1315,14 +1316,16 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image
oh->chunk[chunkno].addr = addr;
if (chunkno == 0)
/* First chunk's 'image' includes room for the object header prefix */
- oh->chunk[0].size = len + (size_t)H5O_SIZEOF_HDR(oh);
+ oh->chunk[0].size = chunk_size + (size_t)H5O_SIZEOF_HDR(oh);
else
- oh->chunk[chunkno].size = len;
+ oh->chunk[chunkno].size = chunk_size;
if (NULL == (oh->chunk[chunkno].image = H5FL_BLK_MALLOC(chunk_image, oh->chunk[chunkno].size)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "memory allocation failed")
oh->chunk[chunkno].chunk_proxy = NULL;
/* Copy disk image into chunk's image */
+ if (len < oh->chunk[chunkno].size)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "attempted to copy too many disk image bytes into buffer")
H5MM_memcpy(oh->chunk[chunkno].image, image, oh->chunk[chunkno].size);
/* Point into chunk image to decode */
@@ -1335,7 +1338,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image
/* Check for magic # on chunks > 0 in later versions of the format */
else if (chunkno > 0 && oh->version > H5O_VERSION_1) {
/* Magic number */
- if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "wrong object header chunk signature")
chunk_image += H5_SIZEOF_MAGIC;
} /* end if */
diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c
index 5e13f9f..7def20a 100644
--- a/src/H5Odeprec.c
+++ b/src/H5Odeprec.c
@@ -122,8 +122,6 @@ H5O__iterate1_adapter(hid_t obj_id, const char *name, const H5O_info2_t *oinfo2,
H5O_info1_t oinfo; /* Deprecated object info struct */
unsigned dm_fields; /* Fields for data model query */
unsigned nat_fields; /* Fields for native query */
- H5VL_object_t * vol_obj; /* Object of obj_id */
- H5VL_loc_params_t loc_params; /* Location parameters for VOL callback */
herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_STATIC
@@ -160,24 +158,34 @@ H5O__iterate1_adapter(hid_t obj_id, const char *name, const H5O_info2_t *oinfo2,
oinfo.num_attrs = oinfo2->num_attrs;
}
- /* Fill out location struct */
- loc_params.type = H5VL_OBJECT_BY_NAME;
- loc_params.loc_data.loc_by_name.name = name;
- loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
- loc_params.obj_type = H5I_get_type(obj_id);
-
- /* Get the location object */
- if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
- HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, H5_ITER_ERROR, "invalid location identifier")
-
/* Check for retrieving native information */
nat_fields = shim_data->fields & (H5O_INFO_HDR | H5O_INFO_META_SIZE);
if (nat_fields) {
- H5O_native_info_t nat_info; /* Native object info */
+ H5VL_object_t * vol_obj; /* Object of obj_id */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5VL_loc_params_t loc_params; /* Location parameters for VOL callback */
+ H5O_native_info_t nat_info; /* Native object info */
+
+ /* Fill out location struct */
+ loc_params.type = H5VL_OBJECT_BY_NAME;
+ loc_params.loc_data.loc_by_name.name = name;
+ loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
+ loc_params.obj_type = H5I_get_type(obj_id);
+
+ /* Get the location object */
+ if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
+ HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, H5_ITER_ERROR, "invalid location identifier")
+
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_native_info.fields = nat_fields;
+ obj_opt_args.get_native_info.ninfo = &nat_info;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO;
+ vol_cb_args.args = &obj_opt_args;
/* Retrieve the object's native information */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &loc_params, &nat_info, nat_fields) < 0)
+ if (H5VL_object_optional(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native info for object")
/* Set the native fields */
@@ -228,11 +236,16 @@ H5O__get_info_old(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, H5O_inf
/* Check for retrieving data model information */
dm_fields = fields & (H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS);
if (dm_fields) {
- H5O_info2_t dm_info; /* Data model object info */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5O_info2_t dm_info; /* Data model object info */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_INFO;
+ vol_cb_args.args.get_info.oinfo = &dm_info;
+ vol_cb_args.args.get_info.fields = dm_fields;
/* Retrieve the object's data model information */
- if (H5VL_object_get(vol_obj, loc_params, H5VL_OBJECT_GET_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &dm_info, dm_fields) < 0)
+ if (H5VL_object_get(vol_obj, loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get data model info for object")
/* Set the data model fields */
@@ -265,11 +278,19 @@ H5O__get_info_old(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, H5O_inf
/* Check for retrieving native information */
nat_fields = fields & (H5O_INFO_HDR | H5O_INFO_META_SIZE);
if (nat_fields) {
- H5O_native_info_t nat_info; /* Native object info */
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
+ H5O_native_info_t nat_info; /* Native object info */
+
+ /* Set up VOL callback arguments */
+ obj_opt_args.get_native_info.fields = nat_fields;
+ obj_opt_args.get_native_info.ninfo = &nat_info;
+ vol_cb_args.op_type = H5VL_NATIVE_OBJECT_GET_NATIVE_INFO;
+ vol_cb_args.args = &obj_opt_args;
/* Retrieve the object's native information */
- if (H5VL_object_optional(vol_obj, H5VL_NATIVE_OBJECT_GET_NATIVE_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, loc_params, &nat_info, nat_fields) < 0)
+ if (H5VL_object_optional(vol_obj, loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get native info for object")
/* Set the native fields */
@@ -751,10 +772,11 @@ done:
herr_t
H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1_t op, void *op_data)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "iIiIoOi*x", obj_id, idx_type, order, op, op_data);
@@ -780,10 +802,17 @@ H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1
shim_data.fields = H5O_INFO_ALL;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_VISIT;
+ vol_cb_args.args.visit.idx_type = idx_type;
+ vol_cb_args.args.visit.order = order;
+ vol_cb_args.args.visit.op = H5O__iterate1_adapter;
+ vol_cb_args.args.visit.op_data = &shim_data;
+ vol_cb_args.args.visit.fields = H5O_INFO_ALL;
+
/* Visit the objects */
- if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, H5O__iterate1_adapter,
- (void *)&shim_data, H5O_INFO_ALL)) < 0)
+ if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
done:
@@ -826,10 +855,11 @@ herr_t
H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order,
H5O_iterate1_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIoOi*xi", loc_id, obj_name, idx_type, order, op, op_data, lapl_id);
@@ -865,10 +895,17 @@ H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it
shim_data.fields = H5O_INFO_ALL;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_VISIT;
+ vol_cb_args.args.visit.idx_type = idx_type;
+ vol_cb_args.args.visit.order = order;
+ vol_cb_args.args.visit.op = H5O__iterate1_adapter;
+ vol_cb_args.args.visit.op_data = &shim_data;
+ vol_cb_args.args.visit.fields = H5O_INFO_ALL;
+
/* Visit the objects */
- if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, H5O__iterate1_adapter,
- (void *)&shim_data, H5O_INFO_ALL)) < 0)
+ if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
done:
@@ -914,11 +951,12 @@ herr_t
H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1_t op, void *op_data,
unsigned fields)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
- hbool_t is_native_vol_obj;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
+ hbool_t is_native_vol_obj;
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("e", "iIiIoOi*xIu", obj_id, idx_type, order, op, op_data, fields);
@@ -954,10 +992,17 @@ H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1
shim_data.fields = fields;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_VISIT;
+ vol_cb_args.args.visit.idx_type = idx_type;
+ vol_cb_args.args.visit.order = order;
+ vol_cb_args.args.visit.op = H5O__iterate1_adapter;
+ vol_cb_args.args.visit.op_data = &shim_data;
+ vol_cb_args.args.visit.fields = fields;
+
/* Visit the objects */
- if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, H5O__iterate1_adapter,
- (void *)&shim_data, fields)) < 0)
+ if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object iteration failed")
done:
@@ -1003,11 +1048,12 @@ herr_t
H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order,
H5O_iterate1_t op, void *op_data, unsigned fields, hid_t lapl_id)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
- H5VL_loc_params_t loc_params;
- H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
- hbool_t is_native_vol_obj;
- herr_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
+ hbool_t is_native_vol_obj;
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIoOi*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id);
@@ -1053,10 +1099,17 @@ H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it
shim_data.fields = fields;
shim_data.real_op_data = op_data;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_VISIT;
+ vol_cb_args.args.visit.idx_type = idx_type;
+ vol_cb_args.args.visit.order = order;
+ vol_cb_args.args.visit.op = H5O__iterate1_adapter;
+ vol_cb_args.args.visit.op_data = &shim_data;
+ vol_cb_args.args.visit.fields = fields;
+
/* Visit the objects */
- if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_VISIT, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, (int)idx_type, (int)order, H5O__iterate1_adapter,
- (void *)&shim_data, fields)) < 0)
+ if ((ret_value = H5VL_object_specific(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object iteration failed")
done:
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 1ecaf36..d950249 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -466,7 +466,7 @@ H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_d
HGOTO_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to protect EFL file name heap")
/* Insert "empty" name first */
- if (UFAIL == (name_offset = H5HL_insert(file_dst, heap, (size_t)1, "")))
+ if (H5HL_insert(file_dst, heap, (size_t)1, "", &name_offset) < 0)
HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
HDassert(0 == name_offset);
@@ -483,10 +483,10 @@ H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_d
/* copy the name from the source */
for (idx = 0; idx < efl_src->nused; idx++) {
efl_dst->slot[idx].name = H5MM_xstrdup(efl_src->slot[idx].name);
- if (UFAIL == (efl_dst->slot[idx].name_offset = H5HL_insert(
- file_dst, heap, HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name)))
+ if (H5HL_insert(file_dst, heap, HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name,
+ &(efl_dst->slot[idx].name_offset)) < 0)
HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
- } /* end for */
+ }
/* Set return value */
ret_value = efl_dst;
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 695673f..5068039 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -196,8 +196,9 @@ H5O__fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size,
const uint8_t *p)
{
- H5O_fill_t *fill = NULL;
- void * ret_value = NULL; /* Return value */
+ H5O_fill_t * fill = NULL;
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -228,8 +229,11 @@ H5O__fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
INT32DECODE(p, fill->size);
if (fill->size > 0) {
H5_CHECK_OVERFLOW(fill->size, ssize_t, size_t);
- if ((size_t)fill->size > p_size)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "destination buffer too small")
+
+ /* Ensure that fill size doesn't exceed buffer size, due to possible data corruption */
+ if (p + fill->size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "fill size exceeds buffer size")
+
if (NULL == (fill->buf = H5MM_malloc((size_t)fill->size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value")
H5MM_memcpy(fill->buf, p, (size_t)fill->size);
@@ -311,10 +315,11 @@ static void *
H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
{
- H5O_fill_t *fill = NULL; /* Decoded fill value message */
- htri_t exists = FALSE;
- H5T_t * dt = NULL;
- void * ret_value = NULL; /* Return value */
+ H5O_fill_t * fill = NULL; /* Decoded fill value message */
+ htri_t exists = FALSE;
+ H5T_t * dt = NULL;
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -335,8 +340,10 @@ H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flag
/* Only decode the fill value itself if there is one */
if (fill->size > 0) {
H5_CHECK_OVERFLOW(fill->size, ssize_t, size_t);
- if ((size_t)fill->size > p_size)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "destination buffer too small")
+
+ /* Ensure that fill size doesn't exceed buffer size, due to possible data corruption */
+ if (p + fill->size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "fill size exceeds buffer size")
/* Get the datatype message */
if ((exists = H5O_msg_exists_oh(open_oh, H5O_DTYPE_ID)) < 0)
diff --git a/src/H5Oflush.c b/src/H5Oflush.c
index ea25550..801ef01 100644
--- a/src/H5Oflush.c
+++ b/src/H5Oflush.c
@@ -48,7 +48,7 @@
/* Local Prototypes */
/********************/
static herr_t H5O__oh_tag(const H5O_loc_t *oloc, haddr_t *tag);
-static herr_t H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc);
+static herr_t H5O__refresh_metadata_close(H5O_loc_t *oloc, H5G_loc_t *obj_loc, hid_t oid);
/*************/
/* Functions */
@@ -193,7 +193,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc)
+H5O_refresh_metadata(H5O_loc_t *oloc, hid_t oid)
{
H5VL_object_t *vol_obj = NULL; /* VOL object associated with the ID */
hbool_t objs_incr = FALSE; /* Whether the object count in the file was incremented */
@@ -202,7 +202,7 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc)
FUNC_ENTER_NOAPI(FAIL)
/* If the file is opened with write access, no need to perform refresh actions. */
- if (!(H5F_INTENT(oloc.file) & H5F_ACC_RDWR)) {
+ if (!(H5F_INTENT(oloc->file) & H5F_ACC_RDWR)) {
H5G_loc_t obj_loc;
H5O_loc_t obj_oloc;
H5G_name_t obj_path;
@@ -217,7 +217,7 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc)
/* "Fake" another open object in the file, so that it doesn't get closed
* if this object is the only thing holding the file open.
*/
- H5F_incr_nopen_objs(oloc.file);
+ H5F_incr_nopen_objs(oloc->file);
objs_incr = TRUE;
/* Save important datatype state */
@@ -239,11 +239,11 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc)
connector->nrefs++;
/* Close object & evict its metadata */
- if ((H5O__refresh_metadata_close(oid, oloc, &obj_loc)) < 0)
+ if (H5O__refresh_metadata_close(oloc, &obj_loc, oid) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object")
/* Re-open the object, re-fetching its metadata */
- if ((H5O_refresh_metadata_reopen(oid, &obj_loc, connector, FALSE)) < 0)
+ if (H5O_refresh_metadata_reopen(oid, &obj_loc, connector, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object")
/* Restore the number of references on the VOL connector */
@@ -258,7 +258,7 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc)
done:
if (objs_incr)
- H5F_decr_nopen_objs(oloc.file);
+ H5F_decr_nopen_objs(oloc->file);
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5O_refresh_metadata() */
@@ -283,8 +283,9 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc)
+H5O__refresh_metadata_close(H5O_loc_t *oloc, H5G_loc_t *obj_loc, hid_t oid)
{
+ H5F_t * file; /* Local copy of the object's file pointer */
haddr_t tag = 0; /* Tag for object */
hbool_t corked = FALSE; /* Whether object's metadata is corked */
herr_t ret_value = SUCCEED; /* Return value */
@@ -305,28 +306,32 @@ H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc)
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to prepare refresh for dataset")
/* Retrieve tag for object */
- if (H5O__oh_tag(&oloc, &tag) < 0)
+ if (H5O__oh_tag(oloc, &tag) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to get object header address")
/* Get cork status of the object with tag */
- if (H5AC_cork(oloc.file, tag, H5AC__GET_CORKED, &corked) < 0)
+ if (H5AC_cork(oloc->file, tag, H5AC__GET_CORKED, &corked) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_SYSTEM, FAIL, "unable to retrieve an object's cork status")
+ /* Hold a copy of the object's file pointer, since closing the object will
+ * invalidate the file pointer in the oloc.
+ */
+ file = oloc->file;
/* Close the object */
if (H5I_dec_ref(oid) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to close object")
/* Flush metadata based on tag value of the object */
- if (H5F_flush_tagged_metadata(oloc.file, tag) < 0)
+ if (H5F_flush_tagged_metadata(file, tag) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
/* Evict the object's tagged metadata */
- if (H5F_evict_tagged_metadata(oloc.file, tag) < 0)
+ if (H5F_evict_tagged_metadata(file, tag) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to evict metadata")
/* Re-cork object with tag */
if (corked)
- if (H5AC_cork(oloc.file, tag, H5AC__SET_CORK, &corked) < 0)
+ if (H5AC_cork(file, tag, H5AC__SET_CORK, &corked) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_SYSTEM, FAIL, "unable to cork the object")
done:
diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c
index 44c4985..b60f589 100644
--- a/src/H5Ofsinfo.c
+++ b/src/H5Ofsinfo.c
@@ -91,11 +91,12 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t);
*/
static void *
H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
{
- H5O_fsinfo_t * fsinfo = NULL; /* File space info message */
- H5F_mem_page_t ptype; /* Memory type for iteration */
- unsigned vers; /* message version */
+ H5O_fsinfo_t * fsinfo = NULL; /* File space info message */
+ H5F_mem_page_t ptype; /* Memory type for iteration */
+ unsigned vers; /* message version */
+ const uint8_t *p_end = p + p_size;
void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -136,8 +137,12 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU
fsinfo->threshold = threshold;
if (HADDR_UNDEF == (fsinfo->eoa_pre_fsm_fsalloc = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to get file size")
- for (type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; type++)
+ for (type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; type++) {
+ if (p + H5_SIZEOF_HADDR_T > p_end)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL,
+ "ran off end of input buffer while decoding")
H5F_addr_decode(f, &p, &(fsinfo->fs_addr[type - 1]));
+ }
break;
case H5F_FILE_SPACE_ALL:
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 5fa9c6a..f24d0bb 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -449,12 +449,16 @@ H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t init
#if H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T
if (size_hint > 4294967295UL)
oh->flags |= H5O_HDR_CHUNK0_8;
- else
-#endif /* H5_SIZEOF_SIZE_T > H5_SIZEOF_INT32_T */
- if (size_hint > 65535)
+ else if (size_hint > 65535)
oh->flags |= H5O_HDR_CHUNK0_4;
else if (size_hint > 255)
oh->flags |= H5O_HDR_CHUNK0_2;
+#else
+ if (size_hint > 65535)
+ oh->flags |= H5O_HDR_CHUNK0_4;
+ else if (size_hint > 255)
+ oh->flags |= H5O_HDR_CHUNK0_2;
+#endif
}
else {
/* Reset unused time fields */
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 4020b23..651e317 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -17,7 +17,7 @@
* Purpose: Messages related to data layout.
*/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#include "H5Omodule.h" /* This source code file is part of the H5O module */
#include "H5private.h" /* Generic Functions */
@@ -90,12 +90,13 @@ H5FL_DEFINE(H5O_layout_t);
*/
static void *
H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
{
- H5O_layout_t *mesg = NULL;
- uint8_t * heap_block = NULL;
- unsigned u;
- void * ret_value = NULL; /* Return value */
+ H5O_layout_t * mesg = NULL;
+ uint8_t * heap_block = NULL;
+ unsigned u;
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -179,6 +180,10 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU
if (mesg->type == H5D_COMPACT) {
UINT32DECODE(p, mesg->storage.u.compact.size);
if (mesg->storage.u.compact.size > 0) {
+ /* Ensure that size doesn't exceed buffer size, due to possible data corruption */
+ if (p + mesg->storage.u.compact.size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "storage size exceeds buffer size")
+
if (NULL == (mesg->storage.u.compact.buf = H5MM_malloc(mesg->storage.u.compact.size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed for compact data buffer")
@@ -198,6 +203,10 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU
UINT16DECODE(p, mesg->storage.u.compact.size);
if (mesg->storage.u.compact.size > 0) {
+ /* Ensure that size doesn't exceed buffer size, due to possible data corruption */
+ if (p + mesg->storage.u.compact.size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "storage size exceeds buffer size")
+
/* Allocate space for compact data */
if (NULL == (mesg->storage.u.compact.buf = H5MM_malloc(mesg->storage.u.compact.size)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL,
@@ -887,13 +896,13 @@ done:
} /* end H5O__layout_reset() */
/*-------------------------------------------------------------------------
- * Function: H5O__layout_free
+ * Function: H5O__layout_free
*
- * Purpose: Free's the message
+ * Purpose: Free's the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, March 11, 2000
*
*-------------------------------------------------------------------------
diff --git a/src/H5Omodule.h b/src/H5Omodule.h
index 134aa92..8afba29 100644
--- a/src/H5Omodule.h
+++ b/src/H5Omodule.h
@@ -30,9 +30,46 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5O H5O
- * \brief Object Interface
*
- * \todo Describe concisely what the functions in this module are about.
+ * Use the functions in this module to manage HDF5 objects.
+ *
+ * HDF5 objects (groups, datasets, datatype objects) are usually created
+ * using functions in the object-specific modules (\ref H5G, \ref H5D,
+ * \ref H5T). However, new objects can also be created by copying existing
+ * objects.
+ *
+ * Many functions in this module are variations on object introspection,
+ * that is, the retrieval of detailed information about HDF5 objects in a file.
+ * Objects in an HDF5 file can be "visited" in an iterative fashion.
+ *
+ * HDF5 objects are usually updated using functions in the object-specific
+ * modules. However, there are certain generic object properties, such as
+ * reference counts, that can be manipulated using functions in this module.
+ *
+ * HDF5 objects are deleted as a side effect of rendering them unreachable
+ * from the root group. The net effect is the diminution of the object's
+ * reference count to zero, which can (but should not usually) be effected
+ * by a function in this module.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5O_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5O_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5O_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5O_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
*/
#endif /* H5Omodule_H */
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 6e203bb..331fcf6 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -581,6 +581,11 @@ H5_DLL herr_t H5O__chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_pr
H5_DLL herr_t H5O__chunk_delete(H5F_t *f, H5O_t *oh, unsigned idx);
H5_DLL herr_t H5O__chunk_dest(H5O_chunk_proxy_t *chunk_proxy);
+/* Cache corking functions */
+H5_DLL herr_t H5O__disable_mdc_flushes(H5O_loc_t *oloc);
+H5_DLL herr_t H5O__enable_mdc_flushes(H5O_loc_t *oloc);
+H5_DLL herr_t H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, hbool_t *are_disabled);
+
/* Collect storage info for btree and heap */
H5_DLL herr_t H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info);
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 65f0308..050bd49 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -981,15 +981,10 @@ H5_DLL herr_t H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, uint8_t
/* Object metadata flush/refresh routines */
H5_DLL herr_t H5O_flush(H5O_loc_t *oloc, hid_t obj_id);
H5_DLL herr_t H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id);
-H5_DLL herr_t H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc);
+H5_DLL herr_t H5O_refresh_metadata(H5O_loc_t *oloc, hid_t oid);
H5_DLL herr_t H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, H5VL_t *vol_driver,
hbool_t start_swmr);
-/* Cache corking functions */
-H5_DLL herr_t H5O_disable_mdc_flushes(H5O_loc_t *oloc);
-H5_DLL herr_t H5O_enable_mdc_flushes(H5O_loc_t *oloc);
-H5_DLL herr_t H5O_are_mdc_flushes_disabled(H5O_loc_t *oloc, hbool_t *are_disabled);
-
/* Object copying routines */
H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type,
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index 04ef35b..d9d0500 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -35,14 +35,14 @@
/*****************/
/* Flags for object copy (H5Ocopy) */
-#define H5O_COPY_SHALLOW_HIERARCHY_FLAG (0x0001u) /* Copy only immediate members */
-#define H5O_COPY_EXPAND_SOFT_LINK_FLAG (0x0002u) /* Expand soft links into new objects */
-#define H5O_COPY_EXPAND_EXT_LINK_FLAG (0x0004u) /* Expand external links into new objects */
-#define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /* Copy objects that are pointed by references */
-#define H5O_COPY_WITHOUT_ATTR_FLAG (0x0010u) /* Copy object without copying attributes */
-#define H5O_COPY_PRESERVE_NULL_FLAG (0x0020u) /* Copy NULL messages (empty space) */
-#define H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG (0x0040u) /* Merge committed datatypes in dest file */
-#define H5O_COPY_ALL (0x007Fu) /* All object copying flags (for internal checking) */
+#define H5O_COPY_SHALLOW_HIERARCHY_FLAG (0x0001u) /**< Copy only immediate members */
+#define H5O_COPY_EXPAND_SOFT_LINK_FLAG (0x0002u) /**< Expand soft links into new objects */
+#define H5O_COPY_EXPAND_EXT_LINK_FLAG (0x0004u) /**< Expand external links into new objects */
+#define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /**< Copy objects that are pointed by references */
+#define H5O_COPY_WITHOUT_ATTR_FLAG (0x0010u) /**< Copy object without copying attributes */
+#define H5O_COPY_PRESERVE_NULL_FLAG (0x0020u) /**< Copy NULL messages (empty space) */
+#define H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG (0x0040u) /**< Merge committed datatypes in dest file */
+#define H5O_COPY_ALL (0x007Fu) /**< All object copying flags (for internal checking) */
/* Flags for shared message indexes.
* Pass these flags in using the mesg_type_flags parameter in
@@ -51,25 +51,27 @@
* but we need to assign each kind of message to a different bit so that
* one index can hold multiple types.)
*/
-#define H5O_SHMESG_NONE_FLAG 0x0000 /* No shared messages */
-#define H5O_SHMESG_SDSPACE_FLAG ((unsigned)1 << 0x0001) /* Simple Dataspace Message. */
-#define H5O_SHMESG_DTYPE_FLAG ((unsigned)1 << 0x0003) /* Datatype Message. */
-#define H5O_SHMESG_FILL_FLAG ((unsigned)1 << 0x0005) /* Fill Value Message. */
-#define H5O_SHMESG_PLINE_FLAG ((unsigned)1 << 0x000b) /* Filter pipeline message. */
-#define H5O_SHMESG_ATTR_FLAG ((unsigned)1 << 0x000c) /* Attribute Message. */
+#define H5O_SHMESG_NONE_FLAG 0x0000 /**< No shared messages */
+#define H5O_SHMESG_SDSPACE_FLAG ((unsigned)1 << 0x0001) /**< Simple Dataspace Message. */
+#define H5O_SHMESG_DTYPE_FLAG ((unsigned)1 << 0x0003) /**< Datatype Message. */
+#define H5O_SHMESG_FILL_FLAG ((unsigned)1 << 0x0005) /**< Fill Value Message. */
+#define H5O_SHMESG_PLINE_FLAG ((unsigned)1 << 0x000b) /**< Filter pipeline message. */
+#define H5O_SHMESG_ATTR_FLAG ((unsigned)1 << 0x000c) /**< Attribute Message. */
#define H5O_SHMESG_ALL_FLAG \
(H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG | H5O_SHMESG_FILL_FLAG | H5O_SHMESG_PLINE_FLAG | \
H5O_SHMESG_ATTR_FLAG)
+/* clang-format off */
/* Object header status flag definitions */
-#define H5O_HDR_CHUNK0_SIZE 0x03 /* 2-bit field indicating # of bytes to store the size of chunk 0's data */
-#define H5O_HDR_ATTR_CRT_ORDER_TRACKED 0x04 /* Attribute creation order is tracked */
-#define H5O_HDR_ATTR_CRT_ORDER_INDEXED 0x08 /* Attribute creation order has index */
-#define H5O_HDR_ATTR_STORE_PHASE_CHANGE 0x10 /* Non-default attribute storage phase change values stored */
-#define H5O_HDR_STORE_TIMES 0x20 /* Store access, modification, change & birth times for object */
+#define H5O_HDR_CHUNK0_SIZE 0x03 /**< 2-bit field indicating # of bytes to store the size of chunk 0's data */
+#define H5O_HDR_ATTR_CRT_ORDER_TRACKED 0x04 /**< Attribute creation order is tracked */
+#define H5O_HDR_ATTR_CRT_ORDER_INDEXED 0x08 /**< Attribute creation order has index */
+#define H5O_HDR_ATTR_STORE_PHASE_CHANGE 0x10 /**< Non-default attribute storage phase change values stored */
+#define H5O_HDR_STORE_TIMES 0x20 /**< Store access, modification, change & birth times for object */
#define H5O_HDR_ALL_FLAGS \
(H5O_HDR_CHUNK0_SIZE | H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | \
H5O_HDR_ATTR_STORE_PHASE_CHANGE | H5O_HDR_STORE_TIMES)
+/* clang-format on */
/* Maximum shared message values. Number of indexes is 8 to allow room to add
* new types of messages.
@@ -81,22 +83,20 @@
* Theses flags determine which fields will be filled in in the H5O_info_t
* struct.
*/
-#define H5O_INFO_BASIC 0x0001u /* Fill in the fileno, addr, type, and rc fields */
-#define H5O_INFO_TIME 0x0002u /* Fill in the atime, mtime, ctime, and btime fields */
-#define H5O_INFO_NUM_ATTRS 0x0004u /* Fill in the num_attrs field */
+#define H5O_INFO_BASIC 0x0001u /**< Fill in the fileno, addr, type, and rc fields */
+#define H5O_INFO_TIME 0x0002u /**< Fill in the atime, mtime, ctime, and btime fields */
+#define H5O_INFO_NUM_ATTRS 0x0004u /**< Fill in the num_attrs field */
#define H5O_INFO_ALL (H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS)
-/* Flags for H5Oget_native_info.
- * Theses flags determine which fields will be filled in in the H5O_native_info_t
- * struct.
+//! <!-- [H5O_native_info_fields_snip] -->
+/**
+ * Flags for H5Oget_native_info(). Theses flags determine which fields will be
+ * filled in in the \ref H5O_native_info_t struct.
*/
-//! [H5O_native_info_fields_snip]
-
-#define H5O_NATIVE_INFO_HDR 0x0008u /* Fill in the hdr field */
-#define H5O_NATIVE_INFO_META_SIZE 0x0010u /* Fill in the meta_size field */
+#define H5O_NATIVE_INFO_HDR 0x0008u /**< Fill in the hdr field */
+#define H5O_NATIVE_INFO_META_SIZE 0x0010u /**< Fill in the meta_size field */
#define H5O_NATIVE_INFO_ALL (H5O_NATIVE_INFO_HDR | H5O_NATIVE_INFO_META_SIZE)
-
-//! [H5O_native_info_fields_snip]
+//! <!-- [H5O_native_info_fields_snip] -->
/* Convenience macro to check if the token is the 'undefined' token value */
#define H5O_IS_TOKEN_UNDEF(token) (!HDmemcmp(&(token), &(H5O_TOKEN_UNDEF), sizeof(H5O_token_t)))
@@ -105,95 +105,115 @@
/* Public Typedefs */
/*******************/
-//! [H5O_type_t_snip]
-
-/* Types of objects in file */
+//! <!-- [H5O_type_t_snip] -->
+/**
+ * Types of objects in file
+ */
typedef enum H5O_type_t {
- H5O_TYPE_UNKNOWN = -1, /* Unknown object type */
- H5O_TYPE_GROUP, /* Object is a group */
- H5O_TYPE_DATASET, /* Object is a dataset */
- H5O_TYPE_NAMED_DATATYPE, /* Object is a named data type */
- H5O_TYPE_MAP, /* Object is a map */
- H5O_TYPE_NTYPES /* Number of different object types (must be last!) */
+ H5O_TYPE_UNKNOWN = -1, /**< Unknown object type */
+ H5O_TYPE_GROUP, /**< Object is a group */
+ H5O_TYPE_DATASET, /**< Object is a dataset */
+ H5O_TYPE_NAMED_DATATYPE, /**< Object is a named data type */
+ H5O_TYPE_MAP, /**< Object is a map */
+ H5O_TYPE_NTYPES /**< Number of different object types (must be last!) */
} H5O_type_t;
+//! <!-- [H5O_type_t_snip] -->
-//! [H5O_type_t_snip]
-
-/* Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */
-//! [H5O_hdr_info_t_snip]
-
+//! <!-- [H5O_hdr_info_t_snip] -->
+/**
+ * Information struct for object header metadata (for
+ * H5Oget_info(), H5Oget_info_by_name(), H5Oget_info_by_idx())
+ */
typedef struct H5O_hdr_info_t {
- unsigned version; /* Version number of header format in file */
- unsigned nmesgs; /* Number of object header messages */
- unsigned nchunks; /* Number of object header chunks */
- unsigned flags; /* Object header status flags */
+ unsigned version; /**< Version number of header format in file */
+ unsigned nmesgs; /**< Number of object header messages */
+ unsigned nchunks; /**< Number of object header chunks */
+ unsigned flags; /**< Object header status flags */
struct {
- hsize_t total; /* Total space for storing object header in file */
- hsize_t meta; /* Space within header for object header metadata information */
- hsize_t mesg; /* Space within header for actual message information */
- hsize_t free; /* Free space within object header */
+ hsize_t total; /**< Total space for storing object header in file */
+ hsize_t meta; /**< Space within header for object header metadata information */
+ hsize_t mesg; /**< Space within header for actual message information */
+ hsize_t free; /**< Free space within object header */
} space;
struct {
- uint64_t present; /* Flags to indicate presence of message type in header */
- uint64_t shared; /* Flags to indicate message type is shared in header */
+ uint64_t present; /**< Flags to indicate presence of message type in header */
+ uint64_t shared; /**< Flags to indicate message type is shared in header */
} mesg;
} H5O_hdr_info_t;
+//! <!-- [H5O_hdr_info_t_snip] -->
-//! [H5O_hdr_info_t_snip]
-
-//! [H5O_info2_t_snip]
-
-/* Data model information struct for objects */
-/* (For H5Oget_info / H5Oget_info_by_name / H5Oget_info_by_idx version 3) */
+//! <!-- [H5O_info2_t_snip] -->
+/**
+ * Data model information struct for objects
+ * (For H5Oget_info(), H5Oget_info_by_name(), H5Oget_info_by_idx() version 3)
+ */
typedef struct H5O_info2_t {
- unsigned long fileno; /* File number that object is located in */
- H5O_token_t token; /* Token representing the object */
- H5O_type_t type; /* Basic object type (group, dataset, etc.) */
- unsigned rc; /* Reference count of object */
- time_t atime; /* Access time */
- time_t mtime; /* Modification time */
- time_t ctime; /* Change time */
- time_t btime; /* Birth time */
- hsize_t num_attrs; /* # of attributes attached to object */
+ unsigned long fileno; /**< File number that object is located in */
+ H5O_token_t token; /**< Token representing the object */
+ H5O_type_t type; /**< Basic object type (group, dataset, etc.) */
+ unsigned rc; /**< Reference count of object */
+ time_t atime; /**< Access time */
+ time_t mtime; /**< Modification time */
+ time_t ctime; /**< Change time */
+ time_t btime; /**< Birth time */
+ hsize_t num_attrs; /**< Number of attributes attached to object */
} H5O_info2_t;
+//! <!-- [H5O_info2_t_snip] -->
-//! [H5O_info2_t_snip]
-
-//! [H5O_native_info_t_snip]
-
-/* Native file format information struct for objects */
-/* (For H5Oget_native_info / H5Oget_native_info_by_name / H5Oget_native_info_by_idx) */
+//! <!-- [H5O_native_info_t_snip] -->
+/**
+ * Native file format information struct for objects.
+ * (For H5Oget_native_info(), H5Oget_native_info_by_name(), H5Oget_native_info_by_idx())
+ */
typedef struct H5O_native_info_t {
- H5O_hdr_info_t hdr; /* Object header information */
- /* Extra metadata storage for obj & attributes */
+ H5O_hdr_info_t hdr; /**< Object header information */
struct {
- H5_ih_info_t obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
- H5_ih_info_t attr; /* v2 B-tree & heap for attributes */
- } meta_size;
+ H5_ih_info_t obj; /**< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
+ H5_ih_info_t attr; /**< v2 B-tree & heap for attributes */
+ } meta_size; /**< Extra metadata storage for obj & attributes */
} H5O_native_info_t;
+//! <!-- [H5O_native_info_t_snip] -->
-//! [H5O_native_info_t_snip]
-
-/* Typedef for message creation indexes */
+/**
+ * Typedef for message creation indexes
+ */
typedef uint32_t H5O_msg_crt_idx_t;
-/* Prototype for H5Ovisit/H5Ovisit_by_name() operator (version 3) */
-//! [H5O_iterate2_t_snip]
-
+//! <!-- [H5O_iterate2_t_snip] -->
+/**
+ * Prototype for H5Ovisit(), H5Ovisit_by_name() operator (version 3)
+ *
+ * \param[in] obj Object that serves as the root of the iteration;
+ * the same value as the H5Ovisit3() \c obj_id parameter
+ * \param[in] name Name of object, relative to \p obj, being examined at current
+ * step of the iteration
+ * \param[out] info Information about that object
+ * \param[in,out] op_data User-defined pointer to data required by the application
+ * in processing the object; a pass-through of the \c op_data
+ * pointer provided with the H5Ovisit3() function call
+ * \return \herr_t_iter
+ *
+ */
typedef herr_t (*H5O_iterate2_t)(hid_t obj, const char *name, const H5O_info2_t *info, void *op_data);
+//! <!-- [H5O_iterate2_t_snip] -->
-//! [H5O_iterate2_t_snip]
-
+//! <!-- [H5O_mcdt_search_ret_t_snip] -->
typedef enum H5O_mcdt_search_ret_t {
- H5O_MCDT_SEARCH_ERROR = -1, /* Abort H5Ocopy */
- H5O_MCDT_SEARCH_CONT, /* Continue the global search of all committed datatypes in the destination file */
- H5O_MCDT_SEARCH_STOP /* Stop the search, but continue copying. The committed datatype will be copied but
- not merged. */
+ H5O_MCDT_SEARCH_ERROR = -1, /**< Abort H5Ocopy */
+ H5O_MCDT_SEARCH_CONT, /**< Continue the global search of all committed datatypes in the destination file
+ */
+ H5O_MCDT_SEARCH_STOP /**< Stop the search, but continue copying. The committed datatype will be copied
+ but not merged. */
} H5O_mcdt_search_ret_t;
+//! <!-- [H5O_mcdt_search_ret_t_snip] -->
-/* Callback to invoke when completing the search for a matching committed datatype from the committed dtype
- * list */
+//! <!-- [H5O_mcdt_search_cb_t_snip] -->
+/**
+ * Callback to invoke when completing the search for a matching committed
+ * datatype from the committed dtype list
+ */
typedef H5O_mcdt_search_ret_t (*H5O_mcdt_search_cb_t)(void *op_data);
+//! <!-- [H5O_mcdt_search_cb_t_snip] -->
/********************/
/* Public Variables */
@@ -249,6 +269,11 @@ extern "C" {
*
*/
H5_DLL hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Oopen}
+ */
H5_DLL hid_t H5Oopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t lapl_id, hid_t es_id);
@@ -332,6 +357,11 @@ H5_DLL hid_t H5Oopen_by_token(hid_t loc_id, H5O_token_t token);
*/
H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t n, hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Oopen_by_idx}
+ */
H5_DLL hid_t H5Oopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
hsize_t n, hid_t lapl_id, hid_t es_id);
@@ -442,28 +472,7 @@ H5_DLL htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id);
* \return \herr_t
*
* \details H5Oget_info3() specifies an object by its identifier, \p loc_id , and
- * retrieves the metadata describing that object in \p oinfo , an H5O_info2_t \c struct.
- *
- * The H5O_info2_t \c struct is defined in H5Opublic.h as follows :
- * \snippet this H5O_info2_t_snip
- *
- * Note the following about H5O_info2_t :
- * - Of the four time fields (\c atime, \c mtime, \c ctime, and \c btime)
- * only \c ctime has been implemented.
- * - The \c atime value is the last time the object was read or written.
- * - The \c mtime value is the last time the raw data in the object was changed.
- * - The \c ctime value is the last time the metadata for the object was changed.
- * - The \c btime value is the time the object was created.
- *
- * The H5O_token_t is defined in H5public.h as follows:
- * \snippet H5public.h H5O_token_t_snip
- *
- * The H5O_type_t \c enum indicates the object type and
- * is defined in H5Opublic.h as follows:
- * \snippet this H5O_type_t_snip
- *
- * Note that the object retrieved as indicated by \p loc_id
- * refers only to the types specified by H5O_type_t.
+ * retrieves the metadata describing that object in \p oinfo.
*
* The \p fields parameter contains flags to determine which fields will be filled in
* the H5O_info2_t \c struct returned in \p oinfo.
@@ -512,29 +521,6 @@ H5_DLL herr_t H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo, unsigned fields);
* \p loc_id and \p name, respectively, and retrieves the metadata
* describing that object in \p oinfo, an H5O_info2_t struct.
*
- * \p oinfo, in which the object information is returned, is a \c struct of
- * type H5O_info2_t, which is defined in H5Opublic.h in the HDF5 source code:
- *
- * \snippet this H5O_info2_t_snip
- *
- * Note the following about H5O_info2_t :
- * - Of the four time fields (\c atime, \c mtime, \c ctime, and \c btime)
- * only \c ctime has been implemented.
- * - The \c atime value is the last time the object was read or written.
- * - The \c mtime value is the last time the raw data in the object was changed.
- * - The \c ctime value is the last time the metadata for the object was changed.
- * - The \c btime value is the time the object was created.
- *
- * The H5O_token_t is defined in H5public.h as follows:
- * \snippet H5public.h H5O_token_t_snip
- *
- * The H5O_type_t \c enum indicates the object type and
- * is defined in H5Opublic.h as follows:
- * \snippet this H5O_type_t_snip
- *
- * Note that the object retrieved as indicated by \p loc_id
- * refers only to the types specified by H5O_type_t.
- *
* The \p fields parameter contains flags to determine which fields will be filled in
* the H5O_info2_t \c struct returned in \p oinfo.
* These flags are defined in the H5Opublic.h file:
@@ -553,6 +539,11 @@ H5_DLL herr_t H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo, unsigned fields);
*/
H5_DLL herr_t H5Oget_info_by_name3(hid_t loc_id, const char *name, H5O_info2_t *oinfo, unsigned fields,
hid_t lapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Oget_info_by_name}
+ */
H5_DLL herr_t H5Oget_info_by_name_async(const char *app_file, const char *app_func, unsigned app_line,
hid_t loc_id, const char *name, H5O_info2_t *oinfo /*out*/,
unsigned fields, hid_t lapl_id, hid_t es_id);
@@ -585,34 +576,6 @@ H5_DLL herr_t H5Oget_info_by_name_async(const char *app_file, const char *app_fu
* If \p loc_id fully specifies the group in which the object resides,
* \p group_name can be a dot (\c .).
*
- * \p idx_type is of type #H5_index_t, defined in H5public.h as:
- * \snippet H5public.h H5_index_t_snip
- *
- * \p order is of type #H5_iter_order_t defined in H5public.h as:
- * \snippet H5public.h H5_iter_order_t_snip
- *
- * \p oinfo, in which the object information is returned, is a \c struct of
- * type H5O_info2_t, which is defined in H5Opublic.h in the HDF5 source code:
- * \snippet this H5O_info2_t_snip
- *
- * Note the following about H5O_info2_t :
- * - Of the four time fields (\c atime, \c mtime, \c ctime, and \c btime)
- * only \c ctime has been implemented.
- * - The \c atime value is the last time the object was read or written.
- * - The \c mtime value is the last time the raw data in the object was changed.
- * - The \c ctime value is the last time the metadata for the object was changed.
- * - The \c btime value is the time the object was created.
- *
- * H5O_token_t is defined in H5public.h as follows:
- * \snippet H5public.h H5O_token_t_snip
- *
- * The #H5O_type_t \c enum indicates the object type and
- * is defined in H5Opublic.h as follows:
- * \snippet this H5O_type_t_snip
- *
- * Note that the object retrieved as indicated by \p loc_id
- * refers only to the types specified by #H5O_type_t.
- *
* The \p fields parameter contains flags to determine which fields will be filled in
* the H5O_info2_t \c struct returned in \p oinfo.
* These flags are defined in the H5Opublic.h file:
@@ -645,11 +608,7 @@ H5_DLL herr_t H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index
* \return \herr_t
*
* \details H5Oget_native_info() retrieves the native file format information for an object
- * specified by \p loc_id. The information is retrieved into the
- * buffer specified by \p oinfo, which is defined as a \c struct of
- * type H5O_native_info_t in H5Opublic.h:
- *
- * \snippet this H5O_native_info_t_snip
+ * specified by \p loc_id.
*
* The \p fields parameter indicates which fields to fill in
* H5O_native_info_t. Possible values defined in H5Opublic.h are:
@@ -680,12 +639,9 @@ H5_DLL herr_t H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo, unsigne
*
* \return \herr_t
*
- * \details H5Oget_native_info_by_name() retrieves the native file format information for an object
- * specified by \p loc_id and the name \p name. The information is
- * retrieved into the buffer specified by \p oinfo, which is defined
- * as a \c struct of type H5O_native_info_t in H5Opublic.h:
- *
- * \snippet this H5O_native_info_t_snip
+ * \details H5Oget_native_info_by_name() retrieves the native file format
+ * information for an object specified by \p loc_id and the name \p
+ * name.
*
* The \p fields parameter which fields to fill in H5O_native_info_t.
* Possible values defined in H5Opublic.h are:
@@ -724,16 +680,7 @@ H5_DLL herr_t H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_nat
* specified by \p loc_id, group name, \p group_name, the index by which
* objects in the group are tracked, \p idx_type, the order by which
* the index is to be traversed, \p order , and an object's position
- * \p n within that index. The information is retrieved into the
- * buffer specified by \p oinfo, which is defined as a \c struct of
- * type H5O_native_info_t in H5Opublic.h:
- * \snippet this H5O_native_info_t_snip
- *
- * \p idx_type is of type #H5_index_t, defined in H5public.h as:
- * \snippet H5public.h H5_index_t_snip
- *
- * \p order is of type #H5_iter_order_t defined in H5public.h as:
- * \snippet H5public.h H5_iter_order_t_snip
+ * \p n within that index.
*
* The \p fields parameter indicates which fields to fill in H5O_native_info_t.
* Possible values defined in H5Opublic.h are:
@@ -968,7 +915,6 @@ H5_DLL herr_t H5Odecr_refcount(hid_t object_id);
* - H5Pset_copy_object()
* - H5Pset_create_intermediate_group()
* - H5Pset_mcdt_search_cb()
- * .
* - Copying Committed Datatypes with #H5Ocopy - A comprehensive
* discussion of copying committed datatypes (PDF) in
* Advanced Topics in HDF5
@@ -980,6 +926,11 @@ H5_DLL herr_t H5Odecr_refcount(hid_t object_id);
*/
H5_DLL herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name,
hid_t ocpypl_id, hid_t lcpl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Ocopy}
+ */
H5_DLL herr_t H5Ocopy_async(const char *app_file, const char *app_func, unsigned app_line, hid_t src_loc_id,
const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t ocpypl_id,
hid_t lcpl_id, hid_t es_id);
@@ -1209,11 +1160,8 @@ H5_DLL ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comm
* a group have not been indexed by the index type, they will
* first be sorted by that index then the iteration will begin;
* if the links have been so indexed, the sorting step will be
- * unnecessary, so the iteration may begin more quickly. Valid
- * values include the following:
- *
- * \indexes
- *
+ * unnecessary, so the iteration may begin more quickly.
+
* Note that the index type passed in \p idx_type is a
* <em>best effort</em> setting. If the application passes in
* a value indicating iteration in creation order and a group is
@@ -1223,62 +1171,7 @@ H5_DLL ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comm
* used by the HDF5 library and is always available.)
*
* \p order specifies the order in which objects are to be inspected
- * along the index specified in \p idx_type. Valid values include
- * the following:
- *
- * \orders
- *
- * The prototype of the callback function op is as follows (as
- * defined in the source code file H5Opublic.h):
- *
- * \snippet this H5O_iterate2_t_snip
- *
- * The parameters of this callback function have the following values
- * or meanings:
- * <table>
- * <tr>
- * <td>\c obj</td>
- * <td>Object that serves as root of the iteration;
- * same value as the H5Ovisit() \p obj_id parameter</td>
- * </tr>
- * <tr>
- * <td>\c name</td>
- * <td>Name of object, relative to \c obj, being examined at
- * current step of the iteration</td>
- * </tr>
- * <tr>
- * <td>\c info</td>
- * <td>H5O_info2_t \c struct containing information
- * regarding that object</td>
- * </tr>
- * <tr>
- * <td>\c op_data</td>
- * <td>User-defined pointer to data required by the application in
- * processing the object; a pass-through of the \c op_data pointer
- * provided with the H5Ovisit() function call</td>
- * </tr>
- * </table>
- *
- * The H5O_info2_t \c struct is defined in H5Opublic.h as follows:
- * \snippet this H5O_info2_t_snip
- *
- * H5O_token_t is defined in H5public.h as follows:
- * \snippet H5public.h H5O_token_t_snip
- *
- * The #H5O_type_t enum indicates the object type and is
- * defined in H5Opublic.h as follows:
- * \snippet this H5O_type_t_snip
- *
- * Note that the object retrieved as indicated by \p obj_id
- * refers only to the types specified by #H5O_type_t.
- *
- * The return values from an operator are:
- * - Zero causes the visit iterator to continue, returning zero when all
- * group members have been processed.
- * - A positive value causes the visit iterator to immediately return that
- * positive value, indicating short-circuit success.
- * - A negative value causes the visit iterator to immediately return that
- * value, indicating failure.
+ * along the index specified in \p idx_type.
*
* The H5Ovisit3() \p op_data parameter is a user-defined pointer to the data
* required to process objects in the course of the iteration. This pointer
@@ -1302,24 +1195,6 @@ H5_DLL ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comm
* group change during the iteration, the resulting behavior
* is undefined.
*
- * \note \Bold{Programming Note for C++ Developers Using C Functions:}
- * \note If a C routine that takes a function pointer as an argument is
- * called from within C++ code, the C routine should be returned
- * from normally.
- *
- * \note Examples of this kind of routine include callbacks such as
- * H5Pset_elink_cb() and H5Pset_type_conv_cb() and
- * functions such as H5Tconvert() and H5Ewalk2().
- *
- * \note Exiting the routine in its normal fashion allows the HDF5
- * C library to clean up its work properly. In other words, if
- * the C++ application jumps out of the routine back to the C++
- * “catch” statement, the library is not given the opportunity
- * to close any temporary data structures that were set up when
- * the routine was called. The C++ application should save some
- * state as the routine is started so that any problem that occurs
- * might be diagnosed.
- *
* \par Example
* An example snippet from test/links.c:
* \snippet links.c H5Ovisit3_snip
@@ -1384,10 +1259,7 @@ H5_DLL herr_t H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* a group have not been indexed by the index type, they will
* first be sorted by that index then the iteration will begin;
* if the links have been so indexed, the sorting step will be
- * unnecessary, so the iteration may begin more quickly. Valid
- * values include the following:
- *
- * \indexes
+ * unnecessary, so the iteration may begin more quickly.
*
* Note that the index type passed in \p idx_type is a
* <em>best effort</em> setting. If the application passes in a
@@ -1398,49 +1270,7 @@ H5_DLL herr_t H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* used by the HDF5 library and is always available.)
*
* \p order specifies the order in which objects are to be inspected
- * along the index specified in \p idx_type. Valid values include
- * the following:
- *
- * \orders
- *
- * The prototype of the callback function op is as follows (as
- * defined in the source code file H5Opublic.h):
- *
- * \snippet this H5O_iterate2_t_snip
- *
- * The parameters of this callback function have the following
- * values or meanings:
- * <table>
- * <tr>
- * <td>\c obj</td>
- * <td>Object that serves as root of the iteration</td>
- * </tr>
- * <tr>
- * <td>\c name</td>
- * <td>Name of object, relative to \c obj, being examined at
- * current step of the iteration</td>
- * </tr>
- * <tr>
- * <td>\c info</td>
- * <td>H5O_info2_t \c struct containing information
- * regarding that object</td>
- * </tr>
- * <tr>
- * <td>\c op_data</td>
- * <td>User-defined pointer to data required by the application in
- * processing the object</td>
- * </tr>
- * </table>
- *
- * The H5O_info2_t \c struct is defined in H5Opublic.h as follows:
- * \snippet this H5O_info2_t_snip
- *
- * H5O_token_t is defined in H5public.h as follows:
- * \snippet H5public.h H5O_token_t_snip
- *
- * The #H5O_type_t enum indicates the object type and is
- * defined in H5Opublic.h as follows:
- * \snippet this H5O_type_t_snip
+ * along the index specified in \p idx_type.
*
* The H5Ovisit_by_name3() \p op_data parameter is a user-defined
* pointer to the data required to process objects in the course
@@ -1468,24 +1298,6 @@ H5_DLL herr_t H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* in the file has been presented to the application for whatever
* processing the application requires.
*
- * \note \Bold{Programming Note for C++ Developers Using C Functions:}
- * \note If a C routine that takes a function pointer as an argument is
- * called from within C++ code, the C routine should be returned
- * from normally.
- *
- * \note Examples of this kind of routine include callbacks such as
- * H5Pset_elink_cb() and H5Pset_type_conv_cb() and
- * functions such as H5Tconvert() and H5Ewalk2().
- *
- * \note Exiting the routine in its normal fashion allows the HDF5
- * C library to clean up its work properly. In other words, if
- * the C++ application jumps out of the routine back to the C++
- * “catch” statement, the library is not given the opportunity
- * to close any temporary data structures that were set up when
- * the routine was called. The C++ application should save some
- * state as the routine is started so that any problem that occurs
- * might be diagnosed.
- *
* \par Example
* An example snippet from test/links.c:
* \snippet links.c H5Ovisit_by_name3_snip
@@ -1522,6 +1334,11 @@ H5_DLL herr_t H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t i
*
*/
H5_DLL herr_t H5Oclose(hid_t object_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Oclose}
+ */
H5_DLL herr_t H5Oclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t object_id,
hid_t es_id);
@@ -1547,31 +1364,21 @@ H5_DLL herr_t H5Oclose_async(const char *app_file, const char *app_func, unsigne
* files. After that, the OS is responsible for ensuring that
* the data is actually flushed to disk.
*
- * \par See Also:
- * - H5Dflush()
- * - H5Drefresh()
- * - H5Oflush()
- * - H5Grefresh()
- * - H5Oflush()
- * - H5Orefresh()
- * - H5Tflush()
- * - H5Trefresh()
- * \par
- * - \c H5DOappend()
- * - H5Fstart_swmr_write()
- * - H5Pget_append_flush()
- * - H5Pget_object_flush_cb()
- * - H5Pset_append_flush()
- * - H5Pset_object_flush_cb()
- * \par
- * - H5Oare_mdc_flushes_disabled()
- * - H5Odisable_mdc_flushes()
- * - H5Oenable_mdc_flushes()
+ * \see H5Dflush(), H5Drefresh(), H5Oflush(), H5Grefresh(), H5Oflush(),
+ * H5Orefresh(), H5Tflush(), H5Trefresh()
+ * \see H5DOappend(), H5Fstart_swmr_write(), H5Pget_append_flush(),
+ * H5Pget_object_flush_cb(), H5Pset_append_flush(), H5Pset_object_flush_cb()
+ * \see H5Oare_mdc_flushes_disabled(), H5Odisable_mdc_flushes(), H5Oenable_mdc_flushes()
*
* \since 1.10.0
*
*/
H5_DLL herr_t H5Oflush(hid_t obj_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Oflush}
+ */
H5_DLL herr_t H5Oflush_async(const char *app_file, const char *app_func, unsigned app_line, hid_t obj_id,
hid_t es_id);
/**
@@ -1599,6 +1406,11 @@ H5_DLL herr_t H5Oflush_async(const char *app_file, const char *app_func, unsigne
*
*/
H5_DLL herr_t H5Orefresh(hid_t oid);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Orefresh}
+ */
H5_DLL herr_t H5Orefresh_async(const char *app_file, const char *app_func, unsigned app_line, hid_t oid,
hid_t es_id);
@@ -1628,21 +1440,17 @@ H5_DLL herr_t H5Orefresh_async(const char *app_file, const char *app_func, unsig
* HDF5 object level (datasets, groups, committed datatypes)
* and the entire metadata cache level.
*
- * \note HDF5 objects include datasets, groups, and committed datatypes.
- * Only #hid_t identifiers that represent these objects can be passed to the function.
- * \note Passing in a #hid_t identifier that represents any other HDF5 entity is
- * considered an error.
- * \note It is an error to pass an HDF5 file identifier
- * (obtained from H5Fopen() or H5Fcreate())
- * to this function.
- * \note Misuse of this function can cause the cache to exhaust
- * available memory.
- * \note Objects can be returned to the default automatic flush behavior
- * with H5Oenable_mdc_flushes().
- * \note Flush prevention only pertains to new or dirty metadata entries.
- * Clean entries can be evicted from the cache.
- * \note Calling this function on an object that has already had flushes
- * disabled will return an error.
+ * \note HDF5 objects include datasets, groups, and committed datatypes. Only
+ * #hid_t identifiers that represent these objects can be passed to the
+ * function. Passing in a #hid_t identifier that represents any other
+ * HDF5 entity is considered an error. It is an error to pass an HDF5
+ * file identifier (obtained from H5Fopen() or H5Fcreate()) to this
+ * function. Misuse of this function can cause the cache to exhaust
+ * available memory. Objects can be returned to the default automatic
+ * flush behavior with H5Oenable_mdc_flushes(). Flush prevention only
+ * pertains to new or dirty metadata entries. Clean entries can be
+ * evicted from the cache. Calling this function on an object that has
+ * already had flushes disabled will return an error.
*
* \since 1.10.0
*
@@ -1672,28 +1480,18 @@ H5_DLL herr_t H5Odisable_mdc_flushes(hid_t object_id);
* metadata cache level.
*
*
- * \note HDF5 objects include datasets, groups, and committed datatypes.
- * Only #hid_t identifiers that represent these objects can be
- * passed to the function.
- *
- * \note Passing in a #hid_t identifier that represents any other HDF5 entity
- * is considered an error.
- *
- * \note It is an error to pass an HDF5 file identifier
- * (obtained from H5Fopen() or H5Fcreate())
- * to this function.
- *
- * \note Using this function on an object that has not had flushes disabled
- * is considered an error. The state of an object can be determined
- * with H5Oare_mdc_flushes_disabled().
- *
- * \note An object will be returned to the default flush algorithm when it is closed.
- *
- * \note All objects will be returned to the default flush algorithm when
- * the file is closed.
- *
- * \note An object’s entries will not necessarily be flushed as a result of
- * calling this function.
+ * \note HDF5 objects include datasets, groups, and committed datatypes. Only
+ * #hid_t identifiers that represent these objects can be passed to the
+ * function. Passing in a #hid_t identifier that represents any other
+ * HDF5 entity is considered an error. It is an error to pass an HDF5
+ * file identifier (obtained from H5Fopen() or H5Fcreate()) to this
+ * function. Using this function on an object that has not had flushes
+ * disabled is considered an error. The state of an object can be
+ * determined with H5Oare_mdc_flushes_disabled(). An object will be
+ * returned to the default flush algorithm when it is closed. All objects
+ * will be returned to the default flush algorithm when the file is
+ * closed. An object’s entries will not necessarily be flushed as a
+ * result of calling this function.
*
* \since 1.10.0
*
@@ -1829,6 +1627,7 @@ H5_DLL herr_t H5Otoken_to_str(hid_t loc_id, const H5O_token_t *token, char **tok
*/
H5_DLL herr_t H5Otoken_from_str(hid_t loc_id, const char *token_str, H5O_token_t *token);
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -1852,6 +1651,7 @@ H5_DLL herr_t H5Otoken_from_str(hid_t loc_id, const char *token_str, H5O_token_t
#define H5Orefresh_async_wrap H5_NO_EXPAND(H5Orefresh_async)
#define H5Ocopy_async_wrap H5_NO_EXPAND(H5Ocopy_async)
#endif
+/// \endcond
/* The canonical 'undefined' token value */
#define H5O_TOKEN_UNDEF (H5OPEN H5O_TOKEN_UNDEF_g)
@@ -1866,53 +1666,66 @@ H5_DLLVAR const H5O_token_t H5O_TOKEN_UNDEF_g;
/* Macros */
/* Deprecated flags for earlier versions of H5Oget_info* */
-#define H5O_INFO_HDR 0x0008u /* Fill in the hdr field */
-#define H5O_INFO_META_SIZE 0x0010u /* Fill in the meta_size field */
+#define H5O_INFO_HDR 0x0008u /**< Fill in the hdr field */
+#define H5O_INFO_META_SIZE 0x0010u /**< Fill in the meta_size field */
#undef H5O_INFO_ALL
#define H5O_INFO_ALL (H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS | H5O_INFO_HDR | H5O_INFO_META_SIZE)
/* Typedefs */
-/* A struct that's part of the H5G_stat_t structure (deprecated) */
-//! [H5O_stat_t_snip]
+//! <!-- [H5O_stat_t_snip] -->
+/**
+ * A struct that's part of the \ref H5G_stat_t structure
+ * \deprecated
+ */
typedef struct H5O_stat_t {
- hsize_t size; /* Total size of object header in file */
- hsize_t free; /* Free space within object header */
- unsigned nmesgs; /* Number of object header messages */
- unsigned nchunks; /* Number of object header chunks */
+ hsize_t size; /**< Total size of object header in file */
+ hsize_t free; /**< Free space within object header */
+ unsigned nmesgs; /**< Number of object header messages */
+ unsigned nchunks; /**< Number of object header chunks */
} H5O_stat_t;
-//! [H5O_stat_t_snip]
+//! <!-- [H5O_stat_t_snip] -->
-//! [H5O_info1_t_snip]
-
-/* Information struct for object */
-/* (For H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx versions 1 & 2) */
+//! <!-- [H5O_info1_t_snip] -->
+/**
+ * Information struct for object (For H5Oget_info(), H5Oget_info_by_name(),
+ * H5Oget_info_by_idx() versions 1 & 2.)
+ */
typedef struct H5O_info1_t {
- unsigned long fileno; /* File number that object is located in */
- haddr_t addr; /* Object address in file */
- H5O_type_t type; /* Basic object type (group, dataset, etc.) */
- unsigned rc; /* Reference count of object */
- time_t atime; /* Access time */
- time_t mtime; /* Modification time */
- time_t ctime; /* Change time */
- time_t btime; /* Birth time */
- hsize_t num_attrs; /* # of attributes attached to object */
- H5O_hdr_info_t hdr; /* Object header information */
+ unsigned long fileno; /**< File number that object is located in */
+ haddr_t addr; /**< Object address in file */
+ H5O_type_t type; /**< Basic object type (group, dataset, etc.) */
+ unsigned rc; /**< Reference count of object */
+ time_t atime; /**< Access time */
+ time_t mtime; /**< Modification time */
+ time_t ctime; /**< Change time */
+ time_t btime; /**< Birth time */
+ hsize_t num_attrs; /**< Number of attributes attached to object */
+ H5O_hdr_info_t hdr; /**< Object header information */
/* Extra metadata storage for obj & attributes */
struct {
- H5_ih_info_t obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
- H5_ih_info_t attr; /* v2 B-tree & heap for attributes */
+ H5_ih_info_t obj; /**< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
+ H5_ih_info_t attr; /**< v2 B-tree & heap for attributes */
} meta_size;
} H5O_info1_t;
+//! <!-- [H5O_info1_t_snip] -->
-//! [H5O_info1_t_snip]
-
-/* Prototype for H5Ovisit/H5Ovisit_by_name() operator (versions 1 & 2) */
-//! [H5O_iterate1_t_snip]
-
+//! <!-- [H5O_iterate1_t_snip] -->
+/**
+ * Prototype for H5Ovisit(), H5Ovisit_by_name() operator (versions 1 & 2)
+ *
+ * \param[in] obj Object that serves as the root of the iteration;
+ * the same value as the H5Ovisit1() \c obj_id parameter
+ * \param[in] name Name of object, relative to \p obj, being examined at current
+ * step of the iteration
+ * \param[out] info Information about that object
+ * \param[in,out] op_data User-defined pointer to data required by the application
+ * in processing the object
+ * \return \herr_t_iter
+ *
+ */
typedef herr_t (*H5O_iterate1_t)(hid_t obj, const char *name, const H5O_info1_t *info, void *op_data);
-
-//! [H5O_iterate1_t_snip]
+//! <!-- [H5O_iterate1_t_snip] -->
/* Function prototypes */
@@ -1982,36 +1795,7 @@ H5_DLL hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr);
* the function H5Oget_info3() or the macro #H5Oget_info.
*
* \details H5Oget_info1() specifies an object by its identifier, \p loc_id , and
- * retrieves the metadata describing that object in \p oinfo ,
- * defined as a \c struct of type H5O_info1_t :
- *
- * \snippet this H5O_info1_t_snip
- *
- * Note the following about H5O_info1_t :
- * - Of the four time fields (\c atime, \c mtime, \c ctime, and \c btime)
- * only \c ctime has been implemented.
- * - The \c atime value is the last time the object was read or written.
- * - The \c mtime value is the last time the raw data in the object was changed.
- * - The \c ctime value is the last time the metadata for the object was changed.
- * - The \c btime value is the time the object was created.
- * - The fields nested in the \c meta_size field are for internal library use only.
- *
- * The #H5O_type_t \c enum indicates the object type and
- * is defined in H5Opublic.h as follows:
- * \snippet this H5O_type_t_snip
- *
- * Note that the object retrieved as indicated by \p loc_id
- * refers only to the types specified by #H5O_type_t.
- *
- * An H5O_hdr_info_t \c struct holds object header metadata and is
- * defined in H5Opublic.h as follows:
- * \snippet this H5O_hdr_info_t_snip
- *
- * Valid values for the \c version field are \c H5O_VERSION_1 and \c H5O_VERSION_2.
- * Version 2 of the object header is smaller and more efficient than version 1.
- *
- * Please be aware that the information held by H5O_hdr_info_t may only be useful to
- * developers with extensive HDF5 experience.
+ * retrieves the metadata describing that object in \p oinfo.
*
* \note If you are iterating through a lot of different objects to
* retrieve information via the H5Oget_info() family of routines,
@@ -2111,16 +1895,6 @@ H5_DLL herr_t H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *
* If \p loc_id fully specifies the group in which the object resides,
* \p group_name can be a dot (\c .).
*
- * \p idx_type is of type #H5_index_t, defined in H5public.h as:
- * \snippet H5public.h H5_index_t_snip
- *
- * \p order is of type #H5_iter_order_t defined in H5public.h as:
- * \snippet H5public.h H5_iter_order_t_snip
- *
- * \p oinfo, in which the object information is returned, is a \c struct of
- * type H5O_info1_t .
- * \snippet this H5O_info1_t_snip
- *
* The link access property list, \c lapl_id, is not currently used;
* it should be passed in as #H5P_DEFAULT.
*
@@ -2316,10 +2090,7 @@ H5_DLL herr_t H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index
* a group have not been indexed by the index type, they will
* first be sorted by that index then the iteration will begin;
* if the links have been so indexed, the sorting step will be
- * unnecessary, so the iteration may begin more quickly. Valid
- * values include the following:
- *
- * \indexes
+ * unnecessary, so the iteration may begin more quickly.
*
* Note that the index type passed in \p idx_type is a
* <em>best effort</em> setting. If the application passes in
@@ -2330,56 +2101,7 @@ H5_DLL herr_t H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index
* used by the HDF5 library and is always available.)
*
* \p order specifies the order in which objects are to be inspected
- * along the index specified in \p idx_type. Valid values include
- * the following:
- *
- * \orders
- *
- * The prototype of the callback function op is as follows (as
- * defined in the source code file H5Opublic.h):
- *
- * \snippet this H5O_iterate1_t_snip
- *
- * The parameters of this callback function have the following values
- * or meanings:
- * <table>
- * <tr>
- * <td>\c obj</td>
- * <td>Object that serves as root of the iteration;
- * same value as the H5Ovisit1() \p obj_id parameter</td>
- * </tr>
- * <tr>
- * <td>\c name</td>
- * <td>Name of object, relative to \c obj, being examined at
- * current step of the iteration</td>
- * </tr>
- * <tr>
- * <td>\c info</td>
- * <td>H5O_info1_t \c struct containing information
- * regarding that object</td>
- * </tr>
- * <tr>
- * <td>\c op_data</td>
- * <td>User-defined pointer to data required by the application in
- * processing the object</td>
- * </tr>
- * </table>
- *
- * The H5O_info1_t \c struct is defined in H5Opublic.h:
- * \snippet this H5O_info1_t_snip
- *
- * The return values from an operator are:
- * - Zero causes the visit iterator to continue, returning zero when all
- * group members have been processed.
- * - A positive value causes the visit iterator to immediately return that
- * positive value, indicating short-circuit success.
- * - A negative value causes the visit iterator to immediately return that
- * value, indicating failure.
- *
- * The H5Ovisit1() \p op_data parameter is a user-defined pointer to the data
- * required to process objects in the course of the iteration. This pointer
- * is passed back to each step of the iteration in the callback
- * function’s \p op_data parameter.
+ * along the index specified in \p idx_type.
*
* H5Lvisit1() and H5Ovisit1() are companion functions: one for
* examining and operating on links; the other for examining
@@ -2393,24 +2115,6 @@ H5_DLL herr_t H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index
* group change during the iteration, the resulting behavior
* is undefined.
*
- * \note \Bold{Programming Note for C++ Developers Using C Functions:}
- * \note If a C routine that takes a function pointer as an argument is
- * called from within C++ code, the C routine should be returned
- * from normally.
- *
- * \note Examples of this kind of routine include callbacks such as
- * H5Pset_elink_cb() and H5Pset_type_conv_cb() and
- * functions such as H5Tconvert() and H5Ewalk2().
- *
- * \note Exiting the routine in its normal fashion allows the HDF5
- * C library to clean up its work properly. In other words, if
- * the C++ application jumps out of the routine back to the C++
- * “catch” statement, the library is not given the opportunity
- * to close any temporary data structures that were set up when
- * the routine was called. The C++ application should save some
- * state as the routine is started so that any problem that occurs
- * might be diagnosed.
- *
* \version 1.10.5 The macro #H5Ovisit was removed and the function
* H5Ovisit1() was copied to H5Ovisit().
* \version 1.10.3 Function H5Ovisit() was copied to H5Ovisit1(),
@@ -2478,10 +2182,7 @@ H5_DLL herr_t H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* a group have not been indexed by the index type, they will
* first be sorted by that index then the iteration will begin;
* if the links have been so indexed, the sorting step will be
- * unnecessary, so the iteration may begin more quickly. Valid
- * values include the following:
- *
- * \indexes
+ * unnecessary, so the iteration may begin more quickly.
*
* Note that the index type passed in \p idx_type is a
* <em>best effort</em> setting. If the application passes in a
@@ -2492,10 +2193,7 @@ H5_DLL herr_t H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* used by the HDF5 library and is always available.)
*
* \p order specifies the order in which objects are to be inspected
- * along the index specified in \p idx_type. Valid values include
- * the following:
- *
- * \orders
+ * along the index specified in \p idx_type.
*
* The \p op callback function and the effect of the callback
* function’s return value on the application are described
@@ -2525,24 +2223,6 @@ H5_DLL herr_t H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* in the file has been presented to the application for whatever
* processing the application requires.
*
- * \note \Bold{Programming Note for C++ Developers Using C Functions:}
- * \note If a C routine that takes a function pointer as an argument is
- * called from within C++ code, the C routine should be returned
- * from normally.
- *
- * \note Examples of this kind of routine include callbacks such as
- * H5Pset_elink_cb() and H5Pset_type_conv_cb() and
- * functions such as H5Tconvert() and H5Ewalk2().
- *
- * \note Exiting the routine in its normal fashion allows the HDF5
- * C library to clean up its work properly. In other words, if
- * the C++ application jumps out of the routine back to the C++
- * “catch” statement, the library is not given the opportunity
- * to close any temporary data structures that were set up when
- * the routine was called. The C++ application should save some
- * state as the routine is started so that any problem that occurs
- * might be diagnosed.
- *
* \version 1.10.5 The macro #H5Ovisit_by_name was removed and the function
* H5Ovisit_by_name1() was copied to #H5Ovisit_by_name.
* \version 1.10.3 The H5Ovisit_by_name() function was renamed to H5Ovisit_by_name1(),
@@ -2605,10 +2285,7 @@ H5_DLL herr_t H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t i
* a group have not been indexed by the index type, they will
* first be sorted by that index then the iteration will begin;
* if the links have been so indexed, the sorting step will be
- * unnecessary, so the iteration may begin more quickly. Valid
- * values include the following:
- *
- * \indexes
+ * unnecessary, so the iteration may begin more quickly.
*
* Note that the index type passed in \p idx_type is a
* <em>best effort</em> setting. If the application passes in
@@ -2619,57 +2296,7 @@ H5_DLL herr_t H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t i
* used by the HDF5 library and is always available.)
*
* \p order specifies the order in which objects are to be inspected
- * along the index specified in \p idx_type. Valid values include
- * the following:
- *
- * \orders
- *
- * The prototype of the callback function op is as follows (as
- * defined in the source code file H5Opublic.h):
- *
- * \snippet this H5O_iterate1_t_snip
- *
- * The parameters of this callback function have the following values
- * or meanings:
- * <table>
- * <tr>
- * <td>\c obj</td>
- * <td>Object that serves as root of the iteration;
- * same value as the H5Ovisit1() \p obj_id parameter</td>
- * </tr>
- * <tr>
- * <td>\c name</td>
- * <td>Name of object, relative to \c obj, being examined at
- * current step of the iteration</td>
- * </tr>
- * <tr>
- * <td>\c info</td>
- * <td>H5O_info1_t \c struct containing information
- * regarding that object</td>
- * </tr>
- * <tr>
- * <td>\c op_data</td>
- * <td>User-defined pointer to data required by the application in
- * processing the object; a pass-through of the \c op_data pointer
- * provided with the H5Ovisit() function call</td>
- * </tr>
- * </table>
- *
- * The H5O_info1_t \c struct is defined in H5Opublic.h and
- * described in the H5Oget_info1() function entry.
- *
- * The return values from an operator are:
- * - Zero causes the visit iterator to continue, returning zero when all
- * group members have been processed.
- * - A positive value causes the visit iterator to immediately return that
- * positive value, indicating short-circuit success.
- * - A negative value causes the visit iterator to immediately return that
- * value, indicating failure.
- *
- * The H5Ovisit2() \p op_data parameter is a user-defined pointer to the data
- * required to process objects in the course of the iteration. This pointer
- * is passed back to each step of the iteration in the callback
- * function’s \p op_data parameter.
+ * along the index specified in \p idx_type.
*
* The \p fields parameter contains flags to determine which fields will
* be retrieved by the \p op callback function. These flags are defined
@@ -2688,23 +2315,6 @@ H5_DLL herr_t H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t i
* group change during the iteration, the resulting behavior
* is undefined.
*
- * \note \Bold{Programming Note for C++ Developers Using C Functions:}
- * \note If a C routine that takes a function pointer as an argument is
- * called from within C++ code, the C routine should be returned
- * from normally.
- *
- * \note Examples of this kind of routine include callbacks such as
- * H5Pset_elink_cb() and H5Pset_type_conv_cb() and
- * functions such as H5Tconvert() and H5Ewalk2().
- *
- * \note Exiting the routine in its normal fashion allows the HDF5
- * C library to clean up its work properly. In other words, if
- * the C++ application jumps out of the routine back to the C++
- * “catch” statement, the library is not given the opportunity
- * to close any temporary data structures that were set up when
- * the routine was called. The C++ application should save some
- * state as the routine is started so that any problem that occurs
- * might be diagnosed.
*
* \since 1.10.3
*
@@ -2769,10 +2379,7 @@ H5_DLL herr_t H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* a group have not been indexed by the index type, they will
* first be sorted by that index then the iteration will begin;
* if the links have been so indexed, the sorting step will be
- * unnecessary, so the iteration may begin more quickly. Valid
- * values include the following:
- *
- * \indexes
+ * unnecessary, so the iteration may begin more quickly.
*
* Note that the index type passed in \p idx_type is a
* <em>best effort</em> setting. If the application passes in a
@@ -2783,10 +2390,7 @@ H5_DLL herr_t H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* used by the HDF5 library and is always available.)
*
* \p order specifies the order in which objects are to be inspected
- * along the index specified in \p idx_type. Valid values include
- * the following:
- *
- * \orders
+ * along the index specified in \p idx_type.
*
* The \p op callback function and the effect of the callback
* function’s return value on the application are described
@@ -2821,24 +2425,6 @@ H5_DLL herr_t H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order
* in the file has been presented to the application for whatever
* processing the application requires.
*
- * \note \Bold{Programming Note for C++ Developers Using C Functions:}
- * \note If a C routine that takes a function pointer as an argument is
- * called from within C++ code, the C routine should be returned
- * from normally.
- *
- * \note Examples of this kind of routine include callbacks such as
- * H5Pset_elink_cb() and H5Pset_type_conv_cb() and
- * functions such as H5Tconvert() and H5Ewalk2().
- *
- * \note Exiting the routine in its normal fashion allows the HDF5
- * C library to clean up its work properly. In other words, if
- * the C++ application jumps out of the routine back to the C++
- * “catch” statement, the library is not given the opportunity
- * to close any temporary data structures that were set up when
- * the routine was called. The C++ application should save some
- * state as the routine is started so that any problem that occurs
- * might be diagnosed.
- *
* \since 1.10.3
*
*/
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index 2cdf6ec..dab989f 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -106,12 +106,13 @@ H5FL_ARR_EXTERN(hsize_t);
--------------------------------------------------------------------------*/
static void *
H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
{
- H5S_extent_t *sdim = NULL; /* New extent dimensionality structure */
- unsigned flags, version;
- unsigned i; /* Local counting variable */
- void * ret_value = NULL; /* Return value */
+ H5S_extent_t * sdim = NULL; /* New extent dimensionality structure */
+ unsigned flags, version;
+ unsigned i; /* Local counting variable */
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -161,6 +162,13 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN
/* Decode dimension sizes */
if (sdim->rank > 0) {
+ /* Ensure that rank doesn't cause reading passed buffer's end,
+ due to possible data corruption */
+ uint8_t sizeof_size = H5F_SIZEOF_SIZE(f);
+ if (p + (sizeof_size * sdim->rank - 1) > p_end) {
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "rank might cause reading passed buffer's end")
+ }
+
if (NULL == (sdim->size = (hsize_t *)H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -170,6 +178,11 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN
if (flags & H5S_VALID_MAX) {
if (NULL == (sdim->max = (hsize_t *)H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+
+ /* Ensure that rank doesn't cause reading passed buffer's end */
+ if (p + (sizeof_size * sdim->rank - 1) > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "rank might cause reading passed buffer's end")
+
for (i = 0; i < sdim->rank; i++)
H5F_DECODE_LENGTH(f, p, sdim->max[i]);
} /* end if */
diff --git a/src/H5Oshared.h b/src/H5Oshared.h
index 0e774cf..f164db3 100644
--- a/src/H5Oshared.h
+++ b/src/H5Oshared.h
@@ -44,7 +44,7 @@
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE void *
+static inline void *
H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
const uint8_t *p)
{
@@ -103,7 +103,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE herr_t
+static inline herr_t
H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_shared_t *sh_mesg =
@@ -158,7 +158,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE size_t
+static inline size_t
H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg)
{
const H5O_shared_t *sh_mesg =
@@ -211,7 +211,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE herr_t
+static inline herr_t
H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg)
{
H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */
@@ -262,7 +262,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE herr_t
+static inline herr_t
H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg)
{
H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */
@@ -312,7 +312,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE void *
+static inline void *
H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size,
unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata)
{
@@ -375,7 +375,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE herr_t
+static inline herr_t
H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const void *mesg_src,
H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info)
{
@@ -445,7 +445,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE herr_t
+static inline herr_t
H5O_SHARED_DEBUG(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth)
{
const H5O_shared_t *sh_mesg =
diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h
index 1a8b307..2fc70c6 100644
--- a/src/H5PBprivate.h
+++ b/src/H5PBprivate.h
@@ -99,4 +99,4 @@ H5_DLL herr_t H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsig
unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]);
H5_DLL herr_t H5PB_print_stats(const H5PB_t *page_buf);
-#endif /* !_H5PBprivate_H */
+#endif /* H5PBprivate_H */
diff --git a/src/H5PL.c b/src/H5PL.c
index 06443f3..30b6c52 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -359,7 +359,7 @@ H5PLget(unsigned int idx, char *path_buf, size_t buf_size)
/* If the path buffer is not NULL, copy the path to the buffer */
if (path_buf) {
- HDstrncpy(path_buf, path, MIN((size_t)(path_len + 1), buf_size));
+ HDstrncpy(path_buf, path, buf_size);
if ((size_t)path_len >= buf_size)
path_buf[buf_size - 1] = '\0';
} /* end if */
diff --git a/src/H5PLint.c b/src/H5PLint.c
index cf6135d..d20401e 100644
--- a/src/H5PLint.c
+++ b/src/H5PLint.c
@@ -236,11 +236,13 @@ H5PL_load(H5PL_type_t type, const H5PL_key_t *key)
if ((H5PL_plugin_control_mask_g & H5PL_FILTER_PLUGIN) == 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "filter plugins disabled")
break;
+
case H5PL_TYPE_VOL:
if ((H5PL_plugin_control_mask_g & H5PL_VOL_PLUGIN) == 0)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL,
"Virtual Object Layer (VOL) driver plugins disabled")
break;
+
case H5PL_TYPE_ERROR:
case H5PL_TYPE_NONE:
default:
@@ -290,7 +292,7 @@ done:
* get_plugin_info function pointer, but early (4.4.7, at least) gcc
* only allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("pedantic")
+H5_GCC_CLANG_DIAG_OFF("pedantic")
herr_t
H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *success,
H5PL_type_t *plugin_type, const void **plugin_info)
@@ -412,7 +414,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__open() */
-H5_GCC_DIAG_ON("pedantic")
+H5_GCC_CLANG_DIAG_ON("pedantic")
/*-------------------------------------------------------------------------
* Function: H5PL__close
diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h
index ab9f1d5..a093096 100644
--- a/src/H5PLmodule.h
+++ b/src/H5PLmodule.h
@@ -28,8 +28,34 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5PL H5PL
- * \brief Plugins
- * \todo Describe what programmatically controlling dynamically loaded plugins (H5PL) is all about
+ *
+ * Use the functions in this module to manage the loading behavior of HDF5
+ * plugins.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet H5PL_examples.c create
+ * </td>
+ * <td>
+ * \snippet H5PL_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet H5PL_examples.c update
+ * </td>
+ * <td>
+ * \snippet H5PL_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \attention The loading behavior of HDF5 plugins can be controlled via the
+ * functions described below and certain environment variables, such
+ * as \c HDF5_PLUGIN_PRELOAD and \c HDF5_PLUGIN_PATH.
+ *
*/
#endif /* H5PLmodule_H */
diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c
index 2ec0845..b7cdac0 100644
--- a/src/H5PLplugin_cache.c
+++ b/src/H5PLplugin_cache.c
@@ -242,7 +242,7 @@ done:
/* See the other use of H5PL_GET_LIB_FUNC() for an explanation
* for why we disable -Wpedantic here.
*/
-H5_GCC_DIAG_OFF("pedantic")
+H5_GCC_CLANG_DIAG_OFF("pedantic")
herr_t
H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found,
const void **plugin_info)
@@ -263,35 +263,61 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f
/* Loop over all the plugins, looking for one that matches */
for (u = 0; u < H5PL_num_plugins_g; u++) {
-
- /* If the plugin type (filter, VOL connector, etc.) and ID match, query the plugin for its info */
- if ((search_params->type == (H5PL_cache_g[u]).type) &&
- (search_params->key->id == (H5PL_cache_g[u]).key.id)) {
-
- H5PL_get_plugin_info_t get_plugin_info_function;
- const void * info;
-
- /* Get the "get plugin info" function from the plugin. */
- if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(
- (H5PL_cache_g[u]).handle, "H5PLget_plugin_info")))
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info")
-
- /* Call the "get plugin info" function */
- if (NULL == (info = (*get_plugin_info_function)()))
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info")
-
- /* Set output parameters */
- *found = TRUE;
- *plugin_info = info;
-
- /* No need to continue processing */
- break;
-
- } /* end if */
-
- } /* end for */
+ /* If the plugin type (filter, VOL connector, etc.) match, proceed */
+ if (search_params->type == H5PL_cache_g[u].type) {
+ hbool_t matched = FALSE; /* Whether cached plugin info matches */
+
+ switch (search_params->type) {
+ case H5PL_TYPE_FILTER:
+ if (search_params->key->id == H5PL_cache_g[u].key.id)
+ matched = TRUE;
+ break;
+
+ case H5PL_TYPE_VOL:
+ if (search_params->key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE) {
+ if (search_params->key->vol.u.value == H5PL_cache_g[u].key.vol.u.value)
+ matched = TRUE;
+ } /* end if */
+ else if (search_params->key->vol.kind == H5VL_GET_CONNECTOR_BY_NAME) {
+ if (0 == HDstrcmp(search_params->key->vol.u.name, H5PL_cache_g[u].key.vol.u.name))
+ matched = TRUE;
+ } /* end else-if */
+ else
+ HGOTO_ERROR(H5E_PLUGIN, H5E_BADVALUE, FAIL, "bad VOL plugin search key type")
+ break;
+
+ case H5PL_TYPE_ERROR:
+ case H5PL_TYPE_NONE:
+ default:
+ HGOTO_ERROR(H5E_PLUGIN, H5E_BADVALUE, FAIL, "bad plugin type")
+ } /* end switch */
+
+ /* If the plugin type (filter, VOL connector, etc.) and key match, query the plugin for its info
+ */
+ if (matched) {
+ H5PL_get_plugin_info_t get_plugin_info_function;
+ const void * info;
+
+ /* Get the "get plugin info" function from the plugin. */
+ if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(
+ (H5PL_cache_g[u]).handle, "H5PLget_plugin_info")))
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info")
+
+ /* Call the "get plugin info" function */
+ if (NULL == (info = (*get_plugin_info_function)()))
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info")
+
+ /* Set output parameters */
+ *found = TRUE;
+ *plugin_info = info;
+
+ /* No need to continue processing */
+ break;
+ } /* end if */
+ } /* end if */
+ } /* end for */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__find_plugin_in_cache() */
-H5_GCC_DIAG_ON("pedantic")
+H5_GCC_CLANG_DIAG_ON("pedantic")
diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h
index 9ab2b17..55ff594 100644
--- a/src/H5PLpublic.h
+++ b/src/H5PLpublic.h
@@ -28,8 +28,7 @@
*/
#define H5PL_NO_PLUGIN "::"
-//! [H5PL_type_t_snip]
-
+//! <!-- [H5PL_type_t_snip] -->
/**
* Plugin type (bit-position) used by the plugin library
*/
@@ -39,8 +38,7 @@ typedef enum H5PL_type_t {
H5PL_TYPE_VOL = 1, /**< VOL driver */
H5PL_TYPE_NONE = 2 /**< Sentinel: This must be last! */
} H5PL_type_t;
-
-//! [H5PL_type_t_snip]
+//! <!-- [H5PL_type_t_snip] -->
/* Common dynamic plugin type flags used by the set/get_loading_state functions */
#define H5PL_FILTER_PLUGIN 0x0001
@@ -100,7 +98,9 @@ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask);
* A plugin bit set to 1 (one) indicates that that the dynamic plugin type is
* enabled.\n
* If the value of \p plugin_control_mask is negative, all dynamic plugin
- * types are enabled.\n If the value of \p plugin_control_mask is 0 (zero), all dynamic plugins are disabled.
+ * types are enabled.\n
+ * If the value of \p plugin_control_mask is 0 (zero), all dynamic plugins
+ * are disabled.
* \return \herr_t
*
* \details H5PLget_loading_state() retrieves the bitmask that controls whether a certain type of plugins
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index c8a97c2..d374b25 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -768,7 +768,7 @@ H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double
/* Check arguments. Note that we allow negative values - they are
* considered to "unset" the property. */
- if (rdcc_w0 > (double)1.0f)
+ if (rdcc_w0 > 1.0)
HGOTO_ERROR(
H5E_ARGS, H5E_BADVALUE, FAIL,
"raw data cache w0 value must be between 0.0 and 1.0 inclusive, or H5D_CHUNK_CACHE_W0_DEFAULT");
@@ -1453,7 +1453,7 @@ H5Pget_efile_prefix(hid_t plist_id, char *prefix /*out*/, size_t size)
/* Copy to user's buffer, if given */
len = HDstrlen(my_prefix);
if (prefix) {
- HDstrncpy(prefix, my_prefix, MIN(len + 1, size));
+ HDstrncpy(prefix, my_prefix, size);
if (len >= size)
prefix[size - 1] = '\0';
} /* end if */
@@ -1543,7 +1543,7 @@ H5Pget_virtual_prefix(hid_t plist_id, char *prefix /*out*/, size_t size)
/* Copy to user's buffer, if given */
len = HDstrlen(my_prefix);
if (prefix) {
- HDstrncpy(prefix, my_prefix, MIN(len + 1, size));
+ HDstrncpy(prefix, my_prefix, size);
if (len >= size)
prefix[size - 1] = '\0';
} /* end if */
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 0768d11..d08d892 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -96,19 +96,31 @@
#ifdef H5_HAVE_C99_DESIGNATED_INITIALIZER
#define H5D_DEF_STORAGE_COMPACT \
{ \
- H5D_COMPACT, { .compact = H5D_DEF_STORAGE_COMPACT_INIT } \
+ H5D_COMPACT, \
+ { \
+ .compact = H5D_DEF_STORAGE_COMPACT_INIT \
+ } \
}
#define H5D_DEF_STORAGE_CONTIG \
{ \
- H5D_CONTIGUOUS, { .contig = H5D_DEF_STORAGE_CONTIG_INIT } \
+ H5D_CONTIGUOUS, \
+ { \
+ .contig = H5D_DEF_STORAGE_CONTIG_INIT \
+ } \
}
#define H5D_DEF_STORAGE_CHUNK \
{ \
- H5D_CHUNKED, { .chunk = H5D_DEF_STORAGE_CHUNK_INIT } \
+ H5D_CHUNKED, \
+ { \
+ .chunk = H5D_DEF_STORAGE_CHUNK_INIT \
+ } \
}
#define H5D_DEF_STORAGE_VIRTUAL \
{ \
- H5D_VIRTUAL, { .virt = H5D_DEF_STORAGE_VIRTUAL_INIT } \
+ H5D_VIRTUAL, \
+ { \
+ .virt = H5D_DEF_STORAGE_VIRTUAL_INIT \
+ } \
}
#define H5D_DEF_LAYOUT_COMPACT \
{ \
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 70fc982..46dc94c 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -68,7 +68,7 @@
#define H5D_XFER_BTREE_SPLIT_RATIO_SIZE sizeof(double[3])
#define H5D_XFER_BTREE_SPLIT_RATIO_DEF \
{ \
- 0.1f, 0.5f, 0.9f \
+ 0.1, 0.5, 0.9 \
}
#define H5D_XFER_BTREE_SPLIT_RATIO_ENC H5P__dxfr_btree_split_ratio_enc
#define H5D_XFER_BTREE_SPLIT_RATIO_DEC H5P__dxfr_btree_split_ratio_dec
@@ -159,6 +159,16 @@
#define H5D_XFER_XFORM_COPY H5P__dxfr_xform_copy
#define H5D_XFER_XFORM_CMP H5P__dxfr_xform_cmp
#define H5D_XFER_XFORM_CLOSE H5P__dxfr_xform_close
+/* Definitions for dataset I/O selection property */
+#define H5D_XFER_DSET_IO_SEL_SIZE sizeof(H5S_t *)
+#define H5D_XFER_DSET_IO_SEL_DEF NULL
+#define H5D_XFER_DSET_IO_SEL_COPY H5P__dxfr_dset_io_hyp_sel_copy
+#define H5D_XFER_DSET_IO_SEL_CMP H5P__dxfr_dset_io_hyp_sel_cmp
+#define H5D_XFER_DSET_IO_SEL_CLOSE H5P__dxfr_dset_io_hyp_sel_close
+#ifdef QAK
+#define H5D_XFER_DSET_IO_SEL_ENC H5P__dxfr_edc_enc
+#define H5D_XFER_DSET_IO_SEL_DEC H5P__dxfr_edc_dec
+#endif /* QAK */
/******************/
/* Local Typedefs */
@@ -196,6 +206,9 @@ static herr_t H5P__dxfr_xform_del(hid_t prop_id, const char *name, size_t size,
static herr_t H5P__dxfr_xform_copy(const char *name, size_t size, void *value);
static int H5P__dxfr_xform_cmp(const void *value1, const void *value2, size_t size);
static herr_t H5P__dxfr_xform_close(const char *name, size_t size, void *value);
+static herr_t H5P__dxfr_dset_io_hyp_sel_copy(const char *name, size_t size, void *value);
+static int H5P__dxfr_dset_io_hyp_sel_cmp(const void *value1, const void *value2, size_t size);
+static herr_t H5P__dxfr_dset_io_hyp_sel_close(const char *name, size_t size, void *value);
/*********************/
/* Package Variables */
@@ -262,7 +275,9 @@ static const H5Z_EDC_t H5D_def_enable_edc_g = H5D_XFER_EDC_DEF; /* Default
static const H5Z_cb_t H5D_def_filter_cb_g = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */
static const H5T_conv_cb_t H5D_def_conv_cb_g =
H5D_XFER_CONV_CB_DEF; /* Default value for datatype conversion callback */
-static const void *H5D_def_xfer_xform_g = H5D_XFER_XFORM_DEF; /* Default value for data transform */
+static const void * H5D_def_xfer_xform_g = H5D_XFER_XFORM_DEF; /* Default value for data transform */
+static const H5S_t *H5D_def_dset_io_sel_g =
+ H5D_XFER_DSET_IO_SEL_DEF; /* Default value for dataset I/O selection */
/*-------------------------------------------------------------------------
* Function: H5P__dxfr_reg_prop
@@ -420,6 +435,13 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass)
H5D_XFER_XFORM_CLOSE) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+ /* Register the dataset I/O selection property */
+ if (H5P__register_real(pclass, H5D_XFER_DSET_IO_SEL_NAME, H5D_XFER_DSET_IO_SEL_SIZE,
+ &H5D_def_dset_io_sel_g, NULL, NULL, NULL, NULL, NULL, NULL,
+ H5D_XFER_DSET_IO_SEL_COPY, H5D_XFER_DSET_IO_SEL_CMP,
+ H5D_XFER_DSET_IO_SEL_CLOSE) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__dxfr_reg_prop() */
@@ -894,7 +916,7 @@ H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t H5_ATTR_UNU
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P__dxfr_xform_copy() */
+} /* end H5P__dxfr_xform_cmp() */
/*-------------------------------------------------------------------------
* Function: H5P__dxfr_xform_close
@@ -965,7 +987,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
/* Create data transform info from expression */
if (NULL == (data_xform_prop = H5Z_xform_create(expression)))
- HGOTO_ERROR(H5E_PLINE, H5E_NOSPACE, FAIL, "unable to create data transform info")
+ HGOTO_ERROR(H5E_PLIST, H5E_NOSPACE, FAIL, "unable to create data transform info")
/* Update property list (takes ownership of transform) */
if (H5P_poke(plist, H5D_XFER_XFORM_NAME, &data_xform_prop) < 0)
@@ -974,7 +996,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
done:
if (ret_value < 0)
if (data_xform_prop && H5Z_xform_destroy(data_xform_prop) < 0)
- HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
+ HDONE_ERROR(H5E_PLIST, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_data_transform() */
@@ -1030,7 +1052,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size)
/* Copy into application buffer */
len = HDstrlen(pexp);
if (expression) {
- HDstrncpy(expression, pexp, MIN(len + 1, size));
+ HDstrncpy(expression, pexp, size);
if (len >= size)
expression[size - 1] = '\0';
} /* end if */
@@ -1486,9 +1508,8 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, double right)
H5TRACE4("e", "iddd", plist_id, left, middle, right);
/* Check arguments */
- if (left < (double)0.0f || left > (double)1.0f || middle < (double)0.0f || middle > (double)1.0f ||
- right < (double)0.0f || right > (double)1.0f)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0")
+ if (left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 || right < 0.0 || right > 1.0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0 <= X <= 1.0")
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
@@ -2110,3 +2131,251 @@ H5P__dxfr_edc_dec(const void **_pp, void *_value)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5P__dxfr_edc_dec() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dxfr_dset_io_hyp_sel_copy
+ *
+ * Purpose: Creates a copy of the dataset I/O selection.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Sunday, January 31, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dxfr_dset_io_hyp_sel_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
+{
+ H5S_t *orig_space = *(H5S_t **)value; /* Original dataspace for property */
+ H5S_t *new_space = NULL; /* New dataspace for property */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* If there's a dataspace I/O selection set, copy it */
+ if (orig_space) {
+ /* Make copy of dataspace */
+ if (NULL == (new_space = H5S_copy(orig_space, FALSE, TRUE)))
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "error copying the dataset I/O selection")
+
+ /* Set new value for property */
+ *(void **)value = new_space;
+ } /* end if */
+
+done:
+ /* Cleanup on error */
+ if (ret_value < 0)
+ if (new_space && H5S_close(new_space) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing dataset I/O selection dataspace")
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5P__dxfr_dset_io_hyp_sel_copy() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dxfr_dset_io_hyp_sel_cmp
+ *
+ * Purpose: Compare two dataset I/O selections.
+ *
+ * Return: positive if VALUE1 is greater than VALUE2, negative if VALUE2 is
+ * greater than VALUE1 and zero if VALUE1 and VALUE2 are equal.
+ *
+ * Programmer: Quincey Koziol
+ * Sunday, January 31, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5P__dxfr_dset_io_hyp_sel_cmp(const void *_space1, const void *_space2, size_t H5_ATTR_UNUSED size)
+{
+ const H5S_t *const *space1 = (const H5S_t *const *)_space1; /* Create local aliases for values */
+ const H5S_t *const *space2 = (const H5S_t *const *)_space2; /* Create local aliases for values */
+ herr_t ret_value = 0; /* Return value */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity check */
+ HDassert(space1);
+ HDassert(space1);
+ HDassert(size == sizeof(H5S_t *));
+
+ /* Check for a property being set */
+ if (*space1 == NULL && *space2 != NULL)
+ HGOTO_DONE(-1);
+ if (*space1 != NULL && *space2 == NULL)
+ HGOTO_DONE(1);
+
+ if (*space1) {
+ HDassert(*space2);
+
+ /* Compare the extents of the dataspaces */
+ /* (Error & not-equal count the same) */
+ if (TRUE != H5S_extent_equal(*space1, *space2))
+ HGOTO_DONE(-1);
+
+ /* Compare the selection "shape" of the dataspaces */
+ /* (Error & not-equal count the same) */
+ if (TRUE != H5S_select_shape_same(*space1, *space2))
+ HGOTO_DONE(-1);
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5P__dxfr_dset_io_hyp_sel_cmp() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5P__dxfr_dset_io_hyp_sel_close
+ *
+ * Purpose: Frees resources for dataset I/O selection
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Sunday, January 31, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5P__dxfr_dset_io_hyp_sel_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *_value)
+{
+ H5S_t *space = *(H5S_t **)_value; /* Dataspace for property */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Release any dataspace */
+ if (space && H5S_close(space) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing dataset I/O selection dataspace")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5P__dxfr_dset_io_hyp_sel_close() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_dataset_io_hyperslab_selection
+ *
+ * Purpose: H5Pset_dataset_io_hyperslab_selection() is designed to be used
+ * in conjunction with using H5S_PLIST for the file dataspace
+ * ID when making a call to H5Dread() or H5Dwrite(). When used
+ * with H5S_PLIST, the selection created by one or more calls to
+ * this routine is used for determining which dataset elements to
+ * access.
+ *
+ * 'rank' is the dimensionality of the selection and determines
+ * the size of the 'start', 'stride', 'count', and 'block' arrays.
+ * 'rank' must be between 1 and H5S_MAX_RANK, inclusive.
+ *
+ * The 'op', 'start', 'stride', 'count', and 'block' parameters
+ * behave identically to their behavior for H5Sselect_hyperslab(),
+ * please see the documentation for that routine for details about
+ * their use.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, January 30, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper_t op, const hsize_t start[],
+ const hsize_t stride[], const hsize_t count[], const hsize_t block[])
+{
+ H5P_genplist_t *plist = NULL; /* Property list pointer */
+ H5S_t * space; /* Dataspace to hold selection */
+ hbool_t space_created = FALSE; /* Whether a new dataspace has been created */
+ hbool_t reset_prop_on_error = FALSE; /* Whether to reset the property on failure */
+ herr_t ret_value = SUCCEED; /* return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "iIuSs*h*h*h*h", plist_id, rank, op, start, stride, count, block);
+
+ /* Check arguments */
+ if (rank < 1 || rank > H5S_MAX_RANK)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid rank value: %u", rank)
+ if (!(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID))
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
+ if (start == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "'count' pointer is NULL")
+ if (stride != NULL) {
+ unsigned u; /* Local index variable */
+
+ /* Check for 0-sized strides */
+ for (u = 0; u < rank; u++)
+ if (stride[u] == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid value - stride[%u]==0", u)
+ } /* end if */
+ if (count == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "'start' pointer is NULL")
+ /* block is allowed to be NULL, and will be assumed to be all '1's when NULL */
+
+ /* Get the plist structure */
+ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
+
+ /* See if a dataset I/O selection is already set, and free it if it is */
+ if (H5P_peek(plist, H5D_XFER_DSET_IO_SEL_NAME, &space) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting dataset I/O selection")
+
+ /* Check for operation on existing dataspace selection */
+ if (NULL != space) {
+ int sndims; /* Rank of existing dataspace */
+
+ /* Get dimensions from current dataspace for selection */
+ if ((sndims = H5S_GET_EXTENT_NDIMS(space)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get selection's dataspace rank")
+
+ /* Check for different # of dimensions */
+ if ((unsigned)sndims != rank) {
+ /* Set up new dataspace for 'set' operation, otherwise fail */
+ if (op == H5S_SELECT_SET) {
+ /* Close previous dataspace */
+ if (H5S_close(space) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
+
+ /* Reset 'space' pointer, so it's re-created */
+ space = NULL;
+
+ /* Set flag to reset property list on error */
+ reset_prop_on_error = TRUE;
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "different rank for previous and new selections")
+ } /* end if */
+ } /* end if */
+
+ /* Check for first time called */
+ if (NULL == space) {
+ hsize_t dims[H5S_MAX_RANK]; /* Dimensions for new dataspace */
+ unsigned u; /* Local index variable */
+
+ /* Initialize dimensions to largest possible actual size */
+ for (u = 0; u < rank; u++)
+ dims[u] = (H5S_UNLIMITED - 1);
+
+ /* Create dataspace of the correct dimensionality, with maximum dimensions */
+ if (NULL == (space = H5S_create_simple(rank, dims, NULL)))
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create dataspace for selection")
+ space_created = TRUE;
+ } /* end if */
+
+ /* Set selection for dataspace */
+ if (H5S_select_hyperslab(space, op, start, stride, count, block) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSELECT, FAIL, "can't create selection")
+
+ /* Update property list (takes ownership of dataspace, if new) */
+ if (H5P_poke(plist, H5D_XFER_DSET_IO_SEL_NAME, &space) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "error setting dataset I/O selection")
+ space_created = FALSE; /* Reset now that property owns the dataspace */
+
+done:
+ /* Cleanup on failure */
+ if (ret_value < 0) {
+ if (reset_prop_on_error && plist && H5P_poke(plist, H5D_XFER_DSET_IO_SEL_NAME, &space) < 0)
+ HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "error setting dataset I/O selection")
+ if (space_created && H5S_close(space) < 0)
+ HDONE_ERROR(H5E_PLIST, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
+ } /* end if */
+
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pset_dataset_io_hyperslab_selection() */
diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c
index 5b0ecb6..e2a97f8 100644
--- a/src/H5Pencdec.c
+++ b/src/H5Pencdec.c
@@ -333,7 +333,7 @@ H5P__encode_cb(H5P_genprop_t *prop, void *_udata)
/* Encode (or not, if the 'encode' flag is off) the property's name */
prop_name_len = HDstrlen(prop->name) + 1;
if (udata->encode) {
- HDstrncpy((char *)*(udata->pp), prop->name, prop_name_len);
+ HDstrcpy((char *)*(udata->pp), prop->name);
*(uint8_t **)(udata->pp) += prop_name_len;
} /* end if */
*(udata->enc_size_ptr) += prop_name_len;
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index c085b71..a8e0d8e 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1686,7 +1686,7 @@ H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, size_t rdcc_nslots,
H5TRACE5("e", "iIszzd", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0);
/* Check arguments */
- if (rdcc_w0 < (double)0.0f || rdcc_w0 > (double)1.0f)
+ if (rdcc_w0 < 0.0 || rdcc_w0 > 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"raw data cache w0 value must be between 0.0 and 1.0 inclusive")
@@ -4221,7 +4221,7 @@ herr_t
H5Pset_mdc_log_options(hid_t plist_id, hbool_t is_enabled, const char *location, hbool_t start_on_access)
{
H5P_genplist_t *plist; /* Property list pointer */
- char * tmp_location; /* Working location pointer */
+ char * new_location; /* Working location pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -4237,19 +4237,14 @@ H5Pset_mdc_log_options(hid_t plist_id, hbool_t is_enabled, const char *location,
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plist_id is not a file access property list")
- /* Get the current location string and free it */
- if (H5P_get(plist, H5F_ACS_MDC_LOG_LOCATION_NAME, &tmp_location) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get current log location")
- H5MM_xfree(tmp_location);
-
/* Make a copy of the passed-in location */
- if (NULL == (tmp_location = H5MM_xstrdup(location)))
+ if (NULL == (new_location = H5MM_xstrdup(location)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy passed-in log location")
/* Set values */
if (H5P_set(plist, H5F_ACS_USE_MDC_LOGGING_NAME, &is_enabled) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set is_enabled flag")
- if (H5P_set(plist, H5F_ACS_MDC_LOG_LOCATION_NAME, &tmp_location) < 0)
+ if (H5P_set(plist, H5F_ACS_MDC_LOG_LOCATION_NAME, &new_location) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set log location")
if (H5P_set(plist, H5F_ACS_START_MDC_LOG_ON_ACCESS_NAME, &start_on_access) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set start_on_access flag")
@@ -5708,6 +5703,64 @@ done:
} /* end H5Pget_vol_info() */
/*-------------------------------------------------------------------------
+ * Function: H5Pget_vol_cap_flags
+ *
+ * Purpose: Queries the current VOL connector information for a FAPL to
+ * retrieve the capability flags for the VOL connector stack, as will
+ * be used by a file open or create operation that uses this FAPL.
+ *
+ * Current capability flags are:
+ * H5VL_CAP_FLAG_THREADSAFE - Connector is threadsafe
+ * H5VL_CAP_FLAG_ASYNC - Connector performs operations asynchronously
+ * H5VL_CAP_FLAG_NATIVE_FILES - Connector produces native file format
+ *
+ * Note: This routine supports the use of the HDF5_VOL_CONNECTOR environment
+ * environment variable to override the VOL connector set programmatically
+ * for the FAPL (with H5Pset_vol).
+ *
+ * Note: The H5VL_CAP_FLAG_ASYNC flag can be checked to see if asynchronous
+ * operations are supported by the VOL connector stack.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_vol_cap_flags(hid_t plist_id, unsigned *cap_flags)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*Iu", plist_id, cap_flags);
+
+ /* Get the 'cap_flags' from the connector */
+ if (cap_flags) {
+ if (TRUE == H5P_isa_class(plist_id, H5P_FILE_ACCESS)) {
+ H5P_genplist_t * plist; /* Property list pointer */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+
+ /* Get property list for ID */
+ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+
+ /* Get the connector property */
+ if (H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL connector property")
+
+ /* Query the capability flags */
+ if (H5VL_get_cap_flags(&connector_prop, cap_flags) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL connector capability flags")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ } /* end if */
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pget_vol_cap_flags() */
+
+/*-------------------------------------------------------------------------
* Function: H5P__facc_vol_create
*
connectorose: Create callback for the VOL connector ID & info property.
diff --git a/src/H5Pint.c b/src/H5Pint.c
index dd1ad9b..9530d87 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -4878,7 +4878,8 @@ H5P__copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name)
/* If not, get the information required to do an H5Pinsert2 with the property into the destination list */
else {
/* Get the pointer to the source property */
- prop = H5P__find_prop_plist(src_plist, name);
+ if (NULL == (prop = H5P__find_prop_plist(src_plist, name)))
+ HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property doesn't exist")
/* Create property object from parameters */
if (NULL ==
diff --git a/src/H5Plapl.c b/src/H5Plapl.c
index 879e6ed..d00efaf 100644
--- a/src/H5Plapl.c
+++ b/src/H5Plapl.c
@@ -1044,7 +1044,7 @@ H5Pget_elink_prefix(hid_t plist_id, char *prefix /*out*/, size_t size)
/* Copy to user's buffer, if given */
len = HDstrlen(my_prefix);
if (prefix) {
- HDstrncpy(prefix, my_prefix, MIN(len + 1, size));
+ HDstrncpy(prefix, my_prefix, size);
if (len >= size)
prefix[size - 1] = '\0';
} /* end if */
diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h
index 130cb90..6e92e66 100644
--- a/src/H5Pmodule.h
+++ b/src/H5Pmodule.h
@@ -30,46 +30,165 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5P H5P
- * \brief Property List Interface
*
- * \details The HDF5 Property List Interface provides a mechanism to take
- * advantage of more powerful or unusual features in HDF5.
+ * Use the functions in this module to manage HDF5 property lists and property
+ * list classes. HDF5 property lists are the main vehicle to configure the
+ * behavior of HDF5 API functions.
*
- * HDF5 objects have properties or characteristics associated with
- * them, and there are default properties that handle the most
- * common needs. These default properties can be modified using the
- * HDF5 Property List Interface. For example, the data storage
- * layout property of a dataset is contiguous by default. For better
- * performance, the layout can be modified to be chunked or chunked
- * and compressed.
+ * Typically, property lists are created by instantiating one of the built-in
+ * or user-defined property list classes. After adding suitable properties,
+ * property lists are used when opening or creating HDF5 items, or when reading
+ * or writing data. Property lists can be modified by adding or changing
+ * properties. Property lists are deleted by closing the associated handles.
*
- * \todo Describe concisely what the functions in this module are about.
- * \todo Clicking on "more" after "Property List Interface" at the top does not work
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5P_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5P_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5P_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5P_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
- * \defgroup GPLO General Property List Operations
+ * \defgroup ALCAPL Attribute and Link Creation Properties
* \ingroup H5P
- * \defgroup GPLOA General Property List Operations (Advanced)
+ * Currently, there are only two creation properties that you can use to control
+ * the creation of HDF5 attributes and links. The first creation property, the
+ * choice of a character encoding, applies to both attributes and links.
+ * The second creation property applies to links only, and advises the library
+ * to automatically create missing intermediate groups when creating new objects.
+ *
+ * \defgroup DAPL Dataset Access Properties
* \ingroup H5P
- * \defgroup FCPL File Creation Properties
+ * Use dataset access properties to modify the default behavior of the HDF5
+ * library when accessing datasets. The properties include adjusting the size
+ * of the chunk cache, providing prefixes for external content and virtual
+ * dataset file paths, and controlling flush behavior, etc. These properties
+ * are \Emph{not} persisted with datasets, and can be adjusted at runtime before
+ * a dataset is created or opened.
+ *
+ * \defgroup DCPL Dataset Creation Properties
+ * \ingroup H5P
+ * Use dataset creation properties to control aspects of dataset creation such
+ * as fill time, storage layout, compression methods, etc.
+ * Unlike dataset access and transfer properties, creation properties \Emph{are}
+ * stored with the dataset, and cannot be changed once a dataset has been
+ * created.
+ *
+ * \defgroup DXPL Dataset Transfer Properties
* \ingroup H5P
+ * Use dataset transfer properties to customize certain aspects of reading
+ * and writing datasets such as transformations, MPI-IO I/O mode, error
+ * detection, etc. These properties are \Emph{not} persisted with datasets,
+ * and can be adjusted at runtime before a dataset is read or written.
+ *
* \defgroup FAPL File Access Properties
* \ingroup H5P
- * \defgroup GCPL Group Creation Properties
+ * Use file access properties to modify the default behavior of the HDF5
+ * library when accessing files. The properties include selecting a virtual
+ * file driver (VFD), configuring the metadata cache (MDC), control
+ * file locking, etc. These properties are \Emph{not} persisted with files, and
+ * can be adjusted at runtime before a file is created or opened.
+ *
+ * \defgroup FCPL File Creation Properties
* \ingroup H5P
- * \defgroup ALCAPL Attribute and Link Creation Properties
+ * Use file creation properties to control aspects of file creation such
+ * as setting a file space management strategy or creating a user block.
+ * Unlike file access properties, creation properties \Emph{are}
+ * stored with the file, and cannot be changed once a file has been
+ * created.
+ *
+ * \defgroup GAPL General Access Properties
* \ingroup H5P
- * \defgroup LAPL Link Access Properties
+ * \todo Should this be as standalone page?
+ *
+ * \defgroup GCPL Group Creation Properties
* \ingroup H5P
- * \defgroup DCPL Dataset Creation Properties
+ * Use group creation properties to control aspects of group creation such
+ * as storage layout, compression, and link creation order tracking.
+ * Unlike file access properties, creation properties \Emph{are}
+ * stored with the group, and cannot be changed once a group has been
+ * created.
+ *
+ * \defgroup GPLO General Property List Operations
* \ingroup H5P
- * \defgroup DAPL Dataset Access Properties
+ *
+ * Use the functions in this module to manage HDF5 property lists.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5P_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5P_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5P_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5P_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \defgroup GPLOA General Property List Operations (Advanced)
* \ingroup H5P
- * \defgroup DXPL Dataset Transfer Properties
+ *
+ * You can create and customize user-defined property list classes using the
+ * functions described below. Arbitrary user-defined properties can also
+ * be inserted into existing property lists as so-called temporary properties.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ *
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5P_examples.c create_class
+ * </td>
+ * <td>
+ * \snippet{lineno} H5P_examples.c read_class
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5P_examples.c update_class
+ * </td>
+ * <td>
+ * \snippet{lineno} H5P_examples.c delete_class
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \defgroup LAPL Link Access Properties
+ * \ingroup H5P
+ *
+ *
+ * \defgroup MAPL Map Access Properties
* \ingroup H5P
+
* \defgroup OCPL Object Creation Properties
* \ingroup H5P
+ *
+ *
* \defgroup OCPPL Object Copy Properties
* \ingroup H5P
+ *
+ *
*/
#endif /* H5Pmodule_H */
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 801c561..a5c5c37 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -22,16 +22,17 @@
/* Public headers needed by this file */
#include "H5public.h"
-#include "H5ACpublic.h"
-#include "H5Dpublic.h"
-#include "H5Fpublic.h"
-#include "H5FDpublic.h"
-#include "H5Ipublic.h"
-#include "H5Lpublic.h"
-#include "H5Opublic.h"
-#include "H5MMpublic.h"
-#include "H5Tpublic.h"
-#include "H5Zpublic.h"
+#include "H5ACpublic.h" /* Metadata cache */
+#include "H5Dpublic.h" /* Datasets */
+#include "H5Fpublic.h" /* Files */
+#include "H5FDpublic.h" /* File drivers */
+#include "H5Ipublic.h" /* ID management */
+#include "H5Lpublic.h" /* Links */
+#include "H5MMpublic.h" /* Memory management */
+#include "H5Opublic.h" /* Object headers */
+#include "H5Spublic.h" /* Dataspaces */
+#include "H5Tpublic.h" /* Datatypes */
+#include "H5Zpublic.h" /* Data filters */
/*****************/
/* Public Macros */
@@ -99,8 +100,10 @@
#define H5P_CRT_ORDER_TRACKED 0x0001
#define H5P_CRT_ORDER_INDEXED 0x0002
-/* Default value for all property list classes */
-#define H5P_DEFAULT (hid_t)0
+/**
+ * Default value of type \ref hid_t for all property list classes
+ */
+#define H5P_DEFAULT 0 /* (hid_t) */
#ifdef __cplusplus
extern "C" {
@@ -111,84 +114,169 @@ extern "C" {
/*******************/
/* Define property list class callback function pointer types */
-//! [H5P_cls_create_func_t_snip]
+//! <!-- [H5P_cls_create_func_t_snip] -->
+/**
+ * \todo Document me!
+ */
typedef herr_t (*H5P_cls_create_func_t)(hid_t prop_id, void *create_data);
-//! [H5P_cls_create_func_t_snip]
-//! [H5P_cls_copy_func_t_snip]
+//! <!-- [H5P_cls_create_func_t_snip] -->
+
+//! <!-- [H5P_cls_copy_func_t_snip] -->
+/**
+ * \todo Document me!
+ */
typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void *copy_data);
-//! [H5P_cls_copy_func_t_snip]
-//! [H5P_cls_close_func_t_snip]
+//! <!-- [H5P_cls_copy_func_t_snip] -->
+
+//! <!-- [H5P_cls_close_func_t_snip] -->
+/**
+ * \todo Document me!
+ */
typedef herr_t (*H5P_cls_close_func_t)(hid_t prop_id, void *close_data);
-//! [H5P_cls_close_func_t_snip]
+//! <!-- [H5P_cls_close_func_t_snip] -->
/* Define property list callback function pointer types */
-//! [H5P_prp_cb1_t_snip]
+//! <!-- [H5P_prp_cb1_t_snip] -->
+/**
+ * \brief Callback function for H5Pregister2(),H5Pregister1(),H5Pinsert2(),H5Pinsert1()
+ *
+ * \param[in] name The name of the property
+ * \param[in] size The size of the property in bytes
+ * \param[in,out] value The value for the property
+ * \return \herr_t
+ *
+ * \details The H5P_prp_cb1_t() describes the parameters used by the
+ * property create,copy and close callback functions.
+ */
typedef herr_t (*H5P_prp_cb1_t)(const char *name, size_t size, void *value);
-//! [H5P_prp_cb1_t_snip]
-//! [H5P_prp_cb2_t_snip]
+//! <!-- [H5P_prp_cb1_t_snip] -->
+
+//! <!-- [H5P_prp_cb2_t_snip] -->
+/**
+ * \brief Callback function for H5Pregister2(),H5Pregister1(),H5Pinsert2(),H5Pinsert1()
+ *
+ * \plist_id{prop_id}
+ * \param[in] name The name of the property
+ * \param[in] size The size of the property in bytes
+ * \param[in] value The value for the property
+ * \return \herr_t
+ *
+ * \details The H5P_prp_cb2_t() describes the parameters used by the
+ * property set ,copy and delete callback functions.
+ */
typedef herr_t (*H5P_prp_cb2_t)(hid_t prop_id, const char *name, size_t size, void *value);
-//! [H5P_prp_cb2_t_snip]
+//! <!-- [H5P_prp_cb2_t_snip] -->
+
typedef H5P_prp_cb1_t H5P_prp_create_func_t;
typedef H5P_prp_cb2_t H5P_prp_set_func_t;
typedef H5P_prp_cb2_t H5P_prp_get_func_t;
+//! <!-- [H5P_prp_encode_func_t_snip] -->
+/**
+ * \todo Document me!
+ */
typedef herr_t (*H5P_prp_encode_func_t)(const void *value, void **buf, size_t *size);
+//! <!-- [H5P_prp_encode_func_t_snip] -->
+//! <!-- [H5P_prp_decode_func_t_snip] -->
+/**
+ * \todo Document me!
+ */
typedef herr_t (*H5P_prp_decode_func_t)(const void **buf, void *value);
+//! <!-- [H5P_prp_decode_func_t_snip] -->
typedef H5P_prp_cb2_t H5P_prp_delete_func_t;
typedef H5P_prp_cb1_t H5P_prp_copy_func_t;
-//! [H5P_prp_compare_func_t_snip]
+
+//! <!-- [H5P_prp_compare_func_t_snip] -->
+/**
+ * \todo Document me!
+ */
typedef int (*H5P_prp_compare_func_t)(const void *value1, const void *value2, size_t size);
-//! [H5P_prp_compare_func_t_snip]
+//! <!-- [H5P_prp_compare_func_t_snip] -->
+
typedef H5P_prp_cb1_t H5P_prp_close_func_t;
/* Define property list iteration function type */
-//! [H5P_iterate_t_snip]
+//! <!-- [H5P_iterate_t_snip] -->
+/**
+ * \todo Document me!
+ */
typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data);
-//! [H5P_iterate_t_snip]
+//! <!-- [H5P_iterate_t_snip] -->
-/* Actual IO mode property */
+//! <!--[H5D_mpio_actual_chunk_opt_mode_t_snip] -->
+/**
+ * Actual IO mode property
+ *
+ * \details The default value, #H5D_MPIO_NO_CHUNK_OPTIMIZATION, is used for all
+ * I/O operations that do not use chunk optimizations, including
+ * non-collective I/O and contiguous collective I/O.
+ */
typedef enum H5D_mpio_actual_chunk_opt_mode_t {
- /* The default value, H5D_MPIO_NO_CHUNK_OPTIMIZATION, is used for all I/O
- * operations that do not use chunk optimizations, including non-collective
- * I/O and contiguous collective I/O.
- */
H5D_MPIO_NO_CHUNK_OPTIMIZATION = 0,
+ /**< No chunk optimization was performed. Either no collective I/O was
+ attempted or the dataset wasn't chunked. */
H5D_MPIO_LINK_CHUNK,
+ /**< Collective I/O is performed on all chunks simultaneously. */
H5D_MPIO_MULTI_CHUNK
+ /**< Each chunk was individually assigned collective or independent I/O based
+ on what fraction of processes access the chunk. If the fraction is greater
+ than the multi chunk ratio threshold, collective I/O is performed on that
+ chunk. The multi chunk ratio threshold can be set using
+ H5Pset_dxpl_mpio_chunk_opt_ratio(). The default value is 60%. */
} H5D_mpio_actual_chunk_opt_mode_t;
+//! <!--[H5D_mpio_actual_chunk_opt_mode_t_snip] -->
+//! <!-- [H5D_mpio_actual_io_mode_t_snip] -->
+/**
+ * The following values are conveniently defined as a bit field so that
+ * we can switch from the default to independent or collective and then to
+ * mixed without having to check the original value.
+ */
typedef enum H5D_mpio_actual_io_mode_t {
- /* The following four values are conveniently defined as a bit field so that
- * we can switch from the default to independent or collective and then to
- * mixed without having to check the original value.
- *
- * NO_COLLECTIVE means that either collective I/O wasn't requested or that
- * no I/O took place.
- *
- * CHUNK_INDEPENDENT means that collective I/O was requested, but the
- * chunk optimization scheme chose independent I/O for each chunk.
- */
- H5D_MPIO_NO_COLLECTIVE = 0x0,
+ H5D_MPIO_NO_COLLECTIVE = 0x0,
+ /**< No collective I/O was performed. Collective I/O was not requested or
+ collective I/O isn't possible on this dataset */
H5D_MPIO_CHUNK_INDEPENDENT = 0x1,
- H5D_MPIO_CHUNK_COLLECTIVE = 0x2,
- H5D_MPIO_CHUNK_MIXED = 0x1 | 0x2,
-
- /* The contiguous case is separate from the bit field. */
+ /**< HDF5 performed one the chunk collective optimization schemes and each
+ chunk was accessed independently */
+ H5D_MPIO_CHUNK_COLLECTIVE = 0x2,
+ /**< HDF5 performed one the chunk collective optimization schemes and each
+ chunk was accessed collectively */
+ H5D_MPIO_CHUNK_MIXED = 0x1 | 0x2,
+ /**< HDF5 performed one the chunk collective optimization schemes and some
+ chunks were accessed independently, some collectively. */
+ /** \internal The contiguous case is separate from the bit field. */
H5D_MPIO_CONTIGUOUS_COLLECTIVE = 0x4
+ /**< Collective I/O was performed on a contiguous dataset */
} H5D_mpio_actual_io_mode_t;
+//! <!-- [H5D_mpio_actual_io_mode_t_snip] -->
-/* Broken collective IO property */
+//! <!-- [H5D_mpio_no_collective_cause_t_snip] -->
+/**
+ * Broken collective IO property
+ */
typedef enum H5D_mpio_no_collective_cause_t {
- H5D_MPIO_COLLECTIVE = 0x00,
- H5D_MPIO_SET_INDEPENDENT = 0x01,
- H5D_MPIO_DATATYPE_CONVERSION = 0x02,
- H5D_MPIO_DATA_TRANSFORMS = 0x04,
- H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED = 0x08,
- H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES = 0x10,
- H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET = 0x20,
- H5D_MPIO_PARALLEL_FILTERED_WRITES_DISABLED = 0x40,
+ H5D_MPIO_COLLECTIVE = 0x00,
+ /**< Collective I/O was performed successfully */
+ H5D_MPIO_SET_INDEPENDENT = 0x01,
+ /**< Collective I/O was not performed because independent I/O was requested */
+ H5D_MPIO_DATATYPE_CONVERSION = 0x02,
+ /**< Collective I/O was not performed because datatype conversions were required */
+ H5D_MPIO_DATA_TRANSFORMS = 0x04,
+ /**< Collective I/O was not performed because data transforms needed to be applied */
+ H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED = 0x08,
+ /**< \todo FIXME! */
+ H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES = 0x10,
+ /**< Collective I/O was not performed because one of the dataspaces was neither simple nor scalar */
+ H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET = 0x20,
+ /**< Collective I/O was not performed because the dataset was neither contiguous nor chunked */
+ H5D_MPIO_PARALLEL_FILTERED_WRITES_DISABLED = 0x40,
+ /**< \todo FIXME! */
H5D_MPIO_ERROR_WHILE_CHECKING_COLLECTIVE_POSSIBLE = 0x80,
- H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE = 0x100
+ /**< \todo FIXME! */
+ H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE = 0x100
+ /**< Sentinel */
} H5D_mpio_no_collective_cause_t;
+//! <!-- [H5D_mpio_no_collective_cause_t_snip] -->
/********************/
/* Public Variables */
@@ -493,8 +581,6 @@ H5_DLL hid_t H5Pcreate(hid_t cls_id);
* list of this class is being created. The #H5P_cls_create_func_t
* callback function is defined as follows:
*
- * \todo fix snippets to work, when you click on them.
- *
* \snippet this H5P_cls_create_func_t_snip
*
* The parameters to this callback function are defined as follows:
@@ -1233,8 +1319,6 @@ H5_DLL herr_t H5Pget_size(hid_t id, const char *name, size_t *size);
* property list objects; the initial value is assumed to
* have any necessary setup already performed on it.
*
- * \todo "cpp_note" goes here
- *
* \since 1.8.0
*
*/
@@ -1326,9 +1410,6 @@ H5_DLL htri_t H5Pisa_class(hid_t plist_id, hid_t pclass_id);
* If the membership changes during the iteration, the function's
* behavior is undefined.
*
- *
- * \todo "cpp_note" goes here
- *
* \since 1.4.0
*
*/
@@ -1582,16 +1663,12 @@ H5_DLL int H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_da
* property is being closed. The #H5P_prp_close_func_t callback
* function is defined as follows:
*
- * \snippet this H5P_prp_cb2_t_snip
+ * \snippet this H5P_prp_cb1_t_snip
*
* The parameters to the callback function are defined as follows:
*
* <table>
* <tr>
- * <td>\ref hid_t \c prop_id</td>
- * <td>IN: The identifier of the property list being closed</td>
- * </tr>
- * <tr>
* <td>\Code{const char * name}</td>
* <td>IN: The name of the property in the list</td>
* </tr>
@@ -1611,8 +1688,6 @@ H5_DLL int H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_da
* list close routine returns an error value but the property list is
* still closed.
*
- * \todo "cpp_note" goes here
- *
* \since 1.8.0
*
*/
@@ -1701,7 +1776,7 @@ H5_DLL herr_t H5Punregister(hid_t pclass_id, const char *name);
/* Object creation property list (OCPL) routines */
/**
- * \ingroup OCPL
+ * \ingroup DCPL
*
* \brief Verifies that all required filters are available
*
@@ -1805,7 +1880,7 @@ H5_DLL herr_t H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact, un
* \todo Signature for H5Pget_filter2 is different in H5Pocpl.c than in
* H5Ppublic.h
*
- * \plist_id{plist_id}
+ * \ocpl_id{plist_id}
* \param[in] idx Sequence number within the filter pipeline of the filter
* for which information is sought
* \param[out] flags Bit vector specifying certain general properties of the
@@ -1869,7 +1944,7 @@ H5_DLL H5Z_filter_t H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *f
*
* \brief Returns information about the specified filter
*
- * \plist_id
+ * \ocpl_id{plist_id}
* \param[in] filter_id Filter identifier
* \param[out] flags Bit vector specifying certain general
* properties of the filter
@@ -1927,10 +2002,7 @@ H5_DLL herr_t H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t filter_id, unsig
*
* \brief Returns the number of filters in the pipeline
*
- * \todo Signature for H5Pget_nfilters() is different in H5Pocpl.c than in
- * H5Ppublic.h.
- *
- * \plist_id
+ * \ocpl_id{plist_id}
*
* \return Returns the number of filters in the pipeline if successful;
* otherwise returns a negative value.
@@ -1938,8 +2010,8 @@ H5_DLL herr_t H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t filter_id, unsig
* \details H5Pget_nfilters() returns the number of filters defined in the
* filter pipeline associated with the property list \p plist_id.
*
- * In each pipeline, the filters are numbered from 0 through N-1,
- * where N is the value returned by this function. During output to
+ * In each pipeline, the filters are numbered from 0 through \Code{N-1},
+ * where \c N is the value returned by this function. During output to
* the file, the filters are applied in increasing order; during
* input from the file, they are applied in decreasing order.
*
@@ -1987,7 +2059,7 @@ H5_DLL herr_t H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times);
*
* \brief Modifies a filter in the filter pipeline
*
- * \plist_id
+ * \ocpl_id{plist_id}
* \param[in] filter Filter to be modified
* \param[in] flags Bit vector specifying certain general properties
* of the filter
@@ -2016,7 +2088,7 @@ H5_DLL herr_t H5Pmodify_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int
*
* \brief Delete one or more filters in the filter pipeline
*
- * \plist_id
+ * \ocpl_id{plist_id}
* \param[in] filter Filter to be deleted
*
* \return \herr_t
@@ -2166,15 +2238,17 @@ H5_DLL herr_t H5Pset_attr_creation_order(hid_t plist_id, unsigned crt_order_flag
*/
H5_DLL herr_t H5Pset_attr_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dense);
/**
- * \ingroup OCPL
+ * \ingroup DCPL
*
* \brief Sets deflate (GNU gzip) compression method and compression level
*
- * \plist_id
+ * \ocpl_id{plist_id}
* \param[in] level Compression level
*
* \return \herr_t
*
+ * \par_compr_note
+ *
* \details H5Pset_deflate() sets the deflate compression method and the
* compression level, \p level, for a dataset or group creation
* property list, \p plist_id.
@@ -2226,7 +2300,7 @@ H5_DLL herr_t H5Pset_deflate(hid_t plist_id, unsigned level);
*
* \brief Adds a filter to the filter pipeline
*
- * \param[in] plist_id Dataset or group creation property list identifier
+ * \ocpl_id{plist_id}
* \param[in] filter Filter identifier for the filter to be added to the
* pipeline
* \param[in] flags Bit vector specifying certain general properties of
@@ -2478,7 +2552,7 @@ H5_DLL herr_t H5Pset_deflate(hid_t plist_id, unsigned level);
* (The SZIP filter is an exception to this rule; see H5Pset_szip()
* for details.)
*
- * \todo Removed several references to links to documentation
+ * \see \ref_filter_pipe, \ref_group_impls
*
* \version 1.8.5 Function applied to group creation property lists.
* \since 1.6.0
@@ -2491,7 +2565,7 @@ H5_DLL herr_t H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int fl
*
* \brief Sets up use of the Fletcher32 checksum filter
*
- * \param[in] plist_id Dataset or group creation property list identifier
+ * \ocpl_id{plist_id}
*
* \return \herr_t
*
@@ -2672,7 +2746,7 @@ H5_DLL herr_t H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsig
/**
* \ingroup FCPL
*
- * \brief Retrieves number of shared object header message indexes in file
+ * \brief Retrieves the number of shared object header message indexes in file
* creation property list
*
* \fcpl_id{plist_id}
@@ -3237,8 +3311,8 @@ H5_DLL herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, siz
* <td>#H5FD_SEC2</td>
* <td>This driver uses POSIX file-system functions like read and
* write to perform I/O to a single, permanent file on local disk
- * with no system buffering. This driver is POSIX-compliant and is
- * the default file driver for all systems.</td>
+ * with no system buffering. This driver is POSIX-compliant and
+ * is the default file driver for all systems.</td>
* <td>H5Pset_fapl_sec2()</td>
* </tr>
* <tr>
@@ -3276,8 +3350,9 @@ H5_DLL herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, siz
* <td>#H5FD_CORE</td>
* <td>With this driver, an application can work with a file in
* memory for faster reads and writes. File contents are kept in
- * memory until the file is closed. At closing, the memory version
- * of the file can be written back to disk or abandoned.</td>
+ * memory until the file is closed. At closing, the memory
+ * version of the file can be written back to disk or abandoned.
+ * </td>
* <td>H5Pset_fapl_core()</td>
* </tr>
* <tr>
@@ -3286,7 +3361,8 @@ H5_DLL herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, siz
* <td>With this driver, the HDF5 file’s address space is partitioned
* into pieces and sent to separate storage files using an
* underlying driver of the user’s choice. This driver is for
- * systems that do not support files larger than 2 gigabytes.</td>
+ * systems that do not support files larger than 2 gigabytes.
+ * </td>
* <td>H5Pset_fapl_family()</td>
* </tr>
* <tr>
@@ -3352,7 +3428,7 @@ H5_DLL hid_t H5Pget_driver(hid_t plist_id);
* struct. Driver-specific versions of that struct are defined
* for each low-level driver in the relevant source code file
* H5FD*.c. For example, the struct used for the MULTI driver is
- * #H5FD_multi_fapl_t defined in H5FDmulti.c.
+ * \c H5FD_multi_fapl_t defined in H5FDmulti.c.
*
* If no driver-specific properties have been registered,
* H5Pget_driver_info() returns NULL.
@@ -3369,8 +3445,50 @@ H5_DLL hid_t H5Pget_driver(hid_t plist_id);
*
*/
H5_DLL const void *H5Pget_driver_info(hid_t plist_id);
-H5_DLL herr_t H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size);
-H5_DLL herr_t H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the size of the external link open file cache
+ *
+ * \fapl_id{plist_id}
+ * \param[out] efc_size External link open file cache size in number of files
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_elink_file_cache_size() retrieves the number of files that
+ * can be held open in an external link open file cache.
+ *
+ * \since 1.8.7
+ *
+ */
+H5_DLL herr_t H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the file access property list setting that determines
+ * whether an HDF5 object will be evicted from the library's metadata
+ * cache when it is closed
+ *
+ * \fapl_id
+ * \param[out] evict_on_close Pointer to a variable that will indicate if
+ * the object will be evicted on close
+ *
+ * \return \herr_t
+ *
+ * \details The library's metadata cache is fairly conservative about holding on
+ * to HDF5 object metadata (object headers, chunk index structures,
+ * etc.), which can cause the cache size to grow, resulting in memory
+ * pressure on an application or system. When enabled, the "evict on
+ * close" property will cause all metadata for an object to be
+ * immediately evicted from the cache as long as it is not referenced
+ * by any other open object.
+ *
+ * See H5Pset_evict_on_close() for additional notes on behavior.
+ *
+ * \since 1.10.1
+ *
+ */
+H5_DLL herr_t H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close);
/**
* \ingroup FAPL
*
@@ -3386,9 +3504,7 @@ H5_DLL herr_t H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close)
* application can retrieve a file handle for low-level access to
* a particular member of a family of files. The file handle is
* retrieved with a separate call to H5Fget_vfd_handle() (or,
- * in special circumstances, to H5FDget_vfd_handle()).
- *
- * \todo References the VFL documentation.
+ * in special circumstances, to H5FDget_vfd_handle(), see \ref VFL).
*
* \since 1.6.0
*
@@ -3415,8 +3531,113 @@ H5_DLL herr_t H5Pget_family_offset(hid_t fapl_id, hsize_t *offset);
*
*/
H5_DLL herr_t H5Pget_fclose_degree(hid_t fapl_id, H5F_close_degree_t *degree);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves a copy of the file image designated as the initial content
+ * and structure of a file
+ *
+ * \fapl_id
+ * \param[in,out] buf_ptr_ptr On input, \c NULL or a pointer to a
+ * pointer to a buffer that contains the
+ * file image.\n On successful return, if \p buf_ptr_ptr is not
+ * \c NULL, \Code{*buf_ptr_ptr} will contain a pointer to a copy
+ * of the initial image provided in the last call to
+ * H5Pset_file_image() for the supplied \p fapl_id. If no initial
+ * image has been set, \Code{*buf_ptr_ptr} will be \c NULL.
+ * \param[in,out] buf_len_ptr On input, \c NULL or a pointer to a buffer
+ * specifying the required size of the buffer to hold the file
+ * image.\n On successful return, if \p buf_len_ptr was not
+ * passed in as \c NULL, \p buf_len_ptr will return the required
+ * size in bytes of the buffer to hold the initial file image in
+ * the supplied file access property list, \p fapl_id. If no
+ * initial image is set, the value of \Code{*buf_len_ptr} will be
+ * set to 0 (zero)
+ * \return \herr_t
+ *
+ * \details H5Pget_file_image() allows an application to retrieve a copy of the
+ * file image designated for a VFD to use as the initial contents of a file.
+ *
+ * If file image callbacks are defined, H5Pget_file_image() will use
+ * them when allocating and loading the buffer to return to the
+ * application (see H5Pset_file_image_callbacks()). If file image
+ * callbacks are not defined, the function will use \c malloc and \c
+ * memcpy. When \c malloc and \c memcpy are used, it is the caller’s
+ * responsibility to discard the returned buffer with a call to \c
+ * free.
+ *
+ * It is the responsibility of the calling application to free the
+ * buffer whose address is returned in \p buf_ptr_ptr. This can be
+ * accomplished with \c free if file image callbacks have not been set
+ * (see H5Pset_file_image_callbacks()) or with the appropriate method
+ * if file image callbacks have been set.
+ *
+ * \see H5LTopen_file_image(), H5Fget_file_image(), H5Pset_file_image(),
+ * H5Pset_file_image_callbacks(), H5Pget_file_image_callbacks(),
+ * \ref H5FD_file_image_callbacks_t, \ref H5FD_file_image_op_t,
+ * <a href="https://portal.hdfgroup.org/display/HDF5/HDF5+File+Image+Operations">
+ * HDF5 File Image Operations</a>.
+ *
+ *
+ * \since 1.8.9
+ *
+ */
H5_DLL herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves callback routines for working with file images
+ *
+ * \fapl_id
+ * \param[in,out] callbacks_ptr Pointer to the instance of the
+ * #H5FD_file_image_callbacks_t struct in which the callback
+ * routines are to be returned\n
+ * Struct fields must be initialized to NULL before the call
+ * is made.\n
+ * Struct field contents upon return will match those passed in
+ * in the last H5Pset_file_image_callbacks() call for the file
+ * access property list \p fapl_id.
+ * \return \herr_t
+ *
+ * \details H5Pget_file_image_callbacks() retrieves the callback routines set for
+ * working with file images opened with the file access property list
+ * \p fapl_id.
+ *
+ * The callbacks must have been previously set with
+ * H5Pset_file_image_callbacks() in the file access property list.
+ *
+ * Upon the successful return of H5Pset_file_image_callbacks(), the
+ * fields in the instance of the #H5FD_file_image_callbacks_t struct
+ * pointed to by \p callbacks_ptr will contain the same values as were
+ * passed in the most recent H5Pset_file_image_callbacks() call for the
+ * file access property list \p fapl_id.
+ *
+ * \see H5LTopen_file_image(), H5Fget_file_image(), H5Pset_file_image(),
+ * H5Pset_file_image_callbacks(), H5Pget_file_image_callbacks(),
+ * \ref H5FD_file_image_callbacks_t, \ref H5FD_file_image_op_t,
+ * <a href="https://portal.hdfgroup.org/display/HDF5/HDF5+File+Image+Operations">
+ * HDF5 File Image Operations</a>.
+ *
+ * \since 1.8.9
+ *
+ */
H5_DLL herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the file locking property values
+ *
+ * \fapl_id
+ * \param[out] use_file_locking File locking flag
+ * \param[out] ignore_when_disabled Ignore when disabled flag
+ * \return \herr_t
+ *
+ * \details H5Pget_file_locking() retrieves the file locking property values for
+ * the file access property list specified by \p fapl_id.
+ *
+ * \since 1.10.7
+ *
+ */
H5_DLL herr_t H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking, hbool_t *ignore_when_disabled);
/**
* \ingroup FAPL
@@ -3471,11 +3692,212 @@ H5_DLL herr_t H5Pget_gc_references(hid_t fapl_id, unsigned *gc_ref /*out*/);
*
*/
H5_DLL herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, H5F_libver_t *high);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Get the current initial metadata cache configuration from the
+ * provided file access property list
+ *
+ * \fapl_id{plist_id}
+ * \param[in,out] config_ptr Pointer to the instance of #H5AC_cache_config_t
+ * in which the current metadata cache configuration is to be
+ * reported
+ * \return \herr_t
+ *
+ * \note The \c in direction applies only to the \ref H5AC_cache_config_t.version
+ * field. All other fields are \c out parameters.
+ *
+ * \details The fields of the #H5AC_cache_config_t structure are shown
+ * below:
+ * \snippet H5ACpublic.h H5AC_cache_config_t_snip
+ * \click4more
+ *
+ * H5Pget_mdc_config() gets the initial metadata cache configuration
+ * contained in a file access property list and loads it into the
+ * instance of #H5AC_cache_config_t pointed to by the \p config_ptr
+ * parameter. This configuration is used when the file is opened.
+ *
+ * Note that the version field of \Code{*config_ptr} must be
+ * initialized; this allows the library to support earlier versions of
+ * the #H5AC_cache_config_t structure.
+ *
+ * See the overview of the metadata cache in the special topics section
+ * of the user guide for details on the configuration data returned. If
+ * you haven't read and understood that documentation, the results of
+ * this call will not make much sense.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr); /* out */
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the metadata cache image configuration values for a file
+ * access property list
+ *
+ * \fapl_id{plist_id}
+ * \param[out] config_ptr Pointer to metadata cache image configuration values
+ * \return \herr_t
+ *
+ * \details H5Pget_mdc_image_config() retrieves the metadata cache image values
+ * into \p config_ptr for the file access property list specified in \p
+ * plist_id.
+ *
+ * #H5AC_cache_image_config_t is defined as follows:
+ * \snippet H5ACpublic.h H5AC_cache_image_config_t_snip
+ * \click4more
+ *
+ * \since 1.10.1
+ */
H5_DLL herr_t H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr /*out*/);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Gets metadata cache logging options
+ *
+ * \fapl_id{plist_id}
+ * \param[out] is_enabled Flag whether logging is enabled
+ * \param[out] location Location of log in UTF-8/ASCII (file path/name) (On
+ * Windows, this must be ASCII)
+ * \param[out] location_size Size in bytes of the location string
+ * \param[out] start_on_access Whether the logging begins as soon as the file is
+ * opened or created
+ * \return \herr_t
+ *
+ * \details The metadata cache is a central part of the HDF5 library through
+ * which all file metadata reads and writes take place. File metadata
+ * is normally invisible to the user and is used by the library for
+ * purposes such as locating and indexing data. File metadata should
+ * not be confused with user metadata, which consists of attributes
+ * created by users and attached to HDF5 objects such as datasets via
+ * \ref H5A API calls.
+ *
+ * Due to the complexity of the cache, a trace/logging feature has been
+ * created that can be used by HDF5 developers for debugging and
+ * performance analysis. The functions that control this functionality
+ * will normally be of use to a very limited number of developers
+ * outside of The HDF Group. The functions have been documented to help
+ * users create logs that can be sent with bug reports.
+ *
+ * Control of the log functionality is straightforward. Logging is
+ * enabled via the H5Pset_mdc_log_options() function, which will modify
+ * the file access property list used to open or create a file. This
+ * function has a flag that determines whether logging begins at file
+ * open or starts in a paused state. Log messages can then be
+ * controlled via the H5Fstart_mdc_logging() / H5Fstop_mdc_logging()
+ * functions. H5Pget_mdc_log_options() can be used to examine a file
+ * access property list, and H5Fget_mdc_logging_status() will return
+ * the current state of the logging flags.
+ *
+ * The log format is described in the
+ * <a href="https://bit.ly/2PG6fNv">Metadata Cache Logging</a> document.
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location,
size_t *location_size, hbool_t *start_on_access);
-H5_DLL herr_t H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size /*out*/);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Returns the current metadata block size setting
+ *
+ * \fapl_id{fapl_id}
+ * \param[out] size Minimum size, in bytes, of metadata block allocations
+ *
+ * \return \herr_t
+ *
+ * \details Returns the current minimum size, in bytes, of new
+ * metadata block allocations. This setting is retrieved from the
+ * file access property list \p fapl_id.
+ *
+ * This value is set by H5Pset_meta_block_size() and is
+ * retrieved from the file access property list \p fapl_id.
+ *
+ * \since 1.4.0
+ */
+H5_DLL herr_t H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the number of read attempts from a file access
+ * property list
+ *
+ * \fapl_id{plist_id}
+ * \param[out] attempts The number of read attempts
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_metadata_read_attempts() retrieves the number of read
+ * attempts that is set in the file access property list \p plist_id.
+ *
+ * For a default file access property list, the value retrieved
+ * will depend on whether the user sets the number of attempts via
+ * H5Pset_metadata_read_attempts():
+ *
+ * <ul>
+ *
+ * <li>If the number of attempts is set to N, the value
+ * returned will be N.
+ * <li>If the number of attempts is not set, the value returned
+ * will be the default for non-SWMR access (1). SWMR is short
+ * for single-writer/multiple-reader.
+ * </ul>
+ *
+ * For the file access property list of a specified HDF5 file,
+ * the value retrieved will depend on how the file is opened
+ * and whether the user sets the number of read attempts via
+ * H5Pset_metadata_read_attempts():
+ *
+ * <ul>
+ * <li>For a file opened with SWMR access:
+ *
+ * <ul>
+ * <li> If the number of attempts is set to N, the value
+ * returned will be N.
+ * <li> If the number of attempts is not set, the value
+ * returned will be the default for SWMR access (100).
+ * </ul>
+ * <li>For a file opened without SWMR access, the value
+ * retrieved will always be the default for non-SWMR access
+ * (1). The value set via H5Pset_metadata_read_attempts() does
+ * not have any effect on non-SWMR access.
+ * </ul>
+ *
+ * \par Failure Modes
+ * \parblock
+ *
+ * When the input property list is not a file access property list.
+ *
+ * When the library is unable to retrieve the number of read attempts from
+ * the file access property list.
+ *
+ * \endparblock
+ *
+ * \par Examples
+ * \parblock
+ *
+ * The first example illustrates the two cases for retrieving the number
+ * of read attempts from a default file access property list.
+ *
+ * \include H5Pget_metadata_read_attempts.1.c
+ *
+ * The second example illustrates the two cases for retrieving the
+ * number of read attempts from the file access property list of a file
+ * opened with SWMR acccess.
+ *
+ * \include H5Pget_metadata_read_attempts.2.c
+ *
+ * The third example illustrates the two cases for retrieving the number
+ * of read attempts from the file access property list of a file opened
+ * with non-SWMR acccess.
+ *
+ * \include H5Pget_metadata_read_attempts.3.c
+ *
+ * \endparblock
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts);
/**
* \ingroup FAPL
@@ -3510,10 +3932,102 @@ H5_DLL herr_t H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts);
*
*/
H5_DLL herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the object flush property values from the file access property list
+ *
+ * \fapl_id{plist_id}
+ * \param[in] func The user-defined callback function
+ * \param[in] udata The user-defined input data for the callback function
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_object_flush_cb() gets the user-defined callback
+ * function that is set in the file access property list
+ * \p fapl_id and stored in the parameter \p func. The callback is
+ * invoked whenever an object flush occurs in the file. This
+ * routine also obtains the user-defined input data that is
+ * passed along to the callback function in the parameter
+ * \p udata.
+ *
+ * \par Example
+ * \parblock
+ * The example below illustrates the usage of this routine to obtain the
+ * object flush property values.
+ *
+ * \include H5Pget_object_flush_cb.c
+ * \endparblock
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata);
-H5_DLL herr_t H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size, unsigned *min_meta_per,
- unsigned *min_raw_per);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the maximum size for the page buffer and the minimum
+ percentage for metadata and raw data pages
+ *
+ * \fapl_id{plist_id}
+ * \param[out] buf_size Maximum size, in bytes, of the page buffer
+ * \param[out] min_meta_perc Minimum metadata percentage to keep in the
+ * page buffer before allowing pages containing metadata to
+ * be evicted
+ *
+ * \param[out] min_raw_perc Minimum raw data percentage to keep in the
+ * page buffer before allowing pages containing raw data to
+ * be evicted
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_page_buffer_size() retrieves \p buf_size, the maximum
+ * size in bytes of the page buffer, \p min_meta_perc, the
+ * minimum metadata percentage, and \p min_raw_perc, the
+ * minimum raw data percentage.
+ *
+ * \since 1.10.1
+ */
+H5_DLL herr_t H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size, unsigned *min_meta_perc,
+ unsigned *min_raw_perc);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Returns maximum data sieve buffer size
+ *
+ * \fapl_id{fapl_id}
+ * \param[in] size Maximum size, in bytes, of data sieve buffer
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_sieve_buf_size() retrieves, size, the current maximum
+ * size of the data sieve buffer.
+ *
+ * This value is set by H5Pset_sieve_buf_size() and is retrieved
+ * from the file access property list fapl_id.
+ *
+ * \version 1.6.0 The \p size parameter has changed from type \c hsize_t
+ * to \c size_t
+ * \since 1.4.0
+ */
H5_DLL herr_t H5Pget_sieve_buf_size(hid_t fapl_id, size_t *size /*out*/);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves the current small data block size setting
+ *
+ * \fapl_id{fapl_id}
+ * \param[out] size Maximum size, in bytes, of the small data block
+ *
+ * \result \herr_t
+ *
+ * \details H5Pget_small_data_block_size() retrieves the current setting
+ * for the size of the small data block.
+ *
+ * If the returned value is zero (0), the small data block
+ * mechanism has been disabled for the file.
+ *
+ * \since 1.4.4
+ */
H5_DLL herr_t H5Pget_small_data_block_size(hid_t fapl_id, hsize_t *size /*out*/);
/**
* \ingroup FAPL
@@ -3684,6 +4198,64 @@ H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignme
*/
H5_DLL herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts, size_t rdcc_nslots, size_t rdcc_nbytes,
double rdcc_w0);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets write tracking information for core driver, #H5FD_CORE
+ *
+ * \fapl_id{fapl_id}
+ * \param[in] is_enabled Boolean value specifying whether feature is
+ enabled
+ * \param[in] page_size Positive integer specifying size, in bytes, of
+ * write aggregation pages Value of 1 (one) enables
+ * tracking with no paging.
+ *
+ * \return \herr_t
+ *
+ * \details When a file is created or opened for writing using the core
+ * virtual file driver (VFD) with the backing store option
+ * turned on, the core driver can be configured to track
+ * changes to the file and write out only the modified bytes.
+ *
+ * This write tracking feature is enabled and disabled with \p
+ * is_enabled. The default setting is that write tracking is
+ * disabled, or off.
+ *
+ * To avoid a large number of small writes, changes can
+ * be aggregated into pages of a user-specified size, \p
+ * page_size.
+ *
+ * Setting \p page_size to 1 enables tracking with no page
+ * aggregation.
+ *
+ * The backing store option is set via the function
+ * H5Pset_fapl_core.
+ *
+ * \attention
+ * \parblock
+ * This function is only for use with the core VFD and must
+ * be used after the call to H5Pset_fapl_core(). It is an error
+ * to use this function with any other VFD.
+ *
+ * It is an error to use this function when the backing store
+ * flag has not been set using H5Pset_fapl_core().
+ *
+ * This function only applies to the backing store write
+ * operation which typically occurs when the file is flushed
+ * or closed. This function has no relationship to the
+ * increment parameter passed to H5Pset_fapl_core().
+ *
+ * For optimum performance, the \p page_size parameter should be
+ * a power of two.
+ *
+ * It is an error to set the page size to 0.
+ * \endparblock
+ *
+ * \version 1.8.14 C function modified in this release to return error
+ * if \p page_size is set to 0 (zero).
+ * \since 1.8.13
+ *
+ */
H5_DLL herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size_t page_size);
/**
* \ingroup FAPL
@@ -3712,8 +4284,141 @@ H5_DLL herr_t H5Pset_core_write_tracking(hid_t fapl_id, hbool_t is_enabled, size
*
*/
H5_DLL herr_t H5Pset_driver(hid_t plist_id, hid_t driver_id, const void *driver_info);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the number of files that can be held open in an external
+ * link open file cache
+ *
+ * \par Motivation
+ * \parblock
+ * The <em>external link open file cache</em> holds files open after
+ * they have been accessed via an external link. This cache reduces
+ * the number of times such files are opened when external links are
+ * accessed repeatedly and can siginificantly improves performance in
+ * certain heavy-use situations and when low-level file opens or closes
+ * are expensive.
+ *
+ * H5Pset_elink_file_cache_size() sets the number of files
+ * that will be held open in an external link open file
+ * cache. H5Pget_elink_file_cache_size() retrieves the size of an existing
+ * cache; and H5Fclear_elink_file_cache() clears an existing cache without
+ * closing it.
+ * \endparblock
+ *
+ * \fapl_id{plist_id}
+ * \param[in] efc_size External link open file cache size in number of files
+ * <em>Default setting is 0 (zero).</em>
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_elink_file_cache_size() specifies the number of files
+ * that will be held open in an external link open file cache.
+ *
+ * The default external link open file cache size is 0 (zero),
+ * meaning that files accessed via an external link are not
+ * held open. Setting the cache size to a positive integer
+ * turns on the cache; setting the size back to zero turns it
+ * off.
+ *
+ * With this property set, files are placed in the external
+ * link open file cache cache when they are opened via an
+ * external link. Files are then held open until either
+ * they are evicted from the cache or the parent file is
+ * closed. This property setting can improve performance when
+ * external links are repeatedly accessed.
+ *
+ * When the cache is full, files will be evicted using a least
+ * recently used (LRU) scheme; the file which has gone the
+ * longest time without being accessed through the parent file
+ * will be evicted and closed if nothing else is holding that
+ * file open.
+ *
+ * Files opened through external links inherit the parent
+ * file’s file access property list by default, and therefore
+ * inherit the parent file’s external link open file cache
+ * setting.
+ *
+ * When child files contain external links of their own, the
+ * caches can form a graph of cached external files. Closing
+ * the last external reference to such a graph will recursively
+ * close all files in the graph, even if cycles are present.
+ * \par Example
+ * \parblock
+ * The following code sets up an external link open file cache that will
+ * hold open up to 8 files reached through external links:
+ *
+ * \code
+ * status = H5Pset_elink_file_cache_size(fapl_id, 8);
+ * \endcode
+ * \endparblock
+ *
+ * \since 1.8.7
+ */
H5_DLL herr_t H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Controls the library's behavior of evicting metadata associated with
+ * a closed object
+ *
+ * \fapl_id
+ * \param[in] evict_on_close Whether the HDF5 object should be evicted on close
+ *
+ * \return \herr_t
+ *
+ * \details The library's metadata cache is fairly conservative about holding
+ * on to HDF5 object metadata(object headers, chunk index structures,
+ * etc.), which can cause the cache size to grow, resulting in memory
+ * pressure on an application or system. When enabled, the "evict on
+ * close" property will cause all metadata for an object to be evicted
+ * from the cache as long as metadata is not referenced by any other
+ * open object.
+ *
+ * This function only applies to file access property lists.
+ *
+ * The default library behavior is to not evict on object or file
+ * close.
+ *
+ * When applied to a file access property list, any subsequently opened
+ * object will inherit the "evict on close" property and will have
+ * its metadata evicted when the object is closed.
+ *
+ * \since 1.10.1
+ *
+ */
H5_DLL herr_t H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets offset property for low-level access to a file in a family of
+ * files
+ *
+ * \fapl_id
+ * \param[in] offset Offset in bytes within the HDF5 file
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_family_offset() sets the offset property in the file access
+ * property list \p fapl_id so that the user application can
+ * retrieve a file handle for low-level access to a particular member
+ * of a family of files. The file handle is retrieved with a separate
+ * call to H5Fget_vfd_handle() (or, in special circumstances, to
+ * H5FDget_vfd_handle(); see \ref VFL).
+ *
+ * The value of \p offset is an offset in bytes from the beginning of
+ * the HDF5 file, identifying a user-determined location within the
+ * HDF5 file.
+ * The file handle the user application is seeking is for the specific
+ * member-file in the associated family of files to which this offset
+ * is mapped.
+ *
+ * Use of this function is only appropriate for an HDF5 file written as
+ * a family of files with the \c FAMILY file driver.
+ *
+ * \since 1.6.0
+ *
+ */
H5_DLL herr_t H5Pset_family_offset(hid_t fapl_id, hsize_t offset);
/**
* \ingroup FAPL
@@ -3776,9 +4481,279 @@ H5_DLL herr_t H5Pset_family_offset(hid_t fapl_id, hsize_t offset);
*
*/
H5_DLL herr_t H5Pset_fclose_degree(hid_t fapl_id, H5F_close_degree_t degree);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets an initial file image in a memory buffer
+ *
+ * \fapl_id
+ * \param[in] buf_ptr Pointer to the initial file image, or
+ * NULL if no initial file image is desired
+ * \param[in] buf_len Size of the supplied buffer, or
+ * 0 (zero) if no initial image is desired
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_file_image() allows an application to provide a file image
+ * to be used as the initial contents of a file.
+ * Calling H5Pset_file_image()makes a copy of the buffer specified in
+ * \p buf_ptr of size \p buf_len.
+ *
+ * \par Motivation:
+ * H5Pset_file_image() and other elements of HDF5 are
+ * used to load an image of an HDF5 file into system memory and open
+ * that image as a regular HDF5 file. An application can then use the
+ * file without the overhead of disk I/O.
+ *
+ * \par Recommended Reading:
+ * This function is part of the file image
+ * operations feature set. It is highly recommended to study the guide
+ * [<em>HDF5 File Image Operations</em>]
+ * (https://portal.hdfgroup.org/display/HDF5/HDF5+File+Image+Operations
+ * ) before using this feature set. See the “See Also” section below
+ * for links to other elements of HDF5 file image operations.
+ *
+ * \see
+ * \li H5LTopen_file_image()
+ * \li H5Fget_file_image()
+ * \li H5Pget_file_image()
+ * \li H5Pset_file_image_callbacks()
+ * \li H5Pget_file_image_callbacks()
+ *
+ * \li [HDF5 File Image Operations]
+ * (https://portal.hdfgroup.org/display/HDF5/HDF5+File+Image+Operations)
+ * in [Advanced Topics in HDF5]
+ * (https://portal.hdfgroup.org/display/HDF5/Advanced+Topics+in+HDF5)
+ *
+ * \li Within H5Pset_file_image_callbacks():
+ * \li Callback #H5FD_file_image_callbacks_t
+ * \li Callback #H5FD_file_image_op_t
+ *
+ * \version 1.8.13 Fortran subroutine added in this release.
+ * \since 1.8.9
+ *
+ */
H5_DLL herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the callbacks for working with file images
+ *
+ * \note **Motivation:** H5Pset_file_image_callbacks() and other elements
+ * of HDF5 are used to load an image of an HDF5 file into system
+ * memory and open that image as a regular HDF5 file. An application
+ * can then use the file without the overhead of disk I/O.\n
+ * **Recommended Reading:** This function is part of the file
+ * image operations feature set. It is highly recommended to study
+ * the guide [HDF5 File Image Operations]
+ * (https://portal.hdfgroup.org/display/HDF5/HDF5+File+Image+Operations
+ * ) before using this feature set. See the “See Also” section below
+ * for links to other elements of HDF5 file image operations.
+ *
+ * \fapl_id
+ * \param[in,out] callbacks_ptr Pointer to the instance of the
+ * #H5FD_file_image_callbacks_t structure
+ *
+ * \return \herr_t \n
+ * **Failure Modes**: Due to interactions between this function and
+ * H5Pset_file_image() and H5Pget_file_image(),
+ * H5Pset_file_image_callbacks() will fail if a file image has
+ * already been set in the target file access property list, \p fapl_id.
+ *
+ * \details H5Pset_file_image_callbacks() sets callback functions for working
+ * with file images in memory.
+ *
+ * H5Pset_file_image_callbacks() allows an application to control the
+ * management of file image buffers through user defined callbacks.
+ * These callbacks can be used in the management of file image buffers
+ * in property lists and with certain file drivers.
+ *
+ * H5Pset_file_image_callbacks() must be used before any file image has
+ * been set in the file access property list. Once a file image has
+ * been set, the function will fail.
+ *
+ * The callback routines set up by H5Pset_file_image_callbacks() are
+ * invoked when a new file image buffer is allocated, when an existing
+ * file image buffer is copied or resized, or when a file image buffer
+ * is released from use.
+ *
+ * Some file drivers allow the use of user-defined callback functions
+ * for allocating, freeing, and copying the driver’s internal buffer,
+ * potentially allowing optimizations such as avoiding large \c malloc
+ * and \c memcpy operations, or to perform detailed logging.
+ *
+ * From the perspective of the HDF5 library, the operations of the
+ * \ref H5FD_file_image_callbacks_t.image_malloc "image_malloc",
+ * \ref H5FD_file_image_callbacks_t.image_memcpy "image_memcpy",
+ * \ref H5FD_file_image_callbacks_t.image_realloc "image_realloc", and
+ * \ref H5FD_file_image_callbacks_t.image_free "image_free" callbacks
+ * must be identical to those of the
+ * corresponding C standard library calls (\c malloc, \c memcpy,
+ * \c realloc, and \c free). While the operations must be identical,
+ * the file image callbacks have more parameters. The return values
+ * of \ref H5FD_file_image_callbacks_t.image_malloc "image_malloc" and
+ * \ref H5FD_file_image_callbacks_t.image_realloc "image_realloc" are identical to
+ * the return values of \c malloc and \c realloc. The return values of
+ * \ref H5FD_file_image_callbacks_t.image_malloc "image_malloc" and
+ * \ref H5FD_file_image_callbacks_t.image_free "image_free" differ from the return
+ * values of \c memcpy and \c free in that the return values of
+ * \ref H5FD_file_image_callbacks_t.image_memcpy "image_memcpy" and
+ * \ref H5FD_file_image_callbacks_t.image_free "image_free" can also indicate failure.
+ *
+ * The callbacks and their parameters, along with a struct and
+ * an \c ENUM required for their use, are described below.
+ *
+ * <b>Callback struct and \c ENUM:</b>
+ *
+ * The callback functions set up by H5Pset_file_image_callbacks() use
+ * a struct and an \c ENUM that are defined as follows
+ *
+ * The struct #H5FD_file_image_callbacks_t serves as a container
+ * for the callback functions and a pointer to user-supplied data.
+ * The struct is defined as follows:
+ * \snippet H5FDpublic.h H5FD_file_image_callbacks_t_snip
+ *
+ * Elements of the #H5FD_file_image_op_t are used by the
+ * callbacks to invoke certain operations on file images. The ENUM is
+ * defined as follows:
+ * \snippet H5FDpublic.h H5FD_file_image_op_t_snip
+ *
+ * The elements of the #H5FD_file_image_op_t are used in the following
+ * callbacks:
+ *
+ * - The \ref H5FD_file_image_callbacks_t.image_malloc "image_malloc" callback
+ * contains a pointer to a function that must appear to HDF5 to have
+ * functionality identical to that of the standard C library \c malloc() call.
+ *
+ * - Signature in #H5FD_file_image_callbacks_t:
+ * \snippet H5FDpublic.h image_malloc_snip
+ * \n
+ * - The \ref H5FD_file_image_callbacks_t.image_memcpy "image_memcpy"
+ * callback contains a pointer to a function
+ * that must appear to HDF5 to have functionality identical to that
+ * of the standard C library \c memcopy() call, except that it returns
+ * a \p NULL on failure. (The \c memcpy C Library routine is defined
+ * to return the \p dest parameter in all cases.)
+ *
+ * - Setting \ref H5FD_file_image_callbacks_t.image_memcpy "image_memcpy"
+ * to \c NULL indicates that HDF5 should invoke
+ * the standard C library \c memcpy() routine when copying buffers.
+ *
+ * - Signature in #H5FD_file_image_callbacks_t:
+ * \snippet H5FDpublic.h image_memcpy_snip
+ * \n
+ * - The \ref H5FD_file_image_callbacks_t.image_realloc "image_realloc" callback
+ * contains a pointer to a function that must appear to HDF5 to have
+ * functionality identical to that of the standard C library \c realloc() call.
+ *
+ * - Setting \ref H5FD_file_image_callbacks_t.image_realloc "image_realloc"
+ * to \p NULL indicates that HDF5 should
+ * invoke the standard C library \c realloc() routine when resizing
+ * file image buffers.
+ *
+ * - Signature in #H5FD_file_image_callbacks_t:
+ * \snippet H5FDpublic.h image_realloc_snip
+ * \n
+ * - The \ref H5FD_file_image_callbacks_t.image_free "image_free" callback contains
+ * a pointer to a function that must appear to HDF5 to have functionality
+ * identical to that of the standard C library \c free() call, except
+ * that it will return \c 0 (\c SUCCEED) on success and \c -1 (\c FAIL) on failure.
+ *
+ * - Setting \ref H5FD_file_image_callbacks_t.image_free "image_free"
+ * to \c NULL indicates that HDF5 should invoke
+ * the standard C library \c free() routine when releasing file image
+ * buffers.
+ *
+ * - Signature in #H5FD_file_image_callbacks_t:
+ * \snippet H5FDpublic.h image_free_snip
+ * \n
+ * - The \ref H5FD_file_image_callbacks_t.udata_copy "udata_copy"
+ * callback contains a pointer to a function
+ * that, from the perspective of HDF5, allocates a buffer of suitable
+ * size, copies the contents of the supplied \p udata into the new
+ * buffer, and returns the address of the new buffer. The function
+ * returns NULL on failure. This function is necessary if a non-NULL
+ * \p udata parameter is supplied, so that property lists containing
+ * the image callbacks can be copied. If the \p udata parameter below
+ * is \c NULL, then this parameter should be \c NULL as well.
+ *
+ * - Signature in #H5FD_file_image_callbacks_t:
+ * \snippet H5FDpublic.h udata_copy_snip
+ * \n
+ * - The \ref H5FD_file_image_callbacks_t.udata_free "udata_free"
+ * callback contains a pointer to a function
+ * that, from the perspective of HDF5, frees a user data block. This
+ * function is necessary if a non-NULL udata parameter is supplied so
+ * that property lists containing image callbacks can be discarded
+ * without a memory leak. If the udata parameter below is \c NULL,
+ * this parameter should be \c NULL as well.
+ *
+ * - Signature in #H5FD_file_image_callbacks_t:
+ * \snippet H5FDpublic.h udata_free_snip
+ *
+ * - \p **udata**, the final field in the #H5FD_file_image_callbacks_t
+ * struct, provides a pointer to user-defined data. This pointer will
+ * be passed to the
+ * \ref H5FD_file_image_callbacks_t.image_malloc "image_malloc",
+ * \ref H5FD_file_image_callbacks_t.image_memcpy "image_memcpy",
+ * \ref H5FD_file_image_callbacks_t.image_realloc "image_realloc", and
+ * \ref H5FD_file_image_callbacks_t.image_free "image_free" callbacks.
+ * Define udata as \c NULL if no user-defined data is provided.
+ *
+ * \since 1.8.9
+ *
+ */
H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the file locking property values
+ *
+ * \fapl_id
+ * \param[in] use_file_locking Toggle to specify file locking (or not)
+ * \param[in] ignore_when_disabled Toggle to ignore when disabled (or not)
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_file_locking() overrides the default file locking flag
+ * setting that was set when the library was configured.
+ *
+ * This setting can be overridden by the \c HDF5_USE_FILE_LOCKING
+ * environment variable.
+ *
+ * File locking is used when creating/opening a file to prevent
+ * problematic file accesses.
+ *
+ * \since 1.10.7
+ *
+ */
H5_DLL herr_t H5Pset_file_locking(hid_t fapl_id, hbool_t use_file_locking, hbool_t ignore_when_disabled);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets garbage collecting references flag
+ *
+ * \fapl_id
+ * \param[in] gc_ref Flag setting reference garbage collection to on (1) or off (0)
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_gc_references() sets the flag for garbage collecting
+ * references for the file.
+ *
+ * Dataset region references and other reference types use space in an
+ * HDF5 file's global heap. If garbage collection is on and the user
+ * passes in an uninitialized value in a reference structure, the heap
+ * might get corrupted. When garbage collection is off, however, and
+ * the user re-uses a reference, the previous heap block will be
+ * orphaned and not returned to the free heap space.
+ *
+ * When garbage collection is on, the user must initialize the
+ * reference structures to 0 or risk heap corruption.
+ *
+ * The default value for garbage collecting references is off.
+ *
+ */
H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref);
/**
* \ingroup FAPL
@@ -3861,10 +4836,11 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref);
* <td>\p low=#H5F_LIBVER_V18<br />
* \p high=#H5F_LIBVER_V18</td>
* <td>
- * \li The library will create objects with the latest format versions
- * available to library release 1.8.x.
+ * \li The library will create objects with the latest format
+ * versions available to library release 1.8.x.
* \li API calls that create objects or features that are available
- * to versions of the library greater than 1.8.x release will fail.
+ * to versions of the library greater than 1.8.x release will
+ * fail.
* \li Earlier versions of the library may not be able to access
* objects created with this setting.</td>
* </tr>
@@ -3872,14 +4848,15 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref);
* <td>\p low=#H5F_LIBVER_V18<br />
* \p high=#H5F_LIBVER_V110</td>
* <td>
- * \li The library will create objects with the latest format versions
- * available to library release 1.8.x.
+ * \li The library will create objects with the latest format
+ * versions available to library release 1.8.x.
* \li The library will allow objects to be created with the latest
* format versions available to library release 1.10.x.
- * Since 1.10.x is also #H5F_LIBVER_LATEST, there is no upper limit
- * on the format versions to use. For example, if a newer format
- * version is required to support a feature e.g. virtual dataset,
- * this setting will allow the object to be created.
+ * Since 1.10.x is also #H5F_LIBVER_LATEST, there is no upper
+ * limit on the format versions to use. For example, if a
+ * newer format version is required to support a feature e.g.
+ * virtual dataset, this setting will allow the object to be
+ * created.
* \li Earlier versions of the library may not be able to access
* objects created with this setting.</td>
* </tr>
@@ -3888,39 +4865,356 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref);
* \p high=#H5F_LIBVER_V110
* </td>
* <td>
- * \li The library will create objects with the latest format versions
- * available to library release 1.10.x.
+ * \li The library will create objects with the latest format
+ * versions available to library release 1.10.x.
* \li The library will allow objects to be created with the latest
* format versions available to library release 1.10.x.
- * Since 1.10.x is also #H5F_LIBVER_LATEST, there is no upper limit
- * on the format versions to use. For example, if a newer format
- * version is required to support a feature e.g. virtual dataset,
- * this setting will allow the object to be created.
+ * Since 1.10.x is also #H5F_LIBVER_LATEST, there is no upper
+ * limit on the format versions to use. For example, if a
+ * newer format version is required to support a feature e.g.
+ * virtual dataset, this setting will allow the object to be
+ * created.
* \li This setting allows users to take advantage of the latest
- * features and performance enhancements in the library. However,
- * objects written with this setting may be accessible to a smaller
- * range of library versions than would be the case if low is set
- * to #H5F_LIBVER_EARLIEST.
- * \li Earlier versions of the library may not be able to access objects created with this
+ * features and performance enhancements in the library.
+ * However, objects written with this setting may be
+ * accessible to a smaller range of library versions than
+ * would be the case if low is set to #H5F_LIBVER_EARLIEST.
+ * \li Earlier versions of the library may not be able to access
+ * objects created with this
* setting.
* </td>
* </tr>
* </table>
*
- * \version 1.10.2 #H5F_LIBVER_V18 added to the enumerated defines in #H5F_libver_t.
+ * \version 1.10.2 #H5F_LIBVER_V18 added to the enumerated defines in
+ * #H5F_libver_t.
*
* \since 1.8.0
*
*/
H5_DLL herr_t H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Set the initial metadata cache configuration in the indicated File
+ * Access Property List to the supplied value
+ *
+ * \fapl_id{plist_id}
+ * \param[in] config_ptr Pointer to the instance of \p H5AC_cache_config_t
+ * containing the desired configuration
+ * \return \herr_t
+ *
+ * \details The fields of the #H5AC_cache_config_t structure are shown
+ * below:
+ * \snippet H5ACpublic.h H5AC_cache_config_t_snip
+ * \click4more
+ *
+ * \details H5Pset_mdc_config() attempts to set the initial metadata cache
+ * configuration to the supplied value. It will fail if an invalid
+ * configuration is detected. This configuration is used when the file
+ * is opened.
+ *
+ * See the overview of the metadata cache in the special topics section
+ * of the user manual for details on what is being configured. If you
+ * have not read and understood that documentation, you really should
+ * not be using this API call.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets metadata cache logging options
+ *
+ * \fapl_id{plist_id}
+ * \param[in] is_enabled Whether logging is enabled
+ * \param[in] location Location of log in UTF-8/ASCII (file path/name)
+ * (On Windows, this must be ASCII)
+ * \param[in] start_on_access Whether the logging will begin as soon as the
+ * file is opened or created
+ *
+ * \return \herr_t
+ *
+ * \details The metadata cache is a central part of the HDF5 library through
+ * which all file metadata reads and writes take place. File metadata
+ * is normally invisible to the user and is used by the library for
+ * purposes such as locating and indexing data. File metadata should
+ * not be confused with user metadata, which consists of attributes
+ * created by users and attached to HDF5 objects such as datasets via
+ * H5A API calls.
+ *
+ * Due to the complexity of the cache, a trace/logging feature has
+ * been created that can be used by HDF5 developers for debugging and
+ * performance analysis. The functions that control this functionality
+ * will normally be of use to a very limited number of developers
+ * outside of The HDF Group. The functions have been documented to
+ * help users create logs that can be sent with bug reports.
+ *
+ * Control of the log functionality is straightforward. Logging is
+ * enabled via the H5Pset_mdc_log_options() function,
+ * which will modify the file access property list used to open or
+ * create a file. This function has a flag that determines whether
+ * logging begins at file open or starts in a paused state. Log
+ * messages can then be controlled via the H5Fstart_mdc_logging()
+ * and H5Fstop_mdc_logging() function.
+ *
+ * H5Pget_mdc_log_options() can be used to examine a file access
+ * property list, and H5Fget_mdc_logging_status() will return the
+ * current state of the logging flags.
+ *
+ * The log format is described in [<em>Metadata Cache Logging</em>]
+ * (https://portal.hdfgroup.org/display/HDF5/Fine-tuning+the+Metadata+Cache).
+ *
+ * \since 1.10.0
+ *
+ */
H5_DLL herr_t H5Pset_mdc_log_options(hid_t plist_id, hbool_t is_enabled, const char *location,
hbool_t start_on_access);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the minimum metadata block size
+ *
+ * \fapl_id{fapl_id}
+ * \param[in] size Minimum size, in bytes, of metadata block allocations
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_meta_block_size() sets the minimum size, in bytes, of
+ * metadata block allocations when #H5FD_FEAT_AGGREGATE_METADATA is set by a VFL
+ * driver.
+
+ * Each raw metadata block is initially allocated to be of the given size.
+ * Specific metadata objects (e.g., object headers, local heaps, B-trees) are then
+ * sub-allocated from this block.
+ *
+ * The default setting is 2048 bytes, meaning that the library will
+ * attempt to aggregate metadata in at least 2K blocks in the file.
+ * Setting the value to zero (\Code{0}) with this function will turn
+ * off metadata aggregation, even if the VFL driver attempts to use the
+ * metadata aggregation strategy.
+ *
+ * Metadata aggregation reduces the number of small data objects in the file that
+ * would otherwise be required for metadata. The aggregated block of metadata is
+ * usually written in a single write action and always in a contiguous block,
+ * potentially significantly improving library and application performance.
+ *
+ * \since 1.4.0
+ */
H5_DLL herr_t H5Pset_meta_block_size(hid_t fapl_id, hsize_t size);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the number of read attempts in a file access property list
+ *
+ * \fapl_id{plist_id}
+ * \param[in] attempts The number of read attempts. Must be a value greater than \Code{0}
+ *
+ * \return \herr_t
+ *
+ * \return Failure Modes:
+ * - When the user sets the number of read attempts to \Code{0}.
+ * - When the input property list is not a file access property list.
+ * - When the library is unable to set the number of read attempts in the file access property list.
+ *
+ * \details H5Pset_metadata_read_attempts() sets the number of reads that the
+ * library will try when reading checksummed metadata in an HDF5 file opened
+ * with SWMR access. When reading such metadata, the library will compare the
+ * checksum computed for the metadata just read with the checksum stored within
+ * the piece of checksum. When performing SWMR operations on a file, the
+ * checksum check might fail when the library reads data on a system that is not
+ * atomic. To remedy such situations, the library will repeatedly read the piece
+ * of metadata until the check passes or finally fails the read when the allowed
+ * number of attempts is reached.
+ *
+ * The number of read attempts used by the library will depend on how the file is
+ * opened and whether the user sets the number of read attempts via this routine:
+
+ * - For a file opened with SWMR access:
+ * - If the user sets the number of attempts to \Code{N}, the library will use \Code{N}.
+ * - If the user does not set the number of attempts, the library will use the
+ * default for SWMR access (\Code{100}).
+ * - For a file opened with non-SWMR access, the library will always use the default
+ * for non-SWMR access (\Code{1}). The value set via this routine does not have any effect
+ * during non-SWMR access.
+ *
+ * \b Example: The first example illustrates the case in setting the number of read attempts for a file
+ * opened with SWMR access.
+ *
+ * \snippet H5Pset_metadata_read_attempts.c SWMR Access
+ *
+ * \b Example: The second example illustrates the case in setting the number of
+ * read attempts for a file opened with non-SWMR access. The value
+ * set in the file access property list does not have any effect.
+ *
+ * \snippet H5Pset_metadata_read_attempts.c non-SWMR Access
+ *
+ * \note \b Motivation: On a system that is not atomic, the library might
+ * possibly read inconsistent metadata with checksum when performing
+ * single-writer/multiple-reader (SWMR) operations for an HDF5 file. Upon
+ * encountering such situations, the library will try reading the metadata
+ * again to obtain consistent data. This routine provides the means to set
+ * the number of read attempts other than the library default.
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pset_metadata_read_attempts(hid_t plist_id, unsigned attempts);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Specifies type of data to be accessed via the \Code{MULTI} driver,
+ * enabling more direct access
+ *
+ * \fapl_id{fapl_id}
+ * \param[in] type Type of data to be accessed
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_multi_type() sets the \Emph{type of data} property in the file
+ * access property list \p fapl_id. This setting enables a user
+ * application to specify the type of data the application wishes to
+ * access so that the application can retrieve a file handle for
+ * low-level access to the particular member of a set of \Code{MULTI}
+ * files in which that type of data is stored. The file handle is
+ * retrieved with a separate call to H5Fget_vfd_handle() (or, in special
+ * circumstances, to H5FDget_vfd_handle(); see \ref VFL.
+ *
+ * The type of data specified in \p type may be one of the following:
+ *
+ * <table>
+ * <tr>
+ * <td>#H5FD_MEM_SUPER</td> <td>Super block data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_BTREE</td> <td>B-tree data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_DRAW</td> <td>Dataset raw data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_GHEAP</td> <td>Global heap data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_LHEAP</td> <td>Local Heap data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_OHDR</td> <td>Object header data</td>
+ * </tr>
+ * </table>
+ *
+ * This function is for use only when accessing an HDF5 file written as a set of
+ * files with the \Code{MULTI} file driver.
+ *
+ * \since 1.6.0
+ */
H5_DLL herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets a callback function to invoke when an object flush occurs in the file
+ *
+ * \fapl_id{plist_id}
+ * \op{func}
+ * \op_data_in{udata}
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_object_flush_cb() sets the callback function to invoke in the
+ * file access property list \p plist_id whenever an object flush occurs in
+ * the file. Library objects are group, dataset, and committed
+ * datatype.
+ *
+ * The callback function \p func must conform to the prototype defined below:
+ * \code
+ * typedef herr_t (*H5F_flush_cb_t)(hid_t object_id, void *user_data)
+ * \endcode
+ *
+ * The parameters of the callback function, per the above prototypes, are defined as follows:
+ * - \Code{object_id} is the identifier of the object which has just been flushed.
+ * - \Code{user_data} is the user-defined input data for the callback function.
+ *
+ * \b Example: The example below illustrates the usage of this routine to set
+ * the callback function to invoke when an object flush occurs.
+ *
+ * \include H5Pset_object_flush_cb.c
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pset_object_flush_cb(hid_t plist_id, H5F_flush_cb_t func, void *udata);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the maximum size of the data sieve buffer
+ *
+ * \fapl_id{fapl_id}
+ * \param[in] size Maximum size, in bytes, of data sieve buffer
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_sieve_buf_size() sets \p size, the maximum size in bytes of the
+ * data sieve buffer, which is used by file drivers that are capable of
+ * using data sieving.
+ *
+ * The data sieve buffer is used when performing I/O on datasets in the
+ * file. Using a buffer which is large enough to hold several pieces of
+ * the dataset being read in for hyperslab selections boosts
+ * performance by quite a bit.
+ *
+ * The default value is set to 64KB, indicating that file I/O for raw
+ * data reads and writes will occur in at least 64KB blocks. Setting
+ * the value to zero (\Code{0}) with this API function will turn off
+ * the data sieving, even if the VFL driver attempts to use that
+ * strategy.
+ *
+ * Internally, the library checks the storage sizes of the datasets in
+ * the file. It picks the smaller one between the size from the file
+ * access property and the size of the dataset to allocate the sieve
+ * buffer for the dataset in order to save memory usage.
+ *
+ * \version 1.6.0 The \p size parameter has changed from type \Code{hsize_t} to \Code{size_t}.
+ *
+ * \since 1.4.0
+ */
H5_DLL herr_t H5Pset_sieve_buf_size(hid_t fapl_id, size_t size);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the size of a contiguous block reserved for small data
+ *
+ * \fapl_id{fapl_id}
+ * \param[in] size Maximum size, in bytes, of the small data block.
+ The default size is \Code{2048}.
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_small_data_block_size() reserves blocks of \p size bytes for the
+ * contiguous storage of the raw data portion of \Emph{small} datasets. The
+ * HDF5 library then writes the raw data from small datasets to this
+ * reserved space, thus reducing unnecessary discontinuities within
+ * blocks of meta data and improving I/O performance.
+ *
+ * A small data block is actually allocated the first time a qualifying
+ * small dataset is written to the file. Space for the raw data portion
+ * of this small dataset is suballocated within the small data block.
+ * The raw data from each subsequent small dataset is also written to
+ * the small data block until it is filled; additional small data
+ * blocks are allocated as required.
+ *
+ * The HDF5 library employs an algorithm that determines whether I/O
+ * performance is likely to benefit from the use of this mechanism with
+ * each dataset as storage space is allocated in the file. A larger
+ * \p size will result in this mechanism being employed with larger
+ * datasets.
+ *
+ * The small data block size is set as an allocation property in the
+ * file access property list identified by \p fapl_id.
+ *
+ * Setting \p size to zero (\Code{0}) disables the small data block mechanism.
+ *
+ * \since 1.4.4
+ */
H5_DLL herr_t H5Pset_small_data_block_size(hid_t fapl_id, hsize_t size);
/**
* \ingroup FAPL
@@ -3942,15 +5236,271 @@ H5_DLL herr_t H5Pset_small_data_block_size(hid_t fapl_id, hsize_t size);
*/
H5_DLL herr_t H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Query the capability flags for the VOL connector that will be used
+ * with this file access property list (FAPL).
+ *
+ * \fapl_id{plist_id}
+ * \param[out] cap_flags Flags that indicate the VOL connector capabilities
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_vol_cap_flags() queries the current VOL connector information
+ * for a FAPL to retrieve the capability flags for the VOL
+ * connector stack, as will be used by a file open or create
+ * operation that uses this FAPL.
+ *
+ * \note This routine supports the use of the HDF5_VOL_CONNECTOR environment
+ * variable to override the VOL connector set programmatically for the
+ * FAPL (with H5Pset_vol).
+ *
+ * \note The H5VL_CAP_FLAG_ASYNC flag can be checked to see if asynchronous
+ * operations are supported by the VOL connector stack.
+ *
+ * \since 1.13.0
+ *
+ */
+H5_DLL herr_t H5Pget_vol_cap_flags(hid_t plist_id, unsigned *cap_flags);
+
#ifdef H5_HAVE_PARALLEL
+/**
+ * \ingroup GAPL
+ *
+ * \brief Sets metadata I/O mode for read operations to collective or independent (default)
+ *
+ * \gacpl_id
+ * \param[in] is_collective Boolean value indicating whether metadata reads are collective
+ * (\Code{1}) or independent (\Code{0}).
+ * Default mode: Independent (\Code{0})
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_all_coll_metadata_ops() sets the metadata I/O mode for read
+ * operations in the access property list \p plist_id.
+ *
+ * When engaging in parallel I/O, all metadata write operations must be
+ * collective. If \p is_collective is \Code{1}, this property specifies
+ * that the HDF5 library will perform all metadata read operations
+ * collectively; if \p is_collective is \Code{0}, such operations may
+ * be performed independently.
+ *
+ * Users must be aware that several HDF5 operations can potentially
+ * issue metadata reads. These include opening a dataset, datatype, or
+ * group; reading an attribute; or issuing a \Emph{get info} call such
+ * as getting information for a group with H5Fget_info(). Collective
+ * I/O requirements must be kept in mind when issuing such calls in the
+ * context of parallel I/O.
+ *
+ * If this property is collective on a file access property list that
+ * is used in creating or opening a file, then the HDF5 library will
+ * assume that all metadata read operations issued on that file
+ * identifier will be issued collectively from all ranks irrespective
+ * of the individual setting of a particular operation. If this
+ * assumption is not adhered to, corruption will be introduced in the
+ * metadata cache and HDF5’s behavior will be undefined.
+ *
+ * Alternatively, a user may wish to avoid setting this property
+ * globally on the file access property list, and individually set it
+ * on particular object access property lists (dataset, group, link,
+ * datatype, attribute access property lists) for certain operations.
+ * This will indicate that only the operations issued with such an
+ * access property list will be called collectively and other
+ * operations may potentially be called independently. There are,
+ * however, several HDF5 operations that can issue metadata reads but
+ * have no property list in their function signatures to allow passing
+ * the collective requirement property. For those operations, the only
+ * option is to set the global collective requirement property on the
+ * file access property list; otherwise the metadata reads that can be
+ * triggered from those operations will be done independently by each
+ * process.
+ *
+ * Functions that do not accommodate an access property list but that
+ * might issue metadata reads are listed in \ref maybe_metadata_reads.
+ *
+ * \attention As noted above, corruption will be introduced into the metadata
+ * cache and HDF5 library behavior will be undefined when both of the following
+ * conditions exist:
+ * - A file is created or opened with a file access property list in which the
+ * collective metadata I/O property is set to \Code{1}.
+ * - Any function is called that triggers an independent metadata read while the
+ * file remains open with that file access property list.
+ *
+ * \attention An approach that avoids this corruption risk is described above.
+ *
+ * \sa_metadata_ops
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pset_all_coll_metadata_ops(hid_t plist_id, hbool_t is_collective);
+/**
+ * \ingroup GAPL
+ *
+ * \brief Retrieves metadata read mode setting
+ *
+ * \gacpl_id
+ * \param[out] is_collective Pointer to a buffer containing the Boolean value indicating whether metadata
+ * reads are collective (\Code{>0}) or independent (\Code{0}).
+ * Default mode: Independent (\Code{0})
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_all_coll_metadata_ops() retrieves the collective metadata read setting from the access
+ * property list \p plist_id into \p is_collective.
+ *
+ * \sa_metadata_ops
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets metadata write mode to collective or independent (default)
+ *
+ * \fapl_id{plist_id}
+ * \param[out] is_collective Boolean value indicating whether metadata
+ * writes are collective (\Code{>0}) or independent (\Code{0}).
+ * \Emph{Default mode:} Independent (\Code{0})
+ * \return \herr_t
+ *
+ * \details H5Pset_coll_metadata_write() tells the HDF5 library whether to
+ * perform metadata writes collectively (1) or independently (0).
+ *
+ * If collective access is selected, then on a flush of the metadata
+ * cache, all processes will divide the metadata cache entries to be
+ * flushed evenly among themselves and issue a single MPI-IO collective
+ * write operation. This is the preferred method when the size of the
+ * metadata created by the application is large.
+ *
+ * If independent access is selected, the library uses the default
+ * method for doing metadata I/O either from process zero or
+ * independently from each process.
+ *
+ * \sa_metadata_ops
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pset_coll_metadata_write(hid_t plist_id, hbool_t is_collective);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Retrieves metadata write mode setting
+ *
+ * \fapl_id{plist_id}
+ * \param[out] is_collective Pointer to a boolean value indicating whether
+ * metadata writes are collective (\Code{>0}) or independent (\Code{0}).
+ * \Emph{Default mode:} Independent (\Code{0})
+ * \return \herr_t
+ *
+ * \details H5Pget_coll_metadata_write() retrieves the collective metadata write
+ * setting from the file access property into \p is_collective.
+ *
+ * \sa_metadata_ops
+ *
+ * \since 1.10.0
+ */
H5_DLL herr_t H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective);
+
+/**
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pget_mpi_params(hid_t fapl_id, MPI_Comm *comm, MPI_Info *info);
+
+/**
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pset_mpi_params(hid_t fapl_id, MPI_Comm comm, MPI_Info info);
#endif /* H5_HAVE_PARALLEL */
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the metadata cache image option for a file access property list
+ *
+ * \fapl_id{plist_id}
+ * \param[out] config_ptr Pointer to metadata cache image configuration values
+ * \return \herr_t
+ *
+ * \details H5Pset_mdc_image_config() sets the metadata cache image option with
+ * configuration values specified by \p config_ptr for the file access
+ * property list specified in \p plist_id.
+ *
+ * #H5AC_cache_image_config_t is defined as follows:
+ * \snippet H5ACpublic.h H5AC_cache_image_config_t_snip
+ * \click4more
+ *
+ * \par Limitations: While it is an obvious error to request a cache image when
+ * opening the file read only, it is not in general possible to test for
+ * this error in the H5Pset_mdc_image_config() call. Rather than fail the
+ * subsequent file open, the library silently ignores the file image
+ * request in this case.\n It is also an error to request a cache image on
+ * a file that does not support superblock extension messages (i.e. a
+ * superblock version less than 2). As above, it is not always possible to
+ * detect this error in the H5Pset_mdc_image_config() call, and thus the
+ * request for a cache image will fail silently in this case as well.\n
+ * Creation of cache images is currently disabled in parallel -- as above,
+ * any request for a cache image in this context will fail silently.\n
+ * Files with cache images may be read in parallel applications, but note
+ * that the load of the cache image is a collective operation triggered by
+ * the first operation that accesses metadata after file open (or, if
+ * persistent free space managers are enabled, on the first allocation or
+ * deallocation of file space, or read of file space manager status,
+ * whichever comes first). Thus the parallel process may deadlock if any
+ * process does not participate in this access.\n
+ * In long sequences of file closes and opens, infrequently accessed
+ * metadata can accumulate in the cache image to the point where the cost
+ * of storing and restoring this metadata exceeds the benefit of retaining
+ * frequently used metadata in the cache image. When implemented, the
+ * #H5AC_cache_image_config_t::entry_ageout should address this problem. In
+ * the interim, not requesting a cache image every n file close/open cycles
+ * may be an acceptable work around. The choice of \c n will be driven by
+ * application behavior, but \Code{n = 10} seems a good starting point.
+ *
+ * \since 1.10.1
+ */
H5_DLL herr_t H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the maximum size for the page buffer and the minimum percentage
+ * for metadata and raw data pages
+ *
+ * \fapl_id{plist_id}
+ * \param[in] buf_size Maximum size, in bytes, of the page buffer
+ * \param[in] min_meta_per Minimum metadata percentage to keep in the page buffer
+ * before allowing pages containing metadata to be evicted (Default is 0)
+ * \param[in] min_raw_per Minimum raw data percentage to keep in the page buffer
+ * before allowing pages containing raw data to be evicted (Default is 0)
+ * \return \herr_t
+ *
+ * \details H5Pset_page_buffer_size() sets buf_size, the maximum size in bytes
+ * of the page buffer. The default value is zero, meaning that page
+ * buffering is disabled. When a non-zero page buffer size is set, the
+ * library will enable page buffering if that size is larger or equal
+ * than a single page size if a paged file space strategy is enabled
+ * using the functions H5Pset_file_space_strategy() and
+ * H5Pset_file_space_page_size().
+ *
+ * The page buffer layer captures all I/O requests before they are
+ * issued to the VFD and "caches" them in fixed sized pages. Once the
+ * total number of pages exceeds the page buffer size, the library
+ * evicts pages from the page buffer by writing them to the VFD. At
+ * file close, the page buffer is flushed writing all the pages to the
+ * file.
+ *
+ * If a non-zero page buffer size is set, and the file space strategy
+ * is not set to paged or the page size for the file space strategy is
+ * larger than the page buffer size, the subsequent call to H5Fcreate()
+ * or H5Fopen() using the \p plist_id will fail.
+ *
+ * The function also allows setting the minimum percentage of pages for
+ * metadata and raw data to prevent a certain type of data to evict hot
+ * data of the other type.
+ *
+ * \since 1.10.1
+ *
+ */
H5_DLL herr_t H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_per,
unsigned min_raw_per);
@@ -4288,7 +5838,7 @@ H5_DLL H5D_layout_t H5Pget_layout(hid_t plist_id);
* virtual dataset that has the creation property list specified
* by \p dcpl_id.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -4331,7 +5881,7 @@ H5_DLL herr_t H5Pget_virtual_count(hid_t dcpl_id, size_t *count /*out*/);
* assigned to \p size for a second H5Pget_virtual_dsetname()
* call, which will retrieve the actual dataset name.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -4375,7 +5925,7 @@ H5_DLL ssize_t H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name /
* \p size for a second H5Pget_virtual_filename() call, which
* will retrieve the actual filename.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -4400,7 +5950,7 @@ H5_DLL ssize_t H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name /
* index, \p index, and returns a dataspace identifier for the
* selection within the source dataset used in the mapping.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -4425,7 +5975,7 @@ H5_DLL hid_t H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index);
* index, \p index, and returns a dataspace identifier for the
* selection within the virtual dataset used in the mapping.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -4745,6 +6295,8 @@ H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value
*
* \return \herr_t
*
+ * \par_compr_note
+ *
* \details H5Pset_shuffle() sets the shuffle filter, #H5Z_FILTER_SHUFFLE,
* in the dataset creation property list \p plist_id. The shuffle
* filter de-interlaces a block of data by reordering the bytes.
@@ -4816,6 +6368,8 @@ H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout);
*
* \return \herr_t
*
+ * \par_compr_note
+ *
* \details H5Pset_nbit() sets the N-Bit filter, #H5Z_FILTER_NBIT, in the
* dataset creation property list \p plist_id.
*
@@ -4909,6 +6463,8 @@ H5_DLL herr_t H5Pset_nbit(hid_t plist_id);
*
* \return \herr_t
*
+ * \par_compr_note
+ *
* \details H5Pset_scaleoffset() sets the scale-offset filter,
* #H5Z_FILTER_SCALEOFFSET, for a dataset.
*
@@ -5018,6 +6574,8 @@ H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type,
*
* \return \herr_t
*
+ * \par_compr_note
+ *
* \details H5Pset_szip() sets an SZIP compression filter, #H5Z_FILTER_SZIP,
* for a dataset. SZIP is a compression method designed for use with
* scientific data.
@@ -5159,6 +6717,133 @@ H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type,
*
*/
H5_DLL herr_t H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block);
+
+/**
+ * \ingroup DCPL
+ *
+ * \brief Sets the mapping between virtual and source datasets
+ *
+ * \dcpl_id
+ * \param[in] vspace_id The dataspace identifier with the selection within the
+ * virtual dataset applied, possibly an unlimited selection
+ * \param[in] src_file_name The name of the HDF5 file where the source dataset is
+ * located or a \Code{"."} (period) for a source dataset in the same
+ * file. The file might not exist yet. The name can be specified using
+ * a C-style \c printf statement as described below.
+ * \param[in] src_dset_name The path to the HDF5 dataset in the file specified by
+ * \p src_file_name. The dataset might not exist yet. The dataset name
+ * can be specified using a C-style \c printf statement as described below.
+ * \param[in] src_space_id The source dataset’s dataspace identifier with a
+ * selection applied, possibly an unlimited selection
+ * \return \herr_t
+ *
+ * \details H5Pset_virtual() maps elements of the virtual dataset (VDS)
+ * described by the virtual dataspace identifier \p vspace_id to the
+ * elements of the source dataset described by the source dataset
+ * dataspace identifier \p src_space_id. The source dataset is
+ * identified by the name of the file where it is located,
+ * \p src_file_name, and the name of the dataset, \p src_dset_name.
+ *
+ * \par C-style \c printf Formatting Statements:
+ * C-style \c printf formatting allows a pattern to be specified in the name
+ * of a source file or dataset. Strings for the file and dataset names are
+ * treated as literals except for the following substitutions:
+ * <table>
+ * <tr>
+ * <td>\Code{"%%"}</td>
+ * <td>Replaced with a single \Code{"%"} (percent) character.</td>
+ * </tr>
+ * <tr>
+ * <td><code>"%<d>b"</code></td>
+ * <td>Where <code>"<d>"</code> is the virtual dataset dimension axis (0-based)
+ * and \Code{"b"} indicates that the block count of the selection in that
+ * dimension should be used. The full expression (for example, \Code{"%0b"})
+ * is replaced with a single numeric value when the mapping is evaluated at
+ * VDS access time. Example code for many source and virtual dataset mappings
+ * is available in the "Examples of Source to Virtual Dataset Mapping"
+ * chapter in the
+ * <a href="https://portal.hdfgroup.org/display/HDF5/RFC+HDF5+Virtual+Dataset">
+ * RFC: HDF5 Virtual Dataset</a>.
+ * </td>
+ * </tr>
+ * </table>
+ * If the printf form is used for the source file or dataset names, the
+ * selection in the source dataset’s dataspace must be fixed-size.
+ *
+ * \par Source File Resolutions:
+ * When a source dataset residing in a different file is accessed, the
+ * library will search for the source file \p src_file_name as described
+ * below:
+ * \li If \p src_file_name is a \Code{"."} (period) then it refers to the
+ * file containing the virtual dataset.
+ * \li If \p src_file_name is a relative pathname, the following steps are
+ * performed:
+ * - The library will get the prefix(es) set in the environment
+ * variable \c HDF5_VDS_PREFIX and will try to prepend each prefix
+ * to \p src_file_name to form a new \p src_file_name. If the new
+ * \p src_file_name does not exist or if \c HDF5_VDS_PREFIX is not
+ * set, the library will get the prefix set via H5Pset_virtual_prefix()
+ * and prepend it to \p src_file_name to form a new \p src_file_name.
+ * If the new \p src_file_name does not exist or no prefix is being
+ * set by H5Pset_virtual_prefix() then the path of the file containing
+ * the virtual dataset is obtained. This path can be the absolute path
+ * or the current working directory plus the relative path of that
+ * file when it is created/opened. The library will prepend this path
+ * to \p src_file_name to form a new \p src_file_name.
+ * - If the new \p src_file_name does not exist, then the library will
+ * look for \p src_file_name and will return failure/success accordingly.
+ * \li If \p src_file_name is an absolute pathname, the library will first
+ * try to find \p src_file_name. If \p src_file_name does not exist,
+ * \p src_file_name is stripped of directory paths to form a new
+ * \p src_file_name. The search for the new \p src_file_name then follows
+ * the same steps as described above for a relative pathname. See
+ * examples below illustrating how \p src_file_name is stripped to form
+ * a new \p src_file_name.
+ * \par
+ * Note that \p src_file_name is considered to be an absolute pathname when
+ * the following condition is true:
+ * \li For Unix, the first character of \p src_file_name is a slash
+ * (\Code{/}).\n For example, consider a \p src_file_name of
+ * \Code{/tmp/A.h5}. If that source file does not exist, the new
+ * \p src_file_name after stripping will be \Code{A.h5}.
+ * \li For Windows, there are 6 cases:
+ * 1. \p src_file_name is an absolute drive with absolute pathname.\n
+ * For example, consider a \p src_file_name of \Code{/tmp/A.h5}.
+ * If that source file does not exist, the new \p src_file_name
+ * after stripping will be \Code{A.h5}.
+ * 2. \p src_file_name is an absolute pathname without specifying
+ * drive name.\n For example, consider a \p src_file_name of
+ * \Code{/tmp/A.h5}. If that source file does not exist, the new
+ * \p src_file_name after stripping will be \Code{A.h5}.
+ * 3. \p src_file_name is an absolute drive with relative pathname.\n
+ * For example, consider a \p src_file_name of \Code{/tmp/A.h5}.
+ * If that source file does not exist, the new \p src_file_name
+ * after stripping will be \Code{tmp/A.h5}.
+ * 4. \p src_file_name is in UNC (Uniform Naming Convention) format
+ * with server name, share name, and pathname.\n
+ * For example, consider a \p src_file_name of \Code{/tmp/A.h5}.
+ * If that source file does not exist, the new \p src_file_name
+ * after stripping will be \Code{A.h5}.
+ * 5. \p src_file_name is in Long UNC (Uniform Naming Convention)
+ * format with server name, share name, and pathname.\n
+ * For example, consider a \p src_file_name of \Code{/tmp/A.h5}.
+ * If that source file does not exist, the new \p src_file_name
+ * after stripping will be \Code{A.h5}.
+ * 6. \p src_file_name is in Long UNC (Uniform Naming Convention)
+ * format with an absolute drive and an absolute pathname.\n
+ * For example, consider a \p src_file_name of \Code{/tmp/A.h5}.
+ * If that source file does not exist, the new \p src_file_name
+ * after stripping will be \Code{A.h5}
+ *
+ * \see <a href="https://portal.hdfgroup.org/display/HDF5/Virtual+Dataset++-+VDS">
+ * Virtual Dataset Overview</a>
+ *
+ * \see_virtual
+ *
+ * \version 1.10.2 A change was made to the method of searching for VDS source files.
+ * \since 1.10.0
+ *
+ */
H5_DLL herr_t H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
const char *src_dset_name, hid_t src_space_id);
@@ -5191,8 +6876,6 @@ H5_DLL herr_t H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_fil
* \p udata is the user-defined input data for the callback
* function.
*
- * \todo Example Usage was removed and needs to be re-added
- *
* \since 1.10.0
*
*/
@@ -5298,7 +6981,7 @@ H5_DLL ssize_t H5Pget_efile_prefix(hid_t dapl_id, char *prefix /*out*/, size_t s
* NULL will return the size of the prefix without the NULL
* terminator.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.2
*
@@ -5348,7 +7031,7 @@ H5_DLL herr_t H5Pget_virtual_printf_gap(hid_t dapl_id, hsize_t *gap_size);
* list, \p dapl_id, and retrieves the flag, \p view, set by the
* H5Pset_virtual_view() call.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -5389,7 +7072,7 @@ H5_DLL herr_t H5Pget_virtual_view(hid_t dapl_id, H5D_vds_view_t *view);
* \p boundary. It is a 1-dimensional array with \p ndims
* elements, which should be the same as the rank of the
* dataset’s dataspace. While appending to a dataset along a
- * particular dimension index via H5DOappend(), the library
+ * particular dimension index via H5Dappend(), the library
* determines a boundary is reached when the resulting dimension
* size is divisible by \p boundary[index]. A zero value for
* \p boundary[index] indicates no boundary is set for that
@@ -5415,8 +7098,7 @@ H5_DLL herr_t H5Pget_virtual_view(hid_t dapl_id, H5D_vds_view_t *view);
*
* The callback function \p func must conform to the following
* prototype:
- * \Code{typedef herr_t (#H5D_append_cb_t)(hid_t dataset_id,
- * hsize_t *cur_dims, void *user_data)}
+ * \snippet H5Dpublic.h H5D_append_cb_t_snip
*
* The parameters of the callback function, per the above
* prototype, are defined as follows:
@@ -5426,10 +7108,6 @@ H5_DLL herr_t H5Pget_virtual_view(hid_t dapl_id, H5D_vds_view_t *view);
* a boundary is hit.
* \li \p user_data is the user-defined input data.
*
- * \todo Example Usage was removed and should be added back.
- * \todo Adding snippet for H5D_append_cb_t_snip did not work.
- * \todo H5DOappend() not found
- *
* \since 1.10.0
*
*/
@@ -5643,7 +7321,7 @@ H5_DLL herr_t H5Pset_efile_prefix(hid_t dapl_id, const char *prefix);
* buffer should not be freed until the property list has been
* closed.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.2
*
@@ -5685,7 +7363,7 @@ H5_DLL herr_t H5Pset_virtual_prefix(hid_t dapl_id, const char *prefix);
* d-2 and d-3 will be filled according to the virtual
* dataset’s fill value setting.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -5723,7 +7401,7 @@ H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t dapl_id, hsize_t gap_size);
* Missing mapped data is filled with the fill value set in the
* VDS creation property list.
*
- * \virtual
+ * \see_virtual
*
* \since 1.10.0
*
@@ -5731,8 +7409,48 @@ H5_DLL herr_t H5Pset_virtual_printf_gap(hid_t dapl_id, hsize_t gap_size);
H5_DLL herr_t H5Pset_virtual_view(hid_t dapl_id, H5D_vds_view_t view);
/* Dataset xfer property list (DXPL) routines */
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Gets B-tree split ratios for a dataset transfer property list
+ *
+ * \dxpl_id{plist_id}
+ * \param[out] left The B-tree split ratio for left-most nodes
+ * \param[out] middle The B-tree split ratio for right-most nodes and lone nodes
+ * \param[out] right The B-tree split ratio for all other nodes
+ * \return \herr_t
+ *
+ * \details H5Pget_btree_ratios() returns the B-tree split ratios for a dataset
+ * transfer property list.
+ *
+ * The B-tree split ratios are returned through the non-NULL arguments
+ * \p left, \p middle, and \p right, as set by the H5Pset_btree_ratios()
+ * function.
+ *
+ */
H5_DLL herr_t H5Pget_btree_ratios(hid_t plist_id, double *left /*out*/, double *middle /*out*/,
double *right /*out*/);
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Reads buffer settings
+ *
+ * \param[in] plist_id Identifier for the dataset transfer property list
+ * \param[out] tconv Address of the pointer to application-allocated type
+ * conversion buffer
+ * \param[out] bkg Address of the pointer to application-allocated
+ * background buffer
+ *
+ * \return Returns buffer size, in bytes, if successful; otherwise 0 on failure.
+ *
+ * \details H5Pget_buffer() reads values previously set with H5Pset_buffer().
+ *
+ * \version 1.6.0 The return type changed from \p hsize_t to \p size_t.
+ * \version 1.4.0 The return type changed to \p hsize_t.
+ *
+ */
H5_DLL size_t H5Pget_buffer(hid_t plist_id, void **tconv /*out*/, void **bkg /*out*/);
/**
*
@@ -5740,54 +7458,233 @@ H5_DLL size_t H5Pget_buffer(hid_t plist_id, void **tconv /*out*/, void **bkg /*o
*
* \brief Retrieves a data transform expression
*
- * \param[in] plist_id Identifier of the property list or class
- * \param[out] expression Pointer to memory where the transform expression
- * will be copied
- * \param[in] size Number of bytes of the transform expression to copy to
+ * \param[in] plist_id Identifier of the property list or class
+ * \param[out] expression Pointer to memory where the transform expression will
+ * be copied
+ * \param[in] size Number of bytes of the transform expression to copy
+ * to
*
- * \return Returns the size of the transform expression if successful;
- * otherwise returns a negative value.
+ * \return Success: the size of the transform expression. Failure: a negative
+ * value.
*
- * \details H5Pget_data_transform() retrieves the data transform
- * expression previously set in the dataset transfer property
- * list \p plist_id by H5Pset_data_transform().
+ * \details H5Pget_data_transform() retrieves the data transform expression
+ * previously set in the dataset transfer property list \p plist_id
+ * by H5Pset_data_transform().
*
- * H5Pget_data_transform() can be used to both retrieve the
- * transform expression and to query its size.
+ * H5Pget_data_transform() can be used to both retrieve the transform
+ * expression and query its size.
*
* If \p expression is non-NULL, up to \p size bytes of the data
- * transform expression are written to the buffer. If
- * \p expression is NULL, \p size is ignored and the function
- * does not write anything to the buffer. The function always
- * returns the size of the data transform expression.
+ * transform expression are written to the buffer. If \p expression
+ * is NULL, \p size is ignored, and the function does not write
+ * anything to the buffer. The function always returns the size of
+ * the data transform expression.
*
- * If 0 is returned for the size of the expression, no data
- * transform expression exists for the property list.
+ * If 0 is returned for the size of the expression, no data transform
+ * expression exists for the property list.
*
* If an error occurs, the buffer pointed to by \p expression is
- * unchanged and the function returns a negative value.
+ * unchanged, and the function returns a negative value.
*
* \since 1.8.0
*
*/
-H5_DLL ssize_t H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size);
+H5_DLL ssize_t H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size);
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Determines whether error-detection is enabled for dataset reads
+ *
+ * \param[in] plist_id Dataset transfer property list identifier
+ *
+ * \return Returns \p H5Z_ENABLE_EDC or \p H5Z_DISABLE_EDC if successful;
+ * otherwise returns a negative value.
+ *
+ * \details H5Pget_edc_check() queries the dataset transfer property
+ * list \p plist to determine whether error detection is enabled for
+ * data read operations.
+ *
+ * \since 1.6.0
+ *
+ */
H5_DLL H5Z_EDC_t H5Pget_edc_check(hid_t plist_id);
-H5_DLL herr_t H5Pget_hyper_vector_size(hid_t fapl_id, size_t *size /*out*/);
-H5_DLL int H5Pget_preserve(hid_t plist_id);
-H5_DLL herr_t H5Pget_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t *op, void **operate_data);
-H5_DLL herr_t H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func, void **alloc_info,
- H5MM_free_t *free_func, void **free_info);
-H5_DLL herr_t H5Pset_btree_ratios(hid_t plist_id, double left, double middle, double right);
-H5_DLL herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg);
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Retrieves number of I/O vectors to be read/written in hyperslab I/O
+ *
+ * \param[in] fapl_id Dataset transfer property list identifier
+ * \param[out] size Number of I/O vectors to accumulate in memory for I/O operations
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_hyper_vector_size() retrieves the number of I/O vectors to be accumulated in
+ * memory before being issued to the lower levels of the HDF5 library for reading or
+ * writing the actual data.
+ *
+ * The number of I/O vectors set in the dataset transfer property list \p fapl_id is
+ * returned in \p size. Unless the default value is in use, \p size was
+ * previously set with a call to H5Pset_hyper_vector_size().
+ *
+ * \since 1.6.0
+ *
+ */
+H5_DLL herr_t H5Pget_hyper_vector_size(hid_t fapl_id, size_t *size /*out*/);
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Checks status of the dataset transfer property list (\b DEPRECATED)
+ *
+ * \deprecated{H5Pget_preserve() is deprecated as it is no longer useful;
+ * compound datatype field preservation is now core functionality
+ * in the HDF5 library.}
+ *
+ * \param[in] plist_id Identifier for the dataset transfer property list
+ *
+ * \return Returns 1 or 0 if successful; otherwise returns a negative value.
+ *
+ * \details H5Pget_preserve() checks the status of the dataset transfer
+ * property list.
+ *
+ * \version 1.6.0 The flag parameter was changed from INTEGER to LOGICAL to
+ * better match the C API. (Fortran 90)
+ *
+ */
+H5_DLL int H5Pget_preserve(hid_t plist_id);
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Gets user-defined datatype conversion callback function
+ *
+ * \param[in] dxpl_id Dataset transfer property list identifier
+ * \param[out] op User-defined type conversion callback function
+ * \param[out] operate_data User-defined input data for the callback function
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_type_conv_cb() gets the user-defined datatype conversion
+ * callback function \p op in the dataset transfer property list
+ * \p dxpl_id.
+ *
+ * The parameter \p operate_data is a pointer to user-defined input
+ * data for the callback function.
+ *
+ * The callback function \p op defines the actions an application is
+ * to take when there is an exception during datatype conversion.
+ *
+ * Please refer to the function H5Pset_type_conv_cb() for more details.
+ *
+ */
+H5_DLL herr_t H5Pget_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t *op, void **operate_data);
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Gets the memory manager for variable-length datatype allocation in H5Dread() and H5Dvlen_reclaim()
+ *
+ * \param[in] plist_id Identifier for the dataset transfer property list
+ * \param[out] alloc_func User's allocate routine, or NULL for system malloc
+ * \param[out] alloc_info Extra parameter for user’s allocation routine.
+ * Contents are ignored if preceding
+ * parameter is NULL \param[out] free_func User's free routine, or NULL for
+ * system free \param[out] free_info
+ * Extra parameter for user’s free routine. Contents are ignored if preceding
+ * parameter is NULL
+ *
+ * \return \herr_t
+ *
+ * \details H5Pget_vlen_mem_manager() is the companion function to
+ * H5Pset_vlen_mem_manager(), returning the parameters set by
+ * that function.
+ *
+ */
+H5_DLL herr_t H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func, void **alloc_info,
+ H5MM_free_t *free_func, void **free_info);
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Sets B-tree split ratios for a dataset transfer property list
+ *
+ * \param[in] plist_id The dataset transfer property list identifier
+ * \param[in] left The B-tree split ratio for left-most nodes
+ * \param[in] middle The B-tree split ratio for all other nodes
+ * \param[in] right The B-tree split ratio for right-most nodes and lone
+ * nodes
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_btree_ratios() sets the B-tree split ratios for a dataset
+ * transfer property list. The split ratios determine what percent of
+ * children go in the first node when a node splits.
+ *
+ * The ratio \p left is used when the splitting node is the left-most
+ * node at its level in the tree;
+ * the ratio \p right is used when the splitting node is the right-most
+ * node at its level; and
+ * the ratio \p middle is used for all other cases.
+ *
+ * A node that is the only node at its level in the tree uses the
+ * ratio \p right when it splits.
+ *
+ * All ratios are real numbers between 0 and 1, inclusive.
+ *
+ */
+H5_DLL herr_t H5Pset_btree_ratios(hid_t plist_id, double left, double middle, double right);
+
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Sets type conversion and background buffers
+ *
+ * \dxpl_id{plist_id}
+ * \param[in] size Size, in bytes, of the type conversion and background buffers
+ * \param[in] tconv Pointer to application-allocated type conversion buffer
+ * \param[in] bkg Pointer to application-allocated background buffer
+ * \return \herr_t
+ *
+ * \details Given a dataset transfer property list, H5Pset_buffer() sets the
+ * maximum size for the type conversion buffer and background buffer
+ * and optionally supplies pointers to application-allocated
+ * buffers. If the buffer size is smaller than the entire amount of
+ * data being transferred between the application and the file, and a
+ * type conversion buffer or background buffer is required, then strip
+ * mining will be used.
+ *
+ * Note that there are minimum size requirements for the buffer. Strip
+ * mining can only break the data up along the first dimension, so the
+ * buffer must be large enough to accommodate a complete slice that
+ * encompasses all of the remaining dimensions. For example, when strip
+ * mining a \Code{100x200x300} hyperslab of a simple data space, the
+ * buffer must be large enough to hold \Code{1x200x300} data
+ * elements. When strip mining a \Code{100x200x300x150} hyperslab of a
+ * simple data space, the buffer must be large enough to hold
+ * \Code{1x200x300x150} data elements.
+ *
+ * If \p tconv and/or \p bkg are null pointers, then buffers will be
+ * allocated and freed during the data transfer.
+ *
+ * The default value for the maximum buffer is 1 MiB.
+ *
+ * \version 1.6.0 The \p size parameter has changed from type hsize_t to \c size_t.
+ * \version 1.4.0 The \p size parameter has changed to type hsize_t.
+ *
+ */
+H5_DLL herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg);
+
/**
* \ingroup DXPL
*
* \brief Sets a data transform expression
*
- * \param[in] plist_id Identifier of the property list or class
+ * \dxpl_id{plist_id}
* \param[in] expression Pointer to the null-terminated data transform
* expression
- *
* \return \herr_t
*
* \details H5Pset_data_transform() sets the data transform to be used for
@@ -5795,11 +7692,11 @@ H5_DLL herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *b
* transfer property list \p plist_id.
*
* The \p expression parameter is a string containing an algebraic
- * expression, such as (5/9.0)*(x-32) or x*(x-5). When a dataset
- * is read or written with this property list, the transform
- * expression is applied with the x being replaced by the values
- * in the dataset. When reading data, the values in the file are
- * not changed and the transformed data is returned to the user.
+ * expression, such as \Code{(5/9.0)*(x-32)} or \Code{x*(x-5)}. When a
+ * dataset is read or written with this property list, the transform
+ * expression is applied with the \c x being replaced by the values in
+ * the dataset. When reading data, the values in the file are not
+ * changed and the transformed data is returned to the user.
*
* Data transforms can only be applied to integer or
* floating-point datasets. Order of operations is obeyed and
@@ -5813,20 +7710,395 @@ H5_DLL herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *b
*
*/
H5_DLL herr_t H5Pset_data_transform(hid_t plist_id, const char *expression);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets the dataset transfer property list to enable or disable error
+ * detection when reading data
+ *
+ * \dxpl_id{plist_id}
+ * \param[in] check Specifies whether error checking is enabled or disabled
+ * for dataset read operations
+ * \return \herr_t
+ *
+ * \details H5Pset_edc_check() sets the dataset transfer property list \p plist
+ * to enable or disable error detection when reading data.
+ *
+ * Whether error detection is enabled or disabled is specified in the
+ * \p check parameter. Valid values are #H5Z_ENABLE_EDC (default) and
+ * #H5Z_DISABLE_EDC.
+ *
+ * \note The initial error detection implementation, Fletcher32 checksum,
+ * supports error detection for chunked datasets only.
+ *
+ * \attention The Fletcher32 EDC checksum filter, set with H5Pset_fletcher32(),
+ * was added in HDF5 Release 1.6.0. In the original implementation,
+ * however, the checksum value was calculated incorrectly on
+ * little-endian systems. The error was fixed in HDF5 Release 1.6.3.\n
+ * As a result of this fix, an HDF5 library of Release 1.6.0 through
+ * Release 1.6.2 cannot read a dataset created or written with
+ * Release 1.6.3 or later if the dataset was created with the
+ * checksum filter and the filter is enabled in the reading
+ * library. (Libraries of Release 1.6.3 and later understand the
+ * earlier error and compensate appropriately.)\n
+ * \Bold{Work-around:} An HDF5 library of Release 1.6.2 or earlier
+ * will be able to read a dataset created or written with the
+ * checksum filter by an HDF5 library of Release 1.6.3 or later if
+ * the checksum filter is disabled for the read operation. This can
+ * be accomplished via an H5Pset_edc_check() call with the value
+ * #H5Z_DISABLE_EDC in the second parameter. This has the obvious
+ * drawback that the application will be unable to verify the
+ * checksum, but the data does remain accessible.
+ *
+ * \version 1.6.3 Error in checksum calculation on little-endian systems
+ * corrected in this release.
+ * \since 1.6.0
+ *
+ */
H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets user-defined filter callback function
+ *
+ * \dxpl_id{plist_id}
+ * \param[in] func User-defined filter callback function
+ * \param[in] op_data User-defined input data for the callback function
+ * \return \herr_t
+ *
+ * \details H5Pset_filter_callback() sets the user-defined filter callback
+ * function \p func in the dataset transfer property list \p plist_id.
+ *
+ * The parameter \p op_data is a pointer to user-defined input data for
+ * the callback function and will be passed through to the callback
+ * function.
+ *
+ * The callback function \p func defines the actions an application is
+ * to take when a filter fails. The function prototype is as follows:
+ * \snippet H5Zpublic.h H5Z_filter_func_t_snip
+ * where \c filter indicates which filter has failed, \c buf and \c buf_size
+ * are used to pass in the failed data, and op_data is the required
+ * input data for this callback function.
+ *
+ * Valid callback function return values are #H5Z_CB_FAIL and #H5Z_CB_CONT.
+ *
+ * \since 1.6.0
+ *
+ */
H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data);
-H5_DLL herr_t H5Pset_hyper_vector_size(hid_t fapl_id, size_t size);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets number of I/O vectors to be read/written in hyperslab I/O
+ *
+ * \dxpl_id{plist_id}
+ * \param[in] size Number of I/O vectors to accumulate in memory for I/O
+ * operations\n
+ * Must be greater than 1 (one)\n
+ * Default value: 1024
+ * \return \herr_t
+ *
+ * \details H5Pset_hyper_vector_size() sets the number of I/O vectors to be
+ * accumulated in memory before being issued to the lower levels of
+ * the HDF5 library for reading or writing the actual data.
+ *
+ * The I/O vectors are hyperslab offset and length pairs and are
+ * generated during hyperslab I/O.
+ *
+ * The number of I/O vectors is passed in \p size to be set in the
+ * dataset transfer property list \p plist_id. \p size must be
+ * greater than 1 (one).
+ *
+ * H5Pset_hyper_vector_size() is an I/O optimization function;
+ * increasing vector_size should provide better performance, but the
+ * library will use more memory during hyperslab I/O. The default value
+ * of \p size is 1024.
+ *
+ * \since 1.6.0
+ *
+ */
+H5_DLL herr_t H5Pset_hyper_vector_size(hid_t plist_id, size_t size);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets the dataset transfer property list \p status
+ *
+ * \dxpl_id{plist_id}
+ * \param[in] status Status toggle of the dataset transfer property list
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated as it no longer has any effect;
+ * compound datatype field preservation is now core functionality in
+ * the HDF5 library.
+ *
+ * \details H5Pset_preserve() sets the dataset transfer property list status to
+ * \c 1 or \c 0.
+ *
+ * When reading or writing compound datatypes and the destination is
+ * partially initialized and the read/write is intended to initialize
+ * the other members, one must set this property to \c 1. Otherwise the
+ * I/O pipeline treats the destination datapoints as completely
+ * uninitialized.
+ *
+ * \todo Add missing version information: introduction, deprecation, etc.
+ * Why is the declaration not in the deprecated section?
+ *
+ */
H5_DLL herr_t H5Pset_preserve(hid_t plist_id, hbool_t status);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets user-defined datatype conversion callback function
+ *
+ * \dxpl_id
+ * \param[in] op User-defined type conversion callback function
+ * \param[in] operate_data User-defined input data for the callback function
+ * \return \herr_t
+ *
+ * \details H5Pset_type_conv_cb() sets the user-defined datatype conversion
+ * callback function \p op in the dataset transfer property list \p
+ * dxpl_id
+ *
+ * The parameter operate_data is a pointer to user-defined input data
+ * for the callback function and will be passed through to the callback
+ * function.
+ *
+ * The callback function \p op defines the actions an application is to
+ * take when there is an exception during datatype conversion. The
+ * function prototype is as follows:
+ * \snippet H5Tpublic.h H5T_conv_except_func_t_snip
+ *
+ * \todo Add version information.
+ *
+ */
H5_DLL herr_t H5Pset_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t op, void *operate_data);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets the memory manager for variable-length datatype allocation in
+ * H5Dread() and H5Dvlen_reclaim()
+ *
+ * \dxpl_id{plist_id}
+ * \param[in] alloc_func User's allocate routine, or \c NULL for system \c malloc
+ * \param[in] alloc_info Extra parameter for user's allocation routine.
+ * Contents are ignored if preceding parameter is \c NULL.
+ * \param[in] free_func User's free routine, or \c NULL for system \c free
+ * \param[in] free_info Extra parameter for user's free routine. Contents are
+ * ignored if preceding parameter is \c NULL
+ * \return \herr_t
+ *
+ * \details H5Pset_vlen_mem_manager() sets the memory manager for
+ * variable-length datatype allocation in H5Dread() and free in
+ * H5Dvlen_reclaim().
+ *
+ * The \p alloc_func and \p free_func parameters identify the memory
+ * management routines to be used. If the user has defined custom
+ * memory management routines, \p alloc_func and/or free_func should be
+ * set to make those routine calls (i.e., the name of the routine is
+ * used as the value of the parameter); if the user prefers to use the
+ * system's \c malloc and/or \c free, the \p alloc_func and \p
+ * free_func parameters, respectively, should be set to \c NULL
+ *
+ * The prototypes for these user-defined functions are as follows:
+ * \snippet H5MMpublic.h H5MM_allocate_t_snip
+ *
+ * \snippet H5MMpublic.h H5MM_free_t_snip
+ *
+ * The \p alloc_info and \p free_info parameters can be used to pass
+ * along any required information to the user's memory management
+ * routines.
+ *
+ * In summary, if the user has defined custom memory management
+ * routines, the name(s) of the routines are passed in the \p
+ * alloc_func and \p free_func parameters and the custom routines'
+ * parameters are passed in the \p alloc_info and \p free_info
+ * parameters. If the user wishes to use the system \c malloc and \c
+ * free functions, the \p alloc_func and/or \p free_func parameters are
+ * set to \c NULL and the \p alloc_info and \p free_info parameters are
+ * ignored.
+ *
+ * \todo Add version information.
+ */
H5_DLL herr_t H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, void *alloc_info,
H5MM_free_t free_func, void *free_info);
+
#ifdef H5_HAVE_PARALLEL
+/**
+ * \ingroup DXPL
+ *
+ * \brief Retrieves the type of chunk optimization that HDF5 actually performed
+ * on the last parallel I/O call (not necessarily the type requested)
+ *
+ * \dxpl_id{plist_id}
+ * \param[out] actual_chunk_opt_mode The type of chunk optimization performed by HDF5
+ * \return \herr_t
+ *
+ * \par Motivation:
+ * A user can request collective I/O via a data transfer property list
+ * (DXPL) that has been suitably modified with H5Pset_dxpl_mpio().
+ * However, HDF5 will sometimes ignore this request and perform independent
+ * I/O instead. This property allows the user to see what kind of I/O HDF5
+ * actually performed. Used in conjunction with H5Pget_mpio_actual_io_mode(),
+ * this property allows the user to determine exactly what HDF5 did when
+ * attempting collective I/O.
+ *
+ * \details H5Pget_mpio_actual_chunk_opt_mode() retrieves the type of chunk
+ * optimization performed when collective I/O was requested. This
+ * property is set before I/O takes place, and will be set even if I/O
+ * fails.
+ *
+ * Valid values returned in \p actual_chunk_opt_mode:
+ * \snippet this H5D_mpio_actual_chunk_opt_mode_t_snip
+ * \click4more
+ *
+ * \since 1.8.8
+ *
+ */
H5_DLL herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id,
H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode);
+/**
+ * \ingroup DXPL
+ *
+ * \brief Retrieves the type of I/O that HDF5 actually performed on the last
+ * parallel I/O call (not necessarily the type requested)
+ *
+ * \dxpl_id{plist_id}
+ * \param[out] actual_io_mode The type of I/O performed by this process
+ * \return \herr_t
+ *
+ * \par Motivation:
+ * A user can request collective I/O via a data transfer property list
+ * (DXPL) that has been suitably modified with H5Pset_dxpl_mpio().
+ * However, HDF5 will sometimes ignore this request and perform independent
+ * I/O instead. This property allows the user to see what kind of I/O HDF5
+ * actually performed. Used in conjunction with H5Pget_mpio_actual_chunk_opt_mode(),
+ * this property allows the user to determine exactly HDF5 did when
+ * attempting collective I/O.
+ *
+ * \details H5Pget_mpio_actual_io_mode() retrieves the type of I/O performed on
+ * the selection of the current process. This property is set after all
+ * I/O is completed; if I/O fails, it will not be set.
+ *
+ * Valid values returned in \p actual_io_mode:
+ * \snippet this H5D_mpio_actual_io_mode_t_snip
+ * \click4more
+ *
+ * \attention All processes do not need to have the same value. For example, if
+ * I/O is being performed using the multi chunk optimization scheme,
+ * one process's selection may include only chunks accessed
+ * collectively, while another may include chunks accessed
+ * independently. In this case, the first process will report
+ * #H5D_MPIO_CHUNK_COLLECTIVE while the second will report
+ * #H5D_MPIO_CHUNK_INDEPENDENT.
+ *
+ * \see H5Pget_mpio_no_collective_cause(), H5Pget_mpio_actual_chunk_opt_mode()
+ *
+ * \since 1.8.8
+ *
+ */
H5_DLL herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode);
+/**
+ * \ingroup DXPL
+ *
+ * \brief Retrieves local and global causes that broke collective I/O on the last
+ * parallel I/O call
+ *
+ * \dxpl_id{plist_id}
+ * \param[out] local_no_collective_cause An enumerated set value indicating the
+ * causes that prevented collective I/O in the local process
+ * \param[out] global_no_collective_cause An enumerated set value indicating
+ * the causes across all processes that prevented collective I/O
+ * \return \herr_t
+ *
+ * \par Motivation:
+ * A user can request collective I/O via a data transfer property list (DXPL)
+ * that has been suitably modified with H5P_SET_DXPL_MPIO. However, there are
+ * conditions that can cause HDF5 to forgo collective I/O and perform
+ * independent I/O. Such causes can be different across the processes of a
+ * parallel application. This function allows the user to determine what
+ * caused the HDF5 library to skip collective I/O locally, that is in the
+ * local process, and globally, across all processes.
+ *
+ * \details H5Pget_mpio_no_collective_cause() serves two purposes. It can be
+ * used to determine whether collective I/O was used for the last
+ * preceding parallel I/O call. If collective I/O was not used, the
+ * function retrieves the local and global causes that broke collective
+ * I/O on that parallel I/O call. The properties retrieved by this
+ * function are set before I/O takes place and are retained even when
+ * I/O fails.
+ *
+ * Valid values returned in \p local_no_collective_cause and \p
+ * global_no_collective_cause are as follows or, if there are multiple
+ * causes, a bitwise OR of the relevant causes; the numbers in the
+ * center column are the bitmask values:
+ * \snippet this H5D_mpio_no_collective_cause_t_snip
+ * \click4more
+ *
+ * \attention Each process determines whether it can perform collective I/O and
+ * broadcasts the result. Those results are combined to make a
+ * collective decision; collective I/O will be performed only if all
+ * processes can perform collective I/O.\n
+ * If collective I/O was not used, the causes that prevented it are
+ * reported by individual process by means of an enumerated set. The
+ * causes may differ among processes, so H5Pget_mpio_no_collective_cause()
+ * returns two property values. The first value is the one produced
+ * by the local process to report local causes. This local information
+ * is encoded in an enumeration, the \ref H5D_mpio_no_collective_cause_t
+ * described above, with all individual causes combined into a single
+ * enumeration value by means of a bitwise OR operation. The second
+ * value reports global causes; this global value is the result of a
+ * bitwise-OR operation across the values returned by all the processes.
+ *
+ * \since 1.8.10
+ *
+ */
H5_DLL herr_t H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause,
uint32_t *global_no_collective_cause);
#endif /* H5_HAVE_PARALLEL */
+/**
+ *
+ * \ingroup DXPL
+ *
+ * \brief Sets a hyperslab file selection for a dataset I/O operation
+ *
+ * \param[in] plist_id Property list identifier
+ * \param[in] rank Number of dimensions of selection
+ * \param[in] op Operation to perform on current selection
+ * \param[in] start Offset of start of hyperslab
+ * \param[in] stride Hyperslab stride
+ * \param[in] count Number of blocks included in hyperslab
+ * \param[in] block Size of block in hyperslab
+ *
+ * \return \herr_t
+ *
+ * \details H5Pset_dataset_io_hyperslab_selection() is designed to be used
+ * in conjunction with using #H5S_PLIST for the file dataspace
+ * ID when making a call to H5Dread() or H5Dwrite(). When used
+ * with #H5S_PLIST, the selection created by one or more calls to
+ * this routine is used for determining which dataset elements to
+ * access.
+ *
+ * \p rank is the dimensionality of the selection and determines
+ * the size of the \p start, \p stride, \p count, and \p block arrays.
+ * \p rank must be between 1 and #H5S_MAX_RANK, inclusive.
+ *
+ * The \p op, \p start, \p stride, \p count, and \p block parameters
+ * behave identically to their behavior for H5Sselect_hyperslab(),
+ * please see the documentation for that routine for details about
+ * their use.
+ *
+ * \since 1.13.0
+ *
+ */
+H5_DLL herr_t H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper_t op,
+ const hsize_t start[], const hsize_t stride[],
+ const hsize_t count[], const hsize_t block[]);
/* Link creation property list (LCPL) routines */
/**
@@ -5880,6 +8152,36 @@ H5_DLL herr_t H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_int
H5_DLL herr_t H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd);
/* Group creation property list (GCPL) routines */
+
+/**
+ * \ingroup GCPL
+ *
+ * \brief Returns the estimated link count and average link name length in a group
+ *
+ * \gcpl_id{plist_id}
+ * \param[out] est_num_entries The estimated number of links in the group
+ * referenced by \p plist_id
+ * \param[out] est_name_len The estimated average length of line names in the group
+ * referenced by \p plist_id
+ * \return \herr_t
+ *
+ * \details H5Pget_est_link_info() retrieves two settings from the group creation
+ * property list \p plist_id: the estimated number of links that are
+ * expected to be inserted into a group created with the property list
+ * and the estimated average length of those link names.
+ *
+ * The estimated number of links is returned in \p est_num_entries. The
+ * limit for \p est_num_entries is 64 K.
+ *
+ * The estimated average length of the anticipated link names is returned
+ * in \p est_name_len. The limit for \p est_name_len is 64 K.
+ *
+ * See \ref_group_impls for a discussion of the available types of HDF5
+ * group structures.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pget_est_link_info(hid_t plist_id, unsigned *est_num_entries /* out */,
unsigned *est_name_len /* out */);
/**
@@ -5949,7 +8251,64 @@ H5_DLL herr_t H5Pget_link_creation_order(hid_t plist_id, unsigned *crt_order_fla
*/
H5_DLL herr_t H5Pget_link_phase_change(hid_t plist_id, unsigned *max_compact /*out*/,
unsigned *min_dense /*out*/);
+/**
+ * \ingroup GCPL
+ *
+ * \brief Retrieves the anticipated size of the local heap for original-style
+ * groups
+ *
+ * \gcpl_id{plist_id}
+ * \param[out] size_hint Anticipated size of local heap
+ * \return \herr_t
+ *
+ * \details H5Pget_local_heap_size_hint() queries the group creation property
+ * list, \p plist_id, for the anticipated size of the local heap, \p
+ * size_hint, for original-style groups, i.e., for groups of the style
+ * used prior to HDF5 Release 1.8.0. See H5Pset_local_heap_size_hint()
+ * for further discussion.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/);
+/**
+ * \ingroup GCPL
+ *
+ * \brief Sets estimated number of links and length of link names in a group
+ *
+ * \gcpl_id{plist_id}
+ * \param[in] est_num_entries Estimated number of links to be inserted into group
+ * \param[in] est_name_len Estimated average length of link names
+ * \return \herr_t
+ *
+ * \details H5Pset_est_link_info() inserts two settings into the group creation
+ * property list plist_id: the estimated number of links that are
+ * expected to be inserted into a group created with the property list
+ * and the estimated average length of those link names.
+ *
+ * The estimated number of links is passed in \p est_num_entries. The
+ * limit for \p est_num_entries is 64 K.
+ *
+ * The estimated average length of the anticipated link names is passed
+ * in \p est_name_len. The limit for \p est_name_len is 64 K.
+ *
+ * The values for these two settings are multiplied to compute the
+ * initial local heap size (for old-style groups, if the local heap
+ * size hint is not set) or the initial object header size for
+ * (new-style compact groups; see \ref_group_impls). Accurately setting
+ * these parameters will help reduce wasted file space.
+ *
+ * If a group is expected to have many links and to be stored in dense
+ * format, set \p est_num_entries to 0 (zero) for maximum
+ * efficiency. This will prevent the group from being created in the
+ * compact format.
+ *
+ * See \ref_group_impls for a discussion of the available types of HDF5
+ * group structures.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pset_est_link_info(hid_t plist_id, unsigned est_num_entries, unsigned est_name_len);
/**
* \ingroup GCPL
@@ -6043,11 +8402,115 @@ H5_DLL herr_t H5Pset_link_creation_order(hid_t plist_id, unsigned crt_order_flag
*
*/
H5_DLL herr_t H5Pset_link_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dense);
+/**
+ * \ingroup GCPL
+ *
+ * \brief Specifies the anticipated maximum size of a local heap
+ *
+ * \gcpl_id{plist_id}
+ * \param[in] size_hint Anticipated maximum size in bytes of local heap
+ * \return \herr_t
+ *
+ * \details H5Pset_local_heap_size_hint() is used with original-style HDF5
+ * groups (see “Motivation” below) to specify the anticipated maximum
+ * local heap size, size_hint, for groups created with the group
+ * creation property list \p plist_id. The HDF5 library then uses \p
+ * size_hint to allocate contiguous local heap space in the file for
+ * each group created with \p plist_id.
+ *
+ * For groups with many members or very few members, an appropriate
+ * initial value of \p size_hint would be the anticipated number of
+ * group members times the average length of group member names, plus a
+ * small margin:
+ * \code
+ * size_hint = max_number_of_group_members *
+ * (average_length_of_group_member_link_names + 2)
+ * \endcode
+ * If it is known that there will be groups with zero members, the use
+ * of a group creation property list with \p size_hint set to to 1 (one)
+ * will guarantee the smallest possible local heap for each of those groups.
+ *
+ * Setting \p size_hint to zero (0) causes the library to make a
+ * reasonable estimate for the default local heap size.
+ *
+ * \par Motivation:
+ * In situations where backward-compatibility is required, specifically, when
+ * libraries prior to HDF5 Release 1.8.0 may be used to read the file, groups
+ * must be created and maintained in the original style. This is HDF5’s default
+ * behavior. If backward compatibility with pre-1.8.0 libraries is not a concern,
+ * greater efficiencies can be obtained with the new-format compact and indexed
+ * groups. See <a href="https://portal.hdfgroup.org/display/HDF5/Groups">Group
+ * implementations in HDF5</a> in the \ref H5G API introduction (at the bottom).\n
+ * H5Pset_local_heap_size_hint() is useful for tuning file size when files
+ * contain original-style groups with either zero members or very large
+ * numbers of members.\n
+ * The original style of HDF5 groups, the only style available prior to HDF5
+ * Release 1.8.0, was well-suited for moderate-sized groups but was not optimized
+ * for either very small or very large groups. This original style remains the
+ * default, but two new group implementations were introduced in HDF5 Release 1.8.0:
+ * compact groups to accommodate zero to small numbers of members and indexed groups
+ * for thousands or tens of thousands of members ... or millions, if that's what
+ * your application requires.\n
+ * The local heap size hint, \p size_hint, is a performance tuning parameter for
+ * original-style groups. As indicated above, an HDF5 group may have zero, a handful,
+ * or tens of thousands of members. Since the original style of HDF5 groups stores the
+ * metadata for all of these group members in a uniform format in a local heap, the size
+ * of that metadata (and hence, the size of the local heap) can vary wildly from group
+ * to group. To intelligently allocate space and to avoid unnecessary fragmentation of
+ * the local heap, it can be valuable to provide the library with a hint as to the local
+ * heap’s likely eventual size. This can be particularly valuable when it is known that
+ * a group will eventually have a great many members. It can also be useful in conserving
+ * space in a file when it is known that certain groups will never have any members.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint);
/* Map access property list (MAPL) routines */
#ifdef H5_HAVE_MAP_API
+/**
+ * \ingroup MAPL
+ *
+ * \brief Set map iteration hints
+ *
+ * \mapl_id
+ * \param[in] key_prefetch_size Number of keys to prefetch at a time during
+ * iteration
+ * \param[in] key_alloc_size The initial size of the buffer allocated to hold
+ * prefetched keys
+ * \return \herr_t
+ *
+ * \details H5Pset_map_iterate_hints() adjusts the behavior of H5Miterate() when
+ * prefetching keys for iteration. The \p key_prefetch_size parameter
+ * specifies the number of keys to prefetch at a time during
+ * iteration. The \p key_alloc_size parameter specifies the initial
+ * size of the buffer allocated to hold these prefetched keys. If this
+ * buffer is too small it will be reallocated to a larger size, though
+ * this may result in an additional I/O.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Pset_map_iterate_hints(hid_t mapl_id, size_t key_prefetch_size, size_t key_alloc_size);
+/**
+ * \ingroup MAPL
+ *
+ * \brief Set map iteration hints
+ *
+ * \mapl_id
+ * \param[out] key_prefetch_size Pointer to number of keys to prefetch at a time
+ * during iteration
+ * \param[out] key_alloc_size Pointer to the initial size of the buffer allocated
+ * to hold prefetched keys
+ * \return \herr_t
+ *
+ * \details H5Pget_map_iterate() returns the map iterate hints, \p key_prefetch_size
+ * and \p key_alloc_size, as set by H5Pset_map_iterate_hints().
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size /*out*/,
size_t *key_alloc_size /*out*/);
#endif /* H5_HAVE_MAP_API */
@@ -6409,9 +8872,6 @@ H5_DLL herr_t H5Pset_elink_acc_flags(hid_t lapl_id, unsigned flags);
* </pre>
*
*
- * \todo Add Programming Note for C++ Developers Using C Functions
- *
- *
* \since 1.8.3
*
*/
@@ -6594,10 +9054,7 @@ H5_DLL herr_t H5Pset_nlinks(hid_t plist_id, size_t nlinks);
* \li H5Pget_mcdt_search_cb()
* \li H5Pset_copy_object()
* \li H5Pset_mcdt_search_cb()
- *
- * \todo missing link to "Copying Committed Datatypes with H5Ocopy - A
- * comprehensive discussion of copying committed datatypes (PDF)
- * in Advanced Topics in HDF5
+ * \li \ref_h5ocopy
*
* \since 1.8.9
*
@@ -6711,8 +9168,7 @@ H5_DLL herr_t H5Pget_copy_object(hid_t plist_id, unsigned *copy_options /*out*/)
* \li H5Pget_mcdt_search_cb()
* \li H5Pset_copy_object()
* \li H5Pset_mcdt_search_cb()
- *
- * \todo Link to Copying Committed Datatypes with H5Ocopy was removed.
+ * \li \ref_h5ocopy
*
* \since 1.8.9
*
@@ -6803,8 +9259,8 @@ H5_DLL herr_t H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func,
* \li H5Pget_mcdt_search_cb()
* \li H5Pset_copy_object()
* \li H5Pset_mcdt_search_cb()
+ * \li \ref_h5ocopy
*
- * \todo Link to Copying Committed Datatypes with H5Ocopy was removed.
* \version 1.8.9 #H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG added in this release.
*
* \since 1.8.0
@@ -6890,9 +9346,7 @@ H5_DLL herr_t H5Pset_copy_object(hid_t plist_id, unsigned copy_options);
* \li H5Pget_mcdt_search_cb()
* \li H5Pset_copy_object()
* \li H5Pset_mcdt_search_cb()
- *
- * \todo Link removed to "Copying Committed Datatypes with H5Ocopy" in Advanced Topics in HDF5
- * \todo Programming Note for C++ Developers Using C Functions:
+ * \li \ref_h5ocopy
*
* \since 1.8.9
*
@@ -6911,38 +9365,312 @@ H5_DLL herr_t H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, v
#define H5P_NO_CLASS H5P_ROOT
/* Typedefs */
+/**
+ * \ingroup GPLOA
+ *
+ * \brief Registers a permanent property with a property list class
+ *
+ * \plistcls_id{cls_id}
+ * \param[in] name Name of property to register
+ * \param[in] size Size of property in bytes
+ * \param[in] def_value Default value for property in newly created
+ * property lists
+ * \param[in] prp_create Callback routine called when a property list is
+ * being created and the property value will be
+ * initialized
+ * \param[in] prp_set Callback routine called before a new value is
+ * copied into the property's value
+ * \param[in] prp_get Callback routine called when a property value is
+ * retrieved from the property
+ * \param[in] prp_del Callback routine called when a property is deleted
+ * from a property list
+ * \param[in] prp_copy Callback routine called when a property is copied
+ * from a property list
+ * \param[in] prp_close Callback routine called when a property list is
+ * being closed and the property value will be
+ * disposed of
+ *
+ * \return \herr_t
+ *
+ * \deprecated As of HDF5-1.8 this function was deprecated in favor of
+ * H5Pregister2() or the macro H5Pregister().
+ *
+ * \details H5Pregister1() registers a new property with a property list
+ * class. The property will exist in all property list objects
+ * of that class after this routine is finished. The name of
+ * the property must not already exist. The default property
+ * value must be provided and all new property lists created
+ * with this property will have the property value set to the
+ * default provided. Any of the callback routines may be set
+ * to NULL if they are not needed.
+ *
+ * Zero-sized properties are allowed and do not store any data in
+ * the property list. These may be used as flags to indicate the
+ * presence or absence of a particular piece of information. The
+ * default pointer for a zero-sized property may be set to NULL.
+ * The property \p prp_create and \p prp_close callbacks are called for
+ * zero-sized properties, but the \p prp_set and \p prp_get callbacks
+ * are never called.
+ *
+ * The \p prp_create routine is called when a new property list with
+ * this property is being created. The #H5P_prp_create_func_t
+ * callback function is defined as #H5P_prp_cb1_t.
+ *
+ * The \p prp_create routine may modify the value to be set and those
+ * changes will be stored as the initial value of the property.
+ * If the \p prp_create routine returns a negative value, the new
+ * property value is not copied into the property and the
+ * \p prp_create routine returns an error value.
+ *
+ * The \p prp_set routine is called before a new value is copied into
+ * the property. The #H5P_prp_set_func_t callback function is defined
+ * as #H5P_prp_cb2_t.
+ *
+ * The \p prp_set routine may modify the value pointer to be set and
+ * those changes will be used when setting the property's value.
+ * If the \p prp_set routine returns a negative value, the new property
+ * value is not copied into the property and the \p prp_set routine
+ * returns an error value. The \p prp_set routine will not be called
+ * for the initial value; only the \p prp_create routine will be
+ * called.
+ *
+ * \b Note: The \p prp_set callback function may be useful to range
+ * check the value being set for the property or may perform some
+ * transformation or translation of the value set. The \p prp_get
+ * callback would then reverse the transformation or translation.
+ * A single \p prp_get or \p prp_set callback could handle multiple
+ * properties by performing different actions based on the property
+ * name or other properties in the property list.
+ *
+ * The \p prp_get routine is called when a value is retrieved from a
+ * property value. The #H5P_prp_get_func_t callback function is
+ * defined as #H5P_prp_cb2_t.
+ *
+ * The \p prp_get routine may modify the value to be returned from the
+ * query and those changes will be returned to the calling routine.
+ * If the \p prp_set routine returns a negative value, the query
+ * routine returns an error value.
+ *
+ * The \p prp_del routine is called when a property is being
+ * deleted from a property list. The #H5P_prp_delete_func_t
+ * callback function is defined as #H5P_prp_cb2_t.
+ *
+ * The \p prp_del routine may modify the value passed in, but the
+ * value is not used by the library when the \p prp_del routine
+ * returns. If the \p prp_del routine returns a negative value,
+ * the property list deletion routine returns an error value but
+ * the property is still deleted.
+ *
+ * The \p prp_copy routine is called when a new property list with
+ * this property is being created through a \p prp_copy operation.
+ * The #H5P_prp_copy_func_t callback function is defined as
+ * #H5P_prp_cb1_t.
+ *
+ * The \p prp_copy routine may modify the value to be set and those
+ * changes will be stored as the new value of the property. If
+ * the \p prp_copy routine returns a negative value, the new
+ * property value is not copied into the property and the \p prp_copy
+ * routine returns an error value.
+ *
+ * The \p prp_close routine is called when a property list with this
+ * property is being closed. The #H5P_prp_close_func_t callback
+ * function is defined as #H5P_prp_cb1_t.
+ *
+ * The \p prp_close routine may modify the value passed in, but the
+ * value is not used by the library when the \p prp_close routine
+ * returns. If the \p prp_close routine returns a negative value, the
+ * property list close routine returns an error value but the property
+ * list is still closed.
+ *
+ * The #H5P_prp_cb1_t is as follows:
+ * \snippet this H5P_prp_cb1_t_snip
+ *
+ * The #H5P_prp_cb2_t is as follows:
+ * \snippet this H5P_prp_cb2_t_snip
+ *
+ */
/* Function prototypes */
H5_DLL herr_t H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value,
H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set,
H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_del,
H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close);
+/**
+ * \ingroup GPLOA
+ *
+ * \brief Registers a temporary property with a property list
+ *
+ * \plist_id
+ * \param[in] name Name of property to create
+ * \param[in] size Size of property in bytes
+ * \param[in] value Initial value for the property
+ * \param[in] prp_set Callback routine called before a new value is copied
+ * into the property's value
+ * \param[in] prp_get Callback routine called when a property value is
+ * retrieved from the property
+ * \param[in] prp_delete Callback routine called when a property is deleted
+ * from a property list
+ * \param[in] prp_copy Callback routine called when a property is copied
+ * from an existing property list
+ * \param[in] prp_close Callback routine called when a property list is
+ * being closed and the property value will be disposed
+ * of
+ *
+ * \return \herr_t
+ *
+ * \deprecated As of HDF5-1.8 this function was deprecated in favor of
+ * H5Pinsert2() or the macro H5Pinsert().
+ *
+ * \details H5Pinsert1() creates a new property in a property
+ * list. The property will exist only in this property list and
+ * copies made from it.
+ *
+ * The initial property value must be provided in \p value and
+ * the property value will be set accordingly.
+ *
+ * The name of the property must not already exist in this list,
+ * or this routine will fail.
+ *
+ * The \p prp_set and \p prp_get callback routines may be set to NULL
+ * if they are not needed.
+ *
+ * Zero-sized properties are allowed and do not store any data
+ * in the property list. The default value of a zero-size
+ * property may be set to NULL. They may be used to indicate the
+ * presence or absence of a particular piece of information.
+ *
+ * The \p prp_set routine is called before a new value is copied
+ * into the property. The #H5P_prp_set_func_t callback function
+ * is defined as #H5P_prp_cb2_t.
+ * The \p prp_set routine may modify the value pointer to be set and
+ * those changes will be used when setting the property's value.
+ * If the \p prp_set routine returns a negative value, the new property
+ * value is not copied into the property and the \p set routine
+ * returns an error value. The \p prp_set routine will be called for
+ * the initial value.
+ *
+ * \b Note: The \p prp_set callback function may be useful to range
+ * check the value being set for the property or may perform some
+ * transformation or translation of the value set. The \p prp_get
+ * callback would then reverse the transformation or translation.
+ * A single \p prp_get or \p prp_set callback could handle multiple
+ * properties by performing different actions based on the
+ * property name or other properties in the property list.
+ *
+ * The \p prp_get routine is called when a value is retrieved from
+ * a property value. The #H5P_prp_get_func_t callback function
+ * is defined as #H5P_prp_cb2_t.
+ *
+ * The \p prp_get routine may modify the value to be returned from
+ * the query and those changes will be preserved. If the \p prp_get
+ * routine returns a negative value, the query routine returns
+ * an error value.
+ *
+ * The \p prp_delete routine is called when a property is being
+ * deleted from a property list. The #H5P_prp_delete_func_t
+ * callback function is defined as #H5P_prp_cb2_t.
+ *
+ * The \p prp_copy routine is called when a new property list with
+ * this property is being created through a \p prp_copy operation.
+ * The #H5P_prp_copy_func_t callback function is defined as
+ * #H5P_prp_cb1_t.
+ *
+ * The \p prp_copy routine may modify the value to be set and those
+ * changes will be stored as the new value of the property. If the
+ * \p prp_copy routine returns a negative value, the new property value
+ * is not copied into the property and the prp_copy routine returns an
+ * error value.
+ *
+ * The \p prp_close routine is called when a property list with this
+ * property is being closed.
+ * The #H5P_prp_close_func_t callback function is defined as
+ * #H5P_prp_cb1_t.
+ *
+ * The \p prp_close routine may modify the value passed in, the
+ * value is not used by the library when the close routine
+ * returns. If the \p prp_close routine returns a negative value,
+ * the property list \p prp_close routine returns an error value
+ * but the property list is still closed.
+ *
+ * \b Note: There is no \p prp_create callback routine for temporary
+ * property list objects; the initial value is assumed to
+ * have any necessary setup already performed on it.
+ *
+ * The #H5P_prp_cb1_t is as follows:
+ * \snippet this H5P_prp_cb1_t_snip
+ *
+ * The #H5P_prp_cb2_t is as follows:
+ * \snippet this H5P_prp_cb2_t_snip
+ *
+ */
H5_DLL herr_t H5Pinsert1(hid_t plist_id, const char *name, size_t size, void *value,
H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get,
H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy,
H5P_prp_close_func_t prp_close);
+/**
+ * \ingroup GPLO
+ *
+ * \brief Encodes the property values in a property list into a binary
+ * buffer
+ *
+ * \plist_id
+ * \param[out] buf Buffer into which the property list will be encoded.
+ * If the provided buffer is NULL, the size of the
+ * buffer required is returned through \p nalloc; the
+ * function does nothing more.
+ * \param[out] nalloc The size of the required buffer
+ *
+ * \return \herr_t
+ *
+ * \deprecated As of HDF5-1.12 this function has been deprecated in favor of
+ * H5Pencode2() or the macro H5Pencode().
+ *
+ * \details H5Pencode1() encodes the property list \p plist_id into the
+ * binary buffer \p buf.
+ *
+ * If the required buffer size is unknown, \p buf can be passed
+ * in as NULL and the function will set the required buffer size
+ * in \p nalloc. The buffer can then be created and the property
+ * list encoded with a subsequent H5Pencode1() call.
+ *
+ * If the buffer passed in is not big enough to hold the encoded
+ * properties, the H5Pencode1() call can be expected to fail with
+ * a segmentation fault.
+ *
+ * Properties that do not have encode callbacks will be skipped.
+ * There is currently no mechanism to register an encode callback for
+ * a user-defined property, so user-defined properties cannot currently
+ * be encoded.
+ *
+ * Some properties cannot be encoded, particularly properties that are
+ * reliant on local context.
+ *
+ * \since 1.10.0
+ *
+ */
H5_DLL herr_t H5Pencode1(hid_t plist_id, void *buf, size_t *nalloc);
/**
- * \ingroup OCPL
+ * \ingroup DCPL
*
* \brief Returns information about a filter in a pipeline (DEPRECATED)
*
- * \todo H5Pget_filter1() prototype does not match source in H5Pocpl.c.
- * Also, it is not in a deprecated file. Is that okay?
+ *
*
* \plist_id{plist_id}
- * \param[in] filter Sequence number within the filter pipeline of the filter
- * for which information is sought
- * \param[out] flags Bit vector specifying certain general properties of
- * the filter
+ * \param[in] filter Sequence number within the filter pipeline of
+ * the filter for which information is sought
+ * \param[out] flags Bit vector specifying certain general properties
+ * of the filter
* \param[in,out] cd_nelmts Number of elements in \p cd_values
- * \param[out] cd_values Auxiliary data for the filter
- * \param[in] namelen Anticipated number of characters in \p name
- * \param[out] name Name of the filter
+ * \param[out] cd_values Auxiliary data for the filter
+ * \param[in] namelen Anticipated number of characters in \p name
+ * \param[out] name Name of the filter
*
* \return Returns the filter identifier if successful; Otherwise returns
* a negative value. See: #H5Z_filter_t
*
+ * \deprecated When was this function deprecated?
+ *
* \details H5Pget_filter1() returns information about a filter, specified
* by its filter number, in a filter pipeline, specified by the
* property list with which it is associated.
@@ -6977,13 +9705,127 @@ H5_DLL herr_t H5Pencode1(hid_t plist_id, void *buf, size_t *nalloc);
H5_DLL H5Z_filter_t H5Pget_filter1(hid_t plist_id, unsigned filter, unsigned int *flags /*out*/,
size_t *cd_nelmts /*out*/, unsigned cd_values[] /*out*/, size_t namelen,
char name[]);
-H5_DLL herr_t H5Pget_filter_by_id1(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*/,
- size_t *cd_nelmts /*out*/, unsigned cd_values[] /*out*/, size_t namelen,
- char name[] /*out*/);
-H5_DLL herr_t H5Pget_version(hid_t plist_id, unsigned *boot /*out*/, unsigned *freelist /*out*/,
- unsigned *stab /*out*/, unsigned *shhdr /*out*/);
-H5_DLL herr_t H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t threshold);
-H5_DLL herr_t H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *threshold);
+/**
+ * \ingroup DCPL
+ *
+ * \brief Returns information about the specified filter
+ *
+ * \plist_id{plist_id}
+ * \param[in] id Filter identifier
+ * \param[out] flags Bit vector specifying certain general properties
+ * of the filter
+ * \param[in,out] cd_nelmts Number of elements in \p cd_values
+ * \param[out] cd_values Auxiliary data for the filter
+ * \param[in] namelen Anticipated number of characters in \p name
+ * \param[out] name Name of the filter
+ *
+ *
+ * \return Returns a non-negative value if successful; Otherwise returns
+ * a negative value.
+ *
+ * \deprecated As of HDF5-1.8 this function was deprecated in favor of
+ * H5Pget_filter_by_id2() or the macro H5Pget_filter_by_id().
+ *
+ * \details H5Pget_filter_by_id1() returns information about a filter, specified
+ * in \p id, a filter identifier.
+ *
+ * \p plist_id must be a dataset or group creation property list and
+ * \p id must be in the associated filter pipeline.
+ *
+ * The \p id and \p flags parameters are used in the same
+ * manner as described in the discussion of H5Pset_filter().
+ *
+ * Aside from the fact that they are used for output, the parameters
+ * \p cd_nelmts and \p cd_values[] are used in the same manner as
+ * described in the discussion of H5Pset_filter().
+ * On input, the \p cd_nelmts parameter indicates the number of entries
+ * in the \p cd_values[] array allocated by the calling program;
+ * on exit it contains the number of values defined by the filter.
+ *
+ * On input, the \p namelen parameter indicates the number of
+ * characters allocated for the filter name by the calling program
+ * in the array \p name[]. On exit \p name[] contains the name of the
+ * filter with one character of the name in each element of the array.
+ *
+ * If the filter specified in \p id is not set for the property
+ * list, an error will be returned and this function will fail.
+ *
+ *
+ * \version 1.8.5 Function extended to work with group creation property
+ * lists.
+ * \version 1.8.0 Function H5Pget_filter_by_id() renamed to
+ * H5Pget_filter_by_id1() and deprecated in this release.
+ * \version 1.6.0 Function introduced in this release.
+ */
+H5_DLL herr_t H5Pget_filter_by_id1(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*/,
+ size_t *cd_nelmts /*out*/, unsigned cd_values[] /*out*/, size_t namelen,
+ char name[] /*out*/);
+/**
+ * \ingroup FCPL
+ *
+ * \brief Retrieves the version information of various objects
+ * for a file creation property list(deprecated)
+ *
+ * \plist_id
+ * \param[out] boot Pointer to location to return super block version number
+ * \param[out] freelist Pointer to location to return global freelist version number
+ * \param[out] stab Pointer to location to return symbol table version number
+ * \param[out] shhdr Pointer to location to return shared object header version
+ * number
+ *
+ * \return \herr_t
+ *
+ * \deprecated Deprecated in favor of the function H5Fget_info()
+ *
+ * \details H5Pget_version() retrieves the version information of various objects
+ * for a file creation property list. Any pointer parameters which are
+ * passed as NULL are not queried.
+ *
+ * \version 1.6.4 \p boot, \p freelist, \p stab, \p shhdr parameter types
+ * changed to unsigned.
+ *
+ */
+H5_DLL herr_t H5Pget_version(hid_t plist_id, unsigned *boot /*out*/, unsigned *freelist /*out*/,
+ unsigned *stab /*out*/, unsigned *shhdr /*out*/);
+/**
+ * \ingroup FCPL
+ *
+ * \brief Sets the file space handling strategy and the free-space section
+ * size threshold.
+ *
+ * \fcpl_id{plist_id}
+ * \param[in] strategy The file space handling strategy to be used. See:
+ * #H5F_fspace_strategy_t
+ * \param[in] threshold The smallest free-space section size that the free
+ * space manager will track
+ *
+ * \return \herr_t
+ *
+ * \deprecated When was this function deprecated?
+ *
+ * \details Maps to the function H5Pset_file_space_strategy().
+ *
+ */
+H5_DLL herr_t H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t threshold);
+/**
+ * \ingroup FCPL
+ *
+ * \brief Retrieves the file space handling strategy, and threshold value for
+ * a file creation property list
+ *
+ * \fcpl_id{plist_id}
+ * \param[out] strategy Pointer to the file space handling strategy
+ * \param[out] threshold Pointer to the free-space section size threshold value
+ *
+ * \return \herr_t
+ *
+ * \deprecated When was this function deprecated?
+ *
+ * \details Maps to the function H5Pget_file_space_strategy()
+ *
+ *
+ */
+H5_DLL herr_t H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *threshold);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
diff --git a/src/H5R.c b/src/H5R.c
index 5301743..102af7f 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -79,14 +79,16 @@ static hid_t H5R__open_attr_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t
herr_t
H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_ptr)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5I_type_t obj_type; /* Object type of loc_id */
- hid_t file_id = H5I_INVALID_HID; /* File ID */
- H5VL_object_t * vol_obj_file = NULL; /* Object of file_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5I_type_t obj_type; /* Object type of loc_id */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ H5VL_object_t * vol_obj_file = NULL; /* Object of file_id */
+ H5VL_object_specific_args_t obj_spec_vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
+ H5VL_file_get_args_t file_get_vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*si*Rr", loc_id, name, oapl_id, ref_ptr);
@@ -121,9 +123,12 @@ H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_p
if (NULL == (vol_obj_file = H5VL_vol_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ file_get_vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ file_get_vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get(vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &cont_info) < 0)
+ if (H5VL_file_get(vol_obj_file, &file_get_vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info")
/* Set location parameters */
@@ -132,15 +137,18 @@ H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5R_ref_t *ref_p
loc_params.loc_data.loc_by_name.lapl_id = oapl_id;
loc_params.obj_type = obj_type;
+ /* Set up VOL callback arguments */
+ obj_spec_vol_cb_args.op_type = H5VL_OBJECT_LOOKUP;
+ obj_spec_vol_cb_args.args.lookup.token_ptr = &obj_token;
+
/* Get the object token */
- if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_LOOKUP, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &obj_token) < 0)
+ if (H5VL_object_specific(vol_obj, &loc_params, &obj_spec_vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to retrieve object token")
/* Create the reference (do not pass filename, since file_id is attached) */
HDmemset(ref_ptr, 0, H5R_REF_BUF_SIZE);
- if (H5R__create_object((const H5O_token_t *)&obj_token, cont_info.token_size, (H5R_ref_priv_t *)ref_ptr) <
- 0)
+ if (H5R__create_object(&obj_token, cont_info.token_size, (H5R_ref_priv_t *)ref_ptr) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create object reference")
/* Attach loc_id to reference and hold reference to it */
@@ -167,15 +175,17 @@ done:
herr_t
H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id, H5R_ref_t *ref_ptr)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5I_type_t obj_type; /* Object type of loc_id */
- hid_t file_id = H5I_INVALID_HID; /* File ID */
- H5VL_object_t * vol_obj_file = NULL; /* Object of file_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
- struct H5S_t * space = NULL; /* Pointer to dataspace containing region */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5I_type_t obj_type; /* Object type of loc_id */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ H5VL_object_t * vol_obj_file = NULL; /* Object of file_id */
+ H5VL_object_specific_args_t obj_spec_vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
+ H5VL_file_get_args_t file_get_vol_cb_args; /* Arguments to VOL callback */
+ struct H5S_t * space = NULL; /* Pointer to dataspace containing region */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*sii*Rr", loc_id, name, space_id, oapl_id, ref_ptr);
@@ -185,7 +195,7 @@ H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer")
if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given")
- if ((space_id == H5I_BADID) || (space_id == H5S_ALL))
+ if ((space_id == H5I_INVALID_HID) || (space_id == H5S_ALL) || (space_id == H5S_BLOCK))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reference region dataspace id must be valid")
if (NULL == (space = (struct H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
@@ -214,9 +224,12 @@ H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id,
if (NULL == (vol_obj_file = H5VL_vol_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ file_get_vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ file_get_vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get(vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &cont_info) < 0)
+ if (H5VL_file_get(vol_obj_file, &file_get_vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info")
/* Set location parameters */
@@ -225,9 +238,13 @@ H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id,
loc_params.loc_data.loc_by_name.lapl_id = oapl_id;
loc_params.obj_type = obj_type;
+ /* Set up VOL callback arguments */
+ obj_spec_vol_cb_args.op_type = H5VL_OBJECT_LOOKUP;
+ obj_spec_vol_cb_args.args.lookup.token_ptr = &obj_token;
+
/* Get the object token */
- if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_LOOKUP, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &obj_token) < 0)
+ if (H5VL_object_specific(vol_obj, &loc_params, &obj_spec_vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to retrieve object token")
/* Create the reference (do not pass filename, since file_id is attached) */
@@ -259,14 +276,16 @@ done:
herr_t
H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl_id, H5R_ref_t *ref_ptr)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5I_type_t obj_type; /* Object type of loc_id */
- hid_t file_id = H5I_INVALID_HID; /* File ID */
- H5VL_object_t * vol_obj_file = NULL; /* Object of file_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5I_type_t obj_type; /* Object type of loc_id */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ H5VL_object_t * vol_obj_file = NULL; /* Object of file_id */
+ H5VL_object_specific_args_t obj_spec_vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
+ H5VL_file_get_args_t file_get_vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "i*s*si*Rr", loc_id, name, attr_name, oapl_id, ref_ptr);
@@ -303,9 +322,12 @@ H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl
if (NULL == (vol_obj_file = H5VL_vol_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ file_get_vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ file_get_vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get(vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &cont_info) < 0)
+ if (H5VL_file_get(vol_obj_file, &file_get_vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info")
/* Set location parameters */
@@ -314,9 +336,13 @@ H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_name, hid_t oapl
loc_params.loc_data.loc_by_name.lapl_id = oapl_id;
loc_params.obj_type = obj_type;
+ /* Set up VOL callback arguments */
+ obj_spec_vol_cb_args.op_type = H5VL_OBJECT_LOOKUP;
+ obj_spec_vol_cb_args.args.lookup.token_ptr = &obj_token;
+
/* Get the object token */
- if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_LOOKUP, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &obj_token) < 0)
+ if (H5VL_object_specific(vol_obj, &loc_params, &obj_spec_vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to retrieve object token")
/* Create the reference (do not pass filename, since file_id is attached) */
@@ -584,7 +610,7 @@ H5Ropen_object_async(const char *app_file, const char *app_func, unsigned app_li
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on object ID")
@@ -611,15 +637,16 @@ H5R__open_region_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id, vo
hid_t loc_id; /* Reference location ID */
H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */
H5VL_object_t **vol_obj_ptr =
- (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- H5I_type_t opened_type; /* Opened object type */
- void * opened_obj = NULL; /* Opened object */
- hid_t opened_obj_id = H5I_INVALID_HID; /* Opened object ID */
- H5S_t * space = NULL; /* Dataspace pointer (copy) */
- hid_t space_id = H5I_INVALID_HID; /* Dataspace ID */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5O_token_t obj_token = {0}; /* Object token */
+ H5I_type_t opened_type; /* Opened object type */
+ void * opened_obj = NULL; /* Opened object */
+ hid_t opened_obj_id = H5I_INVALID_HID; /* Opened object ID */
+ H5S_t * space = NULL; /* Dataspace pointer (copy) */
+ hid_t space_id = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_STATIC
@@ -662,10 +689,14 @@ H5R__open_region_api_common(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id, vo
if (NULL == (opened_obj = H5VL_vol_object(opened_obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_SPACE;
+ vol_cb_args.args.get_space.space_id = H5I_INVALID_HID;
+
/* Get dataspace from object */
- if (H5VL_dataset_get(opened_obj, H5VL_DATASET_GET_SPACE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &space_id) < 0)
+ if (H5VL_dataset_get(opened_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to get dataspace from dataset")
+ space_id = vol_cb_args.args.get_space.space_id;
if (NULL == (space = (struct H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataspace")
@@ -746,7 +777,7 @@ H5Ropen_region_async(const char *app_file, const char *app_func, unsigned app_li
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on region ID")
@@ -915,7 +946,7 @@ H5Ropen_attr_async(const char *app_file, const char *app_func, unsigned app_line
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, aapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, aapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID,
@@ -940,11 +971,12 @@ done:
herr_t
H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type /*out*/)
{
- hid_t loc_id; /* Reference location ID */
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- herr_t ret_value = SUCCEED; /* Return value */
+ hid_t loc_id; /* Reference location ID */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "*Rrix", ref_ptr, rapl_id, obj_type);
@@ -959,11 +991,10 @@ H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type /*out*/
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
/* Retrieve loc_id from reference */
- if (H5I_INVALID_HID == (loc_id = H5R__get_loc_id((const H5R_ref_priv_t *)ref_ptr))) {
+ if (H5I_INVALID_HID == (loc_id = H5R__get_loc_id((const H5R_ref_priv_t *)ref_ptr)))
/* Attempt to re-open file and pass rapl_id as a fapl_id */
if ((loc_id = H5R__reopen_file((H5R_ref_priv_t *)ref_ptr, rapl_id)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENFILE, FAIL, "cannot re-open referenced file")
- }
/* Get object token */
if (H5R__get_obj_token((const H5R_ref_priv_t *)ref_ptr, &obj_token, NULL) < 0)
@@ -978,9 +1009,12 @@ H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type /*out*/
loc_params.loc_data.loc_by_token.token = &obj_token;
loc_params.obj_type = H5I_get_type(loc_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_TYPE;
+ vol_cb_args.args.get_type.obj_type = obj_type;
+
/* Retrieve object's type */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- obj_type) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve object type")
done:
@@ -1021,15 +1055,27 @@ H5Rget_file_name(const H5R_ref_t *ref_ptr, char *buf /*out*/, size_t size)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "unable to retrieve file name")
}
else {
- H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
+ H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ size_t file_name_len = 0; /* Length of file name */
/* Retrieve VOL file object */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid location identifier")
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5I_FILE,
- size, buf, &ret_value) < 0)
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_NAME;
+ vol_cb_args.args.get_name.type = H5I_FILE;
+ vol_cb_args.args.get_name.buf_size = size;
+ vol_cb_args.args.get_name.buf = buf;
+ vol_cb_args.args.get_name.file_name_len = &file_name_len;
+
+ /* Get file name */
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "unable to get file name")
+
+ /* Set return value */
+ ret_value = (ssize_t)file_name_len;
}
done:
@@ -1049,11 +1095,13 @@ done:
ssize_t
H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf /*out*/, size_t size)
{
- hid_t loc_id; /* Reference location ID */
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- ssize_t ret_value = 0; /* Return value */
+ hid_t loc_id; /* Reference location ID */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ size_t obj_name_len = 0; /* Length of object's name */
+ ssize_t ret_value = 0; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE4("Zs", "*Rrixz", ref_ptr, rapl_id, buf, size);
@@ -1068,11 +1116,10 @@ H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf /*out*/, size_t siz
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a property list")
/* Retrieve loc_id from reference */
- if (H5I_INVALID_HID == (loc_id = H5R__get_loc_id((const H5R_ref_priv_t *)ref_ptr))) {
+ if (H5I_INVALID_HID == (loc_id = H5R__get_loc_id((const H5R_ref_priv_t *)ref_ptr)))
/* Attempt to re-open file and pass rapl_id as a fapl_id */
if ((loc_id = H5R__reopen_file((H5R_ref_priv_t *)ref_ptr, rapl_id)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENFILE, (-1), "cannot re-open referenced file")
- }
/* Get object token */
if (H5R__get_obj_token((const H5R_ref_priv_t *)ref_ptr, &obj_token, NULL) < 0)
@@ -1087,11 +1134,19 @@ H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf /*out*/, size_t siz
loc_params.loc_data.loc_by_token.token = &obj_token;
loc_params.obj_type = H5I_get_type(loc_id);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_NAME;
+ vol_cb_args.args.get_name.buf_size = size;
+ vol_cb_args.args.get_name.buf = buf;
+ vol_cb_args.args.get_name.name_len = &obj_name_len;
+
/* Retrieve object's name */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value, buf, size) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "can't retrieve object name")
+ /* Set return value */
+ ret_value = (ssize_t)obj_name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Rget_obj_name() */
diff --git a/src/H5RS.c b/src/H5RS.c
index 96d55e7..d9915f2 100644
--- a/src/H5RS.c
+++ b/src/H5RS.c
@@ -349,7 +349,7 @@ done:
* format_templ in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
H5_ATTR_FORMAT(printf, 2, 3)
herr_t
H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...)
@@ -392,7 +392,7 @@ H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5RS_asprintf_cat() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: H5RS_acat
@@ -698,7 +698,7 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2)
const H5RS_str_t *rs; IN: Ref-counted string to compute length of
RETURNS
- Returns non-negative value on success, negative value on failure
+ Returns non-negative value on success, can't fail
DESCRIPTION
Compute the length of a ref-counted string. [same as strlen()]
GLOBAL VARIABLES
@@ -706,7 +706,7 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-ssize_t
+size_t
H5RS_len(const H5RS_str_t *rs)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -715,7 +715,7 @@ H5RS_len(const H5RS_str_t *rs)
HDassert(rs);
HDassert(rs->s);
- FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s))
+ FUNC_LEAVE_NOAPI(HDstrlen(rs->s))
} /* end H5RS_len() */
/*--------------------------------------------------------------------------
diff --git a/src/H5RSprivate.h b/src/H5RSprivate.h
index 7d2b728..ebca1a3 100644
--- a/src/H5RSprivate.h
+++ b/src/H5RSprivate.h
@@ -53,7 +53,7 @@ H5_DLL herr_t H5RS_acat(H5RS_str_t *rs, const char *s);
H5_DLL herr_t H5RS_ancat(H5RS_str_t *rs, const char *s, size_t len);
H5_DLL herr_t H5RS_aputc(H5RS_str_t *rs, int c);
H5_DLL int H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2);
-H5_DLL ssize_t H5RS_len(const H5RS_str_t *rs);
+H5_DLL size_t H5RS_len(const H5RS_str_t *rs);
H5_DLL char * H5RS_get_str(const H5RS_str_t *rs);
H5_DLL unsigned H5RS_get_count(const H5RS_str_t *rs);
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index b5d0d44..3f1d70f 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -94,7 +94,8 @@ H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref
hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */
H5VL_object_t * vol_obj_file = NULL;
H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
- herr_t ret_value = SUCCEED;
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
@@ -119,9 +120,12 @@ H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref
if (NULL == (vol_obj_file = H5VL_vol_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get((const H5VL_object_t *)vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &cont_info) < 0)
+ if (H5VL_file_get(vol_obj_file, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info")
if (ref_type == H5R_OBJECT1) {
@@ -240,13 +244,14 @@ done:
H5G_obj_t
H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- H5O_type_t obj_type; /* Object type */
- const unsigned char *buf = (const unsigned char *)ref; /* Reference buffer */
- H5G_obj_t ret_value; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ const unsigned char * buf = (const unsigned char *)ref; /* Reference buffer */
+ H5O_type_t obj_type = H5O_TYPE_UNKNOWN; /* Type of the referenced object */
+ H5G_obj_t ret_value; /* Return value */
FUNC_ENTER_API(H5G_UNKNOWN)
H5TRACE3("Go", "iRt*x", id, ref_type, ref);
@@ -274,9 +279,12 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
loc_params.loc_data.loc_by_token.token = &obj_token;
loc_params.obj_type = vol_obj_type;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_TYPE;
+ vol_cb_args.args.get_type.obj_type = &obj_type;
+
/* Retrieve object's type */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &obj_type) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5G_UNKNOWN, "can't retrieve object type")
/* Set return value */
@@ -365,15 +373,17 @@ done:
herr_t
H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
- hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */
- void * vol_obj_file = NULL;
- unsigned char * buf = (unsigned char *)ref; /* Return reference pointer */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
+ H5VL_object_specific_args_t obj_spec_vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
+ H5VL_file_get_args_t file_get_vol_cb_args; /* Arguments to VOL callback */
+ hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */
+ void * vol_obj_file = NULL;
+ unsigned char * buf = (unsigned char *)ref; /* Return reference pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "*xi*sRti", ref, loc_id, name, ref_type, space_id);
@@ -417,9 +427,13 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t
loc_params.loc_data.loc_by_name.lapl_id = H5P_LINK_ACCESS_DEFAULT;
loc_params.obj_type = vol_obj_type;
+ /* Set up VOL callback arguments */
+ obj_spec_vol_cb_args.op_type = H5VL_OBJECT_LOOKUP;
+ obj_spec_vol_cb_args.args.lookup.token_ptr = &obj_token;
+
/* Get the object token */
- if (H5VL_object_specific(vol_obj, &loc_params, H5VL_OBJECT_LOOKUP, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &obj_token) < 0)
+ if (H5VL_object_specific(vol_obj, &loc_params, &obj_spec_vol_cb_args, H5P_DATASET_XFER_DEFAULT,
+ H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to retrieve object token")
/* Get the file for the object */
@@ -430,9 +444,12 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t
if (NULL == (vol_obj_file = H5VL_vol_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ file_get_vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ file_get_vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get((const H5VL_object_t *)vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &cont_info) < 0)
+ if (H5VL_file_get(vol_obj_file, &file_get_vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info")
/* Create reference */
@@ -449,7 +466,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t
size_t buf_size = H5R_DSET_REG_REF_BUF_SIZE;
/* Retrieve space */
- if (space_id == H5I_BADID)
+ if (space_id == H5I_INVALID_HID)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reference region dataspace id must be valid")
if (NULL == (space = (struct H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
@@ -483,12 +500,13 @@ done:
herr_t
H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type /*out*/)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- const unsigned char *buf = (const unsigned char *)ref; /* Reference pointer */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ const unsigned char * buf = (const unsigned char *)ref; /* Reference pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "iRt*xx", id, ref_type, ref, obj_type);
@@ -516,9 +534,12 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj
loc_params.loc_data.loc_by_token.token = &obj_token;
loc_params.obj_type = vol_obj_type;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_TYPE;
+ vol_cb_args.args.get_type.obj_type = obj_type;
+
/* Retrieve object's type */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- obj_type) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve object type")
done:
@@ -612,12 +633,13 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
void * vol_obj_file = NULL; /* VOL file */
H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
- H5F_t * f = NULL; /* Native file */
- size_t buf_size = H5R_DSET_REG_REF_BUF_SIZE; /* Reference buffer size */
- H5S_t * space = NULL; /* Dataspace object */
- hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */
- const unsigned char * buf = (const unsigned char *)ref; /* Reference pointer */
- hid_t ret_value; /* Return value */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5F_t * f = NULL; /* Native file */
+ size_t buf_size = H5R_DSET_REG_REF_BUF_SIZE; /* Reference buffer size */
+ H5S_t * space = NULL; /* Dataspace object */
+ hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */
+ const unsigned char * buf = (const unsigned char *)ref; /* Reference pointer */
+ hid_t ret_value; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE3("i", "iRt*x", id, ref_type, ref);
@@ -658,9 +680,12 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
if (NULL == (vol_obj_file = H5VL_vol_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get((const H5VL_object_t *)vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, &cont_info) < 0)
+ if (H5VL_file_get(vol_obj_file, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to get container info")
/* Retrieve file from VOL object */
@@ -695,12 +720,14 @@ done:
ssize_t
H5Rget_name(hid_t id, H5R_type_t ref_type, const void *ref, char *name /*out*/, size_t size)
{
- H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
- H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
- H5VL_loc_params_t loc_params; /* Location parameters */
- H5O_token_t obj_token = {0}; /* Object token */
- const unsigned char *buf = (const unsigned char *)ref; /* Reference pointer */
- ssize_t ret_value = -1; /* Return value */
+ H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
+ H5I_type_t vol_obj_type = H5I_BADID; /* Object type of loc_id */
+ H5VL_object_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ H5VL_loc_params_t loc_params; /* Location parameters */
+ H5O_token_t obj_token = {0}; /* Object token */
+ const unsigned char * buf = (const unsigned char *)ref; /* Reference pointer */
+ size_t obj_name_len = 0; /* Length of object's name */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE5("Zs", "iRt*xxz", id, ref_type, ref, name, size);
@@ -728,11 +755,19 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *ref, char *name /*out*/,
loc_params.loc_data.loc_by_token.token = &obj_token;
loc_params.obj_type = vol_obj_type;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_OBJECT_GET_NAME;
+ vol_cb_args.args.get_name.buf_size = size;
+ vol_cb_args.args.get_name.buf = name;
+ vol_cb_args.args.get_name.name_len = &obj_name_len;
+
/* Retrieve object's name */
- if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value, name, size) < 0)
+ if (H5VL_object_get(vol_obj, &loc_params, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "can't retrieve object name")
+ /* Set return value */
+ ret_value = (ssize_t)obj_name_len;
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Rget_name() */
diff --git a/src/H5Rint.c b/src/H5Rint.c
index b714f09..e1a5dcd 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -588,11 +588,18 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id)
supported = 0;
if (H5VL_introspect_opt_query(vol_obj, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't check for 'post open' operation")
- if (supported & H5VL_OPT_QUERY_SUPPORTED)
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (supported & H5VL_OPT_QUERY_SUPPORTED) {
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
+ vol_cb_args.args = NULL;
+
+ /* Make the 'post open' callback */
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5I_INVALID_HID,
"unable to make file 'post open' callback")
+ } /* end if */
/* Attach loc_id to reference */
if (H5R__set_loc_id((H5R_ref_priv_t *)ref, ret_value, FALSE, TRUE) < 0)
diff --git a/src/H5Rmodule.h b/src/H5Rmodule.h
index 2a34d56..fe28bb2 100644
--- a/src/H5Rmodule.h
+++ b/src/H5Rmodule.h
@@ -27,9 +27,32 @@
/**
* \defgroup H5R H5R
- * \brief Reference Interface
- * \details The HDF5 Reference Interface, H5R, provides a mechanism for managing
- * HDF5 referenced objects.
+ *
+ * Use the functions in this module to manage HDF5 references. Referents can
+ * be HDF5 objects, attributes, and selections on datasets a.k.a. dataset
+ * regions.
+ *
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5R_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5R_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5R_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5R_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
*/
#endif /* H5Rmodule_H */
diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h
index 5d356e9..ef798ea 100644
--- a/src/H5Rpublic.h
+++ b/src/H5Rpublic.h
@@ -30,9 +30,11 @@
#define H5R_OBJ_REF_BUF_SIZE sizeof(haddr_t)
#define H5R_DSET_REG_REF_BUF_SIZE (sizeof(haddr_t) + 4)
-/* Default reference buffer size.
- * Note! Be careful with the sizes of the references because they should really
- * depend on the run-time values in the file.
+/**
+ * Default reference buffer size.
+ *
+ * \internal Note! Be careful with the sizes of the references because they
+ * should really depend on the run-time values in the file.
*/
#define H5R_REF_BUF_SIZE (64)
@@ -40,40 +42,54 @@
/* Public Typedefs */
/*******************/
-/*
+//! <!-- [H5R_type_t_snip] -->
+/**
* Reference types allowed.
- * DO NOT CHANGE THE ORDER or VALUES as reference type values are encoded into
- * the datatype message header.
+ *
+ * \internal DO NOT CHANGE THE ORDER or VALUES as reference type values are
+ * encoded into the datatype message header.
*/
typedef enum {
- H5R_BADTYPE = (-1), /* Invalid reference type */
- H5R_OBJECT1 = 0, /* Backward compatibility (object) */
- H5R_DATASET_REGION1 = 1, /* Backward compatibility (region) */
- H5R_OBJECT2 = 2, /* Object reference */
- H5R_DATASET_REGION2 = 3, /* Region reference */
- H5R_ATTR = 4, /* Attribute Reference */
- H5R_MAXTYPE = 5 /* Highest type (invalid) */
+ H5R_BADTYPE = (-1), /**< Invalid reference type */
+ H5R_OBJECT1 = 0, /**< Backward compatibility (object) */
+ H5R_DATASET_REGION1 = 1, /**< Backward compatibility (region) */
+ H5R_OBJECT2 = 2, /**< Object reference */
+ H5R_DATASET_REGION2 = 3, /**< Region reference */
+ H5R_ATTR = 4, /**< Attribute Reference */
+ H5R_MAXTYPE = 5 /**< Highest type (invalid) */
} H5R_type_t;
+//! <!-- [H5R_type_t_snip] -->
/* Deprecated types are kept for backward compatibility with previous versions */
+//! <!-- [hobj_ref_t_snip] -->
/**
- * Deprecated object reference type that is used with deprecated reference APIs.
- * Note! This type can only be used with the "native" HDF5 VOL connector.
+ * \deprecated Deprecated object reference type that is used with deprecated
+ * reference APIs.
+ *
+ * \note This type can only be used with the "native" HDF5 VOL connector.
*/
typedef haddr_t hobj_ref_t;
+//! <!-- [hobj_ref_t_snip] -->
+//! <!-- [hdset_reg_ref_t_snip] -->
/**
- * Dataset region reference type that is used with deprecated reference APIs.
- * (Buffer to store heap ID and index)
- * This needs to be large enough to store largest haddr_t in a worst case
+ * Buffer to store heap ID and index
+ *
+ * This needs to be large enough to store largest #haddr_t in a worst case
* machine (8 bytes currently) plus an int.
- * Note! This type can only be used with the "native" HDF5 VOL connector.
+ *
+ * \deprecated Dataset region reference type that is used with deprecated
+ * reference APIs.
+ *
+ * \note This type can only be used with the "native" HDF5 VOL connector.
*/
typedef struct {
uint8_t __data[H5R_DSET_REG_REF_BUF_SIZE];
} hdset_reg_ref_t;
+//! <!-- [hdset_reg_ref_t_snip] -->
+//! <!-- [H5R_ref_t_snip] -->
/**
* Opaque reference type. The same reference type is used for object,
* dataset region and attribute references. This is the type that
@@ -81,10 +97,11 @@ typedef struct {
*/
typedef struct {
union {
- uint8_t __data[H5R_REF_BUF_SIZE]; /* opaque data */
- int64_t align; /* ensures alignment */
+ uint8_t __data[H5R_REF_BUF_SIZE]; /**< opaque data */
+ int64_t align; /**< ensures alignment */
} u;
} H5R_ref_t;
+//! <!-- [H5R_ref_t_snip] -->
/********************/
/* Public Variables */
@@ -121,8 +138,8 @@ extern "C" {
* must be of the same type as the object being referenced, that is
* a group, dataset or committed datatype property list.
*
- * H5R_ref_t is defined in H5Rpublic.h as: typedef unsigned char
- * H5R_ref_t[#H5R_REF_BUF_SIZE];
+ * \ref H5R_ref_t is defined in H5Rpublic.h as:
+ * \snippet this H5R_ref_t_snip
*
* H5Rdestroy() should be used to release the resource from the
* reference.
@@ -157,14 +174,12 @@ H5_DLL herr_t H5Rcreate_object(hid_t loc_id, const char *name, hid_t oapl_id, H5
* must be of the same type as the object being referenced, that is
* a dataset property list in this case.
*
- * H5R_ref_t is defined in H5Rpublic.h as: typedef unsigned char
- * H5R_ref_t[#H5R_REF_BUF_SIZE];
+ * \ref H5R_ref_t is defined in H5Rpublic.h as:
+ * \snippet this H5R_ref_t_snip
*
* H5Rdestroy() should be used to release the resource from the
* reference.
*
- * \see function_name()
- *
*/
H5_DLL herr_t H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, hid_t oapl_id,
H5R_ref_t *ref_ptr);
@@ -196,8 +211,8 @@ H5_DLL herr_t H5Rcreate_region(hid_t loc_id, const char *name, hid_t space_id, h
* as that object, that is a group, dataset or committed datatype
* property list.
*
- * H5R_ref_t is defined in H5Rpublic.h as: typedef unsigned char
- * H5R_ref_t[#H5R_REF_BUF_SIZE];
+ * \ref H5R_ref_t is defined in H5Rpublic.h as:
+ * \snippet this H5R_ref_t_snip
*
* H5Rdestroy() should be used to release the resource from the
* reference.
@@ -216,12 +231,12 @@ H5_DLL herr_t H5Rcreate_attr(hid_t loc_id, const char *name, const char *attr_na
*
* \return \herr_t
*
- * \details Given a reference, ref_ptr, to an object, region or attribute
- * attached to an object, H5R_DESTROY releases allocated resources
+ * \details Given a reference, \p ref_ptr, to an object, region or attribute
+ * attached to an object, H5Rdestroy() releases allocated resources
* from a previous create call.
*
- * H5R_ref_t is defined in H5Rpublic.h as: typedef unsigned char
- * H5R_ref_t[#H5R_REF_BUF_SIZE];
+ * \ref H5R_ref_t is defined in H5Rpublic.h as:
+ * \snippet this H5R_ref_t_snip
*
*/
H5_DLL herr_t H5Rdestroy(H5R_ref_t *ref_ptr);
@@ -236,23 +251,20 @@ H5_DLL herr_t H5Rdestroy(H5R_ref_t *ref_ptr);
*
* \param[in] ref_ptr Pointer to reference
*
- * \return Returns a valid reference type if successful; otherwise returns #H5R_UNKNOWN.
+ * \return Returns a valid reference type if successful; otherwise returns #H5R_BADTYPE .
*
* \details Given a reference, \p ref_ptr, H5Rget_type() returns the
* type of the reference.
*
* Valid returned reference types are:
+ * \snippet this H5R_type_t_snip
*
- * #H5R_OBJECT2 Object reference version 2
- * #H5R_DATASET_REGION2 Region reference version 2
- * #H5R_ATTRIBUTE Attribute reference
- *
- * Note that #H5R_OBJECT1 and #H5R_DATASET REGION1 can never be
- * associated to an H5R_ref_t reference and can therefore never be
+ * Note that #H5R_OBJECT1 and #H5R_DATASET_REGION1 can never be
+ * associated to an \ref H5R_ref_t reference and can therefore never be
* returned through that function.
*
- * H5R_ref_t is defined in H5Rpublic.h as: typedef unsigned char
- * H5R_ref_t[#H5R_REF_BUF_SIZE];
+ * \ref H5R_ref_t is defined in H5Rpublic.h as:
+ * \snippet this H5R_ref_t_snip
*
*/
H5_DLL H5R_type_t H5Rget_type(const H5R_ref_t *ref_ptr);
@@ -273,8 +285,8 @@ H5_DLL H5R_type_t H5Rget_type(const H5R_ref_t *ref_ptr);
* \details H5Requal() determines whether two references point to the
* same object, region or attribute.
*
- * H5R_ref_t is defined in H5Rpublic.h as: typedef unsigned char
- * H5R_ref_t[#H5R_REF_BUF_SIZE];
+ * \ref H5R_ref_t is defined in H5Rpublic.h as:
+ * \snippet this H5R_ref_t_snip
*
*/
H5_DLL htri_t H5Requal(const H5R_ref_t *ref1_ptr, const H5R_ref_t *ref2_ptr);
@@ -320,8 +332,8 @@ H5_DLL herr_t H5Rcopy(const H5R_ref_t *src_ref_ptr, H5R_ref_t *dst_ref_ptr);
* must be of the same type as the object being referenced, that is
* a group or dataset property list.
*
- * H5R_ref_t is defined in H5Rpublic.h as: typedef unsigned char
- * H5R_ref_t[#H5R_REF_BUF_SIZE];
+ * \ref H5R_ref_t is defined in H5Rpublic.h as:
+ * \snippet this H5R_ref_t_snip
*
* The object opened with this function should be closed when it
* is no longer needed so that resource leaks will not develop. Use
@@ -333,22 +345,8 @@ H5_DLL hid_t H5Ropen_object(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id);
/**
* --------------------------------------------------------------------------
- * \ingroup H5R
- *
- * \brief Asynchronous version of H5Ropen_object()
- *
- * \app_file
- * \app_func
- * \app_line
- * \param[out] ref_ptr Pointer to reference to open
- * \rapl_id
- * \oapl_id
- * \es_id
- *
- * \return \hid_t{object}
- *
- * \see H5Ropen_object()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Ropen}
*/
H5_DLL hid_t H5Ropen_object_async(const char *app_file, const char *app_func, unsigned app_line,
H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id, hid_t es_id);
@@ -388,22 +386,8 @@ H5_DLL hid_t H5Ropen_region(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id);
/**
* --------------------------------------------------------------------------
- * \ingroup H5R
- *
- * \brief Asynchronous version of H5Ropen_region()
- *
- * \app_file
- * \app_func
- * \app_line
- * \param[in] ref_ptr Pointer to reference to open
- * \rapl_id
- * \oapl_id
- * \es_id
- *
- * \return \hid_t{dataspace}
- *
- * \see H5Ropen_region()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Ropen_region}
*/
H5_DLL hid_t H5Ropen_region_async(const char *app_file, const char *app_func, unsigned app_line,
H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t oapl_id, hid_t es_id);
@@ -440,22 +424,8 @@ H5_DLL hid_t H5Ropen_attr(H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id);
/**
* --------------------------------------------------------------------------
- * \ingroup H5R
- *
- * \brief Asynchronous version of H5Ropen_attr()
- *
- * \app_file
- * \app_func
- * \app_line
- * \param[in] ref_ptr Pointer to reference to open
- * \rapl_id
- * \aapl_id
- * \es_id
- *
- * \return \hid_t{attribute}
- *
- * \see H5Ropen_attr()
- *
+ * \ingroup ASYNC
+ * \async_variant_of{H5Ropen_attr}
*/
H5_DLL hid_t H5Ropen_attr_async(const char *app_file, const char *app_func, unsigned app_line,
H5R_ref_t *ref_ptr, hid_t rapl_id, hid_t aapl_id, hid_t es_id);
@@ -485,10 +455,7 @@ H5_DLL hid_t H5Ropen_attr_async(const char *app_file, const char *app_func, unsi
* Upon success, the function returns in \p obj_type the type of
* the object that the reference points to. Valid values for this
* referenced object type are as followed (defined in H5Opublic.h):
- *
- * H5O_TYPE_GROUP Object is a group
- * H5O_TYPE_DATASET Object is a dataset
- * H5O_TYPE_NAMED_DATATYPE Object is a named datatype
+ * \snippet H5Opublic.h H5O_type_t_snip
*
*/
H5_DLL herr_t H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type);
@@ -540,12 +507,12 @@ H5_DLL ssize_t H5Rget_file_name(const H5R_ref_t *ref_ptr, char *name, size_t siz
* \details H5Rget_obj_name() retrieves the object name for the object,
* region or attribute reference pointed to by \p ref_ptr.
*
- * The parameter \p rapl id is a reference access property list
+ * The parameter \p rapl_id is a reference access property list
* identifier for the reference. The access property list can
* be used to access external files that the reference points to
* (through a file access property list).
*
- * Up to size characters of the name are returned in name; additional
+ * Up to size characters of the name are returned in \p name; additional
* characters, if any, are not returned to the user application. If
* the length of the name, which determines the required value of
* \p size, is unknown, a preliminary call to H5Rget_obj_name() call
@@ -553,8 +520,8 @@ H5_DLL ssize_t H5Rget_file_name(const H5R_ref_t *ref_ptr, char *name, size_t siz
* object name. That value can then be passed in for \p size in the
* second call to H5Rget_obj_name(), which will retrieve the actual
* name. If there is no name associated with the object identifier
- * or if the name is #NULL, H5Rget_obj_name() returns the size of
- * the name buffer (the size does not include the #NULL terminator).
+ * or if the name is NULL, H5Rget_obj_name() returns the size of
+ * the name buffer (the size does not include the \c \0 terminator).
*
* If \p ref_ptr is an object reference, \p name will be returned with
* a name for the referenced object. If \p ref_ptr is a dataset region
@@ -595,6 +562,7 @@ H5_DLL ssize_t H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *name, si
*/
H5_DLL ssize_t H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *name, size_t size);
+/// \cond DEV
/* API Wrappers for async routines */
/* (Must be defined _after_ the function prototype) */
/* (And must only defined when included in application code, not the library) */
@@ -609,6 +577,7 @@ H5_DLL ssize_t H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *name, size_t siz
#define H5Ropen_region_async_wrap H5_NO_EXPAND(H5Ropen_region_async)
#define H5Ropen_attr_async_wrap H5_NO_EXPAND(H5Ropen_attr_async)
#endif /* H5R_MODULE */
+/// \endcond
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -624,15 +593,334 @@ H5_DLL ssize_t H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *name, size_t siz
/* Function prototypes */
#ifndef H5_NO_DEPRECATED_SYMBOLS
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5R
+ *
+ * \brief Retrieves the type of object that an object reference points to
+ *
+ * \param[in] id The dataset containing the reference object or the group
+ * containing that dataset
+ * \param[in] ref_type Type of reference to query
+ * \param[in] ref Reference to query
+ *
+ * \return Returns a valid object type if successful; otherwise returns a
+ * negative value (#H5G_UNKNOWN).
+ *
+ * \deprecated This function has been renamed from H5Rget_obj_type() and is
+ * deprecated in favor of the macro H5Rget_obj_type() or the
+ * function H5Rget_obj_type2().
+ *
+ * \details Given an object reference, \p ref, H5Rget_obj_type1() returns the
+ * type of the referenced object.
+ *
+ * A \Emph{reference type} is the type of reference, either an object
+ * reference or a dataset region reference. An \Emph{object reference}
+ * points to an HDF5 object while a \Emph{dataset region reference}
+ * points to a defined region within a dataset.
+ *
+ * The \Emph{referenced object} is the object the reference points
+ * to. The \Emph{referenced object type}, or the type of the referenced
+ * object, is the type of the object that the reference points to.
+ *
+ * The location identifier, \p id, is the identifier for either the
+ * dataset containing the object reference or the group containing that
+ * dataset.
+ *
+ * Valid reference types, to pass in as \p ref_type, include the
+ * following:
+ * \snippet this H5R_type_t_snip
+ *
+ * If the application does not already know the object reference type,
+ * that can be determined with three preliminary calls:
+ *
+ * \li Call H5Dget_type() on the dataset containing the reference to
+ * get a datatype identifier for the dataset’s datatype.
+ * \li Using that datatype identifier, H5Tget_class() returns a datatype
+ * class.\n If the datatype class is #H5T_REFERENCE, H5Tequal() can
+ * then be used to determine whether the reference’s datatype is
+ * #H5T_STD_REF_OBJ or #H5T_STD_REF_DSETREG:
+ * - If the datatype is #H5T_STD_REF_OBJ, the reference object type
+ * is #H5R_OBJECT.
+ * - If the datatype is #H5T_STD_REF_DSETREG, the reference object
+ * type is #H5R_DATASET_REGION.
+ *
+ * When the function completes successfully, it returns one of the
+ * following valid object type values (defined in H5Gpublic.h):
+ * \snippet H5Gpublic.h H5G_obj_t_snip
+ *
+ * \version 1.8.0 Function H5Rget_obj_type() renamed to H5Rget_obj_type1() and
+ * deprecated in this release.
+ * \since 1.6.0
+ *
+ */
H5_DLL H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref);
-H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5R
+ *
+ * \brief Opens the HDF5 object referenced
+ *
+ * \obj_id
+ * \param[in] ref_type The reference type of \p ref
+ * \param[in] ref Reference to open
+ *
+ * \return Returns identifier of referenced object if successful; otherwise
+ * returns a negative value.
+ *
+ * \deprecated This function has been renamed from H5Rdereference() and is
+ * deprecated in favor of the macro H5Rdereference() or the function
+ * H5Rdereference2().
+ *
+ * \details Given a reference, \p ref, to an object or a region in an object,
+ * H5Rdereference1() opens that object and returns an identifier.
+ *
+ * The parameter \p obj_id must be a valid identifier for an object in
+ * the HDF5 file containing the referenced object, including the file
+ * identifier.
+ *
+ * The parameter \p ref_type specifies the reference type of the
+ * reference \p ref. \p ref_type may contain either of the following
+ * values:
+ * - #H5R_OBJECT
+ * - #H5R_DATASET_REGION
+ *
+ * The object opened with this function should be closed when it is no
+ * longer needed so that resource leaks will not develop. Use the
+ * appropriate close function such as H5Oclose() or H5Dclose() for
+ * datasets.
+ *
+ * \version 1.10.0 Function H5Rdereference() renamed to H5Rdereference1() and
+ * deprecated in this release.
+ * \since 1.8.0
+ *
+ */
+H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-H5_DLL herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id);
-H5_DLL herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type);
-H5_DLL hid_t H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *ref);
-H5_DLL hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, const void *ref);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5R
+ *
+ * \brief Creates a reference
+ *
+ * \param[out] ref Reference created by the function call
+ * \param[in] loc_id Location identifier used to locate the object being pointed to
+ * \param[in] name Name of object at location \p loc_id
+ * \param[in] ref_type Type of reference
+ * \param[in] space_id Dataspace identifier with selection. Used only for
+ * dataset region references; pass as -1 if reference is
+ * an object reference, i.e., of type #H5R_OBJECT
+ *
+ * \return \herr_t
+ *
+ * \details H5Rcreate() creates the reference, \p ref, of the type specified in
+ * \p ref_type, pointing to the object \p name located at \p loc_id.
+ *
+ * The HDF5 library maps the void type specified above for \p ref to
+ * the type specified in \p ref_type, which will be one of the following:
+ * \snippet this H5R_type_t_snip
+ *
+ * The parameters \p loc_id and \p name are used to locate the object.
+ *
+ * The parameter \p space_id identifies the dataset region that a
+ * dataset region reference points to. This parameter is used only with
+ * dataset region references and should be set to -1 if the reference
+ * is an object reference, #H5R_OBJECT.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5R
+ *
+ * \brief Retrieves the type of object that an object reference points to
+ *
+ * \param[in] id The dataset containing the reference object or the group
+ * containing that dataset
+ * \param[in] ref_type Type of reference to query
+ * \param[in] ref Reference to query
+ * \param[out] obj_type Type of referenced object
+ *
+ * \return \herr_t
+ *
+ * \details Given an object reference, \p ref, H5Rget_obj_type2() returns the
+ * type of the referenced object in \p obj_type.
+ *
+ * A \Emph{reference type} is the type of reference, either an object
+ * reference or a dataset region reference. An \Emph{object reference}
+ * points to an HDF5 object while a \Emph{dataset region reference}
+ * points to a defined region within a dataset.
+ *
+ * The \Emph{referenced object} is the object the reference points
+ * to. The \Emph{referenced object type}, or the type of the referenced
+ * object, is the type of the object that the reference points to.
+ *
+ * The location identifier, \p id, is the identifier for either the
+ * dataset containing the object reference or the group containing that
+ * dataset.
+ *
+ * Valid reference types, to pass in as \p ref_type, include the
+ * following:
+ * \snippet this H5R_type_t_snip
+ *
+ * If the application does not already know the object reference type,
+ * that can be determined with three preliminary calls:
+ *
+ * \li Call H5Dget_type() on the dataset containing the reference to
+ * get a datatype identifier for the dataset’s datatype.
+ * \li Using that datatype identifier, H5Tget_class() returns a datatype
+ * class.\n If the datatype class is #H5T_REFERENCE, H5Tequal() can
+ * then be used to determine whether the reference’s datatype is
+ * #H5T_STD_REF_OBJ or #H5T_STD_REF_DSETREG:
+ * - If the datatype is #H5T_STD_REF_OBJ, the reference object type
+ * is #H5R_OBJECT.
+ * - If the datatype is #H5T_STD_REF_DSETREG, the reference object
+ * type is #H5R_DATASET_REGION.
+ *
+ * When the function completes successfully, it returns one of the
+ * following valid object type values (defined in H5Opublic.h):
+ * \snippet H5Opublic.h H5O_type_t_snip
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5R
+ *
+ * \brief Opens the HDF5 object referenced
+ *
+ * \obj_id
+ * \oapl_id
+ * \param[in] ref_type The reference type of \p ref
+ * \param[in] ref Reference to open
+ *
+ * \return Returns identifier of referenced object if successful; otherwise
+ * returns a negative value.
+ *
+ * \details Given a reference, \p ref, to an object or a region in an object,
+ * H5Rdereference2() opens that object and returns an identifier.
+ *
+ * The parameter \p obj_id must be a valid identifier for the HDF5 file
+ * containing the referenced object or for any object in that HDF5
+ * file.
+ *
+ * The parameter \p oapl_id is an object access property list
+ * identifier for the referenced object. The access property list must
+ * be of the same type as the object being referenced, that is a group,
+ * dataset, or datatype property list.
+ *
+ * The parameter \p ref_type specifies the reference type of the
+ * reference \p ref. \p ref_type may contain either of the following
+ * values:
+ * - #H5R_OBJECT
+ * - #H5R_DATASET_REGION
+ *
+ * The object opened with this function should be closed when it is no
+ * longer needed so that resource leaks will not develop. Use the
+ * appropriate close function such as H5Oclose() or H5Dclose() for
+ * datasets.
+ *
+ * \since 1.10.0
+ *
+ */
+H5_DLL hid_t H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *ref);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5R
+ *
+ * \brief Sets up a dataspace and selection as specified by a region reference
+ *
+ * \param[in] dataset File identifier or identifier for any object in the file
+ * containing the referenced region
+ * \param[in] ref_type Reference type of \p ref, which must be #H5R_DATASET_REGION
+ * \param[in] ref Region reference to open
+ *
+ * \return Returns a valid dataspace identifier if successful; otherwise returns
+ * a negative value.
+ *
+ * \details H5Rget_region() creates a copy of the dataspace of the dataset
+ * pointed to by a region reference, \p ref, and defines a selection
+ * matching the selection pointed to by ref within the dataspace copy.
+ *
+ * \p dataset is used to identify the file containing the referenced
+ * region; it can be a file identifier or an identifier for any object
+ * in the file.
+ *
+ * The parameter \p ref_type specifies the reference type of \p ref and
+ * must contain the value #H5R_DATASET_REGION.
+ *
+ * Use H5Sclose() to release the dataspace identifier returned by this
+ * function when the identifier is no longer needed.
+ *
+ */
+H5_DLL hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, const void *ref);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5R
+ *
+ * \brief Retrieves a name for a referenced object
+ *
+ * \param[in] loc_id Identifier for the file containing the reference or for
+ * any object in that file
+ * \param[in] ref_type Type of reference
+ * \param[in] ref An object or dataset region reference
+ * \param[out] name A buffer to place the name of the referenced object or
+ * dataset region. If \c NULL, then this call will return the
+ * size in bytes of the name.
+ * \param[in] size The size of the \p name buffer. When the size is passed in,
+ * the \c NULL terminator needs to be included.
+ *
+ * \return Returns the length of the name if successful, returning 0 (zero) if
+ * no name is associated with the identifier. Otherwise returns a
+ * negative value.
+ *
+ * \details H5Rget_name() retrieves a name for the object identified by \p ref.\n
+ * \p loc_id is used to identify the file containing the reference. It
+ * can be the file identifier for the file containing the reference or
+ * an identifier for any object in that file.
+ *
+ * \ref H5R_type_t is the reference type of \p ref. Valid values
+ * include the following:
+ * \snippet this H5R_type_t_snip
+ *
+ * \p ref is the reference for which the target object’s name is
+ * sought.
+ *
+ * If \p ref is an object reference, \p name will be returned with a
+ * name for the referenced object. If \p ref is a dataset region
+ * reference, \p name will contain a name for the object containing the
+ * referenced region.
+ *
+ * Up to \p size characters of the name are returned in \p name;
+ * additional characters, if any, are not returned to the user
+ * application.
+ *
+ * If the length of the name, which determines the required value of \p
+ * size, is unknown, a preliminary H5Rget_name() call can be made. The
+ * return value of this call will be the size of the object name. That
+ * value can then be assigned to \p size for a second H5Rget_name()
+ * call, which will retrieve the actual name.
+ *
+ * If there is no name associated with the object identifier or if the
+ * \p name is \c NULL, H5Rget_name() returns the size of the \p name
+ * buffer (the size does not include the \p NULL terminator).
+ *
+ * Note that an object in an HDF5 file may have multiple paths if there
+ * are multiple links pointing to it. This function may return any one
+ * of these paths.
+ *
+ * \since 1.8.0
+ */
H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, char *name, size_t size);
#ifdef __cplusplus
diff --git a/src/H5S.c b/src/H5S.c
index 747d297..13d32cf 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -84,7 +84,7 @@ H5FL_ARR_DEFINE(hsize_t, H5S_MAX_RANK);
static const H5I_class_t H5I_DATASPACE_CLS[1] = {{
H5I_DATASPACE, /* ID class value */
0, /* Class flags */
- 2, /* # of reserved IDs for class */
+ 3, /* # of reserved IDs for class */
(H5I_free_t)H5S__close_cb /* Callback routine for closing objects of this class */
}};
@@ -277,55 +277,6 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_get_validiated_dataspace
- PURPOSE
- Get a pointer to a validated H5S_t pointer
- USAGE
- H5S_t *H5S_get_validated_space(dataspace_id, space)
- hid_t space_id; IN: The ID of the dataspace
- const H5S_t * space; OUT: A pointer to the dataspace
- RETURNS
- SUCCEED/FAIL
- DESCRIPTION
- Gets a pointer to a dataspace struct after validating it. The pointer
- can be NULL (if the ID is H5S_ALL, for example).
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5S_get_validated_dataspace(hid_t space_id, const H5S_t **space)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert(space);
-
- /* Check for invalid ID */
- if (space_id < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid space_id (ID cannot be a negative number)")
-
- /* No special dataspace struct for H5S_ALL */
- if (H5S_ALL == space_id)
- *space = NULL;
- else {
- /* Get the dataspace pointer */
- if (NULL == (*space = (const H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "space_id is not a dataspace ID")
-
- /* Check for valid selection */
- if (H5S_SELECT_VALID(*space) != TRUE)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection + offset not within extent")
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_get_validated_dataspace() */
-
-/*--------------------------------------------------------------------------
- NAME
H5S_create
PURPOSE
Create empty, typed dataspace
diff --git a/src/H5SL.c b/src/H5SL.c
index 166019b..ba9721c 100644
--- a/src/H5SL.c
+++ b/src/H5SL.c
@@ -209,7 +209,7 @@
/* Check if we need to increase allocation of forward pointers */ \
if (LVL + 1 >= 1u << X->log_nalloc) { \
H5SL_node_t **_tmp; \
- HDassert(LVL + 1 == 1u << X->log_nalloc); \
+ HDassert(LVL + 1 == 1U << X->log_nalloc); \
/* Double the amount of allocated space */ \
X->log_nalloc++; \
\
@@ -251,7 +251,7 @@
/* Check if we can reduce the allocation of forward pointers */ \
if (LVL <= 1u << (X->log_nalloc - 1)) { \
H5SL_node_t **_tmp; \
- HDassert(LVL == 1u << (X->log_nalloc - 1)); \
+ HDassert(LVL == 1U << (X->log_nalloc - 1)); \
X->log_nalloc--; \
\
/* Allocate space for new forward pointers */ \
diff --git a/src/H5SM.c b/src/H5SM.c
index ad7ae4f..b09cb45 100644
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -1079,7 +1079,7 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id,
ssize_t index_num;
htri_t tri_ret;
#ifndef NDEBUG
- unsigned deferred_type = -1u;
+ unsigned deferred_type = -1U;
#endif
htri_t ret_value = TRUE;
@@ -1262,16 +1262,16 @@ static herr_t
H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t defer, unsigned type_id,
void *mesg, unsigned *cache_flags_ptr)
{
- H5SM_list_t * list = NULL; /* List index */
- H5SM_mesg_key_t key; /* Key used to search the index */
- H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- H5O_shared_t shared; /* Shared H5O message */
- hbool_t found = FALSE; /* Was the message in the index? */
- H5HF_t * fheap = NULL; /* Fractal heap handle */
- H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */
- size_t buf_size; /* Size of the encoded message */
- void * encoding_buf = NULL; /* Buffer for encoded message */
- size_t empty_pos = UFAIL; /* Empty entry in list */
+ H5SM_list_t * list = NULL; /* List index */
+ H5SM_mesg_key_t key; /* Key used to search the index */
+ H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */
+ H5O_shared_t shared; /* Shared H5O message */
+ hbool_t found = FALSE; /* Was the message in the index? */
+ H5HF_t * fheap = NULL; /* Fractal heap handle */
+ H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */
+ size_t buf_size; /* Size of the encoded message */
+ void * encoding_buf = NULL; /* Buffer for encoded message */
+ size_t empty_pos = SIZE_MAX; /* Empty entry in list */
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
@@ -1325,11 +1325,11 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t
HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to search for message in list")
if (defer) {
- if (list_pos != UFAIL)
+ if (list_pos != SIZE_MAX)
found = TRUE;
} /* end if */
else {
- if (list_pos != UFAIL) {
+ if (list_pos != SIZE_MAX) {
/* If the message was previously shared in an object header, share
* it in the heap now.
*/
@@ -1481,13 +1481,13 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t
/* Insert the new message into the SOHM index */
if (header->index_type == H5SM_LIST) {
/* Index is a list. Find an empty spot if we haven't already */
- if (empty_pos == UFAIL) {
+ if (empty_pos == SIZE_MAX) {
size_t pos;
if (H5SM__find_in_list(list, NULL, &empty_pos, &pos) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to search for message in list")
- if (pos == UFAIL || empty_pos == UFAIL)
+ if (pos == SIZE_MAX || empty_pos == SIZE_MAX)
HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to find empty entry in list")
}
/* Insert message into list */
@@ -1647,9 +1647,14 @@ done:
*
* If EMPTY_POS is NULL, don't store anything in it.
*
- * Return: Message's position in the list on success
- * UFAIL if message couldn't be found
- * empty_pos set to position of empty message or UFAIL.
+ * Return: Success: SUCCEED
+ * pos = position (if found)
+ * pos = SIZE_MAX (if not found)
+ * empty_pos = indeterminate (if found)
+ * empty_pos = 1st empty position (if not found)
+ *
+ * Failure: FAIL
+ * pos & empty_pos indeterminate
*
* Programmer: James Laird
* Tuesday, May 2, 2006
@@ -1670,7 +1675,7 @@ H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *
/* Initialize empty_pos to an invalid value */
if (empty_pos)
- *empty_pos = UFAIL;
+ *empty_pos = SIZE_MAX;
/* Find the first (only) message equal to the key passed in.
* Also record the first empty position we find.
@@ -1693,11 +1698,11 @@ H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *
/* Found earlier position possible, don't check any more */
empty_pos = NULL;
- } /* end if */
- } /* end for */
+ }
+ }
/* If we reached this point, we didn't find the message */
- *pos = UFAIL;
+ *pos = SIZE_MAX;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1839,7 +1844,7 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, c
/* Find the message in the list */
if (H5SM__find_in_list(list, &key, NULL, &list_pos) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to search for message in list")
- if (list_pos == UFAIL)
+ if (list_pos == SIZE_MAX)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index")
if (list->messages[list_pos].location == H5SM_IN_HEAP)
@@ -2221,7 +2226,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize
/* Find the message in the list */
if (H5SM__find_in_list(list, &key, NULL, &list_pos) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to search for message in list")
- if (list_pos == UFAIL)
+ if (list_pos == SIZE_MAX)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index")
/* Copy the message */
@@ -2519,7 +2524,7 @@ H5SM__list_free(H5SM_list_t *list)
*
* Purpose: Print debugging information for the master table.
*
- * If table_vers and num_indexes are not UFAIL, they are used
+ * If table_vers and num_indexes are not UINT_MAX, they are used
* instead of the values in the superblock.
*
* Return: Non-negative on success/Negative on failure
@@ -2546,14 +2551,14 @@ H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int indent, int fwi
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- /* If table_vers and num_indexes are UFAIL, replace them with values from
+ /* If table_vers and num_indexes are UINT_MAX, replace them with values from
* userblock
*/
- if (table_vers == UFAIL)
+ if (table_vers == UINT_MAX)
table_vers = H5F_SOHM_VERS(f);
else if (table_vers != H5F_SOHM_VERS(f))
HDfprintf(stream, "*** SOHM TABLE VERSION DOESN'T MATCH VERSION IN SUPERBLOCK!\n");
- if (num_indexes == UFAIL)
+ if (num_indexes == UINT_MAX)
num_indexes = H5F_SOHM_NINDEXES(f);
else if (num_indexes != H5F_SOHM_NINDEXES(f))
HDfprintf(stream, "*** NUMBER OF SOHM INDEXES DOESN'T MATCH VALUE IN SUPERBLOCK!\n");
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 8a4c155..2ad467f 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -238,7 +238,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l
HDassert(table->table_size == len);
/* Check magic number */
- if (HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM table signature")
image += H5_SIZEOF_MAGIC;
@@ -580,7 +580,7 @@ H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED le
list->header = udata->header;
/* Check magic number */
- if (HDmemcmp(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM list signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h
index f425074..efe9355 100644
--- a/src/H5SMprivate.h
+++ b/src/H5SMprivate.h
@@ -66,4 +66,4 @@ H5_DLL herr_t H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int i
H5_DLL herr_t H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, int fwidth,
haddr_t table_addr);
-#endif /*_H5SMprivate_H*/
+#endif /*H5SMprivate_H*/
diff --git a/src/H5ST.c b/src/H5ST.c
deleted file mode 100644
index 0b7b858..0000000
--- a/src/H5ST.c
+++ /dev/null
@@ -1,779 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* TERNARY SEARCH TREE ALGS
- This code is described in "Ternary Search Trees" by Jon
-Bentley and Robert Sedgewick in the April, 1998, Dr. Dobb's Journal.
-*/
-
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5STprivate.h" /* Ternary search trees */
-
-#ifdef H5ST_DEBUG
-static herr_t H5ST__dump_internal(H5ST_ptr_t p);
-#endif /* H5ST_DEBUG */
-
-/* Declare a free list to manage the H5ST_node_t struct */
-H5FL_DEFINE_STATIC(H5ST_node_t);
-
-/* Declare a free list to manage the H5ST_tree_t struct */
-H5FL_DEFINE_STATIC(H5ST_tree_t);
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_create
- PURPOSE
- Create a TST
- USAGE
- H5ST_ptr_t H5ST_create()
-
- RETURNS
- Returns a pointer to the new TST tree on success, NULL on failure.
- DESCRIPTION
- Create a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_tree_t *
-H5ST_create(void)
-{
- H5ST_tree_t *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Allocate wrapper for TST */
- if (NULL == (ret_value = H5FL_MALLOC(H5ST_tree_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
-
- /* Set the internal fields */
- ret_value->root = NULL;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_create() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST__close_internal
- PURPOSE
- Close a TST, deallocating it.
- USAGE
- herr_t H5ST_close(p)
- H5ST_ptr_t p; IN/OUT: Root of TST to free
-
- RETURNS
- Returns non-negative on success, negative on failure.
- DESCRIPTION
- Close a TST, freeing all nodes.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5ST__close_internal(H5ST_ptr_t p)
-{
- FUNC_ENTER_STATIC_NOERR
-
- /* Recursively free TST */
- if (p) {
- H5ST__close_internal(p->lokid);
- if (p->splitchar)
- H5ST__close_internal(p->eqkid);
- H5ST__close_internal(p->hikid);
- p = H5FL_FREE(H5ST_node_t, p);
- } /* end if */
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST__close_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_close
- PURPOSE
- Close a TST, deallocating it.
- USAGE
- herr_t H5ST_close(tree)
- H5ST_tree_t *tree; IN/OUT: TST tree to free
-
- RETURNS
- Returns non-negative on success, negative on failure.
- DESCRIPTION
- Close a TST, freeing all nodes.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_close(H5ST_tree_t *tree)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Check arguments */
- if (NULL == tree)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid TST")
-
- /* Free the TST itself */
- if (H5ST__close_internal(tree->root) < 0)
- HGOTO_ERROR(H5E_TST, H5E_CANTFREE, FAIL, "can't free TST")
-
- /* Free root node itself */
- tree = H5FL_FREE(H5ST_tree_t, tree);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_close() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_insert
- PURPOSE
- Insert a string/object pair into a TST
- USAGE
- herr_t H5ST_insert(tree,s,obj)
- H5ST_tree_t *tree; IN/OUT: TST to insert string into
- const char *s; IN: String to use as key for object
- void *obj; IN: Pointer to object to insert
-
- RETURNS
- Returns non-negative on success, negative on failure.
- DESCRIPTION
- Insert a key (string)/object pair into a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj)
-{
- int d; /* Comparison value */
- H5ST_ptr_t pp, *p; /* Pointer to current node and pointer to that */
- H5ST_ptr_t parent = NULL; /* Pointer to parent node */
- H5ST_ptr_t up = NULL; /* Pointer to up node */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Find the correct location to insert object */
- p = &tree->root;
- while ((pp = *p)) {
- /* If this node matches the character in the key, then drop down to the lower tree */
- if (0 == (d = *s - pp->splitchar)) {
- if (*s++ == 0)
- HGOTO_ERROR(H5E_TST, H5E_EXISTS, FAIL, "key already in tree")
- up = pp;
- p = &(pp->eqkid);
- } /* end if */
- else {
- /* Walk through the current tree, searching for the matching character */
- parent = pp;
- if (d < 0)
- p = &(pp->lokid);
- else
- p = &(pp->hikid);
- } /* end else */
- } /* end while */
-
- /* Finish walking through the key string, adding nodes until the end */
- for (;;) {
- if (NULL == (*p = H5FL_MALLOC(H5ST_node_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- pp = *p;
- pp->splitchar = *s;
- pp->up = up;
- pp->parent = parent;
- pp->lokid = pp->eqkid = pp->hikid = NULL;
-
- /* If this is the end of the key string, break out */
- if (*s++ == 0) {
- pp->eqkid = (H5ST_ptr_t)obj;
- break;
- } /* end if */
-
- /* Continue to next character */
- parent = NULL;
- up = pp;
- p = &(pp->eqkid);
- } /* end for */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_insert() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_search
- PURPOSE
- Determine if a key is in the TST
- USAGE
- hbool_t H5ST_search(tree,s)
- H5ST_tree_t *tree; IN: TST to find string in
- const char *s; IN: String to use as key to locate
-
- RETURNS
- Success: TRUE if key string in TST, FALSE if not
- Failure: negative
- DESCRIPTION
- Locate a key (string) in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-htri_t
-H5ST_search(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t p; /* Temporary pointer to TST node */
- htri_t ret_value = FALSE; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- p = tree->root;
- while (p) {
- if (*s < p->splitchar)
- p = p->lokid;
- else if (*s == p->splitchar) {
- if (*s++ == 0)
- HGOTO_DONE(TRUE);
- p = p->eqkid;
- }
- else
- p = p->hikid;
- } /* end while */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_search() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST__find_internal
- PURPOSE
- Find the node matching a particular key string
- USAGE
- H5ST_ptr_t H5ST_find(p,s)
- H5ST_ptr_t p; IN: TST to find string in
- const char *s; IN: String to use as key to locate
-
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Locate a key (string) in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static H5ST_ptr_t
-H5ST__find_internal(H5ST_ptr_t p, const char *s)
-{
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- while (p) {
- if (*s < p->splitchar)
- p = p->lokid;
- else if (*s == p->splitchar) {
- if (*s++ == 0)
- HGOTO_DONE(p);
- p = p->eqkid;
- }
- else
- p = p->hikid;
- } /* end while */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST__find_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_find
- PURPOSE
- Find the node matching a particular key string
- USAGE
- H5ST_ptr_t H5ST_find(tree,s)
- H5ST_tree_t *tree; IN: TST to find string in
- const char *s; IN: String to use as key to locate
-
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Locate a key (string) in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_ptr_t
-H5ST_find(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- if (NULL == (ret_value = H5ST__find_internal(tree->root, s)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_find() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_locate
- PURPOSE
- Find an object in a TST
- USAGE
- void *H5ST_locate(tree,s)
- H5ST_tree_t *tree; IN: TST to locate object within
- const char *s; IN: String of key for object to locate
- RETURNS
- Success: Non-NULL, pointer to object stored for key
- Failure: Negative
- DESCRIPTION
- Locate a node in a TST, returning the object from the node.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-void *
-H5ST_locate(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t node; /* Pointer to node located */
- void * ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Locate the node to remove */
- if (NULL == (node = H5ST__find_internal(tree->root, s)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
-
- /* Get the pointer to the object to return */
- ret_value = node->eqkid;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5ST_locate() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST__findfirst_internal
- PURPOSE
- Find the first node in a TST
- USAGE
- H5ST_ptr_t H5ST__findfirst_internal(p)
- H5ST_ptr_t p; IN: TST to locate first node within
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the first (lexicographically) node in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static H5ST_ptr_t
-H5ST__findfirst_internal(H5ST_ptr_t p)
-{
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- while (p) {
- /* Find least node in current tree */
- while (p->lokid)
- p = p->lokid;
-
- /* Is least node '\0'? */
- if (p->splitchar == '\0') {
- /* Return it */
- HGOTO_DONE(p);
- } /* end if */
- else {
- /* Go down to next level of tree */
- p = p->eqkid;
- } /* end else */
- } /* end while */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST__findfirst_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_findfirst
- PURPOSE
- Find the first node in a TST
- USAGE
- H5ST_ptr_t H5ST_findfirst(tree)
- H5ST_tree_t *tree; IN: TST to locate first node within
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the first (lexicographically) node in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_ptr_t
-H5ST_findfirst(H5ST_tree_t *tree)
-{
- H5ST_ptr_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- if (NULL == (ret_value = H5ST__findfirst_internal(tree->root)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "no nodes in TST");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_findfirst() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST__getnext
- PURPOSE
- Internal routine to find the next node in a given level of a TST
- USAGE
- H5ST_ptr_t H5ST__getnext(p)
- H5ST_ptr_t *p; IN: Pointer to node to find next node from
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the next (lexicographically) node in the current level of a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static H5ST_ptr_t
-H5ST__getnext(H5ST_ptr_t p)
-{
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* If the node to continue from has higher-valued nodes attached */
- if (p->hikid) {
- /* Go to first higher-valued node */
- p = p->hikid;
-
- /* Find least node from here */
- while (p->lokid)
- p = p->lokid;
- HGOTO_DONE(p);
- } /* end if */
- else {
- H5ST_ptr_t q; /* Temporary TST node pointer */
-
- /* Go up one level in current tree */
- q = p->parent;
- if (q == NULL)
- HGOTO_DONE(NULL);
-
- /* While the previous node was the higher-valued node, keep backing up the tree */
- while (q->hikid == p) {
- p = q;
- q = p->parent;
- if (NULL == q)
- HGOTO_DONE(NULL);
- } /* end while */
- HGOTO_DONE(q);
- } /* end else */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST__getnext() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_findnext
- PURPOSE
- Find the next node from a node in a TST
- USAGE
- H5ST_ptr_t H5ST_findnext(p)
- H5ST_ptr_t p; IN: Current node to continue from
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the next (lexicographically) node in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_ptr_t
-H5ST_findnext(H5ST_ptr_t p)
-{
- H5ST_ptr_t q; /* Temporary pointer to TST node */
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* Find the next node at the current level, or go back up the tree */
- do {
- q = H5ST__getnext(p);
- if (q) {
- HGOTO_DONE(H5ST__findfirst_internal(q->eqkid));
- } /* end if */
- else
- p = p->up;
- } while (p);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_findnext() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST__delete_internal
- PURPOSE
- Delete a node from a TST
- USAGE
- herr_t H5ST__delete_internal(root,p)
- H5ST_ptr_t *root; IN/OUT: Root of TST to delete node from
- H5ST_ptr_t p; IN: Node to delete
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Delete a node from a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- This should be the final node for a string.
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5ST__delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p)
-{
- H5ST_ptr_t q, /* Temporary pointer to TST node */
- newp; /* Pointer to node which will replace deleted node in tree */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Find node to replace one being deleted */
- if (p->lokid) {
- /* If the deleted node has lo & hi kids, attach them together */
- if (p->hikid) {
- q = p->lokid;
- while (q->hikid)
- q = q->hikid;
- q->hikid = p->hikid;
- p->hikid->parent = q;
- } /* end if */
- newp = p->lokid;
- } /* end if */
- else if (p->hikid) {
- newp = p->hikid;
- } /* end if */
- else {
- newp = NULL;
- } /* end else */
-
- /* Deleted node is in middle of tree */
- if (p->parent) {
- /* Attach new node to correct side of parent */
- if (p == p->parent->lokid)
- p->parent->lokid = newp;
- else
- p->parent->hikid = newp;
- if (newp)
- newp->parent = p->parent;
- } /* end if */
- else {
- if (newp)
- newp->parent = p->parent;
- if (p->up) {
- p->up->eqkid = newp;
-
- /* If we deleted the last node in the TST, delete the upper node also */
- if (NULL == newp)
- H5ST__delete_internal(root, p->up);
- } /* end if */
- else /* Deleted last node at top level of tree */
- *root = newp;
- } /* end else */
-
- p = H5FL_FREE(H5ST_node_t, p);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST__delete_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_delete
- PURPOSE
- Delete a node from a TST
- USAGE
- herr_t H5ST_delete(tree,p)
- H5ST_tree_t *tree; IN/OUT: TST to delete node from
- H5ST_ptr_t p; IN: Node to delete
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Delete a node from a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- This should be the final node for a string.
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- if (H5ST__delete_internal(&tree->root, p) < 0)
- HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, FAIL, "can't delete node from TST")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_delete() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_remove
- PURPOSE
- Remove a node from a TST
- USAGE
- void *H5ST_remove(tree,s)
- H5ST_tree_t *tree; IN/OUT: TST to remove node from
- const char *s; IN: String of key for node to remove
- RETURNS
- Success: Non-NULL, pointer to object stored for key
- Failure: Negative
- DESCRIPTION
- Remove a node from a TST, returning the object from the node.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-void *
-H5ST_remove(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t node; /* Pointer to node to remove */
- void * ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Locate the node to remove */
- if (NULL == (node = H5ST__find_internal(tree->root, s)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
-
- /* Get the pointer to the object to return */
- ret_value = node->eqkid;
-
- /* Remove the node from the TST */
- if (H5ST__delete_internal(&tree->root, node) < 0)
- HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, NULL, "can't delete node from TST")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5ST_remove() */
-
-#ifdef H5ST_DEBUG
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST__dump_internal
- PURPOSE
- Dump all the nodes of a TST
- USAGE
- herr_t H5ST_dump(p)
- H5ST_ptr_t p; IN: Root of TST to dump
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Dump information for a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5ST__dump_internal(H5ST_ptr_t p)
-{
- FUNC_ENTER_STATIC_NOERR
-
- if (p) {
- HDprintf("p=%p\n", (void *)p);
- HDprintf("\tp->up=%p\n", (void *)p->up);
- HDprintf("\tp->parent=%p\n", (void *)p->parent);
- HDprintf("\tp->lokid=%p\n", (void *)p->lokid);
- HDprintf("\tp->hikid=%p\n", (void *)p->hikid);
- HDprintf("\tp->eqkid=%p\n", (void *)p->eqkid);
- HDprintf("\tp->splitchar=%c\n", p->splitchar);
-
- H5ST__dump_internal(p->lokid);
- if (p->splitchar)
- H5ST__dump_internal(p->eqkid);
- else
- HDprintf("%s\n", (char *)p->eqkid);
- H5ST__dump_internal(p->hikid);
- } /* end if */
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST__dump_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_dump
- PURPOSE
- Dump all the nodes of a TST
- USAGE
- herr_t H5ST_dump(tree)
- H5ST_tree_t *tree; IN: TST to dump
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Dump information for a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_dump(H5ST_tree_t *tree)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* Dump the tree */
- H5ST__dump_internal(tree->root);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST_dump() */
-#endif /* H5ST_DEBUG */
diff --git a/src/H5STprivate.h b/src/H5STprivate.h
deleted file mode 100644
index 2d009fa..0000000
--- a/src/H5STprivate.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This file contains private information about the H5ST module
- */
-#ifndef H5STprivate_H
-#define H5STprivate_H
-
-#ifdef LATER
-#include "H5STpublic.h"
-#endif /* LATER */
-
-/* Private headers needed by this file */
-#include "H5private.h"
-
-/* Typedefs */
-
-/* Internal nodes for TST */
-typedef struct H5ST_node *H5ST_ptr_t;
-typedef struct H5ST_node {
- char splitchar; /* Character represented at node */
- H5ST_ptr_t up; /* Pointer to the node in the tree above (before) this node */
- H5ST_ptr_t parent; /* Pointer to the next higher tree node in this tree */
- H5ST_ptr_t lokid; /* Pointer to the lower node from this one, in this tree */
- H5ST_ptr_t eqkid; /* Pointer to the parent node in the next tree down (after) this node */
- H5ST_ptr_t hikid; /* Pointer to the higher node from this one, in this tree */
-} H5ST_node_t;
-
-/* Wrapper about TST */
-typedef struct {
- H5ST_ptr_t root; /* Pointer to actual TST */
-} H5ST_tree_t;
-
-/* Macro to access "data" pointer in H5ST_node_t's returned from functions */
-#define H5ST_NODE_DATA(p) ((void *)(p->eqkid))
-
-/* Private routines */
-H5_DLL H5ST_tree_t *H5ST_create(void);
-H5_DLL herr_t H5ST_close(H5ST_tree_t *p);
-H5_DLL herr_t H5ST_insert(H5ST_tree_t *root, const char *s, void *obj);
-H5_DLL htri_t H5ST_search(H5ST_tree_t *root, const char *s);
-H5_DLL H5ST_ptr_t H5ST_find(H5ST_tree_t *root, const char *s);
-H5_DLL void * H5ST_locate(H5ST_tree_t *root, const char *s);
-H5_DLL H5ST_ptr_t H5ST_findfirst(H5ST_tree_t *p);
-H5_DLL H5ST_ptr_t H5ST_findnext(H5ST_ptr_t p);
-H5_DLL void * H5ST_remove(H5ST_tree_t *root, const char *s);
-H5_DLL herr_t H5ST_delete(H5ST_tree_t *root, H5ST_ptr_t p);
-#ifdef H5ST_DEBUG
-H5_DLL herr_t H5ST_dump(H5ST_tree_t *tree);
-#endif /* H5ST_DEBUG */
-
-#endif /* H5STprivate_H */
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index e12ff93..a5b9b6c 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -296,11 +296,11 @@ H5S__hyper_print_spans_helper(FILE *f, const H5S_hyper_span_t *span, unsigned de
FUNC_ENTER_STATIC_NOERR
while (span) {
- HDfprintf(f, "%s: %*sdepth=%u, span=%p, (%Hu, %Hu), next=%p\n", FUNC, depth * 2, "", depth, span,
+ HDfprintf(f, "%s: %*sdepth=%u, span=%p, (%Hu, %Hu), next=%p\n", __func__, depth * 2, "", depth, span,
span->low, span->high, span->next);
if (span->down) {
- HDfprintf(f, "%s: %*sspans=%p, count=%u, bounds[0]={%Hu, %Hu}, head=%p\n", FUNC, (depth + 1) * 2,
- "", span->down, span->down->count, span->down->low_bounds[0],
+ HDfprintf(f, "%s: %*sspans=%p, count=%u, bounds[0]={%Hu, %Hu}, head=%p\n", __func__,
+ (depth + 1) * 2, "", span->down, span->down->count, span->down->low_bounds[0],
span->down->high_bounds[0], span->down->head);
H5S__hyper_print_spans_helper(f, span->down->head, depth + 1);
} /* end if */
@@ -316,7 +316,7 @@ H5S__hyper_print_spans(FILE *f, const H5S_hyper_span_info_t *span_lst)
FUNC_ENTER_STATIC_NOERR
if (span_lst != NULL) {
- HDfprintf(f, "%s: spans=%p, count=%u, bounds[0]={%Hu, %Hu}, head=%p\n", FUNC, span_lst,
+ HDfprintf(f, "%s: spans=%p, count=%u, bounds[0]={%Hu, %Hu}, head=%p\n", __func__, span_lst,
span_lst->count, span_lst->low_bounds[0], span_lst->high_bounds[0], span_lst->head);
H5S__hyper_print_spans_helper(f, span_lst->head, 0);
} /* end if */
@@ -342,21 +342,21 @@ H5S__hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, cons
FUNC_ENTER_STATIC_NOERR
if (dinfo != NULL) {
- HDfprintf(f, "%s: %s: start=[", FUNC, field);
+ HDfprintf(f, "%s: %s: start=[", __func__, field);
for (u = 0; u < ndims; u++)
HDfprintf(f, "%Hd%s", dinfo[u].start, (u < (ndims - 1) ? ", " : "]\n"));
- HDfprintf(f, "%s: %s: stride=[", FUNC, field);
+ HDfprintf(f, "%s: %s: stride=[", __func__, field);
for (u = 0; u < ndims; u++)
HDfprintf(f, "%Hu%s", dinfo[u].stride, (u < (ndims - 1) ? ", " : "]\n"));
- HDfprintf(f, "%s: %s: count=[", FUNC, field);
+ HDfprintf(f, "%s: %s: count=[", __func__, field);
for (u = 0; u < ndims; u++)
HDfprintf(f, "%Hu%s", dinfo[u].count, (u < (ndims - 1) ? ", " : "]\n"));
- HDfprintf(f, "%s: %s: block=[", FUNC, field);
+ HDfprintf(f, "%s: %s: block=[", __func__, field);
for (u = 0; u < ndims; u++)
HDfprintf(f, "%Hu%s", dinfo[u].block, (u < (ndims - 1) ? ", " : "]\n"));
} /* end if */
else
- HDfprintf(f, "%s: %s==NULL\n", FUNC, field);
+ HDfprintf(f, "%s: %s==NULL\n", __func__, field);
FUNC_LEAVE_NOAPI(SUCCEED)
}
diff --git a/src/H5Smodule.h b/src/H5Smodule.h
index bb33eb8..010f4a6 100644
--- a/src/H5Smodule.h
+++ b/src/H5Smodule.h
@@ -30,29 +30,36 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5S H5S
- * \brief Dataspace Interface
*
- * \details The Dataspace Interface provides functions for creating and
- * working with dataspaces.
+ * Use the functions in this module to manage HDF5 dataspaces \Emph{and} selections.
*
- * A dataspace has two roles:
+ * HDF5 dataspaces describe the \Emph{shape} of datasets in memory or in HDF5
+ * files. Dataspaces can be empty (#H5S_NULL), a singleton (#H5S_SCALAR), or
+ * a multi-dimensional, regular grid (#H5S_SIMPLE). Dataspaces can be re-shaped.
*
- * \li It contains the spatial information (logical layout) of a
- * dataset stored in a file.
- * \li It describes an application’s data buffers and data elements
- * participating in I/O. In other words, it can be used to
- * select a portion or subset of a dataset.
+ * Subsets of dataspaces can be "book-marked" or used to restrict I/O operations
+ * using \Emph{selections}. Furthermore, certain set operations are supported
+ * for selections.
*
- * The spatial information of a dataset in a file includes the
- * rank and dimensions of the dataset, which are a permanent part
- * of the dataset definition. It can have dimensions that are fixed
- * (unchanging) or unlimited, which means they can grow in size
- * (or are extendible).
- *
- * A dataspace can consist of:
- * \li no elements (NULL)
- * \li a single element (scalar), or
- * \li a simple array.
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5S_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5S_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5S_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5S_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
*/
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 9a38aaa..b626b77 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -685,7 +685,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
rank = sel_iter.u.hyp.iter_rank;
#ifdef H5S_DEBUG
if (H5DEBUG(S))
- HDfprintf(H5DEBUG(S), "%s: Flattened selection\n", FUNC);
+ HDfprintf(H5DEBUG(S), "%s: Flattened selection\n", __func__);
#endif
for (u = 0; u < rank; ++u) {
H5_CHECK_OVERFLOW(diminfo[u].start, hsize_t, hssize_t)
@@ -700,7 +700,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
HDfprintf(H5DEBUG(S),
"%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE
" block=%" PRIuHSIZE " xtent=%" PRIuHSIZE,
- FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
+ __func__, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
if (u == 0)
HDfprintf(H5DEBUG(S), " rank=%u\n", rank);
else
@@ -719,7 +719,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
rank = space->extent.rank;
#ifdef H5S_DEBUG
if (H5DEBUG(S))
- HDfprintf(H5DEBUG(S), "%s: Non-flattened selection\n", FUNC);
+ HDfprintf(H5DEBUG(S), "%s: Non-flattened selection\n", __func__);
#endif
for (u = 0; u < rank; ++u) {
H5_CHECK_OVERFLOW(diminfo[u].start, hsize_t, hssize_t)
@@ -734,7 +734,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
HDfprintf(H5DEBUG(S),
"%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE
" block=%" PRIuHSIZE " xtent=%" PRIuHSIZE,
- FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
+ __func__, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
if (u == 0)
HDfprintf(H5DEBUG(S), " rank=%u\n", rank);
else
@@ -783,7 +783,7 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
*******************************************************/
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
- HDfprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", FUNC, elmt_size);
+ HDfprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", __func__, elmt_size);
for (i = ((int)rank) - 1; i >= 0; --i)
HDfprintf(H5DEBUG(S), "d[%d].xtent=%" PRIuHSIZE "\n", i, d[i].xtent);
}
@@ -817,12 +817,12 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
"%s: Dimension i=%d \n"
"start=%" PRIdHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " stride=%" PRIuHSIZE
", xtent=%" PRIuHSIZE " max_xtent=%" PRIuHSIZE "\n",
- FUNC, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]);
+ __func__, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]);
#endif
#ifdef H5S_DEBUG
if (H5DEBUG(S))
- HDfprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", FUNC, i);
+ HDfprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", __func__, i);
#endif
/****************************************
* Build vector type of the selection.
@@ -957,7 +957,7 @@ done:
#ifdef H5S_DEBUG
if (H5DEBUG(S))
- HDfprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", FUNC, *count,
+ HDfprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", __func__, *count,
(*is_derived_type) ? "TRUE" : "FALSE");
#endif
FUNC_LEAVE_NOAPI(ret_value)
@@ -1014,8 +1014,7 @@ H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *ne
elmt_type_is_derived = TRUE;
/* Compute 'down' sizes for each dimension */
- if (H5VM_array_down(space->extent.rank, space->extent.size, down) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGETSIZE, FAIL, "couldn't compute 'down' dimension sizes")
+ H5VM_array_down(space->extent.rank, space->extent.size, down);
/* Acquire an operation generation value for creating MPI datatypes */
op_gen = H5S__hyper_get_op_gen();
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index 33d1ede..c89b616 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -12,12 +12,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol
- * Thursday, September 28, 2000
+ * Programmer: Quincey Koziol
+ * Thursday, September 28, 2000
*
- * Purpose: This file contains declarations which are visible only within
- * the H5S package. Source files outside the H5S package should
- * include H5Sprivate.h instead.
+ * Purpose: This file contains declarations which are visible only within
+ * the H5S package. Source files outside the H5S package should
+ * include H5Sprivate.h instead.
*/
#if !(defined H5S_FRIEND || defined H5S_MODULE)
#error "Do not include this file outside the H5S package!"
@@ -420,4 +420,4 @@ H5_DLL herr_t H5S__get_diminfo_status_test(hid_t space_id, H5S_diminfo_valid_t *
H5_DLL htri_t H5S__internal_consistency_test(hid_t space_id);
#endif /* H5S_TESTING */
-#endif /*_H5Spkg_H*/
+#endif /*H5Spkg_H*/
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 56c1646..51a98a6 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -217,7 +217,6 @@ H5_DLL htri_t H5S_set_extent(H5S_t *space, const hsize_t *size);
H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size);
H5_DLL herr_t H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, const hsize_t *max);
H5_DLL H5S_t *H5S_create(H5S_class_t type);
-H5_DLL herr_t H5S_get_validated_dataspace(hid_t space_id, const H5S_t **space /*out*/);
H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/*rank*/]);
H5_DLL herr_t H5S_set_version(H5F_t *f, H5S_t *ds);
H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc);
diff --git a/src/H5Spublic.h b/src/H5Spublic.h
index 5037e0a..30ca813 100644
--- a/src/H5Spublic.h
+++ b/src/H5Spublic.h
@@ -21,99 +21,106 @@
#include "H5public.h"
#include "H5Ipublic.h"
-/* Define atomic datatypes */
-#define H5S_ALL (hid_t)0
-#define H5S_UNLIMITED HSIZE_UNDEF
+/* Define special dataspaces for dataset I/O operations */
+#define H5S_ALL 0 /* (hid_t) */
+#define H5S_BLOCK 1 /* (hid_t) */
+#define H5S_PLIST 2 /* (hid_t) */
-/* Define user-level maximum number of dimensions */
+#define H5S_UNLIMITED HSIZE_UNDEF /**< Value for 'unlimited' dimensions */
+
+/**
+ * The maximum dataspace rank or number of dimensions
+ */
#define H5S_MAX_RANK 32
/* Flags for selection iterators */
#define H5S_SEL_ITER_GET_SEQ_LIST_SORTED \
- 0x0001 /* Retrieve elements from iterator \
- * in increasing offset order, for \
- * each call to retrieve sequences. \
- * Currently, this only applies to \
- * point selections, as hyperslab \
- * selections are always returned \
- * in increasing offset order. \
- * \
- * Note that the order is only \
- * increasing for each call to \
- * get_seq_list, the next set of \
- * sequences could start with an \
- * earlier offset than the previous \
- * one. \
+ 0x0001 /**< Retrieve elements from iterator in increasing offset order, for \
+ * each call to retrieve sequences. Currently, this only applies to \
+ * point selections, as hyperslab selections are always returned in \
+ * increasing offset order. Note that the order is only increasing \
+ * for each call to H5Sget_seq_list(), the next set of sequences \
+ * could start with an earlier offset than the previous one. \
*/
#define H5S_SEL_ITER_SHARE_WITH_DATASPACE \
- 0x0002 /* Don't copy the dataspace \
- * selection when creating the \
- * selection iterator. \
- * \
- * This can improve performance \
- * of creating the iterator, but \
- * the dataspace _MUST_NOT_ be \
- * modified or closed until the \
- * selection iterator is closed \
- * or the iterator's behavior \
- * will be undefined. \
+ 0x0002 /**< Don't copy the dataspace selection when creating the selection \
+ * iterator. This can improve performance of creating the iterator, \
+ * but the dataspace \Bold{MUST NOT} be modified or closed until the \
+ * selection iterator is closed or the iterator's behavior will be \
+ * undefined. \
*/
-/* Different types of dataspaces */
+/**
+ * Types of dataspaces
+ */
typedef enum H5S_class_t {
- H5S_NO_CLASS = -1, /*error */
- H5S_SCALAR = 0, /*scalar variable */
- H5S_SIMPLE = 1, /*simple dataspace */
- H5S_NULL = 2 /*null dataspace */
+ H5S_NO_CLASS = -1, /**< Error */
+ H5S_SCALAR = 0, /**< Singleton (scalar) */
+ H5S_SIMPLE = 1, /**< Regular grid */
+ H5S_NULL = 2 /**< Empty set */
} H5S_class_t;
-/* Different ways of combining selections */
+/**
+ * Different ways of combining selections
+ */
typedef enum H5S_seloper_t {
- H5S_SELECT_NOOP = -1, /* error */
- H5S_SELECT_SET = 0, /* Select "set" operation */
- H5S_SELECT_OR, /* Binary "or" operation for hyperslabs
+ H5S_SELECT_NOOP = -1, /**< Error */
+ H5S_SELECT_SET = 0, /**< Select "set" operation */
+ H5S_SELECT_OR, /**< Binary "or" operation for hyperslabs
* (add new selection to existing selection)
+ * \code
* Original region: AAAAAAAAAA
* New region: BBBBBBBBBB
* A or B: CCCCCCCCCCCCCCCC
+ * \endcode
*/
- H5S_SELECT_AND, /* Binary "and" operation for hyperslabs
+ H5S_SELECT_AND, /**< Binary "and" operation for hyperslabs
* (only leave overlapped regions in selection)
+ * \code
* Original region: AAAAAAAAAA
* New region: BBBBBBBBBB
* A and B: CCCC
+ * \endcode
*/
- H5S_SELECT_XOR, /* Binary "xor" operation for hyperslabs
+ H5S_SELECT_XOR, /**< Binary "xor" operation for hyperslabs
* (only leave non-overlapped regions in selection)
+ * \code
* Original region: AAAAAAAAAA
* New region: BBBBBBBBBB
* A xor B: CCCCCC CCCCCC
+ * \endcode
*/
- H5S_SELECT_NOTB, /* Binary "not" operation for hyperslabs
+ H5S_SELECT_NOTB, /**< Binary "not" operation for hyperslabs
* (only leave non-overlapped regions in original selection)
+ * \code
* Original region: AAAAAAAAAA
* New region: BBBBBBBBBB
* A not B: CCCCCC
+ * \endcode
*/
- H5S_SELECT_NOTA, /* Binary "not" operation for hyperslabs
+ H5S_SELECT_NOTA, /**< Binary "not" operation for hyperslabs
* (only leave non-overlapped regions in new selection)
+ * \code
* Original region: AAAAAAAAAA
* New region: BBBBBBBBBB
* B not A: CCCCCC
+ * \endcode
*/
- H5S_SELECT_APPEND, /* Append elements to end of point selection */
- H5S_SELECT_PREPEND, /* Prepend elements to beginning of point selection */
- H5S_SELECT_INVALID /* Invalid upper bound on selection operations */
+ H5S_SELECT_APPEND, /**< Append elements to end of point selection */
+ H5S_SELECT_PREPEND, /**< Prepend elements to beginning of point selection */
+ H5S_SELECT_INVALID /**< Invalid upper bound on selection operations */
} H5S_seloper_t;
-/* Enumerated type for the type of selection */
+/**
+ * Selection type
+ */
typedef enum {
- H5S_SEL_ERROR = -1, /* Error */
- H5S_SEL_NONE = 0, /* Nothing selected */
- H5S_SEL_POINTS = 1, /* Points / elements selected */
- H5S_SEL_HYPERSLABS = 2, /* Hyperslab selected */
- H5S_SEL_ALL = 3, /* Entire extent selected */
- H5S_SEL_N /*THIS MUST BE LAST */
+ H5S_SEL_ERROR = -1, /**< Error */
+ H5S_SEL_NONE = 0, /**< Empty selection */
+ H5S_SEL_POINTS = 1, /**< Set of points */
+ H5S_SEL_HYPERSLABS = 2, /**< Hyperslab */
+ H5S_SEL_ALL = 3, /**< Everything */
+ H5S_SEL_N /**< Sentinel \internal THIS MUST BE LAST */
} H5S_sel_type;
#ifdef __cplusplus
@@ -364,10 +371,8 @@ H5_DLL hid_t H5Sdecode(const void *buf);
*
* \note Motivation: This function was introduced in HDF5-1.12 as part of the
* H5Sencode() format change to enable 64-bit selection encodings and
- * a dataspace selection that is tied to a file. See the New Features
- * in HDF5 Release 1.12 as well as the H5Sencode() / H5Sdecode() Format Change RFC.
- *
- * \todo Fix the references.
+ * a dataspace selection that is tied to a file. See the \ref_news_112
+ * as well as the \ref_sencode_fmt_change.
*
* \since 1.12.0
*
@@ -1069,7 +1074,7 @@ H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id);
* buffer as:
* \n 0 0 0 0 13 5 11 17 7 21 29 21
*
- * \version 1.6.4 C coord parameter type changed to \p const #hsize_t.
+ * \version 1.6.4 C coord parameter type changed to \p const hsize_t.
* \version 1.6.4 Fortran \p coord parameter type changed to \p INTEGER(HSIZE_T).
* \since 1.0.0
*
@@ -1316,9 +1321,6 @@ H5_DLL herr_t H5Sset_extent_none(hid_t space_id);
* \details H5Sset_extent_simple() sets or resets the size of an existing
* dataspace.
*
- * \p rank is the dimensionality, or number of dimensions, of the
- * dataspace.
- *
* \p dims is an array of size \p rank which contains the new size
* of each dimension in the dataspace. \p max is an array of size
* \p rank which contains the maximum size of each dimension in
@@ -1327,10 +1329,6 @@ H5_DLL herr_t H5Sset_extent_none(hid_t space_id);
* Any previous extent is removed from the dataspace, the dataspace
* type is set to #H5S_SIMPLE, and the extent is set as specified.
*
- * Note that a dataset must be chunked if \p dims does not equal
- * \p max.
- *
- *
* \version 1.4.0 Fortran subroutine was introduced.
* \since 1.0.0
*
diff --git a/src/H5T.c b/src/H5T.c
index d736d64..19a3d39 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -290,7 +290,7 @@
#define H5T_INIT_TYPE_SET_SIZE(SIZE) \
{ \
dt->shared->size = SIZE; \
- dt->shared->u.atomic.prec = 8 * SIZE; \
+ dt->shared->u.atomic.prec = 8 * (SIZE); \
}
#define H5T_INIT_TYPE_NOSET_SIZE(SIZE) \
@@ -327,7 +327,7 @@
H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \
\
/* Register result */ \
- if ((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \
+ if (((GLOBAL) = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") \
}
@@ -560,10 +560,10 @@ size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0;
/* Useful floating-point values for conversion routines */
/* (+/- Inf for all floating-point types) */
-float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f;
-float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f;
-double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f;
-double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f;
+float H5T_NATIVE_FLOAT_POS_INF_g = 0.0F;
+float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0F;
+double H5T_NATIVE_DOUBLE_POS_INF_g = 0.0;
+double H5T_NATIVE_DOUBLE_NEG_INF_g = 0.0;
/* Declare the free list for H5T_t's and H5T_shared_t's */
H5FL_DEFINE(H5T_t);
@@ -1512,7 +1512,8 @@ H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata)
FUNC_ENTER_STATIC_NOERR
- HDassert(dt && dt->shared);
+ HDassert(dt);
+ HDassert(dt->shared);
if (H5T_STATE_IMMUTABLE == dt->shared->state) {
dt->shared->state = H5T_STATE_RDONLY;
@@ -1891,19 +1892,24 @@ H5Tcopy(hid_t obj_id)
break;
case H5I_DATASET: {
- H5VL_object_t *vol_obj = NULL; /* Dataset structure */
+ H5VL_object_t * vol_obj; /* Object for obj_id */
+ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */
/* The argument is a dataset handle */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(obj_id, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "type_id is not a dataset ID")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATASET_GET_TYPE;
+ vol_cb_args.args.get_type.type_id = H5I_INVALID_HID;
+
/* Get the datatype from the dataset
* NOTE: This will have to be closed after we're done with it.
*/
- if (H5VL_dataset_get(vol_obj, H5VL_DATASET_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &dset_tid) < 0)
+ if (H5VL_dataset_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID,
"unable to get datatype from the dataset")
+ dset_tid = vol_cb_args.args.get_type.type_id;
/* Unwrap the type ID */
if (NULL == (dt = (H5T_t *)H5I_object(dset_tid)))
@@ -2039,7 +2045,7 @@ H5Tclose_async(const char *app_file, const char *app_func, unsigned app_line, hi
/* If a token was created, add the token to the event set */
if (NULL != token)
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, type_id, es_id)) < 0)
+ H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, type_id, es_id)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert token into event set")
done:
@@ -2834,7 +2840,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c
for (i = H5T_g.nsoft - 1; i >= 0; --i) {
soft = H5T_g.soft + i;
HDassert(soft);
- if (name && *name && HDstrcmp(name, soft->name))
+ if (name && *name && HDstrcmp(name, soft->name) != 0)
continue;
if (src && src->shared->type != soft->src)
continue;
@@ -2856,7 +2862,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c
/* Not a match */
if (((H5T_PERS_SOFT == pers && path->is_hard) || (H5T_PERS_HARD == pers && !path->is_hard)) ||
- (name && *name && HDstrcmp(name, path->name)) || (src && H5T_cmp(src, path->src, FALSE)) ||
+ (name && *name && HDstrcmp(name, path->name) != 0) || (src && H5T_cmp(src, path->src, FALSE)) ||
(dst && H5T_cmp(dst, path->dst, FALSE)) || (func && func != path->conv.u.app_func)) {
/*
* Notify all other functions to recalculate private data since some
diff --git a/src/H5TS.c b/src/H5TS.c
index 90b1244..258c9df 100644
--- a/src/H5TS.c
+++ b/src/H5TS.c
@@ -12,13 +12,13 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Purpose: This file contains the framework for ensuring that the global
- * library lock is held when an API routine is called. This
+ * Purpose: This file contains the framework for ensuring that the global
+ * library lock is held when an API routine is called. This
* framework works in concert with the FUNC_ENTER_API / FUNC_LEAVE_API
- * macros defined in H5private.h.
+ * macros defined in H5private.h.
*
- * Note: Because this threadsafety framework operates outside the library,
- * it does not use the error stack and only uses the "namecheck only"
+ * Note: Because this threadsafety framework operates outside the library,
+ * it does not use the error stack and only uses the "namecheck only"
* FUNC_ENTER_* / FUNC_LEAVE_* macros.
*/
@@ -70,23 +70,45 @@ static herr_t H5TS__mutex_unlock(H5TS_mutex_t *mutex, unsigned int *lock_count);
/* Global variable definitions */
#ifdef H5_HAVE_WIN_THREADS
H5TS_once_t H5TS_first_init_g;
-#else /* H5_HAVE_WIN_THREADS */
-H5TS_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT;
-#endif /* H5_HAVE_WIN_THREADS */
+#else
+H5TS_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT;
+#endif
/* Thread-local keys, used by other interfaces */
-H5TS_key_t H5TS_errstk_key_g; /* Error stack */
+/* Error stack */
+#ifdef H5_HAVE_WIN_THREADS
+H5TS_key_t H5TS_errstk_key_g = TLS_OUT_OF_INDEXES;
+#else
+H5TS_key_t H5TS_errstk_key_g;
+#endif
+
#ifdef H5_HAVE_CODESTACK
-H5TS_key_t H5TS_funcstk_key_g; /* Function stack */
-#endif /* H5_HAVE_CODESTACK */
-H5TS_key_t H5TS_apictx_key_g; /* API context */
+/* Function stack */
+#ifdef H5_HAVE_WIN_THREADS
+H5TS_key_t H5TS_funcstk_key_g = TLS_OUT_OF_INDEXES;
+#else
+H5TS_key_t H5TS_funcstk_key_g;
+#endif
+#endif /* H5_HAVE_CODESTACK */
+
+/* API context */
+#ifdef H5_HAVE_WIN_THREADS
+H5TS_key_t H5TS_apictx_key_g = TLS_OUT_OF_INDEXES;
+#else
+H5TS_key_t H5TS_apictx_key_g;
+#endif
/*******************/
/* Local Variables */
/*******************/
/* Thread-local keys, used in this module */
-static H5TS_key_t H5TS_cancel_key_s; /* Thread cancellation state */
+/* Thread cancellation state */
+#ifdef H5_HAVE_WIN_THREADS
+static H5TS_key_t H5TS_cancel_key_s = TLS_OUT_OF_INDEXES;
+#else
+static H5TS_key_t H5TS_cancel_key_s;
+#endif
#ifndef H5_HAVE_WIN_THREADS
@@ -871,11 +893,14 @@ H5TS_win32_process_exit(void)
DeleteCriticalSection(&H5_g.init_lock.CriticalSection);
/* Clean up per-process thread local storage */
- TlsFree(H5TS_errstk_key_g);
+ if (H5TS_errstk_key_g != TLS_OUT_OF_INDEXES)
+ TlsFree(H5TS_errstk_key_g);
#ifdef H5_HAVE_CODESTACK
- TlsFree(H5TS_funcstk_key_g);
+ if (H5TS_funcstk_key_g != TLS_OUT_OF_INDEXES)
+ TlsFree(H5TS_funcstk_key_g);
#endif /* H5_HAVE_CODESTACK */
- TlsFree(H5TS_apictx_key_g);
+ if (H5TS_apictx_key_g != TLS_OUT_OF_INDEXES)
+ TlsFree(H5TS_apictx_key_g);
FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY
} /* H5TS_win32_process_exit() */
@@ -909,19 +934,25 @@ H5TS_win32_thread_exit(void)
*/
/* Clean up per-thread thread local storage */
- lpvData = TlsGetValue(H5TS_errstk_key_g);
- if (lpvData)
- LocalFree((HLOCAL)lpvData);
+ if (H5TS_errstk_key_g != TLS_OUT_OF_INDEXES) {
+ lpvData = TlsGetValue(H5TS_errstk_key_g);
+ if (lpvData)
+ LocalFree((HLOCAL)lpvData);
+ }
#ifdef H5_HAVE_CODESTACK
- lpvData = TlsGetValue(H5TS_funcstk_key_g);
- if (lpvData)
- LocalFree((HLOCAL)lpvData);
+ if (H5TS_funcstk_key_g != TLS_OUT_OF_INDEXES) {
+ lpvData = TlsGetValue(H5TS_funcstk_key_g);
+ if (lpvData)
+ LocalFree((HLOCAL)lpvData);
+ }
#endif /* H5_HAVE_CODESTACK */
- lpvData = TlsGetValue(H5TS_apictx_key_g);
- if (lpvData)
- LocalFree((HLOCAL)lpvData);
+ if (H5TS_apictx_key_g != TLS_OUT_OF_INDEXES) {
+ lpvData = TlsGetValue(H5TS_apictx_key_g);
+ if (lpvData)
+ LocalFree((HLOCAL)lpvData);
+ }
FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value)
} /* H5TS_win32_thread_exit() */
diff --git a/src/H5TSpublic.h b/src/H5TSdevelop.h
index 41213f9..9e8f718 100644
--- a/src/H5TSpublic.h
+++ b/src/H5TSdevelop.h
@@ -2,7 +2,7 @@
* Copyright by The HDF Group. *
* All rights reserved. *
* *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
@@ -11,14 +11,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * This file contains public declarations for the H5TS (threadsafety) module.
+ * This file contains public declarations for the H5TS (threadsafety) developer
+ * support routines.
*/
-#ifndef H5TSpublic_H
-#define H5TSpublic_H
-
-/* Public headers needed by this file */
-#include "H5public.h" /* Generic Functions */
+#ifndef H5TSdevelop_H
+#define H5TSdevelop_H
/*****************/
/* Public Macros */
@@ -49,4 +47,4 @@ H5_DLL herr_t H5TSmutex_get_attempt_count(unsigned int *count);
}
#endif
-#endif /* H5TSpublic_H */
+#endif /* H5TSdevelop_H */
diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h
index 6f9f1c0..3150f59 100644
--- a/src/H5TSprivate.h
+++ b/src/H5TSprivate.h
@@ -25,8 +25,8 @@
#define H5TSprivate_H_
#ifdef H5_HAVE_THREADSAFE
-/* Public headers needed by this file */
-#include "H5TSpublic.h" /* Public API prototypes */
+/* Include package's public headers */
+#include "H5TSdevelop.h"
#ifdef H5_HAVE_WIN_THREADS
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index c35a530..04e2a97 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -228,10 +228,7 @@ done:
* Purpose: Return a small bit sequence as a number. Bit vector starts
* at OFFSET and is SIZE bits long.
*
- * Return: Success: The bit sequence interpretted as an unsigned
- * integer.
- *
- * Failure: 0
+ * Return: The bit sequence interpretted as an unsigned integer
*
*-------------------------------------------------------------------------
*/
@@ -264,14 +261,13 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size)
case H5T_ORDER_NONE:
case H5T_ORDER_MIXED:
default:
- /* Unknown endianness. Bail out. */
- HGOTO_DONE(UFAIL)
+ /* This function can't return errors */
+ HDassert(0 && "unknown byte order");
}
/* Set return value */
ret_value = val;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__bit_get_d() */
@@ -388,7 +384,7 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value)
*-------------------------------------------------------------------------
*/
ssize_t
-H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value)
+H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value)
{
ssize_t base = (ssize_t)offset;
ssize_t idx, i;
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index d214ca1..d079e71 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -218,7 +218,7 @@ H5Tcommit_async(const char *app_file, const char *app_func, unsigned app_line, h
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE10(FUNC, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id, es_id)) < 0)
+ H5ARG_TRACE10(__func__, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id, es_id)) < 0)
/* clang-format on */
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert token into event set")
@@ -726,7 +726,7 @@ H5Topen_async(const char *app_file, const char *app_func, unsigned app_line, hid
if (NULL != token)
/* clang-format off */
if (H5ES_insert(es_id, vol_obj->connector, token,
- H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, tapl_id, es_id)) < 0) {
+ H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, tapl_id, es_id)) < 0) {
/* clang-format on */
if (H5I_dec_app_ref_always_close(ret_value) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, H5I_INVALID_HID,
@@ -790,12 +790,19 @@ H5Tget_create_plist(hid_t dtype_id)
} /* end if */
/* If the datatype is committed, retrieve further information */
else {
- H5VL_object_t *vol_obj = type->vol_obj;
+ H5VL_object_t * vol_obj = type->vol_obj;
+ H5VL_datatype_get_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATATYPE_GET_TCPL;
+ vol_cb_args.args.get_tcpl.tcpl_id = H5I_INVALID_HID;
/* Get the property list through the VOL */
- if (H5VL_datatype_get(vol_obj, H5VL_DATATYPE_GET_TCPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &ret_value) < 0)
+ if (H5VL_datatype_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info")
+
+ /* Set return value */
+ ret_value = vol_cb_args.args.get_tcpl.tcpl_id;
} /* end else */
done:
@@ -829,15 +836,21 @@ H5Tflush(hid_t type_id)
if (!H5T_is_named(dt))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype")
- /* Set up collective metadata if appropriate */
- if (H5CX_set_loc(type_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
-
/* Flush metadata for named datatype */
- if (dt->vol_obj)
- if (H5VL_datatype_specific(dt->vol_obj, H5VL_DATATYPE_FLUSH, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, type_id) < 0)
+ if (dt->vol_obj) {
+ H5VL_datatype_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up collective metadata if appropriate */
+ if (H5CX_set_loc(type_id) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATATYPE_FLUSH;
+ vol_cb_args.args.flush.type_id = type_id;
+
+ if (H5VL_datatype_specific(dt->vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype")
+ }
done:
FUNC_LEAVE_API(ret_value)
@@ -870,15 +883,21 @@ H5Trefresh(hid_t type_id)
if (!H5T_is_named(dt))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype")
- /* Set up collective metadata if appropriate */
- if (H5CX_set_loc(type_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
-
/* Refresh the datatype's metadata */
- if (dt->vol_obj)
- if (H5VL_datatype_specific(dt->vol_obj, H5VL_DATATYPE_REFRESH, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, type_id) < 0)
+ if (dt->vol_obj) {
+ H5VL_datatype_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up collective metadata if appropriate */
+ if (H5CX_set_loc(type_id) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATATYPE_REFRESH;
+ vol_cb_args.args.refresh.type_id = type_id;
+
+ if (H5VL_datatype_specific(dt->vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype")
+ }
done:
FUNC_LEAVE_API(ret_value)
@@ -1222,32 +1241,41 @@ H5T_update_shared(H5T_t *dt)
H5T_t *
H5T_construct_datatype(H5VL_object_t *vol_obj)
{
- ssize_t nalloc;
- void * buf = NULL;
- H5T_t * dt = NULL; /* datatype object from VOL connector */
- H5T_t * ret_value = NULL;
+ H5T_t * dt = NULL; /* Datatype object from VOL connector */
+ H5VL_datatype_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ size_t nalloc = 0; /* Size required to store serialized form of datatype */
+ void * buf = NULL; /* Buffer to store serialized datatype */
+ H5T_t * ret_value = NULL;
FUNC_ENTER_NOAPI(NULL)
- /* get required buf size for encoding the datatype */
- if (H5VL_datatype_get(vol_obj, H5VL_DATATYPE_GET_BINARY, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &nalloc, NULL, 0) < 0)
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATATYPE_GET_BINARY_SIZE;
+ vol_cb_args.args.get_binary_size.size = &nalloc;
+
+ /* Get required buf size for encoding the datatype */
+ if (H5VL_datatype_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get datatype serialized size")
- /* allocate buffer to store binary description of the datatype */
- if (NULL == (buf = (void *)H5MM_calloc((size_t)nalloc)))
+ /* Allocate buffer to store binary description of the datatype */
+ if (NULL == (buf = (void *)H5MM_calloc(nalloc)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_DATATYPE_GET_BINARY;
+ vol_cb_args.args.get_binary.buf = buf;
+ vol_cb_args.args.get_binary.buf_size = nalloc;
+
/* get binary description of the datatype */
- if (H5VL_datatype_get(vol_obj, H5VL_DATATYPE_GET_BINARY, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &nalloc, buf, (size_t)nalloc) < 0)
+ if (H5VL_datatype_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to get serialized datatype")
- if (NULL == (dt = H5T_decode((size_t)nalloc, (const unsigned char *)buf)))
+ /* Construct datatype, from serialized form in buffer */
+ if (NULL == (dt = H5T_decode(nalloc, buf)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "can't decode datatype")
-
dt->vol_obj = vol_obj;
+ /* Set return value */
ret_value = dt;
done:
@@ -1407,3 +1435,34 @@ H5T_already_vol_managed(const H5T_t *dt)
FUNC_LEAVE_NOAPI(dt->vol_obj != NULL)
} /* end H5T_already_vol_managed() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5T_invoke_vol_optional
+ *
+ * Purpose: Invokes an optional VOL connector-specific operation on a named datatype
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5T_invoke_vol_optional(H5T_t *dt, H5VL_optional_args_t *args, hid_t dxpl_id, void **req,
+ H5VL_object_t **vol_obj_ptr)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check that datatype is committed */
+ if (!H5T_is_named(dt))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a committed datatype")
+
+ /* Only invoke callback if VOL object is set for the datatype */
+ if (dt->vol_obj)
+ if (H5VL_datatype_optional_op(dt->vol_obj, args, dxpl_id, req, vol_obj_ptr) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5T_invoke_vol_optional() */
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 60ad627..18cbcf1 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1668,7 +1668,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
size_t olap; /*num overlapping elements */
size_t half_size; /*1/2 of total size for swapping*/
uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/
- uint8_t dbuf[256]; /*temp destination buffer */
+ uint8_t dbuf[256] = {0}; /*temp destination buffer */
size_t msb_pad_offset; /*offset for dest MSB padding */
size_t i;
uint8_t * src_rev = NULL; /*order-reversed source buffer */
@@ -2699,7 +2699,7 @@ H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
for (i = 0, j = 0; i < src->shared->u.enumer.nmembs && j < dst->shared->u.enumer.nmembs; i++, j++) {
while (j < dst->shared->u.enumer.nmembs &&
- HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]))
+ HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]) != 0)
j++;
if (j >= dst->shared->u.enumer.nmembs)
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
@@ -3843,8 +3843,8 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
size_t half_size; /*half the type size */
size_t olap; /*num overlapping elements */
uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/
- uint8_t * src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t * src_rev = NULL; /*order-reversed source buffer */
+ uint8_t dbuf[64] = {0}; /*temp destination buffer */
size_t first;
ssize_t sfirst; /*a signed version of `first' */
size_t i; /*Local index variables */
@@ -4286,8 +4286,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
size_t olap; /*num overlapping elements */
ssize_t bitno = 0; /*bit number */
uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/
- uint8_t * src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t * src_rev = NULL; /*order-reversed source buffer */
+ uint8_t dbuf[64] = {0}; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
@@ -4947,7 +4947,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size);
/* Allocate the overlap buffer */
- if (NULL == (dbuf = (uint8_t *)H5MM_malloc(dst->shared->size)))
+ if (NULL == (dbuf = (uint8_t *)H5MM_calloc(dst->shared->size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion")
/* The conversion loop. */
@@ -7725,9 +7725,9 @@ herr_t
H5T__conv_float_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7747,9 +7747,9 @@ herr_t
H5T__conv_float_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7769,9 +7769,9 @@ herr_t
H5T__conv_double_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7791,9 +7791,9 @@ herr_t
H5T__conv_double_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7813,9 +7813,9 @@ herr_t
H5T__conv_ldouble_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7835,9 +7835,9 @@ herr_t
H5T__conv_ldouble_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7857,9 +7857,9 @@ herr_t
H5T__conv_float_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7879,9 +7879,9 @@ herr_t
H5T__conv_float_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7901,9 +7901,9 @@ herr_t
H5T__conv_double_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7923,9 +7923,9 @@ herr_t
H5T__conv_double_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7945,9 +7945,9 @@ herr_t
H5T__conv_ldouble_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7967,9 +7967,9 @@ herr_t
H5T__conv_ldouble_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -7989,9 +7989,9 @@ herr_t
H5T__conv_float_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8011,9 +8011,9 @@ herr_t
H5T__conv_float_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8033,9 +8033,9 @@ herr_t
H5T__conv_double_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8055,9 +8055,9 @@ herr_t
H5T__conv_double_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8077,9 +8077,9 @@ herr_t
H5T__conv_ldouble_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8099,9 +8099,9 @@ herr_t
H5T__conv_ldouble_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8121,9 +8121,9 @@ herr_t
H5T__conv_float_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8143,9 +8143,9 @@ herr_t
H5T__conv_float_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8165,9 +8165,9 @@ herr_t
H5T__conv_double_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8187,9 +8187,9 @@ herr_t
H5T__conv_double_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8209,9 +8209,9 @@ herr_t
H5T__conv_ldouble_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8231,9 +8231,9 @@ herr_t
H5T__conv_ldouble_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8253,9 +8253,9 @@ herr_t
H5T__conv_float_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8275,9 +8275,9 @@ herr_t
H5T__conv_float_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8297,9 +8297,9 @@ herr_t
H5T__conv_double_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8319,9 +8319,9 @@ herr_t
H5T__conv_double_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
/*-------------------------------------------------------------------------
@@ -8342,9 +8342,9 @@ herr_t
H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
#endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/
@@ -8366,9 +8366,9 @@ herr_t
H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg)
{
- H5_GCC_DIAG_OFF("float-equal")
+ H5_GCC_CLANG_DIAG_OFF("float-equal")
H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX);
- H5_GCC_DIAG_ON("float-equal")
+ H5_GCC_CLANG_DIAG_ON("float-equal")
}
#endif /*H5T_CONV_INTERNAL_LDOUBLE_ULLONG*/
@@ -8401,8 +8401,8 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
size_t tsize; /*type size for swapping bytes */
size_t olap; /*num overlapping elements */
uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/
- uint8_t * src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t * src_rev = NULL; /*order-reversed source buffer */
+ uint8_t dbuf[64] = {0}; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
@@ -8477,7 +8477,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
/* Allocate enough space for the buffer holding temporary
* converted value
*/
- buf_size = (size_t)(HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1);
+ buf_size = (size_t)(HDpow(2.0, (double)src.u.f.esize) / 8 + 1);
int_buf = (uint8_t *)H5MM_calloc(buf_size);
/* Get conversion exception callback property */
@@ -9027,8 +9027,8 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
size_t tsize; /*type size for swapping bytes */
size_t olap; /*num overlapping elements */
uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/
- uint8_t * src_rev = NULL; /*order-reversed source buffer */
- uint8_t dbuf[64]; /*temp destination buffer */
+ uint8_t * src_rev = NULL; /*order-reversed source buffer */
+ uint8_t dbuf[64] = {0}; /*temp destination buffer */
uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/
/* Conversion-related variables */
@@ -9315,7 +9315,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
}
/* Check if the exponent is too big */
- expo_max = (hsize_t)(HDpow((double)2.0f, (double)dst.u.f.esize) - 1);
+ expo_max = (hsize_t)(HDpow(2.0, (double)dst.u.f.esize) - 1);
if (expo > expo_max) { /*overflows*/
if (cb_struct.func) { /*user's exception handler. Reverse back source order*/
diff --git a/src/H5Tdevelop.h b/src/H5Tdevelop.h
new file mode 100644
index 0000000..e642d7c
--- /dev/null
+++ b/src/H5Tdevelop.h
@@ -0,0 +1,227 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * This file contains public declarations for the H5T (datatype) developer
+ * support routines.
+ */
+
+#ifndef _H5Tdevelop_H
+#define _H5Tdevelop_H
+
+/* Include package's public header */
+#include "H5Tpublic.h"
+
+/*****************/
+/* Public Macros */
+/*****************/
+
+/*******************/
+/* Public Typedefs */
+/*******************/
+
+/**
+ * Commands sent to conversion functions
+ */
+typedef enum H5T_cmd_t {
+ H5T_CONV_INIT = 0, /**< query and/or initialize private data */
+ H5T_CONV_CONV = 1, /**< convert data from source to dest datatype */
+ H5T_CONV_FREE = 2 /**< function is being removed from path */
+} H5T_cmd_t;
+
+/**
+ * How is the `bkg' buffer used by the conversion function?
+ */
+typedef enum H5T_bkg_t {
+ H5T_BKG_NO = 0, /**< background buffer is not needed, send NULL */
+ H5T_BKG_TEMP = 1, /**< bkg buffer used as temp storage only */
+ H5T_BKG_YES = 2 /**< init bkg buf with data before conversion */
+} H5T_bkg_t;
+
+/**
+ * Type conversion client data
+ */
+//! <!-- [H5T_cdata_t_snip] -->
+typedef struct H5T_cdata_t {
+ H5T_cmd_t command; /**< what should the conversion function do? */
+ H5T_bkg_t need_bkg; /**< is the background buffer needed? */
+ hbool_t recalc; /**< recalculate private data */
+ void * priv; /**< private data */
+} H5T_cdata_t;
+//! <!-- [H5T_cdata_t_snip] -->
+
+/**
+ * Conversion function persistence
+ */
+typedef enum H5T_pers_t {
+ H5T_PERS_DONTCARE = -1, /**< wild card */
+ H5T_PERS_HARD = 0, /**< hard conversion function */
+ H5T_PERS_SOFT = 1 /**< soft conversion function */
+} H5T_pers_t;
+
+/**
+ * All datatype conversion functions are...
+ */
+//! <!-- [H5T_conv_t_snip] -->
+typedef herr_t (*H5T_conv_t)(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
+ size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist);
+//! <!-- [H5T_conv_t_snip] -->
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \ingroup CONV
+ *
+ * \brief Registers a datatype conversion function
+ *
+ * \param[in] pers Conversion function type
+ * \param[in] name Name displayed in diagnostic output
+ * \type_id{src_id} of source datatype
+ * \type_id{dst_id} of destination datatype
+ * \param[in] func Function to convert between source and destination datatypes
+ *
+ * \return \herr_t
+ *
+ * \details H5Tregister() registers a hard or soft conversion function for a
+ * datatype conversion path. The parameter \p pers indicates whether a
+ * conversion function is hard (#H5T_PERS_HARD) or soft
+ * (#H5T_PERS_SOFT). User-defined functions employing compiler casting
+ * are designated as \Emph{hard}; other user-defined conversion
+ * functions registered with the HDF5 library (with H5Tregister() )
+ * are designated as \Emph{soft}. The HDF5 library also has its own
+ * hard and soft conversion functions.
+ *
+ * A conversion path can have only one hard function. When type is
+ * #H5T_PERS_HARD, \p func replaces any previous hard function.
+ *
+ * When type is #H5T_PERS_SOFT, H5Tregister() adds the function to the
+ * end of the master soft list and replaces the soft function in all
+ * applicable existing conversion paths. Soft functions are used when
+ * determining which conversion function is appropriate for this path.
+ *
+ * The \p name is used only for debugging and should be a short
+ * identifier for the function.
+ *
+ * The path is specified by the source and destination datatypes \p
+ * src_id and \p dst_id. For soft conversion functions, only the class
+ * of these types is important.
+ *
+ * The type of the conversion function pointer is declared as:
+ * \snippet this H5T_conv_t_snip
+ *
+ * The \ref H5T_cdata_t \c struct is declared as:
+ * \snippet this H5T_cdata_t_snip
+ *
+ * \since 1.6.3 The following change occurred in the \ref H5T_conv_t function:
+ * the \c nelmts parameter type changed to size_t.
+ *
+ */
+H5_DLL herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func);
+/**
+ * \ingroup CONV
+ *
+ * \brief Removes a conversion function
+ *
+ * \param[in] pers Conversion function type
+ * \param[in] name Name displayed in diagnostic output
+ * \type_id{src_id} of source datatype
+ * \type_id{dst_id} of destination datatype
+ * \param[in] func Function to convert between source and destination datatypes
+ *
+ * \return \herr_t
+ *
+ * \details H5Tunregister() removes a conversion function matching criteria
+ * such as soft or hard conversion, source and destination types, and
+ * the conversion function.
+ *
+ * If a user is trying to remove a conversion function he registered,
+ * all parameters can be used. If he is trying to remove a library’s
+ * default conversion function, there is no guarantee the \p name and
+ * \p func parameters will match the user’s chosen values. Passing in
+ * some values may cause this function to fail. A good practice is to
+ * pass in NULL as their values.
+ *
+ * All parameters are optional. The missing parameters will be used to
+ * generalize the search criteria.
+ *
+ * The conversion function pointer type declaration is described in
+ * H5Tregister().
+ *
+ * \version 1.6.3 The following change occurred in the \ref H5T_conv_t function:
+ * the \c nelmts parameter type changed to size_t.
+ *
+ */
+H5_DLL herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func);
+/**
+ * \ingroup CONV
+ *
+ * \brief Finds a conversion function
+ *
+ * \type_id{src_id} of source datatype
+ * \type_id{dst_id} of destination datatype
+ * \param[out] pcdata Pointer to type conversion data
+ *
+ * \return Returns a pointer to a suitable conversion function if successful.
+ * Otherwise returns NULL.
+ *
+ * \details H5Tfind() finds a conversion function that can handle a conversion
+ * from type \p src_id to type \p dst_id. The \p pcdata argument is a
+ * pointer to a pointer to type conversion data which was created and
+ * initialized by the soft type conversion function of this path when
+ * the conversion function was installed on the path.
+ *
+ */
+H5_DLL H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata);
+/**
+ * \ingroup CONV
+ *
+ * \brief Check whether the library’s default conversion is hard conversion
+ *
+ * \type_id{src_id} of source datatype
+ * \type_id{dst_id} of destination datatype
+ *
+ * \return \htri_t
+ *
+ * \details H5Tcompiler_conv() determines whether the library’s conversion
+ * function from type \p src_id to type \p dst_id is a compiler (hard)
+ * conversion or not. A compiler conversion uses compiler’s casting; a
+ * library (soft) conversion uses the library’s own conversion
+ * function.
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Symbols defined for compatibility with previous versions of the HDF5 API.
+ *
+ * Use of these symbols is deprecated.
+ */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+#endif /* _H5Tdevelop_H */
diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h
index 4f9edde..73424fb 100644
--- a/src/H5Tmodule.h
+++ b/src/H5Tmodule.h
@@ -29,10 +29,38 @@
#define H5_MY_PKG_ERR H5E_DATATYPE
#define H5_MY_PKG_INIT YES
-/**
- * \defgroup H5T H5T
- * \brief Datatype Interface
- * \todo Describe concisely what the functions in this module are about.
+/**\defgroup H5T H5T
+ *
+ * Use the functions in this module to manage HDF5 datatypes.
+ *
+ * HDF5 datatypes describe the element type of HDF5 datasets and attributes.
+ * There's a large set of predefined datatypes, but users may find it useful
+ * to define new datatypes through a process called \Emph{derivation}.
+ *
+ * The element type is automatically persisted as part of the HDF5 metadata of
+ * attributes and datasets. Additionally, datatype definitions can be persisted
+ * to HDF5 files and linked to groups as HDF5 datatype objects or so-called
+ * \Emph{committed datatypes}.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5T_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5T_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5T_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5T_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
* \defgroup ARRAY Array Datatypes
* \ingroup H5T
@@ -44,12 +72,8 @@
* \ingroup H5T
* \defgroup ENUM Enumeration Datatypes
* \ingroup H5T
- * \defgroup GTO General Datatype Operations
- * \ingroup H5T
* \defgroup OPAQUE Opaque Datatypes
* \ingroup H5T
- * \defgroup STRING String Datatypes
- * \ingroup H5T
* \defgroup VLEN Variable-length Sequence Datatypes
* \ingroup H5T
*
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 0fe4f50..51ecaca 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -852,7 +852,8 @@ H5_DLL herr_t H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset,
H5_DLL void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value);
H5_DLL uint64_t H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size);
H5_DLL void H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val);
-H5_DLL ssize_t H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value);
+H5_DLL ssize_t H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction,
+ hbool_t value);
H5_DLL hbool_t H5T__bit_inc(uint8_t *buf, size_t start, size_t size);
H5_DLL hbool_t H5T__bit_dec(uint8_t *buf, size_t start, size_t size);
H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size);
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index 9ee0d04..6624096 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -20,8 +20,9 @@
/* Early typedefs to avoid circular dependencies */
typedef struct H5T_t H5T_t;
-/* Get package's public header */
+/* Include package's public headers */
#include "H5Tpublic.h"
+#include "H5Tdevelop.h"
/* Other public headers needed by this file */
#include "H5MMpublic.h" /* Memory management */
@@ -151,6 +152,8 @@ H5_DLL herr_t H5T_save_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O
H5_DLL herr_t H5T_restore_refresh_state(hid_t tid, struct H5O_shared_t *cached_H5O_shared);
H5_DLL hbool_t H5T_already_vol_managed(const H5T_t *dt);
H5_DLL htri_t H5T_is_vl_storage(const H5T_t *dt);
+H5_DLL herr_t H5T_invoke_vol_optional(H5T_t *dt, H5VL_optional_args_t *args, hid_t dxpl_id, void **req,
+ H5VL_object_t **vol_obj_ptr);
/* Reference specific functions */
H5_DLL H5R_type_t H5T_get_ref_type(const H5T_t *dt);
diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h
index 1457053..bb5b0ef 100644
--- a/src/H5Tpublic.h
+++ b/src/H5Tpublic.h
@@ -28,7 +28,7 @@
* internal If this goes over 16 types (0-15), the file format will need to
* change.
*/
-//! [H5T_class_t_snip]
+//! <!-- [H5T_class_t_snip] -->
typedef enum H5T_class_t {
H5T_NO_CLASS = -1, /**< error */
H5T_INTEGER = 0, /**< integer types */
@@ -45,12 +45,12 @@ typedef enum H5T_class_t {
H5T_NCLASSES /**< sentinel: this must be last */
} H5T_class_t;
-//! [H5T_class_t_snip]
+//! <!-- [H5T_class_t_snip] -->
/**
* Byte orders
*/
-//! [H5T_order_t_snip]
+//! <!-- [H5T_order_t_snip] -->
typedef enum H5T_order_t {
H5T_ORDER_ERROR = -1, /**< error */
H5T_ORDER_LE = 0, /**< little endian */
@@ -60,12 +60,12 @@ typedef enum H5T_order_t {
H5T_ORDER_NONE = 4 /**< no particular order (strings, bits,..) */
/*H5T_ORDER_NONE must be last */
} H5T_order_t;
-//! [H5T_order_t_snip]
+//! <!-- [H5T_order_t_snip] -->
/**
* Types of integer sign schemes
*/
-//! [H5T_sign_t_snip]
+//! <!-- [H5T_sign_t_snip] -->
typedef enum H5T_sign_t {
H5T_SGN_ERROR = -1, /**< error */
H5T_SGN_NONE = 0, /**< this is an unsigned type */
@@ -73,12 +73,12 @@ typedef enum H5T_sign_t {
H5T_NSGN = 2 /** sentinel: this must be last! */
} H5T_sign_t;
-//! [H5T_sign_t_snip]
+//! <!-- [H5T_sign_t_snip] -->
/**
* Floating-point normalization schemes
*/
-//! [H5T_norm_t_snip]
+//! <!-- [H5T_norm_t_snip] -->
typedef enum H5T_norm_t {
H5T_NORM_ERROR = -1, /**< error */
H5T_NORM_IMPLIED = 0, /**< msb of mantissa isn't stored, always 1 */
@@ -86,7 +86,7 @@ typedef enum H5T_norm_t {
H5T_NORM_NONE = 2 /**< not normalized */
/*H5T_NORM_NONE must be last */
} H5T_norm_t;
-//! [H5T_norm_t_snip]
+//! <!-- [H5T_norm_t_snip] -->
/**
* Character set to use for text strings.
@@ -141,7 +141,7 @@ typedef enum H5T_str_t {
/**
* Type of padding to use in other atomic types
*/
-//! [H5T_pad_t_snip]
+//! <!-- [H5T_pad_t_snip] -->
typedef enum H5T_pad_t {
H5T_PAD_ERROR = -1, /**< error */
H5T_PAD_ZERO = 0, /**< always set to zero */
@@ -150,69 +150,37 @@ typedef enum H5T_pad_t {
H5T_NPAD = 3 /**< sentinal: THIS MUST BE LAST */
} H5T_pad_t;
-//! [H5T_pad_t_snip]
-
-/**
- * Commands sent to conversion functions
- */
-typedef enum H5T_cmd_t {
- H5T_CONV_INIT = 0, /**< query and/or initialize private data */
- H5T_CONV_CONV = 1, /**< convert data from source to dest datatype */
- H5T_CONV_FREE = 2 /**< function is being removed from path */
-} H5T_cmd_t;
-
-/**
- * How is the `bkg' buffer used by the conversion function?
- */
-typedef enum H5T_bkg_t {
- H5T_BKG_NO = 0, /**< background buffer is not needed, send NULL */
- H5T_BKG_TEMP = 1, /**< bkg buffer used as temp storage only */
- H5T_BKG_YES = 2 /**< init bkg buf with data before conversion */
-} H5T_bkg_t;
-
-/**
- * Type conversion client data
- */
-//! [H5T_cdata_t_snip]
-typedef struct H5T_cdata_t {
- H5T_cmd_t command; /**< what should the conversion function do? */
- H5T_bkg_t need_bkg; /**< is the background buffer needed? */
- hbool_t recalc; /**< recalculate private data */
- void * priv; /**< private data */
-} H5T_cdata_t;
-//! [H5T_cdata_t_snip]
-
-/**
- * Conversion function persistence
- */
-typedef enum H5T_pers_t {
- H5T_PERS_DONTCARE = -1, /**< wild card */
- H5T_PERS_HARD = 0, /**< hard conversion function */
- H5T_PERS_SOFT = 1 /**< soft conversion function */
-} H5T_pers_t;
+//! <!-- [H5T_pad_t_snip] -->
/**
* The order to retrieve atomic native datatype
*/
-//! [H5T_direction_t_snip]
+//! <!-- [H5T_direction_t_snip] -->
typedef enum H5T_direction_t {
- H5T_DIR_DEFAULT = 0, /**< default direction is inscendent */
- H5T_DIR_ASCEND = 1, /**< in inscendent order */
- H5T_DIR_DESCEND = 2 /**< in descendent order */
+ H5T_DIR_DEFAULT = 0, /**< default direction is ascending */
+ H5T_DIR_ASCEND = 1, /**< in ascending order */
+ H5T_DIR_DESCEND = 2 /**< in descending order */
} H5T_direction_t;
-//! [H5T_direction_t_snip]
+//! <!-- [H5T_direction_t_snip] -->
/**
* The exception type passed into the conversion callback function
*/
typedef enum H5T_conv_except_t {
- H5T_CONV_EXCEPT_RANGE_HI = 0, /**< source value is greater than destination's range */
- H5T_CONV_EXCEPT_RANGE_LOW = 1, /**< source value is less than destination's range */
- H5T_CONV_EXCEPT_PRECISION = 2, /**< source value loses precision in destination */
- H5T_CONV_EXCEPT_TRUNCATE = 3, /**< source value is truncated in destination */
- H5T_CONV_EXCEPT_PINF = 4, /**< source value is positive infinity(floating number) */
- H5T_CONV_EXCEPT_NINF = 5, /**< source value is negative infinity(floating number) */
- H5T_CONV_EXCEPT_NAN = 6 /**< source value is NaN(floating number) */
+ H5T_CONV_EXCEPT_RANGE_HI = 0,
+ /**< Source value is greater than destination's range */
+ H5T_CONV_EXCEPT_RANGE_LOW = 1,
+ /**< Source value is less than destination's range */
+ H5T_CONV_EXCEPT_PRECISION = 2,
+ /**< Source value loses precision in destination */
+ H5T_CONV_EXCEPT_TRUNCATE = 3,
+ /**< Source value is truncated in destination */
+ H5T_CONV_EXCEPT_PINF = 4,
+ /**< Source value is positive infinity */
+ H5T_CONV_EXCEPT_NINF = 5,
+ /**< Source value is negative infinity */
+ H5T_CONV_EXCEPT_NAN = 6
+ /**< Source value is \c NaN (not a number, including \c QNaN and \c SNaN) */
} H5T_conv_except_t;
/**
@@ -238,7 +206,7 @@ typedef struct {
* Indicate that a string is variable length (null-terminated in C, instead of
* fixed length)
*/
-#define H5T_VARIABLE ((size_t)(-1))
+#define H5T_VARIABLE SIZE_MAX
/* Opaque information */
/**
@@ -251,20 +219,26 @@ typedef struct {
extern "C" {
#endif
+//! <!-- [H5T_conv_except_func_t_snip] -->
/**
- * All datatype conversion functions are...
- */
-//! [H5T_conv_t_snip]
-typedef herr_t (*H5T_conv_t)(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride,
- size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist);
-//! [H5T_conv_t_snip]
-
-/**
- * Exception handler. If an exception like overflow happenes during conversion,
- * this function is called if it's registered through H5Pset_type_conv_cb().
+ * \brief Exception handler.
+ *
+ * \param[in] except_type The kind of exception that occurred
+ * \param[in] src_id Source datatype identifier
+ * \param[in] dst_id Destination datatype identifier
+ * \param[in] src_buf Source data buffer
+ * \param[in,out] dst_buf Destination data buffer
+ * \param[in,out] user_data Callback context
+ * \returns Valid callback function return values are #H5T_CONV_ABORT,
+ * #H5T_CONV_UNHANDLED and #H5T_CONV_HANDLED.
+ *
+ * \details If an exception like overflow happens during conversion, this
+ * function is called if it's registered through H5Pset_type_conv_cb().
+ *
*/
typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type, hid_t src_id, hid_t dst_id,
void *src_buf, void *dst_buf, void *user_data);
+//! <!-- [H5T_conv_except_func_t_snip] -->
/* When this header is included from a private header, don't make calls to H5open() */
#undef H5OPEN
@@ -1061,7 +1035,7 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST64_g;
* predefined datatype.
*
* When creating a variable-length string datatype, \p size must
- * be #H5T_VARIABLE.
+ * be #H5T_VARIABLE; see \ref_vlen_strings.
*
* When creating a fixed-length string datatype, \p size will
* be the length of the string in bytes. The length of the
@@ -1075,13 +1049,9 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST64_g;
* The datatype identifier returned from this function should be
* released with H5Tclose or resource leaks will result.
*
- * \since 1.2.0
- *
* \see H5Tclose()
*
- * \todo Original has a reference to “Creating variable-length string
- * datatypes”.
- * \todo Create an example for H5Tcreate.
+ * \since 1.2.0
*
*/
H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size);
@@ -1106,8 +1076,6 @@ H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size);
* The returned datatype identifier should be released with H5Tclose()
* to prevent resource leak.
*
- * \todo Create an example for H5Tcopy().
- *
*/
H5_DLL hid_t H5Tcopy(hid_t type_id);
/**
@@ -1130,8 +1098,6 @@ H5_DLL herr_t H5Tclose(hid_t type_id);
*
* \brief Asynchronous version of H5Tclose().
*
- * \todo Create an example for H5Tclose_async().
- *
*/
H5_DLL herr_t H5Tclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t type_id,
hid_t es_id);
@@ -1222,8 +1188,6 @@ H5_DLL herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lc
*
* \brief Asynchronous version of H5Tcommit2().
*
- * \todo Create an example for H5Tcommit_async().
- *
*/
H5_DLL herr_t H5Tcommit_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id,
@@ -1257,8 +1221,6 @@ H5_DLL hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id);
*
* \brief Asynchronous version of H5Topen2().
*
- * \todo Create an example for H5Topen_async().
- *
*/
H5_DLL hid_t H5Topen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
const char *name, hid_t tapl_id, hid_t es_id);
@@ -1503,8 +1465,6 @@ H5_DLL herr_t H5Trefresh(hid_t type_id);
*
* \since 1.2.0
*
- * \todo Create example for H5Tinsert
- *
*/
H5_DLL herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id);
/**
@@ -1663,10 +1623,7 @@ H5_DLL herr_t H5Tenum_valueof(hid_t type, const char *name, void *value /*out*/)
* character base type creates a variable-length sequence of strings
* (a variable-length, 1-dimensional array), with each element of
* the array being of the string or character base type.\n
- * To create a variable-length string datatype, see "Creating
- * variable-length string datatypes."
- *
- * \todo Fix the reference.
+ * To create a variable-length string datatype, see \ref_vlen_strings.
*
*/
H5_DLL hid_t H5Tvlen_create(hid_t base_id);
@@ -1870,13 +1827,9 @@ H5_DLL htri_t H5Tdetect_class(hid_t type_id, H5T_class_t cls);
* actual data and a size value. This function does not return the
* size of actual variable-length sequence data.
*
- * \since 1.2.0
- *
* \see H5Tset_size()
*
- * \todo Original has a reference to “Creating variable-length string datatypes”.
- * \todo Create an example for H5Tget_size().
- *
+ * \since 1.2.0
*/
H5_DLL size_t H5Tget_size(hid_t type_id);
/**
@@ -2090,7 +2043,7 @@ H5_DLL H5T_pad_t H5Tget_inpad(hid_t type_id);
*/
H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id);
/**
- * \ingroup COMPOUND
+ * \ingroup COMPOUND ENUM
*
* \brief Retrieves the number of elements in a compound or enumeration datatype
*
@@ -2107,7 +2060,7 @@ H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id);
*/
H5_DLL int H5Tget_nmembers(hid_t type_id);
/**
- * \ingroup COMPOUND
+ * \ingroup COMPOUND ENUM
*
* \brief Retrieves the name of a compound or enumeration datatype member
*
@@ -2134,7 +2087,7 @@ H5_DLL int H5Tget_nmembers(hid_t type_id);
*/
H5_DLL char *H5Tget_member_name(hid_t type_id, unsigned membno);
/**
- * \ingroup COMPOUND
+ * \ingroup COMPOUND ENUM
*
* \brief Retrieves the index of a compound or enumeration datatype member
*
@@ -2406,6 +2359,7 @@ H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction);
*
* \li Variable-length string datatypes: If \p dtype_id is a
* variable-length string, size must normally be set to #H5T_VARIABLE.
+ * See \ref_vlen_strings.
*
* \li Compound datatypes: This function may be used to increase or
* decrease the size of a compound datatype, but the function will
@@ -2416,12 +2370,9 @@ H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction);
* variable-length array datatypes (#H5T_VLEN), or reference datatypes
* (#H5T_REFERENCE).
*
- * \since 1.2.0
- *
* \see H5Tget_size()
*
- *\todo Create an example for H5Tset_size().
- *\todo Original has a reference to “Creating variable-length string datatypes”.
+ * \since 1.2.0
*
*/
H5_DLL herr_t H5Tset_size(hid_t type_id, size_t size);
@@ -2712,130 +2663,6 @@ H5_DLL herr_t H5Tset_cset(hid_t type_id, H5T_cset_t cset);
*/
H5_DLL herr_t H5Tset_strpad(hid_t type_id, H5T_str_t strpad);
-/* Type conversion database */
-/**
- * \ingroup CONV
- *
- * \brief Registers a datatype conversion function
- *
- * \param[in] pers Conversion function type
- * \param[in] name Name displayed in diagnostic output
- * \type_id{src_id} of source datatype
- * \type_id{dst_id} of destination datatype
- * \param[in] func Function to convert between source and destination datatypes
- *
- * \return \herr_t
- *
- * \details H5Tregister() registers a hard or soft conversion function for a
- * datatype conversion path. The parameter \p pers indicates whether a
- * conversion function is hard (#H5T_PERS_HARD) or soft
- * (#H5T_PERS_SOFT). User-defined functions employing compiler casting
- * are designated as \Emph{hard}; other user-defined conversion
- * functions registered with the HDF5 library (with H5Tregister() )
- * are designated as \Emph{soft}. The HDF5 library also has its own
- * hard and soft conversion functions.
- *
- * A conversion path can have only one hard function. When type is
- * #H5T_PERS_HARD, \p func replaces any previous hard function.
- *
- * When type is #H5T_PERS_SOFT, H5Tregister() adds the function to the
- * end of the master soft list and replaces the soft function in all
- * applicable existing conversion paths. Soft functions are used when
- * determining which conversion function is appropriate for this path.
- *
- * The \p name is used only for debugging and should be a short
- * identifier for the function.
- *
- * The path is specified by the source and destination datatypes \p
- * src_id and \p dst_id. For soft conversion functions, only the class
- * of these types is important.
- *
- * The type of the conversion function pointer is declared as:
- * \snippet this H5T_conv_t_snip
- *
- * The \ref H5T_cdata_t \c struct is declared as:
- * \snippet this H5T_cdata_t_snip
- *
- * \since 1.6.3 The following change occurred in the \ref H5T_conv_t function:
- * the \c nelmts parameter type changed to size_t.
- *
- */
-H5_DLL herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func);
-/**
- * \ingroup CONV
- *
- * \brief Removes a conversion function
- *
- * \param[in] pers Conversion function type
- * \param[in] name Name displayed in diagnostic output
- * \type_id{src_id} of source datatype
- * \type_id{dst_id} of destination datatype
- * \param[in] func Function to convert between source and destination datatypes
- *
- * \return \herr_t
- *
- * \details H5Tunregister() removes a conversion function matching criteria
- * such as soft or hard conversion, source and destination types, and
- * the conversion function.
- *
- * If a user is trying to remove a conversion function he registered,
- * all parameters can be used. If he is trying to remove a library’s
- * default conversion function, there is no guarantee the \p name and
- * \p func parameters will match the user’s chosen values. Passing in
- * some values may cause this function to fail. A good practice is to
- * pass in NULL as their values.
- *
- * All parameters are optional. The missing parameters will be used to
- * generalize the search criteria.
- *
- * The conversion function pointer type declaration is described in
- * H5Tregister().
- *
- * \version 1.6.3 The following change occurred in the \ref H5T_conv_t function:
- * the \c nelmts parameter type changed to size_t.
- *
- */
-H5_DLL herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func);
-/**
- * \ingroup CONV
- *
- * \brief Finds a conversion function
- *
- * \type_id{src_id} of source datatype
- * \type_id{dst_id} of destination datatype
- * \param[out] pcdata Pointer to type conversion data
- *
- * \return Returns a pointer to a suitable conversion function if successful.
- * Otherwise returns NULL.
- *
- * \details H5Tfind() finds a conversion function that can handle a conversion
- * from type \p src_id to type \p dst_id. The \p pcdata argument is a
- * pointer to a pointer to type conversion data which was created and
- * initialized by the soft type conversion function of this path when
- * the conversion function was installed on the path.
- *
- */
-H5_DLL H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata);
-/**
- * \ingroup CONV
- *
- * \brief Check whether the library’s default conversion is hard conversion
- *
- * \type_id{src_id} of source datatype
- * \type_id{dst_id} of destination datatype
- *
- * \return \htri_t
- *
- * \details H5Tcompiler_conv() determines whether the library’s conversion
- * function from type \p src_id to type \p dst_id is a compiler (hard)
- * conversion or not. A compiler conversion uses compiler’s casting; a
- * library (soft) conversion uses the library’s own conversion
- * function.
- *
- * \since 1.8.0
- *
- */
-H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id);
/**
* --------------------------------------------------------------------------
* \ingroup CONV
@@ -2873,7 +2700,7 @@ H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id);
* enough to hold the larger of the input and output data.
*
* \version 1.6.3 \p nelmts parameter type changed to size_t.
- * \version 1.4.0 \p nelmts parameter type changed to \ref hsize_t.
+ * \version 1.4.0 \p nelmts parameter type changed to hsize_t.
*
*/
H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background,
diff --git a/src/H5Tref.c b/src/H5Tref.c
index 1114c25..cac8cf6 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -289,12 +289,16 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
} /* end else-if */
else {
H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
size_t ref_encode_size;
H5R_ref_priv_t fixed_ref;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get(file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &cont_info) < 0)
+ if (H5VL_file_get(file, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get container info")
/* Retrieve min encode size (when references have no vlen part) */
@@ -434,8 +438,10 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf
/* Force re-calculating encoding size if any flags are set */
if (flags || !src_ref->encode_size) {
- char file_name_buf_static[256]; /* File name */
- ssize_t file_name_len; /* Size of file name buffer */
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ char * file_name = NULL; /* Actual file name */
+ char file_name_buf_static[256]; /* File name */
+ size_t file_name_len = 0; /* Length of file name */
/* Pass the correct encoding version for the selection depending on the
* file libver bounds, this is later retrieved in H5S hyper encode */
@@ -458,21 +464,38 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf
H5CX_set_libver_bounds(NULL);
} /* end if */
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_NAME;
+ vol_cb_args.args.get_name.type = H5I_FILE;
+ vol_cb_args.args.get_name.buf_size = sizeof(file_name_buf_static);
+ vol_cb_args.args.get_name.buf = file_name_buf_static;
+ vol_cb_args.args.get_name.file_name_len = &file_name_len;
+
/* Get file name */
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE,
- sizeof(file_name_buf_static), file_name_buf_static, &file_name_len) < 0)
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't get file name")
- if (file_name_len >= (ssize_t)sizeof(file_name_buf_static)) {
- if (NULL == (file_name_buf_dyn = (char *)H5MM_malloc((size_t)file_name_len + 1)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, 0, "can't allocate space for file name")
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE,
- (size_t)file_name_len + 1, file_name_buf_dyn, &file_name_len) < 0)
+
+ /* Check if we need to allocate a buffer for the file name */
+ if (file_name_len >= sizeof(file_name_buf_static)) {
+ /* Allocate file name buffer */
+ if (NULL == (file_name_buf_dyn = H5MM_malloc(file_name_len + 1)))
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTALLOC, 0, "can't allocate space for file name")
+
+ /* Update VOL callback arguments */
+ vol_cb_args.args.get_name.buf_size = file_name_len + 1;
+ vol_cb_args.args.get_name.buf = file_name_buf_dyn;
+
+ /* Get file name again */
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't get file name")
+
+ file_name = file_name_buf_dyn;
} /* end if */
+ else
+ file_name = file_name_buf_static;
/* Determine encoding size */
- if (H5R__encode(file_name_buf_dyn ? file_name_buf_dyn : file_name_buf_static, src_ref, NULL,
- &ret_value, flags) < 0)
+ if (H5R__encode(file_name, src_ref, NULL, &ret_value, flags) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, 0, "unable to determine encoding size")
} /* end if */
else {
@@ -506,10 +529,10 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s
H5VL_object_t * vol_obj; /* VOL object for src ref's location */
const H5R_ref_priv_t *src_ref = (const H5R_ref_priv_t *)src_buf;
hbool_t files_equal = TRUE; /* Whether src & dst references are in same file */
+ char * file_name = NULL; /* Actual file name */
char file_name_buf_static[256] = {'\0'}; /* File name */
char * file_name_buf_dyn =
NULL; /* Pointer to dynamically allocated buffer for file name, if static buffer is too small */
- ssize_t file_name_len; /* Size of file name buffer */
unsigned flags = 0; /* References flags */
herr_t ret_value = SUCCEED; /* Return value */
@@ -560,21 +583,42 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s
/* Get file name (if external reference) */
if (flags) {
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE,
- sizeof(file_name_buf_static), file_name_buf_static, &file_name_len) < 0)
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+ size_t file_name_len = 0; /* Length of file name */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_NAME;
+ vol_cb_args.args.get_name.type = H5I_FILE;
+ vol_cb_args.args.get_name.buf_size = sizeof(file_name_buf_static);
+ vol_cb_args.args.get_name.buf = file_name_buf_static;
+ vol_cb_args.args.get_name.file_name_len = &file_name_len;
+
+ /* Get file name */
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't get file name")
- if (file_name_len >= (ssize_t)sizeof(file_name_buf_static)) {
- if (NULL == (file_name_buf_dyn = (char *)H5MM_malloc((size_t)file_name_len + 1)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, 0, "can't allocate space for file name")
- if (H5VL_file_get(vol_obj, H5VL_FILE_GET_NAME, H5P_DATASET_XFER_DEFAULT, NULL, H5I_FILE,
- (size_t)file_name_len + 1, file_name_buf_dyn, &file_name_len) < 0)
+
+ /* Check if we need to allocate a buffer for the file name */
+ if (file_name_len >= sizeof(file_name_buf_static)) {
+ /* Allocate file name buffer */
+ if (NULL == (file_name_buf_dyn = H5MM_malloc(file_name_len + 1)))
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTALLOC, 0, "can't allocate space for file name")
+
+ /* Update VOL callback arguments */
+ vol_cb_args.args.get_name.buf_size = file_name_len + 1;
+ vol_cb_args.args.get_name.buf = file_name_buf_dyn;
+
+ /* Get file name again */
+ if (H5VL_file_get(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't get file name")
+
+ file_name = file_name_buf_dyn;
} /* end if */
- } /* end if */
+ else
+ file_name = file_name_buf_static;
+ } /* end if */
/* Encode reference */
- if (H5R__encode(file_name_buf_dyn ? file_name_buf_dyn : file_name_buf_static, src_ref,
- (unsigned char *)dst_buf, &dst_size, flags) < 0)
+ if (H5R__encode(file_name, src_ref, (unsigned char *)dst_buf, &dst_size, flags) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "Cannot encode reference")
done:
@@ -731,11 +775,17 @@ H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t
*isnull = FALSE;
}
else {
+ H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+
/* Skip the size / header */
p = (const uint8_t *)src_buf + H5R_ENCODE_HEADER_SIZE + H5_SIZEOF_UINT32_T;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_BLOB_ISNULL;
+ vol_cb_args.args.is_null.isnull = isnull;
+
/* Check if blob ID is "nil" */
- if (H5VL_blob_specific(src_file, (void *)p, H5VL_BLOB_ISNULL, isnull) < 0)
+ if (H5VL_blob_specific(src_file, (void *)p, &vol_cb_args) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to check if a blob ID is 'nil'")
}
@@ -755,9 +805,10 @@ done:
static herr_t
H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf)
{
- uint8_t *q = (uint8_t *)dst_buf;
- uint8_t *p_bg = (uint8_t *)bg_buf;
- herr_t ret_value = SUCCEED;
+ H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ uint8_t * q = (uint8_t *)dst_buf;
+ uint8_t * p_bg = (uint8_t *)bg_buf;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
H5T_REF_LOG_DEBUG("");
@@ -770,8 +821,11 @@ H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf)
/* Skip the size / header */
p_bg += (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_BLOB_DELETE;
+
/* Remove blob for old data */
- if (H5VL_blob_specific(dst_file, (void *)p_bg, H5VL_BLOB_DELETE) < 0)
+ if (H5VL_blob_specific(dst_file, (void *)p_bg, &vol_cb_args) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREMOVE, FAIL, "unable to delete blob")
} /* end if */
@@ -782,8 +836,11 @@ H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf)
/* Set the size */
UINT32ENCODE(q, 0);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_BLOB_SETNULL;
+
/* Set blob ID to "nil" */
- if (H5VL_blob_specific(dst_file, q, H5VL_BLOB_SETNULL) < 0)
+ if (H5VL_blob_specific(dst_file, q, &vol_cb_args) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set a blob ID to 'nil'")
done:
@@ -913,15 +970,19 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf,
/* TODO Should get rid of bg stuff */
if (p_bg) {
- size_t p_buf_size_left = dst_size;
+ H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ size_t p_buf_size_left = dst_size;
/* Skip the size / header */
p_bg += (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE);
HDassert(p_buf_size_left > (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE));
p_buf_size_left -= (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_BLOB_DELETE;
+
/* Remove blob for old data */
- if (H5VL_blob_specific(dst_file, (void *)p_bg, H5VL_BLOB_DELETE) < 0)
+ if (H5VL_blob_specific(dst_file, (void *)p_bg, &vol_cb_args) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREMOVE, FAIL, "unable to delete blob")
} /* end if */
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c
index 39d14f3..080d725 100644
--- a/src/H5Tvlen.c
+++ b/src/H5Tvlen.c
@@ -247,8 +247,7 @@ done:
htri_t
H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
{
- H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
- htri_t ret_value = FALSE; /* Indicate success, but no location change */
+ htri_t ret_value = FALSE; /* Indicate success, but no location change */
FUNC_ENTER_PACKAGE
@@ -293,15 +292,22 @@ H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
dt->shared->u.vlen.file = NULL;
break;
- case H5T_LOC_DISK: /* Disk based VL datatype */
+ /* Disk based VL datatype */
+ case H5T_LOC_DISK: {
+ H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0};
+ H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */
+
HDassert(file);
/* Mark this type as being stored on disk */
dt->shared->u.vlen.loc = H5T_LOC_DISK;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_GET_CONT_INFO;
+ vol_cb_args.args.get_cont_info.info = &cont_info;
+
/* Get container info */
- if (H5VL_file_get(file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- &cont_info) < 0)
+ if (H5VL_file_get(file, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get container info")
/* The datatype size is equal to 4 bytes for the sequence length
@@ -319,6 +325,7 @@ H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
if (H5T_own_vol_obj(dt, file) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't give ownership of VOL object")
break;
+ }
case H5T_LOC_BADLOC:
/* Allow undefined location. In H5Odtype.c, H5O_dtype_decode sets undefined
@@ -841,8 +848,9 @@ H5T__vlen_disk_getlen(H5VL_object_t H5_ATTR_UNUSED *file, const void *_vl, size_
static herr_t
H5T__vlen_disk_isnull(const H5VL_object_t *file, void *_vl, hbool_t *isnull)
{
- uint8_t *vl = (uint8_t *)_vl; /* Pointer to the user's hvl_t information */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ uint8_t * vl = (uint8_t *)_vl; /* Pointer to the user's hvl_t information */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -854,8 +862,12 @@ H5T__vlen_disk_isnull(const H5VL_object_t *file, void *_vl, hbool_t *isnull)
/* Skip the sequence's length */
vl += 4;
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_BLOB_ISNULL;
+ vol_cb_args.args.is_null.isnull = isnull;
+
/* Check if blob ID is "nil" */
- if (H5VL_blob_specific(file, vl, H5VL_BLOB_ISNULL, isnull) < 0)
+ if (H5VL_blob_specific(file, vl, &vol_cb_args) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to check if a blob ID is 'nil'")
done:
@@ -877,8 +889,9 @@ done:
static herr_t
H5T__vlen_disk_setnull(H5VL_object_t *file, void *_vl, void *bg)
{
- uint8_t *vl = (uint8_t *)_vl; /* Pointer to the user's hvl_t information */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ uint8_t * vl = (uint8_t *)_vl; /* Pointer to the user's hvl_t information */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -895,8 +908,11 @@ H5T__vlen_disk_setnull(H5VL_object_t *file, void *_vl, void *bg)
/* Set the length of the sequence */
UINT32ENCODE(vl, 0);
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_BLOB_SETNULL;
+
/* Set blob ID to "nil" */
- if (H5VL_blob_specific(file, vl, H5VL_BLOB_SETNULL) < 0)
+ if (H5VL_blob_specific(file, vl, &vol_cb_args) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set a blob ID to 'nil'")
done:
@@ -1013,10 +1029,16 @@ H5T__vlen_disk_delete(H5VL_object_t *file, const void *_vl)
UINT32DECODE(vl, seq_len);
/* Delete object, if length > 0 */
- if (seq_len > 0)
- if (H5VL_blob_specific(file, (void *)vl, H5VL_BLOB_DELETE) < 0) /* Casting away 'const' OK -QAK */
+ if (seq_len > 0) {
+ H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_BLOB_DELETE;
+
+ if (H5VL_blob_specific(file, (void *)vl, &vol_cb_args) < 0) /* Casting away 'const' OK -QAK */
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREMOVE, FAIL, "unable to delete blob")
- } /* end if */
+ } /* end if */
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5VL.c b/src/H5VL.c
index a77a6f3..2cece6d 100644
--- a/src/H5VL.c
+++ b/src/H5VL.c
@@ -764,6 +764,39 @@ done:
} /* H5VLretrieve_lib_state() */
/*---------------------------------------------------------------------------
+ * Function: H5VLstart_lib_state
+ *
+ * Purpose: Opens a new internal state for the HDF5 library.
+ *
+ * Note: This routine is _only_ for HDF5 VOL connector authors! It is
+ * _not_ part of the public API for HDF5 application developers.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Quincey Koziol
+ * Friday, February 5, 2021
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VLstart_lib_state(void)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ /* Must use this, to avoid modifying the API context stack in FUNC_ENTER */
+ FUNC_ENTER_API_NOINIT
+ H5TRACE0("e", "");
+
+ /* Start a new library state */
+ if (H5VL_start_lib_state() < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't start new library state")
+
+done:
+ FUNC_LEAVE_API_NOINIT(ret_value)
+} /* H5VLstart_lib_state() */
+
+/*---------------------------------------------------------------------------
* Function: H5VLrestore_lib_state
*
* Purpose: Restores the internal state of the HDF5 library.
@@ -801,16 +834,16 @@ done:
} /* H5VLrestore_lib_state() */
/*---------------------------------------------------------------------------
- * Function: H5VLreset_lib_state
+ * Function: H5VLfinish_lib_state
*
- * Purpose: Resets the internal state of the HDF5 library, undoing the
- * affects of H5VLrestore_lib_state.
+ * Purpose: Closes the internal state of the HDF5 library, undoing the
+ * affects of H5VLstart_lib_state.
*
* Note: This routine is _only_ for HDF5 VOL connector authors! It is
* _not_ part of the public API for HDF5 application developers.
*
* Note: This routine must be called as a "pair" with
- * H5VLrestore_lib_state. It can be called before / after /
+ * H5VLstart_lib_state. It can be called before / after /
* independently of H5VLfree_lib_state.
*
* Return: Success: Non-negative
@@ -822,7 +855,7 @@ done:
*---------------------------------------------------------------------------
*/
herr_t
-H5VLreset_lib_state(void)
+H5VLfinish_lib_state(void)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -831,12 +864,12 @@ H5VLreset_lib_state(void)
H5TRACE0("e", "");
/* Reset the library state */
- if (H5VL_reset_lib_state() < 0)
+ if (H5VL_finish_lib_state() < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset library state")
done:
FUNC_LEAVE_API_NOINIT(ret_value)
-} /* H5VLreset_lib_state() */
+} /* H5VLfinish_lib_state() */
/*---------------------------------------------------------------------------
* Function: H5VLfree_lib_state
@@ -911,3 +944,136 @@ H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, uint64_t
done:
FUNC_LEAVE_API(ret_value)
} /* H5VLquery_optional() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VLregister_opt_operation
+ *
+ * Purpose: Allow a VOL connector to register a new optional operation
+ * for a VOL object subclass. The operation name must be runtime
+ * unique for each operation, preferably avoiding naming clashes
+ * by using a Uniform Type Identifier (UTI,
+ *https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html)
+ * for each operation name. The value returned in the 'op_val'
+ * pointer will be unique for that VOL connector to use for its
+ * operation on that subclass.
+ *
+ * For example, registering a 'prefetch' operation for the
+ * caching VOL connector written at the ALCF at Argonne National
+ * Laboratory could have a UTI of: "gov.anl.alcf.cache.prefetch",
+ * and the "evict" operation for the same connector could have a
+ * UTI of: "gov.anl.alcf.cache.evict". Registering a "suspend
+ * background threads" operation for the asynchronous VOL connector
+ * written at NERSC at Lawrence Berkeley National Laboratory could
+ * have a UTI of: "gov.lbnl.nersc.async.suspend_bkg_threads".
+ *
+ * Note: The first 1024 values of each subclass's optional operations
+ * are reserved for the native VOL connector's use.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VLregister_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val /*out*/)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "VS*sx", subcls, op_name, op_val);
+
+ /* Check args */
+ if (NULL == op_val)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_val pointer")
+ if (NULL == op_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_name pointer")
+ if ('\0' == *op_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_name string")
+ if (!((H5VL_SUBCLS_ATTR == subcls) || (H5VL_SUBCLS_DATASET == subcls) ||
+ (H5VL_SUBCLS_DATATYPE == subcls) || (H5VL_SUBCLS_FILE == subcls) || (H5VL_SUBCLS_GROUP == subcls) ||
+ (H5VL_SUBCLS_OBJECT == subcls) || (H5VL_SUBCLS_LINK == subcls) || (H5VL_SUBCLS_REQUEST == subcls)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid VOL subclass type")
+
+ /* Register the operation */
+ if (H5VL__register_opt_operation(subcls, op_name, op_val) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, FAIL, "can't register dynamic optional operation: '%s'",
+ op_name)
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* H5VLregister_opt_operation() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VLfind_opt_operation
+ *
+ * Purpose: Look up a optional operation for a VOL object subclass, by name.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VLfind_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val /*out*/)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "VS*sx", subcls, op_name, op_val);
+
+ /* Check args */
+ if (NULL == op_val)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_val pointer")
+ if (NULL == op_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_name pointer")
+ if ('\0' == *op_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_name string")
+ if (!((H5VL_SUBCLS_ATTR == subcls) || (H5VL_SUBCLS_DATASET == subcls) ||
+ (H5VL_SUBCLS_DATATYPE == subcls) || (H5VL_SUBCLS_FILE == subcls) || (H5VL_SUBCLS_GROUP == subcls) ||
+ (H5VL_SUBCLS_OBJECT == subcls) || (H5VL_SUBCLS_LINK == subcls) || (H5VL_SUBCLS_REQUEST == subcls)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid VOL subclass type")
+
+ /* Find the operation */
+ if (H5VL__find_opt_operation(subcls, op_name, op_val) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_NOTFOUND, FAIL, "can't find dynamic optional operation: '%s'", op_name)
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* H5VLfind_opt_operation() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VLunregister_opt_operation
+ *
+ * Purpose: Unregister a optional operation for a VOL object subclass, by name.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VLunregister_opt_operation(H5VL_subclass_t subcls, const char *op_name)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "VS*s", subcls, op_name);
+
+ /* Check args */
+ if (NULL == op_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_name pointer")
+ if ('\0' == *op_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid op_name string")
+ if (!((H5VL_SUBCLS_ATTR == subcls) || (H5VL_SUBCLS_DATASET == subcls) ||
+ (H5VL_SUBCLS_DATATYPE == subcls) || (H5VL_SUBCLS_FILE == subcls) || (H5VL_SUBCLS_GROUP == subcls) ||
+ (H5VL_SUBCLS_OBJECT == subcls) || (H5VL_SUBCLS_LINK == subcls) || (H5VL_SUBCLS_REQUEST == subcls)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid VOL subclass type")
+
+ /* Unregister the operation */
+ if (H5VL__unregister_opt_operation(subcls, op_name) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTREMOVE, FAIL, "can't unregister dynamic optional operation: '%s'",
+ op_name)
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* H5VLunregister_opt_operation() */
diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c
index 02e0ee0..a61b003 100644
--- a/src/H5VLcallback.c
+++ b/src/H5VLcallback.c
@@ -29,11 +29,13 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
+#include "H5ESprivate.h" /* Event Sets */
+#include "H5Fprivate.h" /* File access */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#include "H5PLprivate.h" /* Plugins */
+#include "H5Tprivate.h" /* Datatypes */
#include "H5VLpkg.h" /* Virtual Object Layer */
/****************/
@@ -54,6 +56,10 @@ typedef struct H5VL_file_open_find_connector_t {
hid_t fapl_id;
} H5VL_file_open_find_connector_t;
+/* Typedef for common callback form of registered optional operations */
+typedef herr_t (*H5VL_reg_opt_oper_t)(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
+
/********************/
/* Package Typedefs */
/********************/
@@ -70,13 +76,12 @@ static herr_t H5VL__attr_read(void *obj, const H5VL_class_t *cls, hid_t mem_type
void **req);
static herr_t H5VL__attr_write(void *obj, const H5VL_class_t *cls, hid_t mem_type_id, const void *buf,
hid_t dxpl_id, void **req);
-static herr_t H5VL__attr_get(void *obj, const H5VL_class_t *cls, H5VL_attr_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
+static herr_t H5VL__attr_get(void *obj, const H5VL_class_t *cls, H5VL_attr_get_args_t *args, hid_t dxpl_id,
+ void **req);
static herr_t H5VL__attr_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL__attr_optional(void *obj, const H5VL_class_t *cls, H5VL_attr_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL__attr_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
static herr_t H5VL__attr_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req);
static void * H5VL__dataset_create(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
const char *name, hid_t lcpl_id, hid_t type_id, hid_t space_id,
@@ -87,26 +92,24 @@ static herr_t H5VL__dataset_read(void *dset, const H5VL_class_t *cls, hid_t mem_
hid_t file_space_id, hid_t dxpl_id, void *buf, void **req);
static herr_t H5VL__dataset_write(void *obj, const H5VL_class_t *cls, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t dxpl_id, const void *buf, void **req);
-static herr_t H5VL__dataset_get(void *obj, const H5VL_class_t *cls, H5VL_dataset_get_t get_type,
- hid_t dxpl_id, void **req, va_list arguments);
-static herr_t H5VL__dataset_specific(void *obj, const H5VL_class_t *cls,
- H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL__dataset_optional(void *obj, const H5VL_class_t *cls, H5VL_dataset_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+static herr_t H5VL__dataset_get(void *obj, const H5VL_class_t *cls, H5VL_dataset_get_args_t *args,
+ hid_t dxpl_id, void **req);
+static herr_t H5VL__dataset_specific(void *obj, const H5VL_class_t *cls, H5VL_dataset_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+static herr_t H5VL__dataset_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
static herr_t H5VL__dataset_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req);
static void * H5VL__datatype_commit(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id,
hid_t tapl_id, hid_t dxpl_id, void **req);
static void * H5VL__datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
const char *name, hid_t tapl_id, hid_t dxpl_id, void **req);
-static herr_t H5VL__datatype_get(void *obj, const H5VL_class_t *cls, H5VL_datatype_get_t get_type,
- hid_t dxpl_id, void **req, va_list arguments);
-static herr_t H5VL__datatype_specific(void *obj, const H5VL_class_t *cls,
- H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL__datatype_optional(void *obj, const H5VL_class_t *cls, H5VL_datatype_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+static herr_t H5VL__datatype_get(void *obj, const H5VL_class_t *cls, H5VL_datatype_get_args_t *args,
+ hid_t dxpl_id, void **req);
+static herr_t H5VL__datatype_specific(void *obj, const H5VL_class_t *cls, H5VL_datatype_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+static herr_t H5VL__datatype_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
static herr_t H5VL__datatype_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req);
static void * H5VL__file_create(const H5VL_class_t *cls, const char *name, unsigned flags, hid_t fcpl_id,
hid_t fapl_id, hid_t dxpl_id, void **req);
@@ -114,28 +117,28 @@ static void * H5VL__file_open(const H5VL_class_t *cls, const char *name, unsigne
hid_t dxpl_id, void **req);
static herr_t H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_info,
void *op_data);
-static herr_t H5VL__file_get(void *obj, const H5VL_class_t *cls, H5VL_file_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-static herr_t H5VL__file_specific(void *obj, const H5VL_class_t *cls, H5VL_file_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-static herr_t H5VL__file_optional(void *obj, const H5VL_class_t *cls, H5VL_file_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+static herr_t H5VL__file_get(void *obj, const H5VL_class_t *cls, H5VL_file_get_args_t *args, hid_t dxpl_id,
+ void **req);
+static herr_t H5VL__file_specific(void *obj, const H5VL_class_t *cls, H5VL_file_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+static herr_t H5VL__file_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
static herr_t H5VL__file_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req);
static void * H5VL__group_create(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id,
void **req);
static void * H5VL__group_open(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
const char *name, hid_t gapl_id, hid_t dxpl_id, void **req);
-static herr_t H5VL__group_get(void *obj, const H5VL_class_t *cls, H5VL_group_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-static herr_t H5VL__group_specific(void *obj, const H5VL_class_t *cls, H5VL_group_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-static herr_t H5VL__group_optional(void *obj, const H5VL_class_t *cls, H5VL_group_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+static herr_t H5VL__group_get(void *obj, const H5VL_class_t *cls, H5VL_group_get_args_t *args, hid_t dxpl_id,
+ void **req);
+static herr_t H5VL__group_specific(void *obj, const H5VL_class_t *cls, H5VL_group_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+static herr_t H5VL__group_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
static herr_t H5VL__group_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req);
-static herr_t H5VL__link_create(H5VL_link_create_type_t create_type, void *obj,
- const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls, hid_t lcpl_id,
- hid_t lapl_id, hid_t dxpl_id, void **req, va_list arguments);
+static herr_t H5VL__link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
+ const H5VL_class_t *cls, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id,
+ void **req);
static herr_t H5VL__link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, const H5VL_class_t *cls, hid_t lcpl_id,
hid_t lapl_id, hid_t dxpl_id, void **req);
@@ -143,12 +146,11 @@ static herr_t H5VL__link_move(void *src_obj, const H5VL_loc_params_t *loc_params
const H5VL_loc_params_t *loc_params2, const H5VL_class_t *cls, hid_t lcpl_id,
hid_t lapl_id, hid_t dxpl_id, void **req);
static herr_t H5VL__link_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_link_get_args_t *args, hid_t dxpl_id, void **req);
static herr_t H5VL__link_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL__link_optional(void *obj, const H5VL_class_t *cls, H5VL_link_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL__link_optional(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
static void * H5VL__object_open(void *obj, const H5VL_loc_params_t *params, const H5VL_class_t *cls,
H5I_type_t *opened_type, hid_t dxpl_id, void **req);
static herr_t H5VL__object_copy(void *src_obj, const H5VL_loc_params_t *src_loc_params, const char *src_name,
@@ -156,12 +158,11 @@ static herr_t H5VL__object_copy(void *src_obj, const H5VL_loc_params_t *src_loc_
const H5VL_class_t *cls, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id,
void **req);
static herr_t H5VL__object_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req);
static herr_t H5VL__object_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL__object_optional(void *obj, const H5VL_class_t *cls, H5VL_object_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL__object_optional(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
static herr_t H5VL__introspect_get_conn_cls(void *obj, const H5VL_class_t *cls, H5VL_get_conn_lvl_t lvl,
const H5VL_class_t **conn_cls);
static herr_t H5VL__introspect_opt_query(void *obj, const H5VL_class_t *cls, H5VL_subclass_t subcls,
@@ -170,27 +171,25 @@ static herr_t H5VL__request_wait(void *req, const H5VL_class_t *cls, uint64_t ti
H5VL_request_status_t *status);
static herr_t H5VL__request_notify(void *req, const H5VL_class_t *cls, H5VL_request_notify_t cb, void *ctx);
static herr_t H5VL__request_cancel(void *req, const H5VL_class_t *cls, H5VL_request_status_t *status);
-static herr_t H5VL__request_specific(void *req, const H5VL_class_t *cls,
- H5VL_request_specific_t specific_type, va_list arguments);
-static herr_t H5VL__request_optional(void *req, const H5VL_class_t *cls, H5VL_request_optional_t opt_type,
- va_list arguments);
+static herr_t H5VL__request_specific(void *req, const H5VL_class_t *cls, H5VL_request_specific_args_t *args);
+static herr_t H5VL__request_optional(void *req, const H5VL_class_t *cls, H5VL_optional_args_t *args);
static herr_t H5VL__request_free(void *req, const H5VL_class_t *cls);
static herr_t H5VL__blob_put(void *obj, const H5VL_class_t *cls, const void *buf, size_t size, void *blob_id,
void *ctx);
static herr_t H5VL__blob_get(void *obj, const H5VL_class_t *cls, const void *blob_id, void *buf, size_t size,
void *ctx);
static herr_t H5VL__blob_specific(void *obj, const H5VL_class_t *cls, void *blob_id,
- H5VL_blob_specific_t specific_type, va_list arguments);
+ H5VL_blob_specific_args_t *args);
static herr_t H5VL__blob_optional(void *obj, const H5VL_class_t *cls, void *blob_id,
- H5VL_blob_optional_t opt_type, va_list arguments);
+ H5VL_optional_args_t *args);
static herr_t H5VL__token_cmp(void *obj, const H5VL_class_t *cls, const H5O_token_t *token1,
const H5O_token_t *token2, int *cmp_value);
static herr_t H5VL__token_to_str(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls,
const H5O_token_t *token, char **token_str);
static herr_t H5VL__token_from_str(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls,
const char *token_str, H5O_token_t *token);
-static herr_t H5VL__optional(void *obj, const H5VL_class_t *cls, int op_type, hid_t dxpl_id, void **req,
- va_list arguments);
+static herr_t H5VL__optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
/*********************/
/* Package Variables */
@@ -329,6 +328,50 @@ done:
} /* H5VLget_value */
/*-------------------------------------------------------------------------
+ * Function: H5VL__common_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on an object
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5VL__common_optional_op(hid_t id, H5I_type_t id_type, H5VL_reg_opt_oper_t reg_opt_op,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req, H5VL_object_t **_vol_obj_ptr)
+{
+ H5VL_object_t * tmp_vol_obj = NULL; /* Object for id */
+ H5VL_object_t **vol_obj_ptr = (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for id */
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Check ID type & get VOL object */
+ if (NULL == (*vol_obj_ptr = (H5VL_object_t *)H5I_object_verify(id, id_type)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid identifier")
+
+ /* Set wrapper info in API context */
+ if (H5VL_set_vol_wrapper(*vol_obj_ptr) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
+ vol_wrapper_set = TRUE;
+
+ /* Call the corresponding internal VOL routine */
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value =
+ (*reg_opt_op)((*vol_obj_ptr)->data, (*vol_obj_ptr)->connector->cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute optional callback");
+
+done:
+ /* Reset object wrapping info in API context */
+ if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
+ HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL__common_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL_copy_connector_info
*
* Purpose: Copy the VOL info for a connector
@@ -1341,8 +1384,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__attr_get(void *obj, const H5VL_class_t *cls, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL__attr_get(void *obj, const H5VL_class_t *cls, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1353,7 +1395,7 @@ H5VL__attr_get(void *obj, const H5VL_class_t *cls, H5VL_attr_get_t get_type, hid
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'attr get' method")
/* Call the corresponding VOL callback */
- if ((cls->attr_cls.get)(obj, get_type, dxpl_id, req, arguments) < 0)
+ if ((cls->attr_cls.get)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "attribute get failed")
done:
@@ -1371,10 +1413,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_attr_get(const H5VL_object_t *vol_obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, ...)
+H5VL_attr_get(const H5VL_object_t *vol_obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1386,16 +1426,10 @@ H5VL_attr_get(const H5VL_object_t *vol_obj, H5VL_attr_get_t get_type, hid_t dxpl
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__attr_get(vol_obj->data, vol_obj->connector->cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__attr_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "attribute get failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -1414,23 +1448,24 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req /*out*/,
- va_list arguments)
+H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVaixx", obj, connector_id, get_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object")
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
+ if (NULL == args)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument struct")
/* Call the corresponding internal VOL routine */
- if (H5VL__attr_get(obj, cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__attr_get(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to get attribute information")
done:
@@ -1449,7 +1484,7 @@ done:
*/
static herr_t
H5VL__attr_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments)
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1460,8 +1495,9 @@ H5VL__attr_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_c
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'attr specific' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->attr_cls.specific)(obj, loc_params, specific_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute attribute specific callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = (cls->attr_cls.specific)(obj, loc_params, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute 'specific' callback");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1479,10 +1515,8 @@ done:
*/
herr_t
H5VL_attr_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, ...)
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1494,17 +1528,12 @@ H5VL_attr_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_pa
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if ((ret_value = H5VL__attr_specific(vol_obj->data, loc_params, vol_obj->connector->cls, specific_type,
- dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute attribute specific callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value =
+ H5VL__attr_specific(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute 'specific' callback");
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -1524,13 +1553,13 @@ done:
*/
herr_t
H5VLattr_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req /*out*/, va_list arguments)
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE7("e", "*x*#iVbixx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments);
+ H5TRACE6("e", "*x*#i*!ix", obj, loc_params, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -1539,8 +1568,9 @@ H5VLattr_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connecto
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__attr_specific(obj, loc_params, cls, specific_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute attribute specific callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = H5VL__attr_specific(obj, loc_params, cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute 'specific' callback");
done:
FUNC_LEAVE_API_NOINIT(ret_value)
@@ -1557,8 +1587,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__attr_optional(void *obj, const H5VL_class_t *cls, H5VL_attr_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__attr_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1569,8 +1598,9 @@ H5VL__attr_optional(void *obj, const H5VL_class_t *cls, H5VL_attr_optional_t opt
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'attr optional' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->attr_cls.optional)(obj, opt_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute attribute optional callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = (cls->attr_cls.optional)(obj, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute optional callback");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1587,11 +1617,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_attr_optional(const H5VL_object_t *vol_obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, void **req,
- ...)
+H5VL_attr_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1603,17 +1630,11 @@ H5VL_attr_optional(const H5VL_object_t *vol_obj, H5VL_attr_optional_t opt_type,
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if ((ret_value = H5VL__attr_optional(vol_obj->data, vol_obj->connector->cls, opt_type, dxpl_id, req,
- arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute attribute optional callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = H5VL__attr_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute optional callback");
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -1632,14 +1653,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLattr_optional(void *obj, hid_t connector_id, H5VL_attr_optional_t opt_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLattr_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVsixx", obj, connector_id, opt_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -1648,14 +1669,58 @@ H5VLattr_optional(void *obj, hid_t connector_id, H5VL_attr_optional_t opt_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__attr_optional(obj, cls, opt_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute attribute optional callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = H5VL__attr_optional(obj, cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute attribute optional callback");
done:
FUNC_LEAVE_API_NOINIT(ret_value)
} /* end H5VLattr_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLattr_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on an attribute
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLattr_optional_op(const char *app_file, const char *app_func, unsigned app_line, hid_t attr_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id)
+{
+ H5VL_object_t *vol_obj = NULL; /* Attribute VOL object */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "*s*sIui*!ii", app_file, app_func, app_line, attr_id, args, dxpl_id, es_id);
+
+ /* Set up request token pointer for asynchronous operation */
+ if (H5ES_NONE != es_id)
+ token_ptr = &token; /* Point at token for VOL connector to set up */
+
+ /* Call the common VOL connector optional routine */
+ if ((ret_value = H5VL__common_optional_op(attr_id, H5I_ATTR, H5VL__attr_optional, args, dxpl_id,
+ token_ptr, &vol_obj)) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute attribute optional callback")
+
+ /* If a token was created, add the token to the event set */
+ if (NULL != token)
+ /* clang-format off */
+ if (H5ES_insert(es_id, vol_obj->connector, token,
+ H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, attr_id, args, dxpl_id, es_id)) < 0)
+ /* clang-format on */
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLattr_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__attr_close
*
* Purpose: Closes an attribute through the VOL
@@ -2169,8 +2234,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__dataset_get(void *obj, const H5VL_class_t *cls, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL__dataset_get(void *obj, const H5VL_class_t *cls, H5VL_dataset_get_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2181,7 +2246,7 @@ H5VL__dataset_get(void *obj, const H5VL_class_t *cls, H5VL_dataset_get_t get_typ
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'dataset get' method")
/* Call the corresponding VOL callback */
- if ((cls->dataset_cls.get)(obj, get_type, dxpl_id, req, arguments) < 0)
+ if ((cls->dataset_cls.get)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "dataset get failed")
done:
@@ -2199,10 +2264,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_dataset_get(const H5VL_object_t *vol_obj, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, ...)
+H5VL_dataset_get(const H5VL_object_t *vol_obj, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2214,16 +2277,10 @@ H5VL_dataset_get(const H5VL_object_t *vol_obj, H5VL_dataset_get_t get_type, hid_
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__dataset_get(vol_obj->data, vol_obj->connector->cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__dataset_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "dataset get failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -2242,14 +2299,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLdataset_get(void *obj, hid_t connector_id, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req /*out*/,
- va_list arguments)
+H5VLdataset_get(void *obj, hid_t connector_id, H5VL_dataset_get_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVcixx", obj, connector_id, get_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -2258,7 +2315,7 @@ H5VLdataset_get(void *obj, hid_t connector_id, H5VL_dataset_get_t get_type, hid_
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__dataset_get(obj, cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__dataset_get(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to execute dataset get callback")
done:
@@ -2276,8 +2333,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__dataset_specific(void *obj, const H5VL_class_t *cls, H5VL_dataset_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments)
+H5VL__dataset_specific(void *obj, const H5VL_class_t *cls, H5VL_dataset_specific_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2288,7 +2345,7 @@ H5VL__dataset_specific(void *obj, const H5VL_class_t *cls, H5VL_dataset_specific
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'dataset specific' method")
/* Call the corresponding VOL callback */
- if ((cls->dataset_cls.specific)(obj, specific_type, dxpl_id, req, arguments) < 0)
+ if ((cls->dataset_cls.specific)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset specific callback")
done:
@@ -2306,11 +2363,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_dataset_specific(const H5VL_object_t *vol_obj, H5VL_dataset_specific_t specific_type, hid_t dxpl_id,
- void **req, ...)
+H5VL_dataset_specific(const H5VL_object_t *vol_obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id,
+ void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2322,17 +2377,10 @@ H5VL_dataset_specific(const H5VL_object_t *vol_obj, H5VL_dataset_specific_t spec
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__dataset_specific(vol_obj->data, vol_obj->connector->cls, specific_type, dxpl_id, req,
- arguments) < 0)
+ if (H5VL__dataset_specific(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset specific callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -2351,14 +2399,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_t specific_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVdixx", obj, connector_id, specific_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -2367,7 +2415,7 @@ H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_t spec
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__dataset_specific(obj, cls, specific_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__dataset_specific(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset specific callback")
done:
@@ -2385,8 +2433,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__dataset_optional(void *obj, const H5VL_class_t *cls, H5VL_dataset_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__dataset_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2397,7 +2445,7 @@ H5VL__dataset_optional(void *obj, const H5VL_class_t *cls, H5VL_dataset_optional
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'dataset optional' method")
/* Call the corresponding VOL callback */
- if ((cls->dataset_cls.optional)(obj, opt_type, dxpl_id, req, arguments) < 0)
+ if ((cls->dataset_cls.optional)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset optional callback")
done:
@@ -2415,11 +2463,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_dataset_optional(const H5VL_object_t *vol_obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id,
- void **req, ...)
+H5VL_dataset_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2431,16 +2476,10 @@ H5VL_dataset_optional(const H5VL_object_t *vol_obj, H5VL_dataset_optional_t opt_
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__dataset_optional(vol_obj->data, vol_obj->connector->cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__dataset_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset optional callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -2459,14 +2498,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLdataset_optional(void *obj, hid_t connector_id, H5VL_dataset_optional_t opt_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLdataset_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVtixx", obj, connector_id, opt_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -2475,7 +2514,7 @@ H5VLdataset_optional(void *obj, hid_t connector_id, H5VL_dataset_optional_t opt_
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__dataset_optional(obj, cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__dataset_optional(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset optional callback")
done:
@@ -2483,6 +2522,49 @@ done:
} /* end H5VLdataset_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLdataset_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on a dataset
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLdataset_optional_op(const char *app_file, const char *app_func, unsigned app_line, hid_t dset_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id)
+{
+ H5VL_object_t *vol_obj = NULL; /* Dataset VOL object */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "*s*sIui*!ii", app_file, app_func, app_line, dset_id, args, dxpl_id, es_id);
+
+ /* Set up request token pointer for asynchronous operation */
+ if (H5ES_NONE != es_id)
+ token_ptr = &token; /* Point at token for VOL connector to set up */
+
+ /* Call the corresponding internal VOL routine */
+ if (H5VL__common_optional_op(dset_id, H5I_DATASET, H5VL__dataset_optional, args, dxpl_id, token_ptr,
+ &vol_obj) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute dataset optional callback")
+
+ /* If a token was created, add the token to the event set */
+ if (NULL != token)
+ /* clang-format off */
+ if (H5ES_insert(es_id, vol_obj->connector, token,
+ H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, dset_id, args, dxpl_id, es_id)) < 0)
+ /* clang-format on */
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLdataset_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__dataset_close
*
* Purpose: Closes a dataset through the VOL
@@ -2807,8 +2889,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__datatype_get(void *obj, const H5VL_class_t *cls, H5VL_datatype_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__datatype_get(void *obj, const H5VL_class_t *cls, H5VL_datatype_get_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2819,8 +2901,8 @@ H5VL__datatype_get(void *obj, const H5VL_class_t *cls, H5VL_datatype_get_t get_t
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'datatype get' method")
/* Call the corresponding VOL callback */
- if ((cls->datatype_cls.get)(obj, get_type, dxpl_id, req, arguments) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "datatype get failed")
+ if ((cls->datatype_cls.get)(obj, args, dxpl_id, req) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "datatype 'get' failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -2837,10 +2919,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_datatype_get(const H5VL_object_t *vol_obj, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, ...)
+H5VL_datatype_get(const H5VL_object_t *vol_obj, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2852,16 +2932,10 @@ H5VL_datatype_get(const H5VL_object_t *vol_obj, H5VL_datatype_get_t get_type, hi
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__datatype_get(vol_obj->data, vol_obj->connector->cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__datatype_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "datatype get failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -2880,14 +2954,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLdatatype_get(void *obj, hid_t connector_id, H5VL_datatype_get_t get_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLdatatype_get(void *obj, hid_t connector_id, H5VL_datatype_get_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVeixx", obj, connector_id, get_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -2895,12 +2969,8 @@ H5VLdatatype_get(void *obj, hid_t connector_id, H5VL_datatype_get_t get_type, hi
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
- /* Check if the corresponding VOL callback exists */
- if (NULL == cls->datatype_cls.get)
- HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no `datatype get' method")
-
/* Call the corresponding internal VOL routine */
- if (H5VL__datatype_get(obj, cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__datatype_get(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to execute datatype get callback")
done:
@@ -2918,8 +2988,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__datatype_specific(void *obj, const H5VL_class_t *cls, H5VL_datatype_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments)
+H5VL__datatype_specific(void *obj, const H5VL_class_t *cls, H5VL_datatype_specific_args_t *args,
+ hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2930,7 +3000,7 @@ H5VL__datatype_specific(void *obj, const H5VL_class_t *cls, H5VL_datatype_specif
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'datatype specific' method")
/* Call the corresponding VOL callback */
- if ((cls->datatype_cls.specific)(obj, specific_type, dxpl_id, req, arguments) < 0)
+ if ((cls->datatype_cls.specific)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype specific callback")
done:
@@ -2948,11 +3018,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_datatype_specific(const H5VL_object_t *vol_obj, H5VL_datatype_specific_t specific_type, hid_t dxpl_id,
- void **req, ...)
+H5VL_datatype_specific(const H5VL_object_t *vol_obj, H5VL_datatype_specific_args_t *args, hid_t dxpl_id,
+ void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2964,17 +3032,10 @@ H5VL_datatype_specific(const H5VL_object_t *vol_obj, H5VL_datatype_specific_t sp
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__datatype_specific(vol_obj->data, vol_obj->connector->cls, specific_type, dxpl_id, req,
- arguments) < 0)
+ if (H5VL__datatype_specific(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype specific callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -2993,14 +3054,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_t specific_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVfixx", obj, connector_id, specific_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -3009,7 +3070,7 @@ H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_t sp
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__datatype_specific(obj, cls, specific_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__datatype_specific(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype specific callback")
done:
@@ -3027,8 +3088,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__datatype_optional(void *obj, const H5VL_class_t *cls, H5VL_datatype_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__datatype_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -3039,7 +3100,7 @@ H5VL__datatype_optional(void *obj, const H5VL_class_t *cls, H5VL_datatype_option
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'datatype optional' method")
/* Call the corresponding VOL callback */
- if ((cls->datatype_cls.optional)(obj, opt_type, dxpl_id, req, arguments) < 0)
+ if ((cls->datatype_cls.optional)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback")
done:
@@ -3057,11 +3118,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_datatype_optional(const H5VL_object_t *vol_obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id,
- void **req, ...)
+H5VL_datatype_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3073,17 +3131,10 @@ H5VL_datatype_optional(const H5VL_object_t *vol_obj, H5VL_datatype_optional_t op
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__datatype_optional(vol_obj->data, vol_obj->connector->cls, opt_type, dxpl_id, req, arguments) <
- 0)
+ if (H5VL__datatype_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -3092,6 +3143,50 @@ done:
} /* end H5VL_datatype_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VL_datatype_optional_op
+ *
+ * Purpose: Optional operation specific to connectors.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_datatype_optional_op(H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req,
+ H5VL_object_t **_vol_obj_ptr)
+{
+ H5VL_object_t * tmp_vol_obj = NULL; /* Object for id */
+ H5VL_object_t **vol_obj_ptr = (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for id */
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vol_obj);
+
+ /* Set up vol_obj_ptr */
+ *vol_obj_ptr = vol_obj;
+
+ /* Set wrapper info in API context */
+ if (H5VL_set_vol_wrapper(*vol_obj_ptr) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
+ vol_wrapper_set = TRUE;
+
+ /* Call the corresponding internal VOL routine */
+ if (H5VL__datatype_optional((*vol_obj_ptr)->data, (*vol_obj_ptr)->connector->cls, args, dxpl_id, req) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback")
+
+done:
+ /* Reset object wrapping info in API context */
+ if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
+ HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_datatype_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VLdatatype_optional
*
* Purpose: Performs an optional connector-specific operation on a datatype
@@ -3102,14 +3197,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLdatatype_optional(void *obj, hid_t connector_id, H5VL_datatype_optional_t opt_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLdatatype_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVuixx", obj, connector_id, opt_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -3118,7 +3213,7 @@ H5VLdatatype_optional(void *obj, hid_t connector_id, H5VL_datatype_optional_t op
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__datatype_optional(obj, cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__datatype_optional(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute datatype optional callback")
done:
@@ -3126,6 +3221,53 @@ done:
} /* end H5VLdatatype_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLdatatype_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on a datatype
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLdatatype_optional_op(const char *app_file, const char *app_func, unsigned app_line, hid_t type_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id)
+{
+ H5T_t * dt; /* Datatype for this operation */
+ H5VL_object_t *vol_obj = NULL; /* Datatype VOL object */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "*s*sIui*!ii", app_file, app_func, app_line, type_id, args, dxpl_id, es_id);
+
+ /* Check args */
+ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+
+ /* Set up request token pointer for asynchronous operation */
+ if (H5ES_NONE != es_id)
+ token_ptr = &token; /* Point at token for VOL connector to set up */
+
+ /* Only invoke callback if VOL object is set for the datatype */
+ if (H5T_invoke_vol_optional(dt, args, dxpl_id, token_ptr, &vol_obj) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to invoke datatype optional callback")
+
+ /* If a token was created, add the token to the event set */
+ if (NULL != token)
+ /* clang-format off */
+ if (H5ES_insert(es_id, vol_obj->connector, token,
+ H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, type_id, args, dxpl_id, es_id)) < 0)
+ /* clang-format on */
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLdatatype_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__datatype_close
*
* Purpose: Closes a datatype through the VOL
@@ -3380,14 +3522,15 @@ static herr_t
H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_info, void *op_data)
{
H5VL_file_open_find_connector_t *udata = (H5VL_file_open_find_connector_t *)op_data;
- const H5VL_class_t * cls = (const H5VL_class_t *)plugin_info;
+ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */
+ const H5VL_class_t * cls = (const H5VL_class_t *)plugin_info;
H5P_genplist_t * fapl_plist;
H5P_genplist_t * fapl_plist_copy;
+ hbool_t is_accessible = FALSE; /* Whether file is accessible */
herr_t status;
- htri_t is_accessible = FALSE;
- hid_t connector_id = H5I_INVALID_HID;
- hid_t fapl_id = H5I_INVALID_HID;
- herr_t ret_value = H5_ITER_CONT;
+ hid_t connector_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ herr_t ret_value = H5_ITER_CONT;
FUNC_ENTER_STATIC
@@ -3416,11 +3559,16 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in
if (H5P_set_vol(fapl_plist_copy, connector_id, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5_ITER_ERROR, "can't set VOL connector on fapl")
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_IS_ACCESSIBLE;
+ vol_cb_args.args.is_accessible.filename = udata->filename;
+ vol_cb_args.args.is_accessible.fapl_id = fapl_id;
+ vol_cb_args.args.is_accessible.accessible = &is_accessible;
+
/* Check if file is accessible with given VOL connector */
H5E_BEGIN_TRY
{
- status = H5VL_file_specific(NULL, H5VL_FILE_IS_ACCESSIBLE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- fapl_id, udata->filename, &is_accessible);
+ status = H5VL_file_specific(NULL, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL);
}
H5E_END_TRY;
@@ -3428,7 +3576,7 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in
* the FAPL with that VOL connector set on it. Errors are ignored here
* as some VOL connectors may not support H5Fis_accessible.
*/
- if (status == SUCCEED && is_accessible > 0) {
+ if (status == SUCCEED && is_accessible) {
/* Modify 'connector_prop' to point to the VOL connector that
* was actually used to open the file, rather than the original
* VOL connector that was requested.
@@ -3479,21 +3627,18 @@ H5VL_file_open(H5VL_connector_prop_t *connector_prop, const char *name, unsigned
/* Call the corresponding internal VOL routine */
if (NULL == (ret_value = H5VL__file_open(cls, name, flags, fapl_id, dxpl_id, req))) {
- H5VL_file_open_find_connector_t find_connector_ud;
- hbool_t find_connector;
- hbool_t connector_available = FALSE;
+ hbool_t is_default_conn = TRUE;
/* Opening the file failed - Determine whether we should search
* the plugin path to see if any other VOL connectors are available
- * to attempt to open the file with. This only occurs if no particular
- * VOL connector was specified (either via a FAPL or the
- * HDF5_VOL_CONNECTOR environment variable).
+ * to attempt to open the file with. This only occurs if the default
+ * VOL connector was used for the initial file open attempt.
*/
- find_connector = !getenv("HDF5_VOL_CONNECTOR") && ((H5P_FILE_ACCESS_DEFAULT == fapl_id) ||
- connector_prop->connector_id == H5_DEFAULT_VOL);
+ H5VL__is_default_conn(fapl_id, connector_prop->connector_id, &is_default_conn);
- if (find_connector) {
- herr_t iter_ret;
+ if (is_default_conn) {
+ H5VL_file_open_find_connector_t find_connector_ud;
+ herr_t iter_ret;
find_connector_ud.connector_prop = connector_prop;
find_connector_ud.filename = name;
@@ -3505,24 +3650,24 @@ H5VL_file_open(H5VL_connector_prop_t *connector_prop, const char *name, unsigned
if (iter_ret < 0)
HGOTO_ERROR(H5E_VOL, H5E_BADITER, NULL,
"failed to iterate over available VOL connector plugins")
- else if (iter_ret)
- connector_available = TRUE;
+ else if (iter_ret) {
+ /* If one of the available VOL connector plugins is
+ * able to open the file, clear the error stack from any
+ * previous file open failures and then open the file.
+ * Otherwise, if no VOL connectors are available, throw
+ * error from original file open failure.
+ */
+ H5E_clear_stack(NULL);
+
+ if (NULL == (ret_value = H5VL__file_open(find_connector_ud.cls, name, flags,
+ find_connector_ud.fapl_id, dxpl_id, req)))
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL,
+ "can't open file '%s' with VOL connector '%s'", name,
+ find_connector_ud.cls->name)
+ }
+ else
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "open failed")
} /* end if */
-
- /* If one of the available VOL connector plugins is
- * able to open the file, clear the error stack from any
- * previous file open failures and then open the file.
- * Otherwise, if no VOL connectors are available, throw
- * error from original file open failure.
- */
- if (connector_available) {
- H5E_clear_stack(NULL);
-
- if (NULL == (ret_value = H5VL__file_open(find_connector_ud.cls, name, flags,
- find_connector_ud.fapl_id, dxpl_id, req)))
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "can't open file '%s' with VOL connector '%s'",
- name, find_connector_ud.cls->name)
- }
else
HGOTO_ERROR(H5E_VOL, H5E_CANTOPENOBJ, NULL, "open failed")
} /* end if */
@@ -3581,8 +3726,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__file_get(void *obj, const H5VL_class_t *cls, H5VL_file_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL__file_get(void *obj, const H5VL_class_t *cls, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -3593,7 +3737,7 @@ H5VL__file_get(void *obj, const H5VL_class_t *cls, H5VL_file_get_t get_type, hid
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'file get' method")
/* Call the corresponding VOL callback */
- if ((cls->file_cls.get)(obj, get_type, dxpl_id, req, arguments) < 0)
+ if ((cls->file_cls.get)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "file get failed")
done:
@@ -3611,10 +3755,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_file_get(const H5VL_object_t *vol_obj, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, ...)
+H5VL_file_get(const H5VL_object_t *vol_obj, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3626,16 +3768,10 @@ H5VL_file_get(const H5VL_object_t *vol_obj, H5VL_file_get_t get_type, hid_t dxpl
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__file_get(vol_obj->data, vol_obj->connector->cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__file_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "file get failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -3654,14 +3790,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLfile_get(void *obj, hid_t connector_id, H5VL_file_get_t get_type, hid_t dxpl_id, void **req /*out*/,
- va_list arguments)
+H5VLfile_get(void *obj, hid_t connector_id, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVgixx", obj, connector_id, get_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -3670,7 +3805,7 @@ H5VLfile_get(void *obj, hid_t connector_id, H5VL_file_get_t get_type, hid_t dxpl
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__file_get(obj, cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__file_get(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to execute file get callback")
done:
@@ -3688,8 +3823,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__file_specific(void *obj, const H5VL_class_t *cls, H5VL_file_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__file_specific(void *obj, const H5VL_class_t *cls, H5VL_file_specific_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -3700,7 +3835,7 @@ H5VL__file_specific(void *obj, const H5VL_class_t *cls, H5VL_file_specific_t spe
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'file specific' method")
/* Call the corresponding VOL callback */
- if ((cls->file_cls.specific)(obj, specific_type, dxpl_id, req, arguments) < 0)
+ if ((cls->file_cls.specific)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file specific failed")
done:
@@ -3718,33 +3853,28 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_t specific_type, hid_t dxpl_id,
- void **req, ...)
+H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req)
{
const H5VL_class_t *cls; /* VOL connector's class struct */
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- /* Start access to the varargs, so they are available in all situations below */
- HDva_start(arguments, req);
- arg_started = TRUE;
-
/* Special treatment of file access check & delete operations */
/* (Retrieve the VOL connector from the FAPL, since the file isn't open) */
- if (specific_type == H5VL_FILE_IS_ACCESSIBLE || specific_type == H5VL_FILE_DELETE) {
+ if (args->op_type == H5VL_FILE_IS_ACCESSIBLE || args->op_type == H5VL_FILE_DELETE) {
H5P_genplist_t * plist; /* Property list pointer */
H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
- va_list tmp_args; /* argument list passed from the API call */
hid_t fapl_id; /* File access property list for accessing the file */
/* Get the file access property list to access the file */
- HDva_copy(tmp_args, arguments);
- fapl_id = HDva_arg(tmp_args, hid_t);
- HDva_end(tmp_args);
+ if (args->op_type == H5VL_FILE_IS_ACCESSIBLE)
+ fapl_id = args->args.is_accessible.fapl_id;
+ else {
+ HDassert(args->op_type == H5VL_FILE_DELETE);
+ fapl_id = args->args.del.fapl_id;
+ }
/* Get the VOL info from the FAPL */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
@@ -3770,14 +3900,10 @@ H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_t specific_t
} /* end else */
/* Call the corresponding internal VOL routine */
- if (H5VL__file_specific(vol_obj ? vol_obj->data : NULL, cls, specific_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__file_specific(vol_obj ? vol_obj->data : NULL, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file specific failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -3798,21 +3924,21 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLfile_specific(void *obj, hid_t connector_id, H5VL_file_specific_t specific_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLfile_specific(void *obj, hid_t connector_id, H5VL_file_specific_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVhixx", obj, connector_id, specific_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__file_specific(obj, cls, specific_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__file_specific(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute file specific callback")
done:
@@ -3830,8 +3956,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__file_optional(void *obj, const H5VL_class_t *cls, H5VL_file_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__file_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -3842,7 +3967,7 @@ H5VL__file_optional(void *obj, const H5VL_class_t *cls, H5VL_file_optional_t opt
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'file optional' method")
/* Call the corresponding VOL callback */
- if ((cls->file_cls.optional)(obj, opt_type, dxpl_id, req, arguments) < 0)
+ if ((cls->file_cls.optional)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file optional failed")
done:
@@ -3860,11 +3985,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_file_optional(const H5VL_object_t *vol_obj, H5VL_file_optional_t opt_type, hid_t dxpl_id, void **req,
- ...)
+H5VL_file_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3876,16 +3998,10 @@ H5VL_file_optional(const H5VL_object_t *vol_obj, H5VL_file_optional_t opt_type,
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__file_optional(vol_obj->data, vol_obj->connector->cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__file_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file optional failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -3904,14 +4020,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLfile_optional(void *obj, hid_t connector_id, H5VL_file_optional_t opt_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLfile_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVvixx", obj, connector_id, opt_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -3920,7 +4036,7 @@ H5VLfile_optional(void *obj, hid_t connector_id, H5VL_file_optional_t opt_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__file_optional(obj, cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__file_optional(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute file optional callback")
done:
@@ -3928,6 +4044,49 @@ done:
} /* end H5VLfile_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLfile_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on a file
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLfile_optional_op(const char *app_file, const char *app_func, unsigned app_line, hid_t file_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id)
+{
+ H5VL_object_t *vol_obj = NULL; /* File VOL object */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "*s*sIui*!ii", app_file, app_func, app_line, file_id, args, dxpl_id, es_id);
+
+ /* Set up request token pointer for asynchronous operation */
+ if (H5ES_NONE != es_id)
+ token_ptr = &token; /* Point at token for VOL connector to set up */
+
+ /* Call the corresponding internal VOL routine */
+ if (H5VL__common_optional_op(file_id, H5I_FILE, H5VL__file_optional, args, dxpl_id, token_ptr, &vol_obj) <
+ 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute file optional callback")
+
+ /* If a token was created, add the token to the event set */
+ if (NULL != token)
+ /* clang-format off */
+ if (H5ES_insert(es_id, vol_obj->connector, token,
+ H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, file_id, args, dxpl_id, es_id)) < 0)
+ /* clang-format on */
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLfile_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__file_close
*
* Purpose: Closes a file through the VOL
@@ -4244,8 +4403,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__group_get(void *obj, const H5VL_class_t *cls, H5VL_group_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL__group_get(void *obj, const H5VL_class_t *cls, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -4256,7 +4414,7 @@ H5VL__group_get(void *obj, const H5VL_class_t *cls, H5VL_group_get_t get_type, h
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'group get' method")
/* Call the corresponding VOL callback */
- if ((cls->group_cls.get)(obj, get_type, dxpl_id, req, arguments) < 0)
+ if ((cls->group_cls.get)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "group get failed")
done:
@@ -4274,10 +4432,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_group_get(const H5VL_object_t *vol_obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, ...)
+H5VL_group_get(const H5VL_object_t *vol_obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -4289,16 +4445,10 @@ H5VL_group_get(const H5VL_object_t *vol_obj, H5VL_group_get_t get_type, hid_t dx
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__group_get(vol_obj->data, vol_obj->connector->cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__group_get(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "group get failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -4317,14 +4467,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_t get_type, hid_t dxpl_id, void **req /*out*/,
- va_list arguments)
+H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiViixx", obj, connector_id, get_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -4333,7 +4482,7 @@ H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_t get_type, hid_t dx
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__group_get(obj, cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__group_get(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to execute group get callback")
done:
@@ -4351,8 +4500,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__group_specific(void *obj, const H5VL_class_t *cls, H5VL_group_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__group_specific(void *obj, const H5VL_class_t *cls, H5VL_group_specific_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -4363,7 +4512,7 @@ H5VL__group_specific(void *obj, const H5VL_class_t *cls, H5VL_group_specific_t s
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'group specific' method")
/* Call the corresponding VOL callback */
- if ((cls->group_cls.specific)(obj, specific_type, dxpl_id, req, arguments) < 0)
+ if ((cls->group_cls.specific)(obj, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group specific callback")
done:
@@ -4381,11 +4530,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_group_specific(const H5VL_object_t *vol_obj, H5VL_group_specific_t specific_type, hid_t dxpl_id,
- void **req, ...)
+H5VL_group_specific(const H5VL_object_t *vol_obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -4397,17 +4543,10 @@ H5VL_group_specific(const H5VL_object_t *vol_obj, H5VL_group_specific_t specific
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__group_specific(vol_obj->data, vol_obj->connector->cls, specific_type, dxpl_id, req, arguments) <
- 0)
+ if (H5VL__group_specific(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group specific callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -4426,14 +4565,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_t specific_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVjixx", obj, connector_id, specific_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -4442,7 +4581,7 @@ H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_t specific
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__group_specific(obj, cls, specific_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__group_specific(obj, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group specific callback")
done:
@@ -4460,8 +4599,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__group_optional(void *obj, const H5VL_class_t *cls, H5VL_group_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__group_optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -4472,8 +4611,9 @@ H5VL__group_optional(void *obj, const H5VL_class_t *cls, H5VL_group_optional_t o
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'group optional' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->group_cls.optional)(obj, opt_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group optional callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = (cls->group_cls.optional)(obj, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute group optional callback");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -4490,11 +4630,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_group_optional(const H5VL_object_t *vol_obj, H5VL_group_optional_t opt_type, hid_t dxpl_id, void **req,
- ...)
+H5VL_group_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -4506,17 +4643,11 @@ H5VL_group_optional(const H5VL_object_t *vol_obj, H5VL_group_optional_t opt_type
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if ((ret_value = H5VL__group_optional(vol_obj->data, vol_obj->connector->cls, opt_type, dxpl_id, req,
- arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group optional callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = H5VL__group_optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute group optional callback");
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -4535,14 +4666,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_group_optional_t opt_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVwixx", obj, connector_id, opt_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -4551,14 +4682,58 @@ H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_group_optional_t opt_type
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__group_optional(obj, cls, opt_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group optional callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = H5VL__group_optional(obj, cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute group optional callback");
done:
FUNC_LEAVE_API_NOINIT(ret_value)
} /* end H5VLgroup_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLgroup_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on a group
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLgroup_optional_op(const char *app_file, const char *app_func, unsigned app_line, hid_t group_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id)
+{
+ H5VL_object_t *vol_obj = NULL; /* Group VOL object */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "*s*sIui*!ii", app_file, app_func, app_line, group_id, args, dxpl_id, es_id);
+
+ /* Set up request token pointer for asynchronous operation */
+ if (H5ES_NONE != es_id)
+ token_ptr = &token; /* Point at token for VOL connector to set up */
+
+ /* Call the corresponding internal VOL routine */
+ if ((ret_value = H5VL__common_optional_op(group_id, H5I_GROUP, H5VL__group_optional, args, dxpl_id,
+ token_ptr, &vol_obj)) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute group optional callback")
+
+ /* If a token was created, add the token to the event set */
+ if (NULL != token)
+ /* clang-format off */
+ if (H5ES_insert(es_id, vol_obj->connector, token,
+ H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, group_id, args, dxpl_id, es_id)) < 0)
+ /* clang-format on */
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLgroup_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__group_close
*
* Purpose: Closes a group through the VOL
@@ -4672,9 +4847,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__link_create(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc_params_t *loc_params,
- const H5VL_class_t *cls, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL__link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
+ const H5VL_class_t *cls, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -4685,7 +4859,7 @@ H5VL__link_create(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'link create' method")
/* Call the corresponding VOL callback */
- if ((cls->link_cls.create)(create_type, obj, loc_params, lcpl_id, lapl_id, dxpl_id, req, arguments) < 0)
+ if ((cls->link_cls.create)(args, obj, loc_params, lcpl_id, lapl_id, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "link create failed")
done:
@@ -4703,31 +4877,19 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_link_create(H5VL_link_create_type_t create_type, const H5VL_object_t *vol_obj,
- const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req,
- ...)
+H5VL_link_create(H5VL_link_create_args_t *args, const H5VL_object_t *vol_obj,
+ const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req)
{
- H5VL_object_t tmp_vol_obj; /* Temporary object */
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
+ H5VL_object_t tmp_vol_obj; /* Temporary VOL object */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- /* Start the varargs, so they can be copied */
- HDva_start(arguments, req);
- arg_started = TRUE;
-
/* Special case for hard links */
- if (H5VL_LINK_CREATE_HARD == create_type && NULL == vol_obj->data) {
- va_list tmp_arguments; /* Copy of argument list passed in */
-
- /* Get the VOL data pointer from the varargs */
- HDva_copy(tmp_arguments, arguments);
- tmp_vol_obj.data = HDva_arg(tmp_arguments, void *);
- HDva_end(tmp_arguments);
- } /* end if */
+ if (H5VL_LINK_CREATE_HARD == args->op_type && NULL == vol_obj->data)
+ /* Get the VOL data pointer from the arguments */
+ tmp_vol_obj.data = args->args.hard.curr_obj;
else
/* Use the VOL object passed in */
tmp_vol_obj.data = vol_obj->data;
@@ -4739,15 +4901,11 @@ H5VL_link_create(H5VL_link_create_type_t create_type, const H5VL_object_t *vol_o
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- if (H5VL__link_create(create_type, vol_obj->data, loc_params, vol_obj->connector->cls, lcpl_id, lapl_id,
- dxpl_id, req, arguments) < 0)
+ if (H5VL__link_create(args, vol_obj->data, loc_params, vol_obj->connector->cls, lcpl_id, lapl_id, dxpl_id,
+ req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "link create failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -4768,23 +4926,21 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLlink_create(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc_params_t *loc_params,
- hid_t connector_id, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req /*out*/,
- va_list arguments)
+H5VLlink_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
+ hid_t connector_id, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE9("e", "Vk*x*#iiiixx", create_type, obj, loc_params, connector_id, lcpl_id, lapl_id, dxpl_id, req,
- arguments);
+ H5TRACE8("e", "*!*x*#iiiix", args, obj, loc_params, connector_id, lcpl_id, lapl_id, dxpl_id, req);
/* Get class pointer */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__link_create(create_type, obj, loc_params, cls, lcpl_id, lapl_id, dxpl_id, req, arguments) < 0)
+ if (H5VL__link_create(args, obj, loc_params, cls, lcpl_id, lapl_id, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "unable to create link")
done:
@@ -5017,7 +5173,7 @@ done:
*/
static herr_t
H5VL__link_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments)
+ H5VL_link_get_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -5028,7 +5184,7 @@ H5VL__link_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'link get' method")
/* Call the corresponding VOL callback */
- if ((cls->link_cls.get)(obj, loc_params, get_type, dxpl_id, req, arguments) < 0)
+ if ((cls->link_cls.get)(obj, loc_params, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "link get failed")
done:
@@ -5046,11 +5202,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_link_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type,
- hid_t dxpl_id, void **req, ...)
+H5VL_link_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args,
+ hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5062,17 +5216,10 @@ H5VL_link_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__link_get(vol_obj->data, loc_params, vol_obj->connector->cls, get_type, dxpl_id, req,
- arguments) < 0)
+ if (H5VL__link_get(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "link get failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -5091,14 +5238,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLlink_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, H5VL_link_get_t get_type,
- hid_t dxpl_id, void **req /*out*/, va_list arguments)
+H5VLlink_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, H5VL_link_get_args_t *args,
+ hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE7("e", "*x*#iVlixx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments);
+ H5TRACE6("e", "*x*#i*!ix", obj, loc_params, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -5107,7 +5254,7 @@ H5VLlink_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__link_get(obj, loc_params, cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__link_get(obj, loc_params, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to execute link get callback")
done:
@@ -5126,7 +5273,7 @@ done:
*/
static herr_t
H5VL__link_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments)
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -5137,8 +5284,9 @@ H5VL__link_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_c
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'link specific' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->link_cls.specific)(obj, loc_params, specific_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link specific callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = (cls->link_cls.specific)(obj, loc_params, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute link specific callback");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -5156,10 +5304,8 @@ done:
*/
herr_t
H5VL_link_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, ...)
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5171,17 +5317,12 @@ H5VL_link_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_pa
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if ((ret_value = H5VL__link_specific(vol_obj->data, loc_params, vol_obj->connector->cls, specific_type,
- dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link specific callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value =
+ H5VL__link_specific(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute link specific callback");
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -5201,13 +5342,13 @@ done:
*/
herr_t
H5VLlink_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req /*out*/, va_list arguments)
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE7("e", "*x*#iVmixx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments);
+ H5TRACE6("e", "*x*#i*!ix", obj, loc_params, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -5216,8 +5357,9 @@ H5VLlink_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connecto
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__link_specific(obj, loc_params, cls, specific_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link specific callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = H5VL__link_specific(obj, loc_params, cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute link specific callback");
done:
FUNC_LEAVE_API_NOINIT(ret_value)
@@ -5234,8 +5376,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__link_optional(void *obj, const H5VL_class_t *cls, H5VL_link_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__link_optional(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -5246,7 +5388,7 @@ H5VL__link_optional(void *obj, const H5VL_class_t *cls, H5VL_link_optional_t opt
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'link optional' method")
/* Call the corresponding VOL callback */
- if ((cls->link_cls.optional)(obj, opt_type, dxpl_id, req, arguments) < 0)
+ if ((cls->link_cls.optional)(obj, loc_params, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link optional callback")
done:
@@ -5264,11 +5406,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_link_optional(const H5VL_object_t *vol_obj, H5VL_link_optional_t opt_type, hid_t dxpl_id, void **req,
- ...)
+H5VL_link_optional(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5280,16 +5420,10 @@ H5VL_link_optional(const H5VL_object_t *vol_obj, H5VL_link_optional_t opt_type,
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__link_optional(vol_obj->data, vol_obj->connector->cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__link_optional(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link optional callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -5308,14 +5442,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLlink_optional(void *obj, hid_t connector_id, H5VL_link_optional_t opt_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLlink_optional(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVxixx", obj, connector_id, opt_type, dxpl_id, req, arguments);
+ H5TRACE6("e", "*x*#i*!ix", obj, loc_params, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -5324,7 +5458,7 @@ H5VLlink_optional(void *obj, hid_t connector_id, H5VL_link_optional_t opt_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__link_optional(obj, cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__link_optional(obj, loc_params, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link optional callback")
done:
@@ -5332,6 +5466,67 @@ done:
} /* end H5VLlink_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLlink_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on a link
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
+ const char *name, hid_t lapl_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id)
+{
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id,
+ es_id);
+
+ /* Check arguments */
+ /* name is verified in H5VL_setup_name_args() */
+
+ /* Set up object access arguments */
+ if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, &vol_obj, &loc_params) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set link access arguments")
+
+ /* Set up request token pointer for asynchronous operation */
+ if (H5ES_NONE != es_id)
+ token_ptr = &token; /* Point at token for VOL connector to set up */
+
+ /* Set wrapper info in API context */
+ if (H5VL_set_vol_wrapper(vol_obj) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
+ vol_wrapper_set = TRUE;
+
+ /* Call the corresponding internal VOL routine */
+ if (H5VL__link_optional(vol_obj->data, &loc_params, vol_obj->connector->cls, args, dxpl_id, token_ptr) <
+ 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute link optional callback")
+
+ /* If a token was created, add the token to the event set */
+ if (NULL != token)
+ /* clang-format off */
+ if (H5ES_insert(es_id, vol_obj->connector, token, H5ARG_TRACE9(__func__, "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id)) < 0)
+ /* clang-format on */
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+
+done:
+ /* Reset object wrapping info in API context */
+ if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
+ HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
+
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLlink_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__object_open
*
* Purpose: Opens a object through the VOL
@@ -5556,7 +5751,7 @@ done:
*/
static herr_t
H5VL__object_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments)
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -5567,7 +5762,7 @@ H5VL__object_get(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_clas
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'object get' method")
/* Call the corresponding VOL callback */
- if ((cls->object_cls.get)(obj, loc_params, get_type, dxpl_id, req, arguments) < 0)
+ if ((cls->object_cls.get)(obj, loc_params, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed")
done:
@@ -5585,11 +5780,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_object_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type,
- hid_t dxpl_id, void **req, ...)
+H5VL_object_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5601,17 +5794,10 @@ H5VL_object_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_param
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__object_get(vol_obj->data, loc_params, vol_obj->connector->cls, get_type, dxpl_id, req,
- arguments) < 0)
+ if (H5VL__object_get(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -5630,14 +5816,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLobject_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, H5VL_object_get_t get_type,
- hid_t dxpl_id, void **req /*out*/, va_list arguments)
+H5VLobject_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE7("e", "*x*#iVnixx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments);
+ H5TRACE6("e", "*x*#i*!ix", obj, loc_params, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -5646,7 +5832,7 @@ H5VLobject_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_i
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__object_get(obj, loc_params, cls, get_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__object_get(obj, loc_params, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "unable to execute object get callback")
done:
@@ -5665,7 +5851,7 @@ done:
*/
static herr_t
H5VL__object_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments)
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -5676,8 +5862,9 @@ H5VL__object_specific(void *obj, const H5VL_loc_params_t *loc_params, const H5VL
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'object specific' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->object_cls.specific)(obj, loc_params, specific_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "object specific failed")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = (cls->object_cls.specific)(obj, loc_params, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "object specific failed");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -5695,10 +5882,8 @@ done:
*/
herr_t
H5VL_object_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, ...)
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5710,17 +5895,12 @@ H5VL_object_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if ((ret_value = H5VL__object_specific(vol_obj->data, loc_params, vol_obj->connector->cls, specific_type,
- dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "object specific failed")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = H5VL__object_specific(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id,
+ req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "object specific failed");
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -5740,14 +5920,13 @@ done:
*/
herr_t
H5VLobject_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req /*out*/,
- va_list arguments)
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE7("e", "*x*#iVoixx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments);
+ H5TRACE6("e", "*x*#i*!ix", obj, loc_params, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -5755,13 +5934,10 @@ H5VLobject_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connec
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
- /* Check if the corresponding VOL callback exists */
- if (NULL == cls->object_cls.specific)
- HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no `object specific' method")
-
/* Bypass the H5VLint layer, calling the VOL callback directly */
- if ((ret_value = (cls->object_cls.specific)(obj, loc_params, specific_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute object specific callback")
+ /* (Must return value from callback, for iterators) */
+ if ((ret_value = (cls->object_cls.specific)(obj, loc_params, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute object specific callback");
done:
FUNC_LEAVE_API_NOINIT(ret_value)
@@ -5778,8 +5954,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__object_optional(void *obj, const H5VL_class_t *cls, H5VL_object_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL__object_optional(void *obj, const H5VL_loc_params_t *loc_params, const H5VL_class_t *cls,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -5790,7 +5966,7 @@ H5VL__object_optional(void *obj, const H5VL_class_t *cls, H5VL_object_optional_t
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'object optional' method")
/* Call the corresponding VOL callback */
- if ((cls->object_cls.optional)(obj, opt_type, dxpl_id, req, arguments) < 0)
+ if ((cls->object_cls.optional)(obj, loc_params, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute object optional callback")
done:
@@ -5808,11 +5984,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_object_optional(const H5VL_object_t *vol_obj, H5VL_object_optional_t opt_type, hid_t dxpl_id, void **req,
- ...)
+H5VL_object_optional(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5824,16 +5998,10 @@ H5VL_object_optional(const H5VL_object_t *vol_obj, H5VL_object_optional_t opt_ty
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if (H5VL__object_optional(vol_obj->data, vol_obj->connector->cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__object_optional(vol_obj->data, loc_params, vol_obj->connector->cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute object optional callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
@@ -5852,14 +6020,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLobject_optional(void *obj, hid_t connector_id, H5VL_object_optional_t opt_type, hid_t dxpl_id,
- void **req /*out*/, va_list arguments)
+H5VLobject_optional(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiVyixx", obj, connector_id, opt_type, dxpl_id, req, arguments);
+ H5TRACE6("e", "*x*#i*!ix", obj, loc_params, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -5868,7 +6036,7 @@ H5VLobject_optional(void *obj, hid_t connector_id, H5VL_object_optional_t opt_ty
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if (H5VL__object_optional(obj, cls, opt_type, dxpl_id, req, arguments) < 0)
+ if (H5VL__object_optional(obj, loc_params, cls, args, dxpl_id, req) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute object optional callback")
done:
@@ -5876,6 +6044,68 @@ done:
} /* end H5VLobject_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLobject_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on an object
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
+ const char *name, hid_t lapl_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ hid_t es_id)
+{
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ void * token = NULL; /* Request token for async operation */
+ void ** token_ptr = H5_REQUEST_NULL; /* Pointer to request token for async operation */
+ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE9("e", "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id,
+ es_id);
+
+ /* Check arguments */
+ /* name is verified in H5VL_setup_name_args() */
+
+ /* Set up object access arguments */
+ if (H5VL_setup_name_args(loc_id, name, FALSE, lapl_id, &vol_obj, &loc_params) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set link access arguments")
+
+ /* Set up request token pointer for asynchronous operation */
+ if (H5ES_NONE != es_id)
+ token_ptr = &token; /* Point at token for VOL connector to set up */
+
+ /* Set wrapper info in API context */
+ if (H5VL_set_vol_wrapper(vol_obj) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
+ vol_wrapper_set = TRUE;
+
+ /* Call the corresponding internal VOL routine */
+ if (H5VL__object_optional(vol_obj->data, &loc_params, vol_obj->connector->cls, args, dxpl_id, token_ptr) <
+ 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute object optional callback")
+
+ /* If a token was created, add the token to the event set */
+ if (NULL != token)
+ /* clang-format off */
+ if (H5ES_insert(es_id, vol_obj->connector, token, H5ARG_TRACE9(__func__, "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id)) < 0)
+ /* clang-format on */
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set")
+
+done:
+ /* Reset object wrapping info in API context */
+ if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
+ HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
+
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLobject_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__introspect_get_conn_cls
*
* Purpose: Calls the connector-specific callback to query the connector
@@ -5989,6 +6219,76 @@ done:
} /* end H5VLintrospect_get_conn_cls() */
/*-------------------------------------------------------------------------
+ * Function: H5VL_introspect_get_cap_flags
+ *
+ * Purpose: Calls the connector-specific callback to query the connector's
+ * capability flags.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_introspect_get_cap_flags(const void *info, const H5VL_class_t *cls, unsigned *cap_flags)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(cls);
+ HDassert(cap_flags);
+
+ /* Check if the corresponding VOL callback exists */
+ if (NULL == cls->introspect_cls.get_cap_flags)
+ HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'get_cap_flags' method")
+
+ /* Call the corresponding VOL callback */
+ if ((cls->introspect_cls.get_cap_flags)(info, cap_flags) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query connector capability flags")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_introspect_get_cap_flags() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VLintrospect_get_cap_flags
+ *
+ * Purpose: Calls the connector-specific callback to query the connector's
+ * capability flags.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLintrospect_get_cap_flags(const void *info, hid_t connector_id, unsigned *cap_flags /*out*/)
+{
+ H5VL_class_t *cls; /* VOL connector's class struct */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API_NOINIT
+ H5TRACE3("e", "*xix", info, connector_id, cap_flags);
+
+ /* Check args */
+ if (NULL == cap_flags)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL conn_cls pointer")
+
+ /* Get class pointer */
+ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
+
+ /* Call the corresponding internal VOL routine */
+ if (H5VL_introspect_get_cap_flags(info, cls, cap_flags) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query connector's capability flags")
+
+done:
+ FUNC_LEAVE_API_NOINIT(ret_value)
+} /* end H5VLintrospect_get_cap_flags() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__introspect_opt_query
*
* Purpose: Calls the connector-specific callback to query if an optional
@@ -6135,28 +6435,18 @@ done:
herr_t
H5VL_request_wait(const H5VL_object_t *vol_obj, uint64_t timeout, H5VL_request_status_t *status)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(vol_obj);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
if (H5VL__request_wait(vol_obj->data, vol_obj->connector->cls, timeout, status) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request wait failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_request_wait() */
@@ -6239,28 +6529,18 @@ done:
herr_t
H5VL_request_notify(const H5VL_object_t *vol_obj, H5VL_request_notify_t cb, void *ctx)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vol_obj);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
if (H5VL__request_notify(vol_obj->data, vol_obj->connector->cls, cb, ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "request notify failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_request_notify() */
@@ -6342,28 +6622,18 @@ done:
herr_t
H5VL_request_cancel(const H5VL_object_t *vol_obj, H5VL_request_status_t *status)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vol_obj);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
if (H5VL__request_cancel(vol_obj->data, vol_obj->connector->cls, status) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request cancel failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_request_cancel() */
@@ -6378,13 +6648,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLrequest_cancel(void *req, hid_t connector_id, H5VL_request_status_t *status)
+H5VLrequest_cancel(void *req, hid_t connector_id, H5VL_request_status_t *status /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE3("e", "*xi*#", req, connector_id, status);
+ H5TRACE3("e", "*xix", req, connector_id, status);
/* Get class pointer */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
@@ -6409,8 +6679,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__request_specific(void *req, const H5VL_class_t *cls, H5VL_request_specific_t specific_type,
- va_list arguments)
+H5VL__request_specific(void *req, const H5VL_class_t *cls, H5VL_request_specific_args_t *args)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -6425,7 +6694,7 @@ H5VL__request_specific(void *req, const H5VL_class_t *cls, H5VL_request_specific
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'async specific' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->request_cls.specific)(req, specific_type, arguments)) < 0)
+ if ((cls->request_cls.specific)(req, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL,
"unable to execute asynchronous request specific callback")
@@ -6444,40 +6713,21 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_t specific_type, ...)
+H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_args_t *args)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vol_obj);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, specific_type);
- arg_started = TRUE;
- if ((ret_value =
- H5VL__request_specific(vol_obj->data, vol_obj->connector->cls, specific_type, arguments)) < 0)
+ if (H5VL__request_specific(vol_obj->data, vol_obj->connector->cls, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL,
"unable to execute asynchronous request specific callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_request_specific() */
@@ -6492,20 +6742,20 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLrequest_specific(void *req, hid_t connector_id, H5VL_request_specific_t specific_type, va_list arguments)
+H5VLrequest_specific(void *req, hid_t connector_id, H5VL_request_specific_args_t *args)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE4("e", "*xiVrx", req, connector_id, specific_type, arguments);
+ H5TRACE3("e", "*xi*!", req, connector_id, args);
/* Get class pointer */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__request_specific(req, cls, specific_type, arguments)) < 0)
+ if (H5VL__request_specific(req, cls, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL,
"unable to execute asynchronous request specific callback")
@@ -6524,8 +6774,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__request_optional(void *req, const H5VL_class_t *cls, H5VL_request_optional_t opt_type,
- va_list arguments)
+H5VL__request_optional(void *req, const H5VL_class_t *cls, H5VL_optional_args_t *args)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -6540,7 +6789,7 @@ H5VL__request_optional(void *req, const H5VL_class_t *cls, H5VL_request_optional
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'async optional' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->request_cls.optional)(req, opt_type, arguments)) < 0)
+ if ((cls->request_cls.optional)(req, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL,
"unable to execute asynchronous request optional callback")
@@ -6559,39 +6808,21 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_request_optional(const H5VL_object_t *vol_obj, H5VL_request_optional_t opt_type, ...)
+H5VL_request_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vol_obj);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, opt_type);
- arg_started = TRUE;
- if ((ret_value = H5VL__request_optional(vol_obj->data, vol_obj->connector->cls, opt_type, arguments)) < 0)
+ if (H5VL__request_optional(vol_obj->data, vol_obj->connector->cls, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL,
"unable to execute asynchronous request optional callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_request_optional() */
@@ -6606,20 +6837,20 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLrequest_optional(void *req, hid_t connector_id, H5VL_request_optional_t opt_type, va_list arguments)
+H5VLrequest_optional(void *req, hid_t connector_id, H5VL_optional_args_t *args)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE4("e", "*xiVzx", req, connector_id, opt_type, arguments);
+ H5TRACE3("e", "*xi*!", req, connector_id, args);
/* Get class pointer */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__request_optional(req, cls, opt_type, arguments)) < 0)
+ if (H5VL__request_optional(req, cls, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL,
"unable to execute asynchronous request optional callback")
@@ -6628,6 +6859,43 @@ done:
} /* end H5VLrequest_optional() */
/*-------------------------------------------------------------------------
+ * Function: H5VLrequest_optional_op
+ *
+ * Purpose: Performs an optional connector-specific operation on a request
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VLrequest_optional_op(void *req, hid_t connector_id, H5VL_optional_args_t *args)
+{
+ H5VL_class_t *cls; /* VOL connector's class struct */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "*xi*!", req, connector_id, args);
+
+ /* Check arguments */
+ if (NULL == req)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid request")
+ if (NULL == args)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid arguments")
+
+ /* Get class pointer */
+ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
+
+ /* Call the corresponding internal VOL routine */
+ if (H5VL__request_optional(req, cls, args) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute request optional callback")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5VLrequest_optional_op() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL__request_free
*
* Purpose: Frees an asynchronous request through the VOL
@@ -6673,28 +6941,18 @@ done:
herr_t
H5VL_request_free(const H5VL_object_t *vol_obj)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(vol_obj);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding VOL callback */
if (H5VL__request_free(vol_obj->data, vol_obj->connector->cls) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request free failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_request_free() */
@@ -6778,8 +7036,7 @@ done:
herr_t
H5VL_blob_put(const H5VL_object_t *vol_obj, const void *buf, size_t size, void *blob_id, void *ctx)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -6788,19 +7045,11 @@ H5VL_blob_put(const H5VL_object_t *vol_obj, const void *buf, size_t size, void *
HDassert(size == 0 || buf);
HDassert(blob_id);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding VOL callback */
if (H5VL__blob_put(vol_obj->data, vol_obj->connector->cls, buf, size, blob_id, ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "blob put failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_blob_put() */
@@ -6882,8 +7131,7 @@ done:
herr_t
H5VL_blob_get(const H5VL_object_t *vol_obj, const void *blob_id, void *buf, size_t size, void *ctx)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -6892,19 +7140,11 @@ H5VL_blob_get(const H5VL_object_t *vol_obj, const void *blob_id, void *buf, size
HDassert(blob_id);
HDassert(buf);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding VOL callback */
if (H5VL__blob_get(vol_obj->data, vol_obj->connector->cls, blob_id, buf, size, ctx) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "blob get failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_blob_get() */
@@ -6953,8 +7193,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__blob_specific(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_blob_specific_t specific_type,
- va_list arguments)
+H5VL__blob_specific(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_blob_specific_args_t *args)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -6970,7 +7209,7 @@ H5VL__blob_specific(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_blob
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'blob specific' method")
/* Call the corresponding VOL callback */
- if ((cls->blob_cls.specific)(obj, blob_id, specific_type, arguments) < 0)
+ if ((cls->blob_cls.specific)(obj, blob_id, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute blob specific callback")
done:
@@ -6988,12 +7227,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_blob_specific(const H5VL_object_t *vol_obj, void *blob_id, H5VL_blob_specific_t specific_type, ...)
+H5VL_blob_specific(const H5VL_object_t *vol_obj, void *blob_id, H5VL_blob_specific_args_t *args)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -7001,27 +7237,11 @@ H5VL_blob_specific(const H5VL_object_t *vol_obj, void *blob_id, H5VL_blob_specif
HDassert(vol_obj);
HDassert(blob_id);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, specific_type);
- arg_started = TRUE;
- if ((ret_value = H5VL__blob_specific(vol_obj->data, vol_obj->connector->cls, blob_id, specific_type,
- arguments)) < 0)
+ if (H5VL__blob_specific(vol_obj->data, vol_obj->connector->cls, blob_id, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute blob specific callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_blob_specific() */
@@ -7035,14 +7255,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLblob_specific(void *obj, hid_t connector_id, void *blob_id, H5VL_blob_specific_t specific_type,
- va_list arguments)
+H5VLblob_specific(void *obj, hid_t connector_id, void *blob_id, H5VL_blob_specific_args_t *args)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE5("e", "*xi*xVBx", obj, connector_id, blob_id, specific_type, arguments);
+ H5TRACE4("e", "*xi*x*!", obj, connector_id, blob_id, args);
/* Get class pointer */
if (NULL == obj)
@@ -7051,7 +7270,7 @@ H5VLblob_specific(void *obj, hid_t connector_id, void *blob_id, H5VL_blob_specif
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding VOL callback */
- if (H5VL__blob_specific(obj, cls, blob_id, specific_type, arguments) < 0)
+ if (H5VL__blob_specific(obj, cls, blob_id, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "blob specific operation failed")
done:
@@ -7071,8 +7290,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__blob_optional(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_blob_optional_t opt_type,
- va_list arguments)
+H5VL__blob_optional(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_optional_args_t *args)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -7088,7 +7306,7 @@ H5VL__blob_optional(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_blob
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'blob optional' method")
/* Call the corresponding VOL callback */
- if ((cls->blob_cls.optional)(obj, blob_id, opt_type, arguments) < 0)
+ if ((cls->blob_cls.optional)(obj, blob_id, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute blob optional callback")
done:
@@ -7106,12 +7324,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_blob_optional(const H5VL_object_t *vol_obj, void *blob_id, H5VL_blob_optional_t opt_type, ...)
+H5VL_blob_optional(const H5VL_object_t *vol_obj, void *blob_id, H5VL_optional_args_t *args)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -7119,27 +7334,11 @@ H5VL_blob_optional(const H5VL_object_t *vol_obj, void *blob_id, H5VL_blob_option
HDassert(vol_obj);
HDassert(blob_id);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, opt_type);
- arg_started = TRUE;
- if ((ret_value =
- H5VL__blob_optional(vol_obj->data, vol_obj->connector->cls, blob_id, opt_type, arguments)) < 0)
+ if (H5VL__blob_optional(vol_obj->data, vol_obj->connector->cls, blob_id, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute blob optional callback")
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_blob_optional() */
@@ -7153,14 +7352,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLblob_optional(void *obj, hid_t connector_id, void *blob_id, H5VL_blob_optional_t opt_type,
- va_list arguments)
+H5VLblob_optional(void *obj, hid_t connector_id, void *blob_id, H5VL_optional_args_t *args)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE5("e", "*xi*xVAx", obj, connector_id, blob_id, opt_type, arguments);
+ H5TRACE4("e", "*xi*x*!", obj, connector_id, blob_id, args);
/* Get class pointer */
if (NULL == obj)
@@ -7169,7 +7367,7 @@ H5VLblob_optional(void *obj, hid_t connector_id, void *blob_id, H5VL_blob_option
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding VOL callback */
- if (H5VL__blob_optional(obj, cls, blob_id, opt_type, arguments) < 0)
+ if (H5VL__blob_optional(obj, cls, blob_id, args) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "blob optional operation failed")
done:
@@ -7243,8 +7441,7 @@ herr_t
H5VL_token_cmp(const H5VL_object_t *vol_obj, const H5O_token_t *token1, const H5O_token_t *token2,
int *cmp_value)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -7252,20 +7449,11 @@ H5VL_token_cmp(const H5VL_object_t *vol_obj, const H5O_token_t *token1, const H5
HDassert(vol_obj);
HDassert(cmp_value);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__token_cmp(vol_obj->data, vol_obj->connector->cls, token1, token2, cmp_value)) < 0)
+ if (H5VL__token_cmp(vol_obj->data, vol_obj->connector->cls, token1, token2, cmp_value) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "token compare failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_token_cmp() */
@@ -7362,8 +7550,7 @@ herr_t
H5VL_token_to_str(const H5VL_object_t *vol_obj, H5I_type_t obj_type, const H5O_token_t *token,
char **token_str)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -7372,21 +7559,11 @@ H5VL_token_to_str(const H5VL_object_t *vol_obj, H5I_type_t obj_type, const H5O_t
HDassert(token);
HDassert(token_str);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__token_to_str(vol_obj->data, obj_type, vol_obj->connector->cls, token, token_str)) <
- 0)
+ if (H5VL__token_to_str(vol_obj->data, obj_type, vol_obj->connector->cls, token, token_str) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSERIALIZE, FAIL, "token serialization failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_token_to_str() */
@@ -7480,8 +7657,7 @@ herr_t
H5VL_token_from_str(const H5VL_object_t *vol_obj, H5I_type_t obj_type, const char *token_str,
H5O_token_t *token)
{
- hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -7490,21 +7666,11 @@ H5VL_token_from_str(const H5VL_object_t *vol_obj, H5I_type_t obj_type, const cha
HDassert(token);
HDassert(token_str);
- /* Set wrapper info in API context */
- if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
- vol_wrapper_set = TRUE;
-
/* Call the corresponding internal VOL routine */
- if ((ret_value =
- H5VL__token_from_str(vol_obj->data, obj_type, vol_obj->connector->cls, token_str, token)) < 0)
+ if (H5VL__token_from_str(vol_obj->data, obj_type, vol_obj->connector->cls, token_str, token) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTUNSERIALIZE, FAIL, "token deserialization failed")
done:
- /* Reset object wrapping info in API context */
- if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_token_from_str() */
@@ -7557,7 +7723,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL__optional(void *obj, const H5VL_class_t *cls, int op_type, hid_t dxpl_id, void **req, va_list arguments)
+H5VL__optional(void *obj, const H5VL_class_t *cls, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -7568,8 +7734,8 @@ H5VL__optional(void *obj, const H5VL_class_t *cls, int op_type, hid_t dxpl_id, v
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'optional' method")
/* Call the corresponding VOL callback */
- if ((ret_value = (cls->optional)(obj, op_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, ret_value, "unable to execute optional callback")
+ if ((ret_value = (cls->optional)(obj, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute optional callback");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -7586,10 +7752,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_optional(const H5VL_object_t *vol_obj, int op_type, hid_t dxpl_id, void **req, ...)
+H5VL_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
- va_list arguments; /* Argument list passed from the API call */
- hbool_t arg_started = FALSE; /* Whether the va_list has been started */
hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */
herr_t ret_value = SUCCEED; /* Return value */
@@ -7601,20 +7765,13 @@ H5VL_optional(const H5VL_object_t *vol_obj, int op_type, hid_t dxpl_id, void **r
vol_wrapper_set = TRUE;
/* Call the corresponding internal VOL routine */
- HDva_start(arguments, req);
- arg_started = TRUE;
- if ((ret_value =
- H5VL__optional(vol_obj->data, vol_obj->connector->cls, op_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "unable to execute optional callback")
+ if ((ret_value = H5VL__optional(vol_obj->data, vol_obj->connector->cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute optional callback");
done:
- /* End access to the va_list, if we started it */
- if (arg_started)
- HDva_end(arguments);
-
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTRESET, ret_value, "can't reset VOL wrapper info")
+ HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_optional() */
@@ -7630,13 +7787,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VLoptional(void *obj, hid_t connector_id, int op_type, hid_t dxpl_id, void **req /*out*/, va_list arguments)
+H5VLoptional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id, void **req /*out*/)
{
H5VL_class_t *cls; /* VOL connector's class struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API_NOINIT
- H5TRACE6("e", "*xiIsixx", obj, connector_id, op_type, dxpl_id, req, arguments);
+ H5TRACE5("e", "*xi*!ix", obj, connector_id, args, dxpl_id, req);
/* Check args and get class pointer */
if (NULL == obj)
@@ -7645,8 +7802,8 @@ H5VLoptional(void *obj, hid_t connector_id, int op_type, hid_t dxpl_id, void **r
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID")
/* Call the corresponding internal VOL routine */
- if ((ret_value = H5VL__optional(obj, cls, op_type, dxpl_id, req, arguments)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, ret_value, "unable to execute optional callback")
+ if ((ret_value = H5VL__optional(obj, cls, args, dxpl_id, req)) < 0)
+ HERROR(H5E_VOL, H5E_CANTOPERATE, "unable to execute optional callback");
done:
FUNC_LEAVE_API_NOINIT(ret_value)
diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h
index ac40e70..af3530c 100644
--- a/src/H5VLconnector.h
+++ b/src/H5VLconnector.h
@@ -20,6 +20,7 @@
/* Public headers needed by this file */
#include "H5public.h" /* Generic Functions */
#include "H5Apublic.h" /* Attributes */
+#include "H5Dpublic.h" /* Datasets */
#include "H5ESpublic.h" /* Event Stack */
#include "H5Fpublic.h" /* Files */
#include "H5Ipublic.h" /* IDs */
@@ -33,8 +34,10 @@
/*****************/
/* Capability flags for connector */
-#define H5VL_CAP_FLAG_NONE 0 /* No special connector capabilities */
-#define H5VL_CAP_FLAG_THREADSAFE 0x01 /* Connector is threadsafe */
+#define H5VL_CAP_FLAG_NONE 0 /* No special connector capabilities */
+#define H5VL_CAP_FLAG_THREADSAFE 0x01 /* Connector is threadsafe */
+#define H5VL_CAP_FLAG_ASYNC 0x02 /* Connector performs operations asynchronously*/
+#define H5VL_CAP_FLAG_NATIVE_FILES 0x04 /* Connector produces native file format */
/* Container info version */
#define H5VL_CONTAINER_INFO_VERSION 0x01 /* Container info struct version */
@@ -42,11 +45,64 @@
/* The maximum size allowed for blobs */
#define H5VL_MAX_BLOB_ID_SIZE (16) /* Allow for 128-bits blob IDs */
+/* # of optional operations reserved for the native VOL connector */
+#define H5VL_RESERVED_NATIVE_OPTIONAL 1024
+
/*******************/
/* Public Typedefs */
/*******************/
-/* types for attribute GET callback */
+/* Types for different ways that objects are located in an HDF5 container */
+typedef enum H5VL_loc_type_t {
+ H5VL_OBJECT_BY_SELF,
+ H5VL_OBJECT_BY_NAME,
+ H5VL_OBJECT_BY_IDX,
+ H5VL_OBJECT_BY_TOKEN
+} H5VL_loc_type_t;
+
+typedef struct H5VL_loc_by_name {
+ const char *name;
+ hid_t lapl_id;
+} H5VL_loc_by_name_t;
+
+typedef struct H5VL_loc_by_idx {
+ const char * name;
+ H5_index_t idx_type;
+ H5_iter_order_t order;
+ hsize_t n;
+ hid_t lapl_id;
+} H5VL_loc_by_idx_t;
+
+typedef struct H5VL_loc_by_token {
+ H5O_token_t *token;
+} H5VL_loc_by_token_t;
+
+/* Structure to hold parameters for object locations.
+ * Either: BY_SELF, BY_NAME, BY_IDX, BY_TOKEN
+ *
+ * Note: Leave loc_by_token as the first union member so we
+ * can perform the simplest initialization of the struct
+ * without raising warnings.
+ *
+ * Note: BY_SELF requires no union members.
+ */
+typedef struct H5VL_loc_params_t {
+ H5I_type_t obj_type;
+ H5VL_loc_type_t type;
+ union {
+ H5VL_loc_by_token_t loc_by_token;
+ H5VL_loc_by_name_t loc_by_name;
+ H5VL_loc_by_idx_t loc_by_idx;
+ } loc_data;
+} H5VL_loc_params_t;
+
+/* Struct for all 'optional' callbacks */
+typedef struct H5VL_optional_args_t {
+ int op_type; /* Operation to perform */
+ void *args; /* Pointer to operation's argument struct */
+} H5VL_optional_args_t;
+
+/* Values for attribute 'get' operations */
typedef enum H5VL_attr_get_t {
H5VL_ATTR_GET_ACPL, /* creation property list */
H5VL_ATTR_GET_INFO, /* info */
@@ -56,18 +112,115 @@ typedef enum H5VL_attr_get_t {
H5VL_ATTR_GET_TYPE /* datatype */
} H5VL_attr_get_t;
-/* types for attribute SPECFIC callback */
+/* Parameters for attribute 'get_name' operation */
+typedef struct H5VL_attr_get_name_args_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ size_t buf_size; /* Size of attribute name buffer */
+ char * buf; /* Buffer for attribute name (OUT) */
+ size_t * attr_name_len; /* Actual length of attribute name (OUT) */
+} H5VL_attr_get_name_args_t;
+
+/* Parameters for attribute 'get_info' operation */
+typedef struct H5VL_attr_get_info_args_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ const char * attr_name; /* Attribute name (for get_info_by_name) */
+ H5A_info_t * ainfo; /* Attribute info (OUT) */
+} H5VL_attr_get_info_args_t;
+
+/* Parameters for attribute 'get' operations */
+typedef struct H5VL_attr_get_args_t {
+ H5VL_attr_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_ATTR_GET_ACPL */
+ struct {
+ hid_t acpl_id; /* Attribute creation property list ID (OUT) */
+ } get_acpl;
+
+ /* H5VL_ATTR_GET_INFO */
+ H5VL_attr_get_info_args_t get_info; /* Attribute info */
+
+ /* H5VL_ATTR_GET_NAME */
+ H5VL_attr_get_name_args_t get_name; /* Attribute name */
+
+ /* H5VL_ATTR_GET_SPACE */
+ struct {
+ hid_t space_id; /* Dataspace ID (OUT) */
+ } get_space;
+
+ /* H5VL_ATTR_GET_STORAGE_SIZE */
+ struct {
+ hsize_t *data_size; /* Size of attribute in file (OUT) */
+ } get_storage_size;
+
+ /* H5VL_ATTR_GET_TYPE */
+ struct {
+ hid_t type_id; /* Datatype ID (OUT) */
+ } get_type;
+ } args;
+} H5VL_attr_get_args_t;
+
+/* Values for attribute 'specific' operation */
typedef enum H5VL_attr_specific_t {
- H5VL_ATTR_DELETE, /* H5Adelete(_by_name/idx) */
- H5VL_ATTR_EXISTS, /* H5Aexists(_by_name) */
- H5VL_ATTR_ITER, /* H5Aiterate(_by_name) */
- H5VL_ATTR_RENAME /* H5Arename(_by_name) */
+ H5VL_ATTR_DELETE, /* H5Adelete(_by_name) */
+ H5VL_ATTR_DELETE_BY_IDX, /* H5Adelete_by_idx */
+ H5VL_ATTR_EXISTS, /* H5Aexists(_by_name) */
+ H5VL_ATTR_ITER, /* H5Aiterate(_by_name) */
+ H5VL_ATTR_RENAME /* H5Arename(_by_name) */
} H5VL_attr_specific_t;
+/* Parameters for attribute 'iterate' operation */
+typedef struct H5VL_attr_iterate_args_t {
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ hsize_t * idx; /* Start/stop iteration index (IN/OUT) */
+ H5A_operator2_t op; /* Iteration callback function */
+ void * op_data; /* Iteration callback context */
+} H5VL_attr_iterate_args_t;
+
+/* Parameters for attribute 'delete_by_idx' operation */
+typedef struct H5VL_attr_delete_by_idx_args_t {
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ hsize_t n; /* Iteration index */
+} H5VL_attr_delete_by_idx_args_t;
+
+/* Parameters for attribute 'specific' operations */
+typedef struct H5VL_attr_specific_args_t {
+ H5VL_attr_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_ATTR_DELETE */
+ struct {
+ const char *name; /* Name of attribute to delete */
+ } del;
+
+ /* H5VL_ATTR_DELETE_BY_IDX */
+ H5VL_attr_delete_by_idx_args_t delete_by_idx;
+
+ /* H5VL_ATTR_EXISTS */
+ struct {
+ const char *name; /* Name of attribute to check */
+ hbool_t * exists; /* Whether attribute exists (OUT) */
+ } exists;
+
+ /* H5VL_ATTR_ITER */
+ H5VL_attr_iterate_args_t iterate;
+
+ /* H5VL_ATTR_RENAME */
+ struct {
+ const char *old_name; /* Name of attribute to rename */
+ const char *new_name; /* New attribute name */
+ } rename;
+ } args;
+} H5VL_attr_specific_args_t;
+
/* Typedef for VOL connector attribute optional VOL operations */
typedef int H5VL_attr_optional_t;
-/* types for dataset GET callback */
+/* Values for dataset 'get' operation */
typedef enum H5VL_dataset_get_t {
H5VL_DATASET_GET_DAPL, /* access property list */
H5VL_DATASET_GET_DCPL, /* creation property list */
@@ -77,31 +230,146 @@ typedef enum H5VL_dataset_get_t {
H5VL_DATASET_GET_TYPE /* datatype */
} H5VL_dataset_get_t;
-/* types for dataset SPECFIC callback */
+/* Parameters for dataset 'get' operations */
+typedef struct H5VL_dataset_get_args_t {
+ H5VL_dataset_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATASET_GET_DAPL */
+ struct {
+ hid_t dapl_id; /* Dataset access property list ID (OUT) */
+ } get_dapl;
+
+ /* H5VL_DATASET_GET_DCPL */
+ struct {
+ hid_t dcpl_id; /* Dataset creation property list ID (OUT) */
+ } get_dcpl;
+
+ /* H5VL_DATASET_GET_SPACE */
+ struct {
+ hid_t space_id; /* Dataspace ID (OUT) */
+ } get_space;
+
+ /* H5VL_DATASET_GET_SPACE_STATUS */
+ struct {
+ H5D_space_status_t *status; /* Storage space allocation status (OUT) */
+ } get_space_status;
+
+ /* H5VL_DATASET_GET_STORAGE_SIZE */
+ struct {
+ hsize_t *storage_size; /* Size of dataset's storage (OUT) */
+ } get_storage_size;
+
+ /* H5VL_DATASET_GET_TYPE */
+ struct {
+ hid_t type_id; /* Datatype ID (OUT) */
+ } get_type;
+ } args;
+} H5VL_dataset_get_args_t;
+
+/* Values for dataset 'specific' operation */
typedef enum H5VL_dataset_specific_t {
H5VL_DATASET_SET_EXTENT, /* H5Dset_extent */
H5VL_DATASET_FLUSH, /* H5Dflush */
- H5VL_DATASET_REFRESH, /* H5Drefresh */
- H5VL_DATASET_WAIT /* H5Dwait */
+ H5VL_DATASET_REFRESH /* H5Drefresh */
} H5VL_dataset_specific_t;
+/* Parameters for dataset 'specific' operations */
+typedef struct H5VL_dataset_specific_args_t {
+ H5VL_dataset_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATASET_SET_EXTENT */
+ struct {
+ const hsize_t *size; /* New dataspace extent */
+ } set_extent;
+
+ /* H5VL_DATASET_FLUSH */
+ struct {
+ hid_t dset_id; /* Dataset ID (IN) */
+ } flush;
+
+ /* H5VL_DATASET_REFRESH */
+ struct {
+ hid_t dset_id; /* Dataset ID (IN) */
+ } refresh;
+ } args;
+} H5VL_dataset_specific_args_t;
+
/* Typedef for VOL connector dataset optional VOL operations */
typedef int H5VL_dataset_optional_t;
-/* types for datatype GET callback */
+/* Values for datatype 'get' operation */
typedef enum H5VL_datatype_get_t {
- H5VL_DATATYPE_GET_BINARY, /* get serialized form of transient type */
- H5VL_DATATYPE_GET_TCPL /* datatype creation property list */
+ H5VL_DATATYPE_GET_BINARY_SIZE, /* Get size of serialized form of transient type */
+ H5VL_DATATYPE_GET_BINARY, /* Get serialized form of transient type */
+ H5VL_DATATYPE_GET_TCPL /* Datatype creation property list */
} H5VL_datatype_get_t;
-/* types for datatype SPECFIC callback */
-typedef enum H5VL_datatype_specific_t { H5VL_DATATYPE_FLUSH, H5VL_DATATYPE_REFRESH } H5VL_datatype_specific_t;
+/* Parameters for datatype 'get' operations */
+typedef struct H5VL_datatype_get_args_t {
+ H5VL_datatype_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATATYPE_GET_BINARY_SIZE */
+ struct {
+ size_t *size; /* Size of serialized form of datatype (OUT) */
+ } get_binary_size;
+
+ /* H5VL_DATATYPE_GET_BINARY */
+ struct {
+ void * buf; /* Buffer to store serialized form of datatype (OUT) */
+ size_t buf_size; /* Size of serialized datatype buffer */
+ } get_binary;
+
+ /* H5VL_DATATYPE_GET_TCPL */
+ struct {
+ hid_t tcpl_id; /* Named datatype creation property list ID (OUT) */
+ } get_tcpl;
+ } args;
+} H5VL_datatype_get_args_t;
+
+/* Values for datatype 'specific' operation */
+typedef enum H5VL_datatype_specific_t {
+ H5VL_DATATYPE_FLUSH, /* H5Tflush */
+ H5VL_DATATYPE_REFRESH /* H5Trefresh */
+} H5VL_datatype_specific_t;
+
+/* Parameters for datatype 'specific' operations */
+typedef struct H5VL_datatype_specific_args_t {
+ H5VL_datatype_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_DATATYPE_FLUSH */
+ struct {
+ hid_t type_id; /* Named datatype ID (IN) */
+ } flush;
+
+ /* H5VL_DATATYPE_REFRESH */
+ struct {
+ hid_t type_id; /* Named datatype ID (IN) */
+ } refresh;
+ } args;
+} H5VL_datatype_specific_args_t;
/* Typedef and values for native VOL connector named datatype optional VOL operations */
typedef int H5VL_datatype_optional_t;
/* (No optional named datatype VOL operations currently) */
-/* types for file GET callback */
+/* Info for H5VL_FILE_GET_CONT_INFO */
+typedef struct H5VL_file_cont_info_t {
+ unsigned version; /* version information (keep first) */
+ uint64_t feature_flags; /* Container feature flags */
+ /* (none currently defined) */
+ size_t token_size; /* Size of tokens */
+ size_t blob_id_size; /* Size of blob IDs */
+} H5VL_file_cont_info_t;
+
+/* Values for file 'get' operation */
typedef enum H5VL_file_get_t {
H5VL_FILE_GET_CONT_INFO, /* file get container info */
H5VL_FILE_GET_FAPL, /* file access property list */
@@ -113,59 +381,296 @@ typedef enum H5VL_file_get_t {
H5VL_FILE_GET_OBJ_IDS /* object ids in file */
} H5VL_file_get_t;
-/* types for file SPECIFIC callback */
+/* Parameters for file 'get_name' operation */
+typedef struct H5VL_file_get_name_args_t {
+ H5I_type_t type; /* ID type of object pointer */
+ size_t buf_size; /* Size of file name buffer (IN) */
+ char * buf; /* Buffer for file name (OUT) */
+ size_t * file_name_len; /* Actual length of file name (OUT) */
+} H5VL_file_get_name_args_t;
+
+/* Parameters for file 'get_obj_ids' operation */
+typedef struct H5VL_file_get_obj_ids_args_t {
+ unsigned types; /* Type of objects to count */
+ size_t max_objs; /* Size of array of object IDs */
+ hid_t * oid_list; /* Array of object IDs (OUT) */
+ size_t * count; /* # of objects (OUT) */
+} H5VL_file_get_obj_ids_args_t;
+
+/* Parameters for file 'get' operations */
+typedef struct H5VL_file_get_args_t {
+ H5VL_file_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_FILE_GET_CONT_INFO */
+ struct {
+ H5VL_file_cont_info_t *info; /* Container info (OUT) */
+ } get_cont_info;
+
+ /* H5VL_FILE_GET_FAPL */
+ struct {
+ hid_t fapl_id; /* File access property list (OUT) */
+ } get_fapl;
+
+ /* H5VL_FILE_GET_FCPL */
+ struct {
+ hid_t fcpl_id; /* File creation property list (OUT) */
+ } get_fcpl;
+
+ /* H5VL_FILE_GET_FILENO */
+ struct {
+ unsigned long *fileno; /* File "number" (OUT) */
+ } get_fileno;
+
+ /* H5VL_FILE_GET_INTENT */
+ struct {
+ unsigned *flags; /* File open/create intent flags (OUT) */
+ } get_intent;
+
+ /* H5VL_FILE_GET_NAME */
+ H5VL_file_get_name_args_t get_name;
+
+ /* H5VL_FILE_GET_OBJ_COUNT */
+ struct {
+ unsigned types; /* Type of objects to count */
+ size_t * count; /* # of objects (OUT) */
+ } get_obj_count;
+
+ /* H5VL_FILE_GET_OBJ_IDS */
+ H5VL_file_get_obj_ids_args_t get_obj_ids;
+ } args;
+} H5VL_file_get_args_t;
+
+/* Values for file 'specific' operation */
typedef enum H5VL_file_specific_t {
H5VL_FILE_FLUSH, /* Flush file */
H5VL_FILE_REOPEN, /* Reopen the file */
- H5VL_FILE_MOUNT, /* Mount a file */
- H5VL_FILE_UNMOUNT, /* Unmount a file */
H5VL_FILE_IS_ACCESSIBLE, /* Check if a file is accessible */
H5VL_FILE_DELETE, /* Delete a file */
- H5VL_FILE_IS_EQUAL, /* Check if two files are the same */
- H5VL_FILE_WAIT /* Wait for async operations to complete */
+ H5VL_FILE_IS_EQUAL /* Check if two files are the same */
} H5VL_file_specific_t;
+/* Parameters for file 'specific' operations */
+typedef struct H5VL_file_specific_args_t {
+ H5VL_file_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_FILE_FLUSH */
+ struct {
+ H5I_type_t obj_type; /* Type of object to use */
+ H5F_scope_t scope; /* Scope of flush operation */
+ } flush;
+
+ /* H5VL_FILE_REOPEN */
+ struct {
+ void **file; /* File object for new file (OUT) */
+ } reopen;
+
+ /* H5VL_FILE_IS_ACCESSIBLE */
+ struct {
+ const char *filename; /* Name of file to check */
+ hid_t fapl_id; /* File access property list to use */
+ hbool_t * accessible; /* Whether file is accessible with FAPL settings (OUT) */
+ } is_accessible;
+
+ /* H5VL_FILE_DELETE */
+ struct {
+ const char *filename; /* Name of file to delete */
+ hid_t fapl_id; /* File access property list to use */
+ } del;
+
+ /* H5VL_FILE_IS_EQUAL */
+ struct {
+ void * obj2; /* Second file object to compare against */
+ hbool_t *same_file; /* Whether files are the same (OUT) */
+ } is_equal;
+ } args;
+} H5VL_file_specific_args_t;
+
/* Typedef for VOL connector file optional VOL operations */
typedef int H5VL_file_optional_t;
-/* types for group GET callback */
+/* Values for group 'get' operation */
typedef enum H5VL_group_get_t {
H5VL_GROUP_GET_GCPL, /* group creation property list */
H5VL_GROUP_GET_INFO /* group info */
} H5VL_group_get_t;
-/* types for group SPECFIC callback */
-typedef enum H5VL_group_specific_t { H5VL_GROUP_FLUSH, H5VL_GROUP_REFRESH } H5VL_group_specific_t;
+/* Parameters for group 'get_info' operation */
+typedef struct H5VL_group_get_info_args_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
+ H5G_info_t * ginfo; /* Group info (OUT) */
+} H5VL_group_get_info_args_t;
+
+/* Parameters for group 'get' operations */
+typedef struct H5VL_group_get_args_t {
+ H5VL_group_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_GROUP_GET_GCPL */
+ struct {
+ hid_t gcpl_id; /* Group creation property list (OUT) */
+ } get_gcpl;
+
+ /* H5VL_GROUP_GET_INFO */
+ H5VL_group_get_info_args_t get_info; /* Group info */
+ } args;
+} H5VL_group_get_args_t;
+
+/* Values for group 'specific' operation */
+typedef enum H5VL_group_specific_t {
+ H5VL_GROUP_MOUNT, /* Mount a file on a group */
+ H5VL_GROUP_UNMOUNT, /* Unmount a file on a group */
+ H5VL_GROUP_FLUSH, /* H5Gflush */
+ H5VL_GROUP_REFRESH /* H5Grefresh */
+} H5VL_group_specific_t;
+
+/* Parameters for group 'mount' operation */
+typedef struct H5VL_group_spec_mount_args_t {
+ const char *name; /* Name of location to mount child file */
+ void * child_file; /* Pointer to child file object */
+ hid_t fmpl_id; /* File mount property list to use */
+} H5VL_group_spec_mount_args_t;
+
+/* Parameters for group 'specific' operations */
+typedef struct H5VL_group_specific_args_t {
+ H5VL_group_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_GROUP_MOUNT */
+ H5VL_group_spec_mount_args_t mount;
+
+ /* H5VL_GROUP_UNMOUNT */
+ struct {
+ const char *name; /* Name of location to unmount child file */
+ } unmount;
+
+ /* H5VL_GROUP_FLUSH */
+ struct {
+ hid_t grp_id; /* Group ID (IN) */
+ } flush;
+
+ /* H5VL_GROUP_REFRESH */
+ struct {
+ hid_t grp_id; /* Group ID (IN) */
+ } refresh;
+ } args;
+} H5VL_group_specific_args_t;
/* Typedef for VOL connector group optional VOL operations */
typedef int H5VL_group_optional_t;
-/* link create types for VOL */
-typedef enum H5VL_link_create_type_t {
+/* Link create types for VOL */
+typedef enum H5VL_link_create_t {
H5VL_LINK_CREATE_HARD,
H5VL_LINK_CREATE_SOFT,
H5VL_LINK_CREATE_UD
-} H5VL_link_create_type_t;
+} H5VL_link_create_t;
+
+/* Parameters for link 'create' operations */
+typedef struct H5VL_link_create_args_t {
+ H5VL_link_create_t op_type; /* Operation to perform */
-/* types for link GET callback */
+ /* Parameters for each operation */
+ union {
+ /* H5VL_LINK_CREATE_HARD */
+ struct {
+ void * curr_obj; /* Current object */
+ H5VL_loc_params_t curr_loc_params; /* Location parameters for current object */
+ } hard;
+
+ /* H5VL_LINK_CREATE_SOFT */
+ struct {
+ const char *target; /* Target of soft link */
+ } soft;
+
+ /* H5VL_LINK_CREATE_UD */
+ struct {
+ H5L_type_t type; /* Type of link to create */
+ const void *buf; /* Buffer that contains link info */
+ size_t buf_size; /* Size of link info buffer */
+ } ud;
+ } args;
+} H5VL_link_create_args_t;
+
+/* Values for link 'get' operation */
typedef enum H5VL_link_get_t {
H5VL_LINK_GET_INFO, /* link info */
H5VL_LINK_GET_NAME, /* link name */
H5VL_LINK_GET_VAL /* link value */
} H5VL_link_get_t;
-/* types for link SPECIFIC callback */
+/* Parameters for link 'get' operations */
+typedef struct H5VL_link_get_args_t {
+ H5VL_link_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_LINK_GET_INFO */
+ struct {
+ H5L_info2_t *linfo; /* Pointer to link's info (OUT) */
+ } get_info;
+
+ /* H5VL_LINK_GET_NAME */
+ struct {
+ size_t name_size; /* Size of link name buffer (IN) */
+ char * name; /* Buffer for link name (OUT) */
+ size_t *name_len; /* Actual length of link name (OUT) */
+ } get_name;
+
+ /* H5VL_LINK_GET_VAL */
+ struct {
+ size_t buf_size; /* Size of link value buffer (IN) */
+ void * buf; /* Buffer for link value (OUT) */
+ } get_val;
+ } args;
+} H5VL_link_get_args_t;
+
+/* Values for link 'specific' operation */
typedef enum H5VL_link_specific_t {
H5VL_LINK_DELETE, /* H5Ldelete(_by_idx) */
H5VL_LINK_EXISTS, /* link existence */
H5VL_LINK_ITER /* H5Literate/visit(_by_name) */
} H5VL_link_specific_t;
+/* Parameters for link 'iterate' operation */
+typedef struct H5VL_link_iterate_args_t {
+ hbool_t recursive; /* Whether iteration is recursive */
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ hsize_t * idx_p; /* Start/stop iteration index (OUT) */
+ H5L_iterate2_t op; /* Iteration callback function */
+ void * op_data; /* Iteration callback context */
+} H5VL_link_iterate_args_t;
+
+/* Parameters for link 'specific' operations */
+typedef struct H5VL_link_specific_args_t {
+ H5VL_link_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_LINK_DELETE */
+ /* No args */
+
+ /* H5VL_LINK_EXISTS */
+ struct {
+ hbool_t *exists; /* Whether link exists (OUT) */
+ } exists;
+
+ /* H5VL_LINK_ITER */
+ H5VL_link_iterate_args_t iterate;
+ } args;
+} H5VL_link_specific_args_t;
+
/* Typedef and values for native VOL connector link optional VOL operations */
typedef int H5VL_link_optional_t;
/* (No optional link VOL operations currently) */
-/* types for object GET callback */
+/* Values for object 'get' operation */
typedef enum H5VL_object_get_t {
H5VL_OBJECT_GET_FILE, /* object file */
H5VL_OBJECT_GET_NAME, /* object name */
@@ -173,7 +678,38 @@ typedef enum H5VL_object_get_t {
H5VL_OBJECT_GET_INFO /* H5Oget_info(_by_idx|name) */
} H5VL_object_get_t;
-/* types for object SPECIFIC callback */
+/* Parameters for object 'get' operations */
+typedef struct H5VL_object_get_args_t {
+ H5VL_object_get_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_OBJECT_GET_FILE */
+ struct {
+ void **file; /* File object (OUT) */
+ } get_file;
+
+ /* H5VL_OBJECT_GET_NAME */
+ struct {
+ size_t buf_size; /* Size of name buffer (IN) */
+ char * buf; /* Buffer for name (OUT) */
+ size_t *name_len; /* Actual length of name (OUT) */
+ } get_name;
+
+ /* H5VL_OBJECT_GET_TYPE */
+ struct {
+ H5O_type_t *obj_type; /* Type of object (OUT) */
+ } get_type;
+
+ /* H5VL_OBJECT_GET_INFO */
+ struct {
+ unsigned fields; /* Flags for fields to retrieve */
+ H5O_info2_t *oinfo; /* Pointer to object info (OUT) */
+ } get_info;
+ } args;
+} H5VL_object_get_args_t;
+
+/* Values for object 'specific' operation */
typedef enum H5VL_object_specific_t {
H5VL_OBJECT_CHANGE_REF_COUNT, /* H5Oincr/decr_refcount */
H5VL_OBJECT_EXISTS, /* H5Oexists_by_name */
@@ -183,6 +719,51 @@ typedef enum H5VL_object_specific_t {
H5VL_OBJECT_REFRESH /* H5{D|G|O|T}refresh */
} H5VL_object_specific_t;
+/* Parameters for object 'visit' operation */
+typedef struct H5VL_object_visit_args_t {
+ H5_index_t idx_type; /* Type of index to iterate over */
+ H5_iter_order_t order; /* Order of index iteration */
+ unsigned fields; /* Flags for fields to provide in 'info' object for 'op' callback */
+ H5O_iterate2_t op; /* Iteration callback function */
+ void * op_data; /* Iteration callback context */
+} H5VL_object_visit_args_t;
+
+/* Parameters for object 'specific' operations */
+typedef struct H5VL_object_specific_args_t {
+ H5VL_object_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_OBJECT_CHANGE_REF_COUNT */
+ struct {
+ int delta; /* Amount to modify object's refcount */
+ } change_rc;
+
+ /* H5VL_OBJECT_EXISTS */
+ struct {
+ hbool_t *exists; /* Whether object exists (OUT) */
+ } exists;
+
+ /* H5VL_OBJECT_LOOKUP */
+ struct {
+ H5O_token_t *token_ptr; /* Pointer to token for lookup (OUT) */
+ } lookup;
+
+ /* H5VL_OBJECT_VISIT */
+ H5VL_object_visit_args_t visit;
+
+ /* H5VL_OBJECT_FLUSH */
+ struct {
+ hid_t obj_id; /* Object ID (IN) */
+ } flush;
+
+ /* H5VL_OBJECT_REFRESH */
+ struct {
+ hid_t obj_id; /* Object ID (IN) */
+ } refresh;
+ } args;
+} H5VL_object_specific_args_t;
+
/* Typedef for VOL connector object optional VOL operations */
typedef int H5VL_object_optional_t;
@@ -199,82 +780,64 @@ typedef enum H5VL_request_status_t {
H5VL_REQUEST_STATUS_CANCELED /* Operation has not completed and was canceled */
} H5VL_request_status_t;
-/* types for async request SPECIFIC callback */
+/* Values for async request 'specific' operation */
typedef enum H5VL_request_specific_t {
- H5VL_REQUEST_WAITANY, /* Wait until any request completes */
- H5VL_REQUEST_WAITSOME, /* Wait until at least one requesst completes */
- H5VL_REQUEST_WAITALL, /* Wait until all requests complete */
- H5VL_REQUEST_GET_ERR_STACK /* Retrieve error stack for failed operation */
+ H5VL_REQUEST_GET_ERR_STACK, /* Retrieve error stack for failed operation */
+ H5VL_REQUEST_GET_EXEC_TIME /* Retrieve execution time for operation */
} H5VL_request_specific_t;
+/* Parameters for request 'specific' operations */
+typedef struct H5VL_request_specific_args_t {
+ H5VL_request_specific_t op_type; /* Operation to perform */
+
+ /* Parameters for each operation */
+ union {
+ /* H5VL_REQUEST_GET_ERR_STACK */
+ struct {
+ hid_t err_stack_id; /* Error stack ID for operation (OUT) */
+ } get_err_stack;
+
+ /* H5VL_REQUEST_GET_EXEC_TIME */
+ struct {
+ uint64_t *exec_ts; /* Timestamp for start of task execution (OUT) */
+ uint64_t *exec_time; /* Duration of task execution (in ns) (OUT) */
+ } get_exec_time;
+ } args;
+} H5VL_request_specific_args_t;
+
/* Typedef and values for native VOL connector request optional VOL operations */
typedef int H5VL_request_optional_t;
/* (No optional request VOL operations currently) */
-/* types for 'blob' SPECIFIC callback */
+/* Values for 'blob' 'specific' operation */
typedef enum H5VL_blob_specific_t {
- H5VL_BLOB_DELETE, /* Delete a blob (by ID) */
- H5VL_BLOB_GETSIZE, /* Get size of blob */
- H5VL_BLOB_ISNULL, /* Check if a blob ID is "null" */
- H5VL_BLOB_SETNULL /* Set a blob ID to the connector's "null" blob ID value */
+ H5VL_BLOB_DELETE, /* Delete a blob (by ID) */
+ H5VL_BLOB_ISNULL, /* Check if a blob ID is "null" */
+ H5VL_BLOB_SETNULL /* Set a blob ID to the connector's "null" blob ID value */
} H5VL_blob_specific_t;
-/* Typedef and values for native VOL connector blob optional VOL operations */
-typedef int H5VL_blob_optional_t;
-/* (No optional blob VOL operations currently) */
-
-/* Types for different ways that objects are located in an HDF5 container */
-typedef enum H5VL_loc_type_t {
- H5VL_OBJECT_BY_SELF,
- H5VL_OBJECT_BY_NAME,
- H5VL_OBJECT_BY_IDX,
- H5VL_OBJECT_BY_TOKEN
-} H5VL_loc_type_t;
-
-typedef struct H5VL_loc_by_name {
- const char *name;
- hid_t lapl_id;
-} H5VL_loc_by_name_t;
+/* Parameters for blob 'specific' operations */
+typedef struct H5VL_blob_specific_args_t {
+ H5VL_blob_specific_t op_type; /* Operation to perform */
-typedef struct H5VL_loc_by_idx {
- const char * name;
- H5_index_t idx_type;
- H5_iter_order_t order;
- hsize_t n;
- hid_t lapl_id;
-} H5VL_loc_by_idx_t;
+ /* Parameters for each operation */
+ union {
+ /* H5VL_BLOB_DELETE */
+ /* No args */
-typedef struct H5VL_loc_by_token {
- H5O_token_t *token;
-} H5VL_loc_by_token_t;
+ /* H5VL_BLOB_ISNULL */
+ struct {
+ hbool_t *isnull; /* Whether blob ID is "null" (OUT) */
+ } is_null;
-/* Structure to hold parameters for object locations.
- * Either: BY_SELF, BY_NAME, BY_IDX, BY_TOKEN
- *
- * Note: Leave loc_by_token as the first union member so we
- * can perform the simplest initialization of the struct
- * without raising warnings.
- *
- * Note: BY_SELF requires no union members.
- */
-typedef struct H5VL_loc_params_t {
- H5I_type_t obj_type;
- H5VL_loc_type_t type;
- union {
- H5VL_loc_by_token_t loc_by_token;
- H5VL_loc_by_name_t loc_by_name;
- H5VL_loc_by_idx_t loc_by_idx;
- } loc_data;
-} H5VL_loc_params_t;
+ /* H5VL_BLOB_SETNULL */
+ /* No args */
+ } args;
+} H5VL_blob_specific_args_t;
-/* Info for H5VL_FILE_GET_CONT_INFO */
-typedef struct H5VL_file_cont_info_t {
- unsigned version; /* version information (keep first) */
- uint64_t feature_flags; /* Container feature flags */
- /* (none currently defined) */
- size_t token_size; /* Size of tokens */
- size_t blob_id_size; /* Size of blob IDs */
-} H5VL_file_cont_info_t;
+/* Typedef and values for native VOL connector blob optional VOL operations */
+typedef int H5VL_blob_optional_t;
+/* (No optional blob VOL operations currently) */
/* VOL connector info fields & callbacks */
typedef struct H5VL_info_class_t {
@@ -309,11 +872,10 @@ typedef struct H5VL_attr_class_t {
hid_t dxpl_id, void **req);
herr_t (*read)(void *attr, hid_t mem_type_id, void *buf, hid_t dxpl_id, void **req);
herr_t (*write)(void *attr, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*optional)(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *attr, hid_t dxpl_id, void **req);
} H5VL_attr_class_t;
@@ -327,11 +889,9 @@ typedef struct H5VL_dataset_class_t {
void *buf, void **req);
herr_t (*write)(void *dset, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t dxpl_id,
const void *buf, void **req);
- herr_t (*get)(void *obj, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *dset, hid_t dxpl_id, void **req);
} H5VL_dataset_class_t;
@@ -341,11 +901,9 @@ typedef struct H5VL_datatype_class_t {
hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req);
void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t tapl_id,
hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_datatype_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *dt, hid_t dxpl_id, void **req);
} H5VL_datatype_class_t;
@@ -354,11 +912,9 @@ typedef struct H5VL_file_class_t {
void *(*create)(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id,
void **req);
void *(*open)(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_file_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *file, hid_t dxpl_id, void **req);
} H5VL_file_class_t;
@@ -368,30 +924,28 @@ typedef struct H5VL_group_class_t {
hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req);
void *(*open)(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t gapl_id,
hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*specific)(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
- herr_t (*optional)(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*specific)(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
herr_t (*close)(void *grp, hid_t dxpl_id, void **req);
} H5VL_group_class_t;
/* H5L routines */
typedef struct H5VL_link_class_t {
- herr_t (*create)(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc_params_t *loc_params,
- hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req, va_list arguments);
+ herr_t (*create)(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
+ hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id,
void **req);
herr_t (*move)(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id,
void **req);
- herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
- herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*optional)(void *obj, H5VL_link_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args, hid_t dxpl_id,
+ void **req);
+ herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
} H5VL_link_class_t;
/* H5O routines */
@@ -401,12 +955,12 @@ typedef struct H5VL_object_class_t {
herr_t (*copy)(void *src_obj, const H5VL_loc_params_t *loc_params1, const char *src_name, void *dst_obj,
const H5VL_loc_params_t *loc_params2, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id,
hid_t dxpl_id, void **req);
- herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
- herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
- herr_t (*optional)(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ herr_t (*get)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_args_t *args, hid_t dxpl_id,
+ void **req);
+ herr_t (*specific)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+ herr_t (*optional)(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req);
} H5VL_object_class_t;
/* Asynchronous request 'notify' callback */
@@ -426,6 +980,7 @@ struct H5VL_class_t;
/* Container/connector introspection routines */
typedef struct H5VL_introspect_class_t {
herr_t (*get_conn_cls)(void *obj, H5VL_get_conn_lvl_t lvl, const struct H5VL_class_t **conn_cls);
+ herr_t (*get_cap_flags)(const void *info, unsigned *cap_flags);
herr_t (*opt_query)(void *obj, H5VL_subclass_t cls, int opt_type, uint64_t *flags);
} H5VL_introspect_class_t;
@@ -434,8 +989,8 @@ typedef struct H5VL_request_class_t {
herr_t (*wait)(void *req, uint64_t timeout, H5VL_request_status_t *status);
herr_t (*notify)(void *req, H5VL_request_notify_t cb, void *ctx);
herr_t (*cancel)(void *req, H5VL_request_status_t *status);
- herr_t (*specific)(void *req, H5VL_request_specific_t specific_type, va_list arguments);
- herr_t (*optional)(void *req, H5VL_request_optional_t opt_type, va_list arguments);
+ herr_t (*specific)(void *req, H5VL_request_specific_args_t *args);
+ herr_t (*optional)(void *req, H5VL_optional_args_t *args);
herr_t (*free)(void *req);
} H5VL_request_class_t;
@@ -443,8 +998,8 @@ typedef struct H5VL_request_class_t {
typedef struct H5VL_blob_class_t {
herr_t (*put)(void *obj, const void *buf, size_t size, void *blob_id, void *ctx);
herr_t (*get)(void *obj, const void *blob_id, void *buf, size_t size, void *ctx);
- herr_t (*specific)(void *obj, void *blob_id, H5VL_blob_specific_t specific_type, va_list arguments);
- herr_t (*optional)(void *obj, void *blob_id, H5VL_blob_optional_t opt_type, va_list arguments);
+ herr_t (*specific)(void *obj, void *blob_id, H5VL_blob_specific_args_t *args);
+ herr_t (*optional)(void *obj, void *blob_id, H5VL_optional_args_t *args);
} H5VL_blob_class_t;
/* Object token routines */
@@ -458,7 +1013,7 @@ typedef struct H5VL_token_class_t {
* \ingroup H5VLDEV
* Class information for each VOL connector
*/
-//! [H5VL_class_t_snip]
+//! <!-- [H5VL_class_t_snip] -->
typedef struct H5VL_class_t {
/* Overall connector fields & callbacks */
unsigned version; /**< VOL connector class struct version # */
@@ -489,10 +1044,10 @@ typedef struct H5VL_class_t {
H5VL_token_class_t token_cls; /**< VOL connector object token class callbacks */
/* Catch-all */
- herr_t (*optional)(void *obj, int op_type, hid_t dxpl_id, void **req,
- va_list arguments); /**< Optional callback */
+ herr_t (*optional)(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req); /**< Optional callback */
} H5VL_class_t;
-//! [H5VL_class_t_snip]
+//! <!-- [H5VL_class_t_snip] -->
/********************/
/* Public Variables */
@@ -529,15 +1084,14 @@ extern "C" {
* uncommon, as most VOL-specific properties are added to the file
* access property list via the connector's API calls which set the
* VOL connector for the file open/create. For more information, see
- * the VOL documentation.
+ * the \ref_vol_doc.
*
* H5VL_class_t is defined in H5VLconnector.h in the source code. It
* contains class information for each VOL connector:
* \snippet this H5VL_class_t_snip
*
- * \todo Fix the reference to VOL documentation.
- *
* \since 1.12.0
+ *
*/
H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id);
/**
@@ -557,6 +1111,53 @@ H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name);
*/
H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value);
+/* User-defined optional operations */
+H5_DLL herr_t H5VLregister_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
+H5_DLL herr_t H5VLfind_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
+H5_DLL herr_t H5VLunregister_opt_operation(H5VL_subclass_t subcls, const char *op_name);
+H5_DLL herr_t H5VLattr_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t attr_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLdataset_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t dset_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLdatatype_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t type_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLfile_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t file_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLgroup_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t group_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t loc_id, const char *name, hid_t lapl_id, H5VL_optional_args_t *args,
+ hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t loc_id, const char *name, hid_t lapl_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+H5_DLL herr_t H5VLrequest_optional_op(void *req, hid_t connector_id, H5VL_optional_args_t *args);
+
+/* API Wrappers for "optional_op" routines */
+/* (Must be defined _after_ the function prototype) */
+/* (And must only defined when included in application code, not the library) */
+#ifndef H5VL_MODULE
+/* Inject application compile-time macros into function calls */
+#define H5VLattr_optional_op(...) H5VLattr_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLdataset_optional_op(...) H5VLdataset_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLdatatype_optional_op(...) H5VLdatatype_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLfile_optional_op(...) H5VLfile_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLgroup_optional_op(...) H5VLgroup_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLlink_optional_op(...) H5VLlink_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+#define H5VLobject_optional_op(...) H5VLobject_optional_op(__FILE__, __func__, __LINE__, __VA_ARGS__)
+
+/* Define "wrapper" versions of function calls, to allow compile-time values to
+ * be passed in by language wrapper or library layer on top of HDF5.
+ */
+#define H5VLattr_optional_op_wrap H5_NO_EXPAND(H5VLattr_optional_op)
+#define H5VLdataset_optional_op_wrap H5_NO_EXPAND(H5VLdataset_optional_op)
+#define H5VLdatatype_optional_op_wrap H5_NO_EXPAND(H5VLdatatype_optional_op)
+#define H5VLfile_optional_op_wrap H5_NO_EXPAND(H5VLfile_optional_op)
+#define H5VLgroup_optional_op_wrap H5_NO_EXPAND(H5VLgroup_optional_op)
+#define H5VLlink_optional_op_wrap H5_NO_EXPAND(H5VLlink_optional_op)
+#define H5VLobject_optional_op_wrap H5_NO_EXPAND(H5VLobject_optional_op)
+#endif /* H5VL_MODULE */
+
#ifdef __cplusplus
}
#endif
diff --git a/src/H5VLconnector_passthru.h b/src/H5VLconnector_passthru.h
index 720740f..17029f0 100644
--- a/src/H5VLconnector_passthru.h
+++ b/src/H5VLconnector_passthru.h
@@ -58,8 +58,9 @@ extern "C" {
H5_DLL herr_t H5VLcmp_connector_cls(int *cmp, hid_t connector_id1, hid_t connector_id2);
H5_DLL hid_t H5VLwrap_register(void *obj, H5I_type_t type);
H5_DLL herr_t H5VLretrieve_lib_state(void **state);
+H5_DLL herr_t H5VLstart_lib_state(void);
H5_DLL herr_t H5VLrestore_lib_state(const void *state);
-H5_DLL herr_t H5VLreset_lib_state(void);
+H5_DLL herr_t H5VLfinish_lib_state(void);
H5_DLL herr_t H5VLfree_lib_state(void *state);
/* Pass-through callbacks */
@@ -92,13 +93,12 @@ H5_DLL herr_t H5VLattr_read(void *attr, hid_t connector_id, hid_t dtype_id, void
void **req);
H5_DLL herr_t H5VLattr_write(void *attr, hid_t connector_id, hid_t dtype_id, const void *buf, hid_t dxpl_id,
void **req);
-H5_DLL herr_t H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
+H5_DLL herr_t H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VLattr_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VLattr_optional(void *obj, hid_t connector_id, H5VL_attr_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VLattr_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VLattr_close(void *attr, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for dataset callbacks */
@@ -111,12 +111,12 @@ H5_DLL herr_t H5VLdataset_read(void *dset, hid_t connector_id, hid_t mem_type_id
hid_t file_space_id, hid_t plist_id, void *buf, void **req);
H5_DLL herr_t H5VLdataset_write(void *dset, hid_t connector_id, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t plist_id, const void *buf, void **req);
-H5_DLL herr_t H5VLdataset_get(void *dset, hid_t connector_id, H5VL_dataset_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-H5_DLL herr_t H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-H5_DLL herr_t H5VLdataset_optional(void *obj, hid_t connector_id, H5VL_dataset_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+H5_DLL herr_t H5VLdataset_get(void *dset, hid_t connector_id, H5VL_dataset_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VLdataset_specific(void *obj, hid_t connector_id, H5VL_dataset_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VLdataset_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VLdataset_close(void *dset, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for named datatype callbacks */
@@ -125,24 +125,24 @@ H5_DLL void * H5VLdatatype_commit(void *obj, const H5VL_loc_params_t *loc_params
hid_t dxpl_id, void **req);
H5_DLL void * H5VLdatatype_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
const char *name, hid_t tapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VLdatatype_get(void *dt, hid_t connector_id, H5VL_datatype_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-H5_DLL herr_t H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-H5_DLL herr_t H5VLdatatype_optional(void *obj, hid_t connector_id, H5VL_datatype_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+H5_DLL herr_t H5VLdatatype_get(void *dt, hid_t connector_id, H5VL_datatype_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VLdatatype_specific(void *obj, hid_t connector_id, H5VL_datatype_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VLdatatype_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VLdatatype_close(void *dt, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for file callbacks */
H5_DLL void * H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id,
void **req);
H5_DLL void * H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VLfile_get(void *file, hid_t connector_id, H5VL_file_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-H5_DLL herr_t H5VLfile_specific(void *obj, hid_t connector_id, H5VL_file_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-H5_DLL herr_t H5VLfile_optional(void *obj, hid_t connector_id, H5VL_file_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+H5_DLL herr_t H5VLfile_get(void *file, hid_t connector_id, H5VL_file_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VLfile_specific(void *obj, hid_t connector_id, H5VL_file_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VLfile_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VLfile_close(void *file, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for group callbacks */
@@ -151,18 +151,17 @@ H5_DLL void * H5VLgroup_create(void *obj, const H5VL_loc_params_t *loc_params, h
void **req);
H5_DLL void * H5VLgroup_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
const char *name, hid_t gapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-H5_DLL herr_t H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-H5_DLL herr_t H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_group_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+H5_DLL herr_t H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VLgroup_specific(void *obj, hid_t connector_id, H5VL_group_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VLgroup_close(void *grp, hid_t connector_id, hid_t dxpl_id, void **req);
/* Public wrappers for link callbacks */
-H5_DLL herr_t H5VLlink_create(H5VL_link_create_type_t create_type, void *obj,
- const H5VL_loc_params_t *loc_params, hid_t connector_id, hid_t lcpl_id,
- hid_t lapl_id, hid_t dxpl_id, void **req, va_list arguments);
+H5_DLL herr_t H5VLlink_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
+ hid_t connector_id, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLlink_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t connector_id, hid_t lcpl_id,
hid_t lapl_id, hid_t dxpl_id, void **req);
@@ -170,12 +169,11 @@ H5_DLL herr_t H5VLlink_move(void *src_obj, const H5VL_loc_params_t *loc_params1,
const H5VL_loc_params_t *loc_params2, hid_t connector_id, hid_t lcpl_id,
hid_t lapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLlink_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_link_get_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLlink_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VLlink_optional(void *obj, hid_t connector_id, H5VL_link_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VLlink_optional(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/* Public wrappers for object callbacks */
H5_DLL void * H5VLobject_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
@@ -184,16 +182,16 @@ H5_DLL herr_t H5VLobject_copy(void *src_obj, const H5VL_loc_params_t *loc_params
void *dst_obj, const H5VL_loc_params_t *loc_params2, const char *dst_name,
hid_t connector_id, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLobject_get(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VLobject_specific(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VLobject_optional(void *obj, hid_t connector_id, H5VL_object_optional_t opt_type,
- hid_t dxpl_id, void **req, va_list arguments);
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VLobject_optional(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/* Public wrappers for connector/container introspection callbacks */
H5_DLL herr_t H5VLintrospect_get_conn_cls(void *obj, hid_t connector_id, H5VL_get_conn_lvl_t lvl,
const H5VL_class_t **conn_cls);
+H5_DLL herr_t H5VLintrospect_get_cap_flags(const void *info, hid_t connector_id, unsigned *cap_flags);
H5_DLL herr_t H5VLintrospect_opt_query(void *obj, hid_t connector_id, H5VL_subclass_t subcls, int opt_type,
uint64_t *flags);
@@ -202,10 +200,8 @@ H5_DLL herr_t H5VLrequest_wait(void *req, hid_t connector_id, uint64_t timeout,
H5VL_request_status_t *status);
H5_DLL herr_t H5VLrequest_notify(void *req, hid_t connector_id, H5VL_request_notify_t cb, void *ctx);
H5_DLL herr_t H5VLrequest_cancel(void *req, hid_t connector_id, H5VL_request_status_t *status);
-H5_DLL herr_t H5VLrequest_specific(void *req, hid_t connector_id, H5VL_request_specific_t specific_type,
- va_list arguments);
-H5_DLL herr_t H5VLrequest_optional(void *req, hid_t connector_id, H5VL_request_optional_t opt_type,
- va_list arguments);
+H5_DLL herr_t H5VLrequest_specific(void *req, hid_t connector_id, H5VL_request_specific_args_t *args);
+H5_DLL herr_t H5VLrequest_optional(void *req, hid_t connector_id, H5VL_optional_args_t *args);
H5_DLL herr_t H5VLrequest_free(void *req, hid_t connector_id);
/* Public wrappers for blob callbacks */
@@ -214,9 +210,8 @@ H5_DLL herr_t H5VLblob_put(void *obj, hid_t connector_id, const void *buf, size_
H5_DLL herr_t H5VLblob_get(void *obj, hid_t connector_id, const void *blob_id, void *buf, size_t size,
void *ctx);
H5_DLL herr_t H5VLblob_specific(void *obj, hid_t connector_id, void *blob_id,
- H5VL_blob_specific_t specific_type, va_list arguments);
-H5_DLL herr_t H5VLblob_optional(void *obj, hid_t connector_id, void *blob_id, H5VL_blob_optional_t opt_type,
- va_list arguments);
+ H5VL_blob_specific_args_t *args);
+H5_DLL herr_t H5VLblob_optional(void *obj, hid_t connector_id, void *blob_id, H5VL_optional_args_t *args);
/* Public wrappers for token callbacks */
H5_DLL herr_t H5VLtoken_cmp(void *obj, hid_t connector_id, const H5O_token_t *token1,
@@ -227,8 +222,8 @@ H5_DLL herr_t H5VLtoken_from_str(void *obj, H5I_type_t obj_type, hid_t connector
H5O_token_t *token);
/* Public wrappers for generic 'optional' callback */
-H5_DLL herr_t H5VLoptional(void *obj, hid_t connector_id, int op_type, hid_t dxpl_id, void **req,
- va_list arguments);
+H5_DLL herr_t H5VLoptional(void *obj, hid_t connector_id, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
#ifdef __cplusplus
}
diff --git a/src/H5VLdyn_ops.c b/src/H5VLdyn_ops.c
new file mode 100644
index 0000000..0992452
--- /dev/null
+++ b/src/H5VLdyn_ops.c
@@ -0,0 +1,334 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: The Virtual Object Layer as described in documentation.
+ * The pupose is to provide an abstraction on how to access the
+ * underlying HDF5 container, whether in a local file with
+ * a specific file format, or remotely on other machines, etc...
+ */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#include "H5VLmodule.h" /* This source code file is part of the H5VL module */
+
+/***********/
+/* Headers */
+/***********/
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5SLprivate.h" /* Skip lists */
+#include "H5VLpkg.h" /* Virtual Object Layer */
+
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/* Dynamic operation info */
+typedef struct H5VL_dyn_op_t {
+ char *op_name; /* Name of operation */
+ int op_val; /* Value of operation */
+} H5VL_dyn_op_t;
+
+/********************/
+/* Local Prototypes */
+/********************/
+static void H5VL__release_dyn_op(H5VL_dyn_op_t *dyn_op);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/* The current optional operation values */
+static int H5VL_opt_vals_g[H5VL_SUBCLS_TOKEN + 1] = {
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_NONE */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_INFO */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_WRAP */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_ATTR */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_DATASET */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_DATATYPE */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_FILE */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_GROUP */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_LINK */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_OBJECT */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_REQUEST */
+ H5VL_RESERVED_NATIVE_OPTIONAL, /* H5VL_SUBCLS_BLOB */
+ H5VL_RESERVED_NATIVE_OPTIONAL /* H5VL_SUBCLS_TOKEN */
+};
+
+/* The current optional operations' info */
+static H5SL_t *H5VL_opt_ops_g[H5VL_SUBCLS_TOKEN + 1] = {
+ NULL, /* H5VL_SUBCLS_NONE */
+ NULL, /* H5VL_SUBCLS_INFO */
+ NULL, /* H5VL_SUBCLS_WRAP */
+ NULL, /* H5VL_SUBCLS_ATTR */
+ NULL, /* H5VL_SUBCLS_DATASET */
+ NULL, /* H5VL_SUBCLS_DATATYPE */
+ NULL, /* H5VL_SUBCLS_FILE */
+ NULL, /* H5VL_SUBCLS_GROUP */
+ NULL, /* H5VL_SUBCLS_LINK */
+ NULL, /* H5VL_SUBCLS_OBJECT */
+ NULL, /* H5VL_SUBCLS_REQUEST */
+ NULL, /* H5VL_SUBCLS_BLOB */
+ NULL /* H5VL_SUBCLS_TOKEN */
+};
+
+/* Declare a free list to manage the H5VL_class_t struct */
+H5FL_DEFINE_STATIC(H5VL_dyn_op_t);
+
+/*---------------------------------------------------------------------------
+ * Function: H5VL__release_dyn_op
+ *
+ * Purpose: Release a dynamic operation info node
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+static void
+H5VL__release_dyn_op(H5VL_dyn_op_t *dyn_op)
+{
+ FUNC_ENTER_STATIC_NOERR
+
+ H5MM_xfree(dyn_op->op_name);
+ H5FL_FREE(H5VL_dyn_op_t, dyn_op);
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* H5VL__release_dyn_op() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VL__term_opt_operation_cb
+ *
+ * Purpose: Callback for releasing a dynamically registered operation info
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+static herr_t
+H5VL__term_opt_operation_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data)
+{
+ H5VL_dyn_op_t *item = (H5VL_dyn_op_t *)_item; /* Item to release */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Release the dynamically registered operation info */
+ H5VL__release_dyn_op(item);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5VL__term_opt_operation_cb() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VL__term_opt_operation
+ *
+ * Purpose: Terminate the dynamically registered optional operations,
+ * releasing all operations.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VL__term_opt_operation(void)
+{
+ size_t subcls; /* Index over the elements of operation array */
+
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Iterate over the VOL subclasses */
+ for (subcls = 0; subcls < NELMTS(H5VL_opt_vals_g); subcls++)
+ if (H5VL_opt_ops_g[subcls])
+ H5SL_destroy(H5VL_opt_ops_g[subcls], H5VL__term_opt_operation_cb, NULL);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5VL__term_opt_operation() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VL__register_opt_operation
+ *
+ * Purpose: Register a new optional operation for a VOL object subclass.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VL__register_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val)
+{
+ H5VL_dyn_op_t *new_op; /* Info about new operation */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity checks */
+ HDassert(op_val);
+ HDassert(op_name && *op_name);
+
+ /* Check for duplicate operation */
+ if (H5VL_opt_ops_g[subcls]) {
+ if (NULL != H5SL_search(H5VL_opt_ops_g[subcls], op_name))
+ HGOTO_ERROR(H5E_VOL, H5E_EXISTS, FAIL, "operation name already exists")
+ } /* end if */
+ else {
+ /* Create skip list for operation of this subclass */
+ if (NULL == (H5VL_opt_ops_g[subcls] = H5SL_create(H5SL_TYPE_STR, NULL)))
+ HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, FAIL, "can't create skip list for operations")
+ } /* end else */
+
+ /* Register new operation */
+ if (NULL == (new_op = H5FL_CALLOC(H5VL_dyn_op_t)))
+ HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, FAIL, "can't allocate memory for dynamic operation info")
+ if (NULL == (new_op->op_name = H5MM_strdup(op_name)))
+ HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, FAIL, "can't allocate name for dynamic operation info")
+ new_op->op_val = H5VL_opt_vals_g[subcls]++;
+
+ /* Insert into subclass's skip list */
+ if (H5SL_insert(H5VL_opt_ops_g[subcls], new_op, new_op->op_name) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert operation info into skip list")
+
+ /* Return the next operation value to the caller */
+ *op_val = new_op->op_val;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5VL__register_opt_operation() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VL__num_opt_operation
+ *
+ * Purpose: Returns the # of currently registered optional operations
+ *
+ * Return: # of registered optional operations / <can't fail>
+ *
+ *---------------------------------------------------------------------------
+ */
+size_t
+H5VL__num_opt_operation(void)
+{
+ size_t subcls; /* Index over the elements of operation array */
+ size_t ret_value = 0; /* Return value */
+
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Iterate over the VOL subclasses */
+ for (subcls = 0; subcls < NELMTS(H5VL_opt_vals_g); subcls++)
+ if (H5VL_opt_ops_g[subcls])
+ ret_value += H5SL_count(H5VL_opt_ops_g[subcls]);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5VL__num_opt_operation() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VL__find_opt_operation
+ *
+ * Purpose: Look up a optional operation for a VOL object subclass, by name.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VL__find_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity checks */
+ HDassert(op_val);
+ HDassert(op_name && *op_name);
+
+ /* Check for dynamic operations in the VOL subclass */
+ if (H5VL_opt_ops_g[subcls]) {
+ H5VL_dyn_op_t *dyn_op; /* Info about operation */
+
+ /* Search for dynamic operation with correct name */
+ if (NULL == (dyn_op = H5SL_search(H5VL_opt_ops_g[subcls], op_name)))
+ HGOTO_ERROR(H5E_VOL, H5E_NOTFOUND, FAIL, "operation name isn't registered")
+
+ /* Set operation value for user */
+ *op_val = dyn_op->op_val;
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_VOL, H5E_NOTFOUND, FAIL, "operation name isn't registered")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5VL__find_opt_operation() */
+
+/*---------------------------------------------------------------------------
+ * Function: H5VL__unregister_opt_operation
+ *
+ * Purpose: Unregister a optional operation for a VOL object subclass, by name.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VL__unregister_opt_operation(H5VL_subclass_t subcls, const char *op_name)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity checks */
+ HDassert(op_name && *op_name);
+
+ /* Check for dynamic operations in the VOL subclass */
+ if (H5VL_opt_ops_g[subcls]) {
+ H5VL_dyn_op_t *dyn_op; /* Info about operation */
+
+ /* Search for dynamic operation with correct name */
+ if (NULL == (dyn_op = H5SL_remove(H5VL_opt_ops_g[subcls], op_name)))
+ HGOTO_ERROR(H5E_VOL, H5E_NOTFOUND, FAIL, "operation name isn't registered")
+
+ /* Release the info for the operation */
+ H5VL__release_dyn_op(dyn_op);
+
+ /* Close the skip list, if no more operations in it */
+ if (0 == H5SL_count(H5VL_opt_ops_g[subcls])) {
+ if (H5SL_close(H5VL_opt_ops_g[subcls]) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "can't close dyn op skip list")
+ H5VL_opt_ops_g[subcls] = NULL;
+ } /* end if */
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_VOL, H5E_NOTFOUND, FAIL, "operation name isn't registered")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5VL__unregister_opt_operation() */
diff --git a/src/H5VLint.c b/src/H5VLint.c
index 500e075..b4432d0 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -88,7 +88,6 @@ typedef struct {
/********************/
static herr_t H5VL__free_cls(H5VL_class_t *cls, void **request);
static int H5VL__get_connector_cb(void *obj, hid_t id, void *_op_data);
-static herr_t H5VL__set_def_conn(void);
static void * H5VL__wrap_obj(void *obj, H5I_type_t obj_type);
static H5VL_object_t *H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector,
hbool_t wrap_obj);
@@ -194,6 +193,10 @@ H5VL_init_phase2(void)
if (H5M_init() < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize map interface")
+ /* Sanity check default VOL connector */
+ HDassert(H5VL_def_conn_s.connector_id == (-1));
+ HDassert(H5VL_def_conn_s.connector_info == NULL);
+
/* Set up the default VOL connector in the default FAPL */
if (H5VL__set_def_conn() < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "unable to set default VOL connector")
@@ -261,15 +264,22 @@ H5VL_term_package(void)
n++;
} /* end if */
else {
- /* Destroy the VOL connector ID group */
- n += (H5I_dec_type_ref(H5I_VOL) > 0);
-
- /* Mark interface as closed */
- if (0 == n)
- H5_PKG_INIT_VAR = FALSE;
- } /* end else */
- } /* end else */
- } /* end if */
+ if (H5VL__num_opt_operation() > 0) {
+ /* Unregister all dynamically registered optional operations */
+ (void)H5VL__term_opt_operation();
+ n++;
+ } /* end if */
+ else {
+ /* Destroy the VOL connector ID group */
+ n += (H5I_dec_type_ref(H5I_VOL) > 0);
+
+ /* Mark interface as closed */
+ if (0 == n)
+ H5_PKG_INIT_VAR = FALSE;
+ } /* end else */
+ } /* end else */
+ } /* end else */
+ } /* end if */
FUNC_LEAVE_NOAPI(n)
} /* end H5VL_term_package() */
@@ -365,7 +375,7 @@ H5VL__get_connector_cb(void *obj, hid_t id, void *_op_data)
*
*-------------------------------------------------------------------------
*/
-static herr_t
+herr_t
H5VL__set_def_conn(void)
{
H5P_genplist_t *def_fapl; /* Default file access property list */
@@ -376,11 +386,16 @@ H5VL__set_def_conn(void)
void * vol_info = NULL; /* VOL connector info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_STATIC
+ FUNC_ENTER_PACKAGE
- /* Sanity check */
- HDassert(H5VL_def_conn_s.connector_id == (-1));
- HDassert(H5VL_def_conn_s.connector_info == NULL);
+ /* Reset default VOL connector, if it's set already */
+ /* (Can happen during testing -QAK) */
+ if (H5VL_def_conn_s.connector_id > 0) {
+ /* Release the default VOL connector */
+ (void)H5VL_conn_free(&H5VL_def_conn_s);
+ H5VL_def_conn_s.connector_id = -1;
+ H5VL_def_conn_s.connector_info = NULL;
+ } /* end if */
/* Check for environment variable set */
env_var = HDgetenv("HDF5_VOL_CONNECTOR");
@@ -760,51 +775,47 @@ done:
} /* end H5VL_register_using_existing_id() */
/*-------------------------------------------------------------------------
- * Function: H5VL_register_using_vol_id
+ * Function: H5VL_new_connector
*
- * Purpose: Utility function to create a user ID for an object created
- * or opened through the VOL. Uses the VOL connector's ID to
- * get the connector information instead of it being passed in.
+ * Purpose: Utility function to create a connector for a connector ID.
*
- * Return: Success: A valid HDF5 ID
- * Failure: H5I_INVALID_HID
+ * Return: Success: Pointer to a new connector object
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
-hid_t
-H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, hbool_t app_ref)
+H5VL_t *
+H5VL_new_connector(hid_t connector_id)
{
- H5VL_class_t *cls = NULL; /* VOL connector class */
- H5VL_t * connector = NULL; /* VOL connector struct */
- hbool_t conn_id_incr = FALSE; /* Whether the VOL connector ID has been incremented */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5VL_class_t *cls = NULL; /* VOL connector class */
+ H5VL_t * connector = NULL; /* New VOL connector struct */
+ hbool_t conn_id_incr = FALSE; /* Whether the VOL connector ID has been incremented */
+ H5VL_t * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(NULL)
/* Get the VOL class object from the connector's ID */
if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL)))
- HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "not a VOL connector ID")
+ HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, NULL, "not a VOL connector ID")
/* Setup VOL info struct */
if (NULL == (connector = H5FL_CALLOC(H5VL_t)))
- HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, H5I_INVALID_HID, "can't allocate VOL info struct")
+ HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate VOL connector struct")
connector->cls = cls;
connector->id = connector_id;
if (H5I_inc_ref(connector->id, FALSE) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VOL connector")
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINC, NULL, "unable to increment ref count on VOL connector")
conn_id_incr = TRUE;
- /* Get an ID for the VOL object */
- if ((ret_value = H5VL_register(type, obj, connector, app_ref)) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle")
+ /* Set return value */
+ ret_value = connector;
done:
/* Clean up on error */
- if (ret_value < 0) {
+ if (NULL == ret_value) {
/* Decrement VOL connector ID ref count on error */
if (conn_id_incr && H5I_dec_ref(connector_id) < 0)
- HDONE_ERROR(H5E_VOL, H5E_CANTDEC, H5I_INVALID_HID,
- "unable to decrement ref count on VOL connector")
+ HDONE_ERROR(H5E_VOL, H5E_CANTDEC, NULL, "unable to decrement ref count on VOL connector")
/* Free VOL connector struct */
if (NULL != connector)
@@ -812,6 +823,45 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_new_connector() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_register_using_vol_id
+ *
+ * Purpose: Utility function to create a user ID for an object created
+ * or opened through the VOL. Uses the VOL connector's ID to
+ * get the connector information instead of it being passed in.
+ *
+ * Return: Success: A valid HDF5 ID
+ * Failure: H5I_INVALID_HID
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t connector_id, hbool_t app_ref)
+{
+ H5VL_t *connector = NULL; /* VOL connector struct */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Create new VOL connector object, using the connector ID */
+ if (NULL == (connector = H5VL_new_connector(connector_id)))
+ HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't create VOL connector object")
+
+ /* Get an ID for the VOL object */
+ if ((ret_value = H5VL_register(type, obj, connector, app_ref)) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle")
+
+done:
+ /* Clean up on error */
+ if (H5I_INVALID_HID == ret_value)
+ /* Release newly created connector */
+ if (connector && H5VL_conn_dec_rc(connector) < 0)
+ HDONE_ERROR(H5E_VOL, H5E_CANTDEC, H5I_INVALID_HID,
+ "unable to decrement ref count on VOL connector")
+
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_register_using_vol_id() */
/*-------------------------------------------------------------------------
@@ -1125,15 +1175,20 @@ H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2,
if (cmp_value)
*same_file = FALSE;
else {
- void *obj2; /* Terminal object for second file */
+ void * obj2; /* Terminal object for second file */
+ H5VL_file_specific_args_t vol_cb_args; /* Arguments to VOL callback */
/* Get unwrapped (terminal) object for vol_obj2 */
if (NULL == (obj2 = H5VL_object_data(vol_obj2)))
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get unwrapped object")
- /* Make callback */
- if (H5VL_file_specific(vol_obj1, H5VL_FILE_IS_EQUAL, H5P_DATASET_XFER_DEFAULT, NULL, obj2,
- same_file) < 0)
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_FILE_IS_EQUAL;
+ vol_cb_args.args.is_equal.obj2 = obj2;
+ vol_cb_args.args.is_equal.same_file = same_file;
+
+ /* Make 'are files equal' callback */
+ if (H5VL_file_specific(vol_obj1, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, NULL) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTOPERATE, FAIL, "file specific failed")
} /* end else */
@@ -1702,7 +1757,7 @@ H5VL__get_connector_name(hid_t id, char *name /*out*/, size_t size)
len = HDstrlen(cls->name);
if (name) {
- HDstrncpy(name, cls->name, MIN(len + 1, size));
+ HDstrncpy(name, cls->name, size);
if (len >= size)
name[size - 1] = '\0';
} /* end if */
@@ -2047,6 +2102,36 @@ done:
} /* end H5VL_retrieve_lib_state() */
/*-------------------------------------------------------------------------
+ * Function: H5VL_start_lib_state
+ *
+ * Purpose: Opens a new internal state for the HDF5 library.
+ *
+ * Note: Currently just pushes a new API context state, but could be
+ * expanded in the future.
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Friday, February 5, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_start_lib_state(void)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Push a new API context on the stack */
+ if (H5CX_push() < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't push API context")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_start_lib_state() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL_restore_lib_state
*
* Purpose: Restore the state of the library.
@@ -2071,10 +2156,6 @@ H5VL_restore_lib_state(const void *state)
/* Sanity checks */
HDassert(state);
- /* Push a new API context on the stack */
- if (H5CX_push() < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't push API context")
-
/* Restore the API context state */
if (H5CX_restore_state((const H5CX_state_t *)state) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set API context state")
@@ -2084,16 +2165,16 @@ done:
} /* end H5VL_restore_lib_state() */
/*-------------------------------------------------------------------------
- * Function: H5VL_reset_lib_state
+ * Function: H5VL_finish_lib_state
*
- * Purpose: Reset the state of the library, undoing affects of
- * H5VL_restore_lib_state.
+ * Purpose: Closes the state of the library, undoing affects of
+ * H5VL_start_lib_state.
*
* Note: Currently just resets the API context state, but could be
* expanded in the future.
*
* Note: This routine must be called as a "pair" with
- * H5VL_restore_lib_state. It can be called before / after /
+ * H5VL_start_lib_state. It can be called before / after /
* independently of H5VL_free_lib_state.
*
* Return: SUCCEED / FAIL
@@ -2104,7 +2185,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_reset_lib_state(void)
+H5VL_finish_lib_state(void)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2116,7 +2197,7 @@ H5VL_reset_lib_state(void)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5VL_reset_lib_state() */
+} /* end H5VL_finish_lib_state() */
/*-------------------------------------------------------------------------
* Function: H5VL_free_lib_state
@@ -2484,6 +2565,33 @@ done:
} /* end H5VL_check_plugin_load() */
/*-------------------------------------------------------------------------
+ * Function: H5VL__is_default_conn
+ *
+ * Purpose: Check if the default connector will be used for a container.
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+H5VL__is_default_conn(hid_t fapl_id, hid_t connector_id, hbool_t *is_default)
+{
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Sanity checks */
+ HDassert(is_default);
+
+ /* Determine if the default VOL connector will be used, based on non-default
+ * values in the FAPL, connector ID, or the HDF5_VOL_CONNECTOR environment
+ * variable being set.
+ */
+ *is_default = (H5VL_def_conn_s.connector_id == H5_DEFAULT_VOL) &&
+ ((H5P_FILE_ACCESS_DEFAULT == fapl_id) || connector_id == H5_DEFAULT_VOL);
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5VL__is_default_conn() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL_setup_args
*
* Purpose: Set up arguments to access an object
@@ -2506,7 +2614,7 @@ H5VL_setup_args(hid_t loc_id, H5I_type_t id_type, H5VL_object_t **vol_obj)
if (NULL == (*vol_obj = (H5VL_object_t *)H5I_object_verify(loc_id, id_type)))
HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not the correct type of ID")
- /* Set up collective metadata (if appropriate */
+ /* Set up collective metadata (if appropriate) */
if (H5CX_set_loc(loc_id) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set collective metadata read")
@@ -2631,8 +2739,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_setup_name_args(hid_t loc_id, const char *name, const H5P_libclass_t *libclass, hbool_t is_collective,
- hid_t acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
+H5VL_setup_name_args(hid_t loc_id, const char *name, hbool_t is_collective, hid_t lapl_id,
+ H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2649,7 +2757,7 @@ H5VL_setup_name_args(hid_t loc_id, const char *name, const H5P_libclass_t *libcl
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string")
/* Verify access property list and set up collective metadata if appropriate */
- if (H5CX_set_apl(&acspl_id, libclass, loc_id, is_collective) < 0)
+ if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, is_collective) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info")
/* Get the location object */
@@ -2659,7 +2767,7 @@ H5VL_setup_name_args(hid_t loc_id, const char *name, const H5P_libclass_t *libcl
/* Set up location parameters */
loc_params->type = H5VL_OBJECT_BY_NAME;
loc_params->loc_data.loc_by_name.name = name;
- loc_params->loc_data.loc_by_name.lapl_id = acspl_id;
+ loc_params->loc_data.loc_by_name.lapl_id = lapl_id;
loc_params->obj_type = H5I_get_type(loc_id);
done:
@@ -2677,8 +2785,8 @@ done:
*/
herr_t
H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
- const H5P_libclass_t *libclass, hbool_t is_collective, hid_t acspl_id,
- H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
+ hbool_t is_collective, hid_t lapl_id, H5VL_object_t **vol_obj,
+ H5VL_loc_params_t *loc_params)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2699,7 +2807,7 @@ H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
/* Verify access property list and set up collective metadata if appropriate */
- if (H5CX_set_apl(&acspl_id, libclass, loc_id, is_collective) < 0)
+ if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, is_collective) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info")
/* Get the location object */
@@ -2712,7 +2820,7 @@ H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter
loc_params->loc_data.loc_by_idx.idx_type = idx_type;
loc_params->loc_data.loc_by_idx.order = order;
loc_params->loc_data.loc_by_idx.n = n;
- loc_params->loc_data.loc_by_idx.lapl_id = acspl_id;
+ loc_params->loc_data.loc_by_idx.lapl_id = lapl_id;
loc_params->obj_type = H5I_get_type(loc_id);
done:
@@ -2752,3 +2860,45 @@ H5VL_setup_token_args(hid_t loc_id, H5O_token_t *obj_token, H5VL_object_t **vol_
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_setup_token_args() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_get_cap_flags
+ *
+ * Purpose: Query capability flags for connector property.
+ *
+ * Note: VOL connector set with HDF5_VOL_CONNECTOR overrides the
+ * property passed in.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_get_cap_flags(const H5VL_connector_prop_t *connector_prop, unsigned *cap_flags)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(connector_prop);
+
+ /* Copy the connector ID & info, if there is one */
+ if (connector_prop->connector_id > 0) {
+ H5VL_class_t *connector; /* Pointer to connector */
+
+ /* Retrieve the connector for the ID */
+ if (NULL == (connector = (H5VL_class_t *)H5I_object(connector_prop->connector_id)))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a VOL connector ID")
+
+ /* Query the connector's capability flags */
+ if (H5VL_introspect_get_cap_flags(connector_prop->connector_info, connector, cap_flags) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't query connector's capability flags")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "connector ID not set?")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_get_cap_flags() */
diff --git a/src/H5VLmodule.h b/src/H5VLmodule.h
index 78c5986..8fcb961 100644
--- a/src/H5VLmodule.h
+++ b/src/H5VLmodule.h
@@ -27,10 +27,12 @@
#define H5_MY_PKG_ERR H5E_VOL
#define H5_MY_PKG_INIT YES
-/**
- * \defgroup H5VL H5VL
- * \brief Virtual Object Layer Interface
- * \todo Describe concisely what the functions in this module are about.
+/**\defgroup H5VL H5VL
+ *
+ * \todo Describe the VOL plugin life cycle.
+ *
+ * \defgroup ASYNC Asynchronous Functions
+ * \brief Asynchronous Functions
*
* \defgroup H5VLDEF Definitions
* \ingroup H5VL
diff --git a/src/H5VLnative.c b/src/H5VLnative.c
index b70d489..18b5b9c 100644
--- a/src/H5VLnative.c
+++ b/src/H5VLnative.c
@@ -47,13 +47,13 @@ static herr_t H5VL__native_term(void);
/* Native VOL connector class struct */
static const H5VL_class_t H5VL_native_cls_g = {
- H5VL_VERSION, /* VOL class struct version */
- H5VL_NATIVE_VALUE, /* value */
- H5VL_NATIVE_NAME, /* name */
- H5VL_NATIVE_VERSION, /* connector version */
- 0, /* capability flags */
- NULL, /* initialize */
- H5VL__native_term, /* terminate */
+ H5VL_VERSION, /* VOL class struct version */
+ H5VL_NATIVE_VALUE, /* value */
+ H5VL_NATIVE_NAME, /* name */
+ H5VL_NATIVE_VERSION, /* connector version */
+ H5VL_CAP_FLAG_NATIVE_FILES, /* capability flags */
+ NULL, /* initialize */
+ H5VL__native_term, /* terminate */
{
/* info_cls */
(size_t)0, /* info size */
@@ -139,8 +139,9 @@ static const H5VL_class_t H5VL_native_cls_g = {
},
{
/* introspect_cls */
- H5VL__native_introspect_get_conn_cls, /* get_conn_cls */
- H5VL__native_introspect_opt_query, /* opt_query */
+ H5VL__native_introspect_get_conn_cls, /* get_conn_cls */
+ H5VL__native_introspect_get_cap_flags, /* get_cap_flags */
+ H5VL__native_introspect_opt_query, /* opt_query */
},
{
/* request_cls */
@@ -244,6 +245,32 @@ H5VL__native_introspect_get_conn_cls(void H5_ATTR_UNUSED *obj, H5VL_get_conn_lvl
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5VL__native_introspect_get_conn_cls() */
+/*---------------------------------------------------------------------------
+ * Function: H5VL__native_introspect_get_cap_flags
+ *
+ * Purpose: Query the capability flags for this connector.
+ *
+ * Note: This routine is in this file so that it can return the field
+ * from the staticly declared class struct.
+ *
+ * Returns: SUCCEED (Can't fail)
+ *
+ *---------------------------------------------------------------------------
+ */
+herr_t
+H5VL__native_introspect_get_cap_flags(const void H5_ATTR_UNUSED *info, unsigned *cap_flags)
+{
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Sanity check */
+ HDassert(cap_flags);
+
+ /* Set the flags from the connector's field */
+ *cap_flags = H5VL_native_cls_g.cap_flags;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5VL__native_introspect_get_cap_flags() */
+
/*-------------------------------------------------------------------------
* Function: H5VL_native_get_file_addr_len
*
diff --git a/src/H5VLnative.h b/src/H5VLnative.h
index 4a46e9e..fe8ede2 100644
--- a/src/H5VLnative.h
+++ b/src/H5VLnative.h
@@ -18,6 +18,7 @@
#define H5VLnative_H
/* Public headers needed by this file */
+#include "H5Apublic.h" /* Attributes */
#include "H5VLpublic.h" /* Virtual Object Layer */
/*****************/
@@ -39,21 +40,140 @@
#ifndef H5_NO_DEPRECATED_SYMBOLS
#define H5VL_NATIVE_ATTR_ITERATE_OLD 0 /* H5Aiterate (deprecated routine) */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
+/* NOTE: If values over 1023 are added, the H5VL_RESERVED_NATIVE_OPTIONAL macro
+ * must be updated.
+ */
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+/* Parameters for attribute 'iterate old' operation */
+typedef struct H5VL_native_attr_iterate_old_t {
+ hid_t loc_id;
+ unsigned * attr_num;
+ H5A_operator1_t op;
+ void * op_data;
+} H5VL_native_attr_iterate_old_t;
+
+/* Parameters for native connector's attribute 'optional' operations */
+typedef union H5VL_native_attr_optional_args_t {
+ /* H5VL_NATIVE_ATTR_ITERATE_OLD */
+ H5VL_native_attr_iterate_old_t iterate_old;
+} H5VL_native_attr_optional_args_t;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Values for native VOL connector dataset optional VOL operations */
/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
* routine must be updated.
*/
-#define H5VL_NATIVE_DATASET_FORMAT_CONVERT 0 /* H5Dformat_convert (internal) */
-#define H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE 1 /* H5Dget_chunk_index_type */
-#define H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE 2 /* H5Dget_chunk_storage_size */
-#define H5VL_NATIVE_DATASET_GET_NUM_CHUNKS 3 /* H5Dget_num_chunks */
-#define H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX 4 /* H5Dget_chunk_info */
-#define H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD 5 /* H5Dget_chunk_info_by_coord */
-#define H5VL_NATIVE_DATASET_CHUNK_READ 6 /* H5Dchunk_read */
-#define H5VL_NATIVE_DATASET_CHUNK_WRITE 7 /* H5Dchunk_write */
-#define H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE 8 /* H5Dvlen_get_buf_size */
-#define H5VL_NATIVE_DATASET_GET_OFFSET 9 /* H5Dget_offset */
+#define H5VL_NATIVE_DATASET_FORMAT_CONVERT 0 /* H5Dformat_convert (internal) */
+#define H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE 1 /* H5Dget_chunk_index_type */
+#define H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE 2 /* H5Dget_chunk_storage_size */
+#define H5VL_NATIVE_DATASET_GET_NUM_CHUNKS 3 /* H5Dget_num_chunks */
+#define H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX 4 /* H5Dget_chunk_info */
+#define H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD 5 /* H5Dget_chunk_info_by_coord */
+#define H5VL_NATIVE_DATASET_CHUNK_READ 6 /* H5Dchunk_read */
+#define H5VL_NATIVE_DATASET_CHUNK_WRITE 7 /* H5Dchunk_write */
+#define H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE 8 /* H5Dvlen_get_buf_size */
+#define H5VL_NATIVE_DATASET_GET_OFFSET 9 /* H5Dget_offset */
+#define H5VL_NATIVE_DATASET_CHUNK_ITER 10 /* H5Dget_offset */
+/* NOTE: If values over 1023 are added, the H5VL_RESERVED_NATIVE_OPTIONAL macro
+ * must be updated.
+ */
+
+/* Parameters for native connector's dataset 'chunk read' operation */
+typedef struct H5VL_native_dataset_chunk_read_t {
+ const hsize_t *offset;
+ uint32_t filters;
+ void * buf;
+} H5VL_native_dataset_chunk_read_t;
+
+/* Parameters for native connector's dataset 'chunk write' operation */
+typedef struct H5VL_native_dataset_chunk_write_t {
+ const hsize_t *offset;
+ uint32_t filters;
+ uint32_t size;
+ const void * buf;
+} H5VL_native_dataset_chunk_write_t;
+
+/* Parameters for native connector's dataset 'get vlen buf size' operation */
+typedef struct H5VL_native_dataset_get_vlen_buf_size_t {
+ hid_t type_id;
+ hid_t space_id;
+ hsize_t *size; /* Size of variable-length data buffer (OUT) */
+} H5VL_native_dataset_get_vlen_buf_size_t;
+
+/* Parameters for native connector's dataset 'get chunk storage size' operation */
+typedef struct H5VL_native_dataset_get_chunk_storage_size_t {
+ const hsize_t *offset; /* Offset of chunk */
+ hsize_t * size; /* Size of chunk (OUT) */
+} H5VL_native_dataset_get_chunk_storage_size_t;
+
+/* Parameters for native connector's dataset 'get num chunks' operation */
+typedef struct H5VL_native_dataset_get_num_chunks_t {
+ hid_t space_id; /* Space selection */
+ hsize_t *nchunks; /* # of chunk for space selection (OUT) */
+} H5VL_native_dataset_get_num_chunks_t;
+
+/* Parameters for native connector's dataset 'get chunk info by idx' operation */
+typedef struct H5VL_native_dataset_get_chunk_info_by_idx_t {
+ hid_t space_id; /* Space selection */
+ hsize_t chk_index; /* Chunk index within space */
+ hsize_t * offset; /* Chunk coordinates (OUT) */
+ unsigned *filter_mask; /* Filter mask for chunk (OUT) */
+ haddr_t * addr; /* Address of chunk in file (OUT) */
+ hsize_t * size; /* Size of chunk in file (OUT) */
+} H5VL_native_dataset_get_chunk_info_by_idx_t;
+
+/* Parameters for native connector's dataset 'get chunk info by coord' operation */
+typedef struct H5VL_native_dataset_get_chunk_info_by_coord_t {
+ const hsize_t *offset; /* Chunk coordinates */
+ unsigned * filter_mask; /* Filter mask for chunk (OUT) */
+ haddr_t * addr; /* Address of chunk in file (OUT) */
+ hsize_t * size; /* Size of chunk in file (OUT) */
+} H5VL_native_dataset_get_chunk_info_by_coord_t;
+
+/* Parameters for native connector's dataset 'optional' operations */
+typedef union H5VL_native_dataset_optional_args_t {
+ /* H5VL_NATIVE_DATASET_FORMAT_CONVERT */
+ /* No args */
+
+ /* H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE */
+ struct {
+ H5D_chunk_index_t *idx_type; /* Type of chunk index (OUT) */
+ } get_chunk_idx_type;
+
+ /* H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE */
+ H5VL_native_dataset_get_chunk_storage_size_t get_chunk_storage_size;
+
+ /* H5VL_NATIVE_DATASET_GET_NUM_CHUNKS */
+ H5VL_native_dataset_get_num_chunks_t get_num_chunks;
+
+ /* H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX */
+ H5VL_native_dataset_get_chunk_info_by_idx_t get_chunk_info_by_idx;
+
+ /* H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD */
+ H5VL_native_dataset_get_chunk_info_by_coord_t get_chunk_info_by_coord;
+
+ /* H5VL_NATIVE_DATASET_CHUNK_READ */
+ H5VL_native_dataset_chunk_read_t chunk_read;
+
+ /* H5VL_NATIVE_DATASET_CHUNK_WRITE */
+ H5VL_native_dataset_chunk_write_t chunk_write;
+
+ /* H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE */
+ H5VL_native_dataset_get_vlen_buf_size_t get_vlen_buf_size;
+
+ /* H5VL_NATIVE_DATASET_GET_OFFSET */
+ struct {
+ haddr_t *offset; /* Contiguous dataset's offset in the file (OUT) */
+ } get_offset;
+
+ /* H5VL_NATIVE_DATASET_CHUNK_ITER */
+ struct {
+ H5D_chunk_iter_op_t op; /* Chunk iteration callback */
+ void * op_data; /* Context to pass to iteration callback */
+ } chunk_iter;
+
+} H5VL_native_dataset_optional_args_t;
/* Values for native VOL connector file optional VOL operations */
/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
@@ -85,9 +205,195 @@
#define H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS 23 /* H5Fset_latest_format/libver_bounds */
#define H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG 24 /* H5Fget_dset_no_attrs_hint */
#define H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG 25 /* H5Fset_dset_no_attrs_hint */
-#define H5VL_NATIVE_FILE_GET_MPI_ATOMICITY 26 /* H5Fget_mpi_atomicity */
-#define H5VL_NATIVE_FILE_SET_MPI_ATOMICITY 27 /* H5Fset_mpi_atomicity */
-#define H5VL_NATIVE_FILE_POST_OPEN 28 /* Adjust file after open, with wrapping context */
+#ifdef H5_HAVE_PARALLEL
+#define H5VL_NATIVE_FILE_GET_MPI_ATOMICITY 26 /* H5Fget_mpi_atomicity */
+#define H5VL_NATIVE_FILE_SET_MPI_ATOMICITY 27 /* H5Fset_mpi_atomicity */
+#endif /* H5_HAVE_PARALLEL */
+#define H5VL_NATIVE_FILE_POST_OPEN 28 /* Adjust file after open, with wrapping context */
+/* NOTE: If values over 1023 are added, the H5VL_RESERVED_NATIVE_OPTIONAL macro
+ * must be updated.
+ */
+
+/* Parameters for native connector's file 'get file image' operation */
+typedef struct H5VL_native_file_get_file_image_t {
+ size_t buf_size; /* Size of file image buffer */
+ void * buf; /* Buffer for file image (OUT) */
+ size_t *image_len; /* Size of file image (OUT) */
+} H5VL_native_file_get_file_image_t;
+
+/* Parameters for native connector's file 'get free sections' operation */
+typedef struct H5VL_native_file_get_free_sections_t {
+ H5F_mem_t type; /* Type of file memory to query */
+ H5F_sect_info_t *sect_info; /* Array of sections (OUT) */
+ size_t nsects; /* Size of section array */
+ size_t * sect_count; /* Actual # of sections of type (OUT) */
+} H5VL_native_file_get_free_sections_t;
+
+/* Parameters for native connector's file 'get freespace' operation */
+typedef struct H5VL_native_file_get_freespace_t {
+ hsize_t *size; /* Size of free space (OUT) */
+} H5VL_native_file_get_freespace_t;
+
+/* Parameters for native connector's file 'get info' operation */
+typedef struct H5VL_native_file_get_info_t {
+ H5I_type_t type; /* Type of object */
+ H5F_info2_t *finfo; /* Pointer to file info (OUT) */
+} H5VL_native_file_get_info_t;
+
+/* Parameters for native connector's file 'get metadata cache size' operation */
+typedef struct H5VL_native_file_get_mdc_size_t {
+ size_t * max_size; /* Maximum amount of cached data (OUT) */
+ size_t * min_clean_size; /* Minimum amount of cached data to keep clean (OUT) */
+ size_t * cur_size; /* Current amount of cached data (OUT) */
+ uint32_t *cur_num_entries; /* Current # of cached entries (OUT) */
+} H5VL_native_file_get_mdc_size_t;
+
+/* Parameters for native connector's file 'get VFD handle' operation */
+typedef struct H5VL_native_file_get_vfd_handle_t {
+ hid_t fapl_id;
+ void **file_handle; /* File handle from VFD (OUT) */
+} H5VL_native_file_get_vfd_handle_t;
+
+/* Parameters for native connector's file 'get MDC logging status' operation */
+typedef struct H5VL_native_file_get_mdc_logging_status_t {
+ hbool_t *is_enabled; /* Whether logging is enabled (OUT) */
+ hbool_t *is_currently_logging; /* Whether currently logging (OUT) */
+} H5VL_native_file_get_mdc_logging_status_t;
+
+/* Parameters for native connector's file 'get page buffering stats' operation */
+typedef struct H5VL_native_file_get_page_buffering_stats_t {
+ unsigned *accesses; /* Metadata/raw data page access counts (OUT) */
+ unsigned *hits; /* Metadata/raw data page hit counts (OUT) */
+ unsigned *misses; /* Metadata/raw data page miss counts (OUT) */
+ unsigned *evictions; /* Metadata/raw data page eviction counts (OUT) */
+ unsigned *bypasses; /* Metadata/raw data page bypass counts (OUT) */
+} H5VL_native_file_get_page_buffering_stats_t;
+
+/* Parameters for native connector's file 'get MDC image info' operation */
+typedef struct H5VL_native_file_get_mdc_image_info_t {
+ haddr_t *addr; /* Address of image (OUT) */
+ hsize_t *len; /* Length of image (OUT) */
+} H5VL_native_file_get_mdc_image_info_t;
+
+/* Parameters for native connector's file 'set libver bounds' operation */
+typedef struct H5VL_native_file_set_libver_bounds_t {
+ H5F_libver_t low; /* Lowest version possible */
+ H5F_libver_t high; /* Highest version possible */
+} H5VL_native_file_set_libver_bounds_t;
+
+/* Parameters for native connector's file 'optional' operations */
+typedef union H5VL_native_file_optional_args_t {
+ /* H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE */
+ /* No args */
+
+ /* H5VL_NATIVE_FILE_GET_FILE_IMAGE */
+ H5VL_native_file_get_file_image_t get_file_image;
+
+ /* H5VL_NATIVE_FILE_GET_FREE_SECTIONS */
+ H5VL_native_file_get_free_sections_t get_free_sections;
+
+ /* H5VL_NATIVE_FILE_GET_FREE_SPACE */
+ H5VL_native_file_get_freespace_t get_freespace;
+
+ /* H5VL_NATIVE_FILE_GET_INFO */
+ H5VL_native_file_get_info_t get_info;
+
+ /* H5VL_NATIVE_FILE_GET_MDC_CONF */
+ struct {
+ H5AC_cache_config_t *config; /* Pointer to MDC config (OUT) */
+ } get_mdc_config;
+
+ /* H5VL_NATIVE_FILE_GET_MDC_HR */
+ struct {
+ double *hit_rate; /* Metadata cache hit rate (OUT) */
+ } get_mdc_hit_rate;
+
+ /* H5VL_NATIVE_FILE_GET_MDC_SIZE */
+ H5VL_native_file_get_mdc_size_t get_mdc_size;
+
+ /* H5VL_NATIVE_FILE_GET_SIZE */
+ struct {
+ hsize_t *size; /* Size of file (OUT) */
+ } get_size;
+
+ /* H5VL_NATIVE_FILE_GET_VFD_HANDLE */
+ H5VL_native_file_get_vfd_handle_t get_vfd_handle;
+
+ /* H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE */
+ /* No args */
+
+ /* H5VL_NATIVE_FILE_SET_MDC_CONFIG */
+ struct {
+ const H5AC_cache_config_t *config; /* Pointer to new MDC config */
+ } set_mdc_config;
+
+ /* H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO */
+ struct {
+ H5F_retry_info_t *info; /* Pointer to metadata read retry info (OUT) */
+ } get_metadata_read_retry_info;
+
+ /* H5VL_NATIVE_FILE_START_SWMR_WRITE */
+ /* No args */
+
+ /* H5VL_NATIVE_FILE_START_MDC_LOGGING */
+ /* No args */
+
+ /* H5VL_NATIVE_FILE_STOP_MDC_LOGGING */
+ /* No args */
+
+ /* H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS */
+ H5VL_native_file_get_mdc_logging_status_t get_mdc_logging_status;
+
+ /* H5VL_NATIVE_FILE_FORMAT_CONVERT */
+ /* No args */
+
+ /* H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS */
+ /* No args */
+
+ /* H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS */
+ H5VL_native_file_get_page_buffering_stats_t get_page_buffering_stats;
+
+ /* H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO */
+ H5VL_native_file_get_mdc_image_info_t get_mdc_image_info;
+
+ /* H5VL_NATIVE_FILE_GET_EOA */
+ struct {
+ haddr_t *eoa; /* End of allocated file address space (OUT) */
+ } get_eoa;
+
+ /* H5VL_NATIVE_FILE_INCR_FILESIZE */
+ struct {
+ hsize_t increment; /* Amount to increment file size */
+ } increment_filesize;
+
+ /* H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS */
+ H5VL_native_file_set_libver_bounds_t set_libver_bounds;
+
+ /* H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG */
+ struct {
+ hbool_t *minimize; /* Flag whether dataset object headers are minimal (OUT) */
+ } get_min_dset_ohdr_flag;
+
+ /* H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG */
+ struct {
+ hbool_t minimize; /* Flag whether dataset object headers should be minimal */
+ } set_min_dset_ohdr_flag;
+
+#ifdef H5_HAVE_PARALLEL
+ /* H5VL_NATIVE_FILE_GET_MPI_ATOMICITY */
+ struct {
+ hbool_t *flag; /* Flag whether MPI atomicity is set for files (OUT) */
+ } get_mpi_atomicity;
+
+ /* H5VL_NATIVE_FILE_SET_MPI_ATOMICITY */
+ struct {
+ hbool_t flag; /* Flag whether to set MPI atomicity for files */
+ } set_mpi_atomicity;
+#endif /* H5_HAVE_PARALLEL */
+
+ /* H5VL_NATIVE_FILE_POST_OPEN */
+ /* No args */
+} H5VL_native_file_optional_args_t;
/* Values for native VOL connector group optional VOL operations */
/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
@@ -97,6 +403,36 @@
#define H5VL_NATIVE_GROUP_ITERATE_OLD 0 /* HG5Giterate (deprecated routine) */
#define H5VL_NATIVE_GROUP_GET_OBJINFO 1 /* HG5Gget_objinfo (deprecated routine) */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
+/* NOTE: If values over 1023 are added, the H5VL_RESERVED_NATIVE_OPTIONAL macro
+ * must be updated.
+ */
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+/* Parameters for group 'iterate old' operation */
+typedef struct H5VL_native_group_iterate_old_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for iteration */
+ hsize_t idx; /* Index of link to begin iteration at */
+ hsize_t * last_obj; /* Index of last link looked at (OUT) */
+ H5G_iterate_t op; /* Group (link) operator callback */
+ void * op_data; /* Context to pass to iterator callback */
+} H5VL_native_group_iterate_old_t;
+
+/* Parameters for group 'get objinfo' operation */
+typedef struct H5VL_native_group_get_objinfo_t {
+ H5VL_loc_params_t loc_params; /* Location parameters for iteration */
+ hbool_t follow_link; /* Whether to follow links for query */
+ H5G_stat_t * statbuf; /* Pointer to object info struct (OUT) */
+} H5VL_native_group_get_objinfo_t;
+
+/* Parameters for native connector's group 'optional' operations */
+typedef union H5VL_native_group_optional_args_t {
+ /* H5VL_NATIVE_GROUP_ITERATE_OLD */
+ H5VL_native_group_iterate_old_t iterate_old;
+
+ /* H5VL_NATIVE_GROUP_GET_OBJINFO */
+ H5VL_native_group_get_objinfo_t get_objinfo;
+} H5VL_native_group_optional_args_t;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Values for native VOL connector object optional VOL operations */
/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
@@ -108,6 +444,47 @@
#define H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES 3 /* H5Oenable_mdc_flushes */
#define H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED 4 /* H5Oare_mdc_flushes_disabled */
#define H5VL_NATIVE_OBJECT_GET_NATIVE_INFO 5 /* H5Oget_native_info(_by_idx, _by_name) */
+/* NOTE: If values over 1023 are added, the H5VL_RESERVED_NATIVE_OPTIONAL macro
+ * must be updated.
+ */
+
+/* Parameters for native connector's object 'get comment' operation */
+typedef struct H5VL_native_object_get_comment_t {
+ size_t buf_size; /* Size of comment buffer */
+ void * buf; /* Buffer for comment (OUT) */
+ size_t *comment_len; /* Actual size of comment (OUT) */
+} H5VL_native_object_get_comment_t;
+
+/* Parameters for object 'get native info' operation */
+typedef struct H5VL_native_object_get_native_info_t {
+ unsigned fields; /* Fields to retrieve */
+ H5O_native_info_t *ninfo; /* Native info (OUT) */
+} H5VL_native_object_get_native_info_t;
+
+/* Parameters for native connector's object 'optional' operations */
+typedef union H5VL_native_object_optional_args_t {
+ /* H5VL_NATIVE_OBJECT_GET_COMMENT */
+ H5VL_native_object_get_comment_t get_comment;
+
+ /* H5VL_NATIVE_OBJECT_SET_COMMENT */
+ struct {
+ const char *comment; /* Comment string to set for the object (IN) */
+ } set_comment;
+
+ /* H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES */
+ /* No args */
+
+ /* H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES */
+ /* No args */
+
+ /* H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED */
+ struct {
+ hbool_t *flag; /* Flag whether metadata cache flushes are disabled for this object (OUT) */
+ } are_mdc_flushes_disabled;
+
+ /* H5VL_NATIVE_OBJECT_GET_NATIVE_INFO */
+ H5VL_native_object_get_native_info_t get_native_info;
+} H5VL_native_object_optional_args_t;
/*******************/
/* Public Typedefs */
diff --git a/src/H5VLnative_attr.c b/src/H5VLnative_attr.c
index 7beb98f..834ae40 100644
--- a/src/H5VLnative_attr.c
+++ b/src/H5VLnative_attr.c
@@ -15,8 +15,15 @@
*
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5A_FRIEND /* Suppress error about including H5Apkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Apkg.h" /* Attributes */
#include "H5Eprivate.h" /* Error handling */
@@ -30,6 +37,30 @@
#include "H5VLnative_private.h" /* Native VOL connector */
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/*-------------------------------------------------------------------------
* Function: H5VL__native_attr_create
*
@@ -214,40 +245,37 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (get_type) {
+ switch (args->op_type) {
/* H5Aget_space */
case H5VL_ATTR_GET_SPACE: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
- H5A_t *attr = (H5A_t *)obj;
+ H5A_t *attr = (H5A_t *)obj;
- if ((*ret_id = H5A_get_space(attr)) < 0)
+ if ((args->args.get_space.space_id = H5A_get_space(attr)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute")
break;
}
/* H5Aget_type */
case H5VL_ATTR_GET_TYPE: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
- H5A_t *attr = (H5A_t *)obj;
+ H5A_t *attr = (H5A_t *)obj;
- if ((*ret_id = H5A__get_type(attr)) < 0)
+ if ((args->args.get_type.type_id = H5A__get_type(attr)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute")
break;
}
/* H5Aget_create_plist */
case H5VL_ATTR_GET_ACPL: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
- H5A_t *attr = (H5A_t *)obj;
+ H5A_t *attr = (H5A_t *)obj;
- if ((*ret_id = H5A__get_create_plist(attr)) < 0)
+ if ((args->args.get_acpl.acpl_id = H5A__get_create_plist(attr)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for attr")
break;
@@ -255,40 +283,37 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED
/* H5Aget_name */
case H5VL_ATTR_GET_NAME: {
- const H5VL_loc_params_t *loc_params = HDva_arg(arguments, const H5VL_loc_params_t *);
- size_t buf_size = HDva_arg(arguments, size_t);
- char * buf = HDva_arg(arguments, char *);
- ssize_t * ret_val = HDva_arg(arguments, ssize_t *);
- H5A_t * attr = NULL;
+ H5VL_attr_get_name_args_t *get_name_args = &args->args.get_name;
- if (H5VL_OBJECT_BY_SELF == loc_params->type) {
- attr = (H5A_t *)obj;
- /* Call private function in turn */
- if (0 > (*ret_val = H5A__get_name(attr, buf_size, buf)))
+ if (H5VL_OBJECT_BY_SELF == get_name_args->loc_params.type) {
+ if (H5A__get_name((H5A_t *)obj, get_name_args->buf_size, get_name_args->buf,
+ get_name_args->attr_name_len) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get attribute name")
}
- else if (H5VL_OBJECT_BY_IDX == loc_params->type) {
+ else if (H5VL_OBJECT_BY_IDX == get_name_args->loc_params.type) {
H5G_loc_t loc;
+ H5A_t * attr;
/* check arguments */
- if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
+ if (H5G_loc_real(obj, get_name_args->loc_params.obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
/* Open the attribute on the object header */
- if (NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name,
- loc_params->loc_data.loc_by_idx.idx_type,
- loc_params->loc_data.loc_by_idx.order,
- loc_params->loc_data.loc_by_idx.n)))
+ if (NULL == (attr = H5A__open_by_idx(&loc, get_name_args->loc_params.loc_data.loc_by_idx.name,
+ get_name_args->loc_params.loc_data.loc_by_idx.idx_type,
+ get_name_args->loc_params.loc_data.loc_by_idx.order,
+ get_name_args->loc_params.loc_data.loc_by_idx.n)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute")
/* Get the length of the name */
- *ret_val = (ssize_t)HDstrlen(attr->shared->name);
+ *get_name_args->attr_name_len = HDstrlen(attr->shared->name);
/* Copy the name into the user's buffer, if given */
- if (buf) {
- HDstrncpy(buf, attr->shared->name, MIN((size_t)(*ret_val + 1), buf_size));
- if ((size_t)(*ret_val) >= buf_size)
- buf[buf_size - 1] = '\0';
+ if (get_name_args->buf) {
+ HDstrncpy(get_name_args->buf, attr->shared->name,
+ MIN((*get_name_args->attr_name_len + 1), get_name_args->buf_size));
+ if (*get_name_args->attr_name_len >= get_name_args->buf_size)
+ get_name_args->buf[get_name_args->buf_size - 1] = '\0';
} /* end if */
/* Release resources */
@@ -303,52 +328,51 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED
/* H5Aget_info */
case H5VL_ATTR_GET_INFO: {
- const H5VL_loc_params_t *loc_params = HDva_arg(arguments, const H5VL_loc_params_t *);
- H5A_info_t * ainfo = HDva_arg(arguments, H5A_info_t *);
- H5A_t * attr = NULL;
+ H5VL_attr_get_info_args_t *get_info_args = &args->args.get_info;
+ H5A_t * attr = NULL;
- if (H5VL_OBJECT_BY_SELF == loc_params->type) {
+ if (H5VL_OBJECT_BY_SELF == get_info_args->loc_params.type) {
attr = (H5A_t *)obj;
- if (H5A__get_info(attr, ainfo) < 0)
+ if (H5A__get_info(attr, get_info_args->ainfo) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get attribute info")
}
- else if (H5VL_OBJECT_BY_NAME == loc_params->type) {
- char * attr_name = HDva_arg(arguments, char *);
+ else if (H5VL_OBJECT_BY_NAME == get_info_args->loc_params.type) {
H5G_loc_t loc;
/* check arguments */
- if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
+ if (H5G_loc_real(obj, get_info_args->loc_params.obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
/* Open the attribute on the object header */
if (NULL ==
- (attr = H5A__open_by_name(&loc, loc_params->loc_data.loc_by_name.name, attr_name)))
+ (attr = H5A__open_by_name(&loc, get_info_args->loc_params.loc_data.loc_by_name.name,
+ get_info_args->attr_name)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute")
/* Get the attribute information */
- if (H5A__get_info(attr, ainfo) < 0)
+ if (H5A__get_info(attr, get_info_args->ainfo) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
/* Release resources */
if (attr && H5A__close(attr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute")
}
- else if (H5VL_OBJECT_BY_IDX == loc_params->type) {
+ else if (H5VL_OBJECT_BY_IDX == get_info_args->loc_params.type) {
H5G_loc_t loc;
/* check arguments */
- if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
+ if (H5G_loc_real(obj, get_info_args->loc_params.obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
/* Open the attribute on the object header */
- if (NULL == (attr = H5A__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name,
- loc_params->loc_data.loc_by_idx.idx_type,
- loc_params->loc_data.loc_by_idx.order,
- loc_params->loc_data.loc_by_idx.n)))
+ if (NULL == (attr = H5A__open_by_idx(&loc, get_info_args->loc_params.loc_data.loc_by_idx.name,
+ get_info_args->loc_params.loc_data.loc_by_idx.idx_type,
+ get_info_args->loc_params.loc_data.loc_by_idx.order,
+ get_info_args->loc_params.loc_data.loc_by_idx.n)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute")
/* Get the attribute information */
- if (H5A__get_info(attr, ainfo) < 0)
+ if (H5A__get_info(attr, get_info_args->ainfo) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
/* Release resources */
@@ -362,11 +386,10 @@ H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED
}
case H5VL_ATTR_GET_STORAGE_SIZE: {
- hsize_t *ret = HDva_arg(arguments, hsize_t *);
- H5A_t * attr = (H5A_t *)obj;
+ H5A_t *attr = (H5A_t *)obj;
- /* Set return value */
- *ret = attr->shared->data_size;
+ /* Set storage size */
+ *args->args.get_storage_size.data_size = attr->shared->data_size;
break;
}
@@ -388,8 +411,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_t specific_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_attr_specific_args_t *args,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req)
{
H5G_loc_t loc;
herr_t ret_value = SUCCEED; /* Return value */
@@ -400,48 +423,51 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_
if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- switch (specific_type) {
+ switch (args->op_type) {
+ /* H5Adelete/delete_by_name */
case H5VL_ATTR_DELETE: {
- char *attr_name = HDva_arg(arguments, char *);
-
if (H5VL_OBJECT_BY_SELF == loc_params->type) {
- /* H5Adelete */
/* Delete the attribute from the location */
- if (H5O__attr_remove(loc.oloc, attr_name) < 0)
+ if (H5O__attr_remove(loc.oloc, args->args.del.name) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
} /* end if */
else if (H5VL_OBJECT_BY_NAME == loc_params->type) {
- /* H5Adelete_by_name */
/* Delete the attribute */
- if (H5A__delete_by_name(&loc, loc_params->loc_data.loc_by_name.name, attr_name) < 0)
+ if (H5A__delete_by_name(&loc, loc_params->loc_data.loc_by_name.name, args->args.del.name) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
} /* end else-if */
- else if (H5VL_OBJECT_BY_IDX == loc_params->type) {
- /* H5Adelete_by_idx */
+ else
+ HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute delete location")
+ break;
+ }
+
+ /* H5Adelete_by_idx */
+ case H5VL_ATTR_DELETE_BY_IDX: {
+ H5VL_attr_delete_by_idx_args_t *del_by_idx_args =
+ &args->args.delete_by_idx; /* Arguments to delete_by_idx operation */
+
+ if (H5VL_OBJECT_BY_NAME == loc_params->type) {
/* Delete the attribute from the location */
- if (H5A__delete_by_idx(
- &loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type,
- loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n) < 0)
+ if (H5A__delete_by_idx(&loc, loc_params->loc_data.loc_by_name.name, del_by_idx_args->idx_type,
+ del_by_idx_args->order, del_by_idx_args->n) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
- } /* end else-if */
+ } /* end if */
else
- HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute remove parameters")
+ HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute delete_by_idx location")
break;
}
+ /* H5Aexists/exists_by_name */
case H5VL_ATTR_EXISTS: {
- const char *attr_name = HDva_arg(arguments, const char *);
- hbool_t * attr_exists = HDva_arg(arguments, hbool_t *);
-
- if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Aexists */
+ if (loc_params->type == H5VL_OBJECT_BY_SELF) {
/* Check if the attribute exists */
- if (H5O__attr_exists(loc.oloc, attr_name, attr_exists) < 0)
+ if (H5O__attr_exists(loc.oloc, args->args.exists.name, args->args.exists.exists) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists")
- } /* end if */
- else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Aexists_by_name */
+ } /* end if */
+ else if (loc_params->type == H5VL_OBJECT_BY_NAME) {
/* Check if the attribute exists */
- if (H5A__exists_by_name(loc, loc_params->loc_data.loc_by_name.name, attr_name, attr_exists) <
- 0)
+ if (H5A__exists_by_name(loc, loc_params->loc_data.loc_by_name.name, args->args.exists.name,
+ args->args.exists.exists) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists")
} /* end else-if */
else
@@ -449,42 +475,38 @@ H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_
break;
}
+ /* H5Aiterate/iterate_by_name */
case H5VL_ATTR_ITER: {
- H5_index_t idx_type = (H5_index_t)HDva_arg(arguments, int); /* enum work-around */
- H5_iter_order_t order = (H5_iter_order_t)HDva_arg(arguments, int); /* enum work-around */
- hsize_t * idx = HDva_arg(arguments, hsize_t *);
- H5A_operator2_t op = HDva_arg(arguments, H5A_operator2_t);
- void * op_data = HDva_arg(arguments, void *);
-
- if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Aiterate2 */
- /* Iterate over attributes */
- if ((ret_value = H5A__iterate(&loc, ".", idx_type, order, idx, op, op_data)) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes")
- } /* end if */
- else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Aiterate_by_name */
- /* Iterate over attributes by name */
- if ((ret_value = H5A__iterate(&loc, loc_params->loc_data.loc_by_name.name, idx_type, order,
- idx, op, op_data)) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "attribute iteration failed");
- } /* end else-if */
+ H5VL_attr_iterate_args_t *iter_args = &args->args.iterate; /* Arguments to iterate operation */
+ static const char * self_name = "."; /* Name for 'self' location */
+ const char * loc_name; /* Location name */
+
+ /* Set correct name, for type of location */
+ if (loc_params->type == H5VL_OBJECT_BY_SELF) /* H5Aiterate2 */
+ loc_name = self_name;
+ else if (loc_params->type == H5VL_OBJECT_BY_NAME) /* H5Aiterate_by_name */
+ loc_name = loc_params->loc_data.loc_by_name.name;
else
- HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown parameters")
+ HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unsupported location type")
+
+ /* Iterate over attributes */
+ if ((ret_value = H5A__iterate(&loc, loc_name, iter_args->idx_type, iter_args->order,
+ iter_args->idx, iter_args->op, iter_args->op_data)) < 0)
+ HERROR(H5E_ATTR, H5E_BADITER, "attribute iteration failed");
break;
}
/* H5Arename/rename_by_name */
case H5VL_ATTR_RENAME: {
- const char *old_name = HDva_arg(arguments, const char *);
- const char *new_name = HDva_arg(arguments, const char *);
-
if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Arename */
/* Call attribute rename routine */
- if (H5O__attr_rename(loc.oloc, old_name, new_name) < 0)
+ if (H5O__attr_rename(loc.oloc, args->args.rename.old_name, args->args.rename.new_name) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute")
} /* end if */
else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Arename_by_name */
/* Call attribute rename routine */
- if (H5A__rename_by_name(loc, loc_params->loc_data.loc_by_name.name, old_name, new_name) < 0)
+ if (H5A__rename_by_name(loc, loc_params->loc_data.loc_by_name.name,
+ args->args.rename.old_name, args->args.rename.new_name) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute")
} /* end else-if */
else
@@ -510,24 +532,24 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_attr_optional(void H5_ATTR_UNUSED *obj, H5VL_attr_optional_t opt_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req,
- va_list H5_ATTR_DEPRECATED_USED arguments)
+H5VL__native_attr_optional(void H5_ATTR_UNUSED *obj, H5VL_optional_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
- herr_t ret_value = SUCCEED; /* Return value */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ H5VL_native_attr_optional_args_t *opt_args = args->args; /* Pointer to native operation's arguments */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (opt_type) {
+ switch (args->op_type) {
#ifndef H5_NO_DEPRECATED_SYMBOLS
case H5VL_NATIVE_ATTR_ITERATE_OLD: {
- hid_t loc_id = HDva_arg(arguments, hid_t);
- unsigned * attr_num = HDva_arg(arguments, unsigned *);
- H5A_operator1_t op = HDva_arg(arguments, H5A_operator1_t);
- void * op_data = HDva_arg(arguments, void *);
+ H5VL_native_attr_iterate_old_t *iter_args = &opt_args->iterate_old;
/* Call the actual iteration routine */
- if ((ret_value = H5A__iterate_old(loc_id, attr_num, op, op_data)) < 0)
+ if ((ret_value = H5A__iterate_old(iter_args->loc_id, iter_args->attr_num, iter_args->op,
+ iter_args->op_data)) < 0)
HERROR(H5E_VOL, H5E_BADITER, "error iterating over attributes");
break;
diff --git a/src/H5VLnative_blob.c b/src/H5VLnative_blob.c
index 170a5bc..1107227 100644
--- a/src/H5VLnative_blob.c
+++ b/src/H5VLnative_blob.c
@@ -145,7 +145,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t specific_type, va_list arguments)
+H5VL__native_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t *args)
{
H5F_t *f = (H5F_t *)obj; /* Retrieve file pointer */
herr_t ret_value = SUCCEED; /* Return value */
@@ -156,44 +156,24 @@ H5VL__native_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t specif
HDassert(f);
HDassert(blob_id);
- switch (specific_type) {
- case H5VL_BLOB_GETSIZE: {
- const uint8_t *id = (const uint8_t *)blob_id; /* Pointer to the blob ID */
- size_t * size = HDva_arg(arguments, size_t *);
- H5HG_t hobjid; /* blob's heap ID */
-
- /* Get heap information */
- H5F_addr_decode(f, &id, &(hobjid.addr));
- UINT32DECODE(id, hobjid.idx);
-
- /* Get heap object's size */
- if (hobjid.addr > 0) {
- if (H5HG_get_obj_size(f, &hobjid, size) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTREMOVE, FAIL, "unable to remove heap object")
- } /* end if */
- else
- *size = 0; /* Return '0' size for 'nil' blob ID */
-
- break;
- }
-
+ switch (args->op_type) {
case H5VL_BLOB_ISNULL: {
- const uint8_t *id = (const uint8_t *)blob_id; /* Pointer to the blob ID */
- hbool_t * isnull = HDva_arg(arguments, hbool_t *);
- haddr_t addr; /* Sequence's heap address */
+ const uint8_t *id = (const uint8_t *)blob_id; /* Pointer to the blob ID */
+ haddr_t addr; /* Sequence's heap address */
/* Get the heap address */
H5F_addr_decode(f, &id, &addr);
/* Check if heap address is 'nil' */
- *isnull = (addr == 0 ? TRUE : FALSE);
+ *args->args.is_null.isnull = (addr == 0 ? TRUE : FALSE);
break;
}
case H5VL_BLOB_SETNULL: {
uint8_t *id = (uint8_t *)blob_id; /* Pointer to the blob ID */
- /* Encode the "nil" heap pointer information */
+
+ /* Encode the 'nil' heap pointer information */
H5F_addr_encode(f, &id, (haddr_t)0);
UINT32ENCODE(id, 0);
diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c
index d78388e..1375344 100644
--- a/src/H5VLnative_dataset.c
+++ b/src/H5VLnative_dataset.c
@@ -15,8 +15,15 @@
*
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5D_FRIEND /* Suppress error about including H5Dpkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
#include "H5Dpkg.h" /* Datasets */
@@ -30,6 +37,128 @@
#include "H5VLnative_private.h" /* Native VOL connector */
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/* Helper routines for read/write API calls */
+static herr_t H5VL__native_dataset_io_setup(H5D_t *dset, hid_t dxpl_id, hid_t file_space_id,
+ hid_t mem_space_id, H5S_t **file_space, H5S_t **mem_space);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL__native_dataset_io_setup
+ *
+ * Purpose: Set up file and memory dataspaces for dataset I/O operation
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5VL__native_dataset_io_setup(H5D_t *dset, hid_t dxpl_id, hid_t file_space_id, hid_t mem_space_id,
+ H5S_t **file_space, H5S_t **mem_space)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity checks */
+ HDassert(dset);
+ HDassert(file_space && NULL == *file_space);
+ HDassert(mem_space && NULL == *mem_space);
+
+ /* Set up file dataspace */
+ if (H5S_ALL == file_space_id)
+ /* Use dataspace for dataset */
+ *file_space = dset->shared->space;
+ else if (H5S_BLOCK == file_space_id)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "H5S_BLOCK is not allowed for file dataspace")
+ else if (H5S_PLIST == file_space_id) {
+ H5P_genplist_t *plist; /* Property list pointer */
+ H5S_t * space; /* Dataspace to hold selection */
+
+ /* Get the plist structure */
+ if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
+ HGOTO_ERROR(H5E_DATASET, H5E_BADID, FAIL, "bad dataset transfer property list")
+
+ /* See if a dataset I/O selection is already set, and free it if it is */
+ if (H5P_peek(plist, H5D_XFER_DSET_IO_SEL_NAME, &space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting dataset I/O selection")
+
+ /* Use dataspace for dataset */
+ *file_space = dset->shared->space;
+
+ /* Copy, but share, selection from property list to dataset's dataspace */
+ if (H5S_SELECT_COPY(*file_space, space, TRUE) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dataset I/O selection")
+ } /* end else-if */
+ else {
+ /* Get the dataspace pointer */
+ if (NULL == (*file_space = (H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "file_space_id is not a dataspace ID")
+ } /* end else */
+
+ /* Get dataspace for memory buffer */
+ if (H5S_ALL == mem_space_id)
+ *mem_space = *file_space;
+ else if (H5S_BLOCK == mem_space_id) {
+ hsize_t nelmts; /* # of selected elements in file */
+
+ /* Get the # of elements selected */
+ nelmts = H5S_GET_SELECT_NPOINTS(*file_space);
+
+ /* Check for any elements */
+ if (nelmts > 0) {
+ /* Create a 1-D dataspace of the same # of elements */
+ if (NULL == (*mem_space = H5S_create_simple(1, &nelmts, NULL)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "unable to create simple memory dataspace")
+ } /* end if */
+ else {
+ /* Create a NULL dataspace of the same # of elements */
+ if (NULL == (*mem_space = H5S_create(H5S_NULL)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "unable to create NULL memory dataspace")
+ } /* end else */
+ } /* end if */
+ else if (H5S_PLIST == mem_space_id)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "H5S_PLIST is not allowed for memory dataspace")
+ else {
+ /* Get the dataspace pointer */
+ if (NULL == (*mem_space = (H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "mem_space_id is not a dataspace ID")
+ } /* end else */
+
+ /* Check for valid selections */
+ if (H5S_SELECT_VALID(*file_space) != TRUE)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL,
+ "selection + offset not within extent for file dataspace")
+ if (H5S_SELECT_VALID(*mem_space) != TRUE)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL,
+ "selection + offset not within extent for memory dataspace")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL__native_dataset_io_setup() */
+
/*-------------------------------------------------------------------------
* Function: H5VL__native_dataset_create
*
@@ -141,10 +270,10 @@ herr_t
H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
hid_t dxpl_id, void *buf, void H5_ATTR_UNUSED **req)
{
- H5D_t * dset = (H5D_t *)obj;
- const H5S_t *mem_space = NULL;
- const H5S_t *file_space = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5D_t *dset = (H5D_t *)obj;
+ H5S_t *mem_space = NULL;
+ H5S_t *file_space = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -152,11 +281,10 @@ H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid_
if (NULL == dset->oloc.file)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dataset is not associated with a file")
- /* Get validated dataspace pointers */
- if (H5S_get_validated_dataspace(mem_space_id, &mem_space) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from mem_space_id")
- if (H5S_get_validated_dataspace(file_space_id, &file_space) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id")
+ /* Get file & memory dataspaces */
+ if (H5VL__native_dataset_io_setup(dset, dxpl_id, file_space_id, mem_space_id, &file_space, &mem_space) <
+ 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up file and memory dataspaces")
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
@@ -166,6 +294,17 @@ H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid_
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data")
done:
+ /* Clean up */
+ if (H5S_BLOCK == mem_space_id && mem_space) {
+ if (H5S_close(mem_space) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL,
+ "unable to release temporary memory dataspace for H5S_BLOCK")
+ } /* end if */
+ else if (H5S_PLIST == file_space_id && file_space)
+ if (H5S_select_all(file_space, TRUE) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL,
+ "unable to release file dataspace selection for H5S_PLIST")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL__native_dataset_read() */
@@ -182,10 +321,10 @@ herr_t
H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
hid_t dxpl_id, const void *buf, void H5_ATTR_UNUSED **req)
{
- H5D_t * dset = (H5D_t *)obj;
- const H5S_t *mem_space = NULL;
- const H5S_t *file_space = NULL;
- herr_t ret_value = SUCCEED; /* Return value */
+ H5D_t *dset = (H5D_t *)obj;
+ H5S_t *mem_space = NULL;
+ H5S_t *file_space = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -193,11 +332,10 @@ H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid
if (NULL == dset->oloc.file)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dataset is not associated with a file")
- /* Get validated dataspace pointers */
- if (H5S_get_validated_dataspace(mem_space_id, &mem_space) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from mem_space_id")
- if (H5S_get_validated_dataspace(file_space_id, &file_space) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id")
+ /* Get file & memory dataspaces */
+ if (H5VL__native_dataset_io_setup(dset, dxpl_id, file_space_id, mem_space_id, &file_space, &mem_space) <
+ 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up file and memory dataspaces")
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
@@ -207,6 +345,17 @@ H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")
done:
+ /* Clean up */
+ if (H5S_BLOCK == mem_space_id && mem_space) {
+ if (H5S_close(mem_space) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL,
+ "unable to release temporary memory dataspace for H5S_BLOCK")
+ } /* end if */
+ else if (H5S_PLIST == file_space_id && file_space)
+ if (H5S_select_all(file_space, TRUE) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL,
+ "unable to release file dataspace selection for H5S_PLIST")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL__native_dataset_write() */
@@ -220,31 +369,26 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_dataset_get(void *obj, H5VL_dataset_get_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
H5D_t *dset = (H5D_t *)obj;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (get_type) {
+ switch (args->op_type) {
/* H5Dget_space */
case H5VL_DATASET_GET_SPACE: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
-
- if ((*ret_id = H5D__get_space(dset)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of dataset")
+ if ((args->args.get_space.space_id = H5D__get_space(dset)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get space ID of dataset")
break;
}
/* H5Dget_space_status */
case H5VL_DATASET_GET_SPACE_STATUS: {
- H5D_space_status_t *allocation = HDva_arg(arguments, H5D_space_status_t *);
-
- /* Read data space address and return */
- if (H5D__get_space_status(dset, allocation) < 0)
+ if (H5D__get_space_status(dset, args->args.get_space_status.status) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get space status")
break;
@@ -252,40 +396,31 @@ H5VL__native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_U
/* H5Dget_type */
case H5VL_DATASET_GET_TYPE: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
-
- if ((*ret_id = H5D__get_type(dset)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of dataset")
+ if ((args->args.get_type.type_id = H5D__get_type(dset)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype ID of dataset")
break;
}
/* H5Dget_create_plist */
case H5VL_DATASET_GET_DCPL: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
-
- if ((*ret_id = H5D_get_create_plist(dset)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for dataset")
+ if ((args->args.get_dcpl.dcpl_id = H5D_get_create_plist(dset)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get creation property list for dataset")
break;
}
/* H5Dget_access_plist */
case H5VL_DATASET_GET_DAPL: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
-
- if ((*ret_id = H5D_get_access_plist(dset)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get access property list for dataset")
+ if ((args->args.get_dapl.dapl_id = H5D_get_access_plist(dset)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get access property list for dataset")
break;
}
/* H5Dget_storage_size */
case H5VL_DATASET_GET_STORAGE_SIZE: {
- hsize_t *ret = HDva_arg(arguments, hsize_t *);
-
- /* Set return value */
- if (H5D__get_storage_size(dset, ret) < 0)
+ if (H5D__get_storage_size(dset, args->args.get_storage_size.storage_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of dataset's storage")
break;
}
@@ -308,51 +443,38 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
H5D_t *dset = (H5D_t *)obj;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (specific_type) {
- /* H5Dspecific_space */
- case H5VL_DATASET_SET_EXTENT: { /* H5Dset_extent (H5Dextend - deprecated) */
- const hsize_t *size = HDva_arg(arguments, const hsize_t *);
-
- if (H5D__set_extent(dset, size) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extent of dataset")
+ switch (args->op_type) {
+ /* H5Dset_extent (H5Dextend - deprecated) */
+ case H5VL_DATASET_SET_EXTENT: {
+ if (H5D__set_extent(dset, args->args.set_extent.size) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set extent of dataset")
break;
}
- case H5VL_DATASET_FLUSH: { /* H5Dflush */
- hid_t dset_id = HDva_arg(arguments, hid_t);
-
- /* Flush the dataset */
- if (H5D__flush(dset, dset_id) < 0)
+ /* H5Dflush */
+ case H5VL_DATASET_FLUSH: {
+ if (H5D__flush(dset, args->args.flush.dset_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush dataset")
break;
}
- case H5VL_DATASET_REFRESH: { /* H5Drefresh */
- hid_t dset_id = HDva_arg(arguments, hid_t);
-
- /* Refresh the dataset */
- if ((H5D__refresh(dset_id, dset)) < 0)
+ /* H5Drefresh */
+ case H5VL_DATASET_REFRESH: {
+ if (H5D__refresh(dset, args->args.refresh.dset_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to refresh dataset")
break;
}
- case H5VL_DATASET_WAIT: { /* H5Dwait */
- /* The native VOL connector doesn't support asynchronous
- * operations, so this is a no-op.
- */
- break;
- }
-
default:
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation")
} /* end switch */
@@ -371,11 +493,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type, hid_t dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void H5_ATTR_UNUSED **req)
{
- H5D_t *dset = (H5D_t *)obj; /* Dataset */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5D_t * dset = (H5D_t *)obj; /* Dataset */
+ H5VL_native_dataset_optional_args_t *opt_args = args->args; /* Pointer to native operation's arguments */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -385,13 +507,14 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
/* Set DXPL for operation */
H5CX_set_dxpl(dxpl_id);
- switch (optional_type) {
- case H5VL_NATIVE_DATASET_FORMAT_CONVERT: { /* H5Dformat_convert */
+ switch (args->op_type) {
+ /* H5Dformat_convert */
+ case H5VL_NATIVE_DATASET_FORMAT_CONVERT: {
switch (dset->shared->layout.type) {
case H5D_CHUNKED:
/* Convert the chunk indexing type to version 1 B-tree if not */
if (dset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE)
- if ((H5D__format_convert(dset)) < 0)
+ if (H5D__format_convert(dset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL,
"unable to downgrade chunk indexing type for dataset")
break;
@@ -400,7 +523,7 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
case H5D_COMPACT:
/* Downgrade the layout version to 3 if greater than 3 */
if (dset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT)
- if ((H5D__format_convert(dset)) < 0)
+ if (H5D__format_convert(dset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL,
"unable to downgrade layout version for dataset")
break;
@@ -420,47 +543,46 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
break;
}
- case H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE: { /* H5Dget_chunk_index_type */
- H5D_chunk_index_t *idx_type = HDva_arg(arguments, H5D_chunk_index_t *);
-
+ /* H5Dget_chunk_index_type */
+ case H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE: {
/* Make sure the dataset is chunked */
if (H5D_CHUNKED != dset->shared->layout.type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Get the chunk indexing type */
- *idx_type = dset->shared->layout.u.chunk.idx_type;
+ *opt_args->get_chunk_idx_type.idx_type = dset->shared->layout.u.chunk.idx_type;
break;
}
- case H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE: { /* H5Dget_chunk_storage_size */
- hsize_t *offset = HDva_arg(arguments, hsize_t *);
- hsize_t *chunk_nbytes = HDva_arg(arguments, hsize_t *);
+ /* H5Dget_chunk_storage_size */
+ case H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE: {
+ H5VL_native_dataset_get_chunk_storage_size_t *gcss_args = &opt_args->get_chunk_storage_size;
/* Make sure the dataset is chunked */
if (H5D_CHUNKED != dset->shared->layout.type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Call private function */
- if (H5D__get_chunk_storage_size(dset, offset, chunk_nbytes) < 0)
+ if (H5D__get_chunk_storage_size(dset, gcss_args->offset, gcss_args->size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get storage size of chunk")
break;
}
- case H5VL_NATIVE_DATASET_GET_NUM_CHUNKS: { /* H5Dget_num_chunks */
- const H5S_t *space = NULL;
- hid_t space_id = HDva_arg(arguments, hid_t);
- hsize_t * nchunks = HDva_arg(arguments, hsize_t *);
+ /* H5Dget_num_chunks */
+ case H5VL_NATIVE_DATASET_GET_NUM_CHUNKS: {
+ H5VL_native_dataset_get_num_chunks_t *gnc_args = &opt_args->get_num_chunks;
+ const H5S_t * space = NULL;
HDassert(dset->shared);
HDassert(dset->shared->space);
/* When default dataspace is given, use the dataset's dataspace */
- if (space_id == H5S_ALL)
+ if (gnc_args->space_id == H5S_ALL)
space = dset->shared->space;
else /* otherwise, use the given space ID */
- if (NULL == (space = (const H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
+ if (NULL == (space = (const H5S_t *)H5I_object_verify(gnc_args->space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid dataspace ID")
/* Make sure the dataset is chunked */
@@ -468,29 +590,25 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Call private function */
- if (H5D__get_num_chunks(dset, space, nchunks) < 0)
+ if (H5D__get_num_chunks(dset, space, gnc_args->nchunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get number of chunks")
break;
}
- case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX: { /* H5Dget_chunk_info */
- const H5S_t *space = NULL;
- hid_t space_id = HDva_arg(arguments, hid_t);
- hsize_t chk_index = HDva_arg(arguments, hsize_t);
- hsize_t * offset = HDva_arg(arguments, hsize_t *);
- unsigned * filter_mask = HDva_arg(arguments, unsigned *);
- haddr_t * addr = HDva_arg(arguments, haddr_t *);
- hsize_t * size = HDva_arg(arguments, hsize_t *);
+ /* H5Dget_chunk_info */
+ case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX: {
+ H5VL_native_dataset_get_chunk_info_by_idx_t *gcibi_args = &opt_args->get_chunk_info_by_idx;
+ const H5S_t * space;
HDassert(dset->shared);
HDassert(dset->shared->space);
/* When default dataspace is given, use the dataset's dataspace */
- if (space_id == H5S_ALL)
+ if (gcibi_args->space_id == H5S_ALL)
space = dset->shared->space;
else /* otherwise, use the given space ID */
- if (NULL == (space = (const H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
+ if (NULL == (space = (const H5S_t *)H5I_object_verify(gcibi_args->space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid dataspace ID")
/* Make sure the dataset is chunked */
@@ -498,16 +616,16 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Call private function */
- if (H5D__get_chunk_info(dset, space, chk_index, offset, filter_mask, addr, size) < 0)
+ if (H5D__get_chunk_info(dset, space, gcibi_args->chk_index, gcibi_args->offset,
+ gcibi_args->filter_mask, gcibi_args->addr, gcibi_args->size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info by index")
+
break;
}
- case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD: { /* H5Dget_chunk_info_by_coord */
- hsize_t * offset = HDva_arg(arguments, hsize_t *);
- unsigned *filter_mask = HDva_arg(arguments, unsigned *);
- haddr_t * addr = HDva_arg(arguments, haddr_t *);
- hsize_t * size = HDva_arg(arguments, hsize_t *);
+ /* H5Dget_chunk_info_by_coord */
+ case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD: {
+ H5VL_native_dataset_get_chunk_info_by_coord_t *gcibc_args = &opt_args->get_chunk_info_by_coord;
HDassert(dset->shared);
@@ -516,17 +634,17 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* Call private function */
- if (H5D__get_chunk_info_by_coord(dset, offset, filter_mask, addr, size) < 0)
+ if (H5D__get_chunk_info_by_coord(dset, gcibc_args->offset, gcibc_args->filter_mask,
+ gcibc_args->addr, gcibc_args->size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info by its logical coordinates")
break;
}
- case H5VL_NATIVE_DATASET_CHUNK_READ: { /* H5Dread_chunk */
- const hsize_t *offset = HDva_arg(arguments, hsize_t *);
- uint32_t * filters = HDva_arg(arguments, uint32_t *);
- void * buf = HDva_arg(arguments, void *);
- hsize_t offset_copy[H5O_LAYOUT_NDIMS]; /* Internal copy of chunk offset */
+ /* H5Dread_chunk */
+ case H5VL_NATIVE_DATASET_CHUNK_READ: {
+ H5VL_native_dataset_chunk_read_t *chunk_read_args = &opt_args->chunk_read;
+ hsize_t offset_copy[H5O_LAYOUT_NDIMS]; /* Internal copy of chunk offset */
/* Check arguments */
if (NULL == dset->oloc.file)
@@ -537,22 +655,21 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
/* Copy the user's offset array so we can be sure it's terminated properly.
* (we don't want to mess with the user's buffer).
*/
- if (H5D__get_offset_copy(dset, offset, offset_copy) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "failure to copy offset array")
+ if (H5D__chunk_get_offset_copy(dset, chunk_read_args->offset, offset_copy) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "failure to copy offset array")
/* Read the raw chunk */
- if (H5D__chunk_direct_read(dset, offset_copy, filters, buf) < 0)
+ if (H5D__chunk_direct_read(dset, offset_copy, &chunk_read_args->filters, chunk_read_args->buf) <
+ 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read unprocessed chunk data")
break;
}
- case H5VL_NATIVE_DATASET_CHUNK_WRITE: { /* H5Dwrite_chunk */
- uint32_t filters = HDva_arg(arguments, uint32_t);
- const hsize_t *offset = HDva_arg(arguments, const hsize_t *);
- uint32_t data_size_32 = HDva_arg(arguments, uint32_t);
- const void * buf = HDva_arg(arguments, const void *);
- hsize_t offset_copy[H5O_LAYOUT_NDIMS]; /* Internal copy of chunk offset */
+ /* H5Dwrite_chunk */
+ case H5VL_NATIVE_DATASET_CHUNK_WRITE: {
+ H5VL_native_dataset_chunk_write_t *chunk_write_args = &opt_args->chunk_write;
+ hsize_t offset_copy[H5O_LAYOUT_NDIMS]; /* Internal copy of chunk offset */
/* Check arguments */
if (NULL == dset->oloc.file)
@@ -563,34 +680,48 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
/* Copy the user's offset array so we can be sure it's terminated properly.
* (we don't want to mess with the user's buffer).
*/
- if (H5D__get_offset_copy(dset, offset, offset_copy) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "failure to copy offset array")
+ if (H5D__chunk_get_offset_copy(dset, chunk_write_args->offset, offset_copy) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "failure to copy offset array")
/* Write chunk */
- if (H5D__chunk_direct_write(dset, filters, offset_copy, data_size_32, buf) < 0)
+ if (H5D__chunk_direct_write(dset, chunk_write_args->filters, offset_copy, chunk_write_args->size,
+ chunk_write_args->buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write unprocessed chunk data")
break;
}
- case H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE: { /* H5Dvlen_get_buf_size */
- hid_t type_id = HDva_arg(arguments, hid_t);
- hid_t space_id = HDva_arg(arguments, hid_t);
- hsize_t *size = HDva_arg(arguments, hsize_t *);
+ /* H5Dvlen_get_buf_size */
+ case H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE: {
+ H5VL_native_dataset_get_vlen_buf_size_t *gvbs_args = &opt_args->get_vlen_buf_size;
- if (H5D__vlen_get_buf_size(dset, type_id, space_id, size) < 0)
+ if (H5D__vlen_get_buf_size(dset, gvbs_args->type_id, gvbs_args->space_id, gvbs_args->size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of vlen buf needed")
break;
}
/* H5Dget_offset */
case H5VL_NATIVE_DATASET_GET_OFFSET: {
- haddr_t *ret = HDva_arg(arguments, haddr_t *);
+ /* Get offset */
+ *opt_args->get_offset.offset = H5D__get_offset(dset);
+
+ break;
+ }
+
+ /* H5Dchunk_iter */
+ case H5VL_NATIVE_DATASET_CHUNK_ITER: {
+ /* Sanity check */
+ HDassert(dset->shared);
+
+ /* Make sure the dataset is chunked */
+ if (H5D_CHUNKED != dset->shared->layout.type)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
+
+ /* Call private function */
+ if ((ret_value = H5D__chunk_iter(dset, opt_args->chunk_iter.op, opt_args->chunk_iter.op_data)) <
+ 0)
+ HERROR(H5E_DATASET, H5E_BADITER, "chunk iteration failed");
- /* Set return value */
- *ret = H5D__get_offset(dset);
- if (!H5F_addr_defined(*ret))
- *ret = HADDR_UNDEF;
break;
}
diff --git a/src/H5VLnative_datatype.c b/src/H5VLnative_datatype.c
index 9551f50..bf6f37c 100644
--- a/src/H5VLnative_datatype.c
+++ b/src/H5VLnative_datatype.c
@@ -15,8 +15,15 @@
*
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5T_FRIEND /* Suppress error about including H5Tpkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
@@ -28,6 +35,30 @@
#include "H5VLnative_private.h" /* Native VOL connector */
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/*-------------------------------------------------------------------------
* Function: H5VL__native_datatype_commit
*
@@ -144,32 +175,34 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_datatype_get(void *obj, H5VL_datatype_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_datatype_get(void *obj, H5VL_datatype_get_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
H5T_t *dt = (H5T_t *)obj;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (get_type) {
- case H5VL_DATATYPE_GET_BINARY: {
- ssize_t *nalloc = HDva_arg(arguments, ssize_t *);
- void * buf = HDva_arg(arguments, void *);
- size_t size = HDva_arg(arguments, size_t);
+ switch (args->op_type) {
+ /* H5T_construct_datatype (library private routine) */
+ case H5VL_DATATYPE_GET_BINARY_SIZE: {
+ if (H5T_encode(dt, NULL, args->args.get_binary_size.size) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't determine serialized length of datatype")
- if (H5T_encode(dt, (unsigned char *)buf, &size) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't determine serialized length of datatype")
+ break;
+ }
+
+ /* H5T_construct_datatype (library private routine) */
+ case H5VL_DATATYPE_GET_BINARY: {
+ if (H5T_encode(dt, args->args.get_binary.buf, &args->args.get_binary.buf_size) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSERIALIZE, FAIL, "can't serialize datatype")
- *nalloc = (ssize_t)size;
break;
}
/* H5Tget_create_plist */
case H5VL_DATATYPE_GET_TCPL: {
- hid_t *ret_id = HDva_arg(arguments, hid_t *);
-
- if (H5I_INVALID_HID == (*ret_id = H5T__get_create_plist(dt)))
+ if (H5I_INVALID_HID == (args->args.get_tcpl.tcpl_id = H5T__get_create_plist(dt)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info");
break;
@@ -193,30 +226,26 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_datatype_specific(void *obj, H5VL_datatype_specific_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
H5T_t *dt = (H5T_t *)obj;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (specific_type) {
+ switch (args->op_type) {
+ /* H5VL_DATATYPE_FLUSH */
case H5VL_DATATYPE_FLUSH: {
- hid_t type_id = HDva_arg(arguments, hid_t);
-
- /* To flush metadata and invoke flush callback if there is */
- if (H5O_flush_common(&dt->oloc, type_id) < 0)
+ if (H5O_flush_common(&dt->oloc, args->args.flush.type_id) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype")
break;
}
+ /* H5VL_DATATYPE_REFRESH */
case H5VL_DATATYPE_REFRESH: {
- hid_t type_id = HDva_arg(arguments, hid_t);
-
- /* Call private function to refresh datatype object */
- if ((H5O_refresh_metadata(type_id, dt->oloc)) < 0)
+ if ((H5O_refresh_metadata(&dt->oloc, args->args.refresh.type_id)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype")
break;
diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c
index c4e4744..1e674dc 100644
--- a/src/H5VLnative_file.c
+++ b/src/H5VLnative_file.c
@@ -15,8 +15,15 @@
*
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5F_FRIEND /* Suppress error about including H5Fpkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Cprivate.h" /* Cache */
@@ -31,6 +38,30 @@
#include "H5VLnative_private.h" /* Native VOL connector */
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/*-------------------------------------------------------------------------
* Function: H5VL__native_file_create
*
@@ -116,21 +147,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_file_get(void *obj, H5VL_file_get_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
H5F_t *f = NULL; /* File struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (get_type) {
+ switch (args->op_type) {
/* "get container info" */
case H5VL_FILE_GET_CONT_INFO: {
- H5VL_file_cont_info_t *info = HDva_arg(arguments, H5VL_file_cont_info_t *);
-
- /* Retrieve the file's container info */
- if (H5F__get_cont_info((H5F_t *)obj, info) < 0)
+ if (H5F__get_cont_info((H5F_t *)obj, args->args.get_cont_info.info) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file container info")
break;
@@ -138,31 +166,22 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED
/* H5Fget_access_plist */
case H5VL_FILE_GET_FAPL: {
- H5P_genplist_t *new_plist; /* New property list */
- hid_t * plist_id = HDva_arg(arguments, hid_t *);
-
- f = (H5F_t *)obj;
-
- /* Retrieve the file's access property list */
- if ((*plist_id = H5F_get_access_plist(f, TRUE)) < 0)
+ if ((args->args.get_fapl.fapl_id = H5F_get_access_plist((H5F_t *)obj, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file access property list")
- if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(*plist_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
break;
}
/* H5Fget_create_plist */
case H5VL_FILE_GET_FCPL: {
H5P_genplist_t *plist; /* Property list */
- hid_t * plist_id = HDva_arg(arguments, hid_t *);
f = (H5F_t *)obj;
if (NULL == (plist = (H5P_genplist_t *)H5I_object(f->shared->fcpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
/* Create the property list object to return */
- if ((*plist_id = H5P_copy_plist(plist, TRUE)) < 0)
+ if ((args->args.get_fcpl.fcpl_id = H5P_copy_plist(plist, TRUE)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy file creation properties")
break;
@@ -170,8 +189,6 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED
/* H5Fget_intent */
case H5VL_FILE_GET_INTENT: {
- unsigned *intent_flags = HDva_arg(arguments, unsigned *);
-
f = (H5F_t *)obj;
/* HDF5 uses some flags internally that users don't know about.
@@ -179,18 +196,18 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED
* or H5F_ACC_RDONLY and any SWMR flags.
*/
if (H5F_INTENT(f) & H5F_ACC_RDWR) {
- *intent_flags = H5F_ACC_RDWR;
+ *args->args.get_intent.flags = H5F_ACC_RDWR;
/* Check for SWMR write access on the file */
if (H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)
- *intent_flags |= H5F_ACC_SWMR_WRITE;
+ *args->args.get_intent.flags |= H5F_ACC_SWMR_WRITE;
} /* end if */
else {
- *intent_flags = H5F_ACC_RDONLY;
+ *args->args.get_intent.flags = H5F_ACC_RDONLY;
/* Check for SWMR read access on the file */
if (H5F_INTENT(f) & H5F_ACC_SWMR_READ)
- *intent_flags |= H5F_ACC_SWMR_READ;
+ *args->args.get_intent.flags |= H5F_ACC_SWMR_READ;
} /* end else */
break;
@@ -198,71 +215,52 @@ H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED
/* H5Fget_fileno */
case H5VL_FILE_GET_FILENO: {
- unsigned long *fno = HDva_arg(arguments, unsigned long *);
- unsigned long my_fileno = 0;
+ unsigned long fileno = 0;
- f = (H5F_t *)obj;
- H5F_GET_FILENO(f, my_fileno);
- *fno = my_fileno; /* sigh */
+ H5F_GET_FILENO((H5F_t *)obj, fileno);
+ *args->args.get_fileno.fileno = fileno;
break;
}
/* H5Fget_name */
case H5VL_FILE_GET_NAME: {
- H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */
- size_t size = HDva_arg(arguments, size_t);
- char * name = HDva_arg(arguments, char *);
- ssize_t * ret = HDva_arg(arguments, ssize_t *);
- size_t len;
+ H5VL_file_get_name_args_t *file_args = &args->args.get_name;
- if (H5VL_native_get_file_struct(obj, type, &f) < 0)
+ if (H5VL_native_get_file_struct(obj, file_args->type, &f) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- len = HDstrlen(H5F_OPEN_NAME(f));
+ /* Get length of file name */
+ *file_args->file_name_len = HDstrlen(H5F_OPEN_NAME(f));
- if (name) {
- HDstrncpy(name, H5F_OPEN_NAME(f), MIN(len + 1, size));
- if (len >= size)
- name[size - 1] = '\0';
+ /* Populate buffer with name, if given */
+ if (file_args->buf) {
+ HDstrncpy(file_args->buf, H5F_OPEN_NAME(f),
+ MIN(*file_args->file_name_len + 1, file_args->buf_size));
+ if (*file_args->file_name_len >= file_args->buf_size)
+ file_args->buf[file_args->buf_size - 1] = '\0';
} /* end if */
- /* Set the return value for the API call */
- *ret = (ssize_t)len;
break;
}
/* H5Fget_obj_count */
case H5VL_FILE_GET_OBJ_COUNT: {
- unsigned types = HDva_arg(arguments, unsigned);
- ssize_t *ret = HDva_arg(arguments, ssize_t *);
- size_t obj_count = 0; /* Number of opened objects */
+ if (H5F_get_obj_count((H5F_t *)obj, args->args.get_obj_count.types, TRUE,
+ args->args.get_obj_count.count) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve object count")
- f = (H5F_t *)obj;
- /* Perform the query */
- if (H5F_get_obj_count(f, types, TRUE, &obj_count) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_count failed")
-
- /* Set the return value */
- *ret = (ssize_t)obj_count;
break;
}
/* H5Fget_obj_ids */
case H5VL_FILE_GET_OBJ_IDS: {
- unsigned types = HDva_arg(arguments, unsigned);
- size_t max_objs = HDva_arg(arguments, size_t);
- hid_t * oid_list = HDva_arg(arguments, hid_t *);
- ssize_t *ret = HDva_arg(arguments, ssize_t *);
- size_t obj_count = 0; /* Number of opened objects */
+ H5VL_file_get_obj_ids_args_t *file_args = &args->args.get_obj_ids;
- f = (H5F_t *)obj;
- /* Perform the query */
- if (H5F_get_obj_ids(f, types, max_objs, oid_list, TRUE, &obj_count) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_ids failed")
+ if (H5F_get_obj_ids((H5F_t *)obj, file_args->types, file_args->max_objs, file_args->oid_list,
+ TRUE, file_args->count) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve object IDs")
- /* Set the return value */
- *ret = (ssize_t)obj_count;
break;
}
@@ -284,22 +282,20 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_file_specific(void *obj, H5VL_file_specific_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (specific_type) {
+ switch (args->op_type) {
/* H5Fflush */
case H5VL_FILE_FLUSH: {
- H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */
- H5F_scope_t scope = (H5F_scope_t)HDva_arg(arguments, int); /* enum work-around */
- H5F_t * f = NULL; /* File to flush */
+ H5F_t *f = NULL; /* File to flush */
/* Get the file for the object */
- if (H5VL_native_get_file_struct(obj, type, &f) < 0)
+ if (H5VL_native_get_file_struct(obj, args->args.flush.obj_type, &f) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
/* Nothing to do if the file is read only. This determination is
@@ -310,7 +306,7 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t
*/
if (H5F_ACC_RDWR & H5F_INTENT(f)) {
/* Flush other files, depending on scope */
- if (H5F_SCOPE_GLOBAL == scope) {
+ if (H5F_SCOPE_GLOBAL == args->args.flush.scope) {
/* Call the flush routine for mounted file hierarchies */
if (H5F_flush_mounts(f) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy")
@@ -322,93 +318,55 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t
"unable to flush file's cached information")
} /* end else */
} /* end if */
+
break;
}
/* H5Freopen */
case H5VL_FILE_REOPEN: {
- void **ret = HDva_arg(arguments, void **);
- H5F_t *new_file = NULL;
+ H5F_t *new_file;
/* Reopen the file through the VOL connector */
if (NULL == (new_file = H5F__reopen((H5F_t *)obj)))
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file")
new_file->id_exists = TRUE;
- *ret = (void *)new_file;
- break;
- }
-
- /* H5Fmount */
- case H5VL_FILE_MOUNT: {
- H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */
- const char *name = HDva_arg(arguments, const char *);
- H5F_t * child = HDva_arg(arguments, H5F_t *);
- hid_t fmpl_id = HDva_arg(arguments, hid_t);
- H5G_loc_t loc;
-
- if (H5G_loc_real(obj, type, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
-
- /* Do the mount */
- if (H5F__mount(&loc, name, child, fmpl_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file")
-
- break;
- }
-
- /* H5Funmount */
- case H5VL_FILE_UNMOUNT: {
- H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */
- const char *name = HDva_arg(arguments, const char *);
- H5G_loc_t loc;
-
- if (H5G_loc_real(obj, type, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
-
- /* Unmount */
- if (H5F__unmount(&loc, name) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file")
+ /* Set 'out' value */
+ *args->args.reopen.file = new_file;
break;
}
/* H5Fis_accessible */
case H5VL_FILE_IS_ACCESSIBLE: {
- hid_t fapl_id = HDva_arg(arguments, hid_t);
- const char *name = HDva_arg(arguments, const char *);
- htri_t * result = HDva_arg(arguments, htri_t *);
+ htri_t result;
+
+ if ((result = H5F__is_hdf5(args->args.is_accessible.filename, args->args.is_accessible.fapl_id)) <
+ 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "error in HDF5 file check")
+
+ /* Set 'out' value */
+ *args->args.is_accessible.accessible = (hbool_t)result;
- /* Call private routine */
- if ((*result = H5F__is_hdf5(name, fapl_id)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "error in HDF5 file check")
break;
}
/* H5Fdelete */
case H5VL_FILE_DELETE: {
- HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL,
- "H5Fdelete() is currently not supported in the native VOL connector")
+ if (H5F__delete(args->args.del.filename, args->args.del.fapl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTDELETEFILE, FAIL, "error in HDF5 file deletion")
+
break;
}
/* Check if two files are the same */
case H5VL_FILE_IS_EQUAL: {
- H5F_t * file2 = (H5F_t *)HDva_arg(arguments, void *);
- hbool_t *is_equal = HDva_arg(arguments, hbool_t *);
-
- if (!obj || !file2)
- *is_equal = FALSE;
+ if (!obj || !args->args.is_equal.obj2)
+ *args->args.is_equal.same_file = FALSE;
else
- *is_equal = (((H5F_t *)obj)->shared == file2->shared);
- break;
- }
+ *args->args.is_equal.same_file =
+ (((H5F_t *)obj)->shared == ((H5F_t *)args->args.is_equal.obj2)->shared);
- /* H5Fwait */
- case H5VL_FILE_WAIT: {
- /* The native VOL connector doesn't support asynchronous
- * operations, so this is a no-op.
- */
break;
}
@@ -430,85 +388,78 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_file_optional(void *obj, H5VL_optional_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
- H5F_t *f = NULL; /* File */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t * f = (H5F_t *)obj; /* File */
+ H5VL_native_file_optional_args_t *opt_args = args->args; /* Pointer to native operation's arguments */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- f = (H5F_t *)obj;
- switch (optional_type) {
+ switch (args->op_type) {
/* H5Fget_filesize */
case H5VL_NATIVE_FILE_GET_SIZE: {
- haddr_t max_eof_eoa; /* Maximum of the EOA & EOF */
- haddr_t base_addr; /* Base address for the file */
- hsize_t *size = HDva_arg(arguments, hsize_t *);
+ haddr_t max_eof_eoa; /* Maximum of the EOA & EOF */
+ haddr_t base_addr; /* Base address for the file */
- /* Go get the actual file size */
+ /* Get the actual file size & base address */
if (H5F__get_max_eof_eoa(f, &max_eof_eoa) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ")
-
base_addr = H5FD_get_base_addr(f->shared->lf);
- if (size)
- *size = (hsize_t)(max_eof_eoa +
- base_addr); /* Convert relative base address for file to absolute address */
+ /* Convert relative base address for file to absolute address */
+ *opt_args->get_size.size = (hsize_t)(max_eof_eoa + base_addr);
break;
}
/* H5Fget_file_image */
case H5VL_NATIVE_FILE_GET_FILE_IMAGE: {
- void * buf_ptr = HDva_arg(arguments, void *);
- ssize_t *ret = HDva_arg(arguments, ssize_t *);
- size_t buf_len = HDva_arg(arguments, size_t);
+ H5VL_native_file_get_file_image_t *gfi_args = &opt_args->get_file_image;
- /* Do the actual work */
- if ((*ret = H5F__get_file_image(f, buf_ptr, buf_len)) < 0)
+ /* Get file image */
+ if (H5F__get_file_image(f, gfi_args->buf, gfi_args->buf_size, gfi_args->image_len) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get file image failed")
+
break;
}
/* H5Fget_freespace */
case H5VL_NATIVE_FILE_GET_FREE_SPACE: {
- hsize_t tot_space; /* Amount of free space in the file */
- hssize_t *ret = HDva_arg(arguments, hssize_t *);
+ H5VL_native_file_get_freespace_t *gfs_args = &opt_args->get_freespace;
- /* Go get the actual amount of free space in the file */
- if (H5MF_get_freespace(f, &tot_space, NULL) < 0)
+ /* Get the actual amount of free space in the file */
+ if (H5MF_get_freespace(f, gfs_args->size, NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file")
- *ret = (hssize_t)tot_space;
+
break;
}
/* H5Fget_free_sections */
case H5VL_NATIVE_FILE_GET_FREE_SECTIONS: {
- H5F_sect_info_t *sect_info = HDva_arg(arguments, H5F_sect_info_t *);
- ssize_t * ret = HDva_arg(arguments, ssize_t *);
- H5F_mem_t type = (H5F_mem_t)HDva_arg(arguments, int); /* enum work-around */
- size_t nsects = HDva_arg(arguments, size_t);
+ H5VL_native_file_get_free_sections_t *gfs_args = &opt_args->get_free_sections;
/* Go get the free-space section information in the file */
- if ((*ret = H5MF_get_free_sections(f, type, nsects, sect_info)) < 0)
+ if (H5MF_get_free_sections(f, gfs_args->type, gfs_args->nsects, gfs_args->sect_info,
+ gfs_args->sect_count) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file")
+
break;
}
/* H5Fget_info1/2 */
case H5VL_NATIVE_FILE_GET_INFO: {
- H5I_type_t type = (H5I_type_t)HDva_arg(arguments, int); /* enum work-around */
- H5F_info2_t *finfo = HDva_arg(arguments, H5F_info2_t *);
+ H5VL_native_file_get_info_t *gfi_args = &opt_args->get_info;
/* Get the file struct. This call is careful to not return the file pointer
* for the top file in a mount hierarchy.
*/
- if (H5VL_native_get_file_struct(obj, type, &f) < 0)
+ if (H5VL_native_get_file_struct(obj, gfi_args->type, &f) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get a file struct")
/* Get the file info */
- if (H5F__get_info(f, finfo) < 0)
+ if (H5F__get_info(f, gfi_args->finfo) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info")
break;
@@ -516,50 +467,42 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fget_mdc_config */
case H5VL_NATIVE_FILE_GET_MDC_CONF: {
- H5AC_cache_config_t *config_ptr = HDva_arg(arguments, H5AC_cache_config_t *);
+ /* Get the metadata cache configuration */
+ if (H5AC_get_cache_auto_resize_config(f->shared->cache, opt_args->get_mdc_config.config) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get metadata cache configuration")
- /* Go get the resize configuration */
- if (H5AC_get_cache_auto_resize_config(f->shared->cache, config_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_auto_resize_config() failed.")
break;
}
/* H5Fget_mdc_hit_rate */
case H5VL_NATIVE_FILE_GET_MDC_HR: {
- double *hit_rate_ptr = HDva_arg(arguments, double *);
+ /* Get the current hit rate */
+ if (H5AC_get_cache_hit_rate(f->shared->cache, opt_args->get_mdc_hit_rate.hit_rate) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get metadata cache hit rate")
- /* Go get the current hit rate */
- if (H5AC_get_cache_hit_rate(f->shared->cache, hit_rate_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_hit_rate() failed.")
break;
}
/* H5Fget_mdc_size */
case H5VL_NATIVE_FILE_GET_MDC_SIZE: {
- size_t * max_size_ptr = HDva_arg(arguments, size_t *);
- size_t * min_clean_size_ptr = HDva_arg(arguments, size_t *);
- size_t * cur_size_ptr = HDva_arg(arguments, size_t *);
- int * cur_num_entries_ptr = HDva_arg(arguments, int *);
- uint32_t cur_num_entries;
+ H5VL_native_file_get_mdc_size_t *gms_args = &opt_args->get_mdc_size;
- /* Go get the size data */
- if (H5AC_get_cache_size(f->shared->cache, max_size_ptr, min_clean_size_ptr, cur_size_ptr,
- &cur_num_entries) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_size() failed.")
+ /* Get the size data */
+ if (H5AC_get_cache_size(f->shared->cache, gms_args->max_size, gms_args->min_clean_size,
+ gms_args->cur_size, gms_args->cur_num_entries) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get metadata cache size")
- if (cur_num_entries_ptr != NULL)
- *cur_num_entries_ptr = (int)cur_num_entries;
break;
}
/* H5Fget_vfd_handle */
case H5VL_NATIVE_FILE_GET_VFD_HANDLE: {
- void **file_handle = HDva_arg(arguments, void **);
- hid_t fapl_id = HDva_arg(arguments, hid_t);
+ H5VL_native_file_get_vfd_handle_t *gvh_args = &opt_args->get_vfd_handle;
/* Retrieve the VFD handle for the file */
- if (H5F_get_vfd_handle(f, fapl_id, file_handle) < 0)
+ if (H5F_get_vfd_handle(f, gvh_args->fapl_id, gvh_args->file_handle) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve VFD handle")
+
break;
}
@@ -569,6 +512,7 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
if (f->shared->efc)
if (H5F__efc_release(f->shared->efc) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache")
+
break;
}
@@ -576,26 +520,24 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
case H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE: {
/* Reset the hit rate statistic */
if (H5AC_reset_cache_hit_rate_stats(f->shared->cache) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't reset cache hit rate")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't reset cache hit rate")
+
break;
}
/* H5Fset_mdc_config */
case H5VL_NATIVE_FILE_SET_MDC_CONFIG: {
- H5AC_cache_config_t *config_ptr = HDva_arg(arguments, H5AC_cache_config_t *);
+ /* Set the metadata cache configuration */
+ if (H5AC_set_cache_auto_resize_config(f->shared->cache, opt_args->set_mdc_config.config) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set metadata cache configuration")
- /* set the resize configuration */
- if (H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "H5AC_set_cache_auto_resize_config() failed")
break;
}
/* H5Fget_metadata_read_retry_info */
case H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO: {
- H5F_retry_info_t *info = HDva_arg(arguments, H5F_retry_info_t *);
-
- if (H5F_get_metadata_read_retry_info(f, info) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't get metadata read retry info")
+ if (H5F_get_metadata_read_retry_info(f, opt_args->get_metadata_read_retry_info.info) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get metadata read retry info")
break;
}
@@ -603,7 +545,7 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fstart_swmr_write */
case H5VL_NATIVE_FILE_START_SWMR_WRITE: {
if (H5F__start_swmr_write(f) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't start SWMR write")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't start SWMR write")
break;
}
@@ -628,11 +570,11 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fget_mdc_logging_status */
case H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS: {
- hbool_t *is_enabled = HDva_arg(arguments, hbool_t *);
- hbool_t *is_currently_logging = HDva_arg(arguments, hbool_t *);
+ H5VL_native_file_get_mdc_logging_status_t *gmls_args = &opt_args->get_mdc_logging_status;
/* Call mdc logging function */
- if (H5C_get_logging_status(f->shared->cache, is_enabled, is_currently_logging) < 0)
+ if (H5C_get_logging_status(f->shared->cache, gmls_args->is_enabled,
+ gmls_args->is_currently_logging) < 0)
HGOTO_ERROR(H5E_FILE, H5E_LOGGING, FAIL, "unable to get logging status")
break;
@@ -662,18 +604,15 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fget_page_buffering_stats */
case H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS: {
- unsigned *accesses = HDva_arg(arguments, unsigned *);
- unsigned *hits = HDva_arg(arguments, unsigned *);
- unsigned *misses = HDva_arg(arguments, unsigned *);
- unsigned *evictions = HDva_arg(arguments, unsigned *);
- unsigned *bypasses = HDva_arg(arguments, unsigned *);
+ H5VL_native_file_get_page_buffering_stats_t *gpbs_args = &opt_args->get_page_buffering_stats;
/* Sanity check */
if (NULL == f->shared->page_buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page buffering not enabled on file")
/* Get the statistics */
- if (H5PB_get_stats(f->shared->page_buf, accesses, hits, misses, evictions, bypasses) < 0)
+ if (H5PB_get_stats(f->shared->page_buf, gpbs_args->accesses, gpbs_args->hits, gpbs_args->misses,
+ gpbs_args->evictions, gpbs_args->bypasses) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve stats for page buffering")
break;
@@ -681,11 +620,10 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fget_mdc_image_info */
case H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO: {
- haddr_t *image_addr = HDva_arg(arguments, haddr_t *);
- hsize_t *image_len = HDva_arg(arguments, hsize_t *);
+ H5VL_native_file_get_mdc_image_info_t *gmii_args = &opt_args->get_mdc_image_info;
/* Go get the address and size of the cache image */
- if (H5AC_get_mdc_image_info(f->shared->cache, image_addr, image_len) < 0)
+ if (H5AC_get_mdc_image_info(f->shared->cache, gmii_args->addr, gmii_args->len) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve cache image info")
break;
@@ -693,11 +631,7 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fget_eoa */
case H5VL_NATIVE_FILE_GET_EOA: {
- haddr_t *eoa = HDva_arg(arguments, haddr_t *);
- haddr_t rel_eoa; /* Relative address of EOA */
-
- /* Sanity check */
- HDassert(eoa);
+ haddr_t rel_eoa; /* Relative address of EOA */
/* This routine will work only for drivers with this feature enabled.*/
/* We might introduce a new feature flag in the future */
@@ -711,14 +645,13 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* Set return value */
/* (Note compensating for base address subtraction in internal routine) */
- *eoa = rel_eoa + H5F_get_base_addr(f);
+ *opt_args->get_eoa.eoa = rel_eoa + H5F_get_base_addr(f);
break;
}
/* H5Fincrement_filesize */
case H5VL_NATIVE_FILE_INCR_FILESIZE: {
- hsize_t increment = HDva_arg(arguments, hsize_t);
haddr_t max_eof_eoa; /* Maximum of the relative EOA & EOF */
/* This public routine will work only for drivers with this feature enabled.*/
@@ -732,7 +665,7 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ")
/* Set EOA to the maximum value + increment */
- if (H5F__set_eoa(f, H5FD_MEM_DEFAULT, max_eof_eoa + increment) < 0)
+ if (H5F__set_eoa(f, H5FD_MEM_DEFAULT, max_eof_eoa + opt_args->increment_filesize.increment) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed")
break;
@@ -740,11 +673,10 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fset_latest_format, H5Fset_libver_bounds */
case H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS: {
- H5F_libver_t low = (H5F_libver_t)HDva_arg(arguments, int); /* enum work-around */
- H5F_libver_t high = (H5F_libver_t)HDva_arg(arguments, int); /* enum work-around */
+ H5VL_native_file_set_libver_bounds_t *slb_args = &opt_args->set_libver_bounds;
/* Call internal set_libver_bounds function */
- if (H5F__set_libver_bounds(f, low, high) < 0)
+ if (H5F__set_libver_bounds(f, slb_args->low, slb_args->high) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds")
break;
@@ -752,34 +684,34 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* H5Fget_dset_no_attrs_hint */
case H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG: {
- hbool_t *minimize = HDva_arg(arguments, hbool_t *);
- *minimize = H5F_GET_MIN_DSET_OHDR(f);
+ *opt_args->get_min_dset_ohdr_flag.minimize = H5F_GET_MIN_DSET_OHDR(f);
+
break;
}
/* H5Fset_dset_no_attrs_hint */
case H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG: {
- int minimize = HDva_arg(arguments, int);
- if (H5F_set_min_dset_ohdr(f, (hbool_t)minimize) < 0)
+ if (H5F_set_min_dset_ohdr(f, opt_args->set_min_dset_ohdr_flag.minimize) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL,
"cannot set file's dataset object header minimization flag")
+
break;
}
#ifdef H5_HAVE_PARALLEL
/* H5Fget_mpi_atomicity */
case H5VL_NATIVE_FILE_GET_MPI_ATOMICITY: {
- hbool_t *flag = (hbool_t *)HDva_arg(arguments, hbool_t *);
- if (H5F_get_mpi_atomicity(f, flag) < 0)
+ if (H5F__get_mpi_atomicity(f, opt_args->get_mpi_atomicity.flag) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "cannot get MPI atomicity");
+
break;
}
/* H5Fset_mpi_atomicity */
case H5VL_NATIVE_FILE_SET_MPI_ATOMICITY: {
- hbool_t flag = (hbool_t)HDva_arg(arguments, int);
- if (H5F_set_mpi_atomicity(f, flag) < 0)
+ if (H5F__set_mpi_atomicity(f, opt_args->set_mpi_atomicity.flag) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set MPI atomicity");
+
break;
}
#endif /* H5_HAVE_PARALLEL */
@@ -787,7 +719,7 @@ H5VL__native_file_optional(void *obj, H5VL_file_optional_t optional_type, hid_t
/* Finalize H5Fopen */
case H5VL_NATIVE_FILE_POST_OPEN: {
/* Call package routine */
- if (H5F__post_open((H5F_t *)obj) < 0)
+ if (H5F__post_open(f) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't finish opening file")
break;
}
@@ -838,7 +770,7 @@ H5VL__native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_U
HGOTO_ERROR(H5E_ID, H5E_CANTGET, FAIL, "can't get ID ref count")
if (nref == 1)
if (H5F__flush(f) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
/* Close the file */
diff --git a/src/H5VLnative_group.c b/src/H5VLnative_group.c
index e3fa702..54f8337 100644
--- a/src/H5VLnative_group.c
+++ b/src/H5VLnative_group.c
@@ -15,8 +15,15 @@
*
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5G_FRIEND /* Suppress error about including H5Gpkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gpkg.h" /* Groups */
@@ -27,6 +34,30 @@
#include "H5VLnative_private.h" /* Native VOL connector */
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/*-------------------------------------------------------------------------
* Function: H5VL__native_group_create
*
@@ -138,55 +169,54 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_group_get(void *obj, H5VL_group_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_group_get(void *obj, H5VL_group_get_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (get_type) {
+ switch (args->op_type) {
/* H5Gget_create_plist */
case H5VL_GROUP_GET_GCPL: {
- hid_t *new_gcpl_id = HDva_arg(arguments, hid_t *);
- H5G_t *grp = (H5G_t *)obj;
+ if ((args->args.get_gcpl.gcpl_id = H5G_get_create_plist((H5G_t *)obj)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get creation property list for group")
- if ((*new_gcpl_id = H5G_get_create_plist(grp)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for group")
break;
}
/* H5Gget_info */
case H5VL_GROUP_GET_INFO: {
- const H5VL_loc_params_t *loc_params = HDva_arg(arguments, const H5VL_loc_params_t *);
- H5G_info_t * group_info = HDva_arg(arguments, H5G_info_t *);
- H5G_loc_t loc;
+ H5VL_group_get_info_args_t *get_info_args = &args->args.get_info;
+ H5G_loc_t loc;
- if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
+ if (H5G_loc_real(obj, get_info_args->loc_params.obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- if (loc_params->type == H5VL_OBJECT_BY_SELF) {
+ if (get_info_args->loc_params.type == H5VL_OBJECT_BY_SELF) {
/* H5Gget_info */
/* Retrieve the group's information */
- if (H5G__obj_info(loc.oloc, group_info) < 0)
+ if (H5G__obj_info(loc.oloc, get_info_args->ginfo) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info")
} /* end if */
- else if (loc_params->type == H5VL_OBJECT_BY_NAME) {
+ else if (get_info_args->loc_params.type == H5VL_OBJECT_BY_NAME) {
/* H5Gget_info_by_name */
/* Retrieve the group's information */
- if (H5G__get_info_by_name(&loc, loc_params->loc_data.loc_by_name.name, group_info) < 0)
+ if (H5G__get_info_by_name(&loc, get_info_args->loc_params.loc_data.loc_by_name.name,
+ get_info_args->ginfo) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info")
} /* end else-if */
- else if (loc_params->type == H5VL_OBJECT_BY_IDX) {
+ else if (get_info_args->loc_params.type == H5VL_OBJECT_BY_IDX) {
/* H5Gget_info_by_idx */
/* Retrieve the group's information */
- if (H5G__get_info_by_idx(&loc, loc_params->loc_data.loc_by_idx.name,
- loc_params->loc_data.loc_by_idx.idx_type,
- loc_params->loc_data.loc_by_idx.order,
- loc_params->loc_data.loc_by_idx.n, group_info) < 0)
+ if (H5G__get_info_by_idx(&loc, get_info_args->loc_params.loc_data.loc_by_idx.name,
+ get_info_args->loc_params.loc_data.loc_by_idx.idx_type,
+ get_info_args->loc_params.loc_data.loc_by_idx.order,
+ get_info_args->loc_params.loc_data.loc_by_idx.n,
+ get_info_args->ginfo) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info")
} /* end else-if */
else
@@ -212,30 +242,53 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_group_specific(void *obj, H5VL_group_specific_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
H5G_t *grp = (H5G_t *)obj;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (specific_type) {
- case H5VL_GROUP_FLUSH: {
- hid_t group_id = HDva_arg(arguments, hid_t);
+ switch (args->op_type) {
+ /* H5Fmount */
+ case H5VL_GROUP_MOUNT: {
+ H5G_loc_t loc;
+
+ if (H5G_loc_real(grp, H5I_GROUP, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group object")
+
+ if (H5F_mount(&loc, args->args.mount.name, args->args.mount.child_file,
+ args->args.mount.fmpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file")
+
+ break;
+ }
+
+ /* H5Funmount */
+ case H5VL_GROUP_UNMOUNT: {
+ H5G_loc_t loc;
+
+ if (H5G_loc_real(grp, H5I_GROUP, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group object")
+
+ if (H5F_unmount(&loc, args->args.unmount.name) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_UNMOUNT, FAIL, "unable to unmount file")
+
+ break;
+ }
- /* Flush object's metadata to file */
- if (H5O_flush_common(&grp->oloc, group_id) < 0)
+ /* H5Gflush */
+ case H5VL_GROUP_FLUSH: {
+ if (H5O_flush_common(&grp->oloc, args->args.flush.grp_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group")
break;
}
+ /* H5Grefresh */
case H5VL_GROUP_REFRESH: {
- hid_t group_id = HDva_arg(arguments, hid_t);
-
- /* Call private function to refresh group object */
- if ((H5O_refresh_metadata(group_id, grp->oloc)) < 0)
+ if ((H5O_refresh_metadata(&grp->oloc, args->args.refresh.grp_id)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group")
break;
@@ -259,50 +312,53 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_group_optional(void H5_ATTR_UNUSED *obj, H5VL_group_optional_t optional_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req,
- va_list H5_ATTR_DEPRECATED_USED arguments)
+H5VL__native_group_optional(void H5_ATTR_UNUSED *obj, H5VL_optional_args_t *args,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req)
{
- herr_t ret_value = SUCCEED; /* Return value */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ H5VL_native_group_optional_args_t *opt_args = args->args; /* Pointer to native operation's arguments */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (optional_type) {
+ switch (args->op_type) {
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* H5Giterate (deprecated) */
case H5VL_NATIVE_GROUP_ITERATE_OLD: {
- const H5VL_loc_params_t * loc_params = HDva_arg(arguments, const H5VL_loc_params_t *);
- hsize_t idx = HDva_arg(arguments, hsize_t);
- hsize_t * last_obj = HDva_arg(arguments, hsize_t *);
- const H5G_link_iterate_t *lnk_op = HDva_arg(arguments, const H5G_link_iterate_t *);
- void * op_data = HDva_arg(arguments, void *);
- H5G_loc_t grp_loc;
+ H5VL_native_group_iterate_old_t *iter_args = &opt_args->iterate_old;
+ H5G_link_iterate_t lnk_op; /* Link operator */
+ H5G_loc_t grp_loc;
/* Get the location struct for the object */
- if (H5G_loc_real(obj, loc_params->obj_type, &grp_loc) < 0)
+ if (H5G_loc_real(obj, iter_args->loc_params.obj_type, &grp_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
+ /* Set up link iteration callback struct */
+ lnk_op.op_type = H5G_LINK_OP_OLD;
+ lnk_op.op_func.op_old = iter_args->op;
+
/* Call the actual iteration routine */
- if ((ret_value = H5G_iterate(&grp_loc, loc_params->loc_data.loc_by_name.name, H5_INDEX_NAME,
- H5_ITER_INC, idx, last_obj, lnk_op, op_data)) < 0)
- HERROR(H5E_VOL, H5E_BADITER, "error iterating over group's links");
+ if ((ret_value = H5G_iterate(&grp_loc, iter_args->loc_params.loc_data.loc_by_name.name,
+ H5_INDEX_NAME, H5_ITER_INC, iter_args->idx, iter_args->last_obj,
+ &lnk_op, iter_args->op_data)) < 0)
+ HERROR(H5E_SYM, H5E_BADITER, "error iterating over group's links");
break;
}
/* H5Gget_objinfo (deprecated) */
case H5VL_NATIVE_GROUP_GET_OBJINFO: {
- const H5VL_loc_params_t *loc_params = HDva_arg(arguments, const H5VL_loc_params_t *);
- hbool_t follow_link = (hbool_t)HDva_arg(arguments, unsigned);
- H5G_stat_t * statbuf = HDva_arg(arguments, H5G_stat_t *);
- H5G_loc_t grp_loc;
+ H5VL_native_group_get_objinfo_t *goi_args = &opt_args->get_objinfo;
+ H5G_loc_t grp_loc;
/* Get the location struct for the object */
- if (H5G_loc_real(obj, loc_params->obj_type, &grp_loc) < 0)
+ if (H5G_loc_real(obj, goi_args->loc_params.obj_type, &grp_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
/* Call the actual group objinfo routine */
- if (H5G__get_objinfo(&grp_loc, loc_params->loc_data.loc_by_name.name, follow_link, statbuf) < 0)
+ if (H5G__get_objinfo(&grp_loc, goi_args->loc_params.loc_data.loc_by_name.name,
+ goi_args->follow_link, goi_args->statbuf) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "cannot stat object")
break;
diff --git a/src/H5VLnative_introspect.c b/src/H5VLnative_introspect.c
index 6af33ba..fa11bea 100644
--- a/src/H5VLnative_introspect.c
+++ b/src/H5VLnative_introspect.c
@@ -15,14 +15,46 @@
*
*/
+/****************/
+/* Module Setup */
+/****************/
+
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL connector */
-/* Note: H5VL__native_introspect_get_conn_cls is in src/H5VLnative.c so that
- * it can return the address of the staticly declared class struct.
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/* Note: H5VL__native_introspect_get_conn_cls and H5VL__native_introspect_get_cap_flags
+ * are in src/H5VLnative.c so that they can work with the staticly declared
+ * class struct.
*/
/*---------------------------------------------------------------------------
@@ -150,8 +182,10 @@ H5VL__native_introspect_opt_query(void H5_ATTR_UNUSED *obj, H5VL_subclass_t subc
case H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS:
case H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG:
case H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG:
+#ifdef H5_HAVE_PARALLEL
case H5VL_NATIVE_FILE_GET_MPI_ATOMICITY:
case H5VL_NATIVE_FILE_SET_MPI_ATOMICITY:
+#endif /* H5_HAVE_PARALLEL */
case H5VL_NATIVE_FILE_POST_OPEN:
break;
diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c
index 72f6cde..042c778 100644
--- a/src/H5VLnative_link.c
+++ b/src/H5VLnative_link.c
@@ -15,8 +15,15 @@
*
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5L_FRIEND /* Suppress error about including H5Lpkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
@@ -27,6 +34,30 @@
#include "H5VLnative_private.h" /* Native VOL connector */
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/*-------------------------------------------------------------------------
* Function: H5VL__native_link_create
*
@@ -37,20 +68,20 @@
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, const H5VL_loc_params_t *loc_params,
+H5VL__native_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+ void H5_ATTR_UNUSED **req)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (create_type) {
+ switch (args->op_type) {
case H5VL_LINK_CREATE_HARD: {
H5G_loc_t cur_loc;
H5G_loc_t link_loc;
- void * cur_obj = HDva_arg(arguments, void *);
- H5VL_loc_params_t *cur_params = HDva_arg(arguments, H5VL_loc_params_t *);
+ void * cur_obj = args->args.hard.curr_obj;
+ H5VL_loc_params_t *cur_params = &args->args.hard.curr_loc_params;
if (NULL != cur_obj && H5G_loc_real(cur_obj, cur_params->obj_type, &cur_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
@@ -73,46 +104,40 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, const H
"source and destination should be in the same file.")
/* Create the link */
- if ((ret_value =
- H5L__create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p,
- loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0)
+ if (H5L__create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p,
+ loc_params->loc_data.loc_by_name.name, lcpl_id) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
} /* end if */
else { /* H5Olink */
/* Link to the object */
if (H5L_link(&link_loc, loc_params->loc_data.loc_by_name.name, &cur_loc, lcpl_id) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create link")
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
} /* end else */
+
break;
}
case H5VL_LINK_CREATE_SOFT: {
- char * target_name = HDva_arg(arguments, char *);
H5G_loc_t link_loc; /* Group location for new link */
if (H5G_loc_real(obj, loc_params->obj_type, &link_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
+ if (H5L__create_soft(args->args.soft.target, &link_loc, loc_params->loc_data.loc_by_name.name,
+ lcpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link")
- /* Create the link */
- if ((ret_value = H5L__create_soft(target_name, &link_loc, loc_params->loc_data.loc_by_name.name,
- lcpl_id)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
break;
}
case H5VL_LINK_CREATE_UD: {
- H5G_loc_t link_loc; /* Group location for new link */
- H5L_type_t link_type = (H5L_type_t)HDva_arg(arguments, int);
- void * udata = HDva_arg(arguments, void *);
- size_t udata_size = HDva_arg(arguments, size_t);
+ H5G_loc_t link_loc; /* Group location for new link */
if (H5G_loc_real(obj, loc_params->obj_type, &link_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
-
- /* Create link */
- if (H5L__create_ud(&link_loc, loc_params->loc_data.loc_by_name.name, udata, udata_size, link_type,
- lcpl_id) < 0)
+ if (H5L__create_ud(&link_loc, loc_params->loc_data.loc_by_name.name, args->args.ud.buf,
+ args->args.ud.buf_size, args->args.ud.type, lcpl_id) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
+
break;
}
@@ -218,8 +243,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req)
{
H5G_loc_t loc;
herr_t ret_value = SUCCEED; /* Return value */
@@ -229,20 +254,19 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_
if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- switch (get_type) {
+ switch (args->op_type) {
/* H5Lget_info/H5Lget_info_by_idx */
case H5VL_LINK_GET_INFO: {
- H5L_info2_t *linfo2 = HDva_arg(arguments, H5L_info2_t *);
-
/* Get the link information */
- if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Lget_info */
- if (H5L_get_info(&loc, loc_params->loc_data.loc_by_name.name, linfo2) < 0)
+ if (loc_params->type == H5VL_OBJECT_BY_NAME) {
+ if (H5L_get_info(&loc, loc_params->loc_data.loc_by_name.name, args->args.get_info.linfo) < 0)
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info")
- } /* end if */
- else if (loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Lget_info_by_idx */
- if (H5L__get_info_by_idx(
- &loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type,
- loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, linfo2) < 0)
+ } /* end if */
+ else if (loc_params->type == H5VL_OBJECT_BY_IDX) {
+ if (H5L__get_info_by_idx(&loc, loc_params->loc_data.loc_by_idx.name,
+ loc_params->loc_data.loc_by_idx.idx_type,
+ loc_params->loc_data.loc_by_idx.order,
+ loc_params->loc_data.loc_by_idx.n, args->args.get_info.linfo) < 0)
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info")
} /* end else-if */
else
@@ -253,15 +277,11 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_
/* H5Lget_name_by_idx */
case H5VL_LINK_GET_NAME: {
- char * name = HDva_arg(arguments, char *);
- size_t size = HDva_arg(arguments, size_t);
- ssize_t *ret = HDva_arg(arguments, ssize_t *);
-
- /* Get the link name */
- if ((*ret = H5L__get_name_by_idx(&loc, loc_params->loc_data.loc_by_idx.name,
- loc_params->loc_data.loc_by_idx.idx_type,
- loc_params->loc_data.loc_by_idx.order,
- loc_params->loc_data.loc_by_idx.n, name, size)) < 0)
+ if (H5L__get_name_by_idx(&loc, loc_params->loc_data.loc_by_idx.name,
+ loc_params->loc_data.loc_by_idx.idx_type,
+ loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n,
+ args->args.get_name.name, args->args.get_name.name_size,
+ args->args.get_name.name_len) < 0)
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info")
break;
@@ -269,20 +289,17 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_
/* H5Lget_val/H5Lget_val_by_idx */
case H5VL_LINK_GET_VAL: {
- void * buf = HDva_arg(arguments, void *);
- size_t size = HDva_arg(arguments, size_t);
-
/* Get the link information */
- if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Lget_val */
- if (H5L__get_val(&loc, loc_params->loc_data.loc_by_name.name, buf, size) < 0)
+ if (loc_params->type == H5VL_OBJECT_BY_NAME) {
+ if (H5L__get_val(&loc, loc_params->loc_data.loc_by_name.name, args->args.get_val.buf,
+ args->args.get_val.buf_size) < 0)
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link value")
}
- else if (loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Lget_val_by_idx */
-
- if (H5L__get_val_by_idx(&loc, loc_params->loc_data.loc_by_idx.name,
- loc_params->loc_data.loc_by_idx.idx_type,
- loc_params->loc_data.loc_by_idx.order,
- loc_params->loc_data.loc_by_idx.n, buf, size) < 0)
+ else if (loc_params->type == H5VL_OBJECT_BY_IDX) {
+ if (H5L__get_val_by_idx(
+ &loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type,
+ loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n,
+ args->args.get_val.buf, args->args.get_val.buf_size) < 0)
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val")
}
else
@@ -309,35 +326,28 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_t specific_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_specific_args_t *args,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- switch (specific_type) {
+ switch (args->op_type) {
case H5VL_LINK_EXISTS: {
- hbool_t * exists = HDva_arg(arguments, hbool_t *);
H5G_loc_t loc;
if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
-
- /* Check for the existence of the link */
- if (H5L__exists(&loc, loc_params->loc_data.loc_by_name.name, exists) < 0)
+ if (H5L__exists(&loc, loc_params->loc_data.loc_by_name.name, args->args.exists.exists) < 0)
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to specific link info")
+
break;
}
case H5VL_LINK_ITER: {
- H5G_loc_t loc;
- hbool_t recursive = (hbool_t)HDva_arg(arguments, unsigned);
- H5_index_t idx_type = (H5_index_t)HDva_arg(arguments, int); /* enum work-around */
- H5_iter_order_t order = (H5_iter_order_t)HDva_arg(arguments, int); /* enum work-around */
- hsize_t * idx_p = HDva_arg(arguments, hsize_t *);
- H5L_iterate2_t op = HDva_arg(arguments, H5L_iterate2_t);
- void * op_data = HDva_arg(arguments, void *);
+ H5VL_link_iterate_args_t *iter_args = &args->args.iterate;
+ H5G_loc_t loc;
/* Get the location */
if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
@@ -345,28 +355,32 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_
/* Visit or iterate over the links */
if (loc_params->type == H5VL_OBJECT_BY_SELF) {
- if (recursive) {
+ if (iter_args->recursive) {
/* H5Lvisit */
- if ((ret_value = H5G_visit(&loc, ".", idx_type, order, op, op_data)) < 0)
+ if ((ret_value = H5G_visit(&loc, ".", iter_args->idx_type, iter_args->order,
+ iter_args->op, iter_args->op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
} /* end if */
else {
/* H5Literate */
- if ((ret_value = H5L_iterate(&loc, ".", idx_type, order, idx_p, op, op_data)) < 0)
+ if ((ret_value = H5L_iterate(&loc, ".", iter_args->idx_type, iter_args->order,
+ iter_args->idx_p, iter_args->op, iter_args->op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links")
} /* end else */
} /* end if */
else if (loc_params->type == H5VL_OBJECT_BY_NAME) {
- if (recursive) {
+ if (iter_args->recursive) {
/* H5Lvisit_by_name */
- if ((ret_value = H5G_visit(&loc, loc_params->loc_data.loc_by_name.name, idx_type, order,
- op, op_data)) < 0)
+ if ((ret_value =
+ H5G_visit(&loc, loc_params->loc_data.loc_by_name.name, iter_args->idx_type,
+ iter_args->order, iter_args->op, iter_args->op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
} /* end if */
else {
/* H5Literate_by_name */
- if ((ret_value = H5L_iterate(&loc, loc_params->loc_data.loc_by_name.name, idx_type, order,
- idx_p, op, op_data)) < 0)
+ if ((ret_value = H5L_iterate(&loc, loc_params->loc_data.loc_by_name.name,
+ iter_args->idx_type, iter_args->order, iter_args->idx_p,
+ iter_args->op, iter_args->op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links")
} /* end else */
} /* end else-if */
diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c
index 449f389..d237617 100644
--- a/src/H5VLnative_object.c
+++ b/src/H5VLnative_object.c
@@ -15,9 +15,16 @@
*
*/
-#define H5O_FRIEND /* Suppress error about including H5Opkg */
+/****************/
+/* Module Setup */
+/****************/
+
#define H5F_FRIEND /* Suppress error about including H5Fpkg */
+#define H5O_FRIEND /* Suppress error about including H5Opkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* Files (pkg needed for id_exists) */
@@ -29,6 +36,30 @@
#include "H5VLnative_private.h" /* Native VOL connector */
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/*-------------------------------------------------------------------------
* Function: H5VL__native_object_open
*
@@ -138,8 +169,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_args_t *args,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req)
{
herr_t ret_value = SUCCEED; /* Return value */
H5G_loc_t loc; /* Location of group */
@@ -149,14 +180,12 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- switch (get_type) {
+ switch (args->op_type) {
/* Object file */
case H5VL_OBJECT_GET_FILE: {
- void **ret = HDva_arg(arguments, void **);
-
if (loc_params->type == H5VL_OBJECT_BY_SELF) {
- *ret = (void *)loc.oloc->file;
+ *args->args.get_file.file = (void *)loc.oloc->file;
/* TODO we currently need to set id_exists to TRUE because
* the upper layer will create an ID from the returned
@@ -166,18 +195,16 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
}
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown get_file parameters")
+
break;
}
/* Object name */
case H5VL_OBJECT_GET_NAME: {
- ssize_t *ret = HDva_arg(arguments, ssize_t *);
- char * name = HDva_arg(arguments, char *);
- size_t size = HDva_arg(arguments, size_t);
-
if (loc_params->type == H5VL_OBJECT_BY_SELF) {
/* Retrieve object's name */
- if ((*ret = H5G_get_name(&loc, name, size, NULL)) < 0)
+ if (H5G_get_name(&loc, args->args.get_name.buf, args->args.get_name.buf_size,
+ args->args.get_name.name_len, NULL) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't retrieve object name")
} /* end if */
else if (loc_params->type == H5VL_OBJECT_BY_TOKEN) {
@@ -194,18 +221,18 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
"can't deserialize object token into address")
/* Retrieve object's name */
- if ((*ret = H5G_get_name_by_addr(loc.oloc->file, &obj_oloc, name, size)) < 0)
+ if (H5G_get_name_by_addr(loc.oloc->file, &obj_oloc, args->args.get_name.buf,
+ args->args.get_name.buf_size, args->args.get_name.name_len) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't determine object name")
} /* end else-if */
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown get_name parameters")
+
break;
}
/* Object type */
case H5VL_OBJECT_GET_TYPE: {
- H5O_type_t *obj_type = HDva_arg(arguments, H5O_type_t *);
-
if (loc_params->type == H5VL_OBJECT_BY_TOKEN) {
H5O_loc_t obj_oloc; /* Object location */
unsigned rc; /* Reference count of object */
@@ -222,35 +249,30 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
/* Get the # of links for object, and its type */
/* (To check to make certain that this object hasn't been deleted) */
- if (H5O_get_rc_and_type(&obj_oloc, &rc, obj_type) < 0 || 0 == rc)
+ if (H5O_get_rc_and_type(&obj_oloc, &rc, args->args.get_type.obj_type) < 0 || 0 == rc)
HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object")
}
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown get_type parameters")
+
break;
}
/* H5Oget_info(_name|_by_idx)3 */
case H5VL_OBJECT_GET_INFO: {
- H5O_info2_t *oinfo = HDva_arg(arguments, H5O_info2_t *);
- unsigned fields = HDva_arg(arguments, unsigned);
-
- /* Use the original H5Oget_info code to get the data */
-
- if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Oget_info */
- /* Retrieve the object's information */
- if (H5G_loc_info(&loc, ".", oinfo, fields) < 0)
+ if (loc_params->type == H5VL_OBJECT_BY_SELF) {
+ if (H5G_loc_info(&loc, ".", args->args.get_info.oinfo, args->args.get_info.fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
- } /* end if */
- else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Oget_info_by_name */
- /* Retrieve the object's information */
- if (H5G_loc_info(&loc, loc_params->loc_data.loc_by_name.name, oinfo, fields) < 0)
+ } /* end if */
+ else if (loc_params->type == H5VL_OBJECT_BY_NAME) {
+ if (H5G_loc_info(&loc, loc_params->loc_data.loc_by_name.name, args->args.get_info.oinfo,
+ args->args.get_info.fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
- } /* end else-if */
- else if (loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Oget_info_by_idx */
- H5G_loc_t obj_loc; /* Location used to open group */
- H5G_name_t obj_path; /* Opened object group hier. path */
- H5O_loc_t obj_oloc; /* Opened object object location */
+ } /* end else-if */
+ else if (loc_params->type == H5VL_OBJECT_BY_IDX) {
+ H5G_loc_t obj_loc; /* Location used to open group */
+ H5G_name_t obj_path; /* Opened object group hier. path */
+ H5O_loc_t obj_oloc; /* Opened object object location */
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
@@ -265,7 +287,7 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found")
/* Retrieve the object's information */
- if (H5O_get_info(obj_loc.oloc, oinfo, fields) < 0) {
+ if (H5O_get_info(obj_loc.oloc, args->args.get_info.oinfo, args->args.get_info.fields) < 0) {
H5G_loc_free(&obj_loc);
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info")
} /* end if */
@@ -276,6 +298,7 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
} /* end else-if */
else
HGOTO_ERROR(H5E_OHDR, H5E_UNSUPPORTED, FAIL, "unknown get info parameters")
+
break;
}
@@ -298,8 +321,8 @@ done:
*/
herr_t
H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+ H5VL_object_specific_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
{
H5G_loc_t loc;
herr_t ret_value = SUCCEED; /* Return value */
@@ -309,13 +332,10 @@ H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- switch (specific_type) {
+ switch (args->op_type) {
/* H5Oincr_refcount / H5Odecr_refcount */
case H5VL_OBJECT_CHANGE_REF_COUNT: {
- int update_ref = HDva_arg(arguments, int);
- H5O_loc_t *oloc = loc.oloc;
-
- if (H5O_link(oloc, update_ref) < 0)
+ if (H5O_link(loc.oloc, args->args.change_rc.delta) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed")
break;
@@ -323,25 +343,20 @@ H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
/* H5Oexists_by_name */
case H5VL_OBJECT_EXISTS: {
- htri_t *ret = HDva_arg(arguments, htri_t *);
-
if (loc_params->type == H5VL_OBJECT_BY_NAME) {
/* Check if the object exists */
- if ((*ret = H5G_loc_exists(&loc, loc_params->loc_data.loc_by_name.name)) < 0)
+ if (H5G_loc_exists(&loc, loc_params->loc_data.loc_by_name.name, args->args.exists.exists) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists",
loc_params->loc_data.loc_by_name.name)
} /* end if */
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown object exists parameters")
+
break;
}
/* Lookup object */
case H5VL_OBJECT_LOOKUP: {
- H5O_token_t *token = HDva_arg(arguments, H5O_token_t *);
-
- HDassert(token);
-
if (loc_params->type == H5VL_OBJECT_BY_NAME) {
H5G_loc_t obj_loc; /* Group hier. location of object */
H5G_name_t obj_path; /* Object group hier. path */
@@ -357,7 +372,8 @@ H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
/* Encode token */
- if (H5VL_native_addr_to_token(loc.oloc->file, H5I_FILE, obj_loc.oloc->addr, token) < 0)
+ if (H5VL_native_addr_to_token(loc.oloc->file, H5I_FILE, obj_loc.oloc->addr,
+ args->args.lookup.token_ptr) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL,
"can't serialize address into object token")
@@ -370,46 +386,39 @@ H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
break;
}
+ /* H5Ovisit/H5Ovisit_by_name */
case H5VL_OBJECT_VISIT: {
- H5_index_t idx_type = (H5_index_t)HDva_arg(arguments, int); /* enum work-around */
- H5_iter_order_t order = (H5_iter_order_t)HDva_arg(arguments, int); /* enum work-around */
- H5O_iterate2_t op = HDva_arg(arguments, H5O_iterate2_t);
- void * op_data = HDva_arg(arguments, void *);
- unsigned fields = HDva_arg(arguments, unsigned);
+ H5VL_object_visit_args_t *visit_args = &args->args.visit;
/* Call internal object visitation routine */
if (loc_params->type == H5VL_OBJECT_BY_SELF) {
- /* H5Ovisit */
- if ((ret_value = H5O__visit(&loc, ".", idx_type, order, op, op_data, fields)) < 0)
+ if ((ret_value = H5O__visit(&loc, ".", visit_args->idx_type, visit_args->order,
+ visit_args->op, visit_args->op_data, visit_args->fields)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
} /* end if */
else if (loc_params->type == H5VL_OBJECT_BY_NAME) {
- /* H5Ovisit_by_name */
- if ((ret_value = H5O__visit(&loc, loc_params->loc_data.loc_by_name.name, idx_type, order, op,
- op_data, fields)) < 0)
+ if ((ret_value = H5O__visit(&loc, loc_params->loc_data.loc_by_name.name, visit_args->idx_type,
+ visit_args->order, visit_args->op, visit_args->op_data,
+ visit_args->fields)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
} /* end else-if */
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown object visit params");
+
break;
}
case H5VL_OBJECT_FLUSH: {
- hid_t oid = HDva_arg(arguments, hid_t);
-
/* Flush the object's metadata */
- if (H5O_flush(loc.oloc, oid) < 0)
+ if (H5O_flush(loc.oloc, args->args.flush.obj_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object")
break;
}
case H5VL_OBJECT_REFRESH: {
- hid_t oid = HDva_arg(arguments, hid_t);
- H5O_loc_t *oloc = loc.oloc;
-
/* Refresh the metadata */
- if (H5O_refresh_metadata(oid, *oloc) < 0)
+ if (H5O_refresh_metadata(loc.oloc, args->args.refresh.obj_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object")
break;
@@ -433,64 +442,59 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_object_optional(void *obj, H5VL_object_optional_t optional_type, hid_t H5_ATTR_UNUSED dxpl_id,
- void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_object_optional(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req)
{
- H5VL_loc_params_t *loc_params = HDva_arg(arguments, H5VL_loc_params_t *);
- H5G_loc_t loc; /* Location of group */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5G_loc_t loc; /* Location of group */
+ H5VL_native_object_optional_args_t *opt_args = args->args; /* Pointer to native operation's arguments */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
- switch (optional_type) {
+ switch (args->op_type) {
/* H5Oget_comment / H5Oget_comment_by_name */
case H5VL_NATIVE_OBJECT_GET_COMMENT: {
- char * comment = HDva_arg(arguments, char *);
- size_t bufsize = HDva_arg(arguments, size_t);
- ssize_t *ret = HDva_arg(arguments, ssize_t *);
+ H5VL_native_object_get_comment_t *gc_args = &opt_args->get_comment;
/* Retrieve the object's comment */
if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Oget_comment */
- if ((*ret = H5G_loc_get_comment(&loc, ".", comment /*out*/, bufsize)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
+ if (H5G_loc_get_comment(&loc, ".", gc_args->buf, gc_args->buf_size, gc_args->comment_len) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object")
} /* end if */
else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Oget_comment_by_name */
- if ((*ret = H5G_loc_get_comment(&loc, loc_params->loc_data.loc_by_name.name, comment /*out*/,
- bufsize)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
+ if (H5G_loc_get_comment(&loc, loc_params->loc_data.loc_by_name.name, gc_args->buf,
+ gc_args->buf_size, gc_args->comment_len) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object")
} /* end else-if */
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown set_coment parameters")
+
break;
}
/* H5Oset_comment */
case H5VL_NATIVE_OBJECT_SET_COMMENT: {
- const char *comment = HDva_arg(arguments, char *);
-
if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Oset_comment */
- /* (Re)set the object's comment */
- if (H5G_loc_set_comment(&loc, ".", comment) < 0)
+ if (H5G_loc_set_comment(&loc, ".", opt_args->set_comment.comment) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
} /* end if */
else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Oset_comment_by_name */
- /* (Re)set the object's comment */
- if (H5G_loc_set_comment(&loc, loc_params->loc_data.loc_by_name.name, comment) < 0)
+ if (H5G_loc_set_comment(&loc, loc_params->loc_data.loc_by_name.name,
+ opt_args->set_comment.comment) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
} /* end else-if */
else
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown set_coment parameters")
+
break;
}
/* H5Odisable_mdc_flushes */
case H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES: {
- H5O_loc_t *oloc = loc.oloc;
-
- if (H5O_disable_mdc_flushes(oloc) < 0)
+ if (H5O__disable_mdc_flushes(loc.oloc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCORK, FAIL, "unable to cork the metadata cache");
break;
@@ -498,9 +502,7 @@ H5VL__native_object_optional(void *obj, H5VL_object_optional_t optional_type, hi
/* H5Oenable_mdc_flushes */
case H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES: {
- H5O_loc_t *oloc = loc.oloc;
-
- if (H5O_enable_mdc_flushes(oloc) < 0)
+ if (H5O__enable_mdc_flushes(loc.oloc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTUNCORK, FAIL, "unable to uncork the metadata cache");
break;
@@ -508,10 +510,7 @@ H5VL__native_object_optional(void *obj, H5VL_object_optional_t optional_type, hi
/* H5Oare_mdc_flushes_disabled */
case H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED: {
- H5O_loc_t *oloc = loc.oloc;
- hbool_t * are_disabled = (hbool_t *)HDva_arg(arguments, hbool_t *);
-
- if (H5O_are_mdc_flushes_disabled(oloc, are_disabled) < 0)
+ if (H5O__are_mdc_flushes_disabled(loc.oloc, opt_args->are_mdc_flushes_disabled.flag) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine metadata cache cork status");
break;
@@ -519,19 +518,16 @@ H5VL__native_object_optional(void *obj, H5VL_object_optional_t optional_type, hi
/* H5Oget_native_info(_name|_by_idx) */
case H5VL_NATIVE_OBJECT_GET_NATIVE_INFO: {
- H5O_native_info_t *native_info = HDva_arg(arguments, H5O_native_info_t *);
- unsigned fields = HDva_arg(arguments, unsigned);
+ H5VL_native_object_get_native_info_t *gni_args = &opt_args->get_native_info;
/* Use the original H5Oget_info code to get the data */
-
- if (loc_params->type == H5VL_OBJECT_BY_SELF) { /* H5Oget_info */
- /* Retrieve the object's information */
- if (H5G_loc_native_info(&loc, ".", native_info, fields) < 0)
+ if (loc_params->type == H5VL_OBJECT_BY_SELF) {
+ if (H5G_loc_native_info(&loc, ".", gni_args->ninfo, gni_args->fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
} /* end if */
else if (loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Oget_info_by_name */
- /* Retrieve the object's information */
- if (H5G_loc_native_info(&loc, loc_params->loc_data.loc_by_name.name, native_info, fields) < 0)
+ if (H5G_loc_native_info(&loc, loc_params->loc_data.loc_by_name.name, gni_args->ninfo,
+ gni_args->fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found")
} /* end else-if */
else if (loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Oget_info_by_idx */
@@ -551,8 +547,7 @@ H5VL__native_object_optional(void *obj, H5VL_object_optional_t optional_type, hi
loc_params->loc_data.loc_by_idx.n, &obj_loc /*out*/) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found")
- /* Retrieve the object's information */
- if (H5O_get_native_info(obj_loc.oloc, native_info, fields) < 0) {
+ if (H5O_get_native_info(obj_loc.oloc, gni_args->ninfo, gni_args->fields) < 0) {
H5G_loc_free(&obj_loc);
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info")
} /* end if */
diff --git a/src/H5VLnative_private.h b/src/H5VLnative_private.h
index 687221a..1fd90c8 100644
--- a/src/H5VLnative_private.h
+++ b/src/H5VLnative_private.h
@@ -49,13 +49,10 @@ void * H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_par
hid_t aapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
+H5_DLL herr_t H5VL__native_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_attr_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VL__native_attr_optional(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL__native_attr_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_attr_close(void *attr, hid_t dxpl_id, void **req);
/* Dataset callbacks */
@@ -68,12 +65,11 @@ H5_DLL herr_t H5VL__native_dataset_read(void *dset, hid_t mem_type_id, hid_t mem
hid_t file_space_id, hid_t plist_id, void *buf, void **req);
H5_DLL herr_t H5VL__native_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t plist_id, const void *buf, void **req);
-H5_DLL herr_t H5VL__native_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VL__native_dataset_specific(void *dset, H5VL_dataset_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments);
-H5_DLL herr_t H5VL__native_dataset_optional(void *dset, H5VL_dataset_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+H5_DLL herr_t H5VL__native_dataset_get(void *dset, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL__native_dataset_specific(void *dset, H5VL_dataset_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL__native_dataset_optional(void *dset, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VL__native_dataset_close(void *dset, hid_t dxpl_id, void **req);
/* Datatype callbacks */
@@ -82,10 +78,9 @@ H5_DLL void * H5VL__native_datatype_commit(void *obj, const H5VL_loc_params_t *l
hid_t dxpl_id, void **req);
H5_DLL void * H5VL__native_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name,
hid_t tapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VL__native_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VL__native_datatype_specific(void *dt, H5VL_datatype_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments);
+H5_DLL herr_t H5VL__native_datatype_get(void *dt, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL__native_datatype_specific(void *dt, H5VL_datatype_specific_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VL__native_datatype_close(void *dt, hid_t dxpl_id, void **req);
/* File callbacks */
@@ -93,12 +88,10 @@ H5_DLL void * H5VL__native_file_create(const char *name, unsigned flags, hid_t f
hid_t dxpl_id, void **req);
H5_DLL void * H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id,
void **req);
-H5_DLL herr_t H5VL__native_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VL__native_file_specific(void *file, H5VL_file_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments);
-H5_DLL herr_t H5VL__native_file_optional(void *file, H5VL_file_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments);
+H5_DLL herr_t H5VL__native_file_get(void *file, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL__native_file_specific(void *file, H5VL_file_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL__native_file_optional(void *file, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_file_close(void *file, hid_t dxpl_id, void **req);
/* Group callbacks */
@@ -107,29 +100,26 @@ H5_DLL void * H5VL__native_group_create(void *obj, const H5VL_loc_params_t *loc_
void **req);
H5_DLL void * H5VL__native_group_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name,
hid_t gapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VL__native_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VL__native_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments);
-H5_DLL herr_t H5VL__native_group_optional(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+H5_DLL herr_t H5VL__native_group_get(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL__native_group_specific(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL__native_group_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_group_close(void *grp, hid_t dxpl_id, void **req);
/* Link callbacks */
-H5_DLL herr_t H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj,
+H5_DLL herr_t H5VL__native_link_create(H5VL_link_create_args_t *args, void *obj,
const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id,
- hid_t dxpl_id, void **req, va_list arguments);
+ hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id,
hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id,
hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type,
- hid_t dxpl_id, void **req, va_list arguments);
+H5_DLL herr_t H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params,
+ H5VL_link_get_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req);
/* Object callbacks */
H5_DLL void *H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_type_t *opened_type,
@@ -139,25 +129,23 @@ H5_DLL herr_t H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *l
const H5VL_loc_params_t *loc_params2, const char *dst_name,
hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-H5_DLL herr_t H5VL__native_object_optional(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL__native_object_optional(void *obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/* Connector/container introspection functions */
H5_DLL herr_t H5VL__native_introspect_get_conn_cls(void *obj, H5VL_get_conn_lvl_t lvl,
const H5VL_class_t **conn_cls);
+H5_DLL herr_t H5VL__native_introspect_get_cap_flags(const void *info, unsigned *cap_flags);
H5_DLL herr_t H5VL__native_introspect_opt_query(void *obj, H5VL_subclass_t cls, int opt_type,
uint64_t *flags);
/* Blob callbacks */
H5_DLL herr_t H5VL__native_blob_put(void *obj, const void *buf, size_t size, void *blob_id, void *ctx);
H5_DLL herr_t H5VL__native_blob_get(void *obj, const void *blob_id, void *buf, size_t size, void *ctx);
-H5_DLL herr_t H5VL__native_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t specific_type,
- va_list arguments);
+H5_DLL herr_t H5VL__native_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t *args);
/* Token callbacks */
H5_DLL herr_t H5VL__native_token_cmp(void *obj, const H5O_token_t *token1, const H5O_token_t *token2,
diff --git a/src/H5VLnative_token.c b/src/H5VLnative_token.c
index 65591c7..bed0164 100644
--- a/src/H5VLnative_token.c
+++ b/src/H5VLnative_token.c
@@ -14,6 +14,10 @@
* Purpose: Object token callbacks for the native VOL connector
*/
+/****************/
+/* Module Setup */
+/****************/
+
/***********/
/* Headers */
/***********/
diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c
index 5ccc082..681531e 100644
--- a/src/H5VLpassthru.c
+++ b/src/H5VLpassthru.c
@@ -77,15 +77,6 @@ typedef struct H5VL_pass_through_wrap_ctx_t {
/********************* */
/* Helper routines */
-static herr_t H5VL_pass_through_file_specific_reissue(void *obj, hid_t connector_id,
- H5VL_file_specific_t specific_type, hid_t dxpl_id,
- void **req, ...);
-static herr_t H5VL_pass_through_request_specific_reissue(void *obj, hid_t connector_id,
- H5VL_request_specific_t specific_type, ...);
-static herr_t H5VL_pass_through_link_create_reissue(H5VL_link_create_type_t create_type, void *obj,
- const H5VL_loc_params_t *loc_params, hid_t connector_id,
- hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req,
- ...);
static H5VL_pass_through_t *H5VL_pass_through_new_obj(void *under_obj, hid_t under_vol_id);
static herr_t H5VL_pass_through_free_obj(H5VL_pass_through_t *obj);
@@ -117,13 +108,11 @@ static herr_t H5VL_pass_through_attr_read(void *attr, hid_t mem_type_id, void *b
void **req);
static herr_t H5VL_pass_through_attr_write(void *attr, hid_t mem_type_id, const void *buf, hid_t dxpl_id,
void **req);
-static herr_t H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
+static herr_t H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req);
static herr_t H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL_pass_through_attr_optional(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL_pass_through_attr_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
static herr_t H5VL_pass_through_attr_close(void *attr, hid_t dxpl_id, void **req);
/* Dataset callbacks */
@@ -137,12 +126,12 @@ static herr_t H5VL_pass_through_dataset_read(void *dset, hid_t mem_type_id, hid_
static herr_t H5VL_pass_through_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t plist_id, const void *buf,
void **req);
-static herr_t H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-static herr_t H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-static herr_t H5VL_pass_through_dataset_optional(void *obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+static herr_t H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_args_t *args, hid_t dxpl_id,
+ void **req);
+static herr_t H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+static herr_t H5VL_pass_through_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
static herr_t H5VL_pass_through_dataset_close(void *dset, hid_t dxpl_id, void **req);
/* Datatype callbacks */
@@ -151,12 +140,12 @@ static void *H5VL_pass_through_datatype_commit(void *obj, const H5VL_loc_params_
hid_t tapl_id, hid_t dxpl_id, void **req);
static void *H5VL_pass_through_datatype_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name,
hid_t tapl_id, hid_t dxpl_id, void **req);
-static herr_t H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id,
- void **req, va_list arguments);
-static herr_t H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type,
- hid_t dxpl_id, void **req, va_list arguments);
-static herr_t H5VL_pass_through_datatype_optional(void *obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+static herr_t H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_args_t *args, hid_t dxpl_id,
+ void **req);
+static herr_t H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+static herr_t H5VL_pass_through_datatype_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
static herr_t H5VL_pass_through_datatype_close(void *dt, hid_t dxpl_id, void **req);
/* File callbacks */
@@ -164,12 +153,11 @@ static void * H5VL_pass_through_file_create(const char *name, unsigned flags, hi
hid_t dxpl_id, void **req);
static void * H5VL_pass_through_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id,
void **req);
-static herr_t H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL_pass_through_file_specific(void *file, H5VL_file_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments);
-static herr_t H5VL_pass_through_file_optional(void *file, H5VL_file_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+static herr_t H5VL_pass_through_file_get(void *file, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL_pass_through_file_specific(void *file, H5VL_file_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+static herr_t H5VL_pass_through_file_optional(void *file, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
static herr_t H5VL_pass_through_file_close(void *file, hid_t dxpl_id, void **req);
/* Group callbacks */
@@ -178,18 +166,17 @@ static void * H5VL_pass_through_group_create(void *obj, const H5VL_loc_params_t
void **req);
static void * H5VL_pass_through_group_open(void *obj, const H5VL_loc_params_t *loc_params, const char *name,
hid_t gapl_id, hid_t dxpl_id, void **req);
-static herr_t H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments);
-static herr_t H5VL_pass_through_group_optional(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+static herr_t H5VL_pass_through_group_get(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+static herr_t H5VL_pass_through_group_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
static herr_t H5VL_pass_through_group_close(void *grp, hid_t dxpl_id, void **req);
/* Link callbacks */
-static herr_t H5VL_pass_through_link_create(H5VL_link_create_type_t create_type, void *obj,
+static herr_t H5VL_pass_through_link_create(H5VL_link_create_args_t *args, void *obj,
const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id,
- hid_t dxpl_id, void **req, va_list arguments);
+ hid_t dxpl_id, void **req);
static herr_t H5VL_pass_through_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, void *dst_obj,
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id,
hid_t dxpl_id, void **req);
@@ -197,13 +184,11 @@ static herr_t H5VL_pass_through_link_move(void *src_obj, const H5VL_loc_params_t
const H5VL_loc_params_t *loc_params2, hid_t lcpl_id, hid_t lapl_id,
hid_t dxpl_id, void **req);
static herr_t H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_link_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ H5VL_link_get_args_t *args, hid_t dxpl_id, void **req);
static herr_t H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments);
-static herr_t H5VL_pass_through_link_optional(void *obj, H5VL_link_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL_pass_through_link_optional(void *obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/* Object callbacks */
static void * H5VL_pass_through_object_open(void *obj, const H5VL_loc_params_t *loc_params,
@@ -213,17 +198,16 @@ static herr_t H5VL_pass_through_object_copy(void *src_obj, const H5VL_loc_params
const H5VL_loc_params_t *dst_loc_params, const char *dst_name,
hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req);
static herr_t H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments);
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req);
static herr_t H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments);
-static herr_t H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id,
- void **req, va_list arguments);
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req);
+static herr_t H5VL_pass_through_object_optional(void *obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/* Container/connector introspection callbacks */
static herr_t H5VL_pass_through_introspect_get_conn_cls(void *obj, H5VL_get_conn_lvl_t lvl,
const H5VL_class_t **conn_cls);
+static herr_t H5VL_pass_through_introspect_get_cap_flags(const void *info, unsigned *cap_flags);
static herr_t H5VL_pass_through_introspect_opt_query(void *obj, H5VL_subclass_t cls, int opt_type,
uint64_t *flags);
@@ -231,19 +215,15 @@ static herr_t H5VL_pass_through_introspect_opt_query(void *obj, H5VL_subclass_t
static herr_t H5VL_pass_through_request_wait(void *req, uint64_t timeout, H5VL_request_status_t *status);
static herr_t H5VL_pass_through_request_notify(void *obj, H5VL_request_notify_t cb, void *ctx);
static herr_t H5VL_pass_through_request_cancel(void *req, H5VL_request_status_t *status);
-static herr_t H5VL_pass_through_request_specific(void *req, H5VL_request_specific_t specific_type,
- va_list arguments);
-static herr_t H5VL_pass_through_request_optional(void *req, H5VL_request_optional_t opt_type,
- va_list arguments);
+static herr_t H5VL_pass_through_request_specific(void *req, H5VL_request_specific_args_t *args);
+static herr_t H5VL_pass_through_request_optional(void *req, H5VL_optional_args_t *args);
static herr_t H5VL_pass_through_request_free(void *req);
/* Blob callbacks */
static herr_t H5VL_pass_through_blob_put(void *obj, const void *buf, size_t size, void *blob_id, void *ctx);
static herr_t H5VL_pass_through_blob_get(void *obj, const void *blob_id, void *buf, size_t size, void *ctx);
-static herr_t H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t specific_type,
- va_list arguments);
-static herr_t H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_blob_optional_t opt_type,
- va_list arguments);
+static herr_t H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t *args);
+static herr_t H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_optional_args_t *args);
/* Token callbacks */
static herr_t H5VL_pass_through_token_cmp(void *obj, const H5O_token_t *token1, const H5O_token_t *token2,
@@ -254,8 +234,7 @@ static herr_t H5VL_pass_through_token_from_str(void *obj, H5I_type_t obj_type, c
H5O_token_t *token);
/* Generic optional callback */
-static herr_t H5VL_pass_through_optional(void *obj, int op_type, hid_t dxpl_id, void **req,
- va_list arguments);
+static herr_t H5VL_pass_through_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/*******************/
/* Local variables */
@@ -355,8 +334,9 @@ static const H5VL_class_t H5VL_pass_through_g = {
},
{
/* introspect_cls */
- H5VL_pass_through_introspect_get_conn_cls, /* get_conn_cls */
- H5VL_pass_through_introspect_opt_query, /* opt_query */
+ H5VL_pass_through_introspect_get_conn_cls, /* get_conn_cls */
+ H5VL_pass_through_introspect_get_cap_flags, /* get_cap_flags */
+ H5VL_pass_through_introspect_opt_query, /* opt_query */
},
{
/* request_cls */
@@ -1025,7 +1005,7 @@ H5VL_pass_through_attr_write(void *attr, hid_t mem_type_id, const void *buf, hid
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments)
+H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -1034,7 +1014,7 @@ H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, v
printf("------- PASS THROUGH VOL ATTRIBUTE Get\n");
#endif
- ret_value = H5VLattr_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments);
+ ret_value = H5VLattr_get(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1055,8 +1035,7 @@ H5VL_pass_through_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, v
*/
static herr_t
H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments)
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -1065,8 +1044,7 @@ H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params,
printf("------- PASS THROUGH VOL ATTRIBUTE Specific\n");
#endif
- ret_value = H5VLattr_specific(o->under_object, loc_params, o->under_vol_id, specific_type, dxpl_id, req,
- arguments);
+ ret_value = H5VLattr_specific(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1086,8 +1064,7 @@ H5VL_pass_through_attr_specific(void *obj, const H5VL_loc_params_t *loc_params,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_attr_optional(void *obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_attr_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -1096,7 +1073,7 @@ H5VL_pass_through_attr_optional(void *obj, H5VL_attr_optional_t opt_type, hid_t
printf("------- PASS THROUGH VOL ATTRIBUTE Optional\n");
#endif
- ret_value = H5VLattr_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments);
+ ret_value = H5VLattr_optional(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1285,8 +1262,7 @@ H5VL_pass_through_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_i
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)dset;
herr_t ret_value;
@@ -1295,7 +1271,7 @@ H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxp
printf("------- PASS THROUGH VOL DATASET Get\n");
#endif
- ret_value = H5VLdataset_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments);
+ ret_value = H5VLdataset_get(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1315,8 +1291,7 @@ H5VL_pass_through_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxp
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
hid_t under_vol_id;
@@ -1326,12 +1301,12 @@ H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_t
printf("------- PASS THROUGH VOL H5Dspecific\n");
#endif
- // Save copy of underlying VOL connector ID and prov helper, in case of
- // refresh destroying the current object
+ /* Save copy of underlying VOL connector ID, in case of
+ * 'refresh' operation destroying the current object
+ */
under_vol_id = o->under_vol_id;
- ret_value =
- H5VLdataset_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments);
+ ret_value = H5VLdataset_specific(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1351,8 +1326,7 @@ H5VL_pass_through_dataset_specific(void *obj, H5VL_dataset_specific_t specific_t
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_dataset_optional(void *obj, H5VL_dataset_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -1361,7 +1335,7 @@ H5VL_pass_through_dataset_optional(void *obj, H5VL_dataset_optional_t opt_type,
printf("------- PASS THROUGH VOL DATASET Optional\n");
#endif
- ret_value = H5VLdataset_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments);
+ ret_value = H5VLdataset_optional(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1488,8 +1462,7 @@ H5VL_pass_through_datatype_open(void *obj, const H5VL_loc_params_t *loc_params,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)dt;
herr_t ret_value;
@@ -1498,7 +1471,7 @@ H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxp
printf("------- PASS THROUGH VOL DATATYPE Get\n");
#endif
- ret_value = H5VLdatatype_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments);
+ ret_value = H5VLdatatype_get(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1518,8 +1491,7 @@ H5VL_pass_through_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxp
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, hid_t dxpl_id,
- void **req, va_list arguments)
+H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
hid_t under_vol_id;
@@ -1529,12 +1501,12 @@ H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific
printf("------- PASS THROUGH VOL DATATYPE Specific\n");
#endif
- // Save copy of underlying VOL connector ID and prov helper, in case of
- // refresh destroying the current object
+ /* Save copy of underlying VOL connector ID, in case of
+ * 'refresh' operation destroying the current object
+ */
under_vol_id = o->under_vol_id;
- ret_value =
- H5VLdatatype_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments);
+ ret_value = H5VLdatatype_specific(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1554,8 +1526,7 @@ H5VL_pass_through_datatype_specific(void *obj, H5VL_datatype_specific_t specific
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_datatype_optional(void *obj, H5VL_datatype_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_datatype_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -1564,7 +1535,7 @@ H5VL_pass_through_datatype_optional(void *obj, H5VL_datatype_optional_t opt_type
printf("------- PASS THROUGH VOL DATATYPE Optional\n");
#endif
- ret_value = H5VLdatatype_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments);
+ ret_value = H5VLdatatype_optional(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1732,7 +1703,7 @@ H5VL_pass_through_file_open(const char *name, unsigned flags, hid_t fapl_id, hid
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments)
+H5VL_pass_through_file_get(void *file, H5VL_file_get_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)file;
herr_t ret_value;
@@ -1741,7 +1712,7 @@ H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id,
printf("------- PASS THROUGH VOL FILE Get\n");
#endif
- ret_value = H5VLfile_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments);
+ ret_value = H5VLfile_get(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -1751,31 +1722,6 @@ H5VL_pass_through_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id,
} /* end H5VL_pass_through_file_get() */
/*-------------------------------------------------------------------------
- * Function: H5VL_pass_through_file_specific_reissue
- *
- * Purpose: Re-wrap vararg arguments into a va_list and reissue the
- * file specific callback to the underlying VOL connector.
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5VL_pass_through_file_specific_reissue(void *obj, hid_t connector_id, H5VL_file_specific_t specific_type,
- hid_t dxpl_id, void **req, ...)
-{
- va_list arguments;
- herr_t ret_value;
-
- va_start(arguments, req);
- ret_value = H5VLfile_specific(obj, connector_id, specific_type, dxpl_id, req, arguments);
- va_end(arguments);
-
- return ret_value;
-} /* end H5VL_pass_through_file_specific_reissue() */
-
-/*-------------------------------------------------------------------------
* Function: H5VL_pass_through_file_specific
*
* Purpose: Specific operation on file
@@ -1786,106 +1732,109 @@ H5VL_pass_through_file_specific_reissue(void *obj, hid_t connector_id, H5VL_file
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_file_specific(void *file, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_file_specific(void *file, H5VL_file_specific_args_t *args, hid_t dxpl_id, void **req)
{
- H5VL_pass_through_t *o = (H5VL_pass_through_t *)file;
- hid_t under_vol_id = -1;
- herr_t ret_value;
+ H5VL_pass_through_t * o = (H5VL_pass_through_t *)file;
+ H5VL_pass_through_t * new_o;
+ H5VL_file_specific_args_t my_args;
+ H5VL_file_specific_args_t *new_args;
+ H5VL_pass_through_info_t * info;
+ hid_t under_vol_id = -1;
+ herr_t ret_value;
#ifdef ENABLE_PASSTHRU_LOGGING
printf("------- PASS THROUGH VOL FILE Specific\n");
#endif
- /* Unpack arguments to get at the child file pointer when mounting a file */
- if (specific_type == H5VL_FILE_MOUNT) {
- H5I_type_t loc_type;
- const char * name;
- H5VL_pass_through_t *child_file;
- hid_t plist_id;
-
- /* Retrieve parameters for 'mount' operation, so we can unwrap the child file */
- loc_type = (H5I_type_t)va_arg(arguments, int); /* enum work-around */
- name = va_arg(arguments, const char *);
- child_file = (H5VL_pass_through_t *)va_arg(arguments, void *);
- plist_id = va_arg(arguments, hid_t);
-
- /* Keep the correct underlying VOL ID for possible async request token */
- under_vol_id = o->under_vol_id;
-
- /* Re-issue 'file specific' call, using the unwrapped pieces */
- ret_value = H5VL_pass_through_file_specific_reissue(o->under_object, o->under_vol_id, specific_type,
- dxpl_id, req, (int)loc_type, name,
- child_file->under_object, plist_id);
- } /* end if */
- else if (specific_type == H5VL_FILE_IS_ACCESSIBLE || specific_type == H5VL_FILE_DELETE) {
- H5VL_pass_through_info_t *info;
- hid_t fapl_id, under_fapl_id;
- const char * name;
- htri_t * ret;
-
- /* Get the arguments for the 'is accessible' check */
- fapl_id = va_arg(arguments, hid_t);
- name = va_arg(arguments, const char *);
- ret = va_arg(arguments, htri_t *);
+ if (args->op_type == H5VL_FILE_IS_ACCESSIBLE) {
+ /* Shallow copy the args */
+ memcpy(&my_args, args, sizeof(my_args));
/* Get copy of our VOL info from FAPL */
- H5Pget_vol_info(fapl_id, (void **)&info);
+ H5Pget_vol_info(args->args.is_accessible.fapl_id, (void **)&info);
/* Make sure we have info about the underlying VOL to be used */
if (!info)
return (-1);
+ /* Keep the correct underlying VOL ID for later */
+ under_vol_id = info->under_vol_id;
+
/* Copy the FAPL */
- under_fapl_id = H5Pcopy(fapl_id);
+ my_args.args.is_accessible.fapl_id = H5Pcopy(args->args.is_accessible.fapl_id);
/* Set the VOL ID and info for the underlying FAPL */
- H5Pset_vol(under_fapl_id, info->under_vol_id, info->under_vol_info);
+ H5Pset_vol(my_args.args.is_accessible.fapl_id, info->under_vol_id, info->under_vol_info);
- /* Keep the correct underlying VOL ID for possible async request token */
+ /* Set argument pointer to new arguments */
+ new_args = &my_args;
+
+ /* Set object pointer for operation */
+ new_o = NULL;
+ } /* end else-if */
+ else if (args->op_type == H5VL_FILE_DELETE) {
+ /* Shallow copy the args */
+ memcpy(&my_args, args, sizeof(my_args));
+
+ /* Get copy of our VOL info from FAPL */
+ H5Pget_vol_info(args->args.del.fapl_id, (void **)&info);
+
+ /* Make sure we have info about the underlying VOL to be used */
+ if (!info)
+ return (-1);
+
+ /* Keep the correct underlying VOL ID for later */
under_vol_id = info->under_vol_id;
- /* Re-issue 'file specific' call */
- ret_value = H5VL_pass_through_file_specific_reissue(NULL, info->under_vol_id, specific_type, dxpl_id,
- req, under_fapl_id, name, ret);
+ /* Copy the FAPL */
+ my_args.args.del.fapl_id = H5Pcopy(args->args.del.fapl_id);
- /* Close underlying FAPL */
- H5Pclose(under_fapl_id);
+ /* Set the VOL ID and info for the underlying FAPL */
+ H5Pset_vol(my_args.args.del.fapl_id, info->under_vol_id, info->under_vol_info);
- /* Release copy of our VOL info */
- H5VL_pass_through_info_free(info);
+ /* Set argument pointer to new arguments */
+ new_args = &my_args;
+
+ /* Set object pointer for operation */
+ new_o = NULL;
} /* end else-if */
else {
- va_list my_arguments;
-
- /* Make a copy of the argument list for later, if reopening */
- if (specific_type == H5VL_FILE_REOPEN)
- va_copy(my_arguments, arguments);
-
- /* Keep the correct underlying VOL ID for possible async request token */
+ /* Keep the correct underlying VOL ID for later */
under_vol_id = o->under_vol_id;
- ret_value =
- H5VLfile_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments);
-
- /* Wrap file struct pointer, if we reopened one */
- if (specific_type == H5VL_FILE_REOPEN) {
- if (ret_value >= 0) {
- void **ret = va_arg(my_arguments, void **);
+ /* Set argument pointer to current arguments */
+ new_args = args;
- if (ret && *ret)
- *ret = H5VL_pass_through_new_obj(*ret, o->under_vol_id);
- } /* end if */
+ /* Set object pointer for operation */
+ new_o = o->under_object;
+ } /* end else */
- /* Finish use of copied vararg list */
- va_end(my_arguments);
- } /* end if */
- } /* end else */
+ ret_value = H5VLfile_specific(new_o, under_vol_id, new_args, dxpl_id, req);
/* Check for async request */
if (req && *req)
*req = H5VL_pass_through_new_obj(*req, under_vol_id);
+ if (args->op_type == H5VL_FILE_IS_ACCESSIBLE) {
+ /* Close underlying FAPL */
+ H5Pclose(my_args.args.is_accessible.fapl_id);
+
+ /* Release copy of our VOL info */
+ H5VL_pass_through_info_free(info);
+ } /* end else-if */
+ else if (args->op_type == H5VL_FILE_DELETE) {
+ /* Close underlying FAPL */
+ H5Pclose(my_args.args.del.fapl_id);
+
+ /* Release copy of our VOL info */
+ H5VL_pass_through_info_free(info);
+ } /* end else-if */
+ else if (args->op_type == H5VL_FILE_REOPEN) {
+ /* Wrap file struct pointer for 'reopen' operation, if we reopened one */
+ if (ret_value >= 0 && *args->args.reopen.file)
+ *args->args.reopen.file = H5VL_pass_through_new_obj(*args->args.reopen.file, under_vol_id);
+ } /* end else */
+
return ret_value;
} /* end H5VL_pass_through_file_specific() */
@@ -1900,8 +1849,7 @@ H5VL_pass_through_file_specific(void *file, H5VL_file_specific_t specific_type,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_file_optional(void *file, H5VL_file_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_file_optional(void *file, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)file;
herr_t ret_value;
@@ -1910,7 +1858,7 @@ H5VL_pass_through_file_optional(void *file, H5VL_file_optional_t opt_type, hid_t
printf("------- PASS THROUGH VOL File Optional\n");
#endif
- ret_value = H5VLfile_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments);
+ ret_value = H5VLfile_optional(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2036,8 +1984,7 @@ H5VL_pass_through_group_open(void *obj, const H5VL_loc_params_t *loc_params, con
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_group_get(void *obj, H5VL_group_get_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2046,7 +1993,7 @@ H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id,
printf("------- PASS THROUGH VOL GROUP Get\n");
#endif
- ret_value = H5VLgroup_get(o->under_object, o->under_vol_id, get_type, dxpl_id, req, arguments);
+ ret_value = H5VLgroup_get(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2066,8 +2013,7 @@ H5VL_pass_through_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
hid_t under_vol_id;
@@ -2077,11 +2023,27 @@ H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type,
printf("------- PASS THROUGH VOL GROUP Specific\n");
#endif
- // Save copy of underlying VOL connector ID and prov helper, in case of
- // refresh destroying the current object
+ /* Save copy of underlying VOL connector ID, in case of
+ * 'refresh' operation destroying the current object
+ */
under_vol_id = o->under_vol_id;
- ret_value = H5VLgroup_specific(o->under_object, o->under_vol_id, specific_type, dxpl_id, req, arguments);
+ /* Unpack arguments to get at the child file pointer when mounting a file */
+ if (args->op_type == H5VL_GROUP_MOUNT) {
+ H5VL_group_specific_args_t vol_cb_args; /* New group specific arg struct */
+
+ /* Set up new VOL callback arguments */
+ vol_cb_args.op_type = H5VL_GROUP_MOUNT;
+ vol_cb_args.args.mount.name = args->args.mount.name;
+ vol_cb_args.args.mount.child_file =
+ ((H5VL_pass_through_t *)args->args.mount.child_file)->under_object;
+ vol_cb_args.args.mount.fmpl_id = args->args.mount.fmpl_id;
+
+ /* Re-issue 'group specific' call, using the unwrapped pieces */
+ ret_value = H5VLgroup_specific(o->under_object, under_vol_id, &vol_cb_args, dxpl_id, req);
+ } /* end if */
+ else
+ ret_value = H5VLgroup_specific(o->under_object, under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2101,8 +2063,7 @@ H5VL_pass_through_group_specific(void *obj, H5VL_group_specific_t specific_type,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_group_optional(void *obj, H5VL_group_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_group_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2111,7 +2072,7 @@ H5VL_pass_through_group_optional(void *obj, H5VL_group_optional_t opt_type, hid_
printf("------- PASS THROUGH VOL GROUP Optional\n");
#endif
- ret_value = H5VLgroup_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments);
+ ret_value = H5VLgroup_optional(o->under_object, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2154,33 +2115,6 @@ H5VL_pass_through_group_close(void *grp, hid_t dxpl_id, void **req)
} /* end H5VL_pass_through_group_close() */
/*-------------------------------------------------------------------------
- * Function: H5VL_pass_through_link_create_reissue
- *
- * Purpose: Re-wrap vararg arguments into a va_list and reissue the
- * link create callback to the underlying VOL connector.
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5VL_pass_through_link_create_reissue(H5VL_link_create_type_t create_type, void *obj,
- const H5VL_loc_params_t *loc_params, hid_t connector_id, hid_t lcpl_id,
- hid_t lapl_id, hid_t dxpl_id, void **req, ...)
-{
- va_list arguments;
- herr_t ret_value;
-
- va_start(arguments, req);
- ret_value = H5VLlink_create(create_type, obj, loc_params, connector_id, lcpl_id, lapl_id, dxpl_id, req,
- arguments);
- va_end(arguments);
-
- return ret_value;
-} /* end H5VL_pass_through_link_create_reissue() */
-
-/*-------------------------------------------------------------------------
* Function: H5VL_pass_through_link_create
*
* Purpose: Creates a hard / soft / UD / external link.
@@ -2191,9 +2125,8 @@ H5VL_pass_through_link_create_reissue(H5VL_link_create_type_t create_type, void
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_link_create(H5VL_link_create_type_t create_type, void *obj,
- const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id,
- hid_t dxpl_id, void **req, va_list arguments)
+H5VL_pass_through_link_create(H5VL_link_create_args_t *args, void *obj, const H5VL_loc_params_t *loc_params,
+ hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
hid_t under_vol_id = -1;
@@ -2208,32 +2141,22 @@ H5VL_pass_through_link_create(H5VL_link_create_type_t create_type, void *obj,
under_vol_id = o->under_vol_id;
/* Fix up the link target object for hard link creation */
- if (H5VL_LINK_CREATE_HARD == create_type) {
- void * cur_obj;
- H5VL_loc_params_t *cur_params;
+ if (H5VL_LINK_CREATE_HARD == args->op_type) {
+ void *cur_obj = args->args.hard.curr_obj;
- /* Retrieve the object & loc params for the link target */
- cur_obj = va_arg(arguments, void *);
- cur_params = va_arg(arguments, H5VL_loc_params_t *);
-
- /* If it's a non-NULL pointer, find the 'under object' and re-set the property */
+ /* If cur_obj is a non-NULL pointer, find its 'under object' and update the pointer */
if (cur_obj) {
- /* Check if we still need the "under" VOL ID */
+ /* Check if we still haven't set the "under" VOL ID */
if (under_vol_id < 0)
under_vol_id = ((H5VL_pass_through_t *)cur_obj)->under_vol_id;
- /* Set the object for the link target */
- cur_obj = ((H5VL_pass_through_t *)cur_obj)->under_object;
+ /* Update the object for the link target */
+ args->args.hard.curr_obj = ((H5VL_pass_through_t *)cur_obj)->under_object;
} /* end if */
+ } /* end if */
- /* Re-issue 'link create' call, using the unwrapped pieces */
- ret_value = H5VL_pass_through_link_create_reissue(create_type, (o ? o->under_object : NULL),
- loc_params, under_vol_id, lcpl_id, lapl_id, dxpl_id,
- req, cur_obj, cur_params);
- } /* end if */
- else
- ret_value = H5VLlink_create(create_type, (o ? o->under_object : NULL), loc_params, under_vol_id,
- lcpl_id, lapl_id, dxpl_id, req, arguments);
+ ret_value = H5VLlink_create(args, (o ? o->under_object : NULL), loc_params, under_vol_id, lcpl_id,
+ lapl_id, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2347,8 +2270,8 @@ H5VL_pass_through_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_t get_type,
- hid_t dxpl_id, void **req, va_list arguments)
+H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_get_args_t *args,
+ hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2357,7 +2280,7 @@ H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_
printf("------- PASS THROUGH VOL LINK Get\n");
#endif
- ret_value = H5VLlink_get(o->under_object, loc_params, o->under_vol_id, get_type, dxpl_id, req, arguments);
+ ret_value = H5VLlink_get(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2378,8 +2301,7 @@ H5VL_pass_through_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_
*/
static herr_t
H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments)
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2388,8 +2310,7 @@ H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params,
printf("------- PASS THROUGH VOL LINK Specific\n");
#endif
- ret_value = H5VLlink_specific(o->under_object, loc_params, o->under_vol_id, specific_type, dxpl_id, req,
- arguments);
+ ret_value = H5VLlink_specific(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2409,8 +2330,8 @@ H5VL_pass_through_link_specific(void *obj, const H5VL_loc_params_t *loc_params,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_link_optional(void *obj, H5VL_link_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_link_optional(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2419,7 +2340,7 @@ H5VL_pass_through_link_optional(void *obj, H5VL_link_optional_t opt_type, hid_t
printf("------- PASS THROUGH VOL LINK Optional\n");
#endif
- ret_value = H5VLlink_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments);
+ ret_value = H5VLlink_optional(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2509,8 +2430,8 @@ H5VL_pass_through_object_copy(void *src_obj, const H5VL_loc_params_t *src_loc_pa
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_t get_type,
- hid_t dxpl_id, void **req, va_list arguments)
+H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_object_get_args_t *args,
+ hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2519,8 +2440,7 @@ H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5V
printf("------- PASS THROUGH VOL OBJECT Get\n");
#endif
- ret_value =
- H5VLobject_get(o->under_object, loc_params, o->under_vol_id, get_type, dxpl_id, req, arguments);
+ ret_value = H5VLobject_get(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2541,8 +2461,7 @@ H5VL_pass_through_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5V
*/
static herr_t
H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req,
- va_list arguments)
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
hid_t under_vol_id;
@@ -2552,12 +2471,12 @@ H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params
printf("------- PASS THROUGH VOL OBJECT Specific\n");
#endif
- // Save copy of underlying VOL connector ID and prov helper, in case of
- // refresh destroying the current object
+ /* Save copy of underlying VOL connector ID, in case of
+ * 'refresh' operation destroying the current object
+ */
under_vol_id = o->under_vol_id;
- ret_value = H5VLobject_specific(o->under_object, loc_params, o->under_vol_id, specific_type, dxpl_id, req,
- arguments);
+ ret_value = H5VLobject_specific(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2577,8 +2496,8 @@ H5VL_pass_through_object_specific(void *obj, const H5VL_loc_params_t *loc_params
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hid_t dxpl_id, void **req,
- va_list arguments)
+H5VL_pass_through_object_optional(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2587,7 +2506,7 @@ H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hi
printf("------- PASS THROUGH VOL OBJECT Optional\n");
#endif
- ret_value = H5VLobject_optional(o->under_object, o->under_vol_id, opt_type, dxpl_id, req, arguments);
+ ret_value = H5VLobject_optional(o->under_object, loc_params, o->under_vol_id, args, dxpl_id, req);
/* Check for async request */
if (req && *req)
@@ -2597,7 +2516,7 @@ H5VL_pass_through_object_optional(void *obj, H5VL_object_optional_t opt_type, hi
} /* end H5VL_pass_through_object_optional() */
/*-------------------------------------------------------------------------
- * Function: H5VL_pass_through_introspect_get_conn_clss
+ * Function: H5VL_pass_through_introspect_get_conn_cls
*
* Purpose: Query the connector class.
*
@@ -2627,6 +2546,36 @@ H5VL_pass_through_introspect_get_conn_cls(void *obj, H5VL_get_conn_lvl_t lvl, co
} /* end H5VL_pass_through_introspect_get_conn_cls() */
/*-------------------------------------------------------------------------
+ * Function: H5VL_pass_through_introspect_get_cap_flags
+ *
+ * Purpose: Query the capability flags for this connector and any
+ * underlying connector(s).
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_pass_through_introspect_get_cap_flags(const void *_info, unsigned *cap_flags)
+{
+ const H5VL_pass_through_info_t *info = (const H5VL_pass_through_info_t *)_info;
+ herr_t ret_value;
+
+#ifdef ENABLE_PASSTHRU_LOGGING
+ printf("------- PASS THROUGH VOL INTROSPECT GetCapFlags\n");
+#endif
+
+ /* Invoke the query on the underlying VOL connector */
+ ret_value = H5VLintrospect_get_cap_flags(info->under_vol_info, info->under_vol_id, cap_flags);
+
+ /* Bitwise OR our capability flags in */
+ if (ret_value >= 0)
+ *cap_flags |= H5VL_pass_through_g.cap_flags;
+
+ return ret_value;
+} /* end H5VL_pass_through_introspect_get_cap_flags() */
+
+/*-------------------------------------------------------------------------
* Function: H5VL_pass_through_introspect_opt_query
*
* Purpose: Query if an optional operation is supported by this connector
@@ -2743,31 +2692,6 @@ H5VL_pass_through_request_cancel(void *obj, H5VL_request_status_t *status)
} /* end H5VL_pass_through_request_cancel() */
/*-------------------------------------------------------------------------
- * Function: H5VL_pass_through_request_specific_reissue
- *
- * Purpose: Re-wrap vararg arguments into a va_list and reissue the
- * request specific callback to the underlying VOL connector.
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5VL_pass_through_request_specific_reissue(void *obj, hid_t connector_id,
- H5VL_request_specific_t specific_type, ...)
-{
- va_list arguments;
- herr_t ret_value;
-
- va_start(arguments, specific_type);
- ret_value = H5VLrequest_specific(obj, connector_id, specific_type, arguments);
- va_end(arguments);
-
- return ret_value;
-} /* end H5VL_pass_through_request_specific_reissue() */
-
-/*-------------------------------------------------------------------------
* Function: H5VL_pass_through_request_specific
*
* Purpose: Specific operation on a request
@@ -2778,139 +2702,16 @@ H5VL_pass_through_request_specific_reissue(void *obj, hid_t connector_id,
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_t specific_type, va_list arguments)
+H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_args_t *args)
{
- herr_t ret_value = -1;
+ H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
+ herr_t ret_value = -1;
#ifdef ENABLE_PASSTHRU_LOGGING
printf("------- PASS THROUGH VOL REQUEST Specific\n");
#endif
- if (H5VL_REQUEST_WAITANY == specific_type || H5VL_REQUEST_WAITSOME == specific_type ||
- H5VL_REQUEST_WAITALL == specific_type) {
- va_list tmp_arguments;
- size_t req_count;
-
- /* Sanity check */
- assert(obj == NULL);
-
- /* Get enough info to call the underlying connector */
- va_copy(tmp_arguments, arguments);
- req_count = va_arg(tmp_arguments, size_t);
-
- /* Can only use a request to invoke the underlying VOL connector when there's >0 requests */
- if (req_count > 0) {
- void ** req_array;
- void ** under_req_array;
- uint64_t timeout;
- H5VL_pass_through_t *o;
- size_t u; /* Local index variable */
-
- /* Get the request array */
- req_array = va_arg(tmp_arguments, void **);
-
- /* Get a request to use for determining the underlying VOL connector */
- o = (H5VL_pass_through_t *)req_array[0];
-
- /* Create array of underlying VOL requests */
- under_req_array = (void **)malloc(req_count * sizeof(void **));
- for (u = 0; u < req_count; u++)
- under_req_array[u] = ((H5VL_pass_through_t *)req_array[u])->under_object;
-
- /* Remove the timeout value from the vararg list (it's used in all the calls below) */
- timeout = va_arg(tmp_arguments, uint64_t);
-
- /* Release requests that have completed */
- if (H5VL_REQUEST_WAITANY == specific_type) {
- size_t * idx; /* Pointer to the index of completed request */
- H5VL_request_status_t *status; /* Pointer to the request's status */
-
- /* Retrieve the remaining arguments */
- idx = va_arg(tmp_arguments, size_t *);
- assert(*idx <= req_count);
- status = va_arg(tmp_arguments, H5VL_request_status_t *);
-
- /* Reissue the WAITANY 'request specific' call */
- ret_value = H5VL_pass_through_request_specific_reissue(o->under_object, o->under_vol_id,
- specific_type, req_count,
- under_req_array, timeout, idx, status);
-
- /* Release the completed request, if it completed */
- if (ret_value >= 0 && *status != H5ES_STATUS_IN_PROGRESS) {
- H5VL_pass_through_t *tmp_o;
-
- tmp_o = (H5VL_pass_through_t *)req_array[*idx];
- H5VL_pass_through_free_obj(tmp_o);
- } /* end if */
- } /* end if */
- else if (H5VL_REQUEST_WAITSOME == specific_type) {
- size_t * outcount; /* # of completed requests */
- unsigned * array_of_indices; /* Array of indices for completed requests */
- H5VL_request_status_t *array_of_statuses; /* Array of statuses for completed requests */
-
- /* Retrieve the remaining arguments */
- outcount = va_arg(tmp_arguments, size_t *);
- assert(*outcount <= req_count);
- array_of_indices = va_arg(tmp_arguments, unsigned *);
- array_of_statuses = va_arg(tmp_arguments, H5VL_request_status_t *);
-
- /* Reissue the WAITSOME 'request specific' call */
- ret_value = H5VL_pass_through_request_specific_reissue(
- o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout,
- outcount, array_of_indices, array_of_statuses);
-
- /* If any requests completed, release them */
- if (ret_value >= 0 && *outcount > 0) {
- unsigned *idx_array; /* Array of indices of completed requests */
-
- /* Retrieve the array of completed request indices */
- idx_array = va_arg(tmp_arguments, unsigned *);
-
- /* Release the completed requests */
- for (u = 0; u < *outcount; u++) {
- H5VL_pass_through_t *tmp_o;
-
- tmp_o = (H5VL_pass_through_t *)req_array[idx_array[u]];
- H5VL_pass_through_free_obj(tmp_o);
- } /* end for */
- } /* end if */
- } /* end else-if */
- else { /* H5VL_REQUEST_WAITALL == specific_type */
- H5VL_request_status_t *array_of_statuses; /* Array of statuses for completed requests */
-
- /* Retrieve the remaining arguments */
- array_of_statuses = va_arg(tmp_arguments, H5VL_request_status_t *);
-
- /* Reissue the WAITALL 'request specific' call */
- ret_value = H5VL_pass_through_request_specific_reissue(
- o->under_object, o->under_vol_id, specific_type, req_count, under_req_array, timeout,
- array_of_statuses);
-
- /* Release the completed requests */
- if (ret_value >= 0) {
- for (u = 0; u < req_count; u++) {
- if (array_of_statuses[u] != H5ES_STATUS_IN_PROGRESS) {
- H5VL_pass_through_t *tmp_o;
-
- tmp_o = (H5VL_pass_through_t *)req_array[u];
- H5VL_pass_through_free_obj(tmp_o);
- } /* end if */
- } /* end for */
- } /* end if */
- } /* end else */
-
- /* Release array of requests for underlying connector */
- free(under_req_array);
- } /* end if */
-
- /* Finish use of copied vararg list */
- va_end(tmp_arguments);
- } /* end if */
- else {
- H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
-
- ret_value = H5VLrequest_specific(o->under_object, o->under_vol_id, specific_type, arguments);
- } /* end else */
+ ret_value = H5VLrequest_specific(o->under_object, o->under_vol_id, args);
return ret_value;
} /* end H5VL_pass_through_request_specific() */
@@ -2926,7 +2727,7 @@ H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_t specific_t
*-------------------------------------------------------------------------
*/
static herr_t
-H5VL_pass_through_request_optional(void *obj, H5VL_request_optional_t opt_type, va_list arguments)
+H5VL_pass_through_request_optional(void *obj, H5VL_optional_args_t *args)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -2935,7 +2736,7 @@ H5VL_pass_through_request_optional(void *obj, H5VL_request_optional_t opt_type,
printf("------- PASS THROUGH VOL REQUEST Optional\n");
#endif
- ret_value = H5VLrequest_optional(o->under_object, o->under_vol_id, opt_type, arguments);
+ ret_value = H5VLrequest_optional(o->under_object, o->under_vol_id, args);
return ret_value;
} /* end H5VL_pass_through_request_optional() */
@@ -3027,8 +2828,7 @@ H5VL_pass_through_blob_get(void *obj, const void *blob_id, void *buf, size_t siz
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t specific_type,
- va_list arguments)
+H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t *args)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -3037,7 +2837,7 @@ H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t s
printf("------- PASS THROUGH VOL BLOB Specific\n");
#endif
- ret_value = H5VLblob_specific(o->under_object, o->under_vol_id, blob_id, specific_type, arguments);
+ ret_value = H5VLblob_specific(o->under_object, o->under_vol_id, blob_id, args);
return ret_value;
} /* end H5VL_pass_through_blob_specific() */
@@ -3052,7 +2852,7 @@ H5VL_pass_through_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_t s
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_blob_optional_t opt_type, va_list arguments)
+H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_optional_args_t *args)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -3061,7 +2861,7 @@ H5VL_pass_through_blob_optional(void *obj, void *blob_id, H5VL_blob_optional_t o
printf("------- PASS THROUGH VOL BLOB Optional\n");
#endif
- ret_value = H5VLblob_optional(o->under_object, o->under_vol_id, blob_id, opt_type, arguments);
+ ret_value = H5VLblob_optional(o->under_object, o->under_vol_id, blob_id, args);
return ret_value;
} /* end H5VL_pass_through_blob_optional() */
@@ -3168,7 +2968,7 @@ H5VL_pass_through_token_from_str(void *obj, H5I_type_t obj_type, const char *tok
*-------------------------------------------------------------------------
*/
herr_t
-H5VL_pass_through_optional(void *obj, int op_type, hid_t dxpl_id, void **req, va_list arguments)
+H5VL_pass_through_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req)
{
H5VL_pass_through_t *o = (H5VL_pass_through_t *)obj;
herr_t ret_value;
@@ -3177,7 +2977,7 @@ H5VL_pass_through_optional(void *obj, int op_type, hid_t dxpl_id, void **req, va
printf("------- PASS THROUGH VOL generic Optional\n");
#endif
- ret_value = H5VLoptional(o->under_object, o->under_vol_id, op_type, dxpl_id, req, arguments);
+ ret_value = H5VLoptional(o->under_object, o->under_vol_id, args, dxpl_id, req);
return ret_value;
} /* end H5VL_pass_through_optional() */
diff --git a/src/H5VLpkg.h b/src/H5VLpkg.h
index 7b8a877..5a4ccc1 100644
--- a/src/H5VLpkg.h
+++ b/src/H5VLpkg.h
@@ -43,6 +43,7 @@
/******************************/
/* Package Private Prototypes */
/******************************/
+H5_DLL herr_t H5VL__set_def_conn(void);
H5_DLL hid_t H5VL__register_connector(const void *cls, hbool_t app_ref, hid_t vipl_id);
H5_DLL hid_t H5VL__register_connector_by_class(const H5VL_class_t *cls, hbool_t app_ref, hid_t vipl_id);
H5_DLL hid_t H5VL__register_connector_by_name(const char *name, hbool_t app_ref, hid_t vipl_id);
@@ -56,5 +57,16 @@ H5_DLL hid_t H5VL__peek_connector_id_by_name(const char *name);
H5_DLL hid_t H5VL__peek_connector_id_by_value(H5VL_class_value_t value);
H5_DLL herr_t H5VL__connector_str_to_info(const char *str, hid_t connector_id, void **info);
H5_DLL ssize_t H5VL__get_connector_name(hid_t id, char *name /*out*/, size_t size);
+H5_DLL void H5VL__is_default_conn(hid_t fapl_id, hid_t connector_id, hbool_t *is_default);
+H5_DLL herr_t H5VL__register_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
+H5_DLL size_t H5VL__num_opt_operation(void);
+H5_DLL herr_t H5VL__find_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_val);
+H5_DLL herr_t H5VL__unregister_opt_operation(H5VL_subclass_t subcls, const char *op_name);
+H5_DLL herr_t H5VL__term_opt_operation(void);
+
+/* Testing functions */
+#ifdef H5VL_TESTING
+H5_DLL herr_t H5VL__reparse_def_vol_conn_variable_test(void);
+#endif /* H5VL_TESTING */
#endif /* H5VLpkg_H */
diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h
index 34fb13d..f929d03 100644
--- a/src/H5VLprivate.h
+++ b/src/H5VLprivate.h
@@ -16,6 +16,11 @@
/* Include package's public header */
#include "H5VLpublic.h" /* Generic Functions */
+/* Include connector author public header(s) */
+#include "H5VLconnector.h" /* VOL connector author routines */
+#include "H5VLconnector_passthru.h" /* Pass-through VOL connector author routines */
+#include "H5VLnative.h" /* Native VOL connector macros, for VOL connector authors */
+
/* Private headers needed by this file */
/**************************/
@@ -61,13 +66,15 @@ typedef enum H5VL_get_connector_kind_t {
/******************************/
/* Utility functions */
-H5_DLL herr_t H5VL_init_phase1(void);
-H5_DLL herr_t H5VL_init_phase2(void);
+H5_DLL herr_t H5VL_init_phase1(void);
+H5_DLL herr_t H5VL_init_phase2(void);
+H5_DLL H5VL_t *H5VL_new_connector(hid_t connector_id);
H5_DLL herr_t H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_class_t *cls2);
H5_DLL herr_t H5VL_conn_copy(H5VL_connector_prop_t *value);
H5_DLL int64_t H5VL_conn_inc_rc(H5VL_t *connector);
H5_DLL int64_t H5VL_conn_dec_rc(H5VL_t *connector);
H5_DLL herr_t H5VL_conn_free(const H5VL_connector_prop_t *info);
+H5_DLL herr_t H5VL_get_cap_flags(const H5VL_connector_prop_t *prop, unsigned *cap_flags);
/* Functions that deal with VOL connectors */
union H5PL_key_t;
@@ -109,8 +116,9 @@ H5_DLL herr_t H5VL_reset_vol_wrapper(void);
/* Library state functions */
H5_DLL herr_t H5VL_retrieve_lib_state(void **state);
+H5_DLL herr_t H5VL_start_lib_state(void);
H5_DLL herr_t H5VL_restore_lib_state(const void *state);
-H5_DLL herr_t H5VL_reset_lib_state(void);
+H5_DLL herr_t H5VL_finish_lib_state(void);
H5_DLL herr_t H5VL_free_lib_state(void *state);
/* ID registration functions */
@@ -127,12 +135,11 @@ H5_DLL herr_t H5VL_setup_loc_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_lo
H5_DLL herr_t H5VL_setup_acc_args(hid_t loc_id, const struct H5P_libclass_t *libclass, hbool_t is_collective,
hid_t *acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
H5_DLL herr_t H5VL_setup_self_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
-H5_DLL herr_t H5VL_setup_name_args(hid_t loc_id, const char *name, const struct H5P_libclass_t *libclass,
- hbool_t is_collective, hid_t acspl_id, H5VL_object_t **vol_obj,
- H5VL_loc_params_t *loc_params);
+H5_DLL herr_t H5VL_setup_name_args(hid_t loc_id, const char *name, hbool_t is_collective, hid_t lapl_id,
+ H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
H5_DLL herr_t H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n, const struct H5P_libclass_t *libclass, hbool_t is_collective,
- hid_t acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
+ hsize_t n, hbool_t is_collective, hid_t lapl_id, H5VL_object_t **vol_obj,
+ H5VL_loc_params_t *loc_params);
H5_DLL herr_t H5VL_setup_token_args(hid_t loc_id, H5O_token_t *obj_token, H5VL_object_t **vol_obj,
H5VL_loc_params_t *loc_params);
@@ -156,12 +163,12 @@ H5_DLL herr_t H5VL_attr_read(const H5VL_object_t *vol_obj, hid_t dtype_id, void
void **req);
H5_DLL herr_t H5VL_attr_write(const H5VL_object_t *vol_obj, hid_t dtype_id, const void *buf, hid_t dxpl_id,
void **req);
-H5_DLL herr_t H5VL_attr_get(const H5VL_object_t *vol_obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req,
- ...);
+H5_DLL herr_t H5VL_attr_get(const H5VL_object_t *vol_obj, H5VL_attr_get_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VL_attr_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, ...);
-H5_DLL herr_t H5VL_attr_optional(const H5VL_object_t *vol_obj, H5VL_attr_optional_t opt_type, hid_t dxpl_id,
- void **req, ...);
+ H5VL_attr_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL_attr_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VL_attr_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req);
/* Dataset functions */
@@ -174,12 +181,12 @@ H5_DLL herr_t H5VL_dataset_read(const H5VL_object_t *vol_obj, hid_t mem_type_id,
hid_t file_space_id, hid_t dxpl_id, void *buf, void **req);
H5_DLL herr_t H5VL_dataset_write(const H5VL_object_t *vol_obj, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t dxpl_id, const void *buf, void **req);
-H5_DLL herr_t H5VL_dataset_get(const H5VL_object_t *vol_obj, H5VL_dataset_get_t get_type, hid_t dxpl_id,
- void **req, ...);
-H5_DLL herr_t H5VL_dataset_specific(const H5VL_object_t *cls, H5VL_dataset_specific_t specific_type,
- hid_t dxpl_id, void **req, ...);
-H5_DLL herr_t H5VL_dataset_optional(const H5VL_object_t *vol_obj, H5VL_dataset_optional_t opt_type,
- hid_t dxpl_id, void **req, ...);
+H5_DLL herr_t H5VL_dataset_get(const H5VL_object_t *vol_obj, H5VL_dataset_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL_dataset_specific(const H5VL_object_t *cls, H5VL_dataset_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL_dataset_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VL_dataset_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req);
/* Datatype functions */
@@ -188,12 +195,14 @@ H5_DLL void * H5VL_datatype_commit(const H5VL_object_t *vol_obj, const H5VL_loc_
hid_t tapl_id, hid_t dxpl_id, void **req);
H5_DLL void * H5VL_datatype_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
const char *name, hid_t tapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VL_datatype_get(const H5VL_object_t *vol_obj, H5VL_datatype_get_t get_type, hid_t dxpl_id,
- void **req, ...);
-H5_DLL herr_t H5VL_datatype_specific(const H5VL_object_t *vol_obj, H5VL_datatype_specific_t specific_type,
- hid_t dxpl_id, void **req, ...);
-H5_DLL herr_t H5VL_datatype_optional(const H5VL_object_t *vol_obj, H5VL_datatype_optional_t opt_type,
- hid_t dxpl_id, void **req, ...);
+H5_DLL herr_t H5VL_datatype_get(const H5VL_object_t *vol_obj, H5VL_datatype_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL_datatype_specific(const H5VL_object_t *vol_obj, H5VL_datatype_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL_datatype_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL_datatype_optional_op(H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req, H5VL_object_t **vol_obj_ptr);
H5_DLL herr_t H5VL_datatype_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req);
/* File functions */
@@ -201,12 +210,12 @@ H5_DLL void * H5VL_file_create(const H5VL_connector_prop_t *connector_prop, cons
hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, void **req);
H5_DLL void * H5VL_file_open(H5VL_connector_prop_t *connector_prop, const char *name, unsigned flags,
hid_t fapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VL_file_get(const H5VL_object_t *vol_obj, H5VL_file_get_t get_type, hid_t dxpl_id, void **req,
- ...);
-H5_DLL herr_t H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_t specific_type,
- hid_t dxpl_id, void **req, ...);
-H5_DLL herr_t H5VL_file_optional(const H5VL_object_t *vol_obj, H5VL_file_optional_t opt_type, hid_t dxpl_id,
- void **req, ...);
+H5_DLL herr_t H5VL_file_get(const H5VL_object_t *vol_obj, H5VL_file_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL_file_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VL_file_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req);
/* Group functions */
@@ -215,18 +224,18 @@ H5_DLL void * H5VL_group_create(const H5VL_object_t *vol_obj, const H5VL_loc_par
void **req);
H5_DLL void * H5VL_group_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
const char *name, hid_t gapl_id, hid_t dxpl_id, void **req);
-H5_DLL herr_t H5VL_group_get(const H5VL_object_t *vol_obj, H5VL_group_get_t get_type, hid_t dxpl_id,
- void **req, ...);
-H5_DLL herr_t H5VL_group_specific(const H5VL_object_t *vol_obj, H5VL_group_specific_t specific_type,
- hid_t dxpl_id, void **req, ...);
-H5_DLL herr_t H5VL_group_optional(const H5VL_object_t *vol_obj, H5VL_group_optional_t opt_type, hid_t dxpl_id,
- void **req, ...);
+H5_DLL herr_t H5VL_group_get(const H5VL_object_t *vol_obj, H5VL_group_get_args_t *args, hid_t dxpl_id,
+ void **req);
+H5_DLL herr_t H5VL_group_specific(const H5VL_object_t *vol_obj, H5VL_group_specific_args_t *args,
+ hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL_group_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
H5_DLL herr_t H5VL_group_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req);
/* Link functions */
-H5_DLL herr_t H5VL_link_create(H5VL_link_create_type_t create_type, const H5VL_object_t *vol_obj,
+H5_DLL herr_t H5VL_link_create(H5VL_link_create_args_t *args, const H5VL_object_t *vol_obj,
const H5VL_loc_params_t *loc_params, hid_t lcpl_id, hid_t lapl_id,
- hid_t dxpl_id, void **req, ...);
+ hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_link_copy(const H5VL_object_t *src_vol_obj, const H5VL_loc_params_t *loc_params1,
const H5VL_object_t *dst_vol_obj, const H5VL_loc_params_t *loc_params2,
hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
@@ -234,11 +243,11 @@ H5_DLL herr_t H5VL_link_move(const H5VL_object_t *src_vol_obj, const H5VL_loc_pa
const H5VL_object_t *dst_vol_obj, const H5VL_loc_params_t *loc_params2,
hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_link_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_link_get_t get_type, hid_t dxpl_id, void **req, ...);
+ H5VL_link_get_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_link_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, ...);
-H5_DLL herr_t H5VL_link_optional(const H5VL_object_t *vol_obj, H5VL_link_optional_t opt_type, hid_t dxpl_id,
- void **req, ...);
+ H5VL_link_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL_link_optional(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/* Object functions */
H5_DLL void * H5VL_object_open(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *params,
@@ -248,15 +257,16 @@ H5_DLL herr_t H5VL_object_copy(const H5VL_object_t *src_obj, const H5VL_loc_para
const H5VL_loc_params_t *dst_loc_params, const char *dst_name, hid_t ocpypl_id,
hid_t lcpl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_object_get(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_get_t get_type, hid_t dxpl_id, void **req, ...);
+ H5VL_object_get_args_t *args, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_object_specific(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
- H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, ...);
-H5_DLL herr_t H5VL_object_optional(const H5VL_object_t *vol_obj, H5VL_object_optional_t opt_type,
- hid_t dxpl_id, void **req, ...);
+ H5VL_object_specific_args_t *args, hid_t dxpl_id, void **req);
+H5_DLL herr_t H5VL_object_optional(const H5VL_object_t *vol_obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
/* Connector/container introspection functions */
H5_DLL herr_t H5VL_introspect_get_conn_cls(const H5VL_object_t *vol_obj, H5VL_get_conn_lvl_t lvl,
const H5VL_class_t **conn_cls);
+H5_DLL herr_t H5VL_introspect_get_cap_flags(const void *info, const H5VL_class_t *cls, unsigned *cap_flags);
H5_DLL herr_t H5VL_introspect_opt_query(const H5VL_object_t *vol_obj, H5VL_subclass_t subcls, int opt_type,
uint64_t *flags);
@@ -265,8 +275,8 @@ H5_DLL herr_t H5VL_request_wait(const H5VL_object_t *vol_obj, uint64_t timeout,
H5VL_request_status_t *status);
H5_DLL herr_t H5VL_request_notify(const H5VL_object_t *vol_obj, H5VL_request_notify_t cb, void *ctx);
H5_DLL herr_t H5VL_request_cancel(const H5VL_object_t *vol_obj, H5VL_request_status_t *status);
-H5_DLL herr_t H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_t specific_type, ...);
-H5_DLL herr_t H5VL_request_optional(const H5VL_object_t *vol_obj, H5VL_request_optional_t opt_type, ...);
+H5_DLL herr_t H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_args_t *args);
+H5_DLL herr_t H5VL_request_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args);
H5_DLL herr_t H5VL_request_free(const H5VL_object_t *vol_obj);
/* Blob functions */
@@ -275,9 +285,8 @@ H5_DLL herr_t H5VL_blob_put(const H5VL_object_t *vol_obj, const void *buf, size_
H5_DLL herr_t H5VL_blob_get(const H5VL_object_t *vol_obj, const void *blob_id, void *buf, size_t size,
void *ctx);
H5_DLL herr_t H5VL_blob_specific(const H5VL_object_t *vol_obj, void *blob_id,
- H5VL_blob_specific_t specific_type, ...);
-H5_DLL herr_t H5VL_blob_optional(const H5VL_object_t *vol_obj, void *blob_id, H5VL_blob_optional_t opt_type,
- ...);
+ H5VL_blob_specific_args_t *args);
+H5_DLL herr_t H5VL_blob_optional(const H5VL_object_t *vol_obj, void *blob_id, H5VL_optional_args_t *args);
/* Token functions */
H5_DLL herr_t H5VL_token_cmp(const H5VL_object_t *vol_obj, const H5O_token_t *token1,
@@ -288,6 +297,7 @@ H5_DLL herr_t H5VL_token_from_str(const H5VL_object_t *vol_obj, H5I_type_t obj_t
H5O_token_t *token);
/* Generic functions */
-H5_DLL herr_t H5VL_optional(const H5VL_object_t *vol_obj, int op_type, hid_t dxpl_id, void **req, ...);
+H5_DLL herr_t H5VL_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hid_t dxpl_id,
+ void **req);
#endif /* H5VLprivate_H */
diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h
index ce50653..78e39e3 100644
--- a/src/H5VLpublic.h
+++ b/src/H5VLpublic.h
@@ -93,9 +93,9 @@
* connectors. Subsequent values should be obtained from the HDF5
* development team at mailto:help@hdfgroup.org.
*/
-//! [H5VL_class_value_t_snip]
+//! <!-- [H5VL_class_value_t_snip] -->
typedef int H5VL_class_value_t;
-//! [H5VL_class_value_t_snip]
+//! <!-- [H5VL_class_value_t_snip] -->
/**
* \ingroup H5VLDEF
@@ -116,6 +116,9 @@ typedef enum H5VL_subclass_t {
H5VL_SUBCLS_REQUEST, /**< 'Request' subclass */
H5VL_SUBCLS_BLOB, /**< 'Blob' subclass */
H5VL_SUBCLS_TOKEN /**< 'Token' subclass */
+ /* NOTE: if more operations are added, the
+ * H5VL_opt_vals_g[] array size should be updated.
+ */
} H5VL_subclass_t;
/********************/
@@ -153,11 +156,10 @@ extern "C" {
* uncommon, as most VOL-specific properties are added to the file
* access property list via the connector's API calls which set the
* VOL connector for the file open/create. For more information, see
- * the VOL documentation.
- *
- * \todo Fix the reference to VOL documentation.
+ * \ref_vol_doc.
*
* \since 1.12.0
+ *
*/
H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id);
/**
@@ -192,11 +194,10 @@ H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vi
* uncommon, as most VOL-specific properties are added to the file
* access property list via the connector's API calls which set the
* VOL connector for the file open/create. For more information, see
- * the VOL documentation.
- *
- * \todo Fix the reference to VOL documentation.
+ * the \ref_vol_doc.
*
* \since 1.12.0
+ *
*/
H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id);
/**
@@ -360,9 +361,4 @@ H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_t
}
#endif
-/* Semi-public headers mainly for VOL connector authors */
-#include "H5VLconnector.h" /* VOL connector author routines */
-#include "H5VLconnector_passthru.h" /* Pass-through VOL connector author routines */
-#include "H5VLnative.h" /* Native VOL connector macros, for VOL connector authors */
-
#endif /* H5VLpublic_H */
diff --git a/src/H5VLtest.c b/src/H5VLtest.c
new file mode 100644
index 0000000..1f99ce5
--- /dev/null
+++ b/src/H5VLtest.c
@@ -0,0 +1,96 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*-------------------------------------------------------------------------
+ *
+ * Created: H5VLtest.c
+ * Jan 3 2021
+ * Quincey Koziol
+ *
+ * Purpose: Virtual Object Layer (VOL) testing routines.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#include "H5VLmodule.h" /* This source code file is part of the H5VL module */
+#define H5VL_TESTING /* Suppress warning about H5VL testing funcs */
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5VLpkg.h" /* Virtual Object Layer */
+
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Package Typedefs */
+/********************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL__reparse_def_vol_conn_variable_test
+ *
+ * Purpose: Re-parse the default VOL connector environment variable.
+ *
+ * Since getenv(3) is fairly expensive, we only parse it once,
+ * when the library opens. This test function is used to
+ * re-parse the environment variable after we've changed it
+ * with setenv(3).
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Feb 3, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL__reparse_def_vol_conn_variable_test(void)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_PACKAGE
+
+ /* Re-check for the HDF5_VOL_CONNECTOR environment variable */
+ if (H5VL__set_def_conn() < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to initialize default VOL connector")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL__reparse_def_vol_conn_variable_test() */
diff --git a/src/H5VM.c b/src/H5VM.c
index 49cad20..4d65d75 100644
--- a/src/H5VM.c
+++ b/src/H5VM.c
@@ -43,20 +43,20 @@ static void H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n
#endif /* LATER */
/*-------------------------------------------------------------------------
- * Function: H5VM__stride_optimize1
+ * Function: H5VM__stride_optimize1
*
- * Purpose: Given a stride vector which references elements of the
- * specified size, optimize the dimensionality, the stride
- * vector, and the element size to minimize the dimensionality
- * and the number of memory accesses.
+ * Purpose: Given a stride vector which references elements of the
+ * specified size, optimize the dimensionality, the stride
+ * vector, and the element size to minimize the dimensionality
+ * and the number of memory accesses.
*
- * All arguments are passed by reference and their values may be
- * modified by this function.
+ * All arguments are passed by reference and their values may be
+ * modified by this function.
*
- * Return: None
+ * Return: void
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -66,15 +66,12 @@ H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
{
FUNC_ENTER_STATIC_NOERR
- /*
- * This has to be true because if we optimize the dimensionality down to
+ /* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
HDassert(1 == H5VM_vector_reduce_product(0, NULL));
- /*
- * Combine adjacent memory accesses
- */
+ /* Combine adjacent memory accesses */
while (*np && stride1[*np - 1] > 0 && (hsize_t)(stride1[*np - 1]) == *elmt_size) {
*elmt_size *= size[*np - 1];
if (--*np)
@@ -85,20 +82,20 @@ H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
}
/*-------------------------------------------------------------------------
- * Function: H5VM__stride_optimize2
+ * Function: H5VM__stride_optimize2
*
- * Purpose: Given two stride vectors which reference elements of the
- * specified size, optimize the dimensionality, the stride
- * vectors, and the element size to minimize the dimensionality
- * and the number of memory accesses.
+ * Purpose: Given two stride vectors which reference elements of the
+ * specified size, optimize the dimensionality, the stride
+ * vectors, and the element size to minimize the dimensionality
+ * and the number of memory accesses.
*
- * All arguments are passed by reference and their values may be
- * modified by this function.
+ * All arguments are passed by reference and their values may be
+ * modified by this function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -108,16 +105,13 @@ H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
{
FUNC_ENTER_STATIC_NOERR
- /*
- * This has to be true because if we optimize the dimensionality down to
+ /* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
HDassert(1 == H5VM_vector_reduce_product(0, NULL));
HDassert(*elmt_size > 0);
- /*
- * Combine adjacent memory accesses
- */
+ /* Combine adjacent memory accesses */
/* Unroll loop for common cases */
switch (*np) {
@@ -206,29 +200,26 @@ H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
}
/*-------------------------------------------------------------------------
- * Function: H5VM_hyper_stride
- *
- * Purpose: Given a description of a hyperslab, this function returns
- * (through STRIDE[]) the byte strides appropriate for accessing
- * all bytes of the hyperslab and the byte offset where the
- * striding will begin. The SIZE can be passed to the various
- * stride functions.
+ * Function: H5VM_hyper_stride
*
- * The dimensionality of the whole array, the hyperslab, and the
- * returned stride array is N. The whole array dimensions are
- * TOTAL_SIZE and the hyperslab is at offset OFFSET and has
- * dimensions SIZE.
+ * Purpose: Given a description of a hyperslab, this function returns
+ * (through STRIDE[]) the byte strides appropriate for accessing
+ * all bytes of the hyperslab and the byte offset where the
+ * striding will begin. The SIZE can be passed to the various
+ * stride functions.
*
- * The stride and starting point returned will cause the
- * hyperslab elements to be referenced in C order.
+ * The dimensionality of the whole array, the hyperslab, and the
+ * returned stride array is N. The whole array dimensions are
+ * TOTAL_SIZE and the hyperslab is at offset OFFSET and has
+ * dimensions SIZE.
*
- * Return: Success: Byte offset from beginning of array to start
- * of striding.
+ * The stride and starting point returned will cause the
+ * hyperslab elements to be referenced in C order.
*
- * Failure: abort() -- should never fail
+ * Return: Byte offset from beginning of array to start of striding.
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -308,23 +299,22 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, co
}
/*-------------------------------------------------------------------------
- * Function: H5VM_hyper_eq
+ * Function: H5VM_hyper_eq
*
- * Purpose: Determines whether two hyperslabs are equal. This function
- * assumes that both hyperslabs are relative to the same array,
- * for if not, they could not possibly be equal.
+ * Purpose: Determines whether two hyperslabs are equal. This function
+ * assumes that both hyperslabs are relative to the same array,
+ * for if not, they could not possibly be equal.
*
- * Return: Success: TRUE if the hyperslabs are equal (that is,
- * both refer to exactly the same elements of an
- * array)
+ * Return: TRUE if the hyperslabs are equal (that is,
+ * both refer to exactly the same elements of an
+ * array)
*
- * FALSE otherwise.
+ * FALSE otherwise
*
- * Failure: TRUE the rank is zero or if both hyperslabs
- * are of zero size.
+ * Never returns FAIL
*
- * Programmer: Robb Matzke
- * Friday, October 17, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 17, 1997
*
*-------------------------------------------------------------------------
*/
@@ -360,19 +350,19 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VM_hyper_fill
*
- * Purpose: Similar to memset() except it operates on hyperslabs...
+ * Purpose: Similar to memset() except it operates on hyperslabs...
*
- * Fills a hyperslab of array BUF with some value VAL. BUF
- * is treated like a C-order array with N dimensions where the
- * size of each dimension is TOTAL_SIZE[]. The hyperslab which
- * will be filled with VAL begins at byte offset OFFSET[] from
- * the minimum corner of BUF and continues for SIZE[] bytes in
- * each dimension.
+ * Fills a hyperslab of array BUF with some value VAL. BUF
+ * is treated like a C-order array with N dimensions where the
+ * size of each dimension is TOTAL_SIZE[]. The hyperslab which
+ * will be filled with VAL begins at byte offset OFFSET[] from
+ * the minimum corner of BUF and continues for SIZE[] bytes in
+ * each dimension.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
@@ -418,31 +408,31 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con
}
/*-------------------------------------------------------------------------
- * Function: H5VM_hyper_copy
+ * Function: H5VM_hyper_copy
*
- * Purpose: Copies a hyperslab from the source to the destination.
+ * Purpose: Copies a hyperslab from the source to the destination.
*
- * A hyperslab is a logically contiguous region of
- * multi-dimensional size SIZE of an array whose dimensionality
- * is N and whose total size is DST_TOTAL_SIZE or SRC_TOTAL_SIZE.
- * The minimum corner of the hyperslab begins at a
- * multi-dimensional offset from the minimum corner of the DST
- * (destination) or SRC (source) array. The sizes and offsets
- * are assumed to be in C order, that is, the first size/offset
- * varies the slowest while the last varies the fastest in the
- * mapping from N-dimensional space to linear space. This
- * function assumes that the array elements are single bytes (if
- * your array has multi-byte elements then add an additional
- * dimension whose size is that of your element).
+ * A hyperslab is a logically contiguous region of
+ * multi-dimensional size SIZE of an array whose dimensionality
+ * is N and whose total size is DST_TOTAL_SIZE or SRC_TOTAL_SIZE.
+ * The minimum corner of the hyperslab begins at a
+ * multi-dimensional offset from the minimum corner of the DST
+ * (destination) or SRC (source) array. The sizes and offsets
+ * are assumed to be in C order, that is, the first size/offset
+ * varies the slowest while the last varies the fastest in the
+ * mapping from N-dimensional space to linear space. This
+ * function assumes that the array elements are single bytes (if
+ * your array has multi-byte elements then add an additional
+ * dimension whose size is that of your element).
*
- * The SRC and DST array may be the same array, but the results
- * are undefined if the source hyperslab overlaps the
- * destination hyperslab.
+ * The SRC and DST array may be the same array, but the results
+ * are undefined if the source hyperslab overlaps the
+ * destination hyperslab.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
@@ -592,13 +582,13 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const
/*-------------------------------------------------------------------------
* Function: H5VM_stride_fill
*
- * Purpose: Fills all bytes of a hyperslab with the same value using
- * memset().
+ * Purpose: Fills all bytes of a hyperslab with the same value using
+ * memset().
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -643,19 +633,19 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
/*-------------------------------------------------------------------------
* Function: H5VM_stride_copy
*
- * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
- * DST and SRC while copying bytes from SRC to DST. This
- * function minimizes the number of calls to memcpy() by
- * combining various strides, but it will never touch memory
- * outside the hyperslab defined by the strides.
+ * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
+ * DST and SRC while copying bytes from SRC to DST. This
+ * function minimizes the number of calls to memcpy() by
+ * combining various strides, but it will never touch memory
+ * outside the hyperslab defined by the strides.
*
- * Note: If the src_stride is all zero and elmt_size is one, then it's
- * probably more efficient to use H5VM_stride_fill() instead.
+ * Note: If the src_stride is all zero and elmt_size is one, then it's
+ * probably more efficient to use H5VM_stride_fill() instead.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -709,19 +699,19 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
/*-------------------------------------------------------------------------
* Function: H5VM_stride_copy_s
*
- * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
- * DST and SRC while copying bytes from SRC to DST. This
- * function minimizes the number of calls to memcpy() by
- * combining various strides, but it will never touch memory
- * outside the hyperslab defined by the strides.
+ * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
+ * DST and SRC while copying bytes from SRC to DST. This
+ * function minimizes the number of calls to memcpy() by
+ * combining various strides, but it will never touch memory
+ * outside the hyperslab defined by the strides.
*
- * Note: If the src_stride is all zero and elmt_size is one, then it's
- * probably more efficient to use H5VM_stride_fill() instead.
+ * Note: If the src_stride is all zero and elmt_size is one, then it's
+ * probably more efficient to use H5VM_stride_fill() instead.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -775,17 +765,17 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss
#ifdef LATER
/*-------------------------------------------------------------------------
- * Function: H5VM__stride_copy2
+ * Function: H5VM__stride_copy2
*
- * Purpose: Similar to H5VM_stride_copy() except the source and
- * destination each have their own dimensionality and size and
- * we copy exactly NELMTS elements each of size ELMT_SIZE. The
- * size counters wrap if NELMTS is more than a size counter.
+ * Purpose: Similar to H5VM_stride_copy() except the source and
+ * destination each have their own dimensionality and size and
+ * we copy exactly NELMTS elements each of size ELMT_SIZE. The
+ * size counters wrap if NELMTS is more than a size counter.
*
- * Return: None
+ * Return: void
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -843,16 +833,16 @@ H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsiz
#endif /* LATER */
/*-------------------------------------------------------------------------
- * Function: H5VM_array_fill
+ * Function: H5VM_array_fill
*
- * Purpose: Fills all bytes of an array with the same value using
- * memset(). Increases amount copied by power of two until the
- * halfway point is crossed, then copies the rest in one swoop.
+ * Purpose: Fills all bytes of an array with the same value using
+ * memset(). Increases amount copied by power of two until the
+ * halfway point is crossed, then copies the rest in one swoop.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, June 18, 1998
+ * Programmer: Quincey Koziol
+ * Thursday, June 18, 1998
*
*-------------------------------------------------------------------------
*/
@@ -895,25 +885,25 @@ H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count)
} /* H5VM_array_fill() */
/*-------------------------------------------------------------------------
- * Function: H5VM_array_down
+ * Function: H5VM_array_down
*
- * Purpose: Given a set of dimension sizes, calculate the size of each
+ * Purpose: Given a set of dimension sizes, calculate the size of each
* "down" slice. This is the size of the dimensions for all the
* dimensions below the current one, which is used for indexing
* offsets in this dimension.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: void
*
- * Programmer: Quincey Koziol
- * Monday, April 28, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 28, 2003
*
*-------------------------------------------------------------------------
*/
-herr_t
+void
H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
{
- hsize_t acc; /*accumulator */
- int i; /*counter */
+ hsize_t acc; /* Accumulator */
+ int i; /* Counter */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -921,31 +911,31 @@ H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
HDassert(total_size);
HDassert(down);
- /* Build the sizes of each dimension in the array */
- /* (From fastest to slowest) */
+ /* Build the sizes of each dimension in the array
+ * (From fastest to slowest)
+ */
for (i = (int)(n - 1), acc = 1; i >= 0; i--) {
down[i] = acc;
acc *= total_size[i];
- } /* end for */
+ }
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI_VOID
} /* end H5VM_array_down() */
/*-------------------------------------------------------------------------
* Function: H5VM_array_offset_pre
*
- * Purpose: Given a coordinate description of a location in an array, this
- * function returns the byte offset of the coordinate.
+ * Purpose: Given a coordinate description of a location in an array, this
+ * function returns the byte offset of the coordinate.
*
- * The dimensionality of the whole array, and the offset is N.
+ * The dimensionality of the whole array, and the offset is N.
* The whole array dimensions are TOTAL_SIZE and the coordinate
* is at offset OFFSET.
*
- * Return: Success: Byte offset from beginning of array to element offset
- * Failure: abort() -- should never fail
+ * Return: Byte offset from beginning of array to element offset
*
* Programmer: Quincey Koziol
- * Tuesday, June 22, 1999
+ * Tuesday, June 22, 1999
*
*-------------------------------------------------------------------------
*/
@@ -971,18 +961,17 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
/*-------------------------------------------------------------------------
* Function: H5VM_array_offset
*
- * Purpose: Given a coordinate description of a location in an array, this
- * function returns the byte offset of the coordinate.
+ * Purpose: Given a coordinate description of a location in an array,
+ * this function returns the byte offset of the coordinate.
*
- * The dimensionality of the whole array, and the offset is N.
+ * The dimensionality of the whole array, and the offset is N.
* The whole array dimensions are TOTAL_SIZE and the coordinate
* is at offset OFFSET.
*
- * Return: Success: Byte offset from beginning of array to element offset
- * Failure: abort() -- should never fail
+ * Return: Byte offset from beginning of array to element offset
*
* Programmer: Quincey Koziol
- * Tuesday, June 22, 1999
+ * Tuesday, June 22, 1999
*
*-------------------------------------------------------------------------
*/
@@ -992,38 +981,36 @@ H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset)
hsize_t acc_arr[H5VM_HYPER_NDIMS]; /* Accumulated size of down dimensions */
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */
+ FUNC_ENTER_NOAPI_NOERR
HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(total_size);
HDassert(offset);
/* Build the sizes of each dimension in the array */
- if (H5VM_array_down(n, total_size, acc_arr) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes")
+ H5VM_array_down(n, total_size, acc_arr);
/* Set return value */
ret_value = H5VM_array_offset_pre(n, acc_arr, offset);
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VM_array_offset() */
/*-------------------------------------------------------------------------
* Function: H5VM_array_calc_pre
*
- * Purpose: Given a linear offset in an array, the dimensions of that
+ * Purpose: Given a linear offset in an array, the dimensions of that
* array and the pre-computed 'down' (accumulator) sizes, this
* function computes the coordinates of that offset in the array.
*
- * The dimensionality of the whole array, and the coordinates is N.
+ * The dimensionality of the whole array, and the coordinates is N.
* The array dimensions are TOTAL_SIZE and the coordinates
* are returned in COORD. The linear offset is in OFFSET.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, July 16, 2009
+ * Programmer: Quincey Koziol
+ * Thursday, July 16, 2009
*
*-------------------------------------------------------------------------
*/
@@ -1050,18 +1037,18 @@ H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *co
/*-------------------------------------------------------------------------
* Function: H5VM_array_calc
*
- * Purpose: Given a linear offset in an array and the dimensions of that
+ * Purpose: Given a linear offset in an array and the dimensions of that
* array, this function computes the coordinates of that offset
* in the array.
*
- * The dimensionality of the whole array, and the coordinates is N.
+ * The dimensionality of the whole array, and the coordinates is N.
* The array dimensions are TOTAL_SIZE and the coordinates
* are returned in COORD. The linear offset is in OFFSET.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Wednesday, April 16, 2003
+ * Programmer: Quincey Koziol
+ * Wednesday, April 16, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1079,8 +1066,7 @@ H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *
HDassert(coords);
/* Build the sizes of each dimension in the array */
- if (H5VM_array_down(n, total_size, idx) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute down sizes")
+ H5VM_array_down(n, total_size, idx);
/* Compute the coordinates from the offset */
if (H5VM_array_calc_pre(offset, n, idx, coords) < 0)
@@ -1093,7 +1079,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VM_chunk_index
*
- * Purpose: Given a coordinate offset (COORD), the size of each chunk
+ * Purpose: Given a coordinate offset (COORD), the size of each chunk
* (CHUNK), the number of chunks in each dimension (NCHUNKS)
* and the number of dimensions of all of these (NDIMS), calculate
* a "chunk index" for the chunk that the coordinate offset is
@@ -1123,10 +1109,10 @@ done:
* The chunk index is placed in the CHUNK_IDX location for return
* from this function
*
- * Return: Chunk index on success (can't fail)
+ * Return: Chunk index on success (can't fail)
*
- * Programmer: Quincey Koziol
- * Monday, April 21, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 21, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1151,14 +1137,14 @@ H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, co
} /* end H5VM_chunk_index() */
/*-------------------------------------------------------------------------
- * Function: H5VM_chunk_scaled
+ * Function: H5VM_chunk_scaled
*
- * Purpose: Compute the scaled coordinates for a chunk offset
+ * Purpose: Compute the scaled coordinates for a chunk offset
*
- * Return: <none>
+ * Return: void
*
- * Programmer: Quincey Koziol
- * Wednesday, November 19, 2014
+ * Programmer: Quincey Koziol
+ * Wednesday, November 19, 2014
*
*-------------------------------------------------------------------------
*/
@@ -1186,7 +1172,7 @@ H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, h
/*-------------------------------------------------------------------------
* Function: H5VM_chunk_index_scaled
*
- * Purpose: Given a coordinate offset (COORD), the size of each chunk
+ * Purpose: Given a coordinate offset (COORD), the size of each chunk
* (CHUNK), the number of chunks in each dimension (NCHUNKS)
* and the number of dimensions of all of these (NDIMS), calculate
* a "chunk index" for the chunk that the coordinate offset is
@@ -1216,13 +1202,13 @@ H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, h
* The chunk index is placed in the CHUNK_IDX location for return
* from this function
*
- * Note: This routine is identical to H5VM_chunk_index(), except for
- * caching the scaled information. Make changes in both places.
+ * Note: This routine is identical to H5VM_chunk_index(), except for
+ * caching the scaled information. Make changes in both places.
*
- * Return: Chunk index on success (can't fail)
+ * Return: Chunk index on success (can't fail)
*
- * Programmer: Vailin Choi
- * Monday, February 9, 2015
+ * Programmer: Vailin Choi
+ * Monday, February 9, 2015
*
*-------------------------------------------------------------------------
*/
@@ -1257,22 +1243,22 @@ H5VM_chunk_index_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *ch
/*-------------------------------------------------------------------------
* Function: H5VM_opvv
*
- * Purpose: Perform an operation on a source & destination sequences
- * of offset/length pairs. Each set of sequnces has an array
- * of lengths, an array of offsets, the maximum number of
- * sequences and the current sequence to start at in the sequence.
+ * Purpose: Perform an operation on a source & destination sequences
+ * of offset/length pairs. Each set of sequnces has an array
+ * of lengths, an array of offsets, the maximum number of
+ * sequences and the current sequence to start at in the sequence.
*
* There may be different numbers of bytes in the source and
* destination sequences, the operation stops when either the
* source or destination sequence runs out of information.
*
- * Note: The algorithm in this routine is [basically] the same as for
- * H5VM_memcpyvv(). Changes should be made to both!
+ * Note: The algorithm in this routine is [basically] the same as for
+ * H5VM_memcpyvv(). Changes should be made to both!
*
- * Return: Non-negative # of bytes operated on, on success/Negative on failure
+ * Return: Non-negative # of bytes operated on, on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, September 30, 2010
+ * Programmer: Quincey Koziol
+ * Thursday, September 30, 2010
*
*-------------------------------------------------------------------------
*/
@@ -1460,7 +1446,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VM_memcpyvv
*
- * Purpose: Given source and destination buffers in memory (SRC & DST)
+ * Purpose: Given source and destination buffers in memory (SRC & DST)
* copy sequences of from the source buffer into the destination
* buffer. Each set of sequences has an array of lengths, an
* array of offsets, the maximum number of sequences and the
@@ -1470,13 +1456,13 @@ done:
* destination sequences, data copying stops when either the
* source or destination buffer runs out of sequence information.
*
- * Note: The algorithm in this routine is [basically] the same as for
- * H5VM_opvv(). Changes should be made to both!
+ * Note: The algorithm in this routine is [basically] the same as for
+ * H5VM_opvv(). Changes should be made to both!
*
- * Return: Non-negative # of bytes copied on success/Negative on failure
+ * Return: Non-negative # of bytes copied on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Friday, May 2, 2003
+ * Programmer: Quincey Koziol
+ * Friday, May 2, 2003
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index e24ce83..0d3bd0f 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -105,7 +105,7 @@ H5_DLL herr_t H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_
const hssize_t *dst_stride, void *_dst, const hssize_t *src_stride,
const void *_src);
H5_DLL herr_t H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count);
-H5_DLL herr_t H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down);
+H5_DLL void H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down);
H5_DLL hsize_t H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset);
H5_DLL hsize_t H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset);
H5_DLL herr_t H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *coords);
@@ -143,7 +143,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE hsize_t H5_ATTR_UNUSED
+static inline hsize_t H5_ATTR_UNUSED
H5VM_vector_reduce_product(unsigned n, const hsize_t *v)
{
hsize_t ret_value = 1;
@@ -179,7 +179,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE htri_t H5_ATTR_UNUSED
+static inline htri_t H5_ATTR_UNUSED
H5VM_vector_zerop_u(int n, const hsize_t *v)
{
htri_t ret_value = TRUE; /* Return value */
@@ -216,7 +216,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE htri_t H5_ATTR_UNUSED
+static inline htri_t H5_ATTR_UNUSED
H5VM_vector_zerop_s(int n, const hssize_t *v)
{
htri_t ret_value = TRUE; /* Return value */
@@ -255,7 +255,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE int H5_ATTR_UNUSED
+static inline int H5_ATTR_UNUSED
H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2)
{
int ret_value = 0; /* Return value */
@@ -303,7 +303,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE int H5_ATTR_UNUSED
+static inline int H5_ATTR_UNUSED
H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2)
{
int ret_value = 0; /* Return value */
@@ -346,7 +346,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE void H5_ATTR_UNUSED
+static inline void H5_ATTR_UNUSED
H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2)
{
while (n--)
@@ -390,7 +390,7 @@ static const unsigned char LogTable256[] = {
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE unsigned H5_ATTR_UNUSED
+static inline unsigned H5_ATTR_UNUSED
H5VM_log2_gen(uint64_t n)
{
unsigned r; /* r will be log2(n) */
@@ -439,7 +439,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = {0, 1, 28, 2, 29, 14,
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE H5_ATTR_PURE unsigned
+static inline H5_ATTR_PURE unsigned
H5VM_log2_of2(uint32_t n)
{
#ifndef NDEBUG
@@ -463,7 +463,7 @@ H5VM_log2_of2(uint32_t n)
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE H5_ATTR_CONST hsize_t
+static inline H5_ATTR_CONST hsize_t
H5VM_power2up(hsize_t n)
{
hsize_t ret_value = 1; /* Return value */
@@ -495,7 +495,7 @@ H5VM_power2up(hsize_t n)
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE unsigned H5_ATTR_UNUSED
+static inline unsigned H5_ATTR_UNUSED
H5VM_limit_enc_size(uint64_t limit)
{
return (H5VM_log2_gen(limit) / 8) + 1;
@@ -527,7 +527,7 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7,
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE hbool_t H5_ATTR_UNUSED
+static inline hbool_t H5_ATTR_UNUSED
H5VM_bit_get(const unsigned char *buf, size_t offset)
{
/* Test the appropriate bit in the buffer */
@@ -557,7 +557,7 @@ H5VM_bit_get(const unsigned char *buf, size_t offset)
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE void H5_ATTR_UNUSED
+static inline void H5_ATTR_UNUSED
H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val)
{
/* Set/reset the appropriate bit in the buffer */
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index d8fed41..d29d8e5 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -48,7 +48,7 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{
H5Z__filter_deflate, /* The actual filter function */
}};
-#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * (double)1.001f) + 12)
+#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * 1.001) + 12)
/*-------------------------------------------------------------------------
* Function: H5Z__filter_deflate
diff --git a/src/H5Zdevelop.h b/src/H5Zdevelop.h
new file mode 100644
index 0000000..328e221
--- /dev/null
+++ b/src/H5Zdevelop.h
@@ -0,0 +1,421 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * This file contains public declarations for the H5Z (data filter) developer
+ * support routines.
+ */
+
+#ifndef _H5Zdevelop_H
+#define _H5Zdevelop_H
+
+/* Include package's public header */
+#include "H5Zpublic.h"
+
+/*****************/
+/* Public Macros */
+/*****************/
+
+/**
+ * Current version of the H5Z_class_t struct
+ */
+#define H5Z_CLASS_T_VERS (1)
+
+/*******************/
+/* Public Typedefs */
+/*******************/
+
+/**
+ * Structure for filter callback property
+ */
+typedef struct H5Z_cb_t {
+ H5Z_filter_func_t func;
+ void * op_data;
+} H5Z_cb_t;
+
+/**
+ * \brief This callback determines if a filter can be applied to the dataset
+ * with the characteristics provided
+ *
+ * \dcpl_id
+ * \type_id
+ * \space_id
+ *
+ * \return \htri_t
+ *
+ * \details Before a dataset gets created, the \ref H5Z_can_apply_func_t
+ * callbacks for any filters used in the dataset creation property list
+ * are called with the dataset's dataset creation property list, the
+ * dataset's datatype and a dataspace describing a chunk (for chunked
+ * dataset storage).
+ *
+ * The \ref H5Z_can_apply_func_t callback must determine if the
+ * combination of the dataset creation property list setting, the
+ * datatype and the dataspace represent a valid combination to apply
+ * this filter to. For example, some cases of invalid combinations may
+ * involve the filter not operating correctly on certain datatypes (or
+ * certain datatype sizes), or certain sizes of the chunk dataspace.
+ *
+ * The \ref H5Z_can_apply_func_t callback can be the NULL pointer, in
+ * which case, the library will assume that it can apply to any
+ * combination of dataset creation property list values, datatypes and
+ * dataspaces.
+ *
+ * The \ref H5Z_can_apply_func_t callback returns positive a valid
+ * combination, zero for an invalid combination and negative for an
+ * error.
+ */
+//! <!-- [H5Z_can_apply_func_t_snip] -->
+typedef htri_t (*H5Z_can_apply_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+//! <!-- [H5Z_can_apply_func_t_snip] -->
+
+/**
+ * \brief The filter operation callback function, defining a filter's operation
+ * on data
+ *
+ * \dcpl_id
+ * \type_id
+ * \space_id
+ *
+ * \return \herr_t
+ *
+ * \details After the \ref H5Z_can_apply_func_t callbacks are checked for new
+ * datasets, the \ref H5Z_set_local_func_t callbacks for any filters
+ * used in the dataset creation property list are called. These
+ * callbacks receive the dataset's private copy of the dataset creation
+ * property list passed in to H5Dcreate() (i.e. not the actual property
+ * list passed in to H5Dcreate()) and the datatype ID passed in to
+ * H5Dcreate() (which is not copied and should not be modified) and a
+ * dataspace describing the chunk (for chunked dataset storage) (which
+ * should also not be modified).
+ *
+ * The \ref H5Z_set_local_func_t callback must set any parameters that
+ * are specific to this dataset, based on the combination of the
+ * dataset creation property list values, the datatype and the
+ * dataspace. For example, some filters perform different actions based
+ * on different datatypes (or datatype sizes) or different number of
+ * dimensions or dataspace sizes.
+ *
+ * The \ref H5Z_set_local_func_t callback can be the NULL pointer, in
+ * which case, the library will assume that there are no
+ * dataset-specific settings for this filter.
+ *
+ * The \ref H5Z_set_local_func_t callback must return non-negative on
+ * success and negative for an error.
+ */
+//! <!-- [H5Z_set_local_func_t_snip] -->
+typedef herr_t (*H5Z_set_local_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+//! <!-- [H5Z_set_local_func_t_snip] -->
+
+/**
+ * \brief The filter operation callback function, defining a filter's operation
+ * on data
+ *
+ * \param[in] flags Bit vector specifying certain general properties of the filter
+ * \param[in] cd_nelmts Number of elements in \p cd_values
+ * \param[in] cd_values Auxiliary data for the filter
+ * \param[in] nbytes The number of valid bytes in \p buf to be filtered
+ * \param[in,out] buf_size The size of \p buf
+ * \param[in,out] buf The filter buffer
+ *
+ * \return Returns the number of valid bytes of data contained in \p buf. In the
+ * case of failure, the return value is 0 (zero) and all pointer
+ * arguments are left unchanged.
+ *
+ * \details A filter gets definition flags and invocation flags (defined
+ * above), the client data array and size defined when the filter was
+ * added to the pipeline, the size in bytes of the data on which to
+ * operate, and pointers to a buffer and its allocated size.
+ *
+ * The filter should store the result in the supplied buffer if
+ * possible, otherwise it can allocate a new buffer, freeing the
+ * original. The allocated size of the new buffer should be returned
+ * through the \p buf_size pointer and the new buffer through the \p
+ * buf pointer.
+ *
+ * The return value from the filter is the number of bytes in the
+ * output buffer. If an error occurs then the function should return
+ * zero and leave all pointer arguments unchanged.
+ */
+//! <!-- [H5Z_func_t_snip] -->
+typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[],
+ size_t nbytes, size_t *buf_size, void **buf);
+//! <!-- [H5Z_func_t_snip] -->
+
+/**
+ * The filter table maps filter identification numbers to structs that
+ * contain a pointers to the filter function and timing statistics.
+ */
+//! <!-- [H5Z_class2_t_snip] -->
+typedef struct H5Z_class2_t {
+ int version; /**< Version number of the H5Z_class_t struct */
+ H5Z_filter_t id; /**< Filter ID number */
+ unsigned encoder_present; /**< Does this filter have an encoder? */
+ unsigned decoder_present; /**< Does this filter have a decoder? */
+ const char * name; /**< Comment for debugging */
+ H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */
+ H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */
+ H5Z_func_t filter; /**< The actual filter function */
+} H5Z_class2_t;
+//! <!-- [H5Z_class2_t_snip] -->
+
+/********************/
+/* Public Variables */
+/********************/
+
+/*********************/
+/* Public Prototypes */
+/*********************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \ingroup H5Z
+ *
+ * \brief Registers a new filter with the HDF5 library
+ *
+ * \param[in] cls A pointer to a buffer for the struct containing the
+ * filter-definition
+ *
+ * \return \herr_t
+ *
+ * \details H5Zregister() registers a new filter with the HDF5 library.
+ *
+ * \details Making a new filter available to an application is a two-step
+ * process. The first step is to write the three filter callback
+ * functions described below: \c can_apply, \c set_local, and \c
+ * filter. This call to H5Zregister(), registering the filter with the
+ * library, is the second step. The can_apply and set_local fields can
+ * be set to NULL if they are not required for the filter being
+ * registered.
+ *
+ * H5Zregister() accepts a single parameter, a pointer to a buffer for
+ * the \p cls data structure. That data structure must conform to one
+ * of the following definitions:
+ * \snippet this H5Z_class1_t_snip
+ * or
+ * \snippet this H5Z_class2_t_snip
+ *
+ * \c version is a library-defined value reporting the version number
+ * of the #H5Z_class_t struct. This currently must be set to
+ * #H5Z_CLASS_T_VERS.
+ *
+ * \c id is the identifier for the new filter. This is a user-defined
+ * value between #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX. These
+ * values are defined in the HDF5 source file H5Zpublic.h, but the
+ * symbols #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX should always be
+ * used instead of the literal values.
+ *
+ * \c encoder_present is a library-defined value indicating whether
+ * the filter’s encoding capability is available to the application.
+ *
+ * \c decoder_present is a library-defined value indicating whether
+ * the filter’s encoding capability is available to the application.
+ *
+ * \c name is a descriptive comment used for debugging, may contain a
+ * descriptive name for the filter, and may be the null pointer.
+ *
+ * \c can_apply, described in detail below, is a user-defined callback
+ * function which determines whether the combination of the dataset
+ * creation property list values, the datatype, and the dataspace
+ * represent a valid combination to apply this filter to.
+ *
+ * \c set_local, described in detail below, is a user-defined callback
+ * function which sets any parameters that are specific to this
+ * dataset, based on the combination of the dataset creation property
+ * list values, the datatype, and the dataspace.
+ *
+ * \c filter, described in detail below, is a user-defined callback
+ * function which performs the action of the filter.
+ *
+ * The statistics associated with a filter are not reset by this
+ * function; they accumulate over the life of the library.
+ *
+ * #H5Z_class_t is a macro which maps to either H5Z_class1_t or
+ * H5Z_class2_t, depending on the needs of the application. To affect
+ * only this macro, H5Z_class_t_vers may be defined to either 1 or 2.
+ * Otherwise, it will behave in the same manner as other API
+ * compatibility macros. See API Compatibility Macros in HDF5 for more
+ * information. H5Z_class1_t matches the #H5Z_class_t structure that is
+ * used in the 1.6.x versions of the HDF5 library.
+ *
+ * H5Zregister() will automatically detect which structure type has
+ * been passed in, regardless of the mapping of the #H5Z_class_t macro.
+ * However, the application must make sure that the fields are filled
+ * in according to the correct structure definition if the macro is
+ * used to declare the structure.
+ *
+ * \Bold{The callback functions:}\n Before H5Zregister() can link a
+ * filter into an application, three callback functions must be
+ * defined as described in the HDF5 library header file H5Zpublic.h.
+ *
+ * When a filter is applied to the fractal heap for a group (e.g.,
+ * when compressing group metadata) and if the can apply and set local
+ * callback functions have been defined for that filter, HDF5 passes
+ * the value -1 for all parameters for those callback functions. This
+ * is done to ensure that the filter will not be applied to groups if
+ * it relies on these parameters, as they are not applicable to group
+ * fractal heaps; to operate on group fractal heaps, a filter must be
+ * capable of operating on an opaque block of binary data.
+ *
+ * The \Emph{can apply} callback function must return a positive value
+ * for a valid combination, zero for an invalid combination, and a
+ * negative value for an error.
+ * \snippet this H5Z_can_apply_func_t_snip
+ *
+ * Before a dataset is created, the \Emph{can apply} callbacks for any
+ * filters used in the dataset creation property list are called with
+ * the dataset's dataset creation property list, \c dcpl_id, the
+ * dataset's datatype, \p type_id, and a dataspace describing a chunk,
+ * \p space_id, (for chunked dataset storage).
+ *
+ * This callback must determine whether the combination of the dataset
+ * creation property list settings, the datatype, and the dataspace
+ * represent a valid combination to which to apply this filter. For
+ * example, an invalid combination may involve the filter not
+ * operating correctly on certain datatypes, on certain datatype
+ * sizes, or on certain sizes of the chunk dataspace. If this filter
+ * is enabled through H5Pset_filter() as optional and the can apply
+ * function returns 0, the library will skip the filter in the filter
+ * pipeline.
+ *
+ * This callback can be the NULL pointer, in which case the library
+ * will assume that the filter can be applied to a dataset with any
+ * combination of dataset creation property list values, datatypes,
+ * and dataspaces.
+ *
+ * The \Emph{set local} callback function is defined as follows:
+ * \snippet this H5Z_set_local_func_t_snip
+ *
+ * After the can apply callbacks are checked for a new dataset, the
+ * \Emph{set local} callback functions for any filters used in the
+ * dataset creation property list are called. These callbacks receive
+ * \c dcpl_id, the dataset's private copy of the dataset creation
+ * property list passed in to H5Dcreate() (i.e. not the actual
+ * property list passed in to H5Dcreate()); \c type_id, the datatype
+ * identifier passed in to H5Dcreate(), which is not copied and should
+ * not be modified; and \c space_id, a dataspace describing the chunk
+ * (for chunked dataset storage), which should also not be modified.
+ *
+ * The set local callback must set any filter parameters that are
+ * specific to this dataset, based on the combination of the dataset
+ * creation property list values, the datatype, and the dataspace. For
+ * example, some filters perform different actions based on different
+ * datatypes, datatype sizes, numbers of dimensions, or dataspace
+ * sizes.
+ *
+ * The \Emph{set local} callback may be the NULL pointer, in which
+ * case, the library will assume that there are no dataset-specific
+ * settings for this filter.
+ *
+ * The \Emph{set local} callback function must return a non-negative
+ * value on success and a negative value for an error.
+ *
+ * The \Emph{filter operation} callback function, defining the
+ * filter's operation on the data, is defined as follows:
+ * \snippet this H5Z_func_t_snip
+ *
+ * The parameters \c flags, \c cd_nelmts, and \c cd_values are the
+ * same as for the function H5Pset_filter(). The one exception is that
+ * an additional flag, #H5Z_FLAG_REVERSE, is set when the filter is
+ * called as part of the input pipeline.
+ *
+ * The parameter \c buf points to the input buffer which has a size of
+ * \c buf_size bytes, \c nbytes of which are valid data.
+ *
+ * The filter should perform the transformation in place if possible.
+ * If the transformation cannot be done in place, then the filter
+ * should allocate a new buffer with malloc() and assign it to \c buf,
+ * assigning the allocated size of that buffer to \c buf_size. The old
+ * buffer should be freed by calling free().
+ *
+ * If successful, the \Emph{filter operation} callback function
+ * returns the number of valid bytes of data contained in \c buf. In
+ * the case of failure, the return value is 0 (zero) and all pointer
+ * arguments are left unchanged.
+ *
+ * \version 1.8.6 Return type for the \Emph{can apply} callback function,
+ * \ref H5Z_can_apply_func_t, changed to \ref htri_t.
+ * \version 1.8.5 Semantics of the \Emph{can apply} and \Emph{set local}
+ * callback functions changed to accommodate the use of filters
+ * with group fractal heaps.
+ * \version 1.8.3 #H5Z_class_t renamed to H5Z_class2_t, H5Z_class1_t structure
+ * introduced for backwards compatibility with release 1.6.x,
+ * and #H5Z_class_t macro introduced in this release. Function
+ * modified to accept either structure type.
+ * \version 1.8.0 The fields \c version, \c encoder_present, and
+ * \c decoder_present were added to the #H5Z_class_t \c struct
+ * in this release.
+ * \version 1.6.0 This function was substantially revised in Release 1.6.0 with
+ * a new #H5Z_class_t struct and new set local and can apply
+ * callback functions.
+ *
+ */
+H5_DLL herr_t H5Zregister(const void *cls);
+/**
+ * \ingroup H5Z
+ *
+ * \brief Unregisters a filter.
+ *
+ * \param[in] id Identifier of the filter to be unregistered.
+ * \return \herr_t
+ *
+ * \details H5Zunregister() unregisters the filter specified in \p id.
+ *
+ * \details This function first iterates through all opened datasets and
+ * groups. If an open object that uses this filter is found, the
+ * function will fail with a message indicating that an object using
+ * the filter is still open. All open files are then flushed to make
+ * sure that all cached data that may use this filter are written out.
+ *
+ * If the application is a parallel program, all processes that
+ * participate in collective data write should call this function to
+ * ensure that all data is flushed.
+ *
+ * After a call to H5Zunregister(), the filter specified in filter
+ * will no longer be available to the application.
+ *
+ * \version 1.8.12 Function modified to check for open objects using the
+ * filter.
+ * \since 1.6.0
+ */
+H5_DLL herr_t H5Zunregister(H5Z_filter_t id);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Symbols defined for compatibility with previous versions of the HDF5 API.
+ *
+ * Use of these symbols is deprecated.
+ */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/**
+ * The filter table maps filter identification numbers to structs that
+ * contain a pointers to the filter function and timing statistics.
+ */
+//! <!-- [H5Z_class1_t_snip] -->
+typedef struct H5Z_class1_t {
+ H5Z_filter_t id; /**< Filter ID number */
+ const char * name; /**< Comment for debugging */
+ H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */
+ H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */
+ H5Z_func_t filter; /**< The actual filter function */
+} H5Z_class1_t;
+//! <!-- [H5Z_class1_t_snip] -->
+
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+#endif /* _H5Zdevelop_H */
diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h
index 25007b3..9312b72 100644
--- a/src/H5Zmodule.h
+++ b/src/H5Zmodule.h
@@ -29,59 +29,80 @@
#define H5_MY_PKG_ERR H5E_PLINE
#define H5_MY_PKG_INIT YES
-/**
- * \defgroup H5Z H5Z
+/**\defgroup H5Z H5Z
*
+ * Use the functions in this module to manage HDF5 filters.
*
- * \brief Filter and Compression Interface
+ * User-defined filters are created by registering a filter descriptor of
+ * type #H5Z_class_t with the library.
*
- * \details The functions in this module let you configure filters that process
- * data during I/O operation.
+ * Available filters can be read or examined at runtime.
*
- * HDF5 supports a filter pipeline that provides the capability for
- * standard and customized raw data processing during I/O operations.
- * HDF5 is distributed with a small set of standard filters such as
- * compression (gzip, SZIP, and a shuffling algorithm) and error
- * checking (Fletcher32 checksum). For further flexibility, the
- * library allows a user application to extend the pipeline through
- * the creation and registration of customized filters.
+ * It is conceivable that filters are stateful and that that state be
+ * updated at runtime.
*
- * The flexibility of the filter pipeline implementation enables the
- * definition of additional filters by a user application. A filter
- * \li is associated with a dataset when the dataset is created,
- * \li can be used only with chunked data (i.e., datasets stored in
- * the #H5D_CHUNKED storage layout), and
- * \li is applied independently to each chunk of the dataset.
+ * Filters are deleted by unregistering.
*
- * The HDF5 library does not support filters for contiguous datasets
- * because of the difficulty of implementing random access for partial
- * I/O. Compact dataset filters are not supported because it would not
- * produce significant results.
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5Z_examples.c filter
+ * \snippet{lineno} H5Z_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5Z_examples.c read
+ * </td>
+ * </tr>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5Z_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5Z_examples.c delete
+ * </tr>
+ * </table>
*
- * Filter identifiers for the filters distributed with the HDF5
- * Library are as follows:
- * <table>
- * <tr><td>#H5Z_FILTER_DEFLATE</td><td>The gzip compression, or
- * deflation, filter</td></tr>
- * <tr><td>#H5Z_FILTER_SZIP</td><td>The SZIP compression
- * filter</td></tr>
- * <tr><td>#H5Z_FILTER_NBIT</td><td>The N-bit compression
- * filter</td></tr>
- * <tr><td>#H5Z_FILTER_SCALEOFFSET</td><td>The scale-offset
- * compression filter</td></tr>
- * <tr><td>#H5Z_FILTER_SHUFFLE</td><td>The shuffle algorithm
- * filter</td></tr>
- * <tr><td>#H5Z_FILTER_FLETCHER32</td><td>The Fletcher32 checksum,
- * or error checking, filter</td></tr>
- * </table>
- * Custom filters that have been registered with the library will have
- * additional unique identifiers.
+ * HDF5 supports a filter pipeline that provides the capability for standard and
+ * customized raw data processing during I/O operations. HDF5 is distributed
+ * with a small set of standard filters such as compression (gzip, SZIP, and a
+ * shuffling algorithm) and error checking (Fletcher32 checksum). For further
+ * flexibility, the library allows a user application to extend the pipeline
+ * through the creation and registration of customized filters.
*
- * See \Emph{HDF5 Dynamically Loaded Filters} for more information on
- * how an HDF5 application can apply a filter that is not registered
- * with the HDF5 library.
+ * The flexibility of the filter pipeline implementation enables the definition
+ * of additional filters by a user application. A filter
+ * \li is associated with a dataset when the dataset is created,
+ * \li can be used only with chunked data (i.e., datasets stored in the
+ * #H5D_CHUNKED storage layout), and
+ * \li is applied independently to each chunk of the dataset.
*
- * \todo Fix the reference.
+ * The HDF5 library does not support filters for contiguous datasets because of
+ * the difficulty of implementing random access for partial I/O. Compact dataset
+ * filters are not supported because it would not produce significant results.
+ *
+ * Filter identifiers for the filters distributed with the HDF5
+ * Library are as follows:
+ * <table>
+ * <tr><td>#H5Z_FILTER_DEFLATE</td><td>The gzip compression, or
+ * deflation, filter</td></tr>
+ * <tr><td>#H5Z_FILTER_SZIP</td><td>The SZIP compression
+ * filter</td></tr>
+ * <tr><td>#H5Z_FILTER_NBIT</td><td>The N-bit compression
+ * filter</td></tr>
+ * <tr><td>#H5Z_FILTER_SCALEOFFSET</td><td>The scale-offset
+ * compression filter</td></tr>
+ * <tr><td>#H5Z_FILTER_SHUFFLE</td><td>The shuffle algorithm
+ * filter</td></tr>
+ * <tr><td>#H5Z_FILTER_FLETCHER32</td><td>The Fletcher32 checksum,
+ * or error checking, filter</td></tr>
+ * </table>
+ * Custom filters that have been registered with the library will have
+ * additional unique identifiers.
+ *
+ * See \ref_dld_filters for more information on how an HDF5 application can
+ * apply a filter that is not registered with the HDF5 library.
*
* \defgroup H5ZPRE Predefined Filters
* \ingroup H5Z
diff --git a/src/H5Znbit.c b/src/H5Znbit.c
index 2b6f277..b696085 100644
--- a/src/H5Znbit.c
+++ b/src/H5Znbit.c
@@ -52,17 +52,19 @@ static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index,
static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
hbool_t *need_not_compress);
-static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len);
-static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len);
+static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned end_i, const unsigned char *buffer,
+ size_t *j, size_t *buf_len, const parms_atomic *p,
+ size_t datatype_len);
+static void H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j,
size_t *buf_len, const parms_atomic *p, size_t datatype_len);
-static void H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
- const parms_atomic *p, size_t datatype_len);
-static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, unsigned size);
-static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, const parms_atomic *p);
+static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset,
+ const unsigned char *buffer, size_t *j, size_t *buf_len,
+ unsigned size);
+static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, const parms_atomic *p);
static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
size_t *j, size_t *buf_len, const unsigned parms[],
unsigned *parms_index);
@@ -71,8 +73,8 @@ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data
const unsigned parms[], unsigned *parms_index);
static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
const unsigned parms[]);
-static void H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, unsigned size);
+static void H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset,
+ unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size);
static void H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
size_t *j, size_t *buf_len, const unsigned parms[],
unsigned *parms_index);
@@ -1026,7 +1028,7 @@ H5Z__nbit_next_byte(size_t *j, size_t *buf_len)
static void
H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
+ unsigned end_i, const unsigned char *buffer, size_t *j, size_t *buf_len,
const parms_atomic *p, size_t datatype_len)
{
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
@@ -1075,8 +1077,8 @@ H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned
}
static void
-H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, unsigned size)
+H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, const unsigned char *buffer,
+ size_t *j, size_t *buf_len, unsigned size)
{
unsigned i; /* index */
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
@@ -1341,7 +1343,7 @@ done:
}
static void
-H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
+H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
const parms_atomic *p, size_t datatype_len)
{
@@ -1383,8 +1385,8 @@ H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
}
static void
-H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, unsigned size)
+H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, unsigned size)
{
unsigned i; /* index */
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h
index 51690b4..13eb26f 100644
--- a/src/H5Zprivate.h
+++ b/src/H5Zprivate.h
@@ -21,8 +21,9 @@
/* Early typedefs to avoid circular dependencies */
typedef struct H5Z_filter_info_t H5Z_filter_info_t;
-/* Include package's public header */
+/* Include package's public headers */
#include "H5Zpublic.h"
+#include "H5Zdevelop.h"
/* Private headers needed by this file */
#include "H5Tprivate.h" /* Datatypes */
diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h
index 4c9b006..5d04c9a 100644
--- a/src/H5Zpublic.h
+++ b/src/H5Zpublic.h
@@ -207,11 +207,6 @@ typedef enum H5Z_SO_scale_type_t {
} H5Z_SO_scale_type_t;
/**
- * Current version of the H5Z_class_t struct
- */
-#define H5Z_CLASS_T_VERS (1)
-
-/**
* \ingroup FLETCHER32
* Values to decide if EDC is enabled for reading data
*/
@@ -230,330 +225,24 @@ typedef enum H5Z_EDC_t {
* Return values for filter callback function
*/
typedef enum H5Z_cb_return_t {
- H5Z_CB_ERROR = -1,
- H5Z_CB_FAIL = 0, /**< I/O should fail if filter fails. */
- H5Z_CB_CONT = 1, /**< I/O continues if filter fails. */
- H5Z_CB_NO = 2
+ H5Z_CB_ERROR = -1, /**< error value */
+ H5Z_CB_FAIL = 0, /**< I/O should fail if filter fails. */
+ H5Z_CB_CONT = 1, /**< I/O continues if filter fails. */
+ H5Z_CB_NO = 2 /**< sentinel */
} H5Z_cb_return_t;
+//! <!-- [H5Z_filter_func_t_snip] -->
/**
* Filter callback function definition
*/
typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void *buf, size_t buf_size, void *op_data);
-
-/**
- * Structure for filter callback property
- */
-typedef struct H5Z_cb_t {
- H5Z_filter_func_t func;
- void * op_data;
-} H5Z_cb_t;
+//! <!-- [H5Z_filter_func_t_snip] -->
#ifdef __cplusplus
extern "C" {
#endif
/**
- * \details Before a dataset gets created, the \c can_apply callbacks for any
- * filters used in the dataset creation property list are called with
- * the dataset's dataset creation property list, the dataset's
- * datatype and a dataspace describing a chunk (for chunked dataset
- * storage).
- *
- * The \c can_apply callback must determine if the combination of the
- * dataset creation property list setting, the datatype and the
- * dataspace represent a valid combination to apply this filter to.
- * For example, some cases of invalid combinations may involve the
- * filter not operating correctly on certain datatypes (or certain
- * datatype sizes), or certain sizes of the chunk dataspace.
- *
- * The \c can_apply callback can be the NULL pointer, in which case,
- * the library will assume that it can apply to any combination of
- * dataset creation property list values, datatypes and dataspaces.
- *
- * The \c can_apply callback returns positive a valid combination,
- * zero for an invalid combination and negative for an error.
- */
-//! [H5Z_can_apply_func_t_snip]
-typedef htri_t (*H5Z_can_apply_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-//! [H5Z_can_apply_func_t_snip]
-/**
- * \details After the "can_apply" callbacks are checked for new datasets, the
- * \c set_local callbacks for any filters used in the dataset creation
- * property list are called. These callbacks receive the dataset's
- * private copy of the dataset creation property list passed in to
- * H5Dcreate() (i.e. not the actual property list passed in to
- * H5Dcreate()) and the datatype ID passed in to H5Dcreate() (which is
- * not copied and should not be modified) and a dataspace describing
- * the chunk (for chunked dataset storage) (which should also not be
- * modified).
- *
- * The \c set_local callback must set any parameters that are specific
- * to this dataset, based on the combination of the dataset creation
- * property list values, the datatype and the dataspace. For example,
- * some filters perform different actions based on different datatypes
- * (or datatype sizes) or different number of dimensions or dataspace
- * sizes.
- *
- * The \c set_local callback can be the NULL pointer, in which case,
- * the library will assume that there are no dataset-specific settings
- * for this filter.
- *
- * The \c set_local callback must return non-negative on success and
- * negative for an error.
- */
-//! [H5Z_set_local_func_t_snip]
-typedef herr_t (*H5Z_set_local_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-//! [H5Z_set_local_func_t_snip]
-/**
- * \details A filter gets definition flags and invocation flags (defined
- * above), the client data array and size defined when the filter was
- * added to the pipeline, the size in bytes of the data on which to
- * operate, and pointers to a buffer and its allocated size.
- *
- * The filter should store the result in the supplied buffer if
- * possible, otherwise it can allocate a new buffer, freeing the
- * original. The allocated size of the new buffer should be returned
- * through the \p buf_size pointer and the new buffer through the \p
- * buf pointer.
- *
- * The return value from the filter is the number of bytes in the
- * output buffer. If an error occurs then the function should return
- * zero and leave all pointer arguments unchanged.
- */
-//! [H5Z_func_t_snip]
-typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[],
- size_t nbytes, size_t *buf_size, void **buf);
-//! [H5Z_func_t_snip]
-/**
- * The filter table maps filter identification numbers to structs that
- * contain a pointers to the filter function and timing statistics.
- */
-//! [H5Z_class2_t_snip]
-typedef struct H5Z_class2_t {
- int version; /**< Version number of the H5Z_class_t struct */
- H5Z_filter_t id; /**< Filter ID number */
- unsigned encoder_present; /**< Does this filter have an encoder? */
- unsigned decoder_present; /**< Does this filter have a decoder? */
- const char * name; /**< Comment for debugging */
- H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */
- H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */
- H5Z_func_t filter; /**< The actual filter function */
-} H5Z_class2_t;
-//! [H5Z_class2_t_snip]
-
-/**
- * \ingroup H5Z
- *
- * \brief Registers a new filter with the HDF5 library
- *
- * \param[in] cls A pointer to a buffer for the struct containing the
- * filter-definition
- *
- * \return \herr_t
- *
- * \details H5Zregister() registers a new filter with the HDF5 library.
- *
- * \details Making a new filter available to an application is a two-step
- * process. The first step is to write the three filter callback
- * functions described below: \c can_apply, \c set_local, and \c
- * filter. This call to H5Zregister(), registering the filter with the
- * library, is the second step. The can_apply and set_local fields can
- * be set to NULL if they are not required for the filter being
- * registered.
- *
- * H5Zregister() accepts a single parameter, a pointer to a buffer for
- * the \p cls data structure. That data structure must conform to one
- * of the following definitions:
- * \snippet this H5Z_class1_t_snip
- * or
- * \snippet this H5Z_class2_t_snip
- *
- * \c version is a library-defined value reporting the version number
- * of the #H5Z_class_t struct. This currently must be set to
- * #H5Z_CLASS_T_VERS.
- *
- * \c id is the identifier for the new filter. This is a user-defined
- * value between #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX. These
- * values are defined in the HDF5 source file H5Zpublic.h, but the
- * symbols #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX should always be
- * used instead of the literal values.
- *
- * \c encoder_present is a library-defined value indicating whether
- * the filter’s encoding capability is available to the application.
- *
- * \c decoder_present is a library-defined value indicating whether
- * the filter’s encoding capability is available to the application.
- *
- * \c name is a descriptive comment used for debugging, may contain a
- * descriptive name for the filter, and may be the null pointer.
- *
- * \c can_apply, described in detail below, is a user-defined callback
- * function which determines whether the combination of the dataset
- * creation property list values, the datatype, and the dataspace
- * represent a valid combination to apply this filter to.
- *
- * \c set_local, described in detail below, is a user-defined callback
- * function which sets any parameters that are specific to this
- * dataset, based on the combination of the dataset creation property
- * list values, the datatype, and the dataspace.
- *
- * \c filter, described in detail below, is a user-defined callback
- * function which performs the action of the filter.
- *
- * The statistics associated with a filter are not reset by this
- * function; they accumulate over the life of the library.
- *
- * #H5Z_class_t is a macro which maps to either H5Z_class1_t or
- * H5Z_class2_t, depending on the needs of the application. To affect
- * only this macro, H5Z_class_t_vers may be defined to either 1 or 2.
- * Otherwise, it will behave in the same manner as other API
- * compatibility macros. See API Compatibility Macros in HDF5 for more
- * information. H5Z_class1_t matches the #H5Z_class_t structure that is
- * used in the 1.6.x versions of the HDF5 library.
- *
- * H5Zregister() will automatically detect which structure type has
- * been passed in, regardless of the mapping of the #H5Z_class_t macro.
- * However, the application must make sure that the fields are filled
- * in according to the correct structure definition if the macro is
- * used to declare the structure.
- *
- * \Bold{The callback functions:}\n Before H5Zregister() can link a
- * filter into an application, three callback functions must be
- * defined as described in the HDF5 library header file H5Zpublic.h.
- *
- * When a filter is applied to the fractal heap for a group (e.g.,
- * when compressing group metadata) and if the can apply and set local
- * callback functions have been defined for that filter, HDF5 passes
- * the value -1 for all parameters for those callback functions. This
- * is done to ensure that the filter will not be applied to groups if
- * it relies on these parameters, as they are not applicable to group
- * fractal heaps; to operate on group fractal heaps, a filter must be
- * capable of operating on an opaque block of binary data.
- *
- * The \Emph{can apply} callback function must return a positive value
- * for a valid combination, zero for an invalid combination, and a
- * negative value for an error.
- * \snippet this H5Z_can_apply_func_t_snip
- *
- * Before a dataset is created, the \Emph{can apply} callbacks for any
- * filters used in the dataset creation property list are called with
- * the dataset's dataset creation property list, \c dcpl_id, the
- * dataset's datatype, \p type_id, and a dataspace describing a chunk,
- * \p space_id, (for chunked dataset storage).
- *
- * This callback must determine whether the combination of the dataset
- * creation property list settings, the datatype, and the dataspace
- * represent a valid combination to which to apply this filter. For
- * example, an invalid combination may involve the filter not
- * operating correctly on certain datatypes, on certain datatype
- * sizes, or on certain sizes of the chunk dataspace. If this filter
- * is enabled through H5Pset_filter() as optional and the can apply
- * function returns 0, the library will skip the filter in the filter
- * pipeline.
- *
- * This callback can be the NULL pointer, in which case the library
- * will assume that the filter can be applied to a dataset with any
- * combination of dataset creation property list values, datatypes,
- * and dataspaces.
- *
- * The \Emph{set local} callback function is defined as follows:
- * \snippet this H5Z_set_local_func_t_snip
- *
- * After the can apply callbacks are checked for a new dataset, the
- * \Emph{set local} callback functions for any filters used in the
- * dataset creation property list are called. These callbacks receive
- * \c dcpl_id, the dataset's private copy of the dataset creation
- * property list passed in to H5Dcreate() (i.e. not the actual
- * property list passed in to H5Dcreate()); \c type_id, the datatype
- * identifier passed in to H5Dcreate(), which is not copied and should
- * not be modified; and \c space_id, a dataspace describing the chunk
- * (for chunked dataset storage), which should also not be modified.
- *
- * The set local callback must set any filter parameters that are
- * specific to this dataset, based on the combination of the dataset
- * creation property list values, the datatype, and the dataspace. For
- * example, some filters perform different actions based on different
- * datatypes, datatype sizes, numbers of dimensions, or dataspace
- * sizes.
- *
- * The \Emph{set local} callback may be the NULL pointer, in which
- * case, the library will assume that there are no dataset-specific
- * settings for this filter.
- *
- * The \Emph{set local} callback function must return a non-negative
- * value on success and a negative value for an error.
- *
- * The \Emph{filter operation} callback function, defining the
- * filter's operation on the data, is defined as follows:
- * \snippet this H5Z_func_t_snip
- *
- * The parameters \c flags, \c cd_nelmts, and \c cd_values are the
- * same as for the function H5Pset_filter(). The one exception is that
- * an additional flag, #H5Z_FLAG_REVERSE, is set when the filter is
- * called as part of the input pipeline.
- *
- * The parameter \c buf points to the input buffer which has a size of
- * \c buf_size bytes, \c nbytes of which are valid data.
- *
- * The filter should perform the transformation in place if possible.
- * If the transformation cannot be done in place, then the filter
- * should allocate a new buffer with malloc() and assign it to \c buf,
- * assigning the allocated size of that buffer to \c buf_size. The old
- * buffer should be freed by calling free().
- *
- * If successful, the \Emph{filter operation} callback function
- * returns the number of valid bytes of data contained in \c buf. In
- * the case of failure, the return value is 0 (zero) and all pointer
- * arguments are left unchanged.
- *
- * \version 1.8.6 Return type for the \Emph{can apply} callback function,
- * \ref H5Z_can_apply_func_t, changed to \ref htri_t.
- * \version 1.8.5 Semantics of the \Emph{can apply} and \Emph{set local}
- * callback functions changed to accommodate the use of filters
- * with group fractal heaps.
- * \version 1.8.3 #H5Z_class_t renamed to H5Z_class2_t, H5Z_class1_t structure
- * introduced for backwards compatibility with release 1.6.x,
- * and #H5Z_class_t macro introduced in this release. Function
- * modified to accept either structure type.
- * \version 1.8.0 The fields \c version, \c encoder_present, and
- * \c decoder_present were added to the #H5Z_class_t \c struct
- * in this release.
- * \version 1.6.0 This function was substantially revised in Release 1.6.0 with
- * a new #H5Z_class_t struct and new set local and can apply
- * callback functions.
- *
- */
-H5_DLL herr_t H5Zregister(const void *cls);
-/**
- * \ingroup H5Z
- *
- * \brief Unregisters a filter.
- *
- * \param[in] id Identifier of the filter to be unregistered.
- * \return \herr_t
- *
- * \details H5Zunregister() unregisters the filter specified in \p id.
- *
- * \details This function first iterates through all opened datasets and
- * groups. If an open object that uses this filter is found, the
- * function will fail with a message indicating that an object using
- * the filter is still open. All open files are then flushed to make
- * sure that all cached data that may use this filter are written out.
- *
- * If the application is a parallel program, all processes that
- * participate in collective data write should call this function to
- * ensure that all data is flushed.
- *
- * After a call to H5Zunregister(), the filter specified in filter
- * will no longer be available to the application.
- *
- * \version 1.8.12 Function modified to check for open objects using the
- * filter.
- * \since 1.6.0
- */
-H5_DLL herr_t H5Zunregister(H5Z_filter_t id);
-/**
* \ingroup H5Z
*
* \brief Determines whether a filter is available
@@ -625,29 +314,8 @@ H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id);
*/
H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags);
-/* Symbols defined for compatibility with previous versions of the HDF5 API.
- *
- * Use of these symbols is deprecated.
- */
-#ifndef H5_NO_DEPRECATED_SYMBOLS
-
-/**
- * The filter table maps filter identification numbers to structs that
- * contain a pointers to the filter function and timing statistics.
- */
-//! [H5Z_class1_t_snip]
-typedef struct H5Z_class1_t {
- H5Z_filter_t id; /**< Filter ID number */
- const char * name; /**< Comment for debugging */
- H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */
- H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */
- H5Z_func_t filter; /**< The actual filter function */
-} H5Z_class1_t;
-//! [H5Z_class1_t_snip]
-
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
#ifdef __cplusplus
}
#endif
-#endif
+
+#endif /* _H5Zpublic_H */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 3f26623..a8a63bf 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -73,9 +73,9 @@ static herr_t H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts,
uint32_t minbits, unsigned long long minval, double D_val);
static void H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len);
static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
- unsigned begin_i, unsigned char *buffer, size_t *j,
+ unsigned begin_i, const unsigned char *buffer, size_t *j,
unsigned *buf_len, parms_atomic p, unsigned dtype_len);
-static void H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+static void H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
unsigned begin_i, unsigned char *buffer, size_t *j,
unsigned *buf_len, parms_atomic p, unsigned dtype_len);
static void H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset,
@@ -198,7 +198,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Set the fill value parameter in cd_values[] for unsigned integer type */
#define H5Z_scaleoffset_set_filval_1(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -209,11 +209,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \
\
H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \
- }
+ } while (0)
/* Set the fill value parameter in cd_values[] for signed integer type */
#define H5Z_scaleoffset_set_filval_2(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -224,11 +224,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \
\
H5Z_scaleoffset_save_filval(unsigned type, cd_values, fill_val) \
- }
+ } while (0)
/* Set the fill value parameter in cd_values[] for character integer type */
#define H5Z_scaleoffset_set_filval_3(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -237,11 +237,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
\
/* Store the fill value as the last entry in cd_values[] */ \
(cd_values)[H5Z_SCALEOFFSET_PARM_FILVAL] = (unsigned)((unsigned char)fill_val); \
- }
+ } while (0)
/* Set the fill value parameter in cd_values[] for floating-point type */
#define H5Z_scaleoffset_set_filval_4(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -252,7 +252,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \
\
H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \
- }
+ } while (0)
/* Get the fill value for integer type */
#define H5Z_scaleoffset_get_filval_1(type, cd_values, fill_val) \
@@ -364,12 +364,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
#define H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \
{ \
i = 0; \
- while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
i++; \
if (i < d_nelmts) \
min = max = buf[i]; \
for (; i < d_nelmts; i++) { \
- if (HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ if (HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
continue; /* ignore fill value */ \
if (buf[i] > max) \
max = buf[i]; \
@@ -425,22 +425,22 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
#define H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) \
{ \
if (sizeof(type) == sizeof(int)) { \
- if (round_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) > \
- pow_fun(2.0f, (type)(sizeof(int) * 8 - 1))) { \
+ if (round_fun(max * pow_fun(10.0F, (type)D_val) - min * pow_fun(10.0F, (type)D_val)) > \
+ pow_fun(2.0F, (type)(sizeof(int) * 8 - 1))) { \
*minbits = sizeof(int) * 8; \
goto done; \
} \
} \
else if (sizeof(type) == sizeof(long)) { \
- if (round_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) > \
- pow_fun(2.0f, (type)(sizeof(long) * 8 - 1))) { \
+ if (round_fun(max * pow_fun(10.0F, (type)D_val) - min * pow_fun(10.0F, (type)D_val)) > \
+ pow_fun(2.0F, (type)(sizeof(long) * 8 - 1))) { \
*minbits = sizeof(long) * 8; \
goto done; \
} \
} \
else if (sizeof(type) == sizeof(long long)) { \
- if (round_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) > \
- pow_fun(2.0f, (type)(sizeof(long long) * 8 - 1))) { \
+ if (round_fun(max * pow_fun(10.0F, (type)D_val) - min * pow_fun(10.0F, (type)D_val)) > \
+ pow_fun(2.0F, (type)(sizeof(long long) * 8 - 1))) { \
*minbits = sizeof(long long) * 8; \
goto done; \
} \
@@ -451,7 +451,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Precompress for unsigned integer type */
#define H5Z_scaleoffset_precompress_1(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, min = 0, max = 0, span, filval = 0; \
unsigned i; \
\
@@ -484,11 +484,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
for (i = 0; i < d_nelmts; i++) buf[i] = (type)(buf[i] - min); \
} \
*minval = min; \
- }
+ } while (0)
/* Precompress for signed integer type */
#define H5Z_scaleoffset_precompress_2(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, min = 0, max = 0, filval = 0; \
unsigned type span; \
unsigned i; \
@@ -522,7 +522,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
for (i = 0; i < d_nelmts; i++) buf[i] = (type)(buf[i] - min); \
} \
*minval = (unsigned long long)min; \
- }
+ } while (0)
/* Modify values of data in precompression if fill value defined for floating-point type */
#define H5Z_scaleoffset_modify_1(i, type, pow_fun, abs_fun, lround_fun, llround_fun, buf, d_nelmts, filval, \
@@ -530,27 +530,27 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ \
if (sizeof(type) == sizeof(int)) \
for (i = 0; i < d_nelmts; i++) { \
- if (abs_fun(buf[i] - filval) < pow_fun(10.0f, (type)-D_val)) \
+ if (abs_fun(buf[i] - filval) < pow_fun(10.0F, (type)-D_val)) \
*(int *)((void *)&buf[i]) = (int)(((unsigned int)1 << *minbits) - 1); \
else \
- *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun(10.0F, (type)D_val) - \
+ min * pow_fun(10.0F, (type)D_val)); \
} \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) { \
- if (abs_fun(buf[i] - filval) < pow_fun(10.0f, (type)-D_val)) \
+ if (abs_fun(buf[i] - filval) < pow_fun(10.0F, (type)-D_val)) \
*(long *)((void *)&buf[i]) = (long)(((unsigned long)1 << *minbits) - 1); \
else \
- *(long *)((void *)&buf[i]) = lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(long *)((void *)&buf[i]) = lround_fun(buf[i] * pow_fun(10.0F, (type)D_val) - \
+ min * pow_fun(10.0F, (type)D_val)); \
} \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) { \
- if (abs_fun(buf[i] - filval) < pow_fun(10.0f, (type)-D_val)) \
+ if (abs_fun(buf[i] - filval) < pow_fun(10.0F, (type)-D_val)) \
*(long long *)((void *)&buf[i]) = (long long)(((unsigned long long)1 << *minbits) - 1); \
else \
- *(long long *)((void *)&buf[i]) = llround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(long long *)((void *)&buf[i]) = llround_fun(buf[i] * pow_fun(10.0F, (type)D_val) - \
+ min * pow_fun(10.0F, (type)D_val)); \
} \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
@@ -561,16 +561,16 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ \
if (sizeof(type) == sizeof(int)) \
for (i = 0; i < d_nelmts; i++) \
- *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)); \
+ *(int *)((void *)&buf[i]) = (int)lround_fun(buf[i] * pow_fun(10.0F, (type)D_val) - \
+ min * pow_fun(10.0F, (type)D_val)); \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) \
*(long *)((void *)&buf[i]) = \
- lround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)); \
+ lround_fun(buf[i] * pow_fun(10.0F, (type)D_val) - min * pow_fun(10.0F, (type)D_val)); \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) \
*(long long *)((void *)&buf[i]) = \
- llround_fun(buf[i] * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)); \
+ llround_fun(buf[i] * pow_fun(10.0F, (type)D_val) - min * pow_fun(10.0F, (type)D_val)); \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
}
@@ -596,7 +596,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Precompress for floating-point type using variable-minimum-bits method */
#define H5Z_scaleoffset_precompress_3(type, pow_fun, abs_fun, round_fun, lround_fun, llround_fun, data, \
d_nelmts, filavail, cd_values, minbits, minval, D_val) \
- { \
+ do { \
type * buf = (type *)data, min = 0, max = 0, filval = 0; \
unsigned long long span; \
unsigned i; \
@@ -606,8 +606,8 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z_scaleoffset_get_filval_2(type, cd_values, filval) \
H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \
H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) span = \
- (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)) + \
+ (unsigned long long)(llround_fun(max * pow_fun(10.0F, (type)D_val) - \
+ min * pow_fun(10.0F, (type)D_val)) + \
1); \
*minbits = H5Z__scaleoffset_log2(span + 1); \
if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \
@@ -617,8 +617,8 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
else { /* fill value undefined */ \
H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \
H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) span = \
- (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \
- min * pow_fun(10.0f, (type)D_val)) + \
+ (unsigned long long)(llround_fun(max * pow_fun(10.0F, (type)D_val) - \
+ min * pow_fun(10.0F, (type)D_val)) + \
1); \
*minbits = H5Z__scaleoffset_log2(span); \
if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \
@@ -626,11 +626,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
D_val) \
} \
H5Z_scaleoffset_save_min(i, type, minval, min) \
- }
+ } while (0)
/* Postdecompress for unsigned integer type */
#define H5Z_scaleoffset_postdecompress_1(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, filval = 0; \
unsigned i; \
\
@@ -641,11 +641,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
else /* fill value undefined */ \
for (i = 0; i < d_nelmts; i++) \
buf[i] = (type)(buf[i] + (type)(minval)); \
- }
+ } while (0)
/* Postdecompress for signed integer type */
#define H5Z_scaleoffset_postdecompress_2(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, filval = 0; \
unsigned i; \
\
@@ -657,7 +657,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
else /* fill value undefined */ \
for (i = 0; i < d_nelmts; i++) \
buf[i] = (type)(buf[i] + (type)(minval)); \
- }
+ } while (0)
/* Retrive minimum value of floating-point type */
#define H5Z_scaleoffset_get_min(type, minval, min) \
@@ -685,19 +685,19 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
buf[i] = \
(type)((*(int *)((void *)&buf[i]) == (int)(((unsigned int)1 << minbits) - 1)) \
? filval \
- : (type)(*(int *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ : (type)(*(int *)((void *)&buf[i])) / pow_fun(10.0F, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) \
buf[i] = \
(type)((*(long *)((void *)&buf[i]) == (long)(((unsigned long)1 << minbits) - 1)) \
? filval \
- : (type)(*(long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ : (type)(*(long *)((void *)&buf[i])) / pow_fun(10.0F, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) \
buf[i] = (type)( \
(*(long long *)((void *)&buf[i]) == (long long)(((unsigned long long)1 << minbits) - 1)) \
? filval \
- : (type)(*(long long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ : (type)(*(long long *)((void *)&buf[i])) / pow_fun(10.0F, (type)D_val) + min); \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
}
@@ -707,13 +707,13 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ \
if (sizeof(type) == sizeof(int)) \
for (i = 0; i < d_nelmts; i++) \
- buf[i] = ((type)(*(int *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ buf[i] = ((type)(*(int *)((void *)&buf[i])) / pow_fun(10.0F, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long)) \
for (i = 0; i < d_nelmts; i++) \
- buf[i] = ((type)(*(long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ buf[i] = ((type)(*(long *)((void *)&buf[i])) / pow_fun(10.0F, (type)D_val) + min); \
else if (sizeof(type) == sizeof(long long)) \
for (i = 0; i < d_nelmts; i++) \
- buf[i] = ((type)(*(long long *)((void *)&buf[i])) / pow_fun(10.0f, (type)D_val) + min); \
+ buf[i] = ((type)(*(long long *)((void *)&buf[i])) / pow_fun(10.0F, (type)D_val) + min); \
else \
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot find matched integer dataype") \
}
@@ -721,7 +721,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Postdecompress for floating-point type using variable-minimum-bits method */
#define H5Z_scaleoffset_postdecompress_3(type, pow_fun, data, d_nelmts, filavail, cd_values, minbits, \
minval, D_val) \
- { \
+ do { \
type * buf = (type *)data, filval = 0, min = 0; \
unsigned i; \
\
@@ -734,7 +734,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
} \
else /* fill value undefined */ \
H5Z_scaleoffset_modify_4(i, type, pow_fun, buf, d_nelmts, min, D_val) \
- }
+ } while (0)
/*-------------------------------------------------------------------------
* Function: H5Z__can_apply_scaleoffset
@@ -884,35 +884,32 @@ H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum
FUNC_ENTER_STATIC
if (scale_type == t_uchar)
- H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_ushort)
- H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_uint)
- H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_ulong)
- H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_ulong_long)
- H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_schar)
- H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values,
- need_convertd) else if (scale_type == t_short)
- H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_int)
- H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_long)
- H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type ==
- t_long_long)
- H5Z_scaleoffset_set_filval_2(
- long long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_float)
- H5Z_scaleoffset_set_filval_4(
- float, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_double)
- H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type,
- cd_values, need_convert)
-
- done : FUNC_LEAVE_NOAPI(ret_value)
+ H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_ushort)
+ H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_uint)
+ H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_ulong)
+ H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_ulong_long)
+ H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_schar)
+ H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convertd);
+ else if (scale_type == t_short)
+ H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_int)
+ H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_long)
+ H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_long_long)
+ H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_float)
+ H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_double)
+ H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, cd_values, need_convert);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z__scaleoffset_set_parms_fillval() */
/*-------------------------------------------------------------------------
@@ -1119,7 +1116,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu
unsigned filavail; /* flag indicating if fill value is defined or not */
H5Z_SO_scale_type_t scale_type = H5Z_SO_FLOAT_DSCALE; /* scale type */
int scale_factor = 0; /* scale factor */
- double D_val = 0.0f; /* decimal scale factor */
+ double D_val = 0.0; /* decimal scale factor */
uint32_t minbits = 0; /* minimum number of bits to store values */
unsigned long long minval = 0; /* minimum value of input buffer */
enum H5Z_scaleoffset_t type; /* memory type corresponding to dataset datatype */
@@ -1443,76 +1440,75 @@ H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffs
const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval)
{
if (type == t_uchar)
- H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ushort)
- H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_uint)
- H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ulong)
- H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ulong_long)
- H5Z_scaleoffset_precompress_1(unsigned long long, data, d_nelmts, filavail, cd_values,
- minbits, minval) else if (type == t_schar)
- {
- signed char * buf = (signed char *)data, min = 0, max = 0, filval = 0;
- unsigned char span;
- unsigned i;
-
- if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
- H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval);
- if (*minbits ==
- H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
- H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max,
- min) if ((unsigned char)(max - min) >
- (unsigned char)(~(unsigned char)0 - 2))
- {
- *minbits = sizeof(signed char) * 8;
- return;
- }
- span = (unsigned char)(max - min + 1);
- *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1));
+ H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ushort)
+ H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_uint)
+ H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong)
+ H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong_long)
+ H5Z_scaleoffset_precompress_1(unsigned long long, data, d_nelmts, filavail, cd_values, minbits,
+ minval);
+ else if (type == t_schar) {
+ signed char * buf = (signed char *)data, min = 0, max = 0, filval = 0;
+ unsigned char span;
+ unsigned i;
+
+ if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
+ H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval);
+ if (*minbits ==
+ H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
+ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max,
+ min) if ((unsigned char)(max - min) >
+ (unsigned char)(~(unsigned char)0 - 2))
+ {
+ *minbits = sizeof(signed char) * 8;
+ return;
}
- else /* minbits already set, only calculate min */
- H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval,
- min) if (*minbits !=
- sizeof(signed char) *
- 8) /* change values if minbits != full precision */
- for (i = 0; i < d_nelmts; i++) buf[i] =
- (signed char)((buf[i] == filval) ? (((unsigned char)1 << *minbits) - 1)
- : (buf[i] - min));
+ span = (unsigned char)(max - min + 1);
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1));
}
- else { /* fill value undefined */
- if (*minbits ==
- H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
- H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max,
- min) if ((unsigned char)(max - min) >
- (unsigned char)(~(unsigned char)0 - 2))
- {
- *minbits = sizeof(signed char) * 8;
- *minval = (unsigned long long)min;
- return;
- }
- span = (unsigned char)(max - min + 1);
- *minbits = H5Z__scaleoffset_log2((unsigned long long)span);
+ else /* minbits already set, only calculate min */
+ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval,
+ min) if (*minbits !=
+ sizeof(signed char) *
+ 8) /* change values if minbits != full precision */
+ for (i = 0; i < d_nelmts; i++) buf[i] =
+ (signed char)((buf[i] == filval) ? (((unsigned char)1 << *minbits) - 1)
+ : (buf[i] - min));
+ }
+ else { /* fill value undefined */
+ if (*minbits ==
+ H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
+ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max,
+ min) if ((unsigned char)(max - min) >
+ (unsigned char)(~(unsigned char)0 - 2))
+ {
+ *minbits = sizeof(signed char) * 8;
+ *minval = (unsigned long long)min;
+ return;
}
- else /* minbits already set, only calculate min */
- H5Z_scaleoffset_min_2(i, d_nelmts, buf,
- min) if (*minbits !=
- sizeof(signed char) *
- 8) /* change values if minbits != full precision */
- for (i = 0; i < d_nelmts; i++) buf[i] = (signed char)(buf[i] - min);
+ span = (unsigned char)(max - min + 1);
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)span);
}
- *minval = (unsigned long long)min;
+ else /* minbits already set, only calculate min */
+ H5Z_scaleoffset_min_2(i, d_nelmts, buf,
+ min) if (*minbits !=
+ sizeof(signed char) *
+ 8) /* change values if minbits != full precision */
+ for (i = 0; i < d_nelmts; i++) buf[i] = (signed char)(buf[i] - min);
}
+ *minval = (unsigned long long)min;
+ }
else if (type == t_short)
- H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_int)
- H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_long)
- H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_long_long)
- H5Z_scaleoffset_precompress_2(long long, data, d_nelmts, filavail, cd_values, minbits,
- minval)
+ H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_int)
+ H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_long)
+ H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_long_long)
+ H5Z_scaleoffset_precompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, minval);
}
/* postdecompress for integer type */
@@ -1524,39 +1520,38 @@ H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleo
long long sminval = *(long long *)&minval; /* for signed integer types */
if (type == t_uchar)
- H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ushort)
- H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_uint)
- H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ulong)
- H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, cd_values,
- minbits, minval) else if (type == t_ulong_long)
- H5Z_scaleoffset_postdecompress_1(unsigned long long, data, d_nelmts, filavail,
- cd_values, minbits, minval) else if (type == t_schar)
- {
- signed char *buf = (signed char *)data, filval = 0;
- unsigned i;
-
- if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
- H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval) for (i = 0; i < d_nelmts; i++)
- buf[i] =
- (signed char)((buf[i] == (((unsigned char)1 << minbits) - 1)) ? filval
- : (buf[i] + sminval));
- }
- else /* fill value undefined */
- for (i = 0; i < d_nelmts; i++)
- buf[i] = (signed char)(buf[i] + sminval);
+ H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ushort)
+ H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits,
+ minval);
+ else if (type == t_uint)
+ H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong)
+ H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong_long)
+ H5Z_scaleoffset_postdecompress_1(unsigned long long, data, d_nelmts, filavail, cd_values, minbits,
+ minval);
+ else if (type == t_schar) {
+ signed char *buf = (signed char *)data, filval = 0;
+ unsigned i;
+
+ if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
+ H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval) for (i = 0; i < d_nelmts;
+ i++) buf[i] =
+ (signed char)((buf[i] == (((unsigned char)1 << minbits) - 1)) ? filval : (buf[i] + sminval));
}
+ else /* fill value undefined */
+ for (i = 0; i < d_nelmts; i++)
+ buf[i] = (signed char)(buf[i] + sminval);
+ }
else if (type == t_short)
- H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, cd_values, minbits,
- sminval) else if (type == t_int)
- H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, cd_values, minbits,
- sminval) else if (type == t_long)
- H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, cd_values, minbits,
- sminval) else if (type == t_long_long)
- H5Z_scaleoffset_postdecompress_2(long long, data, d_nelmts, filavail, cd_values, minbits,
- sminval)
+ H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, cd_values, minbits, sminval);
+ else if (type == t_int)
+ H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, cd_values, minbits, sminval);
+ else if (type == t_long)
+ H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, cd_values, minbits, sminval);
+ else if (type == t_long_long)
+ H5Z_scaleoffset_postdecompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, sminval);
}
/* precompress for floating-point type, variable-minimum-bits method
@@ -1572,11 +1567,13 @@ H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoff
if (type == t_float)
H5Z_scaleoffset_precompress_3(float, HDpowf, HDfabsf, HDroundf, HDlroundf, HDllroundf, data, d_nelmts,
- filavail, cd_values, minbits, minval, D_val) else if (type == t_double)
- H5Z_scaleoffset_precompress_3(double, HDpow, HDfabs, HDround, HDlround, HDllround, data, d_nelmts,
- filavail, cd_values, minbits, minval, D_val)
+ filavail, cd_values, minbits, minval, D_val);
+ else if (type == t_double)
+ H5Z_scaleoffset_precompress_3(double, HDpow, HDfabs, HDround, HDlround, HDllround, data, d_nelmts,
+ filavail, cd_values, minbits, minval, D_val);
- done : FUNC_LEAVE_NOAPI(ret_value)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
}
/* postdecompress for floating-point type, variable-minimum-bits method
@@ -1593,11 +1590,13 @@ H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scale
if (type == t_float)
H5Z_scaleoffset_postdecompress_3(float, HDpowf, data, d_nelmts, filavail, cd_values, minbits, sminval,
- D_val) else if (type == t_double)
- H5Z_scaleoffset_postdecompress_3(double, HDpow, data, d_nelmts, filavail, cd_values, minbits,
- sminval, D_val)
+ D_val);
+ else if (type == t_double)
+ H5Z_scaleoffset_postdecompress_3(double, HDpow, data, d_nelmts, filavail, cd_values, minbits, sminval,
+ D_val);
- done : FUNC_LEAVE_NOAPI(ret_value)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
}
static void
@@ -1609,8 +1608,8 @@ H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len)
static void
H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p,
- unsigned dtype_len)
+ const unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p, unsigned dtype_len)
{
unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */
unsigned char val; /* value to be copied in each data byte */
@@ -1695,9 +1694,9 @@ H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned cha
}
static void
-H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p,
- unsigned dtype_len)
+H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p, unsigned dtype_len)
{
unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */
unsigned char val; /* value to be copied in each data byte */
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index ef7d801..ab7e9be 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -90,8 +90,7 @@ static void H5Z__do_op(H5Z_node *tree);
static hbool_t H5Z__op_is_numbs(H5Z_node *_tree);
static hbool_t H5Z__op_is_numbs2(H5Z_node *_tree);
static hid_t H5Z__xform_find_type(const H5T_t *type);
-static herr_t H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type,
- H5Z_result *res);
+static herr_t H5Z__xform_eval_full(H5Z_node *tree, size_t array_size, hid_t array_type, H5Z_result *res);
static void H5Z__xform_destroy_parse_tree(H5Z_node *tree);
static void * H5Z__xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers);
static void * H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers,
@@ -1548,11 +1547,11 @@ H5Z_xform_create(const char *expr)
(HDisdigit(expr[i - 1]) || (expr[i - 1] == '.')) &&
(HDisdigit(expr[i + 1]) || (expr[i + 1] == '-') || (expr[i + 1] == '+')))
continue;
- }
+ } /* end if */
count++;
- }
- }
+ } /* end if */
+ } /* end for */
/* When there are no "x"'s in the equation (ie, simple transform case),
* we don't need to allocate any space since no array will have to be
@@ -1750,11 +1749,19 @@ done:
hbool_t
H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop)
{
- hbool_t ret_value = FALSE; /* Return value */
+ hbool_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
- ret_value = (data_xform_prop ? FALSE : TRUE);
+ if (data_xform_prop) {
+ ret_value = FALSE;
+
+ /* Check for trivial data tranformation: expression = "x" */
+ if ((HDstrlen(data_xform_prop->xform_exp) == 1) && data_xform_prop->dat_val_pointers &&
+ (data_xform_prop->dat_val_pointers->num_ptrs == 1)) {
+ ret_value = TRUE;
+ } /* end if */
+ } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5Z_xform_noop() */
diff --git a/src/H5detect.c b/src/H5detect.c
index 84b34e6..e8cded7 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -52,7 +52,7 @@ static const char *FileHeader = "\n\
/* Disable warning about cast increasing the alignment of the target type,
* that's _exactly_ what this code is probing. -QAK
*/
-H5_GCC_DIAG_OFF("cast-align")
+H5_GCC_CLANG_DIAG_OFF("cast-align")
#if defined(__has_attribute)
#if __has_attribute(no_sanitize_address)
@@ -80,7 +80,7 @@ H5_GCC_DIAG_OFF("cast-align")
#define H5SETJMP(buf) HDsigsetjmp(buf, 1)
#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val)
#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */
-#elif defined(H5_HAVE_LONGJMP)
+#else
#define H5JMP_BUF jmp_buf
#define H5SETJMP(buf) HDsetjmp(buf)
#define H5LONGJMP(buf, val) HDlongjmp(buf, val)
@@ -149,12 +149,8 @@ static int sigbus_handler_called_g = 0; /* how many times called */
static int sigsegv_handler_called_g = 0; /* how many times called */
static int sigill_handler_called_g = 0; /* how many times called */
static int signal_handler_tested_g = 0; /* how many times tested */
-#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
-static int verify_signal_handlers(int signum, void (*handler)(int));
-#endif
-#ifdef H5JMP_BUF
-static H5JMP_BUF jbuf_g;
-#endif
+static int verify_signal_handlers(int signum, void (*handler)(int));
+static H5JMP_BUF jbuf_g;
/*-------------------------------------------------------------------------
* Function: precision
@@ -304,10 +300,10 @@ precision(detected_t *d)
for (_byte_mask = (unsigned char)1; _byte_mask; _byte_mask = (unsigned char)(_byte_mask << 1)) { \
_buf1[_i] ^= _byte_mask; \
HDmemcpy((void *)&_v2, (const void *)_buf1, sizeof(TYPE)); \
- H5_GCC_DIAG_OFF("float-equal") \
+ H5_GCC_CLANG_DIAG_OFF("float-equal") \
if (_v1 != _v2) \
_pad_mask[_i] |= _byte_mask; \
- H5_GCC_DIAG_ON("float-equal") \
+ H5_GCC_CLANG_DIAG_ON("float-equal") \
_buf1[_i] ^= _byte_mask; \
} /* end for */ \
\
@@ -388,7 +384,6 @@ precision(detected_t *d)
COMP_ALIGN = (unsigned int)((char *)(&(s.x)) - (char *)(&s)); \
}
-#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
#define ALIGNMENT(TYPE, INFO) \
{ \
char *volatile _buf = NULL; \
@@ -419,10 +414,10 @@ precision(detected_t *d)
HDmemcpy(_buf + align_g[_ano] + (INFO.offset / 8), ((char *)&_val) + (INFO.offset / 8), \
(size_t)(INFO.precision / 8)); \
_val2 = *((TYPE *)(_buf + align_g[_ano])); \
- H5_GCC_DIAG_OFF("float-equal") \
+ H5_GCC_CLANG_DIAG_OFF("float-equal") \
if (_val != _val2) \
H5LONGJMP(jbuf_g, 1); \
- H5_GCC_DIAG_ON("float-equal") \
+ H5_GCC_CLANG_DIAG_ON("float-equal") \
/* End Cray Check */ \
(INFO.align) = align_g[_ano]; \
} \
@@ -435,15 +430,6 @@ precision(detected_t *d)
HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \
HDsignal(SIGILL, _handler3); /*restore original handler*/ \
}
-#else
-#define ALIGNMENT(TYPE, INFO) \
- { \
- align_status_g |= STA_NoALIGNMENT; \
- (INFO.align) = 0; \
- }
-#endif
-
-#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
/*-------------------------------------------------------------------------
* Function: sigsegv_handler
@@ -473,9 +459,6 @@ sigsegv_handler(int H5_ATTR_UNUSED signo)
HDsignal(SIGSEGV, sigsegv_handler);
H5LONGJMP(jbuf_g, SIGSEGV);
}
-#endif
-
-#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
/*-------------------------------------------------------------------------
* Function: sigbus_handler
@@ -505,9 +488,6 @@ sigbus_handler(int H5_ATTR_UNUSED signo)
HDsignal(SIGBUS, sigbus_handler);
H5LONGJMP(jbuf_g, SIGBUS);
}
-#endif
-
-#if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL)
/*-------------------------------------------------------------------------
* Function: sigill_handler
@@ -537,7 +517,6 @@ sigill_handler(int H5_ATTR_UNUSED signo)
HDsignal(SIGILL, sigill_handler);
H5LONGJMP(jbuf_g, SIGILL);
}
-#endif
/*-------------------------------------------------------------------------
* Function: print_results
@@ -777,21 +756,6 @@ done:\n\
fprintf(rawoutstream, "/* Signal handlers verify test is not available */\n");
/* The following is available in H5pubconf.h. Printing them here for */
/* convenience. */
-#ifdef H5_HAVE_SIGNAL
- fprintf(rawoutstream, "/* Signal() support: yes */\n");
-#else
- fprintf(rawoutstream, "/* Signal() support: no */\n");
-#endif
-#ifdef H5_HAVE_SETJMP
- fprintf(rawoutstream, "/* setjmp() support: yes */\n");
-#else
- fprintf(rawoutstream, "/* setjmp() support: no */\n");
-#endif
-#ifdef H5_HAVE_LONGJMP
- fprintf(rawoutstream, "/* longjmp() support: yes */\n");
-#else
- fprintf(rawoutstream, "/* longjmp() support: no */\n");
-#endif
#ifdef H5_HAVE_SIGSETJMP
fprintf(rawoutstream, "/* sigsetjmp() support: yes */\n");
#else
@@ -1314,60 +1278,18 @@ detect_C89_floats(void)
static void HDF_NO_UBSAN
detect_C99_integers8(void)
{
-#if H5_SIZEOF_INT8_T > 0
-#if H5_SIZEOF_INT8_T == 1
DETECT_BYTE(int8_t, INT8, d_g[nd_g]);
nd_g++;
-#else
- DETECT_I(int8_t, INT8, d_g[nd_g]);
- nd_g++;
-#endif
-#endif
-#if H5_SIZEOF_UINT8_T > 0
-#if H5_SIZEOF_UINT8_T == 1
DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]);
nd_g++;
-#else
- DETECT_I(uint8_t, UINT8, d_g[nd_g]);
- nd_g++;
-#endif
-#endif
-#if H5_SIZEOF_INT_LEAST8_T > 0
-#if H5_SIZEOF_INT_LEAST8_T == 1
DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]);
nd_g++;
-#else
- DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]);
- nd_g++;
-#endif
-#endif
-#if H5_SIZEOF_UINT_LEAST8_T > 0
-#if H5_SIZEOF_UINT_LEAST8_T == 1
DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]);
nd_g++;
-#else
- DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]);
- nd_g++;
-#endif
-#endif
-#if H5_SIZEOF_INT_FAST8_T > 0
-#if H5_SIZEOF_INT_FAST8_T == 1
DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]);
nd_g++;
-#else
- DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]);
- nd_g++;
-#endif
-#endif
-#if H5_SIZEOF_UINT_FAST8_T > 0
-#if H5_SIZEOF_UINT_FAST8_T == 1
DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]);
nd_g++;
-#else
- DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]);
- nd_g++;
-#endif
-#endif
}
/*-------------------------------------------------------------------------
@@ -1381,30 +1303,18 @@ detect_C99_integers8(void)
static void HDF_NO_UBSAN
detect_C99_integers16(void)
{
-#if H5_SIZEOF_INT16_T > 0
DETECT_I(int16_t, INT16, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT16_T > 0
DETECT_I(uint16_t, UINT16, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_INT_LEAST16_T > 0
DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT_LEAST16_T > 0
DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_INT_FAST16_T > 0
DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT_FAST16_T > 0
DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]);
nd_g++;
-#endif
}
/*-------------------------------------------------------------------------
@@ -1418,30 +1328,18 @@ detect_C99_integers16(void)
static void HDF_NO_UBSAN
detect_C99_integers32(void)
{
-#if H5_SIZEOF_INT32_T > 0
DETECT_I(int32_t, INT32, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT32_T > 0
DETECT_I(uint32_t, UINT32, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_INT_LEAST32_T > 0
DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT_LEAST32_T > 0
DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_INT_FAST32_T > 0
DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT_FAST32_T > 0
DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]);
nd_g++;
-#endif
}
/*-------------------------------------------------------------------------
@@ -1456,47 +1354,23 @@ detect_C99_integers32(void)
static void HDF_NO_UBSAN
detect_C99_integers64(void)
{
-#if H5_SIZEOF_INT64_T > 0
DETECT_I(int64_t, INT64, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT64_T > 0
DETECT_I(uint64_t, UINT64, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_INT_LEAST64_T > 0
DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT_LEAST64_T > 0
DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_INT_FAST64_T > 0
DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_UINT_FAST64_T > 0
DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]);
nd_g++;
-#endif
-#if H5_SIZEOF_LONG_LONG > 0
DETECT_I(long long, LLONG, d_g[nd_g]);
nd_g++;
DETECT_I(unsigned long long, ULLONG, d_g[nd_g]);
nd_g++;
-#else
- /*
- * This architecture doesn't support an integer type larger than `long'
- * so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG since
- * `long long' is probably equivalent to `long' here anyway.
- */
- DETECT_I(long, LLONG, d_g[nd_g]);
- nd_g++;
- DETECT_I(unsigned long, ULLONG, d_g[nd_g]);
- nd_g++;
-#endif
}
/*-------------------------------------------------------------------------
@@ -1568,7 +1442,6 @@ detect_alignments(void)
na_g++;
}
-#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
/* Verify the signal handler for signal signum works correctly multiple times.
* One possible cause of failure is that the signal handling is blocked or
* changed to SIG_DFL after H5LONGJMP.
@@ -1625,7 +1498,6 @@ verify_signal_handlers(int signum, void (*handler)(int))
return 0;
}
}
-#endif
/*-------------------------------------------------------------------------
* Function: main
@@ -1655,22 +1527,6 @@ main(int argc, char *argv[])
if (!rawoutstream)
rawoutstream = stdout;
-#if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS)
-#if defined(UAC_NOPRINT) && defined(UAC_SIGBUS)
- /*
- * Make sure unaligned access generates SIGBUS and doesn't print warning
- * messages so that we can detect alignment constraints on the DEC Alpha.
- */
- int nvpairs[2];
- nvpairs[0] = SSIN_UACPROC;
- nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS;
- if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0) < 0) {
- fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", HDstrerror(errno));
- }
-#endif
-#endif
-
-#if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL)
/* verify the SIGBUS and SIGSEGV handlers work properly */
if (verify_signal_handlers(SIGBUS, sigbus_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n", "sigbus_handler", SIGBUS);
@@ -1681,9 +1537,6 @@ main(int argc, char *argv[])
if (verify_signal_handlers(SIGILL, sigill_handler) != 0) {
fprintf(stderr, "Signal handler %s for signal %d failed\n", "sigill_handler", SIGILL);
}
-#else
- align_status_g |= STA_NoHandlerVerify;
-#endif
print_header();
@@ -1714,4 +1567,4 @@ main(int argc, char *argv[])
return EXIT_SUCCESS;
}
-H5_GCC_DIAG_ON("cast-align")
+H5_GCC_CLANG_DIAG_ON("cast-align")
diff --git a/src/H5err.txt b/src/H5err.txt
index 64452ec..d2f1093 100644
--- a/src/H5err.txt
+++ b/src/H5err.txt
@@ -105,7 +105,7 @@ SECTION, PIPELINE, I/O pipeline errors
SECTION, SYSTEM, System level errors
SECTION, PLUGIN, Plugin errors
SECTION, MAP, Map related errors
-SECTION, ASYNC, Asynchronous I/O errors
+SECTION, ASYNC, Asynchronous operation errors
SECTION, NONE, No error
# Minor errors
@@ -139,6 +139,7 @@ MINOR, FILEACC, H5E_NOTHDF5, Not an HDF5 file
MINOR, FILEACC, H5E_BADFILE, Bad file ID accessed
MINOR, FILEACC, H5E_TRUNCATED, File has been truncated
MINOR, FILEACC, H5E_MOUNT, File mount error
+MINOR, FILEACC, H5E_UNMOUNT, File unmount error
MINOR, FILEACC, H5E_CANTDELETEFILE, Unable to delete file
MINOR, FILEACC, H5E_CANTLOCKFILE, Unable to lock file
MINOR, FILEACC, H5E_CANTUNLOCKFILE, Unable to unlock file
@@ -290,6 +291,7 @@ MINOR, MAP, H5E_CANTPUT, Can't put value
# Asynchronous operation errors
MINOR, ASYNC, H5E_CANTWAIT, Can't wait on operation
+MINOR, ASYNC, H5E_CANTCANCEL, Can't cancel operation
# No error, for backward compatibility */
MINOR, NONE, H5E_NONE_MINOR, No error
diff --git a/src/H5module.h b/src/H5module.h
index 64081bf..6d3cba8 100644
--- a/src/H5module.h
+++ b/src/H5module.h
@@ -27,8 +27,31 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5 H5
- * \brief General Library Functions
- * \todo Describe concisely what the functions in this module are about.
+ *
+ * Use the functions in this module to manage the life cycle of HDF5 library
+ * instances.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5_examples.c create
+ * </td>
+ * <td>
+ * \snippet{lineno} H5_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet{lineno} H5_examples.c update
+ * </td>
+ * <td>
+ * \snippet{lineno} H5_examples.c closing_shop
+ * \snippet{lineno} H5_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
+ *
*/
#endif /* H5module_H */
diff --git a/src/H5mpi.c b/src/H5mpi.c
index 9749721..4a8aa44 100644
--- a/src/H5mpi.c
+++ b/src/H5mpi.c
@@ -523,7 +523,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat
MPI_Type_get_extent(old_type, &unused_lb_arg, &old_extent);
}
- /* Set up the arguments for MPI_Type_struct constructor */
+ /* Set up the arguments for MPI_Type_create_struct() */
type[0] = outer_type;
type[1] = leftover_type;
block_len[0] = 1;
diff --git a/src/H5private.h b/src/H5private.h
index 46e669f..d1275dc 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -26,96 +26,46 @@
#include "H5public.h" /* Include Public Definitions */
-/* include the pthread header */
-#ifdef H5_HAVE_THREADSAFE
-#ifdef H5_HAVE_WIN32_API
-#ifndef H5_HAVE_WIN_THREADS
-#ifdef H5_HAVE_PTHREAD_H
-#include <pthread.h>
-#endif /* H5_HAVE_PTHREAD_H */
-#endif /* H5_HAVE_WIN_THREADS */
-#else /* H5_HAVE_WIN32_API */
-#ifdef H5_HAVE_PTHREAD_H
-#include <pthread.h>
-#endif /* H5_HAVE_PTHREAD_H */
-#endif /* H5_HAVE_WIN32_API */
-#endif /* H5_HAVE_THREADSAFE */
-
-/*
- * Include ANSI-C header files.
- */
-#ifdef H5_STDC_HEADERS
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
-#include <limits.h>
#include <math.h>
+#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
+#include <time.h>
-/*
- * If _POSIX_VERSION is defined in unistd.h then this system is Posix.1
- * compliant. Otherwise all bets are off.
- */
+/* POSIX headers */
+#ifdef H5_HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
#ifdef H5_HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
+#ifdef H5_HAVE_PWD_H
+#include <pwd.h>
#endif
-#ifdef _POSIX_VERSION
+#include <unistd.h>
#include <sys/wait.h>
-#include <pwd.h>
#endif
-/*
- * C9x integer types
- */
-#ifndef __cplusplus
-#ifdef H5_HAVE_STDINT_H
-#include <stdint.h>
-#endif
+/* Include the Pthreads header, if necessary */
+#if defined(H5_HAVE_THREADSAFE) && defined(H5_HAVE_PTHREAD_H)
+#include <pthread.h>
#endif
/*
- * The `struct stat' data type for stat() and fstat(). This is a Posix file
- * but often apears on non-Posix systems also. The `struct stat' is required
- * for hdf5 to compile, although only a few fields are actually used.
+ * The `struct stat' data type for stat() and fstat(). This is a POSIX file
+ * but often apears on non-POSIX systems also. The `struct stat' is required
+ * for HDF5 to compile, although only a few fields are actually used.
*/
#ifdef H5_HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
/*
- * If a program may include both `time.h' and `sys/time.h' then
- * TIME_WITH_SYS_TIME is defined (see AC_HEADER_TIME in configure.ac).
- * On some older systems, `sys/time.h' includes `time.h' but `time.h' is not
- * protected against multiple inclusion, so programs should not explicitly
- * include both files. This macro is useful in programs that use, for example,
- * `struct timeval' or `struct timezone' as well as `struct tm'. It is best
- * used in conjunction with `HAVE_SYS_TIME_H', whose existence is checked
- * by `AC_CHECK_HEADERS(sys/time.h)' in configure.ac.
- */
-#if defined(H5_TIME_WITH_SYS_TIME)
-#include <sys/time.h>
-#include <time.h>
-#elif defined(H5_HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-
-/*
- * Longjumps are used to detect alignment constrants
- */
-#ifdef H5_HAVE_SETJMP_H
-#include <setjmp.h>
-#endif
-
-/*
* flock() in sys/file.h is used for the implementation of file locking.
*/
#if defined(H5_HAVE_FLOCK) && defined(H5_HAVE_SYS_FILE_H)
@@ -139,21 +89,6 @@
#endif
/*
- * System information. These are needed on the DEC Alpha to turn off fixing
- * of unaligned accesses by the operating system during detection of
- * alignment constraints in H5detect.c:main().
- */
-#ifdef H5_HAVE_SYS_SYSINFO_H
-#include <sys/sysinfo.h>
-#endif
-#ifdef H5_HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef H5_HAVE_IO_H
-#include <io.h>
-#endif
-
-/*
* Dynamic library handling. These are needed for dynamically loading I/O
* filters and VFDs.
*/
@@ -173,40 +108,23 @@
#define H5_DEFAULT_VOL H5VL_NATIVE
#ifdef H5_HAVE_WIN32_API
+
/* The following two defines must be before any windows headers are included */
#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
#define NOGDI /* Exclude Graphic Display Interface macros */
-#ifdef H5_HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
+#include <windows.h>
+
+#include <direct.h> /* For _getcwd() */
+#include <io.h> /* POSIX I/O */
+#include <winsock2.h> /* For GetUserName() */
#ifdef H5_HAVE_THREADSAFE
#include <process.h> /* For _beginthread() */
#endif
-#include <windows.h>
-#include <direct.h> /* For _getcwd() */
-
#endif /*H5_HAVE_WIN32_API*/
-/* Various ways that inline functions can be declared */
-#if defined(H5_HAVE___INLINE__)
-/* GNU (alternative form) */
-#define H5_INLINE __inline__
-#elif defined(H5_HAVE___INLINE)
-/* Visual Studio */
-#define H5_INLINE __inline
-#elif defined(H5_HAVE_INLINE)
-/* GNU, C++
- * Use "inline" as a last resort on the off-chance that there will
- * be C++ problems.
- */
-#define H5_INLINE inline
-#else
-#define H5_INLINE
-#endif /* inline choices */
-
#ifndef F_OK
#define F_OK 00
#define W_OK 02
@@ -233,8 +151,8 @@
#define eventa(func_name) h5_mpe_eventa
#define eventb(func_name) h5_mpe_eventb
#define MPE_LOG_VARS \
- static int eventa(FUNC) = -1; \
- static int eventb(FUNC) = -1; \
+ static int eventa(__func__) = -1; \
+ static int eventb(__func__) = -1; \
char p_event_start[128];
/* Hardwire the color to "red", since that's what all the routines are using
@@ -246,14 +164,14 @@
*/
#define BEGIN_MPE_LOG \
if (H5_MPEinit_g) { \
- sprintf(p_event_start, "start %s", FUNC); \
- if (eventa(FUNC) == -1 && eventb(FUNC) == -1) { \
+ sprintf(p_event_start, "start %s", __func__); \
+ if (eventa(__func__) == -1 && eventb(__func__) == -1) { \
const char *p_color = "red"; \
- eventa(FUNC) = MPE_Log_get_event_number(); \
- eventb(FUNC) = MPE_Log_get_event_number(); \
- MPE_Describe_state(eventa(FUNC), eventb(FUNC), FUNC, p_color); \
+ eventa(__func__) = MPE_Log_get_event_number(); \
+ eventb(__func__) = MPE_Log_get_event_number(); \
+ MPE_Describe_state(eventa(__func__), eventb(__func__), __func__, p_color); \
} \
- MPE_Log_event(eventa(FUNC), 0, p_event_start); \
+ MPE_Log_event(eventa(__func__), 0, p_event_start); \
}
/*------------------------------------------------------------------------
@@ -264,7 +182,7 @@
*/
#define FINISH_MPE_LOG \
if (H5_MPEinit_g) { \
- MPE_Log_event(eventb(FUNC), 0, FUNC); \
+ MPE_Log_event(eventb(__func__), 0, __func__); \
}
#else /* H5_HAVE_MPE */
@@ -380,7 +298,6 @@
*/
#define SUCCEED 0
#define FAIL (-1)
-#define UFAIL (unsigned)(-1)
/* The HDF5 library uses the symbol `ERR` frequently. So do
* header files for libraries such as curses(3), terminfo(3), etc.
@@ -440,74 +357,6 @@
#endif
/*
- * Numeric data types. Some of these might be defined in Posix.1g, otherwise
- * we define them with the closest available type which is at least as large
- * as the number of bits indicated in the type name. The `int8' types *must*
- * be exactly one byte wide because we use it for pointer calculations to
- * void* memory.
- */
-#if H5_SIZEOF_INT8_T == 0
-typedef signed char int8_t;
-#undef H5_SIZEOF_INT8_T
-#define H5_SIZEOF_INT8_T H5_SIZEOF_CHAR
-#elif H5_SIZEOF_INT8_T == 1
-#else
-#error "the int8_t type must be 1 byte wide"
-#endif
-
-#if H5_SIZEOF_UINT8_T == 0
-typedef unsigned char uint8_t;
-#undef H5_SIZEOF_UINT8_T
-#define H5_SIZEOF_UINT8_T H5_SIZEOF_CHAR
-#elif H5_SIZEOF_UINT8_T == 1
-#else
-#error "the uint8_t type must be 1 byte wide"
-#endif
-
-#if H5_SIZEOF_INT16_T >= 2
-#elif H5_SIZEOF_SHORT >= 2
-typedef short int16_t;
-#undef H5_SIZEOF_INT16_T
-#define H5_SIZEOF_INT16_T H5_SIZEOF_SHORT
-#elif H5_SIZEOF_INT >= 2
-typedef int int16_t;
-#undef H5_SIZEOF_INT16_T
-#define H5_SIZEOF_INT16_T H5_SIZEOF_INT
-#else
-#error "nothing appropriate for int16_t"
-#endif
-
-#if H5_SIZEOF_UINT16_T >= 2
-#elif H5_SIZEOF_SHORT >= 2
-typedef unsigned short uint16_t;
-#undef H5_SIZEOF_UINT16_T
-#define H5_SIZEOF_UINT16_T H5_SIZEOF_SHORT
-#elif H5_SIZEOF_INT >= 2
-typedef unsigned uint16_t;
-#undef H5_SIZEOF_UINT16_T
-#define H5_SIZEOF_UINT16_T H5_SIZEOF_INT
-#else
-#error "nothing appropriate for uint16_t"
-#endif
-
-#if H5_SIZEOF_INT32_T >= 4
-#elif H5_SIZEOF_SHORT >= 4
-typedef short int32_t;
-#undef H5_SIZEOF_INT32_T
-#define H5_SIZEOF_INT32_T H5_SIZEOF_SHORT
-#elif H5_SIZEOF_INT >= 4
-typedef int int32_t;
-#undef H5_SIZEOF_INT32_T
-#define H5_SIZEOF_INT32_T H5_SIZEOF_INT
-#elif H5_SIZEOF_LONG >= 4
-typedef long int32_t;
-#undef H5_SIZEOF_INT32_T
-#define H5_SIZEOF_INT32_T H5_SIZEOF_LONG
-#else
-#error "nothing appropriate for int32_t"
-#endif
-
-/*
* Maximum and minimum values. These should be defined in <limits.h> for the
* most part.
*/
@@ -602,6 +451,55 @@ typedef long int32_t;
#define LOCK_UN 0x08
#endif /* H5_HAVE_FLOCK */
+/* Macros for enabling/disabling particular GCC / clang warnings
+ *
+ * These are duplicated in H5FDmulti.c (we don't want to put them in the
+ * public header and the multi VFD can't use private headers). If you make
+ * changes here, be sure to update those as well.
+ *
+ * (see the following web-sites for more info:
+ * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
+ * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
+ */
+#define H5_DIAG_JOINSTR(x, y) x y
+#define H5_DIAG_DO_PRAGMA(x) _Pragma(#x)
+#define H5_DIAG_PRAGMA(x) H5_DIAG_DO_PRAGMA(GCC diagnostic x)
+
+#define H5_DIAG_OFF(x) H5_DIAG_PRAGMA(push) H5_DIAG_PRAGMA(ignored H5_DIAG_JOINSTR("-W", x))
+#define H5_DIAG_ON(x) H5_DIAG_PRAGMA(pop)
+
+/* Macros for enabling/disabling particular GCC-only warnings.
+ * These pragmas are only implemented usefully in gcc 4.6+
+ */
+#if (((__GNUC__ * 100) + __GNUC_MINOR__) >= 406)
+#define H5_GCC_DIAG_OFF(x) H5_DIAG_OFF(x)
+#define H5_GCC_DIAG_ON(x) H5_DIAG_ON(x)
+#else
+#define H5_GCC_DIAG_OFF(x)
+#define H5_GCC_DIAG_ON(x)
+#endif
+
+/* Macros for enabling/disabling particular clang-only warnings.
+ */
+#if defined(__clang__)
+#define H5_CLANG_DIAG_OFF(x) H5_DIAG_OFF(x)
+#define H5_CLANG_DIAG_ON(x) H5_DIAG_ON(x)
+#else
+#define H5_CLANG_DIAG_OFF(x)
+#define H5_CLANG_DIAG_ON(x)
+#endif
+
+/* Macros for enabling/disabling particular GCC / clang warnings.
+ * These macros should be used for warnings supported by both gcc and clang.
+ */
+#if (((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || defined(__clang__)
+#define H5_GCC_CLANG_DIAG_OFF(x) H5_DIAG_OFF(x)
+#define H5_GCC_CLANG_DIAG_ON(x) H5_DIAG_ON(x)
+#else
+#define H5_GCC_CLANG_DIAG_OFF(x)
+#define H5_GCC_CLANG_DIAG_ON(x)
+#endif
+
/* Typedefs and functions for timing certain parts of the library. */
/* A set of elapsed/user/system times emitted as a time point by the
@@ -651,233 +549,231 @@ typedef struct {
haddr_t addr; /* The unique address of the object's header in that file */
} H5_obj_t;
-/*
- * Redefine all the POSIX functions. We should never see a POSIX
- * function (or any other non-HDF5 function) in the source!
+#define H5_SIZEOF_H5_STAT_SIZE_T H5_SIZEOF_OFF_T
+
+/* Put all Windows-specific definitions in H5win32defs.h so we
+ * can (mostly) assume a POSIX platform. Not all of the POSIX calls
+ * will have a Windows equivalent so some #ifdef protection is still
+ * necessary (e.g., fork()).
*/
+#include "H5win32defs.h"
-/* Put all platform-specific definitions in the following file */
-/* so that the following definitions are platform free. */
-#include "H5win32defs.h" /* For Windows-specific definitions */
+/* Platform-independent definitions for struct stat and off_t */
+#ifndef H5_HAVE_WIN32_API
+/* These definitions differ in Windows and are defined in
+ * H5win32defs for that platform.
+ */
+typedef struct stat h5_stat_t;
+typedef off_t h5_stat_size_t;
+#define HDoff_t off_t
+#endif
+
+#/* Redefine all the POSIX and C functions. We should never see an
+ * undecorated POSIX or C function (or any other non-HDF5 function)
+ * in the source.
+ */
#ifndef HDabort
#define HDabort() abort()
-#endif /* HDabort */
+#endif
#ifndef HDabs
#define HDabs(X) abs(X)
-#endif /* HDabs */
+#endif
#ifndef HDaccept
-#define HDaccept(A, B, C) accept((A), (B), (C)) /* mirror VFD */
-#endif /* HDaccept */
+#define HDaccept(A, B, C) accept((A), (B), (C))
+#endif
#ifndef HDaccess
#define HDaccess(F, M) access(F, M)
-#endif /* HDaccess */
+#endif
#ifndef HDacos
#define HDacos(X) acos(X)
-#endif /* HDacos */
-#ifndef HDvasprintf
-#ifdef H5_HAVE_VASPRINTF
-#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
-#endif /* H5_HAVE_VASPRINTF */
-#endif /* HDvasprintf */
+#endif
#ifndef HDalarm
-#ifdef H5_HAVE_ALARM
#define HDalarm(N) alarm(N)
-#else /* H5_HAVE_ALARM */
-#define HDalarm(N) (0)
-#endif /* H5_HAVE_ALARM */
-#endif /* HDalarm */
+#endif
#ifndef HDasctime
#define HDasctime(T) asctime(T)
-#endif /* HDasctime */
+#endif
#ifndef HDasin
#define HDasin(X) asin(X)
-#endif /* HDasin */
+#endif
#ifndef HDasprintf
#define HDasprintf asprintf /*varargs*/
-#endif /* HDasprintf */
+#endif
#ifndef HDassert
#define HDassert(X) assert(X)
-#endif /* HDassert */
+#endif
#ifndef HDatan
#define HDatan(X) atan(X)
-#endif /* HDatan */
+#endif
#ifndef HDatan2
#define HDatan2(X, Y) atan2(X, Y)
-#endif /* HDatan2 */
+#endif
#ifndef HDatexit
#define HDatexit(F) atexit(F)
-#endif /* HDatexit */
+#endif
#ifndef HDatof
#define HDatof(S) atof(S)
-#endif /* HDatof */
+#endif
#ifndef HDatoi
#define HDatoi(S) atoi(S)
-#endif /* HDatoi */
+#endif
#ifndef HDatol
#define HDatol(S) atol(S)
-#endif /* HDatol */
+#endif
#ifndef HDatoll
#define HDatoll(S) atoll(S)
-#endif /* HDatol */
+#endif
#ifndef HDbind
-#define HDbind(A, B, C) bind((A), (B), (C)) /* mirror VFD */
-#endif /* HDbind */
+#define HDbind(A, B, C) bind((A), (B), (C))
+#endif
#ifndef HDbsearch
#define HDbsearch(K, B, N, Z, F) bsearch(K, B, N, Z, F)
-#endif /* HDbsearch */
+#endif
#ifndef HDcalloc
#define HDcalloc(N, Z) calloc(N, Z)
-#endif /* HDcalloc */
+#endif
#ifndef HDceil
#define HDceil(X) ceil(X)
-#endif /* HDceil */
+#endif
#ifndef HDcfgetispeed
#define HDcfgetispeed(T) cfgetispeed(T)
-#endif /* HDcfgetispeed */
+#endif
#ifndef HDcfgetospeed
#define HDcfgetospeed(T) cfgetospeed(T)
-#endif /* HDcfgetospeed */
+#endif
#ifndef HDcfsetispeed
#define HDcfsetispeed(T, S) cfsetispeed(T, S)
-#endif /* HDcfsetispeed */
+#endif
#ifndef HDcfsetospeed
#define HDcfsetospeed(T, S) cfsetospeed(T, S)
-#endif /* HDcfsetospeed */
+#endif
#ifndef HDchdir
#define HDchdir(S) chdir(S)
-#endif /* HDchdir */
+#endif
#ifndef HDchmod
#define HDchmod(S, M) chmod(S, M)
-#endif /* HDchmod */
+#endif
#ifndef HDchown
#define HDchown(S, O, G) chown(S, O, G)
-#endif /* HDchown */
+#endif
#ifndef HDclearerr
#define HDclearerr(F) clearerr(F)
-#endif /* HDclearerr */
+#endif
#ifndef HDclock
#define HDclock() clock()
-#endif /* HDclock */
+#endif
#ifndef HDclock_gettime
#define HDclock_gettime(CID, TS) clock_gettime(CID, TS)
-#endif /* HDclock_gettime */
+#endif
#ifndef HDclose
#define HDclose(F) close(F)
-#endif /* HDclose */
+#endif
#ifndef HDclosedir
#define HDclosedir(D) closedir(D)
-#endif /* HDclosedir */
+#endif
#ifndef HDconnect
-#define HDconnect(A, B, C) connect((A), (B), (C)) /* mirror VFD */
-#endif /* HDconnect */
+#define HDconnect(A, B, C) connect((A), (B), (C))
+#endif
#ifndef HDcos
#define HDcos(X) cos(X)
-#endif /* HDcos */
+#endif
#ifndef HDcosh
#define HDcosh(X) cosh(X)
-#endif /* HDcosh */
+#endif
#ifndef HDcreat
#define HDcreat(S, M) creat(S, M)
-#endif /* HDcreat */
+#endif
#ifndef HDctermid
#define HDctermid(S) ctermid(S)
-#endif /* HDctermid */
+#endif
#ifndef HDctime
#define HDctime(T) ctime(T)
-#endif /* HDctime */
+#endif
#ifndef HDcuserid
#define HDcuserid(S) cuserid(S)
-#endif /* HDcuserid */
+#endif
#ifndef HDdifftime
-#ifdef H5_HAVE_DIFFTIME
#define HDdifftime(X, Y) difftime(X, Y)
-#else /* H5_HAVE_DIFFTIME */
-#define HDdifftime(X, Y) ((double)(X) - (double)(Y))
-#endif /* H5_HAVE_DIFFTIME */
-#endif /* HDdifftime */
+#endif
#ifndef HDdiv
#define HDdiv(X, Y) div(X, Y)
-#endif /* HDdiv */
+#endif
#ifndef HDdup
#define HDdup(F) dup(F)
-#endif /* HDdup */
+#endif
#ifndef HDdup2
#define HDdup2(F, I) dup2(F, I)
-#endif /* HDdup2 */
-/* execl() variable arguments */
-/* execle() variable arguments */
-/* execlp() variable arguments */
+#endif
#ifndef HDexecv
#define HDexecv(S, AV) execv(S, AV)
-#endif /* HDexecv */
+#endif
#ifndef HDexecve
#define HDexecve(S, AV, E) execve(S, AV, E)
-#endif /* HDexecve */
+#endif
#ifndef HDexecvp
#define HDexecvp(S, AV) execvp(S, AV)
-#endif /* HDexecvp */
+#endif
#ifndef HDexit
#define HDexit(N) exit(N)
-#endif /* HDexit */
+#endif
#ifndef HD_exit
#define HD_exit(N) _exit(N)
-#endif /* HD_exit */
+#endif
#ifndef HDexp
#define HDexp(X) exp(X)
-#endif /* HDexp */
+#endif
#ifndef HDexp2
#define HDexp2(X) exp2(X)
-#endif /* HDexp2 */
+#endif
#ifndef HDfabs
#define HDfabs(X) fabs(X)
-#endif /* HDfabs */
-/* use ABS() because fabsf() fabsl() are not common yet. */
+#endif
#ifndef HDfabsf
-#define HDfabsf(X) ABS(X)
-#endif /* HDfabsf */
+#define HDfabsf(X) fabsf(X)
+#endif
#ifndef HDfabsl
-#define HDfabsl(X) ABS(X)
-#endif /* HDfabsl */
+#define HDfabsl(X) fabsl(X)
+#endif
#ifndef HDfclose
#define HDfclose(F) fclose(F)
-#endif /* HDfclose */
-#ifdef H5_HAVE_FCNTL
+#endif
#ifndef HDfcntl
#define HDfcntl(F, C, ...) fcntl(F, C, __VA_ARGS__)
-#endif /* HDfcntl */
-#endif /* H5_HAVE_FCNTL */
+#endif
#ifndef HDfdopen
#define HDfdopen(N, S) fdopen(N, S)
-#endif /* HDfdopen */
+#endif
#ifndef HDfeof
#define HDfeof(F) feof(F)
-#endif /* HDfeof */
+#endif
#ifndef HDferror
#define HDferror(F) ferror(F)
-#endif /* HDferror */
+#endif
#ifndef HDfflush
#define HDfflush(F) fflush(F)
-#endif /* HDfflush */
+#endif
#ifndef HDfgetc
#define HDfgetc(F) fgetc(F)
-#endif /* HDfgetc */
+#endif
#ifndef HDfgetpos
#define HDfgetpos(F, P) fgetpos(F, P)
-#endif /* HDfgetpos */
+#endif
#ifndef HDfgets
#define HDfgets(S, N, F) fgets(S, N, F)
-#endif /* HDfgets */
+#endif
#ifndef HDfileno
#define HDfileno(F) fileno(F)
-#endif /* HDfileno */
+#endif
+
/* Since flock is so prevalent, always build these functions
* when possible to avoid them becoming dead code.
*/
#ifdef H5_HAVE_FCNTL
H5_DLL int Pflock(int fd, int operation);
-#endif /* H5_HAVE_FCNTL */
+#endif
H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
+
#ifndef HDflock
/* NOTE: flock(2) is not present on all POSIX systems.
* If it is not present, we try a flock() equivalent based on
@@ -891,814 +787,801 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
#define HDflock(F, L) Pflock(F, L)
#else
#define HDflock(F, L) Nflock(F, L)
-#endif /* H5_HAVE_FLOCK */
+#endif
+
#endif /* HDflock */
+
#ifndef HDfloor
#define HDfloor(X) floor(X)
-#endif /* HDfloor */
+#endif
#ifndef HDfmod
#define HDfmod(X, Y) fmod(X, Y)
-#endif /* HDfmod */
+#endif
#ifndef HDfopen
#define HDfopen(S, M) fopen(S, M)
-#endif /* HDfopen */
+#endif
#ifndef HDfork
#define HDfork() fork()
-#endif /* HDfork */
+#endif
#ifndef HDfprintf
#define HDfprintf fprintf
#endif
#ifndef HDfpathconf
#define HDfpathconf(F, N) fpathconf(F, N)
-#endif /* HDfpathconf */
+#endif
#ifndef HDfputc
#define HDfputc(C, F) fputc(C, F)
-#endif /* HDfputc */
+#endif
#ifndef HDfputs
#define HDfputs(S, F) fputs(S, F)
-#endif /* HDfputs */
+#endif
#ifndef HDfread
#define HDfread(M, Z, N, F) fread(M, Z, N, F)
-#endif /* HDfread */
+#endif
#ifndef HDfree
#define HDfree(M) free(M)
-#endif /* HDfree */
+#endif
#ifndef HDfreopen
#define HDfreopen(S, M, F) freopen(S, M, F)
-#endif /* HDfreopen */
+#endif
#ifndef HDfrexp
#define HDfrexp(X, N) frexp(X, N)
-#endif /* HDfrexp */
-/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
+#endif
#ifndef HDfrexpf
-#ifdef H5_HAVE_FREXPF
#define HDfrexpf(X, N) frexpf(X, N)
-#else /* H5_HAVE_FREXPF */
-#define HDfrexpf(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPF */
-#endif /* HDfrexpf */
+#endif
#ifndef HDfrexpl
-#ifdef H5_HAVE_FREXPL
#define HDfrexpl(X, N) frexpl(X, N)
-#else /* H5_HAVE_FREXPL */
-#define HDfrexpl(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPL */
-#endif /* HDfrexpl */
-/* fscanf() variable arguments */
+#endif
+#ifndef HDfscanf
+#define HDfscanf fscanf
+#endif
#ifndef HDfseek
#define HDfseek(F, O, W) fseeko(F, O, W)
-#endif /* HDfseek */
+#endif
#ifndef HDfsetpos
#define HDfsetpos(F, P) fsetpos(F, P)
-#endif /* HDfsetpos */
+#endif
#ifndef HDfstat
#define HDfstat(F, B) fstat(F, B)
-#endif /* HDfstat */
-#ifndef HDlstat
-#define HDlstat(S, B) lstat(S, B)
-#endif /* HDlstat */
-#ifndef HDstat
-#define HDstat(S, B) stat(S, B)
-#endif /* HDstat */
-
-#ifndef H5_HAVE_WIN32_API
-/* These definitions differ in Windows and are defined in
- * H5win32defs for that platform.
- */
-typedef struct stat h5_stat_t;
-typedef off_t h5_stat_size_t;
-#define HDoff_t off_t
-#endif /* H5_HAVE_WIN32_API */
-
-#define H5_SIZEOF_H5_STAT_SIZE_T H5_SIZEOF_OFF_T
-
+#endif
#ifndef HDftell
#define HDftell(F) ftell(F)
-#endif /* HDftell */
+#endif
#ifndef HDftruncate
#define HDftruncate(F, L) ftruncate(F, L)
-#endif /* HDftruncate */
+#endif
#ifndef HDfwrite
#define HDfwrite(M, Z, N, F) fwrite(M, Z, N, F)
-#endif /* HDfwrite */
+#endif
#ifndef HDgetc
#define HDgetc(F) getc(F)
-#endif /* HDgetc */
+#endif
#ifndef HDgetchar
#define HDgetchar() getchar()
-#endif /* HDgetchar */
+#endif
#ifndef HDgetcwd
#define HDgetcwd(S, Z) getcwd(S, Z)
-#endif /* HDgetcwd */
+#endif
#ifndef HDgetdcwd
#define HDgetdcwd(D, S, Z) getcwd(S, Z)
-#endif /* HDgetdcwd */
+#endif
+
+/* Windows only - set to zero on other systems */
#ifndef HDgetdrive
#define HDgetdrive() 0
-#endif /* HDgetdrive */
+#endif
+
#ifndef HDgetegid
#define HDgetegid() getegid()
-#endif /* HDgetegid() */
+#endif
#ifndef HDgetenv
#define HDgetenv(S) getenv(S)
-#endif /* HDgetenv */
+#endif
#ifndef HDgeteuid
#define HDgeteuid() geteuid()
-#endif /* HDgeteuid */
+#endif
#ifndef HDgetgid
#define HDgetgid() getgid()
-#endif /* HDgetgid */
+#endif
#ifndef HDgetgrgid
#define HDgetgrgid(G) getgrgid(G)
-#endif /* HDgetgrgid */
+#endif
#ifndef HDgetgrnam
#define HDgetgrnam(S) getgrnam(S)
-#endif /* HDgetgrnam */
+#endif
#ifndef HDgetgroups
#define HDgetgroups(Z, G) getgroups(Z, G)
-#endif /* HDgetgroups */
+#endif
#ifndef HDgethostbyaddr
-#define HDgethostbyaddr(A, B, C) gethostbyaddr((A), (B), (C)) /* mirror VFD */
-#endif /* HDgethostbyaddr */
+#define HDgethostbyaddr(A, B, C) gethostbyaddr((A), (B), (C))
+#endif
#ifndef HDgethostname
#define HDgethostname(N, L) gethostname(N, L)
-#endif /* HDgethostname */
+#endif
#ifndef HDgetlogin
#define HDgetlogin() getlogin()
-#endif /* HDgetlogin */
+#endif
#ifndef HDgetpgrp
#define HDgetpgrp() getpgrp()
-#endif /* HDgetpgrp */
+#endif
#ifndef HDgetpid
#define HDgetpid() getpid()
-#endif /* HDgetpid */
+#endif
#ifndef HDgetppid
#define HDgetppid() getppid()
-#endif /* HDgetppid */
+#endif
#ifndef HDgetpwnam
#define HDgetpwnam(S) getpwnam(S)
-#endif /* HDgetpwnam */
+#endif
#ifndef HDgetpwuid
#define HDgetpwuid(U) getpwuid(U)
-#endif /* HDgetpwuid */
+#endif
#ifndef HDgetrusage
#define HDgetrusage(X, S) getrusage(X, S)
-#endif /* HDgetrusage */
+#endif
/* Don't define HDgets - gets() was deprecated in C99 and removed in C11 */
#ifdef HDgets
#undef HDgets
-#endif /* HDgets */
+#endif
#ifndef HDgettimeofday
#define HDgettimeofday(S, P) gettimeofday(S, P)
-#endif /* HDgettimeofday */
+#endif
#ifndef HDgetuid
#define HDgetuid() getuid()
-#endif /* HDgetuid */
+#endif
#ifndef HDgmtime
#define HDgmtime(T) gmtime(T)
-#endif /* HDgmtime */
+#endif
#ifndef HDhtonl
-#define HDhtonl(X) htonl((X)) /* mirror VFD */
-#endif /* HDhtonl */
+#define HDhtonl(X) htonl((X))
+#endif
#ifndef HDhtons
-#define HDhtons(X) htons((X)) /* mirror VFD */
-#endif /* HDhtons */
+#define HDhtons(X) htons((X))
+#endif
#ifndef HDinet_addr
-#define HDinet_addr(C) inet_addr((C)) /* mirror VFD */
-#endif /* HDinet_addr */
+#define HDinet_addr(C) inet_addr((C))
+#endif
#ifndef HDinet_ntoa
-#define HDinet_ntoa(C) inet_ntoa((C)) /* mirror VFD */
-#endif /* HDinet_ntoa */
+#define HDinet_ntoa(C) inet_ntoa((C))
+#endif
#ifndef HDisalnum
-#define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/
-#endif /* HDisalnum */
+#define HDisalnum(C) isalnum((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDisalpha
-#define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/
-#endif /* HDisalpha */
+#define HDisalpha(C) isalpha((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDisatty
#define HDisatty(F) isatty(F)
-#endif /* HDisatty */
+#endif
#ifndef HDiscntrl
-#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/
-#endif /* HDiscntrl */
+#define HDiscntrl(C) iscntrl((int)(C)) /* Cast for solaris warning */
+#endif
#ifndef HDisdigit
-#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/
-#endif /* HDisdigit */
+#define HDisdigit(C) isdigit((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDisgraph
-#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/
-#endif /* HDisgraph */
+#define HDisgraph(C) isgraph((int)(C)) /* Cast for Solaris warning*/
+#endif
#ifndef HDislower
-#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/
-#endif /* HDislower */
+#define HDislower(C) islower((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDisnan
#define HDisnan(X) isnan(X)
-#endif /* HDisnan */
+#endif
#ifndef HDisprint
-#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/
-#endif /* HDisprint */
+#define HDisprint(C) isprint((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDispunct
-#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/
-#endif /* HDispunct */
+#define HDispunct(C) ispunct((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDisspace
-#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/
-#endif /* HDisspace */
+#define HDisspace(C) isspace((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDisupper
-#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/
-#endif /* HDisupper */
+#define HDisupper(C) isupper((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDisxdigit
-#define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/
-#endif /* HDisxdigit */
+#define HDisxdigit(C) isxdigit((int)(C)) /* Cast for Solaris warning */
+#endif
#ifndef HDkill
#define HDkill(P, S) kill(P, S)
-#endif /* HDkill */
+#endif
#ifndef HDlabs
#define HDlabs(X) labs(X)
-#endif /* HDlabs */
+#endif
#ifndef HDldexp
#define HDldexp(X, N) ldexp(X, N)
-#endif /* HDldexp */
+#endif
#ifndef HDldiv
#define HDldiv(X, Y) ldiv(X, Y)
-#endif /* HDldiv */
+#endif
#ifndef HDlink
#define HDlink(OLD, NEW) link(OLD, NEW)
-#endif /* HDlink */
+#endif
#ifndef HDlisten
-#define HDlisten(A, B) listen((A), (B)) /* mirror VFD */
-#endif /* HDlisten */
+#define HDlisten(A, B) listen((A), (B))
+#endif
#ifndef HDllround
#define HDllround(V) llround(V)
-#endif /* HDround */
+#endif
#ifndef HDllroundf
#define HDllroundf(V) llroundf(V)
-#endif /* HDllroundf */
+#endif
#ifndef HDllroundl
#define HDllroundl(V) llroundl(V)
-#endif /* HDllroundl */
+#endif
#ifndef HDlocaleconv
#define HDlocaleconv() localeconv()
-#endif /* HDlocaleconv */
+#endif
#ifndef HDlocaltime
#define HDlocaltime(T) localtime(T)
-#endif /* HDlocaltime */
+#endif
#ifndef HDlog
#define HDlog(X) log(X)
-#endif /* HDlog */
+#endif
#ifndef HDlog10
#define HDlog10(X) log10(X)
-#endif /* HDlog10 */
+#endif
#ifndef HDlongjmp
#define HDlongjmp(J, N) longjmp(J, N)
-#endif /* HDlongjmp */
+#endif
#ifndef HDlround
#define HDlround(V) lround(V)
-#endif /* HDround */
+#endif
#ifndef HDlroundf
#define HDlroundf(V) lroundf(V)
-#endif /* HDlroundf */
+#endif
#ifndef HDlroundl
#define HDlroundl(V) lroundl(V)
-#endif /* HDroundl */
+#endif
#ifndef HDlseek
#define HDlseek(F, O, W) lseek(F, O, W)
-#endif /* HDlseek */
+#endif
+#ifndef HDlstat
+#define HDlstat(S, B) lstat(S, B)
+#endif
#ifndef HDmalloc
#define HDmalloc(Z) malloc(Z)
-#endif /* HDmalloc */
+#endif
#ifndef HDposix_memalign
#define HDposix_memalign(P, A, Z) posix_memalign(P, A, Z)
-#endif /* HDposix_memalign */
+#endif
#ifndef HDmblen
#define HDmblen(S, N) mblen(S, N)
-#endif /* HDmblen */
+#endif
#ifndef HDmbstowcs
#define HDmbstowcs(P, S, Z) mbstowcs(P, S, Z)
-#endif /* HDmbstowcs */
+#endif
#ifndef HDmbtowc
#define HDmbtowc(P, S, Z) mbtowc(P, S, Z)
-#endif /* HDmbtowc */
+#endif
#ifndef HDmemchr
#define HDmemchr(S, C, Z) memchr(S, C, Z)
-#endif /* HDmemchr */
+#endif
#ifndef HDmemcmp
#define HDmemcmp(X, Y, Z) memcmp(X, Y, Z)
-#endif /* HDmemcmp */
+#endif
#ifndef HDmemcpy
#define HDmemcpy(X, Y, Z) memcpy(X, Y, Z)
-#endif /* HDmemcpy */
+#endif
#ifndef HDmemmove
#define HDmemmove(X, Y, Z) memmove((char *)(X), (const char *)(Y), Z)
-#endif /* HDmemmove */
+#endif
#ifndef HDmemset
#define HDmemset(X, C, Z) memset(X, C, Z)
-#endif /* HDmemset */
+#endif
#ifndef HDmkdir
#define HDmkdir(S, M) mkdir(S, M)
-#endif /* HDmkdir */
+#endif
#ifndef HDmkfifo
#define HDmkfifo(S, M) mkfifo(S, M)
-#endif /* HDmkfifo */
+#endif
#ifndef HDmktime
#define HDmktime(T) mktime(T)
-#endif /* HDmktime */
+#endif
#ifndef HDmodf
#define HDmodf(X, Y) modf(X, Y)
-#endif /* HDmodf */
+#endif
#ifndef HDnanosleep
#define HDnanosleep(N, O) nanosleep(N, O)
-#endif /* HDnanosleep */
+#endif
#ifndef HDntohl
-#define HDntohl(A) ntohl((A)) /* mirror VFD */
-#endif /* HDntohl */
+#define HDntohl(A) ntohl((A))
+#endif
#ifndef HDntohs
-#define HDntohs(A) ntohs((A)) /* mirror VFD */
-#endif /* HDntohs */
+#define HDntohs(A) ntohs((A))
+#endif
#ifndef HDopen
#define HDopen(F, ...) open(F, __VA_ARGS__)
-#endif /* HDopen */
+#endif
#ifndef HDopendir
#define HDopendir(S) opendir(S)
-#endif /* HDopendir */
+#endif
#ifndef HDpathconf
#define HDpathconf(S, N) pathconf(S, N)
-#endif /* HDpathconf */
+#endif
#ifndef HDpause
#define HDpause() pause()
-#endif /* HDpause */
+#endif
#ifndef HDperror
#define HDperror(S) perror(S)
-#endif /* HDperror */
+#endif
#ifndef HDpipe
#define HDpipe(F) pipe(F)
-#endif /* HDpipe */
+#endif
#ifndef HDpow
#define HDpow(X, Y) pow(X, Y)
-#endif /* HDpow */
+#endif
#ifndef HDpowf
#define HDpowf(X, Y) powf(X, Y)
-#endif /* HDpowf */
+#endif
#ifndef HDpread
#define HDpread(F, B, C, O) pread(F, B, C, O)
-#endif /* HDpread */
+#endif
#ifndef HDprintf
-#define HDprintf printf
-#endif /* HDprintf */
+#define HDprintf printf /*varargs*/
+#endif
#ifndef HDpthread_attr_destroy
#define HDpthread_attr_destroy(A) pthread_attr_destroy(A)
-#endif /* HDpthread_attr_destroy */
+#endif
#ifndef HDpthread_attr_init
#define HDpthread_attr_init(A) pthread_attr_init(A)
-#endif /* HDpthread_attr_init */
+#endif
#ifndef HDpthread_attr_setscope
#define HDpthread_attr_setscope(A, S) pthread_attr_setscope(A, S)
-#endif /* HDpthread_attr_setscope */
+#endif
#ifndef HDpthread_cond_init
#define HDpthread_cond_init(C, A) pthread_cond_init(C, A)
-#endif /* HDpthread_cond_init */
+#endif
#ifndef HDpthread_cond_signal
#define HDpthread_cond_signal(C) pthread_cond_signal(C)
-#endif /* HDpthread_cond_signal */
+#endif
#ifndef HDpthread_cond_wait
#define HDpthread_cond_wait(C, M) pthread_cond_wait(C, M)
-#endif /* HDpthread_cond_wait */
+#endif
#ifndef HDpthread_create
#define HDpthread_create(R, A, F, U) pthread_create(R, A, F, U)
-#endif /* HDpthread_create */
+#endif
#ifndef HDpthread_equal
#define HDpthread_equal(T1, T2) pthread_equal(T1, T2)
-#endif /* HDpthread_equal */
+#endif
#ifndef HDpthread_getspecific
#define HDpthread_getspecific(K) pthread_getspecific(K)
-#endif /* HDpthread_getspecific */
+#endif
#ifndef HDpthread_join
#define HDpthread_join(T, V) pthread_join(T, V)
-#endif /* HDpthread_join */
+#endif
#ifndef HDpthread_key_create
#define HDpthread_key_create(K, D) pthread_key_create(K, D)
-#endif /* HDpthread_key_create */
+#endif
#ifndef HDpthread_mutex_init
#define HDpthread_mutex_init(M, A) pthread_mutex_init(M, A)
-#endif /* HDpthread_mutex_init */
+#endif
#ifndef HDpthread_mutex_lock
#define HDpthread_mutex_lock(M) pthread_mutex_lock(M)
-#endif /* HDpthread_mutex_lock */
+#endif
#ifndef HDpthread_mutex_unlock
#define HDpthread_mutex_unlock(M) pthread_mutex_unlock(M)
-#endif /* HDpthread_mutex_unlock */
+#endif
#ifndef HDpthread_self
#define HDpthread_self() pthread_self()
-#endif /* HDpthread_self */
+#endif
#ifndef HDpthread_setcancelstate
#define HDpthread_setcancelstate(N, O) pthread_setcancelstate(N, O)
-#endif /* HDpthread_setcancelstate */
+#endif
#ifndef HDpthread_setspecific
#define HDpthread_setspecific(K, V) pthread_setspecific(K, V)
-#endif /* HDpthread_setspecific */
+#endif
#ifndef HDputc
#define HDputc(C, F) putc(C, F)
-#endif /* HDputc*/
+#endif
#ifndef HDputchar
#define HDputchar(C) putchar(C)
-#endif /* HDputchar */
+#endif
#ifndef HDputs
#define HDputs(S) puts(S)
-#endif /* HDputs */
+#endif
#ifndef HDpwrite
#define HDpwrite(F, B, C, O) pwrite(F, B, C, O)
-#endif /* HDpwrite */
+#endif
#ifndef HDqsort
#define HDqsort(M, N, Z, F) qsort(M, N, Z, F)
-#endif /* HDqsort*/
+#endif
#ifndef HDraise
#define HDraise(N) raise(N)
-#endif /* HDraise */
+#endif
+/* clang-format off */
#ifdef H5_HAVE_RAND_R
-#ifndef HDrandom
-#define HDrandom() HDrand()
-#endif /* HDrandom */
-H5_DLL int HDrand(void);
-#ifndef HDsrandom
-#define HDsrandom(S) HDsrand(S)
-#endif /* HDsrandom */
-H5_DLL void HDsrand(unsigned int seed);
+# ifndef HDrandom
+# define HDrandom() HDrand()
+# endif
+ H5_DLL int HDrand(void);
+# ifndef HDsrandom
+# define HDsrandom(S) HDsrand(S)
+# endif
+ H5_DLL void HDsrand(unsigned int seed);
#elif defined(H5_HAVE_RANDOM)
-#ifndef HDrand
-#define HDrand() random()
-#endif /* HDrand */
-#ifndef HDrandom
-#define HDrandom() random()
-#endif /* HDrandom */
-#ifndef HDsrand
-#define HDsrand(S) srandom(S)
-#endif /* HDsrand */
-#ifndef HDsrandom
-#define HDsrandom(S) srandom(S)
-#endif /* HDsrandom */
-#else /* H5_HAVE_RANDOM */
-#ifndef HDrand
-#define HDrand() rand()
-#endif /* HDrand */
-#ifndef HDrandom
-#define HDrandom() rand()
-#endif /* HDrandom */
-#ifndef HDsrand
-#define HDsrand(S) srand(S)
-#endif /* HDsrand */
-#ifndef HDsrandom
-#define HDsrandom(S) srand(S)
-#endif /* HDsrandom */
-#endif /* H5_HAVE_RANDOM */
+# ifndef HDrand
+# define HDrand() random()
+# endif
+# ifndef HDrandom
+# define HDrandom() random()
+# endif
+# ifndef HDsrand
+# define HDsrand(S) srandom(S)
+# endif
+# ifndef HDsrandom
+# define HDsrandom(S) srandom(S)
+# endif
+#else
+# ifndef HDrand
+# define HDrand() rand()
+# endif
+# ifndef HDrandom
+# define HDrandom() rand()
+# endif
+# ifndef HDsrand
+# define HDsrand(S) srand(S)
+# endif
+# ifndef HDsrandom
+# define HDsrandom(S) srand(S)
+# endif
+#endif
+/* clang-format on */
#ifndef HDread
#define HDread(F, M, Z) read(F, M, Z)
-#endif /* HDread */
+#endif
#ifndef HDreaddir
#define HDreaddir(D) readdir(D)
-#endif /* HDreaddir */
+#endif
#ifndef HDrealloc
#define HDrealloc(M, Z) realloc(M, Z)
-#endif /* HDrealloc */
+#endif
#ifndef HDrealpath
#define HDrealpath(F1, F2) realpath(F1, F2)
-#endif /* HDrealloc */
+#endif
#ifndef HDremove
#define HDremove(S) remove(S)
-#endif /* HDremove */
+#endif
#ifndef HDrename
#define HDrename(OLD, NEW) rename(OLD, NEW)
-#endif /* HDrename */
+#endif
#ifndef HDrewind
#define HDrewind(F) rewind(F)
-#endif /* HDrewind */
+#endif
#ifndef HDrewinddir
#define HDrewinddir(D) rewinddir(D)
-#endif /* HDrewinddir */
+#endif
#ifndef HDround
#define HDround(V) round(V)
-#endif /* HDround */
+#endif
#ifndef HDroundf
#define HDroundf(V) roundf(V)
-#endif /* HDroundf */
+#endif
#ifndef HDroundl
#define HDroundl(V) roundl(V)
-#endif /* HDroundl */
+#endif
#ifndef HDrmdir
#define HDrmdir(S) rmdir(S)
-#endif /* HDrmdir */
-/* scanf() variable arguments */
+#endif
+#ifndef HDscanf
+#define HDscanf scanf /*varargs*/
+#endif
#ifndef HDselect
#define HDselect(N, RD, WR, ER, T) select(N, RD, WR, ER, T)
-#endif /* HDsetbuf */
+#endif
#ifndef HDsetbuf
#define HDsetbuf(F, S) setbuf(F, S)
-#endif /* HDsetbuf */
+#endif
#ifndef HDsetenv
#define HDsetenv(N, V, O) setenv(N, V, O)
-#endif /* HDsetenv */
+#endif
#ifndef HDsetgid
#define HDsetgid(G) setgid(G)
-#endif /* HDsetgid */
+#endif
#ifndef HDsetjmp
#define HDsetjmp(J) setjmp(J)
-#endif /* HDsetjmp */
+#endif
#ifndef HDsetlocale
#define HDsetlocale(N, S) setlocale(N, S)
-#endif /* HDsetlocale */
+#endif
#ifndef HDsetpgid
#define HDsetpgid(P, PG) setpgid(P, PG)
-#endif /* HDsetpgid */
+#endif
#ifndef HDsetsid
#define HDsetsid() setsid()
-#endif /* HDsetsid */
+#endif
#ifndef HDsetsockopt
-#define HDsetsockopt(A, B, C, D, E) setsockopt((A), (B), (C), (D), (E)) /* mirror VFD */
-#endif /* HDsetsockopt */
+#define HDsetsockopt(A, B, C, D, E) setsockopt((A), (B), (C), (D), (E))
+#endif
#ifndef HDsetuid
#define HDsetuid(U) setuid(U)
-#endif /* HDsetuid */
+#endif
#ifndef HDsetvbuf
#define HDsetvbuf(F, S, M, Z) setvbuf(F, S, M, Z)
-#endif /* HDsetvbuf */
+#endif
#ifndef HDshutdown
-#define HDshutdown(A, B) shutdown((A), (B)) /* mirror VFD */
-#endif /* HDshutdown */
+#define HDshutdown(A, B) shutdown((A), (B))
+#endif
#ifndef HDsigaction
#define HDsigaction(S, A, O) sigaction((S), (A), (O))
-#endif /* HDsigaction */
+#endif
#ifndef HDsigaddset
#define HDsigaddset(S, N) sigaddset(S, N)
-#endif /* HDsigaddset */
+#endif
#ifndef HDsigdelset
#define HDsigdelset(S, N) sigdelset(S, N)
-#endif /* HDsigdelset */
+#endif
#ifndef HDsigemptyset
#define HDsigemptyset(S) sigemptyset(S)
-#endif /* HDsigemptyset */
+#endif
#ifndef HDsigfillset
#define HDsigfillset(S) sigfillset(S)
-#endif /* HDsigfillset */
+#endif
#ifndef HDsigismember
#define HDsigismember(S, N) sigismember(S, N)
-#endif /* HDsigismember */
+#endif
#ifndef HDsiglongjmp
#define HDsiglongjmp(J, N) siglongjmp(J, N)
-#endif /* HDsiglongjmp */
+#endif
#ifndef HDsignal
#define HDsignal(N, F) signal(N, F)
-#endif /* HDsignal */
+#endif
#ifndef HDsigpending
#define HDsigpending(S) sigpending(S)
-#endif /* HDsigpending */
+#endif
#ifndef HDsigprocmask
#define HDsigprocmask(H, S, O) sigprocmask(H, S, O)
-#endif /* HDsigprocmask */
+#endif
#ifndef HDsigsetjmp
#define HDsigsetjmp(J, N) sigsetjmp(J, N)
-#endif /* HDsigsetjmp */
+#endif
#ifndef HDsigsuspend
#define HDsigsuspend(S) sigsuspend(S)
-#endif /* HDsigsuspend */
+#endif
#ifndef HDsin
#define HDsin(X) sin(X)
-#endif /* HDsin */
+#endif
#ifndef HDsinh
#define HDsinh(X) sinh(X)
-#endif /* HDsinh */
+#endif
#ifndef HDsleep
#define HDsleep(N) sleep(N)
-#endif /* HDsleep */
+#endif
#ifndef HDsnprintf
#define HDsnprintf snprintf /*varargs*/
-#endif /* HDsnprintf */
+#endif
#ifndef HDsocket
-#define HDsocket(A, B, C) socket((A), (B), (C)) /* mirror VFD */
-#endif /* HDsocket */
+#define HDsocket(A, B, C) socket((A), (B), (C))
+#endif
#ifndef HDsprintf
#define HDsprintf sprintf /*varargs*/
-#endif /* HDsprintf */
+#endif
#ifndef HDsqrt
#define HDsqrt(X) sqrt(X)
-#endif /* HDsqrt */
+#endif
#ifndef HDsscanf
-#define HDsscanf(S, FMT, ...) sscanf(S, FMT, __VA_ARGS__)
-#endif /* HDsscanf */
+#define HDsscanf sscanf /*varargs*/
+#endif
+#ifndef HDstat
+#define HDstat(S, B) stat(S, B)
+#endif
#ifndef HDstrcat
#define HDstrcat(X, Y) strcat(X, Y)
-#endif /* HDstrcat */
+#endif
#ifndef HDstrchr
#define HDstrchr(S, C) strchr(S, C)
-#endif /* HDstrchr */
+#endif
#ifndef HDstrcmp
#define HDstrcmp(X, Y) strcmp(X, Y)
-#endif /* HDstrcmp */
+#endif
#ifndef HDstrcasecmp
#define HDstrcasecmp(X, Y) strcasecmp(X, Y)
-#endif /* HDstrcasecmp */
+#endif
#ifndef HDstrcoll
#define HDstrcoll(X, Y) strcoll(X, Y)
-#endif /* HDstrcoll */
+#endif
#ifndef HDstrcpy
#define HDstrcpy(X, Y) strcpy(X, Y)
-#endif /* HDstrcpy */
+#endif
#ifndef HDstrcspn
#define HDstrcspn(X, Y) strcspn(X, Y)
-#endif /* HDstrcspn */
+#endif
+#ifndef HDstrdup
+#define HDstrdup(S) strdup(S)
+#endif
#ifndef HDstrerror
#define HDstrerror(N) strerror(N)
-#endif /* HDstrerror */
+#endif
#ifndef HDstrftime
#define HDstrftime(S, Z, F, T) strftime(S, Z, F, T)
-#endif /* HDstrftime */
+#endif
#ifndef HDstrlen
#define HDstrlen(S) strlen(S)
-#endif /* HDstrlen */
+#endif
#ifndef HDstrncat
#define HDstrncat(X, Y, Z) strncat(X, Y, Z)
-#endif /* HDstrncat */
+#endif
#ifndef HDstrncmp
#define HDstrncmp(X, Y, Z) strncmp(X, Y, Z)
-#endif /* HDstrncmp */
+#endif
#ifndef HDstrncpy
#define HDstrncpy(X, Y, Z) strncpy(X, Y, Z)
-#endif /* HDstrncpy */
+#endif
#ifndef HDstrpbrk
#define HDstrpbrk(X, Y) strpbrk(X, Y)
-#endif /* HDstrpbrk */
+#endif
#ifndef HDstrrchr
#define HDstrrchr(S, C) strrchr(S, C)
-#endif /* HDstrrchr */
+#endif
#ifndef HDstrspn
#define HDstrspn(X, Y) strspn(X, Y)
-#endif /* HDstrspn */
+#endif
#ifndef HDstrstr
#define HDstrstr(X, Y) strstr(X, Y)
-#endif /* HDstrstr */
+#endif
#ifndef HDstrtod
#define HDstrtod(S, R) strtod(S, R)
-#endif /* HDstrtod */
+#endif
#ifndef HDstrtok
#define HDstrtok(X, Y) strtok(X, Y)
-#endif /* HDstrtok */
+#endif
#ifndef HDstrtok_r
#define HDstrtok_r(X, Y, Z) strtok_r(X, Y, Z)
-#endif /* HDstrtok */
+#endif
#ifndef HDstrtol
#define HDstrtol(S, R, N) strtol(S, R, N)
-#endif /* HDstrtol */
+#endif
#ifndef HDstrtoll
-#ifdef H5_HAVE_STRTOLL
#define HDstrtoll(S, R, N) strtoll(S, R, N)
-#else
-H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base);
-#endif /* H5_HAVE_STRTOLL */
-#endif /* HDstrtoll */
+#endif
#ifndef HDstrtoul
#define HDstrtoul(S, R, N) strtoul(S, R, N)
-#endif /* HDstrtoul */
+#endif
#ifndef HDstrtoull
#define HDstrtoull(S, R, N) strtoull(S, R, N)
-#endif /* HDstrtoul */
+#endif
#ifndef HDstrtoumax
#define HDstrtoumax(S, R, N) strtoumax(S, R, N)
-#endif /* HDstrtoumax */
+#endif
#ifndef HDstrxfrm
#define HDstrxfrm(X, Y, Z) strxfrm(X, Y, Z)
-#endif /* HDstrxfrm */
-#ifdef H5_HAVE_SYMLINK
+#endif
#ifndef HDsymlink
#define HDsymlink(F1, F2) symlink(F1, F2)
-#endif /* HDsymlink */
-#endif /* H5_HAVE_SYMLINK */
+#endif
#ifndef HDsysconf
#define HDsysconf(N) sysconf(N)
-#endif /* HDsysconf */
+#endif
#ifndef HDsystem
#define HDsystem(S) system(S)
-#endif /* HDsystem */
+#endif
#ifndef HDtan
#define HDtan(X) tan(X)
-#endif /* HDtan */
+#endif
#ifndef HDtanh
#define HDtanh(X) tanh(X)
-#endif /* HDtanh */
+#endif
#ifndef HDtcdrain
#define HDtcdrain(F) tcdrain(F)
-#endif /* HDtcdrain */
+#endif
#ifndef HDtcflow
#define HDtcflow(F, A) tcflow(F, A)
-#endif /* HDtcflow */
+#endif
#ifndef HDtcflush
#define HDtcflush(F, N) tcflush(F, N)
-#endif /* HDtcflush */
+#endif
#ifndef HDtcgetattr
#define HDtcgetattr(F, T) tcgetattr(F, T)
-#endif /* HDtcgetattr */
+#endif
#ifndef HDtcgetpgrp
#define HDtcgetpgrp(F) tcgetpgrp(F)
-#endif /* HDtcgetpgrp */
+#endif
#ifndef HDtcsendbreak
#define HDtcsendbreak(F, N) tcsendbreak(F, N)
-#endif /* HDtcsendbreak */
+#endif
#ifndef HDtcsetattr
#define HDtcsetattr(F, O, T) tcsetattr(F, O, T)
-#endif /* HDtcsetattr */
+#endif
#ifndef HDtcsetpgrp
#define HDtcsetpgrp(F, N) tcsetpgrp(F, N)
-#endif /* HDtcsetpgrp */
+#endif
#ifndef HDtime
#define HDtime(T) time(T)
-#endif /* HDtime */
+#endif
#ifndef HDtimes
#define HDtimes(T) times(T)
-#endif /* HDtimes*/
+#endif
#ifndef HDtmpfile
#define HDtmpfile() tmpfile()
-#endif /* HDtmpfile */
+#endif
#ifndef HDtmpnam
#define HDtmpnam(S) tmpnam(S)
-#endif /* HDtmpnam */
+#endif
#ifndef HDtolower
#define HDtolower(C) tolower(C)
-#endif /* HDtolower */
+#endif
#ifndef HDtoupper
#define HDtoupper(C) toupper(C)
-#endif /* HDtoupper */
+#endif
#ifndef HDttyname
#define HDttyname(F) ttyname(F)
-#endif /* HDttyname */
+#endif
#ifndef HDtzset
#define HDtzset() tzset()
-#endif /* HDtzset */
+#endif
#ifndef HDumask
#define HDumask(N) umask(N)
-#endif /* HDumask */
+#endif
#ifndef HDuname
#define HDuname(S) uname(S)
-#endif /* HDuname */
+#endif
#ifndef HDungetc
#define HDungetc(C, F) ungetc(C, F)
-#endif /* HDungetc */
+#endif
#ifndef HDunlink
#define HDunlink(S) unlink(S)
-#endif /* HDunlink */
+#endif
+#ifndef HDunsetenv
+#define HDunsetenv(S) unsetenv(S)
+#endif
#ifndef HDutime
#define HDutime(S, T) utime(S, T)
-#endif /* HDutime */
+#endif
+
+#ifndef HDvasprintf
+#ifdef H5_HAVE_VASPRINTF
+#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
+#else
+H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap);
+#endif
+#endif
+
#ifndef HDva_arg
#define HDva_arg(A, T) va_arg(A, T)
-#endif /* HDva_arg */
+#endif
#ifndef HDva_copy
#define HDva_copy(D, S) va_copy(D, S)
-#endif /* HDva_copy */
+#endif
#ifndef HDva_end
#define HDva_end(A) va_end(A)
-#endif /* HDva_end */
+#endif
#ifndef HDva_start
#define HDva_start(A, P) va_start(A, P)
-#endif /* HDva_start */
+#endif
#ifndef HDvfprintf
#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A)
-#endif /* HDvfprintf */
+#endif
#ifndef HDvprintf
#define HDvprintf(FMT, A) vprintf(FMT, A)
-#endif /* HDvprintf */
+#endif
#ifndef HDvsprintf
#define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A)
-#endif /* HDvsprintf */
+#endif
#ifndef HDvsnprintf
#define HDvsnprintf(S, N, FMT, A) vsnprintf(S, N, FMT, A)
-#endif /* HDvsnprintf */
+#endif
#ifndef HDwait
#define HDwait(W) wait(W)
-#endif /* HDwait */
+#endif
#ifndef HDwaitpid
#define HDwaitpid(P, W, O) waitpid(P, W, O)
-#endif /* HDwaitpid */
+#endif
#ifndef HDwcstombs
#define HDwcstombs(S, P, Z) wcstombs(S, P, Z)
-#endif /* HDwcstombs */
+#endif
#ifndef HDwctomb
#define HDwctomb(S, C) wctomb(S, C)
-#endif /* HDwctomb */
+#endif
#ifndef HDwrite
#define HDwrite(F, M, Z) write(F, M, Z)
-#endif /* HDwrite */
-
-/*
- * And now for a couple non-Posix functions... Watch out for systems that
- * define these in terms of macros.
- */
-#if !defined strdup && !defined H5_HAVE_STRDUP
-extern char * strdup(const char *s);
#endif
-#ifndef HDstrdup
-#define HDstrdup(S) strdup(S)
-#endif /* HDstrdup */
-
/* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */
/* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */
#define H5_STRINGIZE(x) #x
@@ -1826,15 +1709,6 @@ extern char * strdup(const char *s);
#define H5_COLON_SEPC ':'
-/* Use FUNC to safely handle variations of C99 __func__ keyword handling */
-#ifdef H5_HAVE_C99_FUNC
-#define FUNC __func__
-#elif defined(H5_HAVE_FUNCTION)
-#define FUNC __FUNCTION__
-#else
-#error "We need __func__ or __FUNCTION__ to test function names!"
-#endif
-
/*
* These macros check whether debugging has been requested for a certain
* package at run-time. Code for debugging is conditionally compiled by
@@ -1915,51 +1789,52 @@ extern char H5libhdf5_settings[]; /* embedded library information */
#define H5TRACE0(R, T) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T)
+ CALLTIME = H5_trace(NULL, __func__, T)
#define H5TRACE1(R, T, A0) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0)
#define H5TRACE2(R, T, A0, A1) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1)
#define H5TRACE3(R, T, A0, A1, A2) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2)
#define H5TRACE4(R, T, A0, A1, A2, A3) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3)
#define H5TRACE5(R, T, A0, A1, A2, A3, A4) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4)
#define H5TRACE6(R, T, A0, A1, A2, A3, A4, A5) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5)
#define H5TRACE7(R, T, A0, A1, A2, A3, A4, A5, A6) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6)
#define H5TRACE8(R, T, A0, A1, A2, A3, A4, A5, A6, A7) \
- RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7)
+ RTYPE = R; \
+ CALLTIME = \
+ H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7)
#define H5TRACE9(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8)
#define H5TRACE10(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8, #A9, A9)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8, #A9, A9)
#define H5TRACE11(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8, #A9, A9, #A10, A10)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8, #A9, A9, #A10, A10)
#define H5TRACE12(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) \
RTYPE = R; \
- CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \
- A7, #A8, A8, #A9, A9, #A10, A10, #A11, A11)
+ CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \
+ #A7, A7, #A8, A8, #A9, A9, #A10, A10, #A11, A11)
#define H5TRACE_RETURN(V) \
if (RTYPE) { \
- H5_trace(&CALLTIME, FUNC, RTYPE, NULL, V); \
+ H5_trace(&CALLTIME, __func__, RTYPE, NULL, V); \
RTYPE = NULL; \
}
#else
@@ -2135,7 +2010,7 @@ extern hbool_t H5_use_selection_io_g;
/* Include required function stack header */
#include "H5CSprivate.h"
-#define H5_PUSH_FUNC H5CS_push(FUNC);
+#define H5_PUSH_FUNC H5CS_push(__func__);
#define H5_POP_FUNC H5CS_pop();
#else /* H5_HAVE_CODESTACK */
#define H5_PUSH_FUNC /* void */
@@ -2220,7 +2095,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
#define FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_VARS \
- FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_API(__func__)); \
FUNC_ENTER_API_THREADSAFE;
#define FUNC_ENTER_API_INIT(err) \
@@ -2240,6 +2115,8 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Push the API context */ \
if (H5CX_push() < 0) \
HGOTO_ERROR(H5E_FUNC, H5E_CANTSET, err, "can't set API context") \
+ else \
+ api_ctx_pushed = TRUE; \
\
BEGIN_MPE_LOG
@@ -2247,6 +2124,8 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
#define FUNC_ENTER_API(err) \
{ \
{ \
+ hbool_t api_ctx_pushed = FALSE; \
+ \
FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_INIT(err); \
FUNC_ENTER_API_PUSH(err); \
@@ -2261,6 +2140,8 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
#define FUNC_ENTER_API_NOCLEAR(err) \
{ \
{ \
+ hbool_t api_ctx_pushed = FALSE; \
+ \
FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_INIT(err); \
FUNC_ENTER_API_PUSH(err); \
@@ -2295,7 +2176,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
{ \
FUNC_ENTER_API_VARS \
- FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_API(__func__)); \
FUNC_ENTER_API_THREADSAFE; \
BEGIN_MPE_LOG \
{
@@ -2312,7 +2193,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
{ \
{ \
- FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_API(__func__)); \
FUNC_ENTER_API_THREADSAFE; \
FUNC_ENTER_API_INIT(err); \
{
@@ -2321,7 +2202,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
* Use this macro for API functions that shouldn't perform _any_ initialization
* of the library or an interface, or push themselves on the function
* stack, or perform tracing, etc. This macro _only_ sanity checks the
- * API name itself. Examples are: H5TSmutex_acquire,
+ * API name itself. Examples are: H5TSmutex_acquire,
*
*/
#define FUNC_ENTER_API_NAMECHECK_ONLY \
@@ -2331,7 +2212,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
{ \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_API(__func__)); \
{
/* Note: this macro only works when there's _no_ interface initialization routine for the module */
@@ -2345,14 +2226,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro for all "normal" non-API functions */
#define FUNC_ENTER_NOAPI(err) \
{ \
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
FUNC_ENTER_NOAPI_INIT(err) \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/* Use this macro for all non-API functions, which propagate errors, but don't issue them */
#define FUNC_ENTER_NOAPI_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \
FUNC_ENTER_NOAPI_INIT(-) \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2366,7 +2247,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOINIT \
{ \
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2381,7 +2262,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOINIT_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2393,7 +2274,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOFS \
{ \
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
\
/* Initialize the package, if appropriate */ \
H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \
@@ -2410,19 +2291,19 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
*/
#define FUNC_ENTER_NOAPI_NOERR_NOFS \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/*
* Use this macro for non-API functions that shouldn't perform _any_ initialization
* of the library or an interface, or push themselves on the function
* stack, or perform tracing, etc. This macro _only_ sanity checks the
- * API name itself. Examples are private routines in the H5TS package.
+ * API name itself. Examples are private routines in the H5TS package.
*
*/
#define FUNC_ENTER_NOAPI_NAMECHECK_ONLY \
{ \
- FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC));
+ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__));
/* Use the following two macros as replacements for the FUNC_ENTER_NOAPI
* and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set
@@ -2431,7 +2312,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
H5AC_tag(tag, &prev_tag); \
FUNC_ENTER_NOAPI_INIT(err) \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2440,7 +2321,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \
+ FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \
H5AC_tag(tag, &prev_tag); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2448,14 +2329,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro for all "normal" package-level functions */
#define FUNC_ENTER_PACKAGE \
{ \
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/* Use this macro for package-level functions which propgate errors, but don't issue them */
#define FUNC_ENTER_PACKAGE_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2465,7 +2346,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5AC_tag(tag, &prev_tag); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2473,14 +2354,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro for all "normal" staticly-scoped functions */
#define FUNC_ENTER_STATIC \
{ \
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */
#define FUNC_ENTER_STATIC_NOERR \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2488,19 +2369,19 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* And that shouldn't push their name on the function stack */
#define FUNC_ENTER_STATIC_NOERR_NOFS \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
/*
* Use this macro for non-API functions that shouldn't perform _any_ initialization
* of the library or an interface, or push themselves on the function
* stack, or perform tracing, etc. This macro _only_ sanity checks the
- * API name itself. Examples are static routines in the H5TS package.
+ * API name itself. Examples are static routines in the H5TS package.
*
*/
#define FUNC_ENTER_STATIC_NAMECHECK_ONLY \
{ \
- FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC));
+ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__));
/* Use the following macro as replacement for the FUNC_ENTER_STATIC
* macro when the function needs to set up a metadata tag. */
@@ -2508,7 +2389,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
{ \
haddr_t prev_tag = HADDR_UNDEF; \
\
- FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \
+ FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \
H5AC_tag(tag, &prev_tag); \
H5_PUSH_FUNC \
if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) {
@@ -2527,14 +2408,17 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
H5_API_SET_CANCEL
#define FUNC_LEAVE_API_COMMON(ret_value) \
- ; \
- } /*end scope from end of FUNC_ENTER*/ \
FINISH_MPE_LOG \
H5TRACE_RETURN(ret_value);
#define FUNC_LEAVE_API(ret_value) \
+ ; \
+ } /*end scope from end of FUNC_ENTER*/ \
FUNC_LEAVE_API_COMMON(ret_value); \
- (void)H5CX_pop(TRUE); \
+ if (api_ctx_pushed) { \
+ (void)H5CX_pop(TRUE); \
+ api_ctx_pushed = FALSE; \
+ } \
H5_POP_FUNC \
if (err_occurred) \
(void)H5E_dump_api_stack(TRUE); \
@@ -2545,6 +2429,8 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro to match the FUNC_ENTER_API_NOINIT macro */
#define FUNC_LEAVE_API_NOINIT(ret_value) \
+ ; \
+ } /*end scope from end of FUNC_ENTER*/ \
FUNC_LEAVE_API_COMMON(ret_value); \
H5_POP_FUNC \
if (err_occurred) \
@@ -2557,6 +2443,8 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
/* Use this macro to match the FUNC_ENTER_API_NOINIT_NOERR_NOFS macro */
#define FUNC_LEAVE_API_NOFS(ret_value) \
+ ; \
+ } /*end scope from end of FUNC_ENTER*/ \
FUNC_LEAVE_API_COMMON(ret_value); \
FUNC_LEAVE_API_THREADSAFE \
return (ret_value); \
@@ -2633,256 +2521,26 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props);
return (ret_value); \
} /*end scope from beginning of FUNC_ENTER*/
-/****************************************/
-/* Revisions to FUNC_ENTER/LEAVE Macros */
-/****************************************/
-
-/* Macros to check if a package is initialized */
-#define H5_CHECK_PACKAGE_INIT_REG_YES(asrt) HDassert(H5_PACKAGE_INIT_VAR(pkg));
-#define H5_CHECK_PACKAGE_INIT_REG_NO(asrt)
-#define H5_CHECK_PACKAGE_INIT_INIT_YES(asrt)
-#define H5_CHECK_PACKAGE_INIT_INIT_NO(asrt)
-#define H5_CHECK_PACKAGE_INIT(pkg, pkg_init, init) H5_GLUE4(H5_CHECK_PACKAGE_INIT_, init, _, pkg_init)(pkg)
-
-/* Macros to initialize package, if a package initialization routine is defined */
-#define H5_PKG_YES_INIT(pkg) \
- if (!H5_PACKAGE_INIT_VAR(pkg) && !H5_TERM_GLOBAL) { \
- H5_PACKAGE_INIT_VAR(pkg) = TRUE; \
- if (H5_PACKAGE_INIT_FUNC(pkg)() < 0) { \
- H5_PACKAGE_INIT_VAR(pkg) = FALSE; \
- /* (Can't use H5E_THROW here) */ \
- H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \
- ret_value = fail_value; \
- goto func_init_failed; \
- } /* end if */ \
- } /* end if */
-#define H5_PKG_NO_INIT(pkg) \
- if (!H5_PACKAGE_INIT_VAR(pkg) && !H5_TERM_GLOBAL) \
- H5_PACKAGE_INIT_VAR(pkg) = TRUE;
-#define H5_PKG_INIT(pkg_init, pkg) H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg)
-
/* Macros to declare package initialization function, if a package initialization routine is defined */
#ifdef H5_PKG_SINGLE_SOURCE
#define H5_PKG_DECLARE_YES_FUNC(pkg) static herr_t H5_PACKAGE_INIT_FUNC(pkg)(void);
-#else /* H5_PKG_SINGLE_SOURCE */
+#else
#define H5_PKG_DECLARE_YES_FUNC(pkg) extern herr_t H5_PACKAGE_INIT_FUNC(pkg)(void);
-#endif /* H5_PKG_SINGLE_SOURCE */
+#endif
#define H5_PKG_DECLARE_NO_FUNC(pkg)
/* Declare package initialization symbols (if in a package) */
#ifdef H5_PKG_SINGLE_SOURCE
#define H5_PKG_DECLARE_VAR(pkg) static hbool_t H5_PACKAGE_INIT_VAR(pkg);
-#else /* H5_PKG_SINGLE_SOURCE */
+#else
#define H5_PKG_DECLARE_VAR(pkg) extern hbool_t H5_PACKAGE_INIT_VAR(pkg);
-#endif /* H5_PKG_SINGLE_SOURCE */
+#endif
#define H5_PKG_DECLARE_FUNC(pkg_init, pkg) H5_GLUE3(H5_PKG_DECLARE_, pkg_init, _FUNC)(pkg)
+
#ifdef H5_MY_PKG
H5_PKG_DECLARE_VAR(H5_MY_PKG)
H5_PKG_DECLARE_FUNC(H5_MY_PKG_INIT, H5_MY_PKG)
-#endif /* H5_MY_PKG */
-
-/* API re-entrance variable */
-extern hbool_t H5_api_entered_g; /* Has library already been entered through API? */
-
-/* Macros for entering different scopes of routines */
-#define H5_PACKAGE_ENTER(pkg, pkg_init, init) \
- FUNC_ENTER_CHECK_NAME(H5_IS_PKG(FUNC)) \
- \
- /* The library should be initialized already */ \
- HDassert(H5_INIT_GLOBAL); \
- \
- /* This interface should be initialized already */ \
- /* (except for package initialization routines :-) */ \
- H5_CHECK_PACKAGE_INIT(pkg, pkg_init, init) \
- \
- /* Push the name of this function on the function stack */ \
- H5_PUSH_FUNC \
- \
- /* Enter scope for this type of function */ \
- {
-
-#define H5_PRIVATE_ENTER(pkg, pkg_init) \
- FUNC_ENTER_CHECK_NAME(H5_IS_PRIV(FUNC)) \
- \
- /* The library should be initialized already */ \
- HDassert(H5_INIT_GLOBAL); \
- \
- /* Initialize this interface if desired */ \
- H5_PKG_INIT(pkg_init, pkg) \
- \
- /* Push the name of this function on the function stack */ \
- H5_PUSH_FUNC \
- \
- /* Enter scope for this type of function */ \
- { \
- {
-
-#define H5_PUBLIC_ENTER(pkg, pkg_init) \
- FUNC_ENTER_API_VARS \
- FUNC_ENTER_API_THREADSAFE; \
- FUNC_ENTER_CHECK_NAME(H5_IS_PUB(FUNC)) \
- \
- /* Clear thread error stack when entering public functions */ \
- H5E_clear_stack(NULL); \
- \
- /* Initialize the library or bust */ \
- if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \
- if (H5_init_library() < 0) { \
- /* (Can't use H5E_THROW here) */ \
- H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \
- ret_value = fail_value; \
- goto func_init_failed; \
- } /* end if */ \
- } /* end if */ \
- \
- /* Initialize this interface if desired */ \
- H5_PKG_INIT(pkg_init, pkg) \
- \
- /* Check for re-entering API routine */ \
- HDassert(!H5_api_entered_g); \
- H5_api_entered_g = TRUE; \
- \
- /* Start logging MPI's MPE information */ \
- BEGIN_MPE_LOG \
- \
- /* Push the name of this function on the function stack */ \
- H5_PUSH_FUNC \
- \
- /* Enter scope for this type of function */ \
- { \
- { \
- {
-
-/* Macros for substituting the package name */
-#define FUNC_ENT_STATIC(pkg, pkg_init) H5_PACKAGE_ENTER(pkg, pkg_init, REG)
-#define FUNC_ENT_PKGINIT(pkg, pkg_init) H5_PACKAGE_ENTER(pkg, pkg_init, INIT)
-#define FUNC_ENT_PKG(pkg, pkg_init) H5_PACKAGE_ENTER(pkg, pkg_init, REG)
-#define FUNC_ENT_PRIV(pkg, pkg_init) H5_PRIVATE_ENTER(pkg, pkg_init)
-#define FUNC_ENT_PUB(pkg, pkg_init) H5_PUBLIC_ENTER(pkg, pkg_init)
-
-/* Macros for substituting a function prefix */
-#define FUNC_PREFIX_STATIC static
-#define FUNC_PREFIX_PKGINIT
-#define FUNC_PREFIX_PKG
-#define FUNC_PREFIX_PRIV
-#define FUNC_PREFIX_PUB
-
-/* Macros for declaring error variables */
-/* Function can detect errors and has a specific error return value */
-#define FUNC_ERR_VAR_ERR(ret_typ, err) \
- hbool_t past_catch = FALSE; \
- ret_typ fail_value = err;
-/* Function can detect errors but cannot return an error value (Cleanup only) */
-#define FUNC_ERR_VAR_ERRCATCH(ret_typ, err) hbool_t past_catch = FALSE;
-/* Function has no need to detect or clean up from errors */
-#define FUNC_ERR_VAR_NOERR(ret_typ, err)
-
-/* Use this macro when entering all functions */
-#define BEGIN_FUNC(scope, use_err, ret_typ, ret_init, err, func) \
- H5_GLUE(FUNC_PREFIX_, scope) \
- ret_typ func \
- /* Open function */ \
- { \
- ret_typ ret_value = ret_init; \
- H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) H5_GLUE(FUNC_ENT_, scope)(H5_MY_PKG, H5_MY_PKG_INIT)
-
-/* Use this macro when entering functions that have no return value */
-#define BEGIN_FUNC_VOID(scope, use_err, func) \
- H5_GLUE(FUNC_PREFIX_, scope) \
- void func \
- /* Open function */ \
- { \
- H5_GLUE(FUNC_ERR_VAR_, use_err)(void, -, -) H5_GLUE(FUNC_ENT_, scope)
-
-/* Macros for label when a function initialization can fail */
-#define H5_PRIV_YES_FUNC_INIT_FAILED \
-func_init_failed:
-#define H5_PRIV_NO_FUNC_INIT_FAILED
-#define H5_PRIV_FUNC_INIT_FAILED(pkg_init) H5_GLUE3(H5_PRIV_, pkg_init, _FUNC_INIT_FAILED)
-
-/* Macros for leaving different scopes of routines */
-#define FUNC_LEAVE_PKGINIT \
- /* Leave scope for this type of function */ \
- } \
- \
- /* Pop the name of this function off the function stack */ \
- H5_POP_FUNC
-
-#define FUNC_LEAVE_STATIC \
- /* Leave scope for this type of function */ \
- } \
- \
- /* Pop the name of this function off the function stack */ \
- H5_POP_FUNC
-
-#define FUNC_LEAVE_PKG \
- /* Leave scope for this type of function */ \
- } \
- \
- /* Pop the name of this function off the function stack */ \
- H5_POP_FUNC
-
-#define FUNC_LEAVE_PRIV \
- /* Leave scope for this type of function */ \
- } \
- } \
- \
- /* Label for errors during FUNC_ENTER */ \
- H5_PRIV_FUNC_INIT_FAILED(H5_MY_PKG_INIT) \
- \
- /* Pop the name of this function off the function stack */ \
- H5_POP_FUNC
-
-#define FUNC_LEAVE_PUB \
- /* Leave scope for this type of function */ \
- } \
- } \
- } \
- \
- /* Label for errors during FUNC_ENTER */ \
-func_init_failed: \
- \
- /* Dump error stack if an error occurred during API routine */ \
- if (ret_value == fail_value) \
- (void)H5E_dump_api_stack(TRUE); \
- \
- /* Finish the API tracing info */ \
- H5TRACE_RETURN(ret_value); \
- \
- /* Pop the name of this function off the function stack */ \
- H5_POP_FUNC \
- \
- /* Finish the MPE tracing info */ \
- FINISH_MPE_LOG \
- \
- /* Check for leaving API routine */ \
- HDassert(H5_api_entered_g); \
- H5_api_entered_g = FALSE; \
- \
- /* Release thread-safety semaphore */ \
- FUNC_LEAVE_API_THREADSAFE
-
-/* Use this macro when leaving all functions */
-#define END_FUNC(scope) \
- /* Scope-specific function conclusion */ \
- H5_GLUE(FUNC_LEAVE_, scope) \
- \
- /* Leave routine */ \
- return (ret_value); \
- \
- /* Close Function */ \
- }
-
-/* Use this macro when leaving void functions */
-#define END_FUNC_VOID(scope) \
- /* Scope-specific function conclusion */ \
- H5_GLUE(FUNC_LEAVE_, scope) \
- \
- /* Leave routine */ \
- return; \
- \
- /* Close Function */ \
- }
+#endif
/* Macro to begin/end tagging (when FUNC_ENTER_*TAG macros are insufficient).
* Make sure to use HGOTO_ERROR_TAG and HGOTO_DONE_TAG between these macros! */
@@ -2953,6 +2611,57 @@ H5_DLL double H5_get_time(void);
H5_DLL herr_t H5_build_extpath(const char *name, char **extpath /*out*/);
H5_DLL herr_t H5_combine_path(const char *path1, const char *path2, char **full_name /*out*/);
+/* getopt(3) equivalent that papers over the lack of long options on BSD
+ * and lack of Windows support.
+ */
+H5_DLLVAR int H5_opterr; /* get_option prints errors if this is on */
+H5_DLLVAR int H5_optind; /* token pointer */
+H5_DLLVAR const char *H5_optarg; /* flag argument (or value) */
+
+enum h5_arg_level {
+ no_arg = 0, /* doesn't take an argument */
+ require_arg, /* requires an argument */
+ optional_arg /* argument is optional */
+};
+
+/*
+ * get_option determines which options are specified on the command line and
+ * returns a pointer to any arguments possibly associated with the option in
+ * the ``H5_optarg'' variable. get_option returns the shortname equivalent of
+ * the option. The long options are specified in the following way:
+ *
+ * struct h5_long_options foo[] = {
+ * { "filename", require_arg, 'f' },
+ * { "append", no_arg, 'a' },
+ * { "width", require_arg, 'w' },
+ * { NULL, 0, 0 }
+ * };
+ *
+ * Long named options can have arguments specified as either:
+ *
+ * ``--param=arg'' or ``--param arg''
+ *
+ * Short named options can have arguments specified as either:
+ *
+ * ``-w80'' or ``-w 80''
+ *
+ * and can have more than one short named option specified at one time:
+ *
+ * -aw80
+ *
+ * in which case those options which expect an argument need to come at the
+ * end.
+ */
+struct h5_long_options {
+ const char * name; /* Name of the long option */
+ enum h5_arg_level has_arg; /* Whether we should look for an arg */
+ char shortval; /* The shortname equivalent of long arg
+ * this gets returned from get_option
+ */
+};
+
+H5_DLL int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt);
+
#ifdef H5_HAVE_PARALLEL
/* Generic MPI functions */
H5_DLL hsize_t H5_mpi_set_bigio_count(hsize_t new_count);
diff --git a/src/H5public.h b/src/H5public.h
index b319550..65709c6 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -34,129 +34,186 @@
#ifdef H5_HAVE_FEATURES_H
#include <features.h> /* For setting POSIX, BSD, etc. compatibility */
#endif
-#ifdef H5_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef H5_STDC_HEADERS
-#include <limits.h> /* For H5T_NATIVE_CHAR defn in H5Tpublic.h */
-#include <stdarg.h> /* For variadic functions in H5VLpublic.h */
-#endif
-#ifndef __cplusplus
-#ifdef H5_HAVE_STDINT_H
-#include <stdint.h> /* For C9x types */
-#endif
-#else
-#ifdef H5_HAVE_STDINT_H_CXX
-#include <stdint.h> /* For C9x types (when included from C++) */
-#endif
-#endif
-#ifdef H5_HAVE_INTTYPES_H
-#include <inttypes.h> /* C99/POSIX.1 header for uint64_t, PRIu64 */
+
+/* C library header files for things that appear in HDF5 public headers */
+#ifdef __cplusplus
+#define __STDC_FORMAT_MACROS
#endif
-#ifdef H5_HAVE_STDDEF_H
+#include <inttypes.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdbool.h>
#include <stddef.h>
+#include <stdint.h>
+
+/* Unlike most sys/ headers, which are POSIX-only, sys/types.h is avaible
+ * on Windows, though it doesn't necessarily contain all the POSIX types
+ * we need for HDF5 (e.g. ssize_t).
+ */
+#ifdef H5_HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
+
#ifdef H5_HAVE_PARALLEL
/* Don't link against MPI C++ bindings */
+#ifndef MPICH_SKIP_MPICXX
#define MPICH_SKIP_MPICXX 1
-#define OMPI_SKIP_MPICXX 1
+#endif
+#ifndef OMPI_SKIP_MPICXX
+#define OMPI_SKIP_MPICXX 1
+#endif
#include <mpi.h>
#ifndef MPI_FILE_NULL /* MPIO may be defined in mpi.h already */
#include <mpio.h>
#endif
#endif
-/* Include the Windows API adapter header early */
-#include "H5api_adpt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Macros for enabling/disabling particular GCC warnings */
-/* (see the following web-sites for more info:
- * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
- * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
- */
-/* These pragmas are only implemented usefully in gcc 4.6+ */
-#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
-#define H5_GCC_DIAG_JOINSTR(x, y) x y
-#define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma(#x)
-#define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
-
-#define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR("-W", x))
-#define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop)
-#else
-#define H5_GCC_DIAG_OFF(x)
-#define H5_GCC_DIAG_ON(x)
-#endif
-
/* Macro to hide a symbol from further preprocessor substitutions */
#define H5_NO_EXPAND(x) (x)
/* Version numbers */
-#define H5_VERS_MAJOR 1 /* For major interface/format changes */
-#define H5_VERS_MINOR 13 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */
-#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
-/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.13.0" /* Full version string */
+/**
+ * For major interface/format changes
+ */
+#define H5_VERS_MAJOR 1
+/**
+ * For minor interface/format changes
+ */
+#define H5_VERS_MINOR 13
+/**
+ * For tweaks, bug-fixes, or development
+ */
+#define H5_VERS_RELEASE 0
+/**
+ * For pre-releases like \c snap0. Empty string for official releases.
+ */
+#define H5_VERS_SUBRELEASE ""
+/**
+ * Full version string
+ */
+#define H5_VERS_INFO "HDF5 library version: 1.13.0"
#define H5check() H5check_version(H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE)
/* macros for comparing the version */
+/**
+ * \brief Determines whether the version of the library being used is greater
+ * than or equal to the specified version
+ *
+ * \param[in] Maj Major version number - A non-negative integer value
+ * \param[in] Min Minor version number - A non-negative integer value
+ * \param[in] Rel Release version number - A non-negative integer value
+ * \returns A value of 1 is returned if the library version is greater than
+ * or equal to the version number specified.\n
+ * A value of 0 is returned if the library version is less than the
+ * version number specified.\n
+ * A library version is greater than the specified version number if
+ * its major version is larger than the specified major version
+ * number. If the major version numbers are the same, it is greater
+ * than the specified version number if its minor version is larger
+ * than the specified minor version number. If the minor version
+ * numbers are the same, then a library version would be greater than
+ * the specified version number if its release number is larger than
+ * the specified release number.
+ *
+ * \details The #H5_VERSION_GE and #H5_VERSION_LE macros are used at compile
+ * time to conditionally include or exclude code based on the version
+ * of the HDF5 library against which an application will be linked.
+ *
+ * The #H5_VERSION_GE macro compares the version of the HDF5 library
+ * being used against the version number specified in the parameters.
+ *
+ * For more information about release versioning, see \ref_h5lib_relver.
+ *
+ * \since 1.8.7
+ *
+ */
#define H5_VERSION_GE(Maj, Min, Rel) \
(((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR == Min) && (H5_VERS_RELEASE >= Rel)) || \
((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR > Min)) || (H5_VERS_MAJOR > Maj))
+/**
+ * \brief Determines whether the version of the library being used is less
+ * than or equal to the specified version
+ *
+ * \param[in] Maj Major version number - A non-negative integer value
+ * \param[in] Min Minor version number - A non-negative integer value
+ * \param[in] Rel Release version number - A non-negative integer value
+ * \returns A value of 1 is returned if the library version is less than
+ * or equal to the version number specified.\n
+ * A value of 0 is returned if the library version is greater than the
+ * version number specified.\n
+ * A library version is less than the specified version number if
+ * its major version is smaller than the specified major version
+ * number. If the major version numbers are the same, it is smaller
+ * than the specified version number if its minor version is smaller
+ * than the specified minor version number. If the minor version
+ * numbers are the same, then a library version would be smaller than
+ * the specified version number if its release number is smaller than
+ * the specified release number.
+ *
+ * \details The #H5_VERSION_GE and #H5_VERSION_LE macros are used at compile
+ * time to conditionally include or exclude code based on the version
+ * of the HDF5 library against which an application will be linked.
+ *
+ * The #H5_VERSION_LE macro compares the version of the HDF5 library
+ * being used against the version number specified in the parameters.
+ *
+ * For more information about release versioning, see \ref_h5lib_relver.
+ *
+ * \since 1.8.7
+ *
+ */
#define H5_VERSION_LE(Maj, Min, Rel) \
(((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR == Min) && (H5_VERS_RELEASE <= Rel)) || \
((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR < Min)) || (H5_VERS_MAJOR < Maj))
-/*
+/**
* Status return values. Failed integer functions in HDF5 result almost
* always in a negative value (unsigned failing functions sometimes return
* zero for failure) while successful return is non-negative (often zero).
- * The negative failure value is most commonly -1, but don't bet on it. The
- * proper way to detect failure is something like:
+ * The negative failure value is most commonly -1, but don't bet on it.
*
- * if((dset = H5Dopen2(file, name)) < 0)
- * fprintf(stderr, "unable to open the requested dataset\n");
+ * The proper way to detect failure is something like:
+ * \code
+ * if((dset = H5Dopen2(file, name)) < 0)
+ * fprintf(stderr, "unable to open the requested dataset\n");
+ * \endcode
*/
typedef int herr_t;
-/*
- * Boolean type. Successful return values are zero (false) or positive
- * (true). The typical true value is 1 but don't bet on it. Boolean
- * functions cannot fail. Functions that return `htri_t' however return zero
- * (false), positive (true), or negative (failure). The proper way to test
- * for truth from a htri_t function is:
- *
- * if ((retval = H5Tcommitted(type)) > 0) {
- * printf("data type is committed\n");
- * } else if (!retval) {
- * printf("data type is not committed\n");
- * } else {
- * printf("error determining whether data type is committed\n");
- * }
- */
-#ifdef H5_HAVE_STDBOOL_H
+/**
+ * C99-style Boolean type. Successful return values are zero (false) or positive
+ * (true). The typical true value is 1 but don't bet on it.
+ * \attention Boolean functions cannot fail.
+ */
#include <stdbool.h>
-#else /* H5_HAVE_STDBOOL_H */
-#ifndef __cplusplus
-#if defined(H5_SIZEOF_BOOL) && (H5_SIZEOF_BOOL != 0)
-#define bool _Bool
-#else
-#define bool unsigned int
-#endif
-#define true 1
-#define false 0
-#endif /* __cplusplus */
-#endif /* H5_HAVE_STDBOOL_H */
typedef bool hbool_t;
-typedef int htri_t;
+/**
+ * Three-valued Boolean type. Functions that return #htri_t however return zero
+ * (false), positive (true), or negative (failure).
+ *
+ * The proper way to test for truth from a #htri_t function is:
+ * \code
+ * if ((retval = H5Tcommitted(type)) > 0) {
+ * printf("data type is committed\n");
+ * } else if (!retval) {
+ * printf("data type is not committed\n");
+ * } else {
+ * printf("error determining whether data type is committed\n");
+ * }
+ * \endcode
+ */
+typedef int htri_t;
-/* Define the ssize_t type if it not is defined */
+/* The signed version of size_t
+ *
+ * ssize_t is POSIX and not defined in any C standard. It's used in some
+ * public HDF5 API calls so this work-around will define it if it's not
+ * present.
+ *
+ * Use of ssize_t should be discouraged in new code.
+ */
#if H5_SIZEOF_SSIZE_T == 0
/* Undefine this size, we will re-define it in one of the sections below */
#undef H5_SIZEOF_SSIZE_T
@@ -174,141 +231,50 @@ typedef long long ssize_t;
#endif
#endif
-/* int64_t type is used for creation order field for links. It may be
- * defined in Posix.1g, otherwise it is defined here.
- */
-#if H5_SIZEOF_INT64_T >= 8
-#elif H5_SIZEOF_INT >= 8
-typedef int int64_t;
-#undef H5_SIZEOF_INT64_T
-#define H5_SIZEOF_INT64_T H5_SIZEOF_INT
-#elif H5_SIZEOF_LONG >= 8
-typedef long int64_t;
-#undef H5_SIZEOF_INT64_T
-#define H5_SIZEOF_INT64_T H5_SIZEOF_LONG
-#elif H5_SIZEOF_LONG_LONG >= 8
-typedef long long int64_t;
-#undef H5_SIZEOF_INT64_T
-#define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG
-#else
-#error "nothing appropriate for int64_t"
-#endif
-
-/* uint64_t type is used for fields for H5O_info_t. It may be
- * defined in Posix.1g, otherwise it is defined here.
+/**
+ * The size of file objects.
+ *
+ * \internal Defined as a (minimum) 64-bit integer type.
*/
-#if H5_SIZEOF_UINT64_T >= 8
-#ifndef UINT64_MAX
-#define UINT64_MAX ((uint64_t)-1)
-#endif
-#elif H5_SIZEOF_INT >= 8
-typedef unsigned uint64_t;
-#define UINT64_MAX UINT_MAX
-#undef H5_SIZEOF_UINT64_T
-#define H5_SIZEOF_UINT64_T H5_SIZEOF_INT
-#elif H5_SIZEOF_LONG >= 8
-typedef unsigned long uint64_t;
-#define UINT64_MAX ULONG_MAX
-#undef H5_SIZEOF_UINT64_T
-#define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG
-#elif H5_SIZEOF_LONG_LONG >= 8
-typedef unsigned long long uint64_t;
-#define UINT64_MAX ULLONG_MAX
-#undef H5_SIZEOF_UINT64_T
-#define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG
-#else
-#error "nothing appropriate for uint64_t"
-#endif
-
-/*
- * The sizes of file objects have their own types defined here, use a minimum
- * 64-bit type.
- */
-#if H5_SIZEOF_LONG_LONG >= 8
-H5_GCC_DIAG_OFF("long-long")
-typedef unsigned long long hsize_t;
-typedef signed long long hssize_t;
-H5_GCC_DIAG_ON("long-long")
-#define PRIdHSIZE H5_PRINTF_LL_WIDTH "d"
-#define PRIiHSIZE H5_PRINTF_LL_WIDTH "i"
-#define PRIoHSIZE H5_PRINTF_LL_WIDTH "o"
-#define PRIuHSIZE H5_PRINTF_LL_WIDTH "u"
-#define PRIxHSIZE H5_PRINTF_LL_WIDTH "x"
-#define PRIXHSIZE H5_PRINTF_LL_WIDTH "X"
-#define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG
-#define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG
-#define HSIZE_UNDEF ULLONG_MAX
-#else
-#error "nothing appropriate for hsize_t"
-#endif
+typedef uint64_t hsize_t;
+/**
+ * The size of file objects. Used when negative values are needed to indicate errors.
+ *
+ * \internal Defined as a (minimum) 64-bit integer type. Use of hssize_t
+ * should be discouraged in new code.
+ */
+typedef int64_t hssize_t;
+#define PRIdHSIZE PRId64
+#define PRIiHSIZE PRIi64
+#define PRIoHSIZE PRIo64
+#define PRIuHSIZE PRIu64
+#define PRIxHSIZE PRIx64
+#define PRIXHSIZE PRIX64
+#define H5_SIZEOF_HSIZE_T 8
+#define H5_SIZEOF_HSSIZE_T 8
+#define HSIZE_UNDEF UINT64_MAX
-/*
- * File addresses have their own types.
- */
-#if H5_SIZEOF_INT >= 8
-typedef unsigned haddr_t;
-#define HADDR_UNDEF UINT_MAX
-#define H5_SIZEOF_HADDR_T H5_SIZEOF_INT
-#ifdef H5_HAVE_PARALLEL
-#define HADDR_AS_MPI_TYPE MPI_UNSIGNED
-#endif /* H5_HAVE_PARALLEL */
-#define PRIdHADDR "d"
-#define PRIoHADDR "o"
-#define PRIuHADDR "u"
-#define PRIxHADDR "x"
-#define PRIXHADDR "X"
-#elif H5_SIZEOF_LONG >= 8
-typedef unsigned long haddr_t;
-#define HADDR_UNDEF ULONG_MAX
-#define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG
-#ifdef H5_HAVE_PARALLEL
-#define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG
-#endif /* H5_HAVE_PARALLEL */
-#define PRIdHADDR "ld"
-#define PRIoHADDR "lo"
-#define PRIuHADDR "lu"
-#define PRIxHADDR "lx"
-#define PRIXHADDR "lX"
-#elif H5_SIZEOF_LONG_LONG >= 8
-typedef unsigned long long haddr_t;
-#define HADDR_UNDEF ULLONG_MAX
-#define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG
-#ifdef H5_HAVE_PARALLEL
-#define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
-#endif /* H5_HAVE_PARALLEL */
-#define PRIdHADDR H5_PRINTF_LL_WIDTH "d"
-#define PRIoHADDR H5_PRINTF_LL_WIDTH "o"
-#define PRIuHADDR H5_PRINTF_LL_WIDTH "u"
-#define PRIxHADDR H5_PRINTF_LL_WIDTH "x"
-#define PRIXHADDR H5_PRINTF_LL_WIDTH "X"
-#else
-#error "nothing appropriate for haddr_t"
-#endif
+/**
+ * The address of an object in the file.
+ *
+ * \internal Defined as a (minimum) 64-bit unsigned integer type.
+ */
+typedef uint64_t haddr_t;
+#define PRIdHADDR PRId64
+#define PRIoHADDR PRIo64
+#define PRIuHADDR PRIu64
+#define PRIxHADDR PRIx64
+#define PRIXHADDR PRIX64
+#define H5_SIZEOF_HADDR_T 8
+#define HADDR_UNDEF UINT64_MAX
#define H5_PRINTF_HADDR_FMT "%" PRIuHADDR
#define HADDR_MAX (HADDR_UNDEF - 1)
-/* uint32_t type is used for creation order field for messages. It may be
- * defined in Posix.1g, otherwise it is defined here.
- */
-#if H5_SIZEOF_UINT32_T >= 4
-#elif H5_SIZEOF_SHORT >= 4
-typedef short uint32_t;
-#undef H5_SIZEOF_UINT32_T
-#define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT
-#elif H5_SIZEOF_INT >= 4
-typedef unsigned int uint32_t;
-#undef H5_SIZEOF_UINT32_T
-#define H5_SIZEOF_UINT32_T H5_SIZEOF_INT
-#elif H5_SIZEOF_LONG >= 4
-typedef unsigned long uint32_t;
-#undef H5_SIZEOF_UINT32_T
-#define H5_SIZEOF_UINT32_T H5_SIZEOF_LONG
-#else
-#error "nothing appropriate for uint32_t"
+#ifdef H5_HAVE_PARALLEL
+#define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
#endif
-//! [H5_iter_order_t_snip]
-
+//! <!-- [H5_iter_order_t_snip] -->
/**
* Common iteration orders
*/
@@ -319,19 +285,17 @@ typedef enum {
H5_ITER_NATIVE, /**< No particular order, whatever is fastest */
H5_ITER_N /**< Number of iteration orders */
} H5_iter_order_t;
-
-//! [H5_iter_order_t_snip]
+//! <!-- [H5_iter_order_t_snip] -->
/* Iteration callback values */
/* (Actually, any positive value will cause the iterator to stop and pass back
* that positive value to the function that called the iterator)
*/
-#define H5_ITER_ERROR (-1)
-#define H5_ITER_CONT (0)
-#define H5_ITER_STOP (1)
-
-//! [H5_index_t_snip]
+#define H5_ITER_ERROR (-1) /**< Error, stop iteration */
+#define H5_ITER_CONT (0) /**< Continue iteration */
+#define H5_ITER_STOP (1) /**< Stop iteration, short-circuit success */
+//! <!-- [H5_index_t_snip] -->
/**
* The types of indices on links in groups/attributes on objects.
* Primarily used for "<do> <foo> by index" routines and for iterating over
@@ -343,18 +307,17 @@ typedef enum H5_index_t {
H5_INDEX_CRT_ORDER, /**< Index on creation order */
H5_INDEX_N /**< Number of indices defined */
} H5_index_t;
-
-//! [H5_index_t_snip]
+//! <!-- [H5_index_t_snip] -->
/**
* Storage info struct used by H5O_info_t and H5F_info_t
*/
-//! [H5_ih_info_t_snip]
+//! <!-- [H5_ih_info_t_snip] -->
typedef struct H5_ih_info_t {
hsize_t index_size; /**< btree and/or list */
hsize_t heap_size;
} H5_ih_info_t;
-//! [H5_ih_info_t_snip]
+//! <!-- [H5_ih_info_t_snip] -->
/**
* The maximum size allowed for tokens
@@ -364,17 +327,17 @@ typedef struct H5_ih_info_t {
*/
#define H5O_MAX_TOKEN_SIZE (16)
-//! [H5O_token_t_snip]
-
+//! <!-- [H5O_token_t_snip] -->
/**
+ * Type for object tokens
+ *
* \internal (Hoisted here, since it's used by both the
- * H5Lpublic.h and H5Opublic.h headers) */
-/* Type for object tokens */
+ * H5Lpublic.h and H5Opublic.h headers)
+ */
typedef struct H5O_token_t {
uint8_t __data[H5O_MAX_TOKEN_SIZE];
} H5O_token_t;
-
-//! [H5O_token_t_snip]
+//! <!-- [H5O_token_t_snip] -->
/**
* Allocation statistics info struct
@@ -394,6 +357,13 @@ typedef struct H5_alloc_stats_t {
*/
typedef void (*H5_atclose_func_t)(void *ctx);
+/* API adapter header (defines H5_DLL, etc.) */
+#include "H5api_adpt.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Functions in H5.c */
/**
* \ingroup H5
@@ -435,7 +405,7 @@ H5_DLL herr_t H5open(void);
* If the HDF5 library is initialized and closed more than once, the
* \p func callback must be registered within each open/close cycle.
*
- * \since 1.12.1
+ * \since 1.13.0
*/
H5_DLL herr_t H5atclose(H5_atclose_func_t func, void *ctx);
/**
@@ -659,7 +629,7 @@ H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
* after it has been closed. The value of \p is_terminating is
* undefined if this routine fails.
*
- * \since 1.12.1
+ * \since 1.13.0
*/
H5_DLL herr_t H5is_library_terminating(hbool_t *is_terminating);
/**
diff --git a/src/H5system.c b/src/H5system.c
index 2ac3f93..9a966b0 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -66,7 +66,7 @@
/* Track whether tzset routine was called */
static hbool_t H5_ntzset = FALSE;
-#ifndef HDvasprintf
+#ifndef H5_HAVE_VASPRINTF
/* HDvasprintf provides vasprintf-like function on targets where it is
* unavailable.
*/
@@ -94,132 +94,7 @@ HDvasprintf(char **bufp, const char *fmt, va_list _ap)
}
return -1;
}
-#endif
-
-/*-------------------------------------------------------------------------
- * Function: HDstrtoll
- *
- * Purpose: Converts the string S to an int64_t value according to the
- * given BASE, which must be between 2 and 36 inclusive, or be
- * the special value zero.
- *
- * The string must begin with an arbitrary amount of white space
- * (as determined by isspace(3c)) followed by a single optional
- * `+' or `-' sign. If BASE is zero or 16 the string may then
- * include a `0x' or `0X' prefix, and the number will be read in
- * base 16; otherwise a zero BASE is taken as 10 (decimal)
- * unless the next character is a `0', in which case it is taken
- * as 8 (octal).
- *
- * The remainder of the string is converted to an int64_t in the
- * obvious manner, stopping at the first character which is not
- * a valid digit in the given base. (In bases above 10, the
- * letter `A' in either upper or lower case represetns 10, `B'
- * represents 11, and so forth, with `Z' representing 35.)
- *
- * If REST is not null, the address of the first invalid
- * character in S is stored in *REST. If there were no digits
- * at all, the original value of S is stored in *REST. Thus, if
- * *S is not `\0' but **REST is `\0' on return the entire string
- * was valid.
- *
- * Return: Success: The result.
- *
- * Failure: If the input string does not contain any
- * digits then zero is returned and REST points
- * to the original value of S. If an overflow
- * or underflow occurs then the maximum or
- * minimum possible value is returned and the
- * global `errno' is set to ERANGE. If BASE is
- * incorrect then zero is returned.
- *
- * Programmer: Robb Matzke
- * Thursday, April 9, 1998
- *
- *-------------------------------------------------------------------------
- */
-#ifndef HDstrtoll
-int64_t
-HDstrtoll(const char *s, const char **rest, int base)
-{
- int64_t sign = 1, acc = 0;
- hbool_t overflow = FALSE;
-
- errno = 0;
- if (!s || (base && (base < 2 || base > 36))) {
- if (rest)
- *rest = s;
- return 0;
- }
-
- /* Skip white space */
- while (HDisspace(*s))
- s++;
-
- /* Optional minus or plus sign */
- if ('+' == *s) {
- s++;
- }
- else if ('-' == *s) {
- sign = -1;
- s++;
- }
-
- /* Zero base prefix */
- if (0 == base && '0' == *s && ('x' == s[1] || 'X' == s[1])) {
- base = 16;
- s += 2;
- }
- else if (0 == base && '0' == *s) {
- base = 8;
- s++;
- }
- else if (0 == base) {
- base = 10;
- }
-
- /* Digits */
- while ((base <= 10 && *s >= '0' && *s < '0' + base) ||
- (base > 10 && ((*s >= '0' && *s <= '9') || (*s >= 'a' && *s < 'a' + base - 10) ||
- (*s >= 'A' && *s < 'A' + base - 10)))) {
- if (!overflow) {
- int64_t digit = 0;
-
- if (*s >= '0' && *s <= '9')
- digit = *s - '0';
- else if (*s >= 'a' && *s <= 'z')
- digit = (*s - 'a') + 10;
- else
- digit = (*s - 'A') + 10;
-
- if (acc * base + digit < acc) {
- overflow = TRUE;
- }
- else {
- acc = acc * base + digit;
- }
- }
- s++;
- }
-
- /* Overflow */
- if (overflow) {
- if (sign > 0) {
- acc = ((uint64_t)1 << (8 * sizeof(int64_t) - 1)) - 1;
- }
- else {
- acc = (int64_t)((uint64_t)1 << (8 * sizeof(int64_t) - 1));
- }
- errno = ERANGE;
- }
-
- /* Return values */
- acc *= sign;
- if (rest)
- *rest = s;
- return acc;
-} /* end HDstrtoll() */
-#endif
+#endif /* H5_HAVE_VASPRINTF */
/*-------------------------------------------------------------------------
* Function: HDrand/HDsrand
@@ -460,6 +335,9 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz)
* Interestingly, getenv *is* available in the Windows
* POSIX layer, just not setenv.
*
+ * Note: Passing an empty string ("") for the value will remove
+ * the variable from the environment (like unsetenv(3))
+ *
* Return: Success: 0
* Failure: non-zero error code
*
@@ -471,14 +349,14 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz)
int
Wsetenv(const char *name, const char *value, int overwrite)
{
- size_t bufsize;
- errno_t err;
-
/* If we're not overwriting, check if the environment variable exists.
* If it does (i.e.: the required buffer size to store the variable's
* value is non-zero), then return an error code.
*/
if (!overwrite) {
+ size_t bufsize;
+ errno_t err;
+
err = getenv_s(&bufsize, NULL, 0, name);
if (err || bufsize)
return (int)err;
@@ -487,7 +365,7 @@ Wsetenv(const char *name, const char *value, int overwrite)
return (int)_putenv_s(name, value);
} /* end Wsetenv() */
-#ifdef H5_HAVE_WINSOCK2_H
+#ifdef H5_HAVE_WIN32_API
#pragma comment(lib, "advapi32.lib")
#endif
@@ -572,41 +450,15 @@ char *
Wgetlogin(void)
{
-#ifdef H5_HAVE_WINSOCK2_H
- long bufferCount = WloginBuffer_count;
- if (GetUserName(Wlogin_buffer, &bufferCount) == 0)
+#ifdef H5_HAVE_WIN32_API
+ DWORD bufferCount = WloginBuffer_count;
+ if (GetUserName(Wlogin_buffer, &bufferCount) != 0)
return (Wlogin_buffer);
else
-#endif /* H5_HAVE_WINSOCK2_H */
+#endif
return NULL;
}
-int
-c99_snprintf(char *str, size_t size, const char *format, ...)
-{
- int count;
- va_list ap;
-
- HDva_start(ap, format);
- count = c99_vsnprintf(str, size, format, ap);
- HDva_end(ap);
-
- return count;
-}
-
-int
-c99_vsnprintf(char *str, size_t size, const char *format, va_list ap)
-{
- int count = -1;
-
- if (size != 0)
- count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
- if (count == -1)
- count = _vscprintf(format, ap);
-
- return count;
-}
-
/*-------------------------------------------------------------------------
* Function: Wflock
*
@@ -618,110 +470,45 @@ c99_vsnprintf(char *str, size_t size, const char *format, va_list ap)
*-------------------------------------------------------------------------
*/
int
-Wflock(int H5_ATTR_UNUSED fd, int H5_ATTR_UNUSED operation)
+Wflock(int fd, int operation)
{
-/* This is a no-op while we implement a Win32 VFD */
-#if 0
-int
-Wflock(int fd, int operation) {
-
- HANDLE hFile;
- DWORD dwFlags = LOCKFILE_FAIL_IMMEDIATELY;
- DWORD dwReserved = 0;
- /* MAXDWORD for entire file */
- DWORD nNumberOfBytesToLockLow = MAXDWORD;
- DWORD nNumberOfBytesToLockHigh = MAXDWORD;
- /* Must initialize OVERLAPPED struct */
- OVERLAPPED overlapped = {0};
+ HANDLE hFile;
+ DWORD dwFlags = LOCKFILE_FAIL_IMMEDIATELY;
+ DWORD dwReserved = 0;
+ /* MAXDWORD locks the entire file */
+ DWORD nNumberOfBytesToLockLow = MAXDWORD;
+ DWORD nNumberOfBytesToLockHigh = MAXDWORD;
+ /* Must initialize OVERLAPPED struct */
+ OVERLAPPED overlapped = {0};
/* Get Windows HANDLE */
- hFile = _get_osfhandle(fd);
+ if (INVALID_HANDLE_VALUE == (hFile = (HANDLE)_get_osfhandle(fd)))
+ return -1;
/* Convert to Windows flags */
- if(operation & LOCK_EX)
+ if (operation & LOCK_EX)
dwFlags |= LOCKFILE_EXCLUSIVE_LOCK;
/* Lock or unlock */
- if(operation & LOCK_UN)
- if(0 == UnlockFileEx(hFile, dwReserved, nNumberOfBytesToLockLow,
- nNumberOfBytesToLockHigh, &overlapped))
- return -1;
- else
- if(0 == LockFileEx(hFile, dwFlags, dwReserved, nNumberOfBytesToLockLow,
- nNumberOfBytesToLockHigh, &overlapped))
+ if (operation & LOCK_UN) {
+ if (0 ==
+ UnlockFileEx(hFile, dwReserved, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh, &overlapped)) {
+ /* Attempting to unlock an already unlocked file will fail and this can happen
+ * in H5Fstart_swmr_write(). For now, just ignore the "error" (error code: 0x9e / 158).
+ */
+ if (GetLastError() != 158)
+ return -1;
+ }
+ }
+ else {
+ if (0 == LockFileEx(hFile, dwFlags, dwReserved, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh,
+ &overlapped))
return -1;
-#endif /* 0 */
- return 0;
-} /* end Wflock() */
+ }
-/*--------------------------------------------------------------------------
- * Function: Wnanosleep
- *
- * Purpose: Sleep for a given # of nanoseconds (Windows version)
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Dana Robinson
- * Fall 2016
- *--------------------------------------------------------------------------
- */
-int
-Wnanosleep(const struct timespec *req, struct timespec *rem)
-{
- /* XXX: Currently just a placeholder */
return 0;
-
-} /* end Wnanosleep() */
-
-/*-------------------------------------------------------------------------
- * Function: Wllround, Wllroundf, Wlround, Wlroundf, Wround, Wroundf
- *
- * Purpose: Wrapper function for round functions for use with VS2012
- * and earlier.
- *
- * Return: The rounded value that was passed in.
- *
- * Programmer: Dana Robinson
- * December 2016
- *
- *-------------------------------------------------------------------------
- */
-long long
-Wllround(double arg)
-{
- return (long long)(arg < 0.0 ? HDceil(arg - 0.5) : HDfloor(arg + 0.5));
-}
-
-long long
-Wllroundf(float arg)
-{
- return (long long)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F));
-}
-
-long
-Wlround(double arg)
-{
- return (long)(arg < 0.0 ? HDceil(arg - 0.5) : HDfloor(arg + 0.5));
-}
-
-long
-Wlroundf(float arg)
-{
- return (long)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F));
-}
-
-double
-Wround(double arg)
-{
- return arg < 0.0 ? HDceil(arg - 0.5) : HDfloor(arg + 0.5);
-}
-
-float
-Wroundf(float arg)
-{
- return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F));
-}
+} /* end Wflock() */
/*-------------------------------------------------------------------------
* Function: H5_get_utf16_str
@@ -737,7 +524,7 @@ Wroundf(float arg)
*
*-------------------------------------------------------------------------
*/
-const wchar_t *
+wchar_t *
H5_get_utf16_str(const char *s)
{
int nwchars = -1; /* Length of the UTF-16 buffer */
@@ -833,7 +620,7 @@ int
Wremove_utf8(const char *path)
{
wchar_t *wpath = NULL; /* UTF-16 version of the path */
- int ret;
+ int ret = -1;
/* Convert the input UTF-8 path to UTF-16 */
if (NULL == (wpath = H5_get_utf16_str(path)))
@@ -945,8 +732,8 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
HDstrncpy(full_path, cwdpath, cwdlen + 1);
if (!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1]))
- HDstrncat(full_path, H5_DIR_SEPS, HDstrlen(H5_DIR_SEPS));
- HDstrncat(full_path, new_name, HDstrlen(new_name));
+ HDstrncat(full_path, H5_DIR_SEPS, path_len - (cwdlen + 1));
+ HDstrncat(full_path, new_name, path_len - (cwdlen + 1) - HDstrlen(H5_DIR_SEPS));
} /* end if */
} /* end else */
@@ -1052,24 +839,54 @@ done:
*
* Purpose: Sleep for a given # of nanoseconds
*
- * Return: SUCCEED/FAIL
+ * Note that commodity hardware is probably going to have a
+ * resolution of milliseconds, not nanoseconds.
*
- * Programmer: Quincey Koziol
- * October 01, 2016
+ * Return: void
*--------------------------------------------------------------------------
*/
void
H5_nanosleep(uint64_t nanosec)
{
- struct timespec sleeptime; /* Struct to hold time to sleep */
-
FUNC_ENTER_NOAPI_NOINIT_NOERR
- /* Set up time to sleep */
- sleeptime.tv_sec = 0;
- sleeptime.tv_nsec = (long)nanosec;
+#ifdef H5_HAVE_WIN32_API
+ DWORD dwMilliseconds = (DWORD)HDceil(nanosec / 1.0e6);
+ DWORD ignore;
- HDnanosleep(&sleeptime, NULL);
+ /* Windows can't sleep at a ns resolution. Best we can do is ~1 ms. We
+ * don't care about the return value since the second parameter
+ * (bAlertable) is FALSE, so it will always be zero.
+ */
+ ignore = SleepEx(dwMilliseconds, FALSE);
+
+#else
+
+ const uint64_t nanosec_per_sec = 1000 * 1000 * 1000;
+ struct timespec sleeptime; /* Struct to hold time to sleep */
+
+ /* Set up time to sleep
+ *
+ * Assuming ILP32 or LP64 or wider architecture, (long)operand
+ * satisfies 0 <= operand < nanosec_per_sec < LONG_MAX.
+ *
+ * It's harder to be sure that we don't overflow time_t.
+ */
+ sleeptime.tv_sec = (time_t)(nanosec / nanosec_per_sec);
+ sleeptime.tv_nsec = (long)(nanosec % nanosec_per_sec);
+
+ /* Sleep for up to `sleeptime` and, in the event of an interruption,
+ * save the unslept time back to `sleeptime`.
+ */
+ while (HDnanosleep(&sleeptime, &sleeptime) == -1) {
+ /* If we were just interrupted, sleep for the remaining time.
+ * Otherwise, the error was essentially impossible, so just stop
+ * sleeping.
+ */
+ if (errno != EINTR)
+ break;
+ }
+#endif
FUNC_LEAVE_NOAPI_VOID
} /* end H5_nanosleep() */
@@ -1119,3 +936,167 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5_expand_windows_env_vars() */
#endif /* H5_HAVE_WIN32_API */
+
+/* Global variables */
+int H5_opterr = 1; /* Get_option prints errors if this is on */
+int H5_optind = 1; /* Token pointer */
+const char *H5_optarg; /* Flag argument (or value) */
+
+/*-------------------------------------------------------------------------
+ * Function: H5_get_option
+ *
+ * Purpose: Determine the command-line options a user specified. We can
+ * accept both short and long type command-lines.
+ *
+ * Return: Success: The short valued "name" of the command line
+ * parameter or EOF if there are no more
+ * parameters to process.
+ *
+ * Failure: A question mark.
+ *-------------------------------------------------------------------------
+ */
+int
+H5_get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts)
+{
+ static int sp = 1; /* character index in current token */
+ int optchar = '?'; /* option character passed back to user */
+
+ if (sp == 1) {
+ /* check for more flag-like tokens */
+ if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') {
+ return EOF;
+ }
+ else if (HDstrcmp(argv[H5_optind], "--") == 0) {
+ H5_optind++;
+ return EOF;
+ }
+ }
+
+ if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') {
+ /* long command line option */
+ int i;
+ const char ch = '=';
+ char * arg = HDstrdup(&argv[H5_optind][2]);
+ size_t arg_len = 0;
+
+ H5_optarg = strchr(&argv[H5_optind][2], ch);
+ arg_len = HDstrlen(&argv[H5_optind][2]);
+ if (H5_optarg) {
+ arg_len -= HDstrlen(H5_optarg);
+ H5_optarg++; /* skip the equal sign */
+ }
+ arg[arg_len] = 0;
+
+ for (i = 0; l_opts && l_opts[i].name; i++) {
+ if (HDstrcmp(arg, l_opts[i].name) == 0) {
+ /* we've found a matching long command line flag */
+ optchar = l_opts[i].shortval;
+
+ if (l_opts[i].has_arg != no_arg) {
+ if (H5_optarg == NULL) {
+ if (l_opts[i].has_arg != optional_arg) {
+ if (H5_optind < (argc - 1))
+ if (argv[H5_optind + 1][0] != '-')
+ H5_optarg = argv[++H5_optind];
+ }
+ else if (l_opts[i].has_arg == require_arg) {
+ if (H5_opterr)
+ HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg);
+
+ optchar = '?';
+ }
+ }
+ }
+ else {
+ if (H5_optarg) {
+ if (H5_opterr)
+ HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg);
+
+ optchar = '?';
+ }
+ }
+ break;
+ }
+ }
+
+ if (l_opts[i].name == NULL) {
+ /* exhausted all of the l_opts we have and still didn't match */
+ if (H5_opterr)
+ HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
+
+ optchar = '?';
+ }
+
+ H5_optind++;
+ sp = 1;
+
+ HDfree(arg);
+ }
+ else {
+ register char *cp; /* pointer into current token */
+
+ /* short command line option */
+ optchar = argv[H5_optind][sp];
+
+ if (optchar == ':' || (cp = HDstrchr(opts, optchar)) == 0) {
+ if (H5_opterr)
+ HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], optchar);
+
+ /* if no chars left in this token, move to next token */
+ if (argv[H5_optind][++sp] == '\0') {
+ H5_optind++;
+ sp = 1;
+ }
+ return '?';
+ }
+
+ if (*++cp == ':') {
+ /* if a value is expected, get it */
+ if (argv[H5_optind][sp + 1] != '\0') {
+ /* flag value is rest of current token */
+ H5_optarg = &argv[H5_optind++][sp + 1];
+ }
+ else if (++H5_optind >= argc) {
+ if (H5_opterr)
+ HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], optchar);
+
+ optchar = '?';
+ }
+ else {
+ /* flag value is next token */
+ H5_optarg = argv[H5_optind++];
+ }
+
+ sp = 1;
+ }
+ /* wildcard argument */
+ else if (*cp == '*') {
+ /* check the next argument */
+ H5_optind++;
+ /* we do have an extra argument, check if not last */
+ if ((H5_optind + 1) < argc) {
+ if (argv[H5_optind][0] != '-') {
+ H5_optarg = argv[H5_optind++];
+ }
+ else {
+ H5_optarg = NULL;
+ }
+ }
+ else {
+ H5_optarg = NULL;
+ }
+ }
+ else {
+ /* set up to look at next char in token, next time */
+ if (argv[H5_optind][++sp] == '\0') {
+ /* no more in current token, so setup next token */
+ H5_optind++;
+ sp = 1;
+ }
+ H5_optarg = NULL;
+ }
+ }
+
+ /* return the current flag character found */
+ return optchar;
+}
diff --git a/src/H5timer.c b/src/H5timer.c
index 54a3365..b2cc5f0 100644
--- a/src/H5timer.c
+++ b/src/H5timer.c
@@ -42,9 +42,9 @@
#define H5TIMER_TIME_STRING_LEN 1536
/* Conversion factors */
-#define H5_SEC_PER_DAY (double)(24.0F * 60.0F * 60.0F)
-#define H5_SEC_PER_HOUR (double)(60.0F * 60.0F)
-#define H5_SEC_PER_MIN (double)(60.0F)
+#define H5_SEC_PER_DAY (24.0 * 60.0 * 60.0)
+#define H5_SEC_PER_HOUR (60.0 * 60.0)
+#define H5_SEC_PER_MIN (60.0)
/******************/
/* Local Typedefs */
@@ -100,13 +100,13 @@ H5_bandwidth(char *buf /*out*/, double nbytes, double nseconds)
{
double bw;
- if (nseconds <= (double)0.0F)
+ if (nseconds <= 0.0)
HDstrcpy(buf, " NaN");
else {
bw = nbytes / nseconds;
- if (H5_DBL_ABS_EQUAL(bw, (double)0.0F))
+ if (H5_DBL_ABS_EQUAL(bw, 0.0))
HDstrcpy(buf, "0.000 B/s");
- else if (bw < (double)1.0F)
+ else if (bw < 1.0)
HDsprintf(buf, "%10.4e", bw);
else if (bw < (double)H5_KB) {
HDsprintf(buf, "%05.4f", bw);
@@ -224,7 +224,7 @@ H5_now_usec(void)
double
H5_get_time(void)
{
- double ret_value = (double)0.0f;
+ double ret_value = 0.0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -233,14 +233,14 @@ H5_get_time(void)
struct timespec ts;
HDclock_gettime(CLOCK_MONOTONIC, &ts);
- ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / (double)1000000000.0f);
+ ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / 1000000000.0);
}
#elif defined(H5_HAVE_GETTIMEOFDAY)
{
struct timeval now_tv;
HDgettimeofday(&now_tv, NULL);
- ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / (double)1000000.0f);
+ ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / 1000000.0);
}
#else
ret_value = (double)HDtime(NULL);
@@ -289,8 +289,8 @@ H5__timer_get_timevals(H5_timevals_t *times /*in,out*/)
if (HDgetrusage(RUSAGE_SELF, &res) < 0)
return -1;
- times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / (double)1.0E6F);
- times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / (double)1.0E6F);
+ times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / 1.0E6);
+ times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / 1.0E6);
}
#else
/* No suitable way to get system/user times */
@@ -589,7 +589,7 @@ H5_timer_get_time_string(double seconds)
double remainder_sec = 0.0;
/* Extract larger time units from count of seconds */
- if (seconds > (double)60.0F) {
+ if (seconds > 60.0) {
/* Set initial # of seconds */
remainder_sec = seconds;
@@ -617,19 +617,19 @@ H5_timer_get_time_string(double seconds)
* time unit. Perhaps this could be passed as an integer.
* (name? round_up_size? ?)
*/
- if (seconds < (double)0.0F)
+ if (seconds < 0.0)
HDsprintf(s, "N/A");
- else if (H5_DBL_ABS_EQUAL((double)0.0F, seconds))
+ else if (H5_DBL_ABS_EQUAL(0.0, seconds))
HDsprintf(s, "0.0 s");
- else if (seconds < (double)1.0E-6F)
+ else if (seconds < 1.0E-6)
/* t < 1 us, Print time in ns */
- HDsprintf(s, "%.f ns", seconds * (double)1.0E9F);
- else if (seconds < (double)1.0E-3F)
+ HDsprintf(s, "%.f ns", seconds * 1.0E9);
+ else if (seconds < 1.0E-3)
/* t < 1 ms, Print time in us */
- HDsprintf(s, "%.1f us", seconds * (double)1.0E6F);
- else if (seconds < (double)1.0F)
+ HDsprintf(s, "%.1f us", seconds * 1.0E6);
+ else if (seconds < 1.0)
/* t < 1 s, Print time in ms */
- HDsprintf(s, "%.1f ms", seconds * (double)1.0E3F);
+ HDsprintf(s, "%.1f ms", seconds * 1.0E3);
else if (seconds < H5_SEC_PER_MIN)
/* t < 1 m, Print time in s */
HDsprintf(s, "%.2f s", seconds);
diff --git a/src/H5trace.c b/src/H5trace.c
index aa9cfd4..3a5d420 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -1083,6 +1083,15 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
} /* end block */
break;
+ case 'C': /* H5ES_event_complete_func_t */
+ {
+ H5ES_event_complete_func_t cfunc =
+ (H5ES_event_complete_func_t)HDva_arg(ap, H5ES_event_complete_func_t);
+
+ H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)cfunc);
+ } /* end block */
+ break;
+
case 'd': /* H5E_direction_t */
{
H5E_direction_t direction = (H5E_direction_t)HDva_arg(ap, int);
@@ -1111,6 +1120,15 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
} /* end block */
break;
+ case 'I': /* H5ES_event_insert_func_t */
+ {
+ H5ES_event_insert_func_t ifunc =
+ (H5ES_event_insert_func_t)HDva_arg(ap, H5ES_event_insert_func_t);
+
+ H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ifunc);
+ } /* end block */
+ break;
+
case 's': /* H5ES_status_t */
{
H5ES_status_t status = (H5ES_status_t)HDva_arg(ap, int);
@@ -1124,6 +1142,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5ES_STATUS_SUCCEED");
break;
+ case H5ES_STATUS_CANCELED:
+ H5RS_acat(rs, "H5ES_STATUS_CANCELED");
+ break;
+
case H5ES_STATUS_FAIL:
H5RS_acat(rs, "H5ES_STATUS_FAIL");
break;
@@ -1467,6 +1489,14 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
} /* end block */
break;
+ case 'c': /* H5_atclose_func_t */
+ {
+ H5_atclose_func_t cfunc = (H5_atclose_func_t)HDva_arg(ap, H5_atclose_func_t);
+
+ H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)cfunc);
+ } /* end block */
+ break;
+
case 's': /* hssize_t */
{
hssize_t hssize = HDva_arg(ap, hssize_t);
@@ -2873,6 +2903,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_ATTR_DELETE");
break;
+ case H5VL_ATTR_DELETE_BY_IDX:
+ H5RS_acat(rs, "H5VL_ATTR_DELETE_BY_IDX");
+ break;
+
case H5VL_ATTR_EXISTS:
H5RS_acat(rs, "H5VL_ATTR_EXISTS");
break;
@@ -2901,10 +2935,6 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_BLOB_DELETE");
break;
- case H5VL_BLOB_GETSIZE:
- H5RS_acat(rs, "H5VL_BLOB_GETSIZE");
- break;
-
case H5VL_BLOB_ISNULL:
H5RS_acat(rs, "H5VL_BLOB_ISNULL");
break;
@@ -2985,10 +3015,6 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_DATASET_REFRESH");
break;
- case H5VL_DATASET_WAIT:
- H5RS_acat(rs, "H5VL_DATASET_WAIT");
- break;
-
default:
H5RS_asprintf_cat(rs, "%ld", (long)specific);
break;
@@ -3001,6 +3027,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5VL_datatype_get_t get = (H5VL_datatype_get_t)HDva_arg(ap, int);
switch (get) {
+ case H5VL_DATATYPE_GET_BINARY_SIZE:
+ H5RS_acat(rs, "H5VL_DATATYPE_GET_BINARY_SIZE");
+ break;
+
case H5VL_DATATYPE_GET_BINARY:
H5RS_acat(rs, "H5VL_DATATYPE_GET_BINARY");
break;
@@ -3093,14 +3123,6 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_FILE_REOPEN");
break;
- case H5VL_FILE_MOUNT:
- H5RS_acat(rs, "H5VL_FILE_MOUNT");
- break;
-
- case H5VL_FILE_UNMOUNT:
- H5RS_acat(rs, "H5VL_FILE_UNMOUNT");
- break;
-
case H5VL_FILE_IS_ACCESSIBLE:
H5RS_acat(rs, "H5VL_FILE_IS_ACCESSIBLE");
break;
@@ -3113,10 +3135,6 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_FILE_IS_EQUAL");
break;
- case H5VL_FILE_WAIT:
- H5RS_acat(rs, "H5VL_FILE_WAIT");
- break;
-
default:
H5RS_asprintf_cat(rs, "%ld", (long)specific);
break;
@@ -3149,6 +3167,14 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5VL_group_specific_t specific = (H5VL_group_specific_t)HDva_arg(ap, int);
switch (specific) {
+ case H5VL_GROUP_MOUNT:
+ H5RS_acat(rs, "H5VL_GROUP_MOUNT");
+ break;
+
+ case H5VL_GROUP_UNMOUNT:
+ H5RS_acat(rs, "H5VL_GROUP_UNMOUNT");
+ break;
+
case H5VL_GROUP_FLUSH:
H5RS_acat(rs, "H5VL_GROUP_FLUSH");
break;
@@ -3164,9 +3190,9 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
} /* end block */
break;
- case 'k': /* H5VL_link_create_type_t */
+ case 'k': /* H5VL_link_create_t */
{
- H5VL_link_create_type_t create = (H5VL_link_create_type_t)HDva_arg(ap, int);
+ H5VL_link_create_t create = (H5VL_link_create_t)HDva_arg(ap, int);
switch (create) {
case H5VL_LINK_CREATE_HARD:
@@ -3334,22 +3360,14 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5VL_request_specific_t specific = (H5VL_request_specific_t)HDva_arg(ap, int);
switch (specific) {
- case H5VL_REQUEST_WAITANY:
- H5RS_acat(rs, "H5VL_REQUEST_WAITANY");
- break;
-
- case H5VL_REQUEST_WAITSOME:
- H5RS_acat(rs, "H5VL_REQUEST_WAITSOME");
- break;
-
- case H5VL_REQUEST_WAITALL:
- H5RS_acat(rs, "H5VL_REQUEST_WAITALL");
- break;
-
case H5VL_REQUEST_GET_ERR_STACK:
H5RS_acat(rs, "H5VL_REQUEST_GET_ERR_STACK");
break;
+ case H5VL_REQUEST_GET_EXEC_TIME:
+ H5RS_acat(rs, "H5VL_REQUEST_GET_EXEC_TIME");
+ break;
+
default:
H5RS_asprintf_cat(rs, "%ld", (long)specific);
break;
@@ -3608,6 +3626,7 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG");
break;
+#ifdef H5_HAVE_PARALLEL
case H5VL_NATIVE_FILE_GET_MPI_ATOMICITY:
H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MPI_ATOMICITY");
break;
@@ -3615,6 +3634,7 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
case H5VL_NATIVE_FILE_SET_MPI_ATOMICITY:
H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MPI_ATOMICITY");
break;
+#endif /* H5_HAVE_PARALLEL */
case H5VL_NATIVE_FILE_POST_OPEN:
H5RS_acat(rs, "H5VL_NATIVE_FILE_POST_OPEN");
@@ -3883,8 +3903,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
hssize_t i;
FILE * out = H5_debug_g.trace;
static hbool_t is_first_invocation = TRUE;
- H5_timer_t function_timer = {{0}, {0}, {0}, FALSE};
- H5_timevals_t function_times;
+ H5_timer_t function_timer;
+ H5_timevals_t function_times = {0.0, 0.0, 0.0};
static H5_timer_t running_timer;
H5_timevals_t running_times;
static int current_depth = 0;
@@ -3893,36 +3913,39 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
/* FUNC_ENTER() should not be called */
if (!out)
- return (double)0.0F; /*tracing is off*/
+ return 0.0; /* Tracing is off */
+
+ /* Initialize the timer for this function */
+ if (H5_debug_g.ttimes)
+ H5_timer_init(&function_timer);
if (H5_debug_g.ttop) {
if (returning) {
if (current_depth > 1) {
--current_depth;
- return (double)0.0F;
- } /* end if */
- } /* end if */
+ return 0.0;
+ }
+ }
else {
if (current_depth > 0) {
- /*do not update last_call_depth*/
+ /* Do not update last_call_depth */
current_depth++;
- return (double)0.0F;
- } /* end if */
- } /* end else */
- } /* end if */
+ return 0.0;
+ }
+ }
+ }
/* Get time for event if the trace times flag is set */
if (is_first_invocation && H5_debug_g.ttimes) {
- /* start the library-wide timer */
+ /* Start the library-wide timer */
is_first_invocation = FALSE;
H5_timer_init(&running_timer);
H5_timer_start(&running_timer);
- } /* end if */
- if (H5_debug_g.ttimes) {
- /* start the timer for this function */
- H5_timer_init(&function_timer);
+ }
+
+ /* Start the timer for this function */
+ if (H5_debug_g.ttimes)
H5_timer_start(&function_timer);
- } /* end if */
/* Create the ref-counted string */
rs = H5RS_create(NULL);
@@ -3945,15 +3968,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
H5_timer_get_times(running_timer, &running_times);
HDsprintf(tmp, "%.6f", (function_times.elapsed - running_times.elapsed));
H5RS_asprintf_cat(rs, " %*s ", (int)HDstrlen(tmp), "");
- } /* end if */
+ }
for (i = 0; i < current_depth; i++)
H5RS_aputc(rs, '+');
H5RS_asprintf_cat(rs, "%*s%s = ", 2 * current_depth, "", func);
- } /* end if */
+ }
else
/* Continue current line with return value */
H5RS_acat(rs, " = ");
- } /* end if */
+ }
else {
if (current_depth > last_call_depth)
H5RS_acat(rs, " = <delayed>\n");
@@ -3961,11 +3984,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
H5_timer_get_times(function_timer, &function_times);
H5_timer_get_times(running_timer, &running_times);
H5RS_asprintf_cat(rs, "@%.6f ", (function_times.elapsed - running_times.elapsed));
- } /* end if */
+ }
for (i = 0; i < current_depth; i++)
H5RS_aputc(rs, '+');
H5RS_asprintf_cat(rs, "%*s%s(", 2 * current_depth, "", func);
- } /* end else */
+ }
/* Format arguments into the refcounted string */
HDva_start(ap, type);
@@ -3978,7 +4001,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
H5_timer_get_times(running_timer, &running_times);
H5RS_asprintf_cat(rs, " @%.6f [dt=%.6f]", (function_times.elapsed - running_times.elapsed),
(function_times.elapsed - *returning));
- } /* end if */
+ }
/* Display generated string */
if (returning)
@@ -3986,7 +4009,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
else {
last_call_depth = current_depth++;
H5RS_acat(rs, ")");
- } /* end else */
+ }
HDfputs(H5RS_get_str(rs), out);
HDfflush(out);
H5RS_decr(rs);
@@ -3994,5 +4017,5 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
if (H5_debug_g.ttimes)
return function_times.elapsed;
else
- return (double)0.0F;
+ return 0.0;
} /* end H5_trace() */
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index b4b253f..44cf50c 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -11,90 +11,53 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Scott Wegner
- * June 3, 2008
- *
- * Purpose: This file is used to map HDF macros to Windows functions. This
+/* Purpose: This file is used to map HDF macros to Windows functions. This
* should get included H5private mappings, so as to override them.
* Any macro not mapped here, however, will receive a similar mapping
* inside H5private.h
*
*/
-#ifndef H5_HAVE_INTTYPES_H
-/* The following definitions should be suitable for 64-bit Windows, which is
- * LLP64, and for 32-bit Windows, which is ILP32. Those are the only
- * platforms where <inttypes.h> is likely to be missing. VS2015 and later
- * *may* provide these definitions.
- */
-#ifdef _WIN64
-#define PRIdPTR "lld"
-#define PRIoPTR "llo"
-#define PRIuPTR "llu"
-#define PRIxPTR "llx"
-#define PRIXPTR "llX"
-#else /* _WIN64 */
-#define PRIdPTR "ld"
-#define PRIoPTR "lo"
-#define PRIuPTR "lu"
-#define PRIxPTR "lx"
-#define PRIXPTR "lX"
-#endif /* _WIN64 */
-
-#define PRId8 "d"
-#define PRIo8 "o"
-#define PRIu8 "u"
-#define PRIx8 "x"
-#define PRIX8 "X"
-#define PRId16 "d"
-#define PRIo16 "o"
-#define PRIu16 "u"
-#define PRIx16 "x"
-#define PRIX16 "X"
-#define PRId32 "d"
-#define PRIo32 "o"
-#define PRIu32 "u"
-#define PRIx32 "x"
-#define PRIX32 "X"
-#define PRId64 "lld"
-#define PRIo64 "llo"
-#define PRIu64 "llu"
-#define PRIx64 "llx"
-#define PRIX64 "llX"
-#define PRIdMAX "lld"
-#define PRIoMAX "llo"
-#define PRIuMAX "llu"
-#define PRIxMAX "llx"
-#define PRIXMAX "llX"
-#endif
-/*
- * _MSC_VER = 1900 VS2015
- * _MSC_VER = 1800 VS2013
- * _MSC_VER = 1700 VS2012
+/* _MSC_VER = 192x VS2019
+ * _MSC_VER = 191x VS2017
+ * _MSC_VER = 1900 VS2015
+ * _MSC_VER = 1800 VS2013
+ * _MSC_VER = 1700 VS2012
*/
#ifdef H5_HAVE_WIN32_API
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
-#define HDaccess(F, M) _access(F, M)
-#define HDchdir(S) _chdir(S)
-#define HDclose(F) _close(F)
-#define HDcreat(S, M) Wopen_utf8(S, O_CREAT | O_TRUNC | O_RDWR, M)
-#define HDdup(F) _dup(F)
-#define HDfdopen(N, S) _fdopen(N, S)
-#define HDfileno(F) _fileno(F)
-#define HDfstat(F, B) _fstati64(F, B)
-#define HDisatty(F) _isatty(F)
+#ifdef H5_HAVE_VISUAL_STUDIO
+
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+
+#endif /* H5_HAVE_VISUAL_STUDIO */
-#define HDgetcwd(S, Z) _getcwd(S, Z)
-#define HDgetdcwd(D, S, Z) _getdcwd(D, S, Z)
-#define HDgetdrive() _getdrive()
-#define HDlseek(F, O, W) _lseeki64(F, O, W)
-#define HDlstat(S, B) _lstati64(S, B)
-#define HDmkdir(S, M) _mkdir(S)
-#define HDnanosleep(N, O) Wnanosleep(N, O)
-#define HDoff_t __int64
+#define HDaccess(F, M) _access(F, M)
+#define HDchdir(S) _chdir(S)
+#define HDclose(F) _close(F)
+#define HDcreat(S, M) Wopen_utf8(S, O_CREAT | O_TRUNC | O_RDWR, M)
+#define HDdup(F) _dup(F)
+#define HDfdopen(N, S) _fdopen(N, S)
+#define HDfileno(F) _fileno(F)
+#define HDflock(F, L) Wflock(F, L)
+#define HDfstat(F, B) _fstati64(F, B)
+#define HDgetcwd(S, Z) _getcwd(S, Z)
+#define HDgetdcwd(D, S, Z) _getdcwd(D, S, Z)
+#define HDgetdrive() _getdrive()
+#define HDgetlogin() Wgetlogin()
+#define HDgettimeofday(V, Z) Wgettimeofday(V, Z)
+#define HDisatty(F) _isatty(F)
+#define HDlseek(F, O, W) _lseeki64(F, O, W)
+#define HDlstat(S, B) _lstati64(S, B)
+#define HDmemset(X, C, Z) memset((void *)(X), C, Z) /* Cast avoids MSVC warning */
+#define HDmkdir(S, M) _mkdir(S)
+#define HDoff_t __int64
/* Note that the variadic HDopen macro is using a VC++ extension
* where the comma is dropped if nothing is passed to the ellipsis.
@@ -104,9 +67,11 @@ typedef __int64 h5_stat_size_t;
#else
#define HDopen(S, F, ...) Wopen_utf8(S, F, ##__VA_ARGS__)
#endif
+
#define HDread(F, M, Z) _read(F, M, Z)
#define HDremove(S) Wremove_utf8(S)
#define HDrmdir(S) _rmdir(S)
+#define HDsetenv(N, V, O) Wsetenv(N, V, O)
#define HDsetvbuf(F, S, M, Z) setvbuf(F, S, M, (Z > 1 ? Z : 2))
#define HDsleep(S) Sleep(S * 1000)
#define HDstat(S, B) _stati64(S, B)
@@ -115,55 +80,13 @@ typedef __int64 h5_stat_size_t;
#define HDstrtok_r(X, Y, Z) strtok_s(X, Y, Z)
#define HDtzset() _tzset()
#define HDunlink(S) _unlink(S)
+#define HDunsetenv(N) Wsetenv(N, "", 1)
#define HDwrite(F, M, Z) _write(F, M, Z)
-#ifdef H5_HAVE_VISUAL_STUDIO
-
-#if (_MSC_VER < 1800)
-#ifndef H5_HAVE_STRTOLL
-#define HDstrtoll(S, R, N) _strtoi64(S, R, N)
-#endif /* H5_HAVE_STRTOLL */
-#ifndef H5_HAVE_STRTOULL
-#define HDstrtoull(S, R, N) _strtoui64(S, R, N)
-#endif /* H5_HAVE_STRTOULL */
-/* va_copy() does not exist on pre-2013 Visual Studio. Since va_lists are
- * just pointers into the stack in those CRTs, the usual work-around
- * is to just define the operation as a pointer copy.
- */
-#define HDva_copy(D, S) ((D) = (S))
-#endif /* MSC_VER < 1800 */
-
-/*
- * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO
- */
-#define HDmemset(X, C, Z) memset((void *)(X), C, Z)
-
-struct timezone {
- int tz_minuteswest;
- int tz_dsttime;
-};
-
-/* time.h before VS2015 does not include timespec */
-#if (_MSC_VER < 1900)
-struct timespec {
- time_t tv_sec; /* Seconds - >= 0 */
- long tv_nsec; /* Nanoseconds - [0, 999999999] */
-};
-#endif /* MSC_VER < 1900 */
-
-#if (_MSC_VER <= 1700)
-/* The isnan function needs underscore in VS2012 and earlier */
-#define HDisnan(X) _isnan(X)
-/* The round functions do not exist in VS2012 and earlier */
-#define HDllround(V) Wllround(V)
-#define HDllroundf(V) Wllroundf(V)
-#define HDlround(V) Wlround(V)
-#define HDlroundf(V) Wlroundf(V)
-#define HDround(V) Wround(V)
-#define HDroundf(V) Wroundf(V)
-#endif /* MSC_VER < 1700 */
-
-#endif /* H5_HAVE_VISUAL_STUDIO */
+#ifndef H5_HAVE_MINGW
+#define HDftruncate(F, L) _chsize_s(F, L)
+#define HDfseek(F, O, W) _fseeki64(F, O, W)
+#endif /* H5_HAVE_MINGW */
#ifdef __cplusplus
extern "C" {
@@ -172,41 +95,13 @@ H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz);
H5_DLL int Wsetenv(const char *name, const char *value, int overwrite);
H5_DLL int Wflock(int fd, int operation);
H5_DLL char * Wgetlogin(void);
-H5_DLL int c99_snprintf(char *str, size_t size, const char *format, ...);
-H5_DLL int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap);
-H5_DLL int Wnanosleep(const struct timespec *req, struct timespec *rem);
H5_DLL herr_t H5_expand_windows_env_vars(char **env_var);
-H5_DLL const wchar_t *H5_get_utf16_str(const char *s);
-H5_DLL int Wopen_utf8(const char *path, int oflag, ...);
-H5_DLL int Wremove_utf8(const char *path);
-
-/* Round functions only needed for VS2012 and earlier.
- * They are always built to ensure they don't go stale and
- * can be deleted (along with their #defines, above) when we
- * drop VS2012 support.
- */
-H5_DLL long long Wllround(double arg);
-H5_DLL long long Wllroundf(float arg);
-H5_DLL long Wlround(double arg);
-H5_DLL long Wlroundf(float arg);
-H5_DLL double Wround(double arg);
-H5_DLL float Wroundf(float arg);
+H5_DLL wchar_t *H5_get_utf16_str(const char *s);
+H5_DLL int Wopen_utf8(const char *path, int oflag, ...);
+H5_DLL int Wremove_utf8(const char *path);
+H5_DLL int H5_get_win32_times(H5_timevals_t *tvs);
#ifdef __cplusplus
}
#endif /* __cplusplus */
-#define HDgettimeofday(V, Z) Wgettimeofday(V, Z)
-#define HDsetenv(N, V, O) Wsetenv(N, V, O)
-#define HDflock(F, L) Wflock(F, L)
-#define HDgetlogin() Wgetlogin()
-#define HDsnprintf c99_snprintf /*varargs*/
-#define HDvsnprintf c99_vsnprintf /*varargs*/
-
-/* Non-POSIX functions */
-
-#ifndef H5_HAVE_MINGW
-#define HDftruncate(F, L) _chsize_s(F, L)
-#define HDfseek(F, O, W) _fseeki64(F, O, W)
-#endif /* H5_HAVE_MINGW */
-
#endif /* H5_HAVE_WIN32_API */
diff --git a/src/Makefile.am b/src/Makefile.am
index e21a3e7..ce6e3b1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,9 +19,6 @@
include $(top_srcdir)/config/commence.am
include $(top_srcdir)/config/lt_vers.am
-# include Doxygen rules (requires autoconf-archive >2016-03-20)
-@DX_RULES@
-
# How to build H5detect for number format detection.
# Use -g to force no optimization since many compilers (e.g., Intel) takes
# a long time to compile it with any optimization on. H5detect is used
@@ -79,7 +76,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \
H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c \
H5HP.c \
H5I.c H5Idbg.c H5Iint.c H5Itest.c \
- H5L.c H5Ldeprec.c H5Lexternal.c \
+ H5L.c H5Ldeprec.c H5Lexternal.c H5Lint.c \
H5M.c \
H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \
H5MM.c H5MP.c H5MPtest.c \
@@ -102,19 +99,17 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \
H5Sselect.c H5Stest.c \
H5SL.c \
H5SM.c H5SMbtree2.c H5SMcache.c H5SMmessage.c H5SMtest.c \
- H5ST.c \
H5T.c H5Tarray.c H5Tbit.c H5Tcommit.c H5Tcompound.c H5Tconv.c \
H5Tcset.c H5Tdbg.c H5Tdeprec.c H5Tenum.c H5Tfields.c H5Tfixed.c \
H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c H5Topaque.c \
H5Torder.c H5Tref.c H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c \
H5Tvlen.c \
H5TS.c \
- H5VL.c H5VLcallback.c H5VLint.c H5VLnative.c \
+ H5VL.c H5VLcallback.c H5VLdyn_ops.c H5VLint.c H5VLnative.c \
H5VLnative_attr.c H5VLnative_blob.c H5VLnative_dataset.c \
H5VLnative_datatype.c H5VLnative_file.c H5VLnative_group.c \
H5VLnative_link.c H5VLnative_introspect.c H5VLnative_object.c \
- H5VLnative_token.c \
- H5VLpassthru.c \
+ H5VLnative_token.c H5VLpassthru.c H5VLtest.c \
H5VM.c H5WB.c H5Z.c \
H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zscaleoffset.c \
H5Zszip.c H5Ztrans.c
@@ -155,11 +150,15 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers
H5Gpublic.h H5Ipublic.h H5Lpublic.h \
H5Mpublic.h H5MMpublic.h H5Opublic.h H5Ppublic.h \
H5PLextern.h H5PLpublic.h \
- H5Rpublic.h H5Spublic.h H5Tpublic.h H5TSpublic.h \
+ H5Rpublic.h H5Spublic.h H5Tpublic.h \
H5VLconnector.h H5VLconnector_passthru.h \
H5VLnative.h H5VLpassthru.h H5VLpublic.h \
H5Zpublic.h
+# Public component author headers
+include_HEADERS += H5ESdevelop.h H5FDdevelop.h H5Idevelop.h H5Ldevelop.h \
+ H5Tdevelop.h H5TSdevelop.h H5Zdevelop.h
+
# install libhdf5.settings in lib directory
settingsdir=$(libdir)
settings_DATA=libhdf5.settings
@@ -204,11 +203,6 @@ $(top_srcdir)/src/H5version.h: $(top_srcdir)/src/H5vers.txt
$(top_srcdir)/src/H5overflow.h: $(top_srcdir)/src/H5overflow.txt
perl $(top_srcdir)/bin/make_overflow $?
-# doxygen support
-if BUILD_DOXYGEN_CONDITIONAL
-doxygen: doxygen-doc
-endif
-
# Add TRACE macros to library source files. This is done via the trace script
# in the hdf5/bin directory. If the file contains HDF5 API macros, a "clean"
# version of the source file is saved with a tilde (~) after its name and
diff --git a/src/hdf5.h b/src/hdf5.h
index 6edc084..8751ec5 100644
--- a/src/hdf5.h
+++ b/src/hdf5.h
@@ -38,10 +38,23 @@
#include "H5Rpublic.h" /* References */
#include "H5Spublic.h" /* Dataspaces */
#include "H5Tpublic.h" /* Datatypes */
-#include "H5TSpublic.h" /* Thread-safety */
#include "H5VLpublic.h" /* Virtual Object Layer */
#include "H5Zpublic.h" /* Data filters */
+/* Plugin/component developer headers */
+#include "H5ESdevelop.h" /* Event Sets */
+#include "H5FDdevelop.h" /* File drivers */
+#include "H5Idevelop.h" /* ID management */
+#include "H5Ldevelop.h" /* Links */
+#include "H5Tdevelop.h" /* Datatypes */
+#include "H5TSdevelop.h" /* Threadsafety */
+#include "H5Zdevelop.h" /* Data filters */
+
+/* Virtual object layer (VOL) connector developer support */
+#include "H5VLconnector.h" /* VOL connector author routines */
+#include "H5VLconnector_passthru.h" /* Pass-through VOL connector author routines */
+#include "H5VLnative.h" /* Native VOL connector macros, for VOL connector authors */
+
/* Predefined file drivers */
#include "H5FDcore.h" /* Files stored entirely in memory */
#include "H5FDdirect.h" /* Linux direct I/O */
diff --git a/src/uthash.h b/src/uthash.h
new file mode 100644
index 0000000..8bdca55
--- /dev/null
+++ b/src/uthash.h
@@ -0,0 +1,1184 @@
+/*
+Copyright (c) 2003-2018, Troy D. Hanson http://troydhanson.github.com/uthash/
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef UTHASH_H
+#define UTHASH_H
+
+#define UTHASH_VERSION 2.1.0
+
+#include <string.h> /* memcmp, memset, strlen */
+#include <stddef.h> /* ptrdiff_t */
+#include <stdlib.h> /* exit */
+
+/* These macros use decltype or the earlier __typeof GNU extension.
+ As decltype is only available in newer compilers (VS2010 or gcc 4.3+
+ when compiling c++ source) this code uses whatever method is needed
+ or, for VS2008 where neither is available, uses casting workarounds. */
+#if !defined(DECLTYPE) && !defined(NO_DECLTYPE)
+#if defined(_MSC_VER) /* MS compiler */
+#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */
+#define DECLTYPE(x) (decltype(x))
+#else /* VS2008 or older (or VS2010 in C mode) */
+#define NO_DECLTYPE
+#endif
+#elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__)
+#define NO_DECLTYPE
+#else /* GNU, Sun and other compilers */
+#define DECLTYPE(x) (__typeof(x))
+#endif
+#endif
+
+#ifdef NO_DECLTYPE
+#define DECLTYPE(x)
+#define DECLTYPE_ASSIGN(dst, src) \
+ do { \
+ char **_da_dst = (char **)(&(dst)); \
+ *_da_dst = (char *)(src); \
+ } while (0)
+#else
+#define DECLTYPE_ASSIGN(dst, src) \
+ do { \
+ (dst) = DECLTYPE(dst)(src); \
+ } while (0)
+#endif
+
+/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */
+#if defined(_WIN32)
+#if defined(_MSC_VER) && _MSC_VER >= 1600
+#include <stdint.h>
+#elif defined(__WATCOMC__) || defined(__MINGW32__) || defined(__CYGWIN__)
+#include <stdint.h>
+#else
+typedef unsigned int uint32_t;
+typedef unsigned char uint8_t;
+#endif
+#elif defined(__GNUC__) && !defined(__VXWORKS__)
+#include <stdint.h>
+#else
+typedef unsigned int uint32_t;
+typedef unsigned char uint8_t;
+#endif
+
+#ifndef uthash_malloc
+#define uthash_malloc(sz) malloc(sz) /* malloc fcn */
+#endif
+#ifndef uthash_free
+#define uthash_free(ptr, sz) free(ptr) /* free fcn */
+#endif
+#ifndef uthash_bzero
+#define uthash_bzero(a, n) memset(a, '\0', n)
+#endif
+#ifndef uthash_strlen
+#define uthash_strlen(s) strlen(s)
+#endif
+
+#ifdef uthash_memcmp
+/* This warning will not catch programs that define uthash_memcmp AFTER including uthash.h. */
+#warning "uthash_memcmp is deprecated; please use HASH_KEYCMP instead"
+#else
+#define uthash_memcmp(a, b, n) memcmp(a, b, n)
+#endif
+
+#ifndef HASH_KEYCMP
+#define HASH_KEYCMP(a, b, n) uthash_memcmp(a, b, n)
+#endif
+
+#ifndef uthash_noexpand_fyi
+#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */
+#endif
+#ifndef uthash_expand_fyi
+#define uthash_expand_fyi(tbl) /* can be defined to log expands */
+#endif
+
+#ifndef HASH_NONFATAL_OOM
+#define HASH_NONFATAL_OOM 0
+#endif
+
+#if HASH_NONFATAL_OOM
+/* malloc failures can be recovered from */
+
+#ifndef uthash_nonfatal_oom
+#define uthash_nonfatal_oom(obj) \
+ do { \
+ } while (0) /* non-fatal OOM error */
+#endif
+
+#define HASH_RECORD_OOM(oomed) \
+ do { \
+ (oomed) = 1; \
+ } while (0)
+#define IF_HASH_NONFATAL_OOM(x) x
+
+#else
+/* malloc failures result in lost memory, hash tables are unusable */
+
+#ifndef uthash_fatal
+#define uthash_fatal(msg) exit(-1) /* fatal OOM error */
+#endif
+
+#define HASH_RECORD_OOM(oomed) uthash_fatal("out of memory")
+#define IF_HASH_NONFATAL_OOM(x)
+
+#endif
+
+/* initial number of buckets */
+#define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */
+#define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */
+#define HASH_BKT_CAPACITY_THRESH 10U /* expand when bucket count reaches */
+
+/* calculate the element whose hash handle address is hhp */
+#define ELMT_FROM_HH(tbl, hhp) ((void *)(((char *)(hhp)) - ((tbl)->hho)))
+/* calculate the hash handle from element address elp */
+#define HH_FROM_ELMT(tbl, elp) ((UT_hash_handle *)(void *)(((char *)(elp)) + ((tbl)->hho)))
+
+#define HASH_ROLLBACK_BKT(hh, head, itemptrhh) \
+ do { \
+ struct UT_hash_handle *_hd_hh_item = (itemptrhh); \
+ unsigned _hd_bkt; \
+ HASH_TO_BKT(_hd_hh_item->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \
+ (head)->hh.tbl->buckets[_hd_bkt].count++; \
+ _hd_hh_item->hh_next = NULL; \
+ _hd_hh_item->hh_prev = NULL; \
+ } while (0)
+
+#define HASH_VALUE(keyptr, keylen, hashv) \
+ do { \
+ HASH_FCN(keyptr, keylen, hashv); \
+ } while (0)
+
+#define HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, hashval, out) \
+ do { \
+ (out) = NULL; \
+ if (head) { \
+ unsigned _hf_bkt; \
+ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt); \
+ if (HASH_BLOOM_TEST((head)->hh.tbl, hashval) != 0) { \
+ HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[_hf_bkt], keyptr, keylen, \
+ hashval, out); \
+ } \
+ } \
+ } while (0)
+
+#define HASH_FIND(hh, head, keyptr, keylen, out) \
+ do { \
+ (out) = NULL; \
+ if (head) { \
+ unsigned _hf_hashv; \
+ HASH_VALUE(keyptr, keylen, _hf_hashv); \
+ HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out); \
+ } \
+ } while (0)
+
+#ifdef HASH_BLOOM
+#define HASH_BLOOM_BITLEN (1UL << HASH_BLOOM)
+#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN / 8UL) + (((HASH_BLOOM_BITLEN % 8UL) != 0UL) ? 1UL : 0UL)
+#define HASH_BLOOM_MAKE(tbl, oomed) \
+ do { \
+ (tbl)->bloom_nbits = HASH_BLOOM; \
+ (tbl)->bloom_bv = (uint8_t *)uthash_malloc(HASH_BLOOM_BYTELEN); \
+ if (!(tbl)->bloom_bv) { \
+ HASH_RECORD_OOM(oomed); \
+ } \
+ else { \
+ uthash_bzero((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \
+ (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \
+ } \
+ } while (0)
+
+#define HASH_BLOOM_FREE(tbl) \
+ do { \
+ uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \
+ } while (0)
+
+#define HASH_BLOOM_BITSET(bv, idx) (bv[(idx) / 8U] |= (1U << ((idx) % 8U)))
+#define HASH_BLOOM_BITTEST(bv, idx) (bv[(idx) / 8U] & (1U << ((idx) % 8U)))
+
+#define HASH_BLOOM_ADD(tbl, hashv) \
+ HASH_BLOOM_BITSET((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U)))
+
+#define HASH_BLOOM_TEST(tbl, hashv) \
+ HASH_BLOOM_BITTEST((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U)))
+
+#else
+#define HASH_BLOOM_MAKE(tbl, oomed)
+#define HASH_BLOOM_FREE(tbl)
+#define HASH_BLOOM_ADD(tbl, hashv)
+#define HASH_BLOOM_TEST(tbl, hashv) (1)
+#define HASH_BLOOM_BYTELEN 0U
+#endif
+
+#define HASH_MAKE_TABLE(hh, head, oomed) \
+ do { \
+ (head)->hh.tbl = (UT_hash_table *)uthash_malloc(sizeof(UT_hash_table)); \
+ if (!(head)->hh.tbl) { \
+ HASH_RECORD_OOM(oomed); \
+ } \
+ else { \
+ uthash_bzero((head)->hh.tbl, sizeof(UT_hash_table)); \
+ (head)->hh.tbl->tail = &((head)->hh); \
+ (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \
+ (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \
+ (head)->hh.tbl->hho = (char *)(&(head)->hh) - (char *)(head); \
+ (head)->hh.tbl->buckets = \
+ (UT_hash_bucket *)uthash_malloc(HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \
+ (head)->hh.tbl->signature = HASH_SIGNATURE; \
+ if (!(head)->hh.tbl->buckets) { \
+ HASH_RECORD_OOM(oomed); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ } \
+ else { \
+ uthash_bzero((head)->hh.tbl->buckets, \
+ HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \
+ HASH_BLOOM_MAKE((head)->hh.tbl, oomed); \
+ IF_HASH_NONFATAL_OOM(if (oomed) { \
+ uthash_free((head)->hh.tbl->buckets, \
+ HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ }) \
+ } \
+ } \
+ } while (0)
+
+#define HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, hashval, add, replaced, cmpfcn) \
+ do { \
+ (replaced) = NULL; \
+ HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
+ if (replaced) { \
+ HASH_DELETE(hh, head, replaced); \
+ } \
+ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn); \
+ } while (0)
+
+#define HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, hashval, add, replaced) \
+ do { \
+ (replaced) = NULL; \
+ HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
+ if (replaced) { \
+ HASH_DELETE(hh, head, replaced); \
+ } \
+ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add); \
+ } while (0)
+
+#define HASH_REPLACE(hh, head, fieldname, keylen_in, add, replaced) \
+ do { \
+ unsigned _hr_hashv; \
+ HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \
+ HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced); \
+ } while (0)
+
+#define HASH_REPLACE_INORDER(hh, head, fieldname, keylen_in, add, replaced, cmpfcn) \
+ do { \
+ unsigned _hr_hashv; \
+ HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \
+ HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced, cmpfcn); \
+ } while (0)
+
+#define HASH_APPEND_LIST(hh, head, add) \
+ do { \
+ (add)->hh.next = NULL; \
+ (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \
+ (head)->hh.tbl->tail->next = (add); \
+ (head)->hh.tbl->tail = &((add)->hh); \
+ } while (0)
+
+#define HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn) \
+ do { \
+ do { \
+ if (cmpfcn(DECLTYPE(head)(_hs_iter), add) > 0) { \
+ break; \
+ } \
+ } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \
+ } while (0)
+
+#ifdef NO_DECLTYPE
+#undef HASH_AKBI_INNER_LOOP
+#define HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn) \
+ do { \
+ char *_hs_saved_head = (char *)(head); \
+ do { \
+ DECLTYPE_ASSIGN(head, _hs_iter); \
+ if (cmpfcn(head, add) > 0) { \
+ DECLTYPE_ASSIGN(head, _hs_saved_head); \
+ break; \
+ } \
+ DECLTYPE_ASSIGN(head, _hs_saved_head); \
+ } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \
+ } while (0)
+#endif
+
+#if HASH_NONFATAL_OOM
+
+#define HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, oomed) \
+ do { \
+ if (!(oomed)) { \
+ unsigned _ha_bkt; \
+ (head)->hh.tbl->num_items++; \
+ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \
+ HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \
+ if (oomed) { \
+ HASH_ROLLBACK_BKT(hh, head, &(add)->hh); \
+ HASH_DELETE_HH(hh, head, &(add)->hh); \
+ (add)->hh.tbl = NULL; \
+ uthash_nonfatal_oom(add); \
+ } \
+ else { \
+ HASH_BLOOM_ADD((head)->hh.tbl, hashval); \
+ HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \
+ } \
+ } \
+ else { \
+ (add)->hh.tbl = NULL; \
+ uthash_nonfatal_oom(add); \
+ } \
+ } while (0)
+
+#else
+
+#define HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, oomed) \
+ do { \
+ unsigned _ha_bkt; \
+ (head)->hh.tbl->num_items++; \
+ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \
+ HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \
+ HASH_BLOOM_ADD((head)->hh.tbl, hashval); \
+ HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \
+ } while (0)
+
+#endif
+
+#define HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, hashval, add, cmpfcn) \
+ do { \
+ IF_HASH_NONFATAL_OOM(int _ha_oomed = 0;) \
+ (add)->hh.hashv = (hashval); \
+ (add)->hh.key = (char *)(keyptr); \
+ (add)->hh.keylen = (unsigned)(keylen_in); \
+ if (!(head)) { \
+ (add)->hh.next = NULL; \
+ (add)->hh.prev = NULL; \
+ HASH_MAKE_TABLE(hh, add, _ha_oomed); \
+ IF_HASH_NONFATAL_OOM(if (!_ha_oomed) { ) \
+ (head) = (add); \
+ IF_HASH_NONFATAL_OOM( \
+ }) \
+ } \
+ else { \
+ void *_hs_iter = (head); \
+ (add)->hh.tbl = (head)->hh.tbl; \
+ HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn); \
+ if (_hs_iter) { \
+ (add)->hh.next = _hs_iter; \
+ if (((add)->hh.prev = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev)) { \
+ HH_FROM_ELMT((head)->hh.tbl, (add)->hh.prev)->next = (add); \
+ } \
+ else { \
+ (head) = (add); \
+ } \
+ HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev = (add); \
+ } \
+ else { \
+ HASH_APPEND_LIST(hh, head, add); \
+ } \
+ } \
+ HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \
+ HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE_INORDER"); \
+ } while (0)
+
+#define HASH_ADD_KEYPTR_INORDER(hh, head, keyptr, keylen_in, add, cmpfcn) \
+ do { \
+ unsigned _hs_hashv; \
+ HASH_VALUE(keyptr, keylen_in, _hs_hashv); \
+ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, _hs_hashv, add, cmpfcn); \
+ } while (0)
+
+#define HASH_ADD_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, hashval, add, cmpfcn) \
+ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn)
+
+#define HASH_ADD_INORDER(hh, head, fieldname, keylen_in, add, cmpfcn) \
+ HASH_ADD_KEYPTR_INORDER(hh, head, &((add)->fieldname), keylen_in, add, cmpfcn)
+
+#define HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, hashval, add) \
+ do { \
+ IF_HASH_NONFATAL_OOM(int _ha_oomed = 0;) \
+ (add)->hh.hashv = (hashval); \
+ (add)->hh.key = (char *)(keyptr); \
+ (add)->hh.keylen = (unsigned)(keylen_in); \
+ if (!(head)) { \
+ (add)->hh.next = NULL; \
+ (add)->hh.prev = NULL; \
+ HASH_MAKE_TABLE(hh, add, _ha_oomed); \
+ IF_HASH_NONFATAL_OOM(if (!_ha_oomed) { ) \
+ (head) = (add); \
+ IF_HASH_NONFATAL_OOM( \
+ }) \
+ } \
+ else { \
+ (add)->hh.tbl = (head)->hh.tbl; \
+ HASH_APPEND_LIST(hh, head, add); \
+ } \
+ HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \
+ HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE"); \
+ } while (0)
+
+#define HASH_ADD_KEYPTR(hh, head, keyptr, keylen_in, add) \
+ do { \
+ unsigned _ha_hashv; \
+ HASH_VALUE(keyptr, keylen_in, _ha_hashv); \
+ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, _ha_hashv, add); \
+ } while (0)
+
+#define HASH_ADD_BYHASHVALUE(hh, head, fieldname, keylen_in, hashval, add) \
+ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add)
+
+#define HASH_ADD(hh, head, fieldname, keylen_in, add) \
+ HASH_ADD_KEYPTR(hh, head, &((add)->fieldname), keylen_in, add)
+
+#define HASH_TO_BKT(hashv, num_bkts, bkt) \
+ do { \
+ bkt = ((hashv) & ((num_bkts)-1U)); \
+ } while (0)
+
+/* delete "delptr" from the hash table.
+ * "the usual" patch-up process for the app-order doubly-linked-list.
+ * The use of _hd_hh_del below deserves special explanation.
+ * These used to be expressed using (delptr) but that led to a bug
+ * if someone used the same symbol for the head and deletee, like
+ * HASH_DELETE(hh,users,users);
+ * We want that to work, but by changing the head (users) below
+ * we were forfeiting our ability to further refer to the deletee (users)
+ * in the patch-up process. Solution: use scratch space to
+ * copy the deletee pointer, then the latter references are via that
+ * scratch pointer rather than through the repointed (users) symbol.
+ */
+#define HASH_DELETE(hh, head, delptr) HASH_DELETE_HH(hh, head, &(delptr)->hh)
+
+#define HASH_DELETE_HH(hh, head, delptrhh) \
+ do { \
+ struct UT_hash_handle *_hd_hh_del = (delptrhh); \
+ if ((_hd_hh_del->prev == NULL) && (_hd_hh_del->next == NULL)) { \
+ HASH_BLOOM_FREE((head)->hh.tbl); \
+ uthash_free((head)->hh.tbl->buckets, \
+ (head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket)); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ (head) = NULL; \
+ } \
+ else { \
+ unsigned _hd_bkt; \
+ if (_hd_hh_del == (head)->hh.tbl->tail) { \
+ (head)->hh.tbl->tail = HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev); \
+ } \
+ if (_hd_hh_del->prev != NULL) { \
+ HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev)->next = _hd_hh_del->next; \
+ } \
+ else { \
+ DECLTYPE_ASSIGN(head, _hd_hh_del->next); \
+ } \
+ if (_hd_hh_del->next != NULL) { \
+ HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->next)->prev = _hd_hh_del->prev; \
+ } \
+ HASH_TO_BKT(_hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \
+ HASH_DEL_IN_BKT((head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \
+ (head)->hh.tbl->num_items--; \
+ } \
+ HASH_FSCK(hh, head, "HASH_DELETE_HH"); \
+ } while (0)
+
+/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */
+#define HASH_FIND_STR(head, findstr, out) \
+ do { \
+ unsigned _uthash_hfstr_keylen = (unsigned)uthash_strlen(findstr); \
+ HASH_FIND(hh, head, findstr, _uthash_hfstr_keylen, out); \
+ } while (0)
+#define HASH_ADD_STR(head, strfield, add) \
+ do { \
+ unsigned _uthash_hastr_keylen = (unsigned)uthash_strlen((add)->strfield); \
+ HASH_ADD(hh, head, strfield[0], _uthash_hastr_keylen, add); \
+ } while (0)
+#define HASH_REPLACE_STR(head, strfield, add, replaced) \
+ do { \
+ unsigned _uthash_hrstr_keylen = (unsigned)uthash_strlen((add)->strfield); \
+ HASH_REPLACE(hh, head, strfield[0], _uthash_hrstr_keylen, add, replaced); \
+ } while (0)
+#define HASH_FIND_INT(head, findint, out) HASH_FIND(hh, head, findint, sizeof(int), out)
+#define HASH_ADD_INT(head, intfield, add) HASH_ADD(hh, head, intfield, sizeof(int), add)
+#define HASH_REPLACE_INT(head, intfield, add, replaced) \
+ HASH_REPLACE(hh, head, intfield, sizeof(int), add, replaced)
+#define HASH_FIND_PTR(head, findptr, out) HASH_FIND(hh, head, findptr, sizeof(void *), out)
+#define HASH_ADD_PTR(head, ptrfield, add) HASH_ADD(hh, head, ptrfield, sizeof(void *), add)
+#define HASH_REPLACE_PTR(head, ptrfield, add, replaced) \
+ HASH_REPLACE(hh, head, ptrfield, sizeof(void *), add, replaced)
+#define HASH_DEL(head, delptr) HASH_DELETE(hh, head, delptr)
+
+/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.
+ * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.
+ */
+#ifdef HASH_DEBUG
+#include <stdio.h> /* fprintf, stderr */
+#define HASH_OOPS(...) \
+ do { \
+ fprintf(stderr, __VA_ARGS__); \
+ exit(-1); \
+ } while (0)
+#define HASH_FSCK(hh, head, where) \
+ do { \
+ struct UT_hash_handle *_thh; \
+ if (head) { \
+ unsigned _bkt_i; \
+ unsigned _count = 0; \
+ char * _prev; \
+ for (_bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; ++_bkt_i) { \
+ unsigned _bkt_count = 0; \
+ _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \
+ _prev = NULL; \
+ while (_thh) { \
+ if (_prev != (char *)(_thh->hh_prev)) { \
+ HASH_OOPS("%s: invalid hh_prev %p, actual %p\n", (where), (void *)_thh->hh_prev, \
+ (void *)_prev); \
+ } \
+ _bkt_count++; \
+ _prev = (char *)(_thh); \
+ _thh = _thh->hh_next; \
+ } \
+ _count += _bkt_count; \
+ if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \
+ HASH_OOPS("%s: invalid bucket count %u, actual %u\n", (where), \
+ (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \
+ } \
+ } \
+ if (_count != (head)->hh.tbl->num_items) { \
+ HASH_OOPS("%s: invalid hh item count %u, actual %u\n", (where), (head)->hh.tbl->num_items, \
+ _count); \
+ } \
+ _count = 0; \
+ _prev = NULL; \
+ _thh = &(head)->hh; \
+ while (_thh) { \
+ _count++; \
+ if (_prev != (char *)_thh->prev) { \
+ HASH_OOPS("%s: invalid prev %p, actual %p\n", (where), (void *)_thh->prev, \
+ (void *)_prev); \
+ } \
+ _prev = (char *)ELMT_FROM_HH((head)->hh.tbl, _thh); \
+ _thh = (_thh->next ? HH_FROM_ELMT((head)->hh.tbl, _thh->next) : NULL); \
+ } \
+ if (_count != (head)->hh.tbl->num_items) { \
+ HASH_OOPS("%s: invalid app item count %u, actual %u\n", (where), (head)->hh.tbl->num_items, \
+ _count); \
+ } \
+ } \
+ } while (0)
+#else
+#define HASH_FSCK(hh, head, where)
+#endif
+
+/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to
+ * the descriptor to which this macro is defined for tuning the hash function.
+ * The app can #include <unistd.h> to get the prototype for write(2). */
+#ifdef HASH_EMIT_KEYS
+#define HASH_EMIT_KEY(hh, head, keyptr, fieldlen) \
+ do { \
+ unsigned _klen = fieldlen; \
+ write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \
+ write(HASH_EMIT_KEYS, keyptr, (unsigned long)fieldlen); \
+ } while (0)
+#else
+#define HASH_EMIT_KEY(hh, head, keyptr, fieldlen)
+#endif
+
+/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */
+#ifdef HASH_FUNCTION
+#define HASH_FCN HASH_FUNCTION
+#else
+#define HASH_FCN HASH_JEN
+#endif
+
+/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */
+#define HASH_BER(key, keylen, hashv) \
+ do { \
+ unsigned _hb_keylen = (unsigned)keylen; \
+ const unsigned char *_hb_key = (const unsigned char *)(key); \
+ (hashv) = 0; \
+ while (_hb_keylen-- != 0U) { \
+ (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; \
+ } \
+ } while (0)
+
+/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at
+ * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */
+#define HASH_SAX(key, keylen, hashv) \
+ do { \
+ unsigned _sx_i; \
+ const unsigned char *_hs_key = (const unsigned char *)(key); \
+ hashv = 0; \
+ for (_sx_i = 0; _sx_i < keylen; _sx_i++) { \
+ hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \
+ } \
+ } while (0)
+/* FNV-1a variation */
+#define HASH_FNV(key, keylen, hashv) \
+ do { \
+ unsigned _fn_i; \
+ const unsigned char *_hf_key = (const unsigned char *)(key); \
+ (hashv) = 2166136261U; \
+ for (_fn_i = 0; _fn_i < keylen; _fn_i++) { \
+ hashv = hashv ^ _hf_key[_fn_i]; \
+ hashv = hashv * 16777619U; \
+ } \
+ } while (0)
+
+#define HASH_OAT(key, keylen, hashv) \
+ do { \
+ unsigned _ho_i; \
+ const unsigned char *_ho_key = (const unsigned char *)(key); \
+ hashv = 0; \
+ for (_ho_i = 0; _ho_i < keylen; _ho_i++) { \
+ hashv += _ho_key[_ho_i]; \
+ hashv += (hashv << 10); \
+ hashv ^= (hashv >> 6); \
+ } \
+ hashv += (hashv << 3); \
+ hashv ^= (hashv >> 11); \
+ hashv += (hashv << 15); \
+ } while (0)
+
+#define HASH_JEN_MIX(a, b, c) \
+ do { \
+ a -= b; \
+ a -= c; \
+ a ^= (c >> 13); \
+ b -= c; \
+ b -= a; \
+ b ^= (a << 8); \
+ c -= a; \
+ c -= b; \
+ c ^= (b >> 13); \
+ a -= b; \
+ a -= c; \
+ a ^= (c >> 12); \
+ b -= c; \
+ b -= a; \
+ b ^= (a << 16); \
+ c -= a; \
+ c -= b; \
+ c ^= (b >> 5); \
+ a -= b; \
+ a -= c; \
+ a ^= (c >> 3); \
+ b -= c; \
+ b -= a; \
+ b ^= (a << 10); \
+ c -= a; \
+ c -= b; \
+ c ^= (b >> 15); \
+ } while (0)
+
+#define HASH_JEN(key, keylen, hashv) \
+ do { \
+ unsigned _hj_i, _hj_j, _hj_k; \
+ unsigned const char *_hj_key = (unsigned const char *)(key); \
+ hashv = 0xfeedbeefu; \
+ _hj_i = _hj_j = 0x9e3779b9u; \
+ _hj_k = (unsigned)(keylen); \
+ while (_hj_k >= 12U) { \
+ _hj_i += (_hj_key[0] + ((unsigned)_hj_key[1] << 8) + ((unsigned)_hj_key[2] << 16) + \
+ ((unsigned)_hj_key[3] << 24)); \
+ _hj_j += (_hj_key[4] + ((unsigned)_hj_key[5] << 8) + ((unsigned)_hj_key[6] << 16) + \
+ ((unsigned)_hj_key[7] << 24)); \
+ hashv += (_hj_key[8] + ((unsigned)_hj_key[9] << 8) + ((unsigned)_hj_key[10] << 16) + \
+ ((unsigned)_hj_key[11] << 24)); \
+ \
+ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \
+ \
+ _hj_key += 12; \
+ _hj_k -= 12U; \
+ } \
+ hashv += (unsigned)(keylen); \
+ switch (_hj_k) { \
+ case 11: \
+ hashv += ((unsigned)_hj_key[10] << 24); /* FALLTHROUGH */ \
+ case 10: \
+ hashv += ((unsigned)_hj_key[9] << 16); /* FALLTHROUGH */ \
+ case 9: \
+ hashv += ((unsigned)_hj_key[8] << 8); /* FALLTHROUGH */ \
+ case 8: \
+ _hj_j += ((unsigned)_hj_key[7] << 24); /* FALLTHROUGH */ \
+ case 7: \
+ _hj_j += ((unsigned)_hj_key[6] << 16); /* FALLTHROUGH */ \
+ case 6: \
+ _hj_j += ((unsigned)_hj_key[5] << 8); /* FALLTHROUGH */ \
+ case 5: \
+ _hj_j += _hj_key[4]; /* FALLTHROUGH */ \
+ case 4: \
+ _hj_i += ((unsigned)_hj_key[3] << 24); /* FALLTHROUGH */ \
+ case 3: \
+ _hj_i += ((unsigned)_hj_key[2] << 16); /* FALLTHROUGH */ \
+ case 2: \
+ _hj_i += ((unsigned)_hj_key[1] << 8); /* FALLTHROUGH */ \
+ case 1: \
+ _hj_i += _hj_key[0]; \
+ } \
+ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \
+ } while (0)
+
+/* The Paul Hsieh hash function */
+#undef get16bits
+#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) || defined(_MSC_VER) || \
+ defined(__BORLANDC__) || defined(__TURBOC__)
+#define get16bits(d) (*((const uint16_t *)(d)))
+#endif
+
+#if !defined(get16bits)
+#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) + (uint32_t)(((const uint8_t *)(d))[0]))
+#endif
+#define HASH_SFH(key, keylen, hashv) \
+ do { \
+ unsigned const char *_sfh_key = (unsigned const char *)(key); \
+ uint32_t _sfh_tmp, _sfh_len = (uint32_t)keylen; \
+ \
+ unsigned _sfh_rem = _sfh_len & 3U; \
+ _sfh_len >>= 2; \
+ hashv = 0xcafebabeu; \
+ \
+ /* Main loop */ \
+ for (; _sfh_len > 0U; _sfh_len--) { \
+ hashv += get16bits(_sfh_key); \
+ _sfh_tmp = ((uint32_t)(get16bits(_sfh_key + 2)) << 11) ^ hashv; \
+ hashv = (hashv << 16) ^ _sfh_tmp; \
+ _sfh_key += 2U * sizeof(uint16_t); \
+ hashv += hashv >> 11; \
+ } \
+ \
+ /* Handle end cases */ \
+ switch (_sfh_rem) { \
+ case 3: \
+ hashv += get16bits(_sfh_key); \
+ hashv ^= hashv << 16; \
+ hashv ^= (uint32_t)(_sfh_key[sizeof(uint16_t)]) << 18; \
+ hashv += hashv >> 11; \
+ break; \
+ case 2: \
+ hashv += get16bits(_sfh_key); \
+ hashv ^= hashv << 11; \
+ hashv += hashv >> 17; \
+ break; \
+ case 1: \
+ hashv += *_sfh_key; \
+ hashv ^= hashv << 10; \
+ hashv += hashv >> 1; \
+ } \
+ \
+ /* Force "avalanching" of final 127 bits */ \
+ hashv ^= hashv << 3; \
+ hashv += hashv >> 5; \
+ hashv ^= hashv << 4; \
+ hashv += hashv >> 17; \
+ hashv ^= hashv << 25; \
+ hashv += hashv >> 6; \
+ } while (0)
+
+/* iterate over items in a known bucket to find desired item */
+#define HASH_FIND_IN_BKT(tbl, hh, head, keyptr, keylen_in, hashval, out) \
+ do { \
+ if ((head).hh_head != NULL) { \
+ DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (head).hh_head)); \
+ } \
+ else { \
+ (out) = NULL; \
+ } \
+ while ((out) != NULL) { \
+ if ((out)->hh.hashv == (hashval) && (out)->hh.keylen == (keylen_in)) { \
+ if (HASH_KEYCMP((out)->hh.key, keyptr, keylen_in) == 0) { \
+ break; \
+ } \
+ } \
+ if ((out)->hh.hh_next != NULL) { \
+ DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (out)->hh.hh_next)); \
+ } \
+ else { \
+ (out) = NULL; \
+ } \
+ } \
+ } while (0)
+
+/* add an item to a bucket */
+#define HASH_ADD_TO_BKT(head, hh, addhh, oomed) \
+ do { \
+ UT_hash_bucket *_ha_head = &(head); \
+ _ha_head->count++; \
+ (addhh)->hh_next = _ha_head->hh_head; \
+ (addhh)->hh_prev = NULL; \
+ if (_ha_head->hh_head != NULL) { \
+ _ha_head->hh_head->hh_prev = (addhh); \
+ } \
+ _ha_head->hh_head = (addhh); \
+ if ((_ha_head->count >= ((_ha_head->expand_mult + 1U) * HASH_BKT_CAPACITY_THRESH)) && \
+ !(addhh)->tbl->noexpand) { \
+ HASH_EXPAND_BUCKETS(addhh, (addhh)->tbl, oomed); \
+ IF_HASH_NONFATAL_OOM(if (oomed) { HASH_DEL_IN_BKT(head, addhh); }) \
+ } \
+ } while (0)
+
+/* remove an item from a given bucket */
+#define HASH_DEL_IN_BKT(head, delhh) \
+ do { \
+ UT_hash_bucket *_hd_head = &(head); \
+ _hd_head->count--; \
+ if (_hd_head->hh_head == (delhh)) { \
+ _hd_head->hh_head = (delhh)->hh_next; \
+ } \
+ if ((delhh)->hh_prev) { \
+ (delhh)->hh_prev->hh_next = (delhh)->hh_next; \
+ } \
+ if ((delhh)->hh_next) { \
+ (delhh)->hh_next->hh_prev = (delhh)->hh_prev; \
+ } \
+ } while (0)
+
+/* Bucket expansion has the effect of doubling the number of buckets
+ * and redistributing the items into the new buckets. Ideally the
+ * items will distribute more or less evenly into the new buckets
+ * (the extent to which this is true is a measure of the quality of
+ * the hash function as it applies to the key domain).
+ *
+ * With the items distributed into more buckets, the chain length
+ * (item count) in each bucket is reduced. Thus by expanding buckets
+ * the hash keeps a bound on the chain length. This bounded chain
+ * length is the essence of how a hash provides constant time lookup.
+ *
+ * The calculation of tbl->ideal_chain_maxlen below deserves some
+ * explanation. First, keep in mind that we're calculating the ideal
+ * maximum chain length based on the *new* (doubled) bucket count.
+ * In fractions this is just n/b (n=number of items,b=new num buckets).
+ * Since the ideal chain length is an integer, we want to calculate
+ * ceil(n/b). We don't depend on floating point arithmetic in this
+ * hash, so to calculate ceil(n/b) with integers we could write
+ *
+ * ceil(n/b) = (n/b) + ((n%b)?1:0)
+ *
+ * and in fact a previous version of this hash did just that.
+ * But now we have improved things a bit by recognizing that b is
+ * always a power of two. We keep its base 2 log handy (call it lb),
+ * so now we can write this with a bit shift and logical AND:
+ *
+ * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)
+ *
+ */
+#define HASH_EXPAND_BUCKETS(hh, tbl, oomed) \
+ do { \
+ unsigned _he_bkt; \
+ unsigned _he_bkt_i; \
+ struct UT_hash_handle *_he_thh, *_he_hh_nxt; \
+ UT_hash_bucket * _he_new_buckets, *_he_newbkt; \
+ _he_new_buckets = \
+ (UT_hash_bucket *)uthash_malloc(2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ if (!_he_new_buckets) { \
+ HASH_RECORD_OOM(oomed); \
+ } \
+ else { \
+ uthash_bzero(_he_new_buckets, 2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ (tbl)->ideal_chain_maxlen = \
+ ((tbl)->num_items >> ((tbl)->log2_num_buckets + 1U)) + \
+ ((((tbl)->num_items & (((tbl)->num_buckets * 2U) - 1U)) != 0U) ? 1U : 0U); \
+ (tbl)->nonideal_items = 0; \
+ for (_he_bkt_i = 0; _he_bkt_i < (tbl)->num_buckets; _he_bkt_i++) { \
+ _he_thh = (tbl)->buckets[_he_bkt_i].hh_head; \
+ while (_he_thh != NULL) { \
+ _he_hh_nxt = _he_thh->hh_next; \
+ HASH_TO_BKT(_he_thh->hashv, (tbl)->num_buckets * 2U, _he_bkt); \
+ _he_newbkt = &(_he_new_buckets[_he_bkt]); \
+ if (++(_he_newbkt->count) > (tbl)->ideal_chain_maxlen) { \
+ (tbl)->nonideal_items++; \
+ if (_he_newbkt->count > _he_newbkt->expand_mult * (tbl)->ideal_chain_maxlen) { \
+ _he_newbkt->expand_mult++; \
+ } \
+ } \
+ _he_thh->hh_prev = NULL; \
+ _he_thh->hh_next = _he_newbkt->hh_head; \
+ if (_he_newbkt->hh_head != NULL) { \
+ _he_newbkt->hh_head->hh_prev = _he_thh; \
+ } \
+ _he_newbkt->hh_head = _he_thh; \
+ _he_thh = _he_hh_nxt; \
+ } \
+ } \
+ uthash_free((tbl)->buckets, (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ (tbl)->num_buckets *= 2U; \
+ (tbl)->log2_num_buckets++; \
+ (tbl)->buckets = _he_new_buckets; \
+ (tbl)->ineff_expands = \
+ ((tbl)->nonideal_items > ((tbl)->num_items >> 1)) ? ((tbl)->ineff_expands + 1U) : 0U; \
+ if ((tbl)->ineff_expands > 1U) { \
+ (tbl)->noexpand = 1; \
+ uthash_noexpand_fyi(tbl); \
+ } \
+ uthash_expand_fyi(tbl); \
+ } \
+ } while (0)
+
+/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */
+/* Note that HASH_SORT assumes the hash handle name to be hh.
+ * HASH_SRT was added to allow the hash handle name to be passed in. */
+#define HASH_SORT(head, cmpfcn) HASH_SRT(hh, head, cmpfcn)
+#define HASH_SRT(hh, head, cmpfcn) \
+ do { \
+ unsigned _hs_i; \
+ unsigned _hs_looping, _hs_nmerges, _hs_insize, _hs_psize, _hs_qsize; \
+ struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \
+ if (head != NULL) { \
+ _hs_insize = 1; \
+ _hs_looping = 1; \
+ _hs_list = &((head)->hh); \
+ while (_hs_looping != 0U) { \
+ _hs_p = _hs_list; \
+ _hs_list = NULL; \
+ _hs_tail = NULL; \
+ _hs_nmerges = 0; \
+ while (_hs_p != NULL) { \
+ _hs_nmerges++; \
+ _hs_q = _hs_p; \
+ _hs_psize = 0; \
+ for (_hs_i = 0; _hs_i < _hs_insize; ++_hs_i) { \
+ _hs_psize++; \
+ _hs_q = ((_hs_q->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \
+ if (_hs_q == NULL) { \
+ break; \
+ } \
+ } \
+ _hs_qsize = _hs_insize; \
+ while ((_hs_psize != 0U) || ((_hs_qsize != 0U) && (_hs_q != NULL))) { \
+ if (_hs_psize == 0U) { \
+ _hs_e = _hs_q; \
+ _hs_q = \
+ ((_hs_q->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \
+ _hs_qsize--; \
+ } \
+ else if ((_hs_qsize == 0U) || (_hs_q == NULL)) { \
+ _hs_e = _hs_p; \
+ if (_hs_p != NULL) { \
+ _hs_p = ((_hs_p->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) \
+ : NULL); \
+ } \
+ _hs_psize--; \
+ } \
+ else if ((cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_p)), \
+ DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_q)))) <= 0) { \
+ _hs_e = _hs_p; \
+ if (_hs_p != NULL) { \
+ _hs_p = ((_hs_p->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) \
+ : NULL); \
+ } \
+ _hs_psize--; \
+ } \
+ else { \
+ _hs_e = _hs_q; \
+ _hs_q = \
+ ((_hs_q->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \
+ _hs_qsize--; \
+ } \
+ if (_hs_tail != NULL) { \
+ _hs_tail->next = ((_hs_e != NULL) ? ELMT_FROM_HH((head)->hh.tbl, _hs_e) : NULL); \
+ } \
+ else { \
+ _hs_list = _hs_e; \
+ } \
+ if (_hs_e != NULL) { \
+ _hs_e->prev = \
+ ((_hs_tail != NULL) ? ELMT_FROM_HH((head)->hh.tbl, _hs_tail) : NULL); \
+ } \
+ _hs_tail = _hs_e; \
+ } \
+ _hs_p = _hs_q; \
+ } \
+ if (_hs_tail != NULL) { \
+ _hs_tail->next = NULL; \
+ } \
+ if (_hs_nmerges <= 1U) { \
+ _hs_looping = 0; \
+ (head)->hh.tbl->tail = _hs_tail; \
+ DECLTYPE_ASSIGN(head, ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \
+ } \
+ _hs_insize *= 2U; \
+ } \
+ HASH_FSCK(hh, head, "HASH_SRT"); \
+ } \
+ } while (0)
+
+/* This function selects items from one hash into another hash.
+ * The end result is that the selected items have dual presence
+ * in both hashes. There is no copy of the items made; rather
+ * they are added into the new hash through a secondary hash
+ * hash handle that must be present in the structure. */
+#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \
+ do { \
+ unsigned _src_bkt, _dst_bkt; \
+ void * _last_elt = NULL, *_elt; \
+ UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh = NULL; \
+ ptrdiff_t _dst_hho = ((char *)(&(dst)->hh_dst) - (char *)(dst)); \
+ if ((src) != NULL) { \
+ for (_src_bkt = 0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \
+ for (_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; _src_hh != NULL; \
+ _src_hh = _src_hh->hh_next) { \
+ _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \
+ if (cond(_elt)) { \
+ IF_HASH_NONFATAL_OOM(int _hs_oomed = 0;) \
+ _dst_hh = (UT_hash_handle *)(void *)(((char *)_elt) + _dst_hho); \
+ _dst_hh->key = _src_hh->key; \
+ _dst_hh->keylen = _src_hh->keylen; \
+ _dst_hh->hashv = _src_hh->hashv; \
+ _dst_hh->prev = _last_elt; \
+ _dst_hh->next = NULL; \
+ if (_last_elt_hh != NULL) { \
+ _last_elt_hh->next = _elt; \
+ } \
+ if ((dst) == NULL) { \
+ DECLTYPE_ASSIGN(dst, _elt); \
+ HASH_MAKE_TABLE(hh_dst, dst, _hs_oomed); \
+ IF_HASH_NONFATAL_OOM(if (_hs_oomed) { \
+ uthash_nonfatal_oom(_elt); \
+ (dst) = NULL; \
+ continue; \
+ }) \
+ } \
+ else { \
+ _dst_hh->tbl = (dst)->hh_dst.tbl; \
+ } \
+ HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \
+ HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt], hh_dst, _dst_hh, _hs_oomed); \
+ (dst)->hh_dst.tbl->num_items++; \
+ IF_HASH_NONFATAL_OOM(if (_hs_oomed) { \
+ HASH_ROLLBACK_BKT(hh_dst, dst, _dst_hh); \
+ HASH_DELETE_HH(hh_dst, dst, _dst_hh); \
+ _dst_hh->tbl = NULL; \
+ uthash_nonfatal_oom(_elt); \
+ continue; \
+ }) \
+ HASH_BLOOM_ADD(_dst_hh->tbl, _dst_hh->hashv); \
+ _last_elt = _elt; \
+ _last_elt_hh = _dst_hh; \
+ } \
+ } \
+ } \
+ } \
+ HASH_FSCK(hh_dst, dst, "HASH_SELECT"); \
+ } while (0)
+
+#define HASH_CLEAR(hh, head) \
+ do { \
+ if ((head) != NULL) { \
+ HASH_BLOOM_FREE((head)->hh.tbl); \
+ uthash_free((head)->hh.tbl->buckets, \
+ (head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket)); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ (head) = NULL; \
+ } \
+ } while (0)
+
+#define HASH_OVERHEAD(hh, head) \
+ (((head) != NULL) ? ((size_t)(((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \
+ ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \
+ sizeof(UT_hash_table) + (HASH_BLOOM_BYTELEN))) \
+ : 0U)
+
+#ifdef NO_DECLTYPE
+#define HASH_ITER(hh, head, el, tmp) \
+ for (((el) = (head)), ((*(char **)(&(tmp))) = (char *)((head != NULL) ? (head)->hh.next : NULL)); \
+ (el) != NULL; \
+ ((el) = (tmp)), ((*(char **)(&(tmp))) = (char *)((tmp != NULL) ? (tmp)->hh.next : NULL)))
+#else
+#define HASH_ITER(hh, head, el, tmp) \
+ for (((el) = (head)), ((tmp) = DECLTYPE(el)((head != NULL) ? (head)->hh.next : NULL)); (el) != NULL; \
+ ((el) = (tmp)), ((tmp) = DECLTYPE(el)((tmp != NULL) ? (tmp)->hh.next : NULL)))
+#endif
+
+/* obtain a count of items in the hash */
+#define HASH_COUNT(head) HASH_CNT(hh, head)
+#define HASH_CNT(hh, head) ((head != NULL) ? ((head)->hh.tbl->num_items) : 0U)
+
+typedef struct UT_hash_bucket {
+ struct UT_hash_handle *hh_head;
+ unsigned count;
+
+ /* expand_mult is normally set to 0. In this situation, the max chain length
+ * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If
+ * the bucket's chain exceeds this length, bucket expansion is triggered).
+ * However, setting expand_mult to a non-zero value delays bucket expansion
+ * (that would be triggered by additions to this particular bucket)
+ * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.
+ * (The multiplier is simply expand_mult+1). The whole idea of this
+ * multiplier is to reduce bucket expansions, since they are expensive, in
+ * situations where we know that a particular bucket tends to be overused.
+ * It is better to let its chain length grow to a longer yet-still-bounded
+ * value, than to do an O(n) bucket expansion too often.
+ */
+ unsigned expand_mult;
+
+} UT_hash_bucket;
+
+/* random signature used only to find hash tables in external analysis */
+#define HASH_SIGNATURE 0xa0111fe1u
+#define HASH_BLOOM_SIGNATURE 0xb12220f2u
+
+typedef struct UT_hash_table {
+ UT_hash_bucket * buckets;
+ unsigned num_buckets, log2_num_buckets;
+ unsigned num_items;
+ struct UT_hash_handle *tail; /* tail hh in app order, for fast append */
+ ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */
+
+ /* in an ideal situation (all buckets used equally), no bucket would have
+ * more than ceil(#items/#buckets) items. that's the ideal chain length. */
+ unsigned ideal_chain_maxlen;
+
+ /* nonideal_items is the number of items in the hash whose chain position
+ * exceeds the ideal chain maxlen. these items pay the penalty for an uneven
+ * hash distribution; reaching them in a chain traversal takes >ideal steps */
+ unsigned nonideal_items;
+
+ /* ineffective expands occur when a bucket doubling was performed, but
+ * afterward, more than half the items in the hash had nonideal chain
+ * positions. If this happens on two consecutive expansions we inhibit any
+ * further expansion, as it's not helping; this happens when the hash
+ * function isn't a good fit for the key domain. When expansion is inhibited
+ * the hash will still work, albeit no longer in constant time. */
+ unsigned ineff_expands, noexpand;
+
+ uint32_t signature; /* used only to find hash tables in external analysis */
+#ifdef HASH_BLOOM
+ uint32_t bloom_sig; /* used only to test bloom exists in external analysis */
+ uint8_t *bloom_bv;
+ uint8_t bloom_nbits;
+#endif
+
+} UT_hash_table;
+
+typedef struct UT_hash_handle {
+ struct UT_hash_table * tbl;
+ void * prev; /* prev element in app order */
+ void * next; /* next element in app order */
+ struct UT_hash_handle *hh_prev; /* previous hh in bucket order */
+ struct UT_hash_handle *hh_next; /* next hh in bucket order */
+ void * key; /* ptr to enclosing struct's key */
+ unsigned keylen; /* enclosing struct's key len */
+ unsigned hashv; /* result of hash-fcn(key) */
+} UT_hash_handle;
+
+#endif /* UTHASH_H */
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index dbc7e55..56427f5 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -234,7 +234,6 @@ set (testhdf5_SOURCES
${HDF5_TEST_SOURCE_DIR}/tskiplist.c
${HDF5_TEST_SOURCE_DIR}/tsohm.c
${HDF5_TEST_SOURCE_DIR}/ttime.c
- ${HDF5_TEST_SOURCE_DIR}/ttst.c
${HDF5_TEST_SOURCE_DIR}/tunicode.c
${HDF5_TEST_SOURCE_DIR}/tvltypes.c
${HDF5_TEST_SOURCE_DIR}/tvlstr.c
@@ -260,10 +259,6 @@ set (ttsafe_SOURCES
${HDF5_TEST_SOURCE_DIR}/ttsafe_attr_vlen.c
)
-set (event_set_SOURCES
- ${HDF5_TEST_SOURCE_DIR}/event_set.c
-)
-
set (H5_TESTS
testhdf5 # multiple source
cache
@@ -337,7 +332,7 @@ set (H5_TESTS
vol
timer
cmpd_dtransform
- event_set # multiple source
+ event_set
)
macro (ADD_H5_EXE file)
@@ -369,7 +364,6 @@ set (H5_TESTS_MULTIPLE
ttsafe
thread_id # special link
mirror_vfd
- event_set
)
# Only build single source tests here
foreach (h5_test ${H5_TESTS})
@@ -533,19 +527,6 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd)
endif ()
-#-- Adding test for event_set
-add_executable (event_set ${event_set_SOURCES})
-target_compile_options(event_set PRIVATE "${HDF5_CMAKE_C_FLAGS}")
-target_include_directories (event_set PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT BUILD_SHARED_LIBS)
- TARGET_C_PROPERTIES (event_set STATIC)
- target_link_libraries (event_set PRIVATE ${HDF5_TEST_LIB_TARGET})
-else ()
- TARGET_C_PROPERTIES (event_set SHARED)
- target_link_libraries (event_set PRIVATE ${HDF5_TEST_LIBSH_TARGET})
-endif ()
-set_target_properties (event_set PROPERTIES FOLDER test)
-
#-----------------------------------------------------------------------------
# Add Target to clang-format
#-----------------------------------------------------------------------------
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index c623a0e..bb5356d 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -318,14 +318,6 @@ set (test_CLEANFILES
tvlstr.h5
tvlstr2.h5
twriteorder.dat
- flush.h5
- flush-swmr.h5
- noflush.h5
- noflush-swmr.h5
- flush_extend.h5
- flush_extend-swmr.h5
- noflush_extend.h5
- noflush_extend-swmr.h5
enum1.h5
titerate.h5
ttsafe.h5
@@ -410,6 +402,8 @@ set (test_CLEANFILES
mirror_rw/*
mirror_wo/*
event_set_*.h5
+ h5s_block.h5
+ h5s_plist.h5
)
# Remove any output file left over from previous test run
@@ -655,10 +649,10 @@ set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
WILL_FAIL "true"
)
+# release + 1 should pass
add_test (NAME H5TEST-tcheck_version-release COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:tcheck_version> "-tr")
set_tests_properties (H5TEST-tcheck_version-release PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
- WILL_FAIL "true"
)
##############################################################################
@@ -870,7 +864,7 @@ if (BUILD_SHARED_LIBS)
##############################################################################
endif ()
-option (TEST_SHELL_SCRIPTS "Enable shell script tests" OFF)
+option (TEST_SHELL_SCRIPTS "Enable shell script tests" ON)
if (TEST_SHELL_SCRIPTS)
include (ShellTests.cmake)
endif()
@@ -889,8 +883,7 @@ if (ENABLE_EXTENDED_TESTS)
#-- Adding test for flushrefresh
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
- find_package (Perl)
- if (PERL_FOUND)
+ if (H5_PERL_FOUND)
add_test (
NAME H5TEST-testflushrefresh-clear-objects
COMMAND ${CMAKE_COMMAND} -E remove flushrefresh.h5
@@ -916,9 +909,9 @@ if (ENABLE_EXTENDED_TESTS)
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
)
+ else ()
+ message (STATUS "Cannot execute TEST flushrefresh - perl not found")
endif ()
-else ()
- message (STATUS "Cannot execute TEST flushrefresh - perl not found")
endif ()
##############################################################################
diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake
index dada9a9..892ccf3 100644
--- a/test/CMakeVFDTests.cmake
+++ b/test/CMakeVFDTests.cmake
@@ -26,7 +26,7 @@ set (VFD_LIST
multi
family
)
-if (DIRECT_VFD)
+if (H5_HAVE_DIRECT)
set (VFD_LIST ${VFD_LIST} direct)
endif ()
diff --git a/test/COPYING b/test/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/test/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/test/Makefile.am b/test/Makefile.am
index 59675f1..d465664 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -150,7 +150,6 @@ ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \
ttsafe_acreate.c ttsafe_attr_vlen.c
cache_image_SOURCES=cache_image.c genall5.c
mirror_vfd_SOURCES=mirror_vfd.c genall5.c
-event_set_SOURCES=event_set.c
# Additional target for running timing test
timings _timings: testmeta
@@ -176,7 +175,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
zero_chunk.h5 chunk_single.h5 swmr_non_latest.h5 \
earray_hdr_fd.h5 farray_hdr_fd.h5 bt2_hdr_fd.h5 \
storage_size.h5 dls_01_strings.h5 power2up.h5 version_bounds.h5 \
- alloc_0sized.h5 \
+ alloc_0sized.h5 h5s_block.h5 h5s_plist.h5 \
extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \
sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \
stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw gheap[0-4].h5 \
@@ -217,7 +216,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
# Sources for testhdf5 executable
testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \
tgenprop.c th5o.c th5s.c tcoords.c theap.c tid.c titerate.c tmeta.c tmisc.c \
- trefer.c trefer_deprec.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \
+ trefer.c trefer_deprec.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c tunicode.c \
tvlstr.c tvltypes.c
# Sources for Use Cases
diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake
index 4676184..9614152 100644
--- a/test/ShellTests.cmake
+++ b/test/ShellTests.cmake
@@ -17,14 +17,14 @@
if (UNIX)
- find_program (SH_PROGRAM sh)
+ find_program (SH_PROGRAM bash)
if (SH_PROGRAM)
-
+ set (srcdir ${HDF5_TEST_SOURCE_DIR})
+ set (bindir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
##############################################################################
# configure scripts to test dir
##############################################################################
- find_package (Perl)
- if (PERL_FOUND)
+ if (H5_PERL_FOUND)
configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY)
endif ()
configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY)
@@ -34,13 +34,8 @@ if (UNIX)
##############################################################################
# copy test programs to test dir
##############################################################################
- add_custom_command (
- TARGET swmr_check_compat_vfd
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_check_compat_vfd>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_check_compat_vfd"
- )
-
+ #shell script creates dir
+ #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
add_custom_command (
TARGET swmr_check_compat_vfd
POST_BUILD
@@ -48,118 +43,12 @@ if (UNIX)
ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh"
)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
- add_custom_command (
- TARGET flushrefresh
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:flushrefresh>" "${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh"
- )
-
#shell script creates dir
#file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test")
- add_custom_command (
- TARGET use_append_mchunks
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:use_append_mchunks>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_append_mchunks"
- )
- add_custom_command (
- TARGET use_disable_mdc_flushes
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:use_disable_mdc_flushes>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_disable_mdc_flushes"
- )
- add_custom_command (
- TARGET twriteorder
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:twriteorder>" "${HDF5_TEST_BINARY_DIR}/H5TEST/twriteorder"
- )
- add_custom_command (
- TARGET use_append_chunk
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:use_append_chunk>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_append_chunk"
- )
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
- add_custom_command (
- TARGET swmr_generator
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_generator>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_generator"
- )
- add_custom_command (
- TARGET swmr_start_write
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_start_write>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_start_write"
- )
- add_custom_command (
- TARGET swmr_reader
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_reader"
- )
- add_custom_command (
- TARGET swmr_writer
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_writer"
- )
- add_custom_command (
- TARGET swmr_remove_reader
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_remove_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_remove_reader"
- )
- add_custom_command (
- TARGET swmr_remove_writer
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_remove_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_remove_writer"
- )
- add_custom_command (
- TARGET swmr_addrem_writer
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_addrem_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_addrem_writer"
- )
- add_custom_command (
- TARGET swmr_sparse_reader
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_sparse_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_sparse_reader"
- )
- add_custom_command (
- TARGET swmr_sparse_writer
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:swmr_sparse_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_sparse_writer"
- )
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test")
- add_custom_command (
- TARGET vds_swmr_gen
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_gen>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_gen"
- )
- add_custom_command (
- TARGET vds_swmr_writer
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_writer"
- )
- add_custom_command (
- TARGET vds_swmr_reader
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_reader"
- )
-
-
##############################################################################
##############################################################################
@@ -198,18 +87,22 @@ if (UNIX)
# testvdsswmr.sh: vds_swmr*
add_test (H5SHELL-testflushrefresh ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh)
set_tests_properties (H5SHELL-testflushrefresh PROPERTIES
+ ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
add_test (H5SHELL-test_usecases ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh)
set_tests_properties (H5SHELL-test_usecases PROPERTIES
+ ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
add_test (H5SHELL-testswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh)
set_tests_properties (H5SHELL-testswmr PROPERTIES
+ ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
add_test (H5SHELL-testvdsswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh)
set_tests_properties (H5SHELL-testvdsswmr PROPERTIES
+ ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
diff --git a/test/accum.c b/test/accum.c
index e9542cf..c3346bc 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -2074,13 +2074,14 @@ error:
/*-------------------------------------------------------------------------
* Function: test_swmr_write_big
*
- * Purpose: A SWMR test: verifies that writing "large" metadata to a file
- * opened with SWMR_WRITE will flush the existing metadata in the
- * accumulator to disk first before writing the "large" metadata
- * to disk.
- * This test will fork and exec a reader "accum_swmr_reader" which
- * opens the same file with SWMR_READ and verifies that the correct
- * metadata is read from disk.
+ * Purpose: A SWMR test: verifies that writing "large" metadata to a file
+ * opened with SWMR_WRITE will flush the existing metadata in the
+ * accumulator to disk first before writing the "large" metadata
+ * to disk.
+ *
+ * This test will fork and exec a reader "accum_swmr_reader" which
+ * opens the same file with SWMR_READ and verifies that the correct
+ * metadata is read from disk.
*
* Return: Success: 0
* Failure: 1
@@ -2092,6 +2093,7 @@ error:
unsigned
test_swmr_write_big(hbool_t newest_format)
{
+
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
H5F_t * rf = NULL; /* File pointer */
@@ -2099,26 +2101,23 @@ test_swmr_write_big(hbool_t newest_format)
uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */
uint8_t wbuf[1024]; /* Buffer for reading & writing */
unsigned u; /* Local index variable */
-#ifdef H5_HAVE_UNISTD_H
- pid_t pid; /* Process ID */
-#endif /* H5_HAVE_UNISTD_H */
- int status; /* Status returned from child process */
- char * driver = NULL; /* VFD string (from env variable) */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ hbool_t process_success = FALSE;
+ char * driver = NULL; /* VFD string (from env variable) */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
if (newest_format)
TESTING("SWMR write of large metadata: with latest format")
else
TESTING("SWMR write of large metadata: with non-latest-format")
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#if !defined(H5_HAVE_UNISTD_H) && !defined(H5_HAVE_WIN32_API)
+ /* Not a Windows or POSIX system */
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped: Not a Windows or POSIX system.");
return 0;
-#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
-
+#else
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
@@ -2228,56 +2227,94 @@ test_swmr_write_big(hbool_t newest_format)
if (HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
TEST_ERROR;
- /* Fork child process to verify that the data at [1024, 2014] does get written to disk */
- if ((pid = HDfork()) < 0) {
- HDperror("fork");
- FAIL_STACK_ERROR;
- }
- else if (0 == pid) { /* Child process */
- /* By convention, argv[0] tells the name of program invoked.
- *
- * execv on NetBSD 8 will actually return EFAULT if there is a
- * NULL at argv[0], so we follow the convention unconditionally.
- */
- char swmr_reader[] = SWMR_READER;
- char *const new_argv[] = {swmr_reader, NULL};
- /* Run the reader */
- status = HDexecv(SWMR_READER, new_argv);
- HDprintf("errno from execv = %s\n", HDstrerror(errno));
- FAIL_STACK_ERROR;
- } /* end if */
+#if defined(H5_HAVE_WIN32_API)
+ {
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ DWORD exit_code = EXIT_FAILURE;
- /* Parent process -- wait for the child process to complete */
- while (pid != HDwaitpid(pid, &status, 0))
- /*void*/;
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+ ZeroMemory(&pi, sizeof(pi));
- /* Check if child process terminates normally and its return value */
- if (WIFEXITED(status) && !WEXITSTATUS(status)) {
- /* Flush the accumulator */
- if (accum_reset(rf) < 0)
+ if (0 == CreateProcess(NULL, SWMR_READER, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
+ HDprintf("CreateProcess failed (%d).\n", GetLastError());
FAIL_STACK_ERROR;
+ }
- /* Close and remove the file */
- if (H5Fclose(fid) < 0)
- FAIL_STACK_ERROR;
+ (void)WaitForSingleObject(pi.hProcess, INFINITE);
+
+ if (FALSE == GetExitCodeProcess(pi.hProcess, &exit_code) || EXIT_FAILURE == exit_code)
+ process_success = FALSE;
+ else
+ process_success = TRUE;
- /* Close the property list */
- if (H5Pclose(fapl) < 0)
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+#else /* defined(H5_HAVE_WIN32_API) */
+ {
+ pid_t pid; /* Process ID */
+ int status; /* Status returned from child process */
+
+ /* Fork child process to verify that the data at [1024, 2014] does get written to disk */
+ if ((pid = HDfork()) < 0) {
+ HDperror("fork");
+ FAIL_STACK_ERROR;
+ }
+ else if (0 == pid) { /* Child process */
+ /* By convention, argv[0] tells the name of program invoked.
+ *
+ * execv on NetBSD 8 will actually return EFAULT if there is a
+ * NULL at argv[0], so we follow the convention unconditionally.
+ */
+ char swmr_reader[] = SWMR_READER;
+ char *const new_argv[] = {swmr_reader, NULL};
+ /* Run the reader */
+ status = HDexecv(SWMR_READER, new_argv);
+ HDprintf("errno from execv = %s\n", HDstrerror(errno));
FAIL_STACK_ERROR;
+ } /* end if */
- /* Pop API context */
- if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
- FAIL_STACK_ERROR
- api_ctx_pushed = FALSE;
-
- /* Release memory */
- if (wbuf2)
- HDfree(wbuf2);
- if (rbuf)
- HDfree(rbuf);
- PASSED();
- return 0;
- } /* end if */
+ /* Parent process -- wait for the child process to complete */
+ while (pid != HDwaitpid(pid, &status, 0))
+ /*void*/;
+
+ /* Check if child process terminates normally and its return value */
+ if (WIFEXITED(status) && !WEXITSTATUS(status))
+ process_success = TRUE;
+ }
+#endif /* defined(H5_HAVE_WIN32_API) */
+
+ /* Check if the process terminated correctly */
+ if (!process_success)
+ FAIL_PUTS_ERROR("child process exited abnormally")
+
+ /* Flush the accumulator */
+ if (accum_reset(rf) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Close and remove the file */
+ if (H5Fclose(fid) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Close the property list */
+ if (H5Pclose(fapl) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Pop API context */
+ if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
+ FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
+ /* Release memory */
+ if (wbuf2)
+ HDfree(wbuf2);
+ if (rbuf)
+ HDfree(rbuf);
+
+ PASSED();
+ return 0;
error:
/* Closing and remove the file */
@@ -2296,7 +2333,7 @@ error:
return 1;
-#endif
+#endif /* !defined(H5_HAVE_UNISTD_H) && !defined(H5_HAVE_WIN32_API) */
} /* end test_swmr_write_big() */
diff --git a/test/big.c b/test/big.c
index 36fb27d..6f8ce67 100644
--- a/test/big.c
+++ b/test/big.c
@@ -56,8 +56,8 @@
#define DNAME "big.data"
#define WRT_N 50
-#define WRT_SIZE 4 * 1024
-#define FAMILY_SIZE 1024 * 1024 * 1024
+#define WRT_SIZE (4 * 1024)
+#define FAMILY_SIZE (1024 * 1024 * 1024)
#define GB (HDoff_t)0x40000000L
@@ -277,7 +277,7 @@ error:
* 'name' in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static int
enough_room(hid_t fapl)
{
@@ -319,7 +319,7 @@ done:
return ret_value;
}
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: writer
diff --git a/test/btree2.c b/test/btree2.c
index 25f0d07..aca0c77 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -676,7 +676,10 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to index record in B-tree with no records */
idx = 0;
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -731,7 +734,10 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to index non-existant record in B-tree with 1 record */
idx = 0;
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -793,7 +799,10 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to index non-existant record in B-tree with several records */
idx = 0;
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3120,12 +3129,18 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY * 3), find_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3156,7 +3171,10 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
record = INSERT_MANY / 2;
- H5E_BEGIN_TRY { ret = H5B2_insert(bt2, &record); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_insert(bt2, &record);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3288,7 +3306,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3362,7 +3383,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3436,7 +3460,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -3527,7 +3554,10 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5187,12 +5217,18 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5330,7 +5366,10 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to remove a record from a B-tree with no records */
record = 0;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5367,7 +5406,10 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = 0;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5448,7 +5490,10 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_
TEST_ERROR
record = 0;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -5650,7 +5695,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, const bt
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = (INSERT_SPLIT_ROOT_NREC * 2) + 1;
- H5E_BEGIN_TRY { ret = H5B2_remove(bt2, &record, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -8801,8 +8849,8 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Check for VFD which stores data in multiple files */
- single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"));
+ single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0);
if (single_file_vfd) {
/* Make a copy of the file in memory, in order to speed up deletion testing */
@@ -9229,7 +9277,10 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
/* Attempt to find record B-tree less than a value */
search = 0;
- H5E_BEGIN_TRY { ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9306,7 +9357,10 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param
/* Attempt to find record B-tree less than a value */
search = (FIND_NEIGHBOR * 2) + 1;
- H5E_BEGIN_TRY { ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9721,7 +9775,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to modify a non-existant record */
record = 3;
modify = 4;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9769,7 +9826,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to find original record */
record = 4330;
found = HSIZET_MAX;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9817,7 +9877,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to find original record */
record = 5350;
found = 5350;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -9865,7 +9928,10 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param_t *tpa
/* Attempt to find original record */
record = 9445;
found = 9445;
- H5E_BEGIN_TRY { ret = H5B2_modify(bt2, &record, modify_cb, &modify); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
+ }
H5E_END_TRY;
/* Should fail */
if (ret != FAIL)
@@ -10185,7 +10251,10 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Pclose(fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/cache.c b/test/cache.c
index 767bae0..6989564 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -280,17 +280,17 @@ smoke_check_1(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged);
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -308,7 +308,7 @@ smoke_check_1(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -326,7 +326,7 @@ smoke_check_1(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -344,7 +344,7 @@ smoke_check_1(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -354,7 +354,7 @@ smoke_check_1(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -367,7 +367,7 @@ smoke_check_1(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -377,7 +377,7 @@ smoke_check_1(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -390,12 +390,12 @@ smoke_check_1(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -409,7 +409,7 @@ smoke_check_1(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -478,17 +478,17 @@ smoke_check_2(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged);
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -506,7 +506,7 @@ smoke_check_2(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -524,7 +524,7 @@ smoke_check_2(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -542,7 +542,7 @@ smoke_check_2(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -552,7 +552,7 @@ smoke_check_2(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -565,7 +565,7 @@ smoke_check_2(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -575,7 +575,7 @@ smoke_check_2(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -588,12 +588,12 @@ smoke_check_2(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -607,7 +607,7 @@ smoke_check_2(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -675,17 +675,17 @@ smoke_check_3(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -703,7 +703,7 @@ smoke_check_3(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -721,7 +721,7 @@ smoke_check_3(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -739,7 +739,7 @@ smoke_check_3(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -749,7 +749,7 @@ smoke_check_3(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -762,7 +762,7 @@ smoke_check_3(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -772,7 +772,7 @@ smoke_check_3(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -785,12 +785,12 @@ smoke_check_3(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -804,7 +804,7 @@ smoke_check_3(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -873,17 +873,17 @@ smoke_check_4(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -901,7 +901,7 @@ smoke_check_4(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -919,7 +919,7 @@ smoke_check_4(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -937,7 +937,7 @@ smoke_check_4(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -947,7 +947,7 @@ smoke_check_4(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -960,7 +960,7 @@ smoke_check_4(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -970,7 +970,7 @@ smoke_check_4(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -983,12 +983,12 @@ smoke_check_4(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1002,7 +1002,7 @@ smoke_check_4(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -1046,7 +1046,7 @@ smoke_check_5(int express_test, unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (2 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ (32 * 1024 * 1025),
/* size_t min_size = */ (512 * 1024),
@@ -1055,23 +1055,23 @@ smoke_check_5(int express_test, unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.9f,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -1079,7 +1079,7 @@ smoke_check_5(int express_test, unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.5f
+ /* double empty_reserve = */ 0.5
};
if (paged)
@@ -1116,12 +1116,12 @@ smoke_check_5(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
cache_ptr = file_ptr->shared->cache;
@@ -1138,7 +1138,7 @@ smoke_check_5(int express_test, unsigned paged)
}
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1149,7 +1149,7 @@ smoke_check_5(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1160,7 +1160,7 @@ smoke_check_5(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1171,7 +1171,7 @@ smoke_check_5(int express_test, unsigned paged)
/* do_inserts */ TRUE);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1181,7 +1181,7 @@ smoke_check_5(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1193,7 +1193,7 @@ smoke_check_5(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1203,7 +1203,7 @@ smoke_check_5(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1215,12 +1215,12 @@ smoke_check_5(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1234,7 +1234,7 @@ smoke_check_5(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -1278,7 +1278,7 @@ smoke_check_6(int express_test, unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (2 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ (32 * 1024 * 1025),
/* size_t min_size = */ (512 * 1024),
@@ -1287,23 +1287,23 @@ smoke_check_6(int express_test, unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.9f,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -1311,7 +1311,7 @@ smoke_check_6(int express_test, unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f
+ /* double empty_reserve = */ 0.05
};
if (paged)
@@ -1348,12 +1348,12 @@ smoke_check_6(int express_test, unsigned paged)
}
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
cache_ptr = file_ptr->shared->cache;
@@ -1370,7 +1370,7 @@ smoke_check_6(int express_test, unsigned paged)
}
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1381,7 +1381,7 @@ smoke_check_6(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1392,7 +1392,7 @@ smoke_check_6(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1403,7 +1403,7 @@ smoke_check_6(int express_test, unsigned paged)
/* do_inserts */ TRUE);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1413,7 +1413,7 @@ smoke_check_6(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1425,7 +1425,7 @@ smoke_check_6(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1435,7 +1435,7 @@ smoke_check_6(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1447,12 +1447,12 @@ smoke_check_6(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1466,7 +1466,7 @@ smoke_check_6(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -1510,7 +1510,7 @@ smoke_check_7(int express_test, unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (2 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ (32 * 1024 * 1025),
/* size_t min_size = */ (512 * 1024),
@@ -1519,24 +1519,24 @@ smoke_check_7(int express_test, unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (8 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */
H5C_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.9f,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -1544,7 +1544,7 @@ smoke_check_7(int express_test, unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1f
+ /* double empty_reserve = */ 0.1
};
if (paged)
@@ -1581,12 +1581,12 @@ smoke_check_7(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
cache_ptr = file_ptr->shared->cache;
@@ -1603,7 +1603,7 @@ smoke_check_7(int express_test, unsigned paged)
}
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1614,7 +1614,7 @@ smoke_check_7(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1625,7 +1625,7 @@ smoke_check_7(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1636,7 +1636,7 @@ smoke_check_7(int express_test, unsigned paged)
/* do_inserts */ TRUE);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1646,7 +1646,7 @@ smoke_check_7(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1658,7 +1658,7 @@ smoke_check_7(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1668,7 +1668,7 @@ smoke_check_7(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1680,12 +1680,12 @@ smoke_check_7(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1699,7 +1699,7 @@ smoke_check_7(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -1743,7 +1743,7 @@ smoke_check_8(int express_test, unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (2 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ (32 * 1024 * 1025),
/* size_t min_size = */ (512 * 1024),
@@ -1752,24 +1752,24 @@ smoke_check_8(int express_test, unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */
H5C_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.9f,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -1777,7 +1777,7 @@ smoke_check_8(int express_test, unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1f
+ /* double empty_reserve = */ 0.1
};
if (paged)
@@ -1814,12 +1814,12 @@ smoke_check_8(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged);
cache_ptr = file_ptr->shared->cache;
@@ -1836,7 +1836,7 @@ smoke_check_8(int express_test, unsigned paged)
}
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1847,7 +1847,7 @@ smoke_check_8(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1858,7 +1858,7 @@ smoke_check_8(int express_test, unsigned paged)
/* do_inserts */ FALSE);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1869,7 +1869,7 @@ smoke_check_8(int express_test, unsigned paged)
/* do_inserts */ TRUE);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -1879,7 +1879,7 @@ smoke_check_8(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1891,7 +1891,7 @@ smoke_check_8(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -1901,7 +1901,7 @@ smoke_check_8(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
hl_col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -1913,12 +1913,12 @@ smoke_check_8(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -1932,7 +1932,7 @@ smoke_check_8(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -2011,12 +2011,12 @@ smoke_check_9(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged);
cache_ptr = file_ptr->shared->cache;
@@ -2024,7 +2024,7 @@ smoke_check_9(int express_test, unsigned paged)
/* disable evictions */
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2038,7 +2038,8 @@ smoke_check_9(int express_test, unsigned paged)
}
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++,
+ (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2058,7 +2059,7 @@ smoke_check_9(int express_test, unsigned paged)
/* enable evictions */
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2072,7 +2073,8 @@ smoke_check_9(int express_test, unsigned paged)
}
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", __func__, mile_stone++,
+ (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2090,7 +2092,7 @@ smoke_check_9(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2104,7 +2106,8 @@ smoke_check_9(int express_test, unsigned paged)
}
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n", __func__, mile_stone++,
+ (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2122,7 +2125,7 @@ smoke_check_9(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2136,7 +2139,8 @@ smoke_check_9(int express_test, unsigned paged)
}
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", __func__, mile_stone++,
+ (int)pass);
/* flush and destroy all entries in the cache: */
@@ -2146,7 +2150,7 @@ smoke_check_9(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2160,7 +2164,8 @@ smoke_check_9(int express_test, unsigned paged)
}
if (show_progress) /* 12 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++,
+ (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2173,7 +2178,7 @@ smoke_check_9(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 13 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush all entries in the cache: */
@@ -2183,7 +2188,7 @@ smoke_check_9(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 14 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2197,7 +2202,8 @@ smoke_check_9(int express_test, unsigned paged)
}
if (show_progress) /* 15 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++,
+ (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2210,7 +2216,7 @@ smoke_check_9(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 16 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2224,12 +2230,13 @@ smoke_check_9(int express_test, unsigned paged)
}
if (show_progress) /* 17 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++,
+ (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 18 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -2243,7 +2250,7 @@ smoke_check_9(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -2322,18 +2329,19 @@ smoke_check_10(int express_test, unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged);
cache_ptr = file_ptr->shared->cache;
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++,
+ (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2351,7 +2359,7 @@ smoke_check_10(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2365,7 +2373,8 @@ smoke_check_10(int express_test, unsigned paged)
}
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++,
+ (int)pass);
row_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2383,7 +2392,7 @@ smoke_check_10(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2397,7 +2406,8 @@ smoke_check_10(int express_test, unsigned paged)
}
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++,
+ (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2415,7 +2425,7 @@ smoke_check_10(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2429,7 +2439,8 @@ smoke_check_10(int express_test, unsigned paged)
}
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++,
+ (int)pass);
/* flush and destroy all entries in the cache: */
@@ -2439,7 +2450,7 @@ smoke_check_10(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2453,7 +2464,8 @@ smoke_check_10(int express_test, unsigned paged)
}
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++,
+ (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2466,7 +2478,7 @@ smoke_check_10(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 12 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2480,7 +2492,8 @@ smoke_check_10(int express_test, unsigned paged)
}
if (show_progress) /* 13 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++,
+ (int)pass);
/* flush all entries in the cache: */
@@ -2490,7 +2503,7 @@ smoke_check_10(int express_test, unsigned paged)
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 14 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2504,7 +2517,8 @@ smoke_check_10(int express_test, unsigned paged)
}
if (show_progress) /* 15 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++,
+ (int)pass);
col_major_scan_backward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2517,7 +2531,7 @@ smoke_check_10(int express_test, unsigned paged)
/* dirty_unprotects */ dirty_unprotects);
if (show_progress) /* 16 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -2531,12 +2545,13 @@ smoke_check_10(int express_test, unsigned paged)
}
if (show_progress) /* 17 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++,
+ (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 18 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -2550,7 +2565,7 @@ smoke_check_10(int express_test, unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -2625,17 +2640,17 @@ write_permitted_check(int
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
reset_entries();
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
file_ptr = setup_cache((size_t)(1 * 1024 * 1024), (size_t)0, paged);
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
row_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2653,7 +2668,7 @@ write_permitted_check(int
/* dirty_unprotects */ TRUE);
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
write_permitted = FALSE;
@@ -2673,7 +2688,7 @@ write_permitted_check(int
/* dirty_unprotects */ NO_CHANGE);
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
write_permitted = TRUE;
@@ -2693,7 +2708,7 @@ write_permitted_check(int
/* dirty_unprotects */ TRUE);
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* flush and destroy all entries in the cache: */
@@ -2703,7 +2718,7 @@ write_permitted_check(int
/* dump_detailed_stats */ FALSE);
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
col_major_scan_forward(/* file_ptr */ file_ptr,
/* max_index */ max_index,
@@ -2716,7 +2731,7 @@ write_permitted_check(int
/* dirty_unprotects */ TRUE);
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
write_permitted = FALSE;
@@ -2733,12 +2748,12 @@ write_permitted_check(int
write_permitted = TRUE;
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
takedown_cache(file_ptr, display_stats, TRUE);
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
verify_clean();
verify_unprotected();
@@ -2752,7 +2767,7 @@ write_permitted_check(int
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
@@ -3046,7 +3061,7 @@ check_insert_entry(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -3135,7 +3150,7 @@ check_flush_cache(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -3210,8 +3225,6 @@ check_flush_cache__empty_cache(H5F_t *file_ptr)
"flush with flags = 0x10 failed on empty cache.\n")
}
- return;
-
} /* check_flush_cache__empty_cache() */
/*-------------------------------------------------------------------------
@@ -4413,8 +4426,6 @@ check_flush_cache__multi_entry(H5F_t *file_ptr)
check_flush_cache__pe_multi_entry_test(file_ptr, test_num, flush_flags, spec_size, spec);
}
- return;
-
} /* check_flush_cache__multi_entry() */
/*-------------------------------------------------------------------------
@@ -4599,8 +4610,6 @@ check_flush_cache__multi_entry_test(H5F_t *file_ptr, int test_num, unsigned int
u++;
}
- return;
-
} /* check_flush_cache__multi_entry_test() */
/*-------------------------------------------------------------------------
@@ -4794,8 +4803,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t *file_ptr, int test_num, unsigned i
u++;
}
- return;
-
} /* check_flush_cache__pe_multi_entry_test() */
/*-------------------------------------------------------------------------
@@ -7991,8 +7998,6 @@ check_flush_cache__flush_ops(H5F_t *file_ptr)
/* finally finish up with the flush ops eviction test */
check_flush_cache__flush_op_eviction_test(file_ptr);
- return;
-
} /* check_flush_cache__flush_ops() */
/*-------------------------------------------------------------------------
@@ -8078,19 +8083,6 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu
if ((check[i].entry_num != i) || (check[i].entry_type < 0) ||
(check[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || (check[i].entry_index < 0) ||
(check[i].entry_index > max_indices[check[i].entry_type]) ||
-#ifndef H5_HAVE_STDBOOL_H
- /* Check for nonsense values if hbool_t is an integral
- * type instead of a real Boolean.
- */
- ((check[i].in_cache != TRUE) && (check[i].in_cache != FALSE)) ||
- ((check[i].at_main_addr != TRUE) && (check[i].at_main_addr != FALSE)) ||
- ((check[i].is_dirty != TRUE) && (check[i].is_dirty != FALSE)) ||
- ((check[i].is_protected != TRUE) && (check[i].is_protected != FALSE)) ||
- ((check[i].is_pinned != TRUE) && (check[i].is_pinned != FALSE)) ||
- ((check[i].expected_deserialized != TRUE) && (check[i].expected_deserialized != FALSE)) ||
- ((check[i].expected_serialized != TRUE) && (check[i].expected_serialized != FALSE)) ||
- ((check[i].expected_destroyed != TRUE) && (check[i].expected_destroyed != FALSE)) ||
-#endif /* H5_HAVE_STDBOOL_H */
(check[i].expected_size <= (size_t)0)) {
pass = FALSE;
@@ -8394,8 +8386,6 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu
i++;
}
- return;
-
} /* check_flush_cache__flush_op_test() */
/*-------------------------------------------------------------------------
@@ -10546,8 +10536,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr)
reset_entries();
}
- return;
-
} /* check_flush_cache__flush_op_eviction_test() */
/*-------------------------------------------------------------------------
@@ -12171,8 +12159,6 @@ check_flush_cache__single_entry(H5F_t *file_ptr)
}
}
- return;
-
} /* check_flush_cache__single_entry() */
/*-------------------------------------------------------------------------
@@ -12312,8 +12298,6 @@ check_flush_cache__single_entry_test(H5F_t *file_ptr, int test_num, int entry_ty
}
}
- return;
-
} /* check_flush_cache__single_entry_test() */
/*-------------------------------------------------------------------------
@@ -12489,8 +12473,6 @@ check_flush_cache__pinned_single_entry_test(H5F_t *file_ptr, int test_num, int e
}
}
- return;
-
} /* check_flush_cache__pinned_single_entry_test() */
/*-------------------------------------------------------------------------
@@ -12706,7 +12688,7 @@ check_get_entry_status(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -12987,7 +12969,7 @@ check_expunge_entry(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -13378,7 +13360,7 @@ check_multiple_read_protect(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -13478,7 +13460,7 @@ check_move_entry(unsigned paged)
H5_FAILED()
if (!pass)
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
return (unsigned)!pass;
} /* check_move_entry() */
@@ -13639,8 +13621,6 @@ check_move_entry__run_test(H5F_t *file_ptr, unsigned test_num, struct move_entry
/* put the entry back where it started from */
move_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, TRUE);
- return;
-
} /* check_move_entry__run_test() */
/*-------------------------------------------------------------------------
@@ -13738,7 +13718,7 @@ check_pin_protected_entry(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -14606,7 +14586,7 @@ check_resize_entry(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -14691,7 +14671,7 @@ check_evictions_enabled(unsigned paged)
pass = TRUE;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* create the cache */
if (pass) {
@@ -14713,7 +14693,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that it is empty */
if (pass) {
@@ -14729,7 +14709,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that H5C_get_evictions_enabled() returns the expected value */
if (pass) {
@@ -14745,7 +14725,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14757,7 +14737,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that the cache is full */
if (pass) {
@@ -14773,7 +14753,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14783,7 +14763,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that an entry has been evicted */
if (pass) {
@@ -14799,7 +14779,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14829,7 +14809,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14838,7 +14818,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that another entry has been evicted */
if (pass) {
@@ -14855,7 +14835,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14885,7 +14865,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 12 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* disable evictions */
if (pass) {
@@ -14901,7 +14881,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 13 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that evictions are disabled */
if (pass) {
@@ -14918,7 +14898,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 14 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14928,7 +14908,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 15 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that no entry has been evicted */
if (pass) {
@@ -14945,7 +14925,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 16 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14954,7 +14934,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 17 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that no entry has been evicted */
if (pass) {
@@ -14971,7 +14951,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 18 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* re-enable evictions */
if (pass) {
@@ -14987,7 +14967,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 19 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -14997,7 +14977,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 20 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that no entries have been evicted */
if (pass) {
@@ -15014,7 +14994,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 21 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -15024,7 +15004,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 22 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that the entries have been evicted to bring the
* cache back down to its normal size.
@@ -15044,7 +15024,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 23 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -15074,7 +15054,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 24 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -15104,7 +15084,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 25 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* disable evictions again */
if (pass) {
@@ -15120,7 +15100,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 26 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -15132,7 +15112,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 27 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that the cache has grown */
if (pass) {
@@ -15149,7 +15129,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 28 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* re-enable evictions again */
if (pass) {
@@ -15165,7 +15145,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 29 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -15174,7 +15154,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 30 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* verify that the cache has returned to its maximum size */
if (pass) {
@@ -15191,7 +15171,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 31 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -15221,7 +15201,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 32 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* disable evictions one last time before we shut down */
if (pass) {
@@ -15237,7 +15217,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 33 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -15245,7 +15225,7 @@ check_evictions_enabled(unsigned paged)
}
if (show_progress) /* 34 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
PASSED();
@@ -15256,7 +15236,7 @@ check_evictions_enabled(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -15354,7 +15334,7 @@ check_flush_protected_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -15443,7 +15423,7 @@ check_destroy_pinned_err(unsigned paged)
}
if (!pass)
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
return (unsigned)!pass;
@@ -15539,7 +15519,7 @@ check_destroy_protected_err(unsigned paged)
}
if (!pass)
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
return (unsigned)!pass;
@@ -15620,7 +15600,7 @@ check_duplicate_insert_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -15709,7 +15689,7 @@ check_double_pin_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -15807,7 +15787,7 @@ check_double_unpin_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -15919,7 +15899,7 @@ check_pin_entry_errs(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16001,7 +15981,7 @@ check_double_protect_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16079,7 +16059,7 @@ check_double_unprotect_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16161,7 +16141,7 @@ check_mark_entry_dirty_errs(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16278,7 +16258,7 @@ check_expunge_entry_errs(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16395,7 +16375,7 @@ check_move_entry_errs(unsigned paged)
else {
H5_FAILED()
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
} /* end else */
return (unsigned)!pass;
@@ -16495,7 +16475,7 @@ check_resize_entry_errs(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16616,7 +16596,7 @@ check_unprotect_ro_dirty_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16703,7 +16683,7 @@ check_protect_ro_rw_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16832,7 +16812,7 @@ check_protect_retries(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_msg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_msg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -16972,7 +16952,7 @@ check_check_evictions_enabled_err(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -17024,7 +17004,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (512 * 1024),
- /* double min_clean_fraction = */ 0.5f,
+ /* double min_clean_fraction = */ 0.5,
/* size_t max_size = */ (14 * 1024 * 1024),
/* size_t min_size = */ (512 * 1024),
@@ -17033,23 +17013,23 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.1f,
+ /* double decrement = */ 0.1,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -17057,7 +17037,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f};
+ /* double empty_reserve = */ 0.05};
if (paged)
TESTING("automatic cache resizing (paged aggregation)")
@@ -17381,7 +17361,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1000 * 1000 + 10;
- auto_size_ctl.min_clean_fraction = 0.1f;
+ auto_size_ctl.min_clean_fraction = 0.1;
auto_size_ctl.max_size = 8 * 1000 * 1000;
auto_size_ctl.min_size = 500 * 1000;
@@ -17390,22 +17370,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1000 * 1000);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1000 * 1000);
@@ -17413,7 +17393,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
if (result != SUCCEED) {
@@ -17696,7 +17676,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -17705,22 +17685,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 4.0f;
+ auto_size_ctl.increment = 4.0;
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.25f;
+ auto_size_ctl.decrement = 0.25;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -17728,7 +17708,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
if (result != SUCCEED) {
@@ -17872,7 +17852,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -17881,22 +17861,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -17904,7 +17884,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
if (result != SUCCEED) {
@@ -18240,7 +18220,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -18249,22 +18229,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -18272,7 +18252,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -18722,7 +18702,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -18731,22 +18711,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -18754,7 +18734,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */
+ auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -19099,7 +19079,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -19108,16 +19088,16 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -19126,7 +19106,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
*/
auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -19134,7 +19114,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
if (result != SUCCEED) {
@@ -19346,7 +19326,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1000 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1000 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -19355,22 +19335,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- auto_size_ctl.upper_hr_threshold = 0.999f; /* for ease of testing */
+ auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1000 * 1024);
@@ -19378,7 +19358,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */
+ auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
if (result != SUCCEED) {
@@ -19888,7 +19868,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 64 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 1024 * 1024;
auto_size_ctl.min_size = 5 * 1024;
@@ -19897,22 +19877,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (32 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- auto_size_ctl.flash_multiple = 1.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 1.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- auto_size_ctl.upper_hr_threshold = 0.999f; /* for ease of testing */
+ auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1000 * 1024);
@@ -19920,7 +19900,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */
+ auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
if (result != SUCCEED) {
@@ -20622,7 +20602,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 20 * 1024;
auto_size_ctl.min_size = 4 * 1024;
@@ -20631,22 +20611,22 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.4f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.4;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- auto_size_ctl.upper_hr_threshold = 0.999f; /* for ease of testing */
+ auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (2 * 1024);
@@ -20654,7 +20634,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5f; /* for ease of testing */
+ auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
if (result != SUCCEED) {
@@ -20838,7 +20818,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
} /* end else */
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return (unsigned)!pass;
} /* check_auto_cache_resize() */
@@ -20879,7 +20859,7 @@ check_auto_cache_resize_disable(unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (512 * 1024),
- /* double min_clean_fraction = */ 0.5f,
+ /* double min_clean_fraction = */ 0.5,
/* size_t max_size = */ (14 * 1024 * 1024),
/* size_t min_size = */ (512 * 1024),
@@ -20888,23 +20868,23 @@ check_auto_cache_resize_disable(unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 1.0f,
- /* double flash_threshold = */ 0.25f,
+ /* double flash_multiple = */ 1.0,
+ /* double flash_threshold = */ 0.25,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.1f,
+ /* double decrement = */ 0.1,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -20912,7 +20892,7 @@ check_auto_cache_resize_disable(unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f};
+ /* double empty_reserve = */ 0.05};
if (paged)
TESTING("automatic cache resize disable (paged aggregation)")
@@ -20984,7 +20964,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -20993,22 +20973,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 1.0f; /* disable size increases */
+ auto_size_ctl.increment = 1.0; /* disable size increases */
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -21016,7 +20996,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -21136,7 +21116,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -21145,21 +21125,21 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.0f; /* disable size increases */
+ auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -21167,7 +21147,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -21287,7 +21267,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -21296,22 +21276,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = FALSE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -21319,7 +21299,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -21438,7 +21418,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -21447,22 +21427,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 1.0f; /* disable size decreases */
+ auto_size_ctl.decrement = 1.0; /* disable size decreases */
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -21470,7 +21450,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -21592,7 +21572,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -21601,22 +21581,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 1.0f; /* disable size decreases */
+ auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -21624,7 +21604,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -21742,7 +21722,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -21751,22 +21731,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__off;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -21774,7 +21754,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -21894,7 +21874,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -21903,22 +21883,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = 0; /* disable decrement */
@@ -21926,7 +21906,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 1;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -22111,7 +22091,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -22120,22 +22100,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -22143,7 +22123,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 1;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 1.0f; /* disable decrement */
+ auto_size_ctl.empty_reserve = 1.0; /* disable decrement */
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -22335,7 +22315,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -22344,22 +22324,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- auto_size_ctl.upper_hr_threshold = 1.0f;
+ auto_size_ctl.upper_hr_threshold = 1.0;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -22367,7 +22347,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 1;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -22561,7 +22541,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 2 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -22570,22 +22550,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.0f; /* disable size increases */
+ auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 1.0f; /* disable size decreases */
+ auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -22593,7 +22573,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -22681,7 +22661,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.25f;
+ auto_size_ctl.min_clean_fraction = 0.25;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -22690,22 +22670,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 1.0f; /* disable size increment */
+ auto_size_ctl.increment = 1.0; /* disable size increment */
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 1.0f; /* disable size decrement */
+ auto_size_ctl.decrement = 1.0; /* disable size decrement */
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -22713,7 +22693,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -22801,7 +22781,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = FALSE;
auto_size_ctl.initial_size = 2 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 6 * 1024 * 1024; /* no resize */
auto_size_ctl.min_size = 6 * 1024 * 1024; /* no resize */
@@ -22810,22 +22790,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -22833,7 +22813,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -22921,7 +22901,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.25f;
+ auto_size_ctl.min_clean_fraction = 0.25;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -22930,22 +22910,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 1.0f; /* disable size increment */
+ auto_size_ctl.increment = 1.0; /* disable size increment */
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 1.0f; /* disable size decrement */
+ auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decrement */
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -22953,7 +22933,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -23041,7 +23021,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -23050,22 +23030,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.0f; /* disable size increment */
+ auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increment */
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 1.0f; /* disable size decrement */
+ auto_size_ctl.decrement = 1.0; /* disable size decrement */
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -23073,7 +23053,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -23161,7 +23141,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 4 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 16 * 1024 * 1024;
auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -23170,22 +23150,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__off;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -23193,7 +23173,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -23308,7 +23288,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 64 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 256 * 1024;
auto_size_ctl.min_size = 32 * 1024;
@@ -23317,22 +23297,22 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__threshold;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (2 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 1.0f;
- auto_size_ctl.flash_threshold = 0.25f;
+ auto_size_ctl.flash_multiple = 1.0;
+ auto_size_ctl.flash_threshold = 0.25;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = TRUE;
auto_size_ctl.max_decrement = (1 * 1024);
@@ -23340,7 +23320,7 @@ check_auto_cache_resize_disable(unsigned paged)
auto_size_ctl.epochs_before_eviction = 3;
auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -23438,7 +23418,7 @@ check_auto_cache_resize_disable(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -23478,7 +23458,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (512 * 1024),
- /* double min_clean_fraction = */ 0.5f,
+ /* double min_clean_fraction = */ 0.5,
/* size_t max_size = */ (14 * 1024 * 1024),
/* size_t min_size = */ (512 * 1024),
@@ -23487,23 +23467,23 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.1f,
+ /* double decrement = */ 0.1,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -23511,7 +23491,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f};
+ /* double empty_reserve = */ 0.05};
if (paged)
TESTING("automatic cache resize epoch marker management (paged aggr)")
@@ -23565,7 +23545,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -23574,22 +23554,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -23597,7 +23577,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.epochs_before_eviction = 10;
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -23729,7 +23709,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -23738,22 +23718,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -23761,7 +23741,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.epochs_before_eviction = 1;
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -23847,7 +23827,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -23856,22 +23836,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -23879,7 +23859,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.epochs_before_eviction = 1;
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -23925,7 +23905,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -23934,22 +23914,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -23957,7 +23937,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.epochs_before_eviction = 10;
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -24034,7 +24014,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.set_initial_size = TRUE;
auto_size_ctl.initial_size = 8 * 1024 * 1024;
- auto_size_ctl.min_clean_fraction = 0.5f;
+ auto_size_ctl.min_clean_fraction = 0.5;
auto_size_ctl.max_size = 8 * 1024 * 1024;
auto_size_ctl.min_size = 512 * 1024;
@@ -24043,22 +24023,22 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.incr_mode = H5C_incr__off;
- auto_size_ctl.lower_hr_threshold = 0.75f;
+ auto_size_ctl.lower_hr_threshold = 0.75;
- auto_size_ctl.increment = 2.0f;
+ auto_size_ctl.increment = 2.0;
auto_size_ctl.apply_max_increment = TRUE;
auto_size_ctl.max_increment = (4 * 1024 * 1024);
auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0f;
- auto_size_ctl.flash_threshold = 0.5f;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
auto_size_ctl.decr_mode = H5C_decr__off;
- auto_size_ctl.upper_hr_threshold = 0.995f;
+ auto_size_ctl.upper_hr_threshold = 0.995;
- auto_size_ctl.decrement = 0.5f;
+ auto_size_ctl.decrement = 0.5;
auto_size_ctl.apply_max_decrement = FALSE;
auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24066,7 +24046,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
auto_size_ctl.epochs_before_eviction = 10;
auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05f;
+ auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
@@ -24125,7 +24105,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -24166,7 +24146,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (512 * 1024),
- /* double min_clean_fraction = */ 0.5f,
+ /* double min_clean_fraction = */ 0.5,
/* size_t max_size = */ (16 * 1024 * 1024),
/* size_t min_size = */ (512 * 1024),
@@ -24175,23 +24155,23 @@ check_auto_cache_resize_input_errs(unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.1f,
+ /* double decrement = */ 0.1,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -24199,7 +24179,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f};
+ /* double empty_reserve = */ 0.05};
H5C_auto_size_ctl_t invalid_auto_size_ctl;
H5C_auto_size_ctl_t test_auto_size_ctl;
@@ -24269,7 +24249,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24278,22 +24258,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.7f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.7;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24301,7 +24281,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(NULL, &invalid_auto_size_ctl);
@@ -24338,7 +24318,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24347,22 +24327,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.7f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.7;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24370,7 +24350,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24408,7 +24388,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.initial_size = 16 * 1024 * 1024 + 1;
/* INVALID */
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24417,22 +24397,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24440,7 +24420,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24476,7 +24456,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.initial_size = 1 * 1024 * 1024 - 1;
/* INVALID */
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24485,22 +24465,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24508,7 +24488,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24545,7 +24525,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 1.00001f; /* INVALID */
+ invalid_auto_size_ctl.min_clean_fraction = 1.00001; /* INVALID */
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24554,22 +24534,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24577,7 +24557,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24612,7 +24592,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = -0.00001f; /* INVALID */
+ invalid_auto_size_ctl.min_clean_fraction = -0.00001; /* INVALID */
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24621,22 +24601,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24644,7 +24624,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24681,7 +24661,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = H5C__MAX_MAX_CACHE_SIZE + 1;
/* INVALID */
@@ -24691,22 +24671,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24714,7 +24694,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24749,7 +24729,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 1 * 1024 * 1024; /* INVALID */
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024 + 1; /*PAIR */
@@ -24758,22 +24738,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24781,7 +24761,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24816,7 +24796,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = H5C__MIN_MAX_CACHE_SIZE - 1;
@@ -24825,22 +24805,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24848,7 +24828,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24885,7 +24865,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24895,22 +24875,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24918,7 +24898,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -24953,7 +24933,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -24963,22 +24943,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -24986,7 +24966,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25023,7 +25003,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25032,22 +25012,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = (enum H5C_cache_incr_mode) - 1; /* INVALID */
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25055,7 +25035,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25090,7 +25070,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25099,22 +25079,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = (enum H5C_cache_incr_mode)2; /* INVALID */
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25122,7 +25102,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25159,7 +25139,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25168,22 +25148,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.7f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.7;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 1.01f; /* INVALID */
+ invalid_auto_size_ctl.upper_hr_threshold = 1.01; /* INVALID */
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25191,7 +25171,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25226,7 +25206,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25235,22 +25215,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.8f; /* INVALID */
+ invalid_auto_size_ctl.lower_hr_threshold = 0.8; /* INVALID */
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.7f; /* INVALID */
+ invalid_auto_size_ctl.upper_hr_threshold = 0.7; /* INVALID */
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25258,7 +25238,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25293,7 +25273,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.5f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.5;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25302,22 +25282,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = -0.0001f; /* INVALID */
+ invalid_auto_size_ctl.lower_hr_threshold = -0.0001; /* INVALID */
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25325,7 +25305,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25362,7 +25342,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25371,22 +25351,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 0.99999f; /* INVALID */
+ invalid_auto_size_ctl.increment = 0.99999; /* INVALID */
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.5f;
+ invalid_auto_size_ctl.decrement = 0.5;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25394,7 +25374,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25431,7 +25411,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25440,22 +25420,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = (enum H5C_cache_flash_incr_mode) - 1; /* INVALID */
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25463,7 +25443,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25500,7 +25480,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25509,22 +25489,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 0.09f; /* INVALID */
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 0.09; /* INVALID */
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25532,7 +25512,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25567,7 +25547,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25576,22 +25556,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 10.01f; /* INVALID */
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 10.01; /* INVALID */
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25599,7 +25579,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25636,7 +25616,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25645,22 +25625,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 1.0f;
- invalid_auto_size_ctl.flash_threshold = 0.09f; /* INVALID */
+ invalid_auto_size_ctl.flash_multiple = 1.0;
+ invalid_auto_size_ctl.flash_threshold = 0.09; /* INVALID */
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25668,7 +25648,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25703,7 +25683,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25712,22 +25692,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 1.0f;
- invalid_auto_size_ctl.flash_threshold = 1.001f; /* INVALID */
+ invalid_auto_size_ctl.flash_multiple = 1.0;
+ invalid_auto_size_ctl.flash_threshold = 1.001; /* INVALID */
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25735,7 +25715,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25772,7 +25752,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25781,22 +25761,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = (enum H5C_cache_decr_mode) - 1; /* INVALID */
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25804,7 +25784,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25839,7 +25819,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25848,22 +25828,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = (enum H5C_cache_decr_mode)4; /* INVALID */
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25871,7 +25851,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25908,7 +25888,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25917,22 +25897,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 1.000001f; /* INVALID */
+ invalid_auto_size_ctl.decrement = 1.000001; /* INVALID */
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -25940,7 +25920,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -25975,7 +25955,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -25984,22 +25964,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = -0.000001f; /* INVALID */
+ invalid_auto_size_ctl.decrement = -0.000001; /* INVALID */
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -26007,7 +25987,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -26044,7 +26024,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -26053,22 +26033,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -26076,7 +26056,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 0; /* INVALID */
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -26111,7 +26091,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -26120,22 +26100,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -26143,7 +26123,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1; /* INVALID */
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -26180,7 +26160,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -26189,22 +26169,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -26212,7 +26192,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = 3;
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = -0.0000001f; /* INVALID */
+ invalid_auto_size_ctl.empty_reserve = -0.0000001; /* INVALID */
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -26247,7 +26227,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.set_initial_size = TRUE;
invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
- invalid_auto_size_ctl.min_clean_fraction = 0.1f;
+ invalid_auto_size_ctl.min_clean_fraction = 0.1;
invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
@@ -26256,22 +26236,22 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.incr_mode = H5C_incr__threshold;
- invalid_auto_size_ctl.lower_hr_threshold = 0.75f;
+ invalid_auto_size_ctl.lower_hr_threshold = 0.75;
- invalid_auto_size_ctl.increment = 2.0f;
+ invalid_auto_size_ctl.increment = 2.0;
invalid_auto_size_ctl.apply_max_increment = TRUE;
invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
invalid_auto_size_ctl.flash_incr_mode = H5C_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0f;
- invalid_auto_size_ctl.flash_threshold = 0.5f;
+ invalid_auto_size_ctl.flash_multiple = 2.0;
+ invalid_auto_size_ctl.flash_threshold = 0.5;
invalid_auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
- invalid_auto_size_ctl.upper_hr_threshold = 0.999f;
+ invalid_auto_size_ctl.upper_hr_threshold = 0.999;
- invalid_auto_size_ctl.decrement = 0.9f;
+ invalid_auto_size_ctl.decrement = 0.9;
invalid_auto_size_ctl.apply_max_decrement = TRUE;
invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
@@ -26279,7 +26259,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
invalid_auto_size_ctl.epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1; /* INVALID */
invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05f;
+ invalid_auto_size_ctl.empty_reserve = 0.05;
result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl);
@@ -26357,7 +26337,7 @@ check_auto_cache_resize_input_errs(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -26407,7 +26387,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.5f,
+ /* double min_clean_fraction = */ 0.5,
/* size_t max_size = */ (16 * 1024 * 1025),
/* size_t min_size = */ (512 * 1024),
@@ -26416,23 +26396,23 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.9f,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -26440,7 +26420,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
/* int32_t epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.5f
+ /* double empty_reserve = */ 0.5
};
if (paged)
@@ -26504,7 +26484,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
}
- else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f)) { /* i.e. hit_rate != 0.0 */
+ else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.0)) { /* i.e. hit_rate != 0.0 */
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 1.\n";
@@ -26535,7 +26515,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
}
- else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f)) { /* i.e. hit_rate != 0.0 */
+ else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.0)) { /* i.e. hit_rate != 0.0 */
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 2.\n";
@@ -26576,7 +26556,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
}
- else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.5f)) { /* i.e. hit_rate != 0.5 */
+ else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.5)) { /* i.e. hit_rate != 0.5 */
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 3.\n";
@@ -26649,7 +26629,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
}
- else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.5F)) { /* i.e. hit_rate != 0.5 */
+ else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.5)) { /* i.e. hit_rate != 0.5 */
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 4.\n";
@@ -26853,7 +26833,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -27083,7 +27063,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
} /* end else */
if (show_progress) /* 0 */
- HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
@@ -27104,7 +27084,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -27167,7 +27147,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -27237,7 +27217,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
@@ -27291,13 +27271,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
/* Fill out the rest of the cache with entries */
/* Verify expected status of entries after each insertion */
- for (entry_idx = entry_idx; entry_idx < 50; entry_idx++) {
+ for (; entry_idx < 50; entry_idx++) {
if (fill_via_insertion) {
insert_entry(file_ptr, /* H5F_t * file_ptr */
@@ -27344,7 +27324,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -27419,7 +27399,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
@@ -27431,7 +27411,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
* After each insertion, verify the expected status of the
* entries in the cache.
*/
- for (entry_idx = entry_idx; entry_idx < 100; entry_idx++) {
+ for (; entry_idx < 100; entry_idx++) {
if (fill_via_insertion) {
insert_entry(file_ptr, /* H5F_t * file_ptr */
@@ -27490,7 +27470,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
/* ========================================================================
* ========================================================================
@@ -27549,7 +27529,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
@@ -27597,7 +27577,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
@@ -27648,7 +27628,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 10 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
@@ -27694,7 +27674,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 11 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (cache_ptr) {
@@ -27704,7 +27684,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged)
}
if (show_progress) /* 12 */
- HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass);
+ HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass);
if (pass) {
PASSED();
@@ -33243,7 +33223,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
/* Fill out the rest of the cache with entries */
/* Verify expected status of entries after each insertion */
- for (entry_idx = entry_idx; entry_idx < 50; entry_idx++) {
+ for (; entry_idx < 50; entry_idx++) {
if (fill_via_insertion) {
insert_entry(file_ptr, /* H5F_t * file_ptr */
@@ -33304,7 +33284,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged)
if (pass) {
/* Insert 50 more entries (indices 50-99) into the cache. */
- for (entry_idx = entry_idx; entry_idx < 100; entry_idx++) {
+ for (; entry_idx < 100; entry_idx++) {
if (fill_via_insertion) {
insert_entry(file_ptr, /* H5F_t * file_ptr */
@@ -33664,7 +33644,7 @@ check_entry_deletions_during_scans(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return (unsigned)!pass;
@@ -33880,8 +33860,6 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t *file_ptr)
/* reset cache min clean size to its expected value */
cache_ptr->min_clean_size = (1 * 1024 * 1024);
- return;
-
} /* cedds__expunge_dirty_entry_in_flush_test() */
/*-------------------------------------------------------------------------
@@ -34240,8 +34218,6 @@ cedds__H5C_make_space_in_cache(H5F_t *file_ptr)
/* reset cache min clean size to its expected value */
cache_ptr->min_clean_size = (1 * 1024 * 1024);
- return;
-
} /* cedds__H5C_make_space_in_cache() */
/*-------------------------------------------------------------------------
@@ -34337,7 +34313,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr)
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (2 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.5f,
+ /* double min_clean_fraction = */ 0.5,
/* size_t max_size = */ (8 * 1024 * 1024),
/* size_t min_size = */ (1 * 1024 * 1024),
@@ -34346,23 +34322,23 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr)
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.75f,
+ /* double lower_hr_threshold = */ 0.75,
- /* double increment = */ 2.0f,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
- /* double upper_hr_threshold = */ 0.995f,
+ /* double upper_hr_threshold = */ 0.995,
- /* double decrement = */ 0.5f,
+ /* double decrement = */ 0.5,
/* hbool_t apply_max_decrement = */ FALSE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
@@ -34370,7 +34346,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr)
/* int32_t epochs_before_eviction = */ 1,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f};
+ /* double empty_reserve = */ 0.05};
if (pass) {
@@ -34638,8 +34614,6 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr)
/* reset cache min clean size to its expected value */
cache_ptr->min_clean_size = (1 * 1024 * 1024);
- return;
-
} /* cedds__H5C__autoadjust__ageout__evict_aged_out_entries() */
/*-------------------------------------------------------------------------
@@ -35016,8 +34990,6 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t *file_ptr)
/* reset cache min clean size to its expected value */
cache_ptr->min_clean_size = (1 * 1024 * 1024);
- return;
-
} /* cedds__H5C_flush_invalidate_cache__bucket_scan() */
/*-------------------------------------------------------------------------
@@ -35083,7 +35055,7 @@ check_stats(unsigned paged)
if (!pass) {
- HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
#else /* H5C_COLLECT_CACHE_STATS */
@@ -35480,8 +35452,6 @@ check_stats__smoke_check_1(H5F_t *file_ptr)
/* reset cache min clean size to its expected value */
cache_ptr->min_clean_size = (1 * 1024 * 1024);
- return;
-
} /* check_stats__smoke_check_1() */
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -35565,7 +35535,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
hid_t fcpl_id = H5P_DEFAULT;
if (show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
saved_fid = -1;
@@ -35608,7 +35578,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
}
if (show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass && try_core_file_driver) {
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == FAIL) {
@@ -35625,7 +35595,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
core_file_driver_failed = TRUE;
if (verbose)
- HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC);
+ HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", __func__);
}
else {
saved_fapl_id = fapl_id;
@@ -35633,7 +35603,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
}
if (show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
/* if we either aren't using the core file driver, or a create
* with the core file driver failed, try again with a regular file.
@@ -35648,7 +35618,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
failure_mssg = "H5Fcreate() failed.";
if (verbose)
- HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC);
+ HDfprintf(stdout, "%s: H5Fcreate() failed.\n", __func__);
} /* end if */
} /* end if */
@@ -35656,7 +35626,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
H5CX_push();
if (show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
HDassert(fid >= 0);
@@ -35666,7 +35636,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
failure_mssg = "H5Fflush() failed.";
if (verbose)
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", __func__);
}
else {
file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE);
@@ -35675,13 +35645,13 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
failure_mssg = "Can't get file_ptr.";
if (verbose)
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", __func__);
}
}
}
if (show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
@@ -35724,7 +35694,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
}
if (show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
if (cache_ptr == NULL) {
@@ -35732,19 +35702,19 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
failure_mssg = "H5C_create() failed.";
if (verbose)
- HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
+ HDfprintf(stdout, "%s: H5C_create() failed.\n", __func__);
}
else if (cache_ptr->magic != H5C__H5C_T_MAGIC) {
pass = FALSE;
failure_mssg = "Bad cache_ptr magic.";
if (verbose)
- HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
+ HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", __func__);
}
}
if (show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) { /* allocate space for test entries */
actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
@@ -35754,7 +35724,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
failure_mssg = "H5MF_alloc() failed.";
if (verbose)
- HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC);
+ HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", __func__);
}
else if (actual_base_addr > BASE_ADDR) {
/* If this happens, must increase BASE_ADDR so that the
@@ -35765,14 +35735,14 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
failure_mssg = "actual_base_addr > BASE_ADDR";
if (verbose)
- HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC);
+ HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", __func__);
}
saved_actual_base_addr = actual_base_addr;
}
if (show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
if (pass) {
/* Need to set this else all cache tests will fail */
@@ -35783,7 +35753,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged)
}
if (show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass);
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass);
return (ret_val);
} /* setup_cache() */
@@ -35889,8 +35859,6 @@ takedown_cache(H5F_t *file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats)
}
}
- return;
-
} /* takedown_cache() */
/*-------------------------------------------------------------------------
diff --git a/test/cache_api.c b/test/cache_api.c
index c7c109c..7858c65 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -81,27 +81,27 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (1 * 1024 * 1024 + 1),
- /* double min_clean_fraction = */ 0.2f,
+ /* double min_clean_fraction = */ 0.2,
/* size_t max_size = */ (16 * 1024 * 1024 + 1),
/* size_t min_size = */ (1 * 1024 * 1024 + 1),
/* long int epoch_length = */ 50001,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.91f,
- /* double increment = */ 2.1f,
+ /* double lower_hr_threshold = */ 0.91,
+ /* double increment = */ 2.1,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024 + 1),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
- /* double upper_hr_threshold = */ 0.998f,
- /* double decrement = */ 0.91f,
+ /* double upper_hr_threshold = */ 0.998,
+ /* double decrement = */ 0.91,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024 - 1),
/* int epochs_before_eviction = */ 4,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f,
+ /* double empty_reserve = */ 0.05,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -478,7 +478,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return pass;
@@ -526,22 +526,22 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (1 * 1024 * 1024 + 1),
- /* double min_clean_fraction = */ 0.2f,
+ /* double min_clean_fraction = */ 0.2,
/* size_t max_size = */ (16 * 1024 * 1024 + 1),
/* size_t min_size = */ (1 * 1024 * 1024 + 1),
/* long int epoch_length = */ 50001,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.91f,
- /* double increment = */ 2.1f,
+ /* double lower_hr_threshold = */ 0.91,
+ /* double increment = */ 2.1,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024 + 1),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
- /* double upper_hr_threshold = */ 0.998f,
- /* double decrement = */ 0.91f,
+ /* double upper_hr_threshold = */ 0.998,
+ /* double decrement = */ 0.91,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024 - 1),
/* int epochs_before_eviction = */ 4,
@@ -559,27 +559,27 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (512 * 1024),
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ (8 * 1024 * 1024),
/* size_t min_size = */ (512 * 1024),
/* long int epoch_length = */ 25000,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.9f,
- /* double increment = */ 2.0f,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (2 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 1.5f,
- /* double flash_threshold = */ 0.4f,
+ /* double flash_multiple = */ 1.5,
+ /* double flash_threshold = */ 0.4,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
- /* double upper_hr_threshold = */ 0.9995f,
- /* double decrement = */ 0.95f,
+ /* double upper_hr_threshold = */ 0.9995,
+ /* double decrement = */ 0.95,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (512 * 1024),
/* int epochs_before_eviction = */ 4,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f,
+ /* double empty_reserve = */ 0.05,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -592,27 +592,27 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.2f,
+ /* double min_clean_fraction = */ 0.2,
/* size_t max_size = */ (16 * 1024 * 1024),
/* size_t min_size = */ (1 * 1024 * 1024),
/* long int epoch_length = */ 50000,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off,
- /* double lower_hr_threshold = */ 0.90f,
- /* double increment = */ 2.0f,
+ /* double lower_hr_threshold = */ 0.90,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.1f,
- /* double flash_threshold = */ 0.6f,
+ /* double flash_multiple = */ 2.1,
+ /* double flash_threshold = */ 0.6,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ FALSE,
/* size_t max_decrement = */ (1 * 1024 * 1024 - 1),
/* int epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ FALSE,
- /* double empty_reserve = */ 0.05f,
+ /* double empty_reserve = */ 0.05,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -625,28 +625,28 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.15f,
+ /* double min_clean_fraction = */ 0.15,
/* size_t max_size = */ (20 * 1024 * 1024),
/* size_t min_size = */ (1 * 1024 * 1024),
/* long int epoch_length = */ 75000,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
- /* double lower_hr_threshold = */ 0.9f,
- /* double increment = */ 2.0f,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (2 * 1024 * 1024),
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 1.1f,
- /* double flash_threshold = */ 0.3f,
+ /* double flash_multiple = */ 1.1,
+ /* double flash_threshold = */ 0.3,
/* enum H5C_cache_decr_mode decr_mode = */
H5C_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ TRUE,
/* size_t max_decrement = */ (1 * 1024 * 1024),
/* int epochs_before_eviction = */ 3,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1f,
+ /* double empty_reserve = */ 0.1,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -755,7 +755,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
pass = FALSE;
failure_mssg = "H5Fget_mdc_hit_rate() failed 1.\n";
}
- else if (!H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f)) {
+ else if (!H5_DBL_ABS_EQUAL(hit_rate, 0.0)) {
pass = FALSE;
failure_mssg = "H5Fget_mdc_hit_rate() returned unexpected hit rate.\n";
@@ -821,7 +821,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return pass;
@@ -857,7 +857,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
hbool_t valid_chunk;
hbool_t dump_hit_rate = FALSE;
int64_t min_accesses = 1000;
- double min_hit_rate = 0.90f;
+ double min_hit_rate = 0.90;
hbool_t dump_cache_size = FALSE;
hid_t file_id = -1;
hid_t dataspace_id = -1;
@@ -883,27 +883,27 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ 500000,
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ 16000000,
/* size_t min_size = */ 250000,
/* long int epoch_length = */ 50000,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off,
- /* double lower_hr_threshold = */ 0.95f,
- /* double increment = */ 2.0f,
+ /* double lower_hr_threshold = */ 0.95,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ FALSE,
/* size_t max_increment = */ 4000000,
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ FALSE,
/* size_t max_decrement = */ 1000000,
/* int epochs_before_eviction = */ 2,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f,
+ /* double empty_reserve = */ 0.05,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -916,27 +916,27 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ 12000000,
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ 16000000,
/* size_t min_size = */ 250000,
/* long int epoch_length = */ 50000,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off,
- /* double lower_hr_threshold = */ 0.95f,
- /* double increment = */ 2.0f,
+ /* double lower_hr_threshold = */ 0.95,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ FALSE,
/* size_t max_increment = */ 4000000,
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ FALSE,
/* size_t max_decrement = */ 1000000,
/* int epochs_before_eviction = */ 2,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f,
+ /* double empty_reserve = */ 0.05,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -949,27 +949,27 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* hbool_t evictions_enabled = */ TRUE,
/* hbool_t set_initial_size = */ TRUE,
/* size_t initial_size = */ 2000000,
- /* double min_clean_fraction = */ 0.1f,
+ /* double min_clean_fraction = */ 0.1,
/* size_t max_size = */ 16000000,
/* size_t min_size = */ 250000,
/* long int epoch_length = */ 50000,
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__off,
- /* double lower_hr_threshold = */ 0.95f,
- /* double increment = */ 2.0f,
+ /* double lower_hr_threshold = */ 0.95,
+ /* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ FALSE,
/* size_t max_increment = */ 4000000,
/* enum H5C_cache_flash_incr_mode */
/* flash_incr_mode = */ H5C_flash_incr__off,
- /* double flash_multiple = */ 2.0f,
- /* double flash_threshold = */ 0.5f,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
- /* double upper_hr_threshold = */ 0.999f,
- /* double decrement = */ 0.9f,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
/* hbool_t apply_max_decrement = */ FALSE,
/* size_t max_decrement = */ 1000000,
/* int epochs_before_eviction = */ 2,
/* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05f,
+ /* double empty_reserve = */ 0.05,
/* int dirty_bytes_threshold = */ (256 * 1024),
/* int metadata_write_strategy = */
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -1463,7 +1463,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return pass;
@@ -1517,26 +1517,26 @@ init_invalid_configs(void)
configs[i].evictions_enabled = TRUE;
configs[i].set_initial_size = TRUE;
configs[i].initial_size = (1 * 1024 * 1024);
- configs[i].min_clean_fraction = 0.25F;
+ configs[i].min_clean_fraction = 0.25;
configs[i].max_size = (16 * 1024 * 1024);
configs[i].min_size = (1 * 1024 * 1024);
configs[i].epoch_length = 50000;
configs[i].incr_mode = H5C_incr__threshold;
- configs[i].lower_hr_threshold = 0.9F;
- configs[i].increment = 2.0F;
+ configs[i].lower_hr_threshold = 0.9;
+ configs[i].increment = 2.0;
configs[i].apply_max_increment = TRUE;
configs[i].max_increment = (4 * 1024 * 1024);
configs[i].flash_incr_mode = H5C_flash_incr__off;
- configs[i].flash_multiple = 2.0F;
- configs[i].flash_threshold = 0.5F;
+ configs[i].flash_multiple = 2.0;
+ configs[i].flash_threshold = 0.5;
configs[i].decr_mode = H5C_decr__age_out_with_threshold;
- configs[i].upper_hr_threshold = 0.999F;
- configs[i].decrement = 0.9F;
+ configs[i].upper_hr_threshold = 0.999;
+ configs[i].decrement = 0.9;
configs[i].apply_max_decrement = TRUE;
configs[i].max_decrement = (1 * 1024 * 1024);
configs[i].epochs_before_eviction = 3;
configs[i].apply_empty_reserve = TRUE;
- configs[i].empty_reserve = 0.1F;
+ configs[i].empty_reserve = 0.1;
configs[i].dirty_bytes_threshold = (256 * 1024);
configs[i].metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
}
@@ -1567,10 +1567,10 @@ init_invalid_configs(void)
configs[6].initial_size = (1 * 1024 * 1024 - 1);
/* 7 -- min_clean_fraction too big */
- configs[7].min_clean_fraction = 1.000001f;
+ configs[7].min_clean_fraction = 1.000001;
/* 8 -- min_clean_fraction too small */
- configs[8].min_clean_fraction = -0.00000001f;
+ configs[8].min_clean_fraction = -0.00000001;
/* 9 -- epoch_length too small */
configs[9].epoch_length = H5C__MIN_AR_EPOCH_LENGTH - 1;
@@ -1582,10 +1582,10 @@ init_invalid_configs(void)
configs[11].incr_mode = (enum H5C_cache_incr_mode) - 1;
/* 12 -- lower_hr_threshold too small */
- configs[12].lower_hr_threshold = -0.000001f;
+ configs[12].lower_hr_threshold = -0.000001;
/* 13 -- lower_hr_threshold too big */
- configs[13].lower_hr_threshold = 1.00000001f;
+ configs[13].lower_hr_threshold = 1.00000001;
/* 14 -- increment too small */
configs[14].increment = 0.999999999999;
@@ -1595,29 +1595,29 @@ init_invalid_configs(void)
/* 16 -- flash_multiple too small */
configs[16].flash_incr_mode = H5C_flash_incr__add_space;
- configs[16].flash_multiple = 0.09f;
+ configs[16].flash_multiple = 0.09;
/* 17 -- flash_multiple too big */
configs[17].flash_incr_mode = H5C_flash_incr__add_space;
- configs[17].flash_multiple = 10.001f;
+ configs[17].flash_multiple = 10.001;
/* 18 -- flash_threshold too small */
configs[18].flash_incr_mode = H5C_flash_incr__add_space;
- configs[18].flash_threshold = 0.099f;
+ configs[18].flash_threshold = 0.099;
/* 19 -- flash_threshold too big */
configs[19].flash_incr_mode = H5C_flash_incr__add_space;
- configs[19].flash_threshold = 1.001f;
+ configs[19].flash_threshold = 1.001;
/* 20 -- bad decr_mode */
configs[20].decr_mode = (enum H5C_cache_decr_mode) - 1;
/* 21 -- upper_hr_threshold too big */
- configs[21].upper_hr_threshold = 1.00001f;
+ configs[21].upper_hr_threshold = 1.00001;
/* 22 -- decrement too small */
configs[22].decr_mode = H5C_decr__threshold;
- configs[22].decrement = -0.0000000001f;
+ configs[22].decrement = -0.0000000001;
/* 23 -- decrement too big */
configs[23].decr_mode = H5C_decr__threshold;
@@ -1630,20 +1630,20 @@ init_invalid_configs(void)
configs[25].epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1;
/* 26 -- empty_reserve too small */
- configs[26].empty_reserve = -0.0000000001f;
+ configs[26].empty_reserve = -0.0000000001;
/* 27 -- empty_reserve too big */
configs[27].empty_reserve = 1.00000000001;
/* 28 -- upper_hr_threshold too small */
- configs[28].upper_hr_threshold = -0.000000001f;
+ configs[28].upper_hr_threshold = -0.000000001;
/* 29 -- upper_hr_threshold too big */
configs[29].upper_hr_threshold = 1.00000001;
/* 30 -- upper_hr_threshold <= lower_hr_threshold */
- configs[30].lower_hr_threshold = 0.9f;
- configs[30].upper_hr_threshold = 0.9f;
+ configs[30].lower_hr_threshold = 0.9;
+ configs[30].upper_hr_threshold = 0.9;
/* 31 -- dirty_bytes_threshold too small */
configs[31].dirty_bytes_threshold = (H5C__MIN_MAX_CACHE_SIZE / 2) - 1;
@@ -1699,7 +1699,10 @@ check_fapl_mdc_api_errs(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
if (pass) {
- H5E_BEGIN_TRY { result = H5Pget_mdc_config((hid_t)-1, &scratch); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Pget_mdc_config((hid_t)-1, &scratch);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1734,7 +1737,10 @@ check_fapl_mdc_api_errs(void)
if (pass) {
- H5E_BEGIN_TRY { result = H5Pget_mdc_config(fapl_id, NULL); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Pget_mdc_config(fapl_id, NULL);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1749,7 +1755,10 @@ check_fapl_mdc_api_errs(void)
scratch.version = -1; /* a convenient, invalid value */
if (pass) {
- H5E_BEGIN_TRY { result = H5Pget_mdc_config(fapl_id, &scratch); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Pget_mdc_config(fapl_id, &scratch);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1765,7 +1774,10 @@ check_fapl_mdc_api_errs(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
if (pass) {
- H5E_BEGIN_TRY { result = H5Pset_mdc_config((hid_t)-1, &default_config); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Pset_mdc_config((hid_t)-1, &default_config);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1777,7 +1789,10 @@ check_fapl_mdc_api_errs(void)
if (pass) {
- H5E_BEGIN_TRY { result = H5Pset_mdc_config(fapl_id, NULL); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Pset_mdc_config(fapl_id, NULL);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1789,7 +1804,10 @@ check_fapl_mdc_api_errs(void)
i = 0;
while ((pass) && (i < NUM_INVALID_CONFIGS)) {
- H5E_BEGIN_TRY { result = H5Pset_mdc_config(fapl_id, &(invalid_configs[i])); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Pset_mdc_config(fapl_id, &(invalid_configs[i]));
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1823,7 +1841,7 @@ check_fapl_mdc_api_errs(void)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return pass;
@@ -1876,7 +1894,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC);
+ HDfprintf(stdout, "%s: calling h5_fixname().\n", __func__);
}
if (h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL) {
@@ -1890,7 +1908,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: calling H5Fcreate().\n", FUNC);
+ HDfprintf(stdout, "%s: calling H5Fcreate().\n", __func__);
}
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
@@ -1911,10 +1929,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Fget_mdc_config((hid_t)-1, &scratch); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fget_mdc_config((hid_t)-1, &scratch);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1928,10 +1949,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Fget_mdc_config(file_id, NULL); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fget_mdc_config(file_id, NULL);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1946,10 +1970,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Fget_mdc_config(file_id, &scratch); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fget_mdc_config(file_id, &scratch);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1966,10 +1993,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Fset_mdc_config((hid_t)-1, &default_config); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fset_mdc_config((hid_t)-1, &default_config);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -1983,10 +2013,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Fset_mdc_config(file_id, NULL); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fset_mdc_config(file_id, NULL);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -2000,10 +2033,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
while ((pass) && (i < NUM_INVALID_CONFIGS)) {
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", FUNC, i);
+ HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", __func__, i);
}
- H5E_BEGIN_TRY { result = H5Fset_mdc_config(file_id, &(invalid_configs[i])); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fset_mdc_config(file_id, &(invalid_configs[i]));
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -2025,10 +2061,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Fget_mdc_hit_rate((hid_t)-1, &hit_rate); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fget_mdc_hit_rate((hid_t)-1, &hit_rate);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -2042,10 +2081,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Fget_mdc_hit_rate(file_id, NULL); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Fget_mdc_hit_rate(file_id, NULL);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -2060,10 +2102,13 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", __func__);
}
- H5E_BEGIN_TRY { result = H5Freset_mdc_hit_rate_stats((hid_t)-1); }
+ H5E_BEGIN_TRY
+ {
+ result = H5Freset_mdc_hit_rate_stats((hid_t)-1);
+ }
H5E_END_TRY;
if (result >= 0) {
@@ -2078,7 +2123,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", __func__);
}
H5E_BEGIN_TRY
@@ -2098,7 +2143,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", FUNC);
+ HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", __func__);
}
if ((H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0) ||
@@ -2117,7 +2162,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (show_progress) {
- HDfprintf(stdout, "%s: cleaning up from tests.\n", FUNC);
+ HDfprintf(stdout, "%s: cleaning up from tests.\n", __func__);
}
if (H5Fclose(file_id) < 0) {
@@ -2143,7 +2188,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
if (!pass) {
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
}
return pass;
@@ -2185,26 +2230,26 @@ main(void)
invalid_configs = init_invalid_configs();
if (NULL == invalid_configs) {
failure_mssg = "Unable to allocate memory for invalid configs.";
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return EXIT_FAILURE;
} /* end if */
if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) {
failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n";
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return EXIT_FAILURE;
} /* end if */
/* Set file space strategy to default or paged aggregation strategy */
if ((fcpl2_id = H5Pcopy(fcpl_id)) < 0) {
failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n";
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return EXIT_FAILURE;
} /* end if */
if (H5Pset_file_space_strategy(fcpl2_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) < 0) {
failure_mssg = "H5Pset_file_space_strategy() failed.\n";
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return EXIT_FAILURE;
} /* end if */
@@ -2237,7 +2282,7 @@ main(void)
if (H5Pclose(fcpl_id) < 0) {
failure_mssg = "H5Pclose() failed.\n";
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return EXIT_FAILURE;
} /* end if */
diff --git a/test/cache_common.c b/test/cache_common.c
index 0d6136e..2d88e05 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -434,8 +434,6 @@ addr_to_type_and_index(haddr_t addr, int32_t *type_ptr, int32_t *index_ptr)
*type_ptr = type;
*index_ptr = idx;
- return;
-
} /* addr_to_type_and_index() */
/* Call back functions: */
@@ -1489,12 +1487,6 @@ add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hb
HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES));
HDassert((0 <= idx) && (idx <= max_indices[type]));
HDassert(new_size <= VARIABLE_ENTRY_SIZE);
-#ifndef H5_HAVE_STDBOOL_H
- /* Check for TRUE or FALSE if we're using an integer type instead
- * of a real Boolean type.
- */
- HDassert((flag == TRUE) || (flag == FALSE));
-#endif /* H5_HAVE_STDBOOL_H */
if (pass) {
@@ -1515,8 +1507,6 @@ add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hb
(target_entry_ptr->flush_ops)[i].order_ptr = order_ptr;
}
- return;
-
} /* add_flush_op() */
/*-------------------------------------------------------------------------
@@ -1586,8 +1576,6 @@ create_pinned_entry_dependency(H5F_t *file_ptr, int pinning_type, int pinning_id
(pinned_entry_ptr->pinning_ref_count)++;
}
- return;
-
} /* create_pinned_entry_dependency() */
/*-------------------------------------------------------------------------
@@ -1660,8 +1648,6 @@ dirty_entry(H5F_t *file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin)
}
}
- return;
-
} /* dirty_entry() */
/*-------------------------------------------------------------------------
@@ -1691,7 +1677,7 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o
HDassert(cache_ptr != NULL);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(entry_ptr != NULL);
- HDassert(entry_ptr = entry_ptr->self);
+ HDassert(entry_ptr == entry_ptr->self);
HDassert(entry_ptr->header.addr == entry_ptr->addr);
HDassert((entry_ptr->flush_op_self_resize_in_progress) || (entry_ptr->header.size == entry_ptr->size));
HDassert(op_ptr != NULL);
@@ -1700,12 +1686,6 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o
HDassert((0 <= op_ptr->type) && (op_ptr->type < NUMBER_OF_ENTRY_TYPES));
HDassert((0 <= op_ptr->idx) && (op_ptr->idx <= max_indices[op_ptr->type]));
HDassert(flags_ptr != NULL);
-#ifndef H5_HAVE_STDBOOL_H
- /* Check for TRUE or FALSE if we're using an integer type instead
- * of a real Boolean type.
- */
- HDassert((op_ptr->flag == FALSE) || (op_ptr->flag == TRUE));
-#endif /* H5_HAVE_STDBOOL_H */
if (pass) {
@@ -1805,8 +1785,6 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o
}
}
- return;
-
} /* execute_flush_op() */
/*-------------------------------------------------------------------------
@@ -2032,8 +2010,6 @@ free_entry_arrays(void)
HDfree(notify_entries);
HDfree(orig_notify_entries);
- return;
-
} /* free_entry_arrays() */
/*-------------------------------------------------------------------------
@@ -2177,8 +2153,6 @@ reset_entries(void)
} /* end for */
} /* end else */
- return;
-
} /* reset_entries() */
/*-------------------------------------------------------------------------
@@ -2257,7 +2231,7 @@ resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_
}
else {
- HDassert(entry_ptr->size = (entry_ptr->header).size);
+ HDassert(entry_ptr->size == (entry_ptr->header).size);
}
}
}
@@ -2270,8 +2244,6 @@ resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_
}
}
- return;
-
} /* resize_entry() */
/*-------------------------------------------------------------------------
@@ -2323,8 +2295,6 @@ verify_clean(void)
}
}
- return;
-
} /* verify_clean() */
/*-------------------------------------------------------------------------
@@ -2621,8 +2591,6 @@ verify_entry_status(H5C_t *cache_ptr, int tag, int num_entries, struct expected_
i++;
} /* while */
- return;
-
} /* verify_entry_status() */
/*-------------------------------------------------------------------------
@@ -2676,8 +2644,6 @@ verify_unprotected(void)
}
}
- return;
-
} /* verify_unprotected() */
/*-------------------------------------------------------------------------
@@ -2741,8 +2707,6 @@ expunge_entry(H5F_t *file_ptr, int32_t type, int32_t idx)
}
}
- return;
-
} /* expunge_entry() */
/*-------------------------------------------------------------------------
@@ -2781,7 +2745,6 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_
if (pass) {
H5C_t *cache_ptr;
- herr_t result = 0;
HDassert(file_ptr);
@@ -2807,7 +2770,7 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_
if (verbose) {
- HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", FUNC,
+ HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", __func__,
(long long)(cache_ptr->index_len), (long long)(cache_ptr->index_size),
(long long)(cache_ptr->clean_index_size), (long long)(cache_ptr->dirty_index_size));
}
@@ -2816,8 +2779,6 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_
}
}
- return;
-
} /* flush_cache() */
/*-------------------------------------------------------------------------
@@ -2985,8 +2946,6 @@ insert_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags)
HDassert(((entry_ptr->header).type)->id == type);
} /* end if */
- return;
-
} /* insert_entry() */
/*-------------------------------------------------------------------------
@@ -3046,8 +3005,6 @@ mark_entry_dirty(int32_t type, int32_t idx)
HDassert(((entry_ptr->header).type)->id == type);
}
- return;
-
} /* mark_entry_dirty() */
/*-------------------------------------------------------------------------
@@ -3146,8 +3103,6 @@ move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr)
HDassert(entry_ptr->is_dirty);
}
- return;
-
} /* move_entry() */
/*-------------------------------------------------------------------------
@@ -3314,8 +3269,6 @@ protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx)
HDassert(((entry_ptr->header).type)->id == type);
}
- return;
-
} /* protect_entry_ro() */
/*-------------------------------------------------------------------------
@@ -3372,8 +3325,6 @@ pin_entry(int32_t type, int32_t idx)
}
} /* end if */
- return;
-
} /* pin_entry() */
/*-------------------------------------------------------------------------
@@ -3431,8 +3382,6 @@ unpin_entry(int32_t type, int32_t idx)
HDassert(((entry_ptr->header).type)->id == type);
}
- return;
-
} /* unpin_entry() */
/*-------------------------------------------------------------------------
@@ -3542,8 +3491,6 @@ unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags)
HDassert(entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count);
}
- return;
-
} /* unprotect_entry() */
/*-------------------------------------------------------------------------
@@ -3577,7 +3524,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
int32_t local_max_index;
if (verbose)
- HDfprintf(stdout, "%s(): entering.\n", FUNC);
+ HDfprintf(stdout, "%s(): entering.\n", __func__);
if (pass) {
cache_ptr = file_ptr->shared->cache;
@@ -3909,7 +3856,7 @@ hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h
int32_t local_max_index;
if (verbose)
- HDfprintf(stdout, "%s(): entering.\n", FUNC);
+ HDfprintf(stdout, "%s(): entering.\n", __func__);
if (pass) {
@@ -3972,8 +3919,6 @@ hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h
H5C_stats(cache_ptr, "test cache", display_detailed_stats);
}
- return;
-
} /* hl_row_major_scan_forward() */
/*-------------------------------------------------------------------------
@@ -4003,7 +3948,7 @@ row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
int32_t local_max_index;
if (verbose)
- HDfprintf(stdout, "%s(): Entering.\n", FUNC);
+ HDfprintf(stdout, "%s(): Entering.\n", __func__);
if (pass) {
@@ -4234,8 +4179,6 @@ row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
H5C_stats(cache_ptr, "test cache", display_detailed_stats);
}
- return;
-
} /* row_major_scan_backward() */
/*-------------------------------------------------------------------------
@@ -4265,7 +4208,7 @@ hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose,
int32_t local_max_index;
if (verbose)
- HDfprintf(stdout, "%s(): entering.\n", FUNC);
+ HDfprintf(stdout, "%s(): entering.\n", __func__);
if (pass) {
@@ -4328,8 +4271,6 @@ hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose,
H5C_stats(cache_ptr, "test cache", display_detailed_stats);
}
- return;
-
} /* hl_row_major_scan_backward() */
/*-------------------------------------------------------------------------
@@ -4358,7 +4299,7 @@ col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
int32_t local_max_index[NUMBER_OF_ENTRY_TYPES];
if (verbose)
- HDfprintf(stdout, "%s: entering.\n", FUNC);
+ HDfprintf(stdout, "%s: entering.\n", __func__);
if (pass) {
int i;
@@ -4422,8 +4363,6 @@ col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
H5C_stats(cache_ptr, "test cache", display_detailed_stats);
}
- return;
-
} /* col_major_scan_forward() */
/*-------------------------------------------------------------------------
@@ -4454,7 +4393,7 @@ hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h
int32_t local_max_index;
if (verbose)
- HDfprintf(stdout, "%s: entering.\n", FUNC);
+ HDfprintf(stdout, "%s: entering.\n", __func__);
if (pass) {
@@ -4527,8 +4466,6 @@ hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h
H5C_stats(cache_ptr, "test cache", display_detailed_stats);
}
- return;
-
} /* hl_col_major_scan_forward() */
/*-------------------------------------------------------------------------
@@ -4555,10 +4492,10 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
int mile_stone = 1;
int32_t type;
int32_t idx;
- int32_t local_max_index[NUMBER_OF_ENTRY_TYPES];
+ int32_t local_max_index[NUMBER_OF_ENTRY_TYPES] = {0};
if (verbose)
- HDfprintf(stdout, "%s: entering.\n", FUNC);
+ HDfprintf(stdout, "%s: entering.\n", __func__);
if (pass) {
int i;
@@ -4581,7 +4518,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
idx = local_max_index[NUMBER_OF_ENTRY_TYPES - 1] + lag;
if (verbose) /* 1 */
- HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++);
+ HDfprintf(stdout, "%s: point %d.\n", __func__, mile_stone++);
while ((pass) && ((idx + lag) >= 0)) {
type = NUMBER_OF_ENTRY_TYPES - 1;
@@ -4623,7 +4560,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
}
if (verbose) /* 2 */
- HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++);
+ HDfprintf(stdout, "%s: point %d.\n", __func__, mile_stone++);
if ((pass) && (display_stats)) {
@@ -4631,9 +4568,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t
}
if (verbose)
- HDfprintf(stdout, "%s: exiting.\n", FUNC);
-
- return;
+ HDfprintf(stdout, "%s: exiting.\n", __func__);
} /* col_major_scan_backward() */
@@ -4665,7 +4600,7 @@ hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose,
int32_t local_max_index = -1;
if (verbose)
- HDfprintf(stdout, "%s: entering.\n", FUNC);
+ HDfprintf(stdout, "%s: entering.\n", __func__);
if (pass) {
@@ -4738,8 +4673,6 @@ hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose,
H5C_stats(cache_ptr, "test cache", display_detailed_stats);
}
- return;
-
} /* hl_col_major_scan_backward() */
/*-------------------------------------------------------------------------
@@ -5061,7 +4994,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d
}
else {
- expected_hit_rate = 0.0F;
+ expected_hit_rate = 0.0;
}
result = H5Fget_mdc_hit_rate(file_id, &hit_rate);
@@ -5108,8 +5041,6 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d
failure_mssg = "Unexpectedly low hit rate.";
}
- return;
-
} /* check_and_validate_cache_hit_rate() */
/*-------------------------------------------------------------------------
@@ -5227,8 +5158,6 @@ check_and_validate_cache_size(hid_t file_id, size_t *max_size_ptr, size_t *min_c
(long)min_clean_size, (long)cur_size, (long)cur_num_entries);
}
- return;
-
} /* check_and_validate_cache_size() */
H5_ATTR_PURE hbool_t
@@ -5389,8 +5318,6 @@ validate_mdc_config(hid_t file_id, H5AC_cache_config_t *ext_config_ptr, hbool_t
}
}
- return;
-
} /* validate_mdc_config() */
#if 0 /* debugging functions -- normally commented out */
diff --git a/test/cache_common.h b/test/cache_common.h
index bc9f33b..126a8b3 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -17,8 +17,8 @@
* This file contains common #defines, type definitions, and
* externs for tests of the cache implemented in H5C.c
*/
-#ifndef _CACHE_COMMON_H
-#define _CACHE_COMMON_H
+#ifndef CACHE_COMMON_H
+#define CACHE_COMMON_H
#define H5C_FRIEND /*suppress error about including H5Cpkg */
#define H5F_FRIEND /*suppress error about including H5Fpkg */
@@ -694,4 +694,4 @@ H5TEST_DLL void dump_LRU(H5F_t * file_ptr);
}
#endif
-#endif /* _CACHE_COMMON_H */
+#endif /* CACHE_COMMON_H */
diff --git a/test/cache_image.c b/test/cache_image.c
index ecb8c05..4967066 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -387,8 +387,6 @@ create_datasets(hid_t file_id, int min_dset, int max_dset)
}
}
- return;
-
} /* create_datasets() */
/*-------------------------------------------------------------------------
@@ -460,8 +458,6 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset)
if (show_progress)
HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++);
- return;
-
} /* delete_datasets() */
/*-------------------------------------------------------------------------
@@ -850,8 +846,6 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, hbool_t read_onl
if (show_progress)
HDfprintf(stdout, "%s: cp = %d -- exiting.\n", fcn_name, cp++);
- return;
-
} /* open_hdf5_file() */
/*-------------------------------------------------------------------------
@@ -946,7 +940,10 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, const hbool_t set_mdci_fa
}
else {
- H5E_BEGIN_TRY { file_id = H5Fopen(hdf_file_name, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(hdf_file_name, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl_id);
+ }
H5E_END_TRY;
}
@@ -960,8 +957,6 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file, const hbool_t set_mdci_fa
if (show_progress)
HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++);
- return;
-
} /* attempt_swmr_open_hdf5_file() */
/*-------------------------------------------------------------------------
@@ -1199,8 +1194,6 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
}
}
- return;
-
} /* verify_datasets() */
/****************************************************************************/
@@ -1480,7 +1473,7 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -1726,7 +1719,7 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -2100,7 +2093,7 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -2436,7 +2429,7 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -2725,7 +2718,7 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -2976,7 +2969,7 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -3425,7 +3418,7 @@ cache_image_smoke_check_1(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -3701,7 +3694,7 @@ cache_image_smoke_check_2(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -4089,7 +4082,7 @@ cache_image_smoke_check_3(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -4468,7 +4461,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
} /* cache_image_smoke_check_4() */
@@ -4972,7 +4965,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -5389,7 +5382,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -5745,7 +5738,7 @@ cache_image_api_error_check_1(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -6173,7 +6166,7 @@ cache_image_api_error_check_2(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -6428,7 +6421,7 @@ cache_image_api_error_check_3(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -6985,7 +6978,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -7443,7 +7436,7 @@ get_free_sections_test(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
@@ -7816,7 +7809,7 @@ evict_on_close_test(hbool_t single_file_vfd)
}
if (!pass)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg);
return !pass;
#endif /* H5_HAVE_PARALLEL */
@@ -7860,8 +7853,8 @@ main(void)
HDprintf("=========================================\n");
/* Check for VFD which stores data in multiple files */
- single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"));
+ single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0);
nerrs += check_cache_image_ctl_flow_1(single_file_vfd);
nerrs += check_cache_image_ctl_flow_2(single_file_vfd);
diff --git a/test/cache_logging.c b/test/cache_logging.c
index 1ae908b..12f3d96 100644
--- a/test/cache_logging.c
+++ b/test/cache_logging.c
@@ -16,7 +16,8 @@
#include "h5test.h"
#define LOG_LOCATION "cache_logging.out"
-#define FILE_NAME "cache_logging"
+
+const char *FILENAME[] = {"cache_logging", NULL};
#define N_GROUPS 100
@@ -50,7 +51,7 @@ test_logging_api(void)
TESTING("metadata cache log api calls");
fapl = h5_fileaccess();
- h5_fixname(FILE_NAME, fapl, filename, sizeof filename);
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
/* Set up metadata cache logging */
is_enabled = TRUE;
@@ -58,6 +59,12 @@ test_logging_api(void)
if (H5Pset_mdc_log_options(fapl, is_enabled, LOG_LOCATION, start_on_access) < 0)
TEST_ERROR;
+ /* Ensure that setting the property twice doesn't cause problems
+ * (addresses a previous bug).
+ */
+ if (H5Pset_mdc_log_options(fapl, is_enabled, LOG_LOCATION, start_on_access) < 0)
+ TEST_ERROR;
+
/* Check to make sure that the property list getter returns the correct
* location string buffer size;
*/
@@ -76,7 +83,7 @@ test_logging_api(void)
if (H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size, &start_on_access_out) < 0)
TEST_ERROR;
if ((is_enabled != is_enabled_out) || (start_on_access != start_on_access_out) ||
- HDstrcmp(LOG_LOCATION, location))
+ HDstrcmp(LOG_LOCATION, location) != 0)
TEST_ERROR;
/* Create a file */
@@ -84,8 +91,6 @@ test_logging_api(void)
TEST_ERROR;
if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if (H5Pclose(fapl) < 0)
- TEST_ERROR;
/* Check to see if the logging flags were set correctly */
is_enabled = FALSE;
@@ -127,10 +132,19 @@ test_logging_api(void)
if (H5Fclose(fid) < 0)
TEST_ERROR;
+ HDremove(LOG_LOCATION);
+ h5_clean_files(FILENAME, fapl);
+
PASSED();
return 0;
error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
+ H5E_END_TRY
+
return 1;
} /* test_logging_api() */
diff --git a/test/chunk_info.c b/test/chunk_info.c
index 0298db4..a1c4160 100644
--- a/test/chunk_info.c
+++ b/test/chunk_info.c
@@ -127,7 +127,7 @@ void reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size);
static int verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type,
hsize_t exp_num_chunks);
static int verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size,
- hsize_t *exp_offset, unsigned exp_flt_msk);
+ const hsize_t *exp_offset, unsigned exp_flt_msk);
static int verify_get_chunk_info_by_coord(hid_t dset, hsize_t *offset, hsize_t exp_chk_size,
unsigned exp_flt_msk);
static int verify_empty_chunk_info(hid_t dset, hsize_t *offset);
@@ -169,8 +169,8 @@ reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size)
*-------------------------------------------------------------------------
*/
static int
-verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, hsize_t *exp_offset,
- unsigned exp_flt_msk)
+verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size,
+ const hsize_t *exp_offset, unsigned exp_flt_msk)
{
unsigned read_flt_msk = 0; /* Read filter mask */
hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */
@@ -302,7 +302,7 @@ index_type_str(H5D_chunk_index_t idx_type)
*-------------------------------------------------------------------------
*/
static int
-verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end)
+verify_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end)
{
int read_buf[CHUNK_NX][CHUNK_NY];
int expected_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Expected data */
@@ -364,7 +364,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-write_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end, unsigned flt_msk)
+write_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end, unsigned flt_msk)
{
int direct_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Data in chunks */
hsize_t offset[2]; /* Offset coordinates of a chunk */
@@ -449,7 +449,7 @@ error:
* Return: Success: SUCCEED
* Failure: FAIL
*
- * Note: Note that the dataspace argument in these new functions are
+ * Note: Note that the dataspace argument in these new functions is
* currently not used. The functionality involved the dataspace
* will be implemented in the next version.
*
@@ -482,14 +482,14 @@ test_get_chunk_info_highest_v18(hid_t fapl)
unsigned flt_msk = 0; /* Filter mask */
unsigned read_flt_msk = 0; /* Filter mask after direct read */
int fillvalue = -1; /* Fill value */
- int aggression = 9; /* Compression aggression setting */
hsize_t offset[2] = {0, 0}; /* Offset coordinates of a chunk */
#ifdef H5_HAVE_FILTER_DEFLATE
- const Bytef *z_src = (const Bytef *)(direct_buf);
- Bytef * z_dst; /*destination buffer */
+ int aggression = 9; /* Compression aggression setting */
+ const Bytef *z_src = (const Bytef *)(direct_buf);
+ Bytef * z_dst; /* Destination buffer */
uLongf z_dst_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(CHK_SIZE);
uLong z_src_nbytes = (uLong)CHK_SIZE;
-#endif /* end H5_HAVE_FILTER_DEFLATE */
+#endif
void * inbuf = NULL; /* Pointer to new buffer */
hsize_t chunk_size = CHK_SIZE; /* Size of a chunk, can be compressed or not */
hsize_t ii, jj; /* Array indices */
@@ -544,14 +544,15 @@ test_get_chunk_info_highest_v18(hid_t fapl)
/* Allocate input (compressed) buffer */
inbuf = HDcalloc(1, z_dst_nbytes);
- /* Set chunk size to the compressed chunk size and the chunk point
- to the compressed data chunk */
- chunk_size = (hsize_t)z_dst_nbytes;
- z_dst = (Bytef *)inbuf;
+ /* zlib-friendly alias for the input buffer */
+ z_dst = (Bytef *)inbuf;
/* Perform compression from the source to the destination buffer */
ret = compress2(z_dst, &z_dst_nbytes, z_src, z_src_nbytes, aggression);
+ /* Set the chunk size to the compressed chunk size */
+ chunk_size = (hsize_t)z_dst_nbytes;
+
/* Check for various zlib errors */
if (Z_BUF_ERROR == ret) {
HDfprintf(stderr, "overflow");
@@ -567,7 +568,8 @@ test_get_chunk_info_highest_v18(hid_t fapl)
}
#else
/* Allocate input (non-compressed) buffer */
- inbuf = HDcalloc(1, CHK_SIZE);
+ if (NULL == (inbuf = HDcalloc(1, CHK_SIZE)))
+ TEST_ERROR
HDmemcpy(inbuf, direct_buf, CHK_SIZE);
#endif /* end H5_HAVE_FILTER_DEFLATE */
@@ -1482,6 +1484,53 @@ error:
return FAIL;
} /* test_chunk_info_version2_btrees() */
+typedef struct chunk_iter_info_t {
+ hsize_t offset[2];
+ uint32_t filter_mask;
+ haddr_t addr;
+ uint32_t nbytes;
+} chunk_iter_info_t;
+
+typedef struct chunk_iter_udata_t {
+ chunk_iter_info_t *chunk_info;
+ int last_index;
+} chunk_iter_udata_t;
+
+static int
+iter_cb(const hsize_t *offset, uint32_t filter_mask, haddr_t addr, uint32_t nbytes, void *op_data)
+{
+ chunk_iter_udata_t *cidata = (chunk_iter_udata_t *)op_data;
+ int idx = cidata->last_index + 1;
+
+ cidata->chunk_info[idx].offset[0] = offset[0];
+ cidata->chunk_info[idx].offset[1] = offset[1];
+ cidata->chunk_info[idx].filter_mask = filter_mask;
+ cidata->chunk_info[idx].addr = addr;
+ cidata->chunk_info[idx].nbytes = nbytes;
+
+ cidata->last_index++;
+
+ return H5_ITER_CONT;
+}
+
+static int
+iter_cb_stop(const hsize_t H5_ATTR_UNUSED *offset, uint32_t H5_ATTR_UNUSED filter_mask,
+ haddr_t H5_ATTR_UNUSED addr, uint32_t H5_ATTR_UNUSED nbytes, void *op_data)
+{
+ chunk_iter_info_t **chunk_info = (chunk_iter_info_t **)op_data;
+ *chunk_info += 1;
+ return H5_ITER_STOP;
+}
+
+static int
+iter_cb_fail(const hsize_t H5_ATTR_UNUSED *offset, uint32_t H5_ATTR_UNUSED filter_mask,
+ haddr_t H5_ATTR_UNUSED addr, uint32_t H5_ATTR_UNUSED nbytes, void *op_data)
+{
+ chunk_iter_info_t **chunk_info = (chunk_iter_info_t **)op_data;
+ *chunk_info += 1;
+ return H5_ITER_ERROR;
+}
+
/*-------------------------------------------------------------------------
* Function: test_basic_query
*
@@ -1502,24 +1551,27 @@ error:
static herr_t
test_basic_query(hid_t fapl)
{
- char filename[FILENAME_BUF_SIZE]; /* File name */
- hid_t basicfile = H5I_INVALID_HID; /* File ID */
- hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */
- hid_t dset = H5I_INVALID_HID; /* Dataset ID */
- hid_t cparms = H5I_INVALID_HID; /* Creation plist */
- hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */
- hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */
- int direct_buf[CHUNK_NX][CHUNK_NY]; /* Data in chunks */
- unsigned flt_msk = 0; /* Filter mask */
- unsigned read_flt_msk = 0; /* Filter mask after direct read */
- hsize_t offset[2]; /* Offset coordinates of a chunk */
- hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */
- hsize_t size = 0; /* Size of an allocated/written chunk */
- hsize_t nchunks = 0; /* Number of chunks */
- haddr_t addr = 0; /* Address of an allocated/written chunk */
- hsize_t chk_index = 0; /* Index of a chunk */
- hsize_t ii, jj; /* Array indices */
- herr_t ret; /* Temporary returned value for verifying failure */
+ char filename[FILENAME_BUF_SIZE]; /* File name */
+ hid_t basicfile = H5I_INVALID_HID; /* File ID */
+ hid_t dspace = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t dset = H5I_INVALID_HID; /* Dataset ID */
+ hid_t cparms = H5I_INVALID_HID; /* Creation plist */
+ hsize_t dims[2] = {NX, NY}; /* Dataset dimensions */
+ hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY}; /* Chunk dimensions */
+ int direct_buf[CHUNK_NX][CHUNK_NY]; /* Data in chunks */
+ unsigned flt_msk = 0; /* Filter mask */
+ unsigned read_flt_msk = 0; /* Filter mask after direct read */
+ hsize_t offset[2]; /* Offset coordinates of a chunk */
+ hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */
+ hsize_t size = 0; /* Size of an allocated/written chunk */
+ hsize_t nchunks = 0; /* Number of chunks */
+ haddr_t addr = 0; /* Address of an allocated/written chunk */
+ hsize_t chk_index = 0; /* Index of a chunk */
+ hsize_t ii, jj; /* Array indices */
+ chunk_iter_info_t chunk_infos[2]; /* Chunk infos filled up by iterator */
+ chunk_iter_info_t *cptr; /* Pointer to array of chunks */
+ chunk_iter_udata_t udata; /* udata for iteration */
+ herr_t ret; /* Temporary returned value for verifying failure */
TESTING("basic operations");
@@ -1627,6 +1679,38 @@ test_basic_query(hid_t fapl)
if (verify_empty_chunk_info(dset, offset) == FAIL)
FAIL_PUTS_ERROR("Verification of H5Dget_chunk_info_by_coord on empty chunk failed\n");
+ /* Iterate over all chunks */
+ udata.chunk_info = chunk_infos;
+ udata.last_index = -1;
+ if (H5Dchunk_iter(dset, H5P_DEFAULT, &iter_cb, &udata) < 0)
+ TEST_ERROR;
+
+ VERIFY(udata.last_index, 1, "Iterator did not iterate all chunks");
+ VERIFY(chunk_infos[0].offset[0], 0, "Offset mismatch");
+ VERIFY(chunk_infos[0].offset[1], 0, "Offset mismatch");
+ VERIFY(chunk_infos[0].filter_mask, 0, "Filter mismatch");
+ VERIFY(chunk_infos[0].nbytes, 96, "Size mismatch");
+
+ VERIFY(chunk_infos[1].offset[0], 1, "Offset mismatch");
+ VERIFY(chunk_infos[1].offset[1], 1, "Offset mismatch");
+
+ /* Iterate and stop after one iteration */
+ cptr = &(chunk_infos[0]);
+ if (H5Dchunk_iter(dset, H5P_DEFAULT, &iter_cb_stop, &cptr) < 0)
+ TEST_ERROR;
+ VERIFY(cptr, &(chunk_infos[1]), "Verification of halted iterator failed\n");
+
+ /* Iterate and fail after one iteration */
+ cptr = &(chunk_infos[0]);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dchunk_iter(dset, H5P_DEFAULT, &iter_cb_fail, &cptr);
+ }
+ H5E_END_TRY;
+ if (ret >= 0)
+ TEST_ERROR;
+ VERIFY(cptr, &(chunk_infos[1]), "Verification of halted iterator failed\n");
+
/* Release resourse */
if (H5Dclose(dset) < 0)
TEST_ERROR
@@ -1725,7 +1809,10 @@ test_failed_attempts(const char *filename, hid_t fapl)
TEST_ERROR
/* Attempt to get the number of chunks on contiguous dataset, should fail */
- H5E_BEGIN_TRY { ret = H5Dget_num_chunks(dset, dspace, &nchunks); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dget_num_chunks(dset, dspace, &nchunks);
+ }
H5E_END_TRY;
if (ret != FAIL)
FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset.")
@@ -1745,7 +1832,10 @@ test_failed_attempts(const char *filename, hid_t fapl)
* dataset, should fail */
offset[0] = 0;
offset[1] = 0;
- H5E_BEGIN_TRY { ret = H5Dget_chunk_info_by_coord(dset, offset, &read_flt_msk, &addr, &size); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dget_chunk_info_by_coord(dset, offset, &read_flt_msk, &addr, &size);
+ }
H5E_END_TRY;
if (ret != FAIL)
FAIL_PUTS_ERROR(" Attempt a chunk query function on a contiguous dataset.")
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 1008b60..8777096 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -110,8 +110,8 @@ typedef struct {
long long r, s, t;
} stype4;
-#define NX 100u
-#define NY 2000u
+#define NX 100U
+#define NY 2000U
#define PACK_NMEMBS 100
/*-------------------------------------------------------------------------
@@ -1466,6 +1466,10 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
return 0;
error:
+ HDfree(orig);
+ HDfree(rbuf);
+ HDfree(rew_buf);
+
HDputs("*** DATASET TESTS FAILED ***");
return 1;
}
@@ -2233,7 +2237,7 @@ main(int argc, char *argv[])
/* Turn off optimized compound converter? */
if (argc > 1) {
- if (argc > 2 || HDstrcmp("--noopt", argv[1])) {
+ if (argc > 2 || HDstrcmp("--noopt", argv[1]) != 0) {
HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]);
HDexit(EXIT_FAILURE);
}
diff --git a/test/cork.c b/test/cork.c
index 1b8b476..80934ad 100644
--- a/test/cork.c
+++ b/test/cork.c
@@ -1469,19 +1469,28 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Should fail to cork the attribute: aidg2; not an object */
- H5E_BEGIN_TRY { ret = H5Odisable_mdc_flushes(aidg2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Odisable_mdc_flushes(aidg2);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
/* Should fail to uncork the attribute: aidd1; not an object */
- H5E_BEGIN_TRY { ret = H5Odisable_mdc_flushes(aidd1); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Odisable_mdc_flushes(aidd1);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
/* Should fail to check cork status of the attribute: aidt2; not an object */
- H5E_BEGIN_TRY { ret = H5Oare_mdc_flushes_disabled(aidt2, &corked); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oare_mdc_flushes_disabled(aidt2, &corked);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -1511,7 +1520,10 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Should fail to uncork the file: fid2; not an object */
- H5E_BEGIN_TRY { ret = H5Oenable_mdc_flushes(fid2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oenable_mdc_flushes(fid2);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -1646,7 +1658,10 @@ test_objs_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Should fail to cork the datatype: not an object */
- H5E_BEGIN_TRY { ret = H5Odisable_mdc_flushes(tid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Odisable_mdc_flushes(tid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -1682,7 +1697,10 @@ test_objs_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Should fail to uncork the dataspace: not an object */
- H5E_BEGIN_TRY { ret = H5Oenable_mdc_flushes(sid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oenable_mdc_flushes(sid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -1696,7 +1714,10 @@ test_objs_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Should fail to check cork status of the attribute: not an object */
- H5E_BEGIN_TRY { ret = H5Oare_mdc_flushes_disabled(aid, &corked); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oare_mdc_flushes_disabled(aid, &corked);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -1736,7 +1757,10 @@ test_objs_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Should fail to cork the group again */
- H5E_BEGIN_TRY { ret = H5Odisable_mdc_flushes(gid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Odisable_mdc_flushes(gid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -1758,7 +1782,10 @@ test_objs_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Should fail to un-cork the named datatype that is not corked yet */
- H5E_BEGIN_TRY { ret = H5Oenable_mdc_flushes(tid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oenable_mdc_flushes(tid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
diff --git a/test/cross_read.c b/test/cross_read.c
index d2f74b6..cb71996 100644
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -41,8 +41,10 @@ const char *FILENAME[] = {"vms_data", "le_data", "be_data", NULL};
#define DATASETNAME14 "Fletcher_float_data_le"
#define DATASETNAME15 "Fletcher_float_data_be"
+#ifdef H5_HAVE_FILTER_DEFLATE
#define DATASETNAME16 "Deflate_float_data_le"
#define DATASETNAME17 "Deflate_float_data_be"
+#endif
#ifdef H5_HAVE_FILTER_SZIP
#define DATASETNAME18 "Szip_float_data_le"
#define DATASETNAME19 "Szip_float_data_be"
@@ -121,7 +123,10 @@ check_data_i(const char *dsetname, hid_t fid)
return 0;
error:
- H5E_BEGIN_TRY { H5Dclose(did); }
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ }
H5E_END_TRY;
return 1;
} /* end check_data_i() */
@@ -156,9 +161,9 @@ check_data_f(const char *dsetname, hid_t fid)
/* Input (last row is different) */
for (i = 0; i < NX; i++)
for (j = 0; j < NY; j++)
- data_in[i][j] = ((double)(i + j + 1)) / (double)3.0F;
+ data_in[i][j] = ((double)(i + j + 1)) / 3.0;
for (i = 0; i < NY; i++)
- data_in[NX][i] = -2.2F;
+ data_in[NX][i] = -2.2;
/* Output */
HDmemset(data_out, 0, (NX + 1) * NY * sizeof(double));
@@ -171,7 +176,7 @@ check_data_f(const char *dsetname, hid_t fid)
/* Check results */
for (i = 0; i < (NX + 1); i++)
for (j = 0; j < NY; j++)
- if (!H5_DBL_REL_EQUAL(data_out[i][j], data_in[i][j], (double)0.001F))
+ if (!H5_DBL_REL_EQUAL(data_out[i][j], data_in[i][j], 0.001))
if (!nerrors++) {
H5_FAILED();
HDprintf("element [%d][%d] is %g but should have been %g\n", (int)i, (int)j,
@@ -192,7 +197,10 @@ check_data_f(const char *dsetname, hid_t fid)
return 0;
error:
- H5E_BEGIN_TRY { H5Dclose(did); }
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ }
H5E_END_TRY;
return 1;
} /* end check_data_f() */
@@ -321,7 +329,10 @@ check_file(char *filename)
return nerrors;
error:
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
return nerrors;
} /* end check_file() */
diff --git a/test/cve_2020_10810.h5 b/test/cve_2020_10810.h5
new file mode 100644
index 0000000..5cface3
--- /dev/null
+++ b/test/cve_2020_10810.h5
Binary files differ
diff --git a/test/dangle.c b/test/dangle.c
index a1f5c45..d41507b 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -176,7 +176,10 @@ test_dangle_group(H5F_close_degree_t degree)
TEST_ERROR;
/* Try creating duplicate group */
- H5E_BEGIN_TRY { gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gid >= 0)
TEST_ERROR
diff --git a/test/direct_chunk.c b/test/direct_chunk.c
index 237c70d..8960784 100644
--- a/test/direct_chunk.c
+++ b/test/direct_chunk.c
@@ -23,7 +23,9 @@
#define FILE_NAME "direct_chunk.h5"
/* Datasets for Direct Write tests */
+#ifdef H5_HAVE_FILTER_DEFLATE
#define DATASETNAME1 "direct_write"
+#endif
#define DATASETNAME2 "skip_one_filter"
#define DATASETNAME3 "skip_two_filters"
#define DATASETNAME4 "data_conv"
@@ -31,9 +33,11 @@
#define DATASETNAME6 "invalid_argue"
#define DATASETNAME7 "overwrite_chunk"
/* Datasets for Direct Read tests */
+#ifdef H5_HAVE_FILTER_DEFLATE
#define DATASETNAME8 "disabled_chunk_cache"
#define DATASETNAME9 "flush_chunk_cache"
#define DATASETNAME10 "read_w_valid_cache"
+#endif
#define DATASETNAME11 "unallocated_chunk"
#define DATASETNAME12 "unfiltered_data"
@@ -43,7 +47,9 @@
#define CHUNK_NX 4
#define CHUNK_NY 4
+#ifdef H5_HAVE_FILTER_DEFLATE
#define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * 1.001) + 12.0)
+#endif
/* Temporary filter IDs used for testing */
#define H5Z_FILTER_BOGUS1 305
@@ -1990,23 +1996,23 @@ test_read_unallocated_chunk(hid_t file)
/* Create the data space with unlimited dimensions. */
if ((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if ((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Modify dataset creation properties, i.e. enable chunking, no compression */
if ((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if ((status = H5Pset_chunk(cparms, RANK, chunk_dims)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Create a new dataset within the file using cparms creation properties. */
if ((dataset = H5Dcreate2(file, DATASETNAME11, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms,
H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Write a single chunk to intialize the chunk storage */
HDmemset(direct_buf, 0, CHUNK_NX * CHUNK_NY * sizeof(int));
@@ -2014,7 +2020,7 @@ test_read_unallocated_chunk(hid_t file)
offset[1] = 0;
if (H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, chunk_nbytes, direct_buf) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Attempt to read each chunk in the dataset. Chunks are not allocated,
* therefore we expect the result of H5Dread_chunk to fail. Chunk idx starts
@@ -2026,32 +2032,43 @@ test_read_unallocated_chunk(hid_t file)
offset[1] = j * CHUNK_NY;
/* Read a non-existant chunk using the direct read function. */
- H5E_BEGIN_TRY { status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, &direct_buf); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, &direct_buf);
+ }
H5E_END_TRY;
/* Check that the chunk read call does not succeed. */
if (status != -1)
- goto error;
+ TEST_ERROR
/* Query the size of the non-existant chunk */
direct_chunk_nbytes = ULONG_MAX;
- H5E_BEGIN_TRY { status = H5Dget_chunk_storage_size(dataset, offset, &direct_chunk_nbytes); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dget_chunk_storage_size(dataset, offset, &direct_chunk_nbytes);
+ }
H5E_END_TRY;
/* Check that the chunk storage size call does not succeed. */
if (status != -1)
- goto error;
- if (direct_chunk_nbytes != 0)
- goto error;
+ TEST_ERROR
+ if (direct_chunk_nbytes != ULONG_MAX)
+ TEST_ERROR
}
}
/* Close/release resources. */
- H5Dclose(dataset);
- H5Sclose(mem_space);
- H5Sclose(dataspace);
- H5Pclose(cparms);
- H5Pclose(dxpl);
+ if (H5Dclose(dataset) < 0)
+ FAIL_STACK_ERROR;
+ if (H5Sclose(mem_space) < 0)
+ FAIL_STACK_ERROR;
+ if (H5Sclose(dataspace) < 0)
+ FAIL_STACK_ERROR;
+ if (H5Pclose(cparms) < 0)
+ FAIL_STACK_ERROR;
+ if (H5Pclose(dxpl) < 0)
+ FAIL_STACK_ERROR;
PASSED();
return 0;
@@ -2115,103 +2132,100 @@ test_single_chunk(unsigned config)
TESTING("Single chunk I/O");
/* Initialize data */
- for (i = 0; i < DIM0; i++) {
+ for (i = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++)
wdata[i][j] = j / CHUNK0;
- }
/* Create a new file with the latest format */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (config & CONFIG_LATEST)
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if ((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Create dataspace */
if ((sid = H5Screate_simple(2, dims, NULL)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Create the dataset creation property list and set the chunk size */
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (H5Pset_chunk(dcpl, 2, chunk) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Create the dataset */
if ((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (config & CONFIG_DIRECT_WRITE) {
/* Write the data directly to the dataset */
if (H5Dwrite_chunk(did, H5P_DEFAULT, 0, offset, CHUNK0 * CHUNK1 * 4, (void *)wdata) < 0)
- goto error;
+ FAIL_STACK_ERROR;
} /* end if */
else
/* Write the data to the dataset */
if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)wdata) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/*
* Close and release resources.
*/
if (H5Pclose(dcpl) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (config & CONFIG_REOPEN_DSET)
if (H5Dclose(did) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (H5Sclose(sid) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (H5Pclose(fapl) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (config & CONFIG_REOPEN_FILE)
if (H5Fclose(fid) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Open the file and dataset with default properties */
if (config & CONFIG_REOPEN_FILE)
if ((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (config & CONFIG_REOPEN_DSET)
if ((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Retrieve dataset creation property list */
if ((dcpl = H5Dget_create_plist(did)) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (config & CONFIG_DIRECT_READ) {
/* Read the data directly */
if (H5Dread_chunk(did, H5P_DEFAULT, offset, &filters, rdata) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Verify returned filter mask */
if (filters != 0)
- goto error;
+ TEST_ERROR
} /* end if */
else
/* Read the data */
if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0)
- goto error;
+ FAIL_STACK_ERROR;
/* Verify that the data read was correct. */
- for (i = 0; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++) {
+ for (i = 0; i < DIM0; i++)
+ for (j = 0; j < DIM1; j++)
if (rdata[i][j] != wdata[i][j])
- goto error;
- }
- }
+ TEST_ERROR
/*
* Close and release resources
*/
if (H5Pclose(dcpl) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (H5Dclose(did) < 0)
- goto error;
+ FAIL_STACK_ERROR;
if (H5Fclose(fid) < 0)
- goto error;
+ FAIL_STACK_ERROR;
PASSED();
return 0;
diff --git a/test/dsets.c b/test/dsets.c
index 5dcdbce..922f370 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -83,6 +83,8 @@ const char *FILENAME[] = {"dataset", /* 0 */
"power2up", /* 24 */
"version_bounds", /* 25 */
"alloc_0sized", /* 26 */
+ "h5s_block", /* 27 */
+ "h5s_plist", /* 28 */
NULL};
#define OHMIN_FILENAME_A "ohdr_min_a"
@@ -93,25 +95,29 @@ const char *FILENAME[] = {"dataset", /* 0 */
#define FILE_DEFLATE_NAME "deflate.h5"
/* Dataset names for testing filters */
-#define DSET_DEFAULT_NAME "default"
-#define DSET_CHUNKED_NAME "chunked"
-#define DSET_COMPACT_NAME "compact"
-#define DSET_SIMPLE_IO_NAME "simple_io"
-#define DSET_USERBLOCK_IO_NAME "userblock_io"
-#define DSET_COMPACT_IO_NAME "compact_io"
-#define DSET_COMPACT_MAX_NAME "max_compact"
-#define DSET_COMPACT_MAX2_NAME "max_compact_2"
-#define DSET_CONV_BUF_NAME "conv_buf"
-#define DSET_TCONV_NAME "tconv"
-#define DSET_DEFLATE_NAME "deflate"
-#define DSET_SHUFFLE_NAME "shuffle"
-#define DSET_FLETCHER32_NAME "fletcher32"
-#define DSET_FLETCHER32_NAME_2 "fletcher32_2"
-#define DSET_FLETCHER32_NAME_3 "fletcher32_3"
+#define DSET_DEFAULT_NAME "default"
+#define DSET_CHUNKED_NAME "chunked"
+#define DSET_COMPACT_NAME "compact"
+#define DSET_SIMPLE_IO_NAME "simple_io"
+#define DSET_USERBLOCK_IO_NAME "userblock_io"
+#define DSET_COMPACT_IO_NAME "compact_io"
+#define DSET_COMPACT_MAX_NAME "max_compact"
+#define DSET_COMPACT_MAX2_NAME "max_compact_2"
+#define DSET_CONV_BUF_NAME "conv_buf"
+#define DSET_TCONV_NAME "tconv"
+#ifdef H5_HAVE_FILTER_DEFLATE
+#define DSET_DEFLATE_NAME "deflate"
+#endif
+#define DSET_SHUFFLE_NAME "shuffle"
+#define DSET_FLETCHER32_NAME "fletcher32"
+#define DSET_FLETCHER32_NAME_2 "fletcher32_2"
+#define DSET_FLETCHER32_NAME_3 "fletcher32_3"
+#ifdef H5_HAVE_FILTER_DEFLATE
#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32"
#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2"
-#define DSET_OPTIONAL_SCALAR "dataset_with_scalar_space"
-#define DSET_OPTIONAL_VLEN "dataset_with_vlen_type"
+#endif
+#define DSET_OPTIONAL_SCALAR "dataset_with_scalar_space"
+#define DSET_OPTIONAL_VLEN "dataset_with_vlen_type"
#ifdef H5_HAVE_FILTER_SZIP
#define DSET_SZIP_NAME "szip"
#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32"
@@ -434,7 +440,10 @@ test_create(hid_t file)
* cannot be created with this function. Temporarily turn off error
* reporting.
*/
- H5E_BEGIN_TRY { dataset = H5Dopen2(file, "does_not_exist", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ dataset = H5Dopen2(file, "does_not_exist", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (dataset >= 0) {
H5_FAILED();
@@ -539,7 +548,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
TESTING("simple I/O");
/* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */
- if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
+ if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0) {
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
/* Set up data array */
@@ -699,7 +709,8 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TESTING("dataset offset with user block");
/* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */
- if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
+ if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0) {
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
/* Set up data array */
@@ -927,7 +938,10 @@ test_compact_io(hid_t fapl)
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
@@ -1382,10 +1396,10 @@ test_conv_buffer(hid_t fid)
cf->a[j][k][l] = 10 * (j + 1) + l + k;
for (j = 0; j < DIM2; j++)
- cf->b[j] = 100.0f * (float)(j + 1) + 0.01f * (float)j;
+ cf->b[j] = 100.0F * (float)(j + 1) + 0.01F * (float)j;
for (j = 0; j < DIM3; j++)
- cf->c[j] = 100.0f * (float)(j + 1) + 0.02f * (float)j;
+ cf->c[j] = 100.0F * (float)(j + 1) + 0.02F * (float)j;
/* Create data space */
if ((space = H5Screate(H5S_SCALAR)) < 0)
@@ -1448,7 +1462,10 @@ test_conv_buffer(hid_t fid)
if (H5Pset_buffer(xfer_list, size, NULL, NULL) < 0)
goto error;
- H5E_BEGIN_TRY { status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -1491,6 +1508,9 @@ test_conv_buffer(hid_t fid)
return SUCCEED;
error:
+ HDfree(cfrR);
+ HDfree(cf);
+
H5E_BEGIN_TRY
{
H5Pclose(xfer_list);
@@ -1979,7 +1999,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (corrupted) {
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -1994,7 +2017,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0)
TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -2040,7 +2066,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (corrupted) {
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -2055,7 +2084,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0)
TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -2098,7 +2130,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (corrupted) {
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -2114,7 +2149,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -2159,7 +2197,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (corrupted) {
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -2174,7 +2215,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if (H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0)
TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
- H5E_BEGIN_TRY { status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR;
@@ -2315,7 +2359,10 @@ test_filter_noencoder(const char *dset_name)
* allocation.
*/
dims = 20; /* Dataset is originally of size 10 */
- H5E_BEGIN_TRY { err = H5Dset_extent(dset_id, &dims); }
+ H5E_BEGIN_TRY
+ {
+ err = H5Dset_extent(dset_id, &dims);
+ }
H5E_END_TRY
if (err >= 0)
@@ -2324,7 +2371,10 @@ test_filter_noencoder(const char *dset_name)
/* Attempt to write to the dataset. This should fail because
* the filter does not have an encoder.
*/
- H5E_BEGIN_TRY { err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints); }
+ H5E_BEGIN_TRY
+ {
+ err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints);
+ }
H5E_END_TRY
if (err >= 0)
@@ -2417,7 +2467,10 @@ test_get_filter_info(void)
/* Verify that get_filter_info throws an error when given a bad filter */
/* (Depends on 1.6 compatibility flag) */
- H5E_BEGIN_TRY { err = H5Zget_filter_info(-1, &flags); }
+ H5E_BEGIN_TRY
+ {
+ err = H5Zget_filter_info(-1, &flags);
+ }
H5E_END_TRY;
if (err >= 0)
TEST_ERROR
@@ -2964,7 +3017,10 @@ test_missing_filter(hid_t file)
} /* end if */
/* Read data (should fail, since deflate filter is missing) */
- H5E_BEGIN_TRY { ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -3181,7 +3237,7 @@ test_nbit_int(hid_t file)
/* Initialize data, assuming size of long long >= size of int */
for (i = 0; i < (size_t)size[0]; i++)
for (j = 0; j < (size_t)size[1]; j++) {
- power = HDpow(2.0f, (double)(precision - 1));
+ power = HDpow(2.0, (double)(precision - 1));
orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset);
/* even-numbered values are negtive */
@@ -3268,8 +3324,8 @@ test_nbit_float(hid_t file)
/* orig_data[] are initialized to be within the range that can be represented by
* dataset datatype (no precision loss during datatype conversion)
*/
- float orig_data[2][5] = {{188384.0f, 19.103516f, -1.0831790e9f, -84.242188f, 5.2045898f},
- {-49140.0f, 2350.25f, -3.2110596e-1f, 6.4998865e-5f, -0.0f}};
+ float orig_data[2][5] = {{188384.0F, 19.103516F, -1.0831790e9F, -84.242188F, 5.2045898F},
+ {-49140.0F, 2350.25F, -3.2110596e-1F, 6.4998865e-5F, -0.0F}};
float new_data[2][5];
size_t precision, offset;
size_t i, j;
@@ -3558,7 +3614,7 @@ test_nbit_array(hid_t file)
for (j = 0; j < (size_t)size[1]; j++)
for (m = 0; m < (size_t)adims[0]; m++)
for (n = 0; n < (size_t)adims[1]; n++) {
- power = HDpow(2.0F, (double)precision);
+ power = HDpow(2.0, (double)precision);
orig_data[i][j][m][n] =
(unsigned int)(((long long)HDrandom() % (long long)power) << offset);
} /* end for */
@@ -3754,11 +3810,11 @@ test_nbit_compound(hid_t file)
/* Initialize data, assuming size of long long >= size of member datatypes */
for (i = 0; i < (size_t)size[0]; i++)
for (j = 0; j < (size_t)size[1]; j++) {
- power = HDpow(2.0F, (double)(precision[0] - 1));
+ power = HDpow(2.0, (double)(precision[0] - 1));
orig_data[i][j].i = (int)(((long long)HDrandom() % (long long)power) << offset[0]);
- power = HDpow(2.0F, (double)(precision[1] - 1));
+ power = HDpow(2.0, (double)(precision[1] - 1));
orig_data[i][j].c = (char)(((long long)HDrandom() % (long long)power) << offset[1]);
- power = HDpow(2.0F, (double)(precision[2] - 1));
+ power = HDpow(2.0, (double)(precision[2] - 1));
orig_data[i][j].s = (short)(((long long)HDrandom() % (long long)power) << offset[2]);
orig_data[i][j].f = float_val[i][j];
@@ -4036,32 +4092,32 @@ test_nbit_compound_2(hid_t file)
/* Initialize data, assuming size of long long >= size of member datatypes */
for (i = 0; i < (size_t)size[0]; i++)
for (j = 0; j < (size_t)size[1]; j++) {
- power = HDpow(2.0F, (double)(precision[0] - 1));
+ power = HDpow(2.0, (double)(precision[0] - 1));
orig_data[i][j].a.i = (int)(((long long)HDrandom() % (long long)power) << offset[0]);
- power = HDpow(2.0F, (double)(precision[1] - 1));
+ power = HDpow(2.0, (double)(precision[1] - 1));
orig_data[i][j].a.c = (char)(((long long)HDrandom() % (long long)power) << offset[1]);
- power = HDpow(2.0F, (double)(precision[2] - 1));
+ power = HDpow(2.0, (double)(precision[2] - 1));
orig_data[i][j].a.s = (short)(-(((long long)HDrandom() % (long long)power) << offset[2]));
orig_data[i][j].a.f = float_val[i][j];
- power = HDpow(2.0F, (double)precision[3]);
+ power = HDpow(2.0, (double)precision[3]);
orig_data[i][j].v = (unsigned int)(((long long)HDrandom() % (long long)power) << offset[3]);
for (m = 0; m < (size_t)array_dims[0]; m++)
for (n = 0; n < (size_t)array_dims[1]; n++) {
- power = HDpow(2.0F, (double)(precision[4] - 1));
+ power = HDpow(2.0, (double)(precision[4] - 1));
orig_data[i][j].b[m][n] = (char)(((long long)HDrandom() % (long long)power) << offset[4]);
} /* end for */
for (m = 0; m < (size_t)array_dims[0]; m++)
for (n = 0; n < (size_t)array_dims[1]; n++) {
- power = HDpow(2.0F, (double)(precision[0] - 1));
+ power = HDpow(2.0, (double)(precision[0] - 1));
orig_data[i][j].d[m][n].i =
(int)(-(((long long)HDrandom() % (long long)power) << offset[0]));
- power = HDpow(2.0F, (double)(precision[1] - 1));
+ power = HDpow(2.0, (double)(precision[1] - 1));
orig_data[i][j].d[m][n].c =
(char)(((long long)HDrandom() % (long long)power) << offset[1]);
- power = HDpow(2.0F, (double)(precision[2] - 1));
+ power = HDpow(2.0, (double)(precision[2] - 1));
orig_data[i][j].d[m][n].s =
(short)(((long long)HDrandom() % (long long)power) << offset[2]);
orig_data[i][j].d[m][n].f = float_val[i][j];
@@ -4292,7 +4348,7 @@ test_nbit_compound_3(hid_t file)
/* Initialize data */
for (i = 0; i < (size_t)size[0]; i++) {
- power = HDpow(2.0F, 17.0F - 1.0F);
+ power = HDpow(2.0, 17.0 - 1.0);
HDmemset(&orig_data[i], 0, sizeof(orig_data[i]));
orig_data[i].i = (int)(HDrandom() % (long)power);
HDstrcpy(orig_data[i].str, "fixed-length C string");
@@ -4481,7 +4537,7 @@ test_nbit_int_size(hid_t file)
*/
for (i = 0; i < DSET_DIM1; i++)
for (j = 0; j < DSET_DIM2; j++) {
- power = HDpow(2.0F, (double)(precision - 1));
+ power = HDpow(2.0, (double)(precision - 1));
orig[i][j] = HDrandom() % (int)power << offset;
}
@@ -5145,7 +5201,7 @@ test_scaleoffset_float(hid_t file)
/* Check that the values read are the same as the values written */
for (i = 0; i < (size_t)size[0]; i++) {
for (j = 0; j < (size_t)size[1]; j++) {
- if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0F, -3.0F)) {
+ if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0, -3.0)) {
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -5291,7 +5347,7 @@ test_scaleoffset_float_2(hid_t file)
/* Check that the values read are the same as the values written */
for (j = 0; j < (size_t)size[1]; j++) {
- if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0F, -3.0F)) {
+ if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0, -3.0)) {
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -5412,7 +5468,7 @@ test_scaleoffset_double(hid_t file)
/* Check that the values read are the same as the values written */
for (i = 0; i < (size_t)size[0]; i++) {
for (j = 0; j < (size_t)size[1]; j++) {
- if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0F, -7.0F)) {
+ if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0, -7.0)) {
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -5558,7 +5614,7 @@ test_scaleoffset_double_2(hid_t file)
/* Check that the values read are the same as the values written */
for (j = 0; j < (size_t)size[1]; j++) {
- if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0F, -7.0F)) {
+ if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0, -7.0)) {
H5_FAILED();
HDprintf(" Read different values than written.\n");
HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -6285,7 +6341,10 @@ test_can_apply_szip(hid_t
/* Set (invalid at property set time) szip parameters */
szip_pixels_per_block = 3;
- H5E_BEGIN_TRY { ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -6295,7 +6354,10 @@ test_can_apply_szip(hid_t
/* Set (invalid at property set time) szip parameters */
szip_pixels_per_block = 512;
- H5E_BEGIN_TRY { ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -6467,7 +6529,7 @@ test_set_local(hid_t fapl)
for (i = 0; i < DSET_DIM1; i++)
for (j = 0; j < DSET_DIM2; j++) {
points[i][j] = (int)n++;
- points_dbl[i][j] = (double)1.5F * n++;
+ points_dbl[i][j] = 1.5 * n++;
}
/* Open file */
@@ -6663,7 +6725,7 @@ test_set_local(hid_t fapl)
for (j = 0; j < dims[1]; j++) {
/* If the difference between two values is greater than 0.001%, they're
* considered not equal. */
- if (!H5_DBL_REL_EQUAL(points_dbl[i][j], check_dbl[i][j], (double)0.00001F)) {
+ if (!H5_DBL_REL_EQUAL(points_dbl[i][j], check_dbl[i][j], 0.00001)) {
H5_FAILED();
HDprintf(" Line %d: Read different values than written.\n", __LINE__);
HDprintf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -6976,6 +7038,7 @@ error:
static herr_t
test_filter_delete(hid_t file)
{
+#ifdef H5_HAVE_FILTER_DEFLATE
H5Z_filter_t filtn; /* filter identification number */
hid_t dsid = -1; /* dataset ID */
hid_t sid = -1; /* dataspace ID */
@@ -6987,6 +7050,7 @@ test_filter_delete(hid_t file)
unsigned flags; /* flags for filter */
herr_t ret; /* generic return value */
int i;
+#endif
TESTING("filter deletion");
@@ -7048,7 +7112,10 @@ test_filter_delete(hid_t file)
} /* end if */
/* try to delete the deflate filter again */
- H5E_BEGIN_TRY { ret = H5Premove_filter(dcpl1, H5Z_FILTER_DEFLATE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Premove_filter(dcpl1, H5Z_FILTER_DEFLATE);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -7088,9 +7155,7 @@ test_filter_delete(hid_t file)
goto error;
PASSED();
-#else
- SKIPPED();
-#endif
+
return SUCCEED;
error:
@@ -7103,6 +7168,11 @@ error:
}
H5E_END_TRY;
return FAIL;
+#else
+ (void)file; /* Silence compiler */
+ SKIPPED();
+ return SUCCEED;
+#endif
} /* end test_filter_delete() */
/*-------------------------------------------------------------------------
@@ -7331,7 +7401,10 @@ test_zero_dims(hid_t file)
} /* end if */
/* Try creating chunked dataset with zero-sized chunk dimensions */
- H5E_BEGIN_TRY { ret = H5Pset_chunk(dcpl, 1, &dzero); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_chunk(dcpl, 1, &dzero);
+ }
H5E_END_TRY;
if (ret > 0)
FAIL_PUTS_ERROR("set zero-sized chunk dimensions")
@@ -7409,7 +7482,10 @@ test_zero_dims(hid_t file)
} /* end if */
/* Try creating chunked dataset with zero-sized chunk dimensions */
- H5E_BEGIN_TRY { ret = H5Pset_chunk(dcpl2, 2, dzero2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_chunk(dcpl2, 2, dzero2);
+ }
H5E_END_TRY;
if (ret > 0)
FAIL_PUTS_ERROR("set zero-sized chunk dimensions")
@@ -8378,7 +8454,10 @@ test_deprec(hid_t file)
* dataset can only be created once. Temporarily turn off error
* reporting.
*/
- H5E_BEGIN_TRY { dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (dataset >= 0) {
H5_FAILED();
@@ -8400,7 +8479,10 @@ test_deprec(hid_t file)
* cannot be created with this function. Temporarily turn off error
* reporting.
*/
- H5E_BEGIN_TRY { dataset = H5Dopen1(file, "does_not_exist"); }
+ H5E_BEGIN_TRY
+ {
+ dataset = H5Dopen1(file, "does_not_exist");
+ }
H5E_END_TRY;
if (dataset >= 0) {
H5_FAILED();
@@ -8575,7 +8657,10 @@ test_huge_chunks(hid_t fapl)
/* Try to set too large of a chunk for 1-D dataset (# of elements) */
chunk_dim = TOO_HUGE_CHUNK_DIM;
- H5E_BEGIN_TRY { ret = H5Pset_chunk(dcpl, 1, &chunk_dim); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_chunk(dcpl, 1, &chunk_dim);
+ }
H5E_END_TRY;
if (ret >= 0)
FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.")
@@ -8584,7 +8669,10 @@ test_huge_chunks(hid_t fapl)
chunk_dim2[0] = TOO_HUGE_CHUNK_DIM2_0;
chunk_dim2[1] = TOO_HUGE_CHUNK_DIM2_1;
chunk_dim2[2] = TOO_HUGE_CHUNK_DIM2_2;
- H5E_BEGIN_TRY { ret = H5Pset_chunk(dcpl, 3, chunk_dim2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_chunk(dcpl, 3, chunk_dim2);
+ }
H5E_END_TRY;
if (ret >= 0)
FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.")
@@ -8725,7 +8813,7 @@ test_chunk_cache(hid_t fapl)
/* Set new rdcc settings on fapl */
nslots_2 = nslots_1 * 2;
nbytes_2 = nbytes_1 * 2;
- w0_2 = w0_1 / (double)2.0F;
+ w0_2 = w0_1 / 2.0;
if (H5Pset_cache(fapl_local, 0, nslots_2, nbytes_2, w0_2) < 0)
FAIL_STACK_ERROR
@@ -9447,8 +9535,7 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
npoints = (hsize_t)snpoints;
/* Compute the "down" dimension values */
- if (H5VM_array_down(ndims, dim, down) < 0)
- FAIL_STACK_ERROR
+ H5VM_array_down(ndims, dim, down);
/* Create chunked dataset */
if ((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl,
@@ -9630,8 +9717,7 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
H5VM_swizzle_coords(hsize_t, swizzled_dim, unlim_dim);
/* Compute the "down" dimension values */
- if (H5VM_array_down(ndims, swizzled_dim, down) < 0)
- FAIL_STACK_ERROR
+ H5VM_array_down(ndims, swizzled_dim, down);
/* Read elements */
for (u = 0; u < npoints; u++) {
@@ -11556,7 +11642,7 @@ test_unfiltered_edge_chunks(hid_t fapl)
TEST_ERROR
/* Add "count" filter */
- if (H5Pset_filter(dcpl, H5Z_FILTER_COUNT, 0u, (size_t)0, NULL) < 0)
+ if (H5Pset_filter(dcpl, H5Z_FILTER_COUNT, 0U, (size_t)0, NULL) < 0)
TEST_ERROR
/* Disable filters on partial chunks */
@@ -11818,7 +11904,10 @@ test_zero_dim_dset(hid_t fapl)
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds before opening the file */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
@@ -13072,7 +13161,10 @@ test_power2up(hid_t fapl)
ext_dims[1] = dims[1] + 5;
/* Extend to (2^63)+ */
- H5E_BEGIN_TRY { status = H5Dset_extent(did, ext_dims); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dset_extent(did, ext_dims);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR
@@ -13408,7 +13500,10 @@ test_scatter(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Sclose(sid); }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ }
H5E_END_TRY;
return FAIL;
} /* end test_scatter() */
@@ -13772,7 +13867,10 @@ test_gather(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Sclose(sid); }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ }
H5E_END_TRY;
return FAIL;
} /* end test_gather() */
@@ -13876,14 +13974,20 @@ test_scatter_error(void)
*/
scatter_info.src_buf = src_buf;
scatter_info.size = 6;
- H5E_BEGIN_TRY { ret = H5Dscatter(NULL, NULL, H5T_NATIVE_INT, sid, dst_buf); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dscatter(NULL, NULL, H5T_NATIVE_INT, sid, dst_buf);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
scatter_info.src_buf = src_buf;
scatter_info.size = 6;
- H5E_BEGIN_TRY { ret = H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, sid, sid, dst_buf); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dscatter((H5D_scatter_func_t)scatter_cb, &scatter_info, sid, sid, dst_buf);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
@@ -13996,7 +14100,10 @@ test_scatter_error(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Sclose(sid); }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ }
H5E_END_TRY;
return FAIL;
} /* end test_scatter_error() */
@@ -14098,14 +14205,20 @@ test_gather_error(void)
gather_info.expect_dst_buf = expect_dst_buf;
gather_info.last_call = FALSE;
- H5E_BEGIN_TRY { ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 0, dst_buf, gather_cb, &gather_info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 0, dst_buf, gather_cb, &gather_info);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
gather_info.expect_dst_buf = expect_dst_buf;
gather_info.last_call = FALSE;
- H5E_BEGIN_TRY { ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 1, dst_buf, gather_cb, &gather_info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dgather(sid, src_buf, H5T_NATIVE_INT, 1, dst_buf, gather_cb, &gather_info);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
@@ -14153,7 +14266,10 @@ test_gather_error(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Sclose(sid); }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ }
H5E_END_TRY;
return FAIL;
} /* end test_gather_error() */
@@ -14514,7 +14630,10 @@ test_compact_open_close_dirty(hid_t fapl)
/* Verify the repeated open/close of the dataset will not fail */
for (i = 0; i < 20; i++) {
- H5E_BEGIN_TRY { did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (did < 0)
TEST_ERROR
@@ -14642,7 +14761,10 @@ test_versionbounds(void)
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds, skip for invalid low/high combination */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
@@ -14797,7 +14919,10 @@ test_object_header_minimization_dcpl(void)
/* error cases
*/
- H5E_BEGIN_TRY { ret = H5Pget_dset_no_attrs_hint(-1, &minimize); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pget_dset_no_attrs_hint(-1, &minimize);
+ }
H5E_END_TRY;
if (ret == SUCCEED)
TEST_ERROR /* Invalid DCPL ID should fail */
@@ -14848,6 +14973,370 @@ error:
} /* end test_object_header_minimization_dcpl() */
/*-----------------------------------------------------------------------------
+ * Function: test_h5s_block
+ *
+ * Purpose: Test the H5S_BLOCK feature.
+ *
+ * Return: Success/pass: 0
+ * Failure/error: -1
+ *
+ * Programmer: Quincey Koziol
+ * 3 November 2020
+ *
+ *-----------------------------------------------------------------------------
+ */
+static herr_t
+test_h5s_block(void)
+{
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ char filename[FILENAME_BUF_SIZE] = "";
+ hid_t dset_id = H5I_INVALID_HID; /* Dataset ID */
+ hsize_t dims[1] = {20}; /* Dataset's dataspace size */
+ hsize_t start = 2; /* Starting offset of hyperslab selection */
+ hsize_t count = 10; /* Count of hyperslab selection */
+ hid_t file_space_id = H5I_INVALID_HID; /* File dataspace ID */
+ int buf[20]; /* Memory buffer for I/O */
+ unsigned u; /* Local index variable */
+ herr_t ret;
+
+ TESTING("contiguous memory buffers with H5S_BLOCK");
+
+ /*********/
+ /* SETUP */
+ /*********/
+ if (NULL == h5_fixname(FILENAME[27], H5P_DEFAULT, filename, sizeof(filename)))
+ TEST_ERROR
+ if (H5I_INVALID_HID == (file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)))
+ FAIL_STACK_ERROR
+ if ((file_space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ FAIL_STACK_ERROR
+ if ((dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_INT, file_space_id, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+
+ for (u = 0; u < 20; u++)
+ buf[u] = (int)u;
+
+ /*********/
+ /* TESTS */
+ /*********/
+
+ /* Check error cases */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_BLOCK, H5P_DEFAULT, buf);
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+
+ /* Write the entire dataset */
+ if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Reset the memory buffer */
+ HDmemset(buf, 0, sizeof(buf));
+
+ /* Read the entire dataset */
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < 20; u++)
+ if (buf[u] != (int)u)
+ TEST_ERROR
+
+ /* Read a hyperslab from the file to the first 10 elements of the buffer */
+ if (H5Sselect_hyperslab(file_space_id, H5S_SELECT_SET, &start, NULL, &count, NULL) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, file_space_id, H5P_DEFAULT, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < count; u++)
+ if (buf[u] != (int)(u + start))
+ TEST_ERROR
+
+ /* Verify that reading 0 elements is handled correctly and doesn't modify buffer */
+ if (H5Sselect_none(file_space_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, file_space_id, H5P_DEFAULT, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < count; u++)
+ if (buf[u] != (int)(u + start))
+ TEST_ERROR
+
+ /************/
+ /* TEARDOWN */
+ /************/
+ if (FAIL == H5Sclose(file_space_id))
+ FAIL_STACK_ERROR
+ if (FAIL == H5Dclose(dset_id))
+ FAIL_STACK_ERROR
+ if (FAIL == H5Fclose(file_id))
+ FAIL_STACK_ERROR
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(file_space_id);
+ H5Dclose(dset_id);
+ H5Fclose(file_id);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+} /* end test_h5s_block() */
+
+/*-----------------------------------------------------------------------------
+ * Function: test_h5s_plist
+ *
+ * Purpose: Test the H5S_PLIST feature.
+ *
+ * Return: Success/pass: 0
+ * Failure/error: -1
+ *
+ * Programmer: Quincey Koziol
+ * 28 January 2021
+ *
+ *-----------------------------------------------------------------------------
+ */
+static herr_t
+test_h5s_plist(void)
+{
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ char filename[FILENAME_BUF_SIZE] = "";
+ hid_t dset_id = H5I_INVALID_HID; /* Dataset ID */
+ hsize_t dims[1] = {20}; /* Dataset's dataspace size */
+ hid_t dxpl_id = H5I_INVALID_HID; /* Dataset xfer property list ID */
+ hid_t dxpl_id_copy = H5I_INVALID_HID; /* Copy of dataset xfer property list ID */
+ hsize_t start = 2; /* Starting offset of hyperslab selection */
+ hsize_t stride = 1; /* Stride of hyperslab selection */
+ hsize_t count = 10; /* Count of hyperslab selection */
+ hsize_t start2 = 14; /* Starting offset of hyperslab selection */
+ hsize_t count2 = 4; /* Count of hyperslab selection */
+ hsize_t block = 1; /* Block size of hyperslab selection */
+ hid_t file_space_id = H5I_INVALID_HID; /* File dataspace ID */
+ int buf[20]; /* Memory buffer for I/O */
+ unsigned u; /* Local index variable */
+ herr_t ret;
+
+ TESTING("dataset's dataspace selection for I/O in DXPL with H5S_PLIST");
+
+ /*********/
+ /* SETUP */
+ /*********/
+ if (NULL == h5_fixname(FILENAME[28], H5P_DEFAULT, filename, sizeof(filename)))
+ TEST_ERROR
+ if (H5I_INVALID_HID == (file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)))
+ FAIL_STACK_ERROR
+ if ((file_space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ FAIL_STACK_ERROR
+ if ((dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_INT, file_space_id, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ FAIL_STACK_ERROR
+
+ for (u = 0; u < 20; u++)
+ buf[u] = (int)u;
+
+ /*********/
+ /* TESTS */
+ /*********/
+
+ /* Check error cases */
+ H5E_BEGIN_TRY
+ {
+ /* Bad rank */
+ ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id, 0, H5S_SELECT_SET, &start, &stride, &count,
+ &block);
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+ H5E_BEGIN_TRY
+ {
+ /* Bad selection operator */
+ ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_NOOP, &start, &stride, &count,
+ &block);
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+ H5E_BEGIN_TRY
+ {
+ /* Bad start pointer */
+ ret =
+ H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_SET, NULL, &stride, &count, &block);
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+ H5E_BEGIN_TRY
+ {
+ /* Bad stride value (stride of NULL is OK) */
+ stride = 0;
+ ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_SET, &start, &stride, &count,
+ &block);
+ stride = 1;
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+ H5E_BEGIN_TRY
+ {
+ /* Bad count pointer */
+ ret =
+ H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_SET, &start, &stride, NULL, &block);
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+
+ /* Block pointer is allowed to be NULL */
+
+ H5E_BEGIN_TRY
+ {
+ /* H5S_PLIST for memory dataspace */
+ ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_PLIST, H5S_ALL, H5P_DEFAULT, buf);
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+
+ /* Write the entire dataset */
+ if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Reset the memory buffer */
+ HDmemset(buf, 0, sizeof(buf));
+
+ /* Read the entire dataset */
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < 20; u++)
+ if (buf[u] != (int)u)
+ TEST_ERROR
+
+ /* Reset the memory buffer */
+ HDmemset(buf, 0, sizeof(buf));
+
+ /* Set valid selection in DXPL */
+ if (H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_SET, &start, &stride, &count, &block) <
+ 0)
+ FAIL_STACK_ERROR
+
+ /* Read a hyperslab from the file to the first 10 elements of the buffer */
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_PLIST, dxpl_id, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < count; u++)
+ if (buf[u] != (int)(u + start))
+ TEST_ERROR
+
+ /* Reset the memory buffer */
+ HDmemset(buf, 0, sizeof(buf));
+
+ /* Check for copying property list w/selection */
+ if ((dxpl_id_copy = H5Pcopy(dxpl_id)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Read a hyperslab from the file to the first 10 elements of the buffer */
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_PLIST, dxpl_id_copy, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < count; u++)
+ if (buf[u] != (int)(u + start))
+ TEST_ERROR
+
+ /* Attempt to 'OR' block with invalid dimensions into the selection */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_dataset_io_hyperslab_selection(dxpl_id_copy, 2, H5S_SELECT_OR, &start, &stride, &count,
+ &block);
+ }
+ H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR
+
+ /* Set new valid selection in DXPL */
+ if (H5Pset_dataset_io_hyperslab_selection(dxpl_id_copy, 1, H5S_SELECT_SET, &start, &stride, &count,
+ &block) < 0)
+ FAIL_STACK_ERROR
+
+ /* Read a hyperslab from the file to the first 10 elements of the buffer */
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_PLIST, dxpl_id_copy, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < count; u++)
+ if (buf[u] != (int)(u + start))
+ TEST_ERROR
+
+ /* Close the copy */
+ if (FAIL == H5Pclose(dxpl_id_copy))
+ FAIL_STACK_ERROR
+ dxpl_id_copy = H5I_INVALID_HID;
+
+ /* 'OR' valid block into the existing selection in original DXPL */
+ if (H5Pset_dataset_io_hyperslab_selection(dxpl_id, 1, H5S_SELECT_OR, &start2, &stride, &count2, &block) <
+ 0)
+ FAIL_STACK_ERROR
+
+ /* Read a disjoint hyperslab from the file to the first 10 elements of the buffer */
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, H5S_PLIST, dxpl_id, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Verify the data read in */
+ for (u = 0; u < count; u++)
+ if (buf[u] != (int)(u + start))
+ TEST_ERROR
+ for (u = 0; u < count2; u++)
+ if (buf[u + count] != (int)(u + start2))
+ TEST_ERROR
+
+ /************/
+ /* TEARDOWN */
+ /************/
+ if (FAIL == H5Pclose(dxpl_id))
+ FAIL_STACK_ERROR
+ if (FAIL == H5Sclose(file_space_id))
+ FAIL_STACK_ERROR
+ if (FAIL == H5Dclose(dset_id))
+ FAIL_STACK_ERROR
+ if (FAIL == H5Fclose(file_id))
+ FAIL_STACK_ERROR
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dxpl_id_copy);
+ H5Pclose(dxpl_id);
+ H5Sclose(file_space_id);
+ H5Dclose(dset_id);
+ H5Fclose(file_id);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+} /* end test_h5s_plist() */
+
+/*-----------------------------------------------------------------------------
* Function: test_0sized_dset_metadata_alloc
*
* Purpose: Tests the metadata allocation for 0-sized datasets.
@@ -15077,7 +15566,7 @@ main(void)
envval = "nomatch";
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0);
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
@@ -15292,7 +15781,10 @@ main(void)
/* Tests version bounds using its own file */
nerrors += (test_versionbounds() < 0 ? 1 : 0);
+ /* Tests that use their own file */
nerrors += (test_object_header_minimization_dcpl() < 0 ? 1 : 0);
+ nerrors += (test_h5s_block() < 0 ? 1 : 0);
+ nerrors += (test_h5s_plist() < 0 ? 1 : 0);
/* Run misc tests */
nerrors += (dls_01_main() < 0 ? 1 : 0);
diff --git a/test/dt_arith.c b/test/dt_arith.c
index de2e4c3..91e31d5 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -53,7 +53,7 @@ const char *FILENAME[] = {"dt_arith1", "dt_arith2", NULL};
* endian. If local variable `endian' is H5T_ORDER_BE then the result will
* be I, otherwise the result will be Z-(I+1).
*/
-#define ENDIAN(Z, I, E) (H5T_ORDER_BE == E ? (I) : (Z) - ((I) + 1))
+#define ENDIAN(Z, I, E) (H5T_ORDER_BE == (E) ? (I) : (Z) - ((I) + 1))
typedef enum dtype_t {
INT_SCHAR,
@@ -74,9 +74,6 @@ typedef enum dtype_t {
OTHER
} dtype_t;
-/* Skip overflow tests if non-zero */
-static int skip_overflow_tests_g = 0;
-
/*
* Although we check whether a floating point overflow generates a SIGFPE and
* turn off overflow tests in that case, it might still be possible for an
@@ -84,7 +81,7 @@ static int skip_overflow_tests_g = 0;
* be allowed to continue (cf. Posix signals) so in order to recover from a
* SIGFPE we run tests that might generate one in a child process.
*/
-#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
+#ifdef H5_HAVE_UNISTD_H
#define HANDLE_SIGFPE
#endif
@@ -394,11 +391,10 @@ static int without_hardware_g = 0;
HDfree(value); \
}
-void some_dummy_func(float x);
static hbool_t overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits);
static int my_isnan(dtype_t type, void *val);
-static int my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos,
- size_t esize);
+static int my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos,
+ size_t esize);
/*-------------------------------------------------------------------------
* Function: fpe_handler
@@ -515,92 +511,6 @@ except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5
}
/*-------------------------------------------------------------------------
- * Function: some_dummy_func
- *
- * Purpose: A dummy function to help check for overflow.
- *
- * Note: DO NOT DECLARE THIS FUNCTION STATIC OR THE COMPILER MIGHT
- * PROMOTE ARGUMENT `x' TO DOUBLE AND DEFEAT THE OVERFLOW
- * CHECKING.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Tuesday, July 21, 1998
- *
- *-------------------------------------------------------------------------
- */
-void
-some_dummy_func(float x)
-{
- char s[128];
-
- HDsnprintf(s, sizeof(s), "%g", (double)x);
-}
-
-/*-------------------------------------------------------------------------
- * Function: generates_sigfpe
- *
- * Purpose: Determines if SIGFPE is generated from overflows. We must be
- * able to fork() and waitpid() in order for this test to work
- * properly. Sets skip_overflow_tests_g to non-zero if they
- * would generate SIGBUS, zero otherwise.
- *
- * Programmer: Robb Matzke
- * Tuesday, July 21, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void
-generates_sigfpe(void)
-{
-#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
- pid_t pid;
- int status;
- size_t i, j;
- double d;
- unsigned char *dp = (unsigned char *)&d;
- float f;
-
- HDfflush(stdout);
- HDfflush(stderr);
- if ((pid = HDfork()) < 0) {
- HDperror("fork");
- HDexit(EXIT_FAILURE);
- }
- else if (0 == pid) {
- for (i = 0; i < 2000; i++) {
- for (j = 0; j < sizeof(double); j++)
- dp[j] = (unsigned char)HDrand();
- f = (float)d;
- some_dummy_func((float)f);
- }
- HDexit(EXIT_SUCCESS);
- }
-
- while (pid != HDwaitpid(pid, &status, 0))
- /*void*/;
- if (WIFEXITED(status) && 0 == WEXITSTATUS(status)) {
- HDputs("Floating-point overflow cases will be tested.");
- skip_overflow_tests_g = FALSE;
- }
- else if (WIFSIGNALED(status) && SIGFPE == WTERMSIG(status)) {
- HDputs("Floating-point overflow cases cannot be safely tested.");
- skip_overflow_tests_g = TRUE;
- /* delete the core dump file that SIGFPE may have created */
- HDunlink("core");
- }
-#else
- HDputs("Cannot determine if floating-point overflows generate a SIGFPE;");
- HDputs("assuming yes.");
- HDputs("Overflow cases will not be tested.");
- skip_overflow_tests_g = TRUE;
-#endif
-}
-
-/*-------------------------------------------------------------------------
* Function: test_hard_query
*
* Purpose: Tests H5Tcompiler_conv() for querying whether a conversion is
@@ -864,7 +774,10 @@ test_particular_fp_integer(void)
error:
HDfflush(stdout);
- H5E_BEGIN_TRY { H5Pclose(dxpl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dxpl_id);
+ }
H5E_END_TRY;
if (buf1)
HDfree(buf1);
@@ -2853,7 +2766,8 @@ my_isnan(dtype_t type, void *val)
*-------------------------------------------------------------------------
*/
static int
-my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, size_t esize)
+my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos,
+ size_t esize)
{
unsigned char *bits;
int retval = 0;
@@ -3144,10 +3058,10 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
/* Check the software results against the hardware */
for (j = 0; j < nelmts; j++) {
underflow = 0;
- hw_f = 911.0f;
- hw_d = 911.0f;
+ hw_f = 911.0F;
+ hw_d = 911.0F;
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
- hw_ld = 911.0f;
+ hw_ld = 911.0L;
#endif
/* The hardware conversion */
@@ -3318,7 +3232,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst)
int expo_diff = check_expo[0] - check_expo[1];
int valid_bits =
(int)((dst_ebias + dst_msize) + (size_t)MIN(check_expo[0], check_expo[1])) - 1;
- double epsilon = 1.0F;
+ double epsilon = 1.0;
/* Re-scale the mantissas based on any exponent difference */
if (expo_diff != 0)
@@ -5402,9 +5316,6 @@ main(void)
* for user-defined integer types */
nerrors += (unsigned long)test_derived_integer();
- /* Does floating point overflow generate a SIGFPE? */
- generates_sigfpe();
-
/* Test degenerate cases */
nerrors += (unsigned long)run_fp_tests("noop");
diff --git a/test/dtransform.c b/test/dtransform.c
index 23d09ac..743103f 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -18,12 +18,12 @@
#define FLOAT_TOL 0.0001F
static int init_test(hid_t file_id);
-static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy);
-static int test_trivial(const hid_t dxpl_id_simple);
-static int test_poly(const hid_t dxpl_id_polynomial);
+static int test_copy(hid_t dxpl_id_c_to_f_copy, hid_t dxpl_id_polynomial_copy);
+static int test_trivial(hid_t dxpl_id_simple);
+static int test_poly(hid_t dxpl_id_polynomial);
static int test_specials(hid_t file);
static int test_set(void);
-static int test_getset(const hid_t dxpl_id_simple);
+static int test_getset(hid_t dxpl_id_simple);
/* These are needed for multiple tests, so are declared here globally and are init'ed in init_test */
hid_t dset_id_int = -1;
@@ -32,30 +32,30 @@ hid_t dset_id_int_chunk = -1;
hid_t dset_id_float_chunk = -1;
const float windchillFfloat[ROWS][COLS] = {
- {36.0f, 31.0f, 25.0f, 19.0f, 13.0f, 7.0f, 1.0f, -5.0f, -11.0f, -16.0f, -22.0f, -28.0f, -34.0f, -40.0f,
- -46.0f, -52.0f, -57.0f, -63.0f},
- {34.0f, 27.0f, 21.0f, 15.0f, 9.0f, 3.0f, -4.0f, -10.0f, -16.0f, -22.0f, -28.0f, -35.0f, -41.0f, -47.0f,
- -53.0f, -59.0f, -66.0f, -72.0f},
- {32.0f, 25.0f, 19.0f, 13.0f, 6.0f, 0.0f, -7.0f, -13.0f, -19.0f, -26.0f, -32.0f, -39.0f, -45.0f, -51.0f,
- -58.0f, -64.0f, -71.0f, -77.0f},
- {30.0f, 24.0f, 17.0f, 11.0f, 4.0f, -2.0f, -9.0f, -15.0f, -22.0f, -29.0f, -35.0f, -42.0f, -48.0f, -55.0f,
- -61.0f, -68.0f, -74.0f, -81.0f},
- {29.0f, 23.0f, 16.0f, 9.0f, 3.0f, -4.0f, -11.0f, -17.0f, -24.0f, -31.0f, -37.0f, -44.0f, -51.0f, -58.0f,
- -64.0f, -71.0f, -78.0f, -84.0f},
- {28.0f, 22.0f, 15.0f, 8.0f, 1.0f, -5.0f, -12.0f, -19.0f, -26.0f, -33.0f, -39.0f, -46.0f, -53.0f, -60.0f,
- -67.0f, -73.0f, -80.0f, -87.0f},
- {28.0f, 21.0f, 14.0f, 7.0f, 0.0f, -7.0f, -14.0f, -21.0f, -27.0f, -34.0f, -41.0f, -48.0f, -55.0f, -62.0f,
- -69.0f, -76.0f, -82.0f, -89.0f},
- {27.0f, 20.0f, 13.0f, 6.0f, -1.0f, -8.0f, -15.0f, -22.0f, -29.0f, -36.0f, -43.0f, -50.0f, -57.0f, -64.0f,
- -71.0f, -78.0f, -84.0f, -91.0f},
- {26.0f, 19.0f, 12.0f, 5.0f, -2.0f, -9.0f, -16.0f, -23.0f, -30.0f, -37.0f, -44.0f, -51.0f, -58.0f, -65.0f,
- -72.0f, -79.0f, -86.0f, -93.0f},
- {26.0f, 19.0f, 12.0f, 4.0f, -3.0f, -10.0f, -17.0f, -24.0f, -31.0f, -38.0f, -45.0f, -52.0f, -60.0f, -67.0f,
- -74.0f, -81.0f, -88.0f, -95.0f},
- {25.0f, 18.0f, 11.0f, 4.0f, -3.0f, -11.0f, -18.0f, -25.0f, -32.0f, -39.0f, -46.0f, -54.0f, -61.0f, -68.0f,
- -75.0f, -82.0f, -89.0f, -97.0f},
- {25.0f, 17.0f, 10.0f, 3.0f, -4.0f, -11.0f, -19.0f, -26.0f, -33.0f, -40.0f, -48.0f, -55.0f, -62.0f, -69.0f,
- -76.0f, -84.0f, -91.0f, -98.0f}};
+ {36.0F, 31.0F, 25.0F, 19.0F, 13.0F, 7.0F, 1.0F, -5.0F, -11.0F, -16.0F, -22.0F, -28.0F, -34.0F, -40.0F,
+ -46.0F, -52.0F, -57.0F, -63.0F},
+ {34.0F, 27.0F, 21.0F, 15.0F, 9.0F, 3.0F, -4.0F, -10.0F, -16.0F, -22.0F, -28.0F, -35.0F, -41.0F, -47.0F,
+ -53.0F, -59.0F, -66.0F, -72.0F},
+ {32.0F, 25.0F, 19.0F, 13.0F, 6.0F, 0.0F, -7.0F, -13.0F, -19.0F, -26.0F, -32.0F, -39.0F, -45.0F, -51.0F,
+ -58.0F, -64.0F, -71.0F, -77.0F},
+ {30.0F, 24.0F, 17.0F, 11.0F, 4.0F, -2.0F, -9.0F, -15.0F, -22.0F, -29.0F, -35.0F, -42.0F, -48.0F, -55.0F,
+ -61.0F, -68.0F, -74.0F, -81.0F},
+ {29.0F, 23.0F, 16.0F, 9.0F, 3.0F, -4.0F, -11.0F, -17.0F, -24.0F, -31.0F, -37.0F, -44.0F, -51.0F, -58.0F,
+ -64.0F, -71.0F, -78.0F, -84.0F},
+ {28.0F, 22.0F, 15.0F, 8.0F, 1.0F, -5.0F, -12.0F, -19.0F, -26.0F, -33.0F, -39.0F, -46.0F, -53.0F, -60.0F,
+ -67.0F, -73.0F, -80.0F, -87.0F},
+ {28.0F, 21.0F, 14.0F, 7.0F, 0.0F, -7.0F, -14.0F, -21.0F, -27.0F, -34.0F, -41.0F, -48.0F, -55.0F, -62.0F,
+ -69.0F, -76.0F, -82.0F, -89.0F},
+ {27.0F, 20.0F, 13.0F, 6.0F, -1.0F, -8.0F, -15.0F, -22.0F, -29.0F, -36.0F, -43.0F, -50.0F, -57.0F, -64.0F,
+ -71.0F, -78.0F, -84.0F, -91.0F},
+ {26.0F, 19.0F, 12.0F, 5.0F, -2.0F, -9.0F, -16.0F, -23.0F, -30.0F, -37.0F, -44.0F, -51.0F, -58.0F, -65.0F,
+ -72.0F, -79.0F, -86.0F, -93.0F},
+ {26.0F, 19.0F, 12.0F, 4.0F, -3.0F, -10.0F, -17.0F, -24.0F, -31.0F, -38.0F, -45.0F, -52.0F, -60.0F, -67.0F,
+ -74.0F, -81.0F, -88.0F, -95.0F},
+ {25.0F, 18.0F, 11.0F, 4.0F, -3.0F, -11.0F, -18.0F, -25.0F, -32.0F, -39.0F, -46.0F, -54.0F, -61.0F, -68.0F,
+ -75.0F, -82.0F, -89.0F, -97.0F},
+ {25.0F, 17.0F, 10.0F, 3.0F, -4.0F, -11.0F, -19.0F, -26.0F, -33.0F, -40.0F, -48.0F, -55.0F, -62.0F, -69.0F,
+ -76.0F, -84.0F, -91.0F, -98.0F}};
const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, 28, 34, 40, 46, 52, 57, 63},
{34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 1},
@@ -77,9 +77,9 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22,
for (i = 0; i < ROWS; i++) \
for (j = 0; j < COLS; j++) { \
if (!((((VAR1)[i][j] >= (TYPE)((VAR2)[i][j])) && \
- (((VAR1)[i][j] - TOL) < (TYPE)((VAR2)[i][j]))) || \
+ (((VAR1)[i][j] - (TOL)) < (TYPE)((VAR2)[i][j]))) || \
(((VAR1)[i][j] <= (TYPE)((VAR2)[i][j])) && \
- (((VAR1)[i][j] + TOL) > (TYPE)((VAR2)[i][j]))))) { \
+ (((VAR1)[i][j] + (TOL)) > (TYPE)((VAR2)[i][j]))))) { \
H5_FAILED(); \
HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \
goto error; \
@@ -94,8 +94,8 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22,
\
for (i = 0; i < ROWS; i++) \
for (j = 0; j < COLS; j++) { \
- if (!(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + TOL)) && \
- ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - TOL)))) { \
+ if (!(((VAR1)[i][j] <= ((TYPE)(VAR2)[i][j] + (TOL))) && \
+ ((VAR1)[i][j] >= ((TYPE)(VAR2)[i][j] - (TOL))))) { \
H5_FAILED(); \
HDfprintf(stderr, " ERROR: Conversion failed to match computed data\n"); \
goto error; \
@@ -540,19 +540,19 @@ test_poly(const hid_t dxpl_id_polynomial)
for (row = 0; row < ROWS; row++)
for (col = 0; col < COLS; col++) {
- windchillC = (int)((5.0f / 9.0f) * (windchillFfloat[row][col] - 32));
- polyflres[row][col] = ((2.0f + (float)windchillC) * (((float)windchillC - 8.0f) / 2.0f));
+ windchillC = (int)((5.0F / 9.0F) * (windchillFfloat[row][col] - 32));
+ polyflres[row][col] = ((2.0F + (float)windchillC) * (((float)windchillC - 8.0F) / 2.0F));
}
TESTING("data transform, polynomial transform (int->float)")
if (H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread) < 0)
TEST_ERROR
- COMPARE(float, polyflread, polyflres, 2.0f)
+ COMPARE(float, polyflread, polyflres, 2.0F)
for (row = 0; row < ROWS; row++)
for (col = 0; col < COLS; col++) {
- windchillC = (int)((5.0f / 9.0f) * (windchillFfloat[row][col] - 32));
+ windchillC = (int)((5.0F / 9.0F) * (windchillFfloat[row][col] - 32));
polyflres[row][col] = (float)((2 + windchillC) * ((windchillC - 8) / 2));
}
@@ -582,6 +582,7 @@ test_specials(hid_t file)
const char *special4 = "-x";
const char *special5 = "+x";
const char *special6 = "2e+1*x";
+ const char *special7 = "x";
TESTING("data transform of some special cases")
@@ -729,6 +730,32 @@ test_specials(hid_t file)
if (H5Dclose(dset_id) < 0)
TEST_ERROR
+ /*-----------------------------
+ * Operation 7: x
+ * This operation will be
+ * treated if no function has
+ * been specified.
+ *----------------------------*/
+ if (H5Pset_data_transform(dxpl_id, special7) < 0)
+ TEST_ERROR;
+
+ for (row = 0; row < ROWS; row++)
+ for (col = 0; col < COLS; col++)
+ data_res[row][col] = transformData[row][col];
+
+ if ((dset_id = H5Dcreate2(file, "/special7", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0)
+ TEST_ERROR
+ if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0)
+ TEST_ERROR
+
+ COMPARE_INT(read_buf, data_res)
+
+ if (H5Dclose(dset_id) < 0)
+ TEST_ERROR
+
if (H5Pclose(dxpl_id) < 0)
TEST_ERROR
if (H5Sclose(dataspace) < 0)
@@ -752,7 +779,7 @@ test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy)
for (row = 0; row < ROWS; row++)
for (col = 0; col < COLS; col++) {
- windchillC = (int)((5.0f / 9.0f) * (windchillFfloat[row][col] - 32));
+ windchillC = (int)((5.0F / 9.0F) * (windchillFfloat[row][col] - 32));
polyflres[row][col] = (float)((2 + windchillC) * ((windchillC - 8) / 2));
}
@@ -786,7 +813,7 @@ test_trivial(const hid_t dxpl_id_simple)
TEST_ERROR
for (row = 0; row < ROWS; row++)
for (col = 0; col < COLS; col++) {
- if ((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL)
+ if ((windchillFfloatread[row][col] - 4.8F) > FLOAT_TOL)
FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n");
}
@@ -843,7 +870,7 @@ test_getset(const hid_t dxpl_id_c_to_f)
for (row = 0; row < ROWS; row++)
for (col = 0; col < COLS; col++) {
- if ((windchillFfloatread[row][col] - 4.8f) > FLOAT_TOL)
+ if ((windchillFfloatread[row][col] - 4.8F) > FLOAT_TOL)
FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n")
}
@@ -938,7 +965,10 @@ test_set(void)
error:
if (ptrgetTest)
HDfree(ptrgetTest);
- H5E_BEGIN_TRY { H5Pclose(dxpl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dxpl_id);
+ }
H5E_END_TRY
return -1;
diff --git a/test/dtypes.c b/test/dtypes.c
index 27d31d4..8b3101c 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -70,7 +70,7 @@
FAIL_STACK_ERROR \
if ((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \
H5_FAILED(); \
- HDprintf(" #dtype ids expected: %lld; found: %lld\n", (long long)NMEMBS, \
+ HDprintf(" #dtype ids expected: %lld; found: %lld\n", (long long)(NMEMBS), \
(long long)H5I_nmembers(H5I_DATATYPE)); \
goto error; \
}
@@ -312,7 +312,10 @@ test_copy(void)
goto error;
/* We should not be able to close a built-in byte */
- H5E_BEGIN_TRY { status = H5Tclose(H5T_NATIVE_SCHAR); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tclose(H5T_NATIVE_SCHAR);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -598,7 +601,10 @@ test_compound_1(void)
goto error;
/* Attempt to add the new compound datatype as a field within itself */
- H5E_BEGIN_TRY { ret = H5Tinsert(complex_id, "compound", (size_t)0, complex_id); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tinsert(complex_id, "compound", (size_t)0, complex_id);
+ }
H5E_END_TRY;
if (ret >= 0) {
FAIL_PUTS_ERROR("Inserted compound datatype into itself?");
@@ -612,56 +618,83 @@ test_compound_1(void)
/* Test some functions that aren't supposed to work for compound type */
/* Tries to shrink the size and trail the last member */
- H5E_BEGIN_TRY { ret = H5Tset_size(complex_id, sizeof(double)); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_size(complex_id, sizeof(double));
+ }
H5E_END_TRY;
if (ret >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { size = H5Tget_precision(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ size = H5Tget_precision(complex_id);
+ }
H5E_END_TRY;
if (size > 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
size = 128;
- H5E_BEGIN_TRY { ret = H5Tset_precision(complex_id, size); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_precision(complex_id, size);
+ }
H5E_END_TRY;
if (ret >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { ret = H5Tget_pad(complex_id, &lsb, &msb); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tget_pad(complex_id, &lsb, &msb);
+ }
H5E_END_TRY;
if (ret >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { size = H5Tget_ebias(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ size = H5Tget_ebias(complex_id);
+ }
H5E_END_TRY;
if (size > 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { lsb = H5Tget_inpad(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ lsb = H5Tget_inpad(complex_id);
+ }
H5E_END_TRY;
if (lsb >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { cset = H5Tget_cset(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ cset = H5Tget_cset(complex_id);
+ }
H5E_END_TRY;
if (cset > -1) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { strpad = H5Tget_strpad(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ strpad = H5Tget_strpad(complex_id);
+ }
H5E_END_TRY;
if (strpad > -1) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { offset = H5Tget_offset(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ offset = H5Tget_offset(complex_id);
+ }
H5E_END_TRY;
if (offset >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
@@ -673,19 +706,28 @@ test_compound_1(void)
if (order != H5T_ORDER_LE && order != H5T_ORDER_BE)
FAIL_PUTS_ERROR("Wrong order for this type.");
- H5E_BEGIN_TRY { sign = H5Tget_sign(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ sign = H5Tget_sign(complex_id);
+ }
H5E_END_TRY;
if (sign > -1) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { tag = H5Tget_tag(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ tag = H5Tget_tag(complex_id);
+ }
H5E_END_TRY;
if (tag) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { super = H5Tget_super(complex_id); }
+ H5E_BEGIN_TRY
+ {
+ super = H5Tget_super(complex_id);
+ }
H5E_END_TRY;
if (super >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
@@ -741,9 +783,12 @@ test_compound_2(void)
FAIL_STACK_ERROR
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st));
+ if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)))))
+ goto error;
+ if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt))))
+ goto error;
+ if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st))))
+ goto error;
for (i = 0; i < (int)nelmts; i++) {
s_ptr = ((struct st *)((void *)orig)) + i;
s_ptr->a = i * 8 + 0;
@@ -815,6 +860,10 @@ test_compound_2(void)
return 0;
error:
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
+
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
@@ -861,9 +910,12 @@ test_compound_3(void)
FAIL_STACK_ERROR
/* Initialize */
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st));
+ if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)))))
+ goto error;
+ if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt))))
+ goto error;
+ if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st))))
+ goto error;
for (i = 0; i < (int)nelmts; i++) {
s_ptr = ((struct st *)((void *)orig)) + i;
s_ptr->a = i * 8 + 0;
@@ -931,6 +983,10 @@ test_compound_3(void)
return 0;
error:
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
+
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
@@ -981,9 +1037,12 @@ test_compound_4(void)
FAIL_STACK_ERROR
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st));
+ if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)))))
+ goto error;
+ if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt))))
+ goto error;
+ if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st))))
+ goto error;
for (i = 0; i < (int)nelmts; i++) {
s_ptr = ((struct st *)((void *)orig)) + i;
s_ptr->a = i * 8 + 0;
@@ -1054,6 +1113,10 @@ test_compound_4(void)
return 0;
error:
+ HDfree(buf);
+ HDfree(bkg);
+ HDfree(orig);
+
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
@@ -1104,6 +1167,12 @@ test_compound_5(void)
TESTING("optimized struct converter");
+ if (!buf || !bkg) {
+ HDfree(buf);
+ HDfree(bkg);
+ return 1;
+ }
+
/* Build datatypes */
short_array = H5Tcreate(H5T_COMPOUND, 4 * sizeof(short));
array_dt = H5Tarray_create2(H5T_NATIVE_SHORT, 1, dims);
@@ -1141,7 +1210,7 @@ test_compound_5(void)
H5Tclose(int_array);
/* Check results */
- if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim ||
+ if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim ||
src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] ||
src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) {
H5_FAILED();
@@ -1196,9 +1265,12 @@ test_compound_6(void)
FAIL_STACK_ERROR
/* Sizes should be the same, but be careful just in case */
- buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)));
- bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt));
- orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st));
+ if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt)))))
+ goto error;
+ if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt))))
+ goto error;
+ if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st))))
+ goto error;
for (i = 0; i < (int)nelmts; i++) {
s_ptr = ((struct st *)((void *)orig)) + i;
s_ptr->b = (int16_t)((i * 8 + 1) & 0x7fff);
@@ -1347,7 +1419,10 @@ test_compound_7(void)
} /* end if */
/* Should not be able to insert field past end of compound datatype */
- H5E_BEGIN_TRY { ret = H5Tinsert(tid2, "d", HOFFSET(struct s2, d), H5T_NATIVE_DOUBLE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tinsert(tid2, "d", HOFFSET(struct s2, d), H5T_NATIVE_DOUBLE);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -1356,7 +1431,10 @@ test_compound_7(void)
} /* end if */
/* Should not be able to shrink size of compound datatype */
- H5E_BEGIN_TRY { ret = H5Tset_size(tid2, sizeof(struct s1) / 2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_size(tid2, sizeof(struct s1) / 2);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -1434,10 +1512,10 @@ test_compound_8(void)
int b;
} s1;
- typedef struct s2 {
+ struct s2 {
char c;
s1 d;
- } s2;
+ };
hid_t tid1, tid1_copy, tid2, tid2_copy, tid3, arr_tid;
size_t tsize;
hsize_t dims[1] = {ARRAY_DIM};
@@ -1590,7 +1668,10 @@ test_compound_8(void)
} /* end if */
/* If the type is not packed, packing a locked type shouldn't work */
- H5E_BEGIN_TRY { ret = H5Tpack(tid3); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tpack(tid3);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -1817,7 +1898,7 @@ test_compound_9(void)
goto error;
} /* end if */
- if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
+ if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
@@ -1891,7 +1972,7 @@ test_compound_9(void)
goto error;
} /* end if */
- if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
+ if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
@@ -2081,7 +2162,7 @@ test_compound_10(void)
for (i = 0; i < ARRAY_DIM; i++) {
if (rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 ||
- HDstrcmp(rdata[i].str, wdata[i].str)) {
+ HDstrcmp(rdata[i].str, wdata[i].str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
@@ -2097,7 +2178,7 @@ test_compound_10(void)
t1 = rdata[i].text.p;
t2 = wdata[i].text.p;
- if (HDstrcmp((char *)t1, (char *)t2)) {
+ if (HDstrcmp((char *)t1, (char *)t2) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect VL read data\n");
@@ -2233,12 +2314,14 @@ test_compound_11(void)
/* Initialize buffer */
for (u = 0; u < NTESTELEM; u++) {
- ((big_t *)buf)[u].d1 = (double)u * (double)1.5f;
- ((big_t *)buf)[u].d2 = (double)u * (double)2.5f;
- ((big_t *)buf)[u].d3 = (double)u * (double)3.5f;
+ ((big_t *)buf)[u].d1 = (double)u * 1.5;
+ ((big_t *)buf)[u].d2 = (double)u * 2.5;
+ ((big_t *)buf)[u].d3 = (double)u * 3.5;
((big_t *)buf)[u].i1 = (int)(u * 3);
((big_t *)buf)[u].i2 = (int)(u * 5);
((big_t *)buf)[u].s1 = (char *)HDmalloc((size_t)32);
+ if (!((big_t *)buf)[u].s1)
+ TEST_ERROR
HDsprintf(((big_t *)buf)[u].s1, "%u", (unsigned)u);
} /* end for */
@@ -2282,7 +2365,7 @@ test_compound_11(void)
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
- else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) {
+ else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) {
HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u,
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
@@ -2333,7 +2416,7 @@ test_compound_11(void)
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
- else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) {
+ else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) {
HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u,
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
@@ -2374,7 +2457,7 @@ test_compound_11(void)
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
- else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) {
+ else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) {
HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u,
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
@@ -2498,7 +2581,10 @@ test_compound_12(void)
/* Tries to cut last member. Supposed to fail. */
size--;
- H5E_BEGIN_TRY { ret = H5Tset_size(complex_id, size); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_size(complex_id, size);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -2956,14 +3042,14 @@ test_compound_14(void)
goto error;
} /* end if */
- if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) {
+ if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
goto error;
} /* end if */
- if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) ||
+ if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 ||
rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 ||
rdata2.l4 != wdata2.l4) {
H5_FAILED();
@@ -3054,14 +3140,14 @@ test_compound_14(void)
goto error;
} /* end if */
- if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) {
+ if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
goto error;
} /* end if */
- if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) ||
+ if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 ||
rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 ||
rdata2.l4 != wdata2.l4) {
H5_FAILED();
@@ -3594,7 +3680,10 @@ test_compound_18(void)
HDassert(sid > 0);
/* Create a dataset with the bad compound datatype */
- H5E_BEGIN_TRY { did = H5Dcreate2(file, "dataset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dcreate2(file, "dataset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (did > 0) {
H5Dclose(did);
@@ -3606,7 +3695,10 @@ test_compound_18(void)
HDassert(gid > 0);
/* Create an attribute with the bad compound datatype */
- H5E_BEGIN_TRY { aid = H5Acreate2(gid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ aid = H5Acreate2(gid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (aid > 0) {
H5Aclose(aid);
@@ -3614,7 +3706,10 @@ test_compound_18(void)
} /* end if */
/* Commit the datatype */
- H5E_BEGIN_TRY { ret = H5Tcommit2(file, "cmpnd", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tcommit2(file, "cmpnd", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (ret >= 0) {
FAIL_PUTS_ERROR("committed named datatype with bad compound datatype")
@@ -3636,7 +3731,10 @@ test_compound_18(void)
FAIL_STACK_ERROR
/* Try to open the datatype */
- H5E_BEGIN_TRY { tid = H5Topen2(file, "cmpnd", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tid = H5Topen2(file, "cmpnd", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (tid > 0) {
H5Tclose(tid);
@@ -3644,7 +3742,10 @@ test_compound_18(void)
} /* end if */
/* Try to open the dataset */
- H5E_BEGIN_TRY { did = H5Dopen2(file, "dataset", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(file, "dataset", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (did > 0) {
H5Dclose(did);
@@ -3656,7 +3757,10 @@ test_compound_18(void)
TEST_ERROR
/* Try to open the dataset */
- H5E_BEGIN_TRY { aid = H5Aopen(gid, "attr", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ aid = H5Aopen(gid, "attr", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (aid > 0) {
H5Aclose(aid);
@@ -3885,7 +3989,7 @@ test_query(void)
HDprintf("Can't get name for enum member\n");
goto error;
} /* end if */
- if (HDstrcmp("YELLOW", enum_name)) {
+ if (HDstrcmp("YELLOW", enum_name) != 0) {
H5_FAILED();
HDprintf("Incorrect name for enum member\n");
goto error;
@@ -3958,14 +4062,20 @@ test_transient(hid_t fapl)
goto error;
/* Predefined types cannot be modified or closed */
- H5E_BEGIN_TRY { status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tset_precision(H5T_NATIVE_INT, (size_t)256);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
HDputs(" Predefined types should not be modifiable!");
goto error;
}
- H5E_BEGIN_TRY { status = H5Tclose(H5T_NATIVE_INT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tclose(H5T_NATIVE_INT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -3980,7 +4090,10 @@ test_transient(hid_t fapl)
goto error;
/* It should not be possible to create an attribute for a transient type */
- H5E_BEGIN_TRY { ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret_id = H5Acreate2(type, "attr1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (ret_id >= 0) {
H5_FAILED();
@@ -3999,7 +4112,10 @@ test_transient(hid_t fapl)
/* The type returned from a dataset should not be modifiable */
if ((t2 = H5Dget_type(dset)) < 0)
goto error;
- H5E_BEGIN_TRY { status = H5Tset_precision(t2, (size_t)256); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tset_precision(t2, (size_t)256);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -4019,7 +4135,10 @@ test_transient(hid_t fapl)
goto error;
if ((t2 = H5Dget_type(dset)) < 0)
goto error;
- H5E_BEGIN_TRY { status = H5Tset_precision(t2, (size_t)256); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tset_precision(t2, (size_t)256);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -4127,7 +4246,10 @@ test_named(hid_t fapl)
}
/* We should not be able to modify a type after it has been committed. */
- H5E_BEGIN_TRY { status = H5Tset_precision(type, (size_t)256); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tset_precision(type, (size_t)256);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -4325,7 +4447,10 @@ test_named(hid_t fapl)
/* Verify that H5Tcommit_anon returns an error */
if ((type = H5Tcopy(H5T_NATIVE_INT)) < 0)
goto error;
- H5E_BEGIN_TRY { status = H5Tcommit_anon(file, type, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tcommit_anon(file, type, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -4504,14 +4629,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Truncated C-string test failed");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Extended C-string test failed");
goto error;
@@ -4535,14 +4660,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Truncated C buffer test failed");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Extended C buffer test failed");
goto error;
@@ -4566,14 +4691,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Truncated Fortran-string test failed");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde abcde ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde abcde ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Extended Fortran-string test failed");
goto error;
@@ -4600,7 +4725,7 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Non-terminated string test 1");
goto error;
@@ -4611,7 +4736,7 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Non-terminated string test 2");
goto error;
@@ -4619,7 +4744,7 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdeabcdexxxxxxxxxx", (size_t)20);
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Non-terminated string test 2");
goto error;
@@ -4643,14 +4768,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C string to Fortran test 1");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C string test 1");
goto error;
@@ -4662,14 +4787,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C string to Fortran test 2");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C string test 2");
goto error;
@@ -4685,14 +4810,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C string to Fortran test 3");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C string test 3");
goto error;
@@ -4716,14 +4841,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C buffer to Fortran test 1");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C buffer test 1");
goto error;
@@ -4735,14 +4860,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C buffer to Fortran test 2");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C buffer test 2");
goto error;
@@ -4758,14 +4883,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C buffer to Fortran test 3");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C buffer test 3");
goto error;
@@ -4935,37 +5060,55 @@ test_conv_str_3(void)
if (H5Tget_order(type) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { ret = H5Tset_precision(type, nelmts); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_precision(type, nelmts);
+ }
H5E_END_TRY;
if (ret >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { size = H5Tget_ebias(type); }
+ H5E_BEGIN_TRY
+ {
+ size = H5Tget_ebias(type);
+ }
H5E_END_TRY;
if (size > 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { inpad = H5Tget_inpad(type); }
+ H5E_BEGIN_TRY
+ {
+ inpad = H5Tget_inpad(type);
+ }
H5E_END_TRY;
if (inpad > -1) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { sign = H5Tget_sign(type); }
+ H5E_BEGIN_TRY
+ {
+ sign = H5Tget_sign(type);
+ }
H5E_END_TRY;
if (sign > -1) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { tag = H5Tget_tag(type); }
+ H5E_BEGIN_TRY
+ {
+ tag = H5Tget_tag(type);
+ }
H5E_END_TRY;
if (tag) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
} /* end if */
- H5E_BEGIN_TRY { super = H5Tget_super(type); }
+ H5E_BEGIN_TRY
+ {
+ super = H5Tget_super(type);
+ }
H5E_END_TRY;
if (super >= 0) {
FAIL_PUTS_ERROR("Operation not allowed for this type.");
@@ -5298,7 +5441,10 @@ test_bitfield_funcs(void)
if ((ntype = H5Tget_native_type(type, H5T_DIR_ASCEND)) < 0)
goto error;
- H5E_BEGIN_TRY { size = H5Tget_ebias(type); }
+ H5E_BEGIN_TRY
+ {
+ size = H5Tget_ebias(type);
+ }
H5E_END_TRY;
if (size > 0) {
H5_FAILED();
@@ -5306,7 +5452,10 @@ test_bitfield_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { inpad = H5Tget_inpad(type); }
+ H5E_BEGIN_TRY
+ {
+ inpad = H5Tget_inpad(type);
+ }
H5E_END_TRY;
if (inpad > -1) {
H5_FAILED();
@@ -5314,7 +5463,10 @@ test_bitfield_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { cset = H5Tget_cset(type); }
+ H5E_BEGIN_TRY
+ {
+ cset = H5Tget_cset(type);
+ }
H5E_END_TRY;
if (cset > -1) {
H5_FAILED();
@@ -5322,7 +5474,10 @@ test_bitfield_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { strpad = H5Tget_strpad(type); }
+ H5E_BEGIN_TRY
+ {
+ strpad = H5Tget_strpad(type);
+ }
H5E_END_TRY;
if (strpad > -1) {
H5_FAILED();
@@ -5330,7 +5485,10 @@ test_bitfield_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { ret = H5Tset_sign(type, H5T_SGN_2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_sign(type, H5T_SGN_2);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -5338,7 +5496,10 @@ test_bitfield_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { tag = H5Tget_tag(type); }
+ H5E_BEGIN_TRY
+ {
+ tag = H5Tget_tag(type);
+ }
H5E_END_TRY;
if (tag) {
H5_FAILED();
@@ -5346,7 +5507,10 @@ test_bitfield_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { super = H5Tget_super(type); }
+ H5E_BEGIN_TRY
+ {
+ super = H5Tget_super(type);
+ }
H5E_END_TRY;
if (super >= 0) {
H5_FAILED();
@@ -5471,7 +5635,10 @@ opaque_check(int tag_it)
}
/* Make sure that we can't convert between the types yet */
- H5E_BEGIN_TRY { status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -5540,7 +5707,10 @@ opaque_long(void)
long_tag[16384] = '\0';
/* Set opaque type's tag */
- H5E_BEGIN_TRY { ret = H5Tset_tag(dt, long_tag); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_tag(dt, long_tag);
+ }
H5E_END_TRY;
if (ret != FAIL)
TEST_ERROR
@@ -5596,63 +5766,90 @@ opaque_funcs(void)
if ((size = H5Tget_size(type)) == 0)
goto error;
- H5E_BEGIN_TRY { ret = H5Tset_precision(type, (size_t)32); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_precision(type, (size_t)32);
+ }
H5E_END_TRY;
if (ret >= 0) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { ret = H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE);
+ }
H5E_END_TRY;
if (ret >= 0) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { size = H5Tget_ebias(type); }
+ H5E_BEGIN_TRY
+ {
+ size = H5Tget_ebias(type);
+ }
H5E_END_TRY;
if (size > 0) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { inpad = H5Tget_inpad(type); }
+ H5E_BEGIN_TRY
+ {
+ inpad = H5Tget_inpad(type);
+ }
H5E_END_TRY;
if (inpad > -1) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { cset = H5Tget_cset(type); }
+ H5E_BEGIN_TRY
+ {
+ cset = H5Tget_cset(type);
+ }
H5E_END_TRY;
if (cset > -1) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { strpad = H5Tget_strpad(type); }
+ H5E_BEGIN_TRY
+ {
+ strpad = H5Tget_strpad(type);
+ }
H5E_END_TRY;
if (strpad > -1) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { ret = H5Tset_offset(type, (size_t)16); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_offset(type, (size_t)16);
+ }
H5E_END_TRY;
if (ret >= 0) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { sign = H5Tget_sign(type); }
+ H5E_BEGIN_TRY
+ {
+ sign = H5Tget_sign(type);
+ }
H5E_END_TRY;
if (sign > -1) {
HDprintf("Operation not allowed for this type.\n");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { super = H5Tget_super(type); }
+ H5E_BEGIN_TRY
+ {
+ super = H5Tget_super(type);
+ }
H5E_END_TRY;
if (super >= 0) {
HDprintf("Operation not allowed for this type.\n");
@@ -5810,7 +6007,10 @@ test_encode(void)
cmpd_buf = (unsigned char *)HDcalloc((size_t)1, cmpd_buf_size);
/* Try decoding bogus buffer */
- H5E_BEGIN_TRY { ret_id = H5Tdecode(cmpd_buf); }
+ H5E_BEGIN_TRY
+ {
+ ret_id = H5Tdecode(cmpd_buf);
+ }
H5E_END_TRY;
if (ret_id != FAIL) {
H5_FAILED();
@@ -6159,7 +6359,10 @@ test_encode(void)
} /* end if */
/* Make sure the decoded datatypes are already closed. */
- H5E_BEGIN_TRY { ret = H5Tclose(decoded_tid1); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tclose(decoded_tid1);
+ }
H5E_END_TRY;
if (ret != FAIL) {
H5_FAILED();
@@ -6167,7 +6370,10 @@ test_encode(void)
goto error;
}
- H5E_BEGIN_TRY { ret = H5Tclose(decoded_tid2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tclose(decoded_tid2);
+ }
H5E_END_TRY;
if (ret != FAIL) {
H5_FAILED();
@@ -6175,7 +6381,10 @@ test_encode(void)
goto error;
}
- H5E_BEGIN_TRY { ret = H5Tclose(decoded_tid3); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tclose(decoded_tid3);
+ }
H5E_END_TRY;
if (ret != FAIL) {
H5_FAILED();
@@ -6474,13 +6683,13 @@ static int
test_int_float_except(void)
{
#if H5_SIZEOF_INT == 4 && H5_SIZEOF_FLOAT == 4
- float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0f, (float)INT_MAX - 32.0f, (float)INT_MAX - 68.0f,
- (float)4.5f};
+ float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0F, (float)INT_MAX - 32.0F, (float)INT_MAX - 68.0F,
+ (float)4.5F};
int buf_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 4};
- float buf_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX + 1.0f, (float)INT_MAX - 127.0f, 4};
+ float buf_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX + 1.0F, (float)INT_MAX - 127.0F, 4};
int * intp; /* Pointer to buffer, as integers */
int buf2[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 72, 0};
- float buf2_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX, (float)INT_MAX - 127.0f, (float)0.0f};
+ float buf2_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX, (float)INT_MAX - 127.0F, (float)0.0F};
int buf2_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 0};
float *floatp; /* Pointer to buffer #2, as floats */
hid_t dxpl; /* Dataset transfer property list */
@@ -6610,7 +6819,10 @@ test_int_float_except(void)
#if H5_SIZEOF_INT == 4 && H5_SIZEOF_FLOAT == 4
error:
- H5E_BEGIN_TRY { H5Pclose(dxpl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dxpl);
+ }
H5E_END_TRY;
return 1;
#endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */
@@ -7193,7 +7405,7 @@ test_named_indirect_reopen(hid_t fapl)
TEST_ERROR
if (NULL == (tag_ret = H5Tget_tag(type)))
TEST_ERROR
- if (HDstrcmp(tag, tag_ret))
+ if (HDstrcmp(tag, tag_ret) != 0)
TEST_ERROR
H5free_memory(tag_ret);
tag_ret = NULL;
@@ -7209,7 +7421,7 @@ test_named_indirect_reopen(hid_t fapl)
TEST_ERROR
if (NULL == (tag_ret = H5Tget_tag(type)))
TEST_ERROR
- if (HDstrcmp(tag, tag_ret))
+ if (HDstrcmp(tag, tag_ret) != 0)
TEST_ERROR
H5free_memory(tag_ret);
tag_ret = NULL;
@@ -7788,7 +8000,10 @@ test_deprec(hid_t fapl)
FAIL_STACK_ERROR
/* Predefined types cannot be committed */
- H5E_BEGIN_TRY { status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" Predefined types should not be committable!")
@@ -7804,13 +8019,19 @@ test_deprec(hid_t fapl)
FAIL_PUTS_ERROR(" H5Tcommitted() returned false!")
/* We should not be able to modify a type after it has been committed. */
- H5E_BEGIN_TRY { status = H5Tset_precision(type, (size_t)256); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tset_precision(type, (size_t)256);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" Committed type is not constant!")
/* We should not be able to re-commit a committed type */
- H5E_BEGIN_TRY { status = H5Tcommit1(file, "test_named_2 (should not exist)", type); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tcommit1(file, "test_named_2 (should not exist)", type);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" Committed types should not be recommitted!")
@@ -7840,7 +8061,10 @@ test_deprec(hid_t fapl)
/* Verify that H5Tcommit2 returns an error */
if ((type = H5Tcopy(H5T_NATIVE_INT)) < 0)
goto error;
- H5E_BEGIN_TRY { status = H5Tcommit1(file, "test_named_3 (should not exist)", type); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tcommit1(file, "test_named_3 (should not exist)", type);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -7927,7 +8151,10 @@ test_utf_ascii_conv(void)
FAIL_STACK_ERROR
/* Test conversion in memory */
- H5E_BEGIN_TRY { status = H5Tconvert(utf8_vtid, ascii_vtid, 1, &utf8_w, NULL, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tconvert(utf8_vtid, ascii_vtid, 1, &utf8_w, NULL, H5P_DEFAULT);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -7950,7 +8177,10 @@ test_utf_ascii_conv(void)
FAIL_STACK_ERROR
/* Read the UTF8 string, as ASCII, supposed to fail */
- H5E_BEGIN_TRY { status = H5Dread(did, ascii_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii_r); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(did, ascii_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii_r);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -7963,7 +8193,10 @@ test_utf_ascii_conv(void)
* Test VL string conversion from ASCII to UTF8
************************************************/
/* Test conversion in memory */
- H5E_BEGIN_TRY { status = H5Tconvert(ascii_vtid, utf8_vtid, 1, &ascii_w, NULL, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tconvert(ascii_vtid, utf8_vtid, 1, &ascii_w, NULL, H5P_DEFAULT);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -7977,7 +8210,10 @@ test_utf_ascii_conv(void)
FAIL_STACK_ERROR
/* Read the ASCII string, as UTF8, supposed to fail */
- H5E_BEGIN_TRY { status = H5Dread(did, utf8_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_r); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(did, utf8_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_r);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -8020,7 +8256,10 @@ test_utf_ascii_conv(void)
FAIL_STACK_ERROR
/* Test conversion in memory */
- H5E_BEGIN_TRY { status = H5Tconvert(utf8_tid, ascii_tid, 1, utf8_2, NULL, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tconvert(utf8_tid, ascii_tid, 1, utf8_2, NULL, H5P_DEFAULT);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -8034,7 +8273,10 @@ test_utf_ascii_conv(void)
FAIL_STACK_ERROR
/* Read the UTF8 string as ASCII, supposed to fail */
- H5E_BEGIN_TRY { status = H5Dread(did, ascii_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii2); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(did, ascii_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii2);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -8047,7 +8289,10 @@ test_utf_ascii_conv(void)
* Test fixed-length string conversion from ASCII to UTF8
**********************************************************/
/* Test conversion in memory */
- H5E_BEGIN_TRY { status = H5Tconvert(ascii_tid, utf8_tid, 1, ascii2, NULL, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tconvert(ascii_tid, utf8_tid, 1, ascii2, NULL, H5P_DEFAULT);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -8061,7 +8306,10 @@ test_utf_ascii_conv(void)
FAIL_STACK_ERROR
/* Read the UTF8 string as ASCII, supposed to fail */
- H5E_BEGIN_TRY { status = H5Dread(did, utf8_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_2); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Dread(did, utf8_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_2);
+ }
H5E_END_TRY
if (status >= 0)
FAIL_STACK_ERROR
@@ -8441,7 +8689,10 @@ test_versionbounds(void)
for (high = 0; high < versions_count; high++) {
/* Set version bounds */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(fapl, versions[low], versions[high]); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(fapl, versions[low], versions[high]);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
diff --git a/test/earray.c b/test/earray.c
index 52908a7..337e818 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -122,7 +122,7 @@ typedef struct earray_iter_t {
hsize_t cnt); /* Initialize/allocate iterator private info */
hssize_t (*next)(void *info); /* Get the next element to test */
hssize_t (*max_elem)(const void *info); /* Get the max. element set */
- int (*state)(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam,
+ int (*state)(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam,
earray_state_t *state, hsize_t idx); /* Get the state of the extensible array */
herr_t (*term)(void *info); /* Shutdown/free iterator private info */
} earray_iter_t;
@@ -623,7 +623,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
/* Set invalid element size */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.raw_elmt_size = 0;
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -637,7 +640,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
/* Set invalid max. # of elements bits */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_nelmts_bits = 0;
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -650,7 +656,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_nelmts_bits = 65;
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -664,7 +673,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
/* Set invalid min. # of data block pointers in super blocks */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.sup_blk_min_data_ptrs = 0;
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -676,7 +688,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
} /* end if */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.sup_blk_min_data_ptrs = 1;
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -688,7 +703,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
} /* end if */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.sup_blk_min_data_ptrs = 6;
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -702,7 +720,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
/* Set invalid min. # of elements per data block */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.data_blk_min_elmts = 0;
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -718,7 +739,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits =
(uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1);
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -732,7 +756,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = 4; /* corresponds to 16 elements in data block page, which is
less than the 64 elements for the default settings */
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -744,7 +771,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
} /* end if */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(test_cparam.max_nelmts_bits + 1);
- H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened extensible array */
@@ -1178,7 +1208,10 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
ea2 = NULL;
/* Try re-opening the array again (should fail, as array will be deleted) */
- H5E_BEGIN_TRY { ea2 = H5EA_open(f, ea_addr, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea2 = H5EA_open(f, ea_addr, NULL);
+ }
H5E_END_TRY;
if (ea2) {
/* Close opened array */
@@ -1198,7 +1231,10 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* Try re-opening the array again (should fail, as array is now deleted) */
- H5E_BEGIN_TRY { ea = H5EA_open(f, ea_addr, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ea = H5EA_open(f, ea_addr, NULL);
+ }
H5E_END_TRY;
if (ea) {
/* Close opened array */
@@ -1290,9 +1326,9 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para
*-------------------------------------------------------------------------
*/
static hssize_t
-eiter_fw_next(void *_eiter)
+eiter_fw_next(void *in_eiter)
{
- eiter_fw_t *eiter = (eiter_fw_t *)_eiter;
+ eiter_fw_t *eiter = (eiter_fw_t *)in_eiter;
hssize_t ret_val;
/* Sanity check */
@@ -1318,9 +1354,9 @@ eiter_fw_next(void *_eiter)
*-------------------------------------------------------------------------
*/
static H5_ATTR_PURE hssize_t
-eiter_fw_max(const void *_eiter)
+eiter_fw_max(const void *in_eiter)
{
- const eiter_fw_t *eiter = (const eiter_fw_t *)_eiter;
+ const eiter_fw_t *eiter = (const eiter_fw_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -1343,10 +1379,10 @@ eiter_fw_max(const void *_eiter)
*-------------------------------------------------------------------------
*/
static int
-eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam,
+eiter_fw_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam,
earray_state_t *state, hsize_t idx)
{
- eiter_fw_t *eiter = (eiter_fw_t *)_eiter;
+ eiter_fw_t *eiter = (eiter_fw_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -1490,9 +1526,9 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, hs
*-------------------------------------------------------------------------
*/
static hssize_t
-eiter_rv_next(void *_eiter)
+eiter_rv_next(void *in_eiter)
{
- eiter_rv_t *eiter = (eiter_rv_t *)_eiter;
+ eiter_rv_t *eiter = (eiter_rv_t *)in_eiter;
hssize_t ret_val;
/* Sanity check */
@@ -1518,9 +1554,9 @@ eiter_rv_next(void *_eiter)
*-------------------------------------------------------------------------
*/
static H5_ATTR_PURE hssize_t
-eiter_rv_max(const void *_eiter)
+eiter_rv_max(const void *in_eiter)
{
- const eiter_rv_t *eiter = (const eiter_rv_t *)_eiter;
+ const eiter_rv_t *eiter = (const eiter_rv_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -1543,10 +1579,10 @@ eiter_rv_max(const void *_eiter)
*-------------------------------------------------------------------------
*/
static int
-eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam,
+eiter_rv_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam,
earray_state_t *state, hsize_t idx)
{
- eiter_rv_t *eiter = (eiter_rv_t *)_eiter;
+ eiter_rv_t *eiter = (eiter_rv_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -1720,9 +1756,9 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par
*-------------------------------------------------------------------------
*/
static hssize_t
-eiter_rnd_next(void *_eiter)
+eiter_rnd_next(void *in_eiter)
{
- eiter_rnd_t *eiter = (eiter_rnd_t *)_eiter;
+ eiter_rnd_t *eiter = (eiter_rnd_t *)in_eiter;
hssize_t ret_val;
/* Sanity check */
@@ -1753,9 +1789,9 @@ eiter_rnd_next(void *_eiter)
*-------------------------------------------------------------------------
*/
static H5_ATTR_PURE hssize_t
-eiter_rnd_max(const void *_eiter)
+eiter_rnd_max(const void *in_eiter)
{
- const eiter_rnd_t *eiter = (const eiter_rnd_t *)_eiter;
+ const eiter_rnd_t *eiter = (const eiter_rnd_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -1778,9 +1814,9 @@ eiter_rnd_max(const void *_eiter)
*-------------------------------------------------------------------------
*/
static int
-eiter_rnd_term(void *_eiter)
+eiter_rnd_term(void *in_eiter)
{
- eiter_rnd_t *eiter = (eiter_rnd_t *)_eiter;
+ eiter_rnd_t *eiter = (eiter_rnd_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -1934,9 +1970,9 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par
*-------------------------------------------------------------------------
*/
static hssize_t
-eiter_cyc_next(void *_eiter)
+eiter_cyc_next(void *in_eiter)
{
- eiter_cyc_t *eiter = (eiter_cyc_t *)_eiter;
+ eiter_cyc_t *eiter = (eiter_cyc_t *)in_eiter;
hssize_t ret_val;
/* Sanity check */
@@ -1969,9 +2005,9 @@ eiter_cyc_next(void *_eiter)
*-------------------------------------------------------------------------
*/
static H5_ATTR_PURE hssize_t
-eiter_cyc_max(const void *_eiter)
+eiter_cyc_max(const void *in_eiter)
{
- const eiter_cyc_t *eiter = (const eiter_cyc_t *)_eiter;
+ const eiter_cyc_t *eiter = (const eiter_cyc_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -1994,9 +2030,9 @@ eiter_cyc_max(const void *_eiter)
*-------------------------------------------------------------------------
*/
static int
-eiter_cyc_term(void *_eiter)
+eiter_cyc_term(void *in_eiter)
{
- eiter_cyc_t *eiter = (eiter_cyc_t *)_eiter;
+ eiter_cyc_t *eiter = (eiter_cyc_t *)in_eiter;
/* Sanity check */
HDassert(eiter);
@@ -2568,7 +2604,10 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Pclose(fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/efc.c b/test/efc.c
index 74e559a..e61eb1b 100644
--- a/test/efc.c
+++ b/test/efc.c
@@ -2724,7 +2724,10 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ }
H5E_END_TRY
if (api_ctx_pushed)
diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c
index 49fba3b..60b229a 100644
--- a/test/enc_dec_plist.c
+++ b/test/enc_dec_plist.c
@@ -39,7 +39,10 @@ test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high, hbool_t s
if (H5Pset_libver_bounds(fapl, low, high) < 0)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5Pencode2(orig_pl, NULL, &temp_size, fapl); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pencode2(orig_pl, NULL, &temp_size, fapl);
+ }
H5E_END_TRY;
if (support_virtual && high < H5F_LIBVER_V110)
@@ -138,11 +141,11 @@ main(void)
hid_t vspace = -1; /* Virtual dset dataspaces */
hsize_t dims[1] = {3}; /* Data space current size */
hsize_t chunk_size[2] = {16384, 4}; /* chunk size */
- double fill = 2.7f; /* Fill value */
+ double fill = 2.7; /* Fill value */
hsize_t max_size[1]; /* data space maximum size */
size_t nslots = 521 * 2;
size_t nbytes = 1048576 * 10;
- double w0 = 0.5f;
+ double w0 = 0.5;
unsigned max_compact;
unsigned min_dense;
const char * c_to_f = "x+32";
@@ -156,26 +159,26 @@ main(void)
TRUE,
FALSE,
(2 * 2048 * 1024),
- 0.3f,
+ 0.3,
(64 * 1024 * 1024),
(4 * 1024 * 1024),
60000,
H5C_incr__threshold,
- 0.8f,
- 3.0f,
+ 0.8,
+ 3.0,
TRUE,
(8 * 1024 * 1024),
H5C_flash_incr__add_space,
- 2.0f,
- 0.25f,
+ 2.0,
+ 0.25,
H5C_decr__age_out_with_threshold,
- 0.997f,
- 0.8f,
+ 0.997,
+ 0.8,
TRUE,
(3 * 1024 * 1024),
3,
FALSE,
- 0.2f,
+ 0.2,
(256 * 2048),
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
@@ -347,7 +350,7 @@ main(void)
TESTING("DXPL Encoding/Decoding");
- if ((H5Pset_btree_ratios(dxpl, 0.2f, 0.6f, 0.2f)) < 0)
+ if ((H5Pset_btree_ratios(dxpl, 0.2, 0.6, 0.2)) < 0)
FAIL_STACK_ERROR
if ((H5Pset_hyper_vector_size(dxpl, 5)) < 0)
FAIL_STACK_ERROR
@@ -541,7 +544,7 @@ main(void)
FAIL_STACK_ERROR
if ((H5Pset_alignment(fapl, 2, 1024)) < 0)
FAIL_STACK_ERROR
- if ((H5Pset_cache(fapl, 1024, 128, 10485760, 0.3f)) < 0)
+ if ((H5Pset_cache(fapl, 1024, 128, 10485760, 0.3)) < 0)
FAIL_STACK_ERROR
if ((H5Pset_elink_file_cache_size(fapl, 10485760)) < 0)
FAIL_STACK_ERROR
diff --git a/test/enum.c b/test/enum.c
index 73c9889..3923892 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -602,7 +602,10 @@ test_value_dsnt_exist(void)
return 0;
error:
- H5E_BEGIN_TRY { H5Tclose(datatype_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Tclose(datatype_id);
+ }
H5E_END_TRY;
return 1;
}
@@ -661,7 +664,10 @@ test_funcs(void)
if (H5Tget_super(type) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { ret = H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -669,7 +675,10 @@ test_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { size = H5Tget_ebias(type); }
+ H5E_BEGIN_TRY
+ {
+ size = H5Tget_ebias(type);
+ }
H5E_END_TRY;
if (size > 0) {
H5_FAILED();
@@ -677,7 +686,10 @@ test_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { inpad = H5Tget_inpad(type); }
+ H5E_BEGIN_TRY
+ {
+ inpad = H5Tget_inpad(type);
+ }
H5E_END_TRY;
if (inpad > -1) {
H5_FAILED();
@@ -685,7 +697,10 @@ test_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { cset = H5Tget_cset(type); }
+ H5E_BEGIN_TRY
+ {
+ cset = H5Tget_cset(type);
+ }
H5E_END_TRY;
if (cset > -1) {
H5_FAILED();
@@ -694,7 +709,10 @@ test_funcs(void)
} /* end if */
size = 16;
- H5E_BEGIN_TRY { ret = H5Tset_offset(type, (size_t)size); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_offset(type, (size_t)size);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -702,7 +720,10 @@ test_funcs(void)
goto error;
} /* end if */
- H5E_BEGIN_TRY { ret = H5Tset_order(type, H5T_ORDER_BE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tset_order(type, H5T_ORDER_BE);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -717,7 +738,10 @@ test_funcs(void)
return 0;
error:
- H5E_BEGIN_TRY { H5Tclose(type); }
+ H5E_BEGIN_TRY
+ {
+ H5Tclose(type);
+ }
H5E_END_TRY;
return 1;
}
diff --git a/test/err_compat.c b/test/err_compat.c
index 53c8667..6ad69d8 100644
--- a/test/err_compat.c
+++ b/test/err_compat.c
@@ -39,7 +39,6 @@ int * ipoints2_data = NULL;
int * icheck2_data = NULL;
#define DSET_NAME "a_dataset"
-#define FAKE_ID (hid_t) - 1
herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void *client_data);
herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void *client_data);
@@ -47,13 +46,13 @@ herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void *client_data);
/*-------------------------------------------------------------------------
* Function: user_print1
*
- * Purpose: This function is a user-defined old-style printing function.
+ * Purpose: This function is a user-defined old-style printing function.
* This is just a convenience function for H5Ewalk1() with a
* function that prints error messages.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
*-------------------------------------------------------------------------
@@ -66,22 +65,22 @@ user_print1(FILE *stream)
if (H5Ewalk1(H5E_WALK_UPWARD, (H5E_walk1_t)custom_print_cb1, stream) < 0)
TEST_ERROR;
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
}
/*-------------------------------------------------------------------------
* Function: user_print2
*
- * Purpose: This function is a user-defined new-style printing function.
+ * Purpose: This function is a user-defined new-style printing function.
* This is just a convenience function for H5Ewalk2() with a
* function that prints error messages.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
*-------------------------------------------------------------------------
@@ -94,27 +93,23 @@ user_print2(hid_t err_stack, FILE *stream)
if (H5Ewalk2(err_stack, H5E_WALK_UPWARD, (H5E_walk2_t)custom_print_cb2, stream) < 0)
TEST_ERROR;
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
}
/*-------------------------------------------------------------------------
* Function: custom_print_cb1
*
- * Purpose: Callback function to print error stack in customized way
- * for H5Ewalk1.
+ * Purpose: Callback function to print error stack in customized way
+ * for H5Ewalk1
*
- * Return: Success: 0
+ * Return: SUCCEED/FAIL
*
- * Failure: -1
- *
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -140,7 +135,7 @@ custom_print_cb1(int n, H5E_error1_t *err_desc, void *client_data)
H5free_memory(maj);
H5free_memory(min);
- return 0;
+ return SUCCEED;
error:
if (maj)
@@ -148,24 +143,20 @@ error:
if (min)
H5free_memory(min);
- return -1;
+ return FAIL;
}
/*-------------------------------------------------------------------------
* Function: custom_print_cb2
*
- * Purpose: Callback function to print error stack in customized way
- * for H5Ewalk1.
- *
- * Return: Success: 0
+ * Purpose: Callback function to print error stack in customized way
+ * for H5Ewalk1
*
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 October 2010
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -191,7 +182,7 @@ custom_print_cb2(int n, H5E_error2_t *err_desc, void *client_data)
H5free_memory(maj);
H5free_memory(min);
- return 0;
+ return SUCCEED;
error:
if (maj)
@@ -199,62 +190,59 @@ error:
if (min)
H5free_memory(min);
- return -1;
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: test_error1
- *
- * Purpose: Test the backward compatibility of H5Eset/get_auto.
- *
- * Return: Success: 0
+ * Function: test_error_compat
*
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * 17 September 2010
+ * Purpose: Test the backward compatibility of H5Eset/get_auto
*
+ * Return: SUCCEED/FAIL
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * 17 September 2010
*
*-------------------------------------------------------------------------
*/
static herr_t
-test_error1(void)
+test_error_compat(void)
{
- hid_t dataset, space;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
hsize_t dims[2];
H5E_auto1_t old_func1;
H5E_auto2_t old_func2;
- void * old_data;
+ void * old_data = NULL;
herr_t ret;
TESTING("error API H5Eset/get_auto");
- HDfprintf(stderr, "\n");
- /* Create the data space */
+ /* Add a newline and flush so the output file looks nicer */
+ HDprintf("\n");
+ HDfflush(stdout);
+
+ /* Create the dataspace */
dims[0] = DIM0;
dims[1] = DIM1;
- if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
- /* Use H5Eget_auto2 to query the default printing function. The library
- *should indicate H5Eprint2 as the default. */
+ /* Use H5Eget_auto2 to query the default printing function. */
if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data) < 0)
TEST_ERROR;
if (old_data != NULL)
TEST_ERROR;
- if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
+ if (old_func2 == NULL)
TEST_ERROR;
- /* This function sets the default printing function to be H5Eprint2. */
if (H5Eset_auto2(H5E_DEFAULT, old_func2, old_data) < 0)
TEST_ERROR;
/* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (dataset >= 0)
+ did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (did >= 0)
TEST_ERROR;
/* This call should work. It simply returns H5Eprint1. */
@@ -271,8 +259,8 @@ test_error1(void)
/* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (dataset >= 0)
+ did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (did >= 0)
TEST_ERROR;
/* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1.
@@ -288,16 +276,16 @@ test_error1(void)
/* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (dataset >= 0)
+ did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (did >= 0)
TEST_ERROR;
- /* This function changes the new-style printing function back to the default H5Eprint2. */
- if (H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL) < 0)
+ /* This function changes the new-style printing function to the original. */
+ if (H5Eset_auto2(H5E_DEFAULT, old_func2, NULL) < 0)
TEST_ERROR;
- /* This call should work because the H5Eset_auto2 above restored the default printing
- * function H5Eprint2. It simply returns user_print1. */
+ /* This call should work because the H5Eset_auto2 above set the default printing
+ * function to H5Eprint2. It simply returns user_print1. */
if ((ret = H5Eget_auto1(&old_func1, &old_data)) < 0)
TEST_ERROR;
if (old_data != NULL)
@@ -315,69 +303,77 @@ test_error1(void)
TEST_ERROR;
if (old_data != NULL)
TEST_ERROR;
- if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
+ if (old_func2 == NULL)
TEST_ERROR;
/* Try the printing function. Dataset creation should fail because the file
* doesn't exist. */
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (dataset >= 0)
+ did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (did >= 0)
TEST_ERROR;
- return 0;
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
error:
- return -1;
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ H5Sclose(sid);
+ }
+ H5E_END_TRY
+
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: test_error2
- *
- * Purpose: Test error API functions, mainly on H5Epush1.
+ * Function: test_h5epush1
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Purpose: Test error API functions, mainly H5Epush1
*
+ * Return: SUCCEED/FAIL
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * July 10, 2003
*
*-------------------------------------------------------------------------
*/
static herr_t
-test_error2(hid_t file)
+test_h5epush1(hid_t file)
{
- hid_t dataset, space;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t estack_id = H5I_INVALID_HID;
hsize_t dims[2];
- const char *FUNC_test_error = "test_error2";
+ const char *FUNC_test_error = "test_h5epush1";
TESTING("error API based on data I/O");
- HDfprintf(stderr, "\n");
- /* Create the data space */
+ /* Add a newline and flush so the output file looks nicer */
+ HDprintf("\n");
+ HDfflush(stdout);
+
+ /* Create the dataspace */
dims[0] = DIM0;
dims[1] = DIM1;
- if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ if ((sid = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
/* Test H5E_BEGIN_TRY */
H5E_BEGIN_TRY
{
- dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ did =
+ H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
}
H5E_END_TRY;
/* Create the dataset */
- if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
- 0) {
- H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE, "H5Dcreate2 failed");
- goto error;
- }
+ if ((did = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
- /* Disable the library's default printing function */
+ /* Disable the library's default printing function */
#ifdef H5_USE_16_API_DEFAULT
if (H5Eset_auto(NULL, NULL) < 0)
#else
@@ -386,36 +382,48 @@ test_error2(hid_t file)
TEST_ERROR;
/* Make H5Dwrite fail, verify default print is disabled */
- if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) {
- H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_WRITEERROR,
- "H5Dwrite shouldn't succeed");
- goto error;
- }
+ if (H5Dwrite(H5I_INVALID_HID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0)
+ H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_WRITEERROR, "expected H5Dwrite error");
+ else
+ TEST_ERROR;
+
+ /* Save the error stack so the close calls don't interfere with it */
+ if ((estack_id = H5Eget_current_stack()) < 0)
+ TEST_ERROR;
- /* In case program comes to this point, close dataset */
- if (H5Dclose(dataset) < 0)
+ /* Close open identifiers */
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ /* Restore the stack containing errors */
+ if (H5Eset_current_stack(estack_id) < 0)
TEST_ERROR;
- TEST_ERROR;
+ return SUCCEED;
error:
- return -1;
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Eclose_stack(estack_id);
+ }
+ H5E_END_TRY
+
+ return FAIL;
}
/*-------------------------------------------------------------------------
* Function: dump_error
*
- * Purpose: Prints error stack in default and customized ways.
+ * Purpose: Prints error stack in default and customized ways
*
- * Return: Success: 0
+ * Return: SUCCEED/FAIL
*
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * July 17, 2003
- *
- *
- * Modifications:
+ * Programmer: Raymond Lu
+ * July 17, 2003
*
*-------------------------------------------------------------------------
*/
@@ -432,35 +440,34 @@ dump_error(void)
if (H5Ewalk1(H5E_WALK_UPWARD, custom_print_cb1, stderr) < 0)
TEST_ERROR;
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
}
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Test error API.
- *
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Purpose: Test error API
*
- * Modifications:
+ * Programmer: Raymond Lu
+ * July 10, 2003
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t file, fapl;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
char filename[1024];
const char *FUNC_main = "main";
int i;
HDfprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There are supposed to "
"be some error messages\n");
- fapl = h5_fileaccess();
+ fapl_id = h5_fileaccess();
/* Set up data arrays */
if (NULL == (ipoints2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int))))
@@ -477,14 +484,14 @@ main(void)
for (i = 0; i < DIM0; i++)
icheck2[i] = icheck2_data + (i * DIM1);
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename));
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
/* Test error stack */
/* Push an error onto error stack */
- H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE, "Error test failed");
+ H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE, "fake error message 1");
/* Print out the errors on stack */
dump_error();
@@ -493,17 +500,24 @@ main(void)
H5Eclear1();
/* Test error API */
- if (test_error1() < 0)
+ if (test_error_compat() < 0)
TEST_ERROR;
- if (test_error2(file) < 0) {
- H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADMESG, "Error test failed");
+ /* Test H5Epush1
+ *
+ * On success, there will be errors on the stack to print.
+ */
+ if (test_h5epush1(fid) < 0) {
+ TEST_ERROR;
+ }
+ else {
+ H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADMESG, "fake error message 2");
H5Eprint1(stderr);
}
- if (H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
TEST_ERROR;
- h5_clean_files(FILENAME, fapl);
+ h5_clean_files(FILENAME, fapl_id);
HDfree(ipoints2);
HDfree(ipoints2_data);
@@ -511,7 +525,7 @@ main(void)
HDfree(icheck2_data);
HDprintf("All error API tests passed.\n");
- return 0;
+ return EXIT_SUCCESS;
error:
HDfree(ipoints2);
@@ -519,7 +533,14 @@ error:
HDfree(icheck2);
HDfree(icheck2_data);
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ H5Pclose(fapl_id);
+ }
+ H5E_END_TRY
+
HDprintf("***** ERROR TEST FAILED! *****\n");
- return 1;
+ return EXIT_FAILURE;
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/test/error_test.c b/test/error_test.c
index e294a43..f4dc340 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -129,13 +129,8 @@ test_error(hid_t file)
TEST_ERROR;
if (old_data != NULL)
TEST_ERROR;
-#ifdef H5_USE_16_API
- if (old_func != (H5E_auto_t)H5Eprint)
- TEST_ERROR;
-#else /* H5_USE_16_API */
- if (old_func != (H5E_auto2_t)H5Eprint2)
+ if (old_func == NULL)
TEST_ERROR;
-#endif /* H5_USE_16_API */
if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0)
TEST_ERROR;
@@ -200,7 +195,7 @@ init_error(void)
if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1)
TEST_ERROR;
- if (HDstrcmp(ERR_CLS_NAME, cls_name))
+ if (HDstrcmp(ERR_CLS_NAME, cls_name) != 0)
TEST_ERROR;
if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0)
@@ -225,7 +220,7 @@ init_error(void)
TEST_ERROR;
if (msg_type != H5E_MINOR)
TEST_ERROR;
- if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG))
+ if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG) != 0)
TEST_ERROR;
/* Register another class for later testing. */
@@ -324,7 +319,7 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie
* 'full_desc' in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static herr_t
test_long_desc(void)
{
@@ -380,7 +375,7 @@ error:
return -1;
} /* end test_long_desc() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: dump_error
@@ -563,7 +558,10 @@ test_copy(void)
/* Try to close error stack copy. Should fail because
* the current H5Eset_current_stack closes the stack to be set.
*/
- H5E_BEGIN_TRY { ret = H5Eclose_stack(estack_id); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eclose_stack(estack_id);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
@@ -629,15 +627,24 @@ test_append(void)
TEST_ERROR
/* Try to append bad error stack IDs */
- H5E_BEGIN_TRY { ret = H5Eappend_stack(H5E_DEFAULT, H5E_DEFAULT, FALSE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eappend_stack(H5E_DEFAULT, H5E_DEFAULT, FALSE);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5Eappend_stack(estack_id1, H5E_DEFAULT, FALSE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eappend_stack(estack_id1, H5E_DEFAULT, FALSE);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5Eappend_stack(H5E_DEFAULT, estack_id2, FALSE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eappend_stack(H5E_DEFAULT, estack_id2, FALSE);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
@@ -663,7 +670,10 @@ test_append(void)
/* Try to close error stack #2. Should fail because H5Eappend_stack
* should have already closed it.
*/
- H5E_BEGIN_TRY { ret = H5Eclose_stack(estack_id2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eclose_stack(estack_id2);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
diff --git a/test/event_set.c b/test/event_set.c
index e1ef880..5df49e9 100644
--- a/test/event_set.c
+++ b/test/event_set.c
@@ -85,12 +85,80 @@ test_es_create(void)
return 0;
error:
- H5E_BEGIN_TRY { H5ESclose(es_id); }
+ H5E_BEGIN_TRY
+ {
+ H5ESclose(es_id);
+ }
H5E_END_TRY;
return 1;
}
/*-------------------------------------------------------------------------
+ * Function: test_es_none
+ *
+ * Purpose: Tests for passing H5ES_NONE to H5ES routines
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ * Programmer: Quincey Koziol
+ * Friday, February 26, 2021
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_es_none(void)
+{
+ TESTING("event set H5ES_NONE");
+
+ /* Wait */
+ if (H5ESwait(H5ES_NONE, 0, NULL, NULL) < 0)
+ TEST_ERROR;
+
+ /* Cancel */
+ if (H5EScancel(H5ES_NONE, NULL, NULL) < 0)
+ TEST_ERROR;
+
+ /* Get count */
+ if (H5ESget_count(H5ES_NONE, NULL) < 0)
+ TEST_ERROR;
+
+ /* Get op counter */
+ if (H5ESget_op_counter(H5ES_NONE, NULL) < 0)
+ TEST_ERROR;
+
+ /* Get error status */
+ if (H5ESget_err_status(H5ES_NONE, NULL) < 0)
+ TEST_ERROR;
+
+ /* Get error count */
+ if (H5ESget_err_count(H5ES_NONE, NULL) < 0)
+ TEST_ERROR;
+
+ /* Get error info */
+ if (H5ESget_err_info(H5ES_NONE, 0, NULL, NULL) < 0)
+ TEST_ERROR;
+
+ /* Register insert function */
+ if (H5ESregister_insert_func(H5ES_NONE, NULL, NULL) < 0)
+ TEST_ERROR;
+
+ /* Register complete function */
+ if (H5ESregister_complete_func(H5ES_NONE, NULL, NULL) < 0)
+ TEST_ERROR;
+
+ /* Close */
+ if (H5ESclose(H5ES_NONE) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return 0;
+
+error:
+ return 1;
+}
+
+/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Tests event sets
@@ -115,6 +183,7 @@ main(void)
/* Tests */
nerrors += test_es_create();
+ nerrors += test_es_none();
/* Cleanup */
h5_cleanup(FILENAME, fapl_id);
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index 798fcec..8239207 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -778,7 +778,10 @@ check_dset_scheme(hid_t fid, const char *dset_name)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Dclose(did); }
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ }
H5E_END_TRY;
H5_FAILED();
@@ -841,13 +844,19 @@ check_evict_on_close_api(void)
TEST_ERROR;
/* ensure using an incorrect access plist fails */
- H5E_BEGIN_TRY { status = H5Pset_evict_on_close(dapl_id, evict_on_close); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Pset_evict_on_close(dapl_id, evict_on_close);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR("H5Pset_evict_on_close() accepted invalid access plist.");
/* ensure an invalid plist fails */
- H5E_BEGIN_TRY { status = H5Pget_evict_on_close(H5I_INVALID_HID, &evict_on_close); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Pget_evict_on_close(H5I_INVALID_HID, &evict_on_close);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR("H5Pget_evict_on_close() accepted invalid hid_t.");
@@ -994,7 +1003,10 @@ check_evict_on_close_parallel_fail(void)
/* Set the evict on close property (should fail)*/
evict_on_close = TRUE;
- H5E_BEGIN_TRY { status = H5Pset_evict_on_close(fapl_id, evict_on_close); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Pset_evict_on_close(fapl_id, evict_on_close);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR("H5Pset_evict_on_close() did not fail in parallel HDF5.");
diff --git a/test/external.c b/test/external.c
index 9109e75..c31701d 100644
--- a/test/external.c
+++ b/test/external.c
@@ -72,7 +72,7 @@ files_have_same_contents(const char *name1, const char *name2)
break;
}
- if (HDmemcmp(buf1, buf2, (size_t)n1))
+ if (HDmemcmp(buf1, buf2, (size_t)n1) != 0)
break;
} /* end while */
@@ -134,7 +134,10 @@ test_non_extendible(hid_t file)
FAIL_STACK_ERROR
/* Test dataset address. Should be undefined. */
- H5E_BEGIN_TRY { dset_addr = H5Dget_offset(dset); }
+ H5E_BEGIN_TRY
+ {
+ dset_addr = H5Dget_offset(dset);
+ }
H5E_END_TRY;
if (dset_addr != HADDR_UNDEF)
FAIL_STACK_ERROR
@@ -220,7 +223,10 @@ test_too_small(hid_t file)
if ((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { dset = H5Dcreate2(file, "dset2", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ dset = H5Dcreate2(file, "dset2", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (dset >= 0)
FAIL_PUTS_ERROR(" Small external file succeeded instead of failing.");
@@ -332,7 +338,10 @@ test_large_enough_current_not_eventual(hid_t file)
if ((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { dset = H5Dcreate2(file, "dset4", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ dset = H5Dcreate2(file, "dset4", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (dset >= 0)
FAIL_PUTS_ERROR(" Small external file succeeded instead of failing.");
@@ -465,7 +474,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-__add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, hsize_t max_ext_size)
+add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, hsize_t max_ext_size)
{
char exname[AEF_EXNAME_MAX_LEN + 1];
unsigned int i = 0;
@@ -519,7 +528,7 @@ test_multiple_files(hid_t file)
max_ext_size = (hsize_t)(sizeof(int) * max_size[0] / n_external_files);
- if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
+ if (add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
FAIL_STACK_ERROR;
}
@@ -543,11 +552,14 @@ test_multiple_files(hid_t file)
max_ext_size -= 1;
- if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
+ if (add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
FAIL_STACK_ERROR;
}
- H5E_BEGIN_TRY { dset = H5Dcreate2(file, "dset7", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ dset = H5Dcreate2(file, "dset7", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (dset >= 0)
FAIL_PUTS_ERROR(" Small external files succeeded instead of failing.");
@@ -599,7 +611,10 @@ test_add_to_unlimited(void)
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" H5Pset_external() succeeded when it should have failed.");
@@ -615,7 +630,10 @@ test_add_to_unlimited(void)
return 0;
error:
- H5E_BEGIN_TRY { H5Pclose(dcpl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dcpl);
+ }
H5E_END_TRY;
return 1;
} /* end test_add_to_unlimited() */
@@ -647,7 +665,10 @@ test_overflow(void)
if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED - 1) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" H5Pset_external() succeeded when it should have failed.");
@@ -659,7 +680,10 @@ test_overflow(void)
return 0;
error:
- H5E_BEGIN_TRY { H5Pclose(dcpl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dcpl);
+ }
H5E_END_TRY;
return 1;
} /* end test_overflow() */
@@ -1187,7 +1211,10 @@ test_path_relative_cwd(hid_t fapl)
/* Reopen dataset with different efile_prefix property */
if (H5Pset_efile_prefix(dapl, "//") < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { dset3 = H5Dopen2(file, "dset1", dapl); }
+ H5E_BEGIN_TRY
+ {
+ dset3 = H5Dopen2(file, "dset1", dapl);
+ }
H5E_END_TRY;
if (dset3 >= 0)
FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeded");
@@ -1221,7 +1248,10 @@ test_path_relative_cwd(hid_t fapl)
/* Reopen dataset with different efile_prefix property */
if (H5Pset_efile_prefix(dapl, NULL) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { dset3 = H5Dopen2(file, "dset1", dapl); }
+ H5E_BEGIN_TRY
+ {
+ dset3 = H5Dopen2(file, "dset1", dapl);
+ }
H5E_END_TRY;
if (dset3 >= 0)
FAIL_PUTS_ERROR("reopening the dataset with a different efile_prefix succeded");
diff --git a/test/external_common.h b/test/external_common.h
index d338a70..6215be9 100644
--- a/test/external_common.h
+++ b/test/external_common.h
@@ -17,8 +17,8 @@
*
* Purpose: Private function for external.c and external_env.c
*/
-#ifndef _EXTERNAL_COMMON_H
-#define _EXTERNAL_COMMON_H
+#ifndef EXTERNAL_COMMON_H
+#define EXTERNAL_COMMON_H
/* Include test header files */
#include "h5test.h"
@@ -41,4 +41,4 @@ H5TEST_DLL herr_t reset_raw_data_files(hbool_t is_env);
}
#endif
-#endif /* _EXTERNAL_COMMON_H */
+#endif /* EXTERNAL_COMMON_H */
diff --git a/test/external_fname.h b/test/external_fname.h
index 2545547..c2cd059 100644
--- a/test/external_fname.h
+++ b/test/external_fname.h
@@ -17,8 +17,8 @@
*
* Purpose: Private declaration for external.c and external_env.c
*/
-#ifndef _EXTERNAL_FNAME_H
-#define _EXTERNAL_FNAME_H
+#ifndef EXTERNAL_FNAME_H
+#define EXTERNAL_FNAME_H
/* Include test header files */
#include "h5test.h"
@@ -26,4 +26,4 @@
static const char *EXT_FNAME[] = {"extern_1", "extern_2", "extern_3", "extern_4",
"extern_dir/file_1", "extern_5", NULL};
-#endif /* _EXTERNAL_FNAME_H */
+#endif /* EXTERNAL_FNAME_H */
diff --git a/test/farray.c b/test/farray.c
index da38b31..950c7a7 100644
--- a/test/farray.c
+++ b/test/farray.c
@@ -440,7 +440,10 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
/* Set invalid element size */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.raw_elmt_size = 0;
- H5E_BEGIN_TRY { fa = H5FA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ fa = H5FA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (fa) {
/* Close opened fixed array */
@@ -454,7 +457,10 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
/* Set invalid max. # of elements bits */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = 0;
- H5E_BEGIN_TRY { fa = H5FA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ fa = H5FA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (fa) {
/* Close opened fixed array */
@@ -468,7 +474,10 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
/* Set invalid max. # of elements */
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.nelmts = 0;
- H5E_BEGIN_TRY { fa = H5FA_create(f, &test_cparam, NULL); }
+ H5E_BEGIN_TRY
+ {
+ fa = H5FA_create(f, &test_cparam, NULL);
+ }
H5E_END_TRY;
if (fa) {
/* Close opened fixed array */
@@ -885,7 +894,10 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
fa2 = NULL;
/* Try re-opening the array again (should fail, as array will be deleted) */
- H5E_BEGIN_TRY { fa2 = H5FA_open(f, fa_addr, NULL); }
+ H5E_BEGIN_TRY
+ {
+ fa2 = H5FA_open(f, fa_addr, NULL);
+ }
H5E_END_TRY;
if (fa2) {
/* Close opened array */
@@ -905,7 +917,10 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TEST_ERROR
/* Try re-opening the array again (should fail, as array is now deleted) */
- H5E_BEGIN_TRY { fa = H5FA_open(f, fa_addr, NULL); }
+ H5E_BEGIN_TRY
+ {
+ fa = H5FA_open(f, fa_addr, NULL);
+ }
H5E_END_TRY;
if (fa) {
/* Close opened array */
@@ -1783,7 +1798,10 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Pclose(fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/fheap.c b/test/fheap.c
index 5e3251d..86a555d 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -424,7 +424,7 @@ add_obj(H5HF_t *fh, size_t obj_off, size_t obj_size, fheap_heap_state_t *state,
TEST_ERROR
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(obj, shared_robj_g, obj_size))
+ if (HDmemcmp(obj, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* If the heap IDs are to be retained, append them to the list */
@@ -553,7 +553,7 @@ get_fill_size(const fheap_test_param_t *tparam)
* test_desc in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static int
begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *keep_ids, size_t *fill_size)
{
@@ -581,7 +581,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *
/* Success */
return (0);
} /* end begin_test() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: reopen_file
@@ -1192,7 +1192,7 @@ fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size, fheap_heap_state_t *s
/* Check that object is correct */
wobj = &shared_wobj_g[*curr_off_ptr];
- if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr))
+ if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr) != 0)
TEST_ERROR
/* Adjust object & ID pointers */
@@ -2360,7 +2360,10 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
fh2 = NULL;
/* Try re-opening the heap again (should fail, as heap will be deleted) */
- H5E_BEGIN_TRY { fh2 = H5HF_open(f, fh_addr); }
+ H5E_BEGIN_TRY
+ {
+ fh2 = H5HF_open(f, fh_addr);
+ }
H5E_END_TRY;
if (fh2) {
/* Close opened heap */
@@ -2397,7 +2400,10 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
} /* end if */
/* Try re-opening the heap again (should fail, as heap is now deleted) */
- H5E_BEGIN_TRY { fh = H5HF_open(f, fh_addr); }
+ H5E_BEGIN_TRY
+ {
+ fh = H5HF_open(f, fh_addr);
+ }
H5E_END_TRY;
if (fh) {
/* Close opened heap */
@@ -2584,7 +2590,10 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 3;
/* Create absolute heap */
- H5E_BEGIN_TRY { fh = H5HF_create(f, &tmp_cparam); }
+ H5E_BEGIN_TRY
+ {
+ fh = H5HF_create(f, &tmp_cparam);
+ }
H5E_END_TRY;
if (NULL != fh)
FAIL_STACK_ERROR
@@ -2745,7 +2754,10 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = H5HF_MAX_ID_LEN + 1;
/* Create absolute heap */
- H5E_BEGIN_TRY { fh = H5HF_create(f, &tmp_cparam); }
+ H5E_BEGIN_TRY
+ {
+ fh = H5HF_create(f, &tmp_cparam);
+ }
H5E_END_TRY;
if (NULL != fh)
FAIL_STACK_ERROR
@@ -3232,7 +3244,10 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
TESTING("inserting 'weird' sized objects into absolute heap");
/* Attempt to insert 0-sized object into heap */
- H5E_BEGIN_TRY { ret = H5HF_insert(fh, (size_t)0, shared_wobj_g, heap_id); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5HF_insert(fh, (size_t)0, shared_wobj_g, heap_id);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -6459,7 +6474,10 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
heap_id[u] = (unsigned char)(HDrandom() + 1);
/* Try removing bogus heap ID from empty heap */
- H5E_BEGIN_TRY { ret = H5HF_remove(fh, heap_id); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5HF_remove(fh, heap_id);
+ }
H5E_END_TRY;
if (ret >= 0)
FAIL_STACK_ERROR
@@ -6485,14 +6503,20 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
} /* end while */
/* Try removing bogus heap ID from heap w/objects */
- H5E_BEGIN_TRY { ret = H5HF_remove(fh, heap_id); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5HF_remove(fh, heap_id);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
H5Eclear2(H5E_DEFAULT);
/* Try reading bogus heap ID from heap w/objects */
- H5E_BEGIN_TRY { ret = H5HF_read(fh, heap_id, shared_robj_g); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5HF_read(fh, heap_id, shared_robj_g);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -12698,7 +12722,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -12851,7 +12875,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -12881,7 +12905,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -13084,7 +13108,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -13114,7 +13138,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert third object too large for managed heap blocks */
@@ -13144,7 +13168,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -13395,7 +13419,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -13425,7 +13449,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert third object too large for managed heap blocks */
@@ -13455,7 +13479,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fourth object small enough to fit into 'normal' heap blocks */
@@ -13492,7 +13516,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id4, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fifth object small enough to fit into 'normal' heap blocks */
@@ -13530,7 +13554,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id5, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -13868,7 +13892,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -14019,7 +14043,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -14172,7 +14196,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object small enough to encode in heap ID */
@@ -14202,7 +14226,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -14418,14 +14442,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on first huge object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -14455,14 +14479,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on second huge object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id2, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert third object too large for managed heap blocks */
@@ -14492,14 +14516,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on third huge object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id3, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fourth object small enough to fit into 'normal' heap blocks */
@@ -14536,14 +14560,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id4, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on fourth ('normal') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id4, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fifth object small enough to fit into 'normal' heap blocks */
@@ -14581,14 +14605,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id5, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on fifth ('normal') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id5, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert sixth object small enough to encode in heap ID */
@@ -14618,14 +14642,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id6, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on sixth ('tiny') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id6, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert seventh object small enough to encode in heap ID */
@@ -14655,14 +14679,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id7, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on seventh ('tiny') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id7, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -15032,7 +15056,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -15215,7 +15239,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id1, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Read in ('normal') object #2 */
@@ -15226,7 +15250,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -15954,7 +15978,10 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Verify that writing to 'huge' objects works for un-filtered heaps */
- H5E_BEGIN_TRY { ret = H5HF_write(fh, huge_heap_id, &id_changed, shared_wobj_g); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5HF_write(fh, huge_heap_id, &id_changed, shared_wobj_g);
+ }
H5E_END_TRY;
HDassert(!id_changed);
if (tparam->comp == FHEAP_TEST_COMPRESS) {
@@ -15967,7 +15994,10 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
} /* end else */
/* Verify that writing to 'tiny' objects return failure (for now) */
- H5E_BEGIN_TRY { ret = H5HF_write(fh, tiny_heap_id, &id_changed, shared_wobj_g); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5HF_write(fh, tiny_heap_id, &id_changed, shared_wobj_g);
+ }
H5E_END_TRY;
HDassert(!id_changed);
if (ret >= 0)
@@ -16032,7 +16062,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Compare data read in */
- if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size))
+ if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Change size of data to write */
@@ -16081,7 +16111,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Compare data read in */
- if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size))
+ if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Change size of data to write */
@@ -16340,7 +16370,7 @@ main(void)
envval = "nomatch";
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0);
/* Reset library */
h5_reset();
diff --git a/test/file_image.c b/test/file_image.c
index 7e8219c..0d031f5 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -102,8 +102,9 @@ test_properties(void)
* property list functions. In the file driver tests further down, this will
* not be the case.
*/
- size = (size_t)count * sizeof(char);
- buffer = (char *)HDmalloc(size);
+ size = (size_t)count * sizeof(char);
+ if (NULL == (buffer = (char *)HDmalloc(size)))
+ TEST_ERROR
for (i = 0; i < count - 1; i++)
buffer[i] = (char)(65 + i);
buffer[count - 1] = '\0';
@@ -338,8 +339,8 @@ test_callbacks(void)
H5FD_file_image_callbacks_t callbacks;
hid_t fapl_1;
hid_t fapl_2;
- udata_t * udata;
- char * file_image;
+ udata_t * udata = NULL;
+ char * file_image = NULL;
char * temp_file_image;
int count = 10;
int i;
@@ -350,6 +351,7 @@ test_callbacks(void)
/* Allocate and initialize udata */
udata = (udata_t *)HDmalloc(sizeof(udata_t));
+ VERIFY(udata != NULL, "udata malloc failed");
reset_udata(udata);
/* copy the address of the user data into read_callbacks */
@@ -358,6 +360,7 @@ test_callbacks(void)
/* Allocate and initialize file image buffer */
size = (size_t)count * sizeof(char);
file_image = (char *)HDmalloc(size);
+ VERIFY(file_image != NULL, "file_image malloc failed");
for (i = 0; i < count - 1; i++)
file_image[i] = (char)(65 + i);
file_image[count - 1] = '\0';
@@ -529,6 +532,9 @@ test_callbacks(void)
return 0;
error:
+ HDfree(file_image);
+ HDfree(udata);
+
return 1;
} /* test_callbacks() */
@@ -706,7 +712,7 @@ error:
* 'member_file_name' in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static int
test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl, hbool_t user)
{
@@ -970,7 +976,7 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl
error:
return 1;
} /* end test_get_file_image() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/******************************************************************************
* Function: test_get_file_image_error_rejection
@@ -1064,21 +1070,30 @@ test_get_file_image_error_rejection(void)
VERIFY(image_ptr != NULL, "HDmalloc(1) failed.");
/* load the image of the file into the buffer */
- H5E_BEGIN_TRY { bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)(image_size - 1)); }
+ H5E_BEGIN_TRY
+ {
+ bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)(image_size - 1));
+ }
H5E_END_TRY;
VERIFY(bytes_read < 0, "H5Fget_file_image(2 -- test 1) succeeded.");
/* Call H5Fget_file_image() with good buffer and buffer size,
* but non-existant file_id. Should fail.
*/
- H5E_BEGIN_TRY { bytes_read = H5Fget_file_image((hid_t)0, image_ptr, (size_t)(image_size)); }
+ H5E_BEGIN_TRY
+ {
+ bytes_read = H5Fget_file_image((hid_t)0, image_ptr, (size_t)(image_size));
+ }
H5E_END_TRY;
VERIFY(bytes_read < 0, "H5Fget_file_image(3 -- test 1) succeeded.");
/* Call H5Fget_file_image() with good buffer and buffer size,
* but a file_id of the wrong type. Should fail.
*/
- H5E_BEGIN_TRY { bytes_read = H5Fget_file_image(dset_id, image_ptr, (size_t)(image_size)); }
+ H5E_BEGIN_TRY
+ {
+ bytes_read = H5Fget_file_image(dset_id, image_ptr, (size_t)(image_size));
+ }
H5E_END_TRY;
VERIFY(bytes_read < 0, "H5Fget_file_image(4 -- test 1) succeeded.");
@@ -1179,7 +1194,10 @@ test_get_file_image_error_rejection(void)
VERIFY(err >= 0, "H5Fflush failed");
/* attempt to get the size of the file -- should fail */
- H5E_BEGIN_TRY { image_size = H5Fget_file_image(file_id, NULL, (size_t)0); }
+ H5E_BEGIN_TRY
+ {
+ image_size = H5Fget_file_image(file_id, NULL, (size_t)0);
+ }
H5E_END_TRY;
VERIFY(image_size == -1, "H5Fget_file_image(5) succeeded.");
@@ -1238,7 +1256,10 @@ test_get_file_image_error_rejection(void)
VERIFY(err >= 0, "H5Fflush failed");
/* attempt to get the size of the file -- should fail */
- H5E_BEGIN_TRY { image_size = H5Fget_file_image(file_id, NULL, (size_t)0); }
+ H5E_BEGIN_TRY
+ {
+ image_size = H5Fget_file_image(file_id, NULL, (size_t)0);
+ }
H5E_END_TRY;
VERIFY(image_size == -1, "H5Fget_file_image(6) succeeded.");
@@ -1295,7 +1316,10 @@ test_get_file_image_error_rejection(void)
VERIFY(err >= 0, "H5Fflush failed");
/* attempt to get the size of the file -- should fail */
- H5E_BEGIN_TRY { image_size = H5Fget_file_image(file_id, NULL, (size_t)0); }
+ H5E_BEGIN_TRY
+ {
+ image_size = H5Fget_file_image(file_id, NULL, (size_t)0);
+ }
H5E_END_TRY;
VERIFY(image_size == -1, "H5Fget_file_image(7) succeeded.");
diff --git a/test/filenotclosed.c b/test/filenotclosed.c
index 519ccb1..b5def9b 100644
--- a/test/filenotclosed.c
+++ b/test/filenotclosed.c
@@ -77,7 +77,7 @@ main(void)
* Further investigation is needed to resolve the test failure with the
* split/multi driver. Please see HDFFV-10160.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (!contig_addr_vfd) {
SKIPPED();
HDputs(" Temporary skipped for a spilt/multi driver");
diff --git a/test/fillval.c b/test/fillval.c
index 80d8f9a..8de6ef1 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -86,7 +86,10 @@ create_compound_type(void)
return ret_value;
error:
- H5E_BEGIN_TRY { H5Tclose(ret_value); }
+ H5E_BEGIN_TRY
+ {
+ H5Tclose(ret_value);
+ }
H5E_END_TRY;
return -1;
}
@@ -197,7 +200,10 @@ test_getset(void)
* Reading the fill value from a dataset creation property list that has
* no fill value should result in a failure.
*/
- H5E_BEGIN_TRY { H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i); }
+ H5E_BEGIN_TRY
+ {
+ H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i);
+ }
H5E_END_TRY;
if (fill_i != 0) {
H5_FAILED();
@@ -318,7 +324,7 @@ test_getset_vl(hid_t fapl)
TEST_ERROR
/* Verify that the fill value is the original value */
- if (HDstrcmp(f2, orig_fill_value))
+ if (HDstrcmp(f2, orig_fill_value) != 0)
TEST_ERROR
/* Release the fill value retrieved */
@@ -360,7 +366,7 @@ test_getset_vl(hid_t fapl)
TEST_ERROR
/* Verify that the fill value is the original value */
- if (HDstrcmp(f2, orig_fill_value))
+ if (HDstrcmp(f2, orig_fill_value) != 0)
TEST_ERROR
/* Release the fill value retrieved */
@@ -380,7 +386,9 @@ test_getset_vl(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY {}
+ H5E_BEGIN_TRY
+ {
+ }
H5E_END_TRY;
return 1;
} /* end test_getset_vl() */
@@ -1042,7 +1050,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
for (u = 0; u < nelmts; u++) {
buf_c[u].a = 1111.11F;
buf_c[u].x = 2222;
- buf_c[u].y = 3333.3333F;
+ buf_c[u].y = 3333.3333;
buf_c[u].z = 'd';
}
if (H5Dwrite(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0)
@@ -1296,7 +1304,7 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
HDmemset(&fill_ctype, 0, sizeof(fill_ctype));
- fill_ctype.y = 4444.4444F;
+ fill_ctype.y = 4444.4444;
if (H5Pset_fill_value(dcpl, ctype_id, &fill_ctype) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset11", &fill_ctype, H5D_FILL_TIME_ALLOC, layout,
@@ -1362,7 +1370,7 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
HDmemset(&fill_ctype, 0, sizeof(fill_ctype));
- fill_ctype.y = 4444.4444F;
+ fill_ctype.y = 4444.4444;
if (H5Pset_fill_value(dcpl, ctype_id, &fill_ctype) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset12", &fill_ctype, H5D_FILL_TIME_ALLOC, layout, H5T_COMPOUND,
@@ -1529,8 +1537,8 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, const void *_
(const comp_vl_datatype *)_compare_val; /* Value to compare against */
/* Verify value */
- if ((test_val->x != compare_val->x) || HDstrcmp(test_val->a, compare_val->a) ||
- HDstrcmp(test_val->b, compare_val->b) || (test_val->y != compare_val->y)) {
+ if ((test_val->x != compare_val->x) || HDstrcmp(test_val->a, compare_val->a) != 0 ||
+ HDstrcmp(test_val->b, compare_val->b) != 0 || (test_val->y != compare_val->y)) {
HDfprintf(stdout, "%u: Value read was not expected.\n", lineno);
HDfprintf(stdout,
" Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
@@ -1586,7 +1594,7 @@ test_extend_release_cmpd_vl(void *_elmt)
*-------------------------------------------------------------------------
*/
static int
-test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_size, hsize_t *start_size,
+test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t *ch_size, hsize_t *start_size,
hsize_t *max_size, hid_t dtype, void *fillval)
{
hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */
diff --git a/test/filter_fail.c b/test/filter_fail.c
index 5c95fe6..a1bcf28 100644
--- a/test/filter_fail.c
+++ b/test/filter_fail.c
@@ -167,7 +167,10 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled)
}
else {
/* Data writing should fail */
- H5E_BEGIN_TRY { ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -185,7 +188,10 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled)
/* Close dataset. If the chunk cache is enabled, the flushing of chunks should fail
* during H5Dclose. If it is diabled, H5Dwrite should fail but H5Dclose should succeed. */
if (cache_enabled) {
- H5E_BEGIN_TRY { ret = H5Dclose(dataset); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dclose(dataset);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
diff --git a/test/filter_plugin.c b/test/filter_plugin.c
index 254011c..276141a 100644
--- a/test/filter_plugin.c
+++ b/test/filter_plugin.c
@@ -566,7 +566,10 @@ test_dataset_write_with_filters(hid_t fid)
error:
/* Clean up objects used for this test */
- H5E_BEGIN_TRY { H5Pclose(dcpl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dcpl_id);
+ }
H5E_END_TRY
return FAIL;
@@ -703,7 +706,10 @@ test_dataset_read_with_filters(hid_t fid)
error:
/* Clean up objects used for this test */
- H5E_BEGIN_TRY { H5Dclose(did); }
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ }
H5E_END_TRY
return FAIL;
@@ -728,7 +734,10 @@ ensure_data_read_fails(hid_t did)
TEST_ERROR;
/* Read the dataset back (should fail) */
- H5E_BEGIN_TRY { ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, *check); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, *check);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR;
@@ -998,7 +1007,10 @@ test_path_api_calls(void)
TESTING(" remove (index 0 in empty table)");
/* Try to remove index zero in an empty list (SHOULD FAIL) */
- H5E_BEGIN_TRY { ret = H5PLremove(0); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5PLremove(0);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR;
@@ -1029,7 +1041,10 @@ test_path_api_calls(void)
TESTING(" remove (index too high)");
/* Try to remove a path where the index is beyond the table capacity (SHOULD FAIL) */
- H5E_BEGIN_TRY { ret = H5PLremove(n_starting_paths); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5PLremove(n_starting_paths);
+ }
H5E_END_TRY
if (ret >= 0)
@@ -1087,7 +1102,10 @@ test_path_api_calls(void)
TESTING(" get (index too high)");
/* Get path at the last + 1 index (SHOULD FAIL) */
- H5E_BEGIN_TRY { path_len = H5PLget(n_starting_paths, NULL, 0); }
+ H5E_BEGIN_TRY
+ {
+ path_len = H5PLget(n_starting_paths, NULL, 0);
+ }
H5E_END_TRY
if (path_len > 0)
TEST_ERROR;
diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c
index 7f9a664..5d6c1ef 100644
--- a/test/filter_plugin1_dsets.c
+++ b/test/filter_plugin1_dsets.c
@@ -26,14 +26,14 @@ static size_t add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER1_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 1", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)add_sub_value, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER1_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 1", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ add_sub_value, /* The actual filter function */
}};
H5PL_type_t
diff --git a/test/filter_plugin2_dsets.c b/test/filter_plugin2_dsets.c
index 08be78c..d2011d4 100644
--- a/test/filter_plugin2_dsets.c
+++ b/test/filter_plugin2_dsets.c
@@ -27,14 +27,14 @@ static size_t mult_div_value(unsigned int flags, size_t cd_nelmts, const unsigne
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER2_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 2", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)mult_div_value, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER2_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 2", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ mult_div_value, /* The actual filter function */
}};
H5PL_type_t
@@ -73,7 +73,7 @@ mult_div_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_valu
return 0;
/* Assignment to eliminate unused parameter warning */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) {
/* READ - Divide the original value by MULTIPLIER */
diff --git a/test/filter_plugin3_dsets.c b/test/filter_plugin3_dsets.c
index 5d8d57f..618ce06 100644
--- a/test/filter_plugin3_dsets.c
+++ b/test/filter_plugin3_dsets.c
@@ -30,14 +30,14 @@ static size_t add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts, const uns
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER3_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 3", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)add_sub_value_hdf5, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER3_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 3", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ add_sub_value_hdf5, /* The actual filter function */
}};
H5PL_type_t
diff --git a/test/filter_plugin4_groups.c b/test/filter_plugin4_groups.c
index 237642d..630dcd6 100644
--- a/test/filter_plugin4_groups.c
+++ b/test/filter_plugin4_groups.c
@@ -29,14 +29,14 @@ static size_t append_to_group_name(unsigned int flags, size_t cd_nelmts, const u
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER4_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 4", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)append_to_group_name, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER4_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 4", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ append_to_group_name, /* The actual filter function */
}};
H5PL_type_t
@@ -74,7 +74,7 @@ append_to_group_name(unsigned int flags, size_t cd_nelmts, const unsigned int *c
return 0;
/* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) {
/* READ - Remove the suffix from the group name */
diff --git a/test/flush1.c b/test/flush1.c
index 700286d..456f5f4 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -327,7 +327,10 @@ main(void)
HD_exit(EXIT_SUCCESS);
error:
- H5E_BEGIN_TRY { H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ }
H5E_END_TRY;
HDexit(EXIT_FAILURE);
diff --git a/test/freespace.c b/test/freespace.c
index 0ca4ea7..e888b2b 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -2916,7 +2916,10 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Pclose(fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/gen_cross.c b/test/gen_cross.c
index 3eac79a..2746bb6 100644
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
@@ -295,7 +295,7 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid)
hid_t dataset = -1; /* dataset handles */
hid_t dcpl = -1;
double data[NX][NY]; /* data to write */
- double fillvalue = -2.2f;
+ double fillvalue = -2.2;
hsize_t chunk[RANK] = {CHUNK0, CHUNK1};
int i, j;
diff --git a/test/gen_plist.c b/test/gen_plist.c
index 7a67c56..10c6423 100644
--- a/test/gen_plist.c
+++ b/test/gen_plist.c
@@ -42,7 +42,7 @@ main(void)
hsize_t max_size[1]; /* data space maximum size */
size_t nslots = 521 * 2;
size_t nbytes = 1048576 * 10;
- double w0 = 0.5f;
+ double w0 = 0.5;
unsigned max_compact;
unsigned min_dense;
const char * c_to_f = "x+32";
@@ -56,26 +56,26 @@ main(void)
1 /*TRUE*/,
0 /*FALSE*/,
(2 * 2048 * 1024),
- 0.3f,
+ 0.3,
(64 * 1024 * 1024),
(4 * 1024 * 1024),
60000,
H5C_incr__threshold,
- 0.8f,
- 3.0f,
+ 0.8,
+ 3.0,
1 /*TRUE*/,
(8 * 1024 * 1024),
H5C_flash_incr__add_space,
- 2.0f,
- 0.25f,
+ 2.0,
+ 0.25,
H5C_decr__age_out_with_threshold,
- 0.997f,
- 0.8f,
+ 0.997,
+ 0.8,
1 /*TRUE*/,
(3 * 1024 * 1024),
3,
0 /*FALSE*/,
- 0.2f,
+ 0.2,
(256 * 2048),
H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY};
H5AC_cache_image_config_t my_cache_image_config = {H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, TRUE, FALSE,
diff --git a/test/genall5.c b/test/genall5.c
index b5ff862..1da61f8 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -103,8 +103,6 @@ ns_grp_0(hid_t fid, const char *group_name)
HDassert(ret >= 0);
}
- return;
-
} /* ns_grp_0 */
/*-------------------------------------------------------------------------
@@ -222,7 +220,6 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name)
HDassert(ret >= 0);
}
- return;
} /* vrfy_ns_grp_0() */
/*-------------------------------------------------------------------------
@@ -363,8 +360,6 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(ret >= 0);
}
- return;
-
} /* ns_grp_c() */
/*-------------------------------------------------------------------------
@@ -640,7 +635,6 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(ret >= 0);
}
- return;
} /* vrfy_ns_grp_c() */
/*-------------------------------------------------------------------------
@@ -776,7 +770,6 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(ret >= 0);
}
- return;
} /* ns_grp_d() */
/*-------------------------------------------------------------------------
@@ -1050,8 +1043,6 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(ret >= 0);
}
- return;
-
} /* vrfy_ns_grp_d() */
/*-------------------------------------------------------------------------
@@ -1140,7 +1131,6 @@ os_grp_0(hid_t fid, const char *group_name)
}
}
- return;
} /* os_grp_0() */
/*-------------------------------------------------------------------------
@@ -1257,7 +1247,6 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
HDassert(ret >= 0);
}
- return;
} /* vrfy_os_grp_0() */
/*-------------------------------------------------------------------------
@@ -1377,7 +1366,6 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
}
- return;
} /* os_grp_n() */
/*-------------------------------------------------------------------------
@@ -1603,7 +1591,6 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
HDassert(ret >= 0);
}
- return;
} /* vrfy_os_grp_n() */
/*-------------------------------------------------------------------------
@@ -1686,10 +1673,10 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
-
- HDfree(wdata);
}
+ HDfree(wdata);
+
if (pass) {
ret = H5Dclose(dsid);
@@ -1700,7 +1687,6 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
} /* ds_ctg_i */
/*-------------------------------------------------------------------------
@@ -1905,10 +1891,10 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
}
HDassert((int)u == rdata[u]);
}
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Dclose(dsid);
@@ -1919,8 +1905,6 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
-
} /* vrfy_ds_ctg_i() */
/*-------------------------------------------------------------------------
@@ -2047,7 +2031,6 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
} /* ds_chk_i */
/*-------------------------------------------------------------------------
@@ -2267,10 +2250,10 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
}
HDassert((int)u == rdata[u]);
}
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Dclose(dsid);
@@ -2281,7 +2264,6 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
} /* vrfy_ds_chk_i() */
/*-------------------------------------------------------------------------
@@ -2409,8 +2391,6 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
-
} /* ds_cpt_i() */
/*-------------------------------------------------------------------------
@@ -2610,10 +2590,10 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
}
HDassert((int)u == rdata[u]);
}
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Dclose(dsid);
@@ -2624,7 +2604,6 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
} /* vrfy_ds_cpt_i() */
/*-------------------------------------------------------------------------
@@ -2773,7 +2752,6 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
} /* ds_ctg_v() */
/*-------------------------------------------------------------------------
@@ -3004,10 +2982,10 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
failure_mssg = "vrfy_ds_ctg_v: H5Treclaim() failed.";
}
HDassert(ret >= 0);
-
- HDfree(rdata);
} /* end if */
+ HDfree(rdata);
+
if (pass) {
ret = H5Sclose(sid);
@@ -3038,7 +3016,6 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
HDassert(ret >= 0);
}
- return;
} /* vrfy_ds_ctg_v() */
/*-------------------------------------------------------------------------
@@ -3266,7 +3243,6 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
- return;
} /* create_zoo() */
/*-------------------------------------------------------------------------
@@ -3414,5 +3390,4 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
- return;
} /* validate_zoo() */
diff --git a/test/getname.c b/test/getname.c
index d90e1c1..200c426 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -68,11 +68,11 @@ check_name(hid_t id, const char *chk_name, const char *chk_user_path)
TEST_ERROR
/* Check on name from H5Iget_name() */
- if (HDstrcmp(name, chk_name))
+ if (HDstrcmp(name, chk_name) != 0)
goto error;
/* Check on user path */
- if (HDstrcmp(user_path, chk_user_path))
+ if (HDstrcmp(user_path, chk_user_path) != 0)
goto error;
/* Check that if user path is hidden, the name from H5Iget_name() and the user path should be different */
@@ -1439,7 +1439,7 @@ test_main(hid_t file_id, hid_t fapl)
/* Check that name is longer */
if (name_len <= SMALL_NAME_BUF_SIZE)
TEST_ERROR
- if (HDstrcmp(name2, "/"))
+ if (HDstrcmp(name2, "/") != 0)
TEST_ERROR
}
@@ -1481,7 +1481,7 @@ test_main(hid_t file_id, hid_t fapl)
TEST_ERROR
/* Verify */
- if (HDstrcmp(name3, "/g17"))
+ if (HDstrcmp(name3, "/g17") != 0)
TEST_ERROR
*name3 = '\0';
@@ -1491,7 +1491,7 @@ test_main(hid_t file_id, hid_t fapl)
TEST_ERROR
/* Verify */
- if (HDstrcmp(name3, "/g"))
+ if (HDstrcmp(name3, "/g") != 0)
TEST_ERROR
HDfree(name3);
@@ -3794,7 +3794,10 @@ main(void)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file_id);
+ }
H5E_END_TRY;
HDputs("***** GET NAME TESTS FAILED *****");
diff --git a/test/gheap.c b/test/gheap.c
index 1d3b730..567fd65 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -129,7 +129,7 @@ test_1(hid_t fapl)
HDputs(" Unable to read object");
nerrors++;
}
- else if (HDmemcmp(in, out, size)) {
+ else if (HDmemcmp(in, out, size) != 0) {
H5_FAILED();
HDputs(" Value read doesn't match value written");
nerrors++;
@@ -149,7 +149,10 @@ test_1(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
if (obj)
HDfree(obj);
@@ -226,7 +229,7 @@ test_2(hid_t fapl)
HDputs(" Unable to read object");
nerrors++;
}
- else if (HDmemcmp(in, out, size)) {
+ else if (HDmemcmp(in, out, size) != 0) {
H5_FAILED();
HDputs(" Value read doesn't match value written");
nerrors++;
@@ -246,7 +249,10 @@ test_2(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
if (obj)
HDfree(obj);
@@ -333,7 +339,10 @@ test_3(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
if (obj)
HDfree(obj);
@@ -426,7 +435,10 @@ test_4(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
if (obj)
HDfree(obj);
@@ -491,7 +503,7 @@ test_ooo_indices(hid_t fapl)
GHEAP_REPEATED_ERR(" Unable to insert object into global heap")
/* Check that the index is as expected */
- if (obj[j].idx != ((1000 * i) + j - (1000 * ((~i & 1)))) % ((1u << 16) - 1) + 1)
+ if (obj[j].idx != ((1000 * i) + j - (1000 * ((~i & 1)))) % ((1U << 16) - 1) + 1)
GHEAP_REPEATED_ERR(" Unexpected global heap index");
}
@@ -542,7 +554,10 @@ test_ooo_indices(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
if (obj)
HDfree(obj);
@@ -597,7 +612,10 @@ main(void)
HDexit(EXIT_SUCCESS);
error:
- H5E_BEGIN_TRY { H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/h5test.c b/test/h5test.c
index 49df75ef..ba0662a 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -171,8 +171,6 @@ h5_clean_files(const char *base_name[], hid_t fapl)
/* Close the FAPL used to access the file */
H5Pclose(fapl);
-
- return;
} /* end h5_clean_files() */
/*-------------------------------------------------------------------------
@@ -192,66 +190,22 @@ h5_clean_files(const char *base_name[], hid_t fapl)
*
*-------------------------------------------------------------------------
*/
-/* Disable warning for "format not a string literal" here -QAK */
-/*
- * This pragma only needs to surround the snprintf() calls with
- * sub_filename in the code below, but early (4.4.7, at least) gcc only
- * allows diagnostic pragmas to be toggled outside of functions.
- */
-H5_GCC_DIAG_OFF("format-nonliteral")
void
h5_delete_test_file(const char *base_name, hid_t fapl)
{
- char filename[1024]; /* VFD-dependent filename to delete */
- char sub_filename[2048]; /* sub-files in multi & family VFDs */
- hid_t driver = -1; /* VFD ID */
+ char filename[1024]; /* VFD-dependent filename to delete */
/* Get the VFD-dependent filename */
if (NULL == h5_fixname(base_name, fapl, filename, sizeof(filename)))
return;
- driver = H5Pget_driver(fapl);
-
- if (driver == H5FD_FAMILY) {
- int j;
- for (j = 0; /*void*/; j++) {
- HDsnprintf(sub_filename, sizeof(sub_filename), filename, j);
-
- /* If we can't access the file, it probably doesn't exist
- * and we are done deleting the sub-files.
- */
- if (HDaccess(sub_filename, F_OK) < 0)
- break;
-
- HDremove(sub_filename);
- } /* end for */
- }
- else if (driver == H5FD_CORE) {
- hbool_t backing; /* Whether the core file has backing store */
-
- H5Pget_fapl_core(fapl, NULL, &backing);
-
- /* If the file was stored to disk with bacing store, remove it */
- if (backing)
- HDremove(filename);
- }
- else if (driver == H5FD_MULTI) {
- H5FD_mem_t mt;
-
- HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
-
- for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
- HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]);
- HDremove(sub_filename);
- }
+ H5E_BEGIN_TRY
+ {
+ H5Fdelete(filename, fapl);
}
- else {
- HDremove(filename);
- } /* end driver selection tree */
+ H5E_END_TRY;
- return;
} /* end h5_delete_test_file() */
-H5_GCC_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: h5_delete_all_test_files
@@ -282,7 +236,6 @@ h5_delete_all_test_files(const char *base_name[], hid_t fapl)
h5_delete_test_file(base_name[i], fapl);
} /* end for */
- return;
} /* end h5_delete_all_test_files() */
/*-------------------------------------------------------------------------
@@ -341,8 +294,6 @@ h5_test_shutdown(void)
/* Restore the original error reporting routine */
h5_restore_err();
-
- return;
} /* end h5_test_shutdown() */
/*-------------------------------------------------------------------------
@@ -449,8 +400,6 @@ h5_test_init(void)
HDassert(err_func == NULL);
H5Eget_auto2(H5E_DEFAULT, &err_func, NULL);
H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL);
-
- return;
} /* end h5_test_init() */
/*-------------------------------------------------------------------------
@@ -1246,9 +1195,10 @@ h5_set_info_object(void)
valp++;
/* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = (char *)HDcalloc(1, len + 1);
+ len = HDstrcspn(valp, ";");
+ next = &valp[len];
+ if (NULL == (key_val = (char *)HDcalloc(1, len + 1)))
+ return -1;
/* increment the next pointer past the terminating semicolon */
if (*next == ';')
@@ -1355,7 +1305,7 @@ h5_dump_info_object(MPI_Info info)
* temp in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
h5_stat_size_t
h5_get_file_size(const char *filename, hid_t fapl)
{
@@ -1460,7 +1410,7 @@ h5_get_file_size(const char *filename, hid_t fapl)
return (-1);
} /* end get_file_size() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*
* This routine is designed to provide equivalent functionality to 'printf'
@@ -1644,6 +1594,9 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name)
void * buf = NULL; /* Buffer for copying data */
const char *filename = H5_get_srcdir_filename(origfilename); /* Get the test file name to copy */
+ if (!filename)
+ goto error;
+
/* Allocate copy buffer */
if (NULL == (buf = HDcalloc((size_t)1, (size_t)READ_BUF_SIZE)))
goto error;
@@ -1733,7 +1686,10 @@ h5_verify_cached_stabs(const char *base_name[], hid_t fapl)
if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL)
continue;
- H5E_BEGIN_TRY { file = H5Fopen(filename, H5F_ACC_RDONLY, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
+ }
H5E_END_TRY
if (file < 0) {
i++;
@@ -1754,7 +1710,10 @@ h5_verify_cached_stabs(const char *base_name[], hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return -1;
@@ -1965,6 +1924,8 @@ static const H5FD_class_t H5FD_dummy_g = {
NULL, /* truncate */
NULL, /* lock */
NULL, /* unlock */
+ NULL, /* del */
+ NULL, /* ctl */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
diff --git a/test/h5test.h b/test/h5test.h
index 0d7dade..2855fb5 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -89,7 +89,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
/*
* Print the current location on the standard output stream.
*/
-#define AT() HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define AT() HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__);
/*
* The name of the test is printed by saying TESTING("something") which will
@@ -162,12 +162,8 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
goto error; \
}
-/*
- * Alarm definitions to wait up (terminate) a test that runs too long.
- */
+/* Number of seconds to wait before killing a test (requires alarm(2)) */
#define H5_ALARM_SEC 1200 /* default is 20 minutes */
-#define ALARM_ON TestAlarmOn()
-#define ALARM_OFF HDalarm(0)
/* Flags for h5_fileaccess_flags() */
#define H5_FILEACCESS_VFD 0x01
diff --git a/test/hdfs.c b/test/hdfs.c
index 6adae07..74fc2bd 100644
--- a/test/hdfs.c
+++ b/test/hdfs.c
@@ -102,7 +102,7 @@
*/
#define JSFAILED_AT() \
{ \
- HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \
}
/*----------------------------------------------------------------------------
@@ -588,7 +588,10 @@ error:
***********/
if (fapl_id < 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
return 1;
@@ -671,7 +674,10 @@ test_hdfs_fapl(void)
return 0;
error:
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
return 1;
@@ -856,7 +862,10 @@ test_vfd_open(void)
HDfprintf(stderr, "testing: %s\n", T.message);
#endif /* HDFS_TEST_DEBUG */
- H5E_BEGIN_TRY { fd = H5FDopen(T.url, T.flags, fapl_id, T.maxaddr); }
+ H5E_BEGIN_TRY
+ {
+ fd = H5FDopen(T.url, T.flags, fapl_id, T.maxaddr);
+ }
H5E_END_TRY;
if (NULL != fd) {
if (TRUE == T.might_use_other_driver && H5FD_HDFS != fd->driver_id) {
@@ -1037,7 +1046,10 @@ error:
(void)H5FDclose(fd_shakespeare);
}
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
@@ -1134,7 +1146,10 @@ error:
(void)H5FDclose(file_shakespeare);
}
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
@@ -1338,7 +1353,10 @@ error:
(void)H5FDclose(file_raven);
}
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
@@ -1450,7 +1468,10 @@ error:
***********/
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
if (file != NULL) {
@@ -1593,7 +1614,10 @@ error:
#endif /* HDFS_TEST_DEBUG */
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
if (file > 0) {
diff --git a/test/hyperslab.c b/test/hyperslab.c
index 1f57e3b..1c55259 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -585,10 +585,10 @@ test_multifill(size_t nx)
for (i = 0; i < nx; i++) {
src[i].left = 1111111;
- src[i].mid = 12345.6789F;
+ src[i].mid = 12345.6789;
src[i].right = 2222222;
dst[i].left = 3333333;
- dst[i].mid = 98765.4321F;
+ dst[i].mid = 98765.4321;
dst[i].right = 4444444;
} /* end for */
@@ -597,7 +597,7 @@ test_multifill(size_t nx)
* over and over again.
*/
fill.left = 55555555;
- fill.mid = 3.1415927F;
+ fill.mid = 3.1415927;
fill.right = 66666666;
src_stride = 0;
diff --git a/test/istore.c b/test/istore.c
index e634044..c75b8bf 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -376,7 +376,7 @@ test_extend(hid_t f, const char *prefix, size_t nx, size_t ny, size_t nz)
HDfprintf(stderr, " Read failed: ctr=%lu\n", (unsigned long)ctr);
goto error;
}
- if (HDmemcmp(buf, check, (size_t)nelmts)) {
+ if (HDmemcmp(buf, check, (size_t)nelmts) != 0) {
H5_FAILED();
HDfprintf(stderr, " Read check failed: ctr=%lu\n", (unsigned long)ctr);
HDfprintf(stderr, " Wrote:\n");
diff --git a/test/lheap.c b/test/lheap.c
index 125081c..2609510 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -103,7 +103,7 @@ main(void)
if (j > 4)
buf[j] = '\0';
- if (UFAIL == (obj[i] = H5HL_insert(f, heap, HDstrlen(buf) + 1, buf))) {
+ if (H5HL_insert(f, heap, HDstrlen(buf) + 1, buf, &obj[i]) < 0) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -155,7 +155,7 @@ main(void)
goto error;
}
- if (HDstrcmp(s, buf)) {
+ if (HDstrcmp(s, buf) != 0) {
H5_FAILED();
HDprintf(" i=%d, heap offset=%lu\n", i, (unsigned long)(obj[i]));
HDprintf(" got: \"%s\"\n", s);
@@ -212,7 +212,10 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/links.c b/test/links.c
index def3768..f022783 100644
--- a/test/links.c
+++ b/test/links.c
@@ -140,7 +140,7 @@ const char *FILENAME[] = {"links0",
#define H5L_DIM1 100
#define H5L_DIM2 100
-#define FILTER_FILESIZE_MAX_FRACTION (double)0.9F
+#define FILTER_FILESIZE_MAX_FRACTION 0.9
/* Creation order macros */
#define CORDER_GROUP_NAME "corder_group"
@@ -664,14 +664,20 @@ cklinks(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
if (H5Lexists(file, "/grp1/hard", H5P_DEFAULT) != TRUE)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
HDputs(" H5Lexists() should have failed for a path with missing components.");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { status = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -697,7 +703,7 @@ cklinks(hid_t fapl, hbool_t new_format)
} /* end if */
if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(linkval, "/d1")) {
+ if (HDstrcmp(linkval, "/d1") != 0) {
H5_FAILED();
HDputs(" Soft link test failed. Wrong link value");
TEST_ERROR
@@ -728,7 +734,7 @@ cklinks(hid_t fapl, hbool_t new_format)
HDprintf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR
} /* end if */
- if (HDstrcmp(linkval, "foobar")) {
+ if (HDstrcmp(linkval, "foobar") != 0) {
H5_FAILED();
HDputs(" Dangling link test failed. Wrong link value");
TEST_ERROR
@@ -759,7 +765,7 @@ cklinks(hid_t fapl, hbool_t new_format)
HDprintf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR
} /* end if */
- if (HDstrcmp(linkval, "/grp1/recursive")) {
+ if (HDstrcmp(linkval, "/grp1/recursive") != 0) {
H5_FAILED();
HDputs(" Recursive link test failed. Wrong link value");
TEST_ERROR
@@ -1058,7 +1064,7 @@ toomany(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/hard21"))
+ if (HDstrcmp(objname, "/hard21") != 0)
TEST_ERROR
/* Create object in hard-linked group */
@@ -1074,7 +1080,10 @@ toomany(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through too deep soft link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "soft17", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "soft17", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
@@ -1089,7 +1098,7 @@ toomany(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/soft16"))
+ if (HDstrcmp(objname, "/soft16") != 0)
TEST_ERROR
/* Create object using soft links */
@@ -1419,7 +1428,10 @@ test_move(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that the group is no longer in the original location */
- H5E_BEGIN_TRY { moved_grp = H5Gopen2(grp_1, "group_move", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ moved_grp = H5Gopen2(grp_1, "group_move", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (moved_grp >= 0) {
H5_FAILED();
@@ -1955,7 +1967,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
if (H5Gget_comment(file_id, "group1", sizeof(tmpstr), tmpstr) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(tmpstr, "comment"))
+ if (HDstrcmp(tmpstr, "comment") != 0)
TEST_ERROR
/* Create links using H5Glink and H5Glink2 */
@@ -1971,7 +1983,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
/* Test getting the names for objects */
if (H5Gget_objname_by_idx(group1_id, (hsize_t)0, tmpstr, sizeof(tmpstr)) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(tmpstr, "link_to_group2"))
+ if (HDstrcmp(tmpstr, "link_to_group2") != 0)
TEST_ERROR
H5E_BEGIN_TRY
{
@@ -2008,7 +2020,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
if (H5Gget_objinfo(file_id, "/group1/link_to_group2", TRUE, &sb_hard2) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) {
+ if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) {
H5_FAILED();
HDputs(" Hard link test failed. Link seems not to point to the ");
HDputs(" expected file location.");
@@ -2021,7 +2033,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
if (H5Gget_objinfo(file_id, "/group2/link_to_group1", TRUE, &sb_hard2) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) {
+ if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) {
H5_FAILED();
HDputs(" Hard link test failed. Link seems not to point to the ");
HDputs(" expected file location.");
@@ -2038,7 +2050,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
if (H5Gget_linkval(group2_id, "soft_link_to_group1", sb_soft1.linklen, tmpstr) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp("link_to_group1", tmpstr))
+ if (HDstrcmp("link_to_group1", tmpstr) != 0)
TEST_ERROR
/* Test non-existing links with H5Gget_objinfo */
@@ -2059,7 +2071,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
if (H5Gget_linkval(group2_id, "dangle_soft_link", sb_soft2.linklen, tmpstr) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp("dangle", tmpstr))
+ if (HDstrcmp("dangle", tmpstr) != 0)
TEST_ERROR
/* Test H5Gmove and H5Gmove2 */
@@ -2169,14 +2181,20 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
if (H5Lexists(file, "/grp1/hard", H5P_DEFAULT) != TRUE)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Lexists(file, "no_grp1/hard", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
HDputs(" H5Lexists() should have failed for a path with missing components.");
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { status = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Lexists(file, "/no_grp1/hard", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -2200,7 +2218,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
} /* end if */
if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(linkval, "/d1")) {
+ if (HDstrcmp(linkval, "/d1") != 0) {
H5_FAILED();
HDputs(" Soft link test failed. Wrong link value");
TEST_ERROR
@@ -2231,7 +2249,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
HDprintf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR
} /* end if */
- if (HDstrcmp(linkval, "foobar")) {
+ if (HDstrcmp(linkval, "foobar") != 0) {
H5_FAILED();
HDputs(" Dangling link test failed. Wrong link value");
TEST_ERROR
@@ -2262,7 +2280,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
HDprintf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR
} /* end if */
- if (HDstrcmp(linkval, "/grp1/recursive")) {
+ if (HDstrcmp(linkval, "/grp1/recursive") != 0) {
H5_FAILED();
HDputs(" Recursive link test failed. Wrong link value");
TEST_ERROR
@@ -2799,12 +2817,12 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR
- if (HDstrcmp(file, filename1)) {
+ if (HDstrcmp(file, filename1) != 0) {
H5_FAILED();
HDputs(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/")) {
+ if (HDstrcmp(path, "/") != 0) {
H5_FAILED();
HDputs(" External link path incorrect");
goto error;
@@ -2827,12 +2845,12 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR
- if (HDstrcmp(file, filename1)) {
+ if (HDstrcmp(file, filename1) != 0) {
H5_FAILED();
HDputs(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/")) {
+ if (HDstrcmp(path, "/") != 0) {
H5_FAILED();
HDputs(" External link path incorrect");
goto error;
@@ -2851,7 +2869,7 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/"))
+ if (HDstrcmp(objname, "/") != 0)
TEST_ERROR
/* Create object in external file */
@@ -2896,11 +2914,11 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
/* Check names */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/new_group"))
+ if (HDstrcmp(objname, "/new_group") != 0)
TEST_ERROR
if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/newer_group"))
+ if (HDstrcmp(objname, "/newer_group") != 0)
TEST_ERROR
/* Close opened objects */
@@ -2924,7 +2942,10 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
if ((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR
- H5E_BEGIN_TRY { gid = H5Gcreate2(fid, "ext_link/readonly_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gcreate2(fid, "ext_link/readonly_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY
if (gid >= 0)
TEST_ERROR
@@ -3045,9 +3066,9 @@ external_link_query_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Compare the file and object names */
- if (HDstrcmp(file_name, filename2))
+ if (HDstrcmp(file_name, filename2) != 0)
TEST_ERROR
- if (HDstrcmp(object_name, "/dst"))
+ if (HDstrcmp(object_name, "/dst") != 0)
TEST_ERROR
/* Query information about object that external link points to */
@@ -3241,7 +3262,7 @@ external_link_closing_deprec(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(buf, "comment"))
+ if (HDstrcmp(buf, "comment") != 0)
TEST_ERROR
/* Test H5*open */
@@ -3486,6 +3507,7 @@ done:
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
return FAIL;
@@ -3576,6 +3598,7 @@ done:
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
return FAIL;
@@ -3658,7 +3681,7 @@ ud_hard_links_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/group"))
+ if (HDstrcmp(objname, "/group") != 0)
TEST_ERROR
/* Create object in group */
@@ -3678,7 +3701,7 @@ ud_hard_links_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/group/new_group"))
+ if (HDstrcmp(objname, "/group/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -3841,7 +3864,7 @@ ud_link_reregister_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/" REREG_TARGET_NAME))
+ if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0)
TEST_ERROR
/* Create object in group */
@@ -3861,7 +3884,7 @@ ud_link_reregister_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/rereg_target/new_group"))
+ if (HDstrcmp(objname, "/rereg_target/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -4205,7 +4228,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/soft17"))
+ if (HDstrcmp(objname, "/soft17") != 0)
TEST_ERROR
/* Create group using soft link */
@@ -4231,7 +4254,10 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Try opening through what is now too many soft links */
- H5E_BEGIN_TRY { gid = H5Oopen(fid, "soft5", plist); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Oopen(fid, "soft5", plist);
+ }
H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
@@ -4246,7 +4272,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/soft4"))
+ if (HDstrcmp(objname, "/soft4") != 0)
TEST_ERROR
/* Test other functions that should use a LAPL */
@@ -4861,7 +4887,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -4870,7 +4896,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Don't test "native" order if there is no creation order index, since
@@ -4900,7 +4926,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -4909,7 +4935,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
} /* end if */
@@ -4934,7 +4960,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -4943,7 +4969,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Verify the link information for first link, in increasing link name order */
@@ -4966,7 +4992,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -4975,7 +5001,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Don't test "native" order queries on link name order, since there's not
@@ -5002,7 +5028,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -5011,7 +5037,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Success */
@@ -5358,7 +5384,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end else */
@@ -5366,7 +5392,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
/* Verify link information (in native order - native is increasing) */
@@ -5381,7 +5407,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end else */
@@ -5389,7 +5415,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
/* Make link name for decreasing order queries */
@@ -5410,7 +5436,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end else */
@@ -5418,7 +5444,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -5644,7 +5670,7 @@ delete_by_idx_deprec(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -5718,7 +5744,7 @@ delete_by_idx_deprec(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -5797,7 +5823,7 @@ delete_by_idx_deprec(hid_t fapl)
else
HDsnprintf(objname, sizeof(objname), "filler %02u",
((max_compact * 2) - ((u * 2) + 2)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -5831,7 +5857,7 @@ delete_by_idx_deprec(hid_t fapl)
else
HDsnprintf(objname, sizeof(objname), "filler %02u",
((max_compact * 2) - ((u * 2) + 4)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -5998,7 +6024,7 @@ delete_by_idx_old_deprec(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -6072,7 +6098,7 @@ delete_by_idx_old_deprec(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -6106,7 +6132,7 @@ delete_by_idx_old_deprec(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -6188,7 +6214,7 @@ link_iterate_deprec_cb(hid_t group_id, const char *link_name, const H5L_info1_t
/* Verify name of link */
HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder);
- if (HDstrcmp(link_name, objname))
+ if (HDstrcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -6397,7 +6423,10 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
/* Check for iteration routine indicating failure */
skip = 0;
- H5E_BEGIN_TRY { ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_fail_deprec_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_fail_deprec_cb, NULL);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -6685,7 +6714,7 @@ link_iterate_old_deprec_cb(hid_t group_id, const char *link_name, const H5L_info
/* Verify name of link */
HDsnprintf(objname, sizeof(objname), "filler %02u",
(info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
- if (HDstrcmp(link_name, objname))
+ if (HDstrcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -6895,7 +6924,10 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
if (ret >= 0)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_deprec_cb, iter_info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_deprec_cb, iter_info);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -7105,12 +7137,12 @@ external_link_root(hid_t fapl, hbool_t new_format)
TEST_ERROR
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR
- if (HDstrcmp(file, filename1)) {
+ if (HDstrcmp(file, filename1) != 0) {
H5_FAILED();
HDputs(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/")) {
+ if (HDstrcmp(path, "/") != 0) {
H5_FAILED();
HDputs(" External link path incorrect");
goto error;
@@ -7133,12 +7165,12 @@ external_link_root(hid_t fapl, hbool_t new_format)
TEST_ERROR
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR
- if (HDstrcmp(file, filename1)) {
+ if (HDstrcmp(file, filename1) != 0) {
H5_FAILED();
HDputs(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/")) {
+ if (HDstrcmp(path, "/") != 0) {
H5_FAILED();
HDputs(" External link path incorrect");
goto error;
@@ -7157,7 +7189,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/"))
+ if (HDstrcmp(objname, "/") != 0)
TEST_ERROR
/* Create object in external file */
@@ -7202,11 +7234,11 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check names */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/new_group"))
+ if (HDstrcmp(objname, "/new_group") != 0)
TEST_ERROR
if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/newer_group"))
+ if (HDstrcmp(objname, "/newer_group") != 0)
TEST_ERROR
/* Close opened objects */
@@ -7230,7 +7262,10 @@ external_link_root(hid_t fapl, hbool_t new_format)
if ((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR
- H5E_BEGIN_TRY { gid = H5Gcreate2(fid, "ext_link/readonly_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gcreate2(fid, "ext_link/readonly_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY
if (gid >= 0)
TEST_ERROR
@@ -7325,7 +7360,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/B/C"))
+ if (HDstrcmp(objname, "/A/B/C") != 0)
TEST_ERROR
/* Create object in external file */
@@ -7355,7 +7390,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/B/C/new_group"))
+ if (HDstrcmp(objname, "/A/B/C/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -7497,7 +7532,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/B/C"))
+ if (HDstrcmp(objname, "/A/B/C") != 0)
TEST_ERROR
/* Create object in external file */
@@ -7527,7 +7562,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/B/C/new_group"))
+ if (HDstrcmp(objname, "/A/B/C/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -7643,7 +7678,7 @@ external_link_self(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/X"))
+ if (HDstrcmp(objname, "/X") != 0)
TEST_ERROR
/* Create object through external link */
@@ -7665,7 +7700,7 @@ external_link_self(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/X/new_group"))
+ if (HDstrcmp(objname, "/X/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -7850,7 +7885,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/final"))
+ if (HDstrcmp(objname, "/final") != 0)
TEST_ERROR
/* Create object in external file */
@@ -7880,7 +7915,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/final/new_group"))
+ if (HDstrcmp(objname, "/final/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -8024,7 +8059,10 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "link1", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "link1", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
@@ -8039,7 +8077,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/final"))
+ if (HDstrcmp(objname, "/final") != 0)
TEST_ERROR
/* Create object in external file */
@@ -8131,7 +8169,10 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Open object through dangling file external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "no_file", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "no_file", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
@@ -8140,7 +8181,10 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
}
/* Open object through dangling object external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "no_object", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "no_object", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
@@ -8248,7 +8292,10 @@ external_link_prefix(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", gapl_id); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", gapl_id);
+ }
H5E_END_TRY;
/* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */
@@ -8342,7 +8389,10 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file from absolute path set for main file */
@@ -8427,7 +8477,10 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file from the main file's relative pathname */
@@ -8517,7 +8570,10 @@ external_link_cwd(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file from the current working directory */
@@ -8612,7 +8668,10 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file with abolute path */
@@ -8707,7 +8766,10 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file from main file's current working directory */
@@ -8879,7 +8941,10 @@ external_link_chdir(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (HDchdir("..") < 0)
@@ -9511,7 +9576,10 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
TEST_ERROR
/* Attempt to create a group through the external link using gapl (should fail) */
- H5E_BEGIN_TRY { group = H5Gcreate2(file1, "/ext_link/group", H5P_DEFAULT, H5P_DEFAULT, gapl); }
+ H5E_BEGIN_TRY
+ {
+ group = H5Gcreate2(file1, "/ext_link/group", H5P_DEFAULT, H5P_DEFAULT, gapl);
+ }
H5E_END_TRY;
if (group != FAIL)
TEST_ERROR
@@ -9559,25 +9627,40 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
TEST_ERROR
/* Attempt to set invalid flags on gapl */
- H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_TRUNC); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_TRUNC);
+ }
H5E_END_TRY;
if (ret != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_EXCL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_EXCL);
+ }
H5E_END_TRY;
if (ret != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_CREAT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_CREAT);
+ }
H5E_END_TRY;
if (ret != FAIL)
TEST_ERROR
/* SWMR reader with write access */
- H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_RDWR | H5F_ACC_SWMR_READ); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_RDWR | H5F_ACC_SWMR_READ);
+ }
H5E_END_TRY;
if (ret != FAIL)
TEST_ERROR
/* SWMR writer with read-only access */
- H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE);
+ }
H5E_END_TRY;
if (ret != FAIL)
TEST_ERROR
@@ -9690,19 +9773,31 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
} /* end if */
/* Verify that H5Fcreate and H5Fopen reject H5F_ACC_DEFAULT */
- H5E_BEGIN_TRY { file1 = H5Fcreate(filename1, H5F_ACC_DEFAULT, H5P_DEFAULT, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file1 = H5Fcreate(filename1, H5F_ACC_DEFAULT, H5P_DEFAULT, fapl);
+ }
H5E_END_TRY;
if (file1 != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { file1 = H5Fcreate(filename1, H5F_ACC_TRUNC | H5F_ACC_DEFAULT, H5P_DEFAULT, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file1 = H5Fcreate(filename1, H5F_ACC_TRUNC | H5F_ACC_DEFAULT, H5P_DEFAULT, fapl);
+ }
H5E_END_TRY;
if (file1 != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { file1 = H5Fopen(filename1, H5F_ACC_DEFAULT, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file1 = H5Fopen(filename1, H5F_ACC_DEFAULT, fapl);
+ }
H5E_END_TRY;
if (file1 != FAIL)
TEST_ERROR
- H5E_BEGIN_TRY { file1 = H5Fopen(filename1, H5F_ACC_RDWR | H5F_ACC_DEFAULT, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file1 = H5Fopen(filename1, H5F_ACC_RDWR | H5F_ACC_DEFAULT, fapl);
+ }
H5E_END_TRY;
if (file1 != FAIL)
TEST_ERROR
@@ -9753,13 +9848,13 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group, cons
set_elink_cb_t *op_data = (set_elink_cb_t *)_op_data;
/* Verify file and object names are correct */
- if (HDstrcmp(parent_file, op_data->parent_file))
+ if (HDstrcmp(parent_file, op_data->parent_file) != 0)
return FAIL;
- if (HDstrcmp(parent_group, "/group1"))
+ if (HDstrcmp(parent_group, "/group1") != 0)
return FAIL;
- if (HDstrcmp(target_file, op_data->target_file))
+ if (HDstrcmp(target_file, op_data->target_file) != 0)
return FAIL;
- if (HDstrcmp(target_obj, "/"))
+ if (HDstrcmp(target_obj, "/") != 0)
return FAIL;
/* Set flags to be read-write */
@@ -9883,7 +9978,10 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
op_data.code = 1;
/* Attempt to reopen group2 (should fail) */
- H5E_BEGIN_TRY { group = H5Gopen2(file1, "/group1/ext_link/group2", gapl); }
+ H5E_BEGIN_TRY
+ {
+ group = H5Gopen2(file1, "/group1/ext_link/group2", gapl);
+ }
H5E_END_TRY;
if (group != FAIL)
TEST_ERROR
@@ -9892,7 +9990,10 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
op_data.code = 2;
/* Attempt to reopen group2 (should fail) */
- H5E_BEGIN_TRY { group = H5Gopen2(file1, "/group1/ext_link/group2", gapl); }
+ H5E_BEGIN_TRY
+ {
+ group = H5Gopen2(file1, "/group1/ext_link/group2", gapl);
+ }
H5E_END_TRY;
if (group != FAIL)
TEST_ERROR
@@ -9977,7 +10078,10 @@ external_reset_register(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return FAIL;
} /* end external_reset_register() */
@@ -10046,7 +10150,10 @@ external_link_win1(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file via main file's CWD*/
@@ -10140,7 +10247,10 @@ external_link_win2(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file directly */
@@ -10231,7 +10341,10 @@ external_link_win3(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file directly */
@@ -10319,7 +10432,10 @@ external_link_win4(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file via main file's absolute drive/relative path */
@@ -10417,7 +10533,10 @@ external_link_win5(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file via main file's rel drive/abs path */
@@ -10512,7 +10631,10 @@ external_link_win6(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file via target file's rel path in current drive */
@@ -10604,7 +10726,10 @@ external_link_win7(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file via main file's local host/main drive*/
@@ -10701,7 +10826,10 @@ external_link_win8(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file directly */
@@ -10793,7 +10921,10 @@ external_link_win9(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* should be able to find the target file via main file's local host/main drive*/
@@ -10865,7 +10996,10 @@ external_link_recursive(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through dangling file external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "recursive", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "recursive", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
@@ -10983,9 +11117,9 @@ external_link_query(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Compare the file and object names */
- if (HDstrcmp(file_name, filename2))
+ if (HDstrcmp(file_name, filename2) != 0)
TEST_ERROR
- if (HDstrcmp(object_name, "/dst"))
+ if (HDstrcmp(object_name, "/dst") != 0)
TEST_ERROR
/* Query information about object that external link points to */
@@ -11382,7 +11516,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/dst"))
+ if (HDstrcmp(objname, "/dst") != 0)
TEST_ERROR
/* Create object in external file */
@@ -11442,7 +11576,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/dst"))
+ if (HDstrcmp(objname, "/dst") != 0)
TEST_ERROR
/* Create object in external file */
@@ -11489,7 +11623,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/dst"))
+ if (HDstrcmp(objname, "/dst") != 0)
TEST_ERROR
/* Move external link back to original location */
@@ -11499,7 +11633,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/dst"))
+ if (HDstrcmp(objname, "/dst") != 0)
TEST_ERROR
/* Create object in external file */
@@ -11673,7 +11807,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/dst"))
+ if (HDstrcmp(objname, "/dst") != 0)
TEST_ERROR
/* Create object in external file */
@@ -11722,7 +11856,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/dst"))
+ if (HDstrcmp(objname, "/dst") != 0)
TEST_ERROR
/* Create object in external file */
@@ -11915,7 +12049,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(buf, "comment"))
+ if (HDstrcmp(buf, "comment") != 0)
TEST_ERROR
/* Test H5*open */
@@ -12258,7 +12392,7 @@ external_link_strong(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/B/C"))
+ if (HDstrcmp(objname, "/A/B/C") != 0)
TEST_ERROR
if (H5Gclose(gid2) < 0)
TEST_ERROR
@@ -12706,7 +12840,10 @@ external_dont_fail_to_source(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Attempt to open the object the link points to. This should fail */
- H5E_BEGIN_TRY { oid = H5Oopen(fid, "link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ oid = H5Oopen(fid, "link", H5P_DEFAULT);
+ }
H5E_END_TRY
if (oid >= 0)
FAIL_PUTS_ERROR("Succeeded in opening target of invalid external link")
@@ -13650,6 +13787,7 @@ done:
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
return FAIL;
@@ -13741,6 +13879,7 @@ done:
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
return FAIL;
@@ -13823,7 +13962,7 @@ ud_hard_links(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/group"))
+ if (HDstrcmp(objname, "/group") != 0)
TEST_ERROR
/* Create object in group */
@@ -13843,7 +13982,7 @@ ud_hard_links(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/group/new_group"))
+ if (HDstrcmp(objname, "/group/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -14034,7 +14173,7 @@ ud_link_reregister(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/" REREG_TARGET_NAME))
+ if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0)
TEST_ERROR
/* Create object in group */
@@ -14054,7 +14193,7 @@ ud_link_reregister(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/rereg_target/new_group"))
+ if (HDstrcmp(objname, "/rereg_target/new_group") != 0)
TEST_ERROR
/* Close opened object */
@@ -14143,9 +14282,9 @@ UD_cb_create(const char *link_name, hid_t loc_group, const void *udata, size_t u
if (lcpl_id < 0)
TEST_ERROR
- if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME))
+ if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR
- if (HDstrcmp((const char *)udata, UD_CB_TARGET))
+ if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR
@@ -14170,9 +14309,9 @@ UD_cb_traverse(const char *link_name, hid_t cur_group, const void *udata, size_t
if (udata_size > 0 && !udata)
TEST_ERROR
- if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME))
+ if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR
- if (HDstrcmp((const char *)udata, UD_CB_TARGET))
+ if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR
@@ -14197,9 +14336,9 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata, size_t udata_
if (udata_size > 0 && !udata)
TEST_ERROR
- if (HDstrcmp(new_name, NEW_UD_CB_LINK_NAME))
+ if (HDstrcmp(new_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR
- if (HDstrcmp((const char *)udata, UD_CB_TARGET))
+ if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR
@@ -14221,9 +14360,9 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata, size_t udata_
if (udata_size > 0 && !udata)
TEST_ERROR
- if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME))
+ if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR
- if (HDstrcmp((const char *)udata, UD_CB_TARGET))
+ if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR
@@ -14243,9 +14382,9 @@ UD_cb_query(const char *link_name, const void *udata, size_t udata_size, void *b
if (udata_size > 0 && !udata)
TEST_ERROR
- if (HDstrcmp(link_name, UD_CB_LINK_NAME))
+ if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0)
TEST_ERROR
- if (HDstrcmp((const char *)udata, UD_CB_TARGET))
+ if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR
@@ -15077,7 +15216,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/soft17"))
+ if (HDstrcmp(objname, "/soft17") != 0)
TEST_ERROR
/* Create group using soft link */
@@ -15103,7 +15242,10 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Try opening through what is now too many soft links */
- H5E_BEGIN_TRY { gid = H5Oopen(fid, "soft5", plist); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Oopen(fid, "soft5", plist);
+ }
H5E_END_TRY;
if (gid >= 0) {
H5_FAILED();
@@ -15118,7 +15260,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/soft4"))
+ if (HDstrcmp(objname, "/soft4") != 0)
TEST_ERROR
/* Test other functions that should use a LAPL */
@@ -15426,7 +15568,10 @@ check_all_closed(hid_t fapl, hbool_t new_format, int stopat)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
return FAIL;
} /* end check_all_closed() */
@@ -15552,7 +15697,10 @@ build_visit_file(hid_t fapl)
return (fid);
error:
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
return FAIL;
} /* end build_visit_file() */
@@ -15572,7 +15720,7 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info2_t
lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data;
/* Check for correct link information */
- if (HDstrcmp(op_data->info[op_data->idx].path, name))
+ if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0)
return (H5_ITER_ERROR);
if (op_data->info[op_data->idx].type != linfo->type)
return (H5_ITER_ERROR);
@@ -15763,7 +15911,7 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info2_t
ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data;
/* Check for correct object information */
- if (HDstrcmp(op_data->info[op_data->idx].path, name))
+ if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0)
return (H5_ITER_ERROR);
if (op_data->info[op_data->idx].type != oinfo->type)
return (H5_ITER_ERROR);
@@ -16027,7 +16175,10 @@ obj_visit_stop(hid_t fapl, hbool_t new_format)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
return FAIL;
} /* end obj_visit_stop() */
@@ -16297,13 +16448,13 @@ link_filters(hid_t fapl, hbool_t new_format)
if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out,
(size_t)24, name_out, &filter_config_out) < 0)
TEST_ERROR
- if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) ||
+ if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 ||
filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
TEST_ERROR
if (H5Pget_filter2(gcpl2, (unsigned)(nfilters - 1), &flags_out, &cd_nelmts, &cd_value_out, (size_t)24,
name_out, &filter_config_out) < 0)
TEST_ERROR
- if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) ||
+ if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 ||
filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
TEST_ERROR
@@ -16314,7 +16465,7 @@ link_filters(hid_t fapl, hbool_t new_format)
if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out,
(size_t)24, name_out, &filter_config_out) < 0)
TEST_ERROR
- if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) ||
+ if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 ||
filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
TEST_ERROR
@@ -16536,8 +16687,11 @@ obj_exists(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Hard links */
- /* Verify that H5Oexists_by_name() fails for non-existent link in root group */
- H5E_BEGIN_TRY { status = H5Oexists_by_name(fid, "foo", H5P_DEFAULT); }
+ /* Verify that H5Oexists_by_name() returns false for non-existent link in root group */
+ H5E_BEGIN_TRY
+ {
+ status = H5Oexists_by_name(fid, "foo", H5P_DEFAULT);
+ }
H5E_END_TRY
if (status >= 0)
TEST_ERROR
@@ -16552,8 +16706,11 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (TRUE != H5Oexists_by_name(fid, "group", H5P_DEFAULT))
TEST_ERROR
- /* Verify that H5Oexists_by_name() fails for non-existent link in non-root group */
- H5E_BEGIN_TRY { status = H5Oexists_by_name(fid, "group/foo", H5P_DEFAULT); }
+ /* Verify that H5Oexists_by_name() returns false for non-existent object in non-root group */
+ H5E_BEGIN_TRY
+ {
+ status = H5Oexists_by_name(fid, "group/foo", H5P_DEFAULT);
+ }
H5E_END_TRY
if (status >= 0)
TEST_ERROR
@@ -16867,7 +17024,10 @@ corder_create_empty(hid_t fapl)
TEST_ERROR
/* Setting invalid combination of a group order creation order indexing on should fail */
- H5E_BEGIN_TRY { ret = H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_INDEXED); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_INDEXED);
+ }
H5E_END_TRY;
if (ret > 0) {
H5_FAILED();
@@ -17753,7 +17913,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -17762,7 +17922,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Don't test "native" order if there is no creation order index, since
@@ -17792,7 +17952,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -17801,7 +17961,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
} /* end if */
@@ -17826,7 +17986,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -17835,7 +17995,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Verify the link information for first link, in increasing link name order */
@@ -17858,7 +18018,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -17867,7 +18027,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Don't test "native" order queries on link name order, since there's not
@@ -17894,7 +18054,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end if */
@@ -17903,7 +18063,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(linkname, tmpname))
+ if (HDstrcmp(linkname, tmpname) != 0)
TEST_ERROR
/* Success */
@@ -18260,7 +18420,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end else */
@@ -18268,7 +18428,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
/* Verify link information (in native order - native is increasing) */
@@ -18285,7 +18445,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end else */
@@ -18293,7 +18453,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
/* Make link name for decreasing order queries */
@@ -18316,7 +18476,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(valname, tmpval))
+ if (HDstrcmp(valname, tmpval) != 0)
TEST_ERROR
} /* end else */
@@ -18324,7 +18484,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -18548,7 +18708,7 @@ delete_by_idx(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -18622,7 +18782,7 @@ delete_by_idx(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -18701,7 +18861,7 @@ delete_by_idx(hid_t fapl)
else
HDsnprintf(objname, sizeof(objname), "filler %02u",
((max_compact * 2) - ((u * 2) + 2)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -18735,7 +18895,7 @@ delete_by_idx(hid_t fapl)
else
HDsnprintf(objname, sizeof(objname), "filler %02u",
((max_compact * 2) - ((u * 2) + 4)));
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -18916,7 +19076,7 @@ delete_by_idx_old(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -18995,7 +19155,7 @@ delete_by_idx_old(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -19033,7 +19193,7 @@ delete_by_idx_old(hid_t fapl)
HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname))
+ if (HDstrcmp(objname, tmpname) != 0)
TEST_ERROR
} /* end for */
@@ -19119,7 +19279,7 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info2_t *info,
/* Verify name of link */
HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder);
- if (HDstrcmp(link_name, objname))
+ if (HDstrcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -19339,7 +19499,10 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
/* Check for iteration routine indicating failure */
skip = 0;
- H5E_BEGIN_TRY { ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_fail_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_fail_cb, NULL);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -19502,7 +19665,10 @@ link_iterate(hid_t fapl)
/* Check for out of bound iteration on compact group */
skip = (hsize_t)u;
- H5E_BEGIN_TRY { ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -19532,7 +19698,10 @@ link_iterate(hid_t fapl)
/* Check for out of bound iteration on dense group */
skip = (hsize_t)u;
- H5E_BEGIN_TRY { ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -19625,7 +19794,7 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info2_t *in
/* Verify name of link */
HDsnprintf(objname, sizeof(objname), "filler %02u",
(info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
- if (HDstrcmp(link_name, objname))
+ if (HDstrcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -19827,20 +19996,29 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
/* Check for iteration routine indicating failure */
skip = 0;
- H5E_BEGIN_TRY { ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
/* Check for iteration w/bad location ID */
skip = 0;
- H5E_BEGIN_TRY { ret = H5Literate2((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
#ifndef H5_NO_DEPRECATED_SYMBOLS
- H5E_BEGIN_TRY { ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_cb, iter_info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_cb, iter_info);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -19930,7 +20108,10 @@ link_iterate_old(hid_t fapl)
/* Check for out of bound iteration on old-style group */
skip = (hsize_t)u;
- H5E_BEGIN_TRY { ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, NULL);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -20535,7 +20716,10 @@ open_by_idx_old(hid_t fapl)
TEST_ERROR
/* Try to open on object in an empty group */
- H5E_BEGIN_TRY { ret = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -20571,7 +20755,10 @@ open_by_idx_old(hid_t fapl)
TEST_ERROR
/* Check for out of bound open by index */
- H5E_BEGIN_TRY { ret = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
diff --git a/test/links_env.c b/test/links_env.c
index 1a78ae2..590be20 100644
--- a/test/links_env.c
+++ b/test/links_env.c
@@ -69,7 +69,7 @@ external_link_env(hid_t fapl, hbool_t new_format)
if ((envval = HDgetenv("HDF5_EXT_PREFIX")) == NULL)
envval = "nomatch";
- if (HDstrcmp(envval, ".:tmp_links_env"))
+ if (HDstrcmp(envval, ".:tmp_links_env") != 0)
TEST_ERROR
/* Set up name for main file:"extlinks_env0" */
@@ -106,7 +106,10 @@ external_link_env(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Open object through external link */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ }
H5E_END_TRY;
/* Should be able to find the target file from pathnames set via HDF5_EXT_PREFIX */
diff --git a/test/mf.c b/test/mf.c
index d6f9fb7..59088dc 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -230,7 +230,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
/* Skip test when using VFDs that has different address spaces for each
* type of metadata allocation.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -378,7 +378,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
/* Skip test when using VFDs that has different address spaces for each
* type of metadata allocation.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -665,7 +665,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
/* Skip test when using VFDs that has different address spaces for each
* type of metadata allocation.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -872,7 +872,8 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TESTING("'temporary' file space allocation with old library format")
/* Can't run this test with multi-file VFDs */
- if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
+ if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0) {
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t * f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
@@ -936,17 +937,26 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Reading & writing with a temporary address value should fail */
- H5E_BEGIN_TRY { status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); }
+ H5E_BEGIN_TRY
+ {
+ status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR
- H5E_BEGIN_TRY { status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); }
+ H5E_BEGIN_TRY
+ {
+ status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR
/* Freeing a temporary address value should fail */
- H5E_BEGIN_TRY { status = H5MF_xfree(f, H5FD_MEM_SUPER, tmp_addr, (hsize_t)TBLOCK_SIZE30); }
+ H5E_BEGIN_TRY
+ {
+ status = H5MF_xfree(f, H5FD_MEM_SUPER, tmp_addr, (hsize_t)TBLOCK_SIZE30);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR
@@ -984,13 +994,19 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Test that pushing temporary space allocation into normal space fails */
- H5E_BEGIN_TRY { check_addr = H5MF_alloc_tmp(f, (hsize_t)(maxaddr / 3)); }
+ H5E_BEGIN_TRY
+ {
+ check_addr = H5MF_alloc_tmp(f, (hsize_t)(maxaddr / 3));
+ }
H5E_END_TRY;
if (H5F_addr_defined(check_addr))
TEST_ERROR
/* Test that pushing normal space allocation into temporary space fails */
- H5E_BEGIN_TRY { check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)); }
+ H5E_BEGIN_TRY
+ {
+ check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3));
+ }
H5E_END_TRY;
if (H5F_addr_defined(check_addr))
TEST_ERROR
@@ -1021,7 +1037,10 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_tmp() */
@@ -1998,7 +2017,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
TESTING("A free-space section absorbs an aggregator: test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2131,7 +2150,10 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_fs_absorb() */
@@ -2171,7 +2193,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2322,7 +2344,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 2");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2416,7 +2438,10 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_alloc2() */
@@ -2477,7 +2502,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator: test 3");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2579,7 +2604,10 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_alloc3() */
@@ -2642,7 +2670,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 4");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2744,7 +2772,10 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_alloc4() */
@@ -2788,7 +2819,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 5");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2867,7 +2898,10 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_alloc5() */
@@ -2923,7 +2957,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 6");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3027,7 +3061,10 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_alloc6() */
@@ -3094,7 +3131,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 7");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3216,7 +3253,10 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_alloc7() */
@@ -3262,7 +3302,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3512,7 +3552,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_extend() */
@@ -3557,7 +3600,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3749,7 +3792,10 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_aggr_absorb() */
@@ -3808,8 +3854,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4037,7 +4083,10 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_align_eoa() */
@@ -4249,8 +4298,8 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
if ((file_size = h5_get_file_size(filename, new_fapl)) < 0)
TEST_ERROR
@@ -4328,7 +4377,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_align_fs() */
@@ -4452,8 +4504,8 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4600,7 +4652,10 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_align_alloc1() */
@@ -4711,8 +4766,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4890,7 +4945,10 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_align_alloc2() */
@@ -5053,8 +5111,8 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5272,7 +5330,10 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_align_alloc3() */
@@ -5363,8 +5424,8 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5484,7 +5545,10 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_align_alloc4() */
@@ -5578,8 +5642,8 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5710,7 +5774,10 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_align_alloc5() */
@@ -5845,8 +5912,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -6021,7 +6088,10 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return 1;
} /* test_mf_align_alloc6() */
@@ -6190,7 +6260,10 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_mf_bug1() */
@@ -6856,7 +6929,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
else
TESTING("File's free-space is persistent with old library format")
- if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) {
+ if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0) {
/* File creation property list template */
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -7033,7 +7106,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TESTING("File's free-space is going away with old library format")
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -7224,7 +7297,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
TESTING("File space strategy/persisting/threshold with old library format")
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -7394,7 +7467,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
TESTING("File space merge/shrink for section size < threshold with old library format")
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -7637,7 +7710,10 @@ test_dichotomy(hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return (1);
} /* test_dichotomy() */
@@ -7956,7 +8032,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: H5MF_try_shrink()");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -8085,8 +8161,8 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: H5MF_try_extend() a small block");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0);
if (contig_addr_vfd) {
@@ -8264,7 +8340,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: H5MF_try_extend() a large block");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -8428,7 +8504,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: large allocations and de-allocations");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -8545,7 +8621,10 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
return (0);
error:
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
return (1);
diff --git a/test/mount.c b/test/mount.c
index 94d372e..c5ac9b3 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -96,7 +96,10 @@ setup(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return -1;
} /* end setup() */
@@ -197,7 +200,10 @@ test_illegal(hid_t fapl)
FAIL_STACK_ERROR
/* Try mounting a file on itself */
- H5E_BEGIN_TRY { status = H5Fmount(file1, "/mnt1", file1, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Fmount(file1, "/mnt1", file1, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -214,7 +220,10 @@ test_illegal(hid_t fapl)
FAIL_STACK_ERROR
if (H5Fmount(mnt, ".", file2, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Fmount(mnt, ".", file3, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Fmount(mnt, ".", file3, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -236,7 +245,10 @@ test_illegal(hid_t fapl)
FAIL_STACK_ERROR
if (H5Fmount(mnt, ".", file3, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Fmount(mnt, ".", file3b, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Fmount(mnt, ".", file3b, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -251,7 +263,10 @@ test_illegal(hid_t fapl)
/* Try to create a "weak" cycle */
if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Fmount(file2, "/mnt1/file2", file1b, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Fmount(file2, "/mnt1/file2", file1b, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -353,7 +368,10 @@ test_samefile(hid_t fapl)
FAIL_STACK_ERROR
if (!grp_info.mounted)
FAIL_PUTS_ERROR(" Group should have 'mounted' flag set.")
- H5E_BEGIN_TRY { status = H5Fmount(mnt1b, ".", file3, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Fmount(mnt1b, ".", file3, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" Mounting different files at one mount point should have failed.")
@@ -389,7 +407,10 @@ test_samefile(hid_t fapl)
FAIL_STACK_ERROR
if (!grp_info.mounted)
FAIL_PUTS_ERROR(" Group should have 'mounted' flag set.")
- H5E_BEGIN_TRY { status = H5Fmount(mnt1b, ".", file2, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Fmount(mnt1b, ".", file2, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" Mounting same files at one mount point should have failed.")
@@ -470,7 +491,10 @@ test_hide(hid_t fapl)
FAIL_STACK_ERROR
/* Original names under file1:/mnt1 should not be accessible */
- H5E_BEGIN_TRY { grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (grp >= 0) {
H5_FAILED();
@@ -958,7 +982,10 @@ test_unlink(hid_t fapl)
FAIL_STACK_ERROR
if (H5Oget_info_by_name3(root, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -976,7 +1003,10 @@ test_unlink(hid_t fapl)
*/
if (H5Oget_info_by_name3(root, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -999,14 +1029,20 @@ test_unlink(hid_t fapl)
* the mount point because the name doesn't exist anymore. We must
* supply the mount point directly.
*/
- H5E_BEGIN_TRY { status = H5Funmount(file1, "/mnt_unlink"); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Funmount(file1, "/mnt_unlink");
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
HDprintf(" %d: Unmount by name should not have been allowed!\n", __LINE__);
TEST_ERROR
} /* end if */
- H5E_BEGIN_TRY { status = H5Funmount(file2, "/"); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Funmount(file2, "/");
+ }
H5E_END_TRY;
if (status >= 0) {
H5_FAILED();
@@ -1547,7 +1583,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidABMX, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/M/X"))
+ if (HDstrcmp(objname, "/A/B/M/X") != 0)
TEST_ERROR
/* Close object in mounted file */
@@ -1562,7 +1598,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidABC, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/C"))
+ if (HDstrcmp(objname, "/A/B/C") != 0)
TEST_ERROR
/* Close object in mounted file */
@@ -1577,7 +1613,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidABT, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/T"))
+ if (HDstrcmp(objname, "/A/B/T") != 0)
TEST_ERROR
/* Close object in original file */
@@ -1592,7 +1628,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(didABMXYD, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/M/X/Y/D"))
+ if (HDstrcmp(objname, "/A/B/M/X/Y/D") != 0)
TEST_ERROR
/* Close object in mounted file */
@@ -1765,7 +1801,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXX, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/M/X/X"))
+ if (HDstrcmp(objname, "/A/M/X/X") != 0)
TEST_ERROR
/* Open group in mounted file #2 */
@@ -1785,7 +1821,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/M/X/M/Y"))
+ if (HDstrcmp(objname, "/A/M/X/M/Y") != 0)
TEST_ERROR
/* Unmount second file */
@@ -1796,7 +1832,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/X/M/Y"))
+ if (HDstrcmp(objname, "/X/M/Y") != 0)
TEST_ERROR
/* Rename object in file #3 that is "disconnected" from name hiearchy */
@@ -1816,7 +1852,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/X/M/Z"))
+ if (HDstrcmp(objname, "/X/M/Z") != 0)
TEST_ERROR
/* Mount fourth file */
@@ -1832,7 +1868,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidBMZ, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/B/M/Z"))
+ if (HDstrcmp(objname, "/B/M/Z") != 0)
TEST_ERROR
/* Unmount third file */
@@ -2412,7 +2448,10 @@ test_fcdegree_same(hid_t fapl)
TEST_ERROR
/* Try mounting file with different file close degree (should fail) */
- H5E_BEGIN_TRY { ret = H5Fmount(gidA, ".", fid2, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fmount(gidA, ".", fid2, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2565,7 +2604,10 @@ test_fcdegree_semi(hid_t fapl)
TEST_ERROR
/* Try closing file #2 (should fail, since there are still objects open) */
- H5E_BEGIN_TRY { ret = H5Fclose(fid2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fclose(fid2);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2575,7 +2617,10 @@ test_fcdegree_semi(hid_t fapl)
TEST_ERROR
/* Try closing file #2 (should still fail, since there are still objects open in child file) */
- H5E_BEGIN_TRY { ret = H5Fclose(fid2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fclose(fid2);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2713,11 +2758,17 @@ test_fcdegree_strong(hid_t fapl)
TEST_ERROR
/* Check that objects are closed */
- H5E_BEGIN_TRY { ret = H5Oget_info3(gidA, &oinfo, H5O_INFO_BASIC); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oget_info3(gidA, &oinfo, H5O_INFO_BASIC);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
- H5E_BEGIN_TRY { ret = H5Oget_info3(gidAM, &oinfo, H5O_INFO_BASIC); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oget_info3(gidAM, &oinfo, H5O_INFO_BASIC);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2851,11 +2902,17 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Attempt to create objects in read only file (should fail) */
- H5E_BEGIN_TRY { bad_id = H5Gcreate2(gidAM, "Z", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ bad_id = H5Gcreate2(gidAM, "Z", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (bad_id >= 0)
TEST_ERROR
- H5E_BEGIN_TRY { bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (bad_id >= 0)
TEST_ERROR
@@ -2895,7 +2952,10 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Attempt to create objects in read only file again (should fail) */
- H5E_BEGIN_TRY { bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (bad_id >= 0)
TEST_ERROR
@@ -3080,7 +3140,7 @@ test_mult_mount(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidAMT, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/A/M/T"))
+ if (HDstrcmp(name, "/A/M/T") != 0)
TEST_ERROR
/* Create object in file #3 */
@@ -3098,7 +3158,7 @@ test_mult_mount(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidBS, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/B/S"))
+ if (HDstrcmp(name, "/B/S") != 0)
TEST_ERROR
/* Re-open object created in file #3 through file #1 mount path */
@@ -3279,7 +3339,7 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/A/M"))
+ if (name_len == 0 || HDstrcmp(name, "/A/M") != 0)
TEST_ERROR
/* Unmount file #2 from file #1 */
@@ -3290,11 +3350,14 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len != 0 || HDstrcmp(name, ""))
+ if (name_len != 0 || HDstrcmp(name, "") != 0)
TEST_ERROR
/* Open object in file #3 through file #1 mount path (should fail) */
- H5E_BEGIN_TRY { gidAMS = H5Gopen2(fid1, "A/M/S", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gidAMS = H5Gopen2(fid1, "A/M/S", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gidAMS >= 0)
TEST_ERROR
@@ -3307,7 +3370,7 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidMS, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/M/S"))
+ if (HDstrcmp(name, "/M/S") != 0)
TEST_ERROR
/* Close group in file #3 */
@@ -3326,7 +3389,7 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidAMS, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/A/M/S"))
+ if (HDstrcmp(name, "/A/M/S") != 0)
TEST_ERROR
/* Close group in file #3 */
@@ -3475,7 +3538,7 @@ test_close_parent(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/A/M"))
+ if (name_len == 0 || HDstrcmp(name, "/A/M") != 0)
TEST_ERROR
/* Unmount file #2 from file #1, closing file #1 */
@@ -3486,7 +3549,7 @@ test_close_parent(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/M"))
+ if (name_len == 0 || HDstrcmp(name, "/M") != 0)
TEST_ERROR
/* Just file #2's underlying shared file should be open still */
@@ -3753,7 +3816,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/A/E/M"))
+ if (name_len == 0 || HDstrcmp(name, "/A/E/M") != 0)
TEST_ERROR
/* Open object in file #7 */
@@ -3764,7 +3827,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/B/I/Q"))
+ if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0)
TEST_ERROR
/* Close file #1 */
@@ -3808,7 +3871,10 @@ test_cut_graph(hid_t fapl)
TEST_ERROR
/* Attempt to open an object in file #4, from file #1 */
- H5E_BEGIN_TRY { gidK = H5Gopen2(gidQ, "/A/D/K", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gidK = H5Gopen2(gidQ, "/A/D/K", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gidK >= 0)
TEST_ERROR
@@ -3821,14 +3887,17 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidK, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/D/K"))
+ if (name_len == 0 || HDstrcmp(name, "/D/K") != 0)
TEST_ERROR
if (H5Gclose(gidK) < 0)
TEST_ERROR
/* Attempt to open an object in file #6, from file #5 */
- H5E_BEGIN_TRY { gidO = H5Gopen2(gidM, "/B/H/O", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gidO = H5Gopen2(gidM, "/B/H/O", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gidO >= 0)
TEST_ERROR
@@ -3841,7 +3910,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/B/H/O"))
+ if (name_len == 0 || HDstrcmp(name, "/B/H/O") != 0)
TEST_ERROR
if (H5Gclose(gidO) < 0)
@@ -3851,14 +3920,14 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/E/M"))
+ if (name_len == 0 || HDstrcmp(name, "/E/M") != 0)
TEST_ERROR
/* Check the name of "Q" is still defined */
*name = '\0';
if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/B/I/Q"))
+ if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0)
TEST_ERROR
/* Check that all seven underlying files are still opened */
@@ -3883,7 +3952,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/I/Q"))
+ if (name_len == 0 || HDstrcmp(name, "/I/Q") != 0)
TEST_ERROR
/* Open object in file #6 from file #7 */
@@ -3894,7 +3963,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/H/O"))
+ if (name_len == 0 || HDstrcmp(name, "/H/O") != 0)
TEST_ERROR
if (H5Gclose(gidO) < 0)
@@ -4039,7 +4108,10 @@ test_symlink(hid_t fapl)
TEST_ERROR
/* Attempt to open an object in file #3 (should fail) */
- H5E_BEGIN_TRY { gidL = H5Gopen2(fid1, "L", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gidL = H5Gopen2(fid1, "L", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (gidL >= 0)
TEST_ERROR
@@ -4060,7 +4132,7 @@ test_symlink(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidL, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/L"))
+ if (name_len == 0 || HDstrcmp(name, "/L") != 0)
TEST_ERROR
/* Close file #1 */
diff --git a/test/mtime.c b/test/mtime.c
index 78f9065..43dc502 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -120,7 +120,7 @@ main(void)
HDputs(" cannot be queried on this system. See H5O_mtime_decode().");
return 0;
}
- else if (HDfabs(HDdifftime(now, oi1.ctime)) > (double)60.0F) {
+ else if (HDfabs(HDdifftime(now, oi1.ctime)) > 60.0) {
H5_FAILED();
tm = HDlocaltime(&(oi1.ctime));
HDstrftime((char *)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm);
diff --git a/test/null_vol_connector.c b/test/null_vol_connector.c
index b574a8e..6555763 100644
--- a/test/null_vol_connector.c
+++ b/test/null_vol_connector.c
@@ -15,9 +15,6 @@
* (registration, etc.).
*/
-/* Public HDF5 header */
-#include "hdf5.h"
-
/* For HDF5 plugin functionality */
#include "H5PLextern.h"
@@ -119,6 +116,7 @@ static const H5VL_class_t null_vol_g = {
{
/* introspect_cls */
NULL, /* get_conn_cls */
+ NULL, /* get_cap_flags */
NULL, /* opt_query */
},
{
diff --git a/test/null_vol_connector.h b/test/null_vol_connector.h
index 0e48e75..8fe9abe 100644
--- a/test/null_vol_connector.h
+++ b/test/null_vol_connector.h
@@ -15,10 +15,10 @@
* (registration, etc.).
*/
-#ifndef _null_vol_connector_H
-#define _null_vol_connector_H
+#ifndef NULL_VOL_CONNECTOR_H
+#define NULL_VOL_CONNECTOR_H
#define NULL_VOL_CONNECTOR_VALUE ((H5VL_class_value_t)160)
#define NULL_VOL_CONNECTOR_NAME "null_vol_connector"
-#endif /* _null_vol_connector_H */
+#endif /* NULL_VOL_CONNECTOR_H */
diff --git a/test/objcopy.c b/test/objcopy.c
index 717427a..e01083d 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -1103,7 +1103,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
/* Iterate over all elements, calling memcmp() for each */
for (elmt = 0; elmt < nelmts; elmt++) {
- if (HDmemcmp(memb1, memb2, memb_size))
+ if (HDmemcmp(memb1, memb2, memb_size) != 0)
TEST_ERROR
/* Update member pointers */
@@ -1325,7 +1325,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
else
TEST_ERROR
} /* end else */
- else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts)))
+ else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts)) != 0)
TEST_ERROR
/* Data should be the same. :-) */
@@ -1596,7 +1596,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
if (H5Lget_name_by_idx(gid2, ".", H5_INDEX_NAME, H5_ITER_INC, idx, objname2,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, objname2))
+ if (HDstrcmp(objname, objname2) != 0)
TEST_ERROR
/* Get link info */
@@ -1710,7 +1710,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
TEST_ERROR
/* Compare link data */
- if (HDmemcmp(linkval, linkval2, linfo.u.val_size))
+ if (HDmemcmp(linkval, linkval2, linfo.u.val_size) != 0)
TEST_ERROR
} /* end else-if */
else {
@@ -1728,7 +1728,9 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
return TRUE;
error:
- H5E_BEGIN_TRY {}
+ H5E_BEGIN_TRY
+ {
+ }
H5E_END_TRY;
return FALSE;
} /* end compare_groups() */
@@ -2539,7 +2541,10 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(fapl_dst, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(fapl_dst, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
@@ -2931,7 +2936,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
HDmemset(buf, 0, sizeof(buf));
for (i = 0; i < DIM_SIZE_1; i++) {
buf[i].a = i;
- buf[i].d = (double)1.0F / (double)(i + 1);
+ buf[i].d = 1.0 / (double)(i + 1);
} /* end for */
/* Initialize the filenames */
@@ -4493,6 +4498,10 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
TESTING("H5Ocopy(): compressed dataset");
#ifndef H5_HAVE_FILTER_DEFLATE
+ (void)fcpl_src;
+ (void)fcpl_dst;
+ (void)src_fapl;
+ (void)dst_fapl; /* Silence compiler */
SKIPPED();
HDputs(" Deflation filter not available");
#else /* H5_HAVE_FILTER_DEFLATE */
@@ -4918,6 +4927,10 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
}
#ifndef H5_HAVE_FILTER_DEFLATE
+ (void)fcpl_src;
+ (void)fcpl_dst;
+ (void)src_fapl;
+ (void)dst_fapl; /* Silence compiler */
SKIPPED();
HDputs(" Deflation filter not available");
#else /* H5_HAVE_FILTER_DEFLATE */
@@ -7025,7 +7038,7 @@ compare_attribute_compound_vlstr(hid_t loc, hid_t loc2)
FAIL_STACK_ERROR
if (HDstrlen(rbuf.v) != HDstrlen(rbuf2.v))
FAIL_STACK_ERROR
- if (HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)))
+ if (HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)) != 0)
FAIL_STACK_ERROR
/* Reclaim vlen buffer */
@@ -7272,6 +7285,10 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
TESTING("H5Ocopy(): compressed dataset with VLEN datatype");
#ifndef H5_HAVE_FILTER_DEFLATE
+ (void)fcpl_src;
+ (void)fcpl_dst;
+ (void)src_fapl;
+ (void)dst_fapl; /* Silence compiler */
SKIPPED();
HDputs(" Deflation filter not available");
#else /* H5_HAVE_FILTER_DEFLATE */
@@ -11695,9 +11712,9 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap
TEST_ERROR
/* Verify that the references contain only "0" bytes */
- if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)))
+ if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0)
TEST_ERROR
- if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)))
+ if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0)
TEST_ERROR
/* Close datasets */
@@ -11740,9 +11757,9 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap
TEST_ERROR
/* Verify that the references contain only "0" bytes */
- if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)))
+ if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0)
TEST_ERROR
- if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)))
+ if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0)
TEST_ERROR
/* Close */
@@ -11902,9 +11919,9 @@ test_copy_null_ref_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
TEST_ERROR
/* Verify that the references contain only "0" bytes */
- if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)))
+ if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0)
TEST_ERROR
- if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)))
+ if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0)
TEST_ERROR
/* Create destination file */
@@ -11947,9 +11964,9 @@ test_copy_null_ref_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
TEST_ERROR
/* Verify that the references contain only "0" bytes */
- if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)))
+ if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0)
TEST_ERROR
- if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)))
+ if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0)
TEST_ERROR
/* Close */
diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c
index 22022f2..23df121 100644
--- a/test/objcopy_ref.c
+++ b/test/objcopy_ref.c
@@ -887,7 +887,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
/* Iterate over all elements, calling memcmp() for each */
for (elmt = 0; elmt < nelmts; elmt++) {
- if (HDmemcmp(memb1, memb2, memb_size))
+ if (HDmemcmp(memb1, memb2, memb_size) != 0)
TEST_ERROR
/* Update member pointers */
@@ -1035,7 +1035,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
else
TEST_ERROR
} /* end else */
- else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts)))
+ else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts)) != 0)
TEST_ERROR
/* Data should be the same. :-) */
@@ -1306,7 +1306,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
if (H5Lget_name_by_idx(gid2, ".", H5_INDEX_NAME, H5_ITER_INC, idx, objname2,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(objname, objname2))
+ if (HDstrcmp(objname, objname2) != 0)
TEST_ERROR
/* Get link info */
@@ -1420,7 +1420,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
TEST_ERROR
/* Compare link data */
- if (HDmemcmp(linkval, linkval2, linfo.u.val_size))
+ if (HDmemcmp(linkval, linkval2, linfo.u.val_size) != 0)
TEST_ERROR
} /* end else-if */
else {
@@ -1438,7 +1438,9 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
return TRUE;
error:
- H5E_BEGIN_TRY {}
+ H5E_BEGIN_TRY
+ {
+ }
H5E_END_TRY;
return FALSE;
} /* end compare_groups() */
diff --git a/test/ohdr.c b/test/ohdr.c
index 54040e1..d28b11e 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -296,7 +296,10 @@ test_ohdr_cache(char *filename, hid_t fapl)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
return FAIL;
@@ -454,6 +457,59 @@ error:
} /* test_ohdr_swmr() */
/*
+ * Tests bad object header messages.
+ *
+ * Currently tests for CVE-2020-10810 fixes but can be expanded to handle
+ * other CVE badness.
+ */
+
+/* This is a generated file that can be obtained from:
+ *
+ * https://nvd.nist.gov/vuln/detail/CVE-2020-10810
+ *
+ * It was formerly named H5AC_unpin_entry_POC
+ */
+#define CVE_2020_10810_FILENAME "cve_2020_10810.h5"
+
+static herr_t
+test_ohdr_badness(hid_t fapl)
+{
+ hid_t fid = H5I_INVALID_HID;
+
+ /* CVE-2020-10810 involved a malformed fsinfo message
+ * This test ensures the fundamental problem is fixed. Running it under
+ * valgrind et al. will ensure that the memory leaks and invalid access
+ * are fixed.
+ */
+ TESTING("Fix for CVE-2020-10810");
+
+ H5E_BEGIN_TRY
+ {
+ /* This should fail due to the malformed fsinfo message. It should
+ * fail gracefully and not segfault.
+ */
+ fid = H5Fopen(CVE_2020_10810_FILENAME, H5F_ACC_RDWR, fapl);
+ }
+ H5E_END_TRY;
+
+ if (fid >= 0)
+ FAIL_PUTS_ERROR("should not have been able to open malformed file");
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+}
+
+/*
* To test objects with unknown messages in a file with:
* a) H5O_BOGUS_VALID_ID:
* --the bogus_id is within the range of H5O_msg_class_g[]
@@ -485,7 +541,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
done in the source directory. */
HDstrncpy(testfile, FILE_BOGUS, TESTFILE_LEN);
testfile[TESTFILE_LEN - 1] = '\0';
- HDstrncat(testfile, ".copy", 5);
+ HDstrncat(testfile, ".copy", sizeof(testfile) - HDstrlen(testfile) - 1);
/* Make a copy of the data file from svn. */
if (h5_make_local_copy(FILE_BOGUS, testfile) < 0)
@@ -549,7 +605,10 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
TESTING("object in r/o file with unknown header message & 'fail if unknown always' flag set");
/* Attempt to open the dataset with the unknown header message, and "fail if unknown always" flag */
- H5E_BEGIN_TRY { did = H5Dopen2(loc_bogus, "Dataset3", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(loc_bogus, "Dataset3", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (did >= 0) {
H5Dclose(did);
@@ -713,7 +772,10 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* Attempt to open the dataset with the unknown header message, and "fail if unknown and open for write"
* flag */
- H5E_BEGIN_TRY { did = H5Dopen2(loc_bogus, "Dataset2", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(loc_bogus, "Dataset2", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (did >= 0) {
H5Dclose(did);
@@ -725,7 +787,10 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
TESTING("object in r/w file with unknown header message & 'fail if unknown always' flag set");
/* Attempt to open the dataset with the unknown header message, and "fail if unknown always" flag */
- H5E_BEGIN_TRY { did = H5Dopen2(loc_bogus, "Dataset3", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(loc_bogus, "Dataset3", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (did >= 0) {
H5Dclose(did);
@@ -780,7 +845,7 @@ count_attributes(hid_t dset_id)
* On success, stores size in `size_out` pointer.
*/
static herr_t
-_oh_getsize(hid_t did, hsize_t *size_out)
+oh_getsize(hid_t did, hsize_t *size_out)
{
H5O_native_info_t ninfo;
@@ -803,9 +868,9 @@ oh_compare(hid_t did1, hid_t did2)
hsize_t space1 = 0;
hsize_t space2 = 0;
- if (FAIL == _oh_getsize(did1, &space1))
+ if (FAIL == oh_getsize(did1, &space1))
return -1;
- if (FAIL == _oh_getsize(did2, &space2))
+ if (FAIL == oh_getsize(did2, &space2))
return -2;
if (space1 < space2)
@@ -907,7 +972,7 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id)
/* Read the data back and verify */
if (H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0)
TEST_ERROR;
- if (HDstrcmp(in_buf, out_buf))
+ if (HDstrcmp(in_buf, out_buf) != 0)
TEST_ERROR;
/* modify the string attribute */
@@ -922,7 +987,7 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id)
/* Read the data back and verify */
if (H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0)
TEST_ERROR;
- if (HDstrcmp(in_buf, out_buf))
+ if (HDstrcmp(in_buf, out_buf) != 0)
TEST_ERROR;
/* Close */
@@ -1753,8 +1818,8 @@ main(void)
env_h5_drvr = "nomatch";
/* Check for VFD which stores data in multiple files */
- single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"));
+ single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0);
/* Reset library */
h5_reset();
@@ -1774,7 +1839,10 @@ main(void)
char msg[80]; /* Message for file format version */
/* Set version bounds before opening the file */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
@@ -1967,7 +2035,10 @@ main(void)
if (ro != time_new)
TEST_ERROR
time_new = 33333333;
- H5E_BEGIN_TRY { ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2029,6 +2100,9 @@ main(void)
} /* high */
} /* low */
+ /* Verify bad ohdr message fixes work */
+ test_ohdr_badness(fapl);
+
/* Verify symbol table messages are cached */
if (h5_verify_cached_stabs(FILENAME, fapl) < 0)
TEST_ERROR
@@ -2050,7 +2124,10 @@ main(void)
error:
HDputs("*** TESTS FAILED ***");
- H5E_BEGIN_TRY { H5Fclose(file); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/page_buffer.c b/test/page_buffer.c
index 9aade63..b80d330 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -408,7 +408,10 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Pset_page_buffer_size(fapl, 512, 0, 0) < 0)
TEST_ERROR;
- H5E_BEGIN_TRY { file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
if (file_id >= 0)
@@ -426,7 +429,10 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Pset_page_buffer_size(fapl, 511, 0, 0) < 0)
TEST_ERROR;
- H5E_BEGIN_TRY { file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
if (file_id >= 0)
@@ -435,7 +441,10 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
/* Test setting a page buffer with sum of min meta and raw
* data percentage > 100 - should fail
*/
- H5E_BEGIN_TRY { ret = H5Pset_page_buffer_size(fapl, 512, 50, 51); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_page_buffer_size(fapl, 512, 50, 51);
+ }
H5E_END_TRY;
if (ret >= 0)
@@ -2054,7 +2063,10 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* try to create the file -- should fail */
- H5E_BEGIN_TRY { file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
if (file_id >= 0)
@@ -2083,7 +2095,10 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr)
/* try to open the file using the fapl prepared above which enables
* page buffering. Should fail.
*/
- H5E_BEGIN_TRY { file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ }
H5E_END_TRY;
if (file_id >= 0)
@@ -2195,7 +2210,10 @@ main(void)
error:
HDprintf("***** %d Page Buffering TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
- H5E_BEGIN_TRY { H5Pclose(fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ }
H5E_END_TRY;
if (api_ctx_pushed)
diff --git a/test/pool.c b/test/pool.c
index 9ce1846..c508025 100644
--- a/test/pool.c
+++ b/test/pool.c
@@ -34,7 +34,7 @@
#define MPOOL_LARGE_BLOCK (MPOOL_PAGE_SIZE * 3)
#define MPOOL_NUM_SMALL_BLOCKS 64
#define MPOOL_SMALL_BLOCK 1
-#define MPOOL_NUM_RANDOM 10 * 1024
+#define MPOOL_NUM_RANDOM (10 * 1024)
#define MPOOL_RANDOM_MAX_SIZE (MPOOL_PAGE_SIZE * 2)
/*-------------------------------------------------------------------------
diff --git a/test/reserved.c b/test/reserved.c
index 1286893..6e41a16 100644
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -65,7 +65,10 @@ rsrv_heap(void)
* should throw an error.
*/
for (i = 0; i < 200; i++) {
- H5E_BEGIN_TRY { dataspace_id = H5Screate_simple(1, dims, dims); }
+ H5E_BEGIN_TRY
+ {
+ dataspace_id = H5Screate_simple(1, dims, dims);
+ }
H5E_END_TRY
HDsprintf(dset_name, "Dset %d", i);
@@ -80,7 +83,10 @@ rsrv_heap(void)
if (dataset_id < 0)
break;
- H5E_BEGIN_TRY { H5Dwrite(dataset_id, H5T_NATIVE_INT, dataspace_id, dataspace_id, H5P_DEFAULT, &i); }
+ H5E_BEGIN_TRY
+ {
+ H5Dwrite(dataset_id, H5T_NATIVE_INT, dataspace_id, dataspace_id, H5P_DEFAULT, &i);
+ }
H5E_END_TRY
if (H5Dclose(dataset_id) < 0)
@@ -120,7 +126,7 @@ rsrv_heap(void)
/* If we can read a dataset from the file, the file has been flushed to disk
* (if the heap or object headers weren't flushed, the file would be empty).
*/
- if (dataset_id == H5I_BADID)
+ if (dataset_id == H5I_INVALID_HID)
TEST_ERROR;
if (H5Dclose(dataset_id) < 0)
@@ -262,7 +268,7 @@ rsrv_ohdr(void)
/* If we can read the dataset from the file, the file has been flushed to disk
* (if the heap or object headers weren't flushed, the file would be empty).
*/
- if (dataset_id == H5I_BADID)
+ if (dataset_id == H5I_INVALID_HID)
TEST_ERROR;
if (H5Dclose(dataset_id) < 0)
@@ -426,7 +432,7 @@ rsrv_vlen(void)
/* If we can read the dataset from the file, the file has been flushed to disk
* (if the heap or object headers weren't flushed, the file would be empty).
*/
- if (dataset_id == H5I_BADID)
+ if (dataset_id == H5I_INVALID_HID)
TEST_ERROR;
if (H5Dclose(dataset_id) < 0)
diff --git a/test/ros3.c b/test/ros3.c
index 9fb3ebe..b7b27ed 100644
--- a/test/ros3.c
+++ b/test/ros3.c
@@ -106,7 +106,7 @@
*/
#define JSFAILED_AT() \
{ \
- HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \
}
/*----------------------------------------------------------------------------
@@ -625,7 +625,10 @@ error:
***********/
if (fapl_id < 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
return 1;
@@ -699,7 +702,10 @@ test_ros3_fapl(void)
return 0;
error:
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
return 1;
@@ -867,7 +873,10 @@ test_vfd_open(void)
else if (T.which_fapl == FAPL_ROS3_ANON)
_fapl_id = fapl_id;
- H5E_BEGIN_TRY { fd = H5FDopen(T.url, T.flags, _fapl_id, T.maxaddr); }
+ H5E_BEGIN_TRY
+ {
+ fd = H5FDopen(T.url, T.flags, _fapl_id, T.maxaddr);
+ }
H5E_END_TRY;
if (NULL != fd)
JSVERIFY(1, 0, T.message); /* wrapper to print message and fail */
@@ -908,11 +917,17 @@ error:
(void)H5FDclose(fd);
}
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
if (fapl_file_access >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_file_access); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_file_access);
+ }
H5E_END_TRY;
}
if (curl_ready == TRUE) {
@@ -1043,7 +1058,10 @@ error:
if (TRUE == curl_ready)
curl_global_cleanup();
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
@@ -1138,7 +1156,10 @@ error:
(void)H5FDclose(file_shakespeare);
}
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
@@ -1338,7 +1359,10 @@ error:
if (file_raven)
(void)H5FDclose(file_raven);
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
@@ -1448,7 +1472,10 @@ error:
***********/
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
if (file) {
@@ -1579,7 +1606,10 @@ error:
if (TRUE == curl_ready)
curl_global_cleanup();
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
@@ -1685,7 +1715,10 @@ error:
HDfflush(stdout);
if (fapl_id >= 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
if (file > 0)
diff --git a/test/s3comms.c b/test/s3comms.c
index 6202af3..cec7a27 100644
--- a/test/s3comms.c
+++ b/test/s3comms.c
@@ -96,7 +96,7 @@
*/
#define JSFAILED_AT() \
{ \
- HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \
}
/*----------------------------------------------------------------------------
diff --git a/test/set_extent.c b/test/set_extent.c
index 31fc5d9..3078c2d 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -39,7 +39,7 @@ const char *FILENAME[] = {"set_extent1", "set_extent2", "set_extent3", "set_exte
#define CONFIG_EARLY_ALLOC 0x04u
#define CONFIG_UNFILT_EDGE 0x08u
#define CONFIG_ALL (CONFIG_COMPRESS + CONFIG_FILL + CONFIG_EARLY_ALLOC + CONFIG_UNFILT_EDGE)
-#define FILL_VALUE -1
+#define FILL_VALUE (-1)
#define DO_RANKS_PRINT_CONFIG(TEST) \
{ \
HDprintf(" Config:\n"); \
@@ -121,7 +121,7 @@ main(void)
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Initialize random number seed */
HDsrandom((unsigned)HDtime(NULL));
@@ -134,11 +134,11 @@ main(void)
TEST_ERROR
/* Set chunk cache so only part of the chunks can be cached on fapl */
- if (H5Pset_cache(fapl, 0, (size_t)8, 256 * sizeof(int), 0.75F) < 0)
+ if (H5Pset_cache(fapl, 0, (size_t)8, 256 * sizeof(int), 0.75) < 0)
TEST_ERROR
/* Disable chunk caching on fapl2 */
- if (H5Pset_cache(fapl2, 0, (size_t)0, (size_t)0, 0.0F) < 0)
+ if (H5Pset_cache(fapl2, 0, (size_t)0, (size_t)0, 0.0) < 0)
TEST_ERROR
/* Set the "use the latest version of the format" bounds for creating objects in the file */
@@ -388,7 +388,10 @@ do_ranks(hid_t fapl, hbool_t new_format)
return 0;
error:
- H5E_BEGIN_TRY { H5Pclose(dcpl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dcpl);
+ }
H5E_END_TRY
return -1;
@@ -414,7 +417,10 @@ do_layouts(hid_t fapl)
new_fapl = H5Pcopy(fapl);
/* Set version bounds */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
@@ -440,7 +446,10 @@ do_layouts(hid_t fapl)
return 0;
error:
- H5E_BEGIN_TRY { H5Pclose(new_fapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(new_fapl);
+ }
H5E_END_TRY;
return -1;
}
@@ -2075,7 +2084,10 @@ test_layouts(H5D_layout_t layout, hid_t fapl)
*-------------------------------------------------------------------------
*/
- H5E_BEGIN_TRY { ret = H5Dset_extent(did, dims_e); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dset_extent(did, dims_e);
+ }
H5E_END_TRY;
if (ret >= 0)
@@ -2121,7 +2133,10 @@ test_layouts(H5D_layout_t layout, hid_t fapl)
*-------------------------------------------------------------------------
*/
- H5E_BEGIN_TRY { ret = H5Dset_extent(did, dims_s); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dset_extent(did, dims_s);
+ }
H5E_END_TRY;
if (ret >= 0)
@@ -2677,6 +2692,4 @@ test_random_rank4_dump(unsigned ndim_sets, hsize_t dim_log[][4], hsize_t cdims[4
(unsigned)dim_log[i][1], (unsigned)dim_log[i][2], (unsigned)dim_log[i][3]);
if (j >= 0)
HDprintf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, m);
-
- return;
} /* end test_random_rank4_dump */
diff --git a/test/stab.c b/test/stab.c
index c40b518..798619d 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -134,7 +134,7 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
TEST_ERROR
if (H5Oget_comment_by_name(g3, "././.", comment, sizeof comment, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(comment, "hello world")) {
+ if (HDstrcmp(comment, "hello world") != 0) {
H5_FAILED();
HDputs(" Read the wrong comment string from the group.");
HDprintf(" got: \"%s\"\n ans: \"hello world\"\n", comment);
@@ -148,12 +148,18 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Check that creating groups with no-op names isn't allowed */
- H5E_BEGIN_TRY { g1 = H5Gcreate2(fid, "/", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ g1 = H5Gcreate2(fid, "/", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY
if (g1 >= 0)
TEST_ERROR
- H5E_BEGIN_TRY { g1 = H5Gcreate2(fid, "./././", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ g1 = H5Gcreate2(fid, "./././", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY
if (g1 >= 0)
TEST_ERROR
@@ -1358,7 +1364,10 @@ corrupt_stab_msg(void)
TEST_ERROR
/* Verify that an error is thrown when we try to access the dataset */
- H5E_BEGIN_TRY { did = H5Dopen2(fid, CORRUPT_STAB_DSET, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(fid, CORRUPT_STAB_DSET, H5P_DEFAULT);
+ }
H5E_END_TRY
if (did >= 0)
TEST_ERROR
@@ -1416,7 +1425,7 @@ main(void)
env_h5_drvr = "nomatch";
/* VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Reset library */
h5_reset();
diff --git a/test/swmr.c b/test/swmr.c
index fd78117..24a0b7c 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -163,7 +163,10 @@ test_metadata_read_attempts(hid_t in_fapl)
TEST_ERROR
/* Set the # of read attempts to 0--should fail */
- H5E_BEGIN_TRY { ret = H5Pset_metadata_read_attempts(fapl, 0); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_metadata_read_attempts(fapl, 0);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -844,14 +847,17 @@ error:
static int
test_metadata_read_retry_info(hid_t in_fapl)
{
- hid_t fapl, new_fapl; /* File access property list */
- hid_t fid, fid1; /* File IDs */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fid1 = H5I_INVALID_HID; /* File ID */
H5F_retry_info_t info, info1; /* The collection of metadata retries */
H5F_t * f = NULL, *f1 = NULL; /* Internal file object pointers */
unsigned i, j, n; /* Local index variables */
- hid_t did1, did2; /* Dataset IDs */
- hid_t sid; /* Dataspace ID */
- hid_t dcpl; /* Dataset creation property list */
+ hid_t did1 = H5I_INVALID_HID; /* Dataset ID */
+ hid_t did2 = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
hsize_t dims[2] = {6, 10}; /* Dataset dimensions */
char filename[NAME_BUF_SIZE]; /* File name */
int buf[6][10], chkbuf1[6][10], chkbuf2[6][10]; /* Buffers for data */
@@ -1620,7 +1626,7 @@ test_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Should be 100 */
- if (attempts != (new_format ? H5F_METADATA_READ_ATTEMPTS : H5F_SWMR_METADATA_READ_ATTEMPTS))
+ if (attempts != (unsigned int)(new_format ? H5F_METADATA_READ_ATTEMPTS : H5F_SWMR_METADATA_READ_ATTEMPTS))
TEST_ERROR;
/* Close the property list */
@@ -1649,7 +1655,10 @@ test_start_swmr_write(hid_t in_fapl, hbool_t new_format)
/* Should fail to enable SWMR for non-latest-format */
/* Should succeed in enabling SWMR for latest format */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (new_format) {
if (ret < 0)
@@ -1974,7 +1983,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
fid = H5Fcreate(filename, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl);
/* Should fail to enable SWMR writing when the file is already in SWMR writing mode */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -1997,7 +2009,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing when there is an opened named datatype */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2021,7 +2036,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
TEST_ERROR
/* Should fail to enable SWMR writing because the file's superblock version is not at least 3 */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2047,7 +2065,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing when the file is already in SWMR writing mode */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2063,7 +2084,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing when the file is opened with read only access */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2079,7 +2103,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing when the file is opened with SWMR read access only */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2109,7 +2136,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing when there are opened named datatype and attribute */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2119,7 +2149,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Still fail to enable SWMR writing when the attribute is still opened */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2164,7 +2197,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
TEST_ERROR
/* Should fail for a second call to enable SWMR writing mode */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2188,7 +2224,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing mode for fid2 */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid2);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2214,7 +2253,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
TEST_ERROR
/* Should fail to enable SWMR writing for fid2 */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid2);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2241,7 +2283,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
/* Should fail to open the file with SWMR write + latest format due to superblock version not at least
* 3 */
- H5E_BEGIN_TRY { bad_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, new_fapl); }
+ H5E_BEGIN_TRY
+ {
+ bad_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, new_fapl);
+ }
H5E_END_TRY;
if (bad_fid >= 0)
TEST_ERROR
@@ -2250,7 +2295,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
/* Should fail to open the file with SWMR write + non-latest-format due to superblock version not at
* least 3 */
- H5E_BEGIN_TRY { bad_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ bad_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
if (bad_fid >= 0)
TEST_ERROR
@@ -2262,7 +2310,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing due to superblock version not at least 3 */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2277,7 +2328,10 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Should fail to enable SWMR writing because the file's superblock version is not at least 3 */
- H5E_BEGIN_TRY { ret = H5Fstart_swmr_write(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fstart_swmr_write(fid);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -2341,17 +2395,24 @@ error:
* (5) Parent: open a file with write access; enable SWMR writing mode
* Child: concurrent open of the file with write and SWMR write access (fail)
*/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
static int
-test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSED new_format)
+test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
{
+ if (new_format) {
+ TESTING("H5Fstart_swmr_write()--concurrent access for latest format");
+ }
+ else {
+ TESTING("H5Fstart_swmr_write()--concurrent access for non-latest-format");
+ }
+
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* test_start_swmr_write_concur() */
-#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
+#else /* H5_HAVE_UNISTD_H */
static int
test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
@@ -2383,7 +2444,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
}
else {
TESTING("H5Fstart_swmr_write()--concurrent access for non-latest-format");
- } /* end if */
+ }
if ((fapl = H5Pcopy(in_fapl)) < 0)
FAIL_STACK_ERROR
@@ -2725,7 +2786,10 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
}
/* Should fail in opening the test file */
- H5E_BEGIN_TRY { fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
HDexit(EXIT_FAILURE);
@@ -2798,7 +2862,10 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
}
/* Should fail in opening the test file */
- H5E_BEGIN_TRY { fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
HDexit(EXIT_FAILURE);
@@ -2875,7 +2942,10 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format)
}
/* Should fail in opening the test file */
- H5E_BEGIN_TRY { fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
HDexit(EXIT_FAILURE);
@@ -2944,7 +3014,7 @@ error:
return -1;
} /* test_start_swmr_write_concur() */
-#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
/*
* test_start_swmr_write_stress_ohdr():
@@ -3163,7 +3233,10 @@ test_object_flush_cb(hid_t in_fapl)
* To verify the failure condition in setting object flush property
*/
/* Should fail if the callback function is not defined but user data is defined */
- H5E_BEGIN_TRY { ret = H5Pset_object_flush_cb(fapl, NULL, &flush_ct); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_object_flush_cb(fapl, NULL, &flush_ct);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -3464,19 +3537,28 @@ test_append_flush_generic(void)
FAIL_STACK_ERROR
/* Invalid dataset rank: zero value */
- H5E_BEGIN_TRY { ret = H5Pset_append_flush(dapl, 0, NULL, NULL, &count); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_append_flush(dapl, 0, NULL, NULL, &count);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
/* Invalid dataset rank: > H5S_MAX_RANK */
- H5E_BEGIN_TRY { ret = H5Pset_append_flush(dapl, H5S_MAX_RANK + 1, NULL, NULL, &count); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_append_flush(dapl, H5S_MAX_RANK + 1, NULL, NULL, &count);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
/* No boundary specified */
- H5E_BEGIN_TRY { ret = H5Pset_append_flush(dapl, 2, NULL, NULL, &count); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_append_flush(dapl, 2, NULL, NULL, &count);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -3486,7 +3568,10 @@ test_append_flush_generic(void)
boundary[1] = 1;
/* Undefined callback function but defined user data */
- H5E_BEGIN_TRY { ret = H5Pset_append_flush(dapl, 2, boundary, NULL, &count); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_append_flush(dapl, 2, boundary, NULL, &count);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -3494,7 +3579,10 @@ test_append_flush_generic(void)
/* Invalid boundary size: negative value */
boundary[0] = (hsize_t)-1;
boundary[1] = 1;
- H5E_BEGIN_TRY { ret = H5Pset_append_flush(dapl, 2, boundary, append_cb, &count); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_append_flush(dapl, 2, boundary, append_cb, &count);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -3502,7 +3590,10 @@ test_append_flush_generic(void)
/* Invalid boundary size: H5S_UNLIMITED */
boundary[0] = 1;
boundary[1] = H5S_UNLIMITED;
- H5E_BEGIN_TRY { ret = H5Pset_append_flush(dapl, 2, boundary, append_cb, &count); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_append_flush(dapl, 2, boundary, append_cb, &count);
+ }
H5E_END_TRY;
if (ret >= 0)
TEST_ERROR
@@ -3545,7 +3636,10 @@ test_append_flush_generic(void)
return 0;
error:
- H5E_BEGIN_TRY { H5Pclose(dapl); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dapl);
+ }
H5E_END_TRY;
return -1;
@@ -3663,7 +3757,10 @@ test_append_flush_dataset_chunked(hid_t in_fapl)
FAIL_STACK_ERROR
/* Should fail to Create the dataset */
- H5E_BEGIN_TRY { did2 = H5Dcreate2(fid, "dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl); }
+ H5E_BEGIN_TRY
+ {
+ did2 = H5Dcreate2(fid, "dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl);
+ }
H5E_END_TRY;
if (did2 >= 0)
TEST_ERROR
@@ -3674,7 +3771,10 @@ test_append_flush_dataset_chunked(hid_t in_fapl)
FAIL_STACK_ERROR
/* Should fail to create the dataset */
- H5E_BEGIN_TRY { did2 = H5Dcreate2(fid, "dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl); }
+ H5E_BEGIN_TRY
+ {
+ did2 = H5Dcreate2(fid, "dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, dapl);
+ }
H5E_END_TRY;
if (did2 >= 0)
TEST_ERROR
@@ -3686,7 +3786,10 @@ test_append_flush_dataset_chunked(hid_t in_fapl)
FAIL_STACK_ERROR;
/* Should fail to open the dataset */
- H5E_BEGIN_TRY { did2 = H5Dopen2(fid, "dataset2", dapl); }
+ H5E_BEGIN_TRY
+ {
+ did2 = H5Dopen2(fid, "dataset2", dapl);
+ }
H5E_END_TRY;
if (did2 >= 0)
TEST_ERROR
@@ -4325,7 +4428,10 @@ test_file_lock_same(hid_t in_fapl)
TEST_ERROR
/* Open file with RDWR should fail */
- H5E_BEGIN_TRY { fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ }
H5E_END_TRY;
if (fid2 >= 0)
TEST_ERROR
@@ -4396,8 +4502,9 @@ error:
static int
test_file_lock_swmr_same(hid_t in_fapl)
{
- hid_t fid, fid2; /* File IDs */
- hid_t fapl; /* File access property list */
+ hid_t fid = H5I_INVALID_HID; /* File IDs */
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
char filename[NAME_BUF_SIZE]; /* file name */
/* Output message about test being performed */
@@ -4429,7 +4536,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
/*
* Case a: RDWR|SWRM_READ : should fail
*/
- H5E_BEGIN_TRY { fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
TEST_ERROR
@@ -4437,7 +4547,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
/*
* Case b: RDWR|SWMM_WRTE|SWMR_READ : should fail
*/
- H5E_BEGIN_TRY { fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
TEST_ERROR
@@ -4445,7 +4558,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
/*
* Case c: RDONLY|SWMM_WRITE : should fail
*/
- H5E_BEGIN_TRY { fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
TEST_ERROR
@@ -4453,7 +4569,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
/*
* Case d: RDONLY|SWMM_WRITE|SWMR_READ : should fail
*/
- H5E_BEGIN_TRY { fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
TEST_ERROR
@@ -4468,7 +4587,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
if ((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
if (fid2 >= 0)
TEST_ERROR
@@ -4561,7 +4683,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
if ((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { fid2 = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (fid2 >= 0)
TEST_ERROR
@@ -4576,7 +4701,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
if ((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
if (fid2 >= 0)
TEST_ERROR
@@ -4623,7 +4751,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
if (fid2 >= 0)
TEST_ERROR
@@ -4638,7 +4769,10 @@ test_file_lock_swmr_same(hid_t in_fapl)
if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { fid2 = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid2 = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
if (fid2 >= 0)
TEST_ERROR
@@ -4675,7 +4809,7 @@ error:
** This is for concurrent access.
**
*****************************************************************/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK))
+#ifndef H5_HAVE_UNISTD_H
static int
test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl)
@@ -4683,12 +4817,12 @@ test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl)
/* Output message about test being performed */
TESTING("File open with different combinations of flags--concurrent access");
SKIPPED();
- HDputs(" Test skipped due to fork, waitpid, or flock not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* end test_file_lock_concur() */
-#else
+#else /* H5_HAVE_UNISTD_H */
static int
test_file_lock_concur(hid_t in_fapl)
@@ -4749,7 +4883,10 @@ test_file_lock_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -4823,7 +4960,10 @@ test_file_lock_concur(hid_t in_fapl)
}
/* Opens the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -4898,7 +5038,10 @@ test_file_lock_concur(hid_t in_fapl)
}
/* Opens the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -4973,7 +5116,10 @@ test_file_lock_concur(hid_t in_fapl)
}
/* Opens the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
+ }
H5E_END_TRY;
/* Should succeed */
@@ -5046,7 +5192,7 @@ error:
} /* end test_file_lock_concur() */
-#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK)) */
+#endif /* H5_HAVE_UNISTD_H */
/****************************************************************
**
@@ -5056,7 +5202,7 @@ error:
** This is for concurrent access.
**
*****************************************************************/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
static int
test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
@@ -5064,12 +5210,12 @@ test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl)
/* Output message about test being performed */
TESTING("File open with different combintations of flags + SWMR flags--concurrent access");
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* end test_file_lock_swmr_concur() */
-#else
+#else /* H5_HAVE_UNISTD_H */
static int
test_file_lock_swmr_concur(hid_t in_fapl)
@@ -5134,7 +5280,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5209,7 +5358,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5284,7 +5436,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5358,7 +5513,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5432,7 +5590,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
/* Should succeed */
@@ -5509,7 +5670,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5584,7 +5748,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5659,7 +5826,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5734,7 +5904,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
/* Should succeed */
@@ -5890,7 +6063,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl);
+ }
H5E_END_TRY;
/* Should fail */
@@ -5965,7 +6141,10 @@ test_file_lock_swmr_concur(hid_t in_fapl)
}
/* Open the test file */
- H5E_BEGIN_TRY { child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl); }
+ H5E_BEGIN_TRY
+ {
+ child_fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl);
+ }
H5E_END_TRY;
/* Should succeed */
@@ -6036,7 +6215,7 @@ error:
} /* end test_file_lock_swmr_concur() */
-#endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
/****************************************************************
**
@@ -6048,11 +6227,19 @@ error:
static int
test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override)
{
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
+ if (turn_locking_on && env_var_override)
+ TESTING("File locking: ON w/ env var override")
+ else if (turn_locking_on && !env_var_override)
+ TESTING("File locking: ON")
+ else if (!turn_locking_on && env_var_override)
+ TESTING("File locking: OFF w/ env var override")
+ else
+ TESTING("File locking: OFF")
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
-#else
+#else /* H5_HAVE_UNISTD_H */
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
char filename[NAME_BUF_SIZE]; /* file name */
@@ -6218,7 +6405,7 @@ error:
return -1;
-#endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
} /* end test_file_locking() */
@@ -6264,7 +6451,10 @@ test_different_lock_flags(hid_t in_fapl)
TEST_ERROR
/* Open the test file with different flags (should FAIL) */
- H5E_BEGIN_TRY { fid3 = H5Fopen(filename, H5F_ACC_RDWR, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ fid3 = H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
+ }
H5E_END_TRY;
if (H5I_INVALID_HID != fid3)
FAIL_PUTS_ERROR("Should not have been able to open a file with different locking flags")
@@ -6332,7 +6522,10 @@ test_swmr_vfd_flag(void)
fid = -1;
h5_fixname(FILENAME[0], bad_fapl, filename, sizeof(filename));
- H5E_BEGIN_TRY { fid = H5Fcreate(filename, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, H5P_DEFAULT, bad_fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE, H5P_DEFAULT, bad_fapl);
+ }
H5E_END_TRY;
if (fid >= 0)
TEST_ERROR;
@@ -6367,10 +6560,18 @@ error:
static int
test_bug_refresh(hid_t in_fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t fapl;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl = H5I_INVALID_HID;
H5F_t *f;
- hid_t gid1, gid2, gid3, gid4, gid5, gid6, gid7, gid8, gid9;
+ hid_t gid1 = H5I_INVALID_HID;
+ hid_t gid2 = H5I_INVALID_HID;
+ hid_t gid3 = H5I_INVALID_HID;
+ hid_t gid4 = H5I_INVALID_HID;
+ hid_t gid5 = H5I_INVALID_HID;
+ hid_t gid6 = H5I_INVALID_HID;
+ hid_t gid7 = H5I_INVALID_HID;
+ hid_t gid8 = H5I_INVALID_HID;
+ hid_t gid9 = H5I_INVALID_HID;
char filename[NAME_BUF_SIZE]; /* File name */
/* Create a copy of the input parameter in_fapl */
@@ -6498,17 +6699,24 @@ error:
* (7) Refresh the dataset
* (8) Verify the dataset's dimension and data are correct
*/
-#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
+#ifndef H5_HAVE_UNISTD_H
static int
-test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSED new_format)
+test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format)
{
+ if (new_format) {
+ TESTING("H5Drefresh()--concurrent access for latest format");
+ }
+ else {
+ TESTING("H5Drefresh()--concurrent access for non-latest-format");
+ }
+
SKIPPED();
- HDputs(" Test skipped due to fork or waitpid not defined.");
+ HDputs(" Test skipped due to a lack of unistd.h functionality.");
return 0;
} /* test_refresh_concur() */
-#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */
+#else /* H5_HAVE_UNISTD_H */
static int
test_refresh_concur(hid_t in_fapl, hbool_t new_format)
@@ -6808,7 +7016,7 @@ error:
return -1;
} /* test_refresh_concur() */
-#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */
+#endif /* H5_HAVE_UNISTD_H */
/*
* test_multiple_same():
diff --git a/test/swmr_common.h b/test/swmr_common.h
index e342580..d0d829d 100644
--- a/test/swmr_common.h
+++ b/test/swmr_common.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _SWMR_COMMON_H
-#define _SWMR_COMMON_H
+#ifndef SWMR_COMMON_H
+#define SWMR_COMMON_H
/***********/
/* Headers */
@@ -75,4 +75,4 @@ H5TEST_DLL int print_metadata_retries_info(hid_t fid);
}
#endif
-#endif /* _SWMR_COMMON_H */
+#endif /* SWMR_COMMON_H */
diff --git a/test/swmr_generator.c b/test/swmr_generator.c
index 64056a1..2bff12c 100644
--- a/test/swmr_generator.c
+++ b/test/swmr_generator.c
@@ -286,7 +286,7 @@ main(int argc, const char *argv[])
/* Chunk index type */
case 'i':
index_type = argv[u + 1];
- if (HDstrcmp(index_type, "ea") && HDstrcmp(index_type, "b2"))
+ if (HDstrcmp(index_type, "ea") != 0 && HDstrcmp(index_type, "b2") != 0)
usage();
u += 2;
break;
diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c
index 3514b28..2d25801 100644
--- a/test/swmr_start_write.c
+++ b/test/swmr_start_write.c
@@ -385,7 +385,7 @@ main(int argc, const char *argv[])
/* Chunk index type */
case 'i':
index_type = argv[u + 1];
- if (HDstrcmp(index_type, "ea") && HDstrcmp(index_type, "b2"))
+ if (HDstrcmp(index_type, "ea") != 0 && HDstrcmp(index_type, "b2") != 0)
usage();
u += 2;
break;
diff --git a/test/tarray.c b/test/tarray.c
index a63ebd7..af167a7 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -157,8 +157,9 @@ test_array_atomic_1d(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -235,11 +236,17 @@ test_array_funcs(void)
ret = H5Tset_offset(type, (size_t)16);
CHECK(ret, FAIL, "H5Tset_offset");
- H5E_BEGIN_TRY { cset = H5Tget_cset(type); }
+ H5E_BEGIN_TRY
+ {
+ cset = H5Tget_cset(type);
+ }
H5E_END_TRY;
VERIFY(cset, FAIL, "H5Tget_cset");
- H5E_BEGIN_TRY { strpad = H5Tget_strpad(type); }
+ H5E_BEGIN_TRY
+ {
+ strpad = H5Tget_strpad(type);
+ }
H5E_END_TRY;
VERIFY(strpad, FAIL, "H5Tget_strpad");
@@ -484,8 +491,9 @@ test_array_array_atomic(void)
/* Check the array dimensions */
for (i = 0; i < ndims1; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -662,8 +670,9 @@ test_array_compound_atomic(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -883,8 +892,9 @@ test_array_compound_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -945,8 +955,9 @@ test_array_compound_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Nested array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Nested array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -1086,7 +1097,6 @@ test_array_free_custom(void *_mem, void *info)
HDfree(mem);
} /* end if */
- return;
} /* end test_array_free_custom() */
/*-------------------------------------------------------------------------
@@ -1204,8 +1214,9 @@ test_array_vlen_atomic(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -1434,8 +1445,9 @@ test_array_vlen_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -1466,8 +1478,9 @@ test_array_vlen_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -2075,8 +2088,9 @@ test_compat(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -2122,8 +2136,9 @@ test_compat(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%" PRIuHSIZE
+ ", tdims1[%d]=%" PRIuHSIZE "\n",
+ i, rdims1[i], i, tdims1[i]);
continue;
} /* end if */
diff --git a/test/tattr.c b/test/tattr.c
index 2b7a03b..756e139 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -95,8 +95,7 @@ int attr_data2[ATTR2_DIM1][ATTR2_DIM2] = {{7614, -416}, {197814, -3}}; /* Test d
#define ATTR3_DIM2 2
#define ATTR3_DIM3 2
double attr_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3] = {
- {{2.3F, -26.1F}, {0.123F, -10.0F}},
- {{973.23F, -0.91827F}, {2.0F, 23.0F}}}; /* Test data for 3rd attribute */
+ {{2.3, -26.1}, {0.123, -10.0}}, {{973.23, -0.91827}, {2.0, 23.0}}}; /* Test data for 3rd attribute */
#define ATTR4_NAME "Attr4"
#define ATTR4_RANK 2
@@ -113,8 +112,8 @@ struct attr4_struct {
double d;
char c;
} attr_data4[ATTR4_DIM1][ATTR4_DIM2] = {
- {{3, -26.1F, 'd'}, {-100000, 0.123F, '3'}},
- {{-23, 981724.2F, 'Q'}, {0, 2.0F, '\n'}}}; /* Test data for 4th attribute */
+ {{3, -26.1, 'd'}, {-100000, 0.123, '3'}},
+ {{-23, 981724.2, 'Q'}, {0, 2.0, '\n'}}}; /* Test data for 4th attribute */
#define ATTR5_NAME "Attr5"
#define ATTR5_RANK 0
@@ -519,13 +518,13 @@ test_attr_basic_read(hid_t fapl)
static void
test_attr_flush(hid_t fapl)
{
- hid_t fil, /* File ID */
- att, /* Attribute ID */
- spc, /* Dataspace ID */
- set; /* Dataset ID */
- double wdata = 3.14159F; /* Data to write */
- double rdata; /* Data read in */
- herr_t ret; /* Generic return value */
+ hid_t fil, /* File ID */
+ att, /* Attribute ID */
+ spc, /* Dataspace ID */
+ set; /* Dataset ID */
+ double wdata = 3.14159; /* Data to write */
+ double rdata; /* Data read in */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attribute Flushing\n"));
@@ -545,8 +544,8 @@ test_attr_flush(hid_t fapl)
ret = H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if (!H5_DBL_ABS_EQUAL(rdata, (double)0.0f))
- TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, (double)0.0F);
+ if (!H5_DBL_ABS_EQUAL(rdata, 0.0))
+ TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, 0.0);
ret = H5Fflush(fil, H5F_SCOPE_GLOBAL);
CHECK(ret, FAIL, "H5Fflush");
@@ -554,8 +553,8 @@ test_attr_flush(hid_t fapl)
ret = H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if (!H5_DBL_ABS_EQUAL(rdata, (double)0.0f))
- TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, (double)0.0F);
+ if (!H5_DBL_ABS_EQUAL(rdata, 0.0))
+ TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, 0.0);
ret = H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata);
CHECK(ret, FAIL, "H5Awrite");
@@ -859,8 +858,8 @@ test_attr_compound_read(hid_t fapl)
VERIFY(fields, 3, "H5Tget_nmembers");
for (i = 0; i < fields; i++) {
fieldname = H5Tget_member_name(type, (unsigned)i);
- if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) || HDstrcmp(fieldname, ATTR4_FIELDNAME2) ||
- HDstrcmp(fieldname, ATTR4_FIELDNAME3)))
+ if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) != 0 || HDstrcmp(fieldname, ATTR4_FIELDNAME2) != 0 ||
+ HDstrcmp(fieldname, ATTR4_FIELDNAME3) != 0))
TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname);
H5free_memory(fieldname);
} /* end for */
@@ -907,7 +906,7 @@ test_attr_compound_read(hid_t fapl)
/* Verify values read in */
for (i = 0; i < ATTR4_DIM1; i++)
for (j = 0; j < ATTR4_DIM2; j++)
- if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct))) {
+ if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct)) != 0) {
HDprintf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",
__LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i);
HDprintf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",
@@ -920,7 +919,7 @@ test_attr_compound_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR4_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR4_NAME))
+ if (HDstrcmp(attr_name, ATTR4_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR4_NAME);
/* Close attribute datatype */
@@ -1279,7 +1278,7 @@ test_attr_mult_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR1_NAME))
+ if (HDstrcmp(attr_name, ATTR1_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME);
/* Verify Name with too small of a buffer */
@@ -1287,7 +1286,7 @@ test_attr_mult_read(hid_t fapl)
VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name");
HDstrcpy(temp_name, ATTR1_NAME); /* make a copy of the name */
temp_name[HDstrlen(ATTR1_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */
- if (HDstrcmp(attr_name, temp_name))
+ if (HDstrcmp(attr_name, temp_name) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name);
/* Close attribute */
@@ -1337,7 +1336,7 @@ test_attr_mult_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR2_NAME))
+ if (HDstrcmp(attr_name, ATTR2_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR2_NAME);
/* Verify Name with too small of a buffer */
@@ -1345,7 +1344,7 @@ test_attr_mult_read(hid_t fapl)
VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name");
HDstrcpy(temp_name, ATTR2_NAME); /* make a copy of the name */
temp_name[HDstrlen(ATTR2_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */
- if (HDstrcmp(attr_name, temp_name))
+ if (HDstrcmp(attr_name, temp_name) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name);
/* Close attribute */
@@ -1399,7 +1398,7 @@ test_attr_mult_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR3_NAME))
+ if (HDstrcmp(attr_name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME);
/* Verify Name with too small of a buffer */
@@ -1407,7 +1406,7 @@ test_attr_mult_read(hid_t fapl)
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
HDstrcpy(temp_name, ATTR3_NAME); /* make a copy of the name */
temp_name[HDstrlen(ATTR3_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */
- if (HDstrcmp(attr_name, temp_name))
+ if (HDstrcmp(attr_name, temp_name) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name);
/* Close attribute */
@@ -1436,19 +1435,19 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR
switch (*count) {
case 0:
- if (HDstrcmp(name, ATTR1_NAME))
+ if (HDstrcmp(name, ATTR1_NAME) != 0)
TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR1_NAME);
(*count)++;
break;
case 1:
- if (HDstrcmp(name, ATTR2_NAME))
+ if (HDstrcmp(name, ATTR2_NAME) != 0)
TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR2_NAME);
(*count)++;
break;
case 2:
- if (HDstrcmp(name, ATTR3_NAME))
+ if (HDstrcmp(name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR3_NAME);
(*count)++;
break;
@@ -1590,7 +1589,7 @@ test_attr_delete(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR1_NAME))
+ if (HDstrcmp(attr_name, ATTR1_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME);
/* Close attribute */
@@ -1605,7 +1604,7 @@ test_attr_delete(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR3_NAME))
+ if (HDstrcmp(attr_name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME);
/* Close attribute */
@@ -1629,7 +1628,7 @@ test_attr_delete(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR3_NAME))
+ if (HDstrcmp(attr_name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME);
/* Close attribute */
@@ -2123,7 +2122,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
HDsprintf(attrname, "attr %02u", u);
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, check_name);
VERIFY(name_len, HDstrlen(attrname), "H5Aget_name");
- if (HDstrcmp(check_name, attrname))
+ if (HDstrcmp(check_name, attrname) != 0)
TestErrPrintf("attribute name different: attrname = '%s', should be '%s'\n", check_name,
attrname);
@@ -5658,7 +5657,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Don't test "native" order if there is no creation order index, since
@@ -5684,7 +5683,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
} /* end if */
@@ -5705,7 +5704,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Verify the information for first attribute, in increasing name order */
@@ -5725,7 +5724,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Don't test "native" order queries on link name order, since there's not
@@ -5749,7 +5748,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Retrieve current # of errors */
@@ -6010,7 +6009,10 @@ test_attr_info_null_info_pointer(hid_t fcpl, hid_t fapl)
attr = H5Acreate2(fid, GET_INFO_NULL_POINTER_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
- H5E_BEGIN_TRY { err_ret = H5Aget_info(attr, NULL); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Aget_info(attr, NULL);
+ }
H5E_END_TRY;
CHECK(err_ret, SUCCEED, "H5Aget_info");
@@ -6071,22 +6073,34 @@ test_attr_rename_invalid_name(hid_t fcpl, hid_t fapl)
attr = H5Acreate2(fid, INVALID_RENAME_TEST_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
- H5E_BEGIN_TRY { err_ret = H5Arename(fid, NULL, INVALID_RENAME_TEST_NEW_ATTR_NAME); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Arename(fid, NULL, INVALID_RENAME_TEST_NEW_ATTR_NAME);
+ }
H5E_END_TRY;
CHECK(err_ret, SUCCEED, "H5Arename");
- H5E_BEGIN_TRY { err_ret = H5Arename(fid, "", INVALID_RENAME_TEST_NEW_ATTR_NAME); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Arename(fid, "", INVALID_RENAME_TEST_NEW_ATTR_NAME);
+ }
H5E_END_TRY;
CHECK(err_ret, SUCCEED, "H5Arename");
- H5E_BEGIN_TRY { err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, NULL); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, NULL);
+ }
H5E_END_TRY;
CHECK(err_ret, SUCCEED, "H5Arename");
- H5E_BEGIN_TRY { err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, ""); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, "");
+ }
H5E_END_TRY;
CHECK(err_ret, SUCCEED, "H5Arename");
@@ -6107,12 +6121,18 @@ test_attr_rename_invalid_name(hid_t fcpl, hid_t fapl)
CHECK(err_ret, SUCCEED, "H5Arename_by_name");
- H5E_BEGIN_TRY { err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, NULL, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, NULL, H5P_DEFAULT);
+ }
H5E_END_TRY;
CHECK(err_ret, SUCCEED, "H5Arename_by_name");
- H5E_BEGIN_TRY { err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, "", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, "", H5P_DEFAULT);
+ }
H5E_END_TRY;
CHECK(err_ret, SUCCEED, "H5Arename_by_name");
@@ -6159,7 +6179,10 @@ test_attr_get_name_invalid_buf(hid_t fcpl, hid_t fapl)
H5Acreate2(fid, GET_NAME_INVALID_BUF_TEST_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr, FAIL, "H5Acreate2");
- H5E_BEGIN_TRY { err_ret = H5Aget_name(attr, 1, NULL); }
+ H5E_BEGIN_TRY
+ {
+ err_ret = H5Aget_name(attr, 1, NULL);
+ }
H5E_END_TRY;
VERIFY(err_ret, FAIL, "H5Aget_name");
@@ -6782,7 +6805,7 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, vo
/* Verify name of link */
HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder);
- if (HDstrcmp(attr_name, attrname))
+ if (HDstrcmp(attr_name, attrname) != 0)
return (H5_ITER_ERROR);
/* Check if we've visited this link before */
diff --git a/test/tcheck_version.c b/test/tcheck_version.c
index 49c86c2..bfc8daf 100644
--- a/test/tcheck_version.c
+++ b/test/tcheck_version.c
@@ -29,6 +29,10 @@
#include "h5test.h"
+#ifdef H5_HAVE_WIN32_API
+#include <crtdbg.h>
+#endif
+
#define progname "tcheck_version"
/* prototypes */
@@ -108,12 +112,31 @@ abort_intercept(int H5_ATTR_UNUSED sig)
HDexit(6);
}
+#ifdef H5_HAVE_WIN32_API
+/* Turns off the modal dialog that is raised when the Windows CRT calls abort().
+ *
+ * Returning TRUE here lets Windows know that we've handled the abort() and that there
+ * is no need to alert the user with a modal dialog box.
+ */
+int
+handle_crt_abort(int reportType, char *message, int *returnValue)
+{
+ return TRUE;
+}
+#endif
+
int
main(int ac, char **av)
{
+#ifdef H5_HAVE_WIN32_API
+ (void)_CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, handle_crt_abort);
+#endif
parse(ac, av);
HDsignal(SIGABRT, &abort_intercept);
H5check_version(major, minor, release);
HDsignal(SIGABRT, SIG_DFL);
+#ifdef H5_HAVE_WIN32_API
+ (void)_CrtSetReportHook2(_CRT_RPTHOOK_REMOVE, handle_crt_abort);
+#endif
return 0;
}
diff --git a/test/tconfig.c b/test/tconfig.c
index e3c6a2c..101de9a 100644
--- a/test/tconfig.c
+++ b/test/tconfig.c
@@ -37,8 +37,9 @@
/* verify if the sizeof(type) matches size defined in macro. */
/* Needs this extra step so that we can print the macro name. */
#define vrfy_macrosize(type, macro, macroname) \
- if (sizeof(type) != macro) \
- TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", #type, sizeof(type), macroname, (int)macro);
+ if (sizeof(type) != (macro)) \
+ TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", #type, sizeof(type), macroname, \
+ (int)(macro));
/* local routine prototypes */
void test_config_ctypes(void);
diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in
index bb53697..eaa875e 100644
--- a/test/test_usecases.sh.in
+++ b/test/test_usecases.sh.in
@@ -22,10 +22,16 @@
# exit codes are okay (0).
srcdir=@srcdir@
+bindir=@bindir@
+
+# If the bindir directory is not set just use current (.).
+if test -z "$bindir"; then
+ bindir=.
+fi
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-./swmr_check_compat_vfd
+$bindir/swmr_check_compat_vfd
rc=$?
if [[ $rc != 0 ]] ; then
echo
@@ -85,7 +91,7 @@ TOOLTEST() {
# Run test.
TESTING $program $@
(
- $RUNSERIAL ./$program "$@"
+ $RUNSERIAL $bindir/$program "$@"
) >$actual 2>$actual_err
exit_code=$?
@@ -178,14 +184,14 @@ fi
# main body
for p in $USECASES_PROGRAMS; do
- TOOLTEST ./$p
- TOOLTEST ./$p -z 256
+ TOOLTEST $p
+ TOOLTEST $p -z 256
tmpfile=/tmp/datatfile.$$
- TOOLTEST ./$p -f $tmpfile; rm -f $tmpfile
- TOOLTEST ./$p -l w
- TOOLTEST ./$p -l r
+ TOOLTEST $p -f $tmpfile; rm -f $tmpfile
+ TOOLTEST $p -l w
+ TOOLTEST $p -l r
# use case 1.9, testing with multi-planes chunks
- TOOLTEST ./$p -z 256 -y 5 # 5 planes chunks
+ TOOLTEST $p -z 256 -y 5 # 5 planes chunks
# cleanup temp datafile
if test -z "$HDF5_NOCLEANUP"; then
rm -f $p.h5
diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in
index 43d1b46..6378ee5 100644
--- a/test/testcheck_version.sh.in
+++ b/test/testcheck_version.sh.in
@@ -15,7 +15,7 @@
# Tests for the H5check_version function.
#
# Programmer: Albert Cheng
-# Sep 28, 2009
+# Sep 28, 2009
srcdir=@srcdir@
@@ -24,7 +24,7 @@ srcdir=@srcdir@
Shared_Lib=@enable_shared@
Static_Lib=@enable_static@
Static_exec=@STATIC_EXEC@
-h5haveexitcode=yes # default is yes
+h5haveexitcode=yes # default is yes
CMP='cmp -s'
DIFF='diff -c'
@@ -103,10 +103,10 @@ WarnMesg2(){
# mismatch).
#
# Expected results:
-# Value of $HDF5_DISABLE_VERSION_CHECK
-# unset "" -1 0 1 2 3
-# Matched OK OK OK OK OK OK OK
-# Mismatched W/A W/A W/A W/A W2/OK OK W2/OK
+# Value of $HDF5_DISABLE_VERSION_CHECK
+# unset "" -1 0 1 2 3
+# Matched OK OK OK OK OK OK OK
+# Mismatched W/A W/A W/A W/A W2/OK OK W2/OK
# Result codes:
# OK: No warning, exit 0.
# W/A: Warning, abort and exit non-0.
@@ -130,42 +130,42 @@ TESTING() {
xxh5versrelease=$h5versrelease
if [ "$h5DisableVersion" = unset ]; then
- envcmd="" # noop
+ envcmd="" # noop
else
- envcmd="env HDF5_DISABLE_VERSION_CHECK=$h5DisableVersion"
+ envcmd="env HDF5_DISABLE_VERSION_CHECK=$h5DisableVersion"
fi
if [ "$wrongversionnumbers" = none ]; then
- # OK: No warning, exit 0
- cp /dev/null $expect
- expect_code=0
+ # OK: No warning, exit 0
+ cp /dev/null $expect
+ expect_code=0
else
- arguments=-t"$wrongversionnumbers"
- # calculate mismatched version numbers by listing.
- case $wrongversionnumbers in
- "M") xxh5versmajor=`expr $h5versmajor + 1`
- ;;
- "m") xxh5versminor=`expr $h5versminor + 1`
- ;;
- "r") xxh5versrelease=`expr $h5versrelease + 1`
- ;;
- esac
- case "$h5DisableVersion" in
- 1)
- # W2/OK: Different Warning, exit 0.
- WarnMesg2 > $expect
- expect_code=0
- ;;
- [2-9]|[1-9][0-9]*)
- # OK: No warning, exit 0
- cp /dev/null $expect
- expect_code=0
- ;;
- *) # W/A: Warning, abort and exit non-0.
- WarnMesg > $expect
- expect_code=6 # Signal Abort exit code (128+6)
- ;;
- esac
+ arguments=-t"$wrongversionnumbers"
+ # calculate mismatched version numbers by listing.
+ case $wrongversionnumbers in
+ "M") xxh5versmajor=`expr $h5versmajor + 1`
+ ;;
+ "m") xxh5versminor=`expr $h5versminor + 1`
+ ;;
+ "r") xxh5versrelease=`expr $h5versrelease + 1`
+ ;;
+ esac
+ case "$h5DisableVersion" in
+ 1)
+ # W2/OK: Different Warning, exit 0.
+ WarnMesg2 > $expect
+ expect_code=0
+ ;;
+ [2-9]|[1-9][0-9]*)
+ # OK: No warning, exit 0
+ cp /dev/null $expect
+ expect_code=0
+ ;;
+ *) # W/A: Warning, abort and exit non-0.
+ WarnMesg > $expect
+ expect_code=6 # Signal Abort exit code (128+6)
+ ;;
+ esac
fi
# Run test.
@@ -177,23 +177,23 @@ TESTING() {
cat $actual_err >> $actual
if [ $h5haveexitcode = 'yes' -a \( $expect_code -ne $ret_code \) ]; then
- echo "*FAILED*"
- echo " Expected exit code ($expect_code) differs from actual code ($ret_code)"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ echo " Expected exit code ($expect_code) differs from actual code ($ret_code)"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
- echo " PASSED"
+ echo " PASSED"
else
- echo "*FAILED*"
- echo " Expected result differs from actual result"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ echo "*FAILED*"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
# Clean up output file.
# Also clean the core file generated by H5check_version's abort.
if test -z "$HDF5_NOCLEANUP"; then
- $RM $expect $actual $actual_err
- $RM core
+ $RM $expect $actual $actual_err
+ $RM core
fi
}
@@ -201,15 +201,15 @@ TESTING() {
# Echo parameters for debugging if verbose mode is on.
DEBUGPRINT() {
if [ -n "$debugmode" ]; then
- echo $*
+ echo $*
fi
}
# MAIN Body
nerrors=0
-verbose=yes # default on
-debugmode= # default off
+verbose=yes # default on
+debugmode= # default off
H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h`
h5libsettings=../src/libhdf5.settings
@@ -240,13 +240,13 @@ fi
# Three Categories of tests:
# Normal: where the version numbers all matched (wrong_version == none).
# Mismatched version numbers (could be Major or minor version
-# or release numbers or a combination of all three.)
+# or release numbers or a combination of all three.)
# Test all the above with different values of the environment variable,
# HDF5_DISABLE_VERSION_CHECK, as unset, "", -1, 0, 1, 2, 3
for val_disable_version_check in unset "" -1 0 1 2 3; do
- for wrong_version in none M m r; do
- TESTING "$val_disable_version_check" "$wrong_version"
+ for wrong_version in none M m; do
+ TESTING "$val_disable_version_check" "$wrong_version"
done
done
diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1
index c797ebb..e0c4654 100644
--- a/test/testfiles/err_compat_1
+++ b/test/testfiles/err_compat_1
@@ -1,8 +1,10 @@
-Testing error API H5Eset/get_auto Testing error API based on data I/O All error API tests passed.
+Testing error API H5Eset/get_auto
+Testing error API based on data I/O
+All error API tests passed.
This program tests the Error API compatible with HDF5 version (number). There are supposed to be some error messages
********* Print error stack in HDF5 default way *********
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in main(): Error test failed
+ #000: (file name) line (number) in main(): fake error message 1
major: Error API
minor: Bad value
@@ -10,7 +12,6 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
error #000: (file name) in main(): line (number)
major: Error API
minor: Bad value
-
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dcreate2(): unable to synchronously create dataset
major: Dataset
@@ -40,7 +41,19 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Unable to create file
********* Print error stack in customized way *********
- error #000: (file name) in H5Eget_auto(1 or 2)(): line (number)
+ error #000: (file name) in H5VL_vol_object(): line (number)
+ major: Invalid arguments to routine
+ minor: Inappropriate type
+ error #001: (file name) in H5VL_setup_acc_args(): line (number)
+ major: Invalid arguments to routine
+ minor: Inappropriate type
+ error #002: (file name) in H5D__create_api_common(): line (number)
+ major: Dataset
+ minor: Can't set value
+ error #003: (file name) in H5Dcreate2(): line (number)
+ major: Dataset
+ minor: Unable to create file
+ error #004: (file name) in H5Eget_auto(1 or 2)(): line (number)
major: Error API
minor: Can't get value
@@ -70,12 +83,11 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#003: (file name) line (number) in H5VL_vol_object(): invalid identifier type to function
major: Invalid arguments to routine
minor: Inappropriate type
-
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in main(): Error test failed
+ #000: (file name) line (number) in main(): fake error message 2
major: Error API
minor: Unrecognized message
- #001: (file name) line (number) in test_error2(): H5Dwrite shouldn't succeed
+ #001: (file name) line (number) in test_h5epush1(): expected H5Dwrite error
major: Error API
minor: Write failed
#002: (file name) line (number) in H5Dwrite(): can't synchronously write data
diff --git a/test/testframe.c b/test/testframe.c
index f805997..d3f0211 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -320,9 +320,9 @@ PerformTests(void)
MESSAGE(5, ("===============================================\n"));
Test[Loop].NumErrors = num_errs;
Test_parameters = Test[Loop].Parameters;
- ALARM_ON;
+ TestAlarmOn();
Test[Loop].Call();
- ALARM_OFF;
+ TestAlarmOff();
Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors;
MESSAGE(5, ("===============================================\n"));
MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors));
@@ -620,12 +620,15 @@ SetTest(const char *testname, int action)
}
}
-/*
- * Enable alarm on test execution, configurable by environment variable
+/* Enable a test timer that will kill long-running tests, the time is configurable
+ * via an environment variable.
+ *
+ * Only useful on POSIX systems where alarm(2) is present.
*/
void
TestAlarmOn(void)
{
+#ifdef H5_HAVE_ALARM
char * env_val = HDgetenv("HDF5_ALARM_SECONDS"); /* Alarm environment */
unsigned long alarm_sec = H5_ALARM_SEC; /* Number of seconds before alarm goes off */
@@ -635,4 +638,15 @@ TestAlarmOn(void)
/* Set the number of seconds before alarm goes off */
HDalarm((unsigned)alarm_sec);
+#endif
+}
+
+/* Disable the test timer */
+void
+TestAlarmOff(void)
+{
+#ifdef H5_HAVE_ALARM
+ /* Set the number of seconds to zero */
+ HDalarm(0);
+#endif
}
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 5e413f3..45c0f9f 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -45,7 +45,6 @@ main(int argc, char *argv[])
AddTest("config", test_configure, cleanup_configure, "Configure definitions", NULL);
AddTest("metadata", test_metadata, cleanup_metadata, "Encoding/decoding metadata", NULL);
AddTest("checksum", test_checksum, cleanup_checksum, "Checksum algorithm", NULL);
- AddTest("tst", test_tst, NULL, "Ternary Search Trees", NULL);
AddTest("heap", test_heap, NULL, "Memory Heaps", NULL);
AddTest("skiplist", test_skiplist, NULL, "Skip Lists", NULL);
AddTest("refstr", test_refstr, NULL, "Reference Counted Strings", NULL);
diff --git a/test/testhdf5.h b/test/testhdf5.h
index f3cb995..ba5fa71 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -136,7 +136,7 @@
"%s \n", \
(where), (int)__LINE__, __FILE__, x); \
} \
- if (HDstrcmp(x, val)) { \
+ if (HDstrcmp(x, val) != 0) { \
TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \
"in %s\n", \
where, val, x, (int)__LINE__, __FILE__); \
@@ -203,7 +203,6 @@ extern "C" {
/* Prototypes for the test routines */
void test_metadata(void);
void test_checksum(void);
-void test_tst(void);
void test_heap(void);
void test_refstr(void);
void test_file(void);
diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in
index 2df23c6..37e8f9c 100644
--- a/test/testswmr.sh.in
+++ b/test/testswmr.sh.in
@@ -17,6 +17,7 @@
# Albert Cheng, 2009/07/22
srcdir=@srcdir@
+bindir=@bindir@
###############################################################################
## test parameters
@@ -97,9 +98,14 @@ if test -z "$srcdir"; then
srcdir=.
fi
+# If the bindir directory is not set just use current (.).
+if test -z "$bindir"; then
+ bindir=.
+fi
+
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-./swmr_check_compat_vfd
+$bindir/swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo
@@ -172,7 +178,7 @@ do
echo "###############################################################################"
# Launch the Generator without SWMR_WRITE
echo launch the swmr_generator
- ./swmr_generator $compress $index_type
+ $bindir/swmr_generator $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -180,7 +186,7 @@ do
# Launch the Generator with SWMR_WRITE
echo launch the swmr_generator with SWMR_WRITE
- ./swmr_generator -s $compress $index_type
+ $bindir/swmr_generator -s $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -204,7 +210,7 @@ do
# Launch the Writer
echo launch the swmr_start_writer
seed="" # Put -r <random seed> command here
- ./swmr_start_write $compress $index_type $Nrecords $seed 2>&1 |tee swmr_writer.out &
+ $bindir/swmr_start_write $compress $index_type $Nrecords $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -220,7 +226,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- ./swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
+ $bindir/swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -265,7 +271,7 @@ do
# Launch the Generator
echo launch the swmr_generator
- ./swmr_generator -s $compress $index_type
+ $bindir/swmr_generator -s $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -277,7 +283,7 @@ do
# Launch the Writer
echo launch the swmr_writer
seed="" # Put -r <random seed> command here
- ./swmr_writer -o $Nrecords $seed 2>&1 |tee swmr_writer.out &
+ $bindir/swmr_writer -o $Nrecords $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -292,7 +298,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- ./swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
+ $bindir/swmr_reader $Nsecs_add $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -340,7 +346,7 @@ do
# Launch the Remove Writer
echo launch the swmr_remove_writer
seed="" # Put -r <random seed> command here
- ./swmr_remove_writer -o $Nrecs_rem $seed 2>&1 |tee swmr_writer.out &
+ $bindir/swmr_remove_writer -o $Nrecs_rem $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -355,7 +361,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- ./swmr_remove_reader $Nsecs_rem $seed 2>&1 |tee swmr_reader.out.$n &
+ $bindir/swmr_remove_reader $Nsecs_rem $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -400,7 +406,7 @@ do
# Launch the Generator
echo launch the swmr_generator
- ./swmr_generator $compress $index_type
+ $bindir/swmr_generator $compress $index_type
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -409,7 +415,7 @@ do
# Launch the Writer (not in parallel - just to rebuild the datasets)
echo launch the swmr_writer
seed="" # Put -r <random seed> command here
- ./swmr_writer $Nrecords $seed
+ $bindir/swmr_writer $Nrecords $seed
if test $? -ne 0; then
echo writer had error
nerrors=`expr $nerrors + 1`
@@ -421,7 +427,7 @@ do
# Launch the Add/Remove Writer
echo launch the swmr_addrem_writer
seed="" # Put -r <random seed> command here
- ./swmr_addrem_writer $Nrecords $seed 2>&1 |tee swmr_writer.out &
+ $bindir/swmr_addrem_writer $Nrecords $seed 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -436,7 +442,7 @@ do
while [ $n -lt $Nreaders ]; do
#seed="-r ${seeds[$n]}"
seed=""
- ./swmr_remove_reader $Nsecs_addrem $seed 2>&1 |tee swmr_reader.out.$n &
+ $bindir/swmr_remove_reader $Nsecs_addrem $seed 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
@@ -484,7 +490,7 @@ do
# created by the generator.
echo launch the swmr_generator
seed="" # Put -r <random seed> command here
- ./swmr_generator $compress $index_type $seed
+ $bindir/swmr_generator $compress $index_type $seed
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -494,7 +500,7 @@ do
rm -f $WRITER_MESSAGE
# Launch the Sparse writer
echo launch the swmr_sparse_writer
- nice -n 20 ./swmr_sparse_writer $Nrecs_spa 2>&1 |tee swmr_writer.out &
+ nice -n 20 $bindir/swmr_sparse_writer $Nrecs_spa 2>&1 |tee swmr_writer.out &
pid_writer=$!
$DPRINT pid_writer=$pid_writer
@@ -507,7 +513,7 @@ do
echo launch $Nrdrs_spa swmr_sparse_readers
while [ $n -lt $Nrdrs_spa ]; do
# The sparse reader spits out a LOT of data so it's set to 'quiet'
- ./swmr_sparse_reader -q $Nrecs_spa 2>&1 |tee swmr_reader.out.$n &
+ $bindir/swmr_sparse_reader -q $Nrecs_spa 2>&1 |tee swmr_reader.out.$n &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in
index 9673aa3..5399903 100644
--- a/test/testvdsswmr.sh.in
+++ b/test/testvdsswmr.sh.in
@@ -17,6 +17,7 @@
# Dana Robinson, November 2015
srcdir=@srcdir@
+bindir=@bindir@
###############################################################################
## test parameters
@@ -30,7 +31,7 @@ nerrors=0
## definitions for message file to coordinate test runs
###############################################################################
WRITER_MESSAGE=SWMR_WRITER_MESSAGE # The message file created by writer that the open is complete
- # This should be the same as the define in "./swmr_common.h"
+ # This should be the same as the define in "$bindir/swmr_common.h"
MESSAGE_TIMEOUT=300 # Message timeout length in secs
# This should be the same as the define in "./h5test.h"
@@ -83,9 +84,14 @@ if test -z "$srcdir"; then
srcdir=.
fi
+# If the bindir directory is not set just use current (.).
+if test -z "$bindir"; then
+ bindir=.
+fi
+
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
-./swmr_check_compat_vfd
+$bindir/swmr_check_compat_vfd
rc=$?
if [ $rc -ne 0 ] ; then
echo
@@ -148,7 +154,7 @@ echo "##########################################################################
# Launch the file generator
echo launch the generator
-./vds_swmr_gen
+$bindir/vds_swmr_gen
if test $? -ne 0; then
echo generator had error
nerrors=`expr $nerrors + 1`
@@ -166,7 +172,7 @@ echo "launch the $Nwriters SWMR VDS writers (1 per source)"
pid_writers=""
n=0
while [ $n -lt $Nwriters ]; do
- ./vds_swmr_writer $n &
+ $bindir/vds_swmr_writer $n &
pid_writers="$pid_writers $!"
n=`expr $n + 1`
done
@@ -181,7 +187,7 @@ echo launch $Nreaders SWMR readers
pid_readers=""
n=0
while [ $n -lt $Nreaders ]; do
- ./vds_swmr_reader &
+ $bindir/vds_swmr_reader &
pid_readers="$pid_readers $!"
n=`expr $n + 1`
done
diff --git a/test/tfile.c b/test/tfile.c
index ae171d8..0014d08 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -125,7 +125,7 @@
#define TEST_THRESHOLD10 10 /* Free space section threshold */
#define FSP_SIZE_DEF 4096 /* File space page size default */
#define FSP_SIZE512 512 /* File space page size */
-#define FSP_SIZE1G 1024 * 1024 * 1024 /* File space page size */
+#define FSP_SIZE1G (1024 * 1024 * 1024) /* File space page size */
/* Declaration for test_libver_macros2() */
#define FILE6 "tfile6.h5" /* Test file */
@@ -309,25 +309,46 @@ test_file_create(void)
CHECK(tmpl1, FAIL, "H5Pcreate");
/* Try setting some bad userblock sizes */
- H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE1); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE1);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE2);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE3); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE3);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE4); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE4);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE5); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE5);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE6); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE6);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE7); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE7);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
@@ -1282,7 +1303,10 @@ test_get_file_id(void)
plist = H5Pcreate(H5P_FILE_ACCESS);
CHECK(plist, FAIL, "H5Pcreate");
- H5E_BEGIN_TRY { fid2 = H5Iget_file_id(plist); }
+ H5E_BEGIN_TRY
+ {
+ fid2 = H5Iget_file_id(plist);
+ }
H5E_END_TRY;
VERIFY(fid2, FAIL, "H5Iget_file_id");
@@ -1428,6 +1452,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, hid_t gid2,
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
ERROR("H5Fget_obj_ids");
@@ -1543,7 +1568,10 @@ test_file_perm2(void)
CHECK(filero, FAIL, "H5Fopen");
/* Create a group with the read-only file handle (should fail) */
- H5E_BEGIN_TRY { group = H5Gcreate2(filero, "MY_GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ group = H5Gcreate2(filero, "MY_GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(group, FAIL, "H5Gcreate2");
@@ -1556,7 +1584,10 @@ test_file_perm2(void)
VERIFY(dset, FAIL, "H5Dcreate2");
/* Create an attribute with the read-only file handle (should fail) */
- H5E_BEGIN_TRY { attr = H5Acreate2(filero, "MY_ATTR", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ attr = H5Acreate2(filero, "MY_ATTR", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(attr, FAIL, "H5Acreate2");
@@ -1564,7 +1595,10 @@ test_file_perm2(void)
CHECK(type, FAIL, "H5Tcopy");
/* Commit a datatype with the read-only file handle (should fail) */
- H5E_BEGIN_TRY { ret = H5Tcommit2(filero, "MY_DTYPE", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tcommit2(filero, "MY_DTYPE", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit2");
@@ -1633,6 +1667,29 @@ test_file_is_accessible(const char *env_h5_drvr)
is_hdf5 = H5Fis_accessible(filename, fapl_id);
VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+ /*****************************************/
+ /* Newly created file that is still open */
+ /*****************************************/
+
+ /* On Windows, file locking is mandatory so this check ensures that
+ * H5Fis_accessible() works on files that have an exclusive lock.
+ * Previous versions of this API call created an additional file handle
+ * and attempted to read through it, which will not work when locks
+ * are enforced by the OS.
+ */
+
+ /* Create a file and hold it open */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Verify that the file is an HDF5 file */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
/*******************************/
/* Non-default user block size */
/*******************************/
@@ -1862,10 +1919,6 @@ test_file_delete(hid_t fapl_id)
/* HDF5 FILE */
/*************/
- /* This is just a placeholder until the native VOL connector supports
- * H5Fdelete().
- */
-
/* Get fapl-dependent filename */
h5_fixname(FILE_DELETE, fapl_id, filename, sizeof(filename));
@@ -1881,16 +1934,20 @@ test_file_delete(hid_t fapl_id)
is_hdf5 = H5Fis_accessible(filename, fapl_id);
VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
- /* Attempt to delete the file - should fail */
- H5E_BEGIN_TRY { ret = H5Fdelete(filename, fapl_id); }
- H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Fdelete");
+ /* Delete the file */
+ ret = H5Fdelete(filename, fapl_id);
+ VERIFY(ret, SUCCEED, "H5Fdelete");
- /* Verify that the file still exists */
- is_hdf5 = H5Fis_accessible(filename, fapl_id);
- VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+ /* Verify that the file is NO LONGER an HDF5 file */
+ /* This should fail since there is no file */
+ H5E_BEGIN_TRY
+ {
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ }
+ H5E_END_TRY;
+ VERIFY(is_hdf5, FAIL, "H5Fis_accessible");
- /* Actually delete the test file */
+ /* Just in case deletion fails - silent on errors */
h5_delete_test_file(FILE_DELETE, fapl_id);
/*****************/
@@ -1914,12 +1971,18 @@ test_file_delete(hid_t fapl_id)
* may not have been created since we created it with
* open(2) and not the library.
*/
- H5E_BEGIN_TRY { is_hdf5 = H5Fis_accessible(filename, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ }
H5E_END_TRY;
CHECK(is_hdf5, TRUE, "H5Fis_accessible");
/* Try to delete it (should fail) */
- H5E_BEGIN_TRY { ret = H5Fdelete(filename, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fdelete(filename, fapl_id);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Fdelete");
@@ -1962,22 +2025,34 @@ test_file_open_dot(void)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset with no name using the file ID */
- H5E_BEGIN_TRY { did = H5Dcreate2(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dcreate2(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(did, FAIL, "H5Dcreate2");
/* Create a dataset with no name using the group ID */
- H5E_BEGIN_TRY { did = H5Dcreate2(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dcreate2(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(did, FAIL, "H5Dcreate2");
/* Open a dataset with no name using the file ID */
- H5E_BEGIN_TRY { did = H5Dopen2(fid, ".", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(fid, ".", H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(did, FAIL, "H5Dopen2");
/* Open a dataset with no name using the group ID */
- H5E_BEGIN_TRY { did = H5Dopen2(gid, ".", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dopen2(gid, ".", H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(did, FAIL, "H5Dopen2");
@@ -1986,32 +2061,50 @@ test_file_open_dot(void)
CHECK(tid, FAIL, "H5Tcopy");
/* Create a named datatype with no name using the file ID */
- H5E_BEGIN_TRY { ret = H5Tcommit2(fid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tcommit2(fid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit2");
/* Create a named datatype with no name using the group ID */
- H5E_BEGIN_TRY { ret = H5Tcommit2(gid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tcommit2(gid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit2");
/* Open a named datatype with no name using the file ID */
- H5E_BEGIN_TRY { tid2 = H5Topen2(fid, ".", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tid2 = H5Topen2(fid, ".", H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tid2, FAIL, "H5Topen2");
/* Open a named datatype with no name using the group ID */
- H5E_BEGIN_TRY { tid2 = H5Topen2(gid, ".", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tid2 = H5Topen2(gid, ".", H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tid2, FAIL, "H5Topen2");
/* Create a group with no name using the file ID */
- H5E_BEGIN_TRY { gid2 = H5Gcreate2(fid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid2 = H5Gcreate2(fid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(gid2, FAIL, "H5Gcreate2");
/* Create a group with no name using the group ID */
- H5E_BEGIN_TRY { gid2 = H5Gcreate2(gid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid2 = H5Gcreate2(gid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(gid2, FAIL, "H5Gcreate2");
@@ -2191,7 +2284,10 @@ test_file_getname(void)
/* Try get file name from data space. Supposed to fail because
* it's illegal operation. */
- H5E_BEGIN_TRY { name_len = H5Fget_name(space_id, name, (size_t)TESTA_NAME_BUF_SIZE); }
+ H5E_BEGIN_TRY
+ {
+ name_len = H5Fget_name(space_id, name, (size_t)TESTA_NAME_BUF_SIZE);
+ }
H5E_END_TRY;
VERIFY(name_len, FAIL, "H5Fget_name");
@@ -3312,7 +3408,10 @@ test_userblock_alignment(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
@@ -3342,7 +3441,10 @@ test_userblock_alignment(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
@@ -3515,7 +3617,10 @@ test_userblock_alignment_paged(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
@@ -3590,7 +3695,10 @@ test_userblock_alignment_paged(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
@@ -3627,7 +3735,10 @@ test_userblock_alignment_paged(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
@@ -3702,7 +3813,10 @@ test_userblock_alignment_paged(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
@@ -3834,7 +3948,7 @@ test_filespace_info(const char *env_h5_drvr)
MESSAGE(5, ("Testing file creation public routines: H5Pget/set_file_space_strategy & "
"H5Pget/set_file_space_page_size\n"));
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
fapl = h5_fileaccess();
h5_fixname(FILESPACE_NAME[0], fapl, filename, sizeof filename);
@@ -3892,17 +4006,26 @@ test_filespace_info(const char *env_h5_drvr)
CHECK(fcpl, FAIL, "H5Pcreate");
/* Setting to 0: should fail */
- H5E_BEGIN_TRY { ret = H5Pset_file_space_page_size(fcpl, 0); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_file_space_page_size(fcpl, 0);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_file_space_page_size");
/* Setting to 511: should fail */
- H5E_BEGIN_TRY { ret = H5Pset_file_space_page_size(fcpl, 511); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_file_space_page_size(fcpl, 511);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_file_space_page_size");
/* Setting to 1GB+1: should fail */
- H5E_BEGIN_TRY { ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE1G + 1); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE1G + 1);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_file_space_page_size");
@@ -5302,13 +5425,19 @@ test_libver_bounds_open(void)
/* Attempt to open latest file with (earliest, v18), should fail */
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18);
- H5E_BEGIN_TRY { file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ }
H5E_END_TRY;
VERIFY(file, FAIL, "Attempted to open latest file with earliest version");
/* Attempt to open latest file with (v18, v18), should fail */
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18);
- H5E_BEGIN_TRY { file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ }
H5E_END_TRY;
VERIFY(file, FAIL, "Attempted to open latest file with v18 bounds");
@@ -5689,13 +5818,16 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t n
herr_t ret; /* The return value */
/* Try to create the file */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl);
+ }
H5E_END_TRY;
/* Get the internal file pointer if the create succeeds */
if (fid >= 0) {
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
}
/* Retrieve the low/high bounds */
@@ -5853,7 +5985,10 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non
herr_t ret; /* Return value */
/* Create the file with the input fcpl and fapl */
- H5E_BEGIN_TRY { fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
/* Retrieve the low/high bounds */
@@ -5868,7 +6003,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non
/* Get the internal file pointer */
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
/* The file's superblock version */
super_vers = f->shared->sblock->super_vers;
@@ -5884,7 +6019,10 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non
/* Loop through all the combinations of low/high bounds in new_fapl */
for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
/* Invalid combinations */
@@ -5906,7 +6044,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non
/* Get the internal file pointer if the open succeeds */
if (fid >= 0) {
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
}
/* Verify the file open succeeds or fails */
@@ -6064,21 +6202,27 @@ test_libver_bounds_obj(hid_t fapl)
object header version, then delete the group and close the file.*/
for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid combinations */
continue;
/* Open the file */
- H5E_BEGIN_TRY { fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ }
H5E_END_TRY;
if (fid >= 0) { /* The file open succeeds */
/* Get the internal file pointer */
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
/* Create a group in the file */
gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -6186,7 +6330,7 @@ test_libver_bounds_dataset(hid_t fapl)
/* Get the internal dataset pointer */
dset = (H5D_t *)H5VL_object(did);
- CHECK(dset, NULL, "H5VL_object");
+ CHECK_PTR(dset, "H5VL_object");
/* Verify version for layout and fill value messages */
if (low == H5F_LIBVER_EARLIEST) {
@@ -6224,14 +6368,17 @@ test_libver_bounds_dataset(hid_t fapl)
CHECK(ret, FAIL, "H5Pset_chunk_opts");
/* Create the chunked dataset */
- H5E_BEGIN_TRY { did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (did >= 0) {
/* Get the internal dataset pointer */
dset = (H5D_t *)H5VL_object(did);
- CHECK(dset, NULL, "H5VL_object");
+ CHECK_PTR(dset, "H5VL_object");
/* Verify layout message version and chunk indexing type */
VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_4, "H5O_layout_ver_bounds");
@@ -6273,21 +6420,27 @@ test_libver_bounds_dataset(hid_t fapl)
/* Verify the dataset's layout, fill value and filter pipleline message versions */
for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
continue;
/* Open the file */
- H5E_BEGIN_TRY { fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ }
H5E_END_TRY;
if (fid >= 0) { /* The file open succeeds */
/* Get the internal file pointer */
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
/* Create the chunked dataset */
did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -6295,7 +6448,7 @@ test_libver_bounds_dataset(hid_t fapl)
/* Get the internal file pointer */
dset = (H5D_t *)H5VL_object(did);
- CHECK(dset, NULL, "H5VL_object");
+ CHECK_PTR(dset, "H5VL_object");
/* Verify the dataset's layout, fill value and filter pipeline message versions */
/* Also verify the chunk indexing type */
@@ -6416,7 +6569,7 @@ test_libver_bounds_dataspace(hid_t fapl)
sid = H5Dget_space(did);
CHECK(sid, H5I_INVALID_HID, "H5Dget_space");
space = (H5S_t *)H5I_object(sid);
- CHECK(space, NULL, "H5I_object");
+ CHECK_PTR(space, "H5I_object");
/* Verify the dataspace version */
VERIFY(space->extent.version, H5O_sdspace_ver_bounds[low], "H5O_sdspace_ver_bounds");
@@ -6433,7 +6586,7 @@ test_libver_bounds_dataspace(hid_t fapl)
sid_null = H5Dget_space(did_null);
CHECK(sid_null, H5I_INVALID_HID, "H5Dget_space");
space_null = (H5S_t *)H5I_object(sid_null);
- CHECK(space_null, NULL, "H5I_object");
+ CHECK_PTR(space_null, "H5I_object");
/* Verify the dataspace version */
VERIFY(space_null->extent.version, H5O_SDSPACE_VERSION_2, "H5O_sdspace_ver_bounds");
@@ -6491,21 +6644,27 @@ test_libver_bounds_dataspace(hid_t fapl)
hid_t tmp_sid, tmp_sid_compact, tmp_sid_contig; /* Dataspace IDs */
H5S_t *tmp_space, *tmp_space_compact, *tmp_space_contig; /* Internal dataspace pointers */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
continue;
/* Open the file */
- H5E_BEGIN_TRY { fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ }
H5E_END_TRY;
if (fid >= 0) { /* The file open succeeds */
/* Get the internal file pointer */
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
/* Create the chunked dataset */
did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -6515,7 +6674,7 @@ test_libver_bounds_dataspace(hid_t fapl)
tmp_sid = H5Dget_space(did);
CHECK(tmp_sid, H5I_INVALID_HID, "H5Dget_space");
tmp_space = (H5S_t *)H5I_object(tmp_sid);
- CHECK(tmp_space, NULL, "H5I_object");
+ CHECK_PTR(tmp_space, "H5I_object");
/* Create the compact dataset */
did_compact = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid_compact, H5P_DEFAULT, dcpl_compact,
@@ -6526,7 +6685,7 @@ test_libver_bounds_dataspace(hid_t fapl)
tmp_sid_compact = H5Dget_space(did_compact);
CHECK(tmp_sid_compact, H5I_INVALID_HID, "H5Dget_space");
tmp_space_compact = (H5S_t *)H5I_object(tmp_sid_compact);
- CHECK(tmp_space_compact, NULL, "H5I_object");
+ CHECK_PTR(tmp_space_compact, "H5I_object");
/* Create the contiguous dataset */
did_contig =
@@ -6537,7 +6696,7 @@ test_libver_bounds_dataspace(hid_t fapl)
tmp_sid_contig = H5Dget_space(did_contig);
CHECK(tmp_sid_contig, H5I_INVALID_HID, "H5Dget_space");
tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig);
- CHECK(tmp_space_contig, NULL, "H5I_object");
+ CHECK_PTR(tmp_space_contig, "H5I_object");
/* Verify versions for the three dataspaces */
VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound],
@@ -6761,7 +6920,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Get the internal datatype pointer */
dtype = (H5T_t *)H5I_object(dtid);
- CHECK(dtype, NULL, "H5I_object");
+ CHECK_PTR(dtype, "H5I_object");
/* Verify the datatype message version */
/* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
@@ -6815,27 +6974,33 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Also verify the committed atatype message version */
for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
continue;
/* Open the file */
- H5E_BEGIN_TRY { fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ }
H5E_END_TRY;
if (fid >= 0) { /* The file open succeeds */
/* Get the internal file pointer */
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
/* Open the committed datatype */
str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT);
CHECK(str_tid, FAIL, "H5Topen2");
str_dtype = (H5T_t *)H5VL_object(str_tid);
- CHECK(str_dtype, NULL, "H5VL_object");
+ CHECK_PTR(str_dtype, "H5VL_object");
/* Verify the committed datatype message version */
VERIFY(str_dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST],
@@ -6855,7 +7020,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
/* Get the internal datatype pointer */
dtype = (H5T_t *)H5I_object(dtid);
- CHECK(dtype, NULL, "H5I_object");
+ CHECK_PTR(dtype, "H5I_object");
/* Verify the dataset's datatype message version */
/* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
@@ -6988,7 +7153,7 @@ test_libver_bounds_attributes(hid_t fapl)
/* Get the internal attribute pointer */
attr = (H5A_t *)H5VL_object(aid);
- CHECK(attr, NULL, "H5VL_object");
+ CHECK_PTR(attr, "H5VL_object");
/* Verify the attribute version */
if (low == H5F_LIBVER_EARLIEST)
@@ -7007,7 +7172,7 @@ test_libver_bounds_attributes(hid_t fapl)
/* Get the internal attribute pointer */
attr = (H5A_t *)H5VL_object(aid);
- CHECK(attr, NULL, "H5VL_object");
+ CHECK_PTR(attr, "H5VL_object");
/* Verify attribute version */
VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
@@ -7028,7 +7193,7 @@ test_libver_bounds_attributes(hid_t fapl)
/* Get internal attribute pointer */
attr = (H5A_t *)H5VL_object(aid);
- CHECK(attr, NULL, "H5VL_object");
+ CHECK_PTR(attr, "H5VL_object");
/* Verify attribute version */
if (low == H5F_LIBVER_EARLIEST)
@@ -7093,7 +7258,7 @@ test_libver_bounds_attributes(hid_t fapl)
/* Get the internal attribute pointer */
attr = (H5A_t *)H5VL_object(aid);
- CHECK(attr, NULL, "H5VL_object");
+ CHECK_PTR(attr, "H5VL_object");
/* Verify the attribute version */
if (low == H5F_LIBVER_EARLIEST)
@@ -7135,21 +7300,27 @@ test_libver_bounds_attributes(hid_t fapl)
/* Verify the attribute version */
for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(new_fapl, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
continue;
/* Open the file */
- H5E_BEGIN_TRY { fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ }
H5E_END_TRY;
if (fid >= 0) { /* The file open succeeds */
/* Get the internal file pointer */
f = (H5F_t *)H5VL_object(fid);
- CHECK(f, NULL, "H5VL_object");
+ CHECK_PTR(f, "H5VL_object");
/* Open the group */
gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT);
@@ -7161,7 +7332,7 @@ test_libver_bounds_attributes(hid_t fapl)
/* Get the internal attribute pointer */
attr = (H5A_t *)H5VL_object(aid);
- CHECK(attr, NULL, "H5VL_object");
+ CHECK_PTR(attr, "H5VL_object");
/* Verify the attribute message version */
VERIFY(attr->shared->version, H5O_attr_ver_bounds[f->shared->low_bound],
@@ -7296,7 +7467,10 @@ test_libver_macros2(void)
ret = H5Gunlink(file, "Group");
CHECK(ret, FAIL, "H5Gunlink");
- H5E_BEGIN_TRY { grp = H5Gopen(file, "Group"); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Gopen(file, "Group");
+ }
H5E_END_TRY;
VERIFY(grp, FAIL, "H5Gopen");
#endif
@@ -7532,17 +7706,26 @@ test_min_dset_ohdr(void)
*/
/* trying to set with invalid file ID */
- H5E_BEGIN_TRY { ret = H5Fset_dset_no_attrs_hint(-1, TRUE); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fset_dset_no_attrs_hint(-1, TRUE);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Fset_dset_no_attrs_hint");
/* trying to get with invalid file ID */
- H5E_BEGIN_TRY { ret = H5Fget_dset_no_attrs_hint(-1, &minimize); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fget_dset_no_attrs_hint(-1, &minimize);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Fget_dset_no_attrs_hint");
/* trying to get with invalid pointer */
- H5E_BEGIN_TRY { ret = H5Fget_dset_no_attrs_hint(file_id, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fget_dset_no_attrs_hint(file_id, NULL);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Fget_dset_no_attrs_hint");
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 7e805e2..55e5a9b 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -55,7 +55,7 @@ char prop3_def[10] = "Ten chars"; /* Property 3 default value */
#define PROP3_DEF_VALUE (&prop3_def)
#define PROP4_NAME "Property 4"
-double prop4_def = 1.41F; /* Property 4 default value */
+double prop4_def = 1.41; /* Property 4 default value */
#define PROP4_SIZE sizeof(prop4_def)
#define PROP4_DEF_VALUE (&prop4_def)
diff --git a/test/th5o.c b/test/th5o.c
index b6b1bf4..ebb6c6e 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -347,21 +347,30 @@ test_h5o_open_by_addr(void)
/* Try giving some bogus values to H5O_open_by_addr. */
/* Try to open an object with a bad address */
grp_addr += 20;
- H5E_BEGIN_TRY { grp = H5Oopen_by_addr(fid, grp_addr); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }
H5E_END_TRY
VERIFY(grp, FAIL, "H5Oopen_by_addr");
/* For instance, an objectno smaller than the end of the file's superblock should
* trigger an error */
grp_addr = 10;
- H5E_BEGIN_TRY { grp = H5Oopen_by_addr(fid, grp_addr); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }
H5E_END_TRY
VERIFY(grp, FAIL, "H5Oopen_by_addr");
/* Likewise, an objectno larger than the size of the file should fail */
grp_addr = 0;
grp_addr = 1000000000;
- H5E_BEGIN_TRY { grp = H5Oopen_by_addr(fid, grp_addr); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }
H5E_END_TRY
VERIFY(grp, FAIL, "H5Oopen_by_addr");
@@ -369,7 +378,10 @@ test_h5o_open_by_addr(void)
CHECK(ret, FAIL, "H5Fclose");
/* Also, trying to open an object without a valid location should fail */
- H5E_BEGIN_TRY { dtype = H5Oopen_by_addr(fid, dtype_addr); }
+ H5E_BEGIN_TRY
+ {
+ dtype = H5Oopen_by_addr(fid, dtype_addr);
+ }
H5E_END_TRY
VERIFY(dtype, FAIL, "H5Oopen_by_addr");
} /* test_h5o_open_by_addr() */
@@ -473,7 +485,10 @@ test_h5o_open_by_token(void)
/* Try giving some bogus values to H5O_open_by_token */
/* Try opening an object using H5O_TOKEN_UNDEF (should fail) */
- H5E_BEGIN_TRY { dtype = H5Oopen_by_token(fid, H5O_TOKEN_UNDEF); }
+ H5E_BEGIN_TRY
+ {
+ dtype = H5Oopen_by_token(fid, H5O_TOKEN_UNDEF);
+ }
H5E_END_TRY
VERIFY(dtype, FAIL, "H5Oopen_by_token");
@@ -481,7 +496,10 @@ test_h5o_open_by_token(void)
CHECK(ret, FAIL, "H5Fclose");
/* Also, trying to open an object without a valid location (should fail) */
- H5E_BEGIN_TRY { dtype = H5Oopen_by_token(fid, li.u.token); }
+ H5E_BEGIN_TRY
+ {
+ dtype = H5Oopen_by_token(fid, li.u.token);
+ }
H5E_END_TRY
VERIFY(dtype, FAIL, "H5Oopen_by_token");
@@ -929,7 +947,10 @@ test_h5o_link(void)
for (high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
/* Set version bounds */
- H5E_BEGIN_TRY { ret = H5Pset_libver_bounds(fapl_id, low, high); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_libver_bounds(fapl_id, low, high);
+ }
H5E_END_TRY;
if (ret < 0) /* Invalid low/high combinations */
@@ -1114,7 +1135,10 @@ test_h5o_comment(void)
CHECK(ret, FAIL, "H5Oset_comment");
/* Putting a comment on the dataspace. It's supposed to fail. */
- H5E_BEGIN_TRY { ret = H5Oset_comment(dspace, "dataspace comment"); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oset_comment(dspace, "dataspace comment");
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Oset_comment");
@@ -1283,7 +1307,10 @@ test_h5o_comment_by_name(void)
CHECK(ret, FAIL, "H5Oset_comment_by_name");
/* Putting a comment on the dataspace. It's supposed to fail. */
- H5E_BEGIN_TRY { ret = H5Oset_comment_by_name(dspace, ".", "dataspace comment", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oset_comment_by_name(dspace, ".", "dataspace comment", H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Oset_comment");
@@ -1565,21 +1592,30 @@ test_h5o_open_by_addr_deprec(void)
/* Try giving some bogus values to H5O_open_by_addr. */
/* Try to open an object with a bad address */
grp_addr += 20;
- H5E_BEGIN_TRY { grp = H5Oopen_by_addr(fid, grp_addr); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }
H5E_END_TRY
VERIFY(grp, FAIL, "H5Oopen_by_addr");
/* For instance, an objectno smaller than the end of the file's superblock should
* trigger an error */
grp_addr = 10;
- H5E_BEGIN_TRY { grp = H5Oopen_by_addr(fid, grp_addr); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }
H5E_END_TRY
VERIFY(grp, FAIL, "H5Oopen_by_addr");
/* Likewise, an objectno larger than the size of the file should fail */
grp_addr = 0;
grp_addr = 1000000000;
- H5E_BEGIN_TRY { grp = H5Oopen_by_addr(fid, grp_addr); }
+ H5E_BEGIN_TRY
+ {
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }
H5E_END_TRY
VERIFY(grp, FAIL, "H5Oopen_by_addr");
@@ -1587,7 +1623,10 @@ test_h5o_open_by_addr_deprec(void)
CHECK(ret, FAIL, "H5Fclose");
/* Also, trying to open an object without a valid location should fail */
- H5E_BEGIN_TRY { dtype = H5Oopen_by_addr(fid, dtype_addr); }
+ H5E_BEGIN_TRY
+ {
+ dtype = H5Oopen_by_addr(fid, dtype_addr);
+ }
H5E_END_TRY
VERIFY(dtype, FAIL, "H5Oopen_by_addr");
} /* test_h5o_open_by_addr_deprec() */
diff --git a/test/th5s.c b/test/th5s.c
index 901d0e3..51216dc 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -180,7 +180,10 @@ test_h5s_basic(void)
* Check to be sure we can't create a simple dataspace that has too many
* dimensions.
*/
- H5E_BEGIN_TRY { sid1 = H5Screate_simple(H5S_MAX_RANK + 1, dims3, NULL); }
+ H5E_BEGIN_TRY
+ {
+ sid1 = H5Screate_simple(H5S_MAX_RANK + 1, dims3, NULL);
+ }
H5E_END_TRY;
VERIFY(sid1, FAIL, "H5Screate_simple");
@@ -247,43 +250,70 @@ test_h5s_basic(void)
CHECK(dset1, FAIL, "H5Dcreate2");
/* Try some writes with the bad dataspace (sid1) */
- H5E_BEGIN_TRY { ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, &n); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, &n);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dwrite");
- H5E_BEGIN_TRY { ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &n); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &n);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dwrite");
- H5E_BEGIN_TRY { ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, sid1, H5P_DEFAULT, &n); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, sid1, H5P_DEFAULT, &n);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dwrite");
/* Try to iterate using the bad dataspace */
- H5E_BEGIN_TRY { ret = H5Diterate(&n, H5T_NATIVE_INT, sid1, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Diterate(&n, H5T_NATIVE_INT, sid1, NULL, NULL);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Diterate");
/* Try to fill using the bad dataspace */
- H5E_BEGIN_TRY { ret = H5Dfill(NULL, H5T_NATIVE_INT, &n, H5T_NATIVE_INT, sid1); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dfill(NULL, H5T_NATIVE_INT, &n, H5T_NATIVE_INT, sid1);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dfill");
/* Now use the bad dataspace as the space for an attribute */
- H5E_BEGIN_TRY { aid1 = H5Acreate2(dset1, BASICATTR, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ aid1 = H5Acreate2(dset1, BASICATTR, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY
VERIFY(aid1, FAIL, "H5Acreate2");
/* Make sure that dataspace reads using the bad dataspace fail */
- H5E_BEGIN_TRY { ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, &n); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, &n);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dread");
- H5E_BEGIN_TRY { ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &n); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &n);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dread");
- H5E_BEGIN_TRY { ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, sid1, H5P_DEFAULT, &n); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, sid1, H5P_DEFAULT, &n);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dread");
@@ -700,7 +730,10 @@ test_h5s_zero_dim(void)
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- H5E_BEGIN_TRY { ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, wdata); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, wdata);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dwrite");
@@ -716,7 +749,10 @@ test_h5s_zero_dim(void)
ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
CHECK(ret, FAIL, "H5Sselect_elements");
- H5E_BEGIN_TRY { ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &val); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &val);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dwrite");
@@ -813,7 +849,10 @@ test_h5s_zero_dim(void)
/* Now extend the first dimension size of the dataset to SPACE1_DIM1*3 past the maximal size.
* It is supposed to fail. */
extend_dims[0] = SPACE1_DIM1 * 3;
- H5E_BEGIN_TRY { ret = H5Dset_extent(dset1, extend_dims); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dset_extent(dset1, extend_dims);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dset_extent");
@@ -1207,11 +1246,14 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
if (sbuf_size > 0) {
sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size);
- CHECK(sbuf, NULL, "HDcalloc");
+ CHECK_PTR(sbuf, "HDcalloc");
}
/* Try decoding bogus buffer */
- H5E_BEGIN_TRY { ret_id = H5Sdecode(sbuf); }
+ H5E_BEGIN_TRY
+ {
+ ret_id = H5Sdecode(sbuf);
+ }
H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
@@ -1266,7 +1308,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
if (null_size > 0) {
null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size);
- CHECK(null_sbuf, NULL, "HDcalloc");
+ CHECK_PTR(null_sbuf, "HDcalloc");
}
/* Encode the null dataspace in the buffer */
@@ -1302,7 +1344,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
if (scalar_size > 0) {
scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size);
- CHECK(scalar_buf, NULL, "HDcalloc");
+ CHECK_PTR(scalar_buf, "HDcalloc");
}
/* Encode the scalar dataspace in the buffer */
@@ -1396,11 +1438,14 @@ test_h5s_encode1(void)
if (sbuf_size > 0) {
sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size);
- CHECK(sbuf, NULL, "HDcalloc");
+ CHECK_PTR(sbuf, "HDcalloc");
}
/* Try decoding bogus buffer */
- H5E_BEGIN_TRY { ret_id = H5Sdecode(sbuf); }
+ H5E_BEGIN_TRY
+ {
+ ret_id = H5Sdecode(sbuf);
+ }
H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
@@ -1455,7 +1500,7 @@ test_h5s_encode1(void)
if (null_size > 0) {
null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size);
- CHECK(null_sbuf, NULL, "HDcalloc");
+ CHECK_PTR(null_sbuf, "HDcalloc");
}
/* Encode the null dataspace in the buffer */
@@ -1491,7 +1536,7 @@ test_h5s_encode1(void)
if (scalar_size > 0) {
scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size);
- CHECK(scalar_buf, NULL, "HDcalloc");
+ CHECK_PTR(scalar_buf, "HDcalloc");
}
/* Encode the scalar dataspace in the buffer */
@@ -1563,7 +1608,10 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version,
herr_t ret; /* Return value */
/* Get buffer size for encoding with the format setting in in_fapl */
- H5E_BEGIN_TRY { ret = H5Sencode2(in_sid, NULL, &buf_size, in_fapl); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sencode2(in_sid, NULL, &buf_size, in_fapl);
+ }
H5E_END_TRY
if (expected_to_fail) {
@@ -1575,7 +1623,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version,
/* Allocate the buffer for encoding */
buf = (char *)HDmalloc(buf_size);
- CHECK(buf, NULL, "H5Dmalloc");
+ CHECK_PTR(buf, "H5Dmalloc");
/* Encode according to the setting in in_fapl */
ret = H5Sencode2(in_sid, buf, &buf_size, in_fapl);
@@ -2101,7 +2149,7 @@ test_h5s_encode_length(void)
/* Allocate the buffer */
if (sbuf_size > 0) {
sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size);
- CHECK(sbuf, NULL, "H5Sencode2");
+ CHECK_PTR(sbuf, "H5Sencode2");
}
/* Encode the dataspace */
@@ -2158,7 +2206,10 @@ test_h5s_scalar_write(void)
CHECK(fid1, FAIL, "H5Fcreate");
/* Verify a non-zero rank fails with a NULL dimension. */
- H5E_BEGIN_TRY { sid1 = H5Screate_simple(SPACE1_RANK, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ sid1 = H5Screate_simple(SPACE1_RANK, NULL, NULL);
+ }
H5E_END_TRY
VERIFY(sid1, FAIL, "H5Screate_simple");
@@ -2398,7 +2449,7 @@ test_h5s_compound_scalar_read(void)
ret = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct))) {
+ if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) {
HDprintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n", space4_data.c1, rdata.c1);
HDprintf("scalar data different: space4_data.u=%u, read_data4.u=%u\n", space4_data.u, rdata.u);
HDprintf("scalar data different: space4_data.f=%f, read_data4.f=%f\n", (double)space4_data.f,
@@ -2524,7 +2575,7 @@ test_h5s_chunk(void)
for (i = 0; i < CHUNK_DATA_NX; i++) {
for (j = 0; j < CHUNK_DATA_NY; j++) {
/* Check if the two values are within 0.001% range. */
- if (!H5_DBL_REL_EQUAL(chunk_data_dbl[i][j], (double)chunk_data_flt[i][j], (double)0.00001F))
+ if (!H5_DBL_REL_EQUAL(chunk_data_dbl[i][j], (double)chunk_data_flt[i][j], 0.00001))
TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n",
(unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j,
(double)chunk_data_flt[i][j]);
@@ -3253,7 +3304,7 @@ test_versionbounds(void)
/* Its version should be H5O_SDSPACE_VERSION_1 */
spacep = (H5S_t *)H5I_object(space);
- CHECK(spacep, NULL, "H5I_object");
+ CHECK_PTR(spacep, "H5I_object");
VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound");
/* Set high bound to V18 */
@@ -3274,7 +3325,7 @@ test_versionbounds(void)
dset_space = H5Dget_space(dset);
CHECK(dset_space, FAIL, "H5Dget_space");
spacep = (H5S_t *)H5I_object(dset_space);
- CHECK(spacep, NULL, "H5I_object");
+ CHECK_PTR(spacep, "H5I_object");
/* Dataspace version should remain as H5O_SDSPACE_VERSION_1 */
VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound");
@@ -3311,7 +3362,7 @@ test_versionbounds(void)
dset_space = H5Dget_space(dset);
CHECK(dset_space, FAIL, "H5Dget_space");
spacep = (H5S_t *)H5I_object(dset_space);
- CHECK(spacep, NULL, "H5I_object");
+ CHECK_PTR(spacep, "H5I_object");
/* Verify the dataspace version */
VERIFY(spacep->extent.version, H5O_sdspace_ver_bounds[low], "upgraded dataspace version");
diff --git a/test/theap.c b/test/theap.c
index f8a6e9b..9d5787b 100644
--- a/test/theap.c
+++ b/test/theap.c
@@ -1050,7 +1050,7 @@ test_heap_term(void)
HDfree(inc_sort_num);
if (dec_sort_num)
HDfree(dec_sort_num);
-} /* end test_tst_term() */
+} /* end test_heap_term() */
/****************************************************************
**
diff --git a/test/tid.c b/test/tid.c
index 7b5fff2..0a45116 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -513,7 +513,7 @@ test_id_type_list(void)
/* Sanity check */
if ((int)startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) {
/* Error condition, throw an error */
- CHECK(1, 1, "H5Iregister_type");
+ ERROR("H5Iregister_type");
goto out;
}
/* Create types up to H5I_MAX_NUM_TYPES */
@@ -705,7 +705,7 @@ test_remove_clear_type(void)
/* Create an array to hold the objects in the master list */
list_size = RCT_MAX_NOBJS * sizeof(rct_obj_t);
obj_list.objects = HDmalloc(list_size);
- CHECK(obj_list.objects, NULL, "HDcalloc");
+ CHECK_PTR(obj_list.objects, "HDcalloc");
if (NULL == obj_list.objects)
goto error;
@@ -715,10 +715,10 @@ test_remove_clear_type(void)
for (i = 0; i < RCT_NITER; i++) {
/* The number of members in the type, according to the HDF5 library */
- hsize_t nmembers = 1234567;
+ hsize_t nmembers = 1234567; /* (init to fake number) */
/* The number of objects found while scanning through the object list */
- unsigned found;
+ int found;
/*********************
* Build object list *
@@ -801,7 +801,7 @@ test_remove_clear_type(void)
if (ret == FAIL)
goto error;
VERIFY(nmembers, found, "The number of members remaining in the type did not match our count");
- if (nmembers != found)
+ if (nmembers != (hsize_t)found)
goto error;
/*****************************************
@@ -856,7 +856,10 @@ test_remove_clear_type(void)
error:
/* Cleanup. For simplicity, just destroy the types and ignore errors. */
- H5E_BEGIN_TRY { H5Idestroy_type(obj_type); }
+ H5E_BEGIN_TRY
+ {
+ H5Idestroy_type(obj_type);
+ }
H5E_END_TRY
HDfree(obj_list.objects);
@@ -995,19 +998,28 @@ test_future_ids(void)
/* Test basic error conditions */
fake_future_obj = 0;
- H5E_BEGIN_TRY { future_id = H5Iregister_future(obj_type, &fake_future_obj, NULL, NULL); }
+ H5E_BEGIN_TRY
+ {
+ future_id = H5Iregister_future(obj_type, &fake_future_obj, NULL, NULL);
+ }
H5E_END_TRY
VERIFY(future_id, H5I_INVALID_HID, "H5Iregister_future");
if (H5I_INVALID_HID != future_id)
goto error;
- H5E_BEGIN_TRY { future_id = H5Iregister_future(obj_type, &fake_future_obj, realize_future_cb, NULL); }
+ H5E_BEGIN_TRY
+ {
+ future_id = H5Iregister_future(obj_type, &fake_future_obj, realize_future_cb, NULL);
+ }
H5E_END_TRY
VERIFY(future_id, H5I_INVALID_HID, "H5Iregister_future");
if (H5I_INVALID_HID != future_id)
goto error;
- H5E_BEGIN_TRY { future_id = H5Iregister_future(obj_type, &fake_future_obj, NULL, discard_future_cb); }
+ H5E_BEGIN_TRY
+ {
+ future_id = H5Iregister_future(obj_type, &fake_future_obj, NULL, discard_future_cb);
+ }
H5E_END_TRY
VERIFY(future_id, H5I_INVALID_HID, "H5Iregister_future");
if (H5I_INVALID_HID != future_id)
@@ -1068,7 +1080,7 @@ test_future_ids(void)
VERIFY(*actual_obj2, 7, "H5Iobject_verify");
if (7 != *actual_obj2)
goto error;
- VERIFY(actual_obj, actual_obj2, "H5Iobject_verify");
+ CHECK_PTR_EQ(actual_obj, actual_obj2, "H5Iobject_verify");
if (actual_obj != actual_obj2)
goto error;
@@ -1119,7 +1131,7 @@ test_future_ids(void)
VERIFY(*actual_obj2, 7, "H5Iobject_verify");
if (7 != *actual_obj2)
goto error;
- VERIFY(actual_obj, actual_obj2, "H5Iobject_verify");
+ CHECK_PTR_EQ(actual_obj, actual_obj2, "H5Iobject_verify");
if (actual_obj != actual_obj2)
goto error;
@@ -1349,7 +1361,10 @@ test_future_ids(void)
error:
/* Cleanup. For simplicity, just destroy the types and ignore errors. */
- H5E_BEGIN_TRY { H5Idestroy_type(obj_type); }
+ H5E_BEGIN_TRY
+ {
+ H5Idestroy_type(obj_type);
+ }
H5E_END_TRY
return -1;
diff --git a/test/timer.c b/test/timer.c
index 24f3245..11b7427 100644
--- a/test/timer.c
+++ b/test/timer.c
@@ -43,55 +43,55 @@ test_time_formatting(void)
TESTING("Time string formats");
/* < 0, N/A */
- s = H5_timer_get_time_string(-1.0F);
+ s = H5_timer_get_time_string(-1.0);
if (NULL == s || HDstrcmp(s, "N/A") != 0)
TEST_ERROR;
HDfree(s);
/* 0 0 */
- s = H5_timer_get_time_string(0.0F);
+ s = H5_timer_get_time_string(0.0);
if (NULL == s || HDstrcmp(s, "0.0 s") != 0)
TEST_ERROR;
HDfree(s);
/* < 1 us nanoseconds */
- s = H5_timer_get_time_string(123.0E-9F);
+ s = H5_timer_get_time_string(123.0E-9);
if (NULL == s || HDstrcmp(s, "123 ns") != 0)
TEST_ERROR;
HDfree(s);
/* < 1 ms microseconds */
- s = H5_timer_get_time_string(23.456E-6F);
+ s = H5_timer_get_time_string(23.456E-6);
if (NULL == s || HDstrcmp(s, "23.5 us") != 0)
TEST_ERROR;
HDfree(s);
/* < 1 s milliseconds */
- s = H5_timer_get_time_string(4.56789E-3F);
+ s = H5_timer_get_time_string(4.56789E-3);
if (NULL == s || HDstrcmp(s, "4.6 ms") != 0)
TEST_ERROR;
HDfree(s);
/* < 1 min seconds */
- s = H5_timer_get_time_string(3.14F);
+ s = H5_timer_get_time_string(3.14);
if (NULL == s || HDstrcmp(s, "3.14 s") != 0)
TEST_ERROR;
HDfree(s);
/* < 1 hr mins, secs */
- s = H5_timer_get_time_string(2521.0F);
+ s = H5_timer_get_time_string(2521.0);
if (NULL == s || HDstrcmp(s, "42 m 1 s") != 0)
TEST_ERROR;
HDfree(s);
/* < 1 d hrs, mins, secs */
- s = H5_timer_get_time_string(9756.0F);
+ s = H5_timer_get_time_string(9756.0);
if (NULL == s || HDstrcmp(s, "2 h 42 m 36 s") != 0)
TEST_ERROR;
HDfree(s);
/* > 1 d days, hrs, mins, secs */
- s = H5_timer_get_time_string(280802.0F);
+ s = H5_timer_get_time_string(280802.0);
if (NULL == s || HDstrcmp(s, "3 d 6 h 0 m 2 s") != 0)
TEST_ERROR;
HDfree(s);
@@ -144,7 +144,7 @@ test_timer_system_user(void)
/* The system and user times may not be present on some systems. They
* will be -1.0 if they are not.
*/
- if (timer.initial.system < (double)0.0f || timer.initial.user < (double)0.0f) {
+ if (timer.initial.system < 0.0 || timer.initial.user < 0.0) {
SKIPPED();
HDprintf("NOTE: No suitable way to get system/user times on this platform.\n");
return 0;
@@ -165,7 +165,7 @@ test_timer_system_user(void)
TEST_ERROR;
/* System and user times should be non-negative. */
- if (times.system < (double)0.0f || times.user < (double)0.0f)
+ if (times.system < 0.0 || times.user < 0.0)
TEST_ERROR;
PASSED();
@@ -224,7 +224,7 @@ test_timer_elapsed(void)
TEST_ERROR;
/* Elapsed time should be non-negative. */
- if (times.elapsed < (double)0.0f)
+ if (times.elapsed < 0.0)
TEST_ERROR;
PASSED();
@@ -260,11 +260,11 @@ test_timer_functionality(void)
/* Times should be initialized to zero */
err = H5_timer_get_times(timer, &times);
- if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f))
+ if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0))
TEST_ERROR;
err = H5_timer_get_total_times(timer, &times);
- if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f))
+ if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0))
TEST_ERROR;
/********************
@@ -289,11 +289,11 @@ test_timer_functionality(void)
/* Times should be positive and non-negative */
err = H5_timer_get_times(timer, &times);
- if (err < 0 || times.elapsed < (double)0.0f)
+ if (err < 0 || times.elapsed < 0.0)
TEST_ERROR;
err = H5_timer_get_total_times(timer, &times);
- if (err < 0 || times.elapsed < (double)0.0f)
+ if (err < 0 || times.elapsed < 0.0)
TEST_ERROR;
/**********************
@@ -306,11 +306,11 @@ test_timer_functionality(void)
TEST_ERROR;
err = H5_timer_get_times(timer, &times);
- if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f))
+ if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0))
TEST_ERROR;
err = H5_timer_get_total_times(timer, &times);
- if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, (double)0.0f))
+ if (err < 0 || !H5_DBL_ABS_EQUAL(times.elapsed, 0.0))
TEST_ERROR;
/* Timer state should flip */
@@ -326,12 +326,12 @@ test_timer_functionality(void)
/* Times should be non-negative */
err = H5_timer_get_times(timer, &times);
- if (err < 0 || times.elapsed < (double)0.0f)
+ if (err < 0 || times.elapsed < 0.0)
TEST_ERROR;
prev_etime = times.elapsed;
err = H5_timer_get_total_times(timer, &times);
- if (err < 0 || times.elapsed < (double)0.0f)
+ if (err < 0 || times.elapsed < 0.0)
TEST_ERROR;
prev_total_etime = times.elapsed;
diff --git a/test/titerate.c b/test/titerate.c
index 52bd9c9..10ed039 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -271,19 +271,28 @@ test_iter_group(hid_t fapl, hbool_t new_format)
/* Test invalid indices for starting iteration */
info.command = RET_ZERO;
idx = (hsize_t)-1;
- H5E_BEGIN_TRY { ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Literate2");
/* Test skipping exactly as many entries as in the group */
idx = NDATASETS + 2;
- H5E_BEGIN_TRY { ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Literate2");
/* Test skipping more entries than are in the group */
idx = NDATASETS + 3;
- H5E_BEGIN_TRY { ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Literate2");
@@ -461,13 +470,19 @@ test_iter_attr(hid_t fapl, hbool_t new_format)
/* Test skipping exactly as many attributes as there are */
idx = NATTR;
- H5E_BEGIN_TRY { ret = H5Aiterate2(dataset, H5_INDEX_NAME, H5_ITER_INC, &idx, aiter_cb, &info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Aiterate2(dataset, H5_INDEX_NAME, H5_ITER_INC, &idx, aiter_cb, &info);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Aiterate2");
/* Test skipping more attributes than there are */
idx = NATTR + 1;
- H5E_BEGIN_TRY { ret = H5Aiterate2(dataset, H5_INDEX_NAME, H5_ITER_INC, &idx, aiter_cb, &info); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Aiterate2(dataset, H5_INDEX_NAME, H5_ITER_INC, &idx, aiter_cb, &info);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Aiterate2");
@@ -570,7 +585,7 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info2_t H5_ATTR_UNUSED *link
H5O_info2_t oinfo;
herr_t ret; /* Generic return value */
- if (HDstrcmp(name, test_info->name)) {
+ if (HDstrcmp(name, test_info->name) != 0) {
TestErrPrintf("name = '%s', test_info = '%s'\n", name, test_info->name);
return (H5_ITER_ERROR);
} /* end if */
@@ -937,7 +952,7 @@ test_links(hid_t fapl)
else if (!HDstrcmp(obj_name, "softlink"))
VERIFY(linfo.type, H5L_TYPE_SOFT, "H5Lget_name_by_idx");
else
- CHECK(0, 0, "unknown object name");
+ ERROR("unknown object name");
} /* end for */
ret = H5Gclose(gid);
@@ -1107,7 +1122,7 @@ test_links_deprec(hid_t fapl)
else if (!HDstrcmp(obj_name, "softlink"))
VERIFY(linfo.type, H5L_TYPE_SOFT, "H5Lget_name_by_idx");
else
- CHECK(0, 0, "unknown object name");
+ ERROR("unknown object name");
} /* end for */
ret = H5Gclose(gid);
diff --git a/test/tmeta.c b/test/tmeta.c
index 2609703..e70db16 100644
--- a/test/tmeta.c
+++ b/test/tmeta.c
@@ -22,9 +22,9 @@
#include "testhdf5.h"
#include "H5Fprivate.h"
-#define TEST_INT16_VALUE -7641
+#define TEST_INT16_VALUE (-7641)
#define TEST_UINT16_VALUE 45002
-#define TEST_INT32_VALUE -981236
+#define TEST_INT32_VALUE (-981236)
#define TEST_UINT32_VALUE 3476589
uint8_t compar_buffer[] = {
diff --git a/test/tmisc.c b/test/tmisc.c
index 68fa06a..b267330 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -517,7 +517,6 @@ test_misc2_write_attribute(void)
HDfree(string_att1);
HDfree(string_att2);
- return;
}
static void
@@ -563,8 +562,6 @@ test_misc2_read_attribute(const char *filename, const char *att_name)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
}
/****************************************************************
**
@@ -1897,7 +1894,10 @@ test_misc11(void)
CHECK(ret, FAIL, "H5Pset_sizes");
/* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */
- H5E_BEGIN_TRY { ret = H5Pset_sym_k(fcpl, 32770, 0); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_sym_k(fcpl, 32770, 0);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_sym_k");
@@ -1905,7 +1905,10 @@ test_misc11(void)
CHECK(ret, FAIL, "H5Pset_sym_k");
/* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */
- H5E_BEGIN_TRY { ret = H5Pset_istore_k(fcpl, 32770); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_istore_k(fcpl, 32770);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_istore_k");
@@ -2086,11 +2089,11 @@ test_misc12(void)
CHECK(ret, FAIL, "H5Dread");
for (i = 0; i < MISC12_SPACE1_DIM1; i++)
- if (HDstrcmp(wdata[i], rdata[i]))
+ if (HDstrcmp(wdata[i], rdata[i]) != 0)
TestErrPrintf("Error on line %d: wdata[%d]=%s, rdata[%d]=%s\n", __LINE__, i, wdata[i], i,
rdata[i]);
for (; i < (MISC12_SPACE1_DIM1 + MISC12_APPEND_SIZE); i++)
- if (HDstrcmp(wdata1[i - MISC12_SPACE1_DIM1], rdata[i]))
+ if (HDstrcmp(wdata1[i - MISC12_SPACE1_DIM1], rdata[i]) != 0)
TestErrPrintf("Error on line %d: wdata1[%d]=%s, rdata[%d]=%s\n", __LINE__, i - MISC12_SPACE1_DIM1,
wdata1[i - MISC12_SPACE1_DIM1], i, rdata[i]);
@@ -2518,17 +2521,17 @@ test_misc13(void)
static void
test_misc14(void)
{
- hid_t file_id; /* File ID */
- hid_t fapl; /* File access property list ID */
- hid_t DataSpace; /* Dataspace ID */
- hid_t Dataset1; /* Dataset ID #1 */
- hid_t Dataset2; /* Dataset ID #2 */
- hid_t Dataset3; /* Dataset ID #3 */
- double data1 = 5.0F; /* Data to write for dataset #1 */
- double data2 = 10.0F; /* Data to write for dataset #2 */
- double data3 = 15.0F; /* Data to write for dataset #3 */
- double rdata; /* Data read in */
- herr_t ret; /* Generic return value */
+ hid_t file_id; /* File ID */
+ hid_t fapl; /* File access property list ID */
+ hid_t DataSpace; /* Dataspace ID */
+ hid_t Dataset1; /* Dataset ID #1 */
+ hid_t Dataset2; /* Dataset ID #2 */
+ hid_t Dataset3; /* Dataset ID #3 */
+ double data1 = 5.0; /* Data to write for dataset #1 */
+ double data2 = 10.0; /* Data to write for dataset #2 */
+ double data3 = 15.0; /* Data to write for dataset #3 */
+ double rdata; /* Data read in */
+ herr_t ret; /* Generic return value */
/* Test creating two datasets and deleting the second */
@@ -3163,7 +3166,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the file again (should fail) */
- H5E_BEGIN_TRY { ret = H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fclose(fid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Fclose");
@@ -3194,7 +3200,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the property list again (should fail) */
- H5E_BEGIN_TRY { ret = H5Pclose(plid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pclose(plid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pclose");
@@ -3225,7 +3234,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the property class again (should fail) */
- H5E_BEGIN_TRY { ret = H5Pclose_class(pcid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pclose_class(pcid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pclose_class");
@@ -3256,7 +3268,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the datatype again (should fail) */
- H5E_BEGIN_TRY { ret = H5Tclose(tid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Tclose(tid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tclose");
@@ -3287,7 +3302,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the dataspace again (should fail) */
- H5E_BEGIN_TRY { ret = H5Sclose(sid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sclose(sid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sclose");
@@ -3326,7 +3344,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the dataset again (should fail) */
- H5E_BEGIN_TRY { ret = H5Dclose(did); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dclose(did);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dclose");
@@ -3377,7 +3398,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the attribute again (should fail) */
- H5E_BEGIN_TRY { ret = H5Aclose(aid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Aclose(aid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Aclose");
@@ -3424,7 +3448,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the group again (should fail) */
- H5E_BEGIN_TRY { ret = H5Gclose(gid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Gclose(gid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Gclose");
@@ -3459,7 +3486,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the error class again (should fail) */
- H5E_BEGIN_TRY { ret = H5Eunregister_class(ecid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eunregister_class(ecid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Eunregister_class");
@@ -3494,7 +3524,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the error message again (should fail) */
- H5E_BEGIN_TRY { ret = H5Eclose_msg(emid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eclose_msg(emid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Eclose_msg");
@@ -3529,7 +3562,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try closing the error stack again (should fail) */
- H5E_BEGIN_TRY { ret = H5Eclose_stack(esid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eclose_stack(esid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Eclose_stack");
@@ -3564,7 +3600,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try unregistering the VFD again (should fail) */
- H5E_BEGIN_TRY { ret = H5FDunregister(vfdid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5FDunregister(vfdid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5FDunregister");
@@ -3574,7 +3613,7 @@ test_misc19(void)
/* Get a VOL class to register */
vol_cls = h5_get_dummy_vol_class();
- CHECK(vol_cls, NULL, "h5_get_dummy_vol_class");
+ CHECK_PTR(vol_cls, "h5_get_dummy_vol_class");
/* Register a VOL connector */
volid = H5VLregister_connector(vol_cls, H5P_DEFAULT);
@@ -3601,7 +3640,10 @@ test_misc19(void)
VERIFY(rc, 0, "H5Idec_ref");
/* Try unregistering the VOL connector again (should fail) */
- H5E_BEGIN_TRY { ret = H5VLunregister_connector(volid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLunregister_connector(volid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5VLunregister_connector");
@@ -4039,23 +4081,50 @@ test_misc23(void)
* test the old APIs
**********************************************************************/
- H5E_BEGIN_TRY { tmp_id = H5Gcreate1(file_id, "/A/B00a/grp", (size_t)0); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gcreate1(file_id, "/A/B00a/grp", (size_t)0);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gcreate1");
- tmp_id = H5Gcreate1(file_id, "/A/grp", (size_t)0);
+ /* Make sure that size_hint values that can't fit into a 32-bit
+ * unsigned integer are rejected. Only necessary on systems where
+ * size_t is a 64-bit type.
+ */
+ if (SIZE_MAX > UINT32_MAX) {
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gcreate1(file_id, "/size_hint_too_large", SIZE_MAX);
+ }
+ H5E_END_TRY;
+ VERIFY(tmp_id, FAIL, "H5Gcreate1");
+ }
+
+ /* Make sure the largest size_hint value works */
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gcreate1(file_id, "/largest_size_hint", UINT32_MAX);
+ }
+ H5E_END_TRY;
CHECK(tmp_id, FAIL, "H5Gcreate1");
+ status = H5Gclose(tmp_id);
+ CHECK(status, FAIL, "H5Gclose");
+ tmp_id = H5Gcreate1(file_id, "/A/grp", (size_t)0);
+ CHECK(tmp_id, FAIL, "H5Gcreate1");
status = H5Gclose(tmp_id);
CHECK(status, FAIL, "H5Gclose");
- H5E_BEGIN_TRY { tmp_id = H5Dcreate1(file_id, "/A/B00c/dset", type_id, space_id, create_id); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dcreate1(file_id, "/A/B00c/dset", type_id, space_id, create_id);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dcreate1");
tmp_id = H5Dcreate1(file_id, "/A/dset", type_id, space_id, create_id);
CHECK(tmp_id, FAIL, "H5Dcreate1");
-
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -4382,51 +4451,87 @@ test_misc24(void)
CHECK(ret, FAIL, "H5Tclose");
/* Attempt to open each kind of object with wrong API, including using soft links */
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
@@ -4435,19 +4540,31 @@ test_misc24(void)
group_id = H5Gopen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT);
CHECK(group_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
@@ -4458,19 +4575,31 @@ test_misc24(void)
dset_id = H5Dopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT);
CHECK(dset_id, FAIL, "H5Dopen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
- H5E_BEGIN_TRY { tmp_id = H5Topen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Topen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Topen2");
@@ -4481,19 +4610,31 @@ test_misc24(void)
type_id = H5Topen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Topen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Gopen2");
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
- H5E_BEGIN_TRY { tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ tmp_id = H5Dopen2(file_id, MISC24_DATATYPE_LINK, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(tmp_id, FAIL, "H5Dopen2");
@@ -5079,7 +5220,10 @@ test_misc27(void)
#ifdef H5_STRICT_FORMAT_CHECKS
/* Open group with incorrect # of object header messages (should fail) */
- H5E_BEGIN_TRY { gid = H5Gopen2(fid, MISC27_GROUP, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ gid = H5Gopen2(fid, MISC27_GROUP, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(gid, FAIL, "H5Gopen2");
#else /* H5_STRICT_FORMAT_CHECKS */
@@ -5132,7 +5276,7 @@ test_misc28(void)
* bytes). */
fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
- ret = H5Pset_cache(fapl, MISC28_NSLOTS, MISC28_NSLOTS, MISC28_SIZE, 0.75F);
+ ret = H5Pset_cache(fapl, MISC28_NSLOTS, MISC28_NSLOTS, MISC28_SIZE, 0.75);
CHECK(ret, FAIL, "H5Pset_cache");
/* Create the dcpl and set the chunk size */
@@ -5572,17 +5716,26 @@ test_misc33(void)
CHECK(fid, FAIL, "H5Fopen");
/* Case (1) */
- H5E_BEGIN_TRY { ret = H5Oget_info_by_name3(fid, "/soft_two", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oget_info_by_name3(fid, "/soft_two", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Oget_info_by_name3");
/* Case (2) */
- H5E_BEGIN_TRY { ret = H5Oget_info_by_name3(fid, "/dsetA", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oget_info_by_name3(fid, "/dsetA", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Oget_info_by_name3");
/* Case (3) */
- H5E_BEGIN_TRY { ret = H5Oget_info_by_name3(fid, "/soft_one", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Oget_info_by_name3(fid, "/soft_one", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Oget_info_by_name3");
diff --git a/test/trefer.c b/test/trefer.c
index 0d6ae75..9b6c415 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -832,7 +832,7 @@ test_reference_cmpnd_obj(void)
hsize_t cmpnd_dims[] = {1};
hid_t dapl_id; /* Dataset access property list */
unsigned * ibuf, *obuf;
- unsigned i, j; /* Counters */
+ unsigned i; /* Counter */
H5O_type_t obj_type; /* Object type */
herr_t ret; /* Generic return value */
s2_t cmpnd_wbuf, cmpnd_rbuf;
@@ -1358,7 +1358,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/*
* Dereference an undefined reference (should fail)
*/
- H5E_BEGIN_TRY { dset2 = H5Ropen_object(&rdata_NA[0], H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ dset2 = H5Ropen_object(&rdata_NA[0], H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object");
@@ -1368,7 +1371,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/* This close should fail since H5Ropen_object never created
* the id of the referenced object. */
- H5E_BEGIN_TRY { ret = H5Dclose(dset2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dclose(dset2);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dclose");
@@ -1520,7 +1526,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/* Attempting to retrieve type of object using non-valid refs */
for (j = 0; j < 3; j++) {
- H5E_BEGIN_TRY { ret = H5Rget_obj_type3(&nvrbuf[j], H5P_DEFAULT, &obj_type); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Rget_obj_type3(&nvrbuf[j], H5P_DEFAULT, &obj_type);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Rget_obj_type3");
} /* end for */
diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c
index 82f5b57..755df68 100644
--- a/test/trefer_deprec.c
+++ b/test/trefer_deprec.c
@@ -87,8 +87,11 @@ test_reference_params(void)
/* Allocate write & read buffers */
wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ CHECK_PTR(rbuf, "HDmalloc");
tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ CHECK_PTR(tbuf, "HDmalloc");
/* Create file */
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -269,8 +272,11 @@ test_reference_obj(void)
/* Allocate write & read buffers */
wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ CHECK_PTR(rbuf, "HDmalloc");
tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ CHECK_PTR(tbuf, "HDmalloc");
/* Create file */
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -456,7 +462,10 @@ test_reference_obj(void)
/* Attempting to retrieve type of object using non-valid refs */
for (j = 0; j < 3; j++) {
- H5E_BEGIN_TRY { ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &nvrbuf[j], &obj_type); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &nvrbuf[j], &obj_type);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Rget_obj_type2");
} /* end for */
@@ -653,7 +662,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
/* Store third dataset region */
- H5E_BEGIN_TRY { ret = H5Rcreate(&wbuf[2], fid1, "/Dataset2", H5R_DATASET_REGION, sid2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Rcreate(&wbuf[2], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
+ }
H5E_END_TRY;
if (libver_high < H5F_LIBVER_V110)
@@ -728,7 +740,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/*
* Dereference an undefined reference (should fail)
*/
- H5E_BEGIN_TRY { dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]); }
+ H5E_BEGIN_TRY
+ {
+ dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]);
+ }
H5E_END_TRY;
VERIFY(dset2, FAIL, "H5Rdereference2");
@@ -738,7 +753,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/* This close should fail since H5Rdereference2 never created
* the id of the referenced object. */
- H5E_BEGIN_TRY { ret = H5Dclose(dset2); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dclose(dset2);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dclose");
@@ -892,7 +910,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
/* Attempting to retrieve type of object using non-valid refs */
for (j = 0; j < 3; j++) {
- H5E_BEGIN_TRY { ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &nvrbuf[j], &obj_type); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &nvrbuf[j], &obj_type);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Rget_obj_type2");
} /* end for */
diff --git a/test/trefstr.c b/test/trefstr.c
index 74455da..d0575ab 100644
--- a/test/trefstr.c
+++ b/test/trefstr.c
@@ -186,7 +186,7 @@ test_refstr_cmp(void)
H5RS_str_t *rs1; /* Ref-counted string created */
H5RS_str_t *rs2; /* Ref-counted string created */
int cmp; /* Comparison value */
- ssize_t len; /* Length of string */
+ size_t len; /* Length of string */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -265,7 +265,9 @@ test_refstr_wrap(void)
/* Get pointer to raw string in ref-counted string */
s = H5RS_get_str(rs);
CHECK_PTR(s, "H5RS_get_str");
- CHECK(s, buf, "wrapping");
+ if (s == buf)
+ TestErrPrintf("%d: Should not have gotten the same pointer from reference-counted string!\n",
+ __LINE__);
cmp = HDstrcmp(s, buf);
if (cmp <= 0)
TestErrPrintf("%d: string comparison incorrect!\n", __LINE__);
@@ -375,7 +377,7 @@ test_refstr_acat(void)
/* Append a large string to ref-counted string */
large_str = HDmalloc(1024);
- CHECK(large_str, NULL, "HDmalloc");
+ CHECK_PTR(large_str, "HDmalloc");
HDmemset(large_str, 'a', 1024);
large_str[1023] = '\0';
ret = H5RS_acat(rs, large_str);
@@ -386,7 +388,7 @@ test_refstr_acat(void)
CHECK_PTR(s, "H5RS_get_str");
HDsprintf(buf, "%s", "foobar");
large_str2 = HDmalloc(1024 + 6);
- CHECK(large_str2, NULL, "HDmalloc");
+ CHECK_PTR(large_str2, "HDmalloc");
HDstrcpy(large_str2, "foobar");
HDmemset(&large_str2[6], 'a', 1024);
large_str2[1029] = '\0';
diff --git a/test/tselect.c b/test/tselect.c
index 8ecbf48..1bfb663 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -287,7 +287,10 @@ test_select_hyper(hid_t xfer_plist)
block[0] = 1;
block[1] = 1;
block[2] = 1;
- H5E_BEGIN_TRY { ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_hyperslab");
@@ -304,7 +307,10 @@ test_select_hyper(hid_t xfer_plist)
block[0] = 2;
block[1] = 2;
block[2] = 2;
- H5E_BEGIN_TRY { ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_hyperslab");
@@ -344,10 +350,16 @@ test_select_hyper(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dwrite");
/* Exercise checks for NULL buffer and valid selection */
- H5E_BEGIN_TRY { ret = H5Dwrite(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, NULL);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dwrite");
- H5E_BEGIN_TRY { ret = H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, xfer_plist, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, xfer_plist, NULL);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dwrite");
@@ -388,10 +400,16 @@ test_select_hyper(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Exercise checks for NULL buffer and valid selection */
- H5E_BEGIN_TRY { ret = H5Dread(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dread(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, NULL);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dread");
- H5E_BEGIN_TRY { ret = H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, xfer_plist, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, xfer_plist, NULL);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Dread");
@@ -1515,7 +1533,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12))
+ if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12) != 0)
TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__);
/* Close memory dataspace */
@@ -1658,7 +1676,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1))
+ if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1) != 0)
TestErrPrintf("Error: hyperslab values don't match!\n");
/* Close memory dataspace */
@@ -2561,7 +2579,7 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist)
static void
test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, unsigned tgt_n_cube_rank,
unsigned edge_size, unsigned checker_edge_size,
- unsigned sel_rank, hsize_t sel_start[])
+ unsigned sel_rank, const hsize_t sel_start[])
{
hbool_t first_selection = TRUE;
unsigned n_cube_offset;
@@ -3765,7 +3783,7 @@ test_select_hyper_copy(void)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2))
+ if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0)
TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__);
/* Close memory dataspace */
@@ -3978,7 +3996,7 @@ test_select_point_copy(void)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2))
+ if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0)
TestErrPrintf("point values don't match!\n");
/* Close memory dataspace */
@@ -5363,9 +5381,9 @@ test_select_hyper_union_3d(void)
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE3_DIM1 * SPACE3_DIM2);
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for (i = 0, tbuf = wbuf; i < SPACE4_DIM1; i++)
@@ -8166,14 +8184,20 @@ test_scalar_select2(void)
/* Select one element in memory with a point selection */
coord1[0] = 0;
- H5E_BEGIN_TRY { ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord1);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_elements");
/* Select one element in memory with a hyperslab selection */
start[0] = 0;
count[0] = 0;
- H5E_BEGIN_TRY { ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_hyperslab");
@@ -13835,7 +13859,10 @@ test_select_bounds(void)
CHECK(ret, FAIL, "H5Sselect_none");
/* Get bounds for 'none' selection */
- H5E_BEGIN_TRY { ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_select_bounds(sid, low_bounds, high_bounds);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_select_bo unds");
@@ -13866,7 +13893,10 @@ test_select_bounds(void)
CHECK(ret, FAIL, "H5Soffset_simple");
/* Get bounds for hyperslab selection with negative offset */
- H5E_BEGIN_TRY { ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_select_bounds(sid, low_bounds, high_bounds);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_select_bounds");
@@ -13917,7 +13947,10 @@ test_select_bounds(void)
CHECK(ret, FAIL, "H5Soffset_simple");
/* Get bounds for hyperslab selection with negative offset */
- H5E_BEGIN_TRY { ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_select_bounds(sid, low_bounds, high_bounds);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_select_bounds");
@@ -13968,7 +14001,10 @@ test_select_bounds(void)
CHECK(ret, FAIL, "H5Soffset_simple");
/* Get bounds for hyperslab selection with negative offset */
- H5E_BEGIN_TRY { ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_select_bounds(sid, low_bounds, high_bounds);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_select_bounds");
@@ -14030,12 +14066,18 @@ test_hyper_regular(void)
CHECK(sid, FAIL, "H5Screate_simple");
/* Query if 'all' selection is regular hyperslab (should fail) */
- H5E_BEGIN_TRY { is_regular = H5Sis_regular_hyperslab(sid); }
+ H5E_BEGIN_TRY
+ {
+ is_regular = H5Sis_regular_hyperslab(sid);
+ }
H5E_END_TRY;
VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
- H5E_BEGIN_TRY { ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
@@ -14044,12 +14086,18 @@ test_hyper_regular(void)
CHECK(ret, FAIL, "H5Sselect_none");
/* Query if 'none' selection is regular hyperslab (should fail) */
- H5E_BEGIN_TRY { is_regular = H5Sis_regular_hyperslab(sid); }
+ H5E_BEGIN_TRY
+ {
+ is_regular = H5Sis_regular_hyperslab(sid);
+ }
H5E_END_TRY;
VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
- H5E_BEGIN_TRY { ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
@@ -14070,12 +14118,18 @@ test_hyper_regular(void)
CHECK(ret, FAIL, "H5Sselect_elements");
/* Query if 'point' selection is regular hyperslab (should fail) */
- H5E_BEGIN_TRY { is_regular = H5Sis_regular_hyperslab(sid); }
+ H5E_BEGIN_TRY
+ {
+ is_regular = H5Sis_regular_hyperslab(sid);
+ }
H5E_END_TRY;
VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
- H5E_BEGIN_TRY { ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
@@ -14130,7 +14184,10 @@ test_hyper_regular(void)
VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
- H5E_BEGIN_TRY { ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
@@ -14220,18 +14277,18 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t enpoints, hssize_t enb
/* Verify blocklist */
if (nblocks == (hssize_t)1) {
- if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])))
+ if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
} /* end if */
else {
HDassert(nblocks == (hssize_t)2);
- if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0]))) {
- if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])))
+ if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) {
+ if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
- if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0])))
+ if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
} /* end if */
- else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0])))
+ else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
} /* end else */
} /* end if */
@@ -15108,10 +15165,16 @@ test_sel_iter(void)
CHECK(iter_id, FAIL, "H5Ssel_iter_create");
/* Try resetting selection iterator with bad parameters */
- H5E_BEGIN_TRY { ret = H5Ssel_iter_reset(H5I_INVALID_HID, sid); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Ssel_iter_reset(H5I_INVALID_HID, sid);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Ssel_iter_reset");
- H5E_BEGIN_TRY { ret = H5Ssel_iter_reset(iter_id, H5I_INVALID_HID); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Ssel_iter_reset(iter_id, H5I_INVALID_HID);
+ }
H5E_END_TRY;
VERIFY(ret, FAIL, "H5Ssel_iter_reset");
diff --git a/test/tsohm.c b/test/tsohm.c
index fcbb06a..b4ece0b 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -622,7 +622,7 @@ size1_helper(hid_t file, const char *filename, hid_t fapl_id, hbool_t test_file_
HDprintf("Can't read data\n"); \
goto error; \
} \
- if ((rdata.i1 != wdata.i1) || (rdata.i2 != wdata.i2) || HDstrcmp(rdata.str, wdata.str)) { \
+ if ((rdata.i1 != wdata.i1) || (rdata.i2 != wdata.i2) || HDstrcmp(rdata.str, wdata.str) != 0) { \
H5_FAILED(); \
AT(); \
HDprintf("incorrect read data\n"); \
diff --git a/test/ttsafe.c b/test/ttsafe.c
index 7b9a375..067a715 100644
--- a/test/ttsafe.c
+++ b/test/ttsafe.c
@@ -70,8 +70,6 @@ tts_is_threadsafe(void)
if (is_ts != should_be)
TestErrPrintf("Thread-safety value incorrect - test failed\n");
-
- return;
}
/* Routine to generate attribute names for numeric values */
diff --git a/test/ttst.c b/test/ttst.c
deleted file mode 100644
index 53aab5e..0000000
--- a/test/ttst.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- FILE
- tst.c
- Test HDF Ternary Search Tree (tst) routines.
-
- REMARKS
-
- DESIGN
-
- BUGS/LIMITATIONS
-
- EXPORTED ROUTINES
-
- AUTHOR
- Quincey Koziol
-
- MODIFICATION HISTORY
- 12/9/02 - Started coding
- */
-
-#include "testhdf5.h"
-#include "H5STprivate.h"
-
-/* Test words to insert into s TST */
-static const char *words[] = {
- "We", "hold", "these", "truths", "to", "be", "self-evident,",
- "that", "all", "men", "are", "created", "equal,", "that",
- "they", "are", "endowed", "by", "their", "Creator", "with",
- "certain", "unalienable", "Rights,", "that", "among", "these", "are",
- "Life,", "Liberty", "and", "the", "pursuit", "of", "Happiness."};
-/* Number of words in test words set */
-size_t num_words;
-
-/* Number of unique words in test word set */
-size_t num_uniq_words;
-/* Unique words in test word set */
-char **uniq_words;
-/* Randomized order version of words in test word set */
-char **rand_uniq_words;
-/* Sorted order version of words in test word set */
-char **sort_uniq_words;
-
-static int
-tst_strcmp(const void *_s1, const void *_s2)
-{
- return (HDstrcmp(*(const char *const *)_s1, *(const char *const *)_s2));
-}
-
-/****************************************************************
-**
-** test_tst_init(): Test basic H5ST (ternary search tree) selection code.
-** Initialize data for TST testing
-**
-****************************************************************/
-static void
-test_tst_init(void)
-{
- time_t curr_time; /* Current time, for seeding random number generator */
- char * tmp_word; /* Temporary pointer to word in word set */
- size_t u, v, w; /* Local index variables */
-
- /* Compute the number of words in the test set */
- num_words = sizeof(words) / sizeof(words[0]);
-
- /* Determine the number of unique words in test set */
- /* (Not particularly efficient, be careful if many words are added to set) */
- num_uniq_words = 0;
- for (u = 0; u < num_words; u++) {
- /* Assume word is unique */
- num_uniq_words++;
- for (v = 0; v < u; v++)
- /* If word is already found in words looked at, decrement unique count */
- if (!HDstrcmp(words[u], words[v])) {
- num_uniq_words--;
- break;
- } /* end if */
- } /* end for */
-
- /* Allocate space for the array of unique words */
- uniq_words = (char **)HDmalloc(sizeof(char *) * num_uniq_words);
-
- /* Allocate space for the array of randomized order unique words also */
- rand_uniq_words = (char **)HDmalloc(sizeof(char *) * num_uniq_words);
-
- /* Allocate space for the array of sorted order unique words also */
- sort_uniq_words = (char **)HDmalloc(sizeof(char *) * num_uniq_words);
-
- /* Insert unique words from test set into unique word set */
- w = 0;
- for (u = 0; u < num_words; u++) {
- /* Assume word is unique */
- tmp_word = (char *)words[u];
- for (v = 0; v < u; v++)
- /* If word is already found in words looked at, decrement unique count */
- if (!HDstrcmp(words[u], words[v])) {
- tmp_word = NULL;
- break;
- } /* end if */
-
- /* Check if word was actually unique */
- if (tmp_word != NULL)
- uniq_words[w++] = tmp_word;
- } /* end for */
-
- /* Create randomized set of unique words */
- for (u = 0; u < num_uniq_words; u++)
- rand_uniq_words[u] = uniq_words[u];
- curr_time = HDtime(NULL);
- HDsrandom((unsigned)curr_time);
- for (u = 0; u < num_uniq_words; u++) {
- v = u + ((size_t)HDrandom() % (num_uniq_words - u));
- if (u != v) {
- tmp_word = rand_uniq_words[u];
- rand_uniq_words[u] = rand_uniq_words[v];
- rand_uniq_words[v] = tmp_word;
- } /* end if */
- } /* end for */
-
- /* Create sorted set of unique words */
- for (u = 0; u < num_uniq_words; u++)
- sort_uniq_words[u] = uniq_words[u];
- HDqsort(sort_uniq_words, num_uniq_words, sizeof(char *), tst_strcmp);
-} /* end test_tst_init() */
-
-/****************************************************************
-**
-** test_tst_create(): Test basic H5ST (ternary search tree) selection code.
-** Tests creating and closing TSTs.
-**
-****************************************************************/
-static void
-test_tst_create(void)
-{
- H5ST_tree_t *tree; /* TST created */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Creating & Closing TSTs\n"));
-
- /* Try closing a NULL tree */
- tree = NULL;
- ret = H5ST_close(tree);
- VERIFY(ret, FAIL, "H5ST_close");
-
- /* Try creating a TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Try closing a real tree */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-
-} /* end test_tst_create() */
-
-/****************************************************************
-**
-** test_tst_insert(): Test basic H5ST (ternary search tree) selection code.
-** Tests inserting key/value pairs into TST
-**
-****************************************************************/
-static void
-test_tst_insert(void)
-{
- H5ST_tree_t *tree; /* TST created */
- H5ST_ptr_t found; /* Pointer to TST node found */
- void * obj; /* Pointer to object located in TST */
- size_t u; /* Local index counter */
- htri_t check; /* Is string in TST? */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Inserting Values into TSTs\n"));
-
- /* Create the TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Verify that all words were inserted into TST properly */
- for (u = 0; u < num_uniq_words; u++) {
- /* Check that the word is present */
- check = H5ST_search(tree, uniq_words[u]);
- VERIFY(check, TRUE, "H5ST_search");
-
- /* Check that the value "payloads" are correct */
- found = H5ST_find(tree, uniq_words[u]);
- CHECK_PTR(found, "H5ST_find");
-
- if (HDstrcmp((const char *)found->eqkid, uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n", __LINE__,
- (char *)found->eqkid, (unsigned)u, uniq_words[u]);
-
- obj = H5ST_locate(tree, uniq_words[u]);
- CHECK_PTR(obj, "H5ST_locate");
-
- if (HDstrcmp((const char *)obj, uniq_words[u]))
- TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n", __LINE__, (char *)obj,
- (unsigned)u, uniq_words[u]);
- } /* end for */
-
- /* Verify that words not in the TST aren't found */
- check = H5ST_search(tree, "foo");
- VERIFY(check, FALSE, "H5ST_search");
- check = H5ST_search(tree, "bar");
- VERIFY(check, FALSE, "H5ST_search");
- check = H5ST_search(tree, "baz");
- VERIFY(check, FALSE, "H5ST_search");
-
- /* Close the TST */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-} /* end test_tst_insert() */
-
-/****************************************************************
-**
-** test_tst_iterate(): Test basic H5ST (ternary search tree) code.
-** Tests iterating through key/value pairs in TST
-**
-****************************************************************/
-static void
-test_tst_iterate(void)
-{
- H5ST_tree_t *tree; /* TST created */
- H5ST_ptr_t found; /* Pointer to TST node found */
- size_t u; /* Local index counter */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Iterating Over TSTs\n"));
-
- /* Create the TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Use findfirst/findnext calls to iterate through TST */
- found = H5ST_findfirst(tree);
- CHECK_PTR(found, "H5ST_findfirst");
- u = 0;
- do {
- /* Check that the strings in the TST are in the correct order */
- if (HDstrcmp((const char *)found->eqkid, sort_uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, sort_uniq_words[%u]=%s\n",
- __LINE__, (char *)found->eqkid, (unsigned)u, sort_uniq_words[u]);
-
- /* Advance to next string in TST */
- found = H5ST_findnext(found);
- u++;
- } while (found != NULL);
-
- /* Close the TST */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-} /* end test_tst_iterate() */
-
-/****************************************************************
-**
-** test_tst_remove(): Test basic H5ST (ternary search tree) code.
-** Tests removing key/value pairs by string value in TST
-**
-****************************************************************/
-static void
-test_tst_remove(void)
-{
- H5ST_tree_t *tree; /* TST created */
- H5ST_ptr_t found; /* Pointer to TST node found */
- void * obj; /* Pointer to object removed from TST */
- htri_t check; /* Is string in TST? */
- size_t u; /* Local index counter */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Removing String Values from TSTs\n"));
-
- /* Create the TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Remove strings from TST in random order */
- for (u = 0; u < num_uniq_words; u++) {
- obj = H5ST_remove(tree, rand_uniq_words[u]);
- CHECK_PTR(obj, "H5ST_remove");
-
- /* Check that the correct string was removed from TST */
- if (HDstrcmp((const char *)obj, rand_uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, obj=%s, rand_uniq_words[%u]=%s\n", __LINE__,
- (char *)obj, (unsigned)u, rand_uniq_words[u]);
-
- /* Check that the string can't be found in the TST any longer */
- check = H5ST_search(tree, rand_uniq_words[u]);
- VERIFY(check, FALSE, "H5ST_search");
- } /* end for */
-
- /* Re-insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Remove TST nodes from TST in random order */
- for (u = 0; u < num_uniq_words; u++) {
- /* Get the pointer to the node to delete */
- found = H5ST_find(tree, rand_uniq_words[u]);
- CHECK_PTR(found, "H5ST_find");
-
- /* Check that the correct object will be removed from TST */
- if (HDstrcmp((const char *)found->eqkid, rand_uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, rand_uniq_words[%u]=%s\n",
- __LINE__, (char *)found->eqkid, (unsigned)u, rand_uniq_words[u]);
-
- /* Remove the node */
- ret = H5ST_delete(tree, found);
- CHECK(ret, FAIL, "H5ST_delete");
-
- /* Check that the string can't be found in the TST any longer */
- check = H5ST_search(tree, rand_uniq_words[u]);
- VERIFY(check, FALSE, "H5ST_search");
- } /* end for */
-
- /* Close the TST */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-} /* end test_tst_remove() */
-
-/****************************************************************
-**
-** test_tst_finalize(): Test basic H5ST (ternary search tree) selection code.
-** Wrap up data for TST testing
-**
-****************************************************************/
-static void
-test_tst_finalize(void)
-{
- /* Release memory for unordered, randomized and sorted order unique words */
- HDfree(uniq_words);
- HDfree(rand_uniq_words);
- HDfree(sort_uniq_words);
-} /* end test_tst_finalize() */
-
-/****************************************************************
-**
-** test_tst(): Main H5ST selection testing routine.
-**
-****************************************************************/
-void
-test_tst(void)
-{
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Ternary Search Trees\n"));
-
- /* Initialize TST testing data */
- test_tst_init();
-
- /* Actual TST tests */
- test_tst_create(); /* Test TST creation */
- test_tst_insert(); /* Test TST insertion */
- test_tst_iterate(); /* Test TST iteration */
- test_tst_remove(); /* Test TST deletion */
-
- /* Finalize TST testing data */
- test_tst_finalize();
-} /* end test_tst() */
diff --git a/test/tunicode.c b/test/tunicode.c
index 52341bb..1b696ac 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -33,7 +33,7 @@
#define RANK 1
#define COMP_INT_VAL 7
-#define COMP_FLOAT_VAL -42.0F
+#define COMP_FLOAT_VAL (-42.0F)
#define COMP_DOUBLE_VAL 42.0F
/* Test function prototypes */
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 77b55a3..7e47c7b 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -659,8 +659,6 @@ test_write_vl_string_attribute(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
}
/****************************************************************
@@ -739,8 +737,6 @@ test_read_vl_string_attribute(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
}
/* Helper routine for test_vl_rewrite() */
@@ -777,7 +773,7 @@ read_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, char *data)
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
- if (HDstrcmp(data, data_read))
+ if (HDstrcmp(data, data_read) != 0)
TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read);
ret = H5Treclaim(type, space, H5P_DEFAULT, &data_read);
@@ -864,8 +860,6 @@ test_vl_rewrite(void)
ret = H5Fclose(file2);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
} /* end test_vl_rewrite() */
/****************************************************************
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 8e2ab4a..03a8ad3 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -136,7 +136,10 @@ test_vltypes_dataset_create(void)
CHECK(ret, FAIL, "H5Pset_fill_time");
/* Create a dataset, supposed to fail */
- H5E_BEGIN_TRY { dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ }
H5E_END_TRY;
VERIFY(dataset, FAIL, "H5Dcreate2");
@@ -202,11 +205,17 @@ test_vltypes_funcs(void)
ret = H5Tset_offset(type, (size_t)16);
CHECK(ret, FAIL, "H5Tset_offset");
- H5E_BEGIN_TRY { cset = H5Tget_cset(type); }
+ H5E_BEGIN_TRY
+ {
+ cset = H5Tget_cset(type);
+ }
H5E_END_TRY;
VERIFY(cset, FAIL, "H5Tget_cset");
- H5E_BEGIN_TRY { strpad = H5Tget_strpad(type); }
+ H5E_BEGIN_TRY
+ {
+ strpad = H5Tget_strpad(type);
+ }
H5E_END_TRY;
VERIFY(strpad, FAIL, "H5Tget_strpad");
@@ -476,7 +485,10 @@ test_vltypes_vlen_atomic(void)
VERIFY(size, ((SPACE1_DIM1 * (SPACE1_DIM1 + 1)) / 2) * sizeof(unsigned int), "H5Dvlen_get_buf_size");
/* Try to call H5Dvlen_get_buf with bad dataspace */
- H5E_BEGIN_TRY { ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_get_buf_size");
@@ -507,7 +519,10 @@ test_vltypes_vlen_atomic(void)
/* Try to reclaim read data using "bad" dataspace with no extent
* Should fail */
- H5E_BEGIN_TRY { ret = H5Treclaim(tid1, sid2, xfer_pid, rdata); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Treclaim(tid1, sid2, xfer_pid, rdata);
+ }
H5E_END_TRY
VERIFY(ret, FAIL, "H5Treclaim");
@@ -1370,7 +1385,7 @@ test_vltypes_compound_vlstr(void)
for (t1 = (s2 *)(wdata[i].v.p), t2 = (s2 *)(rdata[i].v.p), j = 0; j < rdata[i].v.len;
j++, t1++, t2++) {
- if (HDstrcmp(t1->string, t2->string)) {
+ if (HDstrcmp(t1->string, t2->string) != 0) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string,
t2->string);
continue;
@@ -1431,7 +1446,7 @@ test_vltypes_compound_vlstr(void)
for (t1 = (s2 *)(wdata2[i].v.p), t2 = (s2 *)(rdata2[i].v.p), j = 0; j < rdata2[i].v.len;
j++, t1++, t2++) {
- if (HDstrcmp(t1->string, t2->string)) {
+ if (HDstrcmp(t1->string, t2->string) != 0) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string,
t2->string);
continue;
@@ -2493,8 +2508,8 @@ test_vltypes_fill_value(void)
hid_t large_dspace_id; /* Dataspace ID for large datasets */
hid_t small_select_dspace_id; /* Dataspace ID for selection in small datasets */
hid_t large_select_dspace_id; /* Dataspace ID for selection in large datasets */
- hid_t dset_dspace_id; /* Dataspace ID for a particular dataset */
- hid_t dset_select_dspace_id; /* Dataspace ID for selection in a particular dataset */
+ hid_t dset_dspace_id = -1; /* Dataspace ID for a particular dataset */
+ hid_t dset_select_dspace_id = -1; /* Dataspace ID for selection in a particular dataset */
hid_t scalar_dspace_id; /* Dataspace ID for scalar dataspace */
hid_t single_dspace_id; /* Dataspace ID for single element selection */
hsize_t single_offset[] = {2}; /* Offset of single element selection */
@@ -2510,11 +2525,11 @@ test_vltypes_fill_value(void)
hid_t dset_id;
hsize_t small_dims[] = {SPACE4_DIM_SMALL};
hsize_t large_dims[] = {SPACE4_DIM_LARGE};
- size_t dset_elmts; /* Number of elements in a particular dataset */
- const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead",
- 3, 4.0F, 100.0F, 1.0F, "liquid", "meter"};
- const dtype1_struct wdata = {3, 4, "", NULL, "\0", "foo", "two", 6, 8.0F, 200.0F, 2.0F, "solid", "yard"};
- dtype1_struct * rbuf = NULL; /* Buffer for reading data */
+ size_t dset_elmts = 0; /* Number of elements in a particular dataset */
+ const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead",
+ 3, 4.0, 100.0, 1.0, "liquid", "meter"};
+ const dtype1_struct wdata = {3, 4, "", NULL, "\0", "foo", "two", 6, 8.0, 200.0, 2.0, "solid", "yard"};
+ dtype1_struct * rbuf = NULL; /* Buffer for reading data */
size_t mem_used = 0; /* Memory used during allocation */
H5D_layout_t layout; /* Dataset storage layout */
char dset_name1[64], dset_name2[64]; /* Dataset names */
@@ -2804,10 +2819,10 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -2827,10 +2842,11 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -2861,10 +2877,10 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -2884,10 +2900,11 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3002,21 +3019,22 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3037,22 +3055,23 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3088,21 +3107,22 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3123,22 +3143,23 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
diff --git a/test/twriteorder.c b/test/twriteorder.c
index 9f4fee1..e792487 100644
--- a/test/twriteorder.c
+++ b/test/twriteorder.c
@@ -61,11 +61,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#define DATAFILE "twriteorder.dat"
/* #define READERS_MAX 10 */ /* max number of readers */
@@ -468,7 +466,7 @@ done:
return ret_value;
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -477,4 +475,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/unlink.c b/test/unlink.c
index 3357e1c..94bd035 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -117,7 +117,10 @@ test_one(hid_t file)
TESTING("unlink without a name");
if ((grp = H5Gcreate2(work, "foo", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- H5E_BEGIN_TRY { status = H5Ldelete(grp, ".", H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Ldelete(grp, ".", H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0)
FAIL_PUTS_ERROR(" Unlinking object w/o a name should have failed.")
@@ -287,7 +290,10 @@ test_symlink(hid_t file)
return 0;
error:
- H5E_BEGIN_TRY { H5Gclose(work); }
+ H5E_BEGIN_TRY
+ {
+ H5Gclose(work);
+ }
H5E_END_TRY;
return 1;
} /* end test_symlink() */
@@ -510,7 +516,7 @@ check_new_move(hid_t fapl)
/* Check soft links */
if (H5Lget_val(file, "group2/soft", linkval, sizeof(linkval), H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(linkval, "/group1/group_move"))
+ if (HDstrcmp(linkval, "/group1/group_move") != 0)
FAIL_PUTS_ERROR(" Soft link test failed. Wrong link value")
/* Cleanup */
@@ -1288,7 +1294,10 @@ test_filespace(hid_t fapl)
FAIL_STACK_ERROR
/* Create another group with same name */
- H5E_BEGIN_TRY { group = H5Gcreate2(file, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ group = H5Gcreate2(file, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (group >= 0) {
H5Gclose(group);
@@ -1335,7 +1344,10 @@ test_filespace(hid_t fapl)
FAIL_STACK_ERROR
/* Create another named datatype with same name */
- H5E_BEGIN_TRY { status = H5Tcommit2(file, TYPENAME, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ status = H5Tcommit2(file, TYPENAME, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (status >= 0)
TEST_ERROR
@@ -1789,12 +1801,18 @@ error:
/* Close any open groups */
for (n = 0; n < ngroups; n++)
if (gids[n]) {
- H5E_BEGIN_TRY { H5Gclose(gids[n]); }
+ H5E_BEGIN_TRY
+ {
+ H5Gclose(gids[n]);
+ }
H5E_END_TRY;
} /* end if */
HDfree(gids);
} /* end if */
- H5E_BEGIN_TRY { H5Gclose(rootid); }
+ H5E_BEGIN_TRY
+ {
+ H5Gclose(rootid);
+ }
H5E_END_TRY;
return 1;
@@ -1875,12 +1893,18 @@ error:
/* Close any open groups */
for (n = 0; n < ngroups; n++)
if (gids[n]) {
- H5E_BEGIN_TRY { H5Gclose(gids[n]); }
+ H5E_BEGIN_TRY
+ {
+ H5Gclose(gids[n]);
+ }
H5E_END_TRY;
} /* end if */
HDfree(gids);
} /* end if */
- H5E_BEGIN_TRY { H5Gclose(rootid); }
+ H5E_BEGIN_TRY
+ {
+ H5Gclose(rootid);
+ }
H5E_END_TRY;
return 1;
@@ -2247,12 +2271,18 @@ error:
/* Close any open groups */
for (n = 0; n < ngroups; n++)
if (gids[n]) {
- H5E_BEGIN_TRY { H5Gclose(gids[n]); }
+ H5E_BEGIN_TRY
+ {
+ H5Gclose(gids[n]);
+ }
H5E_END_TRY;
} /* end if */
HDfree(gids);
} /* end if */
- H5E_BEGIN_TRY { H5Gclose(rootid); }
+ H5E_BEGIN_TRY
+ {
+ H5Gclose(rootid);
+ }
H5E_END_TRY;
return 1;
diff --git a/test/unregister.c b/test/unregister.c
index 48b29c8..803f8373 100644
--- a/test/unregister.c
+++ b/test/unregister.c
@@ -148,7 +148,10 @@ test_unregister_filters(hid_t fapl_id)
goto error;
/* Unregister the filter before closing the group. It should fail */
- H5E_BEGIN_TRY { ret = H5Zunregister(H5Z_FILTER_DUMMY); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Zunregister(H5Z_FILTER_DUMMY);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
@@ -196,7 +199,10 @@ test_unregister_filters(hid_t fapl_id)
goto error;
/* Unregister the filter before closing the dataset. It should fail */
- H5E_BEGIN_TRY { ret = H5Zunregister(H5Z_FILTER_DUMMY); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Zunregister(H5Z_FILTER_DUMMY);
+ }
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c
index 3699a56..107615a 100644
--- a/test/use_append_chunk.c
+++ b/test/use_append_chunk.c
@@ -61,11 +61,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -272,7 +270,7 @@ done:
return (ret_value);
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -281,4 +279,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c
index 59a7732..b19c510 100644
--- a/test/use_append_chunk_mirror.c
+++ b/test/use_append_chunk_mirror.c
@@ -91,11 +91,9 @@
#include "use.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#ifdef H5_HAVE_MIRROR_VFD
@@ -391,7 +389,7 @@ main(void)
#endif /* H5_HAVE_MIRROR_VFD */
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -400,4 +398,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 7c1971b..47c9f92 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -53,11 +53,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -267,7 +265,7 @@ done:
return (ret_value);
} /* end main() */
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -276,4 +274,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_common.c b/test/use_common.c
index 4a878c7..8f78f3b 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -13,11 +13,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -324,10 +322,12 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK) {
HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
+ HDfree(buffer);
return -1;
}
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) {
HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ HDfree(buffer);
return -1;
}
HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n", rank, (unsigned long long)(dims[0]),
@@ -336,12 +336,14 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]) {
HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", (unsigned long long)dims[0],
(unsigned long long)dims[1], (unsigned long long)dims[2]);
+ HDfree(buffer);
return -1;
}
/* setup mem-space for buffer */
if ((m_sid = H5Screate_simple(rank, memdims, NULL)) < 0) {
HDfprintf(stderr, "H5Screate_simple for memory failed\n");
+ HDfree(buffer);
return -1;
}
@@ -362,6 +364,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
if (opts->use_swmr) {
if (H5Odisable_mdc_flushes(dsid) < 0) {
HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n");
+ HDfree(buffer);
return -1;
}
}
@@ -370,12 +373,14 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
dims[0] = i + 1;
if (H5Dset_extent(dsid, dims) < 0) {
HDfprintf(stderr, "H5Dset_extent failed\n");
+ HDfree(buffer);
return -1;
}
/* Get the dataset's dataspace */
if ((f_sid = H5Dget_space(dsid)) < 0) {
HDfprintf(stderr, "H5Dset_extent failed\n");
+ HDfree(buffer);
return -1;
}
@@ -383,12 +388,14 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
/* Choose the next plane to write */
if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) {
HDfprintf(stderr, "Failed H5Sselect_hyperslab\n");
+ HDfree(buffer);
return -1;
}
/* Write plane to the dataset */
if (H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0) {
HDfprintf(stderr, "Failed H5Dwrite\n");
+ HDfree(buffer);
return -1;
}
@@ -396,6 +403,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
if (opts->use_swmr) {
if (H5Oenable_mdc_flushes(dsid) < 0) {
HDfprintf(stderr, "H5Oenable_mdc_flushes failed\n");
+ HDfree(buffer);
return -1;
}
}
@@ -403,6 +411,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
/* flush file to make the just written plane available. */
if (H5Dflush(dsid) < 0) {
HDfprintf(stderr, "Failed to H5Fflush file\n");
+ HDfree(buffer);
return -1;
}
} /* end for each plane to write */
@@ -490,10 +499,12 @@ read_uc_file(hbool_t towait, options_t *opts)
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK) {
HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
+ HDfree(buffer);
return -1;
}
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) {
HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ HDfree(buffer);
return -1;
}
HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n", rank, (unsigned long long)(dims[0]),
@@ -504,12 +515,14 @@ read_uc_file(hbool_t towait, options_t *opts)
(unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]);
HDfprintf(stderr, "But memdims=(%llu,%llu,%llu)\n", (unsigned long long)memdims[0],
(unsigned long long)memdims[1], (unsigned long long)memdims[2]);
+ HDfree(buffer);
return -1;
}
/* Setup mem-space for buffer */
if ((m_sid = H5Screate_simple(rank, memdims, NULL)) < 0) {
HDfprintf(stderr, "H5Screate_simple for memory failed\n");
+ HDfree(buffer);
return -1;
}
@@ -535,6 +548,7 @@ read_uc_file(hbool_t towait, options_t *opts)
HDprintf(".");
if (loops_waiting_for_plane >= 30) {
HDfprintf(stderr, "waited too long for new plane, quit.\n");
+ HDfree(buffer);
return -1;
}
}
@@ -552,6 +566,7 @@ read_uc_file(hbool_t towait, options_t *opts)
/* Get the dataset's dataspace */
if ((f_sid = H5Dget_space(dsid)) < 0) {
HDfprintf(stderr, "H5Dget_space failed\n");
+ HDfree(buffer);
return -1;
}
@@ -559,12 +574,14 @@ read_uc_file(hbool_t towait, options_t *opts)
/* Choose the next plane to read */
if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) {
HDfprintf(stderr, "H5Sselect_hyperslab failed\n");
+ HDfree(buffer);
return -1;
}
/* Read the plane from the dataset */
if (H5Dread(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0) {
HDfprintf(stderr, "H5Dread failed\n");
+ HDfree(buffer);
return -1;
}
@@ -596,12 +613,14 @@ read_uc_file(hbool_t towait, options_t *opts)
f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) {
HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
+ HDfree(buffer);
return -1;
}
} /* end while (expecting more planes to read) */
if (H5Fclose(fid) < 0) {
HDfprintf(stderr, "H5Fclose failed\n");
+ HDfree(buffer);
return -1;
}
@@ -613,4 +632,4 @@ read_uc_file(hbool_t towait, options_t *opts)
return 0;
} /* end read_uc_file() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index 1f2976f..f28e574 100644
--- a/test/use_disable_mdc_flushes.c
+++ b/test/use_disable_mdc_flushes.c
@@ -18,11 +18,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
@@ -539,7 +537,7 @@ done:
return (ret_value);
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -548,4 +546,4 @@ main(void)
HDexit(EXIT_SUCCESS);
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/vds.c b/test/vds.c
index 66e512e..ac9bb5d 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -78,12 +78,12 @@ char vds_test_str_g[128] = "";
#endif /* VDS_TEST_VERBOSE */
/* I/O test config flags */
-#define TEST_IO_CLOSE_SRC 0x01u
-#define TEST_IO_DIFFERENT_FILE 0x02u
-#define TEST_IO_REOPEN_VIRT 0x04u
-#define TEST_IO_FCLOSE_SEMI 0x08u
-#define TEST_IO_FCLOSE_STRONG 0x10u
-#define TEST_IO_NTESTS 0x20u
+#define TEST_IO_CLOSE_SRC 0x01U
+#define TEST_IO_DIFFERENT_FILE 0x02U
+#define TEST_IO_REOPEN_VIRT 0x04U
+#define TEST_IO_FCLOSE_SEMI 0x08U
+#define TEST_IO_FCLOSE_STRONG 0x10U
+#define TEST_IO_NTESTS 0x20U
#define LIST_DOUBLE_SIZE (H5D_VIRTUAL_DEF_LIST_SIZE + 1)
@@ -323,7 +323,10 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, const char
return 0;
error:
- H5E_BEGIN_TRY { H5Sclose(space_out); }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(space_out);
+ }
H5E_END_TRY
return -1;
@@ -999,7 +1002,10 @@ test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low)
TEST_ERROR
/* Attempt to add virtual layout mapping */
- H5E_BEGIN_TRY { ret = H5Pset_virtual(dcpl, vspace[0], src_file[0], src_dset[0], srcspace[0]); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_virtual(dcpl, vspace[0], src_file[0], src_dset[0], srcspace[0]);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR
@@ -3549,7 +3555,10 @@ test_basic_io(unsigned config, hid_t vds_fapl, hid_t src_fapl)
count[1] = 9;
if (H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
TEST_ERROR_SUPPRESSED
- H5E_BEGIN_TRY { ret = H5Dwrite(vdset, H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(vdset, H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]);
+ }
H5E_END_TRY
if (ret >= 0)
TEST_ERROR_SUPPRESSED
diff --git a/test/vfd.c b/test/vfd.c
index 217f967..bcd1629 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -48,20 +48,22 @@
#define DSET2_DIM 4
#endif /* H5_HAVE_DIRECT */
-const char *FILENAME[] = {"sec2_file", /*0*/
- "core_file", /*1*/
- "family_file", /*2*/
- "new_family_v16_", /*3*/
- "multi_file", /*4*/
- "direct_file", /*5*/
- "log_file", /*6*/
- "stdio_file", /*7*/
- "windows_file", /*8*/
- "new_multi_file_v16", /*9*/
- "ro_s3_file", /*10*/
- "splitter_rw_file", /*11*/
- "splitter_wo_file", /*12*/
- "splitter.log", /*13*/
+const char *FILENAME[] = {"sec2_file", /*0*/
+ "core_file", /*1*/
+ "family_file", /*2*/
+ "new_family_v16_", /*3*/
+ "multi_file", /*4*/
+ "direct_file", /*5*/
+ "log_file", /*6*/
+ "stdio_file", /*7*/
+ "windows_file", /*8*/
+ "new_multi_file_v16", /*9*/
+ "ro_s3_file", /*10*/
+ "splitter_rw_file", /*11*/
+ "splitter_wo_file", /*12*/
+ "splitter.log", /*13*/
+ "ctl_file", /*14*/
+ "ctl_splitter_wo_file", /*15*/
NULL};
#define LOG_FILENAME "log_vfd_out.log"
@@ -148,16 +150,36 @@ struct splitter_dataset_def {
int n_dims; /* rank */
};
+/* Op code type enum for ctl callback test */
+typedef enum {
+ CTL_OPC_KNOWN_PASSTHROUGH, /* op code known to passthrough VFD */
+ CTL_OPC_KNOWN_TERMINAL, /* op code known to terminal VFD */
+ CTL_OPC_UNKNOWN /* unknown op code */
+} ctl_test_opc_type;
+
static int splitter_prepare_file_paths(H5FD_splitter_vfd_config_t *vfd_config, char *filename_rw_out);
static int splitter_create_single_file_at(const char *filename, hid_t fapl_id,
const struct splitter_dataset_def *data);
static int splitter_compare_expected_data(hid_t file_id, const struct splitter_dataset_def *data);
static int run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_errors,
- hbool_t provide_logfile_path, hid_t sub_fapl_ids[2]);
+ hbool_t provide_logfile_path, const hid_t sub_fapl_ids[2]);
static int splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id);
static int splitter_tentative_open_test(hid_t child_fapl_id);
static int file_exists(const char *filename, hid_t fapl_id);
+static herr_t run_ctl_test(uint64_t op_code, uint64_t flags, ctl_test_opc_type opc_type, hid_t fapl_id);
+static H5FD_t *H5FD__ctl_test_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__ctl_test_vfd_close(H5FD_t *_file);
+static haddr_t H5FD__ctl_test_vfd_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ctl_test_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__ctl_test_vfd_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ctl_test_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, void *buf);
+static herr_t H5FD__ctl_test_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+ size_t size, const void *buf);
+static herr_t H5FD__ctl_test_vfd_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *input,
+ void **output);
+
/*-------------------------------------------------------------------------
* Function: test_sec2
*
@@ -394,7 +416,7 @@ test_core(void)
if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
- /* Retrieve the access property list... */
+ /* Retrieve the access property list */
if ((fapl_id_out = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -607,6 +629,38 @@ test_core(void)
TEST_ERROR;
h5_delete_test_file(FILENAME[1], fapl_id);
+ /************************************************************************
+ * Check that delete behavior works correctly
+ ************************************************************************/
+
+ /* Create and close a file */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, TRUE) < 0)
+ TEST_ERROR;
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* Try to delete the file with the backing store off (shouldn't delete anything) */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, FALSE) < 0)
+ TEST_ERROR;
+ if (H5Fdelete(filename, fapl_id) < 0)
+ TEST_ERROR;
+ if (-1 == HDaccess(filename, F_OK))
+ FAIL_PUTS_ERROR("file deleted when backing store set to FALSE");
+
+ /* Try to delete the file with the backing store on (should work) */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, TRUE) < 0)
+ TEST_ERROR;
+ if (H5Fdelete(filename, fapl_id) < 0)
+ TEST_ERROR;
+ if (0 == HDaccess(filename, F_OK))
+ FAIL_PUTS_ERROR("file not deleted when backing store set to TRUE");
+
+ /************************************************************************
+ * Clean up
+ ************************************************************************/
+
/* Close the fapl */
if (H5Pclose(fapl_id) < 0)
TEST_ERROR;
@@ -690,7 +744,10 @@ test_direct(void)
if (H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0)
TEST_ERROR;
- H5E_BEGIN_TRY { file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ }
H5E_END_TRY;
if (file < 0) {
H5Pclose(fapl);
@@ -878,7 +935,7 @@ error:
* 'first_name' in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static herr_t
test_family_opens(char *fname, hid_t fa_pl)
{
@@ -890,13 +947,19 @@ test_family_opens(char *fname, hid_t fa_pl)
/* Case 1: reopen file with 1st member file name and default property list */
HDsnprintf(first_name, sizeof(first_name), fname, 0);
- H5E_BEGIN_TRY { file = H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (file >= 0)
TEST_ERROR
/* Case 2: reopen file with correct name template but default property list */
- H5E_BEGIN_TRY { file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (file >= 0)
TEST_ERROR
@@ -905,7 +968,10 @@ test_family_opens(char *fname, hid_t fa_pl)
if (H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT) < 0)
TEST_ERROR;
- H5E_BEGIN_TRY { file = H5Fopen(fname, H5F_ACC_RDWR, fa_pl); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(fname, H5F_ACC_RDWR, fa_pl);
+ }
H5E_END_TRY;
if (file >= 0)
TEST_ERROR
@@ -921,7 +987,10 @@ test_family_opens(char *fname, hid_t fa_pl)
if (H5Pset_fapl_family(fa_pl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- H5E_BEGIN_TRY { file = H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(wrong_name, H5F_ACC_RDWR, fa_pl);
+ }
H5E_END_TRY;
if (file >= 0)
TEST_ERROR
@@ -931,7 +1000,7 @@ test_family_opens(char *fname, hid_t fa_pl)
error:
return -1;
} /* end test_family_opens() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: test_family
@@ -1157,7 +1226,7 @@ error:
* 'newname_individual', etc. in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static herr_t
test_family_compat(void)
{
@@ -1243,7 +1312,7 @@ error:
return -1;
} /* end test_family_compat() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: test_family_member_fapl
@@ -1383,7 +1452,7 @@ error:
* 'sf_name' in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
+H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
static herr_t
test_multi_opens(char *fname)
{
@@ -1395,12 +1464,15 @@ test_multi_opens(char *fname)
HDsnprintf(super_name, sizeof(super_name), "%%s-%c.h5", 's');
HDsnprintf(sf_name, sizeof(sf_name), super_name, fname);
- H5E_BEGIN_TRY { fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
+ }
H5E_END_TRY;
return (fid >= 0 ? FAIL : SUCCEED);
} /* end test_multi_opens() */
-H5_GCC_DIAG_ON("format-nonliteral")
+H5_GCC_CLANG_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: test_multi
@@ -1871,12 +1943,23 @@ test_log(void)
hsize_t file_size = 0;
unsigned int flags = H5FD_LOG_ALL;
size_t buf_size = 4 * KB;
+ herr_t ret = SUCCEED;
TESTING("LOG file driver");
- /* Set property list and file name for log driver. */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
+
+ /* Make sure calling with an invalid fapl doesn't crash */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_fapl_log(H5I_INVALID_HID, LOG_FILENAME, 0, 0);
+ }
+ H5E_END_TRY;
+ if (SUCCEED == ret)
+ TEST_ERROR;
+
+ /* Set property list and file name for log driver. */
if (H5Pset_fapl_log(fapl, LOG_FILENAME, flags, buf_size) < 0)
TEST_ERROR;
h5_fixname(FILENAME[6], fapl, filename, sizeof filename);
@@ -2358,7 +2441,7 @@ compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info)
}
}
if ((HDstrlen(info->wo_path) != HDstrlen(fetched_info->wo_path)) ||
- HDstrncmp(info->wo_path, fetched_info->wo_path, H5FD_SPLITTER_PATH_MAX)) {
+ HDstrncmp(info->wo_path, fetched_info->wo_path, H5FD_SPLITTER_PATH_MAX) != 0) {
HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info->wo_path);
HEXPRINT(H5FD_SPLITTER_PATH_MAX, info->wo_path);
HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info->wo_path);
@@ -2390,7 +2473,7 @@ done:
*/
static int
run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_errors,
- hbool_t provide_logfile_path, hid_t sub_fapl_ids[2])
+ hbool_t provide_logfile_path, const hid_t sub_fapl_ids[2])
{
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -2583,7 +2666,10 @@ driver_is_splitter_compatible(hid_t fapl_id)
HDstrncpy(vfd_config->wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX);
vfd_config->log_file_path[0] = '\0';
- H5E_BEGIN_TRY { ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config);
+ }
H5E_END_TRY;
if (SUCCEED == ret) {
ret_value = -1;
@@ -2599,7 +2685,10 @@ driver_is_splitter_compatible(hid_t fapl_id)
return ret_value;
error:
- H5E_BEGIN_TRY { H5Pclose(split_fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(split_fapl_id);
+ }
H5E_END_TRY;
HDfree(vfd_config);
@@ -2660,7 +2749,10 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
* Should fail.
*/
- H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
+ }
H5E_END_TRY;
if (file_id >= 0) {
SPLITTER_TEST_FAULT("R/O open on nonexistent files unexpectedly successful\n");
@@ -2673,7 +2765,10 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) {
SPLITTER_TEST_FAULT("can't write W/O file\n");
}
- H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
+ }
H5E_END_TRY;
if (file_id >= 0) {
SPLITTER_TEST_FAULT("R/O open with extant W/O file unexpectedly successful\n");
@@ -2687,7 +2782,10 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
if (splitter_create_single_file_at(filename_rw, vfd_config->rw_fapl_id, data) < 0) {
SPLITTER_TEST_FAULT("can't create R/W file\n");
}
- H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
+ }
H5E_END_TRY;
if (file_id >= 0) {
SPLITTER_TEST_FAULT("R/O open with extant R/W file unexpectedly successful\n");
@@ -2922,7 +3020,10 @@ splitter_compare_expected_data(hid_t file_id, const struct splitter_dataset_def
done:
if (ret_value < 0) {
- H5E_BEGIN_TRY { H5Dclose(dset_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(dset_id);
+ }
H5E_END_TRY;
}
return ret_value;
@@ -3020,7 +3121,10 @@ splitter_tentative_open_test(hid_t child_fapl_id)
* Should fail.
*/
- H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
+ }
H5E_END_TRY;
if (file_id != H5I_INVALID_HID) {
SPLITTER_TEST_FAULT("open with both nonexistent files unexpectedly succeeded\n");
@@ -3041,7 +3145,10 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("Can't create W/O file copy.\n");
}
- H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
+ }
H5E_END_TRY;
if (file_id != H5I_INVALID_HID) {
SPLITTER_TEST_FAULT("open with nonexistent R/W file unexpectedly succeeded\n");
@@ -3066,7 +3173,10 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (h5_duplicate_file_by_bytes(filename_tmp, filename_rw) < 0) {
SPLITTER_TEST_FAULT("Can't create R/W file copy.\n");
}
- H5E_BEGIN_TRY { file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
+ }
H5E_END_TRY;
if (file_id != H5I_INVALID_HID) {
SPLITTER_TEST_FAULT("open with nonexistent W/O unexpectedly succeeded\n");
@@ -3232,7 +3342,10 @@ file_exists(const char *filename, hid_t fapl_id)
hid_t file_id = H5I_INVALID_HID;
int ret_value = 0;
- H5E_BEGIN_TRY { file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id);
+ }
H5E_END_TRY;
if (file_id != H5I_INVALID_HID) {
ret_value = 1;
@@ -3244,7 +3357,10 @@ file_exists(const char *filename, hid_t fapl_id)
return ret_value;
error:
- H5E_BEGIN_TRY { H5Fclose(file_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(file_id);
+ }
H5E_END_TRY;
return ret_value;
} /* end file_exists() */
@@ -3389,7 +3505,7 @@ setup_rand(void)
seed = predefined_seed;
- HDfprintf(stdout, "\n%s: predefined_seed = %d.\n\n", FUNC, seed);
+ HDfprintf(stdout, "\n%s: predefined_seed = %d.\n\n", __func__, seed);
HDfflush(stdout);
HDsrand(seed);
@@ -3398,14 +3514,14 @@ setup_rand(void)
if (HDgettimeofday(&tv, NULL) != 0) {
- HDfprintf(stdout, "\n%s: gettimeofday() failed -- srand() not called.\n\n", FUNC);
+ HDfprintf(stdout, "\n%s: gettimeofday() failed -- srand() not called.\n\n", __func__);
HDfflush(stdout);
}
else {
seed = (unsigned)tv.tv_usec;
- HDfprintf(stdout, "\n%s: seed = %d.\n\n", FUNC, seed);
+ HDfprintf(stdout, "\n%s: seed = %d.\n\n", __func__, seed);
HDfflush(stdout);
HDsrand(seed);
@@ -3416,6 +3532,503 @@ setup_rand(void)
} /* setup_rand() */
+/*
+ * Callback implementations for ctl feature testing VFD
+ */
+static H5FD_t *
+H5FD__ctl_test_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags,
+ hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr)
+{
+ return HDcalloc(1, sizeof(H5FD_t));
+}
+static herr_t
+H5FD__ctl_test_vfd_close(H5FD_t H5_ATTR_UNUSED *_file)
+{
+ HDfree(_file);
+ return SUCCEED;
+}
+static haddr_t
+H5FD__ctl_test_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ return HADDR_UNDEF;
+}
+static herr_t
+H5FD__ctl_test_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type,
+ haddr_t H5_ATTR_UNUSED addr)
+{
+ return FAIL;
+}
+static haddr_t
+H5FD__ctl_test_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type)
+{
+ return HADDR_UNDEF;
+}
+static herr_t
+H5FD__ctl_test_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size,
+ void H5_ATTR_UNUSED *buf)
+{
+ return FAIL;
+}
+static herr_t
+H5FD__ctl_test_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr,
+ size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf)
+{
+ return FAIL;
+}
+static herr_t
+H5FD__ctl_test_vfd_ctl(H5FD_t H5_ATTR_UNUSED *_file, uint64_t op_code, uint64_t flags,
+ const void H5_ATTR_UNUSED *input, void H5_ATTR_UNUSED **output)
+{
+ herr_t ret_value = SUCCEED;
+
+ switch (op_code) {
+ /* Op code for testing purposes */
+ case H5FD_CTL__TEST_OPCODE:
+ break;
+
+ /* Unknown op code */
+ default:
+ if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ ret_value = FAIL;
+ break;
+ }
+
+ return ret_value;
+}
+
+/* Minimal VFD for ctl feature tests */
+static const H5FD_class_t H5FD_ctl_test_vfd_g = {
+ "ctl_test_vfd", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_SEMI, /* fc_degree */
+ NULL, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ 0, /* fapl_size */
+ NULL, /* fapl_get */
+ NULL, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__ctl_test_vfd_open, /* open */
+ H5FD__ctl_test_vfd_close, /* close */
+ NULL, /* cmp */
+ NULL, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__ctl_test_vfd_get_eoa, /* get_eoa */
+ H5FD__ctl_test_vfd_set_eoa, /* set_eoa */
+ H5FD__ctl_test_vfd_get_eof, /* get_eof */
+ NULL, /* get_handle */
+ H5FD__ctl_test_vfd_read, /* read */
+ H5FD__ctl_test_vfd_write, /* write */
+ NULL, /* read_vector */
+ NULL, /* write_vector */
+ NULL, /* read_selection */
+ NULL, /* write_selection */
+ NULL, /* flush */
+ NULL, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ NULL, /* del */
+ H5FD__ctl_test_vfd_ctl, /* ctl */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
+};
+
+/*-------------------------------------------------------------------------
+ * Function: run_ctl_test
+ *
+ * Purpose: Helper method for VFD "ctl" callback test
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+run_ctl_test(uint64_t op_code, uint64_t flags, ctl_test_opc_type opc_type, hid_t fapl_id)
+{
+ hbool_t fail_if_unknown = FALSE;
+ hbool_t routing_flag_set = FALSE;
+ hbool_t is_passthrough_vfd = FALSE;
+ hbool_t expect_fail = FALSE;
+ H5FD_t *file_drv_ptr = NULL;
+ herr_t ctl_result = SUCCEED;
+ hid_t driver_id = H5I_INVALID_HID;
+ char filename[1024];
+
+ /* Check for a few ctl function flags */
+ fail_if_unknown = (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG);
+ routing_flag_set = (flags & H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG);
+
+ /* Determine if the top-level VFD is a passthrough VFD */
+ if ((driver_id = H5Pget_driver(fapl_id)) < 0)
+ PUTS_ERROR("couldn't get VFD ID from FAPL");
+
+ is_passthrough_vfd = ((driver_id == H5FD_SPLITTER) || (driver_id == H5FD_MULTI));
+
+ /*
+ * "Open" testing file. Note that our VFD for testing the ctl
+ * feature doesn't actually create or open files, so we don't
+ * need to create the testing file; we just need the VFD to
+ * give us a pointer to a H5FD_t structure.
+ */
+ h5_fixname(FILENAME[14], fapl_id, filename, sizeof(filename));
+ if (NULL == (file_drv_ptr = H5FDopen(filename, H5F_ACC_RDWR, fapl_id, HADDR_UNDEF)))
+ PUTS_ERROR("couldn't get pointer to H5FD_t structure");
+
+ /* Determine whether the H5FDctl call is expected to fail */
+ expect_fail = fail_if_unknown && (CTL_OPC_UNKNOWN == opc_type);
+ if (is_passthrough_vfd) {
+ /* Should fail if op code is unknown to passthrough VFD
+ * (but known to terminal VFD), no routing flag is specified
+ * and the "fail if unknown" flag is specified.
+ */
+ expect_fail =
+ expect_fail || ((CTL_OPC_KNOWN_TERMINAL == opc_type) && !routing_flag_set && fail_if_unknown);
+ }
+
+ /* Issue opcode to VFD */
+ if (expect_fail) {
+ H5E_BEGIN_TRY
+ {
+ ctl_result = H5FDctl(file_drv_ptr, op_code, flags, NULL, NULL);
+ }
+ H5E_END_TRY;
+ }
+ else
+ ctl_result = H5FDctl(file_drv_ptr, op_code, flags, NULL, NULL);
+
+ /* Verify result of H5FDctl call */
+ if (expect_fail) {
+ if (ctl_result == SUCCEED)
+ PUTS_ERROR("H5FDctl call succeeded when it should have failed");
+ }
+ else {
+ if (ctl_result != SUCCEED)
+ PUTS_ERROR("H5FDctl call failed when it should have succeeded");
+ }
+
+ /* Close H5FD_t structure pointer */
+ if (H5FDclose(file_drv_ptr) < 0)
+ PUTS_ERROR("couldn't close H5FD_t structure pointer");
+ file_drv_ptr = NULL;
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5FDclose(file_drv_ptr);
+ }
+ H5E_END_TRY;
+
+ return -1;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: test_ctl
+ *
+ * Purpose: Tests the VFD "ctl" callback
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_ctl(void)
+{
+ H5FD_splitter_vfd_config_t *splitter_config = NULL;
+ uint64_t op_code;
+ uint64_t flags;
+ hid_t driver_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t sub_fapl_id = H5I_INVALID_HID;
+
+ TESTING("VFD ctl callback");
+ HDputs("");
+
+ /* Register VFD for test */
+ if ((driver_id = H5FDregister(&H5FD_ctl_test_vfd_g)) < 0)
+ PUTS_ERROR("couldn't register VFD for testing");
+
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ PUTS_ERROR("couldn't create FAPL");
+ if (H5Pset_driver(fapl_id, driver_id, NULL) < 0)
+ PUTS_ERROR("couldn't set testing VFD on FAPL");
+
+ TESTING_2("known op code to terminal VFD (without fail on unknown flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = 0;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code to terminal VFD (with fail on unknown flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code to terminal VFD (without fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code to terminal VFD (with fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should succeed normally */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (without fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = 0;
+
+ /* H5FDctl call should silently ignore unknown op code and succeed */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (with fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /* H5FDctl call should fail due to 'fail if unknown' flag being specified */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (without fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should silently ignore unknown op code and succeed */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to terminal VFD (with fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /* H5FDctl call should fail due to 'fail if unknown' flag being specified */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ /* Set up splitter VFD config */
+ if (NULL == (splitter_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t))))
+ TEST_ERROR;
+
+ splitter_config->magic = H5FD_SPLITTER_MAGIC;
+ splitter_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ splitter_config->ignore_wo_errs = TRUE;
+ splitter_config->rw_fapl_id = H5P_DEFAULT;
+ splitter_config->wo_fapl_id = H5P_DEFAULT;
+ h5_fixname(FILENAME[15], splitter_config->wo_fapl_id, splitter_config->wo_path, H5FD_SPLITTER_PATH_MAX);
+
+ if ((sub_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ PUTS_ERROR("couldn't create FAPL");
+ if (H5Pset_driver(sub_fapl_id, driver_id, NULL) < 0)
+ PUTS_ERROR("couldn't set testing VFD on FAPL");
+ splitter_config->rw_fapl_id = sub_fapl_id;
+
+ if (H5Pset_fapl_splitter(fapl_id, splitter_config) < 0)
+ PUTS_ERROR("couldn't set splitter VFD on FAPL");
+
+ TESTING_2("known op code through passthrough VFD to terminal VFD (without fail on unknown flag/no "
+ "routing flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = 0;
+
+ /*
+ * H5FDctl call should silently ignore unknown op code in
+ * passthrough VFD since no routing flag is specified and
+ * 'fail if unknown' flag is not specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2(
+ "known op code through passthrough VFD to terminal VFD (with fail on unknown flag/no routing flag)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /*
+ * H5FDctl call should fail since op code is unknown to
+ * passthrough VFD (though known to terminal VFD), no
+ * routing flag is specified and the 'fail if unknown'
+ * flag is specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code through passthrough VFD to terminal VFD (without fail on unknown flag/route to "
+ "terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should succeed since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("known op code through passthrough VFD to terminal VFD (with fail on unknown flag/route to "
+ "terminal VFD)")
+
+ op_code = H5FD_CTL__TEST_OPCODE;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should succeed since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (without fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = 0;
+
+ /*
+ * H5FDctl call should silently ignore unknown op code in
+ * passthrough VFD since no routing flag is specified and
+ * 'fail if unknown' flag is not specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (with fail on unknown flag)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+
+ /*
+ * H5FDctl call should fail since op code is unknown to
+ * passthrough VFD, no routing flag is specified and the
+ * 'fail if unknown' flag is specified.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (without fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should succeed since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD and the 'fail if
+ * unknown' flag has not been specified. Therefore, the
+ * terminal VFD should silently ignore the unknown op
+ * code.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("unknown op code to passthrough VFD (with fail on unknown flag/route to terminal VFD)")
+
+ op_code = H5FD_CTL_OPC_RESERVED;
+ flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+
+ /*
+ * H5Dctl call should fail since the passthrough VFD
+ * doesn't recognize the op code, but has been instructed
+ * to route it down to the terminal VFD and the 'fail if
+ * unknown' flag has been specified. Therefore, the
+ * terminal VFD will throw an error for the unknown op
+ * code.
+ */
+ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ TESTING_2("test cleanup")
+
+ HDfree(splitter_config);
+
+ if (H5FDunregister(driver_id) < 0)
+ TEST_ERROR;
+ if (H5Pclose(sub_fapl_id) < 0)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ if (splitter_config)
+ HDfree(splitter_config);
+ H5FDunregister(driver_id);
+ H5Pclose(sub_fapl_id);
+ H5Pclose(fapl_id);
+ }
+ H5E_END_TRY;
+
+ return -1;
+}
+
/*-------------------------------------------------------------------------
* Function: test_vector_io__setup_v
*
@@ -3473,7 +4086,7 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz
if ((NULL == write_bufs[i]) || (NULL == read_bufs[i])) {
- HDfprintf(stderr, "%s: can't malloc read / write bufs.\n", FUNC);
+ HDfprintf(stderr, "%s: can't malloc read / write bufs.\n", __func__);
result = FALSE;
break;
}
@@ -3608,7 +4221,7 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a
if ((NULL == write_bufs[i]) || (NULL == read_bufs[i])) {
- HDfprintf(stderr, "%s: can't malloc read / write bufs.\n", FUNC);
+ HDfprintf(stderr, "%s: can't malloc read / write bufs.\n", __func__);
result = FALSE;
break;
}
@@ -3694,7 +4307,7 @@ test_vector_io__read_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], had
if (verbose) {
- HDfprintf(stdout, "%s: HDread() failed on entry %d.\n", FUNC, i);
+ HDfprintf(stdout, "%s: HDread() failed on entry %d.\n", __func__, i);
}
result = FALSE;
break;
@@ -3749,7 +4362,7 @@ test_vector_io__write_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], ha
if (verbose) {
- HDfprintf(stdout, "%s: HDwrite() failed on entry %d.\n", FUNC, i);
+ HDfprintf(stdout, "%s: HDwrite() failed on entry %d.\n", __func__, i);
}
result = FALSE;
break;
@@ -5367,6 +5980,7 @@ main(void)
nerrors += test_vector_io("stdio") < 0 ? 1 : 0;
nerrors += test_selection_io("sec2") < 0 ? 1 : 0;
nerrors += test_selection_io("stdio") < 0 ? 1 : 0;
+ nerrors += test_ctl() < 0 ? 1 : 0;
if (nerrors) {
HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
diff --git a/test/vol.c b/test/vol.c
index 7da35ea..c7586d5 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -20,6 +20,12 @@
/* Headers needed */
#include "h5test.h"
+#include "H5Iprivate.h" /* IDs */
+#define H5T_FRIEND /* Suppress error about including H5Tpkg */
+#include "H5Tpkg.h" /* Datatypes */
+#define H5VL_FRIEND /* Suppress error about including H5VLpkg */
+#define H5VL_TESTING
+#include "H5VLpkg.h" /* Virtual Object Layer */
/* Filename */
const char *FILENAME[] = {"native_vol_test", NULL};
@@ -35,6 +41,136 @@ const char *FILENAME[] = {"native_vol_test", NULL};
#define N_ELEMENTS 10
+/* A VOL class struct to verify registering optional operations */
+static int reg_opt_curr_op_val;
+static herr_t reg_opt_op_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
+static herr_t reg_opt_link_optional(void *obj, const H5VL_loc_params_t *loc_params,
+ H5VL_optional_args_t *args, hid_t dxpl_id, void **req);
+static herr_t reg_opt_datatype_get(void *obj, H5VL_datatype_get_args_t *args, hid_t dxpl_id, void **req);
+#define REG_OPT_VOL_NAME "reg_opt"
+#define REG_OPT_VOL_VALUE ((H5VL_class_value_t)502)
+static const H5VL_class_t reg_opt_vol_g = {
+ H5VL_VERSION, /* VOL class struct version */
+ REG_OPT_VOL_VALUE, /* value */
+ REG_OPT_VOL_NAME, /* name */
+ 0, /* version */
+ 0, /* capability flags */
+ NULL, /* initialize */
+ NULL, /* terminate */
+ {
+ /* info_cls */
+ (size_t)0, /* size */
+ NULL, /* copy */
+ NULL, /* compare */
+ NULL, /* free */
+ NULL, /* to_str */
+ NULL, /* from_str */
+ },
+ {
+ /* wrap_cls */
+ NULL, /* get_object */
+ NULL, /* get_wrap_ctx */
+ NULL, /* wrap_object */
+ NULL, /* unwrap_object */
+ NULL, /* free_wrap_ctx */
+ },
+ {
+ /* attribute_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ reg_opt_op_optional, /* optional */
+ NULL /* close */
+ },
+ {
+ /* dataset_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ reg_opt_op_optional, /* optional */
+ NULL /* close */
+ },
+ {
+ /* datatype_cls */
+ NULL, /* commit */
+ NULL, /* open */
+ reg_opt_datatype_get, /* get */
+ NULL, /* specific */
+ reg_opt_op_optional, /* optional */
+ NULL /* close */
+ },
+ {
+ /* file_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ reg_opt_op_optional, /* optional */
+ NULL /* close */
+ },
+ {
+ /* group_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ reg_opt_op_optional, /* optional */
+ NULL /* close */
+ },
+ {
+ /* link_cls */
+ NULL, /* create */
+ NULL, /* copy */
+ NULL, /* move */
+ NULL, /* get */
+ NULL, /* specific */
+ reg_opt_link_optional /* optional */
+ },
+ {
+ /* object_cls */
+ NULL, /* open */
+ NULL, /* copy */
+ NULL, /* get */
+ NULL, /* specific */
+ reg_opt_link_optional /* optional */
+ },
+ {
+ /* introspect_cls */
+ NULL, /* get_conn_cls */
+ NULL, /* get_cap_flags */
+ NULL, /* opt_query */
+ },
+ {
+ /* request_cls */
+ NULL, /* wait */
+ NULL, /* notify */
+ NULL, /* cancel */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* free */
+ },
+ {
+ /* blob_cls */
+ NULL, /* put */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ {
+ /* token_cls */
+ NULL, /* cmp */
+ NULL, /* to_str */
+ NULL /* from_str */
+ },
+ NULL /* optional */
+};
+
#define FAKE_VOL_NAME "fake"
#define FAKE_VOL_VALUE ((H5VL_class_value_t)501)
@@ -90,6 +226,136 @@ static const H5VL_class_t fake_vol_g = {
},
{
/* datatype_cls */
+ NULL, /* commit */
+ NULL, /* open */
+ reg_opt_datatype_get, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ {
+ /* file_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ {
+ /* group_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ {
+ /* link_cls */
+ NULL, /* create */
+ NULL, /* copy */
+ NULL, /* move */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ {
+ /* object_cls */
+ NULL, /* open */
+ NULL, /* copy */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ {
+ /* introspect_cls */
+ NULL, /* get_conn_cls */
+ NULL, /* get_cap_flags */
+ NULL, /* opt_query */
+ },
+ {
+ /* request_cls */
+ NULL, /* wait */
+ NULL, /* notify */
+ NULL, /* cancel */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* free */
+ },
+ {
+ /* blob_cls */
+ NULL, /* put */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ {
+ /* token_cls */
+ NULL, /* cmp */
+ NULL, /* to_str */
+ NULL /* from_str */
+ },
+ NULL /* optional */
+};
+
+static herr_t fake_async_get_cap_flags(const void *info, unsigned *cap_flags);
+
+#define FAKE_ASYNC_VOL_NAME "fake_async"
+#define FAKE_ASYNC_VOL_VALUE ((H5VL_class_value_t)503)
+
+/* A VOL class struct that describes a VOL class with no
+ * functionality except to set the async capability flag.
+ */
+static const H5VL_class_t fake_async_vol_g = {
+ H5VL_VERSION, /* VOL class struct version */
+ FAKE_ASYNC_VOL_VALUE, /* value */
+ FAKE_ASYNC_VOL_NAME, /* name */
+ 0, /* connector version */
+ H5VL_CAP_FLAG_ASYNC, /* capability flags */
+ NULL, /* initialize */
+ NULL, /* terminate */
+ {
+ /* info_cls */
+ (size_t)0, /* size */
+ NULL, /* copy */
+ NULL, /* compare */
+ NULL, /* free */
+ NULL, /* to_str */
+ NULL, /* from_str */
+ },
+ {
+ /* wrap_cls */
+ NULL, /* get_object */
+ NULL, /* get_wrap_ctx */
+ NULL, /* wrap_object */
+ NULL, /* unwrap_object */
+ NULL, /* free_wrap_ctx */
+ },
+ {
+ /* attribute_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ {
+ /* dataset_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ {
+ /* datatype_cls */
NULL, /* commit */
NULL, /* open */
NULL, /* get */
@@ -134,8 +400,9 @@ static const H5VL_class_t fake_vol_g = {
},
{
/* introspect_cls */
- NULL, /* get_conn_cls */
- NULL, /* opt_query */
+ NULL, /* get_conn_cls */
+ fake_async_get_cap_flags, /* get_cap_flags */
+ NULL, /* opt_query */
},
{
/* request_cls */
@@ -163,6 +430,146 @@ static const H5VL_class_t fake_vol_g = {
};
/*-------------------------------------------------------------------------
+ * Function: reg_opt_op_optional_verify
+ *
+ * Purpose: Common verification routine for dynamic optional operations
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+reg_opt_op_optional_verify(void *obj, H5VL_optional_args_t *args)
+{
+ int *o = (int *)obj;
+ int *op_args;
+
+ /* Check for receiving correct operation value */
+ if (args->op_type != reg_opt_curr_op_val)
+ return -1;
+
+ /* Check that the object is correct */
+ if ((-1) != *o)
+ return -1;
+
+ /* Update the object, with the operation value */
+ *o = args->op_type;
+
+ /* Check that the argument is correct */
+ op_args = args->args;
+ if (NULL == op_args)
+ return -1;
+ if ((-1) != *op_args)
+ return -1;
+
+ /* Update the argument return parameter */
+ *op_args = args->op_type;
+
+ return 0;
+} /* end reg_opt_op_optional_verify() */
+
+/*-------------------------------------------------------------------------
+ * Function: reg_opt_op_optional
+ *
+ * Purpose: Common callback to perform a connector-specific operation
+ * on an object
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+reg_opt_op_optional(void *obj, H5VL_optional_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
+{
+ /* Invoke the common value verification routine */
+ return reg_opt_op_optional_verify(obj, args);
+} /* end reg_opt_op_optional() */
+
+/*-------------------------------------------------------------------------
+ * Function: reg_opt_link_optional
+ *
+ * Purpose: Callback to perform a connector-specific operation
+ * on a link
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+reg_opt_link_optional(void *obj, const H5VL_loc_params_t *loc_params, H5VL_optional_args_t *args,
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req)
+{
+ /* Check for receiving correct loc_params info */
+ if (loc_params->type != H5VL_OBJECT_BY_NAME)
+ return -1;
+ if (loc_params->obj_type != H5I_GROUP)
+ return -1;
+ if (HDstrcmp(loc_params->loc_data.loc_by_name.name, ".") != 0)
+ return -1;
+ if (loc_params->loc_data.loc_by_name.lapl_id != H5P_LINK_ACCESS_DEFAULT)
+ return -1;
+
+ /* Invoke the common value verification routine */
+ return reg_opt_op_optional_verify(obj, args);
+} /* end reg_opt_link_optional() */
+
+/*-------------------------------------------------------------------------
+ * Function: reg_opt_datatype_get
+ *
+ * Purpose: Handles the datatype get callback
+ *
+ * Note: This is _strictly_ a testing fixture to support the
+ * exercise_reg_opt_oper() testing routine. It fakes just
+ * enough of the named datatype VOL callback for the
+ * H5VL_register_using_vol_id() call in that test routine to
+ * succeed.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+reg_opt_datatype_get(void H5_ATTR_UNUSED *obj, H5VL_datatype_get_args_t *args, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ if (H5VL_DATATYPE_GET_BINARY_SIZE == args->op_type) {
+ if (H5Tencode(H5T_NATIVE_INT, NULL, args->args.get_binary_size.size) < 0)
+ ret_value = FAIL;
+ } /* end if */
+ else if (H5VL_DATATYPE_GET_BINARY == args->op_type) {
+ if (H5Tencode(H5T_NATIVE_INT, args->args.get_binary.buf, &args->args.get_binary.buf_size) < 0)
+ ret_value = FAIL;
+ } /* end if */
+ else
+ ret_value = FAIL;
+
+ return ret_value;
+} /* end reg_opt_datatype_get() */
+
+/*-------------------------------------------------------------------------
+ * Function: fake_async_get_cap_flags
+ *
+ * Purpose: Return the capability flags for the 'fake async' connector
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+fake_async_get_cap_flags(const void H5_ATTR_UNUSED *info, unsigned *cap_flags)
+{
+ *cap_flags = fake_async_vol_g.cap_flags;
+
+ return SUCCEED;
+} /* end fake_async_get_cap_flags() */
+
+/*-------------------------------------------------------------------------
* Function: test_vol_registration()
*
* Purpose: Tests if we can load, register, and close a simple
@@ -199,7 +606,10 @@ test_vol_registration(void)
/* Test registering a connector with an incorrect property list (SHOULD FAIL) */
if ((lapl_id = H5Pcreate(H5P_LINK_ACCESS)) < 0)
TEST_ERROR;
- H5E_BEGIN_TRY { vol_id = H5VLregister_connector(&fake_vol_g, lapl_id); }
+ H5E_BEGIN_TRY
+ {
+ vol_id = H5VLregister_connector(&fake_vol_g, lapl_id);
+ }
H5E_END_TRY;
if (H5I_INVALID_HID != vol_id)
FAIL_PUTS_ERROR("should not be able to register a connector with an incorrect property list");
@@ -211,7 +621,10 @@ test_vol_registration(void)
TEST_ERROR;
HDmemcpy(bad_fake_vol_class, &fake_vol_g, sizeof(H5VL_class_t));
bad_fake_vol_class->version = H5VL_VERSION + 1;
- H5E_BEGIN_TRY { vol_id = H5VLregister_connector(bad_fake_vol_class, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ vol_id = H5VLregister_connector(bad_fake_vol_class, H5P_DEFAULT);
+ }
H5E_END_TRY;
if (H5I_INVALID_HID != vol_id)
FAIL_PUTS_ERROR("should not be able to register a connector with an incompatible version #");
@@ -275,7 +688,10 @@ test_vol_registration(void)
/* Try to unregister the native VOL connector (should fail) */
if (H5I_INVALID_HID == (native_id = H5VLget_connector_id_by_name(H5VL_NATIVE_NAME)))
TEST_ERROR;
- H5E_BEGIN_TRY { ret = H5VLunregister_connector(native_id); }
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLunregister_connector(native_id);
+ }
H5E_END_TRY;
if (FAIL != ret)
FAIL_PUTS_ERROR("should not be able to unregister the native VOL connector");
@@ -399,8 +815,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't compare VFD properties for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -421,8 +837,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't retrieve VFD handle for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_vfd_handle */
if (H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0)
TEST_ERROR;
@@ -461,8 +877,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't compare VFD properties for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -476,8 +892,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't compare VFD properties for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0)
TEST_ERROR;
@@ -1167,6 +1583,519 @@ error:
} /* end test_basic_datatype_operation() */
+typedef herr_t (*reg_opt_obj_oper_t)(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t obj_id, H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+typedef herr_t (*reg_opt_link_oper_t)(const char *app_file, const char *app_func, unsigned app_line,
+ hid_t obj_id, const char *name, hid_t lapl_id,
+ H5VL_optional_args_t *args, hid_t dxpl_id, hid_t es_id);
+typedef union {
+ reg_opt_obj_oper_t obj_op;
+ reg_opt_link_oper_t link_op;
+} reg_opt_oper_t;
+
+/*-------------------------------------------------------------------------
+ * Function: exercise_reg_opt_oper()
+ *
+ * Purpose: Exercise a particular optional operation for a type.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+exercise_reg_opt_oper(hid_t fake_vol_id, hid_t reg_opt_vol_id, H5VL_subclass_t subcls,
+ const char *subcls_name, H5I_type_t id_type, reg_opt_oper_t reg_opt_op)
+{
+ char op_name[256]; /* Operation name to register */
+ hid_t obj_id = H5I_INVALID_HID;
+ H5VL_object_t * vol_obj;
+ H5VL_optional_args_t vol_cb_args;
+ int fake_obj, fake_arg;
+ int op_val = -1, op_val2 = -1;
+ int find_op_val;
+ herr_t ret = SUCCEED;
+
+ /* Test registering optional operation */
+ HDsnprintf(op_name, sizeof(op_name), "%s-op1", subcls_name);
+ if (H5VLregister_opt_operation(subcls, op_name, &op_val) < 0)
+ TEST_ERROR;
+
+ /* Verify that the reserved amount of optional operations is obeyed */
+ /* (The first optional operation registered should be at the lower limit) */
+ if (op_val != H5VL_RESERVED_NATIVE_OPTIONAL)
+ TEST_ERROR;
+
+ /* Look up 1st registered optional operation */
+ find_op_val = 0;
+ if (H5VLfind_opt_operation(subcls, op_name, &find_op_val) < 0)
+ TEST_ERROR;
+
+ /* Verify that the operation was looked up successfully */
+ if (op_val != find_op_val)
+ TEST_ERROR;
+
+ /* Test registering second optional operation */
+ HDsnprintf(op_name, sizeof(op_name), "%s-op2", subcls_name);
+ if (H5VLregister_opt_operation(subcls, op_name, &op_val2) < 0)
+ TEST_ERROR;
+
+ /* Verify that the reserved amount of optional operations is obeyed */
+ /* (The 2nd optional operation registered should be at the lower limit + 1) */
+ if (op_val2 != (H5VL_RESERVED_NATIVE_OPTIONAL + 1))
+ TEST_ERROR;
+
+ /* Look up 2nd registered optional operation */
+ find_op_val = 0;
+ if (H5VLfind_opt_operation(subcls, op_name, &find_op_val) < 0)
+ TEST_ERROR;
+
+ /* Verify that the operation was looked up successfully */
+ if (op_val2 != find_op_val)
+ TEST_ERROR;
+
+ /* Push a new API context on the stack */
+ /* (Necessary for the named datatype construction routines) */
+ if (H5VL_SUBCLS_DATATYPE == subcls)
+ H5CX_push();
+
+ /* Create fake object on fake VOL connector */
+ if (H5I_INVALID_HID == (obj_id = H5VL_register_using_vol_id(id_type, &fake_obj, fake_vol_id, TRUE)))
+ TEST_ERROR;
+
+ /* Pop the API context off the stack */
+ if (H5VL_SUBCLS_DATATYPE == subcls)
+ H5CX_pop(FALSE);
+
+ /* Attempt to issue operation on fake VOL connector */
+ fake_obj = -1;
+ fake_arg = -1;
+ vol_cb_args.op_type = op_val;
+ vol_cb_args.args = &fake_arg;
+ H5E_BEGIN_TRY
+ {
+ if (H5VL_SUBCLS_LINK == subcls || H5VL_SUBCLS_OBJECT == subcls)
+ ret = (*reg_opt_op.link_op)(__FILE__, __func__, __LINE__, obj_id, ".", H5P_DEFAULT, &vol_cb_args,
+ H5P_DEFAULT, H5ES_NONE);
+ else
+ ret = (*reg_opt_op.obj_op)(__FILE__, __func__, __LINE__, obj_id, &vol_cb_args, H5P_DEFAULT,
+ H5ES_NONE);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to perform an optional operation with a NULL callback");
+ if ((-1) != fake_obj)
+ FAIL_PUTS_ERROR("'fake_obj' changed during failed operation?");
+ if ((-1) != fake_arg)
+ FAIL_PUTS_ERROR("'fake_arg' changed during failed operation?");
+
+ /* Named datatypes must be destroyed differently */
+ if (H5VL_SUBCLS_DATATYPE == subcls) {
+ H5T_t *dt;
+
+ /* Destroy fake datatype object */
+ if (NULL == (dt = H5I_remove(obj_id)))
+ TEST_ERROR;
+ if (H5VL_free_object(dt->vol_obj) < 0)
+ TEST_ERROR;
+ dt->vol_obj = NULL;
+ if (H5T_close(dt) < 0)
+ TEST_ERROR;
+ } /* end if */
+ else {
+ /* Destroy fake object */
+ if (NULL == (vol_obj = H5I_remove(obj_id)))
+ TEST_ERROR;
+ if (H5VL_free_object(vol_obj) < 0)
+ TEST_ERROR;
+ } /* end else */
+
+ /* Push a new API context on the stack */
+ /* (Necessary for the named datatype construction routines) */
+ if (H5VL_SUBCLS_DATATYPE == subcls)
+ H5CX_push();
+
+ /* Create fake object on reg_opt VOL connector */
+ if (H5I_INVALID_HID == (obj_id = H5VL_register_using_vol_id(id_type, &fake_obj, reg_opt_vol_id, TRUE)))
+ TEST_ERROR;
+
+ /* Pop the API context off the stack */
+ if (H5VL_SUBCLS_DATATYPE == subcls)
+ H5CX_pop(FALSE);
+
+ /* Issue first operation */
+ fake_obj = -1;
+ fake_arg = -1;
+ reg_opt_curr_op_val = op_val;
+ vol_cb_args.op_type = op_val;
+ vol_cb_args.args = &fake_arg;
+ if (H5VL_SUBCLS_LINK == subcls || H5VL_SUBCLS_OBJECT == subcls)
+ ret = (*reg_opt_op.link_op)(__FILE__, __func__, __LINE__, obj_id, ".", H5P_DEFAULT, &vol_cb_args,
+ H5P_DEFAULT, H5ES_NONE);
+ else
+ ret =
+ (*reg_opt_op.obj_op)(__FILE__, __func__, __LINE__, obj_id, &vol_cb_args, H5P_DEFAULT, H5ES_NONE);
+ if (ret < 0)
+ TEST_ERROR;
+
+ /* Verify that fake object & argument were modified correctly */
+ if (op_val != fake_obj)
+ FAIL_PUTS_ERROR("'fake_obj' not updated");
+ if (op_val != fake_arg)
+ FAIL_PUTS_ERROR("'fake_arg' not updated");
+
+ /* Issue second operation */
+ fake_obj = -1;
+ fake_arg = -1;
+ reg_opt_curr_op_val = op_val2;
+ vol_cb_args.op_type = op_val2;
+ vol_cb_args.args = &fake_arg;
+ if (H5VL_SUBCLS_LINK == subcls || H5VL_SUBCLS_OBJECT == subcls)
+ ret = (*reg_opt_op.link_op)(__FILE__, __func__, __LINE__, obj_id, ".", H5P_DEFAULT, &vol_cb_args,
+ H5P_DEFAULT, H5ES_NONE);
+ else
+ ret =
+ (*reg_opt_op.obj_op)(__FILE__, __func__, __LINE__, obj_id, &vol_cb_args, H5P_DEFAULT, H5ES_NONE);
+ if (ret < 0)
+ TEST_ERROR;
+
+ /* Verify that fake object & argument were modified correctly */
+ if (op_val2 != fake_obj)
+ FAIL_PUTS_ERROR("'fake_obj' not updated");
+ if (op_val2 != fake_arg)
+ FAIL_PUTS_ERROR("'fake_arg' not updated");
+
+ /* Named datatypes must be destroyed differently */
+ if (H5VL_SUBCLS_DATATYPE == subcls) {
+ H5T_t *dt;
+
+ /* Destroy fake datatype object */
+ if (NULL == (dt = H5I_remove(obj_id)))
+ TEST_ERROR;
+ if (H5VL_free_object(dt->vol_obj) < 0)
+ TEST_ERROR;
+ dt->vol_obj = NULL;
+ if (H5T_close(dt) < 0)
+ TEST_ERROR;
+ } /* end if */
+ else {
+ /* Destroy fake object */
+ if (NULL == (vol_obj = H5I_remove(obj_id)))
+ TEST_ERROR;
+ if (H5VL_free_object(vol_obj) < 0)
+ TEST_ERROR;
+ } /* end else */
+
+ /* Unregister 2nd registered optional operation */
+ if (H5VLunregister_opt_operation(subcls, op_name) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end exercise_reg_opt_oper() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_register_opt_operation()
+ *
+ * Purpose: Tests if we can load, register, and close a simple
+ * VOL connector.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_register_opt_operation(void)
+{
+ hid_t fake_vol_id = H5I_INVALID_HID;
+ hid_t reg_opt_vol_id = H5I_INVALID_HID;
+ struct {
+ H5VL_subclass_t subcls;
+ const char * subcls_name;
+ H5I_type_t id_type;
+ reg_opt_oper_t reg_opt_op;
+ } test_params[] = {{H5VL_SUBCLS_ATTR, "attr", H5I_ATTR, {.obj_op = H5VLattr_optional_op}},
+ {H5VL_SUBCLS_DATASET, "dataset", H5I_DATASET, {.obj_op = H5VLdataset_optional_op}},
+ {H5VL_SUBCLS_DATATYPE, "datatype", H5I_DATATYPE, {.obj_op = H5VLdatatype_optional_op}},
+ {H5VL_SUBCLS_FILE, "file", H5I_FILE, {.obj_op = H5VLfile_optional_op}},
+ {H5VL_SUBCLS_GROUP, "group", H5I_GROUP, {.obj_op = H5VLgroup_optional_op}},
+ {H5VL_SUBCLS_LINK, "link", H5I_GROUP, {.link_op = H5VLlink_optional_op}},
+ {H5VL_SUBCLS_OBJECT, "object", H5I_GROUP, {.link_op = H5VLobject_optional_op}}};
+ int op_val = -1;
+ unsigned u;
+ herr_t ret = SUCCEED;
+
+ TESTING("dynamically registering optional operations");
+
+ /* Register the VOL connectors for testing */
+ if ((fake_vol_id = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if ((reg_opt_vol_id = H5VLregister_connector(&reg_opt_vol_g, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Test registering invalid optional VOL subclass operations */
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLregister_opt_operation(H5VL_SUBCLS_NONE, "fail", &op_val);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'NONE' VOL subclass");
+ if ((-1) != op_val)
+ FAIL_PUTS_ERROR("'op_val' changed during failed operation?");
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLregister_opt_operation(H5VL_SUBCLS_INFO, "fail2", &op_val);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'INFO' VOL subclass");
+ if ((-1) != op_val)
+ FAIL_PUTS_ERROR("'op_val' changed during failed operation?");
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLregister_opt_operation(H5VL_SUBCLS_WRAP, "fail3", &op_val);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'WRAP' VOL subclass");
+ if ((-1) != op_val)
+ FAIL_PUTS_ERROR("'op_val' changed during failed operation?");
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLregister_opt_operation(H5VL_SUBCLS_BLOB, "fail4", &op_val);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'BLOB' VOL subclass");
+ if ((-1) != op_val)
+ FAIL_PUTS_ERROR("'op_val' changed during failed operation?");
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLregister_opt_operation(H5VL_SUBCLS_TOKEN, "fail5", &op_val);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to register an optional operation for the 'TOKEN' VOL subclass");
+ if ((-1) != op_val)
+ FAIL_PUTS_ERROR("'op_val' changed during failed operation?");
+
+ /* Test registering valid optional VOL subclass operation with NULL op_val ptr*/
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLregister_opt_operation(H5VL_SUBCLS_FILE, "fail6", NULL);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to register an optional operation with a NULL 'op_val'");
+
+ /* Try finding a non-existent optional VOL subclass operation */
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLfind_opt_operation(H5VL_SUBCLS_DATASET, "fail", &op_val);
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to find a non-existent optional operation");
+
+ /* Try unregistering a non-existent optional VOL subclass operation */
+ H5E_BEGIN_TRY
+ {
+ ret = H5VLunregister_opt_operation(H5VL_SUBCLS_DATASET, "fail");
+ }
+ H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to unregister a non-existent optional operation");
+
+ /* Optional operations on requests are supported (but difficult to test further) */
+ if (H5VLregister_opt_operation(H5VL_SUBCLS_REQUEST, "req_op", &op_val) < 0)
+ TEST_ERROR;
+
+ /* Register & test calling optional operations for each valid VOL subclass */
+ /* (Table-driven, with test_params array) */
+ for (u = 0; u < NELMTS(test_params); u++)
+ /* Exercise appropriate callback, for each VOL subclass */
+ if (exercise_reg_opt_oper(fake_vol_id, reg_opt_vol_id, test_params[u].subcls,
+ test_params[u].subcls_name, test_params[u].id_type,
+ test_params[u].reg_opt_op) < 0)
+ TEST_ERROR;
+
+ /* Unregister the VOL connectors */
+ if (H5VLunregister_connector(fake_vol_id) < 0)
+ TEST_ERROR;
+ if (H5VLunregister_connector(reg_opt_vol_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5VLunregister_connector(fake_vol_id);
+ H5VLunregister_connector(reg_opt_vol_id);
+ }
+ H5E_END_TRY;
+
+ return FAIL;
+} /* end test_register_opt_operation() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_async_vol_props()
+ *
+ * Purpose: Test properties related to asynchronous VOL connector operation
+ *
+ * Note: Overrides the HDF5_VOL_CONNECTOR environment variable, to
+ * provide stable testing environment.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_async_vol_props(void)
+{
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t vol_id = H5I_INVALID_HID;
+ H5VL_pass_through_info_t passthru_info;
+ unsigned cap_flags = 0;
+ char * conn_env_str = NULL;
+
+ TESTING("Async VOL props");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+
+ /* Test 'capability flags' property */
+
+ /* Test query w/NULL for cap_flags parameter */
+ if (H5Pget_vol_cap_flags(fapl_id, NULL) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Override possible environment variable & re-initialize default VOL connector */
+ conn_env_str = HDgetenv("HDF5_VOL_CONNECTOR");
+ if (conn_env_str) {
+ if (NULL == (conn_env_str = HDstrdup(conn_env_str)))
+ TEST_ERROR
+ if (HDunsetenv("HDF5_VOL_CONNECTOR") < 0)
+ TEST_ERROR
+ if (H5VL__reparse_def_vol_conn_variable_test() < 0)
+ TEST_ERROR
+ } /* end if */
+
+ /* Test query w/default VOL, which should indicate no async, since native connector
+ * doesn't support async.
+ */
+ if (H5Pget_vol_cap_flags(fapl_id, &cap_flags) < 0)
+ FAIL_STACK_ERROR;
+ if ((cap_flags & H5VL_CAP_FLAG_ASYNC) > 0)
+ TEST_ERROR
+ if ((cap_flags & H5VL_CAP_FLAG_NATIVE_FILES) == 0)
+ TEST_ERROR
+
+ /* Close FAPL */
+ if (H5Pclose(fapl_id) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Register a fake VOL connector that sets the async capability flag */
+ if ((vol_id = H5VLregister_connector(&fake_async_vol_g, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Set environment variable to use 'fake async' connector & re-init default connector */
+ if (HDsetenv("HDF5_VOL_CONNECTOR", "fake_async", TRUE) < 0)
+ TEST_ERROR
+ if (H5VL__reparse_def_vol_conn_variable_test() < 0)
+ TEST_ERROR
+
+ /* Retrieve the file access property again */
+ fapl_id = h5_fileaccess();
+
+ /* Test query w/fake async VOL, which should succeed */
+ cap_flags = 0;
+ if (H5Pget_vol_cap_flags(fapl_id, &cap_flags) < 0)
+ FAIL_STACK_ERROR;
+ if ((cap_flags & H5VL_CAP_FLAG_ASYNC) == 0)
+ TEST_ERROR
+ if ((cap_flags & H5VL_CAP_FLAG_NATIVE_FILES) > 0)
+ TEST_ERROR
+
+ /* Reset environment variable & re-init default connector */
+ if (HDunsetenv("HDF5_VOL_CONNECTOR") < 0)
+ TEST_ERROR
+ if (H5VL__reparse_def_vol_conn_variable_test() < 0)
+ TEST_ERROR
+
+ /* Close FAPL */
+ if (H5Pclose(fapl_id) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Retrieve the file access property again */
+ fapl_id = h5_fileaccess();
+
+ /* Set the VOL connector for the FAPL to the fake async connector */
+ if (H5Pset_vol(fapl_id, vol_id, NULL) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Test query w/fake async VOL, which should succeed */
+ cap_flags = 0;
+ if (H5Pget_vol_cap_flags(fapl_id, &cap_flags) < 0)
+ FAIL_STACK_ERROR;
+ if ((cap_flags & H5VL_CAP_FLAG_ASYNC) == 0)
+ TEST_ERROR
+ if ((cap_flags & H5VL_CAP_FLAG_NATIVE_FILES) > 0)
+ TEST_ERROR
+
+ /* Stack the [internal] passthrough VOL connector on top of the fake async connector */
+ passthru_info.under_vol_id = vol_id;
+ passthru_info.under_vol_info = NULL;
+ if (H5Pset_vol(fapl_id, H5VL_PASSTHRU, &passthru_info) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Test query w/passthru -> fake async VOL, which should succeed */
+ cap_flags = 0;
+ if (H5Pget_vol_cap_flags(fapl_id, &cap_flags) < 0)
+ FAIL_STACK_ERROR;
+ if ((cap_flags & H5VL_CAP_FLAG_ASYNC) == 0)
+ TEST_ERROR
+ if ((cap_flags & H5VL_CAP_FLAG_NATIVE_FILES) > 0)
+ TEST_ERROR
+
+ /* Unregister the fake async VOL ID */
+ if (H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ /* Close FAPL */
+ if (H5Pclose(fapl_id) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Restore environment variable, if there was one */
+ if (conn_env_str) {
+ if (HDsetenv("HDF5_VOL_CONNECTOR", conn_env_str, TRUE) < 0)
+ TEST_ERROR
+ HDfree(conn_env_str);
+
+ if (H5VL__reparse_def_vol_conn_variable_test() < 0)
+ TEST_ERROR
+ } /* end if */
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl_id);
+ H5VLunregister_connector(vol_id);
+ }
+ H5E_END_TRY;
+ HDfree(conn_env_str);
+
+ return FAIL;
+} /* end test_async_vol_props() */
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1192,6 +2121,7 @@ main(void)
HDputs("Testing basic Virtual Object Layer (VOL) functionality.");
nerrors += test_vol_registration() < 0 ? 1 : 0;
+ nerrors += test_register_opt_operation() < 0 ? 1 : 0;
nerrors += test_native_vol_init() < 0 ? 1 : 0;
nerrors += test_basic_file_operation(env_h5_drvr) < 0 ? 1 : 0;
nerrors += test_basic_group_operation() < 0 ? 1 : 0;
@@ -1200,6 +2130,7 @@ main(void)
nerrors += test_basic_object_operation() < 0 ? 1 : 0;
nerrors += test_basic_link_operation() < 0 ? 1 : 0;
nerrors += test_basic_datatype_operation() < 0 ? 1 : 0;
+ nerrors += test_async_vol_props() < 0 ? 1 : 0;
if (nerrors) {
HDprintf("***** %d Virtual Object Layer TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
diff --git a/test/vol_plugin.c b/test/vol_plugin.c
index 8bd6848..7656870 100644
--- a/test/vol_plugin.c
+++ b/test/vol_plugin.c
@@ -71,7 +71,10 @@ test_registration_by_value(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5VLunregister_connector(vol_id); }
+ H5E_BEGIN_TRY
+ {
+ H5VLunregister_connector(vol_id);
+ }
H5E_END_TRY;
return FAIL;
@@ -125,7 +128,10 @@ test_registration_by_name(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5VLunregister_connector(vol_id); }
+ H5E_BEGIN_TRY
+ {
+ H5VLunregister_connector(vol_id);
+ }
H5E_END_TRY;
return FAIL;
diff --git a/testpar/CMakeVFDTests.cmake b/testpar/CMakeVFDTests.cmake
index 32f9337..f50ca16 100644
--- a/testpar/CMakeVFDTests.cmake
+++ b/testpar/CMakeVFDTests.cmake
@@ -30,7 +30,7 @@ set (H5P_VFD_TESTS
t_pflush2
)
-if (DIRECT_VFD)
+if (H5_HAVE_DIRECT)
set (VFD_LIST ${VFD_LIST} direct)
endif ()
@@ -58,9 +58,9 @@ macro (ADD_VFD_TEST vfdname resultcode)
WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}
)
endforeach ()
- set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush1 PROPERTIES WILL_FAIL "true")
+ set_tests_properties (MPI_TEST_VFD-${vfdname}-t_pflush1 PROPERTIES WILL_FAIL "true")
#set_property (TEST MPI_TEST_t_pflush1 PROPERTY PASS_REGULAR_EXPRESSION "PASSED")
- set_tests_properties (MPI_TEST_VFD-${vfdname}-pflush2 PROPERTIES DEPENDS MPI_TEST_VFD-${vfdname}-pflush1)
+ set_tests_properties (MPI_TEST_VFD-${vfdname}-t_pflush2 PROPERTIES DEPENDS MPI_TEST_VFD-${vfdname}-t_pflush1)
endif ()
endmacro ()
diff --git a/testpar/COPYING b/testpar/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/testpar/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index 7884ecb..4389ea5 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -1103,8 +1103,9 @@ dataset_big_read(void)
static void
single_rank_independent_io(void)
{
+#if HDF5_BIG_SELECTION_IO_WORKS
if (mpi_rank_g == 0)
- HDprintf("single_rank_independent_io\n");
+ HDprintf("\nSingle Rank Independent I/O\n");
if (MAIN_PROCESS) {
hsize_t dims[] = {LARGE_DIM};
@@ -1155,6 +1156,7 @@ single_rank_independent_io(void)
HDremove(FILENAME[1]);
}
MPI_Barrier(MPI_COMM_WORLD);
+#endif
}
/*
@@ -1223,8 +1225,6 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
* Programmer: Unknown
* July 12th, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -1250,7 +1250,7 @@ coll_chunk1(void)
{
const char *filename = FILENAME[0];
if (mpi_rank_g == 0)
- HDprintf("coll_chunk1\n");
+ HDprintf("\nCollective chunk I/O Test #1\n");
coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1303,7 +1303,7 @@ coll_chunk2(void)
{
const char *filename = FILENAME[0];
if (mpi_rank_g == 0)
- HDprintf("coll_chunk2\n");
+ HDprintf("\nCollective chunk I/O Test #2\n");
coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1329,8 +1329,6 @@ coll_chunk2(void)
* Programmer: Unknown
* July 12th, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -1357,7 +1355,7 @@ coll_chunk3(void)
{
const char *filename = FILENAME[0];
if (mpi_rank_g == 0)
- HDprintf("coll_chunk3\n");
+ HDprintf("\nCollective chunk I/O Test #3\n");
coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1385,17 +1383,9 @@ coll_chunk3(void)
*
* Failure: -1
*
- * Modifications:
- * Remove invalid temporary property checkings for API_LINK_HARD and
- * API_LINK_TRUE cases.
- * Programmer: Jonathan Kim
- * Date: 2012-10-10
- *
* Programmer: Unknown
* July 12th, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -1845,55 +1835,10 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap
HDfree(data_origin1);
}
-/*****************************************************************************
- *
- * Function: do_express_test()
- *
- * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
- * by GetTestExpress() across all processes. Return this
- * value.
- *
- * Envirmoment variables can be different across different
- * processes. This function ensures that all processes agree
- * on whether to do an express test.
- *
- * Return: Success: Maximum of the values returned by
- * GetTestExpress() across all processes.
- *
- * Failure: -1
- *
- * Programmer: JRM -- 4/25/06
- *
- *****************************************************************************/
-static int
-do_express_test(int world_mpi_rank)
-{
- int express_test;
- int max_express_test;
- int result;
-
- express_test = GetTestExpress();
-
- result =
- MPI_Allreduce((void *)&express_test, (void *)&max_express_test, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
-
- if (result != MPI_SUCCESS) {
- nerrors++;
- max_express_test = -1;
- if (VERBOSE_MED && (world_mpi_rank == 0)) {
- HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n", world_mpi_rank, FUNC);
- }
- }
-
- return (max_express_test);
-
-} /* do_express_test() */
-
int
main(int argc, char **argv)
{
- int ExpressMode = 0;
- hsize_t newsize = 1048576;
+ hsize_t newsize = 1048576;
/* Set the bigio processing limit to be 'newsize' bytes */
hsize_t oldsize = H5_mpi_set_bigio_count(newsize);
@@ -1902,9 +1847,8 @@ main(int argc, char **argv)
* that we try to ensure that our bigio handling is actually
* envoked and tested.
*/
- if (newsize != oldsize) {
+ if (newsize != oldsize)
bigcount = newsize * 2;
- }
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size_g);
@@ -1915,14 +1859,11 @@ main(int argc, char **argv)
* hang in the atexit post processing in which it may try to make MPI
* calls. By then, MPI calls may not work.
*/
- if (H5dont_atexit() < 0) {
+ if (H5dont_atexit() < 0)
HDprintf("Failed to turn off atexit processing. Continue.\n");
- };
/* set alarm. */
- ALARM_ON;
-
- ExpressMode = do_express_test(mpi_rank_g);
+ TestAlarmOn();
dataset_big_write();
MPI_Barrier(MPI_COMM_WORLD);
@@ -1930,22 +1871,16 @@ main(int argc, char **argv)
dataset_big_read();
MPI_Barrier(MPI_COMM_WORLD);
- if (ExpressMode > 0) {
- if (mpi_rank_g == 0)
- HDprintf("***Express test mode on. Several tests are skipped\n");
- }
- else {
- coll_chunk1();
- MPI_Barrier(MPI_COMM_WORLD);
- coll_chunk2();
- MPI_Barrier(MPI_COMM_WORLD);
- coll_chunk3();
- MPI_Barrier(MPI_COMM_WORLD);
- single_rank_independent_io();
- }
+ coll_chunk1();
+ MPI_Barrier(MPI_COMM_WORLD);
+ coll_chunk2();
+ MPI_Barrier(MPI_COMM_WORLD);
+ coll_chunk3();
+ MPI_Barrier(MPI_COMM_WORLD);
+ single_rank_independent_io();
/* turn off alarm */
- ALARM_OFF;
+ TestAlarmOff();
if (mpi_rank_g == 0)
HDremove(FILENAME[0]);
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 4846a75..8696092 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -577,7 +577,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Comm_group() failed with error %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: MPI_Comm_group() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
}
}
@@ -594,7 +594,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Group_excl() failed with error %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: MPI_Group_excl() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
}
}
@@ -609,8 +609,8 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Comm_create() failed with error %d.\n", world_mpi_rank, FUNC,
- mpi_result);
+ HDfprintf(stdout, "%d:%s: MPI_Comm_create() failed with error %d.\n", world_mpi_rank,
+ __func__, mpi_result);
}
}
else {
@@ -622,7 +622,8 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: file_mpi_comm == MPI_COMM_NULL.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: file_mpi_comm == MPI_COMM_NULL.\n", world_mpi_rank,
+ __func__);
}
}
}
@@ -635,7 +636,8 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: file_mpi_comm != MPI_COMM_NULL.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: file_mpi_comm != MPI_COMM_NULL.\n", world_mpi_rank,
+ __func__);
}
}
}
@@ -651,7 +653,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Comm_size() failed with error %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: MPI_Comm_size() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
}
}
@@ -666,7 +668,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Comm_rank() failed with error %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: MPI_Comm_rank() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
}
}
@@ -832,7 +834,7 @@ do_express_test(void)
nerrors++;
max_express_test = -1;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n", world_mpi_rank, __func__);
}
}
@@ -880,7 +882,7 @@ do_sync(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -891,7 +893,7 @@ do_sync(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
else if ((mssg.req != SYNC_ACK_CODE) || (mssg.src != world_server_mpi_rank) ||
@@ -899,7 +901,7 @@ do_sync(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in sync ack.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in sync ack.\n", world_mpi_rank, __func__);
}
}
}
@@ -936,7 +938,7 @@ get_max_nerrors(void)
nerrors++;
max_nerrors = -1;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n", world_mpi_rank, __func__);
}
}
@@ -983,7 +985,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: bad param(s) on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: bad param(s) on entry.\n", world_mpi_rank, __func__);
}
}
else {
@@ -1000,7 +1002,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Recv() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Recv() failed.\n", world_mpi_rank, __func__);
}
}
else if (mssg_ptr->magic != MSSG_MAGIC) {
@@ -1008,7 +1010,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: invalid magic.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: invalid magic.\n", world_mpi_rank, __func__);
}
}
else if (mssg_ptr->src != status.MPI_SOURCE) {
@@ -1016,7 +1018,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: mssg_ptr->src != status.MPI_SOURCE.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: mssg_ptr->src != status.MPI_SOURCE.\n", world_mpi_rank, __func__);
}
}
}
@@ -1061,7 +1063,7 @@ send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Invalid mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Invalid mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -1081,7 +1083,7 @@ send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Send() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Send() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -1130,7 +1132,7 @@ setup_derived_types(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Get_address() call failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Get_address() call failed.\n", world_mpi_rank, __func__);
}
}
else {
@@ -1150,7 +1152,7 @@ setup_derived_types(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Type_create_struct() call failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Type_create_struct() call failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -1164,7 +1166,7 @@ setup_derived_types(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Type_commit() call failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Type_commit() call failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -1200,7 +1202,7 @@ takedown_derived_types(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: MPI_Type_free() call failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: MPI_Type_free() call failed.\n", world_mpi_rank, __func__);
}
}
@@ -1253,7 +1255,7 @@ reset_server_counters(void)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%d).\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%d).\n", world_mpi_rank, __func__,
actual_total_reads, total_reads);
}
}
@@ -1263,7 +1265,7 @@ reset_server_counters(void)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%d).\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%d).\n", world_mpi_rank, __func__,
actual_total_writes, total_writes);
}
}
@@ -1311,7 +1313,7 @@ server_main(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: This isn't the server process?!?!?\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: This isn't the server process?!?!?\n", world_mpi_rank, __func__);
}
}
@@ -1328,7 +1330,7 @@ server_main(void)
case WRITE_REQ_ACK_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received write ack?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received write ack?!?.\n", __func__);
break;
case READ_REQ_CODE:
@@ -1338,7 +1340,7 @@ server_main(void)
case READ_REQ_REPLY_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received read req reply?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received read req reply?!?.\n", __func__);
break;
case SYNC_REQ_CODE:
@@ -1348,7 +1350,7 @@ server_main(void)
case SYNC_ACK_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received sync ack?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received sync ack?!?.\n", __func__);
break;
case REQ_TTL_WRITES_CODE:
@@ -1358,7 +1360,7 @@ server_main(void)
case REQ_TTL_WRITES_RPLY_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received total writes reply?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received total writes reply?!?.\n", __func__);
break;
case REQ_TTL_READS_CODE:
@@ -1368,7 +1370,7 @@ server_main(void)
case REQ_TTL_READS_RPLY_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received total reads reply?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received total reads reply?!?.\n", __func__);
break;
case REQ_ENTRY_WRITES_CODE:
@@ -1378,7 +1380,7 @@ server_main(void)
case REQ_ENTRY_WRITES_RPLY_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", __func__);
break;
case REQ_ENTRY_READS_CODE:
@@ -1388,7 +1390,7 @@ server_main(void)
case REQ_ENTRY_READS_RPLY_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", __func__);
break;
case REQ_RW_COUNT_RESET_CODE:
@@ -1398,7 +1400,7 @@ server_main(void)
case REQ_RW_COUNT_RESET_RPLY_CODE:
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", FUNC);
+ HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", __func__);
break;
case DONE_REQ_CODE:
@@ -1411,7 +1413,7 @@ server_main(void)
nerrors++;
success = FALSE;
if (verbose)
- HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, __func__);
break;
}
}
@@ -1453,7 +1455,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -1467,7 +1469,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
}
}
@@ -1476,7 +1478,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, __func__,
data[target_index].len, mssg_ptr->len);
}
}
@@ -1488,7 +1490,8 @@ serve_read_request(struct mssg_t *mssg_ptr)
HDfprintf(stdout,
"%d:%s: proc %d read invalid entry. "
"idx/base_addr = %d/%" PRIuHADDR ".\n",
- world_mpi_rank, FUNC, mssg_ptr->src, target_index, data[target_index].base_addr);
+ world_mpi_rank, __func__, mssg_ptr->src, target_index,
+ data[target_index].base_addr);
}
}
else {
@@ -1568,7 +1571,7 @@ serve_sync_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -1642,7 +1645,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -1656,7 +1659,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
}
}
@@ -1665,7 +1668,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, __func__,
data[target_index].len, mssg_ptr->len);
}
}
@@ -1681,8 +1684,8 @@ serve_write_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: new ver = %d <= old ver = %d.\n", world_mpi_rank, FUNC, new_ver_num,
- data[target_index].ver);
+ HDfprintf(stdout, "%d:%s: new ver = %d <= old ver = %d.\n", world_mpi_rank, __func__,
+ new_ver_num, data[target_index].ver);
}
}
}
@@ -1767,7 +1770,7 @@ serve_total_writes_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -1837,7 +1840,7 @@ serve_total_reads_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -1909,7 +1912,7 @@ serve_entry_writes_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -1923,7 +1926,7 @@ serve_entry_writes_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
}
}
@@ -1998,7 +2001,7 @@ serve_entry_reads_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -2012,7 +2015,7 @@ serve_entry_reads_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
}
}
@@ -2084,7 +2087,7 @@ serve_rw_count_reset_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
}
@@ -2436,7 +2439,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
@@ -2447,7 +2450,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -2462,7 +2465,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", world_mpi_rank, __func__);
}
#if 0 /* This has been useful debugging code -- keep it for now. */
@@ -2470,35 +2473,35 @@ datum_notify(H5C_notify_action_t action, void *thing)
HDfprintf(stdout,
"%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
HDfprintf(stdout, "%d:%s: mssg.req = %d.\n",
- world_mpi_rank, FUNC, (int)(mssg.req));
+ world_mpi_rank, __func__, (int)(mssg.req));
}
if ( mssg.src != world_server_mpi_rank ) {
HDfprintf(stdout,
"%d:%s: mssg.src != world_server_mpi_rank.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
}
if ( mssg.dest != world_mpi_rank ) {
HDfprintf(stdout,
"%d:%s: mssg.dest != world_mpi_rank.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
}
if ( mssg.base_addr != entry_ptr->base_addr ) {
HDfprintf(stdout,
"%d:%s: mssg.base_addr != entry_ptr->base_addr.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
HDfprintf(stdout, "%d:%s: mssg.base_addr = %" PRIuHADDR ".\n",
- world_mpi_rank, FUNC, mssg.base_addr);
+ world_mpi_rank, __func__, mssg.base_addr);
HDfprintf(stdout,
"%d:%s: entry_ptr->base_addr = %" PRIuHADDR ".\n",
- world_mpi_rank, FUNC,
+ world_mpi_rank, __func__,
entry_ptr->base_addr);
}
@@ -2506,22 +2509,22 @@ datum_notify(H5C_notify_action_t action, void *thing)
HDfprintf(stdout,
"%d:%s: mssg.len != entry_ptr->len.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
HDfprintf(stdout, "%d:%s: mssg.len = %" PRIuHADDR ".\n",
- world_mpi_rank, FUNC, mssg.len);
+ world_mpi_rank, __func__, mssg.len);
}
if ( mssg.ver < entry_ptr->ver ) {
HDfprintf(stdout,
"%d:%s: mssg.ver < entry_ptr->ver.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
}
if ( mssg.magic != MSSG_MAGIC ) {
HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
}
#endif /* JRM */
}
@@ -2554,7 +2557,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
ret_value = FAIL;
HDfprintf(stdout, "%d:%s: Flushed dirty entry from non-zero file process.", world_mpi_rank,
- FUNC);
+ __func__);
}
if (ret_value == SUCCEED) {
@@ -2581,7 +2584,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
else {
@@ -2600,7 +2603,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
else if ((mssg.req != WRITE_REQ_ACK_CODE) || (mssg.src != world_server_mpi_rank) ||
@@ -2611,7 +2614,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", world_mpi_rank, __func__);
}
}
}
@@ -2717,7 +2720,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
nerrors++;
ret_value = FAIL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Unknown notify action.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Unknown notify action.\n", world_mpi_rank, __func__);
}
break;
}
@@ -2824,7 +2827,7 @@ expunge_entry(H5F_t *file_ptr, int32_t idx)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n", world_mpi_rank, __func__);
}
}
@@ -2838,14 +2841,14 @@ expunge_entry(H5F_t *file_ptr, int32_t idx)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n", world_mpi_rank, __func__);
}
}
else if (in_cache) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n", world_mpi_rank, __func__);
}
}
}
@@ -2906,7 +2909,7 @@ insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n", world_mpi_rank, __func__);
}
}
@@ -2927,8 +2930,8 @@ insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", world_mpi_rank, FUNC, idx,
- (int)(data[idx].header.is_dirty));
+ HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", world_mpi_rank, __func__,
+ idx, (int)(data[idx].header.is_dirty));
}
}
}
@@ -3268,7 +3271,7 @@ lock_entry(H5F_t *file_ptr, int32_t idx)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n", world_mpi_rank, __func__);
}
}
else {
@@ -3321,7 +3324,7 @@ mark_entry_dirty(int32_t idx)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: error in H5AC_mark_entry_dirty().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: error in H5AC_mark_entry_dirty().\n", world_mpi_rank, __func__);
}
}
else if (!(entry_ptr->locked)) {
@@ -3432,7 +3435,7 @@ pin_protected_entry(int32_t idx, hbool_t global)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Error in H5AC_pin_protected entry().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Error in H5AC_pin_protected entry().\n", world_mpi_rank, __func__);
}
}
@@ -3536,7 +3539,7 @@ move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n", world_mpi_rank, __func__);
}
}
else {
@@ -3560,7 +3563,7 @@ move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n", world_mpi_rank, __func__,
new_idx, (int)(data[new_idx].header.is_dirty));
}
}
@@ -3612,7 +3615,7 @@ reset_server_counts(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -3624,7 +3627,7 @@ reset_server_counts(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
else if ((mssg.req != REQ_RW_COUNT_RESET_RPLY_CODE) || (mssg.src != world_server_mpi_rank) ||
@@ -3634,7 +3637,8 @@ reset_server_counts(void)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in req r/w counter reset reply.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in req r/w counter reset reply.\n", world_mpi_rank,
+ __func__);
}
}
}
@@ -3685,7 +3689,7 @@ resize_entry(int32_t idx, size_t new_size)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n", world_mpi_rank, __func__);
}
}
else {
@@ -3750,13 +3754,13 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (fid < 0) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n", world_mpi_rank, __func__);
}
}
else if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
}
}
else {
@@ -3766,7 +3770,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (file_ptr == NULL) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n", world_mpi_rank, __func__);
}
}
else {
@@ -3776,13 +3780,13 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (cache_ptr == NULL) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n", world_mpi_rank, __func__);
}
}
else if (cache_ptr->magic != H5C__H5C_T_MAGIC) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n", world_mpi_rank, __func__);
}
}
else {
@@ -3800,7 +3804,8 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
- HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n", world_mpi_rank,
+ __func__);
}
else {
@@ -3810,11 +3815,11 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (H5AC_set_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
else if (enable_rpt_fcn) {
- HDfprintf(stdout, "%d:%s: rpt_fcn enabled.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: rpt_fcn enabled.\n", world_mpi_rank, __func__);
}
}
}
@@ -3830,7 +3835,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n", world_mpi_rank, __func__);
}
}
else if (((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC) {
@@ -3838,7 +3843,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
}
}
else if (((H5AC_aux_t *)(cache_ptr->aux_ptr))->metadata_write_strategy != metadata_write_strategy) {
@@ -3846,7 +3851,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: bad cache_ptr->aux_ptr->metadata_write_strategy\n", world_mpi_rank,
- FUNC);
+ __func__);
}
}
}
@@ -3861,7 +3866,8 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (H5AC_get_cache_auto_resize_config(cache_ptr, &test_config) != SUCCEED) {
- HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n", world_mpi_rank,
+ __func__);
}
else if (test_config.metadata_write_strategy != metadata_write_strategy) {
@@ -3869,7 +3875,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (verbose) {
- HDfprintf(stdout, "%d:%s: unexpected metadata_write_strategy.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: unexpected metadata_write_strategy.\n", world_mpi_rank, __func__);
}
}
}
@@ -3889,7 +3895,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", world_mpi_rank, __func__);
}
}
else if (actual_base_addr > BASE_ADDR) {
@@ -3902,7 +3908,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", world_mpi_rank, __func__);
}
}
}
@@ -3913,7 +3919,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: second H5Fflush() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -3926,7 +3932,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5C_set_write_done_callback failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5C_set_write_done_callback failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -3940,7 +3946,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: H5AC__set_sync_point_done_callback failed.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
}
}
@@ -3996,7 +4002,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
proceed = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 1 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 1 failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4019,7 +4025,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
proceed = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 2 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 2 failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4034,11 +4040,11 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
if (proceed) {
- HDfprintf(stdout, "%d:%s: verified %u writes.\n", world_mpi_rank, FUNC, num_writes);
+ HDfprintf(stdout, "%d:%s: verified %u writes.\n", world_mpi_rank, __func__, num_writes);
}
else {
- HDfprintf(stdout, "%d:%s: FAILED to verify %u writes.\n", world_mpi_rank, FUNC, num_writes);
+ HDfprintf(stdout, "%d:%s: FAILED to verify %u writes.\n", world_mpi_rank, __func__, num_writes);
}
}
@@ -4055,7 +4061,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
proceed = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 3 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 3 failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4098,7 +4104,7 @@ setup_rand(void)
HDassert(world_mpi_rank < world_mpi_size);
seed = predefined_seeds[world_mpi_rank];
- HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", world_mpi_rank, FUNC, seed);
+ HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", world_mpi_rank, __func__, seed);
fflush(stdout);
HDsrand(seed);
}
@@ -4108,13 +4114,13 @@ setup_rand(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n", world_mpi_rank, __func__);
}
}
else {
seed = (unsigned)tv.tv_usec;
if (verbose) {
- HDfprintf(stdout, "%d:%s: seed = %d.\n", world_mpi_rank, FUNC, seed);
+ HDfprintf(stdout, "%d:%s: seed = %d.\n", world_mpi_rank, __func__, seed);
fflush(stdout);
}
HDsrand(seed);
@@ -4154,7 +4160,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
}
}
@@ -4171,7 +4177,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: H5AC__set_sync_point_done_callback failed.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
}
}
@@ -4182,7 +4188,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fclose() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fclose() failed.\n", world_mpi_rank, __func__);
}
}
@@ -4198,7 +4204,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: HDremove() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: HDremove() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4260,7 +4266,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4272,7 +4278,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4286,7 +4292,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in req entry reads reply.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in req entry reads reply.\n", world_mpi_rank, __func__);
}
}
else {
@@ -4303,7 +4309,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
success = FALSE;
if (verbose) {
HDfprintf(stdout, "%d:%s: rep/exp entry 0x%" PRIxHADDR " reads mismatch (%d/%d).\n",
- world_mpi_rank, FUNC, addr, reported_entry_reads, expected_entry_reads);
+ world_mpi_rank, __func__, addr, reported_entry_reads, expected_entry_reads);
}
}
}
@@ -4357,7 +4363,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4369,7 +4375,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4383,7 +4389,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in req entry writes reply.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in req entry writes reply.\n", world_mpi_rank, __func__);
}
}
else {
@@ -4400,7 +4406,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
success = FALSE;
if (verbose) {
HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx writes mismatch (%d/%d).\n", world_mpi_rank,
- FUNC, (long long)addr, reported_entry_writes, expected_entry_writes);
+ __func__, (long long)addr, reported_entry_writes, expected_entry_writes);
}
}
}
@@ -4453,7 +4459,7 @@ verify_total_reads(int expected_total_reads)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4465,7 +4471,7 @@ verify_total_reads(int expected_total_reads)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
else if ((mssg.req != REQ_TTL_READS_RPLY_CODE) || (mssg.src != world_server_mpi_rank) ||
@@ -4475,7 +4481,7 @@ verify_total_reads(int expected_total_reads)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", world_mpi_rank, __func__);
}
}
else {
@@ -4492,7 +4498,7 @@ verify_total_reads(int expected_total_reads)
success = FALSE;
if (verbose) {
HDfprintf(stdout, "%d:%s: reported/expected total reads mismatch (%ld/%d).\n", world_mpi_rank,
- FUNC, reported_total_reads, expected_total_reads);
+ __func__, reported_total_reads, expected_total_reads);
}
}
}
@@ -4545,7 +4551,7 @@ verify_total_writes(unsigned expected_total_writes)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4557,7 +4563,7 @@ verify_total_writes(unsigned expected_total_writes)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
else if ((mssg.req != REQ_TTL_WRITES_RPLY_CODE) || (mssg.src != world_server_mpi_rank) ||
@@ -4567,7 +4573,7 @@ verify_total_writes(unsigned expected_total_writes)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", world_mpi_rank, __func__);
}
}
else {
@@ -4584,7 +4590,7 @@ verify_total_writes(unsigned expected_total_writes)
success = FALSE;
if (verbose) {
HDfprintf(stdout, "%d:%s: reported/expected total writes mismatch (%u/%u).\n", world_mpi_rank,
- FUNC, reported_total_writes, expected_total_writes);
+ __func__, reported_total_writes, expected_total_writes);
}
}
}
@@ -4646,7 +4652,7 @@ unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: error in H5AC_unprotect().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: error in H5AC_unprotect().\n", world_mpi_rank, __func__);
}
}
else {
@@ -4730,7 +4736,7 @@ unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n", world_mpi_rank, __func__);
}
}
}
@@ -4791,7 +4797,7 @@ server_smoke_check(void)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4812,7 +4818,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n", world_mpi_rank, __func__);
}
}
@@ -4827,7 +4833,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4843,7 +4849,7 @@ server_smoke_check(void)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", world_mpi_rank, __func__);
}
}
}
@@ -4858,7 +4864,7 @@ server_smoke_check(void)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 1 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 1 failed.\n", world_mpi_rank, __func__);
}
}
@@ -4890,7 +4896,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 2 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 2 failed.\n", world_mpi_rank, __func__);
}
}
@@ -4913,7 +4919,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on write.\n", world_mpi_rank, __func__);
}
}
}
@@ -4927,7 +4933,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -4943,7 +4949,7 @@ server_smoke_check(void)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", world_mpi_rank, __func__);
}
}
}
@@ -4954,7 +4960,7 @@ server_smoke_check(void)
success = FALSE;
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 3 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 3 failed.\n", world_mpi_rank, __func__);
}
}
@@ -4985,7 +4991,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 4 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 4 failed.\n", world_mpi_rank, __func__);
}
}
@@ -5001,7 +5007,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 5 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 5 failed.\n", world_mpi_rank, __func__);
}
}
@@ -5032,7 +5038,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: barrier 6 failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: barrier 6 failed.\n", world_mpi_rank, __func__);
}
}
@@ -5055,7 +5061,7 @@ server_smoke_check(void)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
}
}
@@ -5138,7 +5144,7 @@ smoke_check_1(int metadata_write_strategy)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5150,7 +5156,7 @@ smoke_check_1(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, __func__);
}
}
@@ -5183,7 +5189,7 @@ smoke_check_1(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5216,7 +5222,7 @@ smoke_check_1(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
}
}
@@ -5302,7 +5308,7 @@ smoke_check_2(int metadata_write_strategy)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5314,7 +5320,7 @@ smoke_check_2(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, __func__);
}
}
@@ -5381,7 +5387,7 @@ smoke_check_2(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5414,7 +5420,7 @@ smoke_check_2(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
}
}
@@ -5507,7 +5513,7 @@ smoke_check_3(int metadata_write_strategy)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5519,7 +5525,7 @@ smoke_check_3(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, __func__);
}
}
@@ -5573,7 +5579,7 @@ smoke_check_3(int metadata_write_strategy)
if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
}
}
@@ -5666,7 +5672,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5699,7 +5705,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
}
}
@@ -5792,7 +5798,7 @@ smoke_check_4(int metadata_write_strategy)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5804,7 +5810,7 @@ smoke_check_4(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, __func__);
}
}
@@ -5870,7 +5876,7 @@ smoke_check_4(int metadata_write_strategy)
if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
}
}
@@ -5950,7 +5956,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -5983,7 +5989,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
}
}
@@ -6067,7 +6073,7 @@ smoke_check_5(int metadata_write_strategy)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -6080,7 +6086,7 @@ smoke_check_5(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, __func__);
}
}
@@ -6092,7 +6098,7 @@ smoke_check_5(int metadata_write_strategy)
if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
}
}
@@ -6142,7 +6148,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -6175,7 +6181,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
}
}
@@ -6352,7 +6358,7 @@ trace_file_check(int metadata_write_strategy)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose)
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
else {
@@ -6364,7 +6370,7 @@ trace_file_check(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if (verbose)
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, __func__);
}
if (nerrors == 0) {
@@ -6374,7 +6380,7 @@ trace_file_check(int metadata_write_strategy)
if (H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
nerrors++;
HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
else {
config.open_trace_file = TRUE;
@@ -6383,7 +6389,7 @@ trace_file_check(int metadata_write_strategy)
if (H5AC_set_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
nerrors++;
HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
}
} /* end if */
@@ -6418,7 +6424,7 @@ trace_file_check(int metadata_write_strategy)
if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
if (verbose)
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
}
if (nerrors == 0) {
@@ -6427,7 +6433,7 @@ trace_file_check(int metadata_write_strategy)
if (H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
nerrors++;
HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
else {
config.open_trace_file = FALSE;
@@ -6437,7 +6443,7 @@ trace_file_check(int metadata_write_strategy)
if (H5AC_set_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
nerrors++;
HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
}
} /* end if */
@@ -6447,7 +6453,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if (verbose)
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, __func__);
}
} /* end if */
@@ -6477,7 +6483,7 @@ trace_file_check(int metadata_write_strategy)
if (!success) {
nerrors++;
if (verbose)
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
} /* end if */
@@ -6488,7 +6494,7 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if (verbose)
- HDfprintf(stdout, "%d:%s: HDfopen failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: HDfopen failed.\n", world_mpi_rank, __func__);
}
} /* end if */
@@ -6517,17 +6523,17 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank,
- FUNC, i);
+ __func__, i);
if (expected_line_len == 0) {
- HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, __func__,
"<EMPTY>", expected_line_len);
- HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, FUNC, buffer,
- actual_line_len);
+ HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, __func__,
+ buffer, actual_line_len);
}
if (actual_line_len == 0) {
- HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, __func__,
(*expected_output)[i], expected_line_len);
- HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, __func__,
"<EMPTY>", actual_line_len);
}
}
@@ -6542,10 +6548,10 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank,
- FUNC, i);
- HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, FUNC,
+ __func__, i);
+ HDfprintf(stdout, "%d:%s: expected = \"%s\" %zu\n", world_mpi_rank, __func__,
(*expected_output)[i], expected_line_len);
- HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, FUNC, buffer,
+ HDfprintf(stdout, "%d:%s: actual = \"%s\" %zu\n", world_mpi_rank, __func__, buffer,
actual_line_len);
}
}
@@ -6563,10 +6569,10 @@ trace_file_check(int metadata_write_strategy)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank,
- FUNC, i);
- HDfprintf(stdout, "%d:%s: expected = \"%s\"\n", world_mpi_rank, FUNC,
+ __func__, i);
+ HDfprintf(stdout, "%d:%s: expected = \"%s\"\n", world_mpi_rank, __func__,
(*expected_output)[i]);
- HDfprintf(stdout, "%d:%s: actual = \"%s\"\n", world_mpi_rank, FUNC, tok);
+ HDfprintf(stdout, "%d:%s: actual = \"%s\"\n", world_mpi_rank, __func__, tok);
}
}
} /* end else */
@@ -6657,7 +6663,7 @@ smoke_check_6(int metadata_write_strategy)
/* some error occured in the server -- report failure */
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -6671,7 +6677,7 @@ smoke_check_6(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if (verbose) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, __func__);
}
}
@@ -6690,7 +6696,7 @@ smoke_check_6(int metadata_write_strategy)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: Entry inserted not marked as collective.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
}
@@ -6711,7 +6717,7 @@ smoke_check_6(int metadata_write_strategy)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: Entry inserted indepedently marked as collective.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
}
}
@@ -6723,7 +6729,7 @@ smoke_check_6(int metadata_write_strategy)
if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
}
}
@@ -6739,7 +6745,7 @@ smoke_check_6(int metadata_write_strategy)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: Entry protected not marked as collective.\n", world_mpi_rank,
- FUNC);
+ __func__);
}
}
@@ -6759,7 +6765,7 @@ smoke_check_6(int metadata_write_strategy)
nerrors++;
if (verbose) {
HDfprintf(stdout, "%d:%s: Entry inserted indepedently marked as collective.\n",
- world_mpi_rank, FUNC);
+ world_mpi_rank, __func__);
}
}
@@ -6777,7 +6783,7 @@ smoke_check_6(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, __func__);
}
}
}
@@ -6810,7 +6816,7 @@ smoke_check_6(int metadata_write_strategy)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, __func__);
}
}
}
@@ -6874,28 +6880,20 @@ main(int argc, char **argv)
* hang in the atexit post processing in which it may try to make MPI
* calls. By then, MPI calls may not work.
*/
- if (H5dont_atexit() < 0) {
+ if (H5dont_atexit() < 0)
HDprintf("%d:Failed to turn off atexit processing. Continue.\n", mpi_rank);
- };
+
H5open();
express_test = do_express_test();
-#if 0 /* JRM */
- express_test = 0;
-#endif /* JRM */
- if (express_test) {
-
+ if (express_test)
virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES;
- }
- else {
-
+ else
virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES;
- }
#ifdef H5_HAVE_MPE
- if (MAINPROCESS) {
+ if (MAINPROCESS)
HDprintf(" Tests compiled for MPE.\n");
- }
virt_num_data_entries = MPE_VIRT_NUM_DATA_ENTIES;
#endif /* H5_HAVE_MPE */
@@ -6908,11 +6906,8 @@ main(int argc, char **argv)
}
if (mpi_size < 3) {
-
- if (MAINPROCESS) {
-
+ if (MAINPROCESS)
HDprintf(" Need at least 3 processes. Exiting.\n");
- }
goto finish;
}
@@ -6930,27 +6925,22 @@ main(int argc, char **argv)
/* setup file access property list with the world communicator */
if (FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS))) {
nerrors++;
- if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", world_mpi_rank, FUNC);
- }
+ if (verbose)
+ HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n", world_mpi_rank, __func__);
}
if (H5Pset_fapl_mpio(fapl, world_mpi_comm, MPI_INFO_NULL) < 0) {
-
nerrors++;
- if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 1.\n", world_mpi_rank, FUNC);
- }
+ if (verbose)
+ HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 1.\n", world_mpi_rank, __func__);
}
/* fix the file names */
for (u = 0; u < sizeof(FILENAME) / sizeof(FILENAME[0]) - 1; ++u) {
if (h5_fixname(FILENAME[u], fapl, filenames[u], sizeof(filenames[u])) == NULL) {
-
nerrors++;
- if (verbose) {
- HDfprintf(stdout, "%d:%s: h5_fixname() failed.\n", world_mpi_rank, FUNC);
- }
+ if (verbose)
+ HDfprintf(stdout, "%d:%s: h5_fixname() failed.\n", world_mpi_rank, __func__);
break;
}
}
@@ -6958,9 +6948,8 @@ main(int argc, char **argv)
/* close the fapl before we set it up again */
if (H5Pclose(fapl) < 0) {
nerrors++;
- if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", world_mpi_rank, FUNC);
- }
+ if (verbose)
+ HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n", world_mpi_rank, __func__);
}
/* now create the fapl again, excluding the server process. */
@@ -6969,32 +6958,25 @@ main(int argc, char **argv)
/* setup file access property list */
if (FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS))) {
nerrors++;
- if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", world_mpi_rank, FUNC);
- }
+ if (verbose)
+ HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n", world_mpi_rank, __func__);
}
if (H5Pset_fapl_mpio(fapl, file_mpi_comm, MPI_INFO_NULL) < 0) {
-
nerrors++;
- if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", world_mpi_rank, FUNC);
- }
+ if (verbose)
+ HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n", world_mpi_rank, __func__);
}
}
setup_rand();
max_nerrors = get_max_nerrors();
-
if (max_nerrors != 0) {
/* errors in setup -- no point in continuing */
-
- if (world_mpi_rank == 0) {
-
+ if (world_mpi_rank == 0)
HDfprintf(stdout, "Errors in test initialization. Exiting.\n");
- }
goto finish;
}
@@ -7028,7 +7010,8 @@ main(int argc, char **argv)
nerrors++;
if (verbose) {
- HDfprintf(stdout, "%d:%s: H5Pset_all_coll_metadata_ops() failed 1.\n", world_mpi_rank, FUNC);
+ HDfprintf(stdout, "%d:%s: H5Pset_all_coll_metadata_ops() failed 1.\n", world_mpi_rank,
+ __func__);
}
}
}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index d65a2a9..19caff5 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -1627,9 +1627,6 @@ extend_writeInd(void)
VRFY((mem_dataspace >= 0), "");
/* Try write to dataset2 beyond its current dim sizes. Should fail. */
- /* Temporary turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
/* create a file dataspace independently */
file_dataspace = H5Dget_space(dataset2);
@@ -1638,11 +1635,13 @@ extend_writeInd(void)
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently. Should fail. */
- ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, data_array1);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, data_array1);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dwrite failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
@@ -1911,20 +1910,19 @@ extend_readInd(void)
VRFY((dataset2 >= 0), "");
/* Try extend dataset1 which is open RDONLY. Should fail. */
- /* first turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
file_dataspace = H5Dget_space(dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded");
dims[0]++;
- ret = H5Dset_extent(dataset1, dims);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dset_extent(dataset1, dims);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dset_extent failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Read dataset1 using BYROW pattern */
@@ -2209,9 +2207,6 @@ extend_writeAll(void)
}
/* Try write to dataset2 beyond its current dim sizes. Should fail. */
- /* Temporary turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
/* create a file dataspace independently */
file_dataspace = H5Dget_space(dataset2);
@@ -2220,11 +2215,13 @@ extend_writeAll(void)
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently. Should fail. */
- ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dwrite failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
@@ -2331,20 +2328,19 @@ extend_readAll(void)
VRFY((dataset2 >= 0), "");
/* Try extend dataset1 which is open RDONLY. Should fail. */
- /* first turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
file_dataspace = H5Dget_space(dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded");
dims[0]++;
- ret = H5Dset_extent(dataset1, dims);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dset_extent(dataset1, dims);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dset_extent failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Read dataset1 using BYROW pattern */
@@ -3321,14 +3317,23 @@ test_actual_io_mode(int selection_mode)
/* Release some resources */
ret = H5Sclose(sid);
+ VRFY((ret >= 0), "H5Sclose succeeded");
ret = H5Pclose(fapl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Pclose(dcpl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Pclose(dxpl_write);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Pclose(dxpl_read);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Dclose(dataset);
+ VRFY((ret >= 0), "H5Dclose succeeded");
ret = H5Sclose(mem_space);
+ VRFY((ret >= 0), "H5Sclose succeeded");
ret = H5Sclose(file_space);
+ VRFY((ret >= 0), "H5Sclose succeeded");
ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
HDfree(buffer);
return;
}
@@ -3344,9 +3349,7 @@ void
actual_io_mode_tests(void)
{
int mpi_size = -1;
- int mpi_rank = -1;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
- MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank);
/* Only run these tests if selection I/O is not being used - selection I/O
* bypasses this IO mode decision - it's effectively always multi chunk
@@ -4118,13 +4121,15 @@ dataset_atomicity(void)
if (MAINPROCESS) {
fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
VRFY((fid >= 0), "H5Fopen succeeed");
- }
- /* should fail */
- ret = H5Fset_mpi_atomicity(fid, TRUE);
- VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
+ /* should fail */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fset_mpi_atomicity(fid, TRUE);
+ }
+ H5E_END_TRY
+ VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
- if (MAINPROCESS) {
ret = H5Fclose(fid);
VRFY((ret >= 0), "H5Fclose succeeded");
}
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 9a99c1c..5348f4f 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -151,7 +151,10 @@ test_page_buffer_access(void)
VRFY((ret == 0), "");
/* This should fail because collective metadata writes are not supported with page buffering */
- H5E_BEGIN_TRY { file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
+ }
H5E_END_TRY;
VRFY((file_id < 0), "H5Fcreate failed");
@@ -945,3 +948,57 @@ test_file_properties(void)
VRFY((mpi_ret >= 0), "MPI_Info_free succeeded");
} /* end test_file_properties() */
+
+void
+test_delete(void)
+{
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t fapl_id = H5I_INVALID_HID; /* File access plist */
+ const char *filename = NULL;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
+ htri_t is_hdf5 = FAIL; /* Whether a file is an HDF5 file */
+ herr_t ret; /* Generic return value */
+
+ filename = (const char *)GetTestParameters();
+
+ /* set up MPI parameters */
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
+ /* setup file access plist */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl_id != H5I_INVALID_HID), "H5Pcreate");
+ ret = H5Pset_fapl_mpio(fapl_id, comm, info);
+ VRFY((SUCCEED == ret), "H5Pset_fapl_mpio");
+
+ /* create the file */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ VRFY((fid != H5I_INVALID_HID), "H5Fcreate");
+
+ /* close the file */
+ ret = H5Fclose(fid);
+ VRFY((SUCCEED == ret), "H5Fclose");
+
+ /* Verify that the file is an HDF5 file */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VRFY((TRUE == is_hdf5), "H5Fis_accessible");
+
+ /* Delete the file */
+ ret = H5Fdelete(filename, fapl_id);
+ VRFY((SUCCEED == ret), "H5Fdelete");
+
+ /* Verify that the file is NO LONGER an HDF5 file */
+ /* This should fail since there is no file */
+ H5E_BEGIN_TRY
+ {
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ }
+ H5E_END_TRY;
+ VRFY((is_hdf5 != SUCCEED), "H5Fis_accessible");
+
+ /* Release file-access plist */
+ ret = H5Pclose(fapl_id);
+ VRFY((SUCCEED == ret), "H5Pclose");
+
+} /* end test_delete() */
diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c
index 5153bce..78af0fb 100644
--- a/testpar/t_filters_parallel.c
+++ b/testpar/t_filters_parallel.c
@@ -62,6 +62,7 @@ static void test_write_filtered_dataset_single_no_selection(void);
static void test_write_filtered_dataset_all_no_selection(void);
static void test_write_filtered_dataset_point_selection(void);
static void test_write_filtered_dataset_interleaved_write(void);
+static void test_write_transformed_filtered_dataset_no_overlap(void);
static void test_write_3d_filtered_dataset_no_overlap_separate_pages(void);
static void test_write_3d_filtered_dataset_no_overlap_same_pages(void);
static void test_write_3d_filtered_dataset_overlap(void);
@@ -79,6 +80,7 @@ static void test_read_filtered_dataset_single_no_selection(void);
static void test_read_filtered_dataset_all_no_selection(void);
static void test_read_filtered_dataset_point_selection(void);
static void test_read_filtered_dataset_interleaved_read(void);
+static void test_read_transformed_filtered_dataset_no_overlap(void);
static void test_read_3d_filtered_dataset_no_overlap_separate_pages(void);
static void test_read_3d_filtered_dataset_no_overlap_same_pages(void);
static void test_read_3d_filtered_dataset_overlap(void);
@@ -120,6 +122,7 @@ static void (*tests[])(void) = {
test_write_filtered_dataset_all_no_selection,
test_write_filtered_dataset_point_selection,
test_write_filtered_dataset_interleaved_write,
+ test_write_transformed_filtered_dataset_no_overlap,
test_write_3d_filtered_dataset_no_overlap_separate_pages,
test_write_3d_filtered_dataset_no_overlap_same_pages,
test_write_3d_filtered_dataset_overlap,
@@ -135,6 +138,7 @@ static void (*tests[])(void) = {
test_read_filtered_dataset_all_no_selection,
test_read_filtered_dataset_point_selection,
test_read_filtered_dataset_interleaved_read,
+ test_read_transformed_filtered_dataset_no_overlap,
test_read_3d_filtered_dataset_no_overlap_separate_pages,
test_read_3d_filtered_dataset_no_overlap_same_pages,
test_read_3d_filtered_dataset_overlap,
@@ -428,7 +432,7 @@ test_write_filtered_dataset_no_overlap(void)
/* Select hyperslab in the file */
filespace = H5Dget_space(dset_id);
- VRFY((dset_id >= 0), "File dataspace retrieval succeeded");
+ VRFY((filespace >= 0), "File dataspace retrieval succeeded");
VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0),
"Hyperslab selection succeeded");
@@ -1288,6 +1292,177 @@ test_write_filtered_dataset_interleaved_write(void)
}
/*
+ * Tests parallel write of transformed and filtered data
+ * in the case where only one process is writing to a
+ * particular chunk in the operation. Normally, a data
+ * transform function will cause the parallel library to
+ * break to independent I/O and this isn't allowed when
+ * there are filters in the pipeline. However, in this
+ * case the parallel library recognizes that the used
+ * data transform function "x" is the same as not applying
+ * the transform function. Therefore it does not apply
+ * the transform function resulting in not breaking to
+ * independent I/O.
+ *
+ * Programmer: Jan-Willem Blokland
+ * 08/20/2021
+ */
+static void
+test_write_transformed_filtered_dataset_no_overlap(void)
+{
+ C_DATATYPE *data = NULL;
+ C_DATATYPE *read_buf = NULL;
+ C_DATATYPE *correct_buf = NULL;
+ hsize_t dataset_dims[WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t chunk_dims[WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t sel_dims[WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t start[WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t stride[WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t count[WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t block[WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ size_t i, data_size, correct_buf_size;
+ hid_t file_id = -1, dset_id = -1, plist_id = -1;
+ hid_t filespace = -1, memspace = -1;
+
+ if (MAINPROCESS)
+ HDputs("Testing write to unshared transformed and filtered chunks");
+
+ CHECK_CUR_FILTER_AVAIL();
+
+ /* Set up file access property list with parallel I/O access */
+ plist_id = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((plist_id >= 0), "FAPL creation succeeded");
+
+ VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded");
+
+ VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0),
+ "Set libver bounds succeeded");
+
+ file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id);
+ VRFY((file_id >= 0), "Test file open succeeded");
+
+ VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded");
+
+ /* Create the dataspace for the dataset */
+ dataset_dims[0] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS;
+ dataset_dims[1] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS;
+ chunk_dims[0] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ chunk_dims[1] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+ sel_dims[0] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ sel_dims[1] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS;
+
+ filespace = H5Screate_simple(WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL);
+ VRFY((filespace >= 0), "File dataspace creation succeeded");
+
+ memspace = H5Screate_simple(WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS, sel_dims, NULL);
+ VRFY((memspace >= 0), "Memory dataspace creation succeeded");
+
+ /* Create chunked dataset */
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ VRFY((plist_id >= 0), "DCPL creation succeeded");
+
+ VRFY((H5Pset_chunk(plist_id, WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) >= 0),
+ "Chunk size set");
+
+ /* Add test filter to the pipeline */
+ VRFY((set_dcpl_filter(plist_id) >= 0), "Filter set");
+
+ dset_id = H5Dcreate2(file_id, WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_NAME, HDF5_DATATYPE_NAME,
+ filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ VRFY((dset_id >= 0), "Dataset creation succeeded");
+
+ VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded");
+ VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded");
+
+ /* Each process defines the dataset selection in memory and writes
+ * it to the hyperslab in the file
+ */
+ count[0] = 1;
+ count[1] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS /
+ (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+ stride[0] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ stride[1] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+ block[0] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ block[1] = (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+ start[0] = ((hsize_t)mpi_rank * (hsize_t)WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS * count[0]);
+ start[1] = 0;
+
+ if (VERBOSE_MED) {
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
+ mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
+ HDfflush(stdout);
+ }
+
+ /* Select hyperslab in the file */
+ filespace = H5Dget_space(dset_id);
+ VRFY((filespace >= 0), "File dataspace retrieval succeeded");
+
+ VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0),
+ "Hyperslab selection succeeded");
+
+ /* Fill data buffer */
+ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data);
+ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf);
+
+ data = (C_DATATYPE *)HDcalloc(1, data_size);
+ VRFY((NULL != data), "HDcalloc succeeded");
+
+ correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size);
+ VRFY((NULL != correct_buf), "HDcalloc succeeded");
+
+ for (i = 0; i < data_size / sizeof(*data); i++)
+ data[i] = (C_DATATYPE)GEN_DATA(i);
+
+ for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++)
+ correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) +
+ (i / (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])));
+
+ /* Create property list for collective dataset write and data transform */
+ plist_id = H5Pcreate(H5P_DATASET_XFER);
+ VRFY((plist_id >= 0), "DXPL creation succeeded");
+
+ VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded");
+
+ /* Set data transform expression */
+ VRFY((H5Pset_data_transform(plist_id, "x") >= 0), "Set data transform expression succeeded");
+
+ VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, data) >= 0),
+ "Dataset write succeeded");
+
+ if (data)
+ HDfree(data);
+
+ VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded");
+
+ /* Verify the correct data was written */
+ read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size);
+ VRFY((NULL != read_buf), "HDcalloc succeeded");
+
+ dset_id = H5Dopen2(file_id, "/" WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT);
+ VRFY((dset_id >= 0), "Dataset open succeeded");
+
+ VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, read_buf) >= 0),
+ "Dataset read succeeded");
+
+ VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded");
+
+ if (correct_buf)
+ HDfree(correct_buf);
+ if (read_buf)
+ HDfree(read_buf);
+
+ VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded");
+ VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded");
+ VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded");
+ VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded");
+ VRFY((H5Fclose(file_id) >= 0), "File close succeeded");
+
+ return;
+}
+
+/*
* Tests parallel write of filtered data in the case where
* the dataset has 3 dimensions and each process writes
* to its own "page" in the 3rd dimension.
@@ -1762,8 +1937,8 @@ test_write_3d_filtered_dataset_overlap(void)
WRITE_SHARED_FILTERED_CHUNKS_3D_NCOLS)) /
(hsize_t)(WRITE_SHARED_FILTERED_CHUNKS_3D_DEPTH * WRITE_SHARED_FILTERED_CHUNKS_3D_NCOLS))
- /* Add the amount that gets added when a rank moves down to its next section vertically in the
- dataset */
+ /* Add the amount that gets added when a rank moves down to its next
+ section vertically in the dataset */
+ ((hsize_t)(WRITE_SHARED_FILTERED_CHUNKS_3D_DEPTH * WRITE_SHARED_FILTERED_CHUNKS_3D_NCOLS) *
(i / (hsize_t)(mpi_size * WRITE_SHARED_FILTERED_CHUNKS_3D_DEPTH *
WRITE_SHARED_FILTERED_CHUNKS_3D_NCOLS))));
@@ -4224,6 +4399,232 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(void)
}
/*
+ * Tests parallel read of transformed and filtered data in the
+ * case where only one process is reading from a particular
+ * chunk in the operation. Normally, a data transform function
+ * will cause the parallel library to break to independent I/O
+ * and this isn't allowed when there are filters in the pipeline.
+ * However, in this case the parallel library recognizes that
+ * the used data transform function "x" is the same as not
+ * applying the transform function. Therefore it does not apply
+ * the transform function resulting in not breaking to
+ * independent I/O.
+ *
+ * The MAINPROCESS rank will first write out all of the
+ * data to the dataset. Then, each rank reads a part of
+ * the dataset and contributes its piece to a global buffer
+ * that is checked for consistency.
+ *
+ * Programmer: Jan-Willem Blokland
+ * 08/20/2021
+ */
+static void
+test_read_transformed_filtered_dataset_no_overlap(void)
+{
+ C_DATATYPE *read_buf = NULL;
+ C_DATATYPE *correct_buf = NULL;
+ C_DATATYPE *global_buf = NULL;
+ hsize_t dataset_dims[READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t chunk_dims[READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t sel_dims[READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t start[READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t stride[READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t count[READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t block[READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS];
+ hsize_t flat_dims[1];
+ size_t i, read_buf_size, correct_buf_size;
+ hid_t file_id = -1, dset_id = -1, plist_id = -1;
+ hid_t filespace = -1, memspace = -1;
+ int * recvcounts = NULL;
+ int * displs = NULL;
+
+ if (MAINPROCESS)
+ HDputs("Testing read from unshared transformed and filtered chunks");
+
+ CHECK_CUR_FILTER_AVAIL();
+
+ dataset_dims[0] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS;
+ dataset_dims[1] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS;
+
+ /* Setup the buffer for writing and for comparison */
+ correct_buf_size = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS *
+ (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS * sizeof(*correct_buf);
+
+ correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size);
+ VRFY((NULL != correct_buf), "HDcalloc succeeded");
+
+ for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++)
+ correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) +
+ (i / (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])));
+
+ if (MAINPROCESS) {
+ plist_id = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((plist_id >= 0), "FAPL creation succeeded");
+
+ VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0),
+ "Set libver bounds succeeded");
+
+ file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, plist_id);
+ VRFY((file_id >= 0), "Test file open succeeded");
+
+ VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded");
+
+ /* Create the dataspace for the dataset */
+ filespace =
+ H5Screate_simple(READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS, dataset_dims, NULL);
+ VRFY((filespace >= 0), "File dataspace creation succeeded");
+
+ /* Create chunked dataset */
+ chunk_dims[0] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ chunk_dims[1] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ VRFY((plist_id >= 0), "DCPL creation succeeded");
+
+ VRFY(
+ (H5Pset_chunk(plist_id, READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS, chunk_dims) >= 0),
+ "Chunk size set");
+
+ /* Add test filter to the pipeline */
+ VRFY((set_dcpl_filter(plist_id) >= 0), "Filter set");
+
+ dset_id = H5Dcreate2(file_id, READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_NAME,
+ HDF5_DATATYPE_NAME, filespace, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ VRFY((dset_id >= 0), "Dataset creation succeeded");
+
+ VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded");
+ VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded");
+
+ /* Create property list for collective dataset read */
+ plist_id = H5Pcreate(H5P_DATASET_XFER);
+ VRFY((plist_id >= 0), "DXPL creation succeeded");
+
+ /* Set data transform expression */
+ VRFY((H5Pset_data_transform(plist_id, "x") >= 0), "Set data transform expression succeeded");
+
+ VRFY((H5Dwrite(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, plist_id, correct_buf) >= 0),
+ "Dataset write succeeded");
+
+ VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded");
+ VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded");
+ VRFY((H5Fclose(file_id) >= 0), "File close succeeded");
+ }
+
+ /* Set up file access property list with parallel I/O access */
+ plist_id = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((plist_id >= 0), "FAPL creation succeeded");
+
+ VRFY((H5Pset_fapl_mpio(plist_id, comm, info) >= 0), "Set FAPL MPIO succeeded");
+
+ VRFY((H5Pset_libver_bounds(plist_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) >= 0),
+ "Set libver bounds succeeded");
+
+ file_id = H5Fopen(filenames[0], H5F_ACC_RDONLY, plist_id);
+ VRFY((file_id >= 0), "Test file open succeeded");
+
+ VRFY((H5Pclose(plist_id) >= 0), "FAPL close succeeded");
+
+ dset_id = H5Dopen2(file_id, "/" READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT);
+ VRFY((dset_id >= 0), "Dataset open succeeded");
+
+ sel_dims[0] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ sel_dims[1] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS;
+
+ /* Setup one-dimensional memory dataspace for reading the dataset data into a contiguous buffer */
+ flat_dims[0] = sel_dims[0] * sel_dims[1];
+
+ memspace = H5Screate_simple(1, flat_dims, NULL);
+ VRFY((memspace >= 0), "Memory dataspace creation succeeded");
+
+ /* Select hyperslab in the file */
+ filespace = H5Dget_space(dset_id);
+ VRFY((filespace >= 0), "File dataspace retrieval succeeded");
+
+ /*
+ * Each process defines the dataset selection in the file and reads
+ * it to the selection in memory
+ */
+ count[0] = 1;
+ count[1] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS /
+ (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+ stride[0] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ stride[1] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+ block[0] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS;
+ block[1] = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS;
+ start[0] = ((hsize_t)mpi_rank * (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS * count[0]);
+ start[1] = 0;
+
+ if (VERBOSE_MED) {
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
+ mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
+ HDfflush(stdout);
+ }
+
+ VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0),
+ "Hyperslab selection succeeded");
+
+ /* Create property list for collective dataset read and data transform */
+ plist_id = H5Pcreate(H5P_DATASET_XFER);
+ VRFY((plist_id >= 0), "DXPL creation succeeded");
+
+ VRFY((H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE) >= 0), "Set DXPL MPIO succeeded");
+
+ /* Set data transform expression */
+ VRFY((H5Pset_data_transform(plist_id, "x") >= 0), "Set data transform expression succeeded");
+
+ read_buf_size = flat_dims[0] * sizeof(*read_buf);
+
+ read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size);
+ VRFY((NULL != read_buf), "HDcalloc succeeded");
+
+ VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, read_buf) >= 0),
+ "Dataset read succeeded");
+
+ global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size);
+ VRFY((NULL != global_buf), "HDcalloc succeeded");
+
+ /* Collect each piece of data from all ranks into a global buffer on all ranks */
+ recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts));
+ VRFY((NULL != recvcounts), "HDcalloc succeeded");
+
+ for (i = 0; i < (size_t)mpi_size; i++)
+ recvcounts[i] = (int)flat_dims[0];
+
+ displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs));
+ VRFY((NULL != displs), "HDcalloc succeeded");
+
+ for (i = 0; i < (size_t)mpi_size; i++)
+ displs[i] = (int)(i * flat_dims[0]);
+
+ VRFY((MPI_SUCCESS == MPI_Allgatherv(read_buf, (int)flat_dims[0], C_DATATYPE_MPI, global_buf, recvcounts,
+ displs, C_DATATYPE_MPI, comm)),
+ "MPI_Allgatherv succeeded");
+
+ VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded");
+
+ if (displs)
+ HDfree(displs);
+ if (recvcounts)
+ HDfree(recvcounts);
+ if (global_buf)
+ HDfree(global_buf);
+ if (read_buf)
+ HDfree(read_buf);
+ if (correct_buf)
+ HDfree(correct_buf);
+
+ VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded");
+ VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded");
+ VRFY((H5Sclose(memspace) >= 0), "Memory dataspace close succeeded");
+ VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded");
+ VRFY((H5Fclose(file_id) >= 0), "File close succeeded");
+
+ return;
+}
+
+/*
* Tests parallel read of filtered data in the case where
* the dataset has 3 dimensions and each process reads from
* each "page" in the 3rd dimension. However, no chunk on a
@@ -4497,8 +4898,8 @@ test_read_3d_filtered_dataset_overlap(void)
READ_SHARED_FILTERED_CHUNKS_3D_NCOLS)) /
(hsize_t)(READ_SHARED_FILTERED_CHUNKS_3D_DEPTH * READ_SHARED_FILTERED_CHUNKS_3D_NCOLS))
- /* Add the amount that gets added when a rank moves down to its next section vertically in the
- dataset */
+ /* Add the amount that gets added when a rank moves down to its next
+ section vertically in the dataset */
+ ((hsize_t)(READ_SHARED_FILTERED_CHUNKS_3D_DEPTH * READ_SHARED_FILTERED_CHUNKS_3D_NCOLS) *
(i / (hsize_t)(mpi_size * READ_SHARED_FILTERED_CHUNKS_3D_DEPTH *
READ_SHARED_FILTERED_CHUNKS_3D_NCOLS))));
@@ -6093,7 +6494,7 @@ main(int argc, char **argv)
if (VERBOSE_MED)
h5_show_hostname();
- ALARM_ON;
+ TestAlarmOn();
/* Create test file */
fapl = H5Pcreate(H5P_FILE_ACCESS);
@@ -6172,7 +6573,7 @@ exit:
if (MAINPROCESS)
HDprintf("*** %d TEST ERROR%s OCCURRED ***\n", nerrors, nerrors > 1 ? "S" : "");
- ALARM_OFF;
+ TestAlarmOff();
h5_clean_files(FILENAME, fapl);
diff --git a/testpar/t_filters_parallel.h b/testpar/t_filters_parallel.h
index 3804c09..7eb34ed 100644
--- a/testpar/t_filters_parallel.h
+++ b/testpar/t_filters_parallel.h
@@ -138,6 +138,16 @@ typedef struct {
#define INTERLEAVED_WRITE_FILTERED_DATASET_NCOLS \
(INTERLEAVED_WRITE_FILTERED_DATASET_CH_NCOLS * DIM1_SCALE_FACTOR)
+/* Defines for the unshared transformed and filtered chunks write test */
+#define WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_NAME "unshared_transformed_filtered_chunks_write"
+#define WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS 2
+#define WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS (mpi_size * DIM0_SCALE_FACTOR)
+#define WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS (mpi_size * DIM1_SCALE_FACTOR)
+#define WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS \
+ (WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS / mpi_size)
+#define WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS \
+ (WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS / mpi_size)
+
/* Defines for the 3D unshared filtered dataset separate page write test */
#define WRITE_UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME \
"3D_unshared_filtered_chunks_separate_pages_write"
@@ -280,6 +290,16 @@ typedef struct {
#define INTERLEAVED_READ_FILTERED_DATASET_NCOLS \
(INTERLEAVED_READ_FILTERED_DATASET_CH_NCOLS * DIM1_SCALE_FACTOR)
+/* Defines for the unshared transformed and filtered chunks read test */
+#define READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_NAME "unshared_transformed_filtered_chunks_read"
+#define READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_DIMS 2
+#define READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS (mpi_size * DIM0_SCALE_FACTOR)
+#define READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS (mpi_size * DIM1_SCALE_FACTOR)
+#define READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NROWS \
+ (READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS / mpi_size)
+#define READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_CH_NCOLS \
+ (READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS / mpi_size)
+
/* Defines for the 3D unshared filtered dataset separate page read test */
#define READ_UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME \
"3D_unshared_filtered_chunks_separate_pages_read"
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 2eca297..3041e77 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -129,12 +129,6 @@ zero_dim_dset(void)
/*
* Example of using PHDF5 to create ndatasets datasets. Each process write
* a slab of array to the file.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
void
multiple_dset_write(void)
@@ -218,12 +212,6 @@ multiple_dset_write(void)
}
/* Example of using PHDF5 to create, write, and read compact dataset.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
void
compact_dataset(void)
@@ -353,14 +341,6 @@ compact_dataset(void)
/*
* Example of using PHDF5 to create, write, and read dataset and attribute
* of Null dataspace.
- *
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
- *
- * JRM - 8/24/04
*/
void
null_dataset(void)
@@ -465,14 +445,6 @@ null_dataset(void)
* Actual data is _not_ written to these datasets. Dataspaces are exact
* sizes(2GB, 4GB, etc.), but the metadata for the file pushes the file over
* the boundary of interest.
- *
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
- *
- * JRM - 8/11/04
*/
void
big_dataset(void)
@@ -594,16 +566,6 @@ big_dataset(void)
/* Example of using PHDF5 to read a partial written dataset. The dataset does
* not have actual data written to the entire raw data area and relies on the
* default fill value of zeros to work correctly.
- *
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
- *
- * Also added code to free dynamically allocated buffers.
- *
- * JRM - 8/11/04
*/
void
dataset_fillvalue(void)
@@ -710,15 +672,16 @@ dataset_fillvalue(void)
for (i = 0; i < (int)dset_dims[0]; i++)
for (j = 0; j < (int)dset_dims[1]; j++)
for (k = 0; k < (int)dset_dims[2]; k++)
- for (l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++)
+ for (l = 0; l < (int)dset_dims[3]; l++, trdata++)
if (*trdata != 0)
if (err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- HDprintf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,
- j, k, l, *trdata);
+ HDprintf(
+ "Rank %d: Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n",
+ mpi_rank, i, j, k, l, *trdata);
if (err_num > MAX_ERR_REPORT && !VERBOSE_MED)
- HDprintf("[more errors ...]\n");
+ HDprintf("Rank %d: [more errors ...]\n", mpi_rank);
if (err_num) {
- HDprintf("%d errors found in check_value\n", err_num);
+ HDprintf("Rank %d: %d errors found in check_value\n", mpi_rank, err_num);
nerrors++;
}
}
@@ -856,12 +819,6 @@ collective_group_write_independent_group_read(void)
/* Write multiple groups with a chunked dataset in each group collectively.
* These groups and datasets are for testing independent read later.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/16/04
*/
void
collective_group_write(void)
@@ -896,6 +853,7 @@ collective_group_write(void)
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
+ VRFY((fid >= 0), "H5Fcreate");
H5Pclose(plist);
/* decide the hyperslab according to process number. */
@@ -909,13 +867,13 @@ collective_group_write(void)
ret2 = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims);
VRFY((memspace >= 0), "memspace");
VRFY((filespace >= 0), "filespace");
- VRFY((ret1 >= 0), "mgroup memspace selection");
- VRFY((ret2 >= 0), "mgroup filespace selection");
+ VRFY((ret1 == 0), "mgroup memspace selection");
+ VRFY((ret2 == 0), "mgroup filespace selection");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
ret1 = H5Pset_chunk(dcpl, 2, chunk_size);
VRFY((dcpl >= 0), "dataset creation property");
- VRFY((ret1 >= 0), "set chunk for dataset creation property");
+ VRFY((ret1 == 0), "set chunk for dataset creation property");
/* creates ngroups groups under the root group, writes chunked
* datasets in parallel. */
@@ -932,10 +890,14 @@ collective_group_write(void)
for (j = 0; j < size; j++)
outme[(i * size) + j] = (i + j) * 1000 + mpi_rank;
- H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme);
+ ret1 = H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme);
+ VRFY((ret1 == 0), "H5Dwrite");
- H5Dclose(did);
- H5Gclose(gid);
+ ret1 = H5Dclose(did);
+ VRFY((ret1 == 0), "H5Dclose");
+
+ ret1 = H5Gclose(gid);
+ VRFY((ret1 == 0), "H5Gclose");
#ifdef BARRIER_CHECKS
if (!((m + 1) % 10)) {
@@ -948,7 +910,9 @@ collective_group_write(void)
H5Pclose(dcpl);
H5Sclose(filespace);
H5Sclose(memspace);
- H5Fclose(fid);
+
+ ret1 = H5Fclose(fid);
+ VRFY((ret1 == 0), "H5Fclose");
HDfree(outme);
}
@@ -964,6 +928,7 @@ independent_group_read(void)
const H5Ptest_param_t *pt;
char * filename;
int ngroups;
+ herr_t ret;
pt = GetTestParameters();
filename = pt->name;
@@ -975,6 +940,7 @@ independent_group_read(void)
H5Pset_all_coll_metadata_ops(plist, FALSE);
fid = H5Fopen(filename, H5F_ACC_RDONLY, plist);
+ VRFY((fid > 0), "H5Fopen");
H5Pclose(plist);
/* open groups and read datasets. Odd number processes read even number
@@ -989,20 +955,11 @@ independent_group_read(void)
group_dataset_read(fid, mpi_rank, m);
}
- H5Fclose(fid);
+ ret = H5Fclose(fid);
+ VRFY((ret == 0), "H5Fclose");
}
/* Open and read datasets and compare data
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * Also added code to verify the results of dynamic memory
- * allocations, and to free dynamically allocated memeory
- * when we are done with it.
- *
- * JRM - 8/16/04
*/
static void
group_dataset_read(hid_t fid, int mpi_rank, int m)
@@ -1035,16 +992,17 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
/* this is the original value */
for (i = 0; i < size; i++)
- for (j = 0; j < size; j++) {
+ for (j = 0; j < size; j++)
outdata[(i * size) + j] = (i + j) * 1000 + mpi_rank;
- }
/* compare the original value(outdata) to the value in file(indata).*/
ret = check_value(indata, outdata, size);
VRFY((ret == 0), "check the data");
- H5Dclose(did);
- H5Gclose(gid);
+ ret = H5Dclose(did);
+ VRFY((ret == 0), "H5Dclose");
+ ret = H5Gclose(gid);
+ VRFY((ret == 0), "H5Gclose");
HDfree(indata);
HDfree(outdata);
@@ -1076,11 +1034,6 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
* + means the group has attribute(s).
* ' means the datasets in the groups have attribute(s).
*
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/16/04
*/
void
multiple_group_write(void)
@@ -1164,12 +1117,6 @@ multiple_group_write(void)
/*
* In a group, creates NDATASETS datasets. Each process writes a hyperslab
* of a data array to the file.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/16/04
*/
static void
write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
@@ -1243,12 +1190,6 @@ create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, int counter)
/*
* This function is to verify the data from multiple group testing. It opens
* every dataset in every group and check their correctness.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
void
multiple_group_read(void)
@@ -1323,12 +1264,6 @@ multiple_group_read(void)
/*
* This function opens all the datasets in a certain, checks the data using
* dataset_vrfy function.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
static int
read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
@@ -1475,12 +1410,6 @@ read_attribute(hid_t obj_id, int this_type, int num)
/* This functions compares the original data with the read-in data for its
* hyperslab part only by process ID.
- *
- * Changes: Modified function to use a passed in size parameter
- * instead of the old SIZE #define. This should let us
- * run with an arbitrary number of processes.
- *
- * JRM - 8/16/04
*/
static int
check_value(DATATYPE *indata, DATATYPE *outdata, int size)
@@ -1513,12 +1442,6 @@ check_value(DATATYPE *indata, DATATYPE *outdata, int size)
}
/* Decide the portion of data chunk in dataset by process ID.
- *
- * Changes: Modified function to use a passed in size parameter
- * instead of the old SIZE #define. This should let us
- * run with an arbitrary number of processes.
- *
- * JRM - 8/11/04
*/
static void
@@ -1560,8 +1483,6 @@ get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[], hsize_t
* This function reproduces this situation. At present the test hangs
* on failure.
* JRM - 9/13/04
- *
- * Changes: None.
*/
#define N 4
@@ -1805,10 +1726,6 @@ io_mode_confusion(void)
* cache clients will have to construct on disk images on demand.
*
* JRM -- 10/13/10
- *
- * Changes:
- * Break it into two parts, a writer to write the file and a reader
- * the correctness of the writer. AKC -- 2010/10/27
*/
#define NUM_DATA_SETS 4
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index a883f55..a8a756c 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -1086,7 +1086,7 @@ main(int argc, char **argv)
H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL);
/* set alarm. */
- ALARM_ON;
+ TestAlarmOn();
/*=======================================
* MPIO 1 write Many read test
@@ -1195,7 +1195,7 @@ finish:
}
/* turn off alarm */
- ALARM_OFF;
+ TestAlarmOff();
h5_clean_files(FILENAME, fapl);
H5close();
diff --git a/testpar/t_prop.c b/testpar/t_prop.c
index 92c8bc0..a3f1859 100644
--- a/testpar/t_prop.c
+++ b/testpar/t_prop.c
@@ -98,10 +98,10 @@ test_plist_ed(void)
int mpi_size, mpi_rank, recv_proc;
hsize_t chunk_size = 16384; /* chunk size */
- double fill = 2.7f; /* Fill value */
+ double fill = 2.7; /* Fill value */
size_t nslots = 521 * 2;
size_t nbytes = 1048576 * 10;
- double w0 = 0.5f;
+ double w0 = 0.5;
unsigned max_compact;
unsigned min_dense;
hsize_t max_size[1]; /*data space maximum size */
@@ -114,26 +114,26 @@ test_plist_ed(void)
TRUE,
FALSE,
(2 * 2048 * 1024),
- 0.3f,
+ 0.3,
(64 * 1024 * 1024),
(4 * 1024 * 1024),
60000,
H5C_incr__threshold,
- 0.8f,
- 3.0f,
+ 0.8,
+ 3.0,
TRUE,
(8 * 1024 * 1024),
H5C_flash_incr__add_space,
- 2.0f,
- 0.25f,
+ 2.0,
+ 0.25,
H5C_decr__age_out_with_threshold,
- 0.997f,
- 0.8f,
+ 0.997,
+ 0.8,
TRUE,
(3 * 1024 * 1024),
3,
FALSE,
- 0.2f,
+ 0.2,
(256 * 2048),
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 7c2763c..518741d 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -35,6 +35,8 @@
#include "H5private.h"
#include "testphdf5.h"
+#define LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG 0
+
static void coll_write_test(int chunk_factor);
static void coll_read_test(void);
@@ -1431,8 +1433,7 @@ lower_dim_size_comp_test__verify_data(uint32_t *buf_ptr,
*-------------------------------------------------------------------------
*/
-#define LDSCT_DS_RANK 5
-#define LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG 0
+#define LDSCT_DS_RANK 5
static void
lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_collective_io,
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index f5b9e63..1ead1b8 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -33,9 +33,6 @@ int ngroups = 512; /* number of groups to create in root
int facc_type = FACC_MPIO; /*Test file access type */
int dxfer_coll_type = DXFER_COLLECTIVE_IO;
-H5E_auto2_t old_func; /* previous error handler */
-void * old_client_data; /* previous error handler arg.*/
-
/* other option flags */
/* FILENAME and filenames must have the same number of names.
@@ -353,6 +350,8 @@ main(int argc, char **argv)
AddTest("props", test_file_properties, NULL, "Coll Metadata file property settings", PARATESTFILE);
+ AddTest("delete", test_delete, NULL, "MPI-IO VFD file delete", PARATESTFILE);
+
AddTest("idsetw", dataset_writeInd, NULL, "dataset independent write", PARATESTFILE);
AddTest("idsetr", dataset_readInd, NULL, "dataset independent read", PARATESTFILE);
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index bd8de08..10e3027 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -225,19 +225,18 @@ typedef enum {
} ShapeSameTestMethods;
/* Shared global variables */
-extern int dim0, dim1; /*Dataset dimensions */
-extern int chunkdim0, chunkdim1; /*Chunk dimensions */
-extern int nerrors; /*errors count */
-extern H5E_auto2_t old_func; /* previous error handler */
-extern void * old_client_data; /*previous error handler arg.*/
-extern int facc_type; /*Test file access type */
-extern int dxfer_coll_type;
+extern int dim0, dim1; /*Dataset dimensions */
+extern int chunkdim0, chunkdim1; /*Chunk dimensions */
+extern int nerrors; /*errors count */
+extern int facc_type; /*Test file access type */
+extern int dxfer_coll_type;
/* Test program prototypes */
void test_plist_ed(void);
void external_links(void);
void zero_dim_dset(void);
void test_file_properties(void);
+void test_delete(void);
void multiple_dset_write(void);
void multiple_group_write(void);
void multiple_group_read(void);
diff --git a/tools/COPYING b/tools/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/tools/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 19a19b0..0ad319e 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -461,7 +461,7 @@ build_match_list(const char *objname1, trav_info_t *info1, const char *objname2,
done:
*table_out = table;
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -493,7 +493,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata)
const char * ext_path;
herr_t ret_value = SUCCEED;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/* init linkinfo struct */
HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t));
@@ -577,7 +577,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata)
done:
if (lnk_info.trg_path)
HDfree(lnk_info.trg_path);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -627,7 +627,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
trav_table_t *match_list = NULL;
diff_err_t ret_value = H5DIFF_NO_ERR;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/* init filenames */
HDmemset(filenames, 0, MAX_FILENAME * 2);
/* init link info struct */
@@ -687,7 +687,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
/* if any object is specified */
if (objname1) {
/* make the given object1 fullpath, start with "/" */
- if (HDstrncmp(objname1, "/", 1)) {
+ if (HDstrncmp(objname1, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if (HDasprintf(&obj1fullname, "/%s", objname1) < 0)
@@ -706,7 +706,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname);
/* make the given object2 fullpath, start with "/" */
- if (HDstrncmp(objname2, "/", 1)) {
+ if (HDstrncmp(objname2, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if (HDasprintf(&obj2fullname, "/%s", objname2) < 0)
@@ -1013,7 +1013,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
parallel_print("\n");
/* if given objects is group under root */
- if (HDstrcmp(obj1fullname, "/") || HDstrcmp(obj2fullname, "/"))
+ if (HDstrcmp(obj1fullname, "/") != 0 || HDstrcmp(obj2fullname, "/") != 0)
parallel_print("group1 group2\n");
else
parallel_print("file1 file2\n");
@@ -1115,9 +1115,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
* if not root, prepare object name to be pre-appended to group path to
* make full path
*/
- if (HDstrcmp(grp1, "/"))
+ if (HDstrcmp(grp1, "/") != 0)
grp1_path = grp1;
- if (HDstrcmp(grp2, "/"))
+ if (HDstrcmp(grp2, "/") != 0)
grp2_path = grp2;
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index 9fcf821..7b41538 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DIFF_H__
-#define H5DIFF_H__
+#ifndef H5DIFF_H
+#define H5DIFF_H
#include "hdf5.h"
#include "h5tools.h"
@@ -160,4 +160,4 @@ int print_objname(diff_opt_t *opts, hsize_t nfound);
void do_print_objname(const char *OBJ, const char *path1, const char *path2, diff_opt_t *opts);
void do_print_attrname(const char *attr, const char *path1, const char *path2);
-#endif /* H5DIFF_H__ */
+#endif /* H5DIFF_H */
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index f97ef50..2d6c66c 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -27,7 +27,7 @@
#define F_FORMAT "%-15g %-15g %-15g\n"
#if H5_SIZEOF_LONG_DOUBLE != 0
-#define LD_FORMAT "%-15Lf %-15Lf %-15Lf\n"
+#define LD_FORMAT "%-15Lg %-15Lg %-15Lg\n"
#endif
#define I_FORMAT "%-15d %-15d %-15d\n"
@@ -42,7 +42,7 @@
#define F_FORMAT_P "%-15.10g %-15.10g %-15.10g %-14.10g\n"
#if H5_SIZEOF_LONG_DOUBLE != 0
-#define LD_FORMAT_P "%-15.10Lf %-15.10Lf %-15.10Lf %-14.10Lf\n"
+#define LD_FORMAT_P "%-15.10Lg %-15.10Lg %-15.10Lg %-14.10Lg\n"
#endif
#define I_FORMAT_P "%-15d %-15d %-15d %-14f\n"
@@ -59,7 +59,7 @@
#define F_FORMAT_P_NOTCOMP "%-15.10g %-15.10g %-15.10g not comparable\n"
#if H5_SIZEOF_LONG_DOUBLE != 0
-#define LD_FORMAT_P_NOTCOMP "%-15.10Lf %-15.10Lf %-15.10Lf not comparable\n"
+#define LD_FORMAT_P_NOTCOMP "%-15.10Lg %-15.10Lg %-15.10Lg not comparable\n"
#endif
#define I_FORMAT_P_NOTCOMP "%-15d %-15d %-15d not comparable\n"
@@ -104,9 +104,9 @@ static hbool_t not_comparable;
per = -1; \
not_comparable = FALSE; \
both_zero = FALSE; \
- if (H5_DBL_ABS_EQUAL(0, (double)A) && H5_DBL_ABS_EQUAL(0, (double)B)) \
+ if (H5_DBL_ABS_EQUAL(0, (double)(A)) && H5_DBL_ABS_EQUAL(0, (double)(B))) \
both_zero = TRUE; \
- if (!H5_DBL_ABS_EQUAL(0, (double)A)) \
+ if (!H5_DBL_ABS_EQUAL(0, (double)(A))) \
per = (double)ABS((double)((B) - (A)) / (double)(A)); \
else \
not_comparable = TRUE; \
@@ -117,9 +117,9 @@ static hbool_t not_comparable;
per = -1; \
not_comparable = FALSE; \
both_zero = FALSE; \
- if (H5_DBL_ABS_EQUAL(0, (double)A) && H5_DBL_ABS_EQUAL(0, (double)B)) \
+ if (H5_DBL_ABS_EQUAL(0, (double)(A)) && H5_DBL_ABS_EQUAL(0, (double)(B))) \
both_zero = TRUE; \
- if (!H5_DBL_ABS_EQUAL(0, (double)A)) \
+ if (!H5_DBL_ABS_EQUAL(0, (double)(A))) \
per = ABS((double)((TYPE)((B) - (A))) / (double)(A)); \
else \
not_comparable = TRUE; \
@@ -225,7 +225,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
mcomp_t members;
H5T_class_t type_class;
- H5TOOLS_START_DEBUG(" - rank:%d hs_nelmts:%ld errstat:%d", opts->rank, opts->hs_nelmts, opts->err_stat);
+ H5TOOLS_START_DEBUG(" - rank:%d hs_nelmts:%lld errstat:%d", opts->rank, opts->hs_nelmts, opts->err_stat);
opts->print_header = 1; /* enable print header */
/* get the size. */
@@ -411,7 +411,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
HDmemset(&members, 0, sizeof(mcomp_t));
get_member_types(opts->m_tid, &members);
for (i = 0; i < opts->hs_nelmts; i++) {
- H5TOOLS_DEBUG("opts->pos[%ld]:%ld - nelmts:%ld", i, opts->pos[i], opts->hs_nelmts);
+ H5TOOLS_DEBUG("opts->pos[%lld]:%lld - nelmts:%lld", i, opts->pos[i], opts->hs_nelmts);
nfound += diff_datum(mem1 + i * size, mem2 + i * size, i, opts, container1_id, container2_id,
&members);
if (opts->count_bool && nfound >= opts->count)
@@ -419,7 +419,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
} /* i */
close_member_types(&members);
} /* switch */
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -475,7 +475,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
hsize_t nfound = 0; /* differences found */
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_START_DEBUG("ph:%d elemtno:%d - errstat:%d", opts->print_header, elemtno, opts->err_stat);
+ H5TOOLS_START_DEBUG("ph:%d elemtno:%lld - errstat:%d", opts->print_header, elemtno, opts->err_stat);
type_size = H5Tget_size(opts->m_tid);
type_class = H5Tget_class(opts->m_tid);
@@ -593,8 +593,8 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
* of length of strings.
* For now mimic the previous way.
*/
- H5TOOLS_DEBUG("string size:%d", size1);
- H5TOOLS_DEBUG("string size:%d", size2);
+ H5TOOLS_DEBUG("string size:%ld", size1);
+ H5TOOLS_DEBUG("string size:%ld", size2);
if (size1 != size2) {
H5TOOLS_DEBUG("string sizes difference");
nfound++;
@@ -725,7 +725,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
H5TOOLS_DEBUG("H5T_ARRAY ph=%d", opts->print_header);
arr_opts = *opts;
- H5TOOLS_DEBUG("Check opts: hs_nelmts:%ld to %ld rank:%d to %ld", opts->hs_nelmts,
+ H5TOOLS_DEBUG("Check opts: hs_nelmts:%lld to %lld rank:%d to %d", opts->hs_nelmts,
arr_opts.hs_nelmts, opts->rank, arr_opts.rank);
/* get the array's base datatype for each element */
arr_opts.m_tid = H5Tget_super(opts->m_tid);
@@ -1074,7 +1074,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1 failed");
if (H5Rdestroy(ref1_buf) < 0)
H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1 failed");
- H5TOOLS_DEBUG("H5T_REFERENCE - H5T_STD_REF complete nfound:%d - errstat:%d", nfound,
+ H5TOOLS_DEBUG("H5T_REFERENCE - H5T_STD_REF complete nfound:%lld - errstat:%d", nfound,
ref_opts.err_stat);
}
/*-------------------------------------------------------------------------
@@ -1286,7 +1286,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
done:
opts->err_stat = opts->err_stat | ret_value;
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -1378,7 +1378,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
hsize_t nfound_p = 0; /* point differences found */
hsize_t ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
ndims1 = H5Sget_simple_extent_ndims(region1_id);
ndims2 = H5Sget_simple_extent_ndims(region2_id);
@@ -1397,8 +1397,8 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
npoints2 = H5Sget_select_elem_npoints(region2_id);
}
H5E_END_TRY;
- H5TOOLS_DEBUG("blocks: 1=%ld-2=%ld", nblocks1, nblocks2);
- H5TOOLS_DEBUG("points: 1=%ld-2=%ld", npoints1, npoints2);
+ H5TOOLS_DEBUG("blocks: 1=%lld-2=%lld", nblocks1, nblocks2);
+ H5TOOLS_DEBUG("points: 1=%lld-2=%lld", npoints1, npoints2);
if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) {
opts->not_cmp = 1;
@@ -1561,7 +1561,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
ret_value = nfound_p + nfound_b;
done:
- H5TOOLS_ENDDEBUG(" with diffs:%d", ret_value);
+ H5TOOLS_ENDDEBUG(" with diffs:%lld", ret_value);
return ret_value;
}
@@ -1598,7 +1598,7 @@ character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t
}
nfound++;
}
- H5TOOLS_ENDDEBUG(": %d", nfound);
+ H5TOOLS_ENDDEBUG(": %lld", nfound);
return nfound;
}
@@ -1669,7 +1669,7 @@ character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno,
nfound++;
}
- H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero);
+ H5TOOLS_ENDDEBUG(": %lld zero:%d", nfound, both_zero);
return nfound;
}
@@ -1850,7 +1850,7 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
}
}
- H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero);
+ H5TOOLS_ENDDEBUG(": %lld zero:%d", nfound, both_zero);
return nfound;
}
@@ -2021,7 +2021,7 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
nfound++;
}
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2196,7 +2196,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2285,7 +2285,7 @@ diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2373,7 +2373,7 @@ diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2461,7 +2461,7 @@ diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2553,7 +2553,7 @@ diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2641,7 +2641,7 @@ diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, dif
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2729,7 +2729,7 @@ diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2817,7 +2817,7 @@ diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2907,7 +2907,7 @@ diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -3000,7 +3000,7 @@ diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
}
}
- H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -3100,7 +3100,7 @@ diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
}
}
- H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero);
+ H5TOOLS_ENDDEBUG(": %lld zero:%d", nfound, both_zero);
return nfound;
}
@@ -3119,7 +3119,7 @@ ull2float(unsigned long long ull_value, float *f_value)
size_t dst_size;
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
H5TOOLS_GOTO_ERROR(FAIL, "H5Pcreate failed");
@@ -3137,13 +3137,16 @@ ull2float(unsigned long long ull_value, float *f_value)
HDmemcpy(f_value, buf, dst_size);
done:
- H5E_BEGIN_TRY { H5Pclose(dxpl_id); }
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dxpl_id);
+ }
H5E_END_TRY;
if (buf)
HDfree(buf);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -3345,97 +3348,87 @@ print_header(diff_opt_t *opts)
static void
print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
{
- int i, j;
-
- H5TOOLS_START_DEBUG(" -- idx:%ld", idx);
+ H5TOOLS_START_DEBUG(" -- idx:%lld", idx);
if (print_data(opts)) {
+ hsize_t curr_pos = idx;
/* print header */
if (opts->print_header == 1) {
opts->print_header = 0;
-
print_header(opts);
} /* end print header */
H5TOOLS_DEBUG("rank=%d", opts->rank);
if (opts->rank > 0) {
- hsize_t curr_pos = idx;
-
parallel_print("[ ");
- H5TOOLS_DEBUG("do calc_acc_pos[%ld] nelmts:%d - errstat:%d", idx, opts->hs_nelmts,
+ H5TOOLS_DEBUG("do calc_acc_pos[%lld] nelmts:%lld - errstat:%d", idx, opts->hs_nelmts,
opts->err_stat);
-
if (opts->sset[0] != NULL) {
/* Subsetting is used - calculate total position */
- hsize_t prev_dim_size = 0; /* previous dim size */
- hsize_t prev_str = 0; /* previouw stride idx*/
- hsize_t str_cnt = 0; /* stride multiplier*/
- hsize_t curr_idx = 0; /* calculated running position */
- hsize_t str_idx = 0;
- hsize_t blk_idx = 0;
- hsize_t cnt_idx = 0;
- hsize_t dim_size = 0; /* current dim size */
- hsize_t elmnt_cnt = 1;
- hsize_t next_idx = idx;
- hsize_t data_idx = 0;
- j = opts->rank - 1;
- H5TOOLS_DEBUG("...begin:%ld=> opts->rank:%ld (idx:%ld)", j, opts->rank, idx);
- do {
- curr_idx = next_idx; /* New current data position */
- cnt_idx = opts->sset[0]->count.data[j]; /* Count value for current dim */
- blk_idx = opts->sset[0]->block.data[j]; /* Block value for current dim */
- str_idx = opts->sset[0]->stride.data[j]; /* Stride value for current dim */
- H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - c:%ld b:%ld s:%ld", j,
- curr_pos, curr_idx, cnt_idx, blk_idx, str_idx);
- dim_size = opts->dims[j]; /* Current dimension size */
- // elmnt_cnt *= dim_size; /* Total number of elements in dimension */
- H5TOOLS_DEBUG("... sset loop:%d with elmnt_cnt:%ld - (prev_dim_size:%ld - dim_size:%ld) "
- "- str_cnt:%ld",
- j, elmnt_cnt, prev_dim_size, dim_size, str_cnt);
- data_idx = elmnt_cnt * dim_size;
- H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (data_idx:%ld)", j, curr_pos, data_idx);
- for (i = 0; i < cnt_idx; i++) {
- H5TOOLS_DEBUG("... ... data loop:%d with cnt_idx:%ld - str_cnt:%ld (curr_idx:%ld - "
- "data_idx:%ld)",
- i, cnt_idx, str_cnt, curr_idx, data_idx);
- if (curr_idx >= data_idx) {
- /* get to next block */
- data_idx += str_idx * dim_size;
- /* get next block */
- str_cnt++;
- H5TOOLS_DEBUG(
- "... ... data loop:%d with cnt_idx:%ld - str_cnt:%ld - data_idx:%ld", i,
- cnt_idx, str_cnt, data_idx);
- }
- H5TOOLS_DEBUG("... ... end data loop:%d with dim_cnt:%ld - str_cnt:%ld - "
- "(curr_idx:%ld - data_idx:%ld)",
- i, dim_size, str_cnt, curr_idx, data_idx);
+ hsize_t curr_idx = 0; /* current pos in the selection space for each dimension */
+
+ curr_pos = 0; /* current position in full space */
+ if (curr_idx < idx) {
+ int j;
+ hsize_t count;
+ hsize_t block;
+ hsize_t stride;
+ hsize_t tmp = 0;
+ hsize_t k0 = 0; /* whole location beyond current dimension */
+ hsize_t k1 = 0; /* partial location within dimension */
+ hsize_t dim_size = 0; /* previous dim size */
+ hsize_t prev_dim_size = 0; /* previous dim size */
+ hsize_t total_dim_size = 1; /* current dim size */
+ hsize_t prev_total_dim_size = 1; /* current dim size */
+
+ prev_dim_size = 1;
+ total_dim_size = 1;
+ curr_idx = idx;
+ /* begin with fastest changing dimension */
+ for (int i = 0; i < opts->rank; i++) {
+ j = opts->rank - i - 1;
+ prev_total_dim_size *= prev_dim_size;
+ dim_size = opts->dims[j];
+ H5TOOLS_DEBUG("j=%d, dim_size=%lld, prev_dim_size=%lld, total_dim_size=%lld, "
+ "prev_total_dim_size=%lld",
+ j, dim_size, prev_dim_size, total_dim_size, prev_total_dim_size);
+ count = opts->sset[0]->count.data[j];
+ block = opts->sset[0]->block.data[j];
+ stride = opts->sset[0]->stride.data[j];
+ H5TOOLS_DEBUG("stride=%lld, count=%lld, block=%lld", stride, count, block);
+ tmp = count * block;
+ k0 = curr_idx / tmp;
+ k1 = curr_idx % tmp;
+ curr_pos += k1 * stride * prev_total_dim_size;
+ H5TOOLS_DEBUG("curr_idx=%lld, k0=%lld, k1=%lld, curr_pos=%lld", curr_idx, k0, k1,
+ curr_pos);
+ if (k0 > 0)
+ curr_idx = k0 * total_dim_size;
+ H5TOOLS_DEBUG("curr_idx=%lld, tmp=%lld", curr_idx, tmp);
+ total_dim_size *= dim_size;
+ /* if last calculation exists within in current dimension */
+ if (k0 == 0)
+ break;
+ H5TOOLS_DEBUG("j=%d, curr_pos=%lld", j, curr_pos);
+ prev_dim_size = dim_size;
}
- next_idx += dim_size * str_cnt; // + prev_dim_size;
- H5TOOLS_DEBUG("... sset loop:%d with curr_idx:%ld (next_idx:%ld)", j, curr_idx, next_idx);
- str_cnt = 0;
- prev_str = str_idx;
- prev_dim_size = dim_size;
- H5TOOLS_DEBUG("... end sset loop:%d with prev_dim_size:%ld (curr_idx:%ld - data_idx:%ld) "
- "- str_cnt:%ld",
- j, prev_dim_size, curr_idx, data_idx, str_cnt);
- elmnt_cnt *= dim_size; /* Total number of elements in dimension */
- j--;
- } while (next_idx >= elmnt_cnt && j >= 0);
- curr_pos = curr_idx; /* New current position */
- H5TOOLS_DEBUG("pos loop:%d,%d with elmnt_cnt:%ld - curr_pos:%ld", i, j, elmnt_cnt, curr_pos);
- } /* if (opts->sset[0] != NULL) */
+ /* check if there is a final calculation needed for slowest changing dimension */
+ if (k0 > 0)
+ curr_pos += k0 * stride * prev_total_dim_size;
+ H5TOOLS_DEBUG("4:curr_idx=%lld, curr_pos=%lld", curr_idx, curr_pos);
+ }
+ }
/*
* Calculate the number of elements represented by a unit change in a
* certain index position.
*/
calc_acc_pos((unsigned)opts->rank, curr_pos, opts->acc, opts->pos);
- for (i = 0; i < opts->rank; i++) {
- H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld opts->sm_pos=%ld", i, opts->pos[i],
+ for (int i = 0; i < opts->rank; i++) {
+ H5TOOLS_DEBUG("pos loop:%d with opts->pos=%lld opts->sm_pos=%lld", i, opts->pos[i],
opts->sm_pos[i]);
opts->pos[i] += (unsigned long)opts->sm_pos[i];
- H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld", i, opts->pos[i]);
+ H5TOOLS_DEBUG("pos loop:%d with opts->pos=%lld", i, opts->pos[i]);
parallel_print(HSIZE_T_FORMAT, (unsigned long long)opts->pos[i]);
parallel_print(" ");
}
@@ -3454,7 +3447,7 @@ print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
parallel_print(SPACES);
}
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -3536,8 +3529,6 @@ get_member_types(hid_t tid, mcomp_t *members)
get_member_types(members->ids[u], members->m[u]);
}
}
-
- return;
}
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index c5966da..5c1777a 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -104,7 +104,7 @@ table_attrs_free(table_attrs_t *table)
* Date: March 15, 2011
*------------------------------------------------------------------------*/
static void
-table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table)
+table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table)
{
if (table->nattrs == table->size) {
match_attr_t *new_attrs;
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index b0726ec..e6872f0 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -961,7 +961,7 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1,
int i;
int ret_value = 1;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/*-------------------------------------------------------------------------
* check for the same class
*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 3e24802..e487a12 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -339,7 +339,7 @@ match_up_memsize(hid_t f_tid1_id, hid_t f_tid2_id, hid_t *m_tid1, hid_t *m_tid2,
{
herr_t ret_value = SUCCEED;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((*m_size1) != (*m_size2)) {
if ((*m_size1) < (*m_size2)) {
H5Tclose(*m_tid1);
@@ -362,6 +362,6 @@ match_up_memsize(hid_t f_tid1_id, hid_t f_tid2_id, hid_t *m_tid1, hid_t *m_tid2,
H5TOOLS_GOTO_ERROR(FAIL, "native type sizes do not compare");
done:
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 3b78491..eee9c53 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -885,7 +885,10 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
fid = H5Fopen(fname, flags, fapl_id);
}
else {
- H5E_BEGIN_TRY { fid = H5Fopen(fname, flags, fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ fid = H5Fopen(fname, flags, fapl_id);
+ }
H5E_END_TRY;
}
@@ -1126,7 +1129,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context
if (!ctx->need_prefix)
return;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
HDmemset(&prefix, 0, sizeof(h5tools_str_t));
HDmemset(&str, 0, sizeof(h5tools_str_t));
@@ -1195,7 +1198,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context
h5tools_str_close(&prefix);
h5tools_str_close(&str);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -1441,7 +1444,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_contex
ctx->prev_multiline = multiline;
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return dimension_break;
}
@@ -1482,7 +1485,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools
int secnum; /* section sequence number */
int multiline; /* datum was multiline */
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
H5TOOLS_DEBUG("elmt_counter=%ld - local_elmt_counter=%ld", elmt_counter, local_elmt_counter);
s = h5tools_str_fmt(buffer, (size_t)0, "%s");
@@ -1595,7 +1598,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools
ctx->prev_multiline = multiline;
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return dimension_break;
}
@@ -1609,12 +1612,12 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools
*-------------------------------------------------------------------------
*/
void
-init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx)
+init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx)
{
int i;
unsigned j;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
for (i = 0; (unsigned)i < ndims; i++)
p_min_idx[i] = 0;
@@ -1629,7 +1632,7 @@ init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t
pos[j] = 0;
}
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -1642,12 +1645,12 @@ init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t
*-------------------------------------------------------------------------
*/
hsize_t
-calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos)
+calc_acc_pos(unsigned ndims, hsize_t elmtno, const hsize_t *acc, hsize_t *pos)
{
int i;
hsize_t curr_pos = elmtno;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if (ndims > 0) {
for (i = 0; i < (int)ndims; i++) {
@@ -1662,7 +1665,7 @@ calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos)
}
}
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return curr_pos;
}
@@ -1686,7 +1689,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
hbool_t past_catch = FALSE;
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((size = H5Tget_size(tid)) == 0)
H5TOOLS_THROW((-1), "H5Tget_size failed");
@@ -1896,7 +1899,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
} /* end switch */
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1913,7 +1916,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
*/
int
render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, unsigned ndims,
- hid_t type_id, hsize_t nblocks, hsize_t *ptdata)
+ hid_t type_id, hsize_t nblocks, const hsize_t *ptdata)
{
hsize_t *dims1 = NULL;
hsize_t *start = NULL;
@@ -1929,7 +1932,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t contai
hid_t sid1 = H5I_INVALID_HID;
int ret_value = -1;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/* Get the dataspace of the dataset */
if ((sid1 = H5Dget_space(region_id)) < 0)
H5TOOLS_THROW((-1), "H5Dget_space failed");
@@ -1995,7 +1998,7 @@ done:;
if (H5Sclose(sid1) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -2023,7 +2026,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *strea
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
H5TOOLS_THROW(FALSE, "H5Sget_select_hyper_nblocks failed");
nblocks = (hsize_t)snblocks;
@@ -2059,7 +2062,7 @@ done:
H5_LEAVE(TRUE)
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -2090,7 +2093,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *
void * region_buf = NULL;
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((type_size = H5Tget_size(type_id)) == 0)
H5TOOLS_GOTO_ERROR((-1), "H5Tget_size failed");
@@ -2120,7 +2123,7 @@ done:
if (H5Sclose(mem_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -2146,7 +2149,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *strea
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((snpoints = H5Sget_select_elem_npoints(region_space)) <= 0)
H5TOOLS_THROW(FALSE, "H5Sget_select_elem_npoints failed");
npoints = (hsize_t)snpoints;
@@ -2173,7 +2176,7 @@ done:
H5_LEAVE(ret_value)
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -2221,12 +2224,12 @@ h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char
H5O_info2_t oinfo1, oinfo2;
hbool_t ret_val = FALSE;
- if (name1 && HDstrcmp(name1, "."))
+ if (name1 && HDstrcmp(name1, ".") != 0)
H5Oget_info_by_name3(loc_id1, name1, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id1, &oinfo1, H5O_INFO_BASIC);
- if (name2 && HDstrcmp(name2, "."))
+ if (name2 && HDstrcmp(name2, ".") != 0)
H5Oget_info_by_name3(loc_id2, name2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id2, &oinfo2, H5O_INFO_BASIC);
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index aa8a989..9d065f3 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -17,8 +17,8 @@
*
* Purpose: Support functions for the various tools.
*/
-#ifndef H5TOOLS_H__
-#define H5TOOLS_H__
+#ifndef H5TOOLS_H
+#define H5TOOLS_H
#include "hdf5.h"
#include "h5tools_error.h"
@@ -672,8 +672,9 @@ H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type);
H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid);
H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid);
H5TOOLS_DLL hbool_t h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2);
-H5TOOLS_DLL void init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx);
-H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, hsize_t *acc, hsize_t *pos);
+H5TOOLS_DLL void init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos,
+ hsize_t *p_min_idx);
+H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, const hsize_t *acc, hsize_t *pos);
H5TOOLS_DLL hbool_t h5tools_is_zero(const void *_mem, size_t size);
H5TOOLS_DLL int h5tools_canreadf(const char *name, hid_t dcpl_id);
H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn);
@@ -687,7 +688,7 @@ H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_
H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts);
H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container,
unsigned ndims, hid_t type_id, hsize_t nblocks,
- hsize_t *ptdata);
+ const hsize_t *ptdata);
H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream,
hid_t container);
H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream,
@@ -708,4 +709,4 @@ H5TOOLS_DLL hbool_t h5tools_render_region_element(FILE *stream, const h5tool_for
}
#endif
-#endif /* H5TOOLS_H__ */
+#endif /* H5TOOLS_H */
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index d31490c..cb4f9d2 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -465,7 +465,7 @@ done:
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -522,7 +522,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for
HDmemset(&ctx, 0, sizeof(ctx));
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((type_size = H5Tget_size(type_id)) == 0)
H5TOOLS_THROW(FAIL, "H5Tget_size failed");
@@ -642,7 +642,7 @@ done:
if (H5Sclose(sid1) < 0)
H5TOOLS_ERROR(FAIL, "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -696,7 +696,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea
HDassert(ctx);
HDassert(buffer);
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
outputformat = *info;
outputformat.idx_fmt = "";
outputformat.idx_n_fmt = "";
@@ -865,7 +865,7 @@ done:
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -915,7 +915,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre
HDassert(ptdata);
HDassert(ndims > 0);
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
HDmemset(&ctx, 0, sizeof(ctx));
/* Allocate space for the dimension array */
@@ -1001,7 +1001,7 @@ done:
if (H5Sclose(mem_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1053,7 +1053,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea
HDassert(ctx);
HDassert(buffer);
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
outputformat = *info;
outputformat.idx_fmt = "";
outputformat.idx_n_fmt = "";
@@ -1217,7 +1217,7 @@ done:
H5_LEAVE(dimension_break)
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1257,12 +1257,12 @@ done:
static herr_t
h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset,
hid_t p_type, hid_t f_space, hsize_t hyperslab_count,
- hsize_t * temp_start, /* start inside offset count loop */
- hsize_t * temp_count, /* count inside offset count loop */
- hsize_t * temp_block, /* block size used in loop */
- hsize_t * temp_stride, /* stride size used in loop */
- hsize_t * total_size, /* total size of dataset */
- unsigned int row_dim) /* index of row_counter dimension */
+ hsize_t * temp_start, /* start inside offset count loop */
+ hsize_t * temp_count, /* count inside offset count loop */
+ hsize_t * temp_block, /* block size used in loop */
+ hsize_t * temp_stride, /* stride size used in loop */
+ const hsize_t *total_size, /* total size of dataset */
+ unsigned int row_dim) /* index of row_counter dimension */
{
size_t i; /* counters */
size_t j; /* counters */
@@ -1284,7 +1284,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
unsigned int vl_data = 0; /* contains VL datatypes */
herr_t ret_value = SUCCEED;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((size_t)ctx->ndims > NELMTS(sm_size))
H5TOOLS_THROW(FAIL, "ndims and sm_size comparision failed");
@@ -1398,7 +1398,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
if (sm_buf)
HDfree(sm_buf);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1583,7 +1583,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
hbool_t past_catch = FALSE;
herr_t ret_value = SUCCEED;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((f_space = H5Dget_space(dset)) < 0)
H5TOOLS_THROW(FAIL, "H5Dget_space failed");
@@ -1607,7 +1607,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
if (f_space >= 0 && H5Sclose(f_space) < 0)
H5TOOLS_THROW(FAIL, "H5Sclose failed");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1660,7 +1660,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
unsigned int vl_data = 0; /* contains VL datatypes */
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if (H5I_INVALID_HID == (f_space = H5Dget_space(dset)))
H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
@@ -1795,7 +1795,7 @@ done:
if (f_space >= 0 && H5Sclose(f_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1826,7 +1826,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
/* VL data special information */
unsigned int vl_data = 0; /* contains VL datatypes */
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if (H5I_INVALID_HID == (f_space = H5Aget_space(attr_id)))
H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
@@ -1885,7 +1885,7 @@ done:
if (f_space >= 0 && H5Sclose(f_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1917,7 +1917,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tool_format_t info_dflt;
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/* Use default values */
if (!stream)
stream = rawoutstream;
@@ -1969,7 +1969,7 @@ done:
if (f_space > 0)
H5Sclose(f_space);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -1993,7 +1993,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
h5tool_format_t info_dflt;
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/* Use default values */
if (!stream)
stream = rawoutstream;
@@ -2039,7 +2039,7 @@ done:
if (f_space > 0)
H5Sclose(f_space);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -2082,7 +2082,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
const char *order_s = NULL; /* byte order string */
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((type_class = H5Tget_class(type)) < 0)
H5TOOLS_THROW((-1), "H5Tget_class failed");
if (object_search && H5Tcommitted(type) > 0) {
@@ -2197,9 +2197,10 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
else
sign_s = " unknown-sign";
- /* print size, order, and sign */
- h5tools_str_append(buffer, "%lu-bit%s%s integer", (unsigned long)(8 * H5Tget_size(type)),
- order_s, sign_s);
+ /* print size, order, sign, and precision */
+ h5tools_str_append(buffer, "%lu-bit%s%s integer %lu-bit precision",
+ (unsigned long)(8 * H5Tget_size(type)), order_s, sign_s,
+ H5Tget_precision(type));
}
break;
@@ -2220,12 +2221,8 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_append(buffer, "H5T_NATIVE_FLOAT");
else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE)
h5tools_str_append(buffer, "H5T_NATIVE_DOUBLE");
-#if H5_SIZEOF_LONG_DOUBLE != 0
- else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE)
- h5tools_str_append(buffer, "H5T_NATIVE_LDOUBLE");
-#endif
else {
-
+ /* print what the library knows */
/* byte order */
if (H5Tget_size(type) > 1) {
order = H5Tget_order(type);
@@ -2241,9 +2238,9 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
else
order_s = "";
- /* print size and byte order */
- h5tools_str_append(buffer, "%lu-bit%s floating-point", (unsigned long)(8 * H5Tget_size(type)),
- order_s);
+ /* print size. byte order, and precision */
+ h5tools_str_append(buffer, "%lu-bit%s floating-point %lu-bit precision",
+ (unsigned long)(8 * H5Tget_size(type)), order_s, H5Tget_precision(type));
}
break;
@@ -2644,7 +2641,7 @@ found_string_type:
}
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -2670,7 +2667,7 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
int i;
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if ((ndims = H5Sget_simple_extent_dims(space, size, maxsize)) < 0)
H5TOOLS_THROW((-1), "H5Sget_simple_extent_dims failed");
@@ -2724,7 +2721,7 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
} /* end switch */
CATCH
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -2759,7 +2756,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
hbool_t past_catch = FALSE;
int ret_value = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -2871,7 +2868,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
if (0 == nmembs)
h5tools_str_append(buffer, "\n<empty>");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return ret_value;
}
@@ -4072,7 +4069,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t datactx; /* print context */
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
datactx = *ctx; /* print context */
/* Assume entire data space to be printed */
@@ -4279,7 +4276,7 @@ h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_contex
h5tools_str_close(&buffer);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -4496,5 +4493,5 @@ done:
}
h5tools_str_close(&buffer);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h
index d49187d..901b38e 100644
--- a/tools/lib/h5tools_dump.h
+++ b/tools/lib/h5tools_dump.h
@@ -14,8 +14,8 @@
/*
* Purpose: Support h5dump functions for the various tools.
*/
-#ifndef H5TOOLS_DUMP_H__
-#define H5TOOLS_DUMP_H__
+#ifndef H5TOOLS_DUMP_H
+#define H5TOOLS_DUMP_H
#include "h5tools_utils.h"
@@ -94,4 +94,4 @@ H5TOOLS_DLL void h5tools_print_packed_bits(h5tools_str_t *buffer /*in,out*/, hid
}
#endif
-#endif /* H5TOOLS_DUMP_H__ */
+#endif /* H5TOOLS_DUMP_H */
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index b8e5339..b1ca00f 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -14,8 +14,8 @@
/*
* Header file for error values, etc.
*/
-#ifndef H5TOOLS_ERROR_H_
-#define H5TOOLS_ERROR_H_
+#ifndef H5TOOLS_ERROR_H
+#define H5TOOLS_ERROR_H
#include "H5Epublic.h"
#include "H5Eprivate.h" /* Error handling */
@@ -29,15 +29,6 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g;
H5TOOLS_DLLVAR hid_t H5E_tools_min_info_id_g;
H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
-/* Use FUNC to safely handle variations of C99 __func__ keyword handling */
-#ifdef H5_HAVE_C99_FUNC
-#define FUNC __func__
-#elif defined(H5_HAVE_FUNCTION)
-#define FUNC __FUNCTION__
-#else
-#error "We need __func__ or __FUNCTION__ to test function names!"
-#endif
-
/*
* H5TOOLS_INIT_ERROR macro, used to initialize error reporting.
*/
@@ -105,7 +96,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
do { \
if (enable_error_stack > 0) { \
if (estack_id >= 0 && err_cls >= 0) \
- H5Epush2(estack_id, __FILE__, FUNC, __LINE__, err_cls, maj_err_id, min_err_id, __VA_ARGS__); \
+ H5Epush2(estack_id, __FILE__, __func__, __LINE__, err_cls, maj_err_id, min_err_id, \
+ __VA_ARGS__); \
else { \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
@@ -175,7 +167,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
#define H5TOOLS_START_DEBUG(...) \
do { \
H5tools_INDENT_g += 2; \
- HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
HDfflush(stderr); \
@@ -183,7 +175,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
#define H5TOOLS_DEBUG(...) \
do { \
- HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
HDfflush(stderr); \
@@ -191,7 +183,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
#define H5TOOLS_ENDDEBUG(...) \
do { \
- HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
H5tools_INDENT_g -= 2; \
@@ -220,22 +212,22 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
/* Macro for "catching" flow of control when an error occurs. Note that the
* H5_LEAVE macro won't jump back here once it's past this point.
*/
-/* #define CATCH catch_except:; past_catch = TRUE; defined in H5Eprivate.h */
+#define CATCH \
+catch_except:; \
+ past_catch = TRUE;
/*
- * H5_LEAVE macro, used to facilitate control flow between a
- * BEGIN_FUNC() and an END_FUNC() within a function body. The argument is
- * the return value.
- * The return value is assigned to a variable `ret_value' and control branches
- * to the `catch_except' label, if we're not already past it.
+ * H5_LEAVE macro, used to facilitate control flow in a function. The argument
+ * is the return value. The return value is assigned to a variable `ret_value'
+ * and control branches to the `catch_except' label, if we're not already past
+ * it.
*/
-/*
- * #define H5_LEAVE(v) { \
- * ret_value = v; \
- * if(!past_catch) \
- * goto catch_except; \
- * }
- * defined in H5Eprivate.h */
+#define H5_LEAVE(v) \
+ { \
+ ret_value = v; \
+ if (!past_catch) \
+ goto catch_except; \
+ }
/*
* H5TOOLS_THROW macro, used to facilitate error reporting within a function body.
@@ -250,4 +242,4 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
H5_LEAVE(ret_val) \
} while (0)
-#endif /* H5TOOLS_ERROR_H_ */
+#endif /* H5TOOLS_ERROR_H */
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index 4643466..50f283d 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -200,7 +200,7 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token)
if ((thepath == NULL) || (HDstrlen(thepath) == 0))
return -1;
/* Allow lookups on the root group, even though it doesn't have any link info */
- if (HDstrcmp(thepath, "/")) {
+ if (HDstrcmp(thepath, "/") != 0) {
H5L_info2_t li;
/* Check for external link first, so we don't return the OID of an object in another file */
diff --git a/tools/lib/h5tools_ref.h b/tools/lib/h5tools_ref.h
index b4819ef..9feaeb1 100644
--- a/tools/lib/h5tools_ref.h
+++ b/tools/lib/h5tools_ref.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5TOOLS_REF_H__
-#define H5TOOLS_REF_H__
+#ifndef H5TOOLS_REF_H
+#define H5TOOLS_REF_H
#include "hdf5.h"
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 6eaded2..abc0058 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -142,7 +142,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...)
/* failure, such as bad format */
return NULL;
- if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) {
+ if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s") != 0))) {
/* Truncation return value as documented by C99, or zero return value with either of the
* following conditions, each of which indicates that the proper C99 return value probably
* should have been positive when the format string is
@@ -258,7 +258,8 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt)
HDassert(temp);
}
- HDstrncpy(temp, str->s + start, n);
+ HDstrncpy(temp, str->s + start, n - 1);
+ temp[n - 1] = '\0';
}
/* Reset the output string and append a formatted version */
@@ -287,7 +288,7 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h
{
size_t i = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims);
h5tools_str_reset(str);
@@ -306,7 +307,7 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h
h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)elmtno);
H5TOOLS_DEBUG("str=%s", str->s);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
/* Add prefix and suffix to the index */
return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
@@ -323,11 +324,11 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h
*/
char *
h5tools_str_region_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno,
- hsize_t *ptdata, h5tools_context_t *ctx)
+ const hsize_t *ptdata, h5tools_context_t *ctx)
{
size_t i = 0;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims);
h5tools_str_reset(str);
@@ -347,7 +348,7 @@ h5tools_str_region_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *
h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)0);
H5TOOLS_DEBUG("str=%s", str->s);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
/* Add prefix and suffix to the index */
return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
@@ -439,7 +440,10 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_for
/*
* This function fails if the rspace does not have blocks.
*/
- H5E_BEGIN_TRY { snblocks = H5Sget_select_hyper_nblocks(rspace); }
+ H5E_BEGIN_TRY
+ {
+ snblocks = H5Sget_select_hyper_nblocks(rspace);
+ }
H5E_END_TRY;
/* Print block information */
@@ -496,7 +500,10 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_for
/*
* This function fails if the rspace does not have points.
*/
- H5E_BEGIN_TRY { snpoints = H5Sget_select_elem_npoints(rspace); }
+ H5E_BEGIN_TRY
+ {
+ snpoints = H5Sget_select_elem_npoints(rspace);
+ }
H5E_END_TRY;
/* Print point information */
@@ -651,7 +658,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
H5T_class_t type_class;
char * ret_value = NULL;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/* Build default formats for long long types */
if (!fmt_llong[0]) {
HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH);
@@ -1333,7 +1340,7 @@ h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *ref_vp)
{
ssize_t buf_size;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
h5tools_str_append(str, " \"");
buf_size = H5Rget_file_name(ref_vp, NULL, 0);
@@ -1375,7 +1382,7 @@ h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *ref_vp)
}
h5tools_str_append(str, "\"");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h
index 9853498..eee87c9 100644
--- a/tools/lib/h5tools_str.h
+++ b/tools/lib/h5tools_str.h
@@ -15,8 +15,8 @@
* Programmer: Bill Wendling
* Monday, 19. February 2001
*/
-#ifndef H5TOOLS_STR_H__
-#define H5TOOLS_STR_H__
+#ifndef H5TOOLS_STR_H
+#define H5TOOLS_STR_H
typedef struct h5tools_str_t {
char * s; /*allocate string */
@@ -36,7 +36,7 @@ H5TOOLS_DLL char * h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t
* new functions needed to display region reference data
*/
H5TOOLS_DLL char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno,
- hsize_t *ptdata, h5tools_context_t *ctx);
+ const hsize_t *ptdata, h5tools_context_t *ctx);
H5TOOLS_DLL void h5tools_str_dump_space_slabs(h5tools_str_t *, hid_t, const h5tool_format_t *,
h5tools_context_t *ctx);
H5TOOLS_DLL void h5tools_str_dump_space_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *);
@@ -46,4 +46,4 @@ H5TOOLS_DLL char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *
hid_t type, void *vp, h5tools_context_t *ctx);
H5TOOLS_DLL char *h5tools_str_replace(const char *string, const char *substr, const char *replacement);
-#endif /* H5TOOLS_STR_H__ */
+#endif /* H5TOOLS_STR_H */
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index b33d908..f2407bf 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -25,12 +25,8 @@
#include "H5FDros3.h"
#endif
-/* global variables */
-unsigned h5tools_nCols = 80;
-/* ``get_option'' variables */
-int opt_err = 1; /*get_option prints errors if this is on */
-int opt_ind = 1; /*token pointer */
-const char * opt_arg; /*flag argument (or value) */
+/* Global variables */
+unsigned h5tools_nCols = 80;
static int h5tools_d_status = 0;
static const char *h5tools_progname = "h5tools";
@@ -162,167 +158,6 @@ help_ref_msg(FILE *output)
HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n", h5tools_getprogname());
}
-/*-------------------------------------------------------------------------
- * Function: get_option
- *
- * Purpose: Determine the command-line options a user specified. We can
- * accept both short and long type command-lines.
- *
- * Return: Success: The short valued "name" of the command line
- * parameter or EOF if there are no more
- * parameters to process.
- *
- * Failure: A question mark.
- *-------------------------------------------------------------------------
- */
-int
-get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts)
-{
- static int sp = 1; /* character index in current token */
- int opt_opt = '?'; /* option character passed back to user */
-
- if (sp == 1) {
- /* check for more flag-like tokens */
- if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') {
- return EOF;
- }
- else if (HDstrcmp(argv[opt_ind], "--") == 0) {
- opt_ind++;
- return EOF;
- }
- }
-
- if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') {
- /* long command line option */
- int i;
- const char ch = '=';
- char * arg = HDstrdup(&argv[opt_ind][2]);
- size_t arg_len = 0;
-
- opt_arg = strchr(&argv[opt_ind][2], ch);
- arg_len = HDstrlen(&argv[opt_ind][2]);
- if (opt_arg) {
- arg_len -= HDstrlen(opt_arg);
- opt_arg++; /* skip the equal sign */
- }
- arg[arg_len] = 0;
-
- for (i = 0; l_opts && l_opts[i].name; i++) {
- if (HDstrcmp(arg, l_opts[i].name) == 0) {
- /* we've found a matching long command line flag */
- opt_opt = l_opts[i].shortval;
-
- if (l_opts[i].has_arg != no_arg) {
- if (opt_arg == NULL) {
- if (l_opts[i].has_arg != optional_arg) {
- if (opt_ind < (argc - 1))
- if (argv[opt_ind + 1][0] != '-')
- opt_arg = argv[++opt_ind];
- }
- else if (l_opts[i].has_arg == require_arg) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0],
- arg);
-
- opt_opt = '?';
- }
- }
- }
- else {
- if (opt_arg) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: no option required for \"%s\" flag\n", argv[0],
- arg);
-
- opt_opt = '?';
- }
- }
- break;
- }
- }
-
- if (l_opts[i].name == NULL) {
- /* exhausted all of the l_opts we have and still didn't match */
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: unknown option \"%s\"\n", argv[0], arg);
-
- opt_opt = '?';
- }
-
- opt_ind++;
- sp = 1;
-
- HDfree(arg);
- }
- else {
- register char *cp; /* pointer into current token */
-
- /* short command line option */
- opt_opt = argv[opt_ind][sp];
-
- if (opt_opt == ':' || (cp = HDstrchr(opts, opt_opt)) == 0) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: unknown option \"%c\"\n", argv[0], opt_opt);
-
- /* if no chars left in this token, move to next token */
- if (argv[opt_ind][++sp] == '\0') {
- opt_ind++;
- sp = 1;
- }
- return '?';
- }
-
- if (*++cp == ':') {
- /* if a value is expected, get it */
- if (argv[opt_ind][sp + 1] != '\0') {
- /* flag value is rest of current token */
- opt_arg = &argv[opt_ind++][sp + 1];
- }
- else if (++opt_ind >= argc) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: value expected for option \"%c\"\n", argv[0], opt_opt);
-
- opt_opt = '?';
- }
- else {
- /* flag value is next token */
- opt_arg = argv[opt_ind++];
- }
-
- sp = 1;
- }
- /* wildcard argument */
- else if (*cp == '*') {
- /* check the next argument */
- opt_ind++;
- /* we do have an extra argument, check if not last */
- if ((opt_ind + 1) < argc) {
- if (argv[opt_ind][0] != '-') {
- opt_arg = argv[opt_ind++];
- }
- else {
- opt_arg = NULL;
- }
- }
- else {
- opt_arg = NULL;
- }
- }
- else {
- /* set up to look at next char in token, next time */
- if (argv[opt_ind][++sp] == '\0') {
- /* no more in current token, so setup next token */
- opt_ind++;
- sp = 1;
- }
- opt_arg = NULL;
- }
- }
-
- /* return the current flag character found */
- return opt_opt;
-}
-
/*****************************************************************************
*
* Function: parse_tuple()
@@ -1075,7 +910,6 @@ h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t
{
const char *ccred[3];
unsigned nelems = 0;
- char * start = NULL;
char * s3cred_src = NULL;
char ** s3cred = NULL;
herr_t ret_value = SUCCEED;
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index 316b007..095ad6c 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -17,8 +17,8 @@
*
* Purpose: Support functions for the various tools.
*/
-#ifndef H5TOOLS_UTILS_H__
-#define H5TOOLS_UTILS_H__
+#ifndef H5TOOLS_UTILS_H
+#define H5TOOLS_UTILS_H
#include "hdf5.h"
@@ -40,58 +40,6 @@ H5TOOLS_DLLVAR FILE *overflow_file;
H5TOOLS_DLLVAR hsize_t H5TOOLS_MALLOCSIZE;
/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */
H5TOOLS_DLLVAR hsize_t H5TOOLS_BUFSIZE;
-/*
- * begin get_option section
- */
-H5TOOLS_DLLVAR int opt_err; /* getoption prints errors if this is on */
-H5TOOLS_DLLVAR int opt_ind; /* token pointer */
-H5TOOLS_DLLVAR const char *opt_arg; /* flag argument (or value) */
-
-enum {
- no_arg = 0, /* doesn't take an argument */
- require_arg, /* requires an argument */
- optional_arg /* argument is optional */
-};
-
-/*
- * get_option determines which options are specified on the command line and
- * returns a pointer to any arguments possibly associated with the option in
- * the ``opt_arg'' variable. get_option returns the shortname equivalent of
- * the option. The long options are specified in the following way:
- *
- * struct long_options foo[] = {
- * { "filename", require_arg, 'f' },
- * { "append", no_arg, 'a' },
- * { "width", require_arg, 'w' },
- * { NULL, 0, 0 }
- * };
- *
- * Long named options can have arguments specified as either:
- *
- * ``--param=arg'' or ``--param arg''
- *
- * Short named options can have arguments specified as either:
- *
- * ``-w80'' or ``-w 80''
- *
- * and can have more than one short named option specified at one time:
- *
- * -aw80
- *
- * in which case those options which expect an argument need to come at the
- * end.
- */
-typedef struct long_options {
- const char *name; /* name of the long option */
- int has_arg; /* whether we should look for an arg */
- char shortval; /* the shortname equivalent of long arg
- * this gets returned from get_option */
-} long_options;
-
-H5TOOLS_DLL int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt);
-/*
- * end get_option section
- */
/*struct taken from the dumper. needed in table struct*/
typedef struct obj_t {
@@ -191,4 +139,4 @@ H5TOOLS_DLL herr_t h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int deli
}
#endif
-#endif /* H5TOOLS_UTILS_H__ */
+#endif /* H5TOOLS_UTILS_H */
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 042288c..d0c299f 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -357,7 +357,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id)
H5O_info2_t oinfo;
size_t idx = info->nused - 1;
- if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, "."))
+ if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, ".") != 0)
H5Oget_info_by_name3(loc_id, info->paths[idx].path, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC);
@@ -731,7 +731,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char
*-------------------------------------------------------------------------
*/
void
-trav_table_addflags(unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table)
+trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table)
{
size_t new_obj;
diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h
index c45b07a..7a8a63d 100644
--- a/tools/lib/h5trav.h
+++ b/tools/lib/h5trav.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5TRAV_H__
-#define H5TRAV_H__
+#ifndef H5TRAV_H
+#define H5TRAV_H
#include "hdf5.h"
@@ -187,6 +187,7 @@ H5TOOLS_DLL void trav_table_init(hid_t fid, trav_table_t **table);
H5TOOLS_DLL void trav_table_free(trav_table_t *table);
-H5TOOLS_DLL void trav_table_addflags(unsigned *flags, char *objname, h5trav_type_t type, trav_table_t *table);
+H5TOOLS_DLL void trav_table_addflags(const unsigned *flags, char *objname, h5trav_type_t type,
+ trav_table_t *table);
-#endif /* H5TRAV_H__ */
+#endif /* H5TRAV_H */
diff --git a/tools/lib/io_timer.h b/tools/lib/io_timer.h
index 96ea05e..0b0f0bb 100644
--- a/tools/lib/io_timer.h
+++ b/tools/lib/io_timer.h
@@ -11,23 +11,20 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef IO_TIMER__
-#define IO_TIMER__
+#ifndef IO_TIMER
+#define IO_TIMER
#include "hdf5.h"
-#if defined(H5_TIME_WITH_SYS_TIME)
-#include <sys/time.h>
#include <time.h>
-#elif defined(H5_HAVE_SYS_TIME_H)
+
+#ifdef H5_HAVE_SYS_TIME_H
#include <sys/time.h>
-#else
-#include <time.h>
#endif
-#ifdef H5_HAVE_WINSOCK2_H
+#ifdef H5_HAVE_WIN32_API
#include <winsock2.h>
-#endif /* H5_HAVE_WINSOCK2_H */
+#endif
/* The different types of timers we can have */
typedef enum timer_type_ {
@@ -88,4 +85,4 @@ H5TOOLS_DLL double io_time_get(io_time_t *pt, timer_type t);
}
#endif /* __cplusplus */
-#endif /* IO_TIMER__ */
+#endif /* IO_TIMER */
diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h
index 8e884dd..7dce495 100644
--- a/tools/lib/ph5diff.h
+++ b/tools/lib/ph5diff.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _PH5DIFF_H__
-#define _PH5DIFF_H__
+#ifndef PH5DIFF_H
+#define PH5DIFF_H
/* Send from manager to workers */
#define MPI_TAG_ARGS 1
@@ -40,4 +40,4 @@ struct diffs_found {
int not_cmp;
};
-#endif /* _PH5DIFF_H__ */
+#endif /* PH5DIFF_H */
diff --git a/tools/libtest/Makefile.am b/tools/libtest/Makefile.am
index a93e25d..1a08a01 100644
--- a/tools/libtest/Makefile.am
+++ b/tools/libtest/Makefile.am
@@ -1,16 +1,16 @@
#
-# Read-Only S3 Virtual File Driver (VFD)
-# Copyright (c) 2017-2018, The HDF Group.
-#
+# Copyright by The HDF Group.
# All rights reserved.
#
# NOTICE:
-# All information contained herein is, and remains, the property of The HDF
-# Group. The intellectual and technical concepts contained herein are
-# proprietary to The HDF Group. Dissemination of this information or
-# reproduction of this material is strictly forbidden unless prior written
-# permission is obtained from The HDF Group.
-##
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://www.hdfgroup.org/licenses.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
## Makefile.am
## Run automake to generate a Makefile.in from this file.
#
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index 7d88c37..37d38fd 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -69,7 +69,7 @@
*
*****************************************************************************/
-H5_GCC_DIAG_OFF("format")
+H5_GCC_CLANG_DIAG_OFF("format")
/*----------------------------------------------------------------------------
*
@@ -100,7 +100,7 @@ H5_GCC_DIAG_OFF("format")
*/
#define JSFAILED_AT() \
{ \
- HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \
}
/*----------------------------------------------------------------------------
@@ -1254,7 +1254,7 @@ error:
#undef UTIL_TEST_DEFAULT
#undef UTIL_TEST_CREATE
} /* test_set_configured_fapl */
-H5_GCC_DIAG_ON("format")
+H5_GCC_CLANG_DIAG_ON("format")
/*----------------------------------------------------------------------------
*
diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt
index 8c3e361..e291f61 100644
--- a/tools/src/CMakeLists.txt
+++ b/tools/src/CMakeLists.txt
@@ -13,7 +13,7 @@ add_subdirectory (misc)
#-- Add the h5import and test executables
add_subdirectory (h5import)
-#-- h5Repack executables
+#-- h5repack executables
add_subdirectory (h5repack)
#-- Add the h5dump and test executables
@@ -30,3 +30,6 @@ add_subdirectory (h5dump)
#-- Add the h5format_convert and test executables
add_subdirectory (h5format_convert)
+
+#-- h5perf executables
+add_subdirectory (h5perf)
diff --git a/tools/src/Makefile.am b/tools/src/Makefile.am
index 397bd31..5af7d06 100644
--- a/tools/src/Makefile.am
+++ b/tools/src/Makefile.am
@@ -23,6 +23,6 @@ CONFIG=ordered
# All subdirectories
SUBDIRS=h5diff h5ls h5dump misc h5import h5repack h5jam h5copy \
- h5format_convert h5stat
+ h5format_convert h5stat h5perf
include $(top_srcdir)/config/conclude.am
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index f618914..4e9a25e 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -19,23 +19,23 @@
#define PROGRAMNAME "h5copy"
/* command-line options: short and long-named parameters */
-static const char * s_opts = "d:f:hi:o:ps:vVE";
-static struct long_options l_opts[] = {{"destination", require_arg, 'd'},
- {"flag", require_arg, 'f'},
- {"help", no_arg, 'h'},
- {"input", require_arg, 'i'},
- {"output", require_arg, 'o'},
- {"parents", no_arg, 'p'},
- {"source", require_arg, 's'},
- {"verbose", no_arg, 'v'},
- {"version", no_arg, 'V'},
- {"enable-error-stack", no_arg, 'E'},
- {NULL, 0, '\0'}};
-char * fname_src = NULL;
-char * fname_dst = NULL;
-char * oname_src = NULL;
-char * oname_dst = NULL;
-char * str_flag = NULL;
+static const char * s_opts = "d:f:hi:o:ps:vVE";
+static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'},
+ {"flag", require_arg, 'f'},
+ {"help", no_arg, 'h'},
+ {"input", require_arg, 'i'},
+ {"output", require_arg, 'o'},
+ {"parents", no_arg, 'p'},
+ {"source", require_arg, 's'},
+ {"verbose", no_arg, 'v'},
+ {"version", no_arg, 'V'},
+ {"enable-error-stack", no_arg, 'E'},
+ {NULL, 0, '\0'}};
+char * fname_src = NULL;
+char * fname_dst = NULL;
+char * oname_src = NULL;
+char * oname_dst = NULL;
+char * str_flag = NULL;
/*-------------------------------------------------------------------------
* Function: leave
@@ -242,19 +242,19 @@ main(int argc, const char *argv[])
} /* end if */
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'd':
- oname_dst = HDstrdup(opt_arg);
+ oname_dst = HDstrdup(H5_optarg);
break;
case 'f':
/* validate flag */
- if (parse_flag(opt_arg, &flag) < 0) {
+ if (parse_flag(H5_optarg, &flag) < 0) {
usage();
leave(EXIT_FAILURE);
}
- str_flag = HDstrdup(opt_arg);
+ str_flag = HDstrdup(H5_optarg);
break;
case 'h':
@@ -263,11 +263,11 @@ main(int argc, const char *argv[])
break;
case 'i':
- fname_src = HDstrdup(opt_arg);
+ fname_src = HDstrdup(H5_optarg);
break;
case 'o':
- fname_dst = HDstrdup(opt_arg);
+ fname_dst = HDstrdup(H5_optarg);
break;
case 'p':
@@ -275,7 +275,7 @@ main(int argc, const char *argv[])
break;
case 's':
- oname_src = HDstrdup(opt_arg);
+ oname_src = HDstrdup(H5_optarg);
break;
case 'V':
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index 99cd653..b669087 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -25,30 +25,30 @@ static int check_d_input(const char *);
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"version", no_arg, 'V'},
- {"report", no_arg, 'r'},
- {"verbose", optional_arg, 'v'},
- {"quiet", no_arg, 'q'},
- {"count", require_arg, 'n'},
- {"delta", require_arg, 'd'},
- {"relative", require_arg, 'p'},
- {"nan", no_arg, 'N'},
- {"compare", no_arg, 'c'},
- {"use-system-epsilon", no_arg, 'e'},
- {"follow-symlinks", no_arg, 'l'},
- {"no-dangling-links", no_arg, 'x'},
- {"exclude-path", require_arg, 'E'},
- {"exclude-attribute", require_arg, 'A'},
- {"enable-error-stack", no_arg, 'S'},
- {"vol-value-1", require_arg, '1'},
- {"vol-name-1", require_arg, '2'},
- {"vol-info-1", require_arg, '3'},
- {"vol-value-2", require_arg, '4'},
- {"vol-name-2", require_arg, '5'},
- {"vol-info-2", require_arg, '6'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
+ {"version", no_arg, 'V'},
+ {"report", no_arg, 'r'},
+ {"verbose", optional_arg, 'v'},
+ {"quiet", no_arg, 'q'},
+ {"count", require_arg, 'n'},
+ {"delta", require_arg, 'd'},
+ {"relative", require_arg, 'p'},
+ {"nan", no_arg, 'N'},
+ {"compare", no_arg, 'c'},
+ {"use-system-epsilon", no_arg, 'e'},
+ {"follow-symlinks", no_arg, 'l'},
+ {"no-dangling-links", no_arg, 'x'},
+ {"exclude-path", require_arg, 'E'},
+ {"exclude-attribute", require_arg, 'A'},
+ {"enable-error-stack", no_arg, 'S'},
+ {"vol-value-1", require_arg, '1'},
+ {"vol-name-1", require_arg, '2'},
+ {"vol-info-1", require_arg, '3'},
+ {"vol-value-2", require_arg, '4'},
+ {"vol-name-2", require_arg, '5'},
+ {"vol-info-2", require_arg, '6'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: check_options
@@ -138,7 +138,7 @@ parse_hsize_list(const char *h_list, subset_d *d)
}
d->data = p_list;
d->len = size_count;
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -187,7 +187,7 @@ parse_subset_params(const char *dset)
parse_hsize_list(brace, &s->block);
}
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return s;
}
@@ -208,7 +208,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node;
struct exclude_path_list *exclude_attr_head, *exclude_attr_prev, *exclude_attr_node;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
/* process the command-line */
HDmemset(opts, 0, sizeof(diff_opt_t));
@@ -232,7 +232,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
exclude_attr_head = NULL;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
default:
usage();
@@ -256,20 +256,20 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
* special check for short opt
*/
if (!strcmp(argv[i], "-v")) {
- if (opt_arg != NULL)
- opt_ind--;
+ if (H5_optarg != NULL)
+ H5_optind--;
opts->mode_verbose_level = 0;
break;
}
else if (!strncmp(argv[i], "-v", (size_t)2)) {
- if (opt_arg != NULL)
- opt_ind--;
+ if (H5_optarg != NULL)
+ H5_optind--;
opts->mode_verbose_level = atoi(&argv[i][2]);
break;
}
else {
- if (opt_arg != NULL)
- opts->mode_verbose_level = HDatoi(opt_arg);
+ if (H5_optarg != NULL)
+ opts->mode_verbose_level = HDatoi(H5_optarg);
else
opts->mode_verbose_level = 0;
}
@@ -308,7 +308,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
}
/* init */
- exclude_node->obj_path = opt_arg;
+ exclude_node->obj_path = H5_optarg;
exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN;
exclude_prev = exclude_head;
@@ -336,7 +336,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
}
/* init */
- exclude_attr_node->obj_path = opt_arg;
+ exclude_attr_node->obj_path = H5_optarg;
exclude_attr_node->obj_type = H5TRAV_TYPE_UNKNOWN;
exclude_attr_prev = exclude_attr_head;
@@ -356,37 +356,37 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
case 'd':
opts->delta_bool = 1;
- if (check_d_input(opt_arg) == -1) {
- HDprintf("<-d %s> is not a valid option\n", opt_arg);
+ if (check_d_input(H5_optarg) == -1) {
+ HDprintf("<-d %s> is not a valid option\n", H5_optarg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- opts->delta = HDatof(opt_arg);
+ opts->delta = HDatof(H5_optarg);
/* do not check against default, the DBL_EPSILON is being replaced by user */
break;
case 'p':
opts->percent_bool = 1;
- if (check_p_input(opt_arg) == -1) {
- HDprintf("<-p %s> is not a valid option\n", opt_arg);
+ if (check_p_input(H5_optarg) == -1) {
+ HDprintf("<-p %s> is not a valid option\n", H5_optarg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- opts->percent = HDatof(opt_arg);
+ opts->percent = HDatof(H5_optarg);
/* -p 0 is the same as default */
- if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F))
+ if (H5_DBL_ABS_EQUAL(opts->percent, 0.0))
opts->percent_bool = 0;
break;
case 'n':
opts->count_bool = 1;
- if (check_n_input(opt_arg) == -1) {
- HDprintf("<-n %s> is not a valid option\n", opt_arg);
+ if (check_n_input(H5_optarg) == -1) {
+ HDprintf("<-n %s> is not a valid option\n", H5_optarg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- opts->count = HDstrtoull(opt_arg, NULL, 0);
+ opts->count = HDstrtoull(H5_optarg, NULL, 0);
break;
case 'N':
@@ -403,34 +403,34 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
case '1':
opts->vol_info[0].type = VOL_BY_VALUE;
- opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
opts->custom_vol[0] = TRUE;
break;
case '2':
opts->vol_info[0].type = VOL_BY_NAME;
- opts->vol_info[0].u.name = opt_arg;
+ opts->vol_info[0].u.name = H5_optarg;
opts->custom_vol[0] = TRUE;
break;
case '3':
- opts->vol_info[0].info_string = opt_arg;
+ opts->vol_info[0].info_string = H5_optarg;
break;
case '4':
opts->vol_info[1].type = VOL_BY_VALUE;
- opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
opts->custom_vol[1] = TRUE;
break;
case '5':
opts->vol_info[1].type = VOL_BY_NAME;
- opts->vol_info[1].u.name = opt_arg;
+ opts->vol_info[1].u.name = H5_optarg;
opts->custom_vol[1] = TRUE;
break;
case '6':
- opts->vol_info[1].info_string = opt_arg;
+ opts->vol_info[1].info_string = H5_optarg;
break;
}
}
@@ -447,15 +447,15 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
opts->exclude_attr = exclude_attr_head;
/* check for file names to be processed */
- if (argc <= opt_ind || argv[opt_ind + 1] == NULL) {
+ if (argc <= H5_optind || argv[H5_optind + 1] == NULL) {
error_msg("missing file names\n");
usage();
h5diff_exit(EXIT_FAILURE);
}
- *fname1 = argv[opt_ind];
- *fname2 = argv[opt_ind + 1];
- *objname1 = argv[opt_ind + 2];
+ *fname1 = argv[H5_optind];
+ *fname2 = argv[H5_optind + 1];
+ *objname1 = argv[H5_optind + 2];
H5TOOLS_DEBUG("file1 = %s", *fname1);
H5TOOLS_DEBUG("file2 = %s", *fname2);
@@ -466,8 +466,8 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
}
H5TOOLS_DEBUG("objname1 = %s", *objname1);
- if (argv[opt_ind + 3] != NULL) {
- *objname2 = argv[opt_ind + 3];
+ if (argv[H5_optind + 3] != NULL) {
+ *objname2 = argv[H5_optind + 3];
}
else {
*objname2 = *objname1;
@@ -482,7 +482,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
opts->sset[1] = parse_subset_params(*objname2);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
diff --git a/tools/src/h5diff/h5diff_common.h b/tools/src/h5diff/h5diff_common.h
index 6594478..83f4255 100644
--- a/tools/src/h5diff/h5diff_common.h
+++ b/tools/src/h5diff/h5diff_common.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DIFFCOMMON_H__
-#define H5DIFFCOMMON_H__
+#ifndef H5DIFFCOMMON_H
+#define H5DIFFCOMMON_H
#include "h5tools.h"
/* Name of tool */
@@ -32,4 +32,4 @@ void print_info(diff_opt_t *opts);
}
#endif
-#endif /* H5DIFFCOMMON_H__ */
+#endif /* H5DIFFCOMMON_H */
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index 18bb1d1..36114ba 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -80,132 +80,54 @@ struct handler_t {
*/
/* The following initialization makes use of C language concatenating */
/* "xxx" "yyy" into "xxxyyy". */
-static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:";
-static struct long_options l_opts[] = {{"attribute", require_arg, 'a'},
- {"attribut", require_arg, 'a'},
- {"attribu", require_arg, 'a'},
- {"attrib", require_arg, 'a'},
- {"attri", require_arg, 'a'},
- {"attr", require_arg, 'a'},
- {"att", require_arg, 'a'},
- {"at", require_arg, 'a'},
- {"binary", optional_arg, 'b'},
- {"count", require_arg, 'c'},
- {"coun", require_arg, 'c'},
- {"cou", require_arg, 'c'},
- {"co", require_arg, 'c'},
- {"dataset", require_arg, 'd'},
- {"datase", require_arg, 'd'},
- {"datas", require_arg, 'd'},
- {"escape", no_arg, 'e'},
- {"filedriver", require_arg, 'f'},
- {"filedrive", require_arg, 'f'},
- {"filedriv", require_arg, 'f'},
- {"filedri", require_arg, 'f'},
- {"filedr", require_arg, 'f'},
- {"filed", require_arg, 'f'},
- {"file", require_arg, 'f'},
- {"fil", require_arg, 'f'},
- {"fi", require_arg, 'f'},
- {"group", require_arg, 'g'},
- {"grou", require_arg, 'g'},
- {"gro", require_arg, 'g'},
- {"gr", require_arg, 'g'},
- {"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"object-ids", no_arg, 'i'},
- {"object-id", no_arg, 'i'},
- {"object-i", no_arg, 'i'},
- {"object", no_arg, 'i'},
- {"objec", no_arg, 'i'},
- {"obje", no_arg, 'i'},
- {"obj", no_arg, 'i'},
- {"ob", no_arg, 'i'},
- {"block", require_arg, 'k'},
- {"bloc", require_arg, 'k'},
- {"blo", require_arg, 'k'},
- {"bl", require_arg, 'k'},
- {"soft-link", require_arg, 'l'},
- {"soft-lin", require_arg, 'l'},
- {"soft-li", require_arg, 'l'},
- {"soft-l", require_arg, 'l'},
- {"soft", require_arg, 'l'},
- {"sof", require_arg, 'l'},
- {"format", require_arg, 'm'},
- {"contents", optional_arg, 'n'},
- {"output", optional_arg, 'o'},
- {"outpu", optional_arg, 'o'},
- {"outp", optional_arg, 'o'},
- {"out", optional_arg, 'o'},
- {"ou", optional_arg, 'o'},
- {"properties", no_arg, 'p'},
- {"sort_by", require_arg, 'q'},
- {"string", no_arg, 'r'},
- {"strin", no_arg, 'r'},
- {"start", require_arg, 's'},
- {"star", require_arg, 's'},
- {"sta", require_arg, 's'},
- {"datatype", require_arg, 't'},
- {"datatyp", require_arg, 't'},
- {"dataty", require_arg, 't'},
- {"datat", require_arg, 't'},
- {"use-dtd", no_arg, 'u'},
- {"use-dt", no_arg, 'u'},
- {"use-d", no_arg, 'u'},
- {"use-", no_arg, 'u'},
- {"use", no_arg, 'u'},
- {"us", no_arg, 'u'},
- {"u", no_arg, 'u'},
- {"vds-view-first-missing", no_arg, 'v'},
- {"width", require_arg, 'w'},
- {"widt", require_arg, 'w'},
- {"wid", require_arg, 'w'},
- {"wi", require_arg, 'w'},
- {"xml", no_arg, 'x'},
- {"xm", no_arg, 'x'},
- {"noindex", no_arg, 'y'},
- {"sort_order", require_arg, 'z'},
- {"onlyattr", optional_arg, 'A'},
- {"superblock", no_arg, 'B'},
- {"boot-block", no_arg, 'B'},
- {"boot-bloc", no_arg, 'B'},
- {"boot-blo", no_arg, 'B'},
- {"boot-bl", no_arg, 'B'},
- {"boot-b", no_arg, 'B'},
- {"boot", no_arg, 'B'},
- {"boo", no_arg, 'B'},
- {"bo", no_arg, 'B'},
- {"no-compact-subset", no_arg, 'C'},
- {"xml-dtd", require_arg, 'D'},
- {"xml-dt", require_arg, 'D'},
- {"xml-d", require_arg, 'D'},
- {"enable-error-stack", optional_arg, 'E'},
- {"form", require_arg, 'F'},
- {"vds-gap-size", require_arg, 'G'},
- {"header", no_arg, 'H'},
- {"heade", no_arg, 'H'},
- {"head", no_arg, 'H'},
- {"hea", no_arg, 'H'},
- {"packed-bits", require_arg, 'M'},
- {"any_path", require_arg, 'N'},
- {"ddl", optional_arg, 'O'},
- {"region", no_arg, 'R'},
- {"stride", require_arg, 'S'},
- {"strid", require_arg, 'S'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'},
- {"xml-ns", require_arg, 'X'},
- {"xml-n", require_arg, 'X'},
- {"s3-cred", require_arg, '$'},
- {"hdfs-attrs", require_arg, '#'},
- {"vol-value", require_arg, '1'},
- {"vol-name", require_arg, '2'},
- {"vol-info", require_arg, '3'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:";
+static struct h5_long_options l_opts[] = {{"attribute", require_arg, 'a'},
+ {"binary", optional_arg, 'b'},
+ {"count", require_arg, 'c'},
+ {"dataset", require_arg, 'd'},
+ {"escape", no_arg, 'e'},
+ {"filedriver", require_arg, 'f'},
+ {"group", require_arg, 'g'},
+ {"help", no_arg, 'h'},
+ {"object-ids", no_arg, 'i'},
+ {"block", require_arg, 'k'},
+ {"soft-link", require_arg, 'l'},
+ {"format", require_arg, 'm'},
+ {"contents", optional_arg, 'n'},
+ {"output", optional_arg, 'o'},
+ {"properties", no_arg, 'p'},
+ {"sort_by", require_arg, 'q'},
+ {"string", no_arg, 'r'},
+ {"start", require_arg, 's'},
+ {"datatype", require_arg, 't'},
+ {"use-dtd", no_arg, 'u'},
+ {"vds-view-first-missing", no_arg, 'v'},
+ {"width", require_arg, 'w'},
+ {"xml", no_arg, 'x'},
+ {"noindex", no_arg, 'y'},
+ {"sort_order", require_arg, 'z'},
+ {"onlyattr", optional_arg, 'A'},
+ {"superblock", no_arg, 'B'},
+ {"boot-block", no_arg, 'B'},
+ {"no-compact-subset", no_arg, 'C'},
+ {"xml-dtd", require_arg, 'D'},
+ {"enable-error-stack", optional_arg, 'E'},
+ {"form", require_arg, 'F'},
+ {"vds-gap-size", require_arg, 'G'},
+ {"header", no_arg, 'H'},
+ {"packed-bits", require_arg, 'M'},
+ {"any_path", require_arg, 'N'},
+ {"ddl", optional_arg, 'O'},
+ {"region", no_arg, 'R'},
+ {"stride", require_arg, 'S'},
+ {"version", no_arg, 'V'},
+ {"xml-ns", require_arg, 'X'},
+ {"s3-cred", require_arg, '$'},
+ {"hdfs-attrs", require_arg, '#'},
+ {"vol-value", require_arg, '1'},
+ {"vol-name", require_arg, '2'},
+ {"vol-info", require_arg, '3'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: leave
@@ -917,7 +839,7 @@ parse_command_line(int argc, const char *argv[])
}
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
parse_start:
switch ((char)opt) {
case 'R':
@@ -931,8 +853,8 @@ parse_start:
case 'n':
dump_opts.display_fi = TRUE;
last_was_dset = FALSE;
- if (opt_arg != NULL)
- h5trav_set_verbose(HDatoi(opt_arg));
+ if (H5_optarg != NULL)
+ h5trav_set_verbose(HDatoi(H5_optarg));
break;
case 'p':
dump_opts.display_dcpl = TRUE;
@@ -949,8 +871,8 @@ parse_start:
last_was_dset = FALSE;
break;
case 'A':
- if (opt_arg != NULL) {
- if (0 == HDatoi(opt_arg))
+ if (H5_optarg != NULL) {
+ if (0 == HDatoi(H5_optarg))
dump_opts.include_attrs = FALSE;
}
else {
@@ -974,7 +896,7 @@ parse_start:
goto done;
break;
case 'w': {
- int sh5tools_nCols = HDatoi(opt_arg);
+ int sh5tools_nCols = HDatoi(H5_optarg);
if (sh5tools_nCols <= 0)
h5tools_nCols = 65535;
@@ -988,7 +910,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_paths;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1000,7 +922,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_attributes;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1012,7 +934,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_datasets;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
hand[i].subset_info = parse_subset_params(hand[i].obj);
last_dset = &hand[i];
break;
@@ -1021,7 +943,7 @@ parse_start:
last_was_dset = TRUE;
break;
case 'f':
- driver_name_g = opt_arg;
+ driver_name_g = H5_optarg;
break;
case 'g':
dump_opts.display_all = 0;
@@ -1029,7 +951,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_groups;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1041,7 +963,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_links;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1053,7 +975,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_datatypes;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1061,7 +983,7 @@ parse_start:
break;
case 'O':
- if (h5tools_set_output_file(opt_arg, 0) < 0) {
+ if (h5tools_set_output_file(H5_optarg, 0) < 0) {
usage(h5tools_getprogname());
goto error;
}
@@ -1069,20 +991,20 @@ parse_start:
case 'o':
if (bin_output) {
- if (h5tools_set_data_output_file(opt_arg, 1) < 0) {
+ if (h5tools_set_data_output_file(H5_optarg, 1) < 0) {
usage(h5tools_getprogname());
goto error;
}
}
else {
if (dump_opts.display_attr_data && !dump_opts.display_data) {
- if (h5tools_set_attr_output_file(opt_arg, 0) < 0) {
+ if (h5tools_set_attr_output_file(H5_optarg, 0) < 0) {
usage(h5tools_getprogname());
goto error;
}
}
if (dump_opts.display_data || dump_opts.display_all) {
- if (h5tools_set_data_output_file(opt_arg, 0) < 0) {
+ if (h5tools_set_data_output_file(H5_optarg, 0) < 0) {
usage(h5tools_getprogname());
goto error;
}
@@ -1091,12 +1013,12 @@ parse_start:
dump_opts.usingdasho = TRUE;
last_was_dset = FALSE;
- outfname_g = opt_arg;
+ outfname_g = H5_optarg;
break;
case 'b':
- if (opt_arg != NULL) {
- if ((bin_form = set_binary_form(opt_arg)) < 0) {
+ if (H5_optarg != NULL) {
+ if ((bin_form = set_binary_form(H5_optarg)) < 0) {
/* failed to set binary form */
usage(h5tools_getprogname());
goto error;
@@ -1115,7 +1037,7 @@ parse_start:
break;
case 'q':
- if ((sort_by = set_sort_by(opt_arg)) < 0) {
+ if ((sort_by = set_sort_by(H5_optarg)) < 0) {
/* failed to set "sort by" form */
usage(h5tools_getprogname());
goto error;
@@ -1123,7 +1045,7 @@ parse_start:
break;
case 'z':
- if ((sort_order = set_sort_order(opt_arg)) < 0) {
+ if ((sort_order = set_sort_order(H5_optarg)) < 0) {
/* failed to set "sort order" form */
usage(h5tools_getprogname());
goto error;
@@ -1135,7 +1057,7 @@ parse_start:
error_msg("option \"-%c\" can only be used after --dataset option\n", opt);
goto error;
}
- if (parse_mask_list(opt_arg) != SUCCEED) {
+ if (parse_mask_list(H5_optarg) != SUCCEED) {
usage(h5tools_getprogname());
goto error;
}
@@ -1145,7 +1067,7 @@ parse_start:
dump_opts.display_vds_first = TRUE;
break;
case 'G':
- dump_opts.vds_gap_size = HDatoi(opt_arg);
+ dump_opts.vds_gap_size = HDatoi(H5_optarg);
if (dump_opts.vds_gap_size < 0) {
usage(h5tools_getprogname());
goto error;
@@ -1172,13 +1094,13 @@ parse_start:
case 'D':
/* specify alternative XML DTD or schema */
/* To Do: check format of this value? */
- xml_dtd_uri_g = opt_arg;
+ xml_dtd_uri_g = H5_optarg;
h5tools_nCols = 0;
break;
case 'm':
/* specify alternative floating point printing format */
- fp_format = opt_arg;
+ fp_format = H5_optarg;
h5tools_nCols = 0;
break;
@@ -1189,10 +1111,10 @@ parse_start:
usage(h5tools_getprogname());
goto error;
}
- if (HDstrcmp(opt_arg, ":") == 0)
+ if (HDstrcmp(H5_optarg, ":") == 0)
xmlnsprefix = "";
else
- xmlnsprefix = opt_arg;
+ xmlnsprefix = H5_optarg;
h5tools_nCols = 0;
break;
/** end XML parameters **/
@@ -1238,33 +1160,33 @@ parse_start:
HDfree(s->start.data);
s->start.data = NULL;
}
- parse_hsize_list(opt_arg, &s->start);
+ parse_hsize_list(H5_optarg, &s->start);
break;
case 'S':
if (s->stride.data) {
HDfree(s->stride.data);
s->stride.data = NULL;
}
- parse_hsize_list(opt_arg, &s->stride);
+ parse_hsize_list(H5_optarg, &s->stride);
break;
case 'c':
if (s->count.data) {
HDfree(s->count.data);
s->count.data = NULL;
}
- parse_hsize_list(opt_arg, &s->count);
+ parse_hsize_list(H5_optarg, &s->count);
break;
case 'k':
if (s->block.data) {
HDfree(s->block.data);
s->block.data = NULL;
}
- parse_hsize_list(opt_arg, &s->block);
+ parse_hsize_list(H5_optarg, &s->block);
break;
default:
goto end_collect;
}
- } while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF);
+ } while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF);
end_collect:
last_was_dset = FALSE;
@@ -1277,8 +1199,8 @@ end_collect:
/** end subsetting parameters **/
case 'E':
- if (opt_arg != NULL)
- enable_error_stack = HDatoi(opt_arg);
+ if (H5_optarg != NULL)
+ enable_error_stack = HDatoi(H5_optarg);
else
enable_error_stack = 1;
break;
@@ -1294,7 +1216,7 @@ end_collect:
case '$':
#ifdef H5_HAVE_ROS3_VFD
- if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa_g) < 0) {
+ if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa_g) < 0) {
error_msg("failed to parse S3 VFD credential info\n");
usage(h5tools_getprogname());
free_handler(hand, argc);
@@ -1311,7 +1233,7 @@ end_collect:
case '#':
#ifdef H5_HAVE_LIBHDFS
- if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa_g) < 0) {
+ if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa_g) < 0) {
error_msg("failed to parse HDFS VFD configuration info\n");
usage(h5tools_getprogname());
free_handler(hand, argc);
@@ -1328,18 +1250,18 @@ end_collect:
case '1':
vol_info_g.type = VOL_BY_VALUE;
- vol_info_g.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ vol_info_g.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
use_custom_vol_g = TRUE;
break;
case '2':
vol_info_g.type = VOL_BY_NAME;
- vol_info_g.u.name = opt_arg;
+ vol_info_g.u.name = H5_optarg;
use_custom_vol_g = TRUE;
break;
case '3':
- vol_info_g.info_string = opt_arg;
+ vol_info_g.info_string = H5_optarg;
break;
case '?':
@@ -1351,7 +1273,7 @@ end_collect:
parse_end:
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
goto error;
@@ -1443,7 +1365,7 @@ main(int argc, const char *argv[])
}
}
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
@@ -1496,8 +1418,8 @@ main(int argc, const char *argv[])
}
}
- while (opt_ind < argc) {
- fname = HDstrdup(argv[opt_ind++]);
+ while (H5_optind < argc) {
+ fname = HDstrdup(argv[H5_optind++]);
fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0);
@@ -1529,7 +1451,7 @@ main(int argc, const char *argv[])
}
}
else {
- if (useschema_g && HDstrcmp(xmlnsprefix, "")) {
+ if (useschema_g && HDstrcmp(xmlnsprefix, "") != 0) {
error_msg(
"Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n");
h5tools_setstatus(EXIT_FAILURE);
diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h
index 60422ad..a53d1ba 100644
--- a/tools/src/h5dump/h5dump.h
+++ b/tools/src/h5dump/h5dump.h
@@ -10,8 +10,8 @@
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DUMP_H__
-#define H5DUMP_H__
+#ifndef H5DUMP_H
+#define H5DUMP_H
#include "hdf5.h"
#include "H5private.h"
@@ -112,4 +112,4 @@ const dump_functions *dump_function_table;
}
#endif
-#endif /* !H5DUMP_H__ */
+#endif /* H5DUMP_H */
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index 2a69ca6..638a738 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -1343,13 +1343,21 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a
ret = FAIL;
}
else {
+ size_t buffer_space = w - 1;
+
HDmemset(obj_name, '\0', w);
if (op_name[0] != '/') {
- HDstrncat(obj_name, buf, u + 1);
- if (buf[u - 1] != '/')
- HDstrncat(obj_name, "/", (size_t)2);
+ HDstrncat(obj_name, buf, buffer_space);
+ buffer_space -= MIN(buffer_space, u);
+
+ if (buf[u - 1] != '/') {
+ HDstrncat(obj_name, "/", buffer_space);
+ buffer_space -= MIN(buffer_space, 2);
+ }
}
- HDstrncat(obj_name, op_name, v + 1);
+
+ HDstrncat(obj_name, op_name, buffer_space);
+ buffer_space -= MIN(buffer_space, v);
handle_attributes(oid, obj_name, NULL, 0, NULL);
HDfree(obj_name);
@@ -1421,10 +1429,10 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data)
else {
if (k == 2) {
HDstrcpy(search_name, "/");
- HDstrncat(search_name, op_name, search_len + 1);
+ HDstrcat(search_name, op_name);
}
else
- HDstrncpy(search_name, op_name, search_len + 1);
+ HDstrcpy(search_name, op_name);
search_name[search_len + k - 1] = '\0';
if (HDstrcmp(path, search_name) == 0) {
diff --git a/tools/src/h5dump/h5dump_ddl.h b/tools/src/h5dump/h5dump_ddl.h
index 6d65796..8487270 100644
--- a/tools/src/h5dump/h5dump_ddl.h
+++ b/tools/src/h5dump/h5dump_ddl.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DUMP_DDL_H__
-#define H5DUMP_DDL_H__
+#ifndef H5DUMP_DDL_H
+#define H5DUMP_DDL_H
#ifdef __cplusplus
extern "C" {
@@ -50,4 +50,4 @@ void handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED *data, in
}
#endif
-#endif /* !H5DUMP_DDL_H__ */
+#endif /* H5DUMP_DDL_H */
diff --git a/tools/src/h5dump/h5dump_defines.h b/tools/src/h5dump/h5dump_defines.h
index 0fb8def..21a31dd 100644
--- a/tools/src/h5dump/h5dump_defines.h
+++ b/tools/src/h5dump/h5dump_defines.h
@@ -10,8 +10,8 @@
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DUMP_DEFINES_H__
-#define H5DUMP_DEFINES_H__
+#ifndef H5DUMP_DEFINES_H
+#define H5DUMP_DEFINES_H
#define H5DUMP_MAX_RANK H5S_MAX_RANK
@@ -50,4 +50,4 @@
#define H5_SZIP_MSB_OPTION_MASK 16
#define H5_SZIP_RAW_OPTION_MASK 128
-#endif /* !H5DUMP_DEFINES_H__ */
+#endif /* H5DUMP_DEFINES_H */
diff --git a/tools/src/h5dump/h5dump_extern.h b/tools/src/h5dump/h5dump_extern.h
index 8fbb5af..308f602 100644
--- a/tools/src/h5dump/h5dump_extern.h
+++ b/tools/src/h5dump/h5dump_extern.h
@@ -10,8 +10,8 @@
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DUMP_EXTERN_H__
-#define H5DUMP_EXTERN_H__
+#ifndef H5DUMP_EXTERN_H
+#define H5DUMP_EXTERN_H
#include "hdf5.h"
#include "H5private.h"
@@ -109,4 +109,4 @@ ssize_t table_list_visited(unsigned long file_no);
}
#endif
-#endif /* !H5DUMP_EXTERN_H__ */
+#endif /* H5DUMP_EXTERN_H */
diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
index 5507dcc..0e881df 100644
--- a/tools/src/h5dump/h5dump_xml.c
+++ b/tools/src/h5dump/h5dump_xml.c
@@ -2365,14 +2365,21 @@ xml_dump_named_datatype(hid_t type, const char *name)
h5tools_context_t ctx; /* print context */
h5tool_format_t * outputformat = &xml_dataformat;
h5tool_format_t string_dataformat;
- char * tmp;
- char * dtxid;
- char * parentxid;
- char * t_tmp;
- char * t_prefix;
- char * t_name;
+ char * tmp = NULL;
+ char * dtxid = NULL;
+ char * parentxid = NULL;
+ char * t_tmp = NULL;
+ char * t_prefix = NULL;
+ char * t_name = NULL;
tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ if (tmp == NULL) {
+ indentation(dump_indent);
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+
HDstrcpy(tmp, prefix);
HDstrcat(tmp, "/");
HDstrcat(tmp, name);
@@ -2627,6 +2634,13 @@ xml_dump_group(hid_t gid, const char *name)
}
else {
tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ if (tmp == NULL) {
+ indentation(dump_indent);
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ return;
+ }
+
HDstrcpy(tmp, prefix);
par = HDstrdup(tmp);
cp = HDstrrchr(par, '/');
@@ -3146,8 +3160,11 @@ xml_print_strs(hid_t did, int source)
}
bp = (char *)buf;
- if (!is_vlstr)
+ if (!is_vlstr) {
onestring = (char *)HDcalloc(tsiz, sizeof(char));
+ if (onestring == NULL)
+ goto error;
+ }
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -3768,6 +3785,14 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss
char *pstr = (char *)HDmalloc((size_t)100);
tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2);
+ if (tmp == NULL) {
+ error_msg("buffer allocation failed\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ HDfree(rstr);
+ HDfree(pstr);
+ return;
+ }
+
HDstrcpy(tmp, prefix);
HDstrcat(tmp, "/");
HDstrcat(tmp, name);
diff --git a/tools/src/h5dump/h5dump_xml.h b/tools/src/h5dump/h5dump_xml.h
index 9ff22ed..d69f6d5 100644
--- a/tools/src/h5dump/h5dump_xml.h
+++ b/tools/src/h5dump/h5dump_xml.h
@@ -10,8 +10,8 @@
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DUMP_XML_H__
-#define H5DUMP_XML_H__
+#ifndef H5DUMP_XML_H
+#define H5DUMP_XML_H
extern const char *xmlnsprefix;
@@ -34,4 +34,4 @@ void xml_dump_data(hid_t, int, struct subset_t *, int);
}
#endif
-#endif /* !H5DUMP_XML_H__ */
+#endif /* H5DUMP_XML_H */
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index 321f274..ddf129c 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -38,28 +38,11 @@ static int verbose_g = 0;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "hVvd:n";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"version", no_arg, 'V'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"verbose", no_arg, 'v'},
- {"verbos", no_arg, 'v'},
- {"verbo", no_arg, 'v'},
- {"verb", no_arg, 'v'},
- {"dname", require_arg, 'd'},
- {"dnam", require_arg, 'd'},
- {"dna", require_arg, 'd'},
- {"dn", require_arg, 'd'},
- {"noop", no_arg, 'n'},
- {"noo", no_arg, 'n'},
- {"no", no_arg, 'n'},
- {"enable-error-stack", no_arg, 'E'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hVvd:n";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"version", no_arg, 'V'},
+ {"verbose", no_arg, 'v'}, {"dname", require_arg, 'd'},
+ {"noop", no_arg, 'n'}, {"enable-error-stack", no_arg, 'E'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -123,7 +106,7 @@ parse_command_line(int argc, const char **argv)
}
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -140,11 +123,11 @@ parse_command_line(int argc, const char **argv)
break;
case 'd': /* -d dname */
- if (opt_arg != NULL && *opt_arg)
- dname_g = HDstrdup(opt_arg);
+ if (H5_optarg != NULL && *H5_optarg)
+ dname_g = HDstrdup(H5_optarg);
if (dname_g == NULL) {
h5tools_setstatus(EXIT_FAILURE);
- error_msg("No dataset name\n", opt_arg);
+ error_msg("No dataset name\n", H5_optarg);
usage(h5tools_getprogname());
goto error;
}
@@ -167,19 +150,19 @@ parse_command_line(int argc, const char **argv)
} /* switch */
} /* while */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
goto error;
}
- fname_g = HDstrdup(argv[opt_ind]);
+ fname_g = HDstrdup(argv[H5_optind]);
- return (0);
+ return 0;
error:
- return (-1);
+ return -1;
;
} /* parse_command_line() */
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 471af51..6517e43 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -489,7 +489,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 0: /* TEXTIN */
in08 = (H5DT_INT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (fscanf(strm, "%hd", &temp16) != 1) {
+ if (HDfscanf(strm, "%hd", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -521,7 +521,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in16++) {
- if (fscanf(strm, "%hd", in16) != 1) {
+ if (HDfscanf(strm, "%hd", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -558,7 +558,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in32++) {
- if (fscanf(strm, "%d", in32) != 1) {
+ if (HDfscanf(strm, "%d", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -595,7 +595,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in64++) {
- if (fscanf(strm, "%s", buffer) < 1) {
+ if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -664,7 +664,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 6: /* TEXTUIN */
in08 = (H5DT_UINT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (fscanf(strm, "%hu", &temp16) != 1) {
+ if (HDfscanf(strm, "%hu", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -693,7 +693,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in16++) {
- if (fscanf(strm, "%hu", in16) != 1) {
+ if (HDfscanf(strm, "%hu", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -729,7 +729,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in32++) {
- if (fscanf(strm, "%u", in32) != 1) {
+ if (HDfscanf(strm, "%u", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -766,7 +766,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in64++) {
- if (fscanf(strm, "%s", buffer) < 1) {
+ if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -832,7 +832,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp32++) {
- if (fscanf(strm, "%f", fp32) != 1) {
+ if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -845,7 +845,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp32++) {
- if (fscanf(strm, "%f", fp32) != 1) {
+ if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -884,7 +884,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp64++) {
- if (fscanf(strm, "%lf", fp64) != 1) {
+ if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -897,7 +897,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp64++) {
- if (fscanf(strm, "%lf", fp64) != 1) {
+ if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1469,16 +1469,16 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
if ((scanret == 1) && !HDstrcmp("HDF5", key)) {
#ifdef H5DEBUGIMPORT
int pndx;
HDprintf("\nh5dump file\n");
#endif
in->h5dumpInput = 1;
- scanret = fscanf(strm, "%254s", temp); /* filename */
- scanret = fscanf(strm, "%254s", temp); /* start bracket */
- scanret = fscanf(strm, "%254s", key); /* DATASET */
+ scanret = HDfscanf(strm, "%254s", temp); /* filename */
+ scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
+ scanret = HDfscanf(strm, "%254s", key); /* DATASET */
while (scanret == 1) {
if (!HDstrcmp("DATASET", key)) { /* PATH */
#ifdef H5DEBUGIMPORT
@@ -1488,7 +1488,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1500,7 +1500,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
in->configOptionVector[PATH] = 1;
- scanret = fscanf(strm, "%254s", temp); /* start bracket */
+ scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASET %s found\n", temp);
#endif
@@ -1514,7 +1514,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1550,27 +1550,27 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* string properties */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* string properties */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
while (get_next_prop) {
if (!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING STRSIZE %s found\n", temp);
#endif
- if (HDstrcmp("H5T_VARIABLE;", temp)) {
+ if (HDstrcmp("H5T_VARIABLE;", temp) != 0) {
char *more = temp;
ival = (int)HDstrtol(more, &more, 10);
if (getInputSize(in, ival) == -1) {
@@ -1582,8 +1582,8 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
}
}
- else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
- if (fscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
+ else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1591,8 +1591,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
#endif
}
- else if (!HDstrcmp("CSET", key)) { /* CSET */
- if (fscanf(strm, "%254s", temp) != 1) { /* CSET type */
+ else if (!HDstrcmp("CSET", key)) { /* CSET */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CSET type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1600,8 +1600,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp);
#endif
}
- else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
- if (fscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
+ else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1609,7 +1609,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
#endif
} /* if(!HDstrcmp("CSET", key)) */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1628,7 +1628,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1644,14 +1644,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1662,7 +1662,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1672,7 +1672,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1716,7 +1716,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1728,7 +1728,7 @@ processConfigurationFile(char *infile, struct Input *in)
(hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) {
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1742,7 +1742,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE process max dim values\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1762,7 +1762,7 @@ processConfigurationFile(char *infile, struct Input *in)
char *more = temp;
in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10);
}
- if (fscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1793,7 +1793,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
- scanret = fscanf(strm, "%254s", temp); /* end bracket */
+ scanret = HDfscanf(strm, "%254s", temp); /* end bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
@@ -1808,14 +1808,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1827,7 +1827,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, "Unable to allocate dynamic memory.\n");
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1838,7 +1838,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1848,7 +1848,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1880,7 +1880,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* SIZE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* SIZE */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1888,7 +1888,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if (!HDstrcmp("SIZE", temp)) { /* SIZE */
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1896,8 +1896,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival);
#endif
}
- while (HDstrcmp("}", temp)) {
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ while (HDstrcmp("}", temp) != 0) {
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1912,14 +1912,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1930,28 +1930,28 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* LEVEL */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* LEVEL */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1959,7 +1959,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
#endif
in->compressionParam = ival;
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1981,7 +1981,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
in->configOptionVector[COMPRESS] = 0;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1995,14 +1995,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err20, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2012,7 +2012,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_prop) {
if (!HDstrcmp("COUNT", temp)) { /* COUNT */
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2023,7 +2023,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2033,7 +2033,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2068,7 +2068,7 @@ processConfigurationFile(char *infile, struct Input *in)
} /* if(!HDstrcmp("COUNT", temp)) COUNT */
if (!HDstrcmp("BLOCK", temp)) { /* BLOCK */
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2079,7 +2079,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2089,7 +2089,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2122,7 +2122,7 @@ processConfigurationFile(char *infile, struct Input *in)
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
} /* if(!HDstrcmp("BLOCK", temp)) BLOCK */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2141,7 +2141,7 @@ processConfigurationFile(char *infile, struct Input *in)
scanret = 0;
break;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump path");
@@ -2182,7 +2182,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2199,7 +2199,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2226,7 +2226,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5a, infile);
goto error;
}
- if (fscanf(strm, "%254d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%254d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -2423,7 +2423,7 @@ processConfigurationFile(char *infile, struct Input *in)
default:
break;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
}
/*
@@ -2602,7 +2602,7 @@ getOutputClass(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output class.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -2637,7 +2637,7 @@ getOutputSize(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for output size.\n";
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3502,7 +3502,7 @@ getInputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for input byte-order.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3524,7 +3524,7 @@ getRank(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for rank.\n";
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3553,7 +3553,7 @@ getDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%llu", (&ullval)) == 1)
+ while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfDimension[i++] = ullval;
if (in->rank != i) {
@@ -3579,7 +3579,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%llu", (&ullval)) == 1)
+ while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfChunk[i++] = ullval;
if (in->rank != i) {
@@ -3612,7 +3612,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%lld", (&llval)) == 1) {
+ while (HDfscanf(strm, "%lld", (&llval)) == 1) {
if (llval == -1)
in->maxsizeOfDimension[i++] = H5S_UNLIMITED;
else
@@ -3642,7 +3642,7 @@ getOutputArchitecture(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output architecture.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3675,7 +3675,7 @@ getOutputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output byte-order.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3708,7 +3708,7 @@ getCompressionType(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for compression.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3750,7 +3750,7 @@ getCompressionParameter(struct Input *in, FILE *strm)
switch (in->compressionType) {
case 0: /* GZIP */
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3771,16 +3771,19 @@ getCompressionParameter(struct Input *in, FILE *strm)
static int
getExternalFilename(struct Input *in, FILE *strm)
{
+ size_t temp_len;
char temp[255];
const char *err1 = "Unable to get 'string' value.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
- in->externFilename = (char *)HDmalloc((size_t)(HDstrlen(temp) + 1) * sizeof(char));
- (void)HDstrncpy(in->externFilename, temp, HDstrlen(temp) + 1);
+ temp_len = HDstrlen(temp);
+ in->externFilename = (char *)HDmalloc((temp_len + 1) * sizeof(char));
+ (void)HDstrcpy(in->externFilename, temp);
+ in->externFilename[temp_len] = '\0';
return (0);
}
@@ -5097,7 +5100,6 @@ help(char *name)
(void)HDfprintf(stdout, "\t data-set will be compressed using GZIP and a compression level \n");
(void)HDfprintf(stdout, "\t of 7.\n");
(void)HDfprintf(stdout, "\t The dataset will be stored at \"/Second-set\"\n\n");
- return;
}
void
@@ -5107,5 +5109,4 @@ usage(char *name)
(void)HDfprintf(stdout, "\t%s <infile> -c[onfig] <configfile> \
[<infile> -c[config] <configfile>...] -o[utfile] <outfile> \n\n",
name);
- return;
}
diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h
index 2192f4a..efd40e1 100644
--- a/tools/src/h5import/h5import.h
+++ b/tools/src/h5import/h5import.h
@@ -17,8 +17,8 @@
*
*/
-#ifndef H5IMPORT_H__
-#define H5IMPORT_H__
+#ifndef H5IMPORT_H
+#define H5IMPORT_H
/*
* state table tokens
@@ -189,4 +189,4 @@ void help(char *);
hid_t createOutputDataType(struct Input *in);
hid_t createInputDataType(struct Input *in);
-#endif /* H5IMPORT_H__ */
+#endif /* H5IMPORT_H */
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 5bcbf45..7f3385c 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -34,14 +34,10 @@ char *ub_file = NULL;
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */
-static struct long_options l_opts[] = {
- {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */
- {"u", require_arg, 'u'}, /* user block file */
- {"o", require_arg, 'o'}, /* output file */
- {"clobber", no_arg, 'c'}, /* clobber existing UB */
- {"clobbe", no_arg, 'c'}, {"clobb", no_arg, 'c'}, {"clob", no_arg, 'c'},
- {"clo", no_arg, 'c'}, {"cl", no_arg, 'c'}, {NULL, 0, '\0'}};
+static const char * s_opts = "hi:u:o:c:V";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require_arg, 'i'},
+ {"u", require_arg, 'u'}, {"o", require_arg, 'o'},
+ {"clobber", no_arg, 'c'}, {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -113,16 +109,16 @@ parse_command_line(int argc, const char *argv[])
int opt = FALSE;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'o':
- output_file = HDstrdup(opt_arg);
+ output_file = HDstrdup(H5_optarg);
break;
case 'i':
- input_file = HDstrdup(opt_arg);
+ input_file = HDstrdup(H5_optarg);
break;
case 'u':
- ub_file = HDstrdup(opt_arg);
+ ub_file = HDstrdup(H5_optarg);
break;
case 'c':
do_clobber = TRUE;
diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c
index cde7ec7..fa23b06 100644
--- a/tools/src/h5jam/h5unjam.c
+++ b/tools/src/h5jam/h5unjam.c
@@ -35,14 +35,10 @@ char *ub_file = NULL;
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "hu:i:o:d:V";
-static struct long_options l_opts[] = {
- {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */
- {"u", require_arg, 'u'}, /* user block file */
- {"o", require_arg, 'o'}, /* output file */
- {"delete", no_arg, 'd'}, /* delete ub */
- {"delet", no_arg, 'd'}, {"dele", no_arg, 'd'}, {"del", no_arg, 'd'},
- {"de", no_arg, 'd'}, {NULL, 0, '\0'}};
+static const char * s_opts = "hu:i:o:d:V";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require_arg, 'i'},
+ {"u", require_arg, 'u'}, {"o", require_arg, 'o'},
+ {"delete", no_arg, 'd'}, {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -101,23 +97,23 @@ parse_command_line(int argc, const char *argv[])
int opt = FALSE;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'o':
- output_file = HDstrdup(opt_arg);
+ output_file = HDstrdup(H5_optarg);
if (output_file)
h5tools_set_data_output_file(output_file, 1);
break;
case 'i':
- input_file = HDstrdup(opt_arg);
+ input_file = HDstrdup(H5_optarg);
if (input_file)
h5tools_set_input_file(input_file, 1);
break;
;
case 'u':
- ub_file = HDstrdup(opt_arg);
+ ub_file = HDstrdup(H5_optarg);
if (ub_file)
h5tools_set_output_file(ub_file, 1);
else
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 64003e7..4392d85 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -428,11 +428,6 @@ print_native_type(h5tools_str_t *buffer, hid_t type, int ind)
else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) {
h5tools_str_append(buffer, "native double");
}
-#if H5_SIZEOF_LONG_DOUBLE != 0
- else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) {
- h5tools_str_append(buffer, "native long double");
- }
-#endif
else if (H5Tequal(type, H5T_NATIVE_INT8) == TRUE) {
h5tools_str_append(buffer, "native int8_t");
}
@@ -530,10 +525,7 @@ print_native_type(h5tools_str_t *buffer, hid_t type, int ind)
h5tools_str_append(buffer, "native hbool_t");
}
else {
- if (H5T_FLOAT == H5Tget_class(type))
- return print_float_type(buffer, type, ind);
- else
- return print_int_type(buffer, type, ind);
+ return print_int_type(buffer, type, ind);
}
}
else {
@@ -1323,7 +1315,7 @@ dump_dataset_values(hid_t dset)
h5tool_format_t * info = &ls_dataformat;
H5R_ref_t * ref_buf = NULL;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
f_type = H5Dget_type(dset);
space = H5Dget_space(dset);
@@ -1464,7 +1456,7 @@ done:
PRINTVALSTREAM(rawoutstream, "\n");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -1492,7 +1484,7 @@ dump_attribute_values(hid_t attr)
h5tool_format_t * info = &ls_dataformat;
H5R_ref_t * ref_buf = NULL;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
f_type = H5Aget_type(attr);
space = H5Aget_space(attr);
@@ -1640,7 +1632,7 @@ done:
PRINTVALSTREAM(rawoutstream, "\n");
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
}
/*-------------------------------------------------------------------------
@@ -1669,7 +1661,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
h5tools_context_t ctx; /* print context */
h5tool_format_t * info = &ls_dataformat;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
HDmemset(&ctx, 0, sizeof(ctx));
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -1748,7 +1740,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
H5TOOLS_DEBUG("Attribute open failed");
h5tools_str_close(&buffer);
}
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return 0;
}
@@ -1991,7 +1983,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
HSIZE_T_FORMAT " logical byte%s, " HSIZE_T_FORMAT " allocated byte%s",
total, 1 == total ? "" : "s", used, 1 == used ? "" : "s");
if (used > 0) {
- utilization = ((double)total * (double)100.0f) / (double)used;
+ utilization = ((double)total * 100.0) / (double)used;
h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization);
}
}
@@ -2096,7 +2088,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi
h5tools_context_t ctx; /* print context */
h5tool_format_t * info = &ls_dataformat;
- H5TOOLS_START_DEBUG("");
+ H5TOOLS_START_DEBUG(" ");
HDmemset(&ctx, 0, sizeof(ctx));
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -2250,7 +2242,7 @@ done:
}
h5tools_str_close(&buffer);
- H5TOOLS_ENDDEBUG("");
+ H5TOOLS_ENDDEBUG(" ");
return 0;
} /* end list_obj() */
@@ -3091,7 +3083,7 @@ main(int argc, const char *argv[])
symlink_list.objs = NULL;
/* Check for root group as object name */
- if (HDstrcmp(oname, root_name)) {
+ if (HDstrcmp(oname, root_name) != 0) {
/* Check the type of link given */
if (H5Lget_info2(file_id, oname, &li, H5P_DEFAULT) < 0) {
hsize_t curr_pos = 0; /* total data element position */
diff --git a/tools/src/h5perf/CMakeLists.txt b/tools/src/h5perf/CMakeLists.txt
new file mode 100644
index 0000000..36b0b2f
--- /dev/null
+++ b/tools/src/h5perf/CMakeLists.txt
@@ -0,0 +1,103 @@
+cmake_minimum_required (VERSION 3.12)
+project (HDF5_TOOLS_SRC_H5PERF C)
+
+# --------------------------------------------------------------------
+# Add the executables
+# --------------------------------------------------------------------
+#-- Adding test for h5perf_serial
+set (h5perf_serial_SOURCES
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_engine.c
+)
+add_executable (h5perf_serial ${h5perf_serial_SOURCES})
+target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_serial STATIC)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5perf_serial SHARED)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
+set_target_properties (h5perf_serial PROPERTIES FOLDER perform)
+set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5perf_serial")
+
+set (H5_DEP_EXECUTABLES h5perf_serial)
+
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TOOLS_SRC_H5PERF_h5perf_serial_FORMAT h5perf_serial)
+endif ()
+
+if (H5_HAVE_PARALLEL)
+ if (UNIX)
+ #-- Adding test for perf - only on unix systems
+ set (perf_SOURCES
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/perf.c
+ )
+ add_executable (perf ${perf_SOURCES})
+ target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (perf STATIC)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ else ()
+ TARGET_C_PROPERTIES (perf SHARED)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ endif ()
+ set_target_properties (perf PROPERTIES FOLDER perform)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};perf")
+
+ set (H5_DEP_EXECUTABLES perf)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TOOLS_SRC_H5PERF_perf_FORMAT perf)
+ endif ()
+ endif ()
+
+ #-- Adding test for h5perf
+ set (h5perf_SOURCES
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_engine.c
+ )
+ add_executable (h5perf ${h5perf_SOURCES})
+ target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf STATIC)
+ target_link_libraries (h5perf PRIVATE ${LINK_LIBS} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ else ()
+ TARGET_C_PROPERTIES (h5perf SHARED)
+ target_link_libraries (h5perf PRIVATE ${LINK_LIBS} ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ endif ()
+ set_target_properties (h5perf PROPERTIES FOLDER perform)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5perf")
+
+ set (H5_DEP_EXECUTABLES h5perf)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TOOLS_SRC_H5PERF_h5perf_FORMAT h5perf)
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Rules for Installation of tools using make Install target
+#-----------------------------------------------------------------------------
+if (HDF5_EXPORTED_TARGETS)
+ foreach (exec ${H5_DEP_EXECUTABLES})
+ INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications)
+ endforeach ()
+
+ install (
+ TARGETS
+ ${H5_DEP_EXECUTABLES}
+ EXPORT
+ ${HDF5_EXPORTED_TARGETS}
+ RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications
+ )
+endif ()
diff --git a/tools/src/h5perf/Makefile.am b/tools/src/h5perf/Makefile.am
new file mode 100644
index 0000000..e8a9fdd
--- /dev/null
+++ b/tools/src/h5perf/Makefile.am
@@ -0,0 +1,63 @@
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://www.hdfgroup.org/licenses.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+##
+## Makefile.am
+## Run automake to generate a Makefile.in from this file.
+##
+#
+# HDF5 Library Performance Makefile(.in)
+#
+
+include $(top_srcdir)/config/commence.am
+
+AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib
+
+# bin_PROGRAMS will be installed.
+if BUILD_PARALLEL_CONDITIONAL
+ bin_PROGRAMS=h5perf_serial perf h5perf
+else
+ bin_PROGRAMS=h5perf_serial
+endif
+
+# Add h5perf and h5perf_serial specific linker flags here
+h5perf_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
+h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
+
+# Some programs are not built or run by default, but can be built by hand or by
+# specifying --enable-build-all at configure time.
+# Also, some of these programs should only be built in parallel.
+# Currently there is no such program.
+if BUILD_PARALLEL_CONDITIONAL
+ PARA_BUILD_ALL=
+endif
+if BUILD_ALL_CONDITIONAL
+ BUILD_ALL_PROGS=$(PARA_BUILD_ALL)
+endif
+
+# Define programs that will be run in 'make check'
+# List them in the order they should be run.
+# Parallel test programs.
+if BUILD_PARALLEL_CONDITIONAL
+ TEST_PROG_PARA=h5perf perf
+endif
+
+h5perf_SOURCES=pio_perf.c pio_engine.c
+h5perf_serial_SOURCES=sio_perf.c sio_engine.c
+
+# All of the programs depend on the main hdf5 library, and some of them
+# depend on test or tools library.
+LDADD=$(LIBHDF5)
+h5perf_LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+h5perf_serial_LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+perf_LDADD=$(LIBHDF5)
+
+include $(top_srcdir)/config/conclude.am
diff --git a/tools/test/perform/perf.c b/tools/src/h5perf/perf.c
index bf4b2a9..83d4ab0 100644
--- a/tools/test/perform/perf.c
+++ b/tools/src/h5perf/perf.c
@@ -22,34 +22,30 @@
#include "hdf5.h"
#include "H5private.h"
-#include "h5test.h"
#ifdef H5_HAVE_PARALLEL
-#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
-
-#ifdef H5_HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
-#endif
+#include <time.h>
#ifdef H5_HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if defined(H5_TIME_WITH_SYS_TIME)
-#include <sys/time.h>
-#include <time.h>
-#elif defined(H5_HAVE_SYS_TIME_H)
+#ifdef H5_HAVE_SYS_TIME_H
#include <sys/time.h>
-#else
-#include <time.h>
+#endif
+
+#ifdef H5_HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef H5_HAVE_UNISTD_H
+#include <unistd.h>
#endif
#include <mpi.h>
@@ -111,6 +107,15 @@ static int parse_args(int argc, char **argv);
extern char *optarg;
#endif
+#ifndef HDF5_PARAPREFIX
+#define HDF5_PARAPREFIX ""
+#endif
+char * paraprefix = NULL; /* for command line option para-prefix */
+MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */
+
+static char *h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fullname,
+ size_t size, hbool_t nest_printf, hbool_t subst_for_superblock);
+
int
main(int argc, char **argv)
{
@@ -138,12 +143,11 @@ main(int argc, char **argv)
if (mynod == 0)
printf("# Using hdf5-io calls.\n");
- /* kindof a weird hack- if the location of the pvfstab file was
- * specified on the command line, then spit out this location into
- * the appropriate environment variable: */
-
-#if H5_HAVE_SETENV
- /* no setenv or unsetenv */
+#ifdef H5_HAVE_UNISTD_H
+ /* Kind of a weird hack- if the location of the pvfstab file was
+ * specified on the command line, then spit out this location into
+ * the appropriate environment variable.
+ */
if (opt_pvfstab_set) {
if ((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0) {
perror("setenv");
@@ -210,7 +214,7 @@ main(int argc, char **argv)
}
}
- h5_fixname_no_suffix(FILENAME[0], acc_tpl, filename, sizeof filename);
+ h5_fixname_real(FILENAME[0], acc_tpl, NULL, filename, sizeof filename, FALSE, FALSE);
/* create the parallel file */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
@@ -374,9 +378,8 @@ main(int argc, char **argv)
die_jar_jar_die:
-#if H5_HAVE_SETENV
- /* no setenv or unsetenv */
- /* clear the environment variable if it was set earlier */
+#ifdef H5_HAVE_UNISTD
+ /* Clear the environment variable if it was set earlier */
if (opt_pvfstab_set) {
unsetenv("PVFSTAB_FILE");
}
@@ -456,6 +459,323 @@ parse_args(int argc, char **argv)
return (0);
}
+/*-------------------------------------------------------------------------
+ * Function: getenv_all
+ *
+ * Purpose: Used to get the environment that the root MPI task has.
+ * name specifies which environment variable to look for
+ * val is the string to which the value of that environment
+ * variable will be copied.
+ *
+ * NOTE: The pointer returned by this function is only
+ * valid until the next call to getenv_all and the data
+ * stored there must be copied somewhere else before any
+ * further calls to getenv_all take place.
+ *
+ * Return: pointer to a string containing the value of the environment variable
+ * NULL if the varialbe doesn't exist in task 'root's environment.
+ *
+ * Programmer: Leon Arber
+ * 4/4/05
+ *
+ * Modifications:
+ * Use original getenv if MPI is not initialized. This happens
+ * one uses the PHDF5 library to build a serial nature code.
+ * Albert 2006/04/07
+ *
+ *-------------------------------------------------------------------------
+ */
+char *
+getenv_all(MPI_Comm comm, int root, const char *name)
+{
+ int mpi_size, mpi_rank, mpi_initialized, mpi_finalized;
+ int len;
+ static char *env = NULL;
+
+ HDassert(name);
+
+ MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
+
+ if (mpi_initialized && !mpi_finalized) {
+ MPI_Comm_rank(comm, &mpi_rank);
+ MPI_Comm_size(comm, &mpi_size);
+ HDassert(root < mpi_size);
+
+ /* The root task does the getenv call
+ * and sends the result to the other tasks */
+ if (mpi_rank == root) {
+ env = HDgetenv(name);
+ if (env) {
+ len = (int)HDstrlen(env);
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ MPI_Bcast(env, len, MPI_CHAR, root, comm);
+ }
+ else {
+ /* len -1 indicates that the variable was not in the environment */
+ len = -1;
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ }
+ }
+ else {
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ if (len >= 0) {
+ if (env == NULL)
+ env = (char *)HDmalloc((size_t)len + 1);
+ else if (HDstrlen(env) < (size_t)len)
+ env = (char *)HDrealloc(env, (size_t)len + 1);
+
+ MPI_Bcast(env, len, MPI_CHAR, root, comm);
+ env[len] = '\0';
+ }
+ else {
+ if (env)
+ HDfree(env);
+ env = NULL;
+ }
+ }
+#ifndef NDEBUG
+ MPI_Barrier(comm);
+#endif
+ }
+ else {
+ /* use original getenv */
+ if (env)
+ HDfree(env);
+ env = HDgetenv(name);
+ } /* end if */
+
+ return env;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: h5_fixname_real
+ *
+ * Purpose: Create a file name from a file base name like `test' and
+ * return it through the FULLNAME (at most SIZE characters
+ * counting the null terminator). The full name is created by
+ * prepending the contents of HDF5_PREFIX (separated from the
+ * base name by a slash) and appending a file extension based on
+ * the driver supplied, resulting in something like
+ * `ufs:/u/matzke/test.h5'.
+ *
+ * Return: Success: The FULLNAME pointer.
+ *
+ * Failure: NULL if BASENAME or FULLNAME is the null
+ * pointer or if FULLNAME isn't large enough for
+ * the result.
+ *
+ * Programmer: Robb Matzke
+ * Thursday, November 19, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+static char *
+h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fullname, size_t size,
+ hbool_t nest_printf, hbool_t subst_for_superblock)
+{
+ const char *prefix = NULL;
+ const char *env = NULL; /* HDF5_DRIVER environment variable */
+ char * ptr, last = '\0';
+ const char *suffix = _suffix;
+ size_t i, j;
+ hid_t driver = -1;
+ int isppdriver = 0; /* if the driver is MPI parallel */
+
+ if (!base_name || !fullname || size < 1)
+ return NULL;
+
+ HDmemset(fullname, 0, size);
+
+ /* figure out the suffix */
+ if (H5P_DEFAULT != fapl) {
+ if ((driver = H5Pget_driver(fapl)) < 0)
+ return NULL;
+
+ if (suffix) {
+ if (H5FD_FAMILY == driver) {
+ if (subst_for_superblock)
+ suffix = "00000.h5";
+ else
+ suffix = nest_printf ? "%%05d.h5" : "%05d.h5";
+ }
+ else if (H5FD_MULTI == driver) {
+
+ /* Get the environment variable, if it exists, in case
+ * we are using the split driver since both of those
+ * use the multi VFD under the hood.
+ */
+ env = HDgetenv("HDF5_DRIVER");
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if (!env)
+ env = HDF5_DRIVER;
+#endif
+ if (env && !HDstrcmp(env, "split")) {
+ /* split VFD */
+ if (subst_for_superblock)
+ suffix = "-m.h5";
+ else
+ suffix = NULL;
+ }
+ else {
+ /* multi VFD */
+ if (subst_for_superblock)
+ suffix = "-s.h5";
+ else
+ suffix = NULL;
+ }
+ }
+ }
+ }
+
+ /* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX
+ * could be of value -1 if it is not defined.
+ */
+ isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO == driver);
+
+ /* Check what prefix to use for test files. Process HDF5_PARAPREFIX and
+ * HDF5_PREFIX.
+ * Use different ones depending on parallel or serial driver used.
+ * (The #ifdef is needed to prevent compile failure in case MPI is not
+ * configured.)
+ */
+ if (isppdriver) {
+ /*
+ * For parallel:
+ * First use command line option, then the environment
+ * variable, then try the constant
+ */
+ static int explained = 0;
+
+ prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX"));
+
+ if (!prefix && !explained) {
+ /* print hint by process 0 once. */
+ int mpi_rank;
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
+ if (mpi_rank == 0)
+ HDprintf("*** Hint ***\n"
+ "You can use environment variable HDF5_PARAPREFIX to "
+ "run parallel test files in a\n"
+ "different directory or to add file type prefix. e.g.,\n"
+ " HDF5_PARAPREFIX=pfs:/PFS/user/me\n"
+ " export HDF5_PARAPREFIX\n"
+ "*** End of Hint ***\n");
+
+ explained = TRUE;
+#ifdef HDF5_PARAPREFIX
+ prefix = HDF5_PARAPREFIX;
+#endif /* HDF5_PARAPREFIX */
+ }
+ }
+ else {
+ /*
+ * For serial:
+ * First use the environment variable, then try the constant
+ */
+ prefix = HDgetenv("HDF5_PREFIX");
+
+#ifdef HDF5_PREFIX
+ if (!prefix)
+ prefix = HDF5_PREFIX;
+#endif /* HDF5_PREFIX */
+ }
+
+ /* Prepend the prefix value to the base name */
+ if (prefix && *prefix) {
+ if (isppdriver) {
+ /* This is a parallel system */
+ char *subdir;
+
+ if (!HDstrcmp(prefix, HDF5_PARAPREFIX)) {
+ /*
+ * If the prefix specifies the HDF5_PARAPREFIX directory, then
+ * default to using the "/tmp/$USER" or "/tmp/$LOGIN"
+ * directory instead.
+ */
+ char *user, *login;
+
+ user = HDgetenv("USER");
+ login = HDgetenv("LOGIN");
+ subdir = (user ? user : login);
+
+ if (subdir) {
+ for (i = 0; i < size && prefix[i]; i++)
+ fullname[i] = prefix[i];
+
+ fullname[i++] = '/';
+
+ for (j = 0; i < size && subdir[j]; ++i, ++j)
+ fullname[i] = subdir[j];
+ }
+ }
+
+ if (!fullname[0]) {
+ /* We didn't append the prefix yet */
+ HDstrncpy(fullname, prefix, size);
+ fullname[size - 1] = '\0';
+ }
+
+ if (HDstrlen(fullname) + HDstrlen(base_name) + 1 < size) {
+ /*
+ * Append the base_name with a slash first. Multiple
+ * slashes are handled below.
+ */
+ h5_stat_t buf;
+
+ if (HDstat(fullname, &buf) < 0)
+ /* The directory doesn't exist just yet */
+ if (HDmkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST)
+ /*
+ * We couldn't make the "/tmp/${USER,LOGIN}"
+ * subdirectory. Default to PREFIX's original
+ * prefix value.
+ */
+ HDstrcpy(fullname, prefix);
+
+ HDstrcat(fullname, "/");
+ HDstrcat(fullname, base_name);
+ }
+ else {
+ /* Buffer is too small */
+ return NULL;
+ }
+ }
+ else {
+ if (HDsnprintf(fullname, size, "%s/%s", prefix, base_name) == (int)size)
+ /* Buffer is too small */
+ return NULL;
+ }
+ }
+ else if (HDstrlen(base_name) >= size) {
+ /* Buffer is too small */
+ return NULL;
+ }
+ else {
+ HDstrcpy(fullname, base_name);
+ }
+
+ /* Append a suffix */
+ if (suffix) {
+ if (HDstrlen(fullname) + HDstrlen(suffix) >= size)
+ return NULL;
+
+ HDstrcat(fullname, suffix);
+ }
+
+ /* Remove any double slashes in the filename */
+ for (ptr = fullname, i = j = 0; ptr && i < size; i++, ptr++) {
+ if (*ptr != '/' || last != '/')
+ fullname[j++] = *ptr;
+
+ last = *ptr;
+ }
+
+ return fullname;
+}
/*
* Local variables:
diff --git a/tools/test/perform/pio_engine.c b/tools/src/h5perf/pio_engine.c
index 65194b0..cac36d7 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/src/h5perf/pio_engine.c
@@ -16,12 +16,10 @@
#include "hdf5.h"
-#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
diff --git a/tools/test/perform/pio_perf.c b/tools/src/h5perf/pio_perf.c
index 6fb5043..41245d9 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/src/h5perf/pio_perf.c
@@ -113,6 +113,12 @@ int pio_debug_level = 0; /* The debug level:
/* local variables */
static const char *progname = "h5perf";
+#ifndef HDF5_PARAPREFIX
+#define HDF5_PARAPREFIX ""
+#endif
+char * paraprefix = NULL; /* for command line option para-prefix */
+MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */
+
/*
* Command-line options: The user can specify short or long-named
* parameters. The long-named ones can be partially spelled. When
@@ -123,147 +129,31 @@ static const char *s_opts = "a:A:B:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
#else
static const char *s_opts = "a:A:bB:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
#endif /* 1 */
-static struct long_options l_opts[] = {{"align", require_arg, 'a'},
- {"alig", require_arg, 'a'},
- {"ali", require_arg, 'a'},
- {"al", require_arg, 'a'},
- {"api", require_arg, 'A'},
- {"ap", require_arg, 'A'},
+static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'},
+ {"api", require_arg, 'A'},
#if 0
/* a sighting of the elusive binary option */
{ "binary", no_arg, 'b' },
- { "binar", no_arg, 'b' },
- { "bina", no_arg, 'b' },
- { "bin", no_arg, 'b' },
- { "bi", no_arg, 'b' },
#endif /* 0 */
- {"block-size", require_arg, 'B'},
- {"block-siz", require_arg, 'B'},
- {"block-si", require_arg, 'B'},
- {"block-s", require_arg, 'B'},
- {"block-", require_arg, 'B'},
- {"block", require_arg, 'B'},
- {"bloc", require_arg, 'B'},
- {"blo", require_arg, 'B'},
- {"bl", require_arg, 'B'},
- {"chunk", no_arg, 'c'},
- {"chun", no_arg, 'c'},
- {"chu", no_arg, 'c'},
- {"ch", no_arg, 'c'},
- {"collective", no_arg, 'C'},
- {"collectiv", no_arg, 'C'},
- {"collecti", no_arg, 'C'},
- {"collect", no_arg, 'C'},
- {"collec", no_arg, 'C'},
- {"colle", no_arg, 'C'},
- {"coll", no_arg, 'C'},
- {"col", no_arg, 'C'},
- {"co", no_arg, 'C'},
- {"debug", require_arg, 'D'},
- {"debu", require_arg, 'D'},
- {"deb", require_arg, 'D'},
- {"de", require_arg, 'D'},
- {"geometry", no_arg, 'g'},
- {"geometr", no_arg, 'g'},
- {"geomet", no_arg, 'g'},
- {"geome", no_arg, 'g'},
- {"geom", no_arg, 'g'},
- {"geo", no_arg, 'g'},
- {"ge", no_arg, 'g'},
- {"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"interleaved", require_arg, 'I'},
- {"interleave", require_arg, 'I'},
- {"interleav", require_arg, 'I'},
- {"interlea", require_arg, 'I'},
- {"interle", require_arg, 'I'},
- {"interl", require_arg, 'I'},
- {"inter", require_arg, 'I'},
- {"inte", require_arg, 'I'},
- {"int", require_arg, 'I'},
- {"in", require_arg, 'I'},
- {"max-num-processes", require_arg, 'P'},
- {"max-num-processe", require_arg, 'P'},
- {"max-num-process", require_arg, 'P'},
- {"max-num-proces", require_arg, 'P'},
- {"max-num-proce", require_arg, 'P'},
- {"max-num-proc", require_arg, 'P'},
- {"max-num-pro", require_arg, 'P'},
- {"max-num-pr", require_arg, 'P'},
- {"max-num-p", require_arg, 'P'},
- {"min-num-processes", require_arg, 'p'},
- {"min-num-processe", require_arg, 'p'},
- {"min-num-process", require_arg, 'p'},
- {"min-num-proces", require_arg, 'p'},
- {"min-num-proce", require_arg, 'p'},
- {"min-num-proc", require_arg, 'p'},
- {"min-num-pro", require_arg, 'p'},
- {"min-num-pr", require_arg, 'p'},
- {"min-num-p", require_arg, 'p'},
- {"max-xfer-size", require_arg, 'X'},
- {"max-xfer-siz", require_arg, 'X'},
- {"max-xfer-si", require_arg, 'X'},
- {"max-xfer-s", require_arg, 'X'},
- {"max-xfer", require_arg, 'X'},
- {"max-xfe", require_arg, 'X'},
- {"max-xf", require_arg, 'X'},
- {"max-x", require_arg, 'X'},
- {"min-xfer-size", require_arg, 'x'},
- {"min-xfer-siz", require_arg, 'x'},
- {"min-xfer-si", require_arg, 'x'},
- {"min-xfer-s", require_arg, 'x'},
- {"min-xfer", require_arg, 'x'},
- {"min-xfe", require_arg, 'x'},
- {"min-xf", require_arg, 'x'},
- {"min-x", require_arg, 'x'},
- {"num-bytes", require_arg, 'e'},
- {"num-byte", require_arg, 'e'},
- {"num-byt", require_arg, 'e'},
- {"num-by", require_arg, 'e'},
- {"num-b", require_arg, 'e'},
- {"num-dsets", require_arg, 'd'},
- {"num-dset", require_arg, 'd'},
- {"num-dse", require_arg, 'd'},
- {"num-ds", require_arg, 'd'},
- {"num-d", require_arg, 'd'},
- {"num-files", require_arg, 'F'},
- {"num-file", require_arg, 'F'},
- {"num-fil", require_arg, 'F'},
- {"num-fi", require_arg, 'F'},
- {"num-f", require_arg, 'F'},
- {"num-iterations", require_arg, 'i'},
- {"num-iteration", require_arg, 'i'},
- {"num-iteratio", require_arg, 'i'},
- {"num-iterati", require_arg, 'i'},
- {"num-iterat", require_arg, 'i'},
- {"num-itera", require_arg, 'i'},
- {"num-iter", require_arg, 'i'},
- {"num-ite", require_arg, 'i'},
- {"num-it", require_arg, 'i'},
- {"num-i", require_arg, 'i'},
- {"output", require_arg, 'o'},
- {"outpu", require_arg, 'o'},
- {"outp", require_arg, 'o'},
- {"out", require_arg, 'o'},
- {"ou", require_arg, 'o'},
- {"threshold", require_arg, 'T'},
- {"threshol", require_arg, 'T'},
- {"thresho", require_arg, 'T'},
- {"thresh", require_arg, 'T'},
- {"thres", require_arg, 'T'},
- {"thre", require_arg, 'T'},
- {"thr", require_arg, 'T'},
- {"th", require_arg, 'T'},
- {"write-only", require_arg, 'w'},
- {"write-onl", require_arg, 'w'},
- {"write-on", require_arg, 'w'},
- {"write-o", require_arg, 'w'},
- {"write", require_arg, 'w'},
- {"writ", require_arg, 'w'},
- {"wri", require_arg, 'w'},
- {"wr", require_arg, 'w'},
- {NULL, 0, '\0'}};
+ {"block-size", require_arg, 'B'},
+ {"chunk", no_arg, 'c'},
+ {"collective", no_arg, 'C'},
+ {"debug", require_arg, 'D'},
+ {"geometry", no_arg, 'g'},
+ {"help", no_arg, 'h'},
+ {"interleaved", require_arg, 'I'},
+ {"max-num-processes", require_arg, 'P'},
+ {"min-num-processes", require_arg, 'p'},
+ {"max-xfer-size", require_arg, 'X'},
+ {"min-xfer-size", require_arg, 'x'},
+ {"num-bytes", require_arg, 'e'},
+ {"num-dsets", require_arg, 'd'},
+ {"num-files", require_arg, 'F'},
+ {"num-iterations", require_arg, 'i'},
+ {"output", require_arg, 'o'},
+ {"threshold", require_arg, 'T'},
+ {"write-only", require_arg, 'w'},
+ {NULL, 0, '\0'}};
struct options {
long io_types; /* bitmask of which I/O types to test */
@@ -850,6 +740,135 @@ output_all_info(minmax *mm, int count, int indent_level)
}
/*
+ * Function: h5_set_info_object
+ * Purpose: Process environment variables setting to set up MPI Info
+ * object.
+ * Return: 0 if all is fine; otherwise non-zero.
+ * Programmer: Albert Cheng, 2002/05/21.
+ * Modifications:
+ * Bill Wendling, 2002/05/31
+ * Modified so that the HDF5_MPI_INFO environment variable can
+ * be a semicolon separated list of "key=value" pairings. Most
+ * of the code is to remove any whitespaces which might be
+ * surrounding the "key=value" pairs.
+ */
+int
+h5_set_info_object(void)
+{
+ char *envp; /* environment pointer */
+ int ret_value = 0;
+
+ /* handle any MPI INFO hints via $HDF5_MPI_INFO */
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL) {
+ char *next, *valp;
+
+ valp = envp = next = HDstrdup(envp);
+
+ if (!valp)
+ return 0;
+
+ /* create an INFO object if not created yet */
+ if (h5_io_info_g == MPI_INFO_NULL)
+ MPI_Info_create(&h5_io_info_g);
+
+ do {
+ size_t len;
+ char * key_val, *endp, *namep;
+
+ if (*valp == ';')
+ valp++;
+
+ /* copy key/value pair into temporary buffer */
+ len = strcspn(valp, ";");
+ next = &valp[len];
+ key_val = (char *)HDcalloc(1, len + 1);
+
+ /* increment the next pointer past the terminating semicolon */
+ if (*next == ';')
+ ++next;
+
+ namep = HDstrncpy(key_val, valp, len);
+
+ /* pass up any beginning whitespaces */
+ while (*namep && (*namep == ' ' || *namep == '\t'))
+ namep++;
+
+ if (!*namep)
+ continue; /* was all white space, so move to next k/v pair */
+
+ /* eat up any ending white spaces */
+ endp = &namep[HDstrlen(namep) - 1];
+
+ while (endp && (*endp == ' ' || *endp == '\t'))
+ *endp-- = '\0';
+
+ /* find the '=' */
+ valp = HDstrchr(namep, '=');
+
+ if (valp != NULL) { /* it's a valid key/value pairing */
+ char *tmp_val = valp + 1;
+
+ /* change '=' to \0, move valp down one */
+ *valp-- = '\0';
+
+ /* eat up ending whitespace on the "key" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp-- = '\0';
+
+ valp = tmp_val;
+
+ /* eat up beginning whitespace on the "value" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp++ = '\0';
+
+ /* actually set the darned thing */
+ if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
+ HDprintf("MPI_Info_set failed\n");
+ ret_value = -1;
+ }
+ }
+
+ valp = next;
+ HDfree(key_val);
+ } while (next && *next);
+
+ HDfree(envp);
+ }
+
+ return ret_value;
+}
+
+/*
+ * Function: h5_dump_info_object
+ * Purpose: Display content of an MPI Info object
+ * Return: void
+ * Programmer: Albert Cheng 2002/05/21
+ * Modifications:
+ */
+void
+h5_dump_info_object(MPI_Info info)
+{
+ char key[MPI_MAX_INFO_KEY + 1];
+ char value[MPI_MAX_INFO_VAL + 1];
+ int flag;
+ int i, nkeys;
+
+ HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
+ if (info == MPI_INFO_NULL) {
+ HDprintf("object is MPI_INFO_NULL\n");
+ }
+ else {
+ MPI_Info_get_nkeys(info, &nkeys);
+ HDprintf("object has %d items\n", nkeys);
+ for (i = 0; i < nkeys; i++) {
+ MPI_Info_get_nthkey(info, i, key);
+ MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
+ HDprintf("%s=%s\n", key, value);
+ }
+ }
+}
+
+/*
* Function: get_minmax
* Purpose: Gather all the min, max and total of val.
* Return: Nothing
@@ -1286,13 +1305,13 @@ parse_command_line(int argc, char *argv[])
cl_opts->h5_write_only = FALSE; /* Do both read and write by default */
cl_opts->verify = FALSE; /* No Verify data correctness by default */
- while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'a':
- cl_opts->h5_alignment = parse_size_directive(opt_arg);
+ cl_opts->h5_alignment = parse_size_directive(H5_optarg);
break;
case 'A': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1332,7 +1351,7 @@ parse_command_line(int argc, char *argv[])
break;
#endif /* 0 */
case 'B':
- cl_opts->blk_size = (size_t)parse_size_directive(opt_arg);
+ cl_opts->blk_size = (size_t)parse_size_directive(H5_optarg);
break;
case 'c':
/* Turn on chunked HDF5 dataset creation */
@@ -1342,10 +1361,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->collective = 1;
break;
case 'd':
- cl_opts->num_dsets = atoi(opt_arg);
+ cl_opts->num_dsets = atoi(H5_optarg);
break;
case 'D': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1402,40 +1421,40 @@ parse_command_line(int argc, char *argv[])
break;
case 'e':
- cl_opts->num_bpp = parse_size_directive(opt_arg);
+ cl_opts->num_bpp = parse_size_directive(H5_optarg);
break;
case 'F':
- cl_opts->num_files = HDatoi(opt_arg);
+ cl_opts->num_files = HDatoi(H5_optarg);
break;
case 'g':
cl_opts->dim2d = 1;
break;
case 'i':
- cl_opts->num_iters = HDatoi(opt_arg);
+ cl_opts->num_iters = HDatoi(H5_optarg);
break;
case 'I':
cl_opts->interleaved = 1;
break;
case 'o':
- cl_opts->output_file = opt_arg;
+ cl_opts->output_file = H5_optarg;
break;
case 'p':
- cl_opts->min_num_procs = HDatoi(opt_arg);
+ cl_opts->min_num_procs = HDatoi(H5_optarg);
break;
case 'P':
- cl_opts->max_num_procs = HDatoi(opt_arg);
+ cl_opts->max_num_procs = HDatoi(H5_optarg);
break;
case 'T':
- cl_opts->h5_threshold = parse_size_directive(opt_arg);
+ cl_opts->h5_threshold = parse_size_directive(H5_optarg);
break;
case 'w':
cl_opts->h5_write_only = TRUE;
break;
case 'x':
- cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg);
+ cl_opts->min_xfer_size = (size_t)parse_size_directive(H5_optarg);
break;
case 'X':
- cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg);
+ cl_opts->max_xfer_size = (size_t)parse_size_directive(H5_optarg);
break;
case 'h':
case '?':
diff --git a/tools/test/perform/pio_perf.h b/tools/src/h5perf/pio_perf.h
index 027b553..8924c20 100644
--- a/tools/test/perform/pio_perf.h
+++ b/tools/src/h5perf/pio_perf.h
@@ -10,12 +10,12 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef PIO_PERF_H__
-#define PIO_PERF_H__
+#ifndef PIO_PERF_H
+#define PIO_PERF_H
#ifndef STANDALONE
#include "io_timer.h"
-#include "h5test.h"
+#include "H5private.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
@@ -23,6 +23,15 @@
#include "pio_standalone.h"
#endif
+#ifdef H5_HAVE_PARALLEL
+extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
+#endif
+
+#ifdef H5_HAVE_PARALLEL
+int h5_set_info_object(void);
+void h5_dump_info_object(MPI_Info info);
+#endif
+
/* setup the dataset no fill option if this is v1.5 or more */
#if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4
#define H5_HAVE_NOFILL 1
@@ -97,4 +106,4 @@ extern results do_pio(parameters param);
}
#endif /* __cplusplus */
-#endif /* PIO_PERF_H__ */
+#endif /* PIO_PERF_H */
diff --git a/tools/test/perform/sio_engine.c b/tools/src/h5perf/sio_engine.c
index f8061d4..e69a7cd 100644
--- a/tools/test/perform/sio_engine.c
+++ b/tools/src/h5perf/sio_engine.c
@@ -16,12 +16,10 @@
#include "hdf5.h"
-#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
@@ -52,7 +50,7 @@
/* verify: if val is false (0), print mesg. */
#define VRFY(val, mesg) \
do { \
- if (!val) { \
+ if (!(val)) { \
ERRMSG(mesg); \
GOTOERROR(FAIL); \
} \
@@ -80,7 +78,7 @@ static int clean_file_g = -1; /*whether to cleanup temporary test */
/*0 is no cleanup; 1 is do cleanup */
/* the different types of file descriptors we can expect */
-typedef union _file_descr {
+typedef union {
int posixfd; /* POSIX file handle*/
hid_t h5fd; /* HDF5 file */
} file_descr;
@@ -1266,13 +1264,6 @@ done:
* Programmer: Albert Cheng 2001/12/12
* Modifications: Support for file drivers. Christian Chilan, April, 2008
*/
-/* Disable warning for "format not a string literal" here -QAK */
-/*
- * This pragma only needs to surround the snprintf() calls with
- * 'temp' in the code below, but early (4.4.7, at least) gcc only
- * allows diagnostic pragmas to be toggled outside of functions.
- */
-H5_GCC_DIAG_OFF("format-nonliteral")
static void
do_cleanupfile(iotype iot, char *filename)
{
@@ -1335,4 +1326,3 @@ do_cleanupfile(iotype iot, char *filename)
}
}
}
-H5_GCC_DIAG_ON("format-nonliteral")
diff --git a/tools/test/perform/sio_perf.c b/tools/src/h5perf/sio_perf.c
index 8463ffa..1b200b0 100644
--- a/tools/test/perform/sio_perf.c
+++ b/tools/src/h5perf/sio_perf.c
@@ -65,8 +65,7 @@
#define SIO_HDF5 0x4
/* report 0.0 in case t is zero too */
-#define MB_PER_SEC(bytes, t) \
- (H5_DBL_ABS_EQUAL(t, (double)0.0F) ? (double)0.0F : ((((double)bytes) / (double)ONE_MB) / (t)))
+#define MB_PER_SEC(bytes, t) (H5_DBL_ABS_EQUAL(t, 0.0) ? 0.0 : ((((double)(bytes)) / (double)ONE_MB) / (t)))
#ifndef TRUE
#define TRUE 1
@@ -98,171 +97,35 @@ static const char *progname = "h5perf_serial";
* It seems that only the options that accept additional information
* such as dataset size (-e) require the colon next to it.
*/
-static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
-static struct long_options l_opts[] = {{"align", require_arg, 'a'},
- {"alig", require_arg, 'a'},
- {"ali", require_arg, 'a'},
- {"al", require_arg, 'a'},
- {"api", require_arg, 'A'},
- {"ap", require_arg, 'A'},
+static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
+static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'},
+ {"api", require_arg, 'A'},
#if 0
/* a sighting of the elusive binary option */
{ "binary", no_arg, 'b' },
- { "binar", no_arg, 'b' },
- { "bina", no_arg, 'b' },
- { "bin", no_arg, 'b' },
- { "bi", no_arg, 'b' },
#endif /* 0 */
- {"block-size", require_arg, 'B'},
- {"block-siz", require_arg, 'B'},
- {"block-si", require_arg, 'B'},
- {"block-s", require_arg, 'B'},
- {"block-", require_arg, 'B'},
- {"block", require_arg, 'B'},
- {"bloc", require_arg, 'B'},
- {"blo", require_arg, 'B'},
- {"bl", require_arg, 'B'},
- {"chunk", no_arg, 'c'},
- {"chun", no_arg, 'c'},
- {"chu", no_arg, 'c'},
- {"ch", no_arg, 'c'},
- {"collective", no_arg, 'C'},
- {"collectiv", no_arg, 'C'},
- {"collecti", no_arg, 'C'},
- {"collect", no_arg, 'C'},
- {"collec", no_arg, 'C'},
- {"colle", no_arg, 'C'},
- {"coll", no_arg, 'C'},
- {"col", no_arg, 'C'},
- {"co", no_arg, 'C'},
- {"debug", require_arg, 'D'},
- {"debu", require_arg, 'D'},
- {"deb", require_arg, 'D'},
- {"de", require_arg, 'D'},
- {"file-driver", require_arg, 'v'},
- {"file-drive", require_arg, 'v'},
- {"file-driv", require_arg, 'v'},
- {"file-dri", require_arg, 'v'},
- {"file-dr", require_arg, 'v'},
- {"file-d", require_arg, 'v'},
- {"file-", require_arg, 'v'},
- {"file", require_arg, 'v'},
- {"fil", require_arg, 'v'},
- {"fi", require_arg, 'v'},
- {"geometry", no_arg, 'g'},
- {"geometr", no_arg, 'g'},
- {"geomet", no_arg, 'g'},
- {"geome", no_arg, 'g'},
- {"geom", no_arg, 'g'},
- {"geo", no_arg, 'g'},
- {"ge", no_arg, 'g'},
- {"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"interleaved", require_arg, 'I'},
- {"interleave", require_arg, 'I'},
- {"interleav", require_arg, 'I'},
- {"interlea", require_arg, 'I'},
- {"interle", require_arg, 'I'},
- {"interl", require_arg, 'I'},
- {"inter", require_arg, 'I'},
- {"inte", require_arg, 'I'},
- {"int", require_arg, 'I'},
- {"in", require_arg, 'I'},
- {"max-num-processes", require_arg, 'P'},
- {"max-num-processe", require_arg, 'P'},
- {"max-num-process", require_arg, 'P'},
- {"max-num-proces", require_arg, 'P'},
- {"max-num-proce", require_arg, 'P'},
- {"max-num-proc", require_arg, 'P'},
- {"max-num-pro", require_arg, 'P'},
- {"max-num-pr", require_arg, 'P'},
- {"max-num-p", require_arg, 'P'},
- {"min-num-processes", require_arg, 'p'},
- {"min-num-processe", require_arg, 'p'},
- {"min-num-process", require_arg, 'p'},
- {"min-num-proces", require_arg, 'p'},
- {"min-num-proce", require_arg, 'p'},
- {"min-num-proc", require_arg, 'p'},
- {"min-num-pro", require_arg, 'p'},
- {"min-num-pr", require_arg, 'p'},
- {"min-num-p", require_arg, 'p'},
- {"max-xfer-size", require_arg, 'X'},
- {"max-xfer-siz", require_arg, 'X'},
- {"max-xfer-si", require_arg, 'X'},
- {"max-xfer-s", require_arg, 'X'},
- {"max-xfer", require_arg, 'X'},
- {"max-xfe", require_arg, 'X'},
- {"max-xf", require_arg, 'X'},
- {"max-x", require_arg, 'X'},
- {"min-xfer-size", require_arg, 'x'},
- {"min-xfer-siz", require_arg, 'x'},
- {"min-xfer-si", require_arg, 'x'},
- {"min-xfer-s", require_arg, 'x'},
- {"min-xfer", require_arg, 'x'},
- {"min-xfe", require_arg, 'x'},
- {"min-xf", require_arg, 'x'},
- {"min-x", require_arg, 'x'},
- {"num-bytes", require_arg, 'e'},
- {"num-byte", require_arg, 'e'},
- {"num-byt", require_arg, 'e'},
- {"num-by", require_arg, 'e'},
- {"num-b", require_arg, 'e'},
- {"num-dsets", require_arg, 'd'},
- {"num-dset", require_arg, 'd'},
- {"num-dse", require_arg, 'd'},
- {"num-ds", require_arg, 'd'},
- {"num-d", require_arg, 'd'},
- {"num-files", require_arg, 'F'},
- {"num-file", require_arg, 'F'},
- {"num-fil", require_arg, 'F'},
- {"num-fi", require_arg, 'F'},
- {"num-f", require_arg, 'F'},
- {"num-iterations", require_arg, 'i'},
- {"num-iteration", require_arg, 'i'},
- {"num-iteratio", require_arg, 'i'},
- {"num-iterati", require_arg, 'i'},
- {"num-iterat", require_arg, 'i'},
- {"num-itera", require_arg, 'i'},
- {"num-iter", require_arg, 'i'},
- {"num-ite", require_arg, 'i'},
- {"num-it", require_arg, 'i'},
- {"num-i", require_arg, 'i'},
- {"order", require_arg, 'r'},
- {"orde", require_arg, 'r'},
- {"ord", require_arg, 'r'},
- {"or", require_arg, 'r'},
- {"output", require_arg, 'o'},
- {"outpu", require_arg, 'o'},
- {"outp", require_arg, 'o'},
- {"out", require_arg, 'o'},
- {"ou", require_arg, 'o'},
- {"extendable", no_arg, 't'},
- {"extendabl", no_arg, 't'},
- {"extendab", no_arg, 't'},
- {"extenda", no_arg, 't'},
- {"extend", no_arg, 't'},
- {"exten", no_arg, 't'},
- {"exte", no_arg, 't'},
- {"ext", no_arg, 't'},
- {"ex", no_arg, 't'},
- {"threshold", require_arg, 'T'},
- {"threshol", require_arg, 'T'},
- {"thresho", require_arg, 'T'},
- {"thresh", require_arg, 'T'},
- {"thres", require_arg, 'T'},
- {"thre", require_arg, 'T'},
- {"thr", require_arg, 'T'},
- {"th", require_arg, 'T'},
- {"write-only", require_arg, 'w'},
- {"write-onl", require_arg, 'w'},
- {"write-on", require_arg, 'w'},
- {"write-o", require_arg, 'w'},
- {"write", require_arg, 'w'},
- {"writ", require_arg, 'w'},
- {"wri", require_arg, 'w'},
- {"wr", require_arg, 'w'},
- {NULL, 0, '\0'}};
+ {"block-size", require_arg, 'B'},
+ {"chunk", no_arg, 'c'},
+ {"collective", no_arg, 'C'},
+ {"debug", require_arg, 'D'},
+ {"file-driver", require_arg, 'v'},
+ {"geometry", no_arg, 'g'},
+ {"help", no_arg, 'h'},
+ {"interleaved", require_arg, 'I'},
+ {"max-num-processes", require_arg, 'P'},
+ {"min-num-processes", require_arg, 'p'},
+ {"max-xfer-size", require_arg, 'X'},
+ {"min-xfer-size", require_arg, 'x'},
+ {"num-bytes", require_arg, 'e'},
+ {"num-dsets", require_arg, 'd'},
+ {"num-files", require_arg, 'F'},
+ {"num-iterations", require_arg, 'i'},
+ {"order", require_arg, 'r'},
+ {"output", require_arg, 'o'},
+ {"extendable", no_arg, 't'},
+ {"threshold", require_arg, 'T'},
+ {"write-only", require_arg, 'w'},
+ {NULL, 0, '\0'}};
struct options {
long io_types; /* bitmask of which I/O types to test */
@@ -292,7 +155,7 @@ struct options {
size_t page_size;
};
-typedef struct _minmax {
+typedef struct {
double min;
double max;
double sum;
@@ -994,19 +857,19 @@ parse_command_line(int argc, const char *argv[])
cl_opts->h5_extendable = FALSE; /* Use extendable dataset */
cl_opts->verify = FALSE; /* No Verify data correctness by default */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'a':
- cl_opts->h5_alignment = parse_size_directive(opt_arg);
+ cl_opts->h5_alignment = parse_size_directive(H5_optarg);
break;
case 'G':
- cl_opts->page_size = parse_size_directive(opt_arg);
+ cl_opts->page_size = parse_size_directive(H5_optarg);
break;
case 'b':
- cl_opts->page_buffer_size = parse_size_directive(opt_arg);
+ cl_opts->page_buffer_size = parse_size_directive(H5_optarg);
break;
case 'A': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1044,7 +907,7 @@ parse_command_line(int argc, const char *argv[])
/* Turn on chunked HDF5 dataset creation */
cl_opts->h5_use_chunks = 1;
{
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
@@ -1071,7 +934,7 @@ parse_command_line(int argc, const char *argv[])
break;
case 'D': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1127,7 +990,7 @@ parse_command_line(int argc, const char *argv[])
break;
case 'e': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
@@ -1154,38 +1017,38 @@ parse_command_line(int argc, const char *argv[])
break;
case 'i':
- cl_opts->num_iters = HDatoi(opt_arg);
+ cl_opts->num_iters = HDatoi(H5_optarg);
break;
case 'o':
- cl_opts->output_file = opt_arg;
+ cl_opts->output_file = H5_optarg;
break;
case 'T':
- cl_opts->h5_threshold = parse_size_directive(opt_arg);
+ cl_opts->h5_threshold = parse_size_directive(H5_optarg);
break;
case 'v':
- if (!HDstrcasecmp(opt_arg, "sec2")) {
+ if (!HDstrcasecmp(H5_optarg, "sec2")) {
cl_opts->vfd = sec2;
}
- else if (!HDstrcasecmp(opt_arg, "stdio")) {
+ else if (!HDstrcasecmp(H5_optarg, "stdio")) {
cl_opts->vfd = stdio;
}
- else if (!HDstrcasecmp(opt_arg, "core")) {
+ else if (!HDstrcasecmp(H5_optarg, "core")) {
cl_opts->vfd = core;
}
- else if (!HDstrcasecmp(opt_arg, "split")) {
+ else if (!HDstrcasecmp(H5_optarg, "split")) {
cl_opts->vfd = split;
}
- else if (!HDstrcasecmp(opt_arg, "multi")) {
+ else if (!HDstrcasecmp(H5_optarg, "multi")) {
cl_opts->vfd = multi;
}
- else if (!HDstrcasecmp(opt_arg, "family")) {
+ else if (!HDstrcasecmp(H5_optarg, "family")) {
cl_opts->vfd = family;
}
- else if (!HDstrcasecmp(opt_arg, "direct")) {
+ else if (!HDstrcasecmp(H5_optarg, "direct")) {
cl_opts->vfd = direct;
}
else {
- HDfprintf(stderr, "sio_perf: invalid --api option %s\n", opt_arg);
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n", H5_optarg);
HDexit(EXIT_FAILURE);
}
break;
@@ -1196,7 +1059,7 @@ parse_command_line(int argc, const char *argv[])
cl_opts->h5_extendable = TRUE;
break;
case 'x': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
@@ -1223,7 +1086,7 @@ parse_command_line(int argc, const char *argv[])
break;
case 'r': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
diff --git a/tools/test/perform/sio_perf.h b/tools/src/h5perf/sio_perf.h
index acdb801..d998377 100644
--- a/tools/test/perform/sio_perf.h
+++ b/tools/src/h5perf/sio_perf.h
@@ -10,12 +10,12 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef SIO_PERF_H__
-#define SIO_PERF_H__
+#ifndef SIO_PERF_H
+#define SIO_PERF_H
#ifndef STANDALONE
#include "io_timer.h"
-#include "h5test.h"
+#include "H5private.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
@@ -101,4 +101,4 @@ extern void do_sio(parameters param, results *res);
}
#endif /* __cplusplus */
-#endif /* PIO_PERF_H__ */
+#endif /* SIO_PERF_H */
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index 7bcca8f..7cad36b 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -225,9 +225,9 @@ hid_t
copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, trav_table_t *travt,
pack_opt_t *options)
{
- named_dt_t *dt = *named_dt_head_p; /* Stack pointer */
- named_dt_t *dt_ret = NULL; /* Datatype to return */
- H5O_info2_t oinfo; /* Object info of input dtype */
+ named_dt_t *dt = NULL; /* Stack pointer */
+ named_dt_t *dt_ret = NULL; /* Datatype to return */
+ H5O_info2_t oinfo; /* Object info of input dtype */
int token_cmp;
hid_t ret_value = H5I_INVALID_HID;
@@ -235,15 +235,13 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t
H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Oget_info failed");
if (*named_dt_head_p) {
- if (H5Otoken_cmp(type_in, &dt->obj_token, &oinfo.token, &token_cmp) < 0)
- H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to compare object tokens");
-
- /* Stack already exists, search for the datatype */
- while (dt && token_cmp) {
- dt = dt->next;
-
+ /* Search the stack for the datatype. */
+ for (dt = *named_dt_head_p; dt != NULL; dt = dt->next) {
if (H5Otoken_cmp(type_in, &dt->obj_token, &oinfo.token, &token_cmp) < 0)
H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to compare object tokens");
+
+ if (token_cmp == 0)
+ break; // found it!
}
dt_ret = dt;
diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h
index 7f4e8f2..74525f4 100644
--- a/tools/src/h5repack/h5repack.h
+++ b/tools/src/h5repack/h5repack.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5REPACK_H__
-#define H5REPACK_H__
+#ifndef H5REPACK_H
+#define H5REPACK_H
#include "H5private.h"
#include "hdf5.h"
@@ -195,13 +195,13 @@ void init_packobject(pack_info_t *obj);
*-------------------------------------------------------------------------
*/
-int apply_filters(const char *name, /* object name from traverse list */
- int rank, /* rank of dataset */
- hsize_t * dims, /* dimensions of dataset */
- size_t msize, /* size of type */
- hid_t dcpl_id, /* dataset creation property list */
- pack_opt_t *options, /* repack options */
- int * has_filter); /* (OUT) object NAME has a filter */
+int apply_filters(const char * name, /* object name from traverse list */
+ int rank, /* rank of dataset */
+ const hsize_t *dims, /* dimensions of dataset */
+ size_t msize, /* size of type */
+ hid_t dcpl_id, /* dataset creation property list */
+ pack_opt_t * options, /* repack options */
+ int * has_filter); /* (OUT) object NAME has a filter */
/*-------------------------------------------------------------------------
* options table
@@ -224,4 +224,4 @@ obj_list_t *parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
obj_list_t *parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about object */
pack_opt_t *options);
-#endif /* H5REPACK_H__ */
+#endif /* H5REPACK_H */
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 0aef710..934b4d1 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -37,7 +37,7 @@
* local functions
*-------------------------------------------------------------------------
*/
-static int get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum,
+static int get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t size_datum,
hsize_t dims_hslab[], hsize_t *hslab_nbytes_p);
static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr);
static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *options);
@@ -305,14 +305,6 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
H5TOOLS_GOTO_ERROR((-1), "H5Fcreate could not create file <%s>:", fnameout);
/*-------------------------------------------------------------------------
- * write a new user block if requested
- *-------------------------------------------------------------------------
- */
- if (options->ublock_size > 0)
- if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0)
- H5TOOLS_GOTO_ERROR((-1), "Could not copy user block. Exiting...");
-
- /*-------------------------------------------------------------------------
* get list of objects
*-------------------------------------------------------------------------
*/
@@ -346,27 +338,60 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
}
/*-------------------------------------------------------------------------
- * write only the input file user block if there is no user block file input
+ * Close the file and everything in it so the lock is removed
*-------------------------------------------------------------------------
*/
+ if (H5Pclose(fcpl) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "could not close fcpl");
+ if (H5Pclose(options->fout_fapl) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "could not close fcpl");
+ options->fout_fapl = H5P_DEFAULT;
+ if (H5Pclose(gcpl_in) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "could not close fcpl");
+ if (H5Gclose(grp_in) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "could not close fcpl");
+ if (H5Fclose(fidout) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "could not close fcpl");
+ if (H5Fclose(fidin) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "could not close fcpl");
- if (ub_size > 0 && options->ublock_size == 0)
+ /*-------------------------------------------------------------------------
+ * NOTE: The userblock MUST be written out AFTER the file is closed or
+ * the file locking will cause failures on Windows, where file locks
+ * are mandatory, not advisory.
+ *-------------------------------------------------------------------------
+ */
+
+ /*-------------------------------------------------------------------------
+ * Write a new user block if requested, using the input file user block if
+ * there is no separate user block file input
+ *-------------------------------------------------------------------------
+ */
+
+ if (options->ublock_size > 0) {
+ if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "Could not copy user block. Exiting...");
+ }
+ else if (ub_size > 0 && options->ublock_size == 0) {
if (copy_user_block(fnamein, fnameout, ub_size) < 0)
H5TOOLS_GOTO_ERROR((-1), "Could not copy user block. Exiting...");
+ }
done:
- H5E_BEGIN_TRY
- {
- H5Pclose(fcpl);
- H5Pclose(options->fout_fapl);
- options->fout_fapl = H5P_DEFAULT;
- H5Pclose(gcpl_in);
- H5Gclose(grp_in);
- H5Pclose(fcpl_in);
- H5Fclose(fidout);
- H5Fclose(fidin);
+ if (-1 == ret_value) {
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fcpl);
+ H5Pclose(options->fout_fapl);
+ options->fout_fapl = H5P_DEFAULT;
+ H5Pclose(gcpl_in);
+ H5Gclose(grp_in);
+ H5Pclose(fcpl_in);
+ H5Fclose(fidout);
+ H5Fclose(fidin);
+ }
+ H5E_END_TRY;
}
- H5E_END_TRY;
if (travt)
trav_table_free(travt);
@@ -406,8 +431,8 @@ done:
*-----------------------------------------*/
int
-get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[],
- hsize_t *hslab_nbytes_p)
+get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t size_datum,
+ hsize_t dims_hslab[], hsize_t *hslab_nbytes_p)
{
int k;
H5D_layout_t dset_layout;
@@ -601,6 +626,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */
hid_t ocpl_id = H5I_INVALID_HID; /* property to pass copy options */
hid_t lcpl_id = H5I_INVALID_HID; /* link creation property list */
+ hid_t dxpl_id = H5I_INVALID_HID; /* dataset transfer property list */
named_dt_t * named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */
size_t msize; /* size of type */
hsize_t nelmts; /* number of elements in dataset */
@@ -970,12 +996,27 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (need < H5TOOLS_MALLOCSIZE)
buf = HDmalloc(need);
+ /* Set up collective write if using filters in parallel */
+ {
+#ifdef H5_HAVE_PARALLEL
+ hbool_t parallel = (H5FD_MPIO == H5Pget_driver(options->fout_fapl));
+
+ if (parallel && apply_s && apply_f) {
+ if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed");
+ if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "H5Pset_dxpl_mpio failed");
+ }
+ else
+#endif
+ dxpl_id = H5P_DEFAULT;
+ }
+
if (buf != NULL) {
if (H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) <
0)
H5TOOLS_GOTO_ERROR((-1), "H5Dread failed");
- if (H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) <
- 0)
+ if (H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed");
/* Check if we have VL data in the dataset's
@@ -1077,8 +1118,8 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (H5Dread(dset_in, wtype_id, hslab_space, f_space_id,
H5P_DEFAULT, hslab_buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dread failed");
- if (H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id,
- H5P_DEFAULT, hslab_buf) < 0)
+ if (H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, dxpl_id,
+ hslab_buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed");
/* reclaim any VL memory, if necessary */
@@ -1337,7 +1378,10 @@ done:
H5TOOLS_ERROR((-1), "named_datatype_free failed");
}
else {
- H5E_BEGIN_TRY { named_datatype_free(&named_dt_head, 1); }
+ H5E_BEGIN_TRY
+ {
+ named_datatype_free(&named_dt_head, 1);
+ }
H5E_END_TRY;
}
@@ -1354,6 +1398,7 @@ done:
H5Pclose(dcpl_in);
H5Pclose(gcpl_in);
H5Pclose(gcpl_out);
+ H5Pclose(dxpl_id);
H5Sclose(f_space_id);
H5Dclose(dset_in);
H5Dclose(dset_out);
diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c
index 66fdf45..32476ce 100644
--- a/tools/src/h5repack/h5repack_filters.c
+++ b/tools/src/h5repack/h5repack_filters.c
@@ -236,13 +236,13 @@ aux_assign_obj(const char * name, /* object name from traverse list */
*/
int
-apply_filters(const char *name, /* object name from traverse list */
- int rank, /* rank of dataset */
- hsize_t * dims, /* dimensions of dataset */
- size_t msize, /* size of type */
- hid_t dcpl_id, /* dataset creation property list */
- pack_opt_t *options, /* repack options */
- int * has_filter) /* (OUT) object NAME has a filter */
+apply_filters(const char * name, /* object name from traverse list */
+ int rank, /* rank of dataset */
+ const hsize_t *dims, /* dimensions of dataset */
+ size_t msize, /* size of type */
+ hid_t dcpl_id, /* dataset creation property list */
+ pack_opt_t * options, /* repack options */
+ int * has_filter) /* (OUT) object NAME has a filter */
{
int nfilters; /* number of filters in DCPL */
hsize_t chsize[64]; /* chunk size in elements */
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index c753e90..3526268 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -31,44 +31,44 @@ const char *outfile = NULL;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:";
-static struct long_options l_opts[] = {{"alignment", require_arg, 'a'},
- {"block", require_arg, 'b'},
- {"compact", require_arg, 'c'},
- {"indexed", require_arg, 'd'},
- {"file", require_arg, 'e'},
- {"filter", require_arg, 'f'},
- {"help", no_arg, 'h'},
- {"infile", require_arg, 'i'}, /* for backward compability */
- {"low", require_arg, 'j'},
- {"high", require_arg, 'k'},
- {"layout", require_arg, 'l'},
- {"minimum", require_arg, 'm'},
- {"native", no_arg, 'n'},
- {"outfile", require_arg, 'o'}, /* for backward compability */
- {"sort_by", require_arg, 'q'},
- {"ssize", require_arg, 's'},
- {"threshold", require_arg, 't'},
- {"ublock", require_arg, 'u'},
- {"verbose", no_arg, 'v'},
- {"sort_order", require_arg, 'z'},
- {"enable-error-stack", no_arg, 'E'},
- {"fs_pagesize", require_arg, 'G'},
- {"latest", no_arg, 'L'},
- {"metadata_block_size", require_arg, 'M'},
- {"fs_persist", require_arg, 'P'},
- {"fs_strategy", require_arg, 'S'},
- {"fs_threshold", require_arg, 'T'},
- {"version", no_arg, 'V'},
- {"merge", no_arg, 'X'},
- {"prune", no_arg, 'W'},
- {"src-vol-value", require_arg, '1'},
- {"src-vol-name", require_arg, '2'},
- {"src-vol-info", require_arg, '3'},
- {"dst-vol-value", require_arg, '4'},
- {"dst-vol-name", require_arg, '5'},
- {"dst-vol-info", require_arg, '6'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:";
+static struct h5_long_options l_opts[] = {{"alignment", require_arg, 'a'},
+ {"block", require_arg, 'b'},
+ {"compact", require_arg, 'c'},
+ {"indexed", require_arg, 'd'},
+ {"file", require_arg, 'e'},
+ {"filter", require_arg, 'f'},
+ {"help", no_arg, 'h'},
+ {"infile", require_arg, 'i'}, /* for backward compability */
+ {"low", require_arg, 'j'},
+ {"high", require_arg, 'k'},
+ {"layout", require_arg, 'l'},
+ {"minimum", require_arg, 'm'},
+ {"native", no_arg, 'n'},
+ {"outfile", require_arg, 'o'}, /* for backward compability */
+ {"sort_by", require_arg, 'q'},
+ {"ssize", require_arg, 's'},
+ {"threshold", require_arg, 't'},
+ {"ublock", require_arg, 'u'},
+ {"verbose", no_arg, 'v'},
+ {"sort_order", require_arg, 'z'},
+ {"enable-error-stack", no_arg, 'E'},
+ {"fs_pagesize", require_arg, 'G'},
+ {"latest", no_arg, 'L'},
+ {"metadata_block_size", require_arg, 'M'},
+ {"fs_persist", require_arg, 'P'},
+ {"fs_strategy", require_arg, 'S'},
+ {"fs_threshold", require_arg, 'T'},
+ {"version", no_arg, 'V'},
+ {"merge", no_arg, 'X'},
+ {"prune", no_arg, 'W'},
+ {"src-vol-value", require_arg, '1'},
+ {"src-vol-name", require_arg, '2'},
+ {"src-vol-info", require_arg, '3'},
+ {"dst-vol-value", require_arg, '4'},
+ {"dst-vol-name", require_arg, '5'},
+ {"dst-vol-info", require_arg, '6'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -363,11 +363,11 @@ read_info(const char *filename, pack_opt_t *options)
/* cycle until end of file reached */
while (1) {
- if (EOF == fscanf(fp, "%9s", stype))
+ if (EOF == HDfscanf(fp, "%9s", stype))
break;
/* Info indicator must be for layout or filter */
- if (HDstrcmp(stype, "-l") && HDstrcmp(stype, "-f")) {
+ if (HDstrcmp(stype, "-l") != 0 && HDstrcmp(stype, "-f") != 0) {
error_msg("bad file format for %s", filename);
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -378,7 +378,7 @@ read_info(const char *filename, pack_opt_t *options)
i = 0;
c = '0';
while (c != ' ') {
- if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -390,7 +390,7 @@ read_info(const char *filename, pack_opt_t *options)
c = '0';
/* go until end */
while (c != ' ') {
- if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -497,18 +497,18 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t));
/* parse command line options */
- while (EOF != (opt = get_option(argc, argv, s_opts, l_opts))) {
+ while (EOF != (opt = H5_get_option(argc, argv, s_opts, l_opts))) {
switch ((char)opt) {
/* -i for backward compatibility */
case 'i':
- infile = opt_arg;
+ infile = H5_optarg;
has_i++;
break;
/* -o for backward compatibility */
case 'o':
- outfile = opt_arg;
+ outfile = H5_optarg;
has_o++;
break;
@@ -530,7 +530,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 'f':
/* parse the -f filter option */
- if (h5repack_addfilter(opt_arg, options) < 0) {
+ if (h5repack_addfilter(H5_optarg, options) < 0) {
error_msg("in parsing filter\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -540,7 +540,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 'l':
/* parse the -l layout option */
- if (h5repack_addlayout(opt_arg, options) < 0) {
+ if (h5repack_addlayout(H5_optarg, options) < 0) {
error_msg("in parsing layout\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -549,9 +549,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'm':
- options->min_comp = HDstrtoull(opt_arg, NULL, 0);
+ options->min_comp = HDstrtoull(H5_optarg, NULL, 0);
if ((int)options->min_comp <= 0) {
- error_msg("invalid minimum compress size <%s>\n", opt_arg);
+ error_msg("invalid minimum compress size <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -559,8 +559,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'e':
- if ((ret_value = read_info(opt_arg, options)) < 0) {
- error_msg("failed to read from repack options file <%s>\n", opt_arg);
+ if ((ret_value = read_info(H5_optarg, options)) < 0) {
+ error_msg("failed to read from repack options file <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -576,7 +576,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'j':
- bound = HDatoi(opt_arg);
+ bound = HDatoi(H5_optarg);
if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) {
error_msg("in parsing low bound\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -587,7 +587,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'k':
- bound = HDatoi(opt_arg);
+ bound = HDatoi(H5_optarg);
if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) {
error_msg("in parsing high bound\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -606,13 +606,13 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'c':
- options->grp_compact = HDatoi(opt_arg);
+ options->grp_compact = HDatoi(H5_optarg);
if (options->grp_compact > 0)
options->latest = TRUE; /* must use latest format */
break;
case 'd':
- options->grp_indexed = HDatoi(opt_arg);
+ options->grp_indexed = HDatoi(H5_optarg);
if (options->grp_indexed > 0)
options->latest = TRUE; /* must use latest format */
break;
@@ -620,10 +620,10 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 's': {
int idx = 0;
int ssize = 0;
- char *msgPtr = HDstrchr(opt_arg, ':');
+ char *msgPtr = HDstrchr(H5_optarg, ':');
options->latest = TRUE; /* must use latest format */
if (msgPtr == NULL) {
- ssize = HDatoi(opt_arg);
+ ssize = HDatoi(H5_optarg);
for (idx = 0; idx < 5; idx++)
options->msg_size[idx] = ssize;
}
@@ -632,7 +632,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
HDstrcpy(msgType, msgPtr + 1);
msgPtr[0] = '\0';
- ssize = HDatoi(opt_arg);
+ ssize = HDatoi(H5_optarg);
if (!HDstrncmp(msgType, "dspace", 6))
options->msg_size[0] = ssize;
else if (!HDstrncmp(msgType, "dtype", 5))
@@ -647,25 +647,25 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
} break;
case 'u':
- options->ublock_filename = opt_arg;
+ options->ublock_filename = H5_optarg;
break;
case 'b':
- options->ublock_size = (hsize_t)HDatol(opt_arg);
+ options->ublock_size = (hsize_t)HDatol(H5_optarg);
break;
case 'M':
- options->meta_block_size = (hsize_t)HDatol(opt_arg);
+ options->meta_block_size = (hsize_t)HDatol(H5_optarg);
break;
case 't':
- options->threshold = (hsize_t)HDatol(opt_arg);
+ options->threshold = (hsize_t)HDatol(H5_optarg);
break;
case 'a':
- options->alignment = HDstrtoull(opt_arg, NULL, 0);
+ options->alignment = HDstrtoull(H5_optarg, NULL, 0);
if (options->alignment < 1) {
- error_msg("invalid alignment size\n", opt_arg);
+ error_msg("invalid alignment size\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -675,7 +675,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 'S': {
char strategy[MAX_NC_NAME];
- HDstrcpy(strategy, opt_arg);
+ HDstrcpy(strategy, H5_optarg);
if (!HDstrcmp(strategy, "FSM_AGGR"))
options->fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR;
else if (!HDstrcmp(strategy, "PAGE"))
@@ -685,7 +685,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
else if (!HDstrcmp(strategy, "NONE"))
options->fs_strategy = H5F_FSPACE_STRATEGY_NONE;
else {
- error_msg("invalid file space management strategy\n", opt_arg);
+ error_msg("invalid file space management strategy\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -696,29 +696,29 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
} break;
case 'P':
- options->fs_persist = HDatoi(opt_arg);
+ options->fs_persist = HDatoi(H5_optarg);
if (options->fs_persist == 0)
/* To distinguish the "specified" zero value */
options->fs_persist = -1;
break;
case 'T':
- options->fs_threshold = HDatol(opt_arg);
+ options->fs_threshold = HDatol(H5_optarg);
if (options->fs_threshold == 0)
/* To distinguish the "specified" zero value */
options->fs_threshold = -1;
break;
case 'G':
- options->fs_pagesize = HDstrtoll(opt_arg, NULL, 0);
+ options->fs_pagesize = HDstrtoll(H5_optarg, NULL, 0);
if (options->fs_pagesize == 0)
/* To distinguish the "specified" zero value */
options->fs_pagesize = -1;
break;
case 'q':
- if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(opt_arg))) {
- error_msg("failed to set sort by form <%s>\n", opt_arg);
+ if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(H5_optarg))) {
+ error_msg("failed to set sort by form <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -726,8 +726,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'z':
- if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(opt_arg))) {
- error_msg("failed to set sort order form <%s>\n", opt_arg);
+ if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(H5_optarg))) {
+ error_msg("failed to set sort order form <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -740,34 +740,34 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case '1':
in_vol_info.type = VOL_BY_VALUE;
- in_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ in_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
custom_in_fapl = TRUE;
break;
case '2':
in_vol_info.type = VOL_BY_NAME;
- in_vol_info.u.name = opt_arg;
+ in_vol_info.u.name = H5_optarg;
custom_in_fapl = TRUE;
break;
case '3':
- in_vol_info.info_string = opt_arg;
+ in_vol_info.info_string = H5_optarg;
break;
case '4':
out_vol_info.type = VOL_BY_VALUE;
- out_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ out_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
custom_out_fapl = TRUE;
break;
case '5':
out_vol_info.type = VOL_BY_NAME;
- out_vol_info.u.name = opt_arg;
+ out_vol_info.u.name = H5_optarg;
custom_out_fapl = TRUE;
break;
case '6':
- out_vol_info.info_string = opt_arg;
+ out_vol_info.info_string = H5_optarg;
break;
default:
@@ -777,9 +777,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
/* If neither -i nor -o given, get in and out files positionally */
if (0 == (has_i + has_o)) {
- if (argv[opt_ind] != NULL && argv[opt_ind + 1] != NULL) {
- infile = argv[opt_ind];
- outfile = argv[opt_ind + 1];
+ if (argv[H5_optind] != NULL && argv[H5_optind + 1] != NULL) {
+ infile = argv[H5_optind];
+ outfile = argv[H5_optind + 1];
if (!HDstrcmp(infile, outfile)) {
error_msg("file names cannot be the same\n");
diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c
index 2fd39fd..167506f 100644
--- a/tools/src/h5repack/h5repack_opttable.c
+++ b/tools/src/h5repack/h5repack_opttable.c
@@ -339,7 +339,7 @@ options_get_object(const char *path, pack_opttbl_t *table)
for (i = 0; i < table->nelems; i++) {
/* make full path (start with "/") to compare correctly */
- if (HDstrncmp(table->objs[i].path, "/", 1)) {
+ if (HDstrncmp(table->objs[i].path, "/", 1) != 0) {
HDstrcpy(tbl_path, "/");
HDstrcat(tbl_path, table->objs[i].path);
}
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index 3e7a8c1..efc80b6 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -171,106 +171,23 @@ struct handler_t {
static const char *s_opts = "Aa:Ddm:EFfhGgl:sSTO:Vw:H:";
/* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"filemetadata", no_arg, 'F'},
- {"filemetadat", no_arg, 'F'},
- {"filemetada", no_arg, 'F'},
- {"filemetad", no_arg, 'F'},
- {"filemeta", no_arg, 'F'},
- {"filemet", no_arg, 'F'},
- {"fileme", no_arg, 'F'},
- {"filem", no_arg, 'F'},
- {"file", no_arg, 'f'},
- {"fil", no_arg, 'f'},
- {"fi", no_arg, 'f'},
- {"groupmetadata", no_arg, 'G'},
- {"groupmetadat", no_arg, 'G'},
- {"groupmetada", no_arg, 'G'},
- {"groupmetad", no_arg, 'G'},
- {"groupmeta", no_arg, 'G'},
- {"groupmet", no_arg, 'G'},
- {"groupme", no_arg, 'G'},
- {"groupm", no_arg, 'G'},
- {"group", no_arg, 'g'},
- {"grou", no_arg, 'g'},
- {"gro", no_arg, 'g'},
- {"gr", no_arg, 'g'},
- {"links", require_arg, 'l'},
- {"link", require_arg, 'l'},
- {"lin", require_arg, 'l'},
- {"li", require_arg, 'l'},
- {"dsetmetadata", no_arg, 'D'},
- {"dsetmetadat", no_arg, 'D'},
- {"dsetmetada", no_arg, 'D'},
- {"dsetmetad", no_arg, 'D'},
- {"dsetmeta", no_arg, 'D'},
- {"dsetmet", no_arg, 'D'},
- {"dsetme", no_arg, 'D'},
- {"dsetm", no_arg, 'D'},
- {"dset", no_arg, 'd'},
- {"dse", no_arg, 'd'},
- {"ds", no_arg, 'd'},
- {"dims", require_arg, 'm'},
- {"dim", require_arg, 'm'},
- {"di", require_arg, 'm'},
- {"dtypemetadata", no_arg, 'T'},
- {"dtypemetadat", no_arg, 'T'},
- {"dtypemetada", no_arg, 'T'},
- {"dtypemetad", no_arg, 'T'},
- {"dtypemeta", no_arg, 'T'},
- {"dtypemet", no_arg, 'T'},
- {"dtypeme", no_arg, 'T'},
- {"dtypem", no_arg, 'T'},
- {"dtype", no_arg, 'T'},
- {"dtyp", no_arg, 'T'},
- {"dty", no_arg, 'T'},
- {"dt", no_arg, 'T'},
- {"object", require_arg, 'O'},
- {"objec", require_arg, 'O'},
- {"obje", require_arg, 'O'},
- {"obj", require_arg, 'O'},
- {"ob", require_arg, 'O'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'},
- {"attribute", no_arg, 'A'},
- {"attribut", no_arg, 'A'},
- {"attribu", no_arg, 'A'},
- {"attrib", no_arg, 'A'},
- {"attri", no_arg, 'A'},
- {"attr", no_arg, 'A'},
- {"att", no_arg, 'A'},
- {"at", no_arg, 'A'},
- {"enable-error-stack", no_arg, 'E'},
- {"numattrs", require_arg, 'a'},
- {"numattr", require_arg, 'a'},
- {"numatt", require_arg, 'a'},
- {"numat", require_arg, 'a'},
- {"numa", require_arg, 'a'},
- {"num", require_arg, 'a'},
- {"nu", require_arg, 'a'},
- {"freespace", no_arg, 's'},
- {"freespac", no_arg, 's'},
- {"freespa", no_arg, 's'},
- {"freesp", no_arg, 's'},
- {"frees", no_arg, 's'},
- {"free", no_arg, 's'},
- {"fre", no_arg, 's'},
- {"fr", no_arg, 's'},
- {"summary", no_arg, 'S'},
- {"summar", no_arg, 'S'},
- {"summa", no_arg, 'S'},
- {"summ", no_arg, 'S'},
- {"sum", no_arg, 'S'},
- {"su", no_arg, 'S'},
- {"s3-cred", require_arg, 'w'},
- {"hdfs-attrs", require_arg, 'H'},
- {NULL, 0, '\0'}};
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
+ {"filemetadata", no_arg, 'F'},
+ {"groupmetadata", no_arg, 'G'},
+ {"links", require_arg, 'l'},
+ {"dsetmetadata", no_arg, 'D'},
+ {"dims", require_arg, 'm'},
+ {"dtypemetadata", no_arg, 'T'},
+ {"object", require_arg, 'O'},
+ {"version", no_arg, 'V'},
+ {"attribute", no_arg, 'A'},
+ {"enable-error-stack", no_arg, 'E'},
+ {"numattrs", require_arg, 'a'},
+ {"freespace", no_arg, 's'},
+ {"summary", no_arg, 'S'},
+ {"s3-cred", require_arg, 'w'},
+ {"hdfs-attrs", require_arg, 'H'},
+ {NULL, 0, '\0'}};
static void
leave(int ret)
@@ -920,7 +837,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
struct handler_t *hand = NULL;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -959,8 +876,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
break;
case 'l':
- if (opt_arg) {
- sgroups_threshold = HDatoi(opt_arg);
+ if (H5_optarg) {
+ sgroups_threshold = HDatoi(H5_optarg);
if (sgroups_threshold < 1) {
error_msg("Invalid threshold for small groups\n");
goto error;
@@ -982,8 +899,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
break;
case 'm':
- if (opt_arg) {
- sdsets_threshold = HDatoi(opt_arg);
+ if (H5_optarg) {
+ sdsets_threshold = HDatoi(H5_optarg);
if (sdsets_threshold < 1) {
error_msg("Invalid threshold for small datasets\n");
goto error;
@@ -1005,8 +922,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
break;
case 'a':
- if (opt_arg) {
- sattrs_threshold = HDatoi(opt_arg);
+ if (H5_optarg) {
+ sattrs_threshold = HDatoi(H5_optarg);
if (sattrs_threshold < 1) {
error_msg("Invalid threshold for small # of attributes\n");
goto error;
@@ -1046,7 +963,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
/* Store object names */
for (u = 0; u < hand->obj_count; u++)
- if (NULL == (hand->obj[u] = HDstrdup(opt_arg))) {
+ if (NULL == (hand->obj[u] = HDstrdup(H5_optarg))) {
error_msg("unable to allocate memory for object name\n");
goto error;
} /* end if */
@@ -1054,7 +971,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
case 'w':
#ifdef H5_HAVE_ROS3_VFD
- if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa) < 0) {
+ if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa) < 0) {
error_msg("failed to parse S3 VFD credential info\n");
goto error;
}
@@ -1068,7 +985,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
case 'H':
#ifdef H5_HAVE_LIBHDFS
- if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa) < 0) {
+ if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa) < 0) {
error_msg("failed to parse HDFS VFD configuration info\n");
goto error;
}
@@ -1087,7 +1004,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
} /* end while */
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
goto error;
@@ -1609,7 +1526,7 @@ print_storage_summary(const iter_t *iter)
{
hsize_t total_meta = 0;
hsize_t unaccount = 0;
- double percent = 0.0f;
+ double percent = 0.0;
HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]);
HDfprintf(stdout, "File space page size: %" PRIuHSIZE " bytes\n", iter->fsp_size);
@@ -1624,7 +1541,7 @@ print_storage_summary(const iter_t *iter)
HDfprintf(stdout, " File metadata: %" PRIuHSIZE " bytes\n", total_meta);
HDfprintf(stdout, " Raw data: %" PRIuHSIZE " bytes\n", iter->dset_storage_size);
- percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f;
+ percent = ((double)iter->free_space / (double)iter->filesize) * 100.0;
HDfprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f%%\n",
iter->free_space, percent);
@@ -1811,7 +1728,7 @@ main(int argc, const char *argv[])
}
}
- fname = argv[opt_ind];
+ fname = argv[H5_optind];
/* Check for filename given */
if (fname) {
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index ac7c0ca..face2f0 100644
--- a/tools/src/misc/h5clear.c
+++ b/tools/src/misc/h5clear.c
@@ -32,7 +32,7 @@
#define H5F_ACS_SKIP_EOF_CHECK_NAME "skip_eof_check"
/* Default increment is 1 megabytes for the --increment option */
-#define DEFAULT_INCREMENT 1024 * 1024
+#define DEFAULT_INCREMENT (1024 * 1024)
static char * fname_g = NULL;
static hbool_t clear_status_flags = FALSE;
@@ -44,40 +44,11 @@ static hsize_t increment = DEFAULT_INCREMENT;
/*
* Command-line options: only publicize long options
*/
-static const char * s_opts = "hVsmzi*";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"version", no_arg, 'V'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"status", no_arg, 's'},
- {"statu", no_arg, 's'},
- {"stat", no_arg, 's'},
- {"sta", no_arg, 's'},
- {"st", no_arg, 's'},
- {"image", no_arg, 'm'},
- {"imag", no_arg, 'm'},
- {"ima", no_arg, 'm'},
- {"im", no_arg, 'm'},
- {"filesize", no_arg, 'z'},
- {"filesiz", no_arg, 'z'},
- {"filesi", no_arg, 'z'},
- {"files", no_arg, 'z'},
- {"file", no_arg, 'z'},
- {"fil", no_arg, 'z'},
- {"fi", no_arg, 'z'},
- {"increment", optional_arg, 'i'},
- {"incremen", optional_arg, 'i'},
- {"increme", optional_arg, 'i'},
- {"increm", optional_arg, 'i'},
- {"incre", optional_arg, 'i'},
- {"incr", optional_arg, 'i'},
- {"inc", optional_arg, 'i'},
- {"in", optional_arg, 'i'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hVsmzi*";
+static struct h5_long_options l_opts[] = {
+ {"help", no_arg, 'h'}, {"version", no_arg, 'V'}, {"status", no_arg, 's'},
+ {"image", no_arg, 'm'}, {"filesize", no_arg, 'z'}, {"increment", optional_arg, 'i'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -150,7 +121,7 @@ parse_command_line(int argc, const char **argv)
}
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -176,12 +147,12 @@ parse_command_line(int argc, const char **argv)
case 'i':
increment_eoa_eof = TRUE;
- if (opt_arg != NULL) {
- if (HDatoi(opt_arg) < 0) {
+ if (H5_optarg != NULL) {
+ if (HDatoi(H5_optarg) < 0) {
usage(h5tools_getprogname());
goto done;
}
- increment = (hsize_t)HDatoi(opt_arg);
+ increment = (hsize_t)HDatoi(H5_optarg);
}
break;
@@ -193,14 +164,14 @@ parse_command_line(int argc, const char **argv)
} /* end while */
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
goto error;
} /* end if */
- fname_g = HDstrdup(argv[opt_ind]);
+ fname_g = HDstrdup(argv[H5_optind]);
done:
return (0);
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index 454981d..72f47cb 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -626,7 +626,7 @@ main(int argc, char *argv[])
* Debug shared message master table.
*/
- status = H5SM_table_debug(f, addr, stdout, 0, VCOL, (unsigned)UFAIL, (unsigned)UFAIL);
+ status = H5SM_table_debug(f, addr, stdout, 0, VCOL, UINT_MAX, UINT_MAX);
}
else if (!HDmemcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c
index 6240d59..3c4f8d5 100644
--- a/tools/src/misc/h5delete.c
+++ b/tools/src/misc/h5delete.c
@@ -37,7 +37,7 @@ main(int argc, const char *argv[])
switch (argc) {
case 3:
- if (HDstrcmp(argv[1], "-f")) {
+ if (HDstrcmp(argv[1], "-f") != 0) {
usage();
return EXIT_FAILURE;
}
@@ -59,13 +59,6 @@ main(int argc, const char *argv[])
}
H5E_END_TRY;
- /* The native VOL connector does not implement the H5Fdelete() call
- * at this time, so try to remove the file via the POSIX remove(3)
- * call on failures.
- */
- if (ret < 0)
- ret = HDremove(name);
-
if (ret < 0 && !quiet)
HDfprintf(stderr, "Unable to delete storage at: %s\n", name);
diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c
index 516191c..a85ee4d 100644
--- a/tools/src/misc/h5mkgrp.c
+++ b/tools/src/misc/h5mkgrp.c
@@ -22,8 +22,8 @@
int d_status = EXIT_SUCCESS;
/* command-line options: short and long-named parameters */
-static const char * s_opts = "hlpvV";
-static struct long_options l_opts[] = {
+static const char * s_opts = "hlpvV";
+static struct h5_long_options l_opts[] = {
{"help", no_arg, 'h'}, {"latest", no_arg, 'l'}, {"parents", no_arg, 'p'},
{"verbose", no_arg, 'v'}, {"version", no_arg, 'V'}, {"vol-value", require_arg, '1'},
{"vol-name", require_arg, '2'}, {"vol-info", require_arg, '3'}, {NULL, 0, '\0'}};
@@ -140,7 +140,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t));
/* Parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
/* Display 'help' */
case 'h':
@@ -171,18 +171,18 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
case '1':
vol_info.type = VOL_BY_VALUE;
- vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
custom_fapl = TRUE;
break;
case '2':
vol_info.type = VOL_BY_NAME;
- vol_info.u.name = opt_arg;
+ vol_info.u.name = H5_optarg;
custom_fapl = TRUE;
break;
case '3':
- vol_info.info_string = opt_arg;
+ vol_info.info_string = H5_optarg;
break;
/* Bad command line argument */
@@ -193,33 +193,33 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
} /* end while */
/* Check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
}
/* Retrieve file name */
- options->fname = HDstrdup(argv[opt_ind]);
- opt_ind++;
+ options->fname = HDstrdup(argv[H5_optind]);
+ H5_optind++;
/* Check for group(s) to be created */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing group name(s)\n");
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
}
/* Allocate space for the group name pointers */
- options->ngroups = (size_t)(argc - opt_ind);
+ options->ngroups = (size_t)(argc - H5_optind);
options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *));
/* Retrieve the group names */
curr_group = 0;
- while (opt_ind < argc) {
- options->groups[curr_group] = HDstrdup(argv[opt_ind]);
+ while (H5_optind < argc) {
+ options->groups[curr_group] = HDstrdup(argv[H5_optind]);
curr_group++;
- opt_ind++;
+ H5_optind++;
}
/* Setup a custom fapl for file accesses */
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index a75f6d8..f4cef6a 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -483,7 +483,10 @@ main(int argc, char *argv[])
* file and the new file can only be a single file, reopen the new file should fail.
* There's nothing to do in this case.
*/
- H5E_BEGIN_TRY { file = H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl); }
+ H5E_BEGIN_TRY
+ {
+ file = H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl);
+ }
H5E_END_TRY;
if (file >= 0) {
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index f76a65e..f63eb84 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -32,7 +32,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
target_include_directories (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5COPY_TOOL_PLUGIN_LIB_TARGET} ${H5COPY_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index 73fbda6..e9b36fe 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -76,13 +76,13 @@
endif ()
# resultcode=2 will cause the test to skip the diff test
- if (NOT ${resultcode} EQUAL 2)
+ if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY_F-${testname}-DIFF
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname})
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -110,13 +110,13 @@
endif ()
# resultcode=2 will cause the test to skip the diff test
- if (NOT ${resultcode} EQUAL 2)
+ if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY-${testname}-DIFF
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -159,13 +159,13 @@
)
set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill)
# resultcode=2 will cause the test to skip the diff test
- if (NOT ${resultcode} EQUAL 2)
+ if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY-${testname}-DIFF
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -198,13 +198,13 @@
)
set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill)
# resultcode=2 will cause the test to skip the diff test
- if (NOT ${resultcode} EQUAL 2)
+ if (NOT "${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY_SAME-${testname}-DIFF
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname})
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -218,7 +218,7 @@
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true")
endif ()
if (last_test)
@@ -255,7 +255,7 @@
NAME H5COPY_UD-${testname}-clear-objects
COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.out.h5
)
- if (${resultcode} EQUAL 2)
+ if ("${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
@@ -318,7 +318,7 @@
NAME H5COPY_UD_ERR-${testname}-clearall-objects
COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5
)
- if (${resultcode} EQUAL 2)
+ if ("${resultcode}" STREQUAL "2")
add_test (
NAME H5COPY_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
diff --git a/tools/test/h5copy/dynlib_copy.c b/tools/test/h5copy/dynlib_copy.c
index 57de3bc..b954a22 100644
--- a/tools/test/h5copy/dynlib_copy.c
+++ b/tools/test/h5copy/dynlib_copy.c
@@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIBUD, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlibud", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIBUD, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlibud", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_dynlibud, /* The actual filter function */
}};
H5PL_type_t
@@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd
return (0);
/* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) { /*read*/
/* Subtract the original value with MULTIPLIER */
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c
index 429ad42..6898839 100644
--- a/tools/test/h5copy/h5copygentest.c
+++ b/tools/test/h5copy/h5copygentest.c
@@ -513,21 +513,21 @@ gen_obj_ref(hid_t loc_id)
* add dataset */
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
oid = H5Dcreate2(loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -539,7 +539,7 @@ gen_obj_ref(hid_t loc_id)
* add group */
oid = H5Gcreate2(loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -547,34 +547,34 @@ gen_obj_ref(hid_t loc_id)
status = H5Rcreate(&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate(&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
sid = H5Screate_simple(1, dims2, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -613,7 +613,7 @@ gen_region_ref(hid_t loc_id)
sid = H5Screate_simple(2, dims2, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -621,7 +621,7 @@ gen_region_ref(hid_t loc_id)
/* create normal dataset which is refered */
oid2 = H5Dcreate2(loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid2 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -629,7 +629,7 @@ gen_region_ref(hid_t loc_id)
/* write values to dataset */
status = H5Dwrite(oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -637,7 +637,7 @@ gen_region_ref(hid_t loc_id)
/* select elements space for reference */
status = H5Sselect_elements(sid, H5S_SELECT_SET, 4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -645,7 +645,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from elements space */
status = H5Rcreate(&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -653,7 +653,7 @@ gen_region_ref(hid_t loc_id)
/* select hyperslab space for reference */
status = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -661,7 +661,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from hyperslab space */
status = H5Rcreate(&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -671,7 +671,7 @@ gen_region_ref(hid_t loc_id)
/* Create dataspace. */
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -679,7 +679,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference dataset */
oid1 = H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid1 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -687,7 +687,7 @@ gen_region_ref(hid_t loc_id)
/* write data as region references */
status = H5Dwrite(oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -816,7 +816,7 @@ gen_extlink_trg(hid_t loc_id)
* target file */
gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -831,7 +831,7 @@ gen_extlink_trg(hid_t loc_id)
tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -864,7 +864,7 @@ gen_extlink_src(hid_t loc_id)
*------------------------------------------------------------------------*/
gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -875,7 +875,7 @@ gen_extlink_src(hid_t loc_id)
/* link to dataset */
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -883,7 +883,7 @@ gen_extlink_src(hid_t loc_id)
/* link to group */
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -892,7 +892,7 @@ gen_extlink_src(hid_t loc_id)
status =
H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -900,7 +900,7 @@ gen_extlink_src(hid_t loc_id)
/* dangling link - no obj*/
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -908,7 +908,7 @@ gen_extlink_src(hid_t loc_id)
/* dangling link - no file */
status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt
index 9349ace..f74db0f 100644
--- a/tools/test/h5diff/CMakeLists.txt
+++ b/tools/test/h5diff/CMakeLists.txt
@@ -32,7 +32,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index aeae2e4..4fcfa26 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -376,40 +376,44 @@
macro (ADD_H5_TEST resultfile resultcode)
if (HDF5_TEST_SERIAL)
- # If using memchecker add tests without using scripts
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${ARGN})
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (${resultcode})
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
- endif ()
- if (last_test)
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- else ()
- add_test (
- NAME H5DIFF-${resultfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>"
- -D "TEST_ARGS:STRING=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${resultfile}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}.txt"
- -D "TEST_APPEND=EXIT CODE:"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- if (last_test)
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- endif ()
+ ADD_SH5_TEST (${resultfile} ${resultcode} ${ARGN})
endif ()
if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL)
ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN})
endif ()
endmacro ()
+ macro (ADD_SH5_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${ARGN})
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ if (${resultcode})
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ if (last_test)
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ else ()
+ add_test (
+ NAME H5DIFF-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_file_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.txt"
+ -D "TEST_APPEND=EXIT CODE:"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ if (last_test)
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ endif ()
+ endmacro ()
+
macro (ADD_PH5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
@@ -446,7 +450,7 @@
macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- if (${resultcode} EQUAL 2)
+ if ("${resultcode}" STREQUAL "2")
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
@@ -1549,7 +1553,8 @@ ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array)
# ##############################################################################
# # dataset subsets
# ##############################################################################
-#TRILABS_227 ADD_H5_TEST (h5diff_830 1 --enable-error-stack -v ${FILE7} ${FILE8} /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;])
+#serial only
+ADD_SH5_TEST (h5diff_830 1 --enable-error-stack -v ${FILE7} ${FILE8} /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;])
# ##############################################################################
# # VDS tests
diff --git a/tools/test/h5diff/dynlib_diff.c b/tools/test/h5diff/dynlib_diff.c
index 4568ca1..433522d 100644
--- a/tools/test/h5diff/dynlib_diff.c
+++ b/tools/test/h5diff/dynlib_diff.c
@@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIBUD, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlibud", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIBUD, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlibud", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_dynlibud, /* The actual filter function */
}};
H5PL_type_t
@@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd
return (0);
/* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) { /*read*/
/* Subtract the original value with MULTIPLIER */
diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c
index b2f4e9e..118a3a7 100644
--- a/tools/test/h5diff/h5diffgentest.c
+++ b/tools/test/h5diff/h5diffgentest.c
@@ -112,7 +112,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024);
#define SPACE1_DIM2 0
/* Error macros */
-#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, __func__);
#define PROGRAM_ERROR \
do { \
AT(); \
@@ -465,15 +465,15 @@ test_basic(const char *fname1, const char *fname2, const char *fname3)
float data15[6];
float data16[6];
- data15[0] = (float)HDsqrt(-1.0F);
+ data15[0] = (float)HDsqrt(-1.0);
data15[1] = 1.0F;
- data15[2] = (float)HDsqrt(-1.0F);
+ data15[2] = (float)HDsqrt(-1.0);
data15[3] = 1.0F;
data15[4] = 1.0F;
data15[5] = 1.0F;
- data16[0] = (float)HDsqrt(-1.0F);
- data16[1] = (float)HDsqrt(-1.0F);
+ data16[0] = (float)HDsqrt(-1.0);
+ data16[1] = (float)HDsqrt(-1.0);
data16[2] = 1.0F;
data16[3] = 1.0F;
data16[4] = 1.0F;
@@ -492,19 +492,19 @@ test_basic(const char *fname1, const char *fname2, const char *fname3)
double data17[6];
double data18[6];
- data17[0] = HDsqrt(-1.0F);
- data17[1] = 1.0F;
- data17[2] = HDsqrt(-1.0F);
- data17[3] = 1.0F;
- data17[4] = 1.0F;
- data17[5] = 1.0F;
+ data17[0] = HDsqrt(-1.0);
+ data17[1] = 1.0;
+ data17[2] = HDsqrt(-1.0);
+ data17[3] = 1.0;
+ data17[4] = 1.0;
+ data17[5] = 1.0;
- data18[0] = HDsqrt(-1.0F);
- data18[1] = HDsqrt(-10000.0F);
- data18[2] = 1.0F;
- data18[3] = 1.0F;
- data18[4] = 1.0F;
- data18[5] = 1.0F;
+ data18[0] = HDsqrt(-1.0);
+ data18[1] = HDsqrt(-10000.0);
+ data18[2] = 1.0;
+ data18[3] = 1.0;
+ data18[4] = 1.0;
+ data18[5] = 1.0;
write_dset(gid1, 1, dims1, "fp17", H5T_NATIVE_DOUBLE, data17);
write_dset(gid1, 1, dims1, "fp18", H5T_NATIVE_DOUBLE, data18);
@@ -519,11 +519,11 @@ test_basic(const char *fname1, const char *fname2, const char *fname3)
float data19[6];
double data20[6];
- data19[0] = data19[1] = data19[2] = (float)HDlog(0.0F);
- data19[3] = data19[4] = data19[5] = (float)-HDlog(0.0F);
+ data19[0] = data19[1] = data19[2] = (float)HDlog(0.0);
+ data19[3] = data19[4] = data19[5] = (float)-HDlog(0.0);
- data20[0] = data20[1] = data20[2] = HDlog(0.0F);
- data20[3] = data20[4] = data20[5] = -HDlog(0.0F);
+ data20[0] = data20[1] = data20[2] = HDlog(0.0);
+ data20[3] = data20[4] = data20[5] = -HDlog(0.0);
write_dset(gid1, 1, dims1, "fp19", H5T_NATIVE_FLOAT, data19);
write_dset(gid1, 1, dims1, "fp19_COPY", H5T_NATIVE_FLOAT, data19);
@@ -547,13 +547,13 @@ test_basic(const char *fname1, const char *fname2, const char *fname3)
size_t type_size;
hid_t tid;
- buf1[0].d = HDsqrt(-1.0F);
- buf1[0].f = (float)HDsqrt(-1.0F);
- buf2[0].d = HDsqrt(-1.0F);
- buf2[0].f = (float)HDsqrt(-1.0F);
+ buf1[0].d = HDsqrt(-1.0);
+ buf1[0].f = (float)HDsqrt(-1.0);
+ buf2[0].d = HDsqrt(-1.0);
+ buf2[0].f = (float)HDsqrt(-1.0);
- buf1[1].d = HDsqrt(-1.0F);
- buf1[1].f = (float)HDsqrt(-1.0F);
+ buf1[1].d = HDsqrt(-1.0);
+ buf1[1].f = (float)HDsqrt(-1.0);
buf2[1].d = 0.0F;
buf2[1].f = 0.0F;
@@ -5009,8 +5009,6 @@ error:
H5Tclose(tid2);
}
H5E_END_TRY;
-
- return;
}
static hid_t
@@ -8058,8 +8056,6 @@ error:
H5Fclose(fid2);
}
H5E_END_TRY;
-
- return;
}
/*-------------------------------------------------------------------------
diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in
index 53e9bf4..bd27dd0 100644
--- a/tools/test/h5diff/testh5diff.sh.in
+++ b/tools/test/h5diff/testh5diff.sh.in
@@ -1205,7 +1205,7 @@ TOOLTEST h5diff_801.txt -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array
# ##############################################################################
# # dataset subsets
# ##############################################################################
-#TRILABS_227 TOOLTEST h5diff_830.txt --enable-error-stack -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;]
+#TOOLTEST h5diff_830.txt --enable-error-stack -v h5diff_dset1.h5 h5diff_dset2.h5 "/g1/array3D[0,0,0;2,2,1;2,2,2;]" "/g1/array3D[0,0,0;2,2,1;2,2,2;]"
# ##############################################################################
# VDS tests
diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt
index 242465e..a7b4846 100644
--- a/tools/test/h5dump/CMakeLists.txt
+++ b/tools/test/h5dump/CMakeLists.txt
@@ -12,7 +12,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c)
target_include_directories (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} ${H5DUMP_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index f54da76..a8984de 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -101,6 +101,8 @@
${HDF5_TOOLS_DIR}/testfiles/tfamily.ddl
${HDF5_TOOLS_DIR}/testfiles/tfill.ddl
${HDF5_TOOLS_DIR}/testfiles/tfletcher32.ddl
+ #${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.ddl #native
+ #${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.wddl #special for windows
${HDF5_TOOLS_DIR}/testfiles/tfpformat.ddl
${HDF5_TOOLS_DIR}/testfiles/tgroup-1.ddl
${HDF5_TOOLS_DIR}/testfiles/tgroup-2.ddl
@@ -128,6 +130,7 @@
${HDF5_TOOLS_DIR}/testfiles/tintsnodata.ddl
${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.ddl
${HDF5_TOOLS_DIR}/testfiles/tldouble.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/tldouble_scalar.ddl
${HDF5_TOOLS_DIR}/testfiles/tlonglinks.ddl
${HDF5_TOOLS_DIR}/testfiles/tloop-1.ddl
${HDF5_TOOLS_DIR}/testfiles/tmulti.ddl
@@ -282,6 +285,7 @@
${HDF5_TOOLS_DIR}/testfiles/tfcontents1.h5
${HDF5_TOOLS_DIR}/testfiles/tfcontents2.h5
${HDF5_TOOLS_DIR}/testfiles/tfilters.h5
+ ${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.h5
${HDF5_TOOLS_DIR}/testfiles/tfpformat.h5
${HDF5_TOOLS_DIR}/testfiles/tfvalues.h5
${HDF5_TOOLS_DIR}/testfiles/tgroup.h5
@@ -294,6 +298,7 @@
${HDF5_TOOLS_DIR}/testfiles/tintsnodata.h5
${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.h5
${HDF5_TOOLS_DIR}/testfiles/tldouble.h5
+ ${HDF5_TOOLS_DIR}/testfiles/tldouble_scalar.h5
${HDF5_TOOLS_DIR}/testfiles/tlonglinks.h5
${HDF5_TOOLS_DIR}/testfiles/tloop.h5
${HDF5_TOOLS_DIR}/testfiles/tmulti-b.h5
@@ -331,6 +336,8 @@
${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5
${HDF5_TOOLS_DIR}/testfiles/tvms.h5
${HDF5_TOOLS_DIR}/testfiles/t128bit_float.h5
+ ${HDF5_TOOLS_DIR}/testfiles/tCVE_2018_11206_fill_old.h5
+ ${HDF5_TOOLS_DIR}/testfiles/tCVE_2018_11206_fill_new.h5
${HDF5_TOOLS_DIR}/testfiles/zerodim.h5
#STD_REF_OBJ files
${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5
@@ -409,8 +416,10 @@
configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF)
#file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
#file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.wddl" "${PROJECT_BINARY_DIR}/testfiles/std/tfloatsattrs.ddl" "h5dump_std_files")
else ()
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tfloatsattrs.ddl" "h5dump_std_files")
endif ()
add_custom_target(h5dump_std_files ALL COMMENT "Copying files needed by h5dump_std tests" DEPENDS ${h5dump_std_files_list})
@@ -1085,7 +1094,9 @@
ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5)
# test for long double (some systems do not have long double)
-# ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5)
+ ADD_H5_TEST (tfloatsattrs 0 -p --enable-error-stack tfloatsattrs.h5)
+ ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5)
+ ADD_H5_TEST (tldouble_scalar 0 -p --enable-error-stack tldouble_scalar.h5)
# test for vms
ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5)
@@ -1172,6 +1183,10 @@
# test to verify HDFFV-9407: long double full precision
# ADD_H5_GREP_TEST (t128bit_float 1 "1.123456789012345" -m %.35Lg t128bit_float.h5)
+ # test to verify HDFFV-10480: out of bounds read in H5O_fill_new[old]_decode
+ ADD_H5_TEST (tCVE_2018_11206_fill_old 1 tCVE_2018_11206_fill_old.h5)
+ ADD_H5_TEST (tCVE_2018_11206_fill_new 1 tCVE_2018_11206_fill_new.h5)
+
##############################################################################
### P L U G I N T E S T S
##############################################################################
diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake
index 014790f..01834b3 100644
--- a/tools/test/h5dump/CMakeVFDTests.cmake
+++ b/tools/test/h5dump/CMakeVFDTests.cmake
@@ -26,7 +26,7 @@ set (VFD_H5DUMP_LIST
family
)
-if (DIRECT_VFD)
+if (H5_HAVE_DIRECT)
set (VFD_H5DUMP_LIST ${VFD_H5DUMP_LIST} direct)
endif ()
diff --git a/tools/test/h5dump/dynlib_dump.c b/tools/test/h5dump/dynlib_dump.c
index 4568ca1..433522d 100644
--- a/tools/test/h5dump/dynlib_dump.c
+++ b/tools/test/h5dump/dynlib_dump.c
@@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIBUD, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlibud", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIBUD, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlibud", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_dynlibud, /* The actual filter function */
}};
H5PL_type_t
@@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd
return (0);
/* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) { /*read*/
/* Subtract the original value with MULTIPLIER */
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 15d3eef..e74054c 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -116,6 +116,7 @@
#define FILE86 "err_attr_dspace.h5"
#define FILE87 "tintsnodata.h5"
#define FILE88 "tldouble_scalar.h5"
+#define FILE89 "tfloatsattrs.h5"
/*-------------------------------------------------------------------------
* prototypes
@@ -154,13 +155,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIBUD, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlibud", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIBUD, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlibud", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_dynlibud, /* The actual filter function */
}};
/* A UD link traversal function. Shouldn't actually be called. */
@@ -198,8 +199,8 @@ const H5L_class_t UD_link_class[1] = {{
#define DIM1 20
#define DIM2 10
-#define CDIM1 DIM1 / 2
-#define CDIM2 DIM2 / 2
+#define CDIM1 (DIM1 / 2)
+#define CDIM2 (DIM2 / 2)
#define RANK 2
/* Dataspace of 0 dimension size */
@@ -396,6 +397,15 @@ typedef struct s1_t {
#define F83_RANK 1
#define F83_ARRAYDIM 3
+/* "FILE89" macros */
+#define F89_XDIM 8
+#define F89_DATASETF32 "DS32BITS"
+#define F89_YDIM32 32
+#define F89_DATASETF64 "DS64BITS"
+#define F89_YDIM64 64
+#define F89_DATASETF128 "DS128BITS"
+#define F89_YDIM128 128
+
static void
gent_group(void)
{
@@ -5375,7 +5385,10 @@ make_dset(hid_t loc_id, const char *name, hid_t sid, hid_t tid, hid_t dcpl, void
return 0;
out:
- H5E_BEGIN_TRY { H5Dclose(dsid); }
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(dsid);
+ }
H5E_END_TRY;
return -1;
}
@@ -6356,7 +6369,7 @@ gent_ldouble_scalar(void)
if ((sid = H5Screate(H5S_SCALAR)) < 0)
goto error;
- if ((tid = H5Tarray_create(H5T_NATIVE_LDOUBLE, 1, dims)) < 0)
+ if ((tid = H5Tarray_create2(H5T_NATIVE_LDOUBLE, 1, dims)) < 0)
goto error;
if (H5Tget_size(tid) == 0)
@@ -6548,7 +6561,6 @@ out:
H5Fclose(fid);
}
H5E_END_TRY;
- return;
}
/*-------------------------------------------------------------------------
@@ -6734,7 +6746,6 @@ out:
H5Fclose(fid);
}
H5E_END_TRY;
- return;
}
/*-------------------------------------------------------------------------
@@ -6994,7 +7005,6 @@ out:
H5Fclose(fid);
}
H5E_END_TRY;
- return;
}
/*-------------------------------------------------------------------------
@@ -10209,6 +10219,152 @@ gent_intsattrs(void)
HDfree(asetdbl);
}
+/*-------------------------------------------------------------------------
+ * Function: gent_floatsattrs
+ *
+ * Purpose: Generate a file to be used in the h5dump tests.
+ * Three datasets of 4, 8 and 16 bytes of float types are created.
+ * Fill them with raw data such that no bit will be all zero in a dataset.
+ *-------------------------------------------------------------------------
+ */
+static void
+gent_floatsattrs(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t attr = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t aspace = H5I_INVALID_HID;
+ hsize_t dims[2], adims[1];
+
+ float ** dset32 = NULL;
+ double ** dset64 = NULL;
+ long double **dset128 = NULL;
+
+ float * aset32 = NULL;
+ double * aset64 = NULL;
+ long double *aset128 = NULL;
+
+ float val32bits;
+ double val64bits;
+ long double val128bits;
+
+ unsigned int i, j;
+
+ /* Create arrays */
+ H5TEST_ALLOCATE_2D_ARRAY(dset32, float, F89_XDIM, F89_YDIM32);
+ H5TEST_ALLOCATE_2D_ARRAY(dset64, double, F89_XDIM, F89_YDIM64);
+ H5TEST_ALLOCATE_2D_ARRAY(dset128, long double, F89_XDIM, F89_YDIM128);
+
+ aset32 = HDcalloc(F89_XDIM * F89_YDIM32, sizeof(float));
+ aset64 = HDcalloc(F89_XDIM * F89_YDIM64, sizeof(double));
+ aset128 = HDcalloc(F89_XDIM * F89_YDIM128, sizeof(long double));
+
+ fid = H5Fcreate(FILE89, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+ if ((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0)
+ goto error;
+
+ if (H5Tget_size(tid) == 0)
+ goto error;
+
+ /* Dataset of 32 bits float */
+ dims[0] = F89_XDIM;
+ dims[1] = F89_YDIM32;
+ space = H5Screate_simple(2, dims, NULL);
+ dataset = H5Dcreate2(fid, F89_DATASETF32, H5T_IEEE_F32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ val32bits = (float)F89_YDIM32;
+ for (i = 0; i < dims[0]; i++) {
+ dset32[i][0] = val32bits;
+ aset32[i * dims[1]] = dset32[i][0];
+ for (j = 1; j < dims[1]; j++) {
+ dset32[i][j] = (float)(j * dims[0] + i) / (float)F89_YDIM32;
+ aset32[i * dims[1] + j] = dset32[i][j];
+ }
+ val32bits -= (float)1;
+ }
+
+ H5Dwrite(dataset, H5T_IEEE_F32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]);
+ /* Attribute of 32 bits float */
+ adims[0] = F89_XDIM * F89_YDIM32;
+ aspace = H5Screate_simple(1, adims, NULL);
+ attr = H5Acreate2(dataset, F89_DATASETF32, H5T_IEEE_F32LE, aspace, H5P_DEFAULT, H5P_DEFAULT);
+ H5Awrite(attr, H5T_IEEE_F32LE, aset32);
+ H5Aclose(attr);
+ H5Sclose(aspace);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+ /* Dataset of 64 bits double */
+ dims[0] = F89_XDIM;
+ dims[1] = F89_YDIM64;
+ space = H5Screate_simple(2, dims, NULL);
+ dataset = H5Dcreate2(fid, F89_DATASETF64, H5T_IEEE_F64LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ val64bits = (double)F89_YDIM64;
+ for (i = 0; i < dims[0]; i++) {
+ dset64[i][0] = val64bits;
+ aset64[i * dims[1]] = dset64[i][0];
+ for (j = 1; j < dims[1]; j++) {
+ dset64[i][j] = (double)(j * dims[0] + i) / (double)F89_YDIM64;
+ aset64[i * dims[1] + j] = dset64[i][j];
+ }
+ val64bits -= (double)1;
+ }
+
+ H5Dwrite(dataset, H5T_IEEE_F64LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]);
+ /* Attribute of 64 bits double */
+ adims[0] = F89_XDIM * F89_YDIM64;
+ aspace = H5Screate_simple(1, adims, NULL);
+ attr = H5Acreate2(dataset, F89_DATASETF64, H5T_IEEE_F64LE, aspace, H5P_DEFAULT, H5P_DEFAULT);
+ H5Awrite(attr, H5T_IEEE_F64LE, aset64);
+ H5Aclose(attr);
+ H5Sclose(aspace);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+ /* Dataset of 128 bits long double */
+ dims[0] = F89_XDIM;
+ dims[1] = F89_YDIM128;
+ space = H5Screate_simple(2, dims, NULL);
+ dataset = H5Dcreate2(fid, F89_DATASETF128, tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ val128bits = (long double)F89_YDIM128;
+ for (i = 0; i < dims[0]; i++) {
+ dset128[i][0] = val128bits;
+ aset128[i * dims[1]] = dset128[i][0];
+ for (j = 1; j < dims[1]; j++) {
+ dset128[i][j] = (long double)(j * dims[0] + i) / (long double)F89_YDIM128;
+ aset128[i * dims[1] + j] = dset128[i][j];
+ }
+ val128bits -= (long double)1;
+ }
+
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset128[0]);
+ /* Attribute of 128 bits long double */
+ adims[0] = F89_XDIM * F89_YDIM128;
+ aspace = H5Screate_simple(1, adims, NULL);
+ attr = H5Acreate2(dataset, F89_DATASETF128, tid, aspace, H5P_DEFAULT, H5P_DEFAULT);
+ H5Awrite(attr, tid, aset128);
+ H5Aclose(attr);
+ H5Sclose(aspace);
+ H5Sclose(space);
+ H5Dclose(dataset);
+
+error:
+ H5Fclose(fid);
+
+ HDfree(dset32);
+ HDfree(dset64);
+ HDfree(dset128);
+
+ HDfree(aset32);
+ HDfree(aset64);
+ HDfree(aset128);
+}
+
static void
gent_bitnopaquefields(void)
{
@@ -10921,7 +11077,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd
return (0);
/* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) { /*read*/
/* Subtract the original value with MULTIPLIER */
@@ -11138,6 +11294,7 @@ main(void)
gent_aindices();
gent_longlinks();
gent_ldouble();
+ gent_ldouble_scalar();
gent_binary();
gent_bigdims();
gent_hyperslab();
@@ -11161,6 +11318,7 @@ main(void)
gent_compound_ints();
gent_intattrscalars();
gent_intsattrs();
+ gent_floatsattrs();
gent_bitnopaquefields();
gent_nodata();
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in
index 8f478b0..9464302 100644
--- a/tools/test/h5dump/testh5dump.sh.in
+++ b/tools/test/h5dump/testh5dump.sh.in
@@ -132,6 +132,7 @@ $SRC_H5DUMP_TESTFILES/tfamily00010.h5
$SRC_H5DUMP_TESTFILES/tfcontents1.h5
$SRC_H5DUMP_TESTFILES/tfcontents2.h5
$SRC_H5DUMP_TESTFILES/tfilters.h5
+$SRC_H5DUMP_TESTFILES/tfloatsattrs.h5
$SRC_H5DUMP_TESTFILES/tfpformat.h5
$SRC_H5DUMP_TESTFILES/tfvalues.h5
$SRC_H5DUMP_TESTFILES/tgroup.h5
@@ -143,6 +144,7 @@ $SRC_H5DUMP_TESTFILES/tintsattrs.h5
$SRC_H5DUMP_TESTFILES/tints4dims.h5
$SRC_H5DUMP_TESTFILES/tlarge_objname.h5
$SRC_H5DUMP_TESTFILES/tldouble.h5
+$SRC_H5DUMP_TESTFILES/tldouble_scalar.h5
$SRC_H5DUMP_TESTFILES/tlonglinks.h5
$SRC_H5DUMP_TESTFILES/tloop.h5
$SRC_H5DUMP_TESTFILES/tmulti-b.h5
@@ -180,6 +182,8 @@ $SRC_H5DUMP_TESTFILES/tvlenstr_array.h5
$SRC_H5DUMP_TESTFILES/tvlstr.h5
$SRC_H5DUMP_TESTFILES/tvms.h5
$SRC_H5DUMP_TESTFILES/err_attr_dspace.h5
+$SRC_H5DUMP_TESTFILES/tCVE_2018_11206_fill_old.h5
+$SRC_H5DUMP_TESTFILES/tCVE_2018_11206_fill_new.h5
"
LIST_OTHER_TEST_FILES="
@@ -262,6 +266,7 @@ $SRC_H5DUMP_TESTFILES/textlink.ddl
$SRC_H5DUMP_TESTFILES/tfamily.ddl
$SRC_H5DUMP_TESTFILES/tfill.ddl
$SRC_H5DUMP_TESTFILES/tfletcher32.ddl
+$SRC_H5DUMP_TESTFILES/tfloatsattrs.ddl
$SRC_H5DUMP_TESTFILES/tfpformat.ddl
$SRC_H5DUMP_TESTFILES/tgroup-1.ddl
$SRC_H5DUMP_TESTFILES/tgroup-2.ddl
@@ -288,6 +293,7 @@ $SRC_H5DUMP_TESTFILES/tints4dimsStride2.ddl
$SRC_H5DUMP_TESTFILES/tintsattrs.ddl
$SRC_H5DUMP_TESTFILES/tlarge_objname.ddl
$SRC_H5DUMP_TESTFILES/tldouble.ddl
+$SRC_H5DUMP_TESTFILES/tldouble_scalar.ddl
$SRC_H5DUMP_TESTFILES/tlonglinks.ddl
$SRC_H5DUMP_TESTFILES/tloop-1.ddl
$SRC_H5DUMP_TESTFILES/tmulti.ddl
@@ -868,6 +874,35 @@ TOOLTEST5() {
fi
}
+# same as TOOLTEST1 but expects h5dump to fail
+#
+TOOLTEST_FAIL() {
+
+ infile=$1
+ expect="$TESTDIR/`basename $1 exp`.ddl"
+ actual="$TESTDIR/`basename $1 .exp`.out"
+
+ # Run test.
+ TESTING $DUMPER $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $DUMPER_BIN "$@" $infile
+ ) >&$actual
+ RET=$?
+ # Segfault occurred
+ if [ $RET == 139 ] ; then
+ nerrors="`expr $nerrors + 1`"
+ echo "*FAILED - test on $infile failed with segmentation fault"
+ # Should fail but didn't
+ elif [ $RET == 0 ] ; then
+ nerrors="`expr $nerrors + 1`"
+ echo "*FAILED - test on $infile did not fail as expected"
+ else
+ echo " PASSED"
+ fi
+
+}
+
# ADD_HELP_TEST
TOOLTEST_HELP() {
@@ -1351,7 +1386,9 @@ TOOLTEST tgrpnullspace.ddl -p --enable-error-stack tgrpnullspace.h5
TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5
# test for long double (some systems do not have long double)
-#TOOLTEST tldouble.ddl --enable-error-stack tldouble.h5
+TOOLTEST tfloatsattrs.ddl -p --enable-error-stack tfloatsattrs.h5
+TOOLTEST tldouble.ddl --enable-error-stack tldouble.h5
+TOOLTEST tldouble_scalar.ddl -p --enable-error-stack tldouble_scalar.h5
# test for vms
TOOLTEST tvms.ddl --enable-error-stack tvms.h5
@@ -1445,6 +1482,10 @@ TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5
# test to verify HDFFV-9407: long double full precision
#GREPTEST OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
+# test to verify HDFFV-10480: out of bounds read in H5O_fill_new[old]_decode
+TOOLTEST_FAIL tCVE_2018_11206_fill_old.h5
+TOOLTEST_FAIL tCVE_2018_11206_fill_new.h5
+
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index 340e31b..e49125b 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -64,8 +64,8 @@ main(void)
double b64r3[5][3][4];
double row8[3], col8[4], pln8[5];
- double rowo8 = 11.0F, colo8 = 21.0F, plno8 = 51.0F;
- double rowi8 = 1.0F, coli8 = 2.0F, plni8 = 5.0F;
+ double rowo8 = 11.0, colo8 = 21.0, plno8 = 51.0;
+ double rowi8 = 1.0, coli8 = 2.0, plni8 = 5.0;
/* Initialize machine endian */
volatile uint32_t ibyte = 0x01234567;
diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c
index a9b4437..fd21d6c 100644
--- a/tools/test/h5jam/getub.c
+++ b/tools/test/h5jam/getub.c
@@ -21,9 +21,9 @@ void parse_command_line(int argc, const char *argv[]);
#define PROGRAM_NAME "getub"
char *nbytes = NULL;
-static const char * s_opts = "c:"; /* add more later ? */
-static struct long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */
- {NULL, 0, '\0'}};
+static const char * s_opts = "c:"; /* add more later ? */
+static struct h5_long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -57,10 +57,10 @@ parse_command_line(int argc, const char *argv[])
int opt;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'c':
- nbytes = HDstrdup(opt_arg);
+ nbytes = HDstrdup(H5_optarg);
break;
case '?':
default:
@@ -69,7 +69,7 @@ parse_command_line(int argc, const char *argv[])
} /* end switch */
} /* end while */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
HDexit(EXIT_FAILURE);
@@ -100,16 +100,16 @@ main(int argc, const char *argv[])
goto error;
} /* end if */
- if (argc <= (opt_ind)) {
+ if (argc <= (H5_optind)) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
goto error;
} /* end if */
- filename = HDstrdup(argv[opt_ind]);
+ filename = HDstrdup(argv[H5_optind]);
size = 0;
- if (EOF == (res = sscanf(nbytes, "%u", &size))) {
+ if (EOF == (res = HDsscanf(nbytes, "%u", &size))) {
/* fail */
error_msg("missing file name\n");
usage(h5tools_getprogname());
diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c
index 45ff0b0..5632cc0 100644
--- a/tools/test/h5jam/h5jamgentest.c
+++ b/tools/test/h5jam/h5jamgentest.c
@@ -31,24 +31,7 @@
#define UBTXT3 "u511.txt"
#define UBTXT4 "u512.txt"
#define UBTXT5 "u513.txt"
-/* not used yet
-#define UBTXT6 "u1023.txt"
-#define UBTXT7 "u1024.txt"
-#define UBTXT8 "u1025.txt"
-#define UBTXT9 "u2047.txt"
-#define UBTXT10 "u2048.txt"
-#define UBTXT11 "u2049.txt"
-#define UBBIN1 "u0.dat"
-#define UBBIN2 "u10.dat"
-#define UBBIN3 "u511.dat"
-#define UBBIN4 "u512.dat"
-#define UBBIN5 "u513.dat"
-*/
-/* not used yet
-#define FILE1 "tnull.h5"
-#define FILE2 "tnullwithub.h5"
-*/
/* tall is same as dumper test */
#define FILE7 "tall.h5"
#define FILE8 "twithub.h5"
@@ -66,24 +49,13 @@ char pattern[11] = "abcdefghij";
#define BUF_SIZE 1024
-/* Element selection information */
-
-typedef enum { RED, GREEN, BLUE, WHITE, BLACK } enumtype;
-
-/* Compound datatype */
-typedef struct s1_t {
- unsigned int a;
- unsigned int b;
- float c;
-} s1_t;
-
/* A UD link traversal function. Shouldn't actually be called. */
static hid_t
UD_traverse(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED cur_group,
const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t H5_ATTR_UNUSED lapl_id,
hid_t H5_ATTR_UNUSED dxpl_id)
{
- return -1;
+ return H5I_INVALID_HID;
}
#define MY_LINKCLASS 187
@@ -115,261 +87,340 @@ g1.2.1 : slink
g2 : dset2.1 dset2.2 udlink
*/
-
-static void
+static herr_t
gent_ub(const char *filename, size_t ub_size, size_t ub_fill)
{
- hid_t fid, group, attr, dataset, space;
- hid_t create_plist;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t group = H5I_INVALID_HID;
+ hid_t attr = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t create_plist = H5I_INVALID_HID;
hsize_t dims[2];
int data[2][2], dset1[10][10], dset2[20];
char buf[BUF_SIZE];
int i, j;
size_t u;
float dset2_1[10], dset2_2[3][5];
- int fd;
- char * bp;
+ int fd = -1;
if (ub_size > 0) {
- create_plist = H5Pcreate(H5P_FILE_CREATE);
- H5Pset_userblock(create_plist, (hsize_t)ub_size);
- fid = H5Fcreate(filename, H5F_ACC_TRUNC, create_plist, H5P_DEFAULT);
+ if ((create_plist = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ goto error;
+ if (H5Pset_userblock(create_plist, (hsize_t)ub_size) < 0)
+ goto error;
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, create_plist, H5P_DEFAULT)) < 0)
+ goto error;
}
else {
- fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
}
- /* create groups */
- group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ /* Create groups */
+ if ((group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- /* root attributes */
- group = H5Gopen2(fid, "/", H5P_DEFAULT);
+ /* Root attributes */
+ if ((group = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0)
+ goto error;
dims[0] = 10;
- space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "abcdefghi");
- H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
- H5Sclose(space);
- H5Aclose(attr);
-
- dims[0] = 2;
- dims[1] = 2;
- space = H5Screate_simple(2, dims, NULL);
- attr = H5Acreate2(group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (HDsprintf(buf, "abcdefghi") < 0)
+ goto error;
+ if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
+
+ dims[0] = 2;
+ dims[1] = 2;
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
data[0][0] = 0;
data[0][1] = 1;
data[1][0] = 2;
data[1][1] = 3;
- H5Awrite(attr, H5T_NATIVE_INT, data);
- H5Sclose(space);
- H5Aclose(attr);
+ if (H5Awrite(attr, H5T_NATIVE_INT, data) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
- H5Gclose(group);
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gopen2(fid, "/g1/g1.1", H5P_DEFAULT);
+ if ((group = H5Gopen2(fid, "/g1/g1.1", H5P_DEFAULT)) < 0)
+ goto error;
- /* dset1.1.1 */
+ /* Dataset 1.1.1 */
dims[0] = 10;
dims[1] = 10;
- space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 10; i++)
for (j = 0; j < 10; j++)
dset1[i][j] = j * i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
- H5Sclose(space);
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
- /* attributes of dset1.1.1 */
+ /* Attributes of dset1.1.1 */
dims[0] = 27;
- space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "1st attribute of dset1.1.1");
- H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
- H5Sclose(space);
- H5Aclose(attr);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (HDsprintf(buf, "1st attribute of dset1.1.1") < 0)
+ goto error;
+ if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
dims[0] = 27;
- space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "2nd attribute of dset1.1.1");
- H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
- H5Sclose(space);
- H5Aclose(attr);
-
- H5Dclose(dataset);
-
- /* dset1.1.2 */
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (HDsprintf(buf, "2nd attribute of dset1.1.1") < 0)
+ goto error;
+ if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
+
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ /* Dataset 1.1.2 */
dims[0] = 20;
- space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 20; i++)
dset2[i] = i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
- H5Sclose(space);
- H5Dclose(dataset);
-
- H5Gclose(group);
-
- /* external link */
- H5Lcreate_external("somefile", "somepath", fid, "/g1/g1.2/extlink", H5P_DEFAULT, H5P_DEFAULT);
-
- /* soft link */
- group = H5Gopen2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT);
- H5Lcreate_soft("somevalue", group, "slink", H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
-
- group = H5Gopen2(fid, "/g2", H5P_DEFAULT);
-
- /* dset2.1 */
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ if (H5Gclose(group) < 0)
+ goto error;
+
+ /* External link */
+ if (H5Lcreate_external("somefile", "somepath", fid, "/g1/g1.2/extlink", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ goto error;
+
+ /* Soft link */
+ if ((group = H5Gopen2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Lcreate_soft("somevalue", group, "slink", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
+
+ if ((group = H5Gopen2(fid, "/g2", H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Dataset 2.1 */
dims[0] = 10;
- space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 10; i++)
dset2_1[i] = (float)((float)i * 0.1F + 1.0F);
- H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1);
- H5Sclose(space);
- H5Dclose(dataset);
-
- /* dset2.2 */
+ if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ /* Dataset 2.2 */
dims[0] = 3;
dims[1] = 5;
- space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 3; i++)
for (j = 0; j < 5; j++)
dset2_2[i][j] = (float)(((float)i + 1.0F) * (float)j * 0.1F);
- H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2);
- H5Sclose(space);
- H5Dclose(dataset);
-
- H5Gclose(group);
-
- /* user-defined link */
- H5Lregister(UD_link_class);
- H5Lcreate_ud(fid, "/g2/udlink", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT);
-
- H5Fclose(fid);
+ if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ if (H5Gclose(group) < 0)
+ goto error;
+
+ /* User-defined link */
+ if (H5Lregister(UD_link_class) < 0)
+ goto error;
+ if (H5Lcreate_ud(fid, "/g2/udlink", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) <
+ 0)
+ goto error;
+
+ /* MUST close the file ID before the user block code or you risk tripping
+ * over file locking issues.
+ */
+ if (H5Fclose(fid) < 0)
+ goto error;
/* If a user block is being used, write to it here */
if (ub_size > 0) {
- HDassert(ub_size <= BUF_SIZE);
+ char *bp;
- fd = HDopen(filename, O_RDWR);
- HDassert(fd >= 0);
+ if (ub_size > BUF_SIZE)
+ goto error;
- /* fill buf with pattern */
+ if ((fd = HDopen(filename, O_RDWR)) < 0)
+ goto error;
+
+ /* Fill buf with pattern */
HDmemset(buf, '\0', ub_size);
bp = buf;
for (u = 0; u < ub_fill; u++)
*bp++ = pattern[u % 10];
- HDwrite(fd, buf, ub_size);
+ if (HDwrite(fd, buf, ub_size) < 0)
+ goto error;
+
+ if (HDclose(fd) < 0)
+ goto error;
+ }
+ return SUCCEED;
+
+error:
+ if (fd >= 0)
HDclose(fd);
+
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ H5Gclose(group);
+ H5Aclose(attr);
+ H5Dclose(dataset);
+ H5Sclose(space);
+ H5Pclose(create_plist);
}
+ H5E_END_TRY;
+
+ return FAIL;
}
-static void
+/* Creates a simple (i.e., not HDF5) text file and fills it with a pattern */
+static herr_t
create_textfile(const char *name, size_t size)
{
- char * buf;
- int fd;
+ char * buf = NULL;
+ int fd = -1;
size_t i;
- char * bp;
+ char * bp = NULL;
- fd = HDcreat(name, 0777);
- HDassert(fd >= 0);
- buf = (char *)HDcalloc(size, (size_t)1);
- HDassert(buf);
+ if ((fd = HDcreat(name, 0777)) < 0)
+ goto error;
+ if (NULL == (buf = (char *)HDcalloc(size, 1)))
+ goto error;
- /* fill buf with pattern */
+ /* Fill buf with pattern */
bp = buf;
for (i = 0; i < size; i++)
*bp++ = pattern[i % 10];
- HDwrite(fd, buf, size);
+ if (HDwrite(fd, buf, size) < 0)
+ goto error;
HDfree(buf);
-
HDclose(fd);
-}
-
-#ifdef notdef
-/* not used yet */
-void
-create_binfile(char *name, off_t size)
-{
- char *buf;
- int fd;
- int i;
- char *bp;
- fd = creat(name, 0777);
- HDassert(fd >= 0);
+ return SUCCEED;
- buf = HDcalloc(size, 1);
- HDassert(buf);
-
- /* fill buf with pattern */
- bp = buf;
- for (i = 0; i < size; i++)
- *bp++ = (char)i & 0xff;
-
- HDwrite(fd, buf, size);
+error:
+ HDfree(buf);
+ if (fd >= 0)
+ HDclose(fd);
- HDclose(fd);
+ return FAIL;
}
-#endif
/*-------------------------------------------------------------------------
* Function: main
*
*-------------------------------------------------------------------------
*/
-
int
main(void)
{
-
- /*
- create_textfile(UBTXT1, (size_t)0);
- */
- create_textfile(UBTXT2, (size_t)10);
- create_textfile(UBTXT3, (size_t)511);
- create_textfile(UBTXT4, (size_t)512);
- create_textfile(UBTXT5, (size_t)513);
- /*
- create_textfile(UBTXT6, (size_t)1023);
- create_textfile(UBTXT7, (size_t)1024);
- create_textfile(UBTXT8, (size_t)1025);
- create_textfile(UBTXT9, (size_t)2047);
- create_textfile(UBTXT10, (size_t)2048);
- create_textfile(UBTXT11, (size_t)2049);
-
- create_binfile(UBBIN1, (off_t)0);
- create_binfile(UBBIN2, (off_t)10);
- create_binfile(UBBIN3, (off_t)511);
- create_binfile(UBBIN4, (off_t)512);
- create_binfile(UBBIN5, (off_t)513);
-
- */
- gent_ub(FILE7, (size_t)0, (size_t)0);
- gent_ub(FILE8, (size_t)512, HDstrlen(pattern));
- gent_ub(FILE9, (size_t)1024, (size_t)513);
-
- return 0;
+ if (create_textfile(UBTXT2, 10) < 0)
+ goto error;
+ if (create_textfile(UBTXT3, 511) < 0)
+ goto error;
+ if (create_textfile(UBTXT4, 512) < 0)
+ goto error;
+ if (create_textfile(UBTXT5, 513) < 0)
+ goto error;
+
+ if (gent_ub(FILE7, 0, 0) < 0)
+ goto error;
+ if (gent_ub(FILE8, 512, HDstrlen(pattern)) < 0)
+ goto error;
+ if (gent_ub(FILE9, 1024, 513) < 0)
+ goto error;
+
+ return EXIT_SUCCESS;
+
+error:
+ HDfprintf(stderr, "h5jam test generator FAILED\n");
+ return EXIT_FAILURE;
}
diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c
index 45d4af4..e6769ec 100644
--- a/tools/test/h5jam/tellub.c
+++ b/tools/test/h5jam/tellub.c
@@ -24,8 +24,8 @@
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "h";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}};
+static const char * s_opts = "h";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -61,7 +61,7 @@ parse_command_line(int argc, const char *argv[])
int opt;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -75,7 +75,7 @@ parse_command_line(int argc, const char *argv[])
}
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
@@ -118,14 +118,14 @@ main(int argc, const char *argv[])
/* enable error reporting if command line option */
h5tools_error_report();
- if (argc <= (opt_ind)) {
+ if (argc <= (H5_optind)) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
goto done;
}
- ifname = HDstrdup(argv[opt_ind]);
+ ifname = HDstrdup(argv[H5_optind]);
testval = H5Fis_accessible(ifname, H5P_DEFAULT);
diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt
index ee223b8..ba6e468 100644
--- a/tools/test/h5ls/CMakeLists.txt
+++ b/tools/test/h5ls/CMakeLists.txt
@@ -12,7 +12,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c)
target_include_directories (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5LS_TOOL_PLUGIN_LIB_TARGET} ${H5LS_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake
index 98435ce..cd2f764 100644
--- a/tools/test/h5ls/CMakeTests.cmake
+++ b/tools/test/h5ls/CMakeTests.cmake
@@ -139,7 +139,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
@@ -164,7 +164,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake
index e8b11bf..e93e7e7 100644
--- a/tools/test/h5ls/CMakeTestsVDS.cmake
+++ b/tools/test/h5ls/CMakeTestsVDS.cmake
@@ -85,7 +85,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
@@ -112,7 +112,7 @@
ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- if (${resultcode} EQUAL 1)
+ if ("${resultcode}" STREQUAL "1")
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
diff --git a/tools/test/h5ls/dynlib_ls.c b/tools/test/h5ls/dynlib_ls.c
index 4568ca1..433522d 100644
--- a/tools/test/h5ls/dynlib_ls.c
+++ b/tools/test/h5ls/dynlib_ls.c
@@ -25,13 +25,13 @@ static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const un
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIBUD[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIBUD, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlibud", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIBUD, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlibud", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_dynlibud, /* The actual filter function */
}};
H5PL_type_t
@@ -70,7 +70,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, const unsigned int *cd
return (0);
/* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) { /*read*/
/* Subtract the original value with MULTIPLIER */
diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt
index 26db85a..0b90750 100644
--- a/tools/test/h5repack/CMakeLists.txt
+++ b/tools/test/h5repack/CMakeLists.txt
@@ -54,13 +54,13 @@ if (BUILD_SHARED_LIBS)
add_library (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} ${H5REPACK_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
add_library (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c)
target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED)
- target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} ${H5REPACK_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index 528ee1c..037287d 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -51,7 +51,8 @@
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_named_dtypes.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nested_8bit_enum.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nested_8bit_enum_deflated.h5
- ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_CVE-2018-17432.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_CVE-2018-14460.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nbit.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_objs.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_refs.h5
@@ -1551,10 +1552,15 @@
ADD_H5_TEST (HDFFV-7840 "TEST" h5diff_attr1.h5)
# test CVE-2018-17432 fix
- set (arg h5repack_HDFFV-10590_CVE-2018-17432.h5 h5repack_HDFFV-10590_CVE-2018-17432_out.h5 --low=1 --high=2 -f GZIP=8 -l dset1:CHUNK=5x6)
+ set (arg h5repack_CVE-2018-17432.h5 h5repack__CVE-2018-17432_out.h5 --low=1 --high=2 -f GZIP=8 -l dset1:CHUNK=5x6)
set (TESTTYPE "TEST")
ADD_H5_FILTER_TEST (HDFFV-10590 "" ${TESTTYPE} 1 ${arg})
+# test CVE-2018-14460 fix
+ set (arg h5repack_CVE-2018-14460.h5 h5repack_CVE-2018-14460_out.h5)
+ set (TESTTYPE "TEST")
+ ADD_H5_FILTER_TEST (HDFFV-11223 "" ${TESTTYPE} 1 ${arg})
+
# tests for metadata block size option ('-M')
ADD_H5_TEST_META (meta_short h5repack_layout.h5 -M 8192)
ADD_H5_TEST_META (meta_long h5repack_layout.h5 --metadata_block_size=8192)
diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake
index 74471f8..e26941b 100644
--- a/tools/test/h5repack/CMakeVFDTests.cmake
+++ b/tools/test/h5repack/CMakeVFDTests.cmake
@@ -26,7 +26,7 @@ set (VFD_LIST
family
)
-if (DIRECT_VFD)
+if (H5_HAVE_DIRECT)
set (VFD_LIST ${VFD_LIST} direct)
endif ()
diff --git a/tools/test/h5repack/dynlib_rpk.c b/tools/test/h5repack/dynlib_rpk.c
index e64e67b..b228344 100644
--- a/tools/test/h5repack/dynlib_rpk.c
+++ b/tools/test/h5repack/dynlib_rpk.c
@@ -27,13 +27,13 @@ static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const uns
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIB1[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIB1, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlib1", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIB1, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlib1", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_dynlib1, /* The actual filter function */
}};
H5PL_type_t
diff --git a/tools/test/h5repack/dynlib_vrpk.c b/tools/test/h5repack/dynlib_vrpk.c
index 2db97da..5eac4f2 100644
--- a/tools/test/h5repack/dynlib_vrpk.c
+++ b/tools/test/h5repack/dynlib_vrpk.c
@@ -27,13 +27,13 @@ static size_t H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, const uns
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DYNLIB4[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIB4, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlib4", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DYNLIB4, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dynlib4", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_dynlib4, /* The actual filter function */
}};
H5PL_type_t
diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in
index f881b0a..3756a95 100644
--- a/tools/test/h5repack/h5repack.sh.in
+++ b/tools/test/h5repack/h5repack.sh.in
@@ -129,7 +129,8 @@ $SRC_H5REPACK_TESTFILES/h5repack_paged_persist.h5
########h5diff/testfile########
$SRC_H5DIFF_TESTFILES/h5diff_attr1.h5
########test#HDFFV-10590########
-$SRC_H5REPACK_TESTFILES/h5repack_HDFFV-10590_CVE-2018-17432.h5
+$SRC_H5REPACK_TESTFILES/h5repack_CVE-2018-17432.h5
+$SRC_H5REPACK_TESTFILES/h5repack_CVE-2018-14460.h5
########tools/testfiles#for#external#links########
$SRC_TOOLS_TESTFILES/tsoftlinks.h5
$SRC_TOOLS_TESTFILES/textlinkfar.h5
@@ -1712,7 +1713,11 @@ TOOLTEST HDFFV-5932 h5repack_attr_refs.h5
TOOLTEST HDFFV-7840 h5diff_attr1.h5
# test HDFFV-10590
-arg="h5repack_HDFFV-10590_CVE-2018-17432.h5 h5repack_HDFFV-10590_CVE-2018-17432_out.h5 --low=1 --high=2 -f GZIP=8 -l dset1:CHUNK=5x6"
+arg="h5repack_CVE-2018-17432.h5 h5repack_CVE-2018-17432_out.h5 --low=1 --high=2 -f GZIP=8 -l dset1:CHUNK=5x6"
+TOOLTEST_FAIL $arg
+
+# test HDFFV-11223
+arg="h5repack_CVE-2018-14460.h5 h5repack_CVE-2018-14460_out.h5"
TOOLTEST_FAIL $arg
# tests for metadata block size option
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
index 2b94422..576b1c7 100644
--- a/tools/test/h5repack/h5repackgentest.c
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -72,8 +72,8 @@ struct external_def {
* Returns 0 on success, -1 on failure.
*/
static int
-__make_dataset(hid_t file_id, const char *dset_name, hid_t mem_type_id, hid_t space_id, hid_t dcpl_id,
- void *wdata)
+make_dataset(hid_t file_id, const char *dset_name, hid_t mem_type_id, hid_t space_id, hid_t dcpl_id,
+ void *wdata)
{
hid_t dset_id = H5I_INVALID_HID;
int ret_value = 0;
@@ -90,7 +90,7 @@ done:
(void)H5Dclose(dset_id);
return ret_value;
-} /* end __make_dataset() */
+} /* end make_dataset() */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Helper function to populate the DCPL external storage list.
@@ -101,8 +101,8 @@ done:
* Returns 0 on success, -1 on failure.
*/
static int
-__set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_file, unsigned n_elts_total,
- hsize_t elt_size)
+set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_file, unsigned n_elts_total,
+ hsize_t elt_size)
{
char name[MAX_NAME_SIZE];
unsigned n_external_files = 0;
@@ -123,7 +123,7 @@ __set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_f
return -1;
}
return 0;
-} /* end __set_dcpl_external_list() */
+} /* end set_dcpl_external_list() */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Generalized utility function to write a file with the specified data and
@@ -132,8 +132,8 @@ __set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_f
* Returns 0 on success, -1 on failure.
*/
static int
-__make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize_t rank, hsize_t *dims,
- void *wdata)
+make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize_t rank, hsize_t *dims,
+ void *wdata)
{
char filename[MAX_NAME_SIZE];
hid_t file_id = H5I_INVALID_HID;
@@ -149,8 +149,8 @@ __make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize
if (dcpl_id == H5I_INVALID_HID)
H5REPACKGENTEST_OOPS;
- if (__set_dcpl_external_list(dcpl_id, basename, ext->n_elts_per_file, ext->n_elts_total,
- ext->type_size) < 0)
+ if (set_dcpl_external_list(dcpl_id, basename, ext->n_elts_per_file, ext->n_elts_total,
+ ext->type_size) < 0)
H5REPACKGENTEST_OOPS;
}
@@ -162,13 +162,13 @@ __make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize
if (file_id == H5I_INVALID_HID)
H5REPACKGENTEST_OOPS;
- if (__make_dataset(file_id, "dset", type_id, space_id, dcpl_id, wdata) < 0)
+ if (make_dataset(file_id, "dset", type_id, space_id, dcpl_id, wdata) < 0)
H5REPACKGENTEST_OOPS;
done:
H5REPACKGENTEST_COMMON_CLEANUP(dcpl_id, file_id, space_id);
return ret_value;
-} /* end __make_file() */
+} /* end make_file() */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Returns 0 on success, -1 on failure.
@@ -190,7 +190,7 @@ generate_int32le_1d(hbool_t external)
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0)
+ if (make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0)
ret_value = -1;
return ret_value;
@@ -216,7 +216,7 @@ generate_int32le_2d(hbool_t external)
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0)
+ if (make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0)
ret_value = -1;
return ret_value;
@@ -249,7 +249,7 @@ generate_int32le_3d(hbool_t external)
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0)
+ if (make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0)
ret_value = -1;
return ret_value;
@@ -282,7 +282,7 @@ generate_uint8be(hbool_t external)
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0)
+ if (make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0)
ret_value = -1;
return ret_value;
@@ -312,7 +312,7 @@ generate_f32le(hbool_t external)
}
def_ptr = (TRUE == external) ? (&def) : NULL;
- if (__make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0)
+ if (make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0)
ret_value = -1;
return ret_value;
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index c4ed074..b62fa53 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -111,8 +111,8 @@ const char *H5REPACK_FILENAMES[] = {"h5repack_big_out", NULL};
#define DIM1 40
#define DIM2 20
-#define CDIM1 DIM1 / 2
-#define CDIM2 DIM2 / 2
+#define CDIM1 (DIM1 / 2)
+#define CDIM2 (DIM2 / 2)
#define RANK 2
/* Size of userblock (for userblock test) */
@@ -5813,7 +5813,10 @@ make_dset(hid_t loc_id, const char *name, hid_t sid, hid_t dcpl, void *buf)
return 0;
out:
- H5E_BEGIN_TRY { H5Dclose(did); }
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ }
H5E_END_TRY;
return -1;
}
@@ -6055,7 +6058,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* ref to dset */
status = H5Rcreate(&data_attr_objref[0], file_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6063,7 +6066,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* ref to group */
status = H5Rcreate(&data_attr_objref[1], file_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6071,7 +6074,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* ref to datatype */
status = H5Rcreate(&data_attr_objref[2], file_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6079,7 +6082,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* create attr with obj ref type */
status = make_attr(obj_id, 1, dim_attr_objref, "Attr_OBJREF", H5T_STD_REF_OBJ, data_attr_objref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6119,7 +6122,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
*/
sid_regrefed_dset = H5Screate_simple(2, dim_regrefed_dset, NULL);
if (sid_regrefed_dset < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6127,7 +6130,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
/* select elements space for reference */
status = H5Sselect_elements(sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6135,7 +6138,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
/* create region reference from elements space */
status = H5Rcreate(&data_attr_regref[0], file_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_regrefed_dset);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6143,7 +6146,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
/* create attr with region ref type */
status = make_attr(obj_id, 1, dim_attr_regref, "Attr_REGREF", H5T_STD_REF_DSETREG, data_attr_regref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6188,21 +6191,21 @@ gen_refered_objs(hid_t loc_id)
*/
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
did1 = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (did1 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6213,7 +6216,7 @@ gen_refered_objs(hid_t loc_id)
*/
gid = H5Gcreate2(loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6225,7 +6228,7 @@ gen_refered_objs(hid_t loc_id)
tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6236,7 +6239,7 @@ gen_refered_objs(hid_t loc_id)
*/
sid2 = H5Screate_simple(2, dims2, NULL);
if (sid2 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6244,7 +6247,7 @@ gen_refered_objs(hid_t loc_id)
/* create normal dataset which is refered */
did2 = H5Dcreate2(loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (did2 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6252,7 +6255,7 @@ gen_refered_objs(hid_t loc_id)
/* write values to dataset */
status = H5Dwrite(did2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6308,7 +6311,7 @@ gen_obj_ref(hid_t loc_id)
/* obj ref to dataset */
status = H5Rcreate(&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6316,7 +6319,7 @@ gen_obj_ref(hid_t loc_id)
/* obj ref to group */
status = H5Rcreate(&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6324,7 +6327,7 @@ gen_obj_ref(hid_t loc_id)
/* obj ref to named-datatype */
status = H5Rcreate(&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6334,21 +6337,21 @@ gen_obj_ref(hid_t loc_id)
*/
sid = H5Screate_simple(1, dims_dset_objref, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, objref_buf);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6360,7 +6363,7 @@ gen_obj_ref(hid_t loc_id)
/* add attribute with obj ref */
status = add_attr_with_objref(loc_id, oid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6368,7 +6371,7 @@ gen_obj_ref(hid_t loc_id)
/* add attribute with region ref */
status = add_attr_with_regref(loc_id, oid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6420,7 +6423,7 @@ gen_region_ref(hid_t loc_id)
sid_trg = H5Screate_simple(2, dims_trg, NULL);
if (sid_trg < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6428,7 +6431,7 @@ gen_region_ref(hid_t loc_id)
/* select elements space for reference */
status = H5Sselect_elements(sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6436,7 +6439,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from elements space */
status = H5Rcreate(&rr_data[0], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6444,7 +6447,7 @@ gen_region_ref(hid_t loc_id)
/* select hyperslab space for reference */
status = H5Sselect_hyperslab(sid_trg, H5S_SELECT_SET, start, stride, count, block);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6452,7 +6455,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from hyperslab space */
status = H5Rcreate(&rr_data[1], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6460,7 +6463,7 @@ gen_region_ref(hid_t loc_id)
/* Create dataspace. */
sid_ref = H5Screate_simple(1, dims1, NULL);
if (sid_ref < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6469,7 +6472,7 @@ gen_region_ref(hid_t loc_id)
oid_ref =
H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid_ref, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid_ref < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6477,7 +6480,7 @@ gen_region_ref(hid_t loc_id)
/* write data as region references */
status = H5Dwrite(oid_ref, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6489,7 +6492,7 @@ gen_region_ref(hid_t loc_id)
/* add attribute with obj ref */
status = add_attr_with_objref(loc_id, oid_ref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6497,7 +6500,7 @@ gen_region_ref(hid_t loc_id)
/* add attribute with region ref */
status = add_attr_with_regref(loc_id, oid_ref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6664,7 +6667,7 @@ make_complex_attr_references(hid_t loc_id)
objdid = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, objsid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(objdid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6673,7 +6676,7 @@ make_complex_attr_references(hid_t loc_id)
objtid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, objtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6684,7 +6687,7 @@ make_complex_attr_references(hid_t loc_id)
* compound type which contain obj and region reference */
main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (main_gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6699,7 +6702,7 @@ make_complex_attr_references(hid_t loc_id)
status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6722,7 +6725,7 @@ make_complex_attr_references(hid_t loc_id)
/* references to dataset */
status = H5Rcreate(&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6731,7 +6734,7 @@ make_complex_attr_references(hid_t loc_id)
/* references to group */
status = H5Rcreate(&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6740,7 +6743,7 @@ make_complex_attr_references(hid_t loc_id)
/* references to datatype */
status = H5Rcreate(&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6754,7 +6757,7 @@ make_complex_attr_references(hid_t loc_id)
H5Acreate2(main_did, "Comp_OBJREF", comp_objref_tid, comp_objref_attr_sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(comp_objref_aid, comp_objref_tid, comp_objref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6775,13 +6778,13 @@ make_complex_attr_references(hid_t loc_id)
*/
status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate(&(comp_regref_data[0].val_regref), loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6795,7 +6798,7 @@ make_complex_attr_references(hid_t loc_id)
H5Acreate2(main_did, "Comp_REGREF", comp_regref_tid, comp_regref_attr_sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(comp_regref_aid, comp_regref_tid, comp_regref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6820,7 +6823,7 @@ make_complex_attr_references(hid_t loc_id)
status =
H5Rcreate(&((hobj_ref_t *)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6828,7 +6831,7 @@ make_complex_attr_references(hid_t loc_id)
status =
H5Rcreate(&((hobj_ref_t *)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6836,7 +6839,7 @@ make_complex_attr_references(hid_t loc_id)
status =
H5Rcreate(&((hobj_ref_t *)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6854,7 +6857,7 @@ make_complex_attr_references(hid_t loc_id)
H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6862,7 +6865,7 @@ make_complex_attr_references(hid_t loc_id)
/* close resource for vlen data */
status = H5Treclaim(vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6882,14 +6885,14 @@ make_complex_attr_references(hid_t loc_id)
*/
status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate(&((hdset_reg_ref_t *)vlen_regref_data[0].p)[0], loc_id, NAME_OBJ_DS1,
H5R_DATASET_REGION, objsid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6907,7 +6910,7 @@ make_complex_attr_references(hid_t loc_id)
H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6915,7 +6918,7 @@ make_complex_attr_references(hid_t loc_id)
/* close resource for vlen data */
status = H5Treclaim(vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
diff --git a/tools/test/h5repack/testfiles/h5repack_CVE-2018-14460.h5 b/tools/test/h5repack/testfiles/h5repack_CVE-2018-14460.h5
new file mode 100644
index 0000000..f4093b5
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_CVE-2018-14460.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5 b/tools/test/h5repack/testfiles/h5repack_CVE-2018-17432.h5
index 7a815ba..7a815ba 100644
--- a/tools/test/h5repack/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5
+++ b/tools/test/h5repack/testfiles/h5repack_CVE-2018-17432.h5
Binary files differ
diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake
index 79de6b9..d4238b5 100644
--- a/tools/test/h5stat/CMakeTests.cmake
+++ b/tools/test/h5stat/CMakeTests.cmake
@@ -207,7 +207,7 @@
# -d --di=15
ADD_H5_ERR_TEST (h5stat_err1_dims 1 -d --dims=-1 h5stat_threshold.h5)
ADD_H5_TEST (h5stat_dims1 0 -gd -m 5 h5stat_threshold.h5)
- ADD_H5_TEST (h5stat_dims2 0 -d --di=15 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_dims2 0 -d --dims=15 h5stat_threshold.h5)
#
# Tests for -a option on h5stat_threshold.h5
# -a -2 (incorrect threshold value)
diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c
index b55cd06..c775d6a 100644
--- a/tools/test/h5stat/h5stat_gentest.c
+++ b/tools/test/h5stat/h5stat_gentest.c
@@ -51,7 +51,7 @@
* Generate HDF5 file with latest format with
* NUM_GRPS groups and NUM_ATTRS attributes for the dataset
*/
-static void
+static herr_t
gen_newgrat_file(const char *fname)
{
hid_t fcpl = H5I_INVALID_HID; /* File creation property */
@@ -117,6 +117,21 @@ gen_newgrat_file(const char *fname)
} /* end for */
/* Close dataset, dataspace, datatype, file */
+ if (H5Pclose(fapl) < 0)
+ goto error;
+ if (H5Pclose(fcpl) < 0)
+ goto error;
+ if (H5Dclose(did) < 0)
+ goto error;
+ if (H5Tclose(tid) < 0)
+ goto error;
+ if (H5Sclose(sid) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return SUCCEED;
+
error:
H5E_BEGIN_TRY
{
@@ -130,6 +145,8 @@ error:
H5Fclose(fid);
}
H5E_END_TRY;
+
+ return FAIL;
} /* gen_newgrat_file() */
/*
@@ -139,7 +156,7 @@ error:
* datasets. -a N (--numattrs=N): Set the threshold for the # of attributes when printing information for
* small # of attributes.
*/
-static void
+static herr_t
gen_threshold_file(const char *fname)
{
hid_t fid = H5I_INVALID_HID; /* File ID */
@@ -302,6 +319,23 @@ gen_threshold_file(const char *fname)
goto error;
}
+ if (H5Gclose(gid) < 0)
+ goto error;
+ if (H5Sclose(sid0) < 0)
+ goto error;
+ if (H5Sclose(sid1) < 0)
+ goto error;
+ if (H5Sclose(sid2) < 0)
+ goto error;
+ if (H5Sclose(sid3) < 0)
+ goto error;
+ if (H5Sclose(sid4) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return SUCCEED;
+
error:
H5E_BEGIN_TRY
{
@@ -317,6 +351,8 @@ error:
}
H5E_END_TRY;
+ return FAIL;
+
} /* gen_threshold_file() */
/*
@@ -327,18 +363,21 @@ error:
* one dataset: fixed dimension, chunked layout, w/ filters
*
*/
-static void
+static herr_t
gen_idx_file(const char *fname)
{
- hid_t fapl = H5I_INVALID_HID; /* file access property id */
- hid_t fid = H5I_INVALID_HID; /* file id */
- hid_t sid = H5I_INVALID_HID; /* space id */
- hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
- hid_t did = -1, did2 = H5I_INVALID_HID; /* dataset id */
- hsize_t dims[1] = {10}; /* dataset dimension */
- hsize_t c_dims[1] = {2}; /* chunk dimension */
- int i; /* local index variable */
- int buf[10]; /* data buffer */
+ hid_t fapl = H5I_INVALID_HID; /* file access property id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
+ hid_t did = H5I_INVALID_HID; /* dataset id */
+#if defined(H5_HAVE_FILTER_DEFLATE)
+ hid_t did2 = H5I_INVALID_HID; /* dataset id (compressed) */
+#endif
+ hsize_t dims[1] = {10}; /* dataset dimension */
+ hsize_t c_dims[1] = {2}; /* chunk dimension */
+ int i; /* local index variable */
+ int buf[10]; /* data buffer */
/* Get a copy of the file access property */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -390,6 +429,19 @@ gen_idx_file(const char *fname)
#endif
/* closing: dataspace, dataset, file */
+ if (H5Pclose(fapl) < 0)
+ goto error;
+ if (H5Pclose(dcpl) < 0)
+ goto error;
+ if (H5Sclose(sid) < 0)
+ goto error;
+ if (H5Dclose(did) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return SUCCEED;
+
error:
H5E_BEGIN_TRY
{
@@ -404,6 +456,8 @@ error:
}
H5E_END_TRY;
+ return FAIL;
+
} /* gen_idx_file() */
/*
@@ -419,20 +473,21 @@ error:
* H5O_refcount_decode in the jira issue.
*
*/
-static void
+static herr_t
gen_err_refcount(const char *fname)
{
- hid_t fid = H5I_INVALID_HID; /* File identifier */
- hid_t sid = H5I_INVALID_HID; /* Dataspace message */
- hid_t did = H5I_INVALID_HID; /* Dataset identifier */
- hid_t gid = H5I_INVALID_HID; /* Group identifier */
- hid_t aid1 = -1, aid2 = H5I_INVALID_HID; /* Attribute identifier */
- hid_t tid = H5I_INVALID_HID; /* Datatype identifier */
- int i, n; /* Local index variables */
- int buf[10]; /* Data buffer */
- hsize_t dims[1]; /* Dimension size */
- int fd = -1; /* File descriptor */
- unsigned short val = 22; /* The refcount message ID */
+ hid_t fid = H5I_INVALID_HID; /* File identifier */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace message */
+ hid_t did = H5I_INVALID_HID; /* Dataset identifier */
+ hid_t gid = H5I_INVALID_HID; /* Group identifier */
+ hid_t aid1 = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t aid2 = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t tid = H5I_INVALID_HID; /* Datatype identifier */
+ int i, n; /* Local index variables */
+ int buf[10]; /* Data buffer */
+ hsize_t dims[1]; /* Dimension size */
+ int fd = -1; /* File descriptor */
+ unsigned short val = 22; /* The refcount message ID */
/* Initialize data buffer */
n = 0;
@@ -485,6 +540,10 @@ gen_err_refcount(const char *fname)
goto error;
if (H5Tclose(tid) < 0)
goto error;
+
+ /* Be sure to close this before opening the file again via open(), below,
+ * or you'll possibly trip over the file locking.
+ */
if (H5Fclose(fid) < 0)
goto error;
@@ -495,11 +554,16 @@ gen_err_refcount(const char *fname)
with the committed datatype */
/* 24: the offset in the object header containing the version of the
attribute message */
- if ((fd = HDopen(fname, O_RDWR, 0633)) >= 0) {
- HDlseek(fd, 4520 + 24, SEEK_SET);
- HDwrite(fd, &val, 2);
- HDclose(fd);
- }
+ if ((fd = HDopen(fname, O_RDWR, 0633)) < 0)
+ goto error;
+ if (HDlseek(fd, 4520 + 24, SEEK_SET) < 0)
+ goto error;
+ if (HDwrite(fd, &val, 2) < 0)
+ goto error;
+ if (HDclose(fd) < 0)
+ goto error;
+
+ return SUCCEED;
error:
H5E_BEGIN_TRY
@@ -513,6 +577,11 @@ error:
H5Fclose(fid);
}
H5E_END_TRY;
+
+ if (fd >= 0)
+ HDclose(fd);
+
+ return FAIL;
} /* gen_err_refcount() */
/*
@@ -542,14 +611,22 @@ error:
int
main(void)
{
- gen_newgrat_file(NEWGRAT_FILE);
- gen_threshold_file(THRESHOLD_FILE);
+ if (gen_newgrat_file(NEWGRAT_FILE) < 0)
+ goto error;
+ if (gen_threshold_file(THRESHOLD_FILE) < 0)
+ goto error;
/* Generate an HDF file to test for datasets with Fixed Array indexing */
- gen_idx_file(IDX_FILE);
+ if (gen_idx_file(IDX_FILE) < 0)
+ goto error;
/* Generate a file with a refcount message ID */
- gen_err_refcount(ERR_REFCOUNT_FILE);
+ if (gen_err_refcount(ERR_REFCOUNT_FILE) < 0)
+ goto error;
+
+ return EXIT_SUCCESS;
- return 0;
+error:
+ HDfprintf(stderr, "h5stat test generator FAILED\n");
+ return EXIT_FAILURE;
}
diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in
index 470c381..647f06a 100644
--- a/tools/test/h5stat/testh5stat.sh.in
+++ b/tools/test/h5stat/testh5stat.sh.in
@@ -304,7 +304,7 @@ TOOLTEST h5stat_links5.ddl -g -l 40000 h5stat_newgrat.h5
# -d --di=15
TOOLTEST h5stat_err1_dims.ddl -d --dims=-1 h5stat_threshold.h5
TOOLTEST h5stat_dims1.ddl -gd -m 5 h5stat_threshold.h5
-TOOLTEST h5stat_dims2.ddl -d --di=15 h5stat_threshold.h5
+TOOLTEST h5stat_dims2.ddl -d --dims=15 h5stat_threshold.h5
#
# Tests for -a option on h5stat_threshold.h5
# -a -2 (incorrect threshold value)
diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake
index ec24a61..198a363 100644
--- a/tools/test/misc/CMakeTestsClear.cmake
+++ b/tools/test/misc/CMakeTestsClear.cmake
@@ -397,7 +397,7 @@
#
# The following are tests to verify the expected exit code from h5clear:
# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code)
-# "h5clear --vers" (valid option, version #, succeed exit code)
+# "h5clear --version" (valid option, version #, succeed exit code)
# "h5clear -k" (invalid 1 option, no file, fail exit code)
# "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code)
# "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code)
@@ -408,7 +408,7 @@
# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code)
# "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code)
ADD_H5_RETTEST (h5clr_mdc_image "false" "-m" h5clear_mdc_image.h5)
- ADD_H5_RETTEST (h5clr_vers "false" "--vers")
+ ADD_H5_RETTEST (h5clr_vers "false" "--version")
ADD_H5_RETTEST (h5clr_k "true" "-k")
ADD_H5_RETTEST (h5clr_k_junk "true" "-k" junk.h5)
ADD_H5_RETTEST (h5clr_l_sec2 "true" "-l" h5clear_sec2_v2.h5)
diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c
index e081bf0..7aa5ad9 100644
--- a/tools/test/misc/repart_test.c
+++ b/tools/test/misc/repart_test.c
@@ -113,7 +113,10 @@ test_single_h5repart_opens(void)
return SUCCEED;
error:
- H5E_BEGIN_TRY { H5Fclose(fid); }
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ }
H5E_END_TRY;
return FAIL;
diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c
index 60e7e15..f214527 100644
--- a/tools/test/misc/talign.c
+++ b/tools/test/misc/talign.c
@@ -63,7 +63,10 @@ main(void)
return 1;
}
- H5E_BEGIN_TRY { (void)H5Ldelete(fil, setname, H5P_DEFAULT); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Ldelete(fil, setname, H5P_DEFAULT);
+ }
H5E_END_TRY;
cs6 = H5Tcopy(H5T_C_S1);
diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in
index c05e43d..a01fa4a 100644
--- a/tools/test/misc/testh5clear.sh.in
+++ b/tools/test/misc/testh5clear.sh.in
@@ -315,7 +315,7 @@ TOOLTEST_ERR orig_h5clear_sec2_v0.h5 -s -m "" h5clear_no_mdc_image.err
#
# The following are tests to verify the expected exit code from h5clear:
# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code)
-# "h5clear --vers" (valid option, version #, succeed exit code)
+# "h5clear --version" (valid option, version #, succeed exit code)
# "h5clear -k" (invalid 1 option, no file, fail exit code)
# "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code)
# "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code)
@@ -326,7 +326,7 @@ TOOLTEST_ERR orig_h5clear_sec2_v0.h5 -s -m "" h5clear_no_mdc_image.err
# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code)
# "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code)
TOOLTEST h5clear_mdc_image.h5 -m "" $SUCCEED
-TOOLTEST "" --vers "" $SUCCEED
+TOOLTEST "" --version "" $SUCCEED
TOOLTEST "" -k "" $FAIL
TOOLTEST junk.h5 -k "" $FAIL
TOOLTEST h5clear_sec2_v2.h5 -l "" $FAIL
diff --git a/tools/test/misc/vds/UC_common.h b/tools/test/misc/vds/UC_common.h
index bfa1ed9..d84d545 100644
--- a/tools/test/misc/vds/UC_common.h
+++ b/tools/test/misc/vds/UC_common.h
@@ -14,15 +14,6 @@
#ifndef USE_CASE_COMMON_H
#define USE_CASE_COMMON_H
-/* Use FUNC to safely handle variations of C99 __func__ keyword handling */
-#ifdef H5_HAVE_C99_FUNC
-#define FUNC __func__
-#elif defined(H5_HAVE_FUNCTION)
-#define FUNC __FUNCTION__
-#else
-#error "We need __func__ or __FUNCTION__ to test function names!"
-#endif
-
/******************************************
* Symbols used across multiple use cases *
******************************************/
@@ -41,7 +32,7 @@
#define FALSE 0
/* Testing macros */
-#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__);
#define UC_ERROR \
{ \
puts("*ERROR*"); \
diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt
index 7399723..7bf79c5 100644
--- a/tools/test/perform/CMakeLists.txt
+++ b/tools/test/perform/CMakeLists.txt
@@ -4,39 +4,17 @@ project (HDF5_TOOLS_TEST_PERFORM C)
# --------------------------------------------------------------------
# Add the executables
# --------------------------------------------------------------------
-#-- Adding test for h5perf_serial
-set (h5perf_serial_SOURCES
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
-)
-add_executable (h5perf_serial ${h5perf_serial_SOURCES})
-target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT BUILD_SHARED_LIBS)
- TARGET_C_PROPERTIES (h5perf_serial STATIC)
- target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-else ()
- TARGET_C_PROPERTIES (h5perf_serial SHARED)
- target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
-endif ()
-set_target_properties (h5perf_serial PROPERTIES FOLDER perform)
-
-#-----------------------------------------------------------------------------
-# Add Target to clang-format
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_serial_FORMAT h5perf_serial)
-endif ()
if (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for h5perf_serial_alone - io_timer.c includes
set (h5perf_serial_alone_SOURCES
${HDF5_TOOLS_DIR}/lib/io_timer.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_engine.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_standalone.c
)
add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES})
- target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR};${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (h5perf_serial_alone STATIC)
target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
@@ -188,63 +166,16 @@ if (HDF5_ENABLE_FORMATTERS)
endif ()
if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL)
- if (UNIX)
- #-- Adding test for perf - only on unix systems
- set (perf_SOURCES
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c
- )
- add_executable (perf ${perf_SOURCES})
- target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT BUILD_SHARED_LIBS)
- TARGET_C_PROPERTIES (perf STATIC)
- target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
- else ()
- TARGET_C_PROPERTIES (perf SHARED)
- target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- endif ()
- set_target_properties (perf PROPERTIES FOLDER perform)
-
- #-----------------------------------------------------------------------------
- # Add Target to clang-format
- #-----------------------------------------------------------------------------
- if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TOOLS_TEST_PERFORM_perf_FORMAT perf)
- endif ()
- endif ()
-
- #-- Adding test for h5perf
- set (h5perf_SOURCES
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
- )
- add_executable (h5perf ${h5perf_SOURCES})
- target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT BUILD_SHARED_LIBS)
- TARGET_C_PROPERTIES (h5perf STATIC)
- target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
- else ()
- TARGET_C_PROPERTIES (h5perf SHARED)
- target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- endif ()
- set_target_properties (h5perf PROPERTIES FOLDER perform)
-
- #-----------------------------------------------------------------------------
- # Add Target to clang-format
- #-----------------------------------------------------------------------------
- if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_FORMAT h5perf)
- endif ()
-
if (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for h5perf
set (h5perf_alone_SOURCES
${HDF5_TOOLS_DIR}/lib/io_timer.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_engine.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_standalone.c
)
add_executable (h5perf_alone ${h5perf_alone_SOURCES})
- target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR};${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (h5perf_alone STATIC)
target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} ${LINK_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
diff --git a/tools/test/perform/COPYING b/tools/test/perform/COPYING
deleted file mode 100644
index 97969da..0000000
--- a/tools/test/perform/COPYING
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Copyright by The HDF Group and
- The Board of Trustees of the University of Illinois.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/tools/test/perform/Makefile.am b/tools/test/perform/Makefile.am
index 244ef3a..10b13fe 100644
--- a/tools/test/perform/Makefile.am
+++ b/tools/test/perform/Makefile.am
@@ -21,17 +21,6 @@ include $(top_srcdir)/config/commence.am
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib
-# bin_PROGRAMS will be installed.
-if BUILD_PARALLEL_CONDITIONAL
- bin_PROGRAMS=h5perf_serial h5perf
-else
- bin_PROGRAMS=h5perf_serial
-endif
-
-# Add h5perf and h5perf_serial specific linker flags here
-h5perf_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
-h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
-
# Some programs are not built or run by default, but can be built by hand or by
# specifying --enable-build-all at configure time.
# Also, some of these programs should only be built in parallel.
@@ -47,18 +36,15 @@ endif
# List them in the order they should be run.
# Parallel test programs.
if BUILD_PARALLEL_CONDITIONAL
- TEST_PROG_PARA=h5perf perf
+ TEST_PROG_PARA=
endif
# Serial test programs.
-TEST_PROG = iopipe chunk chunk_cache overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
+TEST_PROG = iopipe chunk chunk_cache overhead zip_perf perf_meta $(BUILD_ALL_PROGS)
# check_PROGRAMS will be built but not installed. Do not any executable
# that is in bin_PROGRAMS already. Otherwise, it will be removed twice in
# "make clean" and some systems, e.g., AIX, do not like it.
-check_PROGRAMS= iopipe chunk chunk_cache overhead zip_perf perf_meta $(BUILD_ALL_PROGS) perf
-
-h5perf_SOURCES=pio_perf.c pio_engine.c
-h5perf_serial_SOURCES=sio_perf.c sio_engine.c
+check_PROGRAMS= $(TEST_PROG) $(BUILD_ALL_PROGS)
# These are the files that `make clean' (and derivatives) will remove from
# this directory.
@@ -67,9 +53,6 @@ CLEANFILES=*.h5 *.raw *.dat x-gnuplot perftest.out
# All of the programs depend on the main hdf5 library, and some of them
# depend on test or tools library.
LDADD=$(LIBHDF5)
-h5perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
-h5perf_serial_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
-perf_LDADD=$(LIBH5TEST) $(LIBHDF5)
iopipe_LDADD=$(LIBH5TEST) $(LIBHDF5)
zip_perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
perf_meta_LDADD=$(LIBH5TEST) $(LIBHDF5)
diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c
index ada2ed3..5e2dde2 100644
--- a/tools/test/perform/chunk.c
+++ b/tools/test/perform/chunk.c
@@ -21,15 +21,12 @@
*/
/* See H5private.h for how to include headers */
-#undef NDEBUG
#include "hdf5.h"
-#ifdef H5_STDC_HEADERS
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
/* Solaris Studio defines attribute, but for the attributes we need */
#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C)
@@ -55,20 +52,20 @@
#define RM_CACHE_STRT 25
#define RM_CACHE_END 25
#define RM_CACHE_DELT 5
-#define RM_START (double)0.50F
-#define RM_END (double)5.00F
-#define RM_DELTA (double)0.50F
-#define RM_W0 0.0F
+#define RM_START 0.50
+#define RM_END 5.00
+#define RM_DELTA 0.50
+#define RM_W0 0.0
#define RM_NRDCC 521
/* Diagonal test */
#define DIAG_CACHE_STRT 25
#define DIAG_CACHE_END 25
#define DIAG_CACHE_DELT 5
-#define DIAG_START (double)0.50F
-#define DIAG_END (double)5.00F
-#define DIAG_DELTA (double)0.50F
-/* #define DIAG_W0 0.65F */
+#define DIAG_START 0.50
+#define DIAG_END 5.00
+#define DIAG_DELTA 0.50
+/* #define DIAG_W0 0.65 */
/* #define DIAG_NRDCC 521 */
static size_t nio_g;
diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c
index fcaa337..b515961 100644
--- a/tools/test/perform/chunk_cache.c
+++ b/tools/test/perform/chunk_cache.c
@@ -26,9 +26,9 @@
#define RANK 2
#define DSET1_NAME "partial_chunks"
-#define DSET1_DIM1 9 * 1000
+#define DSET1_DIM1 (9 * 1000)
#define DSET1_DIM2 9
-#define CHUNK1_DIM1 2 * 1000
+#define CHUNK1_DIM1 (2 * 1000)
#define CHUNK1_DIM2 2
#define DSET2_NAME "hash_value"
@@ -38,7 +38,7 @@
#define CHUNK2_DIM2 100
#define RDCC_NSLOTS 5
-#define RDCC_NBYTES 1024 * 1024 * 10
+#define RDCC_NBYTES (1024 * 1024 * 10)
#define RDCC_W0 0.75F
#define FILTER_COUNTER 306
@@ -262,13 +262,14 @@ check_partial_chunks_perf(hid_t file)
end_t = H5_get_time();
- if ((end_t - start_t) > (double)0.0f)
- printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n",
- (end_t - start_t), nbytes_global);
+ if ((end_t - start_t) > 0.0)
+ HDprintf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n",
+ (end_t - start_t), nbytes_global);
else
- printf("1. Partial chunks: no total read time because timer is not available; number of bytes being "
- "read from file is %zu\n",
- nbytes_global);
+ HDprintf(
+ "1. Partial chunks: no total read time because timer is not available; number of bytes being "
+ "read from file is %zu\n",
+ nbytes_global);
H5Dclose(dataset);
H5Sclose(filespace);
@@ -340,13 +341,14 @@ check_hash_value_perf(hid_t file)
end_t = H5_get_time();
- if ((end_t - start_t) > (double)0.0f)
- printf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n",
- (end_t - start_t), nbytes_global);
+ if ((end_t - start_t) > 0.0)
+ HDprintf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n",
+ (end_t - start_t), nbytes_global);
else
- printf("2. Hash value: no total read time because timer is not available; number of bytes being read "
- "from file is %zu\n",
- nbytes_global);
+ HDprintf(
+ "2. Hash value: no total read time because timer is not available; number of bytes being read "
+ "from file is %zu\n",
+ nbytes_global);
H5Dclose(dataset);
H5Sclose(filespace);
@@ -375,7 +377,7 @@ error:
int
main(void)
{
- hid_t file; /* handles */
+ hid_t file = H5I_INVALID_HID; /* file ID */
int nerrors = 0;
/* Create a new file. If file exists its contents will be overwritten. */
@@ -404,6 +406,6 @@ main(void)
return 0;
error:
- fprintf(stderr, "*** ERRORS DETECTED ***\n");
+ HDfprintf(stderr, "*** ERRORS DETECTED ***\n");
return 1;
}
diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c
index b3ae54d..371c4f9 100644
--- a/tools/test/perform/direct_write_perf.c
+++ b/tools/test/perform/direct_write_perf.c
@@ -23,31 +23,27 @@
#if !defined(WIN32) && !defined(__MINGW32__)
-#include <math.h>
-
-#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
+#include <math.h>
#include <stdio.h>
#include <stdlib.h>
-#endif
-
-#ifdef H5_HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
-#endif
+#include <time.h>
#ifdef H5_HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if defined(H5_TIME_WITH_SYS_TIME)
+#ifdef H5_HAVE_SYS_TIME_H
#include <sys/time.h>
-#include <time.h>
-#elif defined(H5_HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#else
-#include <time.h>
+#endif
+
+#ifdef H5_HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef H5_HAVE_UNISTD_H
+#include <unistd.h>
#endif
const char *FILENAME[] = {"direct_write", "unix.raw", NULL};
@@ -55,8 +51,7 @@ const char *FILENAME[] = {"direct_write", "unix.raw", NULL};
/*
* Print the current location on the standard output stream.
*/
-#define FUNC __func__
-#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__);
#define H5_FAILED() \
{ \
puts("*FAILED*"); \
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index 68eaa3a..2aa9e25 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -64,11 +64,11 @@ print_stats(const char *prefix,
#ifdef H5_HAVE_GETRUSAGE
double u_time, s_time;
- u_time = ((double)(r_stop->ru_utime.tv_sec) + (double)(r_stop->ru_utime.tv_usec) / (double)1000000.0F) -
- ((double)(r_start->ru_utime.tv_sec) + (double)(r_start->ru_utime.tv_usec) / (double)1000000.0F);
+ u_time = ((double)(r_stop->ru_utime.tv_sec) + (double)(r_stop->ru_utime.tv_usec) / 1000000.0) -
+ ((double)(r_start->ru_utime.tv_sec) + (double)(r_start->ru_utime.tv_usec) / 1000000.0);
- s_time = ((double)(r_stop->ru_stime.tv_sec) + (double)(r_stop->ru_stime.tv_usec) / (double)1000000.0F) -
- ((double)(r_start->ru_stime.tv_sec) + (double)(r_start->ru_stime.tv_usec) / (double)1000000.0F);
+ s_time = ((double)(r_stop->ru_stime.tv_sec) + (double)(r_stop->ru_stime.tv_usec) / 1000000.0) -
+ ((double)(r_start->ru_stime.tv_sec) + (double)(r_start->ru_stime.tv_usec) / 1000000.0);
#endif
e_time = t_stop - t_start;
H5_bandwidth(bw, (double)nbytes, e_time);
@@ -95,7 +95,6 @@ print_stats(const char *prefix,
static void
synchronize(void)
{
-#ifdef H5_HAVE_SYSTEM
#if defined(H5_HAVE_WIN32_API) && !defined(__CYGWIN__)
_flushall();
#else
@@ -107,7 +106,6 @@ synchronize(void)
status = HDsystem("df >/dev/null");
HDassert(status >= 0);
#endif
-#endif
}
/*-------------------------------------------------------------------------
@@ -149,8 +147,7 @@ main(void)
* Win32 version 5.0 compiler.
* 1998-11-06 ptl
*/
- HDprintf("I/O request size is %1.1fMB\n",
- (double)(hssize_t)(size[0] * size[1]) / (double)1024.0F * (double)1024);
+ HDprintf("I/O request size is %1.1fMB\n", (double)(hssize_t)(size[0] * size[1]) / 1024.0 * 1024.0);
/* Open the files */
file = H5Fcreate(HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c
index dba8220..60ec8d8 100644
--- a/tools/test/perform/overhead.c
+++ b/tools/test/perform/overhead.c
@@ -23,17 +23,11 @@
#include "hdf5.h"
#include "H5private.h"
-#ifdef H5_STDC_HEADERS
#include <ctype.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
-#endif
-
-#ifdef H5_HAVE_IO_H
-#include <io.h>
-#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c
index a93d673..d8ed9ec 100644
--- a/tools/test/perform/perf_meta.c
+++ b/tools/test/perform/perf_meta.c
@@ -818,8 +818,10 @@ main(int argc, char **argv)
goto error;
#ifdef H5_HAVE_PARALLEL
if (facc_type != FACC_DEFAULT && MAINPROCESS)
-#endif /*H5_HAVE_PARALLEL*/
printf("All metadata performance tests passed.\n");
+#else
+ printf("All metadata performance tests passed.\n");
+#endif /*H5_HAVE_PARALLEL*/
return 0;
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index 0a9bfc0..032bfba 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -17,40 +17,31 @@
#include "pio_perf.h"
-#ifdef STANDALONE
-MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */
-#endif
-
/** From h5tools_utils.c **/
/* global variables */
int nCols = 80;
-/* ``get_option'' variables */
-int opt_err = 1; /*get_option prints errors if this is on */
-int opt_ind = 1; /*token pointer */
-const char *opt_arg; /*flag argument (or value) */
-
int
-get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts)
+get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts)
{
static int sp = 1; /* character index in current token */
int opt_opt = '?'; /* option character passed back to user */
if (sp == 1) {
/* check for more flag-like tokens */
- if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') {
+ if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') {
return EOF;
}
- else if (HDstrcmp(argv[opt_ind], "--") == 0) {
- opt_ind++;
+ else if (HDstrcmp(argv[H5_optind], "--") == 0) {
+ H5_optind++;
return EOF;
}
}
- if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') {
+ if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') {
/* long command line option */
- const char *arg = &argv[opt_ind][2];
+ const char *arg = &argv[H5_optind][2];
int i;
for (i = 0; l_opts && l_opts[i].name; i++) {
@@ -62,13 +53,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].has_arg != no_arg) {
if (arg[len] == '=') {
- opt_arg = &arg[len + 1];
+ H5_optarg = &arg[len + 1];
}
- else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') {
- opt_arg = argv[++opt_ind];
+ else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') {
+ H5_optarg = argv[++H5_optind];
}
else if (l_opts[i].has_arg == require_arg) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg);
opt_opt = '?';
@@ -76,13 +67,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
}
else {
if (arg[len] == '=') {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg);
opt_opt = '?';
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
break;
@@ -91,29 +82,29 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].name == NULL) {
/* exhausted all of the l_opts we have and still didn't match */
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
opt_opt = '?';
}
- opt_ind++;
+ H5_optind++;
sp = 1;
}
else {
register char *cp; /* pointer into current token */
/* short command line option */
- opt_opt = argv[opt_ind][sp];
+ opt_opt = argv[H5_optind][sp];
if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt);
/* if no chars left in this token, move to next token */
- if (argv[opt_ind][++sp] == '\0') {
- opt_ind++;
+ if (argv[H5_optind][++sp] == '\0') {
+ H5_optind++;
sp = 1;
}
@@ -122,32 +113,32 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (*++cp == ':') {
/* if a value is expected, get it */
- if (argv[opt_ind][sp + 1] != '\0') {
+ if (argv[H5_optind][sp + 1] != '\0') {
/* flag value is rest of current token */
- opt_arg = &argv[opt_ind++][sp + 1];
+ H5_optarg = &argv[H5_optind++][sp + 1];
}
- else if (++opt_ind >= argc) {
- if (opt_err)
+ else if (++H5_optind >= argc) {
+ if (H5_opterr)
HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt);
opt_opt = '?';
}
else {
/* flag value is next token */
- opt_arg = argv[opt_ind++];
+ H5_optarg = argv[H5_optind++];
}
sp = 1;
}
else {
/* set up to look at next char in token, next time */
- if (argv[opt_ind][++sp] == '\0') {
+ if (argv[H5_optind][++sp] == '\0') {
/* no more in current token, so setup next token */
- opt_ind++;
+ H5_optind++;
sp = 1;
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
}
@@ -161,134 +152,3 @@ print_version(const char *progname)
printf("%s: Version %u.%u.%u%s%s\n", progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE,
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
-#ifdef STANDALONE
-/*
- * Function: h5_set_info_object
- * Purpose: Process environment variables setting to set up MPI Info
- * object.
- * Return: 0 if all is fine; otherwise non-zero.
- * Programmer: Albert Cheng, 2002/05/21.
- * Modifications:
- * Bill Wendling, 2002/05/31
- * Modified so that the HDF5_MPI_INFO environment variable can
- * be a semicolon separated list of "key=value" pairings. Most
- * of the code is to remove any whitespaces which might be
- * surrounding the "key=value" pairs.
- */
-int
-h5_set_info_object(void)
-{
- char *envp; /* environment pointer */
- int ret_value = 0;
-
- /* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL) {
- char *next, *valp;
-
- valp = envp = next = HDstrdup(envp);
-
- if (!valp)
- return 0;
-
- /* create an INFO object if not created yet */
- if (h5_io_info_g == MPI_INFO_NULL)
- MPI_Info_create(&h5_io_info_g);
-
- do {
- size_t len;
- char * key_val, *endp, *namep;
-
- if (*valp == ';')
- valp++;
-
- /* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = (char *)HDcalloc(1, len + 1);
-
- /* increment the next pointer past the terminating semicolon */
- if (*next == ';')
- ++next;
-
- namep = HDstrncpy(key_val, valp, len);
-
- /* pass up any beginning whitespaces */
- while (*namep && (*namep == ' ' || *namep == '\t'))
- namep++;
-
- if (!*namep)
- continue; /* was all white space, so move to next k/v pair */
-
- /* eat up any ending white spaces */
- endp = &namep[HDstrlen(namep) - 1];
-
- while (endp && (*endp == ' ' || *endp == '\t'))
- *endp-- = '\0';
-
- /* find the '=' */
- valp = HDstrchr(namep, '=');
-
- if (valp != NULL) { /* it's a valid key/value pairing */
- char *tmp_val = valp + 1;
-
- /* change '=' to \0, move valp down one */
- *valp-- = '\0';
-
- /* eat up ending whitespace on the "key" part */
- while (*valp == ' ' || *valp == '\t')
- *valp-- = '\0';
-
- valp = tmp_val;
-
- /* eat up beginning whitespace on the "value" part */
- while (*valp == ' ' || *valp == '\t')
- *valp++ = '\0';
-
- /* actually set the darned thing */
- if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- HDprintf("MPI_Info_set failed\n");
- ret_value = -1;
- }
- }
-
- valp = next;
- HDfree(key_val);
- } while (next && *next);
-
- HDfree(envp);
- }
-
- return ret_value;
-}
-
-/*
- * Function: h5_dump_info_object
- * Purpose: Display content of an MPI Info object
- * Return: void
- * Programmer: Albert Cheng 2002/05/21
- * Modifications:
- */
-void
-h5_dump_info_object(MPI_Info info)
-{
- char key[MPI_MAX_INFO_KEY + 1];
- char value[MPI_MAX_INFO_VAL + 1];
- int flag;
- int i, nkeys;
-
- HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
- if (info == MPI_INFO_NULL) {
- HDprintf("object is MPI_INFO_NULL\n");
- }
- else {
- MPI_Info_get_nkeys(info, &nkeys);
- HDprintf("object has %d items\n", nkeys);
- for (i = 0; i < nkeys; i++) {
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- HDprintf("%s=%s\n", key, value);
- }
- }
-}
-#endif /* STANDALONE */
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index 721addf..f1fb946 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef PIO_STANDALONE_H__
-#define PIO_PERF_H__
+#ifndef PIO_STANDALONE_H
+#define PIO_STANDALONE_H
/* Header file for building h5perf by standalone mode.
* Created: Christian Chilan, 2005/5/18.
@@ -21,10 +21,6 @@
#include "H5public.h" /* Include Public Definitions */
-/*
- * Include ANSI-C header files.
- */
-#ifdef H5_STDC_HEADERS
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@@ -37,7 +33,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
/*
* Redefine all the POSIX functions. We should never see a POSIX
@@ -95,28 +90,20 @@
#define HDctermid(S) ctermid(S)
#define HDctime(T) ctime(T)
#define HDcuserid(S) cuserid(S)
-#ifdef H5_HAVE_DIFFTIME
-#define HDdifftime(X, Y) difftime(X, Y)
-#else
-#define HDdifftime(X, Y) ((double)(X) - (double)(Y))
-#endif
-#define HDdiv(X, Y) div(X, Y)
-#define HDdup(F) dup(F)
-#define HDdup2(F, I) dup2(F, I)
-/* execl() variable arguments */
-/* execle() variable arguments */
-/* execlp() variable arguments */
-#define HDexecv(S, AV) execv(S, AV)
-#define HDexecve(S, AV, E) execve(S, AV, E)
-#define HDexecvp(S, AV) execvp(S, AV)
-#define HDexit(N) exit(N)
-#define HD_exit(N) _exit(N)
-#define HDexp(X) exp(X)
-#define HDfabs(X) fabs(X)
-/* use ABS() because fabsf() fabsl() are not common yet. */
-#define HDfabsf(X) ABS(X)
-#define HDfabsl(X) ABS(X)
-#define HDfclose(F) fclose(F)
+#define HDdifftime(X, Y) difftime(X, Y)
+#define HDdiv(X, Y) div(X, Y)
+#define HDdup(F) dup(F)
+#define HDdup2(F, I) dup2(F, I)
+#define HDexecv(S, AV) execv(S, AV)
+#define HDexecve(S, AV, E) execve(S, AV, E)
+#define HDexecvp(S, AV) execvp(S, AV)
+#define HDexit(N) exit(N)
+#define HD_exit(N) _exit(N)
+#define HDexp(X) exp(X)
+#define HDfabs(X) fabs(X)
+#define HDfabsf(X) fabsf(X)
+#define HDfabsl(X) fabsl(X)
+#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)
@@ -142,17 +129,8 @@
#define HDfree(M) free(M)
#define HDfreopen(S, M, F) freopen(S, M, F)
#define HDfrexp(X, N) frexp(X, N)
-/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
-#ifdef H5_HAVE_FREXPF
-#define HDfrexpf(X, N) frexpf(X, N)
-#else /* H5_HAVE_FREXPF */
-#define HDfrexpf(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPF */
-#ifdef H5_HAVE_FREXPL
-#define HDfrexpl(X, N) frexpl(X, N)
-#else /* H5_HAVE_FREXPL */
-#define HDfrexpl(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPL */
+#define HDfrexpf(X, N) frexpf(X, N)
+#define HDfrexpl(X, N) frexpl(X, N)
/* fscanf() variable arguments */
#ifdef H5_HAVE_FSEEKO
#define HDfseek(F, O, W) fseeko(F, O, W)
@@ -348,15 +326,9 @@ H5_DLL int HDrand(void);
#define HDsin(X) sin(X)
#define HDsinh(X) sinh(X)
#define HDsleep(N) sleep(N)
-#ifdef H5_HAVE_WIN32_API
-H5_DLL int c99_snprintf(char *str, size_t size, const char *format, ...);
-#define HDsnprintf c99_snprintf /*varargs*/
-#else
-#define HDsnprintf snprintf /*varargs*/
-#endif
-/* sprintf() variable arguments */
-#define HDsprintf sprintf /*varargs*/
-#define HDsqrt(X) sqrt(X)
+#define HDsnprintf snprintf /*varargs*/
+#define HDsprintf sprintf /*varargs*/
+#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);
#define HDsrandom(S) HDsrand(S)
@@ -367,7 +339,6 @@ H5_DLL void HDsrand(unsigned int seed);
#define HDsrand(S) srand(S)
#define HDsrandom(S) srand(S)
#endif
-/* sscanf() variable arguments */
#ifdef H5_HAVE_WIN32_API
#define HDstrcasecmp(A, B) _stricmp(A, B)
@@ -429,25 +400,20 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base);
#else
#define HDunlink(S) unlink(S)
#endif
-#define HDutime(S, T) utime(S, T)
-#define HDva_arg(A, T) va_arg(A, T)
-#define HDva_end(A) va_end(A)
-#define HDva_start(A, P) va_start(A, P)
-#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
-#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A)
-#define HDvprintf(FMT, A) vprintf(FMT, A)
-#define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A)
-#ifdef H5_HAVE_WIN32_API
-H5_DLL int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap);
-#define HDvsnprintf c99_vsnprintf
-#else
+#define HDutime(S, T) utime(S, T)
+#define HDva_arg(A, T) va_arg(A, T)
+#define HDva_end(A) va_end(A)
+#define HDva_start(A, P) va_start(A, P)
+#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
+#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A)
+#define HDvprintf(FMT, A) vprintf(FMT, A)
+#define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A)
#define HDvsnprintf(S, N, FMT, A) vsnprintf(S, N, FMT, A)
-#endif
-#define HDwait(W) wait(W)
-#define HDwaitpid(P, W, O) waitpid(P, W, O)
-#define HDwcstombs(S, P, Z) wcstombs(S, P, Z)
-#define HDwctomb(S, C) wctomb(S, C)
-#define HDwrite(F, M, Z) write(F, M, Z)
+#define HDwait(W) wait(W)
+#define HDwaitpid(P, W, O) waitpid(P, W, O)
+#define HDwcstombs(S, P, Z) wcstombs(S, P, Z)
+#define HDwctomb(S, C) wctomb(S, C)
+#define HDwrite(F, M, Z) write(F, M, Z)
/*
* And now for a couple non-Posix functions... Watch out for systems that
@@ -475,37 +441,27 @@ extern char * strdup(const char *s);
#define TRUE true
#endif
-/** From h5test.h **/
-
-#ifdef H5_HAVE_PARALLEL
-extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
-#endif
-
-#ifdef H5_HAVE_PARALLEL
-int h5_set_info_object(void);
-void h5_dump_info_object(MPI_Info info);
-#endif
-
/** From h5tools_utils.h **/
-extern int opt_err; /* getoption prints errors if this is on */
-extern int opt_ind; /* token pointer */
-extern const char *opt_arg; /* flag argument (or value) */
+H5_DLLVAR int H5_opterr; /* getoption prints errors if this is on */
+H5_DLLVAR int H5_optind; /* token pointer */
+H5_DLLVAR const char *H5_optarg; /* flag argument (or value) */
-enum {
+enum h5_arg_level {
no_arg = 0, /* doesn't take an argument */
require_arg, /* requires an argument */
optional_arg /* argument is optional */
};
-typedef struct long_options {
- const char *name; /* name of the long option */
- int has_arg; /* whether we should look for an arg */
- char shortval; /* the shortname equivalent of long arg
- * this gets returned from get_option */
-} long_options;
+struct h5_long_options {
+ const char * name; /* Name of the long option */
+ enum h5_arg_level has_arg; /* Whether we should look for an arg */
+ char shortval; /* The shortname equivalent of long arg
+ * this gets returned from get_option
+ */
+};
-extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt);
+extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt);
extern int nCols; /*max number of columns for outputting */
diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c
index abc0777..7c22b53 100644
--- a/tools/test/perform/sio_standalone.c
+++ b/tools/test/perform/sio_standalone.c
@@ -22,31 +22,26 @@
/* global variables */
int nCols = 80;
-/* ``get_option'' variables */
-int opt_err = 1; /*get_option prints errors if this is on */
-int opt_ind = 1; /*token pointer */
-const char *opt_arg; /*flag argument (or value) */
-
int
-get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts)
+get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts)
{
static int sp = 1; /* character index in current token */
int opt_opt = '?'; /* option character passed back to user */
if (sp == 1) {
/* check for more flag-like tokens */
- if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') {
+ if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') {
return EOF;
}
- else if (HDstrcmp(argv[opt_ind], "--") == 0) {
- opt_ind++;
+ else if (HDstrcmp(argv[H5_optind], "--") == 0) {
+ H5_optind++;
return EOF;
}
}
- if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') {
+ if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') {
/* long command line option */
- const char *arg = &argv[opt_ind][2];
+ const char *arg = &argv[H5_optind][2];
int i;
for (i = 0; l_opts && l_opts[i].name; i++) {
@@ -58,13 +53,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].has_arg != no_arg) {
if (arg[len] == '=') {
- opt_arg = &arg[len + 1];
+ H5_optarg = &arg[len + 1];
}
- else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') {
- opt_arg = argv[++opt_ind];
+ else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') {
+ H5_optarg = argv[++H5_optind];
}
else if (l_opts[i].has_arg == require_arg) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg);
opt_opt = '?';
@@ -72,13 +67,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
}
else {
if (arg[len] == '=') {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg);
opt_opt = '?';
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
break;
@@ -87,29 +82,29 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].name == NULL) {
/* exhausted all of the l_opts we have and still didn't match */
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
opt_opt = '?';
}
- opt_ind++;
+ H5_optind++;
sp = 1;
}
else {
register char *cp; /* pointer into current token */
/* short command line option */
- opt_opt = argv[opt_ind][sp];
+ opt_opt = argv[H5_optind][sp];
if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt);
/* if no chars left in this token, move to next token */
- if (argv[opt_ind][++sp] == '\0') {
- opt_ind++;
+ if (argv[H5_optind][++sp] == '\0') {
+ H5_optind++;
sp = 1;
}
@@ -118,32 +113,32 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (*++cp == ':') {
/* if a value is expected, get it */
- if (argv[opt_ind][sp + 1] != '\0') {
+ if (argv[H5_optind][sp + 1] != '\0') {
/* flag value is rest of current token */
- opt_arg = &argv[opt_ind++][sp + 1];
+ H5_optarg = &argv[H5_optind++][sp + 1];
}
- else if (++opt_ind >= argc) {
- if (opt_err)
+ else if (++H5_optind >= argc) {
+ if (H5_opterr)
HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt);
opt_opt = '?';
}
else {
/* flag value is next token */
- opt_arg = argv[opt_ind++];
+ H5_optarg = argv[H5_optind++];
}
sp = 1;
}
else {
/* set up to look at next char in token, next time */
- if (argv[opt_ind][++sp] == '\0') {
+ if (argv[H5_optind][++sp] == '\0') {
/* no more in current token, so setup next token */
- opt_ind++;
+ H5_optind++;
sp = 1;
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
}
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index d0e5452..99cca75 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef SIO_STANDALONE_H__
-#define SIO_PERF_H__
+#ifndef SIO_STANDALONE_H
+#define SIO_STANDALONE_H
/* Header file for building h5perf by standalone mode.
* Created: Christian Chilan, 2005/5/18.
@@ -21,10 +21,6 @@
#include "H5public.h" /* Include Public Definitions */
-/*
- * Include ANSI-C header files.
- */
-#ifdef H5_STDC_HEADERS
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@@ -37,7 +33,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#endif
/* maximum of two, three, or four values */
#undef MAX
@@ -110,28 +105,20 @@
#define HDctermid(S) ctermid(S)
#define HDctime(T) ctime(T)
#define HDcuserid(S) cuserid(S)
-#ifdef H5_HAVE_DIFFTIME
-#define HDdifftime(X, Y) difftime(X, Y)
-#else
-#define HDdifftime(X, Y) ((double)(X) - (double)(Y))
-#endif
-#define HDdiv(X, Y) div(X, Y)
-#define HDdup(F) dup(F)
-#define HDdup2(F, I) dup2(F, I)
-/* execl() variable arguments */
-/* execle() variable arguments */
-/* execlp() variable arguments */
-#define HDexecv(S, AV) execv(S, AV)
-#define HDexecve(S, AV, E) execve(S, AV, E)
-#define HDexecvp(S, AV) execvp(S, AV)
-#define HDexit(N) exit(N)
-#define HD_exit(N) _exit(N)
-#define HDexp(X) exp(X)
-#define HDfabs(X) fabs(X)
-/* use ABS() because fabsf() fabsl() are not common yet. */
-#define HDfabsf(X) ABS(X)
-#define HDfabsl(X) ABS(X)
-#define HDfclose(F) fclose(F)
+#define HDdifftime(X, Y) difftime(X, Y)
+#define HDdiv(X, Y) div(X, Y)
+#define HDdup(F) dup(F)
+#define HDdup2(F, I) dup2(F, I)
+#define HDexecv(S, AV) execv(S, AV)
+#define HDexecve(S, AV, E) execve(S, AV, E)
+#define HDexecvp(S, AV) execvp(S, AV)
+#define HDexit(N) exit(N)
+#define HD_exit(N) _exit(N)
+#define HDexp(X) exp(X)
+#define HDfabs(X) fabs(X)
+#define HDfabsf(X) fabsf(X)
+#define HDfabsl(X) fabsl(X)
+#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)
@@ -157,17 +144,8 @@
#define HDfree(M) free(M)
#define HDfreopen(S, M, F) freopen(S, M, F)
#define HDfrexp(X, N) frexp(X, N)
-/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
-#ifdef H5_HAVE_FREXPF
-#define HDfrexpf(X, N) frexpf(X, N)
-#else /* H5_HAVE_FREXPF */
-#define HDfrexpf(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPF */
-#ifdef H5_HAVE_FREXPL
-#define HDfrexpl(X, N) frexpl(X, N)
-#else /* H5_HAVE_FREXPL */
-#define HDfrexpl(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPL */
+#define HDfrexpf(X, N) frexpf(X, N)
+#define HDfrexpl(X, N) frexpl(X, N)
/* fscanf() variable arguments */
#ifdef H5_HAVE_FSEEKO
#define HDfseek(F, O, W) fseeko(F, O, W)
@@ -363,15 +341,9 @@ H5_DLL int HDrand(void);
#define HDsin(X) sin(X)
#define HDsinh(X) sinh(X)
#define HDsleep(N) sleep(N)
-#ifdef H5_HAVE_WIN32_API
-H5_DLL int c99_snprintf(char *str, size_t size, const char *format, ...);
-#define HDsnprintf c99_snprintf /*varargs*/
-#else
-#define HDsnprintf snprintf /*varargs*/
-#endif
-/* sprintf() variable arguments */
-#define HDsprintf sprintf /*varargs*/
-#define HDsqrt(X) sqrt(X)
+#define HDsnprintf snprintf /*varargs*/
+#define HDsprintf sprintf /*varargs*/
+#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);
#define HDsrandom(S) HDsrand(S)
@@ -382,7 +354,6 @@ H5_DLL void HDsrand(unsigned int seed);
#define HDsrand(S) srand(S)
#define HDsrandom(S) srand(S)
#endif
-/* sscanf() variable arguments */
#ifdef H5_HAVE_WIN32_API
#define HDstrcasecmp(A, B) _stricmp(A, B)
@@ -444,25 +415,20 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base);
#else
#define HDunlink(S) unlink(S)
#endif
-#define HDutime(S, T) utime(S, T)
-#define HDva_arg(A, T) va_arg(A, T)
-#define HDva_end(A) va_end(A)
-#define HDva_start(A, P) va_start(A, P)
-#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
-#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A)
-#define HDvprintf(FMT, A) vprintf(FMT, A)
-#define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A)
-#ifdef H5_HAVE_WIN32_API
-H5_DLL int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap);
-#define HDvsnprintf c99_vsnprintf
-#else
+#define HDutime(S, T) utime(S, T)
+#define HDva_arg(A, T) va_arg(A, T)
+#define HDva_end(A) va_end(A)
+#define HDva_start(A, P) va_start(A, P)
+#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
+#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A)
+#define HDvprintf(FMT, A) vprintf(FMT, A)
+#define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A)
#define HDvsnprintf(S, N, FMT, A) vsnprintf(S, N, FMT, A)
-#endif
-#define HDwait(W) wait(W)
-#define HDwaitpid(P, W, O) waitpid(P, W, O)
-#define HDwcstombs(S, P, Z) wcstombs(S, P, Z)
-#define HDwctomb(S, C) wctomb(S, C)
-#define HDwrite(F, M, Z) write(F, M, Z)
+#define HDwait(W) wait(W)
+#define HDwaitpid(P, W, O) waitpid(P, W, O)
+#define HDwcstombs(S, P, Z) wcstombs(S, P, Z)
+#define HDwctomb(S, C) wctomb(S, C)
+#define HDwrite(F, M, Z) write(F, M, Z)
/*
* And now for a couple non-Posix functions... Watch out for systems that
@@ -490,37 +456,27 @@ extern char * strdup(const char *s);
#define TRUE true
#endif
-/** From h5test.h **/
-
-#ifdef H5_HAVE_PARALLEL
-extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
-#endif
-
-#ifdef H5_HAVE_PARALLEL
-int h5_set_info_object(void);
-void h5_dump_info_object(MPI_Info info);
-#endif
-
/** From h5tools_utils.h **/
-extern int opt_err; /* getoption prints errors if this is on */
-extern int opt_ind; /* token pointer */
-extern const char *opt_arg; /* flag argument (or value) */
+H5_DLLVAR int H5_opterr; /* getoption prints errors if this is on */
+H5_DLLVAR int H5_optind; /* token pointer */
+H5_DLLVAR const char *H5_optarg; /* flag argument (or value) */
-enum {
+enum h5_arg_level {
no_arg = 0, /* doesn't take an argument */
require_arg, /* requires an argument */
optional_arg /* argument is optional */
};
-typedef struct long_options {
- const char *name; /* name of the long option */
- int has_arg; /* whether we should look for an arg */
- char shortval; /* the shortname equivalent of long arg
- * this gets returned from get_option */
-} long_options;
+struct h5_long_options {
+ const char * name; /* Name of the long option */
+ enum h5_arg_level has_arg; /* Whether we should look for an arg */
+ char shortval; /* The shortname equivalent of long arg
+ * this gets returned from get_option
+ */
+};
-extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt);
+extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt);
extern int nCols; /*max number of columns for outputting */
diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c
index 6a1e1aa..d8cd3a1 100644
--- a/tools/test/perform/zip_perf.c
+++ b/tools/test/perform/zip_perf.c
@@ -32,11 +32,10 @@
#define ONE_MB (ONE_KB * ONE_KB)
#define ONE_GB (ONE_MB * ONE_KB)
-#define MICROSECOND 1000000.0F
+#define MICROSECOND 1000000.0
/* report 0.0 in case t is zero too */
-#define MB_PER_SEC(bytes, t) \
- ((fabs(t) < (double)0.0000000001F) ? (double)0.0F : ((((double)bytes) / (double)ONE_MB) / (t)))
+#define MB_PER_SEC(bytes, t) ((fabs(t) < 0.0000000001) ? 0.0 : ((((double)(bytes)) / (double)ONE_MB) / (t)))
#ifndef TRUE
#define TRUE 1
@@ -65,66 +64,15 @@ static void error(const char *fmt, ...);
static void compress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
/* commandline options : long and short form */
-static const char * s_opts = "hB:b:c:p:rs:0123456789";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"compressability", require_arg, 'c'},
- {"compressabilit", require_arg, 'c'},
- {"compressabili", require_arg, 'c'},
- {"compressabil", require_arg, 'c'},
- {"compressabi", require_arg, 'c'},
- {"compressab", require_arg, 'c'},
- {"compressa", require_arg, 'c'},
- {"compress", require_arg, 'c'},
- {"compres", require_arg, 'c'},
- {"compre", require_arg, 'c'},
- {"compr", require_arg, 'c'},
- {"comp", require_arg, 'c'},
- {"com", require_arg, 'c'},
- {"co", require_arg, 'c'},
- {"file-size", require_arg, 's'},
- {"file-siz", require_arg, 's'},
- {"file-si", require_arg, 's'},
- {"file-s", require_arg, 's'},
- {"file", require_arg, 's'},
- {"fil", require_arg, 's'},
- {"fi", require_arg, 's'},
- {"max-buffer-size", require_arg, 'B'},
- {"max-buffer-siz", require_arg, 'B'},
- {"max-buffer-si", require_arg, 'B'},
- {"max-buffer-s", require_arg, 'B'},
- {"max-buffer", require_arg, 'B'},
- {"max-buffe", require_arg, 'B'},
- {"max-buff", require_arg, 'B'},
- {"max-buf", require_arg, 'B'},
- {"max-bu", require_arg, 'B'},
- {"max-b", require_arg, 'B'},
- {"max", require_arg, 'B'},
- {"min-buffer-size", require_arg, 'b'},
- {"min-buffer-siz", require_arg, 'b'},
- {"min-buffer-si", require_arg, 'b'},
- {"min-buffer-s", require_arg, 'b'},
- {"min-buffer", require_arg, 'b'},
- {"min-buffe", require_arg, 'b'},
- {"min-buff", require_arg, 'b'},
- {"min-buf", require_arg, 'b'},
- {"min-bu", require_arg, 'b'},
- {"min-b", require_arg, 'b'},
- {"min", require_arg, 'b'},
- {"prefix", require_arg, 'p'},
- {"prefi", require_arg, 'p'},
- {"pref", require_arg, 'p'},
- {"pre", require_arg, 'p'},
- {"pr", require_arg, 'p'},
- {"random-test", no_arg, 'r'},
- {"random-tes", no_arg, 'r'},
- {"random-te", no_arg, 'r'},
- {"random-t", no_arg, 'r'},
- {"random", no_arg, 'r'},
- {"rando", no_arg, 'r'},
- {"rand", no_arg, 'r'},
- {"ran", no_arg, 'r'},
- {"ra", no_arg, 'r'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hB:b:c:p:rs:0123456789";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
+ {"compressability", require_arg, 'c'},
+ {"file-size", require_arg, 's'},
+ {"max-buffer-size", require_arg, 'B'},
+ {"min-buffer-size", require_arg, 'b'},
+ {"prefix", require_arg, 'p'},
+ {"random-test", no_arg, 'r'},
+ {NULL, 0, '\0'}};
/*
* Function: error
@@ -169,7 +117,7 @@ write_file(Bytef *source, uLongf sourceLen)
/* destination buffer needs to be at least 0.1% larger than sourceLen
* plus 12 bytes */
- destLen = (uLongf)((double)sourceLen + ((double)sourceLen * (double)0.1F)) + 12;
+ destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1)) + 12;
dest = (Bytef *)HDmalloc(destLen);
if (!dest)
@@ -179,8 +127,8 @@ write_file(Bytef *source, uLongf sourceLen)
compress_buffer(dest, &destLen, source, sourceLen);
HDgettimeofday(&timer_stop, NULL);
- compression_time += ((double)timer_stop.tv_sec + ((double)timer_stop.tv_usec) / (double)MICROSECOND) -
- ((double)timer_start.tv_sec + ((double)timer_start.tv_usec) / (double)MICROSECOND);
+ compression_time += ((double)timer_stop.tv_sec + ((double)timer_stop.tv_usec) / MICROSECOND) -
+ ((double)timer_start.tv_sec + ((double)timer_start.tv_usec) / MICROSECOND);
if (report_once_flag) {
HDfprintf(stdout, "\tCompression Ratio: %g\n", ((double)destLen) / (double)sourceLen);
@@ -552,7 +500,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- while ((opt = get_option(argc, argv, s_opts, l_opts)) > 0) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) > 0) {
switch ((char)opt) {
case '0':
case '1':
@@ -567,13 +515,13 @@ main(int argc, const char *argv[])
compress_level = opt - '0';
break;
case 'B':
- max_buf_size = parse_size_directive(opt_arg);
+ max_buf_size = parse_size_directive(H5_optarg);
break;
case 'b':
- min_buf_size = parse_size_directive(opt_arg);
+ min_buf_size = parse_size_directive(H5_optarg);
break;
case 'c':
- compress_percent = (int)HDstrtol(opt_arg, NULL, 10);
+ compress_percent = (int)HDstrtol(H5_optarg, NULL, 10);
if (compress_percent < 0)
compress_percent = 0;
@@ -582,13 +530,13 @@ main(int argc, const char *argv[])
break;
case 'p':
- option_prefix = opt_arg;
+ option_prefix = H5_optarg;
break;
case 'r':
random_test = TRUE;
break;
case 's':
- file_size = parse_size_directive(opt_arg);
+ file_size = parse_size_directive(H5_optarg);
break;
case '?':
usage();
diff --git a/tools/testfiles/tCVE_2018_11206_fill_new.h5 b/tools/testfiles/tCVE_2018_11206_fill_new.h5
new file mode 100644
index 0000000..643591c
--- /dev/null
+++ b/tools/testfiles/tCVE_2018_11206_fill_new.h5
Binary files differ
diff --git a/tools/testfiles/tCVE_2018_11206_fill_old.h5 b/tools/testfiles/tCVE_2018_11206_fill_old.h5
new file mode 100644
index 0000000..7f5b41a
--- /dev/null
+++ b/tools/testfiles/tCVE_2018_11206_fill_old.h5
Binary files differ
diff --git a/tools/testfiles/tfloatsattrs.ddl b/tools/testfiles/tfloatsattrs.ddl
new file mode 100644
index 0000000..11c65b8
--- /dev/null
+++ b/tools/testfiles/tfloatsattrs.ddl
@@ -0,0 +1,621 @@
+HDF5 "tfloatsattrs.h5" {
+GROUP "/" {
+ DATASET "DS128BITS" {
+ DATATYPE 128-bit little-endian floating-point 80-bit precision
+ DATASPACE SIMPLE { ( 8, 128 ) / ( 8, 128 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 16384
+ OFFSET 14416
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ (0,0): 128, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5,
+ (0,9): 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1, 1.0625,
+ (0,18): 1.125, 1.1875, 1.25, 1.3125, 1.375, 1.4375, 1.5, 1.5625, 1.625,
+ (0,27): 1.6875, 1.75, 1.8125, 1.875, 1.9375, 2, 2.0625, 2.125, 2.1875,
+ (0,36): 2.25, 2.3125, 2.375, 2.4375, 2.5, 2.5625, 2.625, 2.6875, 2.75,
+ (0,45): 2.8125, 2.875, 2.9375, 3, 3.0625, 3.125, 3.1875, 3.25, 3.3125,
+ (0,54): 3.375, 3.4375, 3.5, 3.5625, 3.625, 3.6875, 3.75, 3.8125, 3.875,
+ (0,63): 3.9375, 4, 4.0625, 4.125, 4.1875, 4.25, 4.3125, 4.375, 4.4375,
+ (0,72): 4.5, 4.5625, 4.625, 4.6875, 4.75, 4.8125, 4.875, 4.9375, 5,
+ (0,81): 5.0625, 5.125, 5.1875, 5.25, 5.3125, 5.375, 5.4375, 5.5,
+ (0,89): 5.5625, 5.625, 5.6875, 5.75, 5.8125, 5.875, 5.9375, 6, 6.0625,
+ (0,98): 6.125, 6.1875, 6.25, 6.3125, 6.375, 6.4375, 6.5, 6.5625, 6.625,
+ (0,107): 6.6875, 6.75, 6.8125, 6.875, 6.9375, 7, 7.0625, 7.125, 7.1875,
+ (0,116): 7.25, 7.3125, 7.375, 7.4375, 7.5, 7.5625, 7.625, 7.6875, 7.75,
+ (0,125): 7.8125, 7.875, 7.9375,
+ (1,0): 127, 0.0703125, 0.132812, 0.195312, 0.257812, 0.320312,
+ (1,6): 0.382812, 0.445312, 0.507812, 0.570312, 0.632812, 0.695312,
+ (1,12): 0.757812, 0.820312, 0.882812, 0.945312, 1.00781, 1.07031,
+ (1,18): 1.13281, 1.19531, 1.25781, 1.32031, 1.38281, 1.44531, 1.50781,
+ (1,25): 1.57031, 1.63281, 1.69531, 1.75781, 1.82031, 1.88281, 1.94531,
+ (1,32): 2.00781, 2.07031, 2.13281, 2.19531, 2.25781, 2.32031, 2.38281,
+ (1,39): 2.44531, 2.50781, 2.57031, 2.63281, 2.69531, 2.75781, 2.82031,
+ (1,46): 2.88281, 2.94531, 3.00781, 3.07031, 3.13281, 3.19531, 3.25781,
+ (1,53): 3.32031, 3.38281, 3.44531, 3.50781, 3.57031, 3.63281, 3.69531,
+ (1,60): 3.75781, 3.82031, 3.88281, 3.94531, 4.00781, 4.07031, 4.13281,
+ (1,67): 4.19531, 4.25781, 4.32031, 4.38281, 4.44531, 4.50781, 4.57031,
+ (1,74): 4.63281, 4.69531, 4.75781, 4.82031, 4.88281, 4.94531, 5.00781,
+ (1,81): 5.07031, 5.13281, 5.19531, 5.25781, 5.32031, 5.38281, 5.44531,
+ (1,88): 5.50781, 5.57031, 5.63281, 5.69531, 5.75781, 5.82031, 5.88281,
+ (1,95): 5.94531, 6.00781, 6.07031, 6.13281, 6.19531, 6.25781, 6.32031,
+ (1,102): 6.38281, 6.44531, 6.50781, 6.57031, 6.63281, 6.69531, 6.75781,
+ (1,109): 6.82031, 6.88281, 6.94531, 7.00781, 7.07031, 7.13281, 7.19531,
+ (1,116): 7.25781, 7.32031, 7.38281, 7.44531, 7.50781, 7.57031, 7.63281,
+ (1,123): 7.69531, 7.75781, 7.82031, 7.88281, 7.94531,
+ (2,0): 126, 0.078125, 0.140625, 0.203125, 0.265625, 0.328125, 0.390625,
+ (2,7): 0.453125, 0.515625, 0.578125, 0.640625, 0.703125, 0.765625,
+ (2,13): 0.828125, 0.890625, 0.953125, 1.01562, 1.07812, 1.14062,
+ (2,19): 1.20312, 1.26562, 1.32812, 1.39062, 1.45312, 1.51562, 1.57812,
+ (2,26): 1.64062, 1.70312, 1.76562, 1.82812, 1.89062, 1.95312, 2.01562,
+ (2,33): 2.07812, 2.14062, 2.20312, 2.26562, 2.32812, 2.39062, 2.45312,
+ (2,40): 2.51562, 2.57812, 2.64062, 2.70312, 2.76562, 2.82812, 2.89062,
+ (2,47): 2.95312, 3.01562, 3.07812, 3.14062, 3.20312, 3.26562, 3.32812,
+ (2,54): 3.39062, 3.45312, 3.51562, 3.57812, 3.64062, 3.70312, 3.76562,
+ (2,61): 3.82812, 3.89062, 3.95312, 4.01562, 4.07812, 4.14062, 4.20312,
+ (2,68): 4.26562, 4.32812, 4.39062, 4.45312, 4.51562, 4.57812, 4.64062,
+ (2,75): 4.70312, 4.76562, 4.82812, 4.89062, 4.95312, 5.01562, 5.07812,
+ (2,82): 5.14062, 5.20312, 5.26562, 5.32812, 5.39062, 5.45312, 5.51562,
+ (2,89): 5.57812, 5.64062, 5.70312, 5.76562, 5.82812, 5.89062, 5.95312,
+ (2,96): 6.01562, 6.07812, 6.14062, 6.20312, 6.26562, 6.32812, 6.39062,
+ (2,103): 6.45312, 6.51562, 6.57812, 6.64062, 6.70312, 6.76562, 6.82812,
+ (2,110): 6.89062, 6.95312, 7.01562, 7.07812, 7.14062, 7.20312, 7.26562,
+ (2,117): 7.32812, 7.39062, 7.45312, 7.51562, 7.57812, 7.64062, 7.70312,
+ (2,124): 7.76562, 7.82812, 7.89062, 7.95312,
+ (3,0): 125, 0.0859375, 0.148438, 0.210938, 0.273438, 0.335938,
+ (3,6): 0.398438, 0.460938, 0.523438, 0.585938, 0.648438, 0.710938,
+ (3,12): 0.773438, 0.835938, 0.898438, 0.960938, 1.02344, 1.08594,
+ (3,18): 1.14844, 1.21094, 1.27344, 1.33594, 1.39844, 1.46094, 1.52344,
+ (3,25): 1.58594, 1.64844, 1.71094, 1.77344, 1.83594, 1.89844, 1.96094,
+ (3,32): 2.02344, 2.08594, 2.14844, 2.21094, 2.27344, 2.33594, 2.39844,
+ (3,39): 2.46094, 2.52344, 2.58594, 2.64844, 2.71094, 2.77344, 2.83594,
+ (3,46): 2.89844, 2.96094, 3.02344, 3.08594, 3.14844, 3.21094, 3.27344,
+ (3,53): 3.33594, 3.39844, 3.46094, 3.52344, 3.58594, 3.64844, 3.71094,
+ (3,60): 3.77344, 3.83594, 3.89844, 3.96094, 4.02344, 4.08594, 4.14844,
+ (3,67): 4.21094, 4.27344, 4.33594, 4.39844, 4.46094, 4.52344, 4.58594,
+ (3,74): 4.64844, 4.71094, 4.77344, 4.83594, 4.89844, 4.96094, 5.02344,
+ (3,81): 5.08594, 5.14844, 5.21094, 5.27344, 5.33594, 5.39844, 5.46094,
+ (3,88): 5.52344, 5.58594, 5.64844, 5.71094, 5.77344, 5.83594, 5.89844,
+ (3,95): 5.96094, 6.02344, 6.08594, 6.14844, 6.21094, 6.27344, 6.33594,
+ (3,102): 6.39844, 6.46094, 6.52344, 6.58594, 6.64844, 6.71094, 6.77344,
+ (3,109): 6.83594, 6.89844, 6.96094, 7.02344, 7.08594, 7.14844, 7.21094,
+ (3,116): 7.27344, 7.33594, 7.39844, 7.46094, 7.52344, 7.58594, 7.64844,
+ (3,123): 7.71094, 7.77344, 7.83594, 7.89844, 7.96094,
+ (4,0): 124, 0.09375, 0.15625, 0.21875, 0.28125, 0.34375, 0.40625,
+ (4,7): 0.46875, 0.53125, 0.59375, 0.65625, 0.71875, 0.78125, 0.84375,
+ (4,14): 0.90625, 0.96875, 1.03125, 1.09375, 1.15625, 1.21875, 1.28125,
+ (4,21): 1.34375, 1.40625, 1.46875, 1.53125, 1.59375, 1.65625, 1.71875,
+ (4,28): 1.78125, 1.84375, 1.90625, 1.96875, 2.03125, 2.09375, 2.15625,
+ (4,35): 2.21875, 2.28125, 2.34375, 2.40625, 2.46875, 2.53125, 2.59375,
+ (4,42): 2.65625, 2.71875, 2.78125, 2.84375, 2.90625, 2.96875, 3.03125,
+ (4,49): 3.09375, 3.15625, 3.21875, 3.28125, 3.34375, 3.40625, 3.46875,
+ (4,56): 3.53125, 3.59375, 3.65625, 3.71875, 3.78125, 3.84375, 3.90625,
+ (4,63): 3.96875, 4.03125, 4.09375, 4.15625, 4.21875, 4.28125, 4.34375,
+ (4,70): 4.40625, 4.46875, 4.53125, 4.59375, 4.65625, 4.71875, 4.78125,
+ (4,77): 4.84375, 4.90625, 4.96875, 5.03125, 5.09375, 5.15625, 5.21875,
+ (4,84): 5.28125, 5.34375, 5.40625, 5.46875, 5.53125, 5.59375, 5.65625,
+ (4,91): 5.71875, 5.78125, 5.84375, 5.90625, 5.96875, 6.03125, 6.09375,
+ (4,98): 6.15625, 6.21875, 6.28125, 6.34375, 6.40625, 6.46875, 6.53125,
+ (4,105): 6.59375, 6.65625, 6.71875, 6.78125, 6.84375, 6.90625, 6.96875,
+ (4,112): 7.03125, 7.09375, 7.15625, 7.21875, 7.28125, 7.34375, 7.40625,
+ (4,119): 7.46875, 7.53125, 7.59375, 7.65625, 7.71875, 7.78125, 7.84375,
+ (4,126): 7.90625, 7.96875,
+ (5,0): 123, 0.101562, 0.164062, 0.226562, 0.289062, 0.351562, 0.414062,
+ (5,7): 0.476562, 0.539062, 0.601562, 0.664062, 0.726562, 0.789062,
+ (5,13): 0.851562, 0.914062, 0.976562, 1.03906, 1.10156, 1.16406,
+ (5,19): 1.22656, 1.28906, 1.35156, 1.41406, 1.47656, 1.53906, 1.60156,
+ (5,26): 1.66406, 1.72656, 1.78906, 1.85156, 1.91406, 1.97656, 2.03906,
+ (5,33): 2.10156, 2.16406, 2.22656, 2.28906, 2.35156, 2.41406, 2.47656,
+ (5,40): 2.53906, 2.60156, 2.66406, 2.72656, 2.78906, 2.85156, 2.91406,
+ (5,47): 2.97656, 3.03906, 3.10156, 3.16406, 3.22656, 3.28906, 3.35156,
+ (5,54): 3.41406, 3.47656, 3.53906, 3.60156, 3.66406, 3.72656, 3.78906,
+ (5,61): 3.85156, 3.91406, 3.97656, 4.03906, 4.10156, 4.16406, 4.22656,
+ (5,68): 4.28906, 4.35156, 4.41406, 4.47656, 4.53906, 4.60156, 4.66406,
+ (5,75): 4.72656, 4.78906, 4.85156, 4.91406, 4.97656, 5.03906, 5.10156,
+ (5,82): 5.16406, 5.22656, 5.28906, 5.35156, 5.41406, 5.47656, 5.53906,
+ (5,89): 5.60156, 5.66406, 5.72656, 5.78906, 5.85156, 5.91406, 5.97656,
+ (5,96): 6.03906, 6.10156, 6.16406, 6.22656, 6.28906, 6.35156, 6.41406,
+ (5,103): 6.47656, 6.53906, 6.60156, 6.66406, 6.72656, 6.78906, 6.85156,
+ (5,110): 6.91406, 6.97656, 7.03906, 7.10156, 7.16406, 7.22656, 7.28906,
+ (5,117): 7.35156, 7.41406, 7.47656, 7.53906, 7.60156, 7.66406, 7.72656,
+ (5,124): 7.78906, 7.85156, 7.91406, 7.97656,
+ (6,0): 122, 0.109375, 0.171875, 0.234375, 0.296875, 0.359375, 0.421875,
+ (6,7): 0.484375, 0.546875, 0.609375, 0.671875, 0.734375, 0.796875,
+ (6,13): 0.859375, 0.921875, 0.984375, 1.04688, 1.10938, 1.17188,
+ (6,19): 1.23438, 1.29688, 1.35938, 1.42188, 1.48438, 1.54688, 1.60938,
+ (6,26): 1.67188, 1.73438, 1.79688, 1.85938, 1.92188, 1.98438, 2.04688,
+ (6,33): 2.10938, 2.17188, 2.23438, 2.29688, 2.35938, 2.42188, 2.48438,
+ (6,40): 2.54688, 2.60938, 2.67188, 2.73438, 2.79688, 2.85938, 2.92188,
+ (6,47): 2.98438, 3.04688, 3.10938, 3.17188, 3.23438, 3.29688, 3.35938,
+ (6,54): 3.42188, 3.48438, 3.54688, 3.60938, 3.67188, 3.73438, 3.79688,
+ (6,61): 3.85938, 3.92188, 3.98438, 4.04688, 4.10938, 4.17188, 4.23438,
+ (6,68): 4.29688, 4.35938, 4.42188, 4.48438, 4.54688, 4.60938, 4.67188,
+ (6,75): 4.73438, 4.79688, 4.85938, 4.92188, 4.98438, 5.04688, 5.10938,
+ (6,82): 5.17188, 5.23438, 5.29688, 5.35938, 5.42188, 5.48438, 5.54688,
+ (6,89): 5.60938, 5.67188, 5.73438, 5.79688, 5.85938, 5.92188, 5.98438,
+ (6,96): 6.04688, 6.10938, 6.17188, 6.23438, 6.29688, 6.35938, 6.42188,
+ (6,103): 6.48438, 6.54688, 6.60938, 6.67188, 6.73438, 6.79688, 6.85938,
+ (6,110): 6.92188, 6.98438, 7.04688, 7.10938, 7.17188, 7.23438, 7.29688,
+ (6,117): 7.35938, 7.42188, 7.48438, 7.54688, 7.60938, 7.67188, 7.73438,
+ (6,124): 7.79688, 7.85938, 7.92188, 7.98438,
+ (7,0): 121, 0.117188, 0.179688, 0.242188, 0.304688, 0.367188, 0.429688,
+ (7,7): 0.492188, 0.554688, 0.617188, 0.679688, 0.742188, 0.804688,
+ (7,13): 0.867188, 0.929688, 0.992188, 1.05469, 1.11719, 1.17969,
+ (7,19): 1.24219, 1.30469, 1.36719, 1.42969, 1.49219, 1.55469, 1.61719,
+ (7,26): 1.67969, 1.74219, 1.80469, 1.86719, 1.92969, 1.99219, 2.05469,
+ (7,33): 2.11719, 2.17969, 2.24219, 2.30469, 2.36719, 2.42969, 2.49219,
+ (7,40): 2.55469, 2.61719, 2.67969, 2.74219, 2.80469, 2.86719, 2.92969,
+ (7,47): 2.99219, 3.05469, 3.11719, 3.17969, 3.24219, 3.30469, 3.36719,
+ (7,54): 3.42969, 3.49219, 3.55469, 3.61719, 3.67969, 3.74219, 3.80469,
+ (7,61): 3.86719, 3.92969, 3.99219, 4.05469, 4.11719, 4.17969, 4.24219,
+ (7,68): 4.30469, 4.36719, 4.42969, 4.49219, 4.55469, 4.61719, 4.67969,
+ (7,75): 4.74219, 4.80469, 4.86719, 4.92969, 4.99219, 5.05469, 5.11719,
+ (7,82): 5.17969, 5.24219, 5.30469, 5.36719, 5.42969, 5.49219, 5.55469,
+ (7,89): 5.61719, 5.67969, 5.74219, 5.80469, 5.86719, 5.92969, 5.99219,
+ (7,96): 6.05469, 6.11719, 6.17969, 6.24219, 6.30469, 6.36719, 6.42969,
+ (7,103): 6.49219, 6.55469, 6.61719, 6.67969, 6.74219, 6.80469, 6.86719,
+ (7,110): 6.92969, 6.99219, 7.05469, 7.11719, 7.17969, 7.24219, 7.30469,
+ (7,117): 7.36719, 7.42969, 7.49219, 7.55469, 7.61719, 7.67969, 7.74219,
+ (7,124): 7.80469, 7.86719, 7.92969, 7.99219
+ }
+ ATTRIBUTE "DS128BITS" {
+ DATATYPE 128-bit little-endian floating-point 80-bit precision
+ DATASPACE SIMPLE { ( 1024 ) / ( 1024 ) }
+ DATA {
+ (0): 128, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5,
+ (9): 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1, 1.0625,
+ (18): 1.125, 1.1875, 1.25, 1.3125, 1.375, 1.4375, 1.5, 1.5625,
+ (26): 1.625, 1.6875, 1.75, 1.8125, 1.875, 1.9375, 2, 2.0625, 2.125,
+ (35): 2.1875, 2.25, 2.3125, 2.375, 2.4375, 2.5, 2.5625, 2.625,
+ (43): 2.6875, 2.75, 2.8125, 2.875, 2.9375, 3, 3.0625, 3.125, 3.1875,
+ (52): 3.25, 3.3125, 3.375, 3.4375, 3.5, 3.5625, 3.625, 3.6875, 3.75,
+ (61): 3.8125, 3.875, 3.9375, 4, 4.0625, 4.125, 4.1875, 4.25, 4.3125,
+ (70): 4.375, 4.4375, 4.5, 4.5625, 4.625, 4.6875, 4.75, 4.8125,
+ (78): 4.875, 4.9375, 5, 5.0625, 5.125, 5.1875, 5.25, 5.3125, 5.375,
+ (87): 5.4375, 5.5, 5.5625, 5.625, 5.6875, 5.75, 5.8125, 5.875,
+ (95): 5.9375, 6, 6.0625, 6.125, 6.1875, 6.25, 6.3125, 6.375, 6.4375,
+ (104): 6.5, 6.5625, 6.625, 6.6875, 6.75, 6.8125, 6.875, 6.9375, 7,
+ (113): 7.0625, 7.125, 7.1875, 7.25, 7.3125, 7.375, 7.4375, 7.5,
+ (121): 7.5625, 7.625, 7.6875, 7.75, 7.8125, 7.875, 7.9375, 127,
+ (129): 0.0703125, 0.132812, 0.195312, 0.257812, 0.320312, 0.382812,
+ (135): 0.445312, 0.507812, 0.570312, 0.632812, 0.695312, 0.757812,
+ (141): 0.820312, 0.882812, 0.945312, 1.00781, 1.07031, 1.13281,
+ (147): 1.19531, 1.25781, 1.32031, 1.38281, 1.44531, 1.50781,
+ (153): 1.57031, 1.63281, 1.69531, 1.75781, 1.82031, 1.88281,
+ (159): 1.94531, 2.00781, 2.07031, 2.13281, 2.19531, 2.25781,
+ (165): 2.32031, 2.38281, 2.44531, 2.50781, 2.57031, 2.63281,
+ (171): 2.69531, 2.75781, 2.82031, 2.88281, 2.94531, 3.00781,
+ (177): 3.07031, 3.13281, 3.19531, 3.25781, 3.32031, 3.38281,
+ (183): 3.44531, 3.50781, 3.57031, 3.63281, 3.69531, 3.75781,
+ (189): 3.82031, 3.88281, 3.94531, 4.00781, 4.07031, 4.13281,
+ (195): 4.19531, 4.25781, 4.32031, 4.38281, 4.44531, 4.50781,
+ (201): 4.57031, 4.63281, 4.69531, 4.75781, 4.82031, 4.88281,
+ (207): 4.94531, 5.00781, 5.07031, 5.13281, 5.19531, 5.25781,
+ (213): 5.32031, 5.38281, 5.44531, 5.50781, 5.57031, 5.63281,
+ (219): 5.69531, 5.75781, 5.82031, 5.88281, 5.94531, 6.00781,
+ (225): 6.07031, 6.13281, 6.19531, 6.25781, 6.32031, 6.38281,
+ (231): 6.44531, 6.50781, 6.57031, 6.63281, 6.69531, 6.75781,
+ (237): 6.82031, 6.88281, 6.94531, 7.00781, 7.07031, 7.13281,
+ (243): 7.19531, 7.25781, 7.32031, 7.38281, 7.44531, 7.50781,
+ (249): 7.57031, 7.63281, 7.69531, 7.75781, 7.82031, 7.88281,
+ (255): 7.94531, 126, 0.078125, 0.140625, 0.203125, 0.265625,
+ (261): 0.328125, 0.390625, 0.453125, 0.515625, 0.578125, 0.640625,
+ (267): 0.703125, 0.765625, 0.828125, 0.890625, 0.953125, 1.01562,
+ (273): 1.07812, 1.14062, 1.20312, 1.26562, 1.32812, 1.39062,
+ (279): 1.45312, 1.51562, 1.57812, 1.64062, 1.70312, 1.76562,
+ (285): 1.82812, 1.89062, 1.95312, 2.01562, 2.07812, 2.14062,
+ (291): 2.20312, 2.26562, 2.32812, 2.39062, 2.45312, 2.51562,
+ (297): 2.57812, 2.64062, 2.70312, 2.76562, 2.82812, 2.89062,
+ (303): 2.95312, 3.01562, 3.07812, 3.14062, 3.20312, 3.26562,
+ (309): 3.32812, 3.39062, 3.45312, 3.51562, 3.57812, 3.64062,
+ (315): 3.70312, 3.76562, 3.82812, 3.89062, 3.95312, 4.01562,
+ (321): 4.07812, 4.14062, 4.20312, 4.26562, 4.32812, 4.39062,
+ (327): 4.45312, 4.51562, 4.57812, 4.64062, 4.70312, 4.76562,
+ (333): 4.82812, 4.89062, 4.95312, 5.01562, 5.07812, 5.14062,
+ (339): 5.20312, 5.26562, 5.32812, 5.39062, 5.45312, 5.51562,
+ (345): 5.57812, 5.64062, 5.70312, 5.76562, 5.82812, 5.89062,
+ (351): 5.95312, 6.01562, 6.07812, 6.14062, 6.20312, 6.26562,
+ (357): 6.32812, 6.39062, 6.45312, 6.51562, 6.57812, 6.64062,
+ (363): 6.70312, 6.76562, 6.82812, 6.89062, 6.95312, 7.01562,
+ (369): 7.07812, 7.14062, 7.20312, 7.26562, 7.32812, 7.39062,
+ (375): 7.45312, 7.51562, 7.57812, 7.64062, 7.70312, 7.76562,
+ (381): 7.82812, 7.89062, 7.95312, 125, 0.0859375, 0.148438,
+ (387): 0.210938, 0.273438, 0.335938, 0.398438, 0.460938, 0.523438,
+ (393): 0.585938, 0.648438, 0.710938, 0.773438, 0.835938, 0.898438,
+ (399): 0.960938, 1.02344, 1.08594, 1.14844, 1.21094, 1.27344,
+ (405): 1.33594, 1.39844, 1.46094, 1.52344, 1.58594, 1.64844,
+ (411): 1.71094, 1.77344, 1.83594, 1.89844, 1.96094, 2.02344,
+ (417): 2.08594, 2.14844, 2.21094, 2.27344, 2.33594, 2.39844,
+ (423): 2.46094, 2.52344, 2.58594, 2.64844, 2.71094, 2.77344,
+ (429): 2.83594, 2.89844, 2.96094, 3.02344, 3.08594, 3.14844,
+ (435): 3.21094, 3.27344, 3.33594, 3.39844, 3.46094, 3.52344,
+ (441): 3.58594, 3.64844, 3.71094, 3.77344, 3.83594, 3.89844,
+ (447): 3.96094, 4.02344, 4.08594, 4.14844, 4.21094, 4.27344,
+ (453): 4.33594, 4.39844, 4.46094, 4.52344, 4.58594, 4.64844,
+ (459): 4.71094, 4.77344, 4.83594, 4.89844, 4.96094, 5.02344,
+ (465): 5.08594, 5.14844, 5.21094, 5.27344, 5.33594, 5.39844,
+ (471): 5.46094, 5.52344, 5.58594, 5.64844, 5.71094, 5.77344,
+ (477): 5.83594, 5.89844, 5.96094, 6.02344, 6.08594, 6.14844,
+ (483): 6.21094, 6.27344, 6.33594, 6.39844, 6.46094, 6.52344,
+ (489): 6.58594, 6.64844, 6.71094, 6.77344, 6.83594, 6.89844,
+ (495): 6.96094, 7.02344, 7.08594, 7.14844, 7.21094, 7.27344,
+ (501): 7.33594, 7.39844, 7.46094, 7.52344, 7.58594, 7.64844,
+ (507): 7.71094, 7.77344, 7.83594, 7.89844, 7.96094, 124, 0.09375,
+ (514): 0.15625, 0.21875, 0.28125, 0.34375, 0.40625, 0.46875,
+ (520): 0.53125, 0.59375, 0.65625, 0.71875, 0.78125, 0.84375,
+ (526): 0.90625, 0.96875, 1.03125, 1.09375, 1.15625, 1.21875,
+ (532): 1.28125, 1.34375, 1.40625, 1.46875, 1.53125, 1.59375,
+ (538): 1.65625, 1.71875, 1.78125, 1.84375, 1.90625, 1.96875,
+ (544): 2.03125, 2.09375, 2.15625, 2.21875, 2.28125, 2.34375,
+ (550): 2.40625, 2.46875, 2.53125, 2.59375, 2.65625, 2.71875,
+ (556): 2.78125, 2.84375, 2.90625, 2.96875, 3.03125, 3.09375,
+ (562): 3.15625, 3.21875, 3.28125, 3.34375, 3.40625, 3.46875,
+ (568): 3.53125, 3.59375, 3.65625, 3.71875, 3.78125, 3.84375,
+ (574): 3.90625, 3.96875, 4.03125, 4.09375, 4.15625, 4.21875,
+ (580): 4.28125, 4.34375, 4.40625, 4.46875, 4.53125, 4.59375,
+ (586): 4.65625, 4.71875, 4.78125, 4.84375, 4.90625, 4.96875,
+ (592): 5.03125, 5.09375, 5.15625, 5.21875, 5.28125, 5.34375,
+ (598): 5.40625, 5.46875, 5.53125, 5.59375, 5.65625, 5.71875,
+ (604): 5.78125, 5.84375, 5.90625, 5.96875, 6.03125, 6.09375,
+ (610): 6.15625, 6.21875, 6.28125, 6.34375, 6.40625, 6.46875,
+ (616): 6.53125, 6.59375, 6.65625, 6.71875, 6.78125, 6.84375,
+ (622): 6.90625, 6.96875, 7.03125, 7.09375, 7.15625, 7.21875,
+ (628): 7.28125, 7.34375, 7.40625, 7.46875, 7.53125, 7.59375,
+ (634): 7.65625, 7.71875, 7.78125, 7.84375, 7.90625, 7.96875, 123,
+ (641): 0.101562, 0.164062, 0.226562, 0.289062, 0.351562, 0.414062,
+ (647): 0.476562, 0.539062, 0.601562, 0.664062, 0.726562, 0.789062,
+ (653): 0.851562, 0.914062, 0.976562, 1.03906, 1.10156, 1.16406,
+ (659): 1.22656, 1.28906, 1.35156, 1.41406, 1.47656, 1.53906,
+ (665): 1.60156, 1.66406, 1.72656, 1.78906, 1.85156, 1.91406,
+ (671): 1.97656, 2.03906, 2.10156, 2.16406, 2.22656, 2.28906,
+ (677): 2.35156, 2.41406, 2.47656, 2.53906, 2.60156, 2.66406,
+ (683): 2.72656, 2.78906, 2.85156, 2.91406, 2.97656, 3.03906,
+ (689): 3.10156, 3.16406, 3.22656, 3.28906, 3.35156, 3.41406,
+ (695): 3.47656, 3.53906, 3.60156, 3.66406, 3.72656, 3.78906,
+ (701): 3.85156, 3.91406, 3.97656, 4.03906, 4.10156, 4.16406,
+ (707): 4.22656, 4.28906, 4.35156, 4.41406, 4.47656, 4.53906,
+ (713): 4.60156, 4.66406, 4.72656, 4.78906, 4.85156, 4.91406,
+ (719): 4.97656, 5.03906, 5.10156, 5.16406, 5.22656, 5.28906,
+ (725): 5.35156, 5.41406, 5.47656, 5.53906, 5.60156, 5.66406,
+ (731): 5.72656, 5.78906, 5.85156, 5.91406, 5.97656, 6.03906,
+ (737): 6.10156, 6.16406, 6.22656, 6.28906, 6.35156, 6.41406,
+ (743): 6.47656, 6.53906, 6.60156, 6.66406, 6.72656, 6.78906,
+ (749): 6.85156, 6.91406, 6.97656, 7.03906, 7.10156, 7.16406,
+ (755): 7.22656, 7.28906, 7.35156, 7.41406, 7.47656, 7.53906,
+ (761): 7.60156, 7.66406, 7.72656, 7.78906, 7.85156, 7.91406,
+ (767): 7.97656, 122, 0.109375, 0.171875, 0.234375, 0.296875,
+ (773): 0.359375, 0.421875, 0.484375, 0.546875, 0.609375, 0.671875,
+ (779): 0.734375, 0.796875, 0.859375, 0.921875, 0.984375, 1.04688,
+ (785): 1.10938, 1.17188, 1.23438, 1.29688, 1.35938, 1.42188,
+ (791): 1.48438, 1.54688, 1.60938, 1.67188, 1.73438, 1.79688,
+ (797): 1.85938, 1.92188, 1.98438, 2.04688, 2.10938, 2.17188,
+ (803): 2.23438, 2.29688, 2.35938, 2.42188, 2.48438, 2.54688,
+ (809): 2.60938, 2.67188, 2.73438, 2.79688, 2.85938, 2.92188,
+ (815): 2.98438, 3.04688, 3.10938, 3.17188, 3.23438, 3.29688,
+ (821): 3.35938, 3.42188, 3.48438, 3.54688, 3.60938, 3.67188,
+ (827): 3.73438, 3.79688, 3.85938, 3.92188, 3.98438, 4.04688,
+ (833): 4.10938, 4.17188, 4.23438, 4.29688, 4.35938, 4.42188,
+ (839): 4.48438, 4.54688, 4.60938, 4.67188, 4.73438, 4.79688,
+ (845): 4.85938, 4.92188, 4.98438, 5.04688, 5.10938, 5.17188,
+ (851): 5.23438, 5.29688, 5.35938, 5.42188, 5.48438, 5.54688,
+ (857): 5.60938, 5.67188, 5.73438, 5.79688, 5.85938, 5.92188,
+ (863): 5.98438, 6.04688, 6.10938, 6.17188, 6.23438, 6.29688,
+ (869): 6.35938, 6.42188, 6.48438, 6.54688, 6.60938, 6.67188,
+ (875): 6.73438, 6.79688, 6.85938, 6.92188, 6.98438, 7.04688,
+ (881): 7.10938, 7.17188, 7.23438, 7.29688, 7.35938, 7.42188,
+ (887): 7.48438, 7.54688, 7.60938, 7.67188, 7.73438, 7.79688,
+ (893): 7.85938, 7.92188, 7.98438, 121, 0.117188, 0.179688, 0.242188,
+ (900): 0.304688, 0.367188, 0.429688, 0.492188, 0.554688, 0.617188,
+ (906): 0.679688, 0.742188, 0.804688, 0.867188, 0.929688, 0.992188,
+ (912): 1.05469, 1.11719, 1.17969, 1.24219, 1.30469, 1.36719,
+ (918): 1.42969, 1.49219, 1.55469, 1.61719, 1.67969, 1.74219,
+ (924): 1.80469, 1.86719, 1.92969, 1.99219, 2.05469, 2.11719,
+ (930): 2.17969, 2.24219, 2.30469, 2.36719, 2.42969, 2.49219,
+ (936): 2.55469, 2.61719, 2.67969, 2.74219, 2.80469, 2.86719,
+ (942): 2.92969, 2.99219, 3.05469, 3.11719, 3.17969, 3.24219,
+ (948): 3.30469, 3.36719, 3.42969, 3.49219, 3.55469, 3.61719,
+ (954): 3.67969, 3.74219, 3.80469, 3.86719, 3.92969, 3.99219,
+ (960): 4.05469, 4.11719, 4.17969, 4.24219, 4.30469, 4.36719,
+ (966): 4.42969, 4.49219, 4.55469, 4.61719, 4.67969, 4.74219,
+ (972): 4.80469, 4.86719, 4.92969, 4.99219, 5.05469, 5.11719,
+ (978): 5.17969, 5.24219, 5.30469, 5.36719, 5.42969, 5.49219,
+ (984): 5.55469, 5.61719, 5.67969, 5.74219, 5.80469, 5.86719,
+ (990): 5.92969, 5.99219, 6.05469, 6.11719, 6.17969, 6.24219,
+ (996): 6.30469, 6.36719, 6.42969, 6.49219, 6.55469, 6.61719,
+ (1002): 6.67969, 6.74219, 6.80469, 6.86719, 6.92969, 6.99219,
+ (1008): 7.05469, 7.11719, 7.17969, 7.24219, 7.30469, 7.36719,
+ (1014): 7.42969, 7.49219, 7.55469, 7.61719, 7.67969, 7.74219,
+ (1020): 7.80469, 7.86719, 7.92969, 7.99219
+ }
+ }
+ }
+ DATASET "DS32BITS" {
+ DATATYPE H5T_IEEE_F32LE
+ DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 1024
+ OFFSET 2048
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ (0,0): 32, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3,
+ (0,13): 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5, 5.25, 5.5, 5.75, 6,
+ (0,25): 6.25, 6.5, 6.75, 7, 7.25, 7.5, 7.75,
+ (1,0): 31, 0.28125, 0.53125, 0.78125, 1.03125, 1.28125, 1.53125,
+ (1,7): 1.78125, 2.03125, 2.28125, 2.53125, 2.78125, 3.03125, 3.28125,
+ (1,14): 3.53125, 3.78125, 4.03125, 4.28125, 4.53125, 4.78125, 5.03125,
+ (1,21): 5.28125, 5.53125, 5.78125, 6.03125, 6.28125, 6.53125, 6.78125,
+ (1,28): 7.03125, 7.28125, 7.53125, 7.78125,
+ (2,0): 30, 0.3125, 0.5625, 0.8125, 1.0625, 1.3125, 1.5625, 1.8125,
+ (2,8): 2.0625, 2.3125, 2.5625, 2.8125, 3.0625, 3.3125, 3.5625, 3.8125,
+ (2,16): 4.0625, 4.3125, 4.5625, 4.8125, 5.0625, 5.3125, 5.5625, 5.8125,
+ (2,24): 6.0625, 6.3125, 6.5625, 6.8125, 7.0625, 7.3125, 7.5625, 7.8125,
+ (3,0): 29, 0.34375, 0.59375, 0.84375, 1.09375, 1.34375, 1.59375,
+ (3,7): 1.84375, 2.09375, 2.34375, 2.59375, 2.84375, 3.09375, 3.34375,
+ (3,14): 3.59375, 3.84375, 4.09375, 4.34375, 4.59375, 4.84375, 5.09375,
+ (3,21): 5.34375, 5.59375, 5.84375, 6.09375, 6.34375, 6.59375, 6.84375,
+ (3,28): 7.09375, 7.34375, 7.59375, 7.84375,
+ (4,0): 28, 0.375, 0.625, 0.875, 1.125, 1.375, 1.625, 1.875, 2.125,
+ (4,9): 2.375, 2.625, 2.875, 3.125, 3.375, 3.625, 3.875, 4.125, 4.375,
+ (4,18): 4.625, 4.875, 5.125, 5.375, 5.625, 5.875, 6.125, 6.375, 6.625,
+ (4,27): 6.875, 7.125, 7.375, 7.625, 7.875,
+ (5,0): 27, 0.40625, 0.65625, 0.90625, 1.15625, 1.40625, 1.65625,
+ (5,7): 1.90625, 2.15625, 2.40625, 2.65625, 2.90625, 3.15625, 3.40625,
+ (5,14): 3.65625, 3.90625, 4.15625, 4.40625, 4.65625, 4.90625, 5.15625,
+ (5,21): 5.40625, 5.65625, 5.90625, 6.15625, 6.40625, 6.65625, 6.90625,
+ (5,28): 7.15625, 7.40625, 7.65625, 7.90625,
+ (6,0): 26, 0.4375, 0.6875, 0.9375, 1.1875, 1.4375, 1.6875, 1.9375,
+ (6,8): 2.1875, 2.4375, 2.6875, 2.9375, 3.1875, 3.4375, 3.6875, 3.9375,
+ (6,16): 4.1875, 4.4375, 4.6875, 4.9375, 5.1875, 5.4375, 5.6875, 5.9375,
+ (6,24): 6.1875, 6.4375, 6.6875, 6.9375, 7.1875, 7.4375, 7.6875, 7.9375,
+ (7,0): 25, 0.46875, 0.71875, 0.96875, 1.21875, 1.46875, 1.71875,
+ (7,7): 1.96875, 2.21875, 2.46875, 2.71875, 2.96875, 3.21875, 3.46875,
+ (7,14): 3.71875, 3.96875, 4.21875, 4.46875, 4.71875, 4.96875, 5.21875,
+ (7,21): 5.46875, 5.71875, 5.96875, 6.21875, 6.46875, 6.71875, 6.96875,
+ (7,28): 7.21875, 7.46875, 7.71875, 7.96875
+ }
+ ATTRIBUTE "DS32BITS" {
+ DATATYPE H5T_IEEE_F32LE
+ DATASPACE SIMPLE { ( 256 ) / ( 256 ) }
+ DATA {
+ (0): 32, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3,
+ (13): 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5, 5.25, 5.5, 5.75, 6,
+ (25): 6.25, 6.5, 6.75, 7, 7.25, 7.5, 7.75, 31, 0.28125, 0.53125,
+ (35): 0.78125, 1.03125, 1.28125, 1.53125, 1.78125, 2.03125, 2.28125,
+ (42): 2.53125, 2.78125, 3.03125, 3.28125, 3.53125, 3.78125, 4.03125,
+ (49): 4.28125, 4.53125, 4.78125, 5.03125, 5.28125, 5.53125, 5.78125,
+ (56): 6.03125, 6.28125, 6.53125, 6.78125, 7.03125, 7.28125, 7.53125,
+ (63): 7.78125, 30, 0.3125, 0.5625, 0.8125, 1.0625, 1.3125, 1.5625,
+ (71): 1.8125, 2.0625, 2.3125, 2.5625, 2.8125, 3.0625, 3.3125,
+ (78): 3.5625, 3.8125, 4.0625, 4.3125, 4.5625, 4.8125, 5.0625,
+ (85): 5.3125, 5.5625, 5.8125, 6.0625, 6.3125, 6.5625, 6.8125,
+ (92): 7.0625, 7.3125, 7.5625, 7.8125, 29, 0.34375, 0.59375, 0.84375,
+ (100): 1.09375, 1.34375, 1.59375, 1.84375, 2.09375, 2.34375,
+ (106): 2.59375, 2.84375, 3.09375, 3.34375, 3.59375, 3.84375,
+ (112): 4.09375, 4.34375, 4.59375, 4.84375, 5.09375, 5.34375,
+ (118): 5.59375, 5.84375, 6.09375, 6.34375, 6.59375, 6.84375,
+ (124): 7.09375, 7.34375, 7.59375, 7.84375, 28, 0.375, 0.625, 0.875,
+ (132): 1.125, 1.375, 1.625, 1.875, 2.125, 2.375, 2.625, 2.875,
+ (140): 3.125, 3.375, 3.625, 3.875, 4.125, 4.375, 4.625, 4.875,
+ (148): 5.125, 5.375, 5.625, 5.875, 6.125, 6.375, 6.625, 6.875,
+ (156): 7.125, 7.375, 7.625, 7.875, 27, 0.40625, 0.65625, 0.90625,
+ (164): 1.15625, 1.40625, 1.65625, 1.90625, 2.15625, 2.40625,
+ (170): 2.65625, 2.90625, 3.15625, 3.40625, 3.65625, 3.90625,
+ (176): 4.15625, 4.40625, 4.65625, 4.90625, 5.15625, 5.40625,
+ (182): 5.65625, 5.90625, 6.15625, 6.40625, 6.65625, 6.90625,
+ (188): 7.15625, 7.40625, 7.65625, 7.90625, 26, 0.4375, 0.6875,
+ (195): 0.9375, 1.1875, 1.4375, 1.6875, 1.9375, 2.1875, 2.4375,
+ (202): 2.6875, 2.9375, 3.1875, 3.4375, 3.6875, 3.9375, 4.1875,
+ (209): 4.4375, 4.6875, 4.9375, 5.1875, 5.4375, 5.6875, 5.9375,
+ (216): 6.1875, 6.4375, 6.6875, 6.9375, 7.1875, 7.4375, 7.6875,
+ (223): 7.9375, 25, 0.46875, 0.71875, 0.96875, 1.21875, 1.46875,
+ (230): 1.71875, 1.96875, 2.21875, 2.46875, 2.71875, 2.96875,
+ (236): 3.21875, 3.46875, 3.71875, 3.96875, 4.21875, 4.46875,
+ (242): 4.71875, 4.96875, 5.21875, 5.46875, 5.71875, 5.96875,
+ (248): 6.21875, 6.46875, 6.71875, 6.96875, 7.21875, 7.46875,
+ (254): 7.71875, 7.96875
+ }
+ }
+ }
+ DATASET "DS64BITS" {
+ DATATYPE H5T_IEEE_F64LE
+ DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 4096
+ OFFSET 6144
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ (0,0): 64, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 1.125, 1.25,
+ (0,11): 1.375, 1.5, 1.625, 1.75, 1.875, 2, 2.125, 2.25, 2.375, 2.5,
+ (0,21): 2.625, 2.75, 2.875, 3, 3.125, 3.25, 3.375, 3.5, 3.625, 3.75,
+ (0,31): 3.875, 4, 4.125, 4.25, 4.375, 4.5, 4.625, 4.75, 4.875, 5,
+ (0,41): 5.125, 5.25, 5.375, 5.5, 5.625, 5.75, 5.875, 6, 6.125, 6.25,
+ (0,51): 6.375, 6.5, 6.625, 6.75, 6.875, 7, 7.125, 7.25, 7.375, 7.5,
+ (0,61): 7.625, 7.75, 7.875,
+ (1,0): 63, 0.140625, 0.265625, 0.390625, 0.515625, 0.640625, 0.765625,
+ (1,7): 0.890625, 1.01562, 1.14062, 1.26562, 1.39062, 1.51562, 1.64062,
+ (1,14): 1.76562, 1.89062, 2.01562, 2.14062, 2.26562, 2.39062, 2.51562,
+ (1,21): 2.64062, 2.76562, 2.89062, 3.01562, 3.14062, 3.26562, 3.39062,
+ (1,28): 3.51562, 3.64062, 3.76562, 3.89062, 4.01562, 4.14062, 4.26562,
+ (1,35): 4.39062, 4.51562, 4.64062, 4.76562, 4.89062, 5.01562, 5.14062,
+ (1,42): 5.26562, 5.39062, 5.51562, 5.64062, 5.76562, 5.89062, 6.01562,
+ (1,49): 6.14062, 6.26562, 6.39062, 6.51562, 6.64062, 6.76562, 6.89062,
+ (1,56): 7.01562, 7.14062, 7.26562, 7.39062, 7.51562, 7.64062, 7.76562,
+ (1,63): 7.89062,
+ (2,0): 62, 0.15625, 0.28125, 0.40625, 0.53125, 0.65625, 0.78125,
+ (2,7): 0.90625, 1.03125, 1.15625, 1.28125, 1.40625, 1.53125, 1.65625,
+ (2,14): 1.78125, 1.90625, 2.03125, 2.15625, 2.28125, 2.40625, 2.53125,
+ (2,21): 2.65625, 2.78125, 2.90625, 3.03125, 3.15625, 3.28125, 3.40625,
+ (2,28): 3.53125, 3.65625, 3.78125, 3.90625, 4.03125, 4.15625, 4.28125,
+ (2,35): 4.40625, 4.53125, 4.65625, 4.78125, 4.90625, 5.03125, 5.15625,
+ (2,42): 5.28125, 5.40625, 5.53125, 5.65625, 5.78125, 5.90625, 6.03125,
+ (2,49): 6.15625, 6.28125, 6.40625, 6.53125, 6.65625, 6.78125, 6.90625,
+ (2,56): 7.03125, 7.15625, 7.28125, 7.40625, 7.53125, 7.65625, 7.78125,
+ (2,63): 7.90625,
+ (3,0): 61, 0.171875, 0.296875, 0.421875, 0.546875, 0.671875, 0.796875,
+ (3,7): 0.921875, 1.04688, 1.17188, 1.29688, 1.42188, 1.54688, 1.67188,
+ (3,14): 1.79688, 1.92188, 2.04688, 2.17188, 2.29688, 2.42188, 2.54688,
+ (3,21): 2.67188, 2.79688, 2.92188, 3.04688, 3.17188, 3.29688, 3.42188,
+ (3,28): 3.54688, 3.67188, 3.79688, 3.92188, 4.04688, 4.17188, 4.29688,
+ (3,35): 4.42188, 4.54688, 4.67188, 4.79688, 4.92188, 5.04688, 5.17188,
+ (3,42): 5.29688, 5.42188, 5.54688, 5.67188, 5.79688, 5.92188, 6.04688,
+ (3,49): 6.17188, 6.29688, 6.42188, 6.54688, 6.67188, 6.79688, 6.92188,
+ (3,56): 7.04688, 7.17188, 7.29688, 7.42188, 7.54688, 7.67188, 7.79688,
+ (3,63): 7.92188,
+ (4,0): 60, 0.1875, 0.3125, 0.4375, 0.5625, 0.6875, 0.8125, 0.9375,
+ (4,8): 1.0625, 1.1875, 1.3125, 1.4375, 1.5625, 1.6875, 1.8125, 1.9375,
+ (4,16): 2.0625, 2.1875, 2.3125, 2.4375, 2.5625, 2.6875, 2.8125, 2.9375,
+ (4,24): 3.0625, 3.1875, 3.3125, 3.4375, 3.5625, 3.6875, 3.8125, 3.9375,
+ (4,32): 4.0625, 4.1875, 4.3125, 4.4375, 4.5625, 4.6875, 4.8125, 4.9375,
+ (4,40): 5.0625, 5.1875, 5.3125, 5.4375, 5.5625, 5.6875, 5.8125, 5.9375,
+ (4,48): 6.0625, 6.1875, 6.3125, 6.4375, 6.5625, 6.6875, 6.8125, 6.9375,
+ (4,56): 7.0625, 7.1875, 7.3125, 7.4375, 7.5625, 7.6875, 7.8125, 7.9375,
+ (5,0): 59, 0.203125, 0.328125, 0.453125, 0.578125, 0.703125, 0.828125,
+ (5,7): 0.953125, 1.07812, 1.20312, 1.32812, 1.45312, 1.57812, 1.70312,
+ (5,14): 1.82812, 1.95312, 2.07812, 2.20312, 2.32812, 2.45312, 2.57812,
+ (5,21): 2.70312, 2.82812, 2.95312, 3.07812, 3.20312, 3.32812, 3.45312,
+ (5,28): 3.57812, 3.70312, 3.82812, 3.95312, 4.07812, 4.20312, 4.32812,
+ (5,35): 4.45312, 4.57812, 4.70312, 4.82812, 4.95312, 5.07812, 5.20312,
+ (5,42): 5.32812, 5.45312, 5.57812, 5.70312, 5.82812, 5.95312, 6.07812,
+ (5,49): 6.20312, 6.32812, 6.45312, 6.57812, 6.70312, 6.82812, 6.95312,
+ (5,56): 7.07812, 7.20312, 7.32812, 7.45312, 7.57812, 7.70312, 7.82812,
+ (5,63): 7.95312,
+ (6,0): 58, 0.21875, 0.34375, 0.46875, 0.59375, 0.71875, 0.84375,
+ (6,7): 0.96875, 1.09375, 1.21875, 1.34375, 1.46875, 1.59375, 1.71875,
+ (6,14): 1.84375, 1.96875, 2.09375, 2.21875, 2.34375, 2.46875, 2.59375,
+ (6,21): 2.71875, 2.84375, 2.96875, 3.09375, 3.21875, 3.34375, 3.46875,
+ (6,28): 3.59375, 3.71875, 3.84375, 3.96875, 4.09375, 4.21875, 4.34375,
+ (6,35): 4.46875, 4.59375, 4.71875, 4.84375, 4.96875, 5.09375, 5.21875,
+ (6,42): 5.34375, 5.46875, 5.59375, 5.71875, 5.84375, 5.96875, 6.09375,
+ (6,49): 6.21875, 6.34375, 6.46875, 6.59375, 6.71875, 6.84375, 6.96875,
+ (6,56): 7.09375, 7.21875, 7.34375, 7.46875, 7.59375, 7.71875, 7.84375,
+ (6,63): 7.96875,
+ (7,0): 57, 0.234375, 0.359375, 0.484375, 0.609375, 0.734375, 0.859375,
+ (7,7): 0.984375, 1.10938, 1.23438, 1.35938, 1.48438, 1.60938, 1.73438,
+ (7,14): 1.85938, 1.98438, 2.10938, 2.23438, 2.35938, 2.48438, 2.60938,
+ (7,21): 2.73438, 2.85938, 2.98438, 3.10938, 3.23438, 3.35938, 3.48438,
+ (7,28): 3.60938, 3.73438, 3.85938, 3.98438, 4.10938, 4.23438, 4.35938,
+ (7,35): 4.48438, 4.60938, 4.73438, 4.85938, 4.98438, 5.10938, 5.23438,
+ (7,42): 5.35938, 5.48438, 5.60938, 5.73438, 5.85938, 5.98438, 6.10938,
+ (7,49): 6.23438, 6.35938, 6.48438, 6.60938, 6.73438, 6.85938, 6.98438,
+ (7,56): 7.10938, 7.23438, 7.35938, 7.48438, 7.60938, 7.73438, 7.85938,
+ (7,63): 7.98438
+ }
+ ATTRIBUTE "DS64BITS" {
+ DATATYPE H5T_IEEE_F64LE
+ DATASPACE SIMPLE { ( 512 ) / ( 512 ) }
+ DATA {
+ (0): 64, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 1.125,
+ (10): 1.25, 1.375, 1.5, 1.625, 1.75, 1.875, 2, 2.125, 2.25, 2.375,
+ (20): 2.5, 2.625, 2.75, 2.875, 3, 3.125, 3.25, 3.375, 3.5, 3.625,
+ (30): 3.75, 3.875, 4, 4.125, 4.25, 4.375, 4.5, 4.625, 4.75, 4.875,
+ (40): 5, 5.125, 5.25, 5.375, 5.5, 5.625, 5.75, 5.875, 6, 6.125,
+ (50): 6.25, 6.375, 6.5, 6.625, 6.75, 6.875, 7, 7.125, 7.25, 7.375,
+ (60): 7.5, 7.625, 7.75, 7.875, 63, 0.140625, 0.265625, 0.390625,
+ (68): 0.515625, 0.640625, 0.765625, 0.890625, 1.01562, 1.14062,
+ (74): 1.26562, 1.39062, 1.51562, 1.64062, 1.76562, 1.89062, 2.01562,
+ (81): 2.14062, 2.26562, 2.39062, 2.51562, 2.64062, 2.76562, 2.89062,
+ (88): 3.01562, 3.14062, 3.26562, 3.39062, 3.51562, 3.64062, 3.76562,
+ (95): 3.89062, 4.01562, 4.14062, 4.26562, 4.39062, 4.51562, 4.64062,
+ (102): 4.76562, 4.89062, 5.01562, 5.14062, 5.26562, 5.39062,
+ (108): 5.51562, 5.64062, 5.76562, 5.89062, 6.01562, 6.14062,
+ (114): 6.26562, 6.39062, 6.51562, 6.64062, 6.76562, 6.89062,
+ (120): 7.01562, 7.14062, 7.26562, 7.39062, 7.51562, 7.64062,
+ (126): 7.76562, 7.89062, 62, 0.15625, 0.28125, 0.40625, 0.53125,
+ (133): 0.65625, 0.78125, 0.90625, 1.03125, 1.15625, 1.28125,
+ (139): 1.40625, 1.53125, 1.65625, 1.78125, 1.90625, 2.03125,
+ (145): 2.15625, 2.28125, 2.40625, 2.53125, 2.65625, 2.78125,
+ (151): 2.90625, 3.03125, 3.15625, 3.28125, 3.40625, 3.53125,
+ (157): 3.65625, 3.78125, 3.90625, 4.03125, 4.15625, 4.28125,
+ (163): 4.40625, 4.53125, 4.65625, 4.78125, 4.90625, 5.03125,
+ (169): 5.15625, 5.28125, 5.40625, 5.53125, 5.65625, 5.78125,
+ (175): 5.90625, 6.03125, 6.15625, 6.28125, 6.40625, 6.53125,
+ (181): 6.65625, 6.78125, 6.90625, 7.03125, 7.15625, 7.28125,
+ (187): 7.40625, 7.53125, 7.65625, 7.78125, 7.90625, 61, 0.171875,
+ (194): 0.296875, 0.421875, 0.546875, 0.671875, 0.796875, 0.921875,
+ (200): 1.04688, 1.17188, 1.29688, 1.42188, 1.54688, 1.67188,
+ (206): 1.79688, 1.92188, 2.04688, 2.17188, 2.29688, 2.42188,
+ (212): 2.54688, 2.67188, 2.79688, 2.92188, 3.04688, 3.17188,
+ (218): 3.29688, 3.42188, 3.54688, 3.67188, 3.79688, 3.92188,
+ (224): 4.04688, 4.17188, 4.29688, 4.42188, 4.54688, 4.67188,
+ (230): 4.79688, 4.92188, 5.04688, 5.17188, 5.29688, 5.42188,
+ (236): 5.54688, 5.67188, 5.79688, 5.92188, 6.04688, 6.17188,
+ (242): 6.29688, 6.42188, 6.54688, 6.67188, 6.79688, 6.92188,
+ (248): 7.04688, 7.17188, 7.29688, 7.42188, 7.54688, 7.67188,
+ (254): 7.79688, 7.92188, 60, 0.1875, 0.3125, 0.4375, 0.5625, 0.6875,
+ (262): 0.8125, 0.9375, 1.0625, 1.1875, 1.3125, 1.4375, 1.5625,
+ (269): 1.6875, 1.8125, 1.9375, 2.0625, 2.1875, 2.3125, 2.4375,
+ (276): 2.5625, 2.6875, 2.8125, 2.9375, 3.0625, 3.1875, 3.3125,
+ (283): 3.4375, 3.5625, 3.6875, 3.8125, 3.9375, 4.0625, 4.1875,
+ (290): 4.3125, 4.4375, 4.5625, 4.6875, 4.8125, 4.9375, 5.0625,
+ (297): 5.1875, 5.3125, 5.4375, 5.5625, 5.6875, 5.8125, 5.9375,
+ (304): 6.0625, 6.1875, 6.3125, 6.4375, 6.5625, 6.6875, 6.8125,
+ (311): 6.9375, 7.0625, 7.1875, 7.3125, 7.4375, 7.5625, 7.6875,
+ (318): 7.8125, 7.9375, 59, 0.203125, 0.328125, 0.453125, 0.578125,
+ (325): 0.703125, 0.828125, 0.953125, 1.07812, 1.20312, 1.32812,
+ (331): 1.45312, 1.57812, 1.70312, 1.82812, 1.95312, 2.07812,
+ (337): 2.20312, 2.32812, 2.45312, 2.57812, 2.70312, 2.82812,
+ (343): 2.95312, 3.07812, 3.20312, 3.32812, 3.45312, 3.57812,
+ (349): 3.70312, 3.82812, 3.95312, 4.07812, 4.20312, 4.32812,
+ (355): 4.45312, 4.57812, 4.70312, 4.82812, 4.95312, 5.07812,
+ (361): 5.20312, 5.32812, 5.45312, 5.57812, 5.70312, 5.82812,
+ (367): 5.95312, 6.07812, 6.20312, 6.32812, 6.45312, 6.57812,
+ (373): 6.70312, 6.82812, 6.95312, 7.07812, 7.20312, 7.32812,
+ (379): 7.45312, 7.57812, 7.70312, 7.82812, 7.95312, 58, 0.21875,
+ (386): 0.34375, 0.46875, 0.59375, 0.71875, 0.84375, 0.96875,
+ (392): 1.09375, 1.21875, 1.34375, 1.46875, 1.59375, 1.71875,
+ (398): 1.84375, 1.96875, 2.09375, 2.21875, 2.34375, 2.46875,
+ (404): 2.59375, 2.71875, 2.84375, 2.96875, 3.09375, 3.21875,
+ (410): 3.34375, 3.46875, 3.59375, 3.71875, 3.84375, 3.96875,
+ (416): 4.09375, 4.21875, 4.34375, 4.46875, 4.59375, 4.71875,
+ (422): 4.84375, 4.96875, 5.09375, 5.21875, 5.34375, 5.46875,
+ (428): 5.59375, 5.71875, 5.84375, 5.96875, 6.09375, 6.21875,
+ (434): 6.34375, 6.46875, 6.59375, 6.71875, 6.84375, 6.96875,
+ (440): 7.09375, 7.21875, 7.34375, 7.46875, 7.59375, 7.71875,
+ (446): 7.84375, 7.96875, 57, 0.234375, 0.359375, 0.484375, 0.609375,
+ (453): 0.734375, 0.859375, 0.984375, 1.10938, 1.23438, 1.35938,
+ (459): 1.48438, 1.60938, 1.73438, 1.85938, 1.98438, 2.10938,
+ (465): 2.23438, 2.35938, 2.48438, 2.60938, 2.73438, 2.85938,
+ (471): 2.98438, 3.10938, 3.23438, 3.35938, 3.48438, 3.60938,
+ (477): 3.73438, 3.85938, 3.98438, 4.10938, 4.23438, 4.35938,
+ (483): 4.48438, 4.60938, 4.73438, 4.85938, 4.98438, 5.10938,
+ (489): 5.23438, 5.35938, 5.48438, 5.60938, 5.73438, 5.85938,
+ (495): 5.98438, 6.10938, 6.23438, 6.35938, 6.48438, 6.60938,
+ (501): 6.73438, 6.85938, 6.98438, 7.10938, 7.23438, 7.35938,
+ (507): 7.48438, 7.60938, 7.73438, 7.85938, 7.98438
+ }
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tfloatsattrs.h5 b/tools/testfiles/tfloatsattrs.h5
new file mode 100644
index 0000000..9e73542
--- /dev/null
+++ b/tools/testfiles/tfloatsattrs.h5
Binary files differ
diff --git a/tools/testfiles/tfloatsattrs.wddl b/tools/testfiles/tfloatsattrs.wddl
new file mode 100644
index 0000000..38b735f
--- /dev/null
+++ b/tools/testfiles/tfloatsattrs.wddl
@@ -0,0 +1,621 @@
+HDF5 "tfloatsattrs.h5" {
+GROUP "/" {
+ DATASET "DS128BITS" {
+ DATATYPE 128-bit little-endian floating-point 80-bit precision
+ DATASPACE SIMPLE { ( 8, 128 ) / ( 8, 128 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 16384
+ OFFSET 14416
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ (0,0): 128, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5,
+ (0,9): 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1, 1.0625,
+ (0,18): 1.125, 1.1875, 1.25, 1.3125, 1.375, 1.4375, 1.5, 1.5625, 1.625,
+ (0,27): 1.6875, 1.75, 1.8125, 1.875, 1.9375, 2, 2.0625, 2.125, 2.1875,
+ (0,36): 2.25, 2.3125, 2.375, 2.4375, 2.5, 2.5625, 2.625, 2.6875, 2.75,
+ (0,45): 2.8125, 2.875, 2.9375, 3, 3.0625, 3.125, 3.1875, 3.25, 3.3125,
+ (0,54): 3.375, 3.4375, 3.5, 3.5625, 3.625, 3.6875, 3.75, 3.8125, 3.875,
+ (0,63): 3.9375, 4, 4.0625, 4.125, 4.1875, 4.25, 4.3125, 4.375, 4.4375,
+ (0,72): 4.5, 4.5625, 4.625, 4.6875, 4.75, 4.8125, 4.875, 4.9375, 5,
+ (0,81): 5.0625, 5.125, 5.1875, 5.25, 5.3125, 5.375, 5.4375, 5.5,
+ (0,89): 5.5625, 5.625, 5.6875, 5.75, 5.8125, 5.875, 5.9375, 6, 6.0625,
+ (0,98): 6.125, 6.1875, 6.25, 6.3125, 6.375, 6.4375, 6.5, 6.5625, 6.625,
+ (0,107): 6.6875, 6.75, 6.8125, 6.875, 6.9375, 7, 7.0625, 7.125, 7.1875,
+ (0,116): 7.25, 7.3125, 7.375, 7.4375, 7.5, 7.5625, 7.625, 7.6875, 7.75,
+ (0,125): 7.8125, 7.875, 7.9375,
+ (1,0): 127, 0.0703125, 0.132813, 0.195313, 0.257813, 0.320313,
+ (1,6): 0.382813, 0.445313, 0.507813, 0.570313, 0.632813, 0.695313,
+ (1,12): 0.757813, 0.820313, 0.882813, 0.945313, 1.00781, 1.07031,
+ (1,18): 1.13281, 1.19531, 1.25781, 1.32031, 1.38281, 1.44531, 1.50781,
+ (1,25): 1.57031, 1.63281, 1.69531, 1.75781, 1.82031, 1.88281, 1.94531,
+ (1,32): 2.00781, 2.07031, 2.13281, 2.19531, 2.25781, 2.32031, 2.38281,
+ (1,39): 2.44531, 2.50781, 2.57031, 2.63281, 2.69531, 2.75781, 2.82031,
+ (1,46): 2.88281, 2.94531, 3.00781, 3.07031, 3.13281, 3.19531, 3.25781,
+ (1,53): 3.32031, 3.38281, 3.44531, 3.50781, 3.57031, 3.63281, 3.69531,
+ (1,60): 3.75781, 3.82031, 3.88281, 3.94531, 4.00781, 4.07031, 4.13281,
+ (1,67): 4.19531, 4.25781, 4.32031, 4.38281, 4.44531, 4.50781, 4.57031,
+ (1,74): 4.63281, 4.69531, 4.75781, 4.82031, 4.88281, 4.94531, 5.00781,
+ (1,81): 5.07031, 5.13281, 5.19531, 5.25781, 5.32031, 5.38281, 5.44531,
+ (1,88): 5.50781, 5.57031, 5.63281, 5.69531, 5.75781, 5.82031, 5.88281,
+ (1,95): 5.94531, 6.00781, 6.07031, 6.13281, 6.19531, 6.25781, 6.32031,
+ (1,102): 6.38281, 6.44531, 6.50781, 6.57031, 6.63281, 6.69531, 6.75781,
+ (1,109): 6.82031, 6.88281, 6.94531, 7.00781, 7.07031, 7.13281, 7.19531,
+ (1,116): 7.25781, 7.32031, 7.38281, 7.44531, 7.50781, 7.57031, 7.63281,
+ (1,123): 7.69531, 7.75781, 7.82031, 7.88281, 7.94531,
+ (2,0): 126, 0.078125, 0.140625, 0.203125, 0.265625, 0.328125, 0.390625,
+ (2,7): 0.453125, 0.515625, 0.578125, 0.640625, 0.703125, 0.765625,
+ (2,13): 0.828125, 0.890625, 0.953125, 1.01563, 1.07813, 1.14063,
+ (2,19): 1.20313, 1.26563, 1.32813, 1.39063, 1.45313, 1.51563, 1.57813,
+ (2,26): 1.64063, 1.70313, 1.76563, 1.82813, 1.89063, 1.95313, 2.01563,
+ (2,33): 2.07813, 2.14063, 2.20313, 2.26563, 2.32813, 2.39063, 2.45313,
+ (2,40): 2.51563, 2.57813, 2.64063, 2.70313, 2.76563, 2.82813, 2.89063,
+ (2,47): 2.95313, 3.01563, 3.07813, 3.14063, 3.20313, 3.26563, 3.32813,
+ (2,54): 3.39063, 3.45313, 3.51563, 3.57813, 3.64063, 3.70313, 3.76563,
+ (2,61): 3.82813, 3.89063, 3.95313, 4.01563, 4.07813, 4.14063, 4.20313,
+ (2,68): 4.26563, 4.32813, 4.39063, 4.45313, 4.51563, 4.57813, 4.64063,
+ (2,75): 4.70313, 4.76563, 4.82813, 4.89063, 4.95313, 5.01563, 5.07813,
+ (2,82): 5.14063, 5.20313, 5.26563, 5.32813, 5.39063, 5.45313, 5.51563,
+ (2,89): 5.57813, 5.64063, 5.70313, 5.76563, 5.82813, 5.89063, 5.95313,
+ (2,96): 6.01563, 6.07813, 6.14063, 6.20313, 6.26563, 6.32813, 6.39063,
+ (2,103): 6.45313, 6.51563, 6.57813, 6.64063, 6.70313, 6.76563, 6.82813,
+ (2,110): 6.89063, 6.95313, 7.01563, 7.07813, 7.14063, 7.20313, 7.26563,
+ (2,117): 7.32813, 7.39063, 7.45313, 7.51563, 7.57813, 7.64063, 7.70313,
+ (2,124): 7.76563, 7.82813, 7.89063, 7.95313,
+ (3,0): 125, 0.0859375, 0.148438, 0.210938, 0.273438, 0.335938,
+ (3,6): 0.398438, 0.460938, 0.523438, 0.585938, 0.648438, 0.710938,
+ (3,12): 0.773438, 0.835938, 0.898438, 0.960938, 1.02344, 1.08594,
+ (3,18): 1.14844, 1.21094, 1.27344, 1.33594, 1.39844, 1.46094, 1.52344,
+ (3,25): 1.58594, 1.64844, 1.71094, 1.77344, 1.83594, 1.89844, 1.96094,
+ (3,32): 2.02344, 2.08594, 2.14844, 2.21094, 2.27344, 2.33594, 2.39844,
+ (3,39): 2.46094, 2.52344, 2.58594, 2.64844, 2.71094, 2.77344, 2.83594,
+ (3,46): 2.89844, 2.96094, 3.02344, 3.08594, 3.14844, 3.21094, 3.27344,
+ (3,53): 3.33594, 3.39844, 3.46094, 3.52344, 3.58594, 3.64844, 3.71094,
+ (3,60): 3.77344, 3.83594, 3.89844, 3.96094, 4.02344, 4.08594, 4.14844,
+ (3,67): 4.21094, 4.27344, 4.33594, 4.39844, 4.46094, 4.52344, 4.58594,
+ (3,74): 4.64844, 4.71094, 4.77344, 4.83594, 4.89844, 4.96094, 5.02344,
+ (3,81): 5.08594, 5.14844, 5.21094, 5.27344, 5.33594, 5.39844, 5.46094,
+ (3,88): 5.52344, 5.58594, 5.64844, 5.71094, 5.77344, 5.83594, 5.89844,
+ (3,95): 5.96094, 6.02344, 6.08594, 6.14844, 6.21094, 6.27344, 6.33594,
+ (3,102): 6.39844, 6.46094, 6.52344, 6.58594, 6.64844, 6.71094, 6.77344,
+ (3,109): 6.83594, 6.89844, 6.96094, 7.02344, 7.08594, 7.14844, 7.21094,
+ (3,116): 7.27344, 7.33594, 7.39844, 7.46094, 7.52344, 7.58594, 7.64844,
+ (3,123): 7.71094, 7.77344, 7.83594, 7.89844, 7.96094,
+ (4,0): 124, 0.09375, 0.15625, 0.21875, 0.28125, 0.34375, 0.40625,
+ (4,7): 0.46875, 0.53125, 0.59375, 0.65625, 0.71875, 0.78125, 0.84375,
+ (4,14): 0.90625, 0.96875, 1.03125, 1.09375, 1.15625, 1.21875, 1.28125,
+ (4,21): 1.34375, 1.40625, 1.46875, 1.53125, 1.59375, 1.65625, 1.71875,
+ (4,28): 1.78125, 1.84375, 1.90625, 1.96875, 2.03125, 2.09375, 2.15625,
+ (4,35): 2.21875, 2.28125, 2.34375, 2.40625, 2.46875, 2.53125, 2.59375,
+ (4,42): 2.65625, 2.71875, 2.78125, 2.84375, 2.90625, 2.96875, 3.03125,
+ (4,49): 3.09375, 3.15625, 3.21875, 3.28125, 3.34375, 3.40625, 3.46875,
+ (4,56): 3.53125, 3.59375, 3.65625, 3.71875, 3.78125, 3.84375, 3.90625,
+ (4,63): 3.96875, 4.03125, 4.09375, 4.15625, 4.21875, 4.28125, 4.34375,
+ (4,70): 4.40625, 4.46875, 4.53125, 4.59375, 4.65625, 4.71875, 4.78125,
+ (4,77): 4.84375, 4.90625, 4.96875, 5.03125, 5.09375, 5.15625, 5.21875,
+ (4,84): 5.28125, 5.34375, 5.40625, 5.46875, 5.53125, 5.59375, 5.65625,
+ (4,91): 5.71875, 5.78125, 5.84375, 5.90625, 5.96875, 6.03125, 6.09375,
+ (4,98): 6.15625, 6.21875, 6.28125, 6.34375, 6.40625, 6.46875, 6.53125,
+ (4,105): 6.59375, 6.65625, 6.71875, 6.78125, 6.84375, 6.90625, 6.96875,
+ (4,112): 7.03125, 7.09375, 7.15625, 7.21875, 7.28125, 7.34375, 7.40625,
+ (4,119): 7.46875, 7.53125, 7.59375, 7.65625, 7.71875, 7.78125, 7.84375,
+ (4,126): 7.90625, 7.96875,
+ (5,0): 123, 0.101563, 0.164063, 0.226563, 0.289063, 0.351563, 0.414063,
+ (5,7): 0.476563, 0.539063, 0.601563, 0.664063, 0.726563, 0.789063,
+ (5,13): 0.851563, 0.914063, 0.976563, 1.03906, 1.10156, 1.16406,
+ (5,19): 1.22656, 1.28906, 1.35156, 1.41406, 1.47656, 1.53906, 1.60156,
+ (5,26): 1.66406, 1.72656, 1.78906, 1.85156, 1.91406, 1.97656, 2.03906,
+ (5,33): 2.10156, 2.16406, 2.22656, 2.28906, 2.35156, 2.41406, 2.47656,
+ (5,40): 2.53906, 2.60156, 2.66406, 2.72656, 2.78906, 2.85156, 2.91406,
+ (5,47): 2.97656, 3.03906, 3.10156, 3.16406, 3.22656, 3.28906, 3.35156,
+ (5,54): 3.41406, 3.47656, 3.53906, 3.60156, 3.66406, 3.72656, 3.78906,
+ (5,61): 3.85156, 3.91406, 3.97656, 4.03906, 4.10156, 4.16406, 4.22656,
+ (5,68): 4.28906, 4.35156, 4.41406, 4.47656, 4.53906, 4.60156, 4.66406,
+ (5,75): 4.72656, 4.78906, 4.85156, 4.91406, 4.97656, 5.03906, 5.10156,
+ (5,82): 5.16406, 5.22656, 5.28906, 5.35156, 5.41406, 5.47656, 5.53906,
+ (5,89): 5.60156, 5.66406, 5.72656, 5.78906, 5.85156, 5.91406, 5.97656,
+ (5,96): 6.03906, 6.10156, 6.16406, 6.22656, 6.28906, 6.35156, 6.41406,
+ (5,103): 6.47656, 6.53906, 6.60156, 6.66406, 6.72656, 6.78906, 6.85156,
+ (5,110): 6.91406, 6.97656, 7.03906, 7.10156, 7.16406, 7.22656, 7.28906,
+ (5,117): 7.35156, 7.41406, 7.47656, 7.53906, 7.60156, 7.66406, 7.72656,
+ (5,124): 7.78906, 7.85156, 7.91406, 7.97656,
+ (6,0): 122, 0.109375, 0.171875, 0.234375, 0.296875, 0.359375, 0.421875,
+ (6,7): 0.484375, 0.546875, 0.609375, 0.671875, 0.734375, 0.796875,
+ (6,13): 0.859375, 0.921875, 0.984375, 1.04688, 1.10938, 1.17188,
+ (6,19): 1.23438, 1.29688, 1.35938, 1.42188, 1.48438, 1.54688, 1.60938,
+ (6,26): 1.67188, 1.73438, 1.79688, 1.85938, 1.92188, 1.98438, 2.04688,
+ (6,33): 2.10938, 2.17188, 2.23438, 2.29688, 2.35938, 2.42188, 2.48438,
+ (6,40): 2.54688, 2.60938, 2.67188, 2.73438, 2.79688, 2.85938, 2.92188,
+ (6,47): 2.98438, 3.04688, 3.10938, 3.17188, 3.23438, 3.29688, 3.35938,
+ (6,54): 3.42188, 3.48438, 3.54688, 3.60938, 3.67188, 3.73438, 3.79688,
+ (6,61): 3.85938, 3.92188, 3.98438, 4.04688, 4.10938, 4.17188, 4.23438,
+ (6,68): 4.29688, 4.35938, 4.42188, 4.48438, 4.54688, 4.60938, 4.67188,
+ (6,75): 4.73438, 4.79688, 4.85938, 4.92188, 4.98438, 5.04688, 5.10938,
+ (6,82): 5.17188, 5.23438, 5.29688, 5.35938, 5.42188, 5.48438, 5.54688,
+ (6,89): 5.60938, 5.67188, 5.73438, 5.79688, 5.85938, 5.92188, 5.98438,
+ (6,96): 6.04688, 6.10938, 6.17188, 6.23438, 6.29688, 6.35938, 6.42188,
+ (6,103): 6.48438, 6.54688, 6.60938, 6.67188, 6.73438, 6.79688, 6.85938,
+ (6,110): 6.92188, 6.98438, 7.04688, 7.10938, 7.17188, 7.23438, 7.29688,
+ (6,117): 7.35938, 7.42188, 7.48438, 7.54688, 7.60938, 7.67188, 7.73438,
+ (6,124): 7.79688, 7.85938, 7.92188, 7.98438,
+ (7,0): 121, 0.117188, 0.179688, 0.242188, 0.304688, 0.367188, 0.429688,
+ (7,7): 0.492188, 0.554688, 0.617188, 0.679688, 0.742188, 0.804688,
+ (7,13): 0.867188, 0.929688, 0.992188, 1.05469, 1.11719, 1.17969,
+ (7,19): 1.24219, 1.30469, 1.36719, 1.42969, 1.49219, 1.55469, 1.61719,
+ (7,26): 1.67969, 1.74219, 1.80469, 1.86719, 1.92969, 1.99219, 2.05469,
+ (7,33): 2.11719, 2.17969, 2.24219, 2.30469, 2.36719, 2.42969, 2.49219,
+ (7,40): 2.55469, 2.61719, 2.67969, 2.74219, 2.80469, 2.86719, 2.92969,
+ (7,47): 2.99219, 3.05469, 3.11719, 3.17969, 3.24219, 3.30469, 3.36719,
+ (7,54): 3.42969, 3.49219, 3.55469, 3.61719, 3.67969, 3.74219, 3.80469,
+ (7,61): 3.86719, 3.92969, 3.99219, 4.05469, 4.11719, 4.17969, 4.24219,
+ (7,68): 4.30469, 4.36719, 4.42969, 4.49219, 4.55469, 4.61719, 4.67969,
+ (7,75): 4.74219, 4.80469, 4.86719, 4.92969, 4.99219, 5.05469, 5.11719,
+ (7,82): 5.17969, 5.24219, 5.30469, 5.36719, 5.42969, 5.49219, 5.55469,
+ (7,89): 5.61719, 5.67969, 5.74219, 5.80469, 5.86719, 5.92969, 5.99219,
+ (7,96): 6.05469, 6.11719, 6.17969, 6.24219, 6.30469, 6.36719, 6.42969,
+ (7,103): 6.49219, 6.55469, 6.61719, 6.67969, 6.74219, 6.80469, 6.86719,
+ (7,110): 6.92969, 6.99219, 7.05469, 7.11719, 7.17969, 7.24219, 7.30469,
+ (7,117): 7.36719, 7.42969, 7.49219, 7.55469, 7.61719, 7.67969, 7.74219,
+ (7,124): 7.80469, 7.86719, 7.92969, 7.99219
+ }
+ ATTRIBUTE "DS128BITS" {
+ DATATYPE 128-bit little-endian floating-point 80-bit precision
+ DATASPACE SIMPLE { ( 1024 ) / ( 1024 ) }
+ DATA {
+ (0): 128, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5,
+ (9): 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1, 1.0625,
+ (18): 1.125, 1.1875, 1.25, 1.3125, 1.375, 1.4375, 1.5, 1.5625,
+ (26): 1.625, 1.6875, 1.75, 1.8125, 1.875, 1.9375, 2, 2.0625, 2.125,
+ (35): 2.1875, 2.25, 2.3125, 2.375, 2.4375, 2.5, 2.5625, 2.625,
+ (43): 2.6875, 2.75, 2.8125, 2.875, 2.9375, 3, 3.0625, 3.125, 3.1875,
+ (52): 3.25, 3.3125, 3.375, 3.4375, 3.5, 3.5625, 3.625, 3.6875, 3.75,
+ (61): 3.8125, 3.875, 3.9375, 4, 4.0625, 4.125, 4.1875, 4.25, 4.3125,
+ (70): 4.375, 4.4375, 4.5, 4.5625, 4.625, 4.6875, 4.75, 4.8125,
+ (78): 4.875, 4.9375, 5, 5.0625, 5.125, 5.1875, 5.25, 5.3125, 5.375,
+ (87): 5.4375, 5.5, 5.5625, 5.625, 5.6875, 5.75, 5.8125, 5.875,
+ (95): 5.9375, 6, 6.0625, 6.125, 6.1875, 6.25, 6.3125, 6.375, 6.4375,
+ (104): 6.5, 6.5625, 6.625, 6.6875, 6.75, 6.8125, 6.875, 6.9375, 7,
+ (113): 7.0625, 7.125, 7.1875, 7.25, 7.3125, 7.375, 7.4375, 7.5,
+ (121): 7.5625, 7.625, 7.6875, 7.75, 7.8125, 7.875, 7.9375, 127,
+ (129): 0.0703125, 0.132813, 0.195313, 0.257813, 0.320313, 0.382813,
+ (135): 0.445313, 0.507813, 0.570313, 0.632813, 0.695313, 0.757813,
+ (141): 0.820313, 0.882813, 0.945313, 1.00781, 1.07031, 1.13281,
+ (147): 1.19531, 1.25781, 1.32031, 1.38281, 1.44531, 1.50781,
+ (153): 1.57031, 1.63281, 1.69531, 1.75781, 1.82031, 1.88281,
+ (159): 1.94531, 2.00781, 2.07031, 2.13281, 2.19531, 2.25781,
+ (165): 2.32031, 2.38281, 2.44531, 2.50781, 2.57031, 2.63281,
+ (171): 2.69531, 2.75781, 2.82031, 2.88281, 2.94531, 3.00781,
+ (177): 3.07031, 3.13281, 3.19531, 3.25781, 3.32031, 3.38281,
+ (183): 3.44531, 3.50781, 3.57031, 3.63281, 3.69531, 3.75781,
+ (189): 3.82031, 3.88281, 3.94531, 4.00781, 4.07031, 4.13281,
+ (195): 4.19531, 4.25781, 4.32031, 4.38281, 4.44531, 4.50781,
+ (201): 4.57031, 4.63281, 4.69531, 4.75781, 4.82031, 4.88281,
+ (207): 4.94531, 5.00781, 5.07031, 5.13281, 5.19531, 5.25781,
+ (213): 5.32031, 5.38281, 5.44531, 5.50781, 5.57031, 5.63281,
+ (219): 5.69531, 5.75781, 5.82031, 5.88281, 5.94531, 6.00781,
+ (225): 6.07031, 6.13281, 6.19531, 6.25781, 6.32031, 6.38281,
+ (231): 6.44531, 6.50781, 6.57031, 6.63281, 6.69531, 6.75781,
+ (237): 6.82031, 6.88281, 6.94531, 7.00781, 7.07031, 7.13281,
+ (243): 7.19531, 7.25781, 7.32031, 7.38281, 7.44531, 7.50781,
+ (249): 7.57031, 7.63281, 7.69531, 7.75781, 7.82031, 7.88281,
+ (255): 7.94531, 126, 0.078125, 0.140625, 0.203125, 0.265625,
+ (261): 0.328125, 0.390625, 0.453125, 0.515625, 0.578125, 0.640625,
+ (267): 0.703125, 0.765625, 0.828125, 0.890625, 0.953125, 1.01563,
+ (273): 1.07813, 1.14063, 1.20313, 1.26563, 1.32813, 1.39063,
+ (279): 1.45313, 1.51563, 1.57813, 1.64063, 1.70313, 1.76563,
+ (285): 1.82813, 1.89063, 1.95313, 2.01563, 2.07813, 2.14063,
+ (291): 2.20313, 2.26563, 2.32813, 2.39063, 2.45313, 2.51563,
+ (297): 2.57813, 2.64063, 2.70313, 2.76563, 2.82813, 2.89063,
+ (303): 2.95313, 3.01563, 3.07813, 3.14063, 3.20313, 3.26563,
+ (309): 3.32813, 3.39063, 3.45313, 3.51563, 3.57813, 3.64063,
+ (315): 3.70313, 3.76563, 3.82813, 3.89063, 3.95313, 4.01563,
+ (321): 4.07813, 4.14063, 4.20313, 4.26563, 4.32813, 4.39063,
+ (327): 4.45313, 4.51563, 4.57813, 4.64063, 4.70313, 4.76563,
+ (333): 4.82813, 4.89063, 4.95313, 5.01563, 5.07813, 5.14063,
+ (339): 5.20313, 5.26563, 5.32813, 5.39063, 5.45313, 5.51563,
+ (345): 5.57813, 5.64063, 5.70313, 5.76563, 5.82813, 5.89063,
+ (351): 5.95313, 6.01563, 6.07813, 6.14063, 6.20313, 6.26563,
+ (357): 6.32813, 6.39063, 6.45313, 6.51563, 6.57813, 6.64063,
+ (363): 6.70313, 6.76563, 6.82813, 6.89063, 6.95313, 7.01563,
+ (369): 7.07813, 7.14063, 7.20313, 7.26563, 7.32813, 7.39063,
+ (375): 7.45313, 7.51563, 7.57813, 7.64063, 7.70313, 7.76563,
+ (381): 7.82813, 7.89063, 7.95313, 125, 0.0859375, 0.148438,
+ (387): 0.210938, 0.273438, 0.335938, 0.398438, 0.460938, 0.523438,
+ (393): 0.585938, 0.648438, 0.710938, 0.773438, 0.835938, 0.898438,
+ (399): 0.960938, 1.02344, 1.08594, 1.14844, 1.21094, 1.27344,
+ (405): 1.33594, 1.39844, 1.46094, 1.52344, 1.58594, 1.64844,
+ (411): 1.71094, 1.77344, 1.83594, 1.89844, 1.96094, 2.02344,
+ (417): 2.08594, 2.14844, 2.21094, 2.27344, 2.33594, 2.39844,
+ (423): 2.46094, 2.52344, 2.58594, 2.64844, 2.71094, 2.77344,
+ (429): 2.83594, 2.89844, 2.96094, 3.02344, 3.08594, 3.14844,
+ (435): 3.21094, 3.27344, 3.33594, 3.39844, 3.46094, 3.52344,
+ (441): 3.58594, 3.64844, 3.71094, 3.77344, 3.83594, 3.89844,
+ (447): 3.96094, 4.02344, 4.08594, 4.14844, 4.21094, 4.27344,
+ (453): 4.33594, 4.39844, 4.46094, 4.52344, 4.58594, 4.64844,
+ (459): 4.71094, 4.77344, 4.83594, 4.89844, 4.96094, 5.02344,
+ (465): 5.08594, 5.14844, 5.21094, 5.27344, 5.33594, 5.39844,
+ (471): 5.46094, 5.52344, 5.58594, 5.64844, 5.71094, 5.77344,
+ (477): 5.83594, 5.89844, 5.96094, 6.02344, 6.08594, 6.14844,
+ (483): 6.21094, 6.27344, 6.33594, 6.39844, 6.46094, 6.52344,
+ (489): 6.58594, 6.64844, 6.71094, 6.77344, 6.83594, 6.89844,
+ (495): 6.96094, 7.02344, 7.08594, 7.14844, 7.21094, 7.27344,
+ (501): 7.33594, 7.39844, 7.46094, 7.52344, 7.58594, 7.64844,
+ (507): 7.71094, 7.77344, 7.83594, 7.89844, 7.96094, 124, 0.09375,
+ (514): 0.15625, 0.21875, 0.28125, 0.34375, 0.40625, 0.46875,
+ (520): 0.53125, 0.59375, 0.65625, 0.71875, 0.78125, 0.84375,
+ (526): 0.90625, 0.96875, 1.03125, 1.09375, 1.15625, 1.21875,
+ (532): 1.28125, 1.34375, 1.40625, 1.46875, 1.53125, 1.59375,
+ (538): 1.65625, 1.71875, 1.78125, 1.84375, 1.90625, 1.96875,
+ (544): 2.03125, 2.09375, 2.15625, 2.21875, 2.28125, 2.34375,
+ (550): 2.40625, 2.46875, 2.53125, 2.59375, 2.65625, 2.71875,
+ (556): 2.78125, 2.84375, 2.90625, 2.96875, 3.03125, 3.09375,
+ (562): 3.15625, 3.21875, 3.28125, 3.34375, 3.40625, 3.46875,
+ (568): 3.53125, 3.59375, 3.65625, 3.71875, 3.78125, 3.84375,
+ (574): 3.90625, 3.96875, 4.03125, 4.09375, 4.15625, 4.21875,
+ (580): 4.28125, 4.34375, 4.40625, 4.46875, 4.53125, 4.59375,
+ (586): 4.65625, 4.71875, 4.78125, 4.84375, 4.90625, 4.96875,
+ (592): 5.03125, 5.09375, 5.15625, 5.21875, 5.28125, 5.34375,
+ (598): 5.40625, 5.46875, 5.53125, 5.59375, 5.65625, 5.71875,
+ (604): 5.78125, 5.84375, 5.90625, 5.96875, 6.03125, 6.09375,
+ (610): 6.15625, 6.21875, 6.28125, 6.34375, 6.40625, 6.46875,
+ (616): 6.53125, 6.59375, 6.65625, 6.71875, 6.78125, 6.84375,
+ (622): 6.90625, 6.96875, 7.03125, 7.09375, 7.15625, 7.21875,
+ (628): 7.28125, 7.34375, 7.40625, 7.46875, 7.53125, 7.59375,
+ (634): 7.65625, 7.71875, 7.78125, 7.84375, 7.90625, 7.96875, 123,
+ (641): 0.101563, 0.164063, 0.226563, 0.289063, 0.351563, 0.414063,
+ (647): 0.476563, 0.539063, 0.601563, 0.664063, 0.726563, 0.789063,
+ (653): 0.851563, 0.914063, 0.976563, 1.03906, 1.10156, 1.16406,
+ (659): 1.22656, 1.28906, 1.35156, 1.41406, 1.47656, 1.53906,
+ (665): 1.60156, 1.66406, 1.72656, 1.78906, 1.85156, 1.91406,
+ (671): 1.97656, 2.03906, 2.10156, 2.16406, 2.22656, 2.28906,
+ (677): 2.35156, 2.41406, 2.47656, 2.53906, 2.60156, 2.66406,
+ (683): 2.72656, 2.78906, 2.85156, 2.91406, 2.97656, 3.03906,
+ (689): 3.10156, 3.16406, 3.22656, 3.28906, 3.35156, 3.41406,
+ (695): 3.47656, 3.53906, 3.60156, 3.66406, 3.72656, 3.78906,
+ (701): 3.85156, 3.91406, 3.97656, 4.03906, 4.10156, 4.16406,
+ (707): 4.22656, 4.28906, 4.35156, 4.41406, 4.47656, 4.53906,
+ (713): 4.60156, 4.66406, 4.72656, 4.78906, 4.85156, 4.91406,
+ (719): 4.97656, 5.03906, 5.10156, 5.16406, 5.22656, 5.28906,
+ (725): 5.35156, 5.41406, 5.47656, 5.53906, 5.60156, 5.66406,
+ (731): 5.72656, 5.78906, 5.85156, 5.91406, 5.97656, 6.03906,
+ (737): 6.10156, 6.16406, 6.22656, 6.28906, 6.35156, 6.41406,
+ (743): 6.47656, 6.53906, 6.60156, 6.66406, 6.72656, 6.78906,
+ (749): 6.85156, 6.91406, 6.97656, 7.03906, 7.10156, 7.16406,
+ (755): 7.22656, 7.28906, 7.35156, 7.41406, 7.47656, 7.53906,
+ (761): 7.60156, 7.66406, 7.72656, 7.78906, 7.85156, 7.91406,
+ (767): 7.97656, 122, 0.109375, 0.171875, 0.234375, 0.296875,
+ (773): 0.359375, 0.421875, 0.484375, 0.546875, 0.609375, 0.671875,
+ (779): 0.734375, 0.796875, 0.859375, 0.921875, 0.984375, 1.04688,
+ (785): 1.10938, 1.17188, 1.23438, 1.29688, 1.35938, 1.42188,
+ (791): 1.48438, 1.54688, 1.60938, 1.67188, 1.73438, 1.79688,
+ (797): 1.85938, 1.92188, 1.98438, 2.04688, 2.10938, 2.17188,
+ (803): 2.23438, 2.29688, 2.35938, 2.42188, 2.48438, 2.54688,
+ (809): 2.60938, 2.67188, 2.73438, 2.79688, 2.85938, 2.92188,
+ (815): 2.98438, 3.04688, 3.10938, 3.17188, 3.23438, 3.29688,
+ (821): 3.35938, 3.42188, 3.48438, 3.54688, 3.60938, 3.67188,
+ (827): 3.73438, 3.79688, 3.85938, 3.92188, 3.98438, 4.04688,
+ (833): 4.10938, 4.17188, 4.23438, 4.29688, 4.35938, 4.42188,
+ (839): 4.48438, 4.54688, 4.60938, 4.67188, 4.73438, 4.79688,
+ (845): 4.85938, 4.92188, 4.98438, 5.04688, 5.10938, 5.17188,
+ (851): 5.23438, 5.29688, 5.35938, 5.42188, 5.48438, 5.54688,
+ (857): 5.60938, 5.67188, 5.73438, 5.79688, 5.85938, 5.92188,
+ (863): 5.98438, 6.04688, 6.10938, 6.17188, 6.23438, 6.29688,
+ (869): 6.35938, 6.42188, 6.48438, 6.54688, 6.60938, 6.67188,
+ (875): 6.73438, 6.79688, 6.85938, 6.92188, 6.98438, 7.04688,
+ (881): 7.10938, 7.17188, 7.23438, 7.29688, 7.35938, 7.42188,
+ (887): 7.48438, 7.54688, 7.60938, 7.67188, 7.73438, 7.79688,
+ (893): 7.85938, 7.92188, 7.98438, 121, 0.117188, 0.179688, 0.242188,
+ (900): 0.304688, 0.367188, 0.429688, 0.492188, 0.554688, 0.617188,
+ (906): 0.679688, 0.742188, 0.804688, 0.867188, 0.929688, 0.992188,
+ (912): 1.05469, 1.11719, 1.17969, 1.24219, 1.30469, 1.36719,
+ (918): 1.42969, 1.49219, 1.55469, 1.61719, 1.67969, 1.74219,
+ (924): 1.80469, 1.86719, 1.92969, 1.99219, 2.05469, 2.11719,
+ (930): 2.17969, 2.24219, 2.30469, 2.36719, 2.42969, 2.49219,
+ (936): 2.55469, 2.61719, 2.67969, 2.74219, 2.80469, 2.86719,
+ (942): 2.92969, 2.99219, 3.05469, 3.11719, 3.17969, 3.24219,
+ (948): 3.30469, 3.36719, 3.42969, 3.49219, 3.55469, 3.61719,
+ (954): 3.67969, 3.74219, 3.80469, 3.86719, 3.92969, 3.99219,
+ (960): 4.05469, 4.11719, 4.17969, 4.24219, 4.30469, 4.36719,
+ (966): 4.42969, 4.49219, 4.55469, 4.61719, 4.67969, 4.74219,
+ (972): 4.80469, 4.86719, 4.92969, 4.99219, 5.05469, 5.11719,
+ (978): 5.17969, 5.24219, 5.30469, 5.36719, 5.42969, 5.49219,
+ (984): 5.55469, 5.61719, 5.67969, 5.74219, 5.80469, 5.86719,
+ (990): 5.92969, 5.99219, 6.05469, 6.11719, 6.17969, 6.24219,
+ (996): 6.30469, 6.36719, 6.42969, 6.49219, 6.55469, 6.61719,
+ (1002): 6.67969, 6.74219, 6.80469, 6.86719, 6.92969, 6.99219,
+ (1008): 7.05469, 7.11719, 7.17969, 7.24219, 7.30469, 7.36719,
+ (1014): 7.42969, 7.49219, 7.55469, 7.61719, 7.67969, 7.74219,
+ (1020): 7.80469, 7.86719, 7.92969, 7.99219
+ }
+ }
+ }
+ DATASET "DS32BITS" {
+ DATATYPE H5T_IEEE_F32LE
+ DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 1024
+ OFFSET 2048
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ (0,0): 32, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3,
+ (0,13): 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5, 5.25, 5.5, 5.75, 6,
+ (0,25): 6.25, 6.5, 6.75, 7, 7.25, 7.5, 7.75,
+ (1,0): 31, 0.28125, 0.53125, 0.78125, 1.03125, 1.28125, 1.53125,
+ (1,7): 1.78125, 2.03125, 2.28125, 2.53125, 2.78125, 3.03125, 3.28125,
+ (1,14): 3.53125, 3.78125, 4.03125, 4.28125, 4.53125, 4.78125, 5.03125,
+ (1,21): 5.28125, 5.53125, 5.78125, 6.03125, 6.28125, 6.53125, 6.78125,
+ (1,28): 7.03125, 7.28125, 7.53125, 7.78125,
+ (2,0): 30, 0.3125, 0.5625, 0.8125, 1.0625, 1.3125, 1.5625, 1.8125,
+ (2,8): 2.0625, 2.3125, 2.5625, 2.8125, 3.0625, 3.3125, 3.5625, 3.8125,
+ (2,16): 4.0625, 4.3125, 4.5625, 4.8125, 5.0625, 5.3125, 5.5625, 5.8125,
+ (2,24): 6.0625, 6.3125, 6.5625, 6.8125, 7.0625, 7.3125, 7.5625, 7.8125,
+ (3,0): 29, 0.34375, 0.59375, 0.84375, 1.09375, 1.34375, 1.59375,
+ (3,7): 1.84375, 2.09375, 2.34375, 2.59375, 2.84375, 3.09375, 3.34375,
+ (3,14): 3.59375, 3.84375, 4.09375, 4.34375, 4.59375, 4.84375, 5.09375,
+ (3,21): 5.34375, 5.59375, 5.84375, 6.09375, 6.34375, 6.59375, 6.84375,
+ (3,28): 7.09375, 7.34375, 7.59375, 7.84375,
+ (4,0): 28, 0.375, 0.625, 0.875, 1.125, 1.375, 1.625, 1.875, 2.125,
+ (4,9): 2.375, 2.625, 2.875, 3.125, 3.375, 3.625, 3.875, 4.125, 4.375,
+ (4,18): 4.625, 4.875, 5.125, 5.375, 5.625, 5.875, 6.125, 6.375, 6.625,
+ (4,27): 6.875, 7.125, 7.375, 7.625, 7.875,
+ (5,0): 27, 0.40625, 0.65625, 0.90625, 1.15625, 1.40625, 1.65625,
+ (5,7): 1.90625, 2.15625, 2.40625, 2.65625, 2.90625, 3.15625, 3.40625,
+ (5,14): 3.65625, 3.90625, 4.15625, 4.40625, 4.65625, 4.90625, 5.15625,
+ (5,21): 5.40625, 5.65625, 5.90625, 6.15625, 6.40625, 6.65625, 6.90625,
+ (5,28): 7.15625, 7.40625, 7.65625, 7.90625,
+ (6,0): 26, 0.4375, 0.6875, 0.9375, 1.1875, 1.4375, 1.6875, 1.9375,
+ (6,8): 2.1875, 2.4375, 2.6875, 2.9375, 3.1875, 3.4375, 3.6875, 3.9375,
+ (6,16): 4.1875, 4.4375, 4.6875, 4.9375, 5.1875, 5.4375, 5.6875, 5.9375,
+ (6,24): 6.1875, 6.4375, 6.6875, 6.9375, 7.1875, 7.4375, 7.6875, 7.9375,
+ (7,0): 25, 0.46875, 0.71875, 0.96875, 1.21875, 1.46875, 1.71875,
+ (7,7): 1.96875, 2.21875, 2.46875, 2.71875, 2.96875, 3.21875, 3.46875,
+ (7,14): 3.71875, 3.96875, 4.21875, 4.46875, 4.71875, 4.96875, 5.21875,
+ (7,21): 5.46875, 5.71875, 5.96875, 6.21875, 6.46875, 6.71875, 6.96875,
+ (7,28): 7.21875, 7.46875, 7.71875, 7.96875
+ }
+ ATTRIBUTE "DS32BITS" {
+ DATATYPE H5T_IEEE_F32LE
+ DATASPACE SIMPLE { ( 256 ) / ( 256 ) }
+ DATA {
+ (0): 32, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3,
+ (13): 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5, 5.25, 5.5, 5.75, 6,
+ (25): 6.25, 6.5, 6.75, 7, 7.25, 7.5, 7.75, 31, 0.28125, 0.53125,
+ (35): 0.78125, 1.03125, 1.28125, 1.53125, 1.78125, 2.03125, 2.28125,
+ (42): 2.53125, 2.78125, 3.03125, 3.28125, 3.53125, 3.78125, 4.03125,
+ (49): 4.28125, 4.53125, 4.78125, 5.03125, 5.28125, 5.53125, 5.78125,
+ (56): 6.03125, 6.28125, 6.53125, 6.78125, 7.03125, 7.28125, 7.53125,
+ (63): 7.78125, 30, 0.3125, 0.5625, 0.8125, 1.0625, 1.3125, 1.5625,
+ (71): 1.8125, 2.0625, 2.3125, 2.5625, 2.8125, 3.0625, 3.3125,
+ (78): 3.5625, 3.8125, 4.0625, 4.3125, 4.5625, 4.8125, 5.0625,
+ (85): 5.3125, 5.5625, 5.8125, 6.0625, 6.3125, 6.5625, 6.8125,
+ (92): 7.0625, 7.3125, 7.5625, 7.8125, 29, 0.34375, 0.59375, 0.84375,
+ (100): 1.09375, 1.34375, 1.59375, 1.84375, 2.09375, 2.34375,
+ (106): 2.59375, 2.84375, 3.09375, 3.34375, 3.59375, 3.84375,
+ (112): 4.09375, 4.34375, 4.59375, 4.84375, 5.09375, 5.34375,
+ (118): 5.59375, 5.84375, 6.09375, 6.34375, 6.59375, 6.84375,
+ (124): 7.09375, 7.34375, 7.59375, 7.84375, 28, 0.375, 0.625, 0.875,
+ (132): 1.125, 1.375, 1.625, 1.875, 2.125, 2.375, 2.625, 2.875,
+ (140): 3.125, 3.375, 3.625, 3.875, 4.125, 4.375, 4.625, 4.875,
+ (148): 5.125, 5.375, 5.625, 5.875, 6.125, 6.375, 6.625, 6.875,
+ (156): 7.125, 7.375, 7.625, 7.875, 27, 0.40625, 0.65625, 0.90625,
+ (164): 1.15625, 1.40625, 1.65625, 1.90625, 2.15625, 2.40625,
+ (170): 2.65625, 2.90625, 3.15625, 3.40625, 3.65625, 3.90625,
+ (176): 4.15625, 4.40625, 4.65625, 4.90625, 5.15625, 5.40625,
+ (182): 5.65625, 5.90625, 6.15625, 6.40625, 6.65625, 6.90625,
+ (188): 7.15625, 7.40625, 7.65625, 7.90625, 26, 0.4375, 0.6875,
+ (195): 0.9375, 1.1875, 1.4375, 1.6875, 1.9375, 2.1875, 2.4375,
+ (202): 2.6875, 2.9375, 3.1875, 3.4375, 3.6875, 3.9375, 4.1875,
+ (209): 4.4375, 4.6875, 4.9375, 5.1875, 5.4375, 5.6875, 5.9375,
+ (216): 6.1875, 6.4375, 6.6875, 6.9375, 7.1875, 7.4375, 7.6875,
+ (223): 7.9375, 25, 0.46875, 0.71875, 0.96875, 1.21875, 1.46875,
+ (230): 1.71875, 1.96875, 2.21875, 2.46875, 2.71875, 2.96875,
+ (236): 3.21875, 3.46875, 3.71875, 3.96875, 4.21875, 4.46875,
+ (242): 4.71875, 4.96875, 5.21875, 5.46875, 5.71875, 5.96875,
+ (248): 6.21875, 6.46875, 6.71875, 6.96875, 7.21875, 7.46875,
+ (254): 7.71875, 7.96875
+ }
+ }
+ }
+ DATASET "DS64BITS" {
+ DATATYPE H5T_IEEE_F64LE
+ DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) }
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 4096
+ OFFSET 6144
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ (0,0): 64, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 1.125, 1.25,
+ (0,11): 1.375, 1.5, 1.625, 1.75, 1.875, 2, 2.125, 2.25, 2.375, 2.5,
+ (0,21): 2.625, 2.75, 2.875, 3, 3.125, 3.25, 3.375, 3.5, 3.625, 3.75,
+ (0,31): 3.875, 4, 4.125, 4.25, 4.375, 4.5, 4.625, 4.75, 4.875, 5,
+ (0,41): 5.125, 5.25, 5.375, 5.5, 5.625, 5.75, 5.875, 6, 6.125, 6.25,
+ (0,51): 6.375, 6.5, 6.625, 6.75, 6.875, 7, 7.125, 7.25, 7.375, 7.5,
+ (0,61): 7.625, 7.75, 7.875,
+ (1,0): 63, 0.140625, 0.265625, 0.390625, 0.515625, 0.640625, 0.765625,
+ (1,7): 0.890625, 1.01563, 1.14063, 1.26563, 1.39063, 1.51563, 1.64063,
+ (1,14): 1.76563, 1.89063, 2.01563, 2.14063, 2.26563, 2.39063, 2.51563,
+ (1,21): 2.64063, 2.76563, 2.89063, 3.01563, 3.14063, 3.26563, 3.39063,
+ (1,28): 3.51563, 3.64063, 3.76563, 3.89063, 4.01563, 4.14063, 4.26563,
+ (1,35): 4.39063, 4.51563, 4.64063, 4.76563, 4.89063, 5.01563, 5.14063,
+ (1,42): 5.26563, 5.39063, 5.51563, 5.64063, 5.76563, 5.89063, 6.01563,
+ (1,49): 6.14063, 6.26563, 6.39063, 6.51563, 6.64063, 6.76563, 6.89063,
+ (1,56): 7.01563, 7.14063, 7.26563, 7.39063, 7.51563, 7.64063, 7.76563,
+ (1,63): 7.89063,
+ (2,0): 62, 0.15625, 0.28125, 0.40625, 0.53125, 0.65625, 0.78125,
+ (2,7): 0.90625, 1.03125, 1.15625, 1.28125, 1.40625, 1.53125, 1.65625,
+ (2,14): 1.78125, 1.90625, 2.03125, 2.15625, 2.28125, 2.40625, 2.53125,
+ (2,21): 2.65625, 2.78125, 2.90625, 3.03125, 3.15625, 3.28125, 3.40625,
+ (2,28): 3.53125, 3.65625, 3.78125, 3.90625, 4.03125, 4.15625, 4.28125,
+ (2,35): 4.40625, 4.53125, 4.65625, 4.78125, 4.90625, 5.03125, 5.15625,
+ (2,42): 5.28125, 5.40625, 5.53125, 5.65625, 5.78125, 5.90625, 6.03125,
+ (2,49): 6.15625, 6.28125, 6.40625, 6.53125, 6.65625, 6.78125, 6.90625,
+ (2,56): 7.03125, 7.15625, 7.28125, 7.40625, 7.53125, 7.65625, 7.78125,
+ (2,63): 7.90625,
+ (3,0): 61, 0.171875, 0.296875, 0.421875, 0.546875, 0.671875, 0.796875,
+ (3,7): 0.921875, 1.04688, 1.17188, 1.29688, 1.42188, 1.54688, 1.67188,
+ (3,14): 1.79688, 1.92188, 2.04688, 2.17188, 2.29688, 2.42188, 2.54688,
+ (3,21): 2.67188, 2.79688, 2.92188, 3.04688, 3.17188, 3.29688, 3.42188,
+ (3,28): 3.54688, 3.67188, 3.79688, 3.92188, 4.04688, 4.17188, 4.29688,
+ (3,35): 4.42188, 4.54688, 4.67188, 4.79688, 4.92188, 5.04688, 5.17188,
+ (3,42): 5.29688, 5.42188, 5.54688, 5.67188, 5.79688, 5.92188, 6.04688,
+ (3,49): 6.17188, 6.29688, 6.42188, 6.54688, 6.67188, 6.79688, 6.92188,
+ (3,56): 7.04688, 7.17188, 7.29688, 7.42188, 7.54688, 7.67188, 7.79688,
+ (3,63): 7.92188,
+ (4,0): 60, 0.1875, 0.3125, 0.4375, 0.5625, 0.6875, 0.8125, 0.9375,
+ (4,8): 1.0625, 1.1875, 1.3125, 1.4375, 1.5625, 1.6875, 1.8125, 1.9375,
+ (4,16): 2.0625, 2.1875, 2.3125, 2.4375, 2.5625, 2.6875, 2.8125, 2.9375,
+ (4,24): 3.0625, 3.1875, 3.3125, 3.4375, 3.5625, 3.6875, 3.8125, 3.9375,
+ (4,32): 4.0625, 4.1875, 4.3125, 4.4375, 4.5625, 4.6875, 4.8125, 4.9375,
+ (4,40): 5.0625, 5.1875, 5.3125, 5.4375, 5.5625, 5.6875, 5.8125, 5.9375,
+ (4,48): 6.0625, 6.1875, 6.3125, 6.4375, 6.5625, 6.6875, 6.8125, 6.9375,
+ (4,56): 7.0625, 7.1875, 7.3125, 7.4375, 7.5625, 7.6875, 7.8125, 7.9375,
+ (5,0): 59, 0.203125, 0.328125, 0.453125, 0.578125, 0.703125, 0.828125,
+ (5,7): 0.953125, 1.07813, 1.20313, 1.32813, 1.45313, 1.57813, 1.70313,
+ (5,14): 1.82813, 1.95313, 2.07813, 2.20313, 2.32813, 2.45313, 2.57813,
+ (5,21): 2.70313, 2.82813, 2.95313, 3.07813, 3.20313, 3.32813, 3.45313,
+ (5,28): 3.57813, 3.70313, 3.82813, 3.95313, 4.07813, 4.20313, 4.32813,
+ (5,35): 4.45313, 4.57813, 4.70313, 4.82813, 4.95313, 5.07813, 5.20313,
+ (5,42): 5.32813, 5.45313, 5.57813, 5.70313, 5.82813, 5.95313, 6.07813,
+ (5,49): 6.20313, 6.32813, 6.45313, 6.57813, 6.70313, 6.82813, 6.95313,
+ (5,56): 7.07813, 7.20313, 7.32813, 7.45313, 7.57813, 7.70313, 7.82813,
+ (5,63): 7.95313,
+ (6,0): 58, 0.21875, 0.34375, 0.46875, 0.59375, 0.71875, 0.84375,
+ (6,7): 0.96875, 1.09375, 1.21875, 1.34375, 1.46875, 1.59375, 1.71875,
+ (6,14): 1.84375, 1.96875, 2.09375, 2.21875, 2.34375, 2.46875, 2.59375,
+ (6,21): 2.71875, 2.84375, 2.96875, 3.09375, 3.21875, 3.34375, 3.46875,
+ (6,28): 3.59375, 3.71875, 3.84375, 3.96875, 4.09375, 4.21875, 4.34375,
+ (6,35): 4.46875, 4.59375, 4.71875, 4.84375, 4.96875, 5.09375, 5.21875,
+ (6,42): 5.34375, 5.46875, 5.59375, 5.71875, 5.84375, 5.96875, 6.09375,
+ (6,49): 6.21875, 6.34375, 6.46875, 6.59375, 6.71875, 6.84375, 6.96875,
+ (6,56): 7.09375, 7.21875, 7.34375, 7.46875, 7.59375, 7.71875, 7.84375,
+ (6,63): 7.96875,
+ (7,0): 57, 0.234375, 0.359375, 0.484375, 0.609375, 0.734375, 0.859375,
+ (7,7): 0.984375, 1.10938, 1.23438, 1.35938, 1.48438, 1.60938, 1.73438,
+ (7,14): 1.85938, 1.98438, 2.10938, 2.23438, 2.35938, 2.48438, 2.60938,
+ (7,21): 2.73438, 2.85938, 2.98438, 3.10938, 3.23438, 3.35938, 3.48438,
+ (7,28): 3.60938, 3.73438, 3.85938, 3.98438, 4.10938, 4.23438, 4.35938,
+ (7,35): 4.48438, 4.60938, 4.73438, 4.85938, 4.98438, 5.10938, 5.23438,
+ (7,42): 5.35938, 5.48438, 5.60938, 5.73438, 5.85938, 5.98438, 6.10938,
+ (7,49): 6.23438, 6.35938, 6.48438, 6.60938, 6.73438, 6.85938, 6.98438,
+ (7,56): 7.10938, 7.23438, 7.35938, 7.48438, 7.60938, 7.73438, 7.85938,
+ (7,63): 7.98438
+ }
+ ATTRIBUTE "DS64BITS" {
+ DATATYPE H5T_IEEE_F64LE
+ DATASPACE SIMPLE { ( 512 ) / ( 512 ) }
+ DATA {
+ (0): 64, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1, 1.125,
+ (10): 1.25, 1.375, 1.5, 1.625, 1.75, 1.875, 2, 2.125, 2.25, 2.375,
+ (20): 2.5, 2.625, 2.75, 2.875, 3, 3.125, 3.25, 3.375, 3.5, 3.625,
+ (30): 3.75, 3.875, 4, 4.125, 4.25, 4.375, 4.5, 4.625, 4.75, 4.875,
+ (40): 5, 5.125, 5.25, 5.375, 5.5, 5.625, 5.75, 5.875, 6, 6.125,
+ (50): 6.25, 6.375, 6.5, 6.625, 6.75, 6.875, 7, 7.125, 7.25, 7.375,
+ (60): 7.5, 7.625, 7.75, 7.875, 63, 0.140625, 0.265625, 0.390625,
+ (68): 0.515625, 0.640625, 0.765625, 0.890625, 1.01563, 1.14063,
+ (74): 1.26563, 1.39063, 1.51563, 1.64063, 1.76563, 1.89063, 2.01563,
+ (81): 2.14063, 2.26563, 2.39063, 2.51563, 2.64063, 2.76563, 2.89063,
+ (88): 3.01563, 3.14063, 3.26563, 3.39063, 3.51563, 3.64063, 3.76563,
+ (95): 3.89063, 4.01563, 4.14063, 4.26563, 4.39063, 4.51563, 4.64063,
+ (102): 4.76563, 4.89063, 5.01563, 5.14063, 5.26563, 5.39063,
+ (108): 5.51563, 5.64063, 5.76563, 5.89063, 6.01563, 6.14063,
+ (114): 6.26563, 6.39063, 6.51563, 6.64063, 6.76563, 6.89063,
+ (120): 7.01563, 7.14063, 7.26563, 7.39063, 7.51563, 7.64063,
+ (126): 7.76563, 7.89063, 62, 0.15625, 0.28125, 0.40625, 0.53125,
+ (133): 0.65625, 0.78125, 0.90625, 1.03125, 1.15625, 1.28125,
+ (139): 1.40625, 1.53125, 1.65625, 1.78125, 1.90625, 2.03125,
+ (145): 2.15625, 2.28125, 2.40625, 2.53125, 2.65625, 2.78125,
+ (151): 2.90625, 3.03125, 3.15625, 3.28125, 3.40625, 3.53125,
+ (157): 3.65625, 3.78125, 3.90625, 4.03125, 4.15625, 4.28125,
+ (163): 4.40625, 4.53125, 4.65625, 4.78125, 4.90625, 5.03125,
+ (169): 5.15625, 5.28125, 5.40625, 5.53125, 5.65625, 5.78125,
+ (175): 5.90625, 6.03125, 6.15625, 6.28125, 6.40625, 6.53125,
+ (181): 6.65625, 6.78125, 6.90625, 7.03125, 7.15625, 7.28125,
+ (187): 7.40625, 7.53125, 7.65625, 7.78125, 7.90625, 61, 0.171875,
+ (194): 0.296875, 0.421875, 0.546875, 0.671875, 0.796875, 0.921875,
+ (200): 1.04688, 1.17188, 1.29688, 1.42188, 1.54688, 1.67188,
+ (206): 1.79688, 1.92188, 2.04688, 2.17188, 2.29688, 2.42188,
+ (212): 2.54688, 2.67188, 2.79688, 2.92188, 3.04688, 3.17188,
+ (218): 3.29688, 3.42188, 3.54688, 3.67188, 3.79688, 3.92188,
+ (224): 4.04688, 4.17188, 4.29688, 4.42188, 4.54688, 4.67188,
+ (230): 4.79688, 4.92188, 5.04688, 5.17188, 5.29688, 5.42188,
+ (236): 5.54688, 5.67188, 5.79688, 5.92188, 6.04688, 6.17188,
+ (242): 6.29688, 6.42188, 6.54688, 6.67188, 6.79688, 6.92188,
+ (248): 7.04688, 7.17188, 7.29688, 7.42188, 7.54688, 7.67188,
+ (254): 7.79688, 7.92188, 60, 0.1875, 0.3125, 0.4375, 0.5625, 0.6875,
+ (262): 0.8125, 0.9375, 1.0625, 1.1875, 1.3125, 1.4375, 1.5625,
+ (269): 1.6875, 1.8125, 1.9375, 2.0625, 2.1875, 2.3125, 2.4375,
+ (276): 2.5625, 2.6875, 2.8125, 2.9375, 3.0625, 3.1875, 3.3125,
+ (283): 3.4375, 3.5625, 3.6875, 3.8125, 3.9375, 4.0625, 4.1875,
+ (290): 4.3125, 4.4375, 4.5625, 4.6875, 4.8125, 4.9375, 5.0625,
+ (297): 5.1875, 5.3125, 5.4375, 5.5625, 5.6875, 5.8125, 5.9375,
+ (304): 6.0625, 6.1875, 6.3125, 6.4375, 6.5625, 6.6875, 6.8125,
+ (311): 6.9375, 7.0625, 7.1875, 7.3125, 7.4375, 7.5625, 7.6875,
+ (318): 7.8125, 7.9375, 59, 0.203125, 0.328125, 0.453125, 0.578125,
+ (325): 0.703125, 0.828125, 0.953125, 1.07813, 1.20313, 1.32813,
+ (331): 1.45313, 1.57813, 1.70313, 1.82813, 1.95313, 2.07813,
+ (337): 2.20313, 2.32813, 2.45313, 2.57813, 2.70313, 2.82813,
+ (343): 2.95313, 3.07813, 3.20313, 3.32813, 3.45313, 3.57813,
+ (349): 3.70313, 3.82813, 3.95313, 4.07813, 4.20313, 4.32813,
+ (355): 4.45313, 4.57813, 4.70313, 4.82813, 4.95313, 5.07813,
+ (361): 5.20313, 5.32813, 5.45313, 5.57813, 5.70313, 5.82813,
+ (367): 5.95313, 6.07813, 6.20313, 6.32813, 6.45313, 6.57813,
+ (373): 6.70313, 6.82813, 6.95313, 7.07813, 7.20313, 7.32813,
+ (379): 7.45313, 7.57813, 7.70313, 7.82813, 7.95313, 58, 0.21875,
+ (386): 0.34375, 0.46875, 0.59375, 0.71875, 0.84375, 0.96875,
+ (392): 1.09375, 1.21875, 1.34375, 1.46875, 1.59375, 1.71875,
+ (398): 1.84375, 1.96875, 2.09375, 2.21875, 2.34375, 2.46875,
+ (404): 2.59375, 2.71875, 2.84375, 2.96875, 3.09375, 3.21875,
+ (410): 3.34375, 3.46875, 3.59375, 3.71875, 3.84375, 3.96875,
+ (416): 4.09375, 4.21875, 4.34375, 4.46875, 4.59375, 4.71875,
+ (422): 4.84375, 4.96875, 5.09375, 5.21875, 5.34375, 5.46875,
+ (428): 5.59375, 5.71875, 5.84375, 5.96875, 6.09375, 6.21875,
+ (434): 6.34375, 6.46875, 6.59375, 6.71875, 6.84375, 6.96875,
+ (440): 7.09375, 7.21875, 7.34375, 7.46875, 7.59375, 7.71875,
+ (446): 7.84375, 7.96875, 57, 0.234375, 0.359375, 0.484375, 0.609375,
+ (453): 0.734375, 0.859375, 0.984375, 1.10938, 1.23438, 1.35938,
+ (459): 1.48438, 1.60938, 1.73438, 1.85938, 1.98438, 2.10938,
+ (465): 2.23438, 2.35938, 2.48438, 2.60938, 2.73438, 2.85938,
+ (471): 2.98438, 3.10938, 3.23438, 3.35938, 3.48438, 3.60938,
+ (477): 3.73438, 3.85938, 3.98438, 4.10938, 4.23438, 4.35938,
+ (483): 4.48438, 4.60938, 4.73438, 4.85938, 4.98438, 5.10938,
+ (489): 5.23438, 5.35938, 5.48438, 5.60938, 5.73438, 5.85938,
+ (495): 5.98438, 6.10938, 6.23438, 6.35938, 6.48438, 6.60938,
+ (501): 6.73438, 6.85938, 6.98438, 7.10938, 7.23438, 7.35938,
+ (507): 7.48438, 7.60938, 7.73438, 7.85938, 7.98438
+ }
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tldouble.ddl b/tools/testfiles/tldouble.ddl
index c032ef3..2fed523 100644
--- a/tools/testfiles/tldouble.ddl
+++ b/tools/testfiles/tldouble.ddl
@@ -1,7 +1,7 @@
HDF5 "tldouble.h5" {
GROUP "/" {
DATASET "dset" {
- DATATYPE H5T_NATIVE_LDOUBLE
+ DATATYPE 128-bit little-endian floating-point 80-bit precision
DATASPACE SIMPLE { ( 3 ) / ( 3 ) }
DATA {
(0): 1, 2, 3
diff --git a/tools/testfiles/tldouble_scalar.ddl b/tools/testfiles/tldouble_scalar.ddl
new file mode 100755
index 0000000..596d8db
--- /dev/null
+++ b/tools/testfiles/tldouble_scalar.ddl
@@ -0,0 +1,26 @@
+HDF5 "tldouble_scalar.h5" {
+GROUP "/" {
+ DATASET "dset" {
+ DATATYPE H5T_ARRAY { [6] 128-bit little-endian floating-point 80-bit precision }
+ DATASPACE SCALAR
+ STORAGE_LAYOUT {
+ CONTIGUOUS
+ SIZE 96
+ OFFSET 2048
+ }
+ FILTERS {
+ NONE
+ }
+ FILLVALUE {
+ FILL_TIME H5D_FILL_TIME_IFSET
+ VALUE H5D_FILL_VALUE_DEFAULT
+ }
+ ALLOCATION_TIME {
+ H5D_ALLOC_TIME_LATE
+ }
+ DATA {
+ (0): [ 0, 1, 2, 3, 4, 5 ]
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tldouble_scalar.h5 b/tools/testfiles/tldouble_scalar.h5
new file mode 100644
index 0000000..0344ea0
--- /dev/null
+++ b/tools/testfiles/tldouble_scalar.h5
Binary files differ
diff --git a/tools/testfiles/tnbit.ddl b/tools/testfiles/tnbit.ddl
index fd5d1cf..cf2ac1f 100644
--- a/tools/testfiles/tnbit.ddl
+++ b/tools/testfiles/tnbit.ddl
@@ -1,6 +1,6 @@
HDF5 "tfilters.h5" {
DATASET "nbit" {
- DATATYPE 32-bit little-endian integer
+ DATATYPE 32-bit little-endian integer 3-bit precision
DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) }
STORAGE_LAYOUT {
CHUNKED ( 10, 5 )
diff --git a/tools/testfiles/treadintfilter.ddl b/tools/testfiles/treadintfilter.ddl
index a2269a6b..fbad3f6 100644
--- a/tools/testfiles/treadintfilter.ddl
+++ b/tools/testfiles/treadintfilter.ddl
@@ -78,7 +78,7 @@ DATASET "fletcher32" {
}
}
DATASET "nbit" {
- DATATYPE 32-bit little-endian integer
+ DATATYPE 32-bit little-endian integer 3-bit precision
DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) }
DATA {
(0,0): 0, 1, 2, 3, -4, -3, -2, -1, 0, 1,
diff --git a/utils/COPYING b/utils/COPYING
deleted file mode 100644
index 9cec22f..0000000
--- a/utils/COPYING
+++ /dev/null
@@ -1,12 +0,0 @@
-
- Copyright by The HDF Group.
- All rights reserved.
-
- The files and subdirectories in this directory are part of HDF5.
- The full HDF5 copyright notice, including terms governing use,
- modification, and redistribution, is contained in the COPYING file
- which can be found at the root of the source code distribution tree
- or in https://www.hdfgroup.org/licenses. If you do
- not have access to either file, you may request a copy from
- help@hdfgroup.org.
-
diff --git a/utils/mirror_vfd/mirror_writer.c b/utils/mirror_vfd/mirror_writer.c
index 8171abe..d3f12de 100644
--- a/utils/mirror_vfd/mirror_writer.c
+++ b/utils/mirror_vfd/mirror_writer.c
@@ -591,7 +591,10 @@ do_open(struct mirror_session *session, const H5FD_mirror_xmit_open_t *xmit_open
error:
if (fapl_id > 0) {
- H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); }
+ H5E_BEGIN_TRY
+ {
+ (void)H5Pclose(fapl_id);
+ }
H5E_END_TRY;
}
return -1;